From a1022d455ca60ca4ae664a07e0e01e48f52504ba Mon Sep 17 00:00:00 2001 From: Kace Date: Sat, 16 Nov 2024 16:55:34 -0500 Subject: [PATCH 01/51] avalonia upgrade wip --- RogueEssence.Editor.Avalonia/App.axaml | 12 +++++++--- RogueEssence.Editor.Avalonia/App.axaml.cs | 17 ++++++++++--- .../DataEditor/CategorySpawnBox.axaml | 2 +- .../DataEditor/CategorySpawnBox.axaml.cs | 9 ++----- .../DataEditor/ClassBox.axaml.cs | 9 ++----- .../DataEditor/CollectionBox.axaml | 2 +- .../DataEditor/CollectionBox.axaml.cs | 9 ++----- .../DataEditor/DataEditForm.axaml.cs | 15 +++--------- .../DataEditor/DataEditRootForm.axaml.cs | 9 ++----- .../DataEditor/DictionaryBox.axaml | 2 +- .../DataEditor/DictionaryBox.axaml.cs | 7 +----- .../DataEditor/Editors/DataFolderEditor.cs | 3 +-- .../DataEditor/Editors/Editor.cs | 15 ++++++------ .../Editors/Primitive/DoubleEditor.cs | 2 +- .../Editors/Primitive/SingleEditor.cs | 2 +- .../RogueElements/PriorityListEditor.cs | 5 ++-- .../Editors/RogueElements/RangeDictEditor.cs | 3 ++- .../Editors/RogueElements/SpawnListEditor.cs | 3 ++- .../RogueElements/SpawnRangeListEditor.cs | 3 ++- .../Editors/RogueEssence/AliasDataEditor.cs | 3 +-- .../Editors/RogueEssence/AnimDataEditor.cs | 3 +-- .../Editors/RogueEssence/EntryDataEditor.cs | 3 +-- .../Editors/RogueEssence/FlagTypeEditor.cs | 2 +- .../Editors/RogueEssence/FrameTypeEditor.cs | 3 +-- .../Editors/RogueEssence/InvItemEditor.cs | 4 +--- .../Editors/RogueEssence/MapItemEditor.cs | 5 ++-- .../Editors/RogueEssence/MonsterIDEditor.cs | 16 ++++--------- .../Editors/RogueEssence/MusicEditor.cs | 3 +-- .../Editors/RogueEssence/SoundEditor.cs | 3 +-- .../Editors/RogueEssence/StringKeyEditor.cs | 3 +-- .../RogueEssence/Tiles/AutotileBrowser.axaml | 2 +- .../Tiles/AutotileBrowser.axaml.cs | 9 ++----- .../RogueEssence/Tiles/TileBox.axaml.cs | 8 +------ .../RogueEssence/Tiles/TileBrowser.axaml | 2 +- .../RogueEssence/Tiles/TileBrowser.axaml.cs | 12 +++------- .../RogueEssence/Tiles/TileEditForm.axaml.cs | 11 +-------- .../DataEditor/Editors/System/ArrayEditor.cs | 2 +- .../Editors/System/DictionaryEditor.cs | 3 ++- .../DataEditor/Editors/System/EnumEditor.cs | 3 +-- .../Editors/System/HashSetEditor.cs | 2 +- .../DataEditor/Editors/System/ListEditor.cs | 5 ++-- .../Editors/System/NoDupeListEditor.cs | 2 +- .../DataEditor/Editors/System/TypeEditor.cs | 2 +- .../DataEditor/PriorityListBox.axaml | 2 +- .../DataEditor/PriorityListBox.axaml.cs | 8 ++----- .../DataEditor/RangeDictBox.axaml | 2 +- .../DataEditor/RangeDictBox.axaml.cs | 8 ++----- .../DataEditor/RankedCollectionBox.axaml | 2 +- .../DataEditor/RankedCollectionBox.axaml.cs | 9 ++----- .../DataEditor/SpawnListBox.axaml | 2 +- .../DataEditor/SpawnListBox.axaml.cs | 9 ++----- .../DataEditor/SpawnListViewBox.axaml | 2 +- .../DataEditor/SpawnListViewBox.axaml.cs | 7 +----- .../DataEditor/SpawnRangeListBox.axaml | 2 +- .../DataEditor/SpawnRangeListBox.axaml.cs | 9 ++----- RogueEssence.Editor.Avalonia/ReactiveExt.cs | 4 ++-- .../RogueEssence.Editor.Avalonia.csproj | 11 +++++---- RogueEssence.Editor.Avalonia/ViewLocator.cs | 2 +- .../ViewModels/DevForm/DevTabDataViewModel.cs | 3 ++- .../GroundEditForm/EntScriptItem.cs | 2 +- .../GroundEditForm/GroundEditViewModel.cs | 6 ++--- .../ViewModels/GroundEditForm/ScriptItem.cs | 3 ++- .../Views/Content/AnimEditForm.axaml.cs | 13 ++-------- .../Views/Content/SpeciesEditForm.axaml | 4 ++-- .../Views/Content/SpeciesEditForm.axaml.cs | 11 +-------- .../Views/Content/StringsEditForm.axaml | 2 +- .../Views/Content/StringsEditForm.axaml.cs | 12 +--------- .../Views/Content/TilesetEditForm.axaml.cs | 10 +------- .../Views/DataListForm.axaml | 4 ++-- .../Views/DataListForm.axaml.cs | 12 ++-------- .../Views/DevForm/DevForm.axaml.cs | 12 ++-------- .../Views/DevForm/DevTabConstants.axaml.cs | 7 +----- .../Views/DevForm/DevTabData.axaml.cs | 7 +----- .../Views/DevForm/DevTabGame.axaml | 22 +++++++++++++---- .../Views/DevForm/DevTabGame.axaml.cs | 7 +----- .../Views/DevForm/DevTabMods.axaml | 2 +- .../Views/DevForm/DevTabMods.axaml.cs | 8 +------ .../Views/DevForm/DevTabPlayer.axaml | 10 ++++---- .../Views/DevForm/DevTabPlayer.axaml.cs | 9 +------ .../Views/DevForm/DevTabScript.axaml.cs | 8 +------ .../Views/DevForm/DevTabSprites.axaml.cs | 7 +----- .../Views/DevForm/DevTabTravel.axaml | 8 +++---- .../Views/DevForm/DevTabTravel.axaml.cs | 10 ++------ .../Views/DialogBoxes/AnimChoiceWindow.axaml | 2 +- .../DialogBoxes/AnimChoiceWindow.axaml.cs | 15 ++---------- .../DialogBoxes/MapResizeWindow.axaml.cs | 12 ++-------- .../DialogBoxes/MapRetileWindow.axaml.cs | 11 +-------- .../Views/DialogBoxes/MessageBox.axaml.cs | 12 ++-------- .../Views/DialogBoxes/ModConfigWindow.axaml | 2 +- .../DialogBoxes/ModConfigWindow.axaml.cs | 13 +--------- .../Views/DialogBoxes/RenameWindow.axaml.cs | 13 +--------- .../Views/GroundEditForm/EntityBrowser.axaml | 22 ++++++++--------- .../GroundEditForm/EntityBrowser.axaml.cs | 8 +------ .../GroundEditForm/GroundEditForm.axaml.cs | 14 +++-------- .../GroundEditForm/GroundTabDecorations.axaml | 6 ++--- .../GroundTabDecorations.axaml.cs | 7 +----- .../GroundEditForm/GroundTabEntities.axaml.cs | 7 +----- .../GroundEditForm/GroundTabProperties.axaml | 4 ++-- .../GroundTabProperties.axaml.cs | 7 +----- .../GroundEditForm/GroundTabScript.axaml | 5 ++-- .../GroundEditForm/GroundTabScript.axaml.cs | 7 +----- .../GroundEditForm/GroundTabStrings.axaml | 2 +- .../GroundEditForm/GroundTabStrings.axaml.cs | 7 +----- .../GroundEditForm/GroundTabTextures.axaml.cs | 7 +----- .../GroundEditForm/GroundTabWalls.axaml.cs | 7 +----- .../Layers/AnimLayerWindow.axaml.cs | 14 ++--------- .../Layers/EntityLayerWindow.axaml.cs | 14 ++--------- .../Layers/GroundLayerWindow.axaml.cs | 14 ++--------- .../Layers/MapLayerWindow.axaml.cs | 15 ++---------- .../Views/MapEditForm/MapEditForm.axaml.cs | 18 +++----------- .../Views/MapEditForm/MapTabDecorations.axaml | 6 ++--- .../MapEditForm/MapTabDecorations.axaml.cs | 7 +----- .../Views/MapEditForm/MapTabEffects.axaml.cs | 7 +----- .../Views/MapEditForm/MapTabEntities.axaml | 24 +++++++++---------- .../Views/MapEditForm/MapTabEntities.axaml.cs | 7 +----- .../Views/MapEditForm/MapTabEntrances.axaml | 2 +- .../MapEditForm/MapTabEntrances.axaml.cs | 7 +----- .../Views/MapEditForm/MapTabItems.axaml | 2 +- .../Views/MapEditForm/MapTabItems.axaml.cs | 8 ++----- .../Views/MapEditForm/MapTabProperties.axaml | 10 ++++---- .../MapEditForm/MapTabProperties.axaml.cs | 7 +----- .../Views/MapEditForm/MapTabSpawns.axaml.cs | 7 +----- .../Views/MapEditForm/MapTabTerrain.axaml | 2 +- .../Views/MapEditForm/MapTabTerrain.axaml.cs | 7 +----- .../Views/MapEditForm/MapTabTextures.axaml.cs | 7 +----- .../Views/MapEditForm/MapTabTiles.axaml | 4 ++-- .../Views/MapEditForm/MapTabTiles.axaml.cs | 7 +----- .../MapEditForm/Teams/TeamWindow.axaml.cs | 14 ++--------- .../Views/SearchListBox.axaml | 2 +- .../Views/SearchListBox.axaml.cs | 9 ++----- .../Views/Testing/TextTestForm.axaml.cs | 12 ++-------- .../Views/UserControls/LayerBox.axaml | 2 +- .../Views/UserControls/LayerBox.axaml.cs | 9 ++----- .../Views/UserControls/SearchComboBox.cs | 6 ++++- .../Views/UserControls/TeamBox.axaml | 2 +- .../Views/UserControls/TeamBox.axaml.cs | 9 ++----- 136 files changed, 285 insertions(+), 684 deletions(-) diff --git a/RogueEssence.Editor.Avalonia/App.axaml b/RogueEssence.Editor.Avalonia/App.axaml index f6e04e48..3fbb7b3c 100644 --- a/RogueEssence.Editor.Avalonia/App.axaml +++ b/RogueEssence.Editor.Avalonia/App.axaml @@ -1,15 +1,15 @@  - - - + + + + diff --git a/RogueEssence.Editor.Avalonia/App.axaml.cs b/RogueEssence.Editor.Avalonia/App.axaml.cs index 976f85d3..f858788f 100644 --- a/RogueEssence.Editor.Avalonia/App.axaml.cs +++ b/RogueEssence.Editor.Avalonia/App.axaml.cs @@ -1,5 +1,7 @@ -using Avalonia; +using System; +using Avalonia; using Avalonia.Controls.ApplicationLifetimes; +using Avalonia.Input.Platform; using Avalonia.Markup.Xaml; using RogueEssence.Dev.ViewModels; using RogueEssence.Dev.Views; @@ -8,11 +10,20 @@ namespace RogueEssence.Dev { public class App : Application { - public override void Initialize() + + + public static async void CopyText(string data) { - AvaloniaXamlLoader.Load(this); + if (Current.ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) + { + if (desktop.MainWindow.Clipboard is IClipboard clipbord) + { + await clipbord.SetTextAsync(data); + } + } } + public override void OnFrameworkInitializationCompleted() { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) diff --git a/RogueEssence.Editor.Avalonia/DataEditor/CategorySpawnBox.axaml b/RogueEssence.Editor.Avalonia/DataEditor/CategorySpawnBox.axaml index 123ca3fc..f6d54116 100644 --- a/RogueEssence.Editor.Avalonia/DataEditor/CategorySpawnBox.axaml +++ b/RogueEssence.Editor.Avalonia/DataEditor/CategorySpawnBox.axaml @@ -33,7 +33,7 @@ - + diff --git a/RogueEssence.Editor.Avalonia/DataEditor/CategorySpawnBox.axaml.cs b/RogueEssence.Editor.Avalonia/DataEditor/CategorySpawnBox.axaml.cs index cd24a4c3..24cf935d 100644 --- a/RogueEssence.Editor.Avalonia/DataEditor/CategorySpawnBox.axaml.cs +++ b/RogueEssence.Editor.Avalonia/DataEditor/CategorySpawnBox.axaml.cs @@ -12,7 +12,7 @@ namespace RogueEssence.Dev.Views { - public class CategorySpawnBox : UserControl + public partial class CategorySpawnBox : UserControl { public CategorySpawnBox() @@ -23,12 +23,7 @@ public CategorySpawnBox() Button addItemButtom = this.FindControl