From c823df87e91ff19598e29caf8d465d447b0231a6 Mon Sep 17 00:00:00 2001 From: chumbayaa Date: Tue, 11 Nov 2025 21:58:17 +0000 Subject: [PATCH 1/9] Migration to Avalonia 11 and dotnet 10 --- README.md | 2 +- .../OpenTracker.Models.csproj | 2 +- .../OpenTracker.Utils.csproj | 8 ++-- src/OpenTracker.Utils/ViewLocator.cs | 7 +++- src/OpenTracker/App.axaml | 4 +- src/OpenTracker/App.axaml.cs | 6 ++- src/OpenTracker/Models/AvaloniaSerilogSink.cs | 16 +++++--- src/OpenTracker/OpenTracker.csproj | 41 ++++++++++--------- src/OpenTracker/Program.cs | 6 ++- .../ValueConverters/BitmapValueConverter.cs | 4 +- .../MapLocations/EntranceMapLocationVM.cs | 8 ++-- .../MapLocations/IMapLocationColorProvider.cs | 4 +- .../MapLocations/IShapedMapLocationVMBase.cs | 4 +- .../MapLocations/MapLocationColorProvider.cs | 16 ++++---- .../ViewModels/MapLocations/MapLocationVM.cs | 8 ++-- .../MapLocations/ShopMapLocationVM.cs | 8 ++-- .../MapLocations/StandardMapLocationVM.cs | 8 ++-- .../MapLocations/TakeAnyMapLocationVM.cs | 8 ++-- .../ViewModels/Maps/MapConnectionVM.cs | 16 ++++---- src/OpenTracker/Views/Areas/MapArea.axaml | 8 ++-- src/OpenTracker/Views/Areas/MapArea.axaml.cs | 2 +- .../Views/Areas/UIPanelArea.axaml.cs | 2 +- .../Views/AutoTracking/AutoTrackerLog.axaml | 2 +- .../AutoTracking/AutoTrackerLog.axaml.cs | 2 +- .../AutoTracking/AutoTrackerStatus.axaml.cs | 2 +- .../BossSelect/BossSelectButton.axaml.cs | 2 +- .../Views/BossSelect/BossSelectPopup.axaml | 2 +- .../Views/BossSelect/BossSelectPopup.axaml.cs | 2 +- .../Views/Capture/CaptureWindow.axaml.cs | 2 +- .../Capture/Design/CaptureDesignDialog.axaml | 2 +- .../Design/CaptureDesignDialog.axaml.cs | 2 +- .../Design/CaptureWindowDesign.axaml.cs | 2 +- .../ColorSelect/ColorPickerControl.axaml | 9 ++-- .../ColorSelect/ColorPickerControl.axaml.cs | 2 +- .../ColorSelect/ColorSelectControl.axaml.cs | 2 +- .../Views/ColorSelect/ColorSelectDialog.axaml | 6 +-- .../ColorSelect/ColorSelectDialog.axaml.cs | 2 +- .../Views/Dialogs/AboutDialog.axaml.cs | 2 +- .../Views/Dialogs/AutoTrackerDialog.axaml | 2 +- .../Views/Dialogs/AutoTrackerDialog.axaml.cs | 2 +- .../Views/Dialogs/ErrorBoxDialog.axaml.cs | 2 +- .../Views/Dialogs/MessageBoxDialog.axaml.cs | 2 +- .../Views/Dialogs/SequenceBreakDialog.axaml | 12 +++--- .../Dialogs/SequenceBreakDialog.axaml.cs | 2 +- .../Views/Dungeons/DungeonItem.axaml.cs | 2 +- .../Dungeons/DungeonItemSection.axaml.cs | 2 +- .../Views/Dungeons/DungeonPanel.axaml.cs | 2 +- .../Dungeons/HorizontalDungeonPanel.axaml | 26 ++++++------ .../Dungeons/HorizontalDungeonPanel.axaml.cs | 2 +- .../Views/Dungeons/VerticalDungeonPanel.axaml | 26 ++++++------ .../Dungeons/VerticalDungeonPanel.axaml.cs | 2 +- src/OpenTracker/Views/Items/Item.axaml.cs | 2 +- .../Views/Items/LargeItem.axaml.cs | 2 +- .../Views/Items/LargeItemPanel.axaml | 2 +- .../Views/Items/LargeItemPanel.axaml.cs | 2 +- src/OpenTracker/Views/MainWindow.axaml.cs | 5 +-- .../MapLocations/EntranceMapLocation.axaml.cs | 2 +- .../Views/MapLocations/MapLocation.axaml | 8 ++-- .../Views/MapLocations/MapLocation.axaml.cs | 2 +- .../MapLocations/MapLocationMarking.axaml.cs | 2 +- .../MapLocations/ShopMapLocation.axaml.cs | 2 +- .../MapLocations/StandardMapLocation.axaml.cs | 2 +- .../MapLocations/TakeAnyMapLocation.axaml.cs | 2 +- src/OpenTracker/Views/Maps/Map.axaml.cs | 2 +- .../Views/Maps/MapConnection.axaml | 8 ++-- .../Views/Maps/MapConnection.axaml.cs | 2 +- .../Markings/Images/ItemMarkingImage.axaml.cs | 2 +- .../Markings/Images/MarkingImage.axaml.cs | 2 +- .../Views/Markings/MarkingSelect.axaml | 2 +- .../Views/Markings/MarkingSelect.axaml.cs | 2 +- .../Markings/MarkingSelectButton.axaml.cs | 2 +- .../Markings/MarkingSelectSpacer.axaml.cs | 2 +- .../Views/Markings/NoteMarkingSelect.axaml | 2 +- .../Views/Markings/NoteMarkingSelect.axaml.cs | 2 +- .../Views/Menus/MenuHotkeyHeader.axaml.cs | 2 +- .../Views/Menus/MenuItemCheckBox.axaml.cs | 2 +- src/OpenTracker/Views/Menus/TopMenu.axaml | 4 +- src/OpenTracker/Views/Menus/TopMenu.axaml.cs | 2 +- src/OpenTracker/Views/ModeSettings.axaml.cs | 2 +- .../Notes/PinnedLocationNote.axaml.cs | 2 +- .../Notes/PinnedLocationNoteArea.axaml | 2 +- .../Notes/PinnedLocationNoteArea.axaml.cs | 2 +- .../PinnedLocations/PinnedLocation.axaml | 2 +- .../PinnedLocations/PinnedLocation.axaml.cs | 2 +- .../PinnedLocationsPanel.axaml | 2 +- .../PinnedLocationsPanel.axaml.cs | 2 +- .../Sections/BossSectionIcon.axaml.cs | 2 +- .../Sections/MarkingSectionIcon.axaml.cs | 2 +- .../Sections/PrizeSectionIcon.axaml.cs | 2 +- .../PinnedLocations/Sections/Section.axaml | 2 +- .../PinnedLocations/Sections/Section.axaml.cs | 2 +- .../Sections/SectionIcon.axaml.cs | 2 +- .../SequenceBreakControl.axaml.cs | 2 +- src/OpenTracker/Views/StatusBar.axaml.cs | 2 +- .../Views/ToolTips/MapLocationToolTip.axaml | 2 +- .../ToolTips/MapLocationToolTip.axaml.cs | 2 +- .../MapLocationToolTipMarking.axaml.cs | 2 +- .../Views/UIPanels/UIPanel.axaml.cs | 2 +- .../OpenTracker.UnitTests.csproj | 10 ++--- 99 files changed, 224 insertions(+), 212 deletions(-) diff --git a/README.md b/README.md index acb68ba4..e266306c 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ The following is on my roadmap for future updates: ### Prerequisites -OpenTracker is a .NET 8.0 application. You will be required to install a .NET runtime version 8.0 or greater. You can find it at this link: https://dotnet.microsoft.com/download/dotnet +OpenTracker is a .NET 10.0 application. You will be required to install a .NET runtime version 10.0 or greater. You can find it at this link: https://dotnet.microsoft.com/download/dotnet ### Windows diff --git a/src/OpenTracker.Models/OpenTracker.Models.csproj b/src/OpenTracker.Models/OpenTracker.Models.csproj index 5b669df5..42886d32 100644 --- a/src/OpenTracker.Models/OpenTracker.Models.csproj +++ b/src/OpenTracker.Models/OpenTracker.Models.csproj @@ -1,7 +1,7 @@  - net8.0 + net10.0 enable 1.8.7 latest diff --git a/src/OpenTracker.Utils/OpenTracker.Utils.csproj b/src/OpenTracker.Utils/OpenTracker.Utils.csproj index 4707db4f..fd10b894 100644 --- a/src/OpenTracker.Utils/OpenTracker.Utils.csproj +++ b/src/OpenTracker.Utils/OpenTracker.Utils.csproj @@ -1,7 +1,7 @@ - net8.0 + net10.0 enable 1.8.5 latest @@ -9,9 +9,9 @@ - - - + + + diff --git a/src/OpenTracker.Utils/ViewLocator.cs b/src/OpenTracker.Utils/ViewLocator.cs index aa6ea41d..dec10973 100644 --- a/src/OpenTracker.Utils/ViewLocator.cs +++ b/src/OpenTracker.Utils/ViewLocator.cs @@ -11,8 +11,11 @@ public class ViewLocator : IDataTemplate public static bool SupportsRecycling => false; - public IControl Build(object data) + public Control? Build(object? data) { + if (data == null) + return null; + var assembly = Assembly.GetEntryAssembly() ?? throw new NullReferenceException(); var viewTypes = assembly.GetTypes(); @@ -29,7 +32,7 @@ public IControl Build(object data) } } - public bool Match(object data) + public bool Match(object? data) { return data is ViewModelBase; } diff --git a/src/OpenTracker/App.axaml b/src/OpenTracker/App.axaml index 2e0071ad..870e7f6b 100644 --- a/src/OpenTracker/App.axaml +++ b/src/OpenTracker/App.axaml @@ -8,9 +8,7 @@ - - - + diff --git a/src/OpenTracker/Views/Menus/TopMenu.axaml.cs b/src/OpenTracker/Views/Menus/TopMenu.axaml.cs index 6865bbb4..39dd7caa 100644 --- a/src/OpenTracker/Views/Menus/TopMenu.axaml.cs +++ b/src/OpenTracker/Views/Menus/TopMenu.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.Menus { - public class TopMenu : UserControl + public partial class TopMenu : UserControl { public TopMenu() { diff --git a/src/OpenTracker/Views/ModeSettings.axaml.cs b/src/OpenTracker/Views/ModeSettings.axaml.cs index 299c57c9..2de50190 100644 --- a/src/OpenTracker/Views/ModeSettings.axaml.cs +++ b/src/OpenTracker/Views/ModeSettings.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views { - public class ModeSettings : UserControl + public partial class ModeSettings : UserControl { public ModeSettings() { diff --git a/src/OpenTracker/Views/PinnedLocations/Notes/PinnedLocationNote.axaml.cs b/src/OpenTracker/Views/PinnedLocations/Notes/PinnedLocationNote.axaml.cs index 06c86254..b03544d2 100644 --- a/src/OpenTracker/Views/PinnedLocations/Notes/PinnedLocationNote.axaml.cs +++ b/src/OpenTracker/Views/PinnedLocations/Notes/PinnedLocationNote.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.PinnedLocations.Notes { - public class PinnedLocationNote : UserControl + public partial class PinnedLocationNote : UserControl { public PinnedLocationNote() { diff --git a/src/OpenTracker/Views/PinnedLocations/Notes/PinnedLocationNoteArea.axaml b/src/OpenTracker/Views/PinnedLocations/Notes/PinnedLocationNoteArea.axaml index d5516169..ce95a423 100644 --- a/src/OpenTracker/Views/PinnedLocations/Notes/PinnedLocationNoteArea.axaml +++ b/src/OpenTracker/Views/PinnedLocations/Notes/PinnedLocationNoteArea.axaml @@ -12,7 +12,7 @@ - + diff --git a/src/OpenTracker/Views/PinnedLocations/Notes/PinnedLocationNoteArea.axaml.cs b/src/OpenTracker/Views/PinnedLocations/Notes/PinnedLocationNoteArea.axaml.cs index 76266df4..c5d72b7c 100644 --- a/src/OpenTracker/Views/PinnedLocations/Notes/PinnedLocationNoteArea.axaml.cs +++ b/src/OpenTracker/Views/PinnedLocations/Notes/PinnedLocationNoteArea.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.PinnedLocations.Notes { - public class PinnedLocationNoteArea : UserControl + public partial class PinnedLocationNoteArea : UserControl { public PinnedLocationNoteArea() { diff --git a/src/OpenTracker/Views/PinnedLocations/PinnedLocation.axaml b/src/OpenTracker/Views/PinnedLocations/PinnedLocation.axaml index c50ece7c..35c54325 100644 --- a/src/OpenTracker/Views/PinnedLocations/PinnedLocation.axaml +++ b/src/OpenTracker/Views/PinnedLocations/PinnedLocation.axaml @@ -38,7 +38,7 @@ - + diff --git a/src/OpenTracker/Views/PinnedLocations/PinnedLocation.axaml.cs b/src/OpenTracker/Views/PinnedLocations/PinnedLocation.axaml.cs index f32c285b..ffe4586a 100644 --- a/src/OpenTracker/Views/PinnedLocations/PinnedLocation.axaml.cs +++ b/src/OpenTracker/Views/PinnedLocations/PinnedLocation.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.PinnedLocations { - public class PinnedLocation : UserControl + public partial class PinnedLocation : UserControl { public PinnedLocation() { diff --git a/src/OpenTracker/Views/PinnedLocations/PinnedLocationsPanel.axaml b/src/OpenTracker/Views/PinnedLocations/PinnedLocationsPanel.axaml index ba090c43..59243023 100644 --- a/src/OpenTracker/Views/PinnedLocations/PinnedLocationsPanel.axaml +++ b/src/OpenTracker/Views/PinnedLocations/PinnedLocationsPanel.axaml @@ -9,7 +9,7 @@ - + diff --git a/src/OpenTracker/Views/PinnedLocations/PinnedLocationsPanel.axaml.cs b/src/OpenTracker/Views/PinnedLocations/PinnedLocationsPanel.axaml.cs index 84d19717..c8249a37 100644 --- a/src/OpenTracker/Views/PinnedLocations/PinnedLocationsPanel.axaml.cs +++ b/src/OpenTracker/Views/PinnedLocations/PinnedLocationsPanel.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.PinnedLocations { - public class PinnedLocationsPanel : UserControl + public partial class PinnedLocationsPanel : UserControl { public PinnedLocationsPanel() { diff --git a/src/OpenTracker/Views/PinnedLocations/Sections/BossSectionIcon.axaml.cs b/src/OpenTracker/Views/PinnedLocations/Sections/BossSectionIcon.axaml.cs index e8788a55..eedc308d 100644 --- a/src/OpenTracker/Views/PinnedLocations/Sections/BossSectionIcon.axaml.cs +++ b/src/OpenTracker/Views/PinnedLocations/Sections/BossSectionIcon.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.PinnedLocations.Sections { - public class BossSectionIcon : UserControl + public partial class BossSectionIcon : UserControl { public BossSectionIcon() { diff --git a/src/OpenTracker/Views/PinnedLocations/Sections/MarkingSectionIcon.axaml.cs b/src/OpenTracker/Views/PinnedLocations/Sections/MarkingSectionIcon.axaml.cs index 9b0f97f2..4f44c225 100644 --- a/src/OpenTracker/Views/PinnedLocations/Sections/MarkingSectionIcon.axaml.cs +++ b/src/OpenTracker/Views/PinnedLocations/Sections/MarkingSectionIcon.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.PinnedLocations.Sections { - public class MarkingSectionIcon : UserControl + public partial class MarkingSectionIcon : UserControl { public MarkingSectionIcon() { diff --git a/src/OpenTracker/Views/PinnedLocations/Sections/PrizeSectionIcon.axaml.cs b/src/OpenTracker/Views/PinnedLocations/Sections/PrizeSectionIcon.axaml.cs index a8c70d00..b652e171 100644 --- a/src/OpenTracker/Views/PinnedLocations/Sections/PrizeSectionIcon.axaml.cs +++ b/src/OpenTracker/Views/PinnedLocations/Sections/PrizeSectionIcon.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.PinnedLocations.Sections { - public class PrizeSectionIcon : UserControl + public partial class PrizeSectionIcon : UserControl { public PrizeSectionIcon() { diff --git a/src/OpenTracker/Views/PinnedLocations/Sections/Section.axaml b/src/OpenTracker/Views/PinnedLocations/Sections/Section.axaml index 7b9a884f..e5bced02 100644 --- a/src/OpenTracker/Views/PinnedLocations/Sections/Section.axaml +++ b/src/OpenTracker/Views/PinnedLocations/Sections/Section.axaml @@ -33,7 +33,7 @@ - + diff --git a/src/OpenTracker/Views/PinnedLocations/Sections/Section.axaml.cs b/src/OpenTracker/Views/PinnedLocations/Sections/Section.axaml.cs index bc713f96..d9dc9135 100644 --- a/src/OpenTracker/Views/PinnedLocations/Sections/Section.axaml.cs +++ b/src/OpenTracker/Views/PinnedLocations/Sections/Section.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.PinnedLocations.Sections { - public class Section : UserControl + public partial class Section : UserControl { public Section() { diff --git a/src/OpenTracker/Views/PinnedLocations/Sections/SectionIcon.axaml.cs b/src/OpenTracker/Views/PinnedLocations/Sections/SectionIcon.axaml.cs index 26105b4f..b41ffd27 100644 --- a/src/OpenTracker/Views/PinnedLocations/Sections/SectionIcon.axaml.cs +++ b/src/OpenTracker/Views/PinnedLocations/Sections/SectionIcon.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.PinnedLocations.Sections { - public class SectionIcon : UserControl + public partial class SectionIcon : UserControl { public SectionIcon() { diff --git a/src/OpenTracker/Views/SequenceBreaks/SequenceBreakControl.axaml.cs b/src/OpenTracker/Views/SequenceBreaks/SequenceBreakControl.axaml.cs index efa79aba..e55c8aef 100644 --- a/src/OpenTracker/Views/SequenceBreaks/SequenceBreakControl.axaml.cs +++ b/src/OpenTracker/Views/SequenceBreaks/SequenceBreakControl.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.SequenceBreaks { - public class SequenceBreakControl : UserControl + public partial class SequenceBreakControl : UserControl { public SequenceBreakControl() { diff --git a/src/OpenTracker/Views/StatusBar.axaml.cs b/src/OpenTracker/Views/StatusBar.axaml.cs index 441b495c..57158815 100644 --- a/src/OpenTracker/Views/StatusBar.axaml.cs +++ b/src/OpenTracker/Views/StatusBar.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views { - public class StatusBar : UserControl + public partial class StatusBar : UserControl { public StatusBar() { diff --git a/src/OpenTracker/Views/ToolTips/MapLocationToolTip.axaml b/src/OpenTracker/Views/ToolTips/MapLocationToolTip.axaml index 671db213..bd7d8e51 100644 --- a/src/OpenTracker/Views/ToolTips/MapLocationToolTip.axaml +++ b/src/OpenTracker/Views/ToolTips/MapLocationToolTip.axaml @@ -25,7 +25,7 @@ - + diff --git a/src/OpenTracker/Views/ToolTips/MapLocationToolTip.axaml.cs b/src/OpenTracker/Views/ToolTips/MapLocationToolTip.axaml.cs index 9261d45e..8443f8b8 100644 --- a/src/OpenTracker/Views/ToolTips/MapLocationToolTip.axaml.cs +++ b/src/OpenTracker/Views/ToolTips/MapLocationToolTip.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.ToolTips { - public class MapLocationToolTip : UserControl + public partial class MapLocationToolTip : UserControl { public MapLocationToolTip() { diff --git a/src/OpenTracker/Views/ToolTips/MapLocationToolTipMarking.axaml.cs b/src/OpenTracker/Views/ToolTips/MapLocationToolTipMarking.axaml.cs index 21c24136..e389157b 100644 --- a/src/OpenTracker/Views/ToolTips/MapLocationToolTipMarking.axaml.cs +++ b/src/OpenTracker/Views/ToolTips/MapLocationToolTipMarking.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.ToolTips { - public class MapLocationToolTipMarking : UserControl + public partial class MapLocationToolTipMarking : UserControl { public MapLocationToolTipMarking() { diff --git a/src/OpenTracker/Views/UIPanels/UIPanel.axaml.cs b/src/OpenTracker/Views/UIPanels/UIPanel.axaml.cs index 8c6b7d65..e923ca77 100644 --- a/src/OpenTracker/Views/UIPanels/UIPanel.axaml.cs +++ b/src/OpenTracker/Views/UIPanels/UIPanel.axaml.cs @@ -3,7 +3,7 @@ namespace OpenTracker.Views.UIPanels { - public class UIPanel : UserControl + public partial class UIPanel : UserControl { public UIPanel() { diff --git a/tests/OpenTracker.UnitTests/OpenTracker.UnitTests.csproj b/tests/OpenTracker.UnitTests/OpenTracker.UnitTests.csproj index 7c245294..7b40c18e 100644 --- a/tests/OpenTracker.UnitTests/OpenTracker.UnitTests.csproj +++ b/tests/OpenTracker.UnitTests/OpenTracker.UnitTests.csproj @@ -1,7 +1,7 @@  - net8.0 + net10.0 enable latest @@ -9,17 +9,17 @@ - + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 83e3b7d652de179a10284489b2265e4c1f496411 Mon Sep 17 00:00:00 2001 From: chumbayaa Date: Sat, 15 Nov 2025 21:22:31 +0000 Subject: [PATCH 2/9] More library code updates --- .../OpenTracker.Models.csproj | 4 +- .../OpenTracker.Utils.csproj | 14 +++---- src/OpenTracker/OpenTracker.csproj | 40 +++++++++---------- .../OpenTracker.UnitTests.csproj | 4 +- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/OpenTracker.Models/OpenTracker.Models.csproj b/src/OpenTracker.Models/OpenTracker.Models.csproj index 42886d32..d03ccd80 100644 --- a/src/OpenTracker.Models/OpenTracker.Models.csproj +++ b/src/OpenTracker.Models/OpenTracker.Models.csproj @@ -12,8 +12,8 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + diff --git a/src/OpenTracker.Utils/OpenTracker.Utils.csproj b/src/OpenTracker.Utils/OpenTracker.Utils.csproj index fd10b894..d06ecb9a 100644 --- a/src/OpenTracker.Utils/OpenTracker.Utils.csproj +++ b/src/OpenTracker.Utils/OpenTracker.Utils.csproj @@ -8,13 +8,13 @@ - - - - - - - + + + + + + + diff --git a/src/OpenTracker/OpenTracker.csproj b/src/OpenTracker/OpenTracker.csproj index 082a8764..04ad598d 100644 --- a/src/OpenTracker/OpenTracker.csproj +++ b/src/OpenTracker/OpenTracker.csproj @@ -36,36 +36,36 @@ - - - - - - - - - + + + + + + + + + - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + @@ -75,7 +75,7 @@ - + 0.1.232 diff --git a/tests/OpenTracker.UnitTests/OpenTracker.UnitTests.csproj b/tests/OpenTracker.UnitTests/OpenTracker.UnitTests.csproj index 7b40c18e..fe8baa13 100644 --- a/tests/OpenTracker.UnitTests/OpenTracker.UnitTests.csproj +++ b/tests/OpenTracker.UnitTests/OpenTracker.UnitTests.csproj @@ -10,8 +10,8 @@ - - + + From 06a22ca9a7c898a452cc4c11432fe3477ffadb37 Mon Sep 17 00:00:00 2001 From: chumbayaa Date: Sat, 15 Nov 2025 21:46:31 +0000 Subject: [PATCH 3/9] Clear some values to prevent duplicate key exception thrown --- .../Factories/SPDungeonNodeFactoryTests.cs | 59 +++++++++++++++---- 1 file changed, 47 insertions(+), 12 deletions(-) diff --git a/tests/OpenTracker.UnitTests/Models/Dungeons/Nodes/Factories/SPDungeonNodeFactoryTests.cs b/tests/OpenTracker.UnitTests/Models/Dungeons/Nodes/Factories/SPDungeonNodeFactoryTests.cs index 87c7ef52..5ca80ce4 100644 --- a/tests/OpenTracker.UnitTests/Models/Dungeons/Nodes/Factories/SPDungeonNodeFactoryTests.cs +++ b/tests/OpenTracker.UnitTests/Models/Dungeons/Nodes/Factories/SPDungeonNodeFactoryTests.cs @@ -77,6 +77,7 @@ private static void PopulateExpectedValues() ExpectedEntryValues.Clear(); ExpectedNoRequirementValues.Clear(); ExpectedBossValues.Clear(); + ExpectedComplexValues.Clear(); ExpectedItemValues.Clear(); ExpectedKeyDoorValues.Clear(); @@ -250,7 +251,8 @@ public void PopulateNodeConnections_ShouldCreateExpectedEntryConnections( var connections = new List(); _sut.PopulateNodeConnections(dungeonData, id, node, connections); - Assert.Contains(_entryFactoryCalls, x => x == _overworldNodes[fromNodeID]); + Assert.True(_entryFactoryCalls.Contains(_overworldNodes[fromNodeID]), + $"Expected entry factory to be called with overworld node {fromNodeID}"); } public static IEnumerable PopulateNodeConnections_ShouldCreateExpectedEntryConnectionsData() @@ -270,10 +272,16 @@ public void PopulateNodeConnections_ShouldCreateExpectedNoRequirementConnections var dungeonData = Substitute.For(); var node = Substitute.For(); var connections = new List(); + + // Configure the substitute to return consistent node instances + var expectedNode = Substitute.For(); + dungeonData.Nodes[fromNodeID].Returns(expectedNode); + _sut.PopulateNodeConnections(dungeonData, id, node, connections); - Assert.Contains(_connectionFactoryCalls, x => - x.fromNode == dungeonData.Nodes[fromNodeID] && x.requirement == null); + Assert.True(_connectionFactoryCalls.Any(x => + x.fromNode == expectedNode && x.requirement == null), + $"Expected connection from {fromNodeID} with no requirement for node {id}"); } public static IEnumerable PopulateNodeConnections_ShouldCreateExpectedNoRequirementConnectionsData() @@ -293,10 +301,17 @@ public void PopulateNodeConnections_ShouldCreateExpectedBossConnections( var dungeonData = Substitute.For(); var node = Substitute.For(); var connections = new List(); + + // Configure the substitute to return consistent node instances + var expectedNode = Substitute.For(); + dungeonData.Nodes[fromNodeID].Returns(expectedNode); + _sut.PopulateNodeConnections(dungeonData, id, node, connections); - Assert.Contains(_connectionFactoryCalls, x => - x.fromNode == dungeonData.Nodes[fromNodeID] && x.requirement == _bossRequirements[bossID]); + Assert.True(_connectionFactoryCalls.Any(x => + x.fromNode == expectedNode && + ReferenceEquals(x.requirement, _bossRequirements[bossID])), + $"Expected boss connection from {fromNodeID} with boss {bossID} for node {id}"); } public static IEnumerable PopulateNodeConnections_ShouldCreateExpectedBossConnectionsData() @@ -315,10 +330,17 @@ public void PopulateNodeConnections_ShouldCreateExpectedComplexConnections( var dungeonData = Substitute.For(); var node = Substitute.For(); var connections = new List(); + + // Configure the substitute to return consistent node instances + var expectedNode = Substitute.For(); + dungeonData.Nodes[fromNodeID].Returns(expectedNode); + _sut.PopulateNodeConnections(dungeonData, id, node, connections); - Assert.Contains(_connectionFactoryCalls, x => - x.fromNode == dungeonData.Nodes[fromNodeID] && x.requirement == _complexRequirements[requirementType]); + Assert.True(_connectionFactoryCalls.Any(x => + x.fromNode == expectedNode && + ReferenceEquals(x.requirement, _complexRequirements[requirementType])), + $"Expected complex connection from {fromNodeID} with type {requirementType} for node {id}"); } public static IEnumerable PopulateNodeConnections_ShouldCreateExpectedComplexConnectionsData() @@ -338,10 +360,17 @@ public void PopulateNodeConnections_ShouldCreateExpectedItemConnections( var dungeonData = Substitute.For(); var node = Substitute.For(); var connections = new List(); + + // Configure the substitute to return consistent node instances + var expectedNode = Substitute.For(); + dungeonData.Nodes[fromNodeID].Returns(expectedNode); + _sut.PopulateNodeConnections(dungeonData, id, node, connections); - Assert.Contains(_connectionFactoryCalls, x => - x.fromNode == dungeonData.Nodes[fromNodeID] && x.requirement == _itemRequirements[(type, count)]); + Assert.True(_connectionFactoryCalls.Any(x => + x.fromNode == expectedNode && + ReferenceEquals(x.requirement, _itemRequirements[(type, count)])), + $"Expected item connection from {fromNodeID} requiring {type}x{count} for node {id}"); } public static IEnumerable PopulateNodeConnections_ShouldCreateExpectedItemConnectionsData() @@ -360,11 +389,17 @@ public void PopulateNodeConnections_ShouldCreateExpectedKeyDoorConnections( var dungeonData = Substitute.For(); var node = Substitute.For(); var connections = new List(); + + // Configure the substitute to return consistent node instances + var expectedNode = Substitute.For(); + dungeonData.Nodes[fromNodeID].Returns(expectedNode); + _sut.PopulateNodeConnections(dungeonData, id, node, connections); - Assert.Contains(_connectionFactoryCalls, x => - x.fromNode == dungeonData.Nodes[fromNodeID] && - x.requirement == dungeonData.KeyDoors[keyDoor].Requirement); + Assert.True(_connectionFactoryCalls.Any(x => + x.fromNode == expectedNode && + ReferenceEquals(x.requirement, dungeonData.KeyDoors[keyDoor].Requirement)), + $"Expected key door connection from {fromNodeID} with door {keyDoor} for node {id}"); } public static IEnumerable PopulateNodeConnections_ShouldCreateExpectedKeyDoorConnectionsData() From 2d57a6aa41ae1b8c1437e79b0fa7f5735c6500a2 Mon Sep 17 00:00:00 2001 From: chumbayaa Date: Sat, 15 Nov 2025 22:10:21 +0000 Subject: [PATCH 4/9] Update package dependencies across projects to latest versions --- .../OpenTracker.Models.csproj | 4 ++-- .../OpenTracker.Utils.csproj | 4 ++-- src/OpenTracker/OpenTracker.csproj | 20 +++++++++---------- .../OpenTracker.UnitTests.csproj | 6 +++--- 4 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/OpenTracker.Models/OpenTracker.Models.csproj b/src/OpenTracker.Models/OpenTracker.Models.csproj index d03ccd80..8c6ec6bf 100644 --- a/src/OpenTracker.Models/OpenTracker.Models.csproj +++ b/src/OpenTracker.Models/OpenTracker.Models.csproj @@ -8,13 +8,13 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/src/OpenTracker.Utils/OpenTracker.Utils.csproj b/src/OpenTracker.Utils/OpenTracker.Utils.csproj index d06ecb9a..cb36b90d 100644 --- a/src/OpenTracker.Utils/OpenTracker.Utils.csproj +++ b/src/OpenTracker.Utils/OpenTracker.Utils.csproj @@ -15,8 +15,8 @@ - - + + \ No newline at end of file diff --git a/src/OpenTracker/OpenTracker.csproj b/src/OpenTracker/OpenTracker.csproj index 04ad598d..adbc9a3c 100644 --- a/src/OpenTracker/OpenTracker.csproj +++ b/src/OpenTracker/OpenTracker.csproj @@ -54,7 +54,7 @@ - + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -66,15 +66,15 @@ - - - - - - - - - + + + + + + + + + 0.1.232 diff --git a/tests/OpenTracker.UnitTests/OpenTracker.UnitTests.csproj b/tests/OpenTracker.UnitTests/OpenTracker.UnitTests.csproj index fe8baa13..0a52d729 100644 --- a/tests/OpenTracker.UnitTests/OpenTracker.UnitTests.csproj +++ b/tests/OpenTracker.UnitTests/OpenTracker.UnitTests.csproj @@ -8,8 +8,8 @@ - - + + @@ -19,7 +19,7 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - + all runtime; build; native; contentfiles; analyzers; buildtransitive From 41c370454b0c656095b29ab43ceb8fd82aee2756 Mon Sep 17 00:00:00 2001 From: chumbayaa Date: Sat, 15 Nov 2025 22:10:56 +0000 Subject: [PATCH 5/9] Refactor `ConfigureAvalonia` to separate Autofac resolver and ReactiveUI setup. --- .../ContainerBuilderAvaloniaExtensions.cs | 38 +++++++++++-------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/src/OpenTracker/Autofac/ContainerBuilderAvaloniaExtensions.cs b/src/OpenTracker/Autofac/ContainerBuilderAvaloniaExtensions.cs index b169862a..d4b6f341 100644 --- a/src/OpenTracker/Autofac/ContainerBuilderAvaloniaExtensions.cs +++ b/src/OpenTracker/Autofac/ContainerBuilderAvaloniaExtensions.cs @@ -13,20 +13,26 @@ namespace OpenTracker.Autofac; public static class ContainerBuilderAvaloniaExtensions { public static ContainerBuilder ConfigureAvalonia(this ContainerBuilder builder) - { - var autofacResolver = builder.UseAutofacDependencyResolver(); - builder.RegisterInstance(autofacResolver); - autofacResolver.InitializeReactiveUI(); - - RxApp.MainThreadScheduler = AvaloniaScheduler.Instance; - - Locator.CurrentMutable.RegisterConstant( - new AvaloniaActivationForViewFetcher(), - typeof(IActivationForViewFetcher)); - Locator.CurrentMutable.RegisterConstant( - new AutoDataTemplateBindingHook(), - typeof(IPropertyBindingHook)); - - return builder; - } +{ + ConfigureAutofacResolver(builder); + ConfigureReactiveUIServices(); + return builder; +} + +private static void ConfigureAutofacResolver(ContainerBuilder builder) +{ + var autofacResolver = builder.UseAutofacDependencyResolver(); + builder.RegisterInstance(autofacResolver); + RxApp.MainThreadScheduler = AvaloniaScheduler.Instance; +} + +private static void ConfigureReactiveUIServices() +{ + Locator.CurrentMutable.RegisterConstant( + new AvaloniaActivationForViewFetcher(), + typeof(IActivationForViewFetcher)); + Locator.CurrentMutable.RegisterConstant( + new AutoDataTemplateBindingHook(), + typeof(IPropertyBindingHook)); +} } \ No newline at end of file From 167f120e59be2eb53d94ab1ee238e7de6d0b366f Mon Sep 17 00:00:00 2001 From: chumbayaa Date: Sat, 15 Nov 2025 22:21:10 +0000 Subject: [PATCH 6/9] Refactor exception handling for invalid SNES connector requests and remove unused imports. --- .../Requests/GetDeviceInfoRequest.cs | 6 ++---- .../SNESConnectors/Requests/GetDevicesRequest.cs | 5 ++--- .../Requests/RegisterNameRequest.cs | 1 - .../SNESConnectors/Requests/RequestBase.cs | 1 - .../InvalidRequestResponseException.cs | 16 ++++++++++++++++ src/OpenTracker/App.axaml.cs | 2 -- .../ContainerBuilderAvaloniaExtensions.cs | 1 - .../ValueConverters/BitmapValueConverter.cs | 3 +-- 8 files changed, 21 insertions(+), 14 deletions(-) create mode 100644 src/OpenTracker.Models/Exceptions/InvalidRequestResponseException.cs diff --git a/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/GetDeviceInfoRequest.cs b/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/GetDeviceInfoRequest.cs index e1491bed..6b928f0b 100644 --- a/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/GetDeviceInfoRequest.cs +++ b/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/GetDeviceInfoRequest.cs @@ -1,10 +1,9 @@ -using System; using System.Collections.Generic; using System.Threading; using Newtonsoft.Json; using OpenTracker.Models.AutoTracking.SNESConnectors.Socket; +using OpenTracker.Models.Exceptions; using OpenTracker.Models.Logging; -using LogLevel = OpenTracker.Models.Logging.LogLevel; namespace OpenTracker.Models.AutoTracking.SNESConnectors.Requests { @@ -34,8 +33,7 @@ public override IEnumerable ProcessResponseAndReturnResults(IMessageEven if (!deserialized!.TryGetValue("Results", out var results)) { - throw new Exception( - $"Request \'{Description}\' is invalid and does not contain a \'Results\' key."); + throw new InvalidRequestResponseException(Description, "Results"); } Logger.Debug("Request \'{Description}\' response successfully deserialized", diff --git a/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/GetDevicesRequest.cs b/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/GetDevicesRequest.cs index 227f41b0..8d81b3de 100644 --- a/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/GetDevicesRequest.cs +++ b/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/GetDevicesRequest.cs @@ -3,8 +3,8 @@ using System.Threading; using Newtonsoft.Json; using OpenTracker.Models.AutoTracking.SNESConnectors.Socket; +using OpenTracker.Models.Exceptions; using OpenTracker.Models.Logging; -using LogLevel = OpenTracker.Models.Logging.LogLevel; namespace OpenTracker.Models.AutoTracking.SNESConnectors.Requests { @@ -34,8 +34,7 @@ public override IEnumerable ProcessResponseAndReturnResults(IMessageEven if (!deserialized!.TryGetValue("Results", out var results)) { - throw new Exception( - $"Request \'{Description}\' is invalid and does not contain a \'Results\' key."); + throw new InvalidRequestResponseException(Description, "Results"); } Logger.Debug("Request \'{Description}\' response successfully deserialized", diff --git a/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/RegisterNameRequest.cs b/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/RegisterNameRequest.cs index e96ecec9..06ae0969 100644 --- a/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/RegisterNameRequest.cs +++ b/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/RegisterNameRequest.cs @@ -3,7 +3,6 @@ using System.Threading; using OpenTracker.Models.AutoTracking.SNESConnectors.Socket; using OpenTracker.Models.Logging; -using WebSocketSharp; namespace OpenTracker.Models.AutoTracking.SNESConnectors.Requests { diff --git a/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/RequestBase.cs b/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/RequestBase.cs index a535ad5a..6db257d5 100644 --- a/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/RequestBase.cs +++ b/src/OpenTracker.Models/AutoTracking/SNESConnectors/Requests/RequestBase.cs @@ -3,7 +3,6 @@ using Newtonsoft.Json; using OpenTracker.Models.AutoTracking.SNESConnectors.Socket; using OpenTracker.Models.Logging; -using LogLevel = OpenTracker.Models.Logging.LogLevel; namespace OpenTracker.Models.AutoTracking.SNESConnectors.Requests { diff --git a/src/OpenTracker.Models/Exceptions/InvalidRequestResponseException.cs b/src/OpenTracker.Models/Exceptions/InvalidRequestResponseException.cs new file mode 100644 index 00000000..16b51101 --- /dev/null +++ b/src/OpenTracker.Models/Exceptions/InvalidRequestResponseException.cs @@ -0,0 +1,16 @@ +using System; + +namespace OpenTracker.Models.Exceptions; + +public class InvalidRequestResponseException : Exception +{ + public string RequestDescription { get; } + public string MissingKey { get; } + + public InvalidRequestResponseException(string requestDescription, string missingKey) + : base($"Request '{requestDescription}' is invalid and does not contain a '{missingKey}' key.") + { + RequestDescription = requestDescription; + MissingKey = missingKey; + } +} \ No newline at end of file diff --git a/src/OpenTracker/App.axaml.cs b/src/OpenTracker/App.axaml.cs index 945dbd26..a57f9b40 100644 --- a/src/OpenTracker/App.axaml.cs +++ b/src/OpenTracker/App.axaml.cs @@ -3,9 +3,7 @@ using Avalonia; using Avalonia.Controls; using Avalonia.Controls.ApplicationLifetimes; -using Avalonia.Logging; using Avalonia.Markup.Xaml; -using OpenTracker.Models; using OpenTracker.Models.SaveLoad; using OpenTracker.Utils; using OpenTracker.Utils.Themes; diff --git a/src/OpenTracker/Autofac/ContainerBuilderAvaloniaExtensions.cs b/src/OpenTracker/Autofac/ContainerBuilderAvaloniaExtensions.cs index d4b6f341..beffdba5 100644 --- a/src/OpenTracker/Autofac/ContainerBuilderAvaloniaExtensions.cs +++ b/src/OpenTracker/Autofac/ContainerBuilderAvaloniaExtensions.cs @@ -1,6 +1,5 @@ using Autofac; using Avalonia.ReactiveUI; -using Avalonia.Threading; using ReactiveUI; using Splat; using Splat.Autofac; diff --git a/src/OpenTracker/ValueConverters/BitmapValueConverter.cs b/src/OpenTracker/ValueConverters/BitmapValueConverter.cs index ac2eba62..6cc3959b 100644 --- a/src/OpenTracker/ValueConverters/BitmapValueConverter.cs +++ b/src/OpenTracker/ValueConverters/BitmapValueConverter.cs @@ -2,7 +2,6 @@ using System.Diagnostics; using System.Globalization; using System.IO; -using Avalonia; using Avalonia.Data.Converters; using Avalonia.Media; using Avalonia.Media.Imaging; @@ -56,7 +55,7 @@ public class BitmapValueConverter : IValueConverter public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) { - throw new Exception("All bindings should be one-way."); + throw new NotSupportedException("All bindings should be one-way."); } } } From d16bfcf277c57e750ae1b03b114b7613b67ea0be Mon Sep 17 00:00:00 2001 From: trippsc2 <46848743+trippsc2@users.noreply.github.com> Date: Tue, 20 Jan 2026 09:01:41 -0500 Subject: [PATCH 7/9] Added ColorPicker style. Adjusted view code to match new ColorPicker control. --- src/OpenTracker/App.axaml | 1 + .../Views/ColorSelect/ColorPickerControl.axaml | 13 ------------- .../ColorSelect/ColorPickerControl.axaml.cs | 18 ------------------ .../Views/ColorSelect/ColorSelectControl.axaml | 9 ++------- 4 files changed, 3 insertions(+), 38 deletions(-) delete mode 100644 src/OpenTracker/Views/ColorSelect/ColorPickerControl.axaml delete mode 100644 src/OpenTracker/Views/ColorSelect/ColorPickerControl.axaml.cs diff --git a/src/OpenTracker/App.axaml b/src/OpenTracker/App.axaml index 870e7f6b..25789cce 100644 --- a/src/OpenTracker/App.axaml +++ b/src/OpenTracker/App.axaml @@ -9,6 +9,7 @@ +