summaryrefslogtreecommitdiff
path: root/src/SMAPI
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2023-04-22 11:55:39 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2023-04-22 11:55:39 -0400
commitcdd62515ea1710c762dc787fae188e7d41890f7e (patch)
treeb35f42e14867ec4cfd48a550f7f4bb1568c8f771 /src/SMAPI
parent8d600e226960a81636137d9bf286c69ab39066ed (diff)
downloadSMAPI-cdd62515ea1710c762dc787fae188e7d41890f7e.tar.gz
SMAPI-cdd62515ea1710c762dc787fae188e7d41890f7e.tar.bz2
SMAPI-cdd62515ea1710c762dc787fae188e7d41890f7e.zip
add multiplayer player type to window titles
Diffstat (limited to 'src/SMAPI')
-rw-r--r--src/SMAPI/Framework/SCore.cs17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/SMAPI/Framework/SCore.cs b/src/SMAPI/Framework/SCore.cs
index 3e179ef7..10f2821c 100644
--- a/src/SMAPI/Framework/SCore.cs
+++ b/src/SMAPI/Framework/SCore.cs
@@ -854,6 +854,9 @@ namespace StardewModdingAPI.Framework
this.Monitor.Log(context);
+ // add context to window titles
+ this.UpdateWindowTitles();
+
// raise events
this.OnLoadStageChanged(LoadStage.Ready);
events.SaveLoaded.RaiseEmpty();
@@ -1205,6 +1208,7 @@ namespace StardewModdingAPI.Framework
case LoadStage.None:
this.JustReturnedToTitle = true;
+ this.UpdateWindowTitles();
break;
case LoadStage.Loaded:
@@ -1452,15 +1456,14 @@ namespace StardewModdingAPI.Framework
string consoleTitle = $"SMAPI {Constants.ApiVersion} - running Stardew Valley {Constants.GameVersion}";
string gameTitle = $"Stardew Valley {Constants.GameVersion} - running SMAPI {Constants.ApiVersion}";
+ string suffix = "";
if (this.ModRegistry.AreAllModsLoaded)
- {
- int modsLoaded = this.ModRegistry.GetAll().Count();
- consoleTitle += $" with {modsLoaded} mods";
- gameTitle += $" with {modsLoaded} mods";
- }
+ suffix += $" with {this.ModRegistry.GetAll().Count()} mods";
+ if (Context.IsMultiplayer)
+ suffix += $" [{(Context.IsMainPlayer ? "main player" : "farmhand")}]";
- this.Game.Window.Title = gameTitle;
- this.LogManager.SetConsoleTitle(consoleTitle);
+ this.Game.Window.Title = gameTitle + suffix;
+ this.LogManager.SetConsoleTitle(consoleTitle + suffix);
}
/// <summary>Log a warning if software known to cause issues is installed.</summary>