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
+20 -4
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,6 +909,16 @@ namespace Barotrauma
wiringToolPanel.AddToGUIUpdateList(); wiringToolPanel.AddToGUIUpdateList();
} }
if ((characterMode || wiringMode) && dummyCharacter != null)
{
CharacterHUD.AddToGUIUpdateList(dummyCharacter);
if (dummyCharacter.SelectedConstruction != null)
{
dummyCharacter.SelectedConstruction.AddToGUIUpdateList();
}
}
else
{
if (loadFrame != null) if (loadFrame != null)
{ {
loadFrame.AddToGUIUpdateList(); loadFrame.AddToGUIUpdateList();
@@ -911,10 +931,6 @@ namespace Barotrauma
{ {
GUItabs[selectedTab].AddToGUIUpdateList(); GUItabs[selectedTab].AddToGUIUpdateList();
} }
if ((characterMode || wiringMode) && dummyCharacter != null)
{
CharacterHUD.AddToGUIUpdateList(dummyCharacter);
} }
GUI.AddToGUIUpdateList(); GUI.AddToGUIUpdateList();