Skip to content

Commit

Permalink
Adjusted behavior of leaving mod id blank
Browse files Browse the repository at this point in the history
  • Loading branch information
thommcgrath committed May 31, 2024
1 parent 3640de9 commit 57aeb35
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions Project/Modules/Beacon/ContentPack.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ Protected Class ContentPack

#tag Method, Flags = &h0
Shared Function GenerateLocalContentPackId(Marketplace As String, MarketplaceId As String) As String
If Marketplace.IsEmpty Or MarketplaceId.IsEmpty Then
Return Beacon.UUID.v4
End If

Return Beacon.UUID.v5("Local " + Marketplace + ": " + MarketplaceId).StringValue
End Function
#tag EndMethod
Expand Down
10 changes: 7 additions & 3 deletions Project/Views/ArkSA/Mods/ArkSARegisterModDialog.xojo_window
Original file line number Diff line number Diff line change
Expand Up @@ -1350,8 +1350,8 @@ End
#tag Event
Sub Pressed()
Self.mModId = Beacon.UUID.v4
Self.mCurseForgeId = System.Random.InRange(1000000, 9999999)
Self.mCurseForgeSlug = Beacon.GenerateRandomKey()
Self.mCurseForgeId = 0
Self.mCurseForgeSlug = ""
Self.ShowNamePage("")
End Sub
#tag EndEvent
Expand Down Expand Up @@ -1425,7 +1425,11 @@ End
Var Pack As Beacon.ContentPack
If Self.mMode = Self.ModeLocal Then
Var Database As ArkSA.DataSource = ArkSA.DataSource.Pool.Get(True)
Var ContentPack As Beacon.ContentPack = Database.CreateLocalContentPack(Self.mModName, Self.mCurseForgeId.ToString(Locale.Raw, "0"), True)
Var MarketplaceId As String
If Self.mCurseForgeId > 0 Then
MarketplaceId = Self.mCurseForgeId.ToString(Locale.Raw, "0")
End If
Var ContentPack As Beacon.ContentPack = Database.CreateLocalContentPack(Self.mModName, MarketplaceId, True)
ModId = ContentPack.ContentPackId
Pack = ContentPack
Else
Expand Down

0 comments on commit 57aeb35

Please sign in to comment.