Skip to content

Commit

Permalink
fix: editor NSE for instance type strings
Browse files Browse the repository at this point in the history
  • Loading branch information
Arufonsu committed May 25, 2024
1 parent 26bd1e5 commit f1f97e9
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
2 changes: 1 addition & 1 deletion Intersect.Editor/Forms/DockingElements/frmMapLayers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
20 changes: 12 additions & 8 deletions Intersect.Editor/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4197,6 +4197,18 @@ public partial struct MapGrid

}

public partial struct MapInstance
{
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static Dictionary<int, LocalizedString> Type = new Dictionary<int, LocalizedString>
{
{(int) MapInstanceType.Overworld, @"Overworld"},
{(int) MapInstanceType.Personal, @"Personal"},
{(int) MapInstanceType.Guild, @"Guild"},
{(int) MapInstanceType.Shared, @"Shared"},
};
}

public partial struct MapLayers
{

Expand Down Expand Up @@ -4249,14 +4261,6 @@ public partial struct MapList

public partial struct Mapping
{
public static LocaleDictionary<MapInstanceType, LocalizedString> InstanceTypes = new LocaleDictionary<MapInstanceType, LocalizedString>()
{
{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?";
Expand Down

0 comments on commit f1f97e9

Please sign in to comment.