Editor UI fixes: UI of the selected item is added to GUIUpdateList in wiring/character mode, save/load/item menus can't be clicked when hidden by wiring/character mode

This commit is contained in:
Regalis
2017-02-27 19:59:19 +02:00
parent c3b8f2a1db
commit b635a61bb4
+29 -13
View File
@@ -418,6 +418,9 @@ namespace Barotrauma
private void CreateSaveScreen() private void CreateSaveScreen()
{ {
if (characterMode) ToggleCharacterMode();
if (wiringMode) ToggleWiringMode();
int width = 400, height = 400; int width = 400, height = 400;
int y = 0; int y = 0;
@@ -502,6 +505,9 @@ namespace Barotrauma
private bool CreateLoadScreen(GUIButton button, object obj) private bool CreateLoadScreen(GUIButton button, object obj)
{ {
if (characterMode) ToggleCharacterMode();
if (wiringMode) ToggleWiringMode();
Submarine.RefreshSavedSubs(); Submarine.RefreshSavedSubs();
int width = 300, height = 400; int width = 300, height = 400;
@@ -596,10 +602,14 @@ namespace Barotrauma
private bool SelectTab(GUIButton button, object obj) private bool SelectTab(GUIButton button, object obj)
{ {
if (characterMode) ToggleCharacterMode();
if (wiringMode) ToggleWiringMode();
selectedTab = (int)obj; selectedTab = (int)obj;
var searchBox = GUItabs[selectedTab].GetChild<GUITextBox>(); var searchBox = GUItabs[selectedTab].GetChild<GUITextBox>();
ClearFilter(searchBox, null); ClearFilter(searchBox, null);
searchBox.Text = "";
searchBox.AddToGUIUpdateList(); searchBox.AddToGUIUpdateList();
searchBox.Select(); searchBox.Select();
@@ -899,22 +909,28 @@ namespace Barotrauma
wiringToolPanel.AddToGUIUpdateList(); wiringToolPanel.AddToGUIUpdateList();
} }
if (loadFrame != null)
{
loadFrame.AddToGUIUpdateList();
}
else if (saveFrame != null)
{
saveFrame.AddToGUIUpdateList();
}
else if (selectedTab > -1)
{
GUItabs[selectedTab].AddToGUIUpdateList();
}
if ((characterMode || wiringMode) && dummyCharacter != null) if ((characterMode || wiringMode) && dummyCharacter != null)
{ {
CharacterHUD.AddToGUIUpdateList(dummyCharacter); CharacterHUD.AddToGUIUpdateList(dummyCharacter);
if (dummyCharacter.SelectedConstruction != null)
{
dummyCharacter.SelectedConstruction.AddToGUIUpdateList();
}
}
else
{
if (loadFrame != null)
{
loadFrame.AddToGUIUpdateList();
}
else if (saveFrame != null)
{
saveFrame.AddToGUIUpdateList();
}
else if (selectedTab > -1)
{
GUItabs[selectedTab].AddToGUIUpdateList();
}
} }
GUI.AddToGUIUpdateList(); GUI.AddToGUIUpdateList();