From f1f97e98215a036225b877152600be8cdc0f469f Mon Sep 17 00:00:00 2001 From: Arufonsu <17498701+Arufonsu@users.noreply.github.com> Date: Sat, 25 May 2024 12:28:46 -0400 Subject: [PATCH] fix: editor NSE for instance type strings --- .../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 6129db4614..db3a291639 100644 --- a/Intersect.Editor/Forms/DockingElements/frmMapLayers.cs +++ b/Intersect.Editor/Forms/DockingElements/frmMapLayers.cs @@ -128,7 +128,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.Type[(int)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 952de40611..637a9c9653 100644 --- a/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Warp.cs +++ b/Intersect.Editor/Forms/Editors/Events/Event Commands/EventCommand_Warp.cs @@ -53,7 +53,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.Type[(int)instanceType]); } cmbInstanceType.SelectedIndex = (int) mMyCommand.InstanceType; } diff --git a/Intersect.Editor/Localization/Strings.cs b/Intersect.Editor/Localization/Strings.cs index d3b5ad4a4a..19c2e0ed12 100644 --- a/Intersect.Editor/Localization/Strings.cs +++ b/Intersect.Editor/Localization/Strings.cs @@ -4197,6 +4197,18 @@ public partial struct MapGrid } + public partial struct MapInstance + { + [JsonProperty(NullValueHandling = NullValueHandling.Ignore)] + public static Dictionary Type = new Dictionary + { + {(int) MapInstanceType.Overworld, @"Overworld"}, + {(int) MapInstanceType.Personal, @"Personal"}, + {(int) MapInstanceType.Guild, @"Guild"}, + {(int) MapInstanceType.Shared, @"Shared"}, + }; + } + public partial struct MapLayers { @@ -4249,14 +4261,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?";