Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

КПК Описание Инструкций Сигнализаций Станции #733

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions Content.Client/PDA/PdaMenu.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@
<ContainerButton Name="StationAlertLevelInstructionsButton">
<RichTextLabel Name="StationAlertLevelInstructions" Access="Public"/>
</ContainerButton>
<ContainerButton Name="StationAlertLevelInstructionsButtonForCommands"> <!-- ADT START-->
<RichTextLabel Name="StationAlertLevelInstructionsForCommands" Access="Public"/>
</ContainerButton>
<ContainerButton Name="StationAlertLevelInstructionsButtonForCapitan">
<RichTextLabel Name="StationAlertLevelInstructionsForCapitan" Access="Public"/>
</ContainerButton>
<ContainerButton Name="StationAlertLevelInstructionsButtonForSecurity">
<RichTextLabel Name="StationAlertLevelInstructionsForSecurity" Access="Public"/>
</ContainerButton>
<ContainerButton Name="StationAlertLevelInstructionsButtonForAnother">
<RichTextLabel Name="StationAlertLevelInstructionsForAnother" Access="Public"/>
</ContainerButton> <!-- ADT END -->
</BoxContainer>
<ScrollContainer HorizontalExpand="True" VerticalExpand="True" HScrollEnabled="True">
<BoxContainer Orientation="Vertical"
Expand Down
148 changes: 143 additions & 5 deletions Content.Client/PDA/PdaMenu.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,56 @@ public sealed partial class PdaMenu : PdaWindow
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 string _instructionsForCommands = Loc.GetString("comp-pda-ui-for-commands-unknown"); // ADT START
private string _instructionsForCapitan = Loc.GetString("comp-pda-ui-for-capitan-unknown");
private string _instructionsForSecurity = Loc.GetString("comp-pda-ui-for-security-unknown");
private string _instructionsForAnother = Loc.GetString("comp-pda-ui-for-another-unknown"); // ADT END


private int _currentView;

public event Action<EntityUid>? OnProgramItemPressed;
public event Action<EntityUid>? OnUninstallButtonPressed;
public event Action<EntityUid>? OnInstallButtonPressed;

private bool IsAnother(string jobTitle) // ADT START Капитан
{
return jobTitle.Equals("Клоун", StringComparison.OrdinalIgnoreCase);

} // ADT END

private bool IsCommand(string jobTitle) // ADT START Главы
{
return jobTitle.Equals("Главный врач", StringComparison.OrdinalIgnoreCase) ||
jobTitle.Equals("Квартирмейстер", StringComparison.OrdinalIgnoreCase) ||
jobTitle.Equals("Старший инженер", StringComparison.OrdinalIgnoreCase) ||
jobTitle.Equals("Научный руководитель", StringComparison.OrdinalIgnoreCase) ||
jobTitle.Equals("Глава службы безопасности", StringComparison.OrdinalIgnoreCase) ||
jobTitle.Equals("Глава персонала", StringComparison.OrdinalIgnoreCase) ||
jobTitle.Equals("Магистрат", StringComparison.OrdinalIgnoreCase);

} // ADT END

private bool IsCapitan(string jobTitle) // ADT START Капитан
{
return jobTitle.Equals("Капитан", StringComparison.OrdinalIgnoreCase);

} // ADT END

private bool IsSecurity(string jobTitle) // ADT START Служба безопасности
{
return jobTitle.Equals("Надзиратель", StringComparison.OrdinalIgnoreCase) ||
jobTitle.Equals("Офицер-Инструктор", StringComparison.OrdinalIgnoreCase) ||
jobTitle.Equals("Бригмедик", StringComparison.OrdinalIgnoreCase) ||
jobTitle.Equals("Детектив", StringComparison.OrdinalIgnoreCase) ||
jobTitle.Equals("Пилот", StringComparison.OrdinalIgnoreCase) ||
jobTitle.Equals("Кадет СБ", StringComparison.OrdinalIgnoreCase) ||
jobTitle.Equals("Офицер СБ", StringComparison.OrdinalIgnoreCase) ||
jobTitle.Equals("Смотритель", StringComparison.OrdinalIgnoreCase);

} // ADT END

public PdaMenu()
{
IoCManager.InjectDependencies(this);
Expand Down Expand Up @@ -151,6 +194,34 @@ public void UpdateState(PdaUpdateState state)
IdInfoLabel.SetMarkup(Loc.GetString("comp-pda-ui",
("owner", _owner),
("jobTitle", _jobTitle)));

// Инструкции "comp-pda-ui-for-commands (-unknown)" для ролей
if (IsCapitan(_jobTitle) || IsCommand(_jobTitle) || IsSecurity(_jobTitle))
{
if (IsCapitan(_jobTitle))
{
_instructionsForCapitan = Loc.GetString("comp-pda-ui-for-capitan");
}

if (IsCommand(_jobTitle))
{
_instructionsForCommands = Loc.GetString("comp-pda-ui-for-commands");
}

if (IsSecurity(_jobTitle))
{
_instructionsForSecurity = Loc.GetString("comp-pda-ui-for-security");
}

if (IsAnother(_jobTitle))
{
_instructionsForAnother = Loc.GetString("comp-pda-ui-for-another");
}
}
else
{
_instructionsForCommands = Loc.GetString("comp-pda-ui-for-commands-unknown");
} // ADT END
}
else
{
Expand All @@ -177,11 +248,78 @@ public void UpdateState(PdaUpdateState state)
("color", alertColor),
("level", _alertLevel)
));
_instructions = Loc.GetString($"{alertLevelKey}-instructions");
StationAlertLevelInstructions.SetMarkup(Loc.GetString(
"comp-pda-ui-station-alert-level-instructions",
("instructions", _instructions))
);

if (IsCapitan(_jobTitle) || IsCommand(_jobTitle) || IsSecurity(_jobTitle) || IsAnother(_jobTitle)) // ADT START
{
if (IsCapitan(_jobTitle)) // ADT
{
_instructionsForCapitan = Loc.GetString($"{alertLevelKey}-instructions-for-capitan");
StationAlertLevelInstructionsForCapitan.SetMarkup(Loc.GetString(
"comp-pda-ui-for-capitan",
("instructionsForCapitan", _instructionsForCapitan))
);
}

if (IsCommand(_jobTitle)) // ADT
{
// Установка текста инструкций для команд
_instructionsForCommands = Loc.GetString($"{alertLevelKey}-instructions-for-commands");
StationAlertLevelInstructionsForCommands.SetMarkup(Loc.GetString(
"comp-pda-ui-for-commands",
("instructionsForCommands", _instructionsForCommands))
);
}

if (IsSecurity(_jobTitle)) // ADT
{
// Установка текста инструкций для команд
_instructionsForSecurity = Loc.GetString($"{alertLevelKey}-instructions-for-security");
StationAlertLevelInstructionsForSecurity.SetMarkup(Loc.GetString(
"comp-pda-ui-for-security",
("instructionsForSecurity", _instructionsForSecurity))
);
}

if (IsAnother(_jobTitle)) // ADT
{
// Установка текста инструкций для команд
_instructionsForAnother = Loc.GetString($"{alertLevelKey}-instructions-for-another");
StationAlertLevelInstructionsForAnother.SetMarkup(Loc.GetString(
"comp-pda-ui-for-another",
("instructionsForAnother", _instructionsForAnother))
);
}

// Единичные _jobTitle.Equals:

if (_jobTitle.Equals("Главный врач", StringComparison.OrdinalIgnoreCase) && alertLevel == "violet") // ADT пример как можно сделать "исключение" (Вирус)
{
_instructionsForCommands = Loc.GetString($"{alertLevelKey}-instructions-for-another-med");
StationAlertLevelInstructionsForCommands.SetMarkup(Loc.GetString(
"comp-pda-ui-for-commands",
("instructionsForCommands", _instructionsForCommands))
);
}


if (_jobTitle.Equals("Клоун", StringComparison.OrdinalIgnoreCase) && alertLevel == "epsilon") // ADT входит в команду another. (Мем)
{
_instructionsForAnother = Loc.GetString($"{alertLevelKey}-instructions-for-another-clown");
StationAlertLevelInstructionsForAnother.SetMarkup(Loc.GetString(
"comp-pda-ui-for-another",
("instructionsForAnother", _instructionsForAnother))
);
}
}

else // ADT END
{
_instructions = Loc.GetString($"{alertLevelKey}-instructions");
StationAlertLevelInstructions.SetMarkup(Loc.GetString(
"comp-pda-ui-station-alert-level-instructions",
("instructions", _instructions))
);
}

AddressLabel.Text = state.Address?.ToUpper() ?? " - ";

Expand Down
12 changes: 12 additions & 0 deletions Resources/Locale/ru-RU/ADT/PDA/pda-components.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Главы
comp-pda-ui-for-commands = Инструкции: [color=white]{ $instructionsForCommands }[/color]
comp-pda-ui-for-commands-unknown = Инструкции: [color=white]{ $instructionsForCommands }[/color]
# Капитан
comp-pda-ui-for-capitan = Инструкции: [color=white]{ $instructionsForCapitan }[/color]
comp-pda-ui-for-capitan-unknown = Инструкции: [color=white]{ $instructionsForCapitan }[/color]
# Служба безопасности
comp-pda-ui-for-security = Инструкции: [color=white]{ $instructionsForSecurity }[/color]
comp-pda-ui-for-security-unknown = Инструкции: [color=white]{ $instructionsForSecurity }[/color]
# Все остальные (как для исключений на некоторые коды - сигнализации)
comp-pda-ui-for-another = Инструкции: [color=white]{ $instructionsForAnother }[/color]
comp-pda-ui-for-another-unknown = Инструкции: [color=white]{ $instructionsForAnother }[/color]
Loading
Loading