Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions PauseInMultiplayer/PauseInMultiplayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,14 @@ private void GameLoop_GameLaunched(object? sender, StardewModdingAPI.Events.Game
setValue: value => this.config.AnyCutscenePauses = value
);

configMenu.AddBoolOption(
mod: this.ModManifest,
name: () => "Any player pauses",
tooltip: () => "(host only)\nWhen enabled, time will pause if any player is in a pausable state.",
getValue: () => this.config.AnyPausePauses,
setValue: value => this.config.AnyPausePauses = value
);


}

Expand Down Expand Up @@ -535,7 +543,8 @@ private void GameLoop_UpdateTicking(object? sender, StardewModdingAPI.Events.Upd
//pause all Monsters
List<GameLocation> farmerLocations = new List<GameLocation>();
foreach (Farmer f in Game1.getOnlineFarmers())
farmerLocations.Add(f.currentLocation);
if (f.currentLocation != null)
farmerLocations.Add(f.currentLocation);
foreach (GameLocation l in farmerLocations)
{
foreach (Character c in l.characters)
Expand Down Expand Up @@ -702,11 +711,20 @@ private bool shouldPause()
return true;
}

//normal pause logic (terminates via false)
foreach (string pauseTime in pauseTimeAll.Values)
if (pauseTime == "false") return false;
if (config.AnyPausePauses)
{
foreach (string pauseTime in pauseTimeAll.Values)
if (pauseTime == "true") return true;

return false;
}
else
{
foreach (string pauseTime in pauseTimeAll.Values)
if (pauseTime == "false") return false;

return true;
return true;
}
}
else
{
Expand Down Expand Up @@ -765,6 +783,8 @@ class ModConfig
public bool LockMonsters { get; set; } = true;

public bool AnyCutscenePauses { get; set; } = false;

public bool AnyPausePauses { get; set; } = false;

public bool EnableVotePause { get; set; } = true;

Expand Down