9 using FarseerPhysics.Dynamics;
10 using Microsoft.Xna.Framework;
11 using Microsoft.Xna.Framework.Graphics;
12 using Microsoft.Xna.Framework.Input;
14 using System.Collections.Generic;
15 using System.Diagnostics;
17 using System.Reflection;
18 using System.Threading;
20 using System.Collections.Immutable;
39 private static Stopwatch performanceCounterTimer;
40 private static int updateCount = 0;
46 public static readonly
Version Version = Assembly.GetEntryAssembly().GetName().Version;
89 get {
return gameSession; }
92 if (gameSession == value) {
return; }
103 private static World world;
108 if (world ==
null) { world =
new World(
new Vector2(0, -9.82f)); }
111 set { world = value; }
115 private bool loadingScreenOpen;
117 private Thread initialLoadingThread;
121 private readonly GameTime fixedTime;
125 private static SpriteBatch spriteBatch;
127 private Viewport defaultViewport;
181 catch (NullReferenceException)
202 get {
return loadingScreenOpen; }
210 private const GraphicsProfile GfxProfile = GraphicsProfile.Reach;
213 public static bool FirstLoad =
true;
215 public static bool CancelQuickStart;
220 private static bool contentLoaded;
222 private static readonly Queue<Action> postContentLoadActions =
new();
226 Content.RootDirectory =
"Content";
228 GraphicsAdapter.UseDebugLayers =
true;
232 IsFullScreen =
false,
233 GraphicsProfile = GfxProfile
237 Window.Title =
"Barotrauma";
241 if (!Directory.Exists(Content.RootDirectory))
243 throw new Exception(
"Content folder not found. If you are trying to compile the game from the source code and own a legal copy of the game, you can copy the Content folder from the game's files to BarotraumaShared/Content.");
249 CreatureMetrics.Init();
259 catch (IndexOutOfRangeException e)
261 DebugConsole.ThrowError($
"Failed to parse console arguments ({string.Join(' ', ConsoleArguments)})", e);
269 IsFixedTimeStep =
false;
272 fixedTime =
new GameTime();
274 FarseerPhysics.Settings.AllowSleep =
true;
275 FarseerPhysics.Settings.ContinuousPhysics =
false;
276 FarseerPhysics.Settings.VelocityIterations = 1;
277 FarseerPhysics.Settings.PositionIterations = 1;
291 postContentLoadActions.Enqueue(action);
298 string filePath = args.FilePath;
299 if (
string.IsNullOrWhiteSpace(filePath)) {
return; }
301 string extension = Path.GetExtension(filePath).ToLower();
303 System.IO.FileInfo info =
new System.IO.FileInfo(args.FilePath);
304 if (!info.Exists) {
return; }
306 screen.OnFileDropped(filePath, extension);
311 static void updateConfig()
313 var config = GameSettings.CurrentConfig;
316 GameSettings.SetCurrentConfig(config);
329 switch (GameSettings.CurrentConfig.Graphics.DisplayMode)
346 SetWindowMode(GameSettings.CurrentConfig.Graphics.DisplayMode);
350 if (recalculateFontsAndStyles)
352 GUIStyle.RecalculateFonts();
353 GUIStyle.RecalculateSizeRestrictions();
371 if (windowMode ==
WindowMode.BorderlessWindowed)
373 GraphicsWidth = GraphicsDevice.PresentationParameters.Bounds.Width;
374 GraphicsHeight = GraphicsDevice.PresentationParameters.Bounds.Height;
386 GraphicsDevice.Viewport = defaultViewport;
387 GraphicsDevice.ScissorRectangle = defaultViewport.Bounds;
404 Hyper.ComponentModel.HyperTypeDescriptionProvider.Add(typeof(
Character));
405 Hyper.ComponentModel.HyperTypeDescriptionProvider.Add(typeof(
Item));
406 Hyper.ComponentModel.HyperTypeDescriptionProvider.Add(typeof(Items.Components.ItemComponent));
407 Hyper.ComponentModel.HyperTypeDescriptionProvider.Add(typeof(
Hull));
409 performanceCounterTimer = Stopwatch.StartNew();
424 ConvertUnits.SetDisplayUnitToSimUnitRatio(Physics.DisplayToSimRation);
426 spriteBatch =
new SpriteBatch(GraphicsDevice);
427 TextureLoader.Init(GraphicsDevice);
432 GraphicsQuad.Init(GraphicsDevice);
434 loadingScreenOpen =
true;
440 Eos.EosAccount.LoginPlatformSpecific();
442 initialLoadingThread =
new Thread(Load);
443 initialLoadingThread.Start();
448 static void log(
string str)
450 if (GameSettings.CurrentConfig.VerboseLogging)
452 DebugConsole.NewMessage(str, Color.Lime);
456 log(
"LOADING COROUTINE");
458 ContentPackageManager.LoadVanillaFileList();
462 ContentPackageManager.VanillaCorePackage.LoadFilesOfType<TextFile>();
463 TitleScreen.
AvailableLanguages = TextManager.AvailableLanguages.OrderBy(l => l.Value !=
"english".ToIdentifier()).ThenBy(l => l.Value).ToArray();
466 Thread.Sleep((
int)(Timing.Step * 1000));
468 LanguageIdentifier selectedLanguage = GameSettings.CurrentConfig.Language;
471 ContentPackageManager.VanillaCorePackage.UnloadFilesOfType<TextFile>();
473 var config = GameSettings.CurrentConfig;
474 config.Language = selectedLanguage;
475 GameSettings.SetCurrentConfig(config);
476 GameSettings.SaveCurrentConfig();
482 if (GameSettings.CurrentConfig.EnableSplashScreen && !
ConsoleArguments.Contains(
"-skipintro"))
485 float baseVolume = MathHelper.Clamp(GameSettings.CurrentConfig.Audio.SoundVolume * 2.0f, 0.0f, 1.0f);
486 pendingSplashScreens.Enqueue(
new LoadingScreen.PendingSplashScreen(
"Content/SplashScreens/Splash_UTG.webm", baseVolume * 0.5f));
487 pendingSplashScreens.Enqueue(
new LoadingScreen.PendingSplashScreen(
"Content/SplashScreens/Splash_FF.webm", baseVolume));
488 pendingSplashScreens.Enqueue(
new LoadingScreen.PendingSplashScreen(
"Content/SplashScreens/Splash_Daedalic.webm", baseVolume * 0.1f));
493 LegacySteamUgcTransition.Prepare();
494 var contentPackageLoadRoutine = ContentPackageManager.Init();
495 foreach (var progress
in contentPackageLoadRoutine
496 .
Select(p => p.Result).Successes())
498 const float min = 1f, max = 70f;
504 var corePackage = ContentPackageManager.EnabledPackages.Core;
505 if (corePackage.EnableError.TryUnwrap(out var error))
507 if (error.ErrorsOrException.TryGet(out ImmutableArray<string> errorMessages))
509 throw new Exception($
"Error while loading the core content package \"{corePackage.Name}\": {errorMessages.First()}");
511 else if (error.ErrorsOrException.TryGet(out Exception exception))
513 throw new Exception($
"Error while loading the core content package \"{corePackage.Name}\": {exception.Message}", exception);
517 TextManager.VerifyLanguageAvailable();
522 ContentPackageManager.LogEnabledRegularPackageErrors();
525 GameAnalyticsManager.InitIfConsented();
528 TaskPool.Add(
"InitRelayNetworkAccess", SteamManager.InitRelayNetworkAccess(), (t) => { });
531 CoreEntityPrefab.InitCorePrefabs();
532 GameModePreset.Init();
534 SaveUtil.DeleteDownloadedSubs();
535 SubmarineInfo.RefreshSavedSubs();
542 LightManager =
new Lights.LightManager(base.GraphicsDevice);
551 if (SteamManager.IsInitialized)
553 Steamworks.SteamFriends.OnGameRichPresenceJoinRequested += OnInvitedToSteamGame;
554 Steamworks.SteamFriends.OnGameLobbyJoinRequested += OnSteamLobbyJoinRequested;
556 if (SteamManager.TryGetUnlockedAchievements(out List<Steamworks.Data.Achievement> achievements))
560 if (!achievements.Any() && SteamManager.GetStatInt(AchievementStat.GameLaunchCount) <= 0)
563 GameAnalyticsManager.AddDesignEvent(
"FirstLaunch");
566 SteamManager.IncrementStat(AchievementStat.GameLaunchCount, 1);
571 Eos.EosAccount.ExecuteAfterLogin(ProcessLaunchCountEos);
589 LevelGenerationParams.CheckValidity();
594 ContainerTagPrefab.CheckForContainerTagErrors();
596 foreach (Identifier steamError
in SteamManager.InitializationErrors)
598 new GUIMessageBox(TextManager.Get(
"Error"), TextManager.Get(steamError));
601 GameSettings.OnGameMainHasLoaded?.Invoke();
606 log(
"LOADING COROUTINE FINISHED");
608 LuaCsInstaller.CheckUpdate();
611 contentLoaded =
true;
612 while (postContentLoadActions.TryDequeue(out Action action))
618 private static void ProcessLaunchCountEos()
620 if (!EosInterface.Core.IsInitialized) {
return; }
622 static void trySetConnectCommand(
string commandStr)
627 EosInterface.Presence.OnJoinGame.Register(
"onJoinGame".ToIdentifier(),
static jgi => trySetConnectCommand(jgi.JoinCommand));
628 EosInterface.Presence.OnInviteAccepted.Register(
"onInviteAccepted".ToIdentifier(),
static aii => trySetConnectCommand(aii.JoinCommand));
630 TaskPool.AddWithResult(
"Eos.GameMain.Load.QueryStats", EosInterface.Achievements.QueryStats(AchievementStat.GameLaunchCount),
static result =>
633 success: static stats =>
635 if (!stats.TryGetValue(AchievementStat.GameLaunchCount, out int launchCount)) { return; }
637 if (launchCount > 0) { return; }
639 IsFirstLaunch = true;
640 GameAnalyticsManager.AddDesignEvent(
"FirstLaunch_Epic");
642 failure:
static error => DebugConsole.ThrowError($
"Failed to query stats for launch count: {error}")
645 TaskPool.Add(
"Eos.GameMain.Load.IngestStat", EosInterface.Achievements.IngestStats((AchievementStat.GameLaunchCount, 1)), TaskPool.IgnoredCallback);
655 TextureLoader.CancelAll();
656 CoroutineManager.StopCoroutines(
"Load");
659 SoundManager?.Dispose();
663 private void OnInvitedToSteamGame(Steamworks.Friend
friend,
string connectCommand) => OnInvitedToSteamGame(connectCommand);
665 private void OnInvitedToSteamGame(
string connectCommand)
669 ConnectCommand =
Barotrauma.
Networking.ConnectCommand.Parse(ToolBox.SplitCommand(connectCommand));
671 catch (IndexOutOfRangeException e)
674 DebugConsole.ThrowError($
"Failed to parse a Steam friend's connect invitation command ({connectCommand})", e);
676 DebugConsole.Log($
"Failed to parse a Steam friend's connect invitation command ({connectCommand})\n" + e.StackTrace.CleanupStackTrace());
678 ConnectCommand = Option<ConnectCommand>.None();
682 private void OnSteamLobbyJoinRequested(Steamworks.Data.Lobby lobby, Steamworks.SteamId friendId)
684 SteamManager.JoinLobby(lobby.Id,
true);
692 protected override void Update(GameTime gameTime)
694 Timing.Accumulator += gameTime.ElapsedGameTime.TotalSeconds;
695 if (Timing.Accumulator > Timing.AccumulatorMax)
700 Timing.Accumulator = Timing.Step;
703 CrossThread.ProcessTasks();
707 if (SoundManager !=
null)
709 if (WindowActive || !GameSettings.CurrentConfig.Audio.MuteOnFocusLost)
711 SoundManager.ListenerGain = SoundManager.CompressionDynamicRangeGain;
715 SoundManager.ListenerGain = 0.0f;
719 while (Timing.Accumulator >= Timing.Step)
721 Timing.TotalTime += Timing.Step;
724 Timing.TotalTimeUnpaused += Timing.Step;
726 Stopwatch sw =
new Stopwatch();
729 fixedTime.IsRunningSlowly = gameTime.IsRunningSlowly;
730 TimeSpan addTime =
new TimeSpan(0, 0, 0, 0, 16);
731 fixedTime.ElapsedGameTime = addTime;
732 fixedTime.TotalGameTime.Add(addTime);
733 base.Update(fixedTime);
739 if (loadingScreenOpen)
748 SoundPlayer.Update((
float)Timing.Step);
749 GUI.ClearUpdateList();
750 GUI.UpdateGUIMessageBoxesOnly((
float)Timing.Step);
756 loadingScreenOpen =
false;
762 CancelQuickStart = !CancelQuickStart;
766 (GameSettings.CurrentConfig.AutomaticQuickStartEnabled ||
767 GameSettings.CurrentConfig.AutomaticCampaignLoadEnabled ||
768 GameSettings.CurrentConfig.TestScreenEnabled) && FirstLoad && !CancelQuickStart)
770 loadingScreenOpen =
false;
773 if (GameSettings.CurrentConfig.TestScreenEnabled)
777 else if (GameSettings.CurrentConfig.AutomaticQuickStartEnabled)
781 else if (GameSettings.CurrentConfig.AutomaticCampaignLoadEnabled)
783 var saveFiles = SaveUtil.GetSaveFiles(SaveUtil.SaveType.Singleplayer);
784 if (saveFiles.Count() > 0)
792 DebugConsole.ThrowError(
"Loading save \"" + saveFiles.Last() +
"\" failed", e);
800 Client?.Update((
float)Timing.Step);
804 if (ConnectCommand.TryUnwrap(out var connectCommand))
813 if (connectCommand.SteamLobbyIdOption.TryUnwrap(out var lobbyId))
815 SteamManager.JoinLobby(lobbyId.Value, joinServer:
true);
817 else if (connectCommand.NameAndP2PEndpointsOption.TryUnwrap(out var nameAndEndpoint)
818 && nameAndEndpoint is { ServerName: var serverName, Endpoints: var endpoints })
821 endpoints.Cast<
Endpoint>().ToImmutableArray(),
826 ConnectCommand = Option<ConnectCommand>.None();
829 SoundPlayer.Update((
float)Timing.Step);
836 socialOverlay.IsOpen = !socialOverlay.IsOpen;
837 if (socialOverlay.IsOpen)
839 socialOverlay.RefreshFriendList();
846 if (GUI.KeyboardDispatcher.Subscriber !=
null)
848 if (GUI.KeyboardDispatcher.Subscriber is
GUITextBox textBox)
852 GUI.KeyboardDispatcher.Subscriber =
null;
867 else if (ObjectiveManager.ContentRunning)
869 ObjectiveManager.CloseActiveContentGUI();
879 else if (GUI.PauseMenuOpen)
881 GUI.TogglePauseMenu();
883 else if (
GameSession?.Campaign is { ShowCampaignUI:
true, ForceMapUI:
false })
894 GUI.TogglePauseMenu();
897 static bool itemHudActive()
907 if (NetworkMember ==
null)
911 DebugConsole.Paused = !DebugConsole.Paused;
916 GUI.ClearUpdateList();
918 (DebugConsole.IsOpen || DebugConsole.Paused ||
919 GUI.PauseMenuOpen || GUI.SettingsMenuOpen ||
921 (NetworkMember ==
null || !NetworkMember.GameStarted);
929 if (NetworkMember ==
null && !WindowActive && !Paused &&
true && GameSettings.CurrentConfig.PauseOnFocusLost &&
933 GUI.TogglePauseMenu();
942 Client?.AddToGUIUpdateList();
946 FileSelection.AddToGUIUpdateList();
948 DebugConsole.AddToGUIUpdateList();
950 DebugConsole.Update((
float)Timing.Step);
958 ObjectiveManager.VideoPlayer.Update();
959 tutorialMode.Update((
float)Timing.Step);
965 DebugConsole.Paused =
false;
973 Client?.Update((
float)Timing.Step);
975 GUI.Update((
float)Timing.Step);
980 List<GUIComponent> hierarchy =
new List<GUIComponent>();
981 var currComponent = GUI.MouseOn;
982 while (currComponent !=
null)
984 hierarchy.Add(currComponent);
985 currComponent = currComponent.Parent;
987 DebugConsole.NewMessage(
"*********************");
988 foreach (var component
in hierarchy)
990 if (component is { MouseRect: var mouseRect, Rect: var rect })
992 DebugConsole.NewMessage($
"{component.GetType().Name} {component.Style?.Name ?? "[
null]
"} {rect.Bottom} {mouseRect.Bottom}", mouseRect!=rect ? Color.Lime : Color.Red);
999 CoroutineManager.Update(Paused, (
float)Timing.Step);
1001 SteamManager.Update((
float)Timing.Step);
1002 EosInterface.Core.Update();
1006 SoundManager?.Update();
1010 Timing.Accumulator -= Timing.Step;
1021 Timing.Alpha = Timing.Accumulator / Timing.Step;
1024 if (performanceCounterTimer.ElapsedMilliseconds > 1000)
1026 CurrentUpdateRate = (int)Math.Round(updateCount / (
double)(performanceCounterTimer.ElapsedMilliseconds / 1000.0));
1027 performanceCounterTimer.Restart();
1034 Timing.Accumulator = 0.0f;
1037 private void FixRazerCortex()
1048 var oldBlendState = GraphicsDevice.BlendState;
1049 GraphicsDevice.BlendState = oldBlendState == BlendState.Opaque ? BlendState.NonPremultiplied : BlendState.Opaque;
1050 GraphicsDevice.BlendState = oldBlendState;
1057 protected override void Draw(GameTime gameTime)
1059 Stopwatch sw =
new Stopwatch();
1064 double deltaTime = gameTime.ElapsedGameTime.TotalSeconds;
1066 if (Timing.FrameLimit > 0)
1068 double step = 1.0 / Timing.FrameLimit;
1069 while (!GameSettings.CurrentConfig.Graphics.VSync && sw.Elapsed.TotalSeconds + deltaTime < step)
1077 if (loadingScreenOpen)
1079 TitleScreen.
Draw(spriteBatch, base.GraphicsDevice, (
float)deltaTime);
1086 if (DebugDraw && GUI.MouseOn !=
null)
1088 spriteBatch.Begin();
1091 List<GUIComponent> hierarchy =
new List<GUIComponent>();
1092 var currComponent = GUI.MouseOn;
1093 while (currComponent !=
null)
1095 hierarchy.Add(currComponent);
1096 currComponent = currComponent.Parent;
1099 Color[] colors = { Color.Lime, Color.Yellow, Color.Aqua, Color.Red };
1100 for (
int index = 0; index < hierarchy.Count; index++)
1102 var component = hierarchy[index];
1103 if (component is { MouseRect: var mouseRect, Rect: var rect })
1105 if (mouseRect.IsEmpty) { mouseRect = rect; }
1106 mouseRect.Location += (index%2,(index%4)/2);
1107 GUI.DrawRectangle(spriteBatch, mouseRect, colors[index%4]);
1113 GUI.DrawRectangle(spriteBatch, GUI.MouseOn.MouseRect, Color.Lime);
1114 GUI.DrawRectangle(spriteBatch, GUI.MouseOn.Rect, Color.Cyan);
1127 if (showVerificationPrompt)
1132 UserData =
"verificationprompt"
1134 msgBox.
Buttons[0].OnClicked = (yesBtn, userdata) =>
1136 QuitToMainMenu(save);
1139 msgBox.Buttons[0].OnClicked += msgBox.Close;
1140 msgBox.Buttons[1].OnClicked += msgBox.Close;
1146 CreatureMetrics.Save();
1149 GUI.SetSavingIndicatorState(
true);
1167 CoroutineManager.StopCoroutines(
"EndCinematic");
1171 GameAnalyticsManager.AddProgressionEvent(GameAnalyticsManager.ProgressionStatus.Fail,
1178 GameAnalyticsManager.AddDesignEvent(eventId +
"EventManager:ActiveEvents:" + activeEvent.Prefab.Identifier);
1183 tutorialMode.Tutorial?.Stop();
1201 var msgBox =
new GUIMessageBox(TextManager.Get(
"bugreportbutton"),
"")
1203 UserData =
"bugreporter",
1206 var linkHolder =
new GUILayoutGroup(
new RectTransform(
new Vector2(1.0f, 1.0f), msgBox.Content.RectTransform)) { Stretch =
true, RelativeSpacing = 0.025f };
1210 new GUIButton(
new RectTransform(
new Vector2(1.0f, 1.0f), linkHolder.RectTransform), TextManager.Get(
"bugreportfeedbackform"), style:
"MainMenuGUIButton", textAlignment: Alignment.Left)
1212 UserData =
"https://steamcommunity.com/app/602960/discussions/1/",
1213 OnClicked = (btn, userdata) =>
1215 if (!SteamManager.OverlayCustomUrl(userdata as
string))
1217 ShowOpenUriPrompt(userdata as
string);
1225 new GUIButton(
new RectTransform(
new Vector2(1.0f, 1.0f), linkHolder.RectTransform), TextManager.Get(
"bugreportgithubform"), style:
"MainMenuGUIButton", textAlignment: Alignment.Left)
1227 UserData =
"https://github.com/FakeFishGames/Barotrauma/discussions/new?category=bug-reports",
1228 OnClicked = (btn, userdata) =>
1230 ShowOpenUriPrompt(userdata as
string);
1236 msgBox.InnerFrame.RectTransform.MinSize =
new Point(0,
1237 msgBox.InnerFrame.Rect.Height + linkHolder.Rect.Height + msgBox.Content.AbsoluteSpacing * 2 + (
int)(50 * GUI.Scale));
1240 static bool waitForKeyHit =
true;
1243 waitForKeyHit = waitKeyHit;
1244 loadingScreenOpen =
true;
1246 return CoroutineManager.StartCoroutine(TitleScreen.
DoLoading(loader));
1249 protected override void OnExiting(
object sender, EventArgs args)
1252 CreatureMetrics.Save();
1253 DebugConsole.NewMessage(
"Exiting...");
1255 SteamManager.ShutDown();
1259 SaveUtil.CleanUnnecessarySaveFiles();
1263 DebugConsole.ThrowError(
"Error while cleaning unnecessary save files", e);
1266 if (GameAnalyticsManager.SendUserStatistics) { GameAnalyticsManager.ShutDown(); }
1267 if (GameSettings.CurrentConfig.SaveDebugConsoleLogs
1268 || GameSettings.CurrentConfig.VerboseLogging) { DebugConsole.SaveLogs(); }
1270 base.OnExiting(sender, args);
1275 LocalizedString text = TextManager.GetWithVariable(promptTextTag,
"[link]", url);
1277 if (!extensionText.IsNullOrEmpty())
1279 text += $
"\n\n{extensionText}";
1281 return ShowOpenUriPrompt(url, text);
1286 if (
string.IsNullOrEmpty(url)) {
return null; }
1291 UserData =
"verificationprompt"
1293 msgBox.
Buttons[0].OnClicked = (btn, userdata) =>
1297 ToolBox.OpenFileWithShell(url);
1301 DebugConsole.ThrowError($
"Failed to open the url {url}", e);
1306 msgBox.Buttons[1].OnClicked = msgBox.Close;
1319 TextInput.SetTextInputRect(rect);
1320 TextInput.StartTextInput();
1321 TextInput.SetTextInputRect(rect);
1322 TextInput.StopTextInput();
void MoveCamera(float deltaTime, bool allowMove=true, bool allowZoom=true, bool allowInput=true, bool? followSub=null)
bool??????? ShowCampaignUI
void HandleSaveAndQuit()
Handles updating store stock, registering event history and relocating items (i.e....
override void End(CampaignMode.TransitionType transitionType=CampaignMode.TransitionType.None)
static CharacterHealth?? OpenHealthWindow
Item????????? SelectedItem
The primary selected item. It can be any device that character interacts with. This excludes items li...
static Character? Controlled
Responsible for keeping track of the characters in the player crew, saving and loading their orders,...
static bool? IsCommandInterfaceOpen
IEnumerable< Event > ActiveEvents
RectTransform RectTransform
static readonly List< GUIComponent > MessageBoxes
List< GUIButton > Buttons
static GUIComponent VisibleBox
static LevelEditorScreen LevelEditorScreen
static CharacterEditor.CharacterEditorScreen CharacterEditorScreen
static NetLobbyScreen NetLobbyScreen
static ContentPackage VanillaContent
static SpriteEditorScreen SpriteEditorScreen
static bool IsFirstLaunch
CoroutineHandle ShowLoading(IEnumerable< CoroutineStatus > loader, bool waitKeyHit=true)
static void ResetFrameTime()
static RasterizerState ScissorTestEnable
static PerformanceCounter PerformanceCounter
static GUIMessageBox ShowOpenUriPrompt(string url, string promptTextTag="openlinkinbrowserprompt", string promptExtensionTag=null)
static SubEditorScreen SubEditorScreen
static int GraphicsHeight
static void QuitToMainMenu(bool save)
static void ExecuteAfterContentFinishedLoading(Action action)
Option< ConnectCommand > ConnectCommand
override void Draw(GameTime gameTime)
This is called when the game should draw itself.
static Lights.LightManager LightManager
static GUIMessageBox ShowOpenUriPrompt(string url, LocalizedString promptText)
override void OnExiting(object sender, EventArgs args)
static ChatMode ActiveChatMode
static bool IsMultiplayer
static bool IsSingleplayer
static readonly Version Version
override void UnloadContent()
UnloadContent will be called once per game and is the place to unload all content.
Action ResolutionChanged
NOTE: Use very carefully. You need to ensure that you ALWAYS unsubscribe from this when you no longer...
static int CurrentUpdateRate
static GameScreen GameScreen
static ParticleEditorScreen ParticleEditorScreen
static MainMenuScreen MainMenuScreen
static NetworkMember NetworkMember
static CampaignEndScreen CampaignEndScreen
static void OnFileDropped(object sender, FileDropEventArgs args)
static ParticleManager ParticleManager
override void Update(GameTime gameTime)
Allows the game to run logic such as updating the world, checking for collisions, gathering input,...
static void QuitToMainMenu(bool save, bool showVerificationPrompt)
static EventEditorScreen EventEditorScreen
void SetWindowMode(WindowMode windowMode)
void ApplyGraphicsSettings(bool recalculateFontsAndStyles=false)
static ServerListScreen ServerListScreen
static TestScreen TestScreen
static LoadingScreen TitleScreen
static bool DevMode
Doesn't automatically enable los or bot AI or do anything like that. Probably not fully implemented.
static void ResetNetLobbyScreen()
static GraphicsDeviceManager GraphicsDeviceManager
override void Initialize()
Allows the game to perform any initialization it needs to before starting to run. This is where it ca...
static ModDownloadScreen ModDownloadScreen
static void ResetIMEWorkaround()
override void LoadContent()
LoadContent will be called once per game and is the place to load all of your content.
static Sounds.SoundManager SoundManager
readonly ImmutableArray< string > ConsoleArguments
readonly Option< string > EgsExchangeCode
GameMode(GameModePreset preset)
virtual void UpdateWhilePaused(float deltaTime)
readonly Identifier Identifier
void LogEndRoundStats(string eventId, TraitorManager.TraitorResults? traitorResults=null)
CampaignDataPath DataPath
SubmarineInfo SubmarineInfo
static bool IsTabMenuOpen
readonly EventManager EventManager
void Update(float newValue)
IEnumerable< ItemComponent > ActiveHUDs
bool WaitForLanguageSelection
void Draw(SpriteBatch spriteBatch, GraphicsDevice graphics, float deltaTime)
readonly ConcurrentQueue< PendingSplashScreen > PendingSplashScreens
Triplet.first = filepath, Triplet.second = resolution, Triplet.third = audio gain
LanguageIdentifier[] AvailableLanguages
IEnumerable< CoroutineStatus > DoLoading(IEnumerable< CoroutineStatus > loader)
static void AddToGUIUpdateList()
void QuickStart(bool fixedSeed=false, Identifier sub=default, float difficulty=50, LevelGenerationParams levelGenerationParams=null)
static MultiplayerPreferences Instance
abstract string StringRepresentation
static VoipCapture Instance
virtual void AddToGUIUpdateList()
By default, submits the screen's main GUIFrame and, if requested upon construction,...
virtual void Update(double deltaTime)
virtual void Draw(double deltaTime, GraphicsDevice graphics, SpriteBatch spriteBatch)
static void AddToGUIUpdateList()
static WaterRenderer Instance
static ? SocialOverlay Instance
static CampaignDataPath CreateRegular(string savePath)
Creates a CampaignDataPath with the same load and save path.
static readonly LanguageIdentifier None