Add hero runtime
This commit is contained in:
@@ -32,6 +32,12 @@ public partial class DebugOverlay : CanvasLayer
|
||||
Refresh();
|
||||
}
|
||||
|
||||
public void SetHeroSummary(string summary)
|
||||
{
|
||||
m_HeroSummary = summary;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
private void Refresh()
|
||||
{
|
||||
Label label = EnsureLabel();
|
||||
@@ -42,7 +48,8 @@ public partial class DebugOverlay : CanvasLayer
|
||||
|
||||
DebugRuntimeState state = m_Service.State;
|
||||
Visible = state.OverlayVisible;
|
||||
label.Text = $"Debug boot: {m_Settings.BootMode}\n" + $"Scene: {m_LoadedSceneId}\n" + $"Seed: {state.Seed}\n" + $"Difficulty: {state.ActiveDifficultyId}\n" + $"Paused: {state.IsPaused}\n" + $"Time scale: {state.TimeScale.ToString(CultureInfo.InvariantCulture)}\n" + $"Marker: {DisplayOrNone(state.CurrentMarkerId)}\n" + $"Spawned: {state.SpawnedActorCount} ({DisplayOrNone(state.LastSpawnedActorId)})\n" + $"Flags: invuln={state.Invulnerable}, ammo={state.InfiniteSpecialAmmo}, nofire={state.NoEnemyFire}\n" + $"Debug draw: collisions={state.ShowCollisionShapes}, bounds={state.ShowGameplayBounds}";
|
||||
string heroLine = string.IsNullOrWhiteSpace(m_HeroSummary) ? string.Empty : $"\nHero: {m_HeroSummary}";
|
||||
label.Text = $"Debug boot: {m_Settings.BootMode}\n" + $"Scene: {m_LoadedSceneId}\n" + $"Seed: {state.Seed}\n" + $"Difficulty: {state.ActiveDifficultyId}\n" + $"Paused: {state.IsPaused}\n" + $"Time scale: {state.TimeScale.ToString(CultureInfo.InvariantCulture)}\n" + $"Marker: {DisplayOrNone(state.CurrentMarkerId)}\n" + $"Spawned: {state.SpawnedActorCount} ({DisplayOrNone(state.LastSpawnedActorId)})\n" + $"Flags: invuln={state.Invulnerable}, ammo={state.InfiniteSpecialAmmo}, nofire={state.NoEnemyFire}\n" + $"Debug draw: collisions={state.ShowCollisionShapes}, bounds={state.ShowGameplayBounds}" + heroLine;
|
||||
}
|
||||
|
||||
private Label EnsureLabel()
|
||||
@@ -74,4 +81,5 @@ public partial class DebugOverlay : CanvasLayer
|
||||
private DebugCommandService? m_Service;
|
||||
private DebugSettings? m_Settings;
|
||||
private string m_LoadedSceneId = "none";
|
||||
private string m_HeroSummary = string.Empty;
|
||||
}
|
||||
Reference in New Issue
Block a user