From: Fildrance Date: Thu, 18 Dec 2025 21:06:24 +0000 (+0300) Subject: feat: RnD tech research console now have reroll feature (#32931) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=1f2d80297cb81e8dbbd1c1f46aeb531a2624204c;p=space-station-14.git feat: RnD tech research console now have reroll feature (#32931) * feat: RnD tech research console now have reroll feature * fix: disable Rediscover button when there is not enough currency or user have no access * refactor: xml-doc, extract method, minor simplify xaml * minor cleanup after review * refactor: change sending research server points amount into BUI from state to ResearchServerComponent (using AfterAutoHandleStateEvent) * feat: now tech rerolls will have cooldown to ensure no one can spam-spend all dept budget instantly * refactor: revert unneeded code * refactor: whitespaces --------- Co-authored-by: pa.pecherskij --- diff --git a/Content.Client/Research/ResearchSystem.cs b/Content.Client/Research/ResearchSystem.cs index 55d9535272..7086fc928b 100644 --- a/Content.Client/Research/ResearchSystem.cs +++ b/Content.Client/Research/ResearchSystem.cs @@ -1,8 +1,5 @@ -using Content.Shared.Research.Systems; +using Content.Shared.Research.Systems; namespace Content.Client.Research; -public sealed class ResearchSystem : SharedResearchSystem -{ - -} +public sealed class ResearchSystem : SharedResearchSystem; diff --git a/Content.Client/Research/UI/ResearchConsoleBoundUserInterface.cs b/Content.Client/Research/UI/ResearchConsoleBoundUserInterface.cs index 2895ada61f..d5202eea5d 100644 --- a/Content.Client/Research/UI/ResearchConsoleBoundUserInterface.cs +++ b/Content.Client/Research/UI/ResearchConsoleBoundUserInterface.cs @@ -7,23 +7,22 @@ using Robust.Shared.Prototypes; namespace Content.Client.Research.UI; [UsedImplicitly] -public sealed class ResearchConsoleBoundUserInterface : BoundUserInterface +public sealed class ResearchConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : BoundUserInterface(owner, uiKey) { [ViewVariables] private ResearchConsoleMenu? _consoleMenu; - public ResearchConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) - { - } - protected override void Open() { base.Open(); - var owner = Owner; - _consoleMenu = this.CreateWindow(); - _consoleMenu.SetEntity(owner); + _consoleMenu.SetEntity(Owner); + + _consoleMenu.OnTechnologyRediscoverPressed += () => + { + SendMessage(new ConsoleRediscoverTechnologyMessage()); + }; _consoleMenu.OnTechnologyCardPressed += id => { @@ -56,6 +55,7 @@ public sealed class ResearchConsoleBoundUserInterface : BoundUserInterface if (state is not ResearchConsoleBoundInterfaceState castState) return; + _consoleMenu?.UpdatePanels(castState); _consoleMenu?.UpdateInformationPanel(castState); } diff --git a/Content.Client/Research/UI/ResearchConsoleMenu.xaml b/Content.Client/Research/UI/ResearchConsoleMenu.xaml index 8de9827c0c..8e3a74f933 100644 --- a/Content.Client/Research/UI/ResearchConsoleMenu.xaml +++ b/Content.Client/Research/UI/ResearchConsoleMenu.xaml @@ -1,4 +1,4 @@ -