Skip to content

Commit

Permalink
Fixed a bug, that caused the spectator admin menu to be the ring admi…
Browse files Browse the repository at this point in the history
…n menu
  • Loading branch information
8vogt committed Nov 26, 2020
1 parent 64992ab commit 0469069
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
12 changes: 7 additions & 5 deletions SEWorldGenPlugin/GUI/PluginAdminMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ public override void RecreateControls(bool constructor)

MyGuiControlCombobox modeCombo = GetCombo();

int oldCount = modeCombo.GetItemsCount();

if (MySession.Static.IsUserSpaceMaster(Sync.MyId) && MySession.Static.IsUserAdmin(Sync.MyId))
{
modeCombo.AddItem(9L, "SEWorldGenPlugin - Rings");
modeCombo.AddItem(10L, "SEWorldGenPlugin - Planets");
modeCombo.AddItem(oldCount, "SEWorldGenPlugin - Rings");
modeCombo.AddItem(oldCount + 1, "SEWorldGenPlugin - Planets");
}

MyGuiControlCombobox newCombo = AddCombo();
Expand All @@ -120,7 +122,7 @@ public override void RecreateControls(bool constructor)
newCombo.ItemSelected += delegate
{
m_currentKey = newCombo.GetSelectedKey();
if (newCombo.GetSelectedKey() > 8)
if (newCombo.GetSelectedKey() >= oldCount)
{
RecreateControls(false);
}
Expand All @@ -132,12 +134,12 @@ public override void RecreateControls(bool constructor)
RecreateControls(false);
}
};
if(newCombo.GetSelectedKey() == 9)
if(newCombo.GetSelectedKey() == oldCount)
{
ClearControls();
CheckBuildPluginControls(BuildRingMenu);
}
else if(newCombo.GetSelectedKey() == 10)
else if(newCombo.GetSelectedKey() == oldCount + 1)
{
ClearControls();
CheckBuildPluginControls(BuildPlanetMenu);
Expand Down
2 changes: 1 addition & 1 deletion SEWorldGenPlugin/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.6.5")]
[assembly: AssemblyVersion("1.7.6.6")]
[assembly: AssemblyFileVersion("1.0.0")]

0 comments on commit 0469069

Please sign in to comment.