Add NixOS and Go
This commit is contained in:
@@ -19,7 +19,7 @@ namespace KernelPanic.UI
|
||||
[RequireComponent(typeof(UIDocument))]
|
||||
[RequireComponent(typeof(RunManager))]
|
||||
[RequireComponent(typeof(CombatManager))]
|
||||
public sealed class CombatSceneController : MonoBehaviour
|
||||
public sealed partial class CombatSceneController : MonoBehaviour
|
||||
{
|
||||
private const string StyleResourcePath = "CombatScene";
|
||||
private const string SharedScrollbarStyleResourcePath = "TerminalScrollbars";
|
||||
@@ -300,6 +300,10 @@ namespace KernelPanic.UI
|
||||
|
||||
private void HandleKeyDown(KeyDownEvent evt)
|
||||
{
|
||||
if (_tutorial?.IsLanguageTraining == true && evt.keyCode == KeyCode.Escape)
|
||||
{ _tutorial.ExitLanguageTraining(); evt.StopPropagation(); return; }
|
||||
if (evt.keyCode == KeyCode.Escape && _combatManager.PendingGoroutineCard != null)
|
||||
{ _combatManager.CancelGoroutineSelection(); evt.StopPropagation(); return; }
|
||||
if (_tutorial?.Guide.Active == true)
|
||||
{
|
||||
if (evt.keyCode == KeyCode.E && _tutorial.Guide.CanEndTurn) _combatManager.EndPlayerTurn();
|
||||
@@ -495,6 +499,7 @@ namespace KernelPanic.UI
|
||||
_schedulerActivity.AddToClassList("scheduler-activity");
|
||||
_schedulerActivity.text = "No operations dispatched.";
|
||||
scheduler.Add(schedulerHeader);
|
||||
BuildGoScheduler(scheduler);
|
||||
_interpreterStrip = AddTrackZone(scheduler, "queue / FIFO", "Interpreter: resolves in order during the interpret phase", "track-zone-queue");
|
||||
_lazyStackPile = AddTrackZone(scheduler, "stack / LIFO", "After FIFO: newest first. Captured multiplier scales damage and explicit Shield only.", "track-zone-stack");
|
||||
_interpreterStrip.name = "TutorialQueue";
|
||||
@@ -779,8 +784,10 @@ namespace KernelPanic.UI
|
||||
: "Endless mode";
|
||||
if (config?.IsTutorial == true)
|
||||
{
|
||||
_waveLabel.text = $"training {config.TutorialLesson}/{TutorialCampaign.LessonCount}";
|
||||
_waveLabel.tooltip = "Clear both training waves for a one-time Bandwidth and Entropy reward.";
|
||||
_waveLabel.text = config.IsLanguageTraining ? $"{config.TrainingLanguage} practice"
|
||||
: $"training {config.TutorialLesson}/{TutorialCampaign.LessonCount}";
|
||||
_waveLabel.tooltip = config.IsLanguageTraining ? "Optional practice with loan cards. Exit any time; campaign progress is unchanged."
|
||||
: "Clear all three training waves for a one-time Bandwidth and Entropy reward.";
|
||||
}
|
||||
_phaseLabel.text = PhaseText(_combatManager.CurrentPhase);
|
||||
_bitsLabel.text = _runManager.Bits.ToString();
|
||||
@@ -828,6 +835,7 @@ namespace KernelPanic.UI
|
||||
}
|
||||
|
||||
_playerPanel.Add(StatusBlock(state, true));
|
||||
RefreshGovernorPanel();
|
||||
|
||||
var compilation = _combatManager.Compilation;
|
||||
if (compilation.Active)
|
||||
@@ -880,6 +888,7 @@ namespace KernelPanic.UI
|
||||
|
||||
private void RefreshTracks()
|
||||
{
|
||||
RefreshGoScheduler();
|
||||
_queueView.Sync(_combatManager.InterpreterQueue.Cards);
|
||||
_stackView.Sync(_combatManager.LazyStack.Cards);
|
||||
_stackView.SyncMultipliers(_combatManager.LazyStack.Entries);
|
||||
@@ -903,7 +912,8 @@ namespace KernelPanic.UI
|
||||
((VisualElement)_tokenArea.userData).EnableInClassList("track-idle", _combatManager.Python.AutomationCount == 0);
|
||||
_root.Q(className: "scheduler").EnableInClassList("scheduler-idle",
|
||||
_combatManager.InterpreterQueue.Count == 0 && _combatManager.LazyStack.Count == 0
|
||||
&& _combatManager.Python.AutomationCount == 0 && _combatManager.Python.RepeatCount == 0 && _combatManager.Python.AreaCount == 0);
|
||||
&& _combatManager.Python.AutomationCount == 0 && _combatManager.Python.RepeatCount == 0 && _combatManager.Python.AreaCount == 0
|
||||
&& _combatManager.Go.Count == 0);
|
||||
((VisualElement)_interpreterStrip.userData).EnableInClassList("track-resolving", _combatManager.CurrentPhase == TurnPhase.Interpret);
|
||||
}
|
||||
|
||||
@@ -1150,9 +1160,11 @@ namespace KernelPanic.UI
|
||||
? $"[!] RECOVER {card.CorruptionRoundsRemaining} ROUNDS" : "[!] CORRUPTED") : card.IsLocked ? $"[L] UNLOCK {EnemyArchetypeCatalog.DrmUnlockCycleCost}c"
|
||||
: card.Definition.IsToken ? "TOKEN / NOT EXECUTABLE"
|
||||
: GetDisplayCardCost(card) > _combatManager.PlayerState.Cycles ? $"NEEDS {GetDisplayCardCost(card)} CYCLES"
|
||||
: _combatManager.PendingTargetCard == card ? "> SELECT TARGET" : "";
|
||||
: _combatManager.PendingGoroutineCard == card ? "> SELECT GOROUTINE"
|
||||
: _combatManager.GoPlayBlockReason(card) ?? (_combatManager.PendingTargetCard == card ? "> SELECT TARGET" : "");
|
||||
if (!string.IsNullOrEmpty(reason)) { stateLabel.text = reason; face.tooltip += "\n" + reason; }
|
||||
face.SetEnabled(!_combatManager.RunFinished && _combatManager.CurrentPhase == TurnPhase.Execute && !card.IsBroken
|
||||
&& _combatManager.GoPlayBlockReason(card) == null
|
||||
&& _combatManager.TutorialGuide?.AllowsCard(card) != false);
|
||||
_handCardElements[card] = face;
|
||||
if (added) PlayElementBeat(face, "hand-card-drawn", 180);
|
||||
@@ -1255,6 +1267,15 @@ namespace KernelPanic.UI
|
||||
|
||||
private void RefreshSurrenderCommand()
|
||||
{
|
||||
if (_tutorial?.IsLanguageTraining == true)
|
||||
{
|
||||
_surrenderConfirming = false;
|
||||
_surrenderButton.text = "[Esc] Exit training";
|
||||
_surrenderButton.SetEnabled(true);
|
||||
_surrenderConfirmLabel.AddToClassList("hidden");
|
||||
_surrenderCancelButton.AddToClassList("hidden");
|
||||
return;
|
||||
}
|
||||
bool canSurrender = _combatManager.CanSurrenderRun;
|
||||
if (!canSurrender)
|
||||
{
|
||||
@@ -1278,6 +1299,7 @@ namespace KernelPanic.UI
|
||||
|
||||
private void HandleSurrenderClicked()
|
||||
{
|
||||
if (_tutorial?.IsLanguageTraining == true) { _tutorial.ExitLanguageTraining(); return; }
|
||||
if (!_combatManager.CanSurrenderRun)
|
||||
{
|
||||
_surrenderConfirming = false;
|
||||
@@ -2012,14 +2034,23 @@ namespace KernelPanic.UI
|
||||
var preview = CardPreviewService.Build(_combatManager, card);
|
||||
if (!string.IsNullOrEmpty(preview.Summary) && !preview.Summary.StartsWith("Utility", StringComparison.Ordinal))
|
||||
{
|
||||
string timing = card.Definition.ResolutionTrack == ResolutionTrack.Native ? "now: " : "preview: ";
|
||||
var label = SoftwareCardView.Text(timing + preview.Summary + (preview.IsConditional ? " *" : ""), "software-live-preview");
|
||||
target.Q(className: "software-body")?.Add(label);
|
||||
bool python = card.Definition.Language == Language.Python;
|
||||
var label = SoftwareCardView.Text(preview.Summary, "software-live-preview");
|
||||
label.tooltip = preview.Details;
|
||||
var body = target.Q(className: "software-body");
|
||||
if (python) body?.Insert(1, label);
|
||||
else body?.Add(label);
|
||||
if (!string.IsNullOrEmpty(preview.CriticalSummary) && body != null)
|
||||
{
|
||||
var crit = SoftwareCardView.Text(preview.CriticalSummary, "software-live-crit");
|
||||
crit.tooltip = preview.Details;
|
||||
body.Insert(body.IndexOf(label) + 1, crit);
|
||||
}
|
||||
}
|
||||
// Rules are already printed on the card. Keep hover help contextual and brief.
|
||||
target.tooltip = card.IsBroken ? CardPreviewService.CorruptionDetails(card)
|
||||
: card.IsLocked ? "Unlock for 1 Cycle before playing."
|
||||
: preview.IsConditional ? "Current estimate; targets, defenses and later effects can change the result."
|
||||
: preview.IsConditional ? "Based on the current setup. Targets, defenses and later effects can change the result."
|
||||
: "";
|
||||
}
|
||||
|
||||
@@ -2425,6 +2456,7 @@ namespace KernelPanic.UI
|
||||
{
|
||||
ResolutionTrack.InterpreterQueue => _interpreterStrip,
|
||||
ResolutionTrack.LazyStack => _lazyStackPile,
|
||||
ResolutionTrack.Goroutine => _goScheduler,
|
||||
_ => FirstTargetElement(payload.Card)
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user