Fix up debug info overlay
This commit is contained in:
@@ -233,9 +233,6 @@ public partial class Game : Node3D, IGame
|
||||
case EffectItem effectItem:
|
||||
EnactEffectItemEffects(effectItem);
|
||||
break;
|
||||
case Jewel jewel:
|
||||
EnactJewelItemEffects(jewel);
|
||||
break;
|
||||
}
|
||||
|
||||
await ToSignal(GetTree().CreateTimer(0.3f), "timeout");
|
||||
@@ -570,13 +567,6 @@ public partial class Game : Node3D, IGame
|
||||
}
|
||||
}
|
||||
|
||||
private void EnactJewelItemEffects(Jewel jewel)
|
||||
{
|
||||
switch (jewel.Stats.JewelTag)
|
||||
{
|
||||
//case JewelTags.AeolicElement
|
||||
}
|
||||
}
|
||||
private void RemoveItemOrSubtractFromItemCount(InventoryItem item)
|
||||
{
|
||||
if (item is IStackable stackableItem && stackableItem.Count.Value > 1)
|
||||
@@ -585,6 +575,8 @@ public partial class Game : Node3D, IGame
|
||||
_player.Inventory.Remove(item);
|
||||
}
|
||||
|
||||
public void ShowDebugInfo(bool show) => InGameUI.DebugInfo.Visible = show;
|
||||
|
||||
private void MovePlayer((Vector3 Rotation, Vector3 Position) spawnPoint) => _player.TeleportPlayer(spawnPoint);
|
||||
|
||||
private void OnNewGame()
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://33ek675mfb5n"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://33ek675mfb5n"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://chftlu4proh3d" path="res://src/game/Game.cs" id="1_ytcii"]
|
||||
[ext_resource type="PackedScene" uid="uid://b1muxus5qdbeu" path="res://src/ui/in_game_ui/InGameUI.tscn" id="5_lxtnp"]
|
||||
[ext_resource type="PackedScene" uid="uid://t22s2y1t8ktc" path="res://src/debug/DebugInfo.tscn" id="6_dxb18"]
|
||||
[ext_resource type="PackedScene" uid="uid://cgwiwufvxvfs4" path="res://src/ui/load_next_level/LoadNextLevel.tscn" id="7_yw8km"]
|
||||
[ext_resource type="PackedScene" uid="uid://dbtfgrtgpr4qg" path="res://src/ui/game_over/GameOverMenu.tscn" id="11_wypid"]
|
||||
[ext_resource type="PackedScene" uid="uid://blbqgw3wosc1w" path="res://src/ui/pause_menu/PauseMenu.tscn" id="12_yev8k"]
|
||||
@@ -31,10 +30,6 @@ render_target_update_mode = 4
|
||||
unique_name_in_owner = true
|
||||
process_mode = 1
|
||||
|
||||
[node name="DebugInfo" parent="." instance=ExtResource("6_dxb18")]
|
||||
unique_name_in_owner = true
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="InGameUI" parent="." instance=ExtResource("5_lxtnp")]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(1280, 720)
|
||||
|
||||
@@ -32,6 +32,8 @@ public interface IGame : IProvide<IGame>, IProvide<IGameRepo>, IProvide<IPlayer>
|
||||
|
||||
public Task Save();
|
||||
|
||||
public void ShowDebugInfo(bool show);
|
||||
|
||||
public ItemRescueMenu ItemRescueMenu { get; }
|
||||
|
||||
public QuestData QuestData { get; }
|
||||
|
||||
@@ -125,19 +125,7 @@ unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Die"
|
||||
|
||||
[node name="DeathCountLabel" type="Label" parent="."]
|
||||
layout_mode = 0
|
||||
offset_left = 58.0
|
||||
offset_top = 657.0
|
||||
offset_right = 160.0
|
||||
offset_bottom = 680.0
|
||||
text = "Death Count:"
|
||||
|
||||
[node name="DeathCount" type="Label" parent="."]
|
||||
[node name="DebugInfoCheckbox" type="CheckBox" parent="MarginContainer/VBoxContainer/HBoxContainer/VFlowContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
offset_left = 165.0
|
||||
offset_top = 658.0
|
||||
offset_right = 205.0
|
||||
offset_bottom = 681.0
|
||||
text = "100"
|
||||
layout_mode = 2
|
||||
text = "Show Debug Info Overlay"
|
||||
|
||||
@@ -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