Client LuaCsForBarotrauma
BarotraumaShared/SharedSource/Screens/Screen.cs
1 namespace Barotrauma
2 {
3  abstract partial class Screen
4  {
5  public static Screen Selected { get; private set; }
6 
7  public static void SelectNull()
8  {
9  Selected = null;
10  }
11 
12  public virtual void Deselect()
13  {
14  }
15 
16  public virtual void Select()
17  {
18  if (Selected != null && Selected != this)
19  {
21 #if CLIENT
22  GameMain.ParticleManager.ClearParticles();
23  GUIContextMenu.CurrentContextMenu = null;
24  GUI.ClearCursorWait();
25  //make sure any textbox in the previously selected screen doesn't stay selected
26  if (GUI.KeyboardDispatcher.Subscriber != DebugConsole.TextBox)
27  {
28  GUI.KeyboardDispatcher.Subscriber = null;
29  GUI.ScreenChanged = true;
30  }
32 
33  // Make sure the saving indicator is disabled when returning to main menu or lobby
34  if (this == GameMain.MainMenuScreen || this == GameMain.NetLobbyScreen)
35  {
36  GUI.DisableSavingIndicatorDelayed();
37  }
39 #endif
40  }
41 
42 #if CLIENT
43  GUI.SettingsMenuOpen = false;
44 #endif
45  Selected = this;
46  }
47 
48  public virtual Camera Cam => null;
49 
50  public virtual bool IsEditor => false;
51 
52  public virtual void Update(double deltaTime)
53  {
54  }
55  }
56 }
static NetLobbyScreen NetLobbyScreen
Definition: GameMain.cs:55
static MainMenuScreen MainMenuScreen
Definition: GameMain.cs:53
static ParticleManager ParticleManager
Definition: GameMain.cs:101
static void ResetIMEWorkaround()
Definition: GameMain.cs:1316