Skip to content

Commit

Permalink
Merge pull request #56 from AscensionGameDev/main
Browse files Browse the repository at this point in the history
fix: editor NSE for instance type strings (AscensionGameDev#2260)
  • Loading branch information
dhmello authored Jul 23, 2024
2 parents 310f6d3 + e492c22 commit 96fd4ed
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 96fd4ed

Please sign in to comment.