Skip to content

Commit

Permalink
Добавление даты в кпк
Browse files Browse the repository at this point in the history
  • Loading branch information
user424242420 committed Jan 10, 2024
1 parent b74e7fc commit f8486af
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
15 changes: 9 additions & 6 deletions Content.Client/PDA/PdaMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,15 @@ public sealed partial class PdaMenu : PdaWindow
public const int SettingsView = 2;
public const int ProgramContentView = 3;

private readonly TimeSpan DeltaUtc3 = new TimeSpan(3,0,0);

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;

Expand Down Expand Up @@ -117,15 +118,15 @@ public PdaMenu()
StationTimeButton.OnPressed += _ =>
{
var stationTime = _gameTiming.CurTime.Subtract(_gameTicker.RoundStartTimeSpan);
_clipboard.SetText((stationTime.ToString("hh\\:mm\\:ss")));
_clipboard.SetText((stationTime.ToString("hh\\:mm\\:ss")) + " " + (DateTime.Now.ToUniversalTime() + DeltaUtc3).ToString("dd\\.MM\\.\\3\\0yy"));
};

StationAlertLevelInstructionsButton.OnPressed += _ =>
{
_clipboard.SetText(_instructions);
};




HideAllViews();
Expand Down Expand Up @@ -160,12 +161,13 @@ public void UpdateState(PdaUpdateState state)
_stationName = state.StationName ?? Loc.GetString("comp-pda-ui-unknown");
StationNameLabel.SetMarkup(Loc.GetString("comp-pda-ui-station",
("station", _stationName)));


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")),
("date", (DateTime.Now.ToUniversalTime() + DeltaUtc3).ToString("dd\\.MM\\.\\3\\0yy"))));

var alertLevel = state.PdaOwnerInfo.StationAlertLevel;
var alertColor = state.PdaOwnerInfo.StationAlertColor;
Expand Down Expand Up @@ -339,7 +341,8 @@ protected override void Draw(DrawingHandleScreen handle)
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")),
("date", (DateTime.Now.ToUniversalTime() + DeltaUtc3).ToString("dd\\.MM\\.\\3\\0yy"))));
}
}
}
2 changes: 1 addition & 1 deletion Resources/Locale/en-US/pda/pda-component.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ comp-pda-ui-station-alert-level = Alert Level: [color={ $color }]{ $level }[/col
comp-pda-ui-station-alert-level-instructions = Instructions: [color=white]{ $instructions }[/color]
comp-pda-ui-station-time = Shift duration: [color=white]{ $time }[/color]
comp-pda-ui-station-time = Shift duration: [color=white]{ $time } { $date }[/color]
comp-pda-ui-eject-id-button = Eject ID
Expand Down
2 changes: 1 addition & 1 deletion Resources/Locale/ru-RU/pda/pda-component.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ comp-pda-ui-footer = Карманный Персональный Компьют
comp-pda-ui-station = Станция: [color=white]{ $station }[/color]
comp-pda-ui-station-alert-level = Уровень угрозы: [color={ $color }]{ $level }[/color]
comp-pda-ui-station-alert-level-instructions = Инструкции: [color=white]{ $instructions }[/color]
comp-pda-ui-station-time = Продолжительность смены: [color=white]{ $time }[/color]
comp-pda-ui-station-time = Продолжительность смены: [color=white]{ $time } { $date }[/color]
comp-pda-ui-eject-id-button = Извлечь ID
comp-pda-ui-eject-pen-button = Извлечь ручку
comp-pda-ui-ringtone-button-description = Измените рингтон вашего КПК
Expand Down

0 comments on commit f8486af

Please sign in to comment.