Fix up debug info overlay
This commit is contained in:
@@ -28,6 +28,8 @@ public partial class InGameUI : Control, IInGameUI
|
||||
|
||||
[Node] public IDebugMenu DebugMenu { get; set; } = default!;
|
||||
|
||||
[Node] public DebugInfo DebugInfo { get; set; } = default!;
|
||||
|
||||
[Dependency] private IGameRepo _gameRepo => this.DependOn<IGameRepo>();
|
||||
|
||||
public IInGameUILogic InGameUILogic { get; set; } = default!;
|
||||
@@ -51,6 +53,8 @@ public partial class InGameUI : Control, IInGameUI
|
||||
.Handle((in InGameUILogic.Output.ShowInventory _) => { InventoryMenu.Show(); InventoryMenu.SetProcessInput(true); })
|
||||
.Handle((in InGameUILogic.Output.HideInventory _) => { CloseInventory(); });
|
||||
|
||||
DebugInfo.Visible = DebugMenu.DebugOverlayVisible;
|
||||
|
||||
InGameUILogic.Start();
|
||||
}
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://dlq2mkhl4pe7a" path="res://src/ui/in_game_ui/InGameUI.cs" id="1_sc13i"]
|
||||
[ext_resource type="PackedScene" uid="uid://bwbofurcvf3yh" path="res://src/minimap/Minimap.tscn" id="2_6sfje"]
|
||||
[ext_resource type="PackedScene" uid="uid://t22s2y1t8ktc" path="res://src/debug/DebugInfo.tscn" id="2_f0tui"]
|
||||
[ext_resource type="PackedScene" uid="uid://dxl8il8f13c2x" path="res://src/ui/player_ui/PlayerInfoUI.tscn" id="4_46s5l"]
|
||||
[ext_resource type="PackedScene" uid="uid://bea2waybmgd6u" path="res://src/ui/teleport_prompt/UseTeleportPrompt.tscn" id="5_h1hgq"]
|
||||
[ext_resource type="PackedScene" uid="uid://x0f1ol50nnp3" path="res://src/ui/in_game_ui/InventoryMessageUI.tscn" id="6_y26qy"]
|
||||
[ext_resource type="Script" uid="uid://3fpuxsgdl8xe" path="res://src/utils/FpsCounter.cs" id="7_c6o8j"]
|
||||
[ext_resource type="PackedScene" uid="uid://8f3dk16nj0dn" path="res://src/menu/DebugMenu.tscn" id="7_llomk"]
|
||||
[ext_resource type="Texture2D" uid="uid://bj4p4qxb1mj3q" path="res://src/ui/player_ui/Assets/panel rough draft.png" id="7_ur8ag"]
|
||||
[ext_resource type="PackedScene" uid="uid://c3e6hbctay1us" path="res://src/ui/inventory_menu/InventoryMenu2.tscn" id="9_ur8ag"]
|
||||
@@ -56,6 +56,10 @@ theme_override_constants/margin_top = 40
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
|
||||
[node name="DebugInfo" parent="HBoxContainer/SubViewportContainer/SubViewport" instance=ExtResource("2_f0tui")]
|
||||
unique_name_in_owner = true
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="HBoxContainer/SubViewportContainer/SubViewport"]
|
||||
custom_minimum_size = Vector2(1440, 1080)
|
||||
offset_right = 1440.0
|
||||
@@ -66,11 +70,6 @@ unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(1440, 1080)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Label" type="Label" parent="HBoxContainer/SubViewportContainer/SubViewport/CenterContainer"]
|
||||
custom_minimum_size = Vector2(1440, 1080)
|
||||
layout_mode = 2
|
||||
script = ExtResource("7_c6o8j")
|
||||
|
||||
[node name="DebugMenu" parent="HBoxContainer/SubViewportContainer/SubViewport/CenterContainer" instance=ExtResource("7_llomk")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
|
||||
@@ -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