From e889141499bc528b805a95386b8410cece5f8bcc Mon Sep 17 00:00:00 2001 From: Ivan Rubinov Date: Fri, 24 May 2024 18:59:05 +0300 Subject: [PATCH 01/17] Add time left for evacuation --- .../Options/UI/Tabs/NetworkTab.xaml.cs | 10 ++++----- Content.Client/PDA/PdaMenu.xaml | 3 +++ Content.Client/PDA/PdaMenu.xaml.cs | 21 +++++++++++++++--- Content.Server/PDA/PdaSystem.cs | 22 ++++++++++++++++++- Content.Shared/CCVar/CCVars.cs | 2 +- Content.Shared/PDA/PdaUpdateState.cs | 7 ++++-- Resources/Locale/ru-RU/pda/pda-component.ftl | 3 ++- 7 files changed, 55 insertions(+), 13 deletions(-) diff --git a/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs b/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs index 0cdc3b53fb8..b229a4b94ba 100644 --- a/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs +++ b/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs @@ -62,11 +62,11 @@ private void OnSliderChanged(Robust.Client.UserInterface.Controls.Range range) private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args) { - _cfg.SetCVar(CVars.NetBufferSize, (int) NetInterpRatioSlider.Value - _stateMan.MinBufferSize); - _cfg.SetCVar(CVars.NetPredictTickBias, (int) NetPredictTickBiasSlider.Value); - _cfg.SetCVar(CVars.NetPVSEntityBudget, (int) NetPvsSpawnSlider.Value); - _cfg.SetCVar(CVars.NetPVSEntityEnterBudget, (int) NetPvsEntrySlider.Value); - _cfg.SetCVar(CVars.NetPVSEntityExitBudget, (int) NetPvsLeaveSlider.Value); + _cfg.SetCVar(CVars.NetBufferSize, (int)NetInterpRatioSlider.Value - _stateMan.MinBufferSize); + _cfg.SetCVar(CVars.NetPredictTickBias, (int)NetPredictTickBiasSlider.Value); + _cfg.SetCVar(CVars.NetPVSEntityBudget, (int)NetPvsSpawnSlider.Value); + _cfg.SetCVar(CVars.NetPVSEntityEnterBudget, (int)NetPvsEntrySlider.Value); + _cfg.SetCVar(CVars.NetPVSEntityExitBudget, (int)NetPvsLeaveSlider.Value); _cfg.SetCVar(CVars.NetPredict, NetPredictCheckbox.Pressed); _cfg.SaveToFile(); diff --git a/Content.Client/PDA/PdaMenu.xaml b/Content.Client/PDA/PdaMenu.xaml index 8f9a297afc2..e372dc521b6 100644 --- a/Content.Client/PDA/PdaMenu.xaml +++ b/Content.Client/PDA/PdaMenu.xaml @@ -44,6 +44,9 @@ + + + diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index c87b05b2d91..9f584510dbe 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -19,6 +19,7 @@ public sealed partial class PdaMenu : PdaWindow [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IEntitySystemManager _entitySystem = default!; private readonly ClientGameTicker _gameTicker; + private TimeSpan shuttleEvacTimeSpan; public const int HomeView = 0; public const int ProgramListView = 1; @@ -33,7 +34,7 @@ public sealed partial class PdaMenu : PdaWindow private string _alertLevel = Loc.GetString("comp-pda-ui-unknown"); private string _instructions = Loc.GetString("comp-pda-ui-unknown"); private string _balance = Loc.GetString("comp-pda-ui-unknown"); - + private string _timeLeftShuttle = Loc.GetString("comp-pda-ui-unknown"); private int _currentView; @@ -171,7 +172,15 @@ public void UpdateState(PdaUpdateState state) var stationTime = _gameTiming.CurTime.Subtract(_gameTicker.RoundStartTimeSpan); StationTimeLabel.SetMarkup(Loc.GetString("comp-pda-ui-station-time", - ("time", stationTime.ToString("hh\\:mm\\:ss")))); + ("time", stationTime.ToString("hh\\:mm\\:ss")))); + + var shuttleEvacTime = (state.EvacShuttleTime ?? TimeSpan.Zero) - _gameTiming.CurTime; + shuttleEvacTimeSpan = (state.EvacShuttleTime ?? TimeSpan.Zero); + if (state.EvacShuttleTime != null) + _timeLeftShuttle = Loc.GetString("comp-pda-ui-station-time", + ("time", shuttleEvacTime.ToString("hh\\:mm\\:ss"))); + + ShuttleLeftTimeLabel.SetMarkup(_timeLeftShuttle); var alertLevel = state.PdaOwnerInfo.StationAlertLevel; var alertColor = state.PdaOwnerInfo.StationAlertColor; @@ -309,7 +318,7 @@ public void ToProgramView(string title) /// /// Changes the current view to the given view number - /// + /// 12 public void ChangeView(int view) { if (ViewContainer.ChildCount <= view) @@ -346,6 +355,12 @@ protected override void Draw(DrawingHandleScreen handle) StationTimeLabel.SetMarkup(Loc.GetString("comp-pda-ui-station-time", ("time", stationTime.ToString("hh\\:mm\\:ss")))); + + var shuttleEvacTime = shuttleEvacTimeSpan - _gameTiming.CurTime; + _timeLeftShuttle = Loc.GetString("comp-pda-ui-station-time", + ("time", shuttleEvacTime.ToString("hh\\:mm\\:ss"))); + + ShuttleLeftTimeLabel.SetMarkup(_timeLeftShuttle); } } } diff --git a/Content.Server/PDA/PdaSystem.cs b/Content.Server/PDA/PdaSystem.cs index 047d671c9a2..8d740d25996 100644 --- a/Content.Server/PDA/PdaSystem.cs +++ b/Content.Server/PDA/PdaSystem.cs @@ -7,6 +7,9 @@ using Content.Server.Light.EntitySystems; using Content.Server.PDA.Ringer; using Content.Server.Station.Systems; +using Content.Server.RoundEnd; +using Content.Server.Shuttles.Components; +using Content.Server.Shuttles.Systems; using Content.Server.Store.Components; using Content.Server.Store.Systems; using Content.Shared.Access.Components; @@ -21,20 +24,27 @@ using Robust.Shared.Containers; using Robust.Shared.Player; using Robust.Shared.Utility; +using Content.Shared.CCVar; +using Robust.Shared.Timing; +using Robust.Shared.Configuration; namespace Content.Server.PDA { public sealed class PdaSystem : SharedPdaSystem { + [Dependency] private readonly RoundEndSystem _roundEndSystem = default!; [Dependency] private readonly CartridgeLoaderSystem _cartridgeLoader = default!; [Dependency] private readonly InstrumentSystem _instrument = default!; [Dependency] private readonly RingerSystem _ringer = default!; [Dependency] private readonly StationSystem _station = default!; [Dependency] private readonly StoreSystem _store = default!; + [Dependency] private readonly EmergencyShuttleSystem _emergencyShuttleSystem = default!; [Dependency] private readonly IChatManager _chatManager = default!; [Dependency] private readonly UserInterfaceSystem _ui = default!; [Dependency] private readonly UnpoweredFlashlightSystem _unpoweredFlashlight = default!; [Dependency] private readonly ContainerSystem _containerSystem = default!; + [Dependency] private readonly IConfigurationManager _cfg = default!; + [Dependency] private readonly IGameTiming _gameTiming = default!; public override void Initialize() { @@ -168,7 +178,16 @@ public void UpdatePdaUi(EntityUid uid, PdaComponent? pda = null, EntityUid? acto var id = CompOrNull(pda.ContainedId); var balance = 0; if (actor_uid != null && TryComp(actor_uid, out var account)) - balance = account.Balance; + balance = account.Balance; + + TimeSpan shuttleTime; + var station = _station.GetOwningStation(uid); + if (!TryComp(station, out var stationEmergencyShuttleComponent) && _roundEndSystem.ExpectedCountdownEnd != null) + shuttleTime = _roundEndSystem.ExpectedCountdownEnd ?? TimeSpan.Zero + _gameTiming.CurTime; + + else + shuttleTime = new TimeSpan(0, 0, (int)(_cfg.GetCVar(CCVars.EmergencyShuttleDockTime) * 60)); + var state = new PdaUpdateState( programs, @@ -186,6 +205,7 @@ public void UpdatePdaUi(EntityUid uid, PdaComponent? pda = null, EntityUid? acto StationAlertColor = pda.StationAlertColor }, balance, + shuttleTime, pda.StationName, showUplink, hasInstrument, diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 7a9c7898c9a..0990e02b0fc 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -875,7 +875,7 @@ public static readonly CVarDef /// Actual area may be larger, as it currently doesn't terminate mid neighbor finding. I.e., area may be that of a ~51 tile radius circle instead. /// public static readonly CVarDef ExplosionMaxArea = - CVarDef.Create("explosion.max_area", (int) 3.14f * 256 * 256, CVar.SERVERONLY); + CVarDef.Create("explosion.max_area", (int)3.14f * 256 * 256, CVar.SERVERONLY); /// /// Upper limit on the number of neighbor finding steps for the explosion system neighbor-finding algorithm. diff --git a/Content.Shared/PDA/PdaUpdateState.cs b/Content.Shared/PDA/PdaUpdateState.cs index 840f8c5ac1c..eb4b084c7d0 100644 --- a/Content.Shared/PDA/PdaUpdateState.cs +++ b/Content.Shared/PDA/PdaUpdateState.cs @@ -5,8 +5,8 @@ namespace Content.Shared.PDA { [Serializable, NetSerializable] public sealed class PdaUpdateState : CartridgeLoaderUiState // WTF is this. what. I ... fuck me I just want net entities to work - // TODO purge this shit - //AAAAAAAAAAAAAAAA + // TODO purge this shit + //AAAAAAAAAAAAAAAA { public bool FlashlightEnabled; public bool HasPen; @@ -18,6 +18,7 @@ public sealed class PdaUpdateState : CartridgeLoaderUiState // WTF is this. what public bool CanPlayMusic; public string? Address; public int Balance; + public TimeSpan? EvacShuttleTime; public PdaUpdateState( List programs, @@ -28,6 +29,7 @@ public PdaUpdateState( bool hasBook, PdaIdInfoText pdaOwnerInfo, int balance, + TimeSpan? evacShuttleTime, string? stationName, bool hasUplink = false, bool canPlayMusic = false, @@ -44,6 +46,7 @@ public PdaUpdateState( StationName = stationName; Address = address; Balance = balance; + EvacShuttleTime = evacShuttleTime; } } diff --git a/Resources/Locale/ru-RU/pda/pda-component.ftl b/Resources/Locale/ru-RU/pda/pda-component.ftl index 43656ee32a1..1944b4e2a37 100644 --- a/Resources/Locale/ru-RU/pda/pda-component.ftl +++ b/Resources/Locale/ru-RU/pda/pda-component.ftl @@ -29,4 +29,5 @@ comp-pda-ui-unknown = Неизвестно comp-pda-ui-unassigned = Не назначено pda-notification-message = [font size=12][bold]КПК[/bold] { $header }: [/font] "{ $message }" -comp-pda-ui-balance = Баланс: [color=white]{ $balance }[/color] +comp-pda-ui-balance = Баланс: [color=white]{ $balance }[/color] $ +comp-pda-ui-left-time = Время до эвакуации: [color=white]{ $time }[/color] From 4900c8537903558c17d918f68abc08b25f0241f3 Mon Sep 17 00:00:00 2001 From: Ivan Rubinov Date: Fri, 24 May 2024 19:01:36 +0300 Subject: [PATCH 02/17] fix pda ftl --- Resources/Locale/ru-RU/pda/pda-component.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Resources/Locale/ru-RU/pda/pda-component.ftl b/Resources/Locale/ru-RU/pda/pda-component.ftl index 1944b4e2a37..af3af1625ef 100644 --- a/Resources/Locale/ru-RU/pda/pda-component.ftl +++ b/Resources/Locale/ru-RU/pda/pda-component.ftl @@ -29,5 +29,5 @@ comp-pda-ui-unknown = Неизвестно comp-pda-ui-unassigned = Не назначено pda-notification-message = [font size=12][bold]КПК[/bold] { $header }: [/font] "{ $message }" -comp-pda-ui-balance = Баланс: [color=white]{ $balance }[/color] $ +comp-pda-ui-balance = Баланс: [color=white]{ $balance }$[/color] comp-pda-ui-left-time = Время до эвакуации: [color=white]{ $time }[/color] From f6ce105dd5ac4a250b72a2eded1252858816edb9 Mon Sep 17 00:00:00 2001 From: Ivan Rubinov Date: Fri, 24 May 2024 19:03:37 +0300 Subject: [PATCH 03/17] fix name --- Content.Client/PDA/PdaMenu.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index 9f584510dbe..15dda85e88d 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -177,7 +177,7 @@ public void UpdateState(PdaUpdateState state) var shuttleEvacTime = (state.EvacShuttleTime ?? TimeSpan.Zero) - _gameTiming.CurTime; shuttleEvacTimeSpan = (state.EvacShuttleTime ?? TimeSpan.Zero); if (state.EvacShuttleTime != null) - _timeLeftShuttle = Loc.GetString("comp-pda-ui-station-time", + _timeLeftShuttle = Loc.GetString("comp-pda-ui-left-time", ("time", shuttleEvacTime.ToString("hh\\:mm\\:ss"))); ShuttleLeftTimeLabel.SetMarkup(_timeLeftShuttle); @@ -357,7 +357,7 @@ protected override void Draw(DrawingHandleScreen handle) ("time", stationTime.ToString("hh\\:mm\\:ss")))); var shuttleEvacTime = shuttleEvacTimeSpan - _gameTiming.CurTime; - _timeLeftShuttle = Loc.GetString("comp-pda-ui-station-time", + _timeLeftShuttle = Loc.GetString("comp-pda-ui-left-time", ("time", shuttleEvacTime.ToString("hh\\:mm\\:ss"))); ShuttleLeftTimeLabel.SetMarkup(_timeLeftShuttle); From a3e3ad988c96cb8c3c38f22ae8b740260d032c7e Mon Sep 17 00:00:00 2001 From: Ivan Rubinov Date: Wed, 29 May 2024 18:31:45 +0300 Subject: [PATCH 04/17] =?UTF-8?q?=D0=9F=D0=BE=D1=84=D0=B8=D0=BA=D1=81?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=B2=D1=81=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Client/PDA/PdaMenu.xaml.cs | 19 ++++++++++--------- Content.Server/PDA/PdaSystem.cs | 17 ++++++++++++----- Content.Shared/PDA/PdaUpdateState.cs | 4 ++-- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index 15dda85e88d..ce64ace8259 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -32,9 +32,9 @@ public sealed partial class PdaMenu : PdaWindow private string _jobTitle = Loc.GetString("comp-pda-ui-unassigned"); private string _stationName = Loc.GetString("comp-pda-ui-unknown"); private string _alertLevel = Loc.GetString("comp-pda-ui-unknown"); + private string _timeLeftShuttle = Loc.GetString("comp-pda-ui-unknown"); private string _instructions = Loc.GetString("comp-pda-ui-unknown"); private string _balance = Loc.GetString("comp-pda-ui-unknown"); - private string _timeLeftShuttle = Loc.GetString("comp-pda-ui-unknown"); private int _currentView; @@ -166,19 +166,20 @@ public void UpdateState(PdaUpdateState state) StationNameLabel.SetMarkup(Loc.GetString("comp-pda-ui-station", ("station", _stationName))); - _balance = Loc.GetString("comp-pda-ui-balance", ("balance", state.Balance)); - BalanceLabel.SetMarkup(_balance); + if (state.Balance is not null) + _balance = Loc.GetString("comp-pda-ui-balance", ("balance", state.Balance.Value)); + BalanceLabel.SetMarkup(_balance); var stationTime = _gameTiming.CurTime.Subtract(_gameTicker.RoundStartTimeSpan); StationTimeLabel.SetMarkup(Loc.GetString("comp-pda-ui-station-time", - ("time", stationTime.ToString("hh\\:mm\\:ss")))); + ("time", stationTime.ToString("hh\\:mm\\:ss")))); - var shuttleEvacTime = (state.EvacShuttleTime ?? TimeSpan.Zero) - _gameTiming.CurTime; shuttleEvacTimeSpan = (state.EvacShuttleTime ?? TimeSpan.Zero); - if (state.EvacShuttleTime != null) + var shuttleEvacTime = shuttleEvacTimeSpan - _gameTiming.CurTime; + if (state.EvacShuttleTime is not null) _timeLeftShuttle = Loc.GetString("comp-pda-ui-left-time", - ("time", shuttleEvacTime.ToString("hh\\:mm\\:ss"))); + ("time", shuttleEvacTime.ToString("hh\\:mm\\:ss"))); ShuttleLeftTimeLabel.SetMarkup(_timeLeftShuttle); @@ -318,7 +319,7 @@ public void ToProgramView(string title) /// /// Changes the current view to the given view number - /// 12 + /// public void ChangeView(int view) { if (ViewContainer.ChildCount <= view) @@ -358,7 +359,7 @@ protected override void Draw(DrawingHandleScreen handle) var shuttleEvacTime = shuttleEvacTimeSpan - _gameTiming.CurTime; _timeLeftShuttle = Loc.GetString("comp-pda-ui-left-time", - ("time", shuttleEvacTime.ToString("hh\\:mm\\:ss"))); + ("time", shuttleEvacTime.TotalSeconds <= 0 ? Loc.GetString("comp-pda-ui-unknown") : shuttleEvacTime.ToString("hh\\:mm\\:ss"))); ShuttleLeftTimeLabel.SetMarkup(_timeLeftShuttle); } diff --git a/Content.Server/PDA/PdaSystem.cs b/Content.Server/PDA/PdaSystem.cs index 8d740d25996..62a137e6e3e 100644 --- a/Content.Server/PDA/PdaSystem.cs +++ b/Content.Server/PDA/PdaSystem.cs @@ -61,6 +61,8 @@ public override void Initialize() SubscribeLocalEvent(OnUiMessage); SubscribeLocalEvent(OnUiMessage); + SubscribeLocalEvent(OnEmergencyChanged); + SubscribeLocalEvent(OnNotification); SubscribeLocalEvent(OnStationRenamed); @@ -114,6 +116,11 @@ private void OnStationRenamed(StationRenamedEvent ev) UpdateAllPdaUisOnStation(); } + private void OnEmergencyChanged(RoundEndSystemChangedEvent ev) + { + UpdateAllPdaUisOnStation(); + } + private void OnAlertLevelChanged(AlertLevelChangedEvent args) { UpdateAllPdaUisOnStation(); @@ -176,17 +183,17 @@ public void UpdatePdaUi(EntityUid uid, PdaComponent? pda = null, EntityUid? acto var programs = _cartridgeLoader.GetAvailablePrograms(uid, loader); var id = CompOrNull(pda.ContainedId); - var balance = 0; - if (actor_uid != null && TryComp(actor_uid, out var account)) + int? balance = null; + if (actor_uid is not null && TryComp(actor_uid, out var account)) balance = account.Balance; TimeSpan shuttleTime; var station = _station.GetOwningStation(uid); - if (!TryComp(station, out var stationEmergencyShuttleComponent) && _roundEndSystem.ExpectedCountdownEnd != null) - shuttleTime = _roundEndSystem.ExpectedCountdownEnd ?? TimeSpan.Zero + _gameTiming.CurTime; + if (!TryComp(station, out var stationEmergencyShuttleComponent) && _roundEndSystem.ExpectedCountdownEnd is not null) + shuttleTime = _roundEndSystem.ExpectedCountdownEnd.Value; else - shuttleTime = new TimeSpan(0, 0, (int)(_cfg.GetCVar(CCVars.EmergencyShuttleDockTime) * 60)); + shuttleTime = TimeSpan.FromMinutes(_cfg.GetCVar(CCVars.EmergencyShuttleDockTime)); var state = new PdaUpdateState( diff --git a/Content.Shared/PDA/PdaUpdateState.cs b/Content.Shared/PDA/PdaUpdateState.cs index eb4b084c7d0..9da66c90434 100644 --- a/Content.Shared/PDA/PdaUpdateState.cs +++ b/Content.Shared/PDA/PdaUpdateState.cs @@ -17,7 +17,7 @@ public sealed class PdaUpdateState : CartridgeLoaderUiState // WTF is this. what public bool HasUplink; public bool CanPlayMusic; public string? Address; - public int Balance; + public int? Balance; public TimeSpan? EvacShuttleTime; public PdaUpdateState( @@ -28,7 +28,7 @@ public PdaUpdateState( bool hasPai, bool hasBook, PdaIdInfoText pdaOwnerInfo, - int balance, + int? balance, TimeSpan? evacShuttleTime, string? stationName, bool hasUplink = false, From af05fd4d905bf3bf48cc29431de43b7e93af87f7 Mon Sep 17 00:00:00 2001 From: Ivan Rubinov Date: Thu, 30 May 2024 16:45:28 +0300 Subject: [PATCH 05/17] Fix --- Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs | 10 +++++----- Content.Server/PDA/PdaSystem.cs | 1 - Content.Shared/CCVar/CCVars.cs | 2 +- Content.Shared/PDA/PdaUpdateState.cs | 4 ++-- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs b/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs index b229a4b94ba..0cdc3b53fb8 100644 --- a/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs +++ b/Content.Client/Options/UI/Tabs/NetworkTab.xaml.cs @@ -62,11 +62,11 @@ private void OnSliderChanged(Robust.Client.UserInterface.Controls.Range range) private void OnApplyButtonPressed(BaseButton.ButtonEventArgs args) { - _cfg.SetCVar(CVars.NetBufferSize, (int)NetInterpRatioSlider.Value - _stateMan.MinBufferSize); - _cfg.SetCVar(CVars.NetPredictTickBias, (int)NetPredictTickBiasSlider.Value); - _cfg.SetCVar(CVars.NetPVSEntityBudget, (int)NetPvsSpawnSlider.Value); - _cfg.SetCVar(CVars.NetPVSEntityEnterBudget, (int)NetPvsEntrySlider.Value); - _cfg.SetCVar(CVars.NetPVSEntityExitBudget, (int)NetPvsLeaveSlider.Value); + _cfg.SetCVar(CVars.NetBufferSize, (int) NetInterpRatioSlider.Value - _stateMan.MinBufferSize); + _cfg.SetCVar(CVars.NetPredictTickBias, (int) NetPredictTickBiasSlider.Value); + _cfg.SetCVar(CVars.NetPVSEntityBudget, (int) NetPvsSpawnSlider.Value); + _cfg.SetCVar(CVars.NetPVSEntityEnterBudget, (int) NetPvsEntrySlider.Value); + _cfg.SetCVar(CVars.NetPVSEntityExitBudget, (int) NetPvsLeaveSlider.Value); _cfg.SetCVar(CVars.NetPredict, NetPredictCheckbox.Pressed); _cfg.SaveToFile(); diff --git a/Content.Server/PDA/PdaSystem.cs b/Content.Server/PDA/PdaSystem.cs index 62a137e6e3e..c6587e608b0 100644 --- a/Content.Server/PDA/PdaSystem.cs +++ b/Content.Server/PDA/PdaSystem.cs @@ -44,7 +44,6 @@ public sealed class PdaSystem : SharedPdaSystem [Dependency] private readonly UnpoweredFlashlightSystem _unpoweredFlashlight = default!; [Dependency] private readonly ContainerSystem _containerSystem = default!; [Dependency] private readonly IConfigurationManager _cfg = default!; - [Dependency] private readonly IGameTiming _gameTiming = default!; public override void Initialize() { diff --git a/Content.Shared/CCVar/CCVars.cs b/Content.Shared/CCVar/CCVars.cs index 0990e02b0fc..7a9c7898c9a 100644 --- a/Content.Shared/CCVar/CCVars.cs +++ b/Content.Shared/CCVar/CCVars.cs @@ -875,7 +875,7 @@ public static readonly CVarDef /// Actual area may be larger, as it currently doesn't terminate mid neighbor finding. I.e., area may be that of a ~51 tile radius circle instead. /// public static readonly CVarDef ExplosionMaxArea = - CVarDef.Create("explosion.max_area", (int)3.14f * 256 * 256, CVar.SERVERONLY); + CVarDef.Create("explosion.max_area", (int) 3.14f * 256 * 256, CVar.SERVERONLY); /// /// Upper limit on the number of neighbor finding steps for the explosion system neighbor-finding algorithm. diff --git a/Content.Shared/PDA/PdaUpdateState.cs b/Content.Shared/PDA/PdaUpdateState.cs index 9da66c90434..70dbbc4f0a0 100644 --- a/Content.Shared/PDA/PdaUpdateState.cs +++ b/Content.Shared/PDA/PdaUpdateState.cs @@ -5,8 +5,8 @@ namespace Content.Shared.PDA { [Serializable, NetSerializable] public sealed class PdaUpdateState : CartridgeLoaderUiState // WTF is this. what. I ... fuck me I just want net entities to work - // TODO purge this shit - //AAAAAAAAAAAAAAAA + // TODO purge this shit + //AAAAAAAAAAAAAAAA { public bool FlashlightEnabled; public bool HasPen; From ed65e4fc8be322a6296970246b81ab20ebaf6b77 Mon Sep 17 00:00:00 2001 From: user424242420 <142989209+user424242420@users.noreply.github.com> Date: Fri, 31 May 2024 16:54:09 +0300 Subject: [PATCH 06/17] Update PdaMenu.xaml.cs --- Content.Client/PDA/PdaMenu.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index ce64ace8259..181f1d18b4e 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -166,9 +166,10 @@ public void UpdateState(PdaUpdateState state) StationNameLabel.SetMarkup(Loc.GetString("comp-pda-ui-station", ("station", _stationName))); - if (state.Balance is not null) + if (state.Balance is not null) { _balance = Loc.GetString("comp-pda-ui-balance", ("balance", state.Balance.Value)); BalanceLabel.SetMarkup(_balance); + } var stationTime = _gameTiming.CurTime.Subtract(_gameTicker.RoundStartTimeSpan); From 9eb5af3ee32529c3c5f4e59b1f6bcb35c6304037 Mon Sep 17 00:00:00 2001 From: user424242420 <142989209+user424242420@users.noreply.github.com> Date: Fri, 31 May 2024 20:30:35 +0300 Subject: [PATCH 07/17] Update PdaMenu.xaml.cs --- Content.Client/PDA/PdaMenu.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index 181f1d18b4e..7bc33ae25ed 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -166,7 +166,8 @@ public void UpdateState(PdaUpdateState state) StationNameLabel.SetMarkup(Loc.GetString("comp-pda-ui-station", ("station", _stationName))); - if (state.Balance is not null) { + if (state.Balance is not null) + { _balance = Loc.GetString("comp-pda-ui-balance", ("balance", state.Balance.Value)); BalanceLabel.SetMarkup(_balance); } From 5b27260771e7df181e79573a309e1ae953becf11 Mon Sep 17 00:00:00 2001 From: Ivan Rubinov Date: Fri, 31 May 2024 20:48:14 +0300 Subject: [PATCH 08/17] =?UTF-8?q?=D0=A4=D0=98=D0=9A=D0=A1=20=D0=A5=D0=A3?= =?UTF-8?q?=D0=99=D0=9D=D0=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Client/PDA/PdaMenu.xaml.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index 7bc33ae25ed..d34c8fe9da6 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -112,11 +112,16 @@ public PdaMenu() _clipboard.SetText(_stationName); }; - StationAlertLevelButton.OnPressed += _ => + TimeLeftShuttleButton.OnPressed += _ => { _clipboard.SetText(_alertLevel); }; + StationAlertLevelButton.OnPressed += _ => + { + _clipboard.SetText(_timeLeftShuttle); + }; + BalanceButton.OnPressed += _ => { _clipboard.SetText(_balance); @@ -166,7 +171,7 @@ public void UpdateState(PdaUpdateState state) StationNameLabel.SetMarkup(Loc.GetString("comp-pda-ui-station", ("station", _stationName))); - if (state.Balance is not null) + if (state.Balance is not null) { _balance = Loc.GetString("comp-pda-ui-balance", ("balance", state.Balance.Value)); BalanceLabel.SetMarkup(_balance); @@ -175,13 +180,13 @@ public void UpdateState(PdaUpdateState state) var stationTime = _gameTiming.CurTime.Subtract(_gameTicker.RoundStartTimeSpan); StationTimeLabel.SetMarkup(Loc.GetString("comp-pda-ui-station-time", - ("time", stationTime.ToString("hh\\:mm\\:ss")))); + ("time", stationTime.ToString("hh\\:mm\\:ss")))); - shuttleEvacTimeSpan = (state.EvacShuttleTime ?? TimeSpan.Zero); + shuttleEvacTimeSpan = state.EvacShuttleTime ?? TimeSpan.Zero; var shuttleEvacTime = shuttleEvacTimeSpan - _gameTiming.CurTime; if (state.EvacShuttleTime is not null) _timeLeftShuttle = Loc.GetString("comp-pda-ui-left-time", - ("time", shuttleEvacTime.ToString("hh\\:mm\\:ss"))); + ("time", shuttleEvacTime.ToString("hh\\:mm\\:ss"))); ShuttleLeftTimeLabel.SetMarkup(_timeLeftShuttle); From 8d4cc0fdeafc88a10a4288b107164e2328ed39c5 Mon Sep 17 00:00:00 2001 From: Ivan Rubinov Date: Fri, 31 May 2024 20:50:44 +0300 Subject: [PATCH 09/17] =?UTF-8?q?=D0=A4=D0=98=D0=9A=D0=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Content.Client/PDA/PdaMenu.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index d34c8fe9da6..c543d157342 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -112,12 +112,12 @@ public PdaMenu() _clipboard.SetText(_stationName); }; - TimeLeftShuttleButton.OnPressed += _ => + StationAlertLevelButton.OnPressed += _ => { _clipboard.SetText(_alertLevel); }; - StationAlertLevelButton.OnPressed += _ => + ShuttleLeftTimeButton.OnPressed += _ => { _clipboard.SetText(_timeLeftShuttle); }; From 8aea365b04fbf7f184b338e3f91448c6ef2144bb Mon Sep 17 00:00:00 2001 From: Ivan Rubinov Date: Fri, 31 May 2024 20:55:00 +0300 Subject: [PATCH 10/17] FIX --- Content.Server/PDA/PdaSystem.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Content.Server/PDA/PdaSystem.cs b/Content.Server/PDA/PdaSystem.cs index c6587e608b0..ef86bdfbc19 100644 --- a/Content.Server/PDA/PdaSystem.cs +++ b/Content.Server/PDA/PdaSystem.cs @@ -25,7 +25,6 @@ using Robust.Shared.Player; using Robust.Shared.Utility; using Content.Shared.CCVar; -using Robust.Shared.Timing; using Robust.Shared.Configuration; namespace Content.Server.PDA From a86e54fe7f17a49635d733f6396da66318ecf378 Mon Sep 17 00:00:00 2001 From: user424242420 <142989209+user424242420@users.noreply.github.com> Date: Fri, 31 May 2024 20:59:01 +0300 Subject: [PATCH 11/17] Update PdaMenu.xaml.cs --- Content.Client/PDA/PdaMenu.xaml.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index c543d157342..21ed2a3f5c2 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -19,7 +19,6 @@ public sealed partial class PdaMenu : PdaWindow [Dependency] private readonly IGameTiming _gameTiming = default!; [Dependency] private readonly IEntitySystemManager _entitySystem = default!; private readonly ClientGameTicker _gameTicker; - private TimeSpan shuttleEvacTimeSpan; public const int HomeView = 0; public const int ProgramListView = 1; @@ -27,6 +26,7 @@ public sealed partial class PdaMenu : PdaWindow public const int ProgramContentView = 3; + private TimeSpan shuttleEvacTimeSpan; private string _pdaOwner = Loc.GetString("comp-pda-ui-unknown"); private string _owner = Loc.GetString("comp-pda-ui-unknown"); private string _jobTitle = Loc.GetString("comp-pda-ui-unassigned"); @@ -35,6 +35,7 @@ public sealed partial class PdaMenu : PdaWindow private string _timeLeftShuttle = Loc.GetString("comp-pda-ui-unknown"); private string _instructions = Loc.GetString("comp-pda-ui-unknown"); private string _balance = Loc.GetString("comp-pda-ui-unknown"); + private int _currentView; From f27237e6de3bb60f1e6d6cfd2939b4d5091f1722 Mon Sep 17 00:00:00 2001 From: user424242420 <142989209+user424242420@users.noreply.github.com> Date: Fri, 31 May 2024 21:01:38 +0300 Subject: [PATCH 12/17] Update PdaMenu.xaml.cs --- Content.Client/PDA/PdaMenu.xaml.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index 21ed2a3f5c2..999b473d8c7 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -25,7 +25,6 @@ public sealed partial class PdaMenu : PdaWindow public const int SettingsView = 2; public const int ProgramContentView = 3; - private TimeSpan shuttleEvacTimeSpan; private string _pdaOwner = Loc.GetString("comp-pda-ui-unknown"); private string _owner = Loc.GetString("comp-pda-ui-unknown"); From 57fcc8f8fb66a185a445716a3625da66c16aac90 Mon Sep 17 00:00:00 2001 From: user424242420 <142989209+user424242420@users.noreply.github.com> Date: Fri, 31 May 2024 21:06:48 +0300 Subject: [PATCH 13/17] Update PdaMenu.xaml.cs --- Content.Client/PDA/PdaMenu.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index 999b473d8c7..013d9a0752c 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -26,6 +26,7 @@ public sealed partial class PdaMenu : PdaWindow public const int ProgramContentView = 3; private TimeSpan shuttleEvacTimeSpan; + private string _pdaOwner = Loc.GetString("comp-pda-ui-unknown"); private string _owner = Loc.GetString("comp-pda-ui-unknown"); private string _jobTitle = Loc.GetString("comp-pda-ui-unassigned"); From f8e16edd7bc89c187f488f686e743e389e499ce2 Mon Sep 17 00:00:00 2001 From: user424242420 <142989209+user424242420@users.noreply.github.com> Date: Fri, 31 May 2024 21:07:32 +0300 Subject: [PATCH 14/17] Update PdaMenu.xaml.cs --- Content.Client/PDA/PdaMenu.xaml.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index 013d9a0752c..d196119641d 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -27,6 +27,7 @@ public sealed partial class PdaMenu : PdaWindow private TimeSpan shuttleEvacTimeSpan; + private string _pdaOwner = Loc.GetString("comp-pda-ui-unknown"); private string _owner = Loc.GetString("comp-pda-ui-unknown"); private string _jobTitle = Loc.GetString("comp-pda-ui-unassigned"); From 90daa5e99cd83634b24585fe465714f501d7ce01 Mon Sep 17 00:00:00 2001 From: user424242420 <142989209+user424242420@users.noreply.github.com> Date: Fri, 31 May 2024 21:12:49 +0300 Subject: [PATCH 15/17] Update PdaMenu.xaml.cs --- Content.Client/PDA/PdaMenu.xaml.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index d196119641d..c80bed6ab06 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -36,7 +36,6 @@ public sealed partial class PdaMenu : PdaWindow private string _timeLeftShuttle = Loc.GetString("comp-pda-ui-unknown"); private string _instructions = Loc.GetString("comp-pda-ui-unknown"); private string _balance = Loc.GetString("comp-pda-ui-unknown"); - private int _currentView; From eeac0796a934b7d62ec2f5c2c88e47fb97d03b10 Mon Sep 17 00:00:00 2001 From: user424242420 <142989209+user424242420@users.noreply.github.com> Date: Fri, 31 May 2024 21:16:34 +0300 Subject: [PATCH 16/17] Update PdaMenu.xaml.cs --- Content.Client/PDA/PdaMenu.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index c80bed6ab06..031e0ac5b25 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -27,7 +27,6 @@ public sealed partial class PdaMenu : PdaWindow private TimeSpan shuttleEvacTimeSpan; - private string _pdaOwner = Loc.GetString("comp-pda-ui-unknown"); private string _owner = Loc.GetString("comp-pda-ui-unknown"); private string _jobTitle = Loc.GetString("comp-pda-ui-unassigned"); @@ -35,7 +34,8 @@ public sealed partial class PdaMenu : PdaWindow private string _alertLevel = Loc.GetString("comp-pda-ui-unknown"); private string _timeLeftShuttle = Loc.GetString("comp-pda-ui-unknown"); private string _instructions = Loc.GetString("comp-pda-ui-unknown"); - private string _balance = Loc.GetString("comp-pda-ui-unknown"); + private string _balance = Loc.GetString("comp-pda-ui-unknown");\ + private int _currentView; From b488d688f3a445852e497e17fee54238be1dd38e Mon Sep 17 00:00:00 2001 From: Ivan Rubinov Date: Fri, 31 May 2024 21:22:14 +0300 Subject: [PATCH 17/17] FIX --- Content.Client/PDA/PdaMenu.xaml.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Content.Client/PDA/PdaMenu.xaml.cs b/Content.Client/PDA/PdaMenu.xaml.cs index 031e0ac5b25..e3e871f0f3b 100644 --- a/Content.Client/PDA/PdaMenu.xaml.cs +++ b/Content.Client/PDA/PdaMenu.xaml.cs @@ -26,7 +26,7 @@ public sealed partial class PdaMenu : PdaWindow public const int ProgramContentView = 3; private TimeSpan shuttleEvacTimeSpan; - + private string _pdaOwner = Loc.GetString("comp-pda-ui-unknown"); private string _owner = Loc.GetString("comp-pda-ui-unknown"); private string _jobTitle = Loc.GetString("comp-pda-ui-unassigned"); @@ -34,7 +34,7 @@ public sealed partial class PdaMenu : PdaWindow private string _alertLevel = Loc.GetString("comp-pda-ui-unknown"); private string _timeLeftShuttle = Loc.GetString("comp-pda-ui-unknown"); private string _instructions = Loc.GetString("comp-pda-ui-unknown"); - private string _balance = Loc.GetString("comp-pda-ui-unknown");\ + private string _balance = Loc.GetString("comp-pda-ui-unknown"); private int _currentView;