From e492c22fbf218f47736db22f30c8b4838e8075c5 Mon Sep 17 00:00:00 2001 From: Fernando Arzola <17498701+Arufonsu@users.noreply.github.com> Date: Mon, 22 Jul 2024 19:18:33 -0400 Subject: [PATCH] fix: editor NSE for instance type strings (#2260) --- .../Forms/DockingElements/frmMapLayers.cs | 2 +- .../Event Commands/EventCommand_Warp.cs | 2 +- Intersect.Editor/Localization/Strings.cs | 20 +++++++++++-------- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Intersect.Editor/Forms/DockingElements/frmMapLayers.cs b/Intersect.Editor/Forms/DockingElements/frmMapLayers.cs index 220dee6e58..1c60158407 100644 --- a/Intersect.Editor/Forms/DockingElements/frmMapLayers.cs +++ b/Intersect.Editor/Forms/DockingElements/frmMapLayers.cs @@ -122,7 +122,7 @@ public void Init() // We do not want to iterate over the "NoChange" enum foreach (MapInstanceType instanceType in Enum.GetValues(typeof(MapInstanceType))) { - cmbInstanceType.Items.Add(instanceType.ToString()); + cmbInstanceType.Items.Add(Strings.MapInstance.InstanceTypes[instanceType]); } cmbInstanceType.SelectedIndex = 0; diff --git a/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Warp.cs b/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Warp.cs index 29c5db4aad..20198d6f46 100644 --- a/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Warp.cs +++ b/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Warp.cs @@ -50,7 +50,7 @@ public EventCommandWarp(WarpCommand refCommand, FrmEvent editor) // We do not want to iterate over the "NoChange" enum foreach (MapInstanceType instanceType in Enum.GetValues(typeof(MapInstanceType))) { - cmbInstanceType.Items.Add(instanceType.ToString()); + cmbInstanceType.Items.Add(Strings.MapInstance.InstanceTypes[instanceType]); } cmbInstanceType.SelectedIndex = (int) mMyCommand.InstanceType; } diff --git a/Intersect.Editor/Localization/Strings.cs b/Intersect.Editor/Localization/Strings.cs index 37244f0cd5..6049875461 100644 --- a/Intersect.Editor/Localization/Strings.cs +++ b/Intersect.Editor/Localization/Strings.cs @@ -4195,6 +4195,18 @@ public partial struct MapGrid } + public partial struct MapInstance + { + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] + public static Dictionary InstanceTypes = new Dictionary + { + {MapInstanceType.Overworld, @"Overworld" }, + {MapInstanceType.Personal, @"Personal" }, + {MapInstanceType.Guild, @"Guild" }, + {MapInstanceType.Shared, @"Shared" } + }; + } + public partial struct MapLayers { @@ -4247,14 +4259,6 @@ public partial struct MapList public partial struct Mapping { - public static LocaleDictionary InstanceTypes = new LocaleDictionary() - { - {MapInstanceType.Overworld, @"Overworld"}, - {MapInstanceType.Personal, @"Personal"}, - {MapInstanceType.Guild, @"Guild"}, - {MapInstanceType.Shared, @"Shared"}, - }; - public static LocalizedString createmap = @"Create new map."; public static LocalizedString createmapdialogue = @"Do you want to create a map here?";