Barotrauma Client Doc
Barotrauma.GameMain Class Reference
Inheritance diagram for Barotrauma.GameMain:

Public Member Functions

 GameMain (string[] args)
 
void ApplyGraphicsSettings (bool recalculateFontsAndStyles=false)
 
void SetWindowMode (WindowMode windowMode)
 
void ResetViewPort ()
 
void OnInvitedToGame (Steamworks.Friend friend, string connectCommand)
 
void OnInvitedToGame (string connectCommand)
 
void OnLobbyJoinRequested (Steamworks.Data.Lobby lobby, Steamworks.SteamId friendId)
 
void ShowBugReporter ()
 
CoroutineHandle ShowLoading (IEnumerable< CoroutineStatus > loader, bool waitKeyHit=true)
 

Static Public Member Functions

static void ResetNetLobbyScreen ()
 
static void OnFileDropped (object sender, FileDropEventArgs args)
 
static void ResetFrameTime ()
 
static void QuitToMainMenu (bool save, bool showVerificationPrompt)
 
static void QuitToMainMenu (bool save)
 
static void ShowOpenUrlInWebBrowserPrompt (string url, string promptExtensionTag=null)
 
static void ResetIMEWorkaround ()
 

Public Attributes

Option< ConnectCommandConnectCommand = Option<ConnectCommand>.None()
 

Static Public Attributes

static LuaCsSetup LuaCs
 
static bool ShowFPS
 
static bool ShowPerf
 
static bool DebugDraw
 
static bool DevMode
 Doesn't automatically enable los or bot AI or do anything like that. Probably not fully implemented. More...
 
static PerformanceCounter PerformanceCounter
 
static readonly Version Version = Assembly.GetEntryAssembly().GetName().Version
 
static string[] ConsoleArguments
 
static GameScreen GameScreen
 
static MainMenuScreen MainMenuScreen
 
static NetLobbyScreen NetLobbyScreen
 
static ModDownloadScreen ModDownloadScreen
 
static ServerListScreen ServerListScreen
 
static SubEditorScreen SubEditorScreen
 
static TestScreen TestScreen
 
static ParticleEditorScreen ParticleEditorScreen
 
static LevelEditorScreen LevelEditorScreen
 
static SpriteEditorScreen SpriteEditorScreen
 
static EventEditorScreen EventEditorScreen
 
static CharacterEditor.CharacterEditorScreen CharacterEditorScreen
 
static CampaignEndScreen CampaignEndScreen
 
static Lights.LightManager LightManager
 
static Sounds.SoundManager SoundManager
 
static ParticleManager ParticleManager
 
static LoadingScreen TitleScreen
 
static GameClient Client
 

Protected Member Functions

override void Initialize ()
 Allows the game to perform any initialization it needs to before starting to run. This is where it can query for any required services and load any non-graphic related content. Calling base.Initialize will enumerate through any components and initialize them as well. More...
 
override void LoadContent ()
 LoadContent will be called once per game and is the place to load all of your content. More...
 
override void UnloadContent ()
 UnloadContent will be called once per game and is the place to unload all content. More...
 
override void Update (GameTime gameTime)
 Allows the game to run logic such as updating the world, checking for collisions, gathering input, and playing audio. More...
 
override void Draw (GameTime gameTime)
 This is called when the game should draw itself. More...
 
override void OnExiting (object sender, EventArgs args)
 

Properties

static bool IsSingleplayer [get]
 
static bool IsMultiplayer [get]
 
static int CurrentUpdateRate [get]
 
static Thread MainThread [get]
 
static ContentPackage VanillaContent [get]
 
static GameSession?? GameSession [get, set]
 
static World World [get, set]
 
bool HasLoaded [get]
 
static bool IsFirstLaunch [get]
 
static GameMain Instance [get]
 
static GraphicsDeviceManager GraphicsDeviceManager [get]
 
static WindowMode WindowMode [get]
 
static int GraphicsWidth [get]
 
static int GraphicsHeight [get]
 
static bool WindowActive [get]
 
static NetworkMember NetworkMember [get]
 
static RasterizerState ScissorTestEnable [get]
 
bool LoadingScreenOpen [get]
 
bool Paused [get]
 
static ChatMode ActiveChatMode = ChatMode.Radio [get, set]
 

Events

Action ResolutionChanged
 NOTE: Use very carefully. You need to ensure that you ALWAYS unsubscribe from this when you no longer need the subscriber! If you're subscribing to this from something else than a singleton or something that there's only ever one instance of, you're probably in dangerous territory. More...
 

Detailed Description

Definition at line 24 of file GameMain.cs.

Constructor & Destructor Documentation

◆ GameMain()

Barotrauma.GameMain.GameMain ( string[]  args)

Definition at line 218 of file GameMain.cs.

Member Function Documentation

◆ ApplyGraphicsSettings()

void Barotrauma.GameMain.ApplyGraphicsSettings ( bool  recalculateFontsAndStyles = false)

Definition at line 291 of file GameMain.cs.

◆ Draw()

override void Barotrauma.GameMain.Draw ( GameTime  gameTime)
protected

This is called when the game should draw itself.

Definition at line 969 of file GameMain.cs.

◆ Initialize()

override void Barotrauma.GameMain.Initialize ( )
protected

Allows the game to perform any initialization it needs to before starting to run. This is where it can query for any required services and load any non-graphic related content. Calling base.Initialize will enumerate through any components and initialize them as well.

Definition at line 378 of file GameMain.cs.

◆ LoadContent()

override void Barotrauma.GameMain.LoadContent ( )
protected

LoadContent will be called once per game and is the place to load all of your content.

Definition at line 399 of file GameMain.cs.

◆ OnExiting()

override void Barotrauma.GameMain.OnExiting ( object  sender,
EventArgs  args 
)
protected

Definition at line 1164 of file GameMain.cs.

◆ OnFileDropped()

static void Barotrauma.GameMain.OnFileDropped ( object  sender,
FileDropEventArgs  args 
)
static

Definition at line 276 of file GameMain.cs.

◆ OnInvitedToGame() [1/2]

void Barotrauma.GameMain.OnInvitedToGame ( Steamworks.Friend  friend,
string  connectCommand 
)

◆ OnInvitedToGame() [2/2]

void Barotrauma.GameMain.OnInvitedToGame ( string  connectCommand)

Definition at line 592 of file GameMain.cs.

◆ OnLobbyJoinRequested()

void Barotrauma.GameMain.OnLobbyJoinRequested ( Steamworks.Data.Lobby  lobby,
Steamworks.SteamId  friendId 
)

Definition at line 609 of file GameMain.cs.

◆ QuitToMainMenu() [1/2]

static void Barotrauma.GameMain.QuitToMainMenu ( bool  save)
static

Definition at line 1056 of file GameMain.cs.

◆ QuitToMainMenu() [2/2]

static void Barotrauma.GameMain.QuitToMainMenu ( bool  save,
bool  showVerificationPrompt 
)
static

Definition at line 1037 of file GameMain.cs.

◆ ResetFrameTime()

static void Barotrauma.GameMain.ResetFrameTime ( )
static

Definition at line 944 of file GameMain.cs.

◆ ResetIMEWorkaround()

static void Barotrauma.GameMain.ResetIMEWorkaround ( )
static

Definition at line 1226 of file GameMain.cs.

◆ ResetNetLobbyScreen()

static void Barotrauma.GameMain.ResetNetLobbyScreen ( )
static

Definition at line 56 of file GameMain.cs.

◆ ResetViewPort()

void Barotrauma.GameMain.ResetViewPort ( )

Definition at line 366 of file GameMain.cs.

◆ SetWindowMode()

void Barotrauma.GameMain.SetWindowMode ( WindowMode  windowMode)

Definition at line 341 of file GameMain.cs.

◆ ShowBugReporter()

void Barotrauma.GameMain.ShowBugReporter ( )

Definition at line 1110 of file GameMain.cs.

◆ ShowLoading()

CoroutineHandle Barotrauma.GameMain.ShowLoading ( IEnumerable< CoroutineStatus loader,
bool  waitKeyHit = true 
)

Definition at line 1156 of file GameMain.cs.

◆ ShowOpenUrlInWebBrowserPrompt()

static void Barotrauma.GameMain.ShowOpenUrlInWebBrowserPrompt ( string  url,
string  promptExtensionTag = null 
)
static

Definition at line 1188 of file GameMain.cs.

◆ UnloadContent()

override void Barotrauma.GameMain.UnloadContent ( )
protected

UnloadContent will be called once per game and is the place to unload all content.

Definition at line 580 of file GameMain.cs.

◆ Update()

override void Barotrauma.GameMain.Update ( GameTime  gameTime)
protected

Allows the game to run logic such as updating the world, checking for collisions, gathering input, and playing audio.

Parameters
gameTimeProvides a snapshot of timing values.

Definition at line 619 of file GameMain.cs.

Member Data Documentation

◆ CampaignEndScreen

CampaignEndScreen Barotrauma.GameMain.CampaignEndScreen
static

Definition at line 74 of file GameMain.cs.

◆ CharacterEditorScreen

CharacterEditor.CharacterEditorScreen Barotrauma.GameMain.CharacterEditorScreen
static

Definition at line 72 of file GameMain.cs.

◆ Client

GameClient Barotrauma.GameMain.Client
static

Definition at line 186 of file GameMain.cs.

◆ ConnectCommand

Option<ConnectCommand> Barotrauma.GameMain.ConnectCommand = Option<ConnectCommand>.None()

Definition at line 121 of file GameMain.cs.

◆ ConsoleArguments

string [] Barotrauma.GameMain.ConsoleArguments
static

Definition at line 48 of file GameMain.cs.

◆ DebugDraw

bool Barotrauma.GameMain.DebugDraw
static

Definition at line 29 of file GameMain.cs.

◆ DevMode

bool Barotrauma.GameMain.DevMode
static

Doesn't automatically enable los or bot AI or do anything like that. Probably not fully implemented.

Definition at line 33 of file GameMain.cs.

◆ EventEditorScreen

EventEditorScreen Barotrauma.GameMain.EventEditorScreen
static

Definition at line 71 of file GameMain.cs.

◆ GameScreen

GameScreen Barotrauma.GameMain.GameScreen
static

Definition at line 50 of file GameMain.cs.

◆ LevelEditorScreen

LevelEditorScreen Barotrauma.GameMain.LevelEditorScreen
static

Definition at line 69 of file GameMain.cs.

◆ LightManager

Lights.LightManager Barotrauma.GameMain.LightManager
static

Definition at line 76 of file GameMain.cs.

◆ LuaCs

LuaCsSetup Barotrauma.GameMain.LuaCs
static

Definition at line 26 of file GameMain.cs.

◆ MainMenuScreen

MainMenuScreen Barotrauma.GameMain.MainMenuScreen
static

Definition at line 51 of file GameMain.cs.

◆ ModDownloadScreen

ModDownloadScreen Barotrauma.GameMain.ModDownloadScreen
static

Definition at line 54 of file GameMain.cs.

◆ NetLobbyScreen

NetLobbyScreen Barotrauma.GameMain.NetLobbyScreen
static

Definition at line 53 of file GameMain.cs.

◆ ParticleEditorScreen

ParticleEditorScreen Barotrauma.GameMain.ParticleEditorScreen
static

Definition at line 68 of file GameMain.cs.

◆ ParticleManager

ParticleManager Barotrauma.GameMain.ParticleManager
static

Definition at line 99 of file GameMain.cs.

◆ PerformanceCounter

PerformanceCounter Barotrauma.GameMain.PerformanceCounter
static

Definition at line 37 of file GameMain.cs.

◆ ServerListScreen

ServerListScreen Barotrauma.GameMain.ServerListScreen
static

Definition at line 64 of file GameMain.cs.

◆ ShowFPS

bool Barotrauma.GameMain.ShowFPS
static

Definition at line 27 of file GameMain.cs.

◆ ShowPerf

bool Barotrauma.GameMain.ShowPerf
static

Definition at line 28 of file GameMain.cs.

◆ SoundManager

Sounds.SoundManager Barotrauma.GameMain.SoundManager
static

Definition at line 78 of file GameMain.cs.

◆ SpriteEditorScreen

SpriteEditorScreen Barotrauma.GameMain.SpriteEditorScreen
static

Definition at line 70 of file GameMain.cs.

◆ SubEditorScreen

SubEditorScreen Barotrauma.GameMain.SubEditorScreen
static

Definition at line 66 of file GameMain.cs.

◆ TestScreen

TestScreen Barotrauma.GameMain.TestScreen
static

Definition at line 67 of file GameMain.cs.

◆ TitleScreen

LoadingScreen Barotrauma.GameMain.TitleScreen
static

Definition at line 112 of file GameMain.cs.

◆ Version

readonly Version Barotrauma.GameMain.Version = Assembly.GetEntryAssembly().GetName().Version
static

Definition at line 46 of file GameMain.cs.

Property Documentation

◆ ActiveChatMode

ChatMode Barotrauma.GameMain.ActiveChatMode = ChatMode.Radio
staticgetset

Definition at line 216 of file GameMain.cs.

◆ CurrentUpdateRate

int Barotrauma.GameMain.CurrentUpdateRate
staticget

Definition at line 41 of file GameMain.cs.

◆ GameSession

GameSession?? Barotrauma.GameMain.GameSession
staticgetset

Definition at line 85 of file GameMain.cs.

◆ GraphicsDeviceManager

GraphicsDeviceManager Barotrauma.GameMain.GraphicsDeviceManager
staticget

Definition at line 147 of file GameMain.cs.

◆ GraphicsHeight

int Barotrauma.GameMain.GraphicsHeight
staticget

Definition at line 165 of file GameMain.cs.

◆ GraphicsWidth

int Barotrauma.GameMain.GraphicsWidth
staticget

Definition at line 159 of file GameMain.cs.

◆ HasLoaded

bool Barotrauma.GameMain.HasLoaded
get

Definition at line 117 of file GameMain.cs.

◆ Instance

GameMain Barotrauma.GameMain.Instance
staticget

Definition at line 141 of file GameMain.cs.

◆ IsFirstLaunch

bool Barotrauma.GameMain.IsFirstLaunch
staticget

Definition at line 135 of file GameMain.cs.

◆ IsMultiplayer

bool Barotrauma.GameMain.IsMultiplayer
staticget

Definition at line 35 of file GameMain.cs.

◆ IsSingleplayer

bool Barotrauma.GameMain.IsSingleplayer
staticget

Definition at line 34 of file GameMain.cs.

◆ LoadingScreenOpen

bool Barotrauma.GameMain.LoadingScreenOpen
get

Definition at line 198 of file GameMain.cs.

◆ MainThread

Thread Barotrauma.GameMain.MainThread
staticget

Definition at line 80 of file GameMain.cs.

◆ NetworkMember

NetworkMember Barotrauma.GameMain.NetworkMember
staticget

Definition at line 187 of file GameMain.cs.

◆ Paused

bool Barotrauma.GameMain.Paused
get

Definition at line 203 of file GameMain.cs.

◆ ScissorTestEnable

RasterizerState Barotrauma.GameMain.ScissorTestEnable
staticget

Definition at line 192 of file GameMain.cs.

◆ VanillaContent

ContentPackage Barotrauma.GameMain.VanillaContent
staticget

Definition at line 82 of file GameMain.cs.

◆ WindowActive

bool Barotrauma.GameMain.WindowActive
staticget

Definition at line 171 of file GameMain.cs.

◆ WindowMode

WindowMode Barotrauma.GameMain.WindowMode
staticget

Definition at line 153 of file GameMain.cs.

◆ World

World Barotrauma.GameMain.World
staticgetset

Definition at line 102 of file GameMain.cs.

Event Documentation

◆ ResolutionChanged

Action Barotrauma.GameMain.ResolutionChanged

NOTE: Use very carefully. You need to ensure that you ALWAYS unsubscribe from this when you no longer need the subscriber! If you're subscribing to this from something else than a singleton or something that there's only ever one instance of, you're probably in dangerous territory.

Definition at line 131 of file GameMain.cs.