<OptionButton Name="SolutionOption" HorizontalExpand="True"/>
</BoxContainer>
+ <BoxContainer Orientation="Horizontal" HorizontalExpand="True" Margin="0 4">
+ <Button Name="VVButton"
+ Text="{Loc 'admin-solutions-window-vv-button'}"
+ ToolTip="{Loc 'admin-solutions-window-vv-button-tooltip'}"
+ Disabled="True"
+ HorizontalExpand="True"
+ StyleClasses="OpenRight"/>
+ <Button Name="SolutionButton"
+ Text="{Loc 'admin-solutions-window-solution-button'}"
+ ToolTip="{Loc 'admin-solutions-window-solution-button-tooltip'}"
+ Disabled="True"
+ HorizontalExpand="True"
+ StyleClasses="OpenLeft"/>
+ </BoxContainer>
+
<!-- The total volume / capacity of the solution -->
<BoxContainer Name="VolumeBox" Orientation="Vertical" HorizontalExpand="True" Margin="0 4"/>
+using Content.Client.Administration.Managers;
using Content.Shared.Administration;
using Content.Shared.Chemistry.Components;
using Content.Shared.Chemistry.Reagent;
[Dependency] private readonly IClientConsoleHost _consoleHost = default!;
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly IClientGameTiming _timing = default!;
+ [Dependency] private readonly IClientAdminManager _admin = default!;
private NetEntity _target = NetEntity.Invalid;
private string? _selectedSolution;
SolutionOption.OnItemSelected += SolutionSelected;
AddButton.OnPressed += OpenAddReagentWindow;
+ VVButton.OnPressed += OpenVVWindow;
+ SolutionButton.OnPressed += OpenSolutionWindow;
+
+ VVButton.Disabled = !_admin.CanViewVar();
+ SolutionButton.Disabled = !_admin.CanViewVar();
}
public override void Close()
_addReagentWindow.OpenCentered();
}
+ /// <summary>
+ /// Open the corresponding solution entity in a ViewVariables window.
+ /// </summary>
+ private void OpenVVWindow(BaseButton.ButtonEventArgs obj)
+ {
+ if (_solutions == null
+ || _selectedSolution == null
+ || !_solutions.TryGetValue(_selectedSolution, out var uid)
+ || !_entityManager.TryGetNetEntity(uid, out var netEntity))
+ return;
+ _consoleHost.ExecuteCommand($"vv {netEntity}");
+ }
+
+ /// <summary>
+ /// Open the corresponding Solution instance in a ViewVariables window.
+ /// </summary>
+ private void OpenSolutionWindow(BaseButton.ButtonEventArgs obj)
+ {
+ if (_solutions == null
+ || _selectedSolution == null
+ || !_solutions.TryGetValue(_selectedSolution, out var uid)
+ || !_entityManager.TryGetNetEntity(uid, out var netEntity))
+ return;
+ _consoleHost.ExecuteCommand($"vv /entity/{netEntity}/Solution/Solution");
+ }
+
/// <summary>
/// When a new solution is selected, set _selectedSolution and update the reagent list.
/// </summary>
admin-solutions-window-title = Solution Editor - {$targetName}
admin-solutions-window-solution-label = Target solution:
+admin-solutions-window-solution-button = Solution
+admin-solutions-window-solution-button-tooltip = Opens the corresponding server-side Solution instance in ViewVariables. Useful for debugging prediction issues.
+admin-solutions-window-vv-button = VV
+admin-solutions-window-vv-button-tooltip = Opens the corresponding solution entity in ViewVariables.
admin-solutions-window-add-new-button = Add new reagent
admin-solutions-window-volume-label = Volume {$currentVolume}/{$maxVolume}u
admin-solutions-window-capacity-label = Capacity (u):
admin-solutions-window-heat-capacity-label = Heat Capacity: {$heatCapacity} J/K
admin-solutions-window-temperature-label = Temperature (K):
admin-solutions-window-thermal-energy-label = Thermal Energy (J):
-admin-solutions-window-thermals = Thermals
\ No newline at end of file
+admin-solutions-window-thermals = Thermals