Skip to content

Commit

Permalink
Merge branch '2.3'
Browse files Browse the repository at this point in the history
  • Loading branch information
thommcgrath committed Jul 30, 2024
2 parents 0af677e + ec432db commit 5aac4c0
Show file tree
Hide file tree
Showing 322 changed files with 10,998 additions and 1,601 deletions.
286 changes: 286 additions & 0 deletions Artwork/Toolbar Icons/Renew.ai

Large diffs are not rendered by default.

Binary file added Icons/IconToolbarRenew.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Icons/[email protected]
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions Project/App.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ Implements NotificationKit.Receiver,Beacon.Application
For Each Source As Beacon.DataSource In Sources
Source.EmptyCaches()
Next
BeaconUI.ShowAlert("Caches have been emptied. It is recommended to reload any open projects.", "Opening a project loads the caches with data that may not be stored in your local database. Reloading your projects after emptying caches will improve reliability.")
BeaconUI.ShowAlert("Caches have been emptied.", "Hopefully that fixes your issue.")
Return True
End Function
#tag EndMenuHandler
Expand Down Expand Up @@ -1539,7 +1539,17 @@ Implements NotificationKit.Receiver,Beacon.Application
Private Sub Pusher_CloudUpdated(ChannelName As String, EventName As String, Payload As String)
#Pragma Unused ChannelName
#Pragma Unused EventName
#Pragma Unused Payload

Try
Var Json As JSONItem = New JSONItem(Payload)
If Json.HasKey("deviceId") And Json.Value("deviceId").IsNull = False And Json.Value("deviceId").Type = Variant.TypeString And Beacon.HardwareId = Json.Value("deviceId") Then
// Message was sent from this device
Return
End If
Catch Err As RuntimeException
App.Log(Err, CurrentMethodName, "Parsing cloud update event")
Return
End Try

// Even though the server is telling us changes were made, wait just in case
UserCloud.Sync(False)
Expand Down
21 changes: 15 additions & 6 deletions Project/Beacon.xojo_project
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,7 @@ Class=ArkSASettingsListElement;Views/ArkSA/Config Editors/General Settings/ArkSA
DesktopWindow=ArkSASettingsListStringElement;Views/ArkSA/Config Editors/General Settings/ArkSASettingsListStringElement.xojo_window;&h00000000704077FF;&h000000005ED247FF;false
DesktopWindow=ArkSASettingsListNumberElement;Views/ArkSA/Config Editors/General Settings/ArkSASettingsListNumberElement.xojo_window;&h000000004791D7FF;&h000000005ED247FF;false
DesktopWindow=ArkSASettingsListBooleanElement;Views/ArkSA/Config Editors/General Settings/ArkSASettingsListBooleanElement.xojo_window;&h0000000065B8AFFF;&h000000005ED247FF;false
DesktopWindow=ArkSASetupTransferrableElementDialog;Views/ArkSA/Config Editors/Crafting Costs/ArkSASetupTransferrableElementDialog.xojo_window;&h0000000060F5DFFF;&h000000004C7377FF;false
DesktopWindow=ArkSASetupTransferableElementDialog;Views/ArkSA/Config Editors/Crafting Costs/ArkSASetupTransferableElementDialog.xojo_window;&h0000000060F5DFFF;&h000000004C7377FF;false
DesktopWindow=ArkSASettingsListHeader;Views/ArkSA/Config Editors/General Settings/ArkSASettingsListHeader.xojo_window;&h0000000008A73FFF;&h000000005ED247FF;false
DesktopWindow=IdentityDecryptDialog;Views/Identity Window/IdentityDecryptDialog.xojo_window;&h000000002C33E7FF;&h000000005A59DFFF;false
DesktopWindow=IdentityView;Views/Identity Window/IdentityView.xojo_window;&h000000005C2BA7FF;&h000000005A59DFFF;false
Expand All @@ -467,7 +467,7 @@ Class=ResizedSearchField;Modules/UITweaks/ResizedSearchField.xojo_code;&h0000000
Class=TimingTracker;Classes/TimingTracker.xojo_code;&h000000005463FFFF;&h00000000056D5FFF;false
DesktopWindow=DocumentVersionListWindow;Views/Main Window Components/Documents/DocumentVersionListWindow.xojo_window;&h0000000010679FFF;&h000000005E2867FF;false
Class=IntegrationTransfer;Modules/Beacon/IntegrationTransfer.xojo_code;&h00000000028C9FFF;&h0000000055ADDFFF;false
DesktopWindow=ArkSetupTransferrableElementDialog;Views/Ark/Config Editors/Crafting Costs/ArkSetupTransferrableElementDialog.xojo_window;&h0000000063BA87FF;&h00000000068D0FFF;false
DesktopWindow=ArkSetupTransferableElementDialog;Views/Ark/Config Editors/Crafting Costs/ArkSetupTransferableElementDialog.xojo_window;&h0000000063BA87FF;&h00000000068D0FFF;false
Class=NewsItem;Data Model/NewsItem.xojo_code;&h0000000014D48FFF;&h000000007CAFFFFF;false
DesktopWindow=ArkEngramControlSettingsView;Views/Ark/Config Editors/Engram Control/ArkEngramControlSettingsView.xojo_window;&h0000000074525FFF;&h0000000045FF37FF;false
DesktopWindow=ArkSpoilTimersEditor;Views/Ark/Config Editors/Decay and Spoil/ArkSpoilTimersEditor.xojo_window;&h000000001E4C97FF;&h000000001D543FFF;false
Expand Down Expand Up @@ -952,15 +952,24 @@ DesktopWindow=ArkSASpawnWeightsEditor;Views/ArkSA/Config Editors/Creature Spawns
Class=DinoSpawnWeightMultiplier;Modules/Game Support/ArkSA/DinoSpawnWeightMultiplier.xojo_code;&h000000002788CFFF;&h000000004504AFFF;false
Class=MutableDinoSpawnWeightMultiplier;Modules/Game Support/ArkSA/MutableDinoSpawnWeightMultiplier.xojo_code;&h000000002E1AC7FF;&h000000004504AFFF;false
DesktopWindow=ArkSANameTagDialog;Views/ArkSA/Config Editors/Creature Spawns/ArkSANameTagDialog.xojo_window;&h000000001C89B7FF;&h00000000272977FF;false
Class=ModDiscoveryEngine2;Modules/Game Support/ArkSA/ModDiscoveryEngine2.xojo_code;&h00000000068FC7FF;&h000000004504AFFF;false
Class=ModDownload;Modules/Game Support/ArkSA/ModDownload.xojo_code;&h000000001C36CFFF;&h000000004504AFFF;false
Module=CurseForge;Modules/CurseForge.xojo_code;&h0000000010F887FF;&h000000001444B7FF;false
Class=ModInfo;Modules/CurseForge/ModInfo.xojo_code;&h000000005C426FFF;&h0000000010F887FF;false
Interface=BlueprintProvider;Modules/Game Support/ArkSA/BlueprintProvider.xojo_code;&h000000004631FFFF;&h000000004504AFFF;false
Class=TagSpec;Modules/Beacon/TagSpec.xojo_code;&h000000007589FFFF;&h0000000055ADDFFF;false
Class=BlueprintContainer;Modules/Game Support/ArkSA/BlueprintContainer.xojo_code;&h00000000301427FF;&h000000004504AFFF;false
DesktopWindow=ArkSALowConfidenceBlueprintsDialog;Views/ArkSA/Mods/ArkSALowConfidenceBlueprintsDialog.xojo_window;&h0000000079F8DFFF;&h000000004B8DE7FF;false
MultiImage=IconToolbarRenew;Icons/IconToolbarRenew.xojo_image;&h0000000069621FFF;&h0000000007F977FF;false
AppMenuBar=MainMenuBar
MajorVersion=2
MinorVersion=2
MinorVersion=3
SubVersion=0
NonRelease=1
NonRelease=0
Release=3
InfoVersion=Beacon
LongVersion=Beacon 2.2.0.1 ©2016-2024 The ZAZ Studios
ShortVersion=2.2.0.1
LongVersion=Beacon 2.3.0 ©2016-2024 The ZAZ Studios
ShortVersion=2.3.0
WinCompanyName=The ZAZ Studios
WinInternalName=
WinProductName=Beacon
Expand Down
20 changes: 15 additions & 5 deletions Project/Classes/IdentityManager.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@ Protected Class IdentityManager

#tag Method, Flags = &h0
Sub Constructor()
Const UseEncryption = Not DebugBuild

Var AppSupport As FolderItem = App.ApplicationSupport

Var DatabaseFile As FolderItem = AppSupport.Child("Identities.sqlite")
Var Database As New SQLiteDatabase
#if Not DebugBuild
Var Key As String = Crypto.SHA3_256("8df95865-3fac-4c79-8ee6-8ee98ca199df " + Beacon.SystemAccountName + " " + Beacon.HardwareId(True))
Database.EncryptionKey = "aes256:" + Key.ReplaceAll(Chr(0), Chr(1)) // https://forum.xojo.com/t/sqlitedatabase-encryptionkey-key-derivation/76366/9?u=thom_mcgrath
#if UseEncryption
Database.EncryptionKey = Self.GenerateKey
#endif
Database.DatabaseFile = DatabaseFile

Expand All @@ -38,6 +39,10 @@ Protected Class IdentityManager
DatabaseFile.Remove
End If

Preferences.HardwareIdVersion = 6
#if UseEncryption
Database.EncryptionKey = Self.GenerateKey
#endif
Database.CreateDatabase
Database.ExecuteSQL("CREATE TABLE identities (user_id TEXT COLLATE NOCASE NOT NULL PRIMARY KEY, public_key TEXT COLLATE NOCASE NOT NULL, private_key TEXT COLLATE NOCASE NOT NULL, cloud_key TEXT NOT NULL DEFAULT '', licenses TEXT NOT NULL DEFAULT '[]', username TEXT COLLATE NOCASE NOT NULL DEFAULT '', anonymous BOOLEAN NOT NULL DEFAULT TRUE, banned BOOLEAN NOT NULL DEFAULT FALSE, signature TEXT NOT NULL DEFAULT '', signature_fields TEXT NOT NULL DEFAULT '[]', expiration TEXT NOT NULL DEFAULT '', active BOOLEAN NOT NULL DEFAULT FALSE, merged BOOLEAN NOT NULL DEFAULT FALSE);")
Self.mDatabase = Database
Expand Down Expand Up @@ -68,8 +73,6 @@ Protected Class IdentityManager
#endif
End If
End If

Preferences.HardwareIdVersion = 5
End Sub
#tag EndMethod

Expand Down Expand Up @@ -162,6 +165,13 @@ Protected Class IdentityManager
End Function
#tag EndMethod

#tag Method, Flags = &h21
Private Shared Function GenerateKey() As String
Var Key As String = Crypto.SHA3_256("8df95865-3fac-4c79-8ee6-8ee98ca199df " + Beacon.SystemAccountName + " " + Beacon.HardwareId)
Return "aes256:" + Key.ReplaceAll(Chr(0), Chr(1)) // https://forum.xojo.com/t/sqlitedatabase-encryptionkey-key-derivation/76366/9?u=thom_mcgrath
End Function
#tag EndMethod

#tag Method, Flags = &h0
Function Import(Dict As Dictionary) As Beacon.Identity
Try
Expand Down
180 changes: 154 additions & 26 deletions Project/Custom Controls/BeaconListbox.xojo_code
Original file line number Diff line number Diff line change
Expand Up @@ -61,13 +61,24 @@ Inherits DesktopListBox
DeleteItem.Enabled = CanDelete
Base.AddMenu(DeleteItem)

Call ConstructContextualMenu(Base, X, Y)
Self.HandleToggleMenu(Base, X, Y)

Var Bound As Integer = Base.Count - 1
For I As Integer = 0 To Bound
If Base.MenuAt(I) = DeleteItem And I < Bound Then
Base.AddMenuAt(I + 1, New DesktopMenuItem(DesktopMenuItem.TextSeparator))
End If
Var Children As New DesktopMenuItem
Call ConstructContextualMenu(Children, X, Y)
If Children.Count = 0 Then
Return True
End If

Var Items() As DesktopMenuItem
For Idx As Integer = 0 To Children.LastRowIndex
Items.Add(Children.MenuAt(Idx))
Next
Children.RemoveAllRows

Base.AddMenu(New DesktopMenuItem(DesktopMenuItem.TextSeparator))

For Each Item As DesktopMenuItem In Items
Base.AddMenu(Item)
Next

Return True
Expand All @@ -76,23 +87,42 @@ Inherits DesktopListBox

#tag Event
Function ContextualMenuItemSelected(selectedItem As DesktopMenuItem) As Boolean
If SelectedItem.Tag <> Nil And SelectedItem.Tag.Type = Variant.TypeString Then
Select Case SelectedItem.Tag
Case "edit"
Self.DoEdit()
Return True
Case "cut"
Self.DoCut()
Return True
Case "copy"
Self.DoCopy()
Return True
Case "paste"
Self.DoPaste()
Return True
Case "clear"
Self.DoClear()
Return True
If SelectedItem.Tag.IsNull = False Then
Select Case SelectedItem.Tag.Type
Case Variant.TypeString
Select Case SelectedItem.Tag.StringValue
Case "edit"
Self.DoEdit()
Return True
Case "cut"
Self.DoCut()
Return True
Case "copy"
Self.DoCopy()
Return True
Case "paste"
Self.DoPaste()
Return True
Case "clear"
Self.DoClear()
Return True
End Select
Case Variant.TypeObject
If SelectedItem.Tag.ObjectValue IsA Dictionary And Dictionary(SelectedItem.Tag.ObjectValue).HasKey("Action") Then
Var ActionInfo As Dictionary = SelectedItem.Tag
Select Case ActionInfo.Value("Action").StringValue
Case "ToggleColumn"
Var Column As Integer = ActionInfo.Value("Column")
Var DesiredValue As Boolean = ActionInfo.Value("DesiredValue")
For Idx As Integer = Self.LastRowIndex DownTo 0
If Self.CellCheckBoxValueAt(Idx, Column) <> DesiredValue Then
Self.CellCheckBoxValueAt(Idx, Column) = DesiredValue
RaiseEvent CellAction(Idx, Column)
End If
Next
Return True
End Select
End If
End Select
End If

Expand Down Expand Up @@ -241,7 +271,7 @@ Inherits DesktopListBox

RaiseEvent Opening

Self.Transparent = False
Self.Transparent = TargetMacOS

Self.mPostOpenInvalidateCallbackKey = CallLater.Schedule(0, WeakAddressOf PostOpenInvalidate)
Self.mOpened = True
Expand Down Expand Up @@ -293,12 +323,12 @@ Inherits DesktopListBox
BackgroundColor = If(RowInvalid, SystemColors.SystemRedColor, SystemColors.SelectedContentBackgroundColor)
TextColor = SystemColors.AlternateSelectedControlTextColor
Else
BackgroundColor = SystemColors.UnemphasizedSelectedContentBackgroundColor
BackgroundColor = Self.mUnfocusedSelectionColor
TextColor = SystemColors.UnemphasizedSelectedTextColor
End If
SecondaryTextColor = TextColor
Else
BackgroundColor = If(Row Mod 2 = 0, SystemColors.ListEvenRowColor, SystemColors.ListOddRowColor)
BackgroundColor = If(Row Mod 2 = 0, Self.mRowEvenColor, Self.mRowOddColor)
TextColor = If(RowInvalid, SystemColors.SystemRedColor, SystemColors.TextColor)
SecondaryTextColor = If(RowInvalid, TextColor, SystemColors.SecondaryLabelColor)
End If
Expand Down Expand Up @@ -505,6 +535,16 @@ Inherits DesktopListBox

Self.mRequestedPages = New Dictionary

If Self.mRowEvenColor Is Nil Then
Self.mRowEvenColor = New ColorGroup(&cFFFEFE00, &cFFFFFFFF)
End If
If Self.mRowOddColor Is Nil Then
Self.mRowOddColor = New ColorGroup(&cF1F2F200, &cFFFFFFF3)
End If
If Self.mUnfocusedSelectionColor Is Nil Then
Self.mUnfocusedSelectionColor = New ColorGroup(&c000000D8, &cFFFFFFD8)
End If

Super.Constructor
End Sub
#tag EndMethod
Expand Down Expand Up @@ -661,6 +701,64 @@ Inherits DesktopListBox
End Sub
#tag EndMethod

#tag Method, Flags = &h21
Private Sub HandleToggleMenu(Base As DesktopMenuItem, X As Integer, Y As Integer)
If Self.RowCount < 2 Then
Return
End If

Var Row As Integer = Self.RowFromXY(X, Y)
If Row < 0 Or Row > Self.LastRowIndex Then
Return
End If

Var CheckBoxColumnCount As Integer
Var FirstCheckBoxColumn As Integer = -1
For ColumnIdx As Integer = 0 To Self.LastColumnIndex
If Self.CellTypeAt(Row, ColumnIdx) = DesktopListBox.CellTypes.CheckBox Then
CheckBoxColumnCount = CheckBoxColumnCount + 1
If FirstCheckBoxColumn = -1 Then
FirstCheckBoxColumn = ColumnIdx
End If
End If
Next
If CheckBoxColumnCount = 0 Then
Return
End If

Var Column As Integer = -1
If CheckBoxColumnCount > 1 Then
Column = Self.ColumnFromXY(X, Y)
If Self.CellTypeAt(Row, Column) <> DesktopListbox.CellTypes.CheckBox Then
Return
End If
ElseIf CheckboxColumnCount > 0 Then
Column = FirstCheckBoxColumn
End If

If Column < 0 Or Column > Self.LastColumnIndex Then
Return
End If

Base.AddMenu(New DesktopMenuItem(DesktopMenuItem.TextSeparator))

Var IsChecked As Boolean = Self.CellCheckBoxValueAt(Row, Column)
Var ToggleItem As New DesktopMenuItem
If CheckBoxColumnCount > 1 Then
If Self.HasHeader And Self.HeaderAt(Column).Trim.IsEmpty = False Then
Var ColumnName As String = Self.HeaderAt(Column).Trim
ToggleItem.Text = Language.ReplacePlaceholders(If(IsChecked, Self.UncheckAllNamed, Self.CheckAllNamed), ColumnName)
Else
ToggleItem.Text = If(IsChecked, Self.UncheckAllUnnamed, Self.CheckAllUnnamed)
End If
Else
ToggleItem.Text = If(IsChecked, Self.UncheckAllSingle, Self.CheckAllSingle)
End If
ToggleItem.Tag = New Dictionary("Action": "ToggleColumn", "Column": Column, "DesiredValue": Not IsChecked)
Base.AddMenu(ToggleItem)
End Sub
#tag EndMethod

#tag Method, Flags = &h21
Private Function Highlighted() As Boolean
If Self.Enabled Then
Expand Down Expand Up @@ -1133,6 +1231,14 @@ Inherits DesktopListBox
Private mRequestedPages As Dictionary
#tag EndProperty

#tag Property, Flags = &h21
Private Shared mRowEvenColor As ColorGroup
#tag EndProperty

#tag Property, Flags = &h21
Private Shared mRowOddColor As ColorGroup
#tag EndProperty

#tag Property, Flags = &h21
Private mScrollTask As AnimationKit.ScrollTask
#tag EndProperty
Expand All @@ -1153,6 +1259,10 @@ Inherits DesktopListBox
Private mTypeaheadTimer As Timer
#tag EndProperty

#tag Property, Flags = &h21
Private Shared mUnfocusedSelectionColor As ColorGroup
#tag EndProperty

#tag Property, Flags = &h21
Private mUpperRequestedBound As Integer
#tag EndProperty
Expand Down Expand Up @@ -1220,6 +1330,15 @@ Inherits DesktopListBox
#tag Constant, Name = AlternateRowColor, Type = Color, Dynamic = False, Default = \"&cFAFAFA", Scope = Public
#tag EndConstant

#tag Constant, Name = CheckAllNamed, Type = String, Dynamic = True, Default = \"Check All In \'\?1\' Column", Scope = Private
#tag EndConstant

#tag Constant, Name = CheckAllSingle, Type = String, Dynamic = True, Default = \"Check All", Scope = Private
#tag EndConstant

#tag Constant, Name = CheckAllUnnamed, Type = String, Dynamic = True, Default = \"Check All In This Column", Scope = Private
#tag EndConstant

#tag Constant, Name = DoubleLineRowHeight, Type = Double, Dynamic = False, Default = \"38", Scope = Public
#tag EndConstant

Expand Down Expand Up @@ -1259,6 +1378,15 @@ Inherits DesktopListBox
#tag Constant, Name = TextColor, Type = Color, Dynamic = False, Default = \"&c000000", Scope = Public
#tag EndConstant

#tag Constant, Name = UncheckAllNamed, Type = String, Dynamic = True, Default = \"Uncheck All In \'\?1\' Column", Scope = Private
#tag EndConstant

#tag Constant, Name = UncheckAllSingle, Type = String, Dynamic = True, Default = \"Uncheck All", Scope = Private
#tag EndConstant

#tag Constant, Name = UncheckAllUnnamed, Type = String, Dynamic = True, Default = \"Uncheck All In This Column", Scope = Private
#tag EndConstant

#tag Constant, Name = UseRoundedRows, Type = Boolean, Dynamic = False, Default = \"False", Scope = Private
#tag EndConstant

Expand Down
Loading

0 comments on commit 5aac4c0

Please sign in to comment.