HorizontalExpand="True"
MinSize="50 50"
Margin="8">
- <RichTextLabel Name="PdaOwnerLabel" Access="Public" />
- <RichTextLabel Name="IdInfoLabel"
- Access="Public"
- HorizontalExpand="True" />
- <PanelContainer>
- <BoxContainer Orientation="Horizontal">
- <RichTextLabel Name="StationNameLabel"
- Access="Public"
- HorizontalExpand="True" />
- </BoxContainer>
- </PanelContainer>
- <RichTextLabel Name="StationAlertLevelLabel" Access="Public" />
- <RichTextLabel Name="StationTimeLabel" Access="Public" />
- <RichTextLabel Name="StationAlertLevelInstructions" Access="Public" />
+ <ContainerButton Name="PdaOwnerButton">
+ <RichTextLabel Name="PdaOwnerLabel" Access="Public"/>
+ </ContainerButton>
+ <ContainerButton Name="IdInfoButton">
+ <RichTextLabel Name="IdInfoLabel" Access="Public"/>
+ </ContainerButton>
+ <ContainerButton Name="StationNameButton">
+ <RichTextLabel Name="StationNameLabel" Access="Public"/>
+ </ContainerButton>
+ <ContainerButton Name="StationAlertLevelButton">
+ <RichTextLabel Name="StationAlertLevelLabel" Access="Public"/>
+ </ContainerButton>
+ <ContainerButton Name="StationTimeButton">
+ <RichTextLabel Name="StationTimeLabel" Access="Public"/>
+ </ContainerButton>
+ <ContainerButton Name="StationAlertLevelInstructionsButton">
+ <RichTextLabel Name="StationAlertLevelInstructions" Access="Public"/>
+ </ContainerButton>
</BoxContainer>
<ScrollContainer HorizontalExpand="True" VerticalExpand="True" HScrollEnabled="True">
<BoxContainer Orientation="Vertical"
[GenerateTypedNameReferences]
public sealed partial class PdaMenu : PdaWindow
{
+ [Dependency] private readonly IClipboardManager _clipboard = null!;
[Dependency] private readonly IGameTiming _gameTiming = default!;
[Dependency] private readonly IEntitySystemManager _entitySystem = default!;
private readonly ClientGameTicker _gameTicker;
public const int SettingsView = 2;
public const int ProgramContentView = 3;
+
+ 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");
+ private string _stationName = Loc.GetString("comp-pda-ui-unknown");
+ private string _alertLevel = Loc.GetString("comp-pda-ui-unknown");
+ private string _instructions = Loc.GetString("comp-pda-ui-unknown");
+
+
private int _currentView;
public event Action<EntityUid>? OnProgramItemPressed;
ToHomeScreen();
};
+ PdaOwnerButton.OnPressed += _ =>
+ {
+ _clipboard.SetText(_pdaOwner);
+ };
+
+ IdInfoButton.OnPressed += _ =>
+ {
+ _clipboard.SetText(_owner + ", " + _jobTitle);
+ };
+
+ StationNameButton.OnPressed += _ =>
+ {
+ _clipboard.SetText(_stationName);
+ };
+
+ StationAlertLevelButton.OnPressed += _ =>
+ {
+ _clipboard.SetText(_alertLevel);
+ };
+
+ StationTimeButton.OnPressed += _ =>
+ {
+ var stationTime = _gameTiming.CurTime.Subtract(_gameTicker.RoundStartTimeSpan);
+ _clipboard.SetText((stationTime.ToString("hh\\:mm\\:ss")));
+ };
+
+ StationAlertLevelInstructionsButton.OnPressed += _ =>
+ {
+ _clipboard.SetText(_instructions);
+ };
+
+
+
HideAllViews();
ToHomeScreen();
if (state.PdaOwnerInfo.ActualOwnerName != null)
{
+ _pdaOwner = state.PdaOwnerInfo.ActualOwnerName;
PdaOwnerLabel.SetMarkup(Loc.GetString("comp-pda-ui-owner",
- ("actualOwnerName", state.PdaOwnerInfo.ActualOwnerName)));
+ ("actualOwnerName", _pdaOwner)));
}
if (state.PdaOwnerInfo.IdOwner != null || state.PdaOwnerInfo.JobTitle != null)
{
+ _owner = state.PdaOwnerInfo.IdOwner ?? Loc.GetString("comp-pda-ui-unknown");
+ _jobTitle = state.PdaOwnerInfo.JobTitle ?? Loc.GetString("comp-pda-ui-unassigned");
IdInfoLabel.SetMarkup(Loc.GetString("comp-pda-ui",
- ("owner", state.PdaOwnerInfo.IdOwner ?? Loc.GetString("comp-pda-ui-unknown")),
- ("jobTitle", state.PdaOwnerInfo.JobTitle ?? Loc.GetString("comp-pda-ui-unassigned"))));
+ ("owner", _owner),
+ ("jobTitle", _jobTitle)));
}
else
{
IdInfoLabel.SetMarkup(Loc.GetString("comp-pda-ui-blank"));
}
+ _stationName = state.StationName ?? Loc.GetString("comp-pda-ui-unknown");
StationNameLabel.SetMarkup(Loc.GetString("comp-pda-ui-station",
- ("station", state.StationName ?? Loc.GetString("comp-pda-ui-unknown"))));
+ ("station", _stationName)));
+
var stationTime = _gameTiming.CurTime.Subtract(_gameTicker.RoundStartTimeSpan);
var alertLevel = state.PdaOwnerInfo.StationAlertLevel;
var alertColor = state.PdaOwnerInfo.StationAlertColor;
var alertLevelKey = alertLevel != null ? $"alert-level-{alertLevel}" : "alert-level-unknown";
+ _alertLevel = Loc.GetString(alertLevelKey);
StationAlertLevelLabel.SetMarkup(Loc.GetString(
"comp-pda-ui-station-alert-level",
("color", alertColor),
- ("level", Loc.GetString(alertLevelKey))
+ ("level", _alertLevel)
));
-
+ _instructions = Loc.GetString($"{alertLevelKey}-instructions");
StationAlertLevelInstructions.SetMarkup(Loc.GetString(
"comp-pda-ui-station-alert-level-instructions",
- ("instructions", Loc.GetString($"{alertLevelKey}-instructions")))
+ ("instructions", _instructions))
);
AddressLabel.Text = state.Address?.ToUpper() ?? " - ";