Skip to content

Commit

Permalink
fix: editor NSE for instance type strings (AscensionGameDev#2260)
Browse files Browse the repository at this point in the history
  • Loading branch information
Arufonsu authored Jul 22, 2024
1 parent e9de494 commit e492c22
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 @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
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 @@ -4195,6 +4195,18 @@ public partial struct MapGrid

}

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

public partial struct MapLayers
{

Expand Down Expand Up @@ -4247,14 +4259,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 e492c22

Please sign in to comment.