Files
LuaCsForBarotraumaEP/Barotrauma/BarotraumaShared/SharedSource/Screens/Screen.cs
Markus Isberg 9d2f160314 Build 0.20.10.0
2022-12-05 19:48:59 +02:00

57 lines
1.5 KiB
C#

namespace Barotrauma
{
abstract partial class Screen
{
public static Screen Selected { get; private set; }
public static void SelectNull()
{
Selected = null;
}
public virtual void Deselect()
{
}
public virtual void Select()
{
if (Selected != null && Selected != this)
{
Selected.Deselect();
#if CLIENT
GameMain.ParticleManager.ClearParticles();
GUIContextMenu.CurrentContextMenu = null;
GUI.ClearCursorWait();
//make sure any textbox in the previously selected screen doesn't stay selected
if (GUI.KeyboardDispatcher.Subscriber != DebugConsole.TextBox)
{
GUI.KeyboardDispatcher.Subscriber = null;
GUI.ScreenChanged = true;
}
SubmarinePreview.Close();
// Make sure the saving indicator is disabled when returning to main menu or lobby
if (this == GameMain.MainMenuScreen || this == GameMain.NetLobbyScreen)
{
GUI.DisableSavingIndicatorDelayed();
}
GameMain.ResetIMEWorkaround();
#endif
}
#if CLIENT
GUI.SettingsMenuOpen = false;
#endif
Selected = this;
}
public virtual Camera Cam => null;
public virtual bool IsEditor => false;
public virtual void Update(double deltaTime)
{
}
}
}