From 32ceb1ea5610f1ffa10368b423913c2f11f6aa66 Mon Sep 17 00:00:00 2001 From: Christopher Cyclonit Klinge Date: Sat, 4 Feb 2023 13:56:25 +0100 Subject: [PATCH] Added a locking mechanism to islands. --- .../MapTemplates/Models/MapElement.cs | 13 ++++ .../FixedIslandProperties.xaml | 63 +++++++++++-------- .../RandomIslandProperties.xaml | 51 +++++++++------ .../Controls/MapTemplates/IslandControl.xaml | 24 +++++++ .../MapTemplates/IslandControl.xaml.cs | 4 +- .../Controls/MapTemplates/IslandViewModel.cs | 5 ++ .../MapTemplates/MapElementViewModel.cs | 3 +- 7 files changed, 114 insertions(+), 49 deletions(-) diff --git a/AnnoMapEditor/MapTemplates/Models/MapElement.cs b/AnnoMapEditor/MapTemplates/Models/MapElement.cs index e44a98a..9cb0b24 100644 --- a/AnnoMapEditor/MapTemplates/Models/MapElement.cs +++ b/AnnoMapEditor/MapTemplates/Models/MapElement.cs @@ -14,6 +14,19 @@ public Vector2 Position } private Vector2 _position = Vector2.Zero; + public bool IsLocked + { + get => _isLocked; + set => SetProperty(ref _isLocked, value, new[] { nameof(IsUnlocked) }); + } + private bool _isLocked; + + public bool IsUnlocked + { + get => !_isLocked; + set => SetProperty(ref _isLocked, !value, new[] { nameof(IsLocked) }); + } + public MapElement() { diff --git a/AnnoMapEditor/UI/Controls/IslandProperties/FixedIslandProperties.xaml b/AnnoMapEditor/UI/Controls/IslandProperties/FixedIslandProperties.xaml index fe21c52..f4117c3 100644 --- a/AnnoMapEditor/UI/Controls/IslandProperties/FixedIslandProperties.xaml +++ b/AnnoMapEditor/UI/Controls/IslandProperties/FixedIslandProperties.xaml @@ -34,49 +34,58 @@ HorizontalAlignment="Left" Text="Fixed Island" Margin="0"/> - - - + + + + - + - - + - - - - - - -