Add NixOS and Go
This commit is contained in:
@@ -14,6 +14,7 @@ namespace KernelPanic.UI
|
||||
private readonly VisualElement[] _shades = new VisualElement[4];
|
||||
private readonly Label _title, _copy, _progress;
|
||||
private readonly Button _next;
|
||||
private Button _exit;
|
||||
private readonly IVisualElementScheduledItem _placement;
|
||||
private TutorialGuide _guide;
|
||||
private VisualElement _anchor;
|
||||
@@ -50,7 +51,9 @@ namespace KernelPanic.UI
|
||||
_guide = guide; _overlay.style.display = DisplayStyle.Flex;
|
||||
_root.EnableInClassList("tutorial-card-focus", guide.Step.Anchor == "card");
|
||||
_anchor = ResolveAnchor();
|
||||
_progress.text = $"Wave {combat.RunConfig.TutorialLesson}/{TutorialCampaign.LessonCount} / step {guide.Index + 1} of {guide.Count}";
|
||||
_progress.text = combat.RunConfig.TrainingLanguage.HasValue
|
||||
? $"{KernelPanic.Data.LanguageCatalog.Get(combat.RunConfig.TrainingLanguage.Value).DisplayName} practice / step {guide.Index + 1} of {guide.Count}"
|
||||
: $"Wave {combat.RunConfig.TutorialLesson}/{TutorialCampaign.LessonCount} / step {guide.Index + 1} of {guide.Count}";
|
||||
_title.text = guide.Step.Title; _copy.text = guide.Step.Copy;
|
||||
_next.style.display = guide.Reading ? DisplayStyle.Flex : DisplayStyle.None;
|
||||
_next.SetEnabled(combat.TutorialInputReady);
|
||||
@@ -70,6 +73,14 @@ namespace KernelPanic.UI
|
||||
Place();
|
||||
}
|
||||
|
||||
public void SetExit(Action exit)
|
||||
{
|
||||
if (_exit != null) return;
|
||||
_exit = new Button(exit) { name = "ExitLanguageTraining", text = "[Esc] Exit training" };
|
||||
_exit.AddToClassList("secondary-action");
|
||||
_panel.Add(_exit);
|
||||
}
|
||||
|
||||
private VisualElement ResolveAnchor()
|
||||
{
|
||||
if (_guide?.Step == null) return null;
|
||||
@@ -95,7 +106,9 @@ namespace KernelPanic.UI
|
||||
private void TrapFocus(NavigationMoveEvent evt)
|
||||
{
|
||||
if (_guide?.Active != true || evt.direction is not (NavigationMoveEvent.Direction.Next or NavigationMoveEvent.Direction.Previous)) return;
|
||||
_root.panel?.focusController.IgnoreEvent(evt); evt.StopImmediatePropagation(); FocusAction();
|
||||
_root.panel?.focusController.IgnoreEvent(evt); evt.StopImmediatePropagation();
|
||||
if (_exit != null && _root.panel?.focusController.focusedElement != _exit) _exit.Focus();
|
||||
else FocusAction();
|
||||
}
|
||||
|
||||
private void Place()
|
||||
|
||||
Reference in New Issue
Block a user