(a13c74ce0) Fixed: Loading screen dismissable & escape usable when the game is not active

This commit is contained in:
Joonas Rikkonen
2019-05-23 15:10:38 +03:00
parent 1cd47a351e
commit 827f54fcff
2 changed files with 25 additions and 25 deletions
@@ -618,7 +618,7 @@ namespace Barotrauma
GameMain.ResetFrameTime(); GameMain.ResetFrameTime();
if (TitleScreen.LoadState >= 100.0f && if (TitleScreen.LoadState >= 100.0f &&
(!waitForKeyHit || PlayerInput.GetKeyboardState.GetPressedKeys().Length>0 || PlayerInput.LeftButtonClicked())) (!waitForKeyHit || ((PlayerInput.GetKeyboardState.GetPressedKeys().Length > 0 || PlayerInput.LeftButtonClicked()) && WindowActive)))
{ {
loadingScreenOpen = false; loadingScreenOpen = false;
} }
@@ -637,7 +637,7 @@ namespace Barotrauma
{ {
SoundPlayer.Update((float)Timing.Step); SoundPlayer.Update((float)Timing.Step);
if (PlayerInput.KeyHit(Keys.Escape)) if (PlayerInput.KeyHit(Keys.Escape) && WindowActive)
{ {
// Check if a text input is selected. // Check if a text input is selected.
if (GUI.KeyboardDispatcher.Subscriber != null) if (GUI.KeyboardDispatcher.Subscriber != null)
@@ -365,34 +365,11 @@ namespace Barotrauma.Tutorials
} while (mechanic.Inventory.FindItemByIdentifier("oxygentank") == null || mechanic.Inventory.FindItemByIdentifier("sodium") == null); // Wait until looted } while (mechanic.Inventory.FindItemByIdentifier("oxygentank") == null || mechanic.Inventory.FindItemByIdentifier("sodium") == null); // Wait until looted
yield return new WaitForSeconds(1.0f, false); yield return new WaitForSeconds(1.0f, false);
SetHighlight(mechanic_craftingCabinet.Item, false); SetHighlight(mechanic_craftingCabinet.Item, false);
SetHighlight(mechanic_deconstructor.Item, true); SetHighlight(mechanic_deconstructor.Item, true);
do do
{ {
if (IsSelectedItem(mechanic_deconstructor.Item)) if (IsSelectedItem(mechanic_deconstructor.Item))
{ {
if (mechanic.Inventory.FindItemByIdentifier("oxygentank") != null)
{
HighlightInventorySlot(mechanic.Inventory, "oxygentank", highlightColor, .5f, .5f, 0f);
if (mechanic_deconstructor.InputContainer.Inventory.slots != null)
{
for (int i = 0; i < mechanic_deconstructor.InputContainer.Inventory.slots.Length; i++)
{
HighlightInventorySlot(mechanic_deconstructor.InputContainer.Inventory, i, highlightColor, .5f, .5f, 0f);
}
}
}
if (mechanic_deconstructor.InputContainer.Inventory.FindItemByIdentifier("oxygentank") != null && !mechanic_deconstructor.IsActive)
{
if (mechanic_deconstructor.ActivateButton.Frame.FlashTimer <= 0)
{
mechanic_deconstructor.ActivateButton.Frame.Flash(highlightColor, 1.5f, false);
}
}
if (mechanic_deconstructor.OutputContainer.Inventory.FindItemByIdentifier("aluminium") != null) if (mechanic_deconstructor.OutputContainer.Inventory.FindItemByIdentifier("aluminium") != null)
{ {
HighlightInventorySlot(mechanic_deconstructor.OutputContainer.Inventory, "aluminium", highlightColor, .5f, .5f, 0f); HighlightInventorySlot(mechanic_deconstructor.OutputContainer.Inventory, "aluminium", highlightColor, .5f, .5f, 0f);
@@ -402,6 +379,29 @@ namespace Barotrauma.Tutorials
if (mechanic.Inventory.Items[i] == null) HighlightInventorySlot(mechanic.Inventory, i, highlightColor, .5f, .5f, 0f); if (mechanic.Inventory.Items[i] == null) HighlightInventorySlot(mechanic.Inventory, i, highlightColor, .5f, .5f, 0f);
} }
} }
else
{
if (mechanic.Inventory.FindItemByIdentifier("oxygentank") != null && mechanic_deconstructor.InputContainer.Inventory.FindItemByIdentifier("oxygentank") == null)
{
HighlightInventorySlot(mechanic.Inventory, "oxygentank", highlightColor, .5f, .5f, 0f);
if (mechanic_deconstructor.InputContainer.Inventory.slots != null)
{
for (int i = 0; i < mechanic_deconstructor.InputContainer.Inventory.slots.Length; i++)
{
HighlightInventorySlot(mechanic_deconstructor.InputContainer.Inventory, i, highlightColor, .5f, .5f, 0f);
}
}
}
if (mechanic_deconstructor.InputContainer.Inventory.FindItemByIdentifier("oxygentank") != null && !mechanic_deconstructor.IsActive)
{
if (mechanic_deconstructor.ActivateButton.Frame.FlashTimer <= 0)
{
mechanic_deconstructor.ActivateButton.Frame.Flash(highlightColor, 1.5f, false);
}
}
}
} }
yield return null; yield return null;
} while (mechanic.Inventory.FindItemByIdentifier("aluminium") == null); // Wait until deconstructed } while (mechanic.Inventory.FindItemByIdentifier("aluminium") == null); // Wait until deconstructed