2f107db...5202af9
This commit is contained in:
@@ -6,8 +6,11 @@ namespace Barotrauma
|
||||
partial class GameSession
|
||||
{
|
||||
private InfoFrameTab selectedTab;
|
||||
private GUIButton infoButton;
|
||||
private GUIButton infoFrame;
|
||||
/// <summary>
|
||||
/// Determines whether the hotkey for the info button was held down in the previous frame.
|
||||
/// </summary>
|
||||
private bool prevInfoKey;
|
||||
|
||||
private GUIFrame infoFrameContent;
|
||||
|
||||
@@ -17,7 +20,12 @@ namespace Barotrauma
|
||||
get { return roundSummary; }
|
||||
}
|
||||
|
||||
private bool ToggleInfoFrame(GUIButton button, object obj)
|
||||
partial void InitProjSpecific()
|
||||
{
|
||||
prevInfoKey = false;
|
||||
}
|
||||
|
||||
private bool ToggleInfoFrame()
|
||||
{
|
||||
if (infoFrame == null)
|
||||
{
|
||||
@@ -36,10 +44,7 @@ namespace Barotrauma
|
||||
{
|
||||
int width = 600, height = 400;
|
||||
|
||||
infoFrame = new GUIButton(new RectTransform(Vector2.One, GUI.Canvas), style: "GUIBackgroundBlocker")
|
||||
{
|
||||
OnClicked = (btn, userdata) => { if (GUI.MouseOn == btn || GUI.MouseOn == btn.TextBlock) ToggleInfoFrame(btn, userdata); return true; }
|
||||
};
|
||||
infoFrame = new GUIButton(new RectTransform(Vector2.One, GUI.Canvas), style: "GUIBackgroundBlocker");
|
||||
|
||||
|
||||
var innerFrame = new GUIFrame(new RectTransform(new Vector2(0.3f, 0.35f), infoFrame.RectTransform, Anchor.Center) { MinSize = new Point(width,height) });
|
||||
@@ -63,6 +68,7 @@ namespace Barotrauma
|
||||
OnClicked = SelectInfoFrameTab
|
||||
};
|
||||
|
||||
/*TODO: fix
|
||||
if (GameMain.Server != null)
|
||||
{
|
||||
var manageButton = new GUIButton(new RectTransform(new Vector2(0.2f, 1.0f), buttonArea.RectTransform), TextManager.Get("ManagePlayers"))
|
||||
@@ -70,12 +76,7 @@ namespace Barotrauma
|
||||
UserData = InfoFrameTab.ManagePlayers,
|
||||
OnClicked = SelectInfoFrameTab
|
||||
};
|
||||
}
|
||||
|
||||
var closeButton = new GUIButton(new RectTransform(new Vector2(0.25f, 0.08f), paddedFrame.RectTransform, Anchor.BottomRight), TextManager.Get("Close"))
|
||||
{
|
||||
OnClicked = ToggleInfoFrame
|
||||
};
|
||||
}*/
|
||||
|
||||
}
|
||||
|
||||
@@ -94,7 +95,8 @@ namespace Barotrauma
|
||||
CreateMissionInfo(infoFrameContent);
|
||||
break;
|
||||
case InfoFrameTab.ManagePlayers:
|
||||
GameMain.Server.ManagePlayersFrame(infoFrameContent);
|
||||
//TODO: fix
|
||||
//GameMain.Server.ManagePlayersFrame(infoFrameContent);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -125,7 +127,6 @@ namespace Barotrauma
|
||||
public void AddToGUIUpdateList()
|
||||
{
|
||||
if (GUI.DisableHUD) return;
|
||||
infoButton.AddToGUIUpdateList();
|
||||
GameMode?.AddToGUIUpdateList();
|
||||
infoFrame?.AddToGUIUpdateList();
|
||||
}
|
||||
@@ -133,8 +134,13 @@ namespace Barotrauma
|
||||
partial void UpdateProjSpecific(float deltaTime)
|
||||
{
|
||||
if (GUI.DisableHUD) return;
|
||||
|
||||
infoButton?.UpdateManually(deltaTime);
|
||||
|
||||
if (prevInfoKey != (PlayerInput.KeyDown(InputType.InfoTab) && GUI.KeyboardDispatcher.Subscriber == null))
|
||||
{
|
||||
ToggleInfoFrame();
|
||||
prevInfoKey = PlayerInput.KeyDown(InputType.InfoTab);
|
||||
}
|
||||
|
||||
infoFrame?.UpdateManually(deltaTime);
|
||||
}
|
||||
|
||||
@@ -142,8 +148,6 @@ namespace Barotrauma
|
||||
{
|
||||
if (GUI.DisableHUD) return;
|
||||
|
||||
infoButton.DrawManually(spriteBatch);
|
||||
|
||||
GameMode?.Draw(spriteBatch);
|
||||
infoFrame?.DrawManually(spriteBatch);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user