Fix up debug info overlay
This commit is contained in:
@@ -2,4 +2,8 @@
|
||||
|
||||
namespace Zennysoft.Game.Ma;
|
||||
|
||||
public interface IDebugMenu : IControl;
|
||||
public interface IDebugMenu : IControl
|
||||
{
|
||||
public bool DebugOverlayVisible { get; }
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ public partial class PauseDebugMenu : Control, IDebugMenu
|
||||
|
||||
[Node] public Button DieButton { get; set; } = default!;
|
||||
|
||||
[Node] public Label DeathCount { get; set; } = default!;
|
||||
[Node] public CheckBox DebugInfoCheckbox { get; set; } = default!;
|
||||
|
||||
private readonly string _floorFilePath = @"res://src/map/dungeon/floors/";
|
||||
private readonly string _enemyFilePath = @"res://src/enemy/enemy_types";
|
||||
@@ -42,7 +42,6 @@ public partial class PauseDebugMenu : Control, IDebugMenu
|
||||
{
|
||||
LoadNextFloorButton.Pressed += LoadNextFloorButton_Pressed;
|
||||
DieButton.Pressed += DieButton_Pressed;
|
||||
VisibilityChanged += PauseDebugMenu_VisibilityChanged;
|
||||
|
||||
_itemDatabase = ItemDatabase.Instance;
|
||||
_spawnableItems = _itemDatabase.Items;
|
||||
@@ -85,11 +84,15 @@ public partial class PauseDebugMenu : Control, IDebugMenu
|
||||
FloorSelectDropDown.ItemSelected += FloorSelectDropDown_ItemSelected;
|
||||
SpawnItemDropDown.ItemSelected += SpawnItemDropDown_ItemSelected;
|
||||
SpawnEnemyDropDown.ItemSelected += SpawnEnemyDropDown_ItemSelected;
|
||||
|
||||
DebugInfoCheckbox.Pressed += DebugInfoCheckbox_Pressed;
|
||||
}
|
||||
|
||||
private void DieButton_Pressed() => _player.Die();
|
||||
private void DebugInfoCheckbox_Pressed() => _game.ShowDebugInfo(DebugInfoCheckbox.ButtonPressed);
|
||||
|
||||
private void PauseDebugMenu_VisibilityChanged() => DeathCount.Text = _game.QuestData.DeathCount.ToString("D2");
|
||||
public bool DebugOverlayVisible => DebugInfoCheckbox.ButtonPressed;
|
||||
|
||||
private void DieButton_Pressed() => _player.Die();
|
||||
|
||||
private void FloorSelectDropDown_ItemSelected(long index)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user