Alert level reloads (#8530)
* adds prototype reload for AlertLevelSystem, reorganizes selectable alerts a bit * makes alert levels not necessarily require localization * oops * sus * does the same for announcements as well * oh, that's not how that works at all * ok, NOW it works * fixes localization, adds event for when alerts are reloaded * addresses review
This commit is contained in:
@@ -95,20 +95,29 @@ namespace Content.Client.Communications.UI
|
||||
|
||||
if (alerts == null)
|
||||
{
|
||||
AlertLevelButton.AddItem(Loc.GetString($"alert-level-{currentAlert}"));
|
||||
var name = currentAlert;
|
||||
if (Loc.TryGetString($"alert-level-{currentAlert}", out var locName))
|
||||
{
|
||||
name = locName;
|
||||
}
|
||||
AlertLevelButton.AddItem(name);
|
||||
AlertLevelButton.SetItemMetadata(AlertLevelButton.ItemCount - 1, currentAlert);
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach (var alert in alerts)
|
||||
{
|
||||
AlertLevelButton.AddItem(Loc.GetString($"alert-level-{alert}"));
|
||||
AlertLevelButton.SetItemMetadata(AlertLevelButton.ItemCount - 1, alert);
|
||||
|
||||
if (alert == currentAlert)
|
||||
{
|
||||
AlertLevelButton.Select(AlertLevelButton.ItemCount - 1);
|
||||
}
|
||||
var name = alert;
|
||||
if (Loc.TryGetString($"alert-level-{alert}", out var locName))
|
||||
{
|
||||
name = locName;
|
||||
}
|
||||
AlertLevelButton.AddItem(name);
|
||||
AlertLevelButton.SetItemMetadata(AlertLevelButton.ItemCount - 1, alert);
|
||||
if (alert == currentAlert)
|
||||
{
|
||||
AlertLevelButton.Select(AlertLevelButton.ItemCount - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user