From cdd62515ea1710c762dc787fae188e7d41890f7e Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 22 Apr 2023 11:55:39 -0400 Subject: add multiplayer player type to window titles --- src/SMAPI/Framework/SCore.cs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/SMAPI/Framework/SCore.cs') 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); } /// Log a warning if software known to cause issues is installed. -- cgit