(6c4495e04) Fixed: Mechanic cabinet highlighting before deconstructing
This commit is contained in:
@@ -347,22 +347,39 @@ namespace Barotrauma.Tutorials
|
||||
SetHighlight(mechanic_craftingCabinet.Item, true);
|
||||
do
|
||||
{
|
||||
for (int i = 0; i < mechanic_craftingCabinet.Inventory.Items.Length; i++)
|
||||
{
|
||||
if (mechanic_craftingCabinet.Inventory.Items[i] != null)
|
||||
{
|
||||
HighlightInventorySlot(mechanic_craftingCabinet.Inventory, i, highlightColor, .5f, .5f, 0f);
|
||||
}
|
||||
}
|
||||
if (mechanic.SelectedConstruction == mechanic_craftingCabinet.Item)
|
||||
{
|
||||
for (int i = 0; i < mechanic.Inventory.slots.Length; i++)
|
||||
{
|
||||
if (mechanic.Inventory.Items[i] == null) HighlightInventorySlot(mechanic.Inventory, i, highlightColor, .5f, .5f, 0f);
|
||||
}
|
||||
|
||||
if (mechanic.Inventory.FindItemByIdentifier("oxygentank") == null && mechanic.Inventory.FindItemByIdentifier("aluminium") == null)
|
||||
{
|
||||
for (int i = 0; i < mechanic_craftingCabinet.Inventory.Items.Length; i++)
|
||||
{
|
||||
Item item = mechanic_craftingCabinet.Inventory.Items[i];
|
||||
if (item != null && item.prefab.Identifier == "oxygentank")
|
||||
{
|
||||
HighlightInventorySlot(mechanic_craftingCabinet.Inventory, i, highlightColor, .5f, .5f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (mechanic.Inventory.FindItemByIdentifier("sodium") == null)
|
||||
{
|
||||
for (int i = 0; i < mechanic_craftingCabinet.Inventory.Items.Length; i++)
|
||||
{
|
||||
Item item = mechanic_craftingCabinet.Inventory.Items[i];
|
||||
if (item != null && item.prefab.Identifier == "sodium")
|
||||
{
|
||||
HighlightInventorySlot(mechanic_craftingCabinet.Inventory, i, highlightColor, .5f, .5f, 0f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
yield return null;
|
||||
} while (mechanic.Inventory.FindItemByIdentifier("oxygentank") == null || mechanic.Inventory.FindItemByIdentifier("sodium") == null); // Wait until looted
|
||||
} while ((mechanic.Inventory.FindItemByIdentifier("oxygentank") == null && mechanic.Inventory.FindItemByIdentifier("aluminium") == null) || mechanic.Inventory.FindItemByIdentifier("sodium") == null); // Wait until looted
|
||||
yield return new WaitForSeconds(1.0f, false);
|
||||
SetHighlight(mechanic_craftingCabinet.Item, false);
|
||||
SetHighlight(mechanic_deconstructor.Item, true);
|
||||
|
||||
@@ -521,10 +521,21 @@ namespace Barotrauma
|
||||
GUIButton otherButton = child as GUIButton;
|
||||
if (otherButton == null || otherButton == button) continue;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public bool ReturnToMainMenu(GUIButton button, object obj)
|
||||
{
|
||||
GUI.PreventPauseMenuToggle = false;
|
||||
|
||||
if (Selected != this)
|
||||
{
|
||||
Select();
|
||||
}
|
||||
else
|
||||
{
|
||||
ResetButtonStates(button);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -614,6 +625,33 @@ namespace Barotrauma
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < tutorialList.Content.Children.Count(); i++)
|
||||
{
|
||||
if (i < completedTutorials + 1)
|
||||
{
|
||||
(tutorialList.Content.GetChild(i) as GUITextBlock).TextColor = Color.LightGreen;
|
||||
#if !DEBUG
|
||||
(tutorialList.Content.GetChild(i) as GUITextBlock).CanBeFocused = true;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
{
|
||||
(tutorialList.Content.GetChild(i) as GUITextBlock).TextColor = Color.Gray;
|
||||
#if !DEBUG
|
||||
(tutorialList.Content.GetChild(i) as GUITextBlock).CanBeFocused = false;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetSettingsFrame(GameSettings.Tab selectedTab = GameSettings.Tab.Graphics)
|
||||
{
|
||||
menuTabs[(int)Tab.Settings].RectTransform.ClearChildren();
|
||||
GameMain.Config.ResetSettingsFrame();
|
||||
GameMain.Config.CreateSettingsFrame(selectedTab);
|
||||
GameMain.Config.SettingsFrame.RectTransform.Parent = menuTabs[(int)Tab.Settings].RectTransform;
|
||||
GameMain.Config.SettingsFrame.RectTransform.RelativeSize = Vector2.One;
|
||||
}
|
||||
|
||||
public void ResetSettingsFrame(GameSettings.Tab selectedTab = GameSettings.Tab.Graphics)
|
||||
|
||||
Reference in New Issue
Block a user