Skip to content
Open
Show file tree
Hide file tree
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
41 changes: 26 additions & 15 deletions BeaverBuddies/Events/TimeEvents.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Text;
using Timberborn.Options;
using Timberborn.OptionsGame;
using Timberborn.TimeSystem;
using Timberborn.UILayoutSystem;
using static BeaverBuddies.SingletonManager;

namespace BeaverBuddies.Events
Expand Down Expand Up @@ -83,13 +83,6 @@ static bool Prefix(SpeedManager __instance, ref float speed)
}
}

// TODO: It might be nice to make this configurable: whether the host
// should freeze the game for these pop-ups. If we don't freeze, it could
// definitely cause some possible invalid operations (e.g. deleting a building
// that's not there anymore), but in theory these errors get caught before
// sending to the server. In practice, though, there could be side-effects of
// and aborted event. For clients, I think this is always a possibility, regardless
// of whether we freeze, since it's always happening at a delay.
[ManualMethodOverwrite]
/*
04/19/2025
Expand Down Expand Up @@ -170,25 +163,43 @@ public override void Replay(IReplayContext context)
}
}

// We make showing the options menu a synced game event, rather than
// By default, we make showing the options menu a synced game event, rather than
// a non-synced UI action, for two reasons:
// 1) This ensures that the Options menu is always shown when a full
// tick has been completed.
// 2) This will give other plays a visual clue about why the game has
// 2) This will give other players a visual clue about why the game has
// paused.
// However, only the host will be able to unpause, and only by manually
// setting the game speed, since they won't process any events by clients
// while they have a panel (including this one) up (I think...).
// TODO: Should allow client to bring up menu, even if they don't pause
[HarmonyPatch(typeof(GameOptionsBox), nameof(GameOptionsBox.Show))]
public class GameOptionsBoxShowPatcher
{
static bool Prefix()
{
return ReplayEvent.DoPrefix(() =>
{
return new ShowOptionsMenuEvent();
});

// This would make options menu unsynced and non-pausing,
// but I think it's dangerous to open the menu outside of a synced pause.
// So we will only do this if the user explicitly opts into it
if (Settings.PauseReductionLevel == 2 ) return true;

return ReplayEvent.DoPrefix(() => new ShowOptionsMenuEvent());
}
}

// OverlayPanelSpeedLocker is triggering ChangeAndLockSpeed via OnPanelShown
// This is now configurable via Settings.PauseReduction. If we don't freeze, it could
// definitely cause some possible invalid operations (e.g. deleting a building
// that's not there anymore), but in theory these errors get caught before
// sending to the server. In practice, though, there could be side-effects of
// and aborted event. For clients, I think this is always a possibility, regardless
// of whether we freeze, since it's always happening at a delay.
[HarmonyPatch(typeof(OverlayPanelSpeedLocker), nameof(OverlayPanelSpeedLocker.OnPanelShown))]
public class OverlayPanelSpeedLockerShowPatcher
{
public static bool Prefix()
{
return Settings.PauseReductionLevel == 0;
}
}
}
9 changes: 9 additions & 0 deletions BeaverBuddies/Localizations/deDE_BeaverBuddie.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ Hinweis: Diese Funktion funktioniert möglicherweise nicht, wenn dein Netzwerk P
Außerdem können Peer‑to‑Peer‑Verbindungen langsamer sein als direkte Verbindungen.",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame,"Freunde direkt über Steam beitreten lassen",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame.Tooltip,"Wenn aktiviert, können deine Freunde direkt über Steam deinem Spiel beitreten, ohne dass du sie einladen musst.",""
BeaverBuddies.Settings.PauseReduction,"Anzahl der erzwungenen Pausen reduzieren",""
BeaverBuddies.Settings.PauseReduction.Tooltip,"Für ein optimales Erlebnis sollten alle Spieler die gleiche Einstellung verwenden.

Aus - Standardverhalten
Empfohlen - Das Spiel wird bei Abrissen nicht pausiert
Hohes Risiko - Zusätzlich zu Empfohlen wird das Spiel auch beim Öffnen des Menüs nicht pausiert. Dies kann zu Speicherschäden führen, wenn du das Spiel vor dem Speichern nicht pausierst.",""
BeaverBuddies.Settings.PauseReduction.Off,"Aus",""
BeaverBuddies.Settings.PauseReduction.LowRisk,"Empfohlen",""
BeaverBuddies.Settings.PauseReduction.HighRisk,"Hohes Risiko",""
BeaverBuddies.Host.ConnectedClients,"Warte auf Clients…
Derzeit verbundene Clients:",""
BeaverBuddies.Host.DirectConnectClient,"Direkt‑Connect‑Client",""
Expand Down
11 changes: 10 additions & 1 deletion BeaverBuddies/Localizations/enUS_BeaverBuddie.csv
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ This setting is indended for developers.",""
BeaverBuddies.Settings.ShowFirstTimerMessage,"Show First Timer Message",""
BeaverBuddies.Settings.AlwaysTrace,"Always Use Detailed Logging",""
BeaverBuddies.Settings.AlwaysTrace.Tooltip,"When enabled, the game will always use detailed logging, which enables you to submit desync reports on the first occurrence without manually enabling detailed logging.
Note that all players must have the setting enabled.
Note that all players must have the setting enabled.
This setting will cause some lag and is not recommended for most players.",""
BeaverBuddies.Settings.ReportingConsent,"Consent to Reporting",""
BeaverBuddies.Settings.EnableSteamConnection,"Enable Steam Networking",""
Expand All @@ -61,6 +61,15 @@ Note: This feature may not work if your network does not support peer-to-peer co
Additionally, peer-to-peer connections may be slower than direct connections.",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame,"Allow Friends to Join Directly via Steam",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame.Tooltip,"When enabled, your friends can join your game directly via Steam without you inviting them.",""
BeaverBuddies.Settings.PauseReduction,"Reduce the number of forced pauses",""
BeaverBuddies.Settings.PauseReduction.Tooltip,"For an optimal experience, all players should set it to the same.

Off - Default behaviour
Recommended - Game will not be paused for deconstructions
High-Risk - In addition to Recommended, the game will also not pause when bringing up the menu. This can lead to save corruptions if you don't pause the game before saving.",""
BeaverBuddies.Settings.PauseReduction.Off,"Off",""
BeaverBuddies.Settings.PauseReduction.LowRisk,"Recommended",""
BeaverBuddies.Settings.PauseReduction.HighRisk,"High-Risk",""
BeaverBuddies.Host.ConnectedClients,"Wait for clients to connect...
Currently connected clients:",""
BeaverBuddies.Host.DirectConnectClient,"Direct Connect Client",""
Expand Down
9 changes: 9 additions & 0 deletions BeaverBuddies/Localizations/esES_BeaverBuddie.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ Nota: esta función puede no funcionar si tu red no soporta conexiones P2P.
Además, las conexiones P2P pueden ser más lentas que las directas.",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame,"Permitir que amigos se unan directamente vía Steam",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame.Tooltip,"Si está activado, tus amigos pueden unirse directamente a tu juego mediante Steam sin que los invites.",""
BeaverBuddies.Settings.PauseReduction,"Reducir el número de pausas forzadas",""
BeaverBuddies.Settings.PauseReduction.Tooltip,"Para una experiencia óptima, todos los jugadores deberían usar el mismo ajuste.

Desactivado - Comportamiento predeterminado
Recomendado - El juego no se pausará durante las deconstrucciones
Alto riesgo - Además de Recomendado, el juego tampoco se pausará al abrir el menú. Esto puede causar corrupción de guardado si no pausas el juego antes de guardar.",""
BeaverBuddies.Settings.PauseReduction.Off,"Desactivado",""
BeaverBuddies.Settings.PauseReduction.LowRisk,"Recomendado",""
BeaverBuddies.Settings.PauseReduction.HighRisk,"Alto riesgo",""
BeaverBuddies.Host.ConnectedClients,"Esperando clientes…
Clientes actualmente conectados:",""
BeaverBuddies.Host.DirectConnectClient,"Cliente de conexión directa",""
Expand Down
13 changes: 13 additions & 0 deletions BeaverBuddies/Localizations/frFR_BeaverBuddie.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ Remarque : cette fonctionnalité peut ne pas fonctionner si ton réseau ne suppo
De plus, les connexions P2P peuvent être plus lentes que les connexions directes.",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame,"Autoriser les amis à rejoindre via Steam",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame.Tooltip,"Si activé, tes amis peuvent rejoindre ta partie directement via Steam sans invitation.",""
BeaverBuddies.Settings.PauseReduction,"Réduire le nombre de pauses forcées",""
BeaverBuddies.Settings.PauseReduction.Tooltip,"Si activé, le nombre de pauses forcées (menu principal, déconstructions, etc.) est fortement réduit. Pour une expérience optimale, tous les joueurs devraient utiliser le même réglage.",""
BeaverBuddies.Settings.PauseReduction,"Réduire le nombre de pauses forcées",""
BeaverBuddies.Settings.PauseReduction.Tooltip,"Pour une expérience optimale, tous les joueurs devraient utiliser le même réglage.

Désactivé - Comportement par défaut
Recommandé - Le jeu ne sera pas mis en pause lors des déconstructions
Risque élevé - En plus de Recommandé, le jeu ne sera pas non plus mis en pause lors de l'ouverture du menu. Cela peut entraîner une corruption de sauvegarde si vous ne mettez pas le jeu en pause avant de sauvegarder.",""
BeaverBuddies.Settings.PauseReduction.Off,"Désactivé",""
BeaverBuddies.Settings.PauseReduction.LowRisk,"Recommandé",""
BeaverBuddies.Settings.PauseReduction.HighRisk,"Risque élevé",""
BeaverBuddies.Host.ConnectedClients,"En attente des clients…
Clients actuellement connectés :",""
BeaverBuddies.Host.ConnectedClients,"En attente des clients…
Clients actuellement connectés :",""
BeaverBuddies.Host.DirectConnectClient,"Client de connexion directe",""
Expand Down
9 changes: 9 additions & 0 deletions BeaverBuddies/Localizations/itIT_BeaverBuddie.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ Nota: questa funzione potrebbe non funzionare se la tua rete non supporta P2P.
Inoltre, le connessioni P2P possono essere più lente di quelle dirette.",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame,"Permetti agli amici di unirsi direttamente via Steam",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame.Tooltip,"Se attivo, i tuoi amici possono unirsi direttamente alla tua partita via Steam senza bisogno di inviti.",""
BeaverBuddies.Settings.PauseReduction,"Riduci il numero di pause forzate",""
BeaverBuddies.Settings.PauseReduction.Tooltip,"Per un'esperienza ottimale, tutti i giocatori dovrebbero impostarlo allo stesso modo.

Disattivato - Comportamento predefinito
Consigliato - Il gioco non verrà messo in pausa durante le decostruzioni
Alto rischio - Oltre a Consigliato, il gioco non si metterà in pausa neanche quando si apre il menu. Questo può causare corruzione dei salvataggi se non metti in pausa il gioco prima di salvare.",""
BeaverBuddies.Settings.PauseReduction.Off,"Off",""
BeaverBuddies.Settings.PauseReduction.LowRisk,"Recommended",""
BeaverBuddies.Settings.PauseReduction.HighRisk,"High-Risk",""
BeaverBuddies.Host.ConnectedClients,"In attesa di client…
Client attualmente connessi:",""
BeaverBuddies.Host.DirectConnectClient,"Client connessione diretta",""
Expand Down
9 changes: 9 additions & 0 deletions BeaverBuddies/Localizations/jaJP_BeaverBuddie.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ BeaverBuddies.Settings.EnableSteamConnection.Tooltip,"SteamのP2Pネットワー
また、P2P接続は直接接続より遅くなる場合があります。",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame,"Steam経由で友達が参加可能に",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame.Tooltip,"有効にすると、あなたの友達がSteam経由で招待なしで直接参加できます。",""
BeaverBuddies.Settings.PauseReduction,"強制一時停止の回数を減らす",""
BeaverBuddies.Settings.PauseReduction.Tooltip,"最適な体験のため、全プレイヤーが同じ設定を使用することを推奨します。

オフ - デフォルトの動作
推奨 - 解体時にゲームが一時停止しません
高リスク - 推奨に加えて、メニューを開いた時もゲームが一時停止しません。保存前にゲームを一時停止しないとセーブデータが破損する可能性があります。",""
BeaverBuddies.Settings.PauseReduction.Off,"オフ",""
BeaverBuddies.Settings.PauseReduction.LowRisk,"推奨",""
BeaverBuddies.Settings.PauseReduction.HighRisk,"高リスク",""
BeaverBuddies.Host.ConnectedClients,"クライアントを待っています…
現在接続中のクライアント:",""
BeaverBuddies.Host.DirectConnectClient,"ダイレクト接続クライアント",""
Expand Down
9 changes: 9 additions & 0 deletions BeaverBuddies/Localizations/koKR_BeaverBuddie.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ BeaverBuddies.Settings.EnableSteamConnection.Tooltip,"Steam의 P2P 네트워크
또한 P2P 연결은 직접 연결보다 느릴 수 있습니다.",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame,"친구가 Steam에서 바로 참여 가능",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame.Tooltip,"활성화하면 당신의 친구들이 Steam을 통해 초대 없이 바로 참여할 수 있습니다.",""
BeaverBuddies.Settings.PauseReduction,"강제 일시정지 횟수 줄이기",""
BeaverBuddies.Settings.PauseReduction.Tooltip,"최적의 경험을 위해 모든 플레이어가 동일한 설정을 사용하는 것이 좋습니다.

끄기 - 기본 동작
권장 - 해체 시 게임이 일시정지되지 않습니다
높은 위험 - 권장에 더해 메뉴를 열 때도 게임이 일시정지되지 않습니다. 저장하기 전에 게임을 일시정지하지 않으면 저장 파일이 손상될 수 있습니다.",""
BeaverBuddies.Settings.PauseReduction.Off,"끄기",""
BeaverBuddies.Settings.PauseReduction.LowRisk,"권장",""
BeaverBuddies.Settings.PauseReduction.HighRisk,"높은 위험",""
BeaverBuddies.Host.ConnectedClients,"클라이언트 연결 대기 중…
현재 연결된 클라이언트:",""
BeaverBuddies.Host.DirectConnectClient,"다이렉트 연결 클라이언트",""
Expand Down
9 changes: 9 additions & 0 deletions BeaverBuddies/Localizations/plPL_BeaverBuddie.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ Uwaga: ta funkcja może nie działać, jeśli twoja sieć nie obsługuje P2P.
Ponadto połączenia P2P mogą być wolniejsze niż bezpośrednie.",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame,"Pozwól znajomym na dołączenie przez Steam",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame.Tooltip,"Po włączeniu twoi znajomi mogą dołączyć do twojej gry bez zaproszenia, korzystając ze Steam.",""
BeaverBuddies.Settings.PauseReduction,"Zmniejsz liczbę wymuszonych pauz",""
BeaverBuddies.Settings.PauseReduction.Tooltip,"Dla najlepszego efektu wszyscy gracze powinni mieć to samo ustawienie.

Wyłączone - Domyślne zachowanie
Zalecane - Gra nie będzie wstrzymywana podczas rozbiórek
Wysokie ryzyko - Oprócz Zalecanego, gra również nie będzie wstrzymywana przy otwieraniu menu. Może to prowadzić do uszkodzenia zapisów, jeśli nie zatrzymasz gry przed zapisaniem.",""
BeaverBuddies.Settings.PauseReduction.Off,"Wyłączone",""
BeaverBuddies.Settings.PauseReduction.LowRisk,"Zalecane",""
BeaverBuddies.Settings.PauseReduction.HighRisk,"Wysokie ryzyko",""
BeaverBuddies.Host.ConnectedClients,"Oczekiwanie na klientów…
Obecnie połączeni klienci:",""
BeaverBuddies.Host.DirectConnectClient,"Klient połączenia bezpośredniego",""
Expand Down
9 changes: 9 additions & 0 deletions BeaverBuddies/Localizations/ptBR_BeaverBuddie.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ Nota: este recurso pode não funcionar se sua rede não suportar conexões P2P.
Além disso, conexões P2P podem ser mais lentas que conexões diretas.",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame,"Permitir que amigos entrem diretamente via Steam",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame.Tooltip,"Quando ativado, seus amigos podem entrar diretamente no seu jogo via Steam sem convite.",""
BeaverBuddies.Settings.PauseReduction,"Reduzir o número de pausas forçadas",""
BeaverBuddies.Settings.PauseReduction.Tooltip,"Para a melhor experiência, todos os jogadores devem usar a mesma configuração.

Desligado - Comportamento padrão
Recomendado - O jogo não será pausado durante desconstruções
Alto risco - Além de Recomendado, o jogo também não pausará ao abrir o menu. Isso pode levar à corrupção de salvamentos se você não pausar o jogo antes de salvar.",""
BeaverBuddies.Settings.PauseReduction.Off,"Desligado",""
BeaverBuddies.Settings.PauseReduction.LowRisk,"Recomendado",""
BeaverBuddies.Settings.PauseReduction.HighRisk,"Alto risco",""
BeaverBuddies.Host.ConnectedClients,"Aguardando clientes…
Clientes atualmente conectados:",""
BeaverBuddies.Host.DirectConnectClient,"Cliente de conexão direta",""
Expand Down
9 changes: 9 additions & 0 deletions BeaverBuddies/Localizations/ruRU_BeaverBuddie.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ BeaverBuddies.Settings.EnableSteamConnection.Tooltip,"Позволяет игр
Кроме того, P2P‑соединения могут быть медленнее прямых.",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame,"Разрешить друзьям присоединяться через Steam",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame.Tooltip,"Если включено, ваши друзья смогут напрямую подключаться к вашей игре через Steam без приглашения.",""
BeaverBuddies.Settings.PauseReduction,"Уменьшить число принудительных пауз",""
BeaverBuddies.Settings.PauseReduction.Tooltip,"Для лучшего опыта всем игрокам стоит использовать одинаковую настройку.

Выключено - Поведение по умолчанию
Рекомендуется - Игра не будет ставиться на паузу при разборке построек
Высокий риск - Помимо Рекомендуется, игра также не будет ставиться на паузу при открытии меню. Это может привести к повреждению сохранений, если вы не поставите игру на паузу перед сохранением.",""
BeaverBuddies.Settings.PauseReduction.Off,"Выключено",""
BeaverBuddies.Settings.PauseReduction.LowRisk,"Рекомендуется",""
BeaverBuddies.Settings.PauseReduction.HighRisk,"Высокий риск",""
BeaverBuddies.Host.ConnectedClients,"Ожидание клиентов…
В настоящее время подключено:",""
BeaverBuddies.Host.DirectConnectClient,"Клиент прямого подключения",""
Expand Down
9 changes: 9 additions & 0 deletions BeaverBuddies/Localizations/thTH_BeaverBuddie.csv
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@ BeaverBuddies.Settings.EnableSteamConnection.Tooltip,"อนุญาตให
นอกจากนี้ การเชื่อมต่อ P2P อาจช้ากว่าแบบตรง",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame,"ให้เพื่อนเข้าร่วมเกมผ่าน Steam ได้ตรงๆ",""
BeaverBuddies.Settings.FriendsCanJoinSteamGame.Tooltip,"หากเปิดใช้งาน เพื่อนของคุณสามารถเข้าร่วมเกมผ่าน Steam โดยไม่ต้องเชิญ",""
BeaverBuddies.Settings.PauseReduction,"ลดจำนวนการหยุดชั่วคราวที่ถูกบังคับ",""
BeaverBuddies.Settings.PauseReduction.Tooltip,"เพื่อประสบการณ์ที่ดีที่สุด ผู้เล่นทุกคนควรใช้การตั้งค่าเดียวกัน

ปิด - พฤติกรรมเริ่มต้น
แนะนำ - เกมจะไม่หยุดชั่วคราวระหว่างการรื้อถอน
ความเสี่ยงสูง - นอกจากแนะนำแล้ว เกมจะไม่หยุดชั่วคราวเมื่อเปิดเมนูด้วย อาจทำให้ไฟล์บันทึกเสียหายหากคุณไม่หยุดเกมก่อนบันทึก",""
BeaverBuddies.Settings.PauseReduction.Off,"ปิด",""
BeaverBuddies.Settings.PauseReduction.LowRisk,"แนะนำ",""
BeaverBuddies.Settings.PauseReduction.HighRisk,"ความเสี่ยงสูง",""
BeaverBuddies.Host.ConnectedClients,"กำลังรอลูกค้าเชื่อมต่อ…
ลูกค้าที่เชื่อมต่อขณะนี้:",""
BeaverBuddies.Host.DirectConnectClient,"ไคลเอนต์เชื่อมต่อโดยตรง",""
Expand Down
Loading