From ac0ca4e3e18da0173b54cb8a560c1ee5b45f9d50 Mon Sep 17 00:00:00 2001 From: Danilo Nobre Date: Fri, 7 Mar 2025 20:56:48 -0300 Subject: [PATCH 01/13] moving components back to ./src 'cause i'm a maniac --- .../CharacterComponent/CharacterComponent.cs | 0 .../CharacterComponent/CharacterComponent.cs.uid | 0 .../CharacterComponent/CharacterComponent.tscn | 2 +- .../components/CharacterGrid/Arrow.tscn | 0 .../components/CharacterGrid/CharacterGrid.cs | 0 .../components/CharacterGrid/CharacterGrid.cs.uid | 0 .../components/CharacterGrid/CharacterGrid.tscn | 6 +++--- src/{scenes => }/components/CharacterGrid/Grid3D.cs | 0 .../components/CharacterGrid/Grid3D.cs.uid | 0 .../components/CharacterGrid/GridCell3D.cs | 0 .../components/CharacterGrid/GridCell3D.cs.uid | 0 .../CharacterInspector/CharacterInspector.cs | 0 .../CharacterInspector/CharacterInspector.cs.uid | 0 .../CharacterInspector/CharacterInspector.tscn | 2 +- .../components/GameLog/GameLogComponent.cs | 0 .../components/GameLog/GameLogComponent.cs.uid | 0 .../components/GameLog/GameLogComponent.tscn | 2 +- .../components/HUDComponent/HUDComponent.tscn | 8 ++++---- .../InventoryComponent/InventoryComponent.cs | 0 .../InventoryComponent/InventoryComponent.cs.uid | 0 .../InventoryComponent/InventoryComponent.tscn | 4 ++-- .../components/InventoryComponent/slot.png | Bin .../components/InventoryComponent/slot.png.import | 6 +++--- .../components/InventoryComponent/test.tscn | 2 +- .../InventoryItemComponent.cs | 0 .../InventoryItemComponent.cs.uid | 0 .../InventoryItemComponent.tscn | 4 ++-- .../components/TooltipComponent/TooltipComponent.cs | 0 .../TooltipComponent/TooltipComponent.cs.uid | 0 .../TooltipComponent/TooltipComponent.tscn | 4 ++-- .../components/TooltipComponent/icon.png | Bin .../components/TooltipComponent/icon.png.import | 6 +++--- .../TurnOrderComponent/TurnOrderComponent.cs | 0 .../TurnOrderComponent/TurnOrderComponent.cs.uid | 0 .../TurnOrderComponent/TurnOrderComponent.tscn | 4 ++-- .../TurnOrderComponent/TurnOrderTheme.tres | 0 src/project.godot | 2 +- src/scenes/gameplay/Battle.tscn | 4 ++-- 38 files changed, 28 insertions(+), 28 deletions(-) rename src/{scenes => }/components/CharacterComponent/CharacterComponent.cs (100%) rename src/{scenes => }/components/CharacterComponent/CharacterComponent.cs.uid (100%) rename src/{scenes => }/components/CharacterComponent/CharacterComponent.tscn (96%) rename src/{scenes => }/components/CharacterGrid/Arrow.tscn (100%) rename src/{scenes => }/components/CharacterGrid/CharacterGrid.cs (100%) rename src/{scenes => }/components/CharacterGrid/CharacterGrid.cs.uid (100%) rename src/{scenes => }/components/CharacterGrid/CharacterGrid.tscn (87%) rename src/{scenes => }/components/CharacterGrid/Grid3D.cs (100%) rename src/{scenes => }/components/CharacterGrid/Grid3D.cs.uid (100%) rename src/{scenes => }/components/CharacterGrid/GridCell3D.cs (100%) rename src/{scenes => }/components/CharacterGrid/GridCell3D.cs.uid (100%) rename src/{scenes => }/components/CharacterInspector/CharacterInspector.cs (100%) rename src/{scenes => }/components/CharacterInspector/CharacterInspector.cs.uid (100%) rename src/{scenes => }/components/CharacterInspector/CharacterInspector.tscn (98%) rename src/{scenes => }/components/GameLog/GameLogComponent.cs (100%) rename src/{scenes => }/components/GameLog/GameLogComponent.cs.uid (100%) rename src/{scenes => }/components/GameLog/GameLogComponent.tscn (97%) rename src/{scenes => }/components/HUDComponent/HUDComponent.tscn (90%) rename src/{scenes => }/components/InventoryComponent/InventoryComponent.cs (100%) rename src/{scenes => }/components/InventoryComponent/InventoryComponent.cs.uid (100%) rename src/{scenes => }/components/InventoryComponent/InventoryComponent.tscn (82%) rename src/{scenes => }/components/InventoryComponent/slot.png (100%) rename src/{scenes => }/components/InventoryComponent/slot.png.import (71%) rename src/{scenes => }/components/InventoryComponent/test.tscn (95%) rename src/{scenes => }/components/InventoryItemComponent/InventoryItemComponent.cs (100%) rename src/{scenes => }/components/InventoryItemComponent/InventoryItemComponent.cs.uid (100%) rename src/{scenes => }/components/InventoryItemComponent/InventoryItemComponent.tscn (79%) rename src/{scenes => }/components/TooltipComponent/TooltipComponent.cs (100%) rename src/{scenes => }/components/TooltipComponent/TooltipComponent.cs.uid (100%) rename src/{scenes => }/components/TooltipComponent/TooltipComponent.tscn (97%) rename src/{scenes => }/components/TooltipComponent/icon.png (100%) rename src/{scenes => }/components/TooltipComponent/icon.png.import (71%) rename src/{scenes => }/components/TurnOrderComponent/TurnOrderComponent.cs (100%) rename src/{scenes => }/components/TurnOrderComponent/TurnOrderComponent.cs.uid (100%) rename src/{scenes => }/components/TurnOrderComponent/TurnOrderComponent.tscn (96%) rename src/{scenes => }/components/TurnOrderComponent/TurnOrderTheme.tres (100%) diff --git a/src/scenes/components/CharacterComponent/CharacterComponent.cs b/src/components/CharacterComponent/CharacterComponent.cs similarity index 100% rename from src/scenes/components/CharacterComponent/CharacterComponent.cs rename to src/components/CharacterComponent/CharacterComponent.cs diff --git a/src/scenes/components/CharacterComponent/CharacterComponent.cs.uid b/src/components/CharacterComponent/CharacterComponent.cs.uid similarity index 100% rename from src/scenes/components/CharacterComponent/CharacterComponent.cs.uid rename to src/components/CharacterComponent/CharacterComponent.cs.uid diff --git a/src/scenes/components/CharacterComponent/CharacterComponent.tscn b/src/components/CharacterComponent/CharacterComponent.tscn similarity index 96% rename from src/scenes/components/CharacterComponent/CharacterComponent.tscn rename to src/components/CharacterComponent/CharacterComponent.tscn index 4df67551..5bd8024f 100644 --- a/src/scenes/components/CharacterComponent/CharacterComponent.tscn +++ b/src/components/CharacterComponent/CharacterComponent.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=3 uid="uid://d3lkjx05elcwq"] -[ext_resource type="Script" uid="uid://f1lqpaw1xng7" path="res://scenes/components/CharacterComponent/CharacterComponent.cs" id="1_t0krx"] +[ext_resource type="Script" uid="uid://f1lqpaw1xng7" path="res://components/CharacterComponent/CharacterComponent.cs" id="1_t0krx"] [ext_resource type="Texture2D" uid="uid://cytb6ea63fslt" path="res://assets/icons/hud/select.png" id="3_gxxii"] [ext_resource type="SpriteFrames" uid="uid://fdkgmyh24b0q" path="res://assets/characters/joannaOtsoga/JoannaOtsogaSprites.tres" id="4_svr47"] diff --git a/src/scenes/components/CharacterGrid/Arrow.tscn b/src/components/CharacterGrid/Arrow.tscn similarity index 100% rename from src/scenes/components/CharacterGrid/Arrow.tscn rename to src/components/CharacterGrid/Arrow.tscn diff --git a/src/scenes/components/CharacterGrid/CharacterGrid.cs b/src/components/CharacterGrid/CharacterGrid.cs similarity index 100% rename from src/scenes/components/CharacterGrid/CharacterGrid.cs rename to src/components/CharacterGrid/CharacterGrid.cs diff --git a/src/scenes/components/CharacterGrid/CharacterGrid.cs.uid b/src/components/CharacterGrid/CharacterGrid.cs.uid similarity index 100% rename from src/scenes/components/CharacterGrid/CharacterGrid.cs.uid rename to src/components/CharacterGrid/CharacterGrid.cs.uid diff --git a/src/scenes/components/CharacterGrid/CharacterGrid.tscn b/src/components/CharacterGrid/CharacterGrid.tscn similarity index 87% rename from src/scenes/components/CharacterGrid/CharacterGrid.tscn rename to src/components/CharacterGrid/CharacterGrid.tscn index 0360d696..1332bd12 100644 --- a/src/scenes/components/CharacterGrid/CharacterGrid.tscn +++ b/src/components/CharacterGrid/CharacterGrid.tscn @@ -1,11 +1,11 @@ [gd_scene load_steps=9 format=3 uid="uid://dmw0cm136sn4p"] -[ext_resource type="Script" uid="uid://gymkyw1r3mtn" path="res://scenes/components/CharacterGrid/CharacterGrid.cs" id="1_tabhr"] +[ext_resource type="Script" uid="uid://gymkyw1r3mtn" path="res://components/CharacterGrid/CharacterGrid.cs" id="1_tabhr"] [ext_resource type="Resource" uid="uid://snt34yslyn4f" path="res://resources/Characters/PlayerCharacterStore.tres" id="2_3uydg"] [ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://features/Grid/GridType.cs" id="2_ml3sj"] -[ext_resource type="PackedScene" uid="uid://d3lkjx05elcwq" path="res://scenes/components/CharacterComponent/CharacterComponent.tscn" id="4_3uydg"] +[ext_resource type="PackedScene" uid="uid://d3lkjx05elcwq" path="res://components/CharacterComponent/CharacterComponent.tscn" id="4_3uydg"] [ext_resource type="Resource" uid="uid://d22hmntd0rfq2" path="res://resources/Characters/EnemyCharacterStore.tres" id="4_r0k5p"] -[ext_resource type="PackedScene" uid="uid://bltesg17i4ul8" path="res://scenes/components/CharacterGrid/Arrow.tscn" id="5_og5wa"] +[ext_resource type="PackedScene" uid="uid://bltesg17i4ul8" path="res://components/CharacterGrid/Arrow.tscn" id="5_og5wa"] [sub_resource type="Resource" id="Resource_jan7r"] script = ExtResource("2_ml3sj") diff --git a/src/scenes/components/CharacterGrid/Grid3D.cs b/src/components/CharacterGrid/Grid3D.cs similarity index 100% rename from src/scenes/components/CharacterGrid/Grid3D.cs rename to src/components/CharacterGrid/Grid3D.cs diff --git a/src/scenes/components/CharacterGrid/Grid3D.cs.uid b/src/components/CharacterGrid/Grid3D.cs.uid similarity index 100% rename from src/scenes/components/CharacterGrid/Grid3D.cs.uid rename to src/components/CharacterGrid/Grid3D.cs.uid diff --git a/src/scenes/components/CharacterGrid/GridCell3D.cs b/src/components/CharacterGrid/GridCell3D.cs similarity index 100% rename from src/scenes/components/CharacterGrid/GridCell3D.cs rename to src/components/CharacterGrid/GridCell3D.cs diff --git a/src/scenes/components/CharacterGrid/GridCell3D.cs.uid b/src/components/CharacterGrid/GridCell3D.cs.uid similarity index 100% rename from src/scenes/components/CharacterGrid/GridCell3D.cs.uid rename to src/components/CharacterGrid/GridCell3D.cs.uid diff --git a/src/scenes/components/CharacterInspector/CharacterInspector.cs b/src/components/CharacterInspector/CharacterInspector.cs similarity index 100% rename from src/scenes/components/CharacterInspector/CharacterInspector.cs rename to src/components/CharacterInspector/CharacterInspector.cs diff --git a/src/scenes/components/CharacterInspector/CharacterInspector.cs.uid b/src/components/CharacterInspector/CharacterInspector.cs.uid similarity index 100% rename from src/scenes/components/CharacterInspector/CharacterInspector.cs.uid rename to src/components/CharacterInspector/CharacterInspector.cs.uid diff --git a/src/scenes/components/CharacterInspector/CharacterInspector.tscn b/src/components/CharacterInspector/CharacterInspector.tscn similarity index 98% rename from src/scenes/components/CharacterInspector/CharacterInspector.tscn rename to src/components/CharacterInspector/CharacterInspector.tscn index 0aee95f4..0fca1c11 100644 --- a/src/scenes/components/CharacterInspector/CharacterInspector.tscn +++ b/src/components/CharacterInspector/CharacterInspector.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://dgyegipn74jj5"] -[ext_resource type="Script" uid="uid://b24cvjmwq5kc" path="res://scenes/components/CharacterInspector/CharacterInspector.cs" id="1_72g88"] +[ext_resource type="Script" uid="uid://b24cvjmwq5kc" path="res://components/CharacterInspector/CharacterInspector.cs" id="1_72g88"] [ext_resource type="Texture2D" uid="uid://dqpa6f8n80d61" path="res://assets/characters/eleonoreOtsoga/EleonoreOtsogaPortrait.png" id="1_jybd2"] [node name="CharacterInspector" type="HBoxContainer" node_paths=PackedStringArray("PortraitNode", "CharacterNameNode", "CharacterRoleNode", "AttributesListNode", "AttributeTemplateNode", "AttributeTemplateTitleNode", "ValueContainerNode", "AttributeCurrentValueNode", "AttributeMaxValueNode", "ActionGridNode", "ActionButtonTemplate")] diff --git a/src/scenes/components/GameLog/GameLogComponent.cs b/src/components/GameLog/GameLogComponent.cs similarity index 100% rename from src/scenes/components/GameLog/GameLogComponent.cs rename to src/components/GameLog/GameLogComponent.cs diff --git a/src/scenes/components/GameLog/GameLogComponent.cs.uid b/src/components/GameLog/GameLogComponent.cs.uid similarity index 100% rename from src/scenes/components/GameLog/GameLogComponent.cs.uid rename to src/components/GameLog/GameLogComponent.cs.uid diff --git a/src/scenes/components/GameLog/GameLogComponent.tscn b/src/components/GameLog/GameLogComponent.tscn similarity index 97% rename from src/scenes/components/GameLog/GameLogComponent.tscn rename to src/components/GameLog/GameLogComponent.tscn index af1fa08a..56191e85 100644 --- a/src/scenes/components/GameLog/GameLogComponent.tscn +++ b/src/components/GameLog/GameLogComponent.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://21o4pt7dm2n0"] -[ext_resource type="Script" uid="uid://c00f3g3y8eujg" path="res://scenes/components/GameLog/GameLogComponent.cs" id="1_h5njw"] +[ext_resource type="Script" uid="uid://c00f3g3y8eujg" path="res://components/GameLog/GameLogComponent.cs" id="1_h5njw"] [node name="GameLog" type="ScrollContainer" node_paths=PackedStringArray("_messageContainerNode", "_messageTemplateNode", "_headingLabelTemplateNode", "_timestampLabelTemplateNode", "_lineTemplateNode")] anchors_preset = 15 diff --git a/src/scenes/components/HUDComponent/HUDComponent.tscn b/src/components/HUDComponent/HUDComponent.tscn similarity index 90% rename from src/scenes/components/HUDComponent/HUDComponent.tscn rename to src/components/HUDComponent/HUDComponent.tscn index 9b5368aa..c3aab2cb 100644 --- a/src/scenes/components/HUDComponent/HUDComponent.tscn +++ b/src/components/HUDComponent/HUDComponent.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=6 format=3 uid="uid://c22tpnmaefgn4"] -[ext_resource type="PackedScene" uid="uid://dsbegy218josn" path="res://scenes/components/TurnOrderComponent/TurnOrderComponent.tscn" id="1_c8j77"] +[ext_resource type="PackedScene" uid="uid://dsbegy218josn" path="res://components/TurnOrderComponent/TurnOrderComponent.tscn" id="1_c8j77"] [ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://features/UI/SceneTransitionButton.cs" id="2_ink42"] -[ext_resource type="PackedScene" uid="uid://dgyegipn74jj5" path="res://scenes/components/CharacterInspector/CharacterInspector.tscn" id="3_xfvph"] -[ext_resource type="PackedScene" uid="uid://bt73g5fssa68h" path="res://scenes/components/InventoryComponent/InventoryComponent.tscn" id="4_313b0"] -[ext_resource type="PackedScene" uid="uid://21o4pt7dm2n0" path="res://scenes/components/GameLog/GameLogComponent.tscn" id="5_no7pv"] +[ext_resource type="PackedScene" uid="uid://dgyegipn74jj5" path="res://components/CharacterInspector/CharacterInspector.tscn" id="3_xfvph"] +[ext_resource type="PackedScene" uid="uid://bt73g5fssa68h" path="res://components/InventoryComponent/InventoryComponent.tscn" id="4_313b0"] +[ext_resource type="PackedScene" uid="uid://21o4pt7dm2n0" path="res://components/GameLog/GameLogComponent.tscn" id="5_no7pv"] [node name="HUDComponent" type="VBoxContainer"] clip_contents = true diff --git a/src/scenes/components/InventoryComponent/InventoryComponent.cs b/src/components/InventoryComponent/InventoryComponent.cs similarity index 100% rename from src/scenes/components/InventoryComponent/InventoryComponent.cs rename to src/components/InventoryComponent/InventoryComponent.cs diff --git a/src/scenes/components/InventoryComponent/InventoryComponent.cs.uid b/src/components/InventoryComponent/InventoryComponent.cs.uid similarity index 100% rename from src/scenes/components/InventoryComponent/InventoryComponent.cs.uid rename to src/components/InventoryComponent/InventoryComponent.cs.uid diff --git a/src/scenes/components/InventoryComponent/InventoryComponent.tscn b/src/components/InventoryComponent/InventoryComponent.tscn similarity index 82% rename from src/scenes/components/InventoryComponent/InventoryComponent.tscn rename to src/components/InventoryComponent/InventoryComponent.tscn index fa80c0d0..35982516 100644 --- a/src/scenes/components/InventoryComponent/InventoryComponent.tscn +++ b/src/components/InventoryComponent/InventoryComponent.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://bt73g5fssa68h"] -[ext_resource type="Script" uid="uid://bx8bk0ye5tevv" path="res://scenes/components/InventoryComponent/InventoryComponent.cs" id="2"] -[ext_resource type="PackedScene" uid="uid://tomctv14euva" path="res://scenes/components/InventoryItemComponent/InventoryItemComponent.tscn" id="2_rwo4n"] +[ext_resource type="Script" uid="uid://bx8bk0ye5tevv" path="res://components/InventoryComponent/InventoryComponent.cs" id="2"] +[ext_resource type="PackedScene" uid="uid://tomctv14euva" path="res://components/InventoryItemComponent/InventoryItemComponent.tscn" id="2_rwo4n"] [node name="Inventory" type="ScrollContainer"] anchors_preset = 15 diff --git a/src/scenes/components/InventoryComponent/slot.png b/src/components/InventoryComponent/slot.png similarity index 100% rename from src/scenes/components/InventoryComponent/slot.png rename to src/components/InventoryComponent/slot.png diff --git a/src/scenes/components/InventoryComponent/slot.png.import b/src/components/InventoryComponent/slot.png.import similarity index 71% rename from src/scenes/components/InventoryComponent/slot.png.import rename to src/components/InventoryComponent/slot.png.import index 3bc3d60d..6f74d20b 100644 --- a/src/scenes/components/InventoryComponent/slot.png.import +++ b/src/components/InventoryComponent/slot.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://c1flt0c431x4o" -path="res://.godot/imported/slot.png-577217e4424890db98b58578545acb41.ctex" +path="res://.godot/imported/slot.png-ccc67c4e40c6c52b675d7ce11da5f24e.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://scenes/components/InventoryComponent/slot.png" -dest_files=["res://.godot/imported/slot.png-577217e4424890db98b58578545acb41.ctex"] +source_file="res://components/InventoryComponent/slot.png" +dest_files=["res://.godot/imported/slot.png-ccc67c4e40c6c52b675d7ce11da5f24e.ctex"] [params] diff --git a/src/scenes/components/InventoryComponent/test.tscn b/src/components/InventoryComponent/test.tscn similarity index 95% rename from src/scenes/components/InventoryComponent/test.tscn rename to src/components/InventoryComponent/test.tscn index 7aceb380..77d2faee 100644 --- a/src/scenes/components/InventoryComponent/test.tscn +++ b/src/components/InventoryComponent/test.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://b5dtfnowy3m0q"] -[ext_resource type="PackedScene" uid="uid://tomctv14euva" path="res://scenes/components/InventoryItemComponent/InventoryItemComponent.tscn" id="1_7fx0t"] +[ext_resource type="PackedScene" uid="uid://tomctv14euva" path="res://components/InventoryItemComponent/InventoryItemComponent.tscn" id="1_7fx0t"] [node name="Test" type="Node2D"] diff --git a/src/scenes/components/InventoryItemComponent/InventoryItemComponent.cs b/src/components/InventoryItemComponent/InventoryItemComponent.cs similarity index 100% rename from src/scenes/components/InventoryItemComponent/InventoryItemComponent.cs rename to src/components/InventoryItemComponent/InventoryItemComponent.cs diff --git a/src/scenes/components/InventoryItemComponent/InventoryItemComponent.cs.uid b/src/components/InventoryItemComponent/InventoryItemComponent.cs.uid similarity index 100% rename from src/scenes/components/InventoryItemComponent/InventoryItemComponent.cs.uid rename to src/components/InventoryItemComponent/InventoryItemComponent.cs.uid diff --git a/src/scenes/components/InventoryItemComponent/InventoryItemComponent.tscn b/src/components/InventoryItemComponent/InventoryItemComponent.tscn similarity index 79% rename from src/scenes/components/InventoryItemComponent/InventoryItemComponent.tscn rename to src/components/InventoryItemComponent/InventoryItemComponent.tscn index 9b3160d6..cc39ad95 100644 --- a/src/scenes/components/InventoryItemComponent/InventoryItemComponent.tscn +++ b/src/components/InventoryItemComponent/InventoryItemComponent.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://tomctv14euva"] -[ext_resource type="Script" uid="uid://5drla5c75a4b" path="res://scenes/components/InventoryItemComponent/InventoryItemComponent.cs" id="1_sc2gm"] -[ext_resource type="PackedScene" uid="uid://bwvsdedui54tw" path="res://scenes/components/TooltipComponent/TooltipComponent.tscn" id="2_7j7lb"] +[ext_resource type="Script" uid="uid://5drla5c75a4b" path="res://components/InventoryItemComponent/InventoryItemComponent.cs" id="1_sc2gm"] +[ext_resource type="PackedScene" uid="uid://bwvsdedui54tw" path="res://components/TooltipComponent/TooltipComponent.tscn" id="2_7j7lb"] [node name="InventoryItemComponent" type="Control"] layout_mode = 3 diff --git a/src/scenes/components/TooltipComponent/TooltipComponent.cs b/src/components/TooltipComponent/TooltipComponent.cs similarity index 100% rename from src/scenes/components/TooltipComponent/TooltipComponent.cs rename to src/components/TooltipComponent/TooltipComponent.cs diff --git a/src/scenes/components/TooltipComponent/TooltipComponent.cs.uid b/src/components/TooltipComponent/TooltipComponent.cs.uid similarity index 100% rename from src/scenes/components/TooltipComponent/TooltipComponent.cs.uid rename to src/components/TooltipComponent/TooltipComponent.cs.uid diff --git a/src/scenes/components/TooltipComponent/TooltipComponent.tscn b/src/components/TooltipComponent/TooltipComponent.tscn similarity index 97% rename from src/scenes/components/TooltipComponent/TooltipComponent.tscn rename to src/components/TooltipComponent/TooltipComponent.tscn index d857da3a..e18e3df4 100644 --- a/src/scenes/components/TooltipComponent/TooltipComponent.tscn +++ b/src/components/TooltipComponent/TooltipComponent.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://bwvsdedui54tw"] -[ext_resource type="Script" uid="uid://cmptfsd2i8ro8" path="res://scenes/components/TooltipComponent/TooltipComponent.cs" id="1_ma61s"] -[ext_resource type="Texture2D" uid="uid://dvfapg1a2gi00" path="res://scenes/components/TooltipComponent/icon.png" id="2_jkd58"] +[ext_resource type="Script" uid="uid://cmptfsd2i8ro8" path="res://components/TooltipComponent/TooltipComponent.cs" id="1_ma61s"] +[ext_resource type="Texture2D" uid="uid://dvfapg1a2gi00" path="res://components/TooltipComponent/icon.png" id="2_jkd58"] [node name="TooltipComponent" type="Control"] custom_minimum_size = Vector2(290, 360) diff --git a/src/scenes/components/TooltipComponent/icon.png b/src/components/TooltipComponent/icon.png similarity index 100% rename from src/scenes/components/TooltipComponent/icon.png rename to src/components/TooltipComponent/icon.png diff --git a/src/scenes/components/TooltipComponent/icon.png.import b/src/components/TooltipComponent/icon.png.import similarity index 71% rename from src/scenes/components/TooltipComponent/icon.png.import rename to src/components/TooltipComponent/icon.png.import index fed62785..5282396d 100644 --- a/src/scenes/components/TooltipComponent/icon.png.import +++ b/src/components/TooltipComponent/icon.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dvfapg1a2gi00" -path="res://.godot/imported/icon.png-f77effeda93dea3dfdfcc7d98d2a8519.ctex" +path="res://.godot/imported/icon.png-52995f8c46839d4f8b7d37344a0ac169.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://scenes/components/TooltipComponent/icon.png" -dest_files=["res://.godot/imported/icon.png-f77effeda93dea3dfdfcc7d98d2a8519.ctex"] +source_file="res://components/TooltipComponent/icon.png" +dest_files=["res://.godot/imported/icon.png-52995f8c46839d4f8b7d37344a0ac169.ctex"] [params] diff --git a/src/scenes/components/TurnOrderComponent/TurnOrderComponent.cs b/src/components/TurnOrderComponent/TurnOrderComponent.cs similarity index 100% rename from src/scenes/components/TurnOrderComponent/TurnOrderComponent.cs rename to src/components/TurnOrderComponent/TurnOrderComponent.cs diff --git a/src/scenes/components/TurnOrderComponent/TurnOrderComponent.cs.uid b/src/components/TurnOrderComponent/TurnOrderComponent.cs.uid similarity index 100% rename from src/scenes/components/TurnOrderComponent/TurnOrderComponent.cs.uid rename to src/components/TurnOrderComponent/TurnOrderComponent.cs.uid diff --git a/src/scenes/components/TurnOrderComponent/TurnOrderComponent.tscn b/src/components/TurnOrderComponent/TurnOrderComponent.tscn similarity index 96% rename from src/scenes/components/TurnOrderComponent/TurnOrderComponent.tscn rename to src/components/TurnOrderComponent/TurnOrderComponent.tscn index a2438bf3..ae9fe1dd 100644 --- a/src/scenes/components/TurnOrderComponent/TurnOrderComponent.tscn +++ b/src/components/TurnOrderComponent/TurnOrderComponent.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=7 format=3 uid="uid://dsbegy218josn"] [ext_resource type="Texture2D" uid="uid://dqpa6f8n80d61" path="res://assets/characters/eleonoreOtsoga/EleonoreOtsogaPortrait.png" id="1_fnlle"] -[ext_resource type="Theme" uid="uid://dxg2mh1ceh3pc" path="res://scenes/components/TurnOrderComponent/TurnOrderTheme.tres" id="1_o2pqp"] -[ext_resource type="Script" uid="uid://016w4jxplp8d" path="res://scenes/components/TurnOrderComponent/TurnOrderComponent.cs" id="2_aj4ue"] +[ext_resource type="Theme" uid="uid://dxg2mh1ceh3pc" path="res://components/TurnOrderComponent/TurnOrderTheme.tres" id="1_o2pqp"] +[ext_resource type="Script" uid="uid://016w4jxplp8d" path="res://components/TurnOrderComponent/TurnOrderComponent.cs" id="2_aj4ue"] [ext_resource type="Resource" uid="uid://clrt1eby68x42" path="res://resources/Characters/Eleonore.tres" id="3_8cip4"] [ext_resource type="Resource" uid="uid://b4niu7ewhuinj" path="res://resources/Attributes/AttributesStore.tres" id="3_vlbb0"] [ext_resource type="Resource" uid="uid://bkolttux1bvi1" path="res://resources/Characters/Joanna.tres" id="5_ntmsh"] diff --git a/src/scenes/components/TurnOrderComponent/TurnOrderTheme.tres b/src/components/TurnOrderComponent/TurnOrderTheme.tres similarity index 100% rename from src/scenes/components/TurnOrderComponent/TurnOrderTheme.tres rename to src/components/TurnOrderComponent/TurnOrderTheme.tres diff --git a/src/project.godot b/src/project.godot index 503bdbf5..cefc3e86 100644 --- a/src/project.godot +++ b/src/project.godot @@ -57,13 +57,13 @@ folder_colors={ "res://addons/": "red", "res://addons/@spacewiz/": "teal", "res://assets/": "purple", +"res://components/": "orange", "res://features/": "blue", "res://features/Common/": "green", "res://features/Scenes/": "green", "res://helpers/": "gray", "res://resources/": "pink", "res://scenes/": "orange", -"res://scenes/components/": "orange", "res://tests/": "red" } diff --git a/src/scenes/gameplay/Battle.tscn b/src/scenes/gameplay/Battle.tscn index d52ca722..245c0f9d 100644 --- a/src/scenes/gameplay/Battle.tscn +++ b/src/scenes/gameplay/Battle.tscn @@ -2,12 +2,12 @@ [ext_resource type="Script" uid="uid://jc3rfy1j13nu" path="res://features/Scenes/Battle/BattleManager.cs" id="1_oeh3a"] [ext_resource type="SpriteFrames" uid="uid://fdkgmyh24b0q" path="res://assets/characters/joannaOtsoga/JoannaOtsogaSprites.tres" id="2_cgh0m"] -[ext_resource type="PackedScene" uid="uid://c22tpnmaefgn4" path="res://scenes/components/HUDComponent/HUDComponent.tscn" id="2_k1t2d"] +[ext_resource type="PackedScene" uid="uid://c22tpnmaefgn4" path="res://components/HUDComponent/HUDComponent.tscn" id="2_k1t2d"] [ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://features/Grid/GridType.cs" id="6_6v2rn"] [ext_resource type="Resource" uid="uid://d22hmntd0rfq2" path="res://resources/Characters/EnemyCharacterStore.tres" id="7_6v2rn"] [ext_resource type="Texture2D" uid="uid://byujdpnhcw2vd" path="res://assets/prototype/Dark/texture_01.png" id="8_vpfel"] [ext_resource type="Resource" uid="uid://snt34yslyn4f" path="res://resources/Characters/PlayerCharacterStore.tres" id="9_eybki"] -[ext_resource type="PackedScene" uid="uid://dmw0cm136sn4p" path="res://scenes/components/CharacterGrid/CharacterGrid.tscn" id="10_hsrxk"] +[ext_resource type="PackedScene" uid="uid://dmw0cm136sn4p" path="res://components/CharacterGrid/CharacterGrid.tscn" id="10_hsrxk"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_vpfel"] sky_horizon_color = Color(0.662243, 0.671743, 0.686743, 1) From 51b861ece3bcc6f2a7349843d04153d8e2b42fde Mon Sep 17 00:00:00 2001 From: Danilo Nobre Date: Sat, 8 Mar 2025 17:14:00 -0300 Subject: [PATCH 02/13] refactoring file structure to a better MVC aligned model --- src/README.md | 42 +++++++---- .../Battle => controllers}/BattleManager.cs | 0 .../BattleManager.cs.uid | 0 .../Menus => controllers}/GameOverManager.cs | 0 .../GameOverManager.cs.uid | 0 .../GameplayTransitionManager.cs | 0 .../GameplayTransitionManager.cs.uid | 0 .../Lobby => controllers}/LobbyManager.cs | 0 .../Lobby => controllers}/LobbyManager.cs.uid | 0 .../Menus => controllers}/MainMenuManager.cs | 0 .../MainMenuManager.cs.uid | 0 .../MenuTransitionManager.cs | 0 .../MenuTransitionManager.cs.uid | 0 .../Common/Events => events}/EventBus.cs | 0 .../Common/Events => events}/EventBus.cs.uid | 0 src/features/Common/IIdentifiable.cs.uid | 1 - .../Common/IdentifiableResource.cs.uid | 1 - .../UI/PlaygroundTransitionManager.cs.uid | 1 - .../UI/PlaygroundTransitionMenu.cs.uid | 1 - .../data}/Action/ActionCategory.cs.uid | 0 .../data}/Action/ActionType.cs | 0 .../data}/Action/ActionType.cs.uid | 0 .../data}/Action/IAction.cs | 0 .../data}/Action/IAction.cs.uid | 0 .../data}/Action/IActionAssets.cs | 0 .../data}/Action/IActionAssets.cs.uid | 0 .../data}/Action/IActionBehavior.cs | 0 .../data}/Action/IActionBehavior.cs.uid | 0 .../data}/Action/IActionContext.cs | 0 .../data}/Action/IActionContext.cs.uid | 0 .../data}/Action/IActionInformation.cs | 0 .../data}/Action/IActionInformation.cs.uid | 0 .../data}/Attribute/AttributeType.cs | 0 .../data}/Attribute/AttributeType.cs.uid | 0 .../data}/Attribute/IAttribute.cs | 0 .../data}/Attribute/IAttribute.cs.uid | 0 .../data}/Attribute/IAttributeAssets.cs | 0 .../data}/Attribute/IAttributeAssets.cs.uid | 0 .../data}/Attribute/IAttributeInformation.cs | 0 .../Attribute/IAttributeInformation.cs.uid | 0 .../data}/Attribute/IAttributeValues.cs | 0 .../data}/Attribute/IAttributeValues.cs.uid | 0 .../data}/Category/Category.cs | 0 .../data}/Category/Category.cs.uid | 0 .../data}/Character/Category.cs.uid | 0 .../data}/Character/CharacterAction.cs | 0 .../data}/Character/CharacterAction.cs.uid | 0 .../data}/Character/CharacterAttribute.cs | 0 .../data}/Character/CharacterAttribute.cs.uid | 0 .../data}/Character/CharacterRole.cs.uid | 0 .../data}/Character/CharacterType.cs | 2 - .../data}/Character/CharacterType.cs.uid | 0 .../data}/Character/ICharacter.cs | 0 .../data}/Character/ICharacter.cs.uid | 0 .../data}/Character/ICharacterActionSheet.cs | 0 .../Character/ICharacterActionSheet.cs.uid | 0 .../data}/Character/ICharacterAssetSheet.cs | 0 .../Character/ICharacterAssetSheet.cs.uid | 0 .../Character/ICharacterAttributeSheet.cs | 0 .../Character/ICharacterAttributeSheet.cs.uid | 0 .../Character/ICharacterInformationSheet.cs | 0 .../ICharacterInformationSheet.cs.uid | 0 .../Character/ICharacterPlacementSheet.cs | 0 .../Character/ICharacterPlacementSheet.cs.uid | 0 .../Character/ICharacterRoleSheet.cs.uid | 0 .../data}/Dice/DiceEnergy.cs | 0 .../data}/Dice/DiceEnergy.cs.uid | 0 .../data}/Dice/DiceEnergyStore.uid | 0 .../data}/Dice/DiceFactory.cs | 0 .../data}/Dice/DiceFactory.cs.uid | 0 .../data}/Dice/DiceIcon.cs | 0 .../data}/Dice/DiceIcon.cs.uid | 0 .../data}/Dice/DiceIconStore.uid | 0 .../data}/Dice/DiceLocation.cs | 0 .../data}/Dice/DiceLocation.cs.uid | 0 .../data}/Dice/DiceLocationCategory.cs | 0 .../data}/Dice/DiceLocationCategory.cs.uid | 0 .../data}/Dice/DiceSide.cs | 0 .../data}/Dice/DiceSide.cs.uid | 0 .../data}/Dice/DiceType.cs | 0 .../data}/Dice/DiceType.cs.uid | 0 src/{features => models/data}/Dice/IDice.cs | 0 .../data}/Dice/IDice.cs.uid | 0 .../data}/Dice/IDiceEnergy.cs | 0 .../data}/Dice/IDiceEnergy.cs.uid | 0 .../data}/Dice/IDiceLocation.cs | 0 .../data}/Dice/IDiceLocation.cs.uid | 0 .../data}/Dungeon/DungeonManager.cs | 0 .../data}/Dungeon/DungeonManager.cs.uid | 0 .../data}/Effect/DamageEffect.cs | 0 .../data}/Effect/DamageEffect.cs.uid | 0 .../data}/Effect/EffectType.cs | 0 .../data}/Effect/EffectType.cs.uid | 0 .../data}/Effect/IEffect.cs | 0 .../data}/Effect/IEffect.cs.uid | 0 .../data}/Grid/GridDirection.cs | 0 .../data}/Grid/GridDirection.cs.uid | 0 .../data}/Grid/GridType.cs | 0 .../data}/Grid/GridType.cs.uid | 0 src/{features => models/data}/Grid/IGrid.cs | 0 .../data}/Grid/IGrid.cs.uid | 0 .../data}/Grid/IGridCells.cs | 0 .../data}/Grid/IGridCells.cs.uid | 0 .../data}/Grid/IGridConfiguration.cs | 0 .../data}/Grid/IGridConfiguration.cs.uid | 0 .../data}/Id/IIdentifiable.cs | 0 .../data}/Id/IIdentifiable.cs.uid | 0 .../data}/Id/IdentifiableResource.cs | 0 .../data}/Id/IdentifiableResource.cs.uid | 0 .../data}/Location/ILocation.cs | 0 .../data}/Location/ILocation.cs.uid | 0 .../data}/Location/LocationType.cs | 0 .../data}/Location/LocationType.cs.uid | 0 .../data}/Logs/GameLogLine.cs | 0 .../data}/Logs/GameLogLine.cs.uid | 0 .../data}/Logs/GameLogMessage.cs | 0 .../data}/Logs/GameLogMessage.cs.uid | 0 src/{features => models/data}/Role/IRole.cs | 0 .../data}/Role/IRole.cs.uid | 0 .../data}/Role/IRoleActions.cs | 0 .../data}/Role/IRoleActions.cs.uid | 0 .../data}/Role/IRoleAttributes.cs | 0 .../data}/Role/IRoleAttributes.cs.uid | 0 .../data}/Role/IRoleInformation.cs | 0 .../data}/Role/IRoleInformation.cs.uid | 0 .../data}/Role/RoleAction.cs | 0 .../data}/Role/RoleAction.cs.uid | 0 .../data}/Role/RoleAttribute.cs | 0 .../data}/Role/RoleAttribute.cs.uid | 0 .../data}/Role/RoleType.cs | 0 .../data}/Role/RoleType.cs.uid | 0 .../data}/Target/ITargetBoard.cs | 0 .../data}/Target/ITargetBoard.cs.uid | 0 .../data}/Target/TargetBoardType.cs | 0 .../data}/Target/TargetBoardType.cs.uid | 0 .../services}/CharacterService.cs | 0 .../services}/CharacterService.cs.uid | 0 .../services}/EffectService.cs | 0 .../services}/EffectService.cs.uid | 0 .../Grid => models/services}/GridService.cs | 0 .../services}/GridService.cs.uid | 0 .../Id => models/services}/IdService.cs | 0 .../Id => models/services}/IdService.cs.uid | 0 .../services}/TargetBoardService.cs | 0 .../services}/TargetBoardService.cs.uid | 0 .../services}/ValidationService.cs | 0 .../services}/ValidationService.cs.uid | 0 .../stores}/AttributesStore.cs | 0 .../stores}/AttributesStore.cs.uid | 0 .../stores}/CharacterStore.cs | 0 .../stores}/CharacterStore.cs.uid | 0 .../Dice => models/stores}/DiceEnergyStore.cs | 0 .../stores}/DiceEnergyStore.cs.uid | 0 .../Dice => models/stores}/DiceIconStore.cs | 0 .../stores}/DiceIconStore.cs.uid | 0 .../Dice => models/stores}/DiceStore.cs | 0 .../Dice => models/stores}/DiceStore.cs.uid | 0 .../Logs => models/stores}/GameLogStore.cs | 0 .../stores}/GameLogStore.cs.uid | 0 src/project.godot | 22 +++--- src/resources/Actions/ArcaneStrike.tres | 8 +-- src/resources/Actions/Categories/Buff.tres | 10 +-- src/resources/Actions/Categories/Debuff.tres | 10 +-- .../Actions/Categories/Defensive.tres | 10 +-- .../Actions/Categories/Offensive.tres | 16 ----- src/resources/Actions/CleaveAttack.tres | 12 ++-- src/resources/Actions/MagicMissiles.tres | 14 ++-- src/resources/Actions/QuickSlash.tres | 16 ++--- src/resources/Actions/Stare.tres | 10 +-- src/resources/Attributes/Armor.tres | 4 +- src/resources/Attributes/AttributesStore.tres | 4 +- src/resources/Attributes/Health.tres | 2 +- src/resources/Attributes/Speed.tres | 4 +- src/resources/Characters/Categories/Ally.tres | 2 +- .../Characters/Categories/Enemy.tres | 4 +- .../Characters/Categories/Neutral.tres | 4 +- src/resources/Characters/Dummy.tres | 10 ++- src/resources/Characters/Eleonore.tres | 16 ++--- .../Characters/EnemyCharacterStore.tres | 7 +- src/resources/Characters/Joanna.tres | 10 ++- .../Characters/PlayerCharacterStore.tres | 11 ++- src/resources/Dice/DiceEnergyStore.tres | 4 +- src/resources/Dice/DiceIconStore.tres | 4 +- src/resources/Dice/Icons/DiceIconD10.tres | 2 +- src/resources/Dice/Icons/DiceIconD100.tres | 2 +- src/resources/Dice/Icons/DiceIconD20.tres | 2 +- src/resources/Dice/Icons/DiceIconD4.tres | 2 +- src/resources/Dice/Icons/DiceIconD6.tres | 2 +- src/resources/Dice/Icons/DiceIconD8.tres | 2 +- src/resources/Dice/Mana/ManaBlue.tres | 2 +- src/resources/Dice/Mana/ManaEmpty.tres | 2 +- src/resources/Dice/Mana/ManaGreen.tres | 2 +- src/resources/Dice/Mana/ManaPurple.tres | 2 +- src/resources/Dice/Mana/ManaRed.tres | 2 +- src/resources/Dice/Mana/ManaYellow.tres | 2 +- src/resources/Effects/DamageEffect.tres | 2 +- src/resources/Locations/EnemySquad.tres | 2 +- src/resources/Locations/PlayerRoster.tres | 2 +- src/resources/Locations/PlayerSquad.tres | 2 +- src/resources/Roles/Playable/Fighter.tres | 20 ++---- src/resources/Roles/Playable/Mage.tres | 6 +- src/resources/Roles/Unplayable/DummyRole.tres | 6 +- src/views/ISelectable.cs.uid | 1 + src/views/SelectionHandler.cs.uid | 1 + .../CharacterComponent/CharacterComponent.cs | 0 .../CharacterComponent.cs.uid | 0 .../CharacterComponent.tscn | 2 +- .../components/CharacterGrid/Arrow.tscn | 0 .../components/CharacterGrid/CharacterGrid.cs | 0 .../CharacterGrid/CharacterGrid.cs.uid | 0 .../CharacterGrid/CharacterGrid.tscn | 14 ++-- .../components/CharacterGrid/Grid3D.cs | 0 .../components/CharacterGrid/Grid3D.cs.uid | 0 .../components/CharacterGrid/GridCell3D.cs | 0 .../CharacterGrid/GridCell3D.cs.uid | 0 .../CharacterInspector/CharacterInspector.cs | 0 .../CharacterInspector.cs.uid | 0 .../CharacterInspector.tscn | 2 +- .../components/GameLog/GameLogComponent.cs | 0 .../GameLog/GameLogComponent.cs.uid | 0 .../components/GameLog/GameLogComponent.tscn | 2 +- .../components/HUDComponent/HUDComponent.tscn | 10 +-- .../InventoryComponent/InventoryComponent.cs | 0 .../InventoryComponent.cs.uid | 0 .../InventoryComponent.tscn | 4 +- .../components/InventoryComponent/slot.png | Bin .../InventoryComponent/slot.png.import | 6 +- .../components/InventoryComponent/test.tscn | 2 +- .../InventoryItemComponent.cs | 0 .../InventoryItemComponent.cs.uid | 0 .../InventoryItemComponent.tscn | 4 +- .../TooltipComponent/TooltipComponent.cs | 0 .../TooltipComponent/TooltipComponent.cs.uid | 0 .../TooltipComponent/TooltipComponent.tscn | 4 +- .../components/TooltipComponent/icon.png | Bin .../TooltipComponent/icon.png.import | 6 +- .../TurnOrderComponent/TurnOrderComponent.cs | 0 .../TurnOrderComponent.cs.uid | 0 .../TurnOrderComponent.tscn | 4 +- .../TurnOrderComponent/TurnOrderTheme.tres | 0 .../scenes/GameplayTransitionManager.tscn | 8 +-- .../scenes/MenuTransitionManager.tscn | 8 +-- src/{ => views}/scenes/gameplay/Battle.tscn | 66 +++++++++--------- src/{ => views}/scenes/gameplay/Dungeon.tscn | 4 +- src/{ => views}/scenes/gameplay/Lobby.tscn | 4 +- src/{ => views}/scenes/menus/GameOver.tscn | 2 +- src/{ => views}/scenes/menus/MainMenu.tscn | 12 ++-- .../UI => views/ui}/CloseGameButton.cs | 0 .../UI => views/ui}/CloseGameButton.cs.uid | 0 .../UI => views/ui}/SceneTransitionButton.cs | 0 .../ui}/SceneTransitionButton.cs.uid | 0 src/{helpers => views/utils}/Arc2D.cs | 0 src/{helpers => views/utils}/Arc2D.cs.uid | 0 .../utils}/Arc3DRenderer/Arc3DRenderer.cs | 0 .../utils}/Arc3DRenderer/Arc3DRenderer.cs.uid | 0 .../utils}/Arc3DRenderer/Arc3DRenderer.tscn | 2 +- .../utils}/Arc3DRenderer/Arc3DRenderer.uid | 0 src/{features/UI => views/utils}/ArcDrawer.cs | 0 .../UI => views/utils}/ArcDrawer.cs.uid | 0 259 files changed, 227 insertions(+), 267 deletions(-) rename src/{features/Scenes/Battle => controllers}/BattleManager.cs (100%) rename src/{features/Scenes/Battle => controllers}/BattleManager.cs.uid (100%) rename src/{features/Scenes/Menus => controllers}/GameOverManager.cs (100%) rename src/{features/Scenes/Menus => controllers}/GameOverManager.cs.uid (100%) rename src/{features/UI => controllers}/GameplayTransitionManager.cs (100%) rename src/{features/UI => controllers}/GameplayTransitionManager.cs.uid (100%) rename src/{features/Scenes/Lobby => controllers}/LobbyManager.cs (100%) rename src/{features/Scenes/Lobby => controllers}/LobbyManager.cs.uid (100%) rename src/{features/Scenes/Menus => controllers}/MainMenuManager.cs (100%) rename src/{features/Scenes/Menus => controllers}/MainMenuManager.cs.uid (100%) rename src/{features/UI => controllers}/MenuTransitionManager.cs (100%) rename src/{features/UI => controllers}/MenuTransitionManager.cs.uid (100%) rename src/{features/Common/Events => events}/EventBus.cs (100%) rename src/{features/Common/Events => events}/EventBus.cs.uid (100%) delete mode 100644 src/features/Common/IIdentifiable.cs.uid delete mode 100644 src/features/Common/IdentifiableResource.cs.uid delete mode 100644 src/features/UI/PlaygroundTransitionManager.cs.uid delete mode 100644 src/features/UI/PlaygroundTransitionMenu.cs.uid rename src/{features => models/data}/Action/ActionCategory.cs.uid (100%) rename src/{features => models/data}/Action/ActionType.cs (100%) rename src/{features => models/data}/Action/ActionType.cs.uid (100%) rename src/{features => models/data}/Action/IAction.cs (100%) rename src/{features => models/data}/Action/IAction.cs.uid (100%) rename src/{features => models/data}/Action/IActionAssets.cs (100%) rename src/{features => models/data}/Action/IActionAssets.cs.uid (100%) rename src/{features => models/data}/Action/IActionBehavior.cs (100%) rename src/{features => models/data}/Action/IActionBehavior.cs.uid (100%) rename src/{features => models/data}/Action/IActionContext.cs (100%) rename src/{features => models/data}/Action/IActionContext.cs.uid (100%) rename src/{features => models/data}/Action/IActionInformation.cs (100%) rename src/{features => models/data}/Action/IActionInformation.cs.uid (100%) rename src/{features => models/data}/Attribute/AttributeType.cs (100%) rename src/{features => models/data}/Attribute/AttributeType.cs.uid (100%) rename src/{features => models/data}/Attribute/IAttribute.cs (100%) rename src/{features => models/data}/Attribute/IAttribute.cs.uid (100%) rename src/{features => models/data}/Attribute/IAttributeAssets.cs (100%) rename src/{features => models/data}/Attribute/IAttributeAssets.cs.uid (100%) rename src/{features => models/data}/Attribute/IAttributeInformation.cs (100%) rename src/{features => models/data}/Attribute/IAttributeInformation.cs.uid (100%) rename src/{features => models/data}/Attribute/IAttributeValues.cs (100%) rename src/{features => models/data}/Attribute/IAttributeValues.cs.uid (100%) rename src/{features => models/data}/Category/Category.cs (100%) rename src/{features => models/data}/Category/Category.cs.uid (100%) rename src/{features => models/data}/Character/Category.cs.uid (100%) rename src/{features => models/data}/Character/CharacterAction.cs (100%) rename src/{features => models/data}/Character/CharacterAction.cs.uid (100%) rename src/{features => models/data}/Character/CharacterAttribute.cs (100%) rename src/{features => models/data}/Character/CharacterAttribute.cs.uid (100%) rename src/{features => models/data}/Character/CharacterRole.cs.uid (100%) rename src/{features => models/data}/Character/CharacterType.cs (98%) rename src/{features => models/data}/Character/CharacterType.cs.uid (100%) rename src/{features => models/data}/Character/ICharacter.cs (100%) rename src/{features => models/data}/Character/ICharacter.cs.uid (100%) rename src/{features => models/data}/Character/ICharacterActionSheet.cs (100%) rename src/{features => models/data}/Character/ICharacterActionSheet.cs.uid (100%) rename src/{features => models/data}/Character/ICharacterAssetSheet.cs (100%) rename src/{features => models/data}/Character/ICharacterAssetSheet.cs.uid (100%) rename src/{features => models/data}/Character/ICharacterAttributeSheet.cs (100%) rename src/{features => models/data}/Character/ICharacterAttributeSheet.cs.uid (100%) rename src/{features => models/data}/Character/ICharacterInformationSheet.cs (100%) rename src/{features => models/data}/Character/ICharacterInformationSheet.cs.uid (100%) rename src/{features => models/data}/Character/ICharacterPlacementSheet.cs (100%) rename src/{features => models/data}/Character/ICharacterPlacementSheet.cs.uid (100%) rename src/{features => models/data}/Character/ICharacterRoleSheet.cs.uid (100%) rename src/{features => models/data}/Dice/DiceEnergy.cs (100%) rename src/{features => models/data}/Dice/DiceEnergy.cs.uid (100%) rename src/{features => models/data}/Dice/DiceEnergyStore.uid (100%) rename src/{features => models/data}/Dice/DiceFactory.cs (100%) rename src/{features => models/data}/Dice/DiceFactory.cs.uid (100%) rename src/{features => models/data}/Dice/DiceIcon.cs (100%) rename src/{features => models/data}/Dice/DiceIcon.cs.uid (100%) rename src/{features => models/data}/Dice/DiceIconStore.uid (100%) rename src/{features => models/data}/Dice/DiceLocation.cs (100%) rename src/{features => models/data}/Dice/DiceLocation.cs.uid (100%) rename src/{features => models/data}/Dice/DiceLocationCategory.cs (100%) rename src/{features => models/data}/Dice/DiceLocationCategory.cs.uid (100%) rename src/{features => models/data}/Dice/DiceSide.cs (100%) rename src/{features => models/data}/Dice/DiceSide.cs.uid (100%) rename src/{features => models/data}/Dice/DiceType.cs (100%) rename src/{features => models/data}/Dice/DiceType.cs.uid (100%) rename src/{features => models/data}/Dice/IDice.cs (100%) rename src/{features => models/data}/Dice/IDice.cs.uid (100%) rename src/{features => models/data}/Dice/IDiceEnergy.cs (100%) rename src/{features => models/data}/Dice/IDiceEnergy.cs.uid (100%) rename src/{features => models/data}/Dice/IDiceLocation.cs (100%) rename src/{features => models/data}/Dice/IDiceLocation.cs.uid (100%) rename src/{features => models/data}/Dungeon/DungeonManager.cs (100%) rename src/{features => models/data}/Dungeon/DungeonManager.cs.uid (100%) rename src/{features => models/data}/Effect/DamageEffect.cs (100%) rename src/{features => models/data}/Effect/DamageEffect.cs.uid (100%) rename src/{features => models/data}/Effect/EffectType.cs (100%) rename src/{features => models/data}/Effect/EffectType.cs.uid (100%) rename src/{features => models/data}/Effect/IEffect.cs (100%) rename src/{features => models/data}/Effect/IEffect.cs.uid (100%) rename src/{features => models/data}/Grid/GridDirection.cs (100%) rename src/{features => models/data}/Grid/GridDirection.cs.uid (100%) rename src/{features => models/data}/Grid/GridType.cs (100%) rename src/{features => models/data}/Grid/GridType.cs.uid (100%) rename src/{features => models/data}/Grid/IGrid.cs (100%) rename src/{features => models/data}/Grid/IGrid.cs.uid (100%) rename src/{features => models/data}/Grid/IGridCells.cs (100%) rename src/{features => models/data}/Grid/IGridCells.cs.uid (100%) rename src/{features => models/data}/Grid/IGridConfiguration.cs (100%) rename src/{features => models/data}/Grid/IGridConfiguration.cs.uid (100%) rename src/{features/Common => models/data}/Id/IIdentifiable.cs (100%) rename src/{features/Common => models/data}/Id/IIdentifiable.cs.uid (100%) rename src/{features/Common => models/data}/Id/IdentifiableResource.cs (100%) rename src/{features/Common => models/data}/Id/IdentifiableResource.cs.uid (100%) rename src/{features => models/data}/Location/ILocation.cs (100%) rename src/{features => models/data}/Location/ILocation.cs.uid (100%) rename src/{features => models/data}/Location/LocationType.cs (100%) rename src/{features => models/data}/Location/LocationType.cs.uid (100%) rename src/{features/Common => models/data}/Logs/GameLogLine.cs (100%) rename src/{features/Common => models/data}/Logs/GameLogLine.cs.uid (100%) rename src/{features/Common => models/data}/Logs/GameLogMessage.cs (100%) rename src/{features/Common => models/data}/Logs/GameLogMessage.cs.uid (100%) rename src/{features => models/data}/Role/IRole.cs (100%) rename src/{features => models/data}/Role/IRole.cs.uid (100%) rename src/{features => models/data}/Role/IRoleActions.cs (100%) rename src/{features => models/data}/Role/IRoleActions.cs.uid (100%) rename src/{features => models/data}/Role/IRoleAttributes.cs (100%) rename src/{features => models/data}/Role/IRoleAttributes.cs.uid (100%) rename src/{features => models/data}/Role/IRoleInformation.cs (100%) rename src/{features => models/data}/Role/IRoleInformation.cs.uid (100%) rename src/{features => models/data}/Role/RoleAction.cs (100%) rename src/{features => models/data}/Role/RoleAction.cs.uid (100%) rename src/{features => models/data}/Role/RoleAttribute.cs (100%) rename src/{features => models/data}/Role/RoleAttribute.cs.uid (100%) rename src/{features => models/data}/Role/RoleType.cs (100%) rename src/{features => models/data}/Role/RoleType.cs.uid (100%) rename src/{features => models/data}/Target/ITargetBoard.cs (100%) rename src/{features => models/data}/Target/ITargetBoard.cs.uid (100%) rename src/{features => models/data}/Target/TargetBoardType.cs (100%) rename src/{features => models/data}/Target/TargetBoardType.cs.uid (100%) rename src/{features/Character => models/services}/CharacterService.cs (100%) rename src/{features/Character => models/services}/CharacterService.cs.uid (100%) rename src/{features/Effect => models/services}/EffectService.cs (100%) rename src/{features/Effect => models/services}/EffectService.cs.uid (100%) rename src/{features/Grid => models/services}/GridService.cs (100%) rename src/{features/Grid => models/services}/GridService.cs.uid (100%) rename src/{features/Common/Id => models/services}/IdService.cs (100%) rename src/{features/Common/Id => models/services}/IdService.cs.uid (100%) rename src/{features/Target => models/services}/TargetBoardService.cs (100%) rename src/{features/Target => models/services}/TargetBoardService.cs.uid (100%) rename src/{features/Common => models/services}/ValidationService.cs (100%) rename src/{features/Common => models/services}/ValidationService.cs.uid (100%) rename src/{features/Attribute => models/stores}/AttributesStore.cs (100%) rename src/{features/Attribute => models/stores}/AttributesStore.cs.uid (100%) rename src/{features/Character => models/stores}/CharacterStore.cs (100%) rename src/{features/Character => models/stores}/CharacterStore.cs.uid (100%) rename src/{features/Dice => models/stores}/DiceEnergyStore.cs (100%) rename src/{features/Dice => models/stores}/DiceEnergyStore.cs.uid (100%) rename src/{features/Dice => models/stores}/DiceIconStore.cs (100%) rename src/{features/Dice => models/stores}/DiceIconStore.cs.uid (100%) rename src/{features/Dice => models/stores}/DiceStore.cs (100%) rename src/{features/Dice => models/stores}/DiceStore.cs.uid (100%) rename src/{features/Common/Logs => models/stores}/GameLogStore.cs (100%) rename src/{features/Common/Logs => models/stores}/GameLogStore.cs.uid (100%) delete mode 100644 src/resources/Actions/Categories/Offensive.tres create mode 100644 src/views/ISelectable.cs.uid create mode 100644 src/views/SelectionHandler.cs.uid rename src/{ => views}/components/CharacterComponent/CharacterComponent.cs (100%) rename src/{ => views}/components/CharacterComponent/CharacterComponent.cs.uid (100%) rename src/{ => views}/components/CharacterComponent/CharacterComponent.tscn (96%) rename src/{ => views}/components/CharacterGrid/Arrow.tscn (100%) rename src/{ => views}/components/CharacterGrid/CharacterGrid.cs (100%) rename src/{ => views}/components/CharacterGrid/CharacterGrid.cs.uid (100%) rename src/{ => views}/components/CharacterGrid/CharacterGrid.tscn (61%) rename src/{ => views}/components/CharacterGrid/Grid3D.cs (100%) rename src/{ => views}/components/CharacterGrid/Grid3D.cs.uid (100%) rename src/{ => views}/components/CharacterGrid/GridCell3D.cs (100%) rename src/{ => views}/components/CharacterGrid/GridCell3D.cs.uid (100%) rename src/{ => views}/components/CharacterInspector/CharacterInspector.cs (100%) rename src/{ => views}/components/CharacterInspector/CharacterInspector.cs.uid (100%) rename src/{ => views}/components/CharacterInspector/CharacterInspector.tscn (98%) rename src/{ => views}/components/GameLog/GameLogComponent.cs (100%) rename src/{ => views}/components/GameLog/GameLogComponent.cs.uid (100%) rename src/{ => views}/components/GameLog/GameLogComponent.tscn (97%) rename src/{ => views}/components/HUDComponent/HUDComponent.tscn (88%) rename src/{ => views}/components/InventoryComponent/InventoryComponent.cs (100%) rename src/{ => views}/components/InventoryComponent/InventoryComponent.cs.uid (100%) rename src/{ => views}/components/InventoryComponent/InventoryComponent.tscn (82%) rename src/{ => views}/components/InventoryComponent/slot.png (100%) rename src/{ => views}/components/InventoryComponent/slot.png.import (71%) rename src/{ => views}/components/InventoryComponent/test.tscn (95%) rename src/{ => views}/components/InventoryItemComponent/InventoryItemComponent.cs (100%) rename src/{ => views}/components/InventoryItemComponent/InventoryItemComponent.cs.uid (100%) rename src/{ => views}/components/InventoryItemComponent/InventoryItemComponent.tscn (79%) rename src/{ => views}/components/TooltipComponent/TooltipComponent.cs (100%) rename src/{ => views}/components/TooltipComponent/TooltipComponent.cs.uid (100%) rename src/{ => views}/components/TooltipComponent/TooltipComponent.tscn (97%) rename src/{ => views}/components/TooltipComponent/icon.png (100%) rename src/{ => views}/components/TooltipComponent/icon.png.import (71%) rename src/{ => views}/components/TurnOrderComponent/TurnOrderComponent.cs (100%) rename src/{ => views}/components/TurnOrderComponent/TurnOrderComponent.cs.uid (100%) rename src/{ => views}/components/TurnOrderComponent/TurnOrderComponent.tscn (96%) rename src/{ => views}/components/TurnOrderComponent/TurnOrderTheme.tres (100%) rename src/{ => views}/scenes/GameplayTransitionManager.tscn (70%) rename src/{ => views}/scenes/MenuTransitionManager.tscn (70%) rename src/{ => views}/scenes/gameplay/Battle.tscn (98%) rename src/{ => views}/scenes/gameplay/Dungeon.tscn (95%) rename src/{ => views}/scenes/gameplay/Lobby.tscn (94%) rename src/{ => views}/scenes/menus/GameOver.tscn (77%) rename src/{ => views}/scenes/menus/MainMenu.tscn (88%) rename src/{features/UI => views/ui}/CloseGameButton.cs (100%) rename src/{features/UI => views/ui}/CloseGameButton.cs.uid (100%) rename src/{features/UI => views/ui}/SceneTransitionButton.cs (100%) rename src/{features/UI => views/ui}/SceneTransitionButton.cs.uid (100%) rename src/{helpers => views/utils}/Arc2D.cs (100%) rename src/{helpers => views/utils}/Arc2D.cs.uid (100%) rename src/{helpers => views/utils}/Arc3DRenderer/Arc3DRenderer.cs (100%) rename src/{helpers => views/utils}/Arc3DRenderer/Arc3DRenderer.cs.uid (100%) rename src/{helpers => views/utils}/Arc3DRenderer/Arc3DRenderer.tscn (79%) rename src/{helpers => views/utils}/Arc3DRenderer/Arc3DRenderer.uid (100%) rename src/{features/UI => views/utils}/ArcDrawer.cs (100%) rename src/{features/UI => views/utils}/ArcDrawer.cs.uid (100%) diff --git a/src/README.md b/src/README.md index 6583959f..ea51b2bd 100644 --- a/src/README.md +++ b/src/README.md @@ -12,25 +12,43 @@ ### Tecnologias do Jogo -- **Godot Engine 4+**: Motor de jogo utilizado para desenvolver o projeto. +- **Godot 4+**: Engine utilizada para desenvolver o projeto; - **C#**: Linguagem de programação utilizada para a lógica do jogo. ### Estrutura da framework -```pwsh +```bash . └── src - ├── addons # bibliotecas third party e plugins do editor - ├── assets # assets como sprites, sons, texturas e respectivos arquivos de configuração - ├── features # funcionalidades do jogo - │ ├── [...feature] # pastas específicas de cada funcionalidade - │ ├── common # funcionalidades comuns - │ └── scenes # cenas específicas das funcionalidades + ├── addons # bibliotecas third party + │ └── @spacewiz # plugins desenvolvidos para o projeto + │ + ├── assets # assets como sprites, sons, texturas e seus arquivos de configuração + │ + ├── controllers # comunicação entre a view e o model, interatividade e controle de eventos + │ # lógica de alto nível, como o controle do estado do jogo, cenas e transições + │ + ├── events # comunicação entre os models, views e controllers + │ # TODO: bus, handlers, types + │ + ├── models + │ ├── data # tipos de dados (resources) que representam informações do jogo + │ ├── services # regras de negócios e acesso aos dados + │ │ # processamento e manipulação dos dados, interação direta com as stores + │ └── stores # estado e armazenamento persistente dos dados + │ + ├── views # View layer: visualização + │ ├── + │ ├── + │ ├── + │ ├── + │ └── + │ ├── helpers # classes utilitárias - ├── resources # resources do Godot - ├── scenes # cenas da framework - │ └── components # nodes a serem exibidos nas cenas e respectivos arquivos de configuração - └── tests # testes do projeto + │ + ├── resources # arquivos de configuração dos dados do jogo + │ + └── tests # testes unitários e cenas específicas para testes ``` ## Ambiente de Desenvolvimento diff --git a/src/features/Scenes/Battle/BattleManager.cs b/src/controllers/BattleManager.cs similarity index 100% rename from src/features/Scenes/Battle/BattleManager.cs rename to src/controllers/BattleManager.cs diff --git a/src/features/Scenes/Battle/BattleManager.cs.uid b/src/controllers/BattleManager.cs.uid similarity index 100% rename from src/features/Scenes/Battle/BattleManager.cs.uid rename to src/controllers/BattleManager.cs.uid diff --git a/src/features/Scenes/Menus/GameOverManager.cs b/src/controllers/GameOverManager.cs similarity index 100% rename from src/features/Scenes/Menus/GameOverManager.cs rename to src/controllers/GameOverManager.cs diff --git a/src/features/Scenes/Menus/GameOverManager.cs.uid b/src/controllers/GameOverManager.cs.uid similarity index 100% rename from src/features/Scenes/Menus/GameOverManager.cs.uid rename to src/controllers/GameOverManager.cs.uid diff --git a/src/features/UI/GameplayTransitionManager.cs b/src/controllers/GameplayTransitionManager.cs similarity index 100% rename from src/features/UI/GameplayTransitionManager.cs rename to src/controllers/GameplayTransitionManager.cs diff --git a/src/features/UI/GameplayTransitionManager.cs.uid b/src/controllers/GameplayTransitionManager.cs.uid similarity index 100% rename from src/features/UI/GameplayTransitionManager.cs.uid rename to src/controllers/GameplayTransitionManager.cs.uid diff --git a/src/features/Scenes/Lobby/LobbyManager.cs b/src/controllers/LobbyManager.cs similarity index 100% rename from src/features/Scenes/Lobby/LobbyManager.cs rename to src/controllers/LobbyManager.cs diff --git a/src/features/Scenes/Lobby/LobbyManager.cs.uid b/src/controllers/LobbyManager.cs.uid similarity index 100% rename from src/features/Scenes/Lobby/LobbyManager.cs.uid rename to src/controllers/LobbyManager.cs.uid diff --git a/src/features/Scenes/Menus/MainMenuManager.cs b/src/controllers/MainMenuManager.cs similarity index 100% rename from src/features/Scenes/Menus/MainMenuManager.cs rename to src/controllers/MainMenuManager.cs diff --git a/src/features/Scenes/Menus/MainMenuManager.cs.uid b/src/controllers/MainMenuManager.cs.uid similarity index 100% rename from src/features/Scenes/Menus/MainMenuManager.cs.uid rename to src/controllers/MainMenuManager.cs.uid diff --git a/src/features/UI/MenuTransitionManager.cs b/src/controllers/MenuTransitionManager.cs similarity index 100% rename from src/features/UI/MenuTransitionManager.cs rename to src/controllers/MenuTransitionManager.cs diff --git a/src/features/UI/MenuTransitionManager.cs.uid b/src/controllers/MenuTransitionManager.cs.uid similarity index 100% rename from src/features/UI/MenuTransitionManager.cs.uid rename to src/controllers/MenuTransitionManager.cs.uid diff --git a/src/features/Common/Events/EventBus.cs b/src/events/EventBus.cs similarity index 100% rename from src/features/Common/Events/EventBus.cs rename to src/events/EventBus.cs diff --git a/src/features/Common/Events/EventBus.cs.uid b/src/events/EventBus.cs.uid similarity index 100% rename from src/features/Common/Events/EventBus.cs.uid rename to src/events/EventBus.cs.uid diff --git a/src/features/Common/IIdentifiable.cs.uid b/src/features/Common/IIdentifiable.cs.uid deleted file mode 100644 index 979001f6..00000000 --- a/src/features/Common/IIdentifiable.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dmmxpye74ucdn diff --git a/src/features/Common/IdentifiableResource.cs.uid b/src/features/Common/IdentifiableResource.cs.uid deleted file mode 100644 index 306d841d..00000000 --- a/src/features/Common/IdentifiableResource.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c4qkr3mvpu6tl diff --git a/src/features/UI/PlaygroundTransitionManager.cs.uid b/src/features/UI/PlaygroundTransitionManager.cs.uid deleted file mode 100644 index 1c7b876b..00000000 --- a/src/features/UI/PlaygroundTransitionManager.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://buwk48b4nt8d2 diff --git a/src/features/UI/PlaygroundTransitionMenu.cs.uid b/src/features/UI/PlaygroundTransitionMenu.cs.uid deleted file mode 100644 index d78448e5..00000000 --- a/src/features/UI/PlaygroundTransitionMenu.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://r0elhsj8rclk diff --git a/src/features/Action/ActionCategory.cs.uid b/src/models/data/Action/ActionCategory.cs.uid similarity index 100% rename from src/features/Action/ActionCategory.cs.uid rename to src/models/data/Action/ActionCategory.cs.uid diff --git a/src/features/Action/ActionType.cs b/src/models/data/Action/ActionType.cs similarity index 100% rename from src/features/Action/ActionType.cs rename to src/models/data/Action/ActionType.cs diff --git a/src/features/Action/ActionType.cs.uid b/src/models/data/Action/ActionType.cs.uid similarity index 100% rename from src/features/Action/ActionType.cs.uid rename to src/models/data/Action/ActionType.cs.uid diff --git a/src/features/Action/IAction.cs b/src/models/data/Action/IAction.cs similarity index 100% rename from src/features/Action/IAction.cs rename to src/models/data/Action/IAction.cs diff --git a/src/features/Action/IAction.cs.uid b/src/models/data/Action/IAction.cs.uid similarity index 100% rename from src/features/Action/IAction.cs.uid rename to src/models/data/Action/IAction.cs.uid diff --git a/src/features/Action/IActionAssets.cs b/src/models/data/Action/IActionAssets.cs similarity index 100% rename from src/features/Action/IActionAssets.cs rename to src/models/data/Action/IActionAssets.cs diff --git a/src/features/Action/IActionAssets.cs.uid b/src/models/data/Action/IActionAssets.cs.uid similarity index 100% rename from src/features/Action/IActionAssets.cs.uid rename to src/models/data/Action/IActionAssets.cs.uid diff --git a/src/features/Action/IActionBehavior.cs b/src/models/data/Action/IActionBehavior.cs similarity index 100% rename from src/features/Action/IActionBehavior.cs rename to src/models/data/Action/IActionBehavior.cs diff --git a/src/features/Action/IActionBehavior.cs.uid b/src/models/data/Action/IActionBehavior.cs.uid similarity index 100% rename from src/features/Action/IActionBehavior.cs.uid rename to src/models/data/Action/IActionBehavior.cs.uid diff --git a/src/features/Action/IActionContext.cs b/src/models/data/Action/IActionContext.cs similarity index 100% rename from src/features/Action/IActionContext.cs rename to src/models/data/Action/IActionContext.cs diff --git a/src/features/Action/IActionContext.cs.uid b/src/models/data/Action/IActionContext.cs.uid similarity index 100% rename from src/features/Action/IActionContext.cs.uid rename to src/models/data/Action/IActionContext.cs.uid diff --git a/src/features/Action/IActionInformation.cs b/src/models/data/Action/IActionInformation.cs similarity index 100% rename from src/features/Action/IActionInformation.cs rename to src/models/data/Action/IActionInformation.cs diff --git a/src/features/Action/IActionInformation.cs.uid b/src/models/data/Action/IActionInformation.cs.uid similarity index 100% rename from src/features/Action/IActionInformation.cs.uid rename to src/models/data/Action/IActionInformation.cs.uid diff --git a/src/features/Attribute/AttributeType.cs b/src/models/data/Attribute/AttributeType.cs similarity index 100% rename from src/features/Attribute/AttributeType.cs rename to src/models/data/Attribute/AttributeType.cs diff --git a/src/features/Attribute/AttributeType.cs.uid b/src/models/data/Attribute/AttributeType.cs.uid similarity index 100% rename from src/features/Attribute/AttributeType.cs.uid rename to src/models/data/Attribute/AttributeType.cs.uid diff --git a/src/features/Attribute/IAttribute.cs b/src/models/data/Attribute/IAttribute.cs similarity index 100% rename from src/features/Attribute/IAttribute.cs rename to src/models/data/Attribute/IAttribute.cs diff --git a/src/features/Attribute/IAttribute.cs.uid b/src/models/data/Attribute/IAttribute.cs.uid similarity index 100% rename from src/features/Attribute/IAttribute.cs.uid rename to src/models/data/Attribute/IAttribute.cs.uid diff --git a/src/features/Attribute/IAttributeAssets.cs b/src/models/data/Attribute/IAttributeAssets.cs similarity index 100% rename from src/features/Attribute/IAttributeAssets.cs rename to src/models/data/Attribute/IAttributeAssets.cs diff --git a/src/features/Attribute/IAttributeAssets.cs.uid b/src/models/data/Attribute/IAttributeAssets.cs.uid similarity index 100% rename from src/features/Attribute/IAttributeAssets.cs.uid rename to src/models/data/Attribute/IAttributeAssets.cs.uid diff --git a/src/features/Attribute/IAttributeInformation.cs b/src/models/data/Attribute/IAttributeInformation.cs similarity index 100% rename from src/features/Attribute/IAttributeInformation.cs rename to src/models/data/Attribute/IAttributeInformation.cs diff --git a/src/features/Attribute/IAttributeInformation.cs.uid b/src/models/data/Attribute/IAttributeInformation.cs.uid similarity index 100% rename from src/features/Attribute/IAttributeInformation.cs.uid rename to src/models/data/Attribute/IAttributeInformation.cs.uid diff --git a/src/features/Attribute/IAttributeValues.cs b/src/models/data/Attribute/IAttributeValues.cs similarity index 100% rename from src/features/Attribute/IAttributeValues.cs rename to src/models/data/Attribute/IAttributeValues.cs diff --git a/src/features/Attribute/IAttributeValues.cs.uid b/src/models/data/Attribute/IAttributeValues.cs.uid similarity index 100% rename from src/features/Attribute/IAttributeValues.cs.uid rename to src/models/data/Attribute/IAttributeValues.cs.uid diff --git a/src/features/Category/Category.cs b/src/models/data/Category/Category.cs similarity index 100% rename from src/features/Category/Category.cs rename to src/models/data/Category/Category.cs diff --git a/src/features/Category/Category.cs.uid b/src/models/data/Category/Category.cs.uid similarity index 100% rename from src/features/Category/Category.cs.uid rename to src/models/data/Category/Category.cs.uid diff --git a/src/features/Character/Category.cs.uid b/src/models/data/Character/Category.cs.uid similarity index 100% rename from src/features/Character/Category.cs.uid rename to src/models/data/Character/Category.cs.uid diff --git a/src/features/Character/CharacterAction.cs b/src/models/data/Character/CharacterAction.cs similarity index 100% rename from src/features/Character/CharacterAction.cs rename to src/models/data/Character/CharacterAction.cs diff --git a/src/features/Character/CharacterAction.cs.uid b/src/models/data/Character/CharacterAction.cs.uid similarity index 100% rename from src/features/Character/CharacterAction.cs.uid rename to src/models/data/Character/CharacterAction.cs.uid diff --git a/src/features/Character/CharacterAttribute.cs b/src/models/data/Character/CharacterAttribute.cs similarity index 100% rename from src/features/Character/CharacterAttribute.cs rename to src/models/data/Character/CharacterAttribute.cs diff --git a/src/features/Character/CharacterAttribute.cs.uid b/src/models/data/Character/CharacterAttribute.cs.uid similarity index 100% rename from src/features/Character/CharacterAttribute.cs.uid rename to src/models/data/Character/CharacterAttribute.cs.uid diff --git a/src/features/Character/CharacterRole.cs.uid b/src/models/data/Character/CharacterRole.cs.uid similarity index 100% rename from src/features/Character/CharacterRole.cs.uid rename to src/models/data/Character/CharacterRole.cs.uid diff --git a/src/features/Character/CharacterType.cs b/src/models/data/Character/CharacterType.cs similarity index 98% rename from src/features/Character/CharacterType.cs rename to src/models/data/Character/CharacterType.cs index 0c32db89..fc0d7109 100644 --- a/src/features/Character/CharacterType.cs +++ b/src/models/data/Character/CharacterType.cs @@ -107,8 +107,6 @@ public RoleType? Role { public int SlotIndex { get; set; } = -1; public CharacterType() { - InitializeAttributes(); - InitializeActions(); } public CharacterType(string name, RoleType role) { diff --git a/src/features/Character/CharacterType.cs.uid b/src/models/data/Character/CharacterType.cs.uid similarity index 100% rename from src/features/Character/CharacterType.cs.uid rename to src/models/data/Character/CharacterType.cs.uid diff --git a/src/features/Character/ICharacter.cs b/src/models/data/Character/ICharacter.cs similarity index 100% rename from src/features/Character/ICharacter.cs rename to src/models/data/Character/ICharacter.cs diff --git a/src/features/Character/ICharacter.cs.uid b/src/models/data/Character/ICharacter.cs.uid similarity index 100% rename from src/features/Character/ICharacter.cs.uid rename to src/models/data/Character/ICharacter.cs.uid diff --git a/src/features/Character/ICharacterActionSheet.cs b/src/models/data/Character/ICharacterActionSheet.cs similarity index 100% rename from src/features/Character/ICharacterActionSheet.cs rename to src/models/data/Character/ICharacterActionSheet.cs diff --git a/src/features/Character/ICharacterActionSheet.cs.uid b/src/models/data/Character/ICharacterActionSheet.cs.uid similarity index 100% rename from src/features/Character/ICharacterActionSheet.cs.uid rename to src/models/data/Character/ICharacterActionSheet.cs.uid diff --git a/src/features/Character/ICharacterAssetSheet.cs b/src/models/data/Character/ICharacterAssetSheet.cs similarity index 100% rename from src/features/Character/ICharacterAssetSheet.cs rename to src/models/data/Character/ICharacterAssetSheet.cs diff --git a/src/features/Character/ICharacterAssetSheet.cs.uid b/src/models/data/Character/ICharacterAssetSheet.cs.uid similarity index 100% rename from src/features/Character/ICharacterAssetSheet.cs.uid rename to src/models/data/Character/ICharacterAssetSheet.cs.uid diff --git a/src/features/Character/ICharacterAttributeSheet.cs b/src/models/data/Character/ICharacterAttributeSheet.cs similarity index 100% rename from src/features/Character/ICharacterAttributeSheet.cs rename to src/models/data/Character/ICharacterAttributeSheet.cs diff --git a/src/features/Character/ICharacterAttributeSheet.cs.uid b/src/models/data/Character/ICharacterAttributeSheet.cs.uid similarity index 100% rename from src/features/Character/ICharacterAttributeSheet.cs.uid rename to src/models/data/Character/ICharacterAttributeSheet.cs.uid diff --git a/src/features/Character/ICharacterInformationSheet.cs b/src/models/data/Character/ICharacterInformationSheet.cs similarity index 100% rename from src/features/Character/ICharacterInformationSheet.cs rename to src/models/data/Character/ICharacterInformationSheet.cs diff --git a/src/features/Character/ICharacterInformationSheet.cs.uid b/src/models/data/Character/ICharacterInformationSheet.cs.uid similarity index 100% rename from src/features/Character/ICharacterInformationSheet.cs.uid rename to src/models/data/Character/ICharacterInformationSheet.cs.uid diff --git a/src/features/Character/ICharacterPlacementSheet.cs b/src/models/data/Character/ICharacterPlacementSheet.cs similarity index 100% rename from src/features/Character/ICharacterPlacementSheet.cs rename to src/models/data/Character/ICharacterPlacementSheet.cs diff --git a/src/features/Character/ICharacterPlacementSheet.cs.uid b/src/models/data/Character/ICharacterPlacementSheet.cs.uid similarity index 100% rename from src/features/Character/ICharacterPlacementSheet.cs.uid rename to src/models/data/Character/ICharacterPlacementSheet.cs.uid diff --git a/src/features/Character/ICharacterRoleSheet.cs.uid b/src/models/data/Character/ICharacterRoleSheet.cs.uid similarity index 100% rename from src/features/Character/ICharacterRoleSheet.cs.uid rename to src/models/data/Character/ICharacterRoleSheet.cs.uid diff --git a/src/features/Dice/DiceEnergy.cs b/src/models/data/Dice/DiceEnergy.cs similarity index 100% rename from src/features/Dice/DiceEnergy.cs rename to src/models/data/Dice/DiceEnergy.cs diff --git a/src/features/Dice/DiceEnergy.cs.uid b/src/models/data/Dice/DiceEnergy.cs.uid similarity index 100% rename from src/features/Dice/DiceEnergy.cs.uid rename to src/models/data/Dice/DiceEnergy.cs.uid diff --git a/src/features/Dice/DiceEnergyStore.uid b/src/models/data/Dice/DiceEnergyStore.uid similarity index 100% rename from src/features/Dice/DiceEnergyStore.uid rename to src/models/data/Dice/DiceEnergyStore.uid diff --git a/src/features/Dice/DiceFactory.cs b/src/models/data/Dice/DiceFactory.cs similarity index 100% rename from src/features/Dice/DiceFactory.cs rename to src/models/data/Dice/DiceFactory.cs diff --git a/src/features/Dice/DiceFactory.cs.uid b/src/models/data/Dice/DiceFactory.cs.uid similarity index 100% rename from src/features/Dice/DiceFactory.cs.uid rename to src/models/data/Dice/DiceFactory.cs.uid diff --git a/src/features/Dice/DiceIcon.cs b/src/models/data/Dice/DiceIcon.cs similarity index 100% rename from src/features/Dice/DiceIcon.cs rename to src/models/data/Dice/DiceIcon.cs diff --git a/src/features/Dice/DiceIcon.cs.uid b/src/models/data/Dice/DiceIcon.cs.uid similarity index 100% rename from src/features/Dice/DiceIcon.cs.uid rename to src/models/data/Dice/DiceIcon.cs.uid diff --git a/src/features/Dice/DiceIconStore.uid b/src/models/data/Dice/DiceIconStore.uid similarity index 100% rename from src/features/Dice/DiceIconStore.uid rename to src/models/data/Dice/DiceIconStore.uid diff --git a/src/features/Dice/DiceLocation.cs b/src/models/data/Dice/DiceLocation.cs similarity index 100% rename from src/features/Dice/DiceLocation.cs rename to src/models/data/Dice/DiceLocation.cs diff --git a/src/features/Dice/DiceLocation.cs.uid b/src/models/data/Dice/DiceLocation.cs.uid similarity index 100% rename from src/features/Dice/DiceLocation.cs.uid rename to src/models/data/Dice/DiceLocation.cs.uid diff --git a/src/features/Dice/DiceLocationCategory.cs b/src/models/data/Dice/DiceLocationCategory.cs similarity index 100% rename from src/features/Dice/DiceLocationCategory.cs rename to src/models/data/Dice/DiceLocationCategory.cs diff --git a/src/features/Dice/DiceLocationCategory.cs.uid b/src/models/data/Dice/DiceLocationCategory.cs.uid similarity index 100% rename from src/features/Dice/DiceLocationCategory.cs.uid rename to src/models/data/Dice/DiceLocationCategory.cs.uid diff --git a/src/features/Dice/DiceSide.cs b/src/models/data/Dice/DiceSide.cs similarity index 100% rename from src/features/Dice/DiceSide.cs rename to src/models/data/Dice/DiceSide.cs diff --git a/src/features/Dice/DiceSide.cs.uid b/src/models/data/Dice/DiceSide.cs.uid similarity index 100% rename from src/features/Dice/DiceSide.cs.uid rename to src/models/data/Dice/DiceSide.cs.uid diff --git a/src/features/Dice/DiceType.cs b/src/models/data/Dice/DiceType.cs similarity index 100% rename from src/features/Dice/DiceType.cs rename to src/models/data/Dice/DiceType.cs diff --git a/src/features/Dice/DiceType.cs.uid b/src/models/data/Dice/DiceType.cs.uid similarity index 100% rename from src/features/Dice/DiceType.cs.uid rename to src/models/data/Dice/DiceType.cs.uid diff --git a/src/features/Dice/IDice.cs b/src/models/data/Dice/IDice.cs similarity index 100% rename from src/features/Dice/IDice.cs rename to src/models/data/Dice/IDice.cs diff --git a/src/features/Dice/IDice.cs.uid b/src/models/data/Dice/IDice.cs.uid similarity index 100% rename from src/features/Dice/IDice.cs.uid rename to src/models/data/Dice/IDice.cs.uid diff --git a/src/features/Dice/IDiceEnergy.cs b/src/models/data/Dice/IDiceEnergy.cs similarity index 100% rename from src/features/Dice/IDiceEnergy.cs rename to src/models/data/Dice/IDiceEnergy.cs diff --git a/src/features/Dice/IDiceEnergy.cs.uid b/src/models/data/Dice/IDiceEnergy.cs.uid similarity index 100% rename from src/features/Dice/IDiceEnergy.cs.uid rename to src/models/data/Dice/IDiceEnergy.cs.uid diff --git a/src/features/Dice/IDiceLocation.cs b/src/models/data/Dice/IDiceLocation.cs similarity index 100% rename from src/features/Dice/IDiceLocation.cs rename to src/models/data/Dice/IDiceLocation.cs diff --git a/src/features/Dice/IDiceLocation.cs.uid b/src/models/data/Dice/IDiceLocation.cs.uid similarity index 100% rename from src/features/Dice/IDiceLocation.cs.uid rename to src/models/data/Dice/IDiceLocation.cs.uid diff --git a/src/features/Dungeon/DungeonManager.cs b/src/models/data/Dungeon/DungeonManager.cs similarity index 100% rename from src/features/Dungeon/DungeonManager.cs rename to src/models/data/Dungeon/DungeonManager.cs diff --git a/src/features/Dungeon/DungeonManager.cs.uid b/src/models/data/Dungeon/DungeonManager.cs.uid similarity index 100% rename from src/features/Dungeon/DungeonManager.cs.uid rename to src/models/data/Dungeon/DungeonManager.cs.uid diff --git a/src/features/Effect/DamageEffect.cs b/src/models/data/Effect/DamageEffect.cs similarity index 100% rename from src/features/Effect/DamageEffect.cs rename to src/models/data/Effect/DamageEffect.cs diff --git a/src/features/Effect/DamageEffect.cs.uid b/src/models/data/Effect/DamageEffect.cs.uid similarity index 100% rename from src/features/Effect/DamageEffect.cs.uid rename to src/models/data/Effect/DamageEffect.cs.uid diff --git a/src/features/Effect/EffectType.cs b/src/models/data/Effect/EffectType.cs similarity index 100% rename from src/features/Effect/EffectType.cs rename to src/models/data/Effect/EffectType.cs diff --git a/src/features/Effect/EffectType.cs.uid b/src/models/data/Effect/EffectType.cs.uid similarity index 100% rename from src/features/Effect/EffectType.cs.uid rename to src/models/data/Effect/EffectType.cs.uid diff --git a/src/features/Effect/IEffect.cs b/src/models/data/Effect/IEffect.cs similarity index 100% rename from src/features/Effect/IEffect.cs rename to src/models/data/Effect/IEffect.cs diff --git a/src/features/Effect/IEffect.cs.uid b/src/models/data/Effect/IEffect.cs.uid similarity index 100% rename from src/features/Effect/IEffect.cs.uid rename to src/models/data/Effect/IEffect.cs.uid diff --git a/src/features/Grid/GridDirection.cs b/src/models/data/Grid/GridDirection.cs similarity index 100% rename from src/features/Grid/GridDirection.cs rename to src/models/data/Grid/GridDirection.cs diff --git a/src/features/Grid/GridDirection.cs.uid b/src/models/data/Grid/GridDirection.cs.uid similarity index 100% rename from src/features/Grid/GridDirection.cs.uid rename to src/models/data/Grid/GridDirection.cs.uid diff --git a/src/features/Grid/GridType.cs b/src/models/data/Grid/GridType.cs similarity index 100% rename from src/features/Grid/GridType.cs rename to src/models/data/Grid/GridType.cs diff --git a/src/features/Grid/GridType.cs.uid b/src/models/data/Grid/GridType.cs.uid similarity index 100% rename from src/features/Grid/GridType.cs.uid rename to src/models/data/Grid/GridType.cs.uid diff --git a/src/features/Grid/IGrid.cs b/src/models/data/Grid/IGrid.cs similarity index 100% rename from src/features/Grid/IGrid.cs rename to src/models/data/Grid/IGrid.cs diff --git a/src/features/Grid/IGrid.cs.uid b/src/models/data/Grid/IGrid.cs.uid similarity index 100% rename from src/features/Grid/IGrid.cs.uid rename to src/models/data/Grid/IGrid.cs.uid diff --git a/src/features/Grid/IGridCells.cs b/src/models/data/Grid/IGridCells.cs similarity index 100% rename from src/features/Grid/IGridCells.cs rename to src/models/data/Grid/IGridCells.cs diff --git a/src/features/Grid/IGridCells.cs.uid b/src/models/data/Grid/IGridCells.cs.uid similarity index 100% rename from src/features/Grid/IGridCells.cs.uid rename to src/models/data/Grid/IGridCells.cs.uid diff --git a/src/features/Grid/IGridConfiguration.cs b/src/models/data/Grid/IGridConfiguration.cs similarity index 100% rename from src/features/Grid/IGridConfiguration.cs rename to src/models/data/Grid/IGridConfiguration.cs diff --git a/src/features/Grid/IGridConfiguration.cs.uid b/src/models/data/Grid/IGridConfiguration.cs.uid similarity index 100% rename from src/features/Grid/IGridConfiguration.cs.uid rename to src/models/data/Grid/IGridConfiguration.cs.uid diff --git a/src/features/Common/Id/IIdentifiable.cs b/src/models/data/Id/IIdentifiable.cs similarity index 100% rename from src/features/Common/Id/IIdentifiable.cs rename to src/models/data/Id/IIdentifiable.cs diff --git a/src/features/Common/Id/IIdentifiable.cs.uid b/src/models/data/Id/IIdentifiable.cs.uid similarity index 100% rename from src/features/Common/Id/IIdentifiable.cs.uid rename to src/models/data/Id/IIdentifiable.cs.uid diff --git a/src/features/Common/Id/IdentifiableResource.cs b/src/models/data/Id/IdentifiableResource.cs similarity index 100% rename from src/features/Common/Id/IdentifiableResource.cs rename to src/models/data/Id/IdentifiableResource.cs diff --git a/src/features/Common/Id/IdentifiableResource.cs.uid b/src/models/data/Id/IdentifiableResource.cs.uid similarity index 100% rename from src/features/Common/Id/IdentifiableResource.cs.uid rename to src/models/data/Id/IdentifiableResource.cs.uid diff --git a/src/features/Location/ILocation.cs b/src/models/data/Location/ILocation.cs similarity index 100% rename from src/features/Location/ILocation.cs rename to src/models/data/Location/ILocation.cs diff --git a/src/features/Location/ILocation.cs.uid b/src/models/data/Location/ILocation.cs.uid similarity index 100% rename from src/features/Location/ILocation.cs.uid rename to src/models/data/Location/ILocation.cs.uid diff --git a/src/features/Location/LocationType.cs b/src/models/data/Location/LocationType.cs similarity index 100% rename from src/features/Location/LocationType.cs rename to src/models/data/Location/LocationType.cs diff --git a/src/features/Location/LocationType.cs.uid b/src/models/data/Location/LocationType.cs.uid similarity index 100% rename from src/features/Location/LocationType.cs.uid rename to src/models/data/Location/LocationType.cs.uid diff --git a/src/features/Common/Logs/GameLogLine.cs b/src/models/data/Logs/GameLogLine.cs similarity index 100% rename from src/features/Common/Logs/GameLogLine.cs rename to src/models/data/Logs/GameLogLine.cs diff --git a/src/features/Common/Logs/GameLogLine.cs.uid b/src/models/data/Logs/GameLogLine.cs.uid similarity index 100% rename from src/features/Common/Logs/GameLogLine.cs.uid rename to src/models/data/Logs/GameLogLine.cs.uid diff --git a/src/features/Common/Logs/GameLogMessage.cs b/src/models/data/Logs/GameLogMessage.cs similarity index 100% rename from src/features/Common/Logs/GameLogMessage.cs rename to src/models/data/Logs/GameLogMessage.cs diff --git a/src/features/Common/Logs/GameLogMessage.cs.uid b/src/models/data/Logs/GameLogMessage.cs.uid similarity index 100% rename from src/features/Common/Logs/GameLogMessage.cs.uid rename to src/models/data/Logs/GameLogMessage.cs.uid diff --git a/src/features/Role/IRole.cs b/src/models/data/Role/IRole.cs similarity index 100% rename from src/features/Role/IRole.cs rename to src/models/data/Role/IRole.cs diff --git a/src/features/Role/IRole.cs.uid b/src/models/data/Role/IRole.cs.uid similarity index 100% rename from src/features/Role/IRole.cs.uid rename to src/models/data/Role/IRole.cs.uid diff --git a/src/features/Role/IRoleActions.cs b/src/models/data/Role/IRoleActions.cs similarity index 100% rename from src/features/Role/IRoleActions.cs rename to src/models/data/Role/IRoleActions.cs diff --git a/src/features/Role/IRoleActions.cs.uid b/src/models/data/Role/IRoleActions.cs.uid similarity index 100% rename from src/features/Role/IRoleActions.cs.uid rename to src/models/data/Role/IRoleActions.cs.uid diff --git a/src/features/Role/IRoleAttributes.cs b/src/models/data/Role/IRoleAttributes.cs similarity index 100% rename from src/features/Role/IRoleAttributes.cs rename to src/models/data/Role/IRoleAttributes.cs diff --git a/src/features/Role/IRoleAttributes.cs.uid b/src/models/data/Role/IRoleAttributes.cs.uid similarity index 100% rename from src/features/Role/IRoleAttributes.cs.uid rename to src/models/data/Role/IRoleAttributes.cs.uid diff --git a/src/features/Role/IRoleInformation.cs b/src/models/data/Role/IRoleInformation.cs similarity index 100% rename from src/features/Role/IRoleInformation.cs rename to src/models/data/Role/IRoleInformation.cs diff --git a/src/features/Role/IRoleInformation.cs.uid b/src/models/data/Role/IRoleInformation.cs.uid similarity index 100% rename from src/features/Role/IRoleInformation.cs.uid rename to src/models/data/Role/IRoleInformation.cs.uid diff --git a/src/features/Role/RoleAction.cs b/src/models/data/Role/RoleAction.cs similarity index 100% rename from src/features/Role/RoleAction.cs rename to src/models/data/Role/RoleAction.cs diff --git a/src/features/Role/RoleAction.cs.uid b/src/models/data/Role/RoleAction.cs.uid similarity index 100% rename from src/features/Role/RoleAction.cs.uid rename to src/models/data/Role/RoleAction.cs.uid diff --git a/src/features/Role/RoleAttribute.cs b/src/models/data/Role/RoleAttribute.cs similarity index 100% rename from src/features/Role/RoleAttribute.cs rename to src/models/data/Role/RoleAttribute.cs diff --git a/src/features/Role/RoleAttribute.cs.uid b/src/models/data/Role/RoleAttribute.cs.uid similarity index 100% rename from src/features/Role/RoleAttribute.cs.uid rename to src/models/data/Role/RoleAttribute.cs.uid diff --git a/src/features/Role/RoleType.cs b/src/models/data/Role/RoleType.cs similarity index 100% rename from src/features/Role/RoleType.cs rename to src/models/data/Role/RoleType.cs diff --git a/src/features/Role/RoleType.cs.uid b/src/models/data/Role/RoleType.cs.uid similarity index 100% rename from src/features/Role/RoleType.cs.uid rename to src/models/data/Role/RoleType.cs.uid diff --git a/src/features/Target/ITargetBoard.cs b/src/models/data/Target/ITargetBoard.cs similarity index 100% rename from src/features/Target/ITargetBoard.cs rename to src/models/data/Target/ITargetBoard.cs diff --git a/src/features/Target/ITargetBoard.cs.uid b/src/models/data/Target/ITargetBoard.cs.uid similarity index 100% rename from src/features/Target/ITargetBoard.cs.uid rename to src/models/data/Target/ITargetBoard.cs.uid diff --git a/src/features/Target/TargetBoardType.cs b/src/models/data/Target/TargetBoardType.cs similarity index 100% rename from src/features/Target/TargetBoardType.cs rename to src/models/data/Target/TargetBoardType.cs diff --git a/src/features/Target/TargetBoardType.cs.uid b/src/models/data/Target/TargetBoardType.cs.uid similarity index 100% rename from src/features/Target/TargetBoardType.cs.uid rename to src/models/data/Target/TargetBoardType.cs.uid diff --git a/src/features/Character/CharacterService.cs b/src/models/services/CharacterService.cs similarity index 100% rename from src/features/Character/CharacterService.cs rename to src/models/services/CharacterService.cs diff --git a/src/features/Character/CharacterService.cs.uid b/src/models/services/CharacterService.cs.uid similarity index 100% rename from src/features/Character/CharacterService.cs.uid rename to src/models/services/CharacterService.cs.uid diff --git a/src/features/Effect/EffectService.cs b/src/models/services/EffectService.cs similarity index 100% rename from src/features/Effect/EffectService.cs rename to src/models/services/EffectService.cs diff --git a/src/features/Effect/EffectService.cs.uid b/src/models/services/EffectService.cs.uid similarity index 100% rename from src/features/Effect/EffectService.cs.uid rename to src/models/services/EffectService.cs.uid diff --git a/src/features/Grid/GridService.cs b/src/models/services/GridService.cs similarity index 100% rename from src/features/Grid/GridService.cs rename to src/models/services/GridService.cs diff --git a/src/features/Grid/GridService.cs.uid b/src/models/services/GridService.cs.uid similarity index 100% rename from src/features/Grid/GridService.cs.uid rename to src/models/services/GridService.cs.uid diff --git a/src/features/Common/Id/IdService.cs b/src/models/services/IdService.cs similarity index 100% rename from src/features/Common/Id/IdService.cs rename to src/models/services/IdService.cs diff --git a/src/features/Common/Id/IdService.cs.uid b/src/models/services/IdService.cs.uid similarity index 100% rename from src/features/Common/Id/IdService.cs.uid rename to src/models/services/IdService.cs.uid diff --git a/src/features/Target/TargetBoardService.cs b/src/models/services/TargetBoardService.cs similarity index 100% rename from src/features/Target/TargetBoardService.cs rename to src/models/services/TargetBoardService.cs diff --git a/src/features/Target/TargetBoardService.cs.uid b/src/models/services/TargetBoardService.cs.uid similarity index 100% rename from src/features/Target/TargetBoardService.cs.uid rename to src/models/services/TargetBoardService.cs.uid diff --git a/src/features/Common/ValidationService.cs b/src/models/services/ValidationService.cs similarity index 100% rename from src/features/Common/ValidationService.cs rename to src/models/services/ValidationService.cs diff --git a/src/features/Common/ValidationService.cs.uid b/src/models/services/ValidationService.cs.uid similarity index 100% rename from src/features/Common/ValidationService.cs.uid rename to src/models/services/ValidationService.cs.uid diff --git a/src/features/Attribute/AttributesStore.cs b/src/models/stores/AttributesStore.cs similarity index 100% rename from src/features/Attribute/AttributesStore.cs rename to src/models/stores/AttributesStore.cs diff --git a/src/features/Attribute/AttributesStore.cs.uid b/src/models/stores/AttributesStore.cs.uid similarity index 100% rename from src/features/Attribute/AttributesStore.cs.uid rename to src/models/stores/AttributesStore.cs.uid diff --git a/src/features/Character/CharacterStore.cs b/src/models/stores/CharacterStore.cs similarity index 100% rename from src/features/Character/CharacterStore.cs rename to src/models/stores/CharacterStore.cs diff --git a/src/features/Character/CharacterStore.cs.uid b/src/models/stores/CharacterStore.cs.uid similarity index 100% rename from src/features/Character/CharacterStore.cs.uid rename to src/models/stores/CharacterStore.cs.uid diff --git a/src/features/Dice/DiceEnergyStore.cs b/src/models/stores/DiceEnergyStore.cs similarity index 100% rename from src/features/Dice/DiceEnergyStore.cs rename to src/models/stores/DiceEnergyStore.cs diff --git a/src/features/Dice/DiceEnergyStore.cs.uid b/src/models/stores/DiceEnergyStore.cs.uid similarity index 100% rename from src/features/Dice/DiceEnergyStore.cs.uid rename to src/models/stores/DiceEnergyStore.cs.uid diff --git a/src/features/Dice/DiceIconStore.cs b/src/models/stores/DiceIconStore.cs similarity index 100% rename from src/features/Dice/DiceIconStore.cs rename to src/models/stores/DiceIconStore.cs diff --git a/src/features/Dice/DiceIconStore.cs.uid b/src/models/stores/DiceIconStore.cs.uid similarity index 100% rename from src/features/Dice/DiceIconStore.cs.uid rename to src/models/stores/DiceIconStore.cs.uid diff --git a/src/features/Dice/DiceStore.cs b/src/models/stores/DiceStore.cs similarity index 100% rename from src/features/Dice/DiceStore.cs rename to src/models/stores/DiceStore.cs diff --git a/src/features/Dice/DiceStore.cs.uid b/src/models/stores/DiceStore.cs.uid similarity index 100% rename from src/features/Dice/DiceStore.cs.uid rename to src/models/stores/DiceStore.cs.uid diff --git a/src/features/Common/Logs/GameLogStore.cs b/src/models/stores/GameLogStore.cs similarity index 100% rename from src/features/Common/Logs/GameLogStore.cs rename to src/models/stores/GameLogStore.cs diff --git a/src/features/Common/Logs/GameLogStore.cs.uid b/src/models/stores/GameLogStore.cs.uid similarity index 100% rename from src/features/Common/Logs/GameLogStore.cs.uid rename to src/models/stores/GameLogStore.cs.uid diff --git a/src/project.godot b/src/project.godot index cefc3e86..97545f67 100644 --- a/src/project.godot +++ b/src/project.godot @@ -11,16 +11,16 @@ config_version=5 [application] config/name="dice-rolling" -run/main_scene="res://scenes/menus/MainMenu.tscn" +run/main_scene="res://views/scenes/menus/MainMenu.tscn" config/features=PackedStringArray("4.4", "C#", "Forward Plus") config/icon="uid://bmcfxb2srpt1o" [autoload] -GameplayTransitionManager="*res://scenes/GameplayTransitionManager.tscn" -MenuTransitionManager="*res://scenes/MenuTransitionManager.tscn" -DiceStore="*res://features/Dice/DiceStore.cs" -GameLogStore="*res://features/Common/Logs/GameLogStore.cs" +GameplayTransitionManager="*res://views/scenes/GameplayTransitionManager.tscn" +MenuTransitionManager="*res://views/scenes/MenuTransitionManager.tscn" +DiceStore="*res://models/stores/DiceStore.cs" +GameLogStore="*res://models/stores/GameLogStore.cs" Shaker="*res://addons/shaker/src/Shaker.gd" [collada] @@ -57,14 +57,14 @@ folder_colors={ "res://addons/": "red", "res://addons/@spacewiz/": "teal", "res://assets/": "purple", -"res://components/": "orange", -"res://features/": "blue", -"res://features/Common/": "green", -"res://features/Scenes/": "green", +"res://controllers/": "yellow", +"res://events/": "green", "res://helpers/": "gray", +"res://models/": "blue", "res://resources/": "pink", -"res://scenes/": "orange", -"res://tests/": "red" +"res://tests/": "gray", +"res://views/": "orange", +"res://views/scenes/": "orange" } [gdunit4] diff --git a/src/resources/Actions/ArcaneStrike.tres b/src/resources/Actions/ArcaneStrike.tres index 2b04a509..da9cebb4 100644 --- a/src/resources/Actions/ArcaneStrike.tres +++ b/src/resources/Actions/ArcaneStrike.tres @@ -1,8 +1,8 @@ [gd_resource type="Resource" script_class="ActionType" load_steps=4 format=3 uid="uid://c8xr12tkory0k"] -[ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://features/Effect/EffectType.cs" id="1_ce1no"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="2_3fo7f"] -[ext_resource type="Script" uid="uid://dk6es2dobyja5" path="res://features/Action/ActionType.cs" id="7_wv8if"] +[ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://models/data/Effect/EffectType.cs" id="1_ce1no"] +[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://models/data/Dice/DiceEnergy.cs" id="2_3fo7f"] +[ext_resource type="Script" uid="uid://dk6es2dobyja5" path="res://models/data/Action/ActionType.cs" id="7_wv8if"] [resource] script = ExtResource("7_wv8if") @@ -11,4 +11,4 @@ Description = "" RequiredEnergy = Array[ExtResource("2_3fo7f")]([]) Effects = Array[ExtResource("1_ce1no")]([]) Id = "75ab151b-3832-4391-ab5b-77341639ec0e" -metadata/_custom_type_script = ExtResource("7_wv8if") +metadata/_custom_type_script = "uid://dk6es2dobyja5" diff --git a/src/resources/Actions/Categories/Buff.tres b/src/resources/Actions/Categories/Buff.tres index b4819fdf..18b69bf0 100644 --- a/src/resources/Actions/Categories/Buff.tres +++ b/src/resources/Actions/Categories/Buff.tres @@ -1,16 +1,12 @@ -[gd_resource type="Resource" script_class="Category" load_steps=5 format=3 uid="uid://ct48lgxn53fl"] +[gd_resource type="Resource" script_class="Category" load_steps=3 format=3 uid="uid://ct48lgxn53fl"] -[ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://features/Effect/EffectType.cs" id="1_ot3a2"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="2_vo1sd"] [ext_resource type="Texture2D" uid="uid://dkkmepxg2rx6r" path="res://assets/icons/actionCategories/buff.png" id="3_t8l7o"] -[ext_resource type="Script" uid="uid://c2h1r5hcgno4f" path="res://features/Action/Category.cs" id="4_buxmq"] +[ext_resource type="Script" uid="uid://c6oq153u13fh4" path="res://models/data/Category/Category.cs" id="4_buxmq"] [resource] script = ExtResource("4_buxmq") Name = "Buff" Description = "Debuff type description." Icon = ExtResource("3_t8l7o") -DefaultRequiredEnergy = Array[ExtResource("2_vo1sd")]([]) -DefaultEffects = Array[ExtResource("1_ot3a2")]([]) Id = "a69e85c7-6674-491e-981e-38a5cf596712" -metadata/_custom_type_script = ExtResource("4_buxmq") +metadata/_custom_type_script = "uid://c6oq153u13fh4" diff --git a/src/resources/Actions/Categories/Debuff.tres b/src/resources/Actions/Categories/Debuff.tres index 72245c5d..3fbbd0f9 100644 --- a/src/resources/Actions/Categories/Debuff.tres +++ b/src/resources/Actions/Categories/Debuff.tres @@ -1,16 +1,12 @@ -[gd_resource type="Resource" script_class="Category" load_steps=5 format=3 uid="uid://bt78ea1fdbgvx"] +[gd_resource type="Resource" script_class="Category" load_steps=3 format=3 uid="uid://bt78ea1fdbgvx"] -[ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://features/Effect/EffectType.cs" id="1_k4dnn"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="2_tpp1d"] [ext_resource type="Texture2D" uid="uid://b1fr2n747j0en" path="res://assets/icons/actionCategories/debuff.png" id="3_6xfdx"] -[ext_resource type="Script" uid="uid://c2h1r5hcgno4f" path="res://features/Action/Category.cs" id="4_8uy6x"] +[ext_resource type="Script" uid="uid://c6oq153u13fh4" path="res://models/data/Category/Category.cs" id="4_8uy6x"] [resource] script = ExtResource("4_8uy6x") Name = "Debuff" Description = "Debuff type description." Icon = ExtResource("3_6xfdx") -DefaultRequiredEnergy = Array[ExtResource("2_tpp1d")]([]) -DefaultEffects = Array[ExtResource("1_k4dnn")]([]) Id = "7a79664d-5d55-4a82-af70-19ba79f14406" -metadata/_custom_type_script = ExtResource("4_8uy6x") +metadata/_custom_type_script = "uid://c6oq153u13fh4" diff --git a/src/resources/Actions/Categories/Defensive.tres b/src/resources/Actions/Categories/Defensive.tres index c20a9d24..0cb1c434 100644 --- a/src/resources/Actions/Categories/Defensive.tres +++ b/src/resources/Actions/Categories/Defensive.tres @@ -1,16 +1,12 @@ -[gd_resource type="Resource" script_class="Category" load_steps=5 format=3 uid="uid://dw1d38425v5rd"] +[gd_resource type="Resource" script_class="Category" load_steps=3 format=3 uid="uid://dw1d38425v5rd"] -[ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://features/Effect/EffectType.cs" id="1_0o8ps"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="2_2jw4p"] [ext_resource type="Texture2D" uid="uid://mh3kl4xhl0nb" path="res://assets/icons/actionCategories/defend.png" id="3_v8mxv"] -[ext_resource type="Script" uid="uid://c2h1r5hcgno4f" path="res://features/Action/Category.cs" id="4_01jea"] +[ext_resource type="Script" uid="uid://c6oq153u13fh4" path="res://models/data/Category/Category.cs" id="4_01jea"] [resource] script = ExtResource("4_01jea") Name = "Defensive" Description = "Defensive category description." Icon = ExtResource("3_v8mxv") -DefaultRequiredEnergy = Array[ExtResource("2_2jw4p")]([]) -DefaultEffects = Array[ExtResource("1_0o8ps")]([]) Id = "506b8289-31a1-4e78-9b4d-7ed5efd2c8d2" -metadata/_custom_type_script = ExtResource("4_01jea") +metadata/_custom_type_script = "uid://c6oq153u13fh4" diff --git a/src/resources/Actions/Categories/Offensive.tres b/src/resources/Actions/Categories/Offensive.tres deleted file mode 100644 index 0b0dbb3f..00000000 --- a/src/resources/Actions/Categories/Offensive.tres +++ /dev/null @@ -1,16 +0,0 @@ -[gd_resource type="Resource" script_class="Category" load_steps=5 format=3 uid="uid://dwtue01tv131s"] - -[ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://features/Effect/EffectType.cs" id="1_e6ljw"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="2_300jt"] -[ext_resource type="Texture2D" uid="uid://drputnuj4p8ds" path="res://assets/icons/actionCategories/attack.png" id="3_42rmu"] -[ext_resource type="Script" uid="uid://c2h1r5hcgno4f" path="res://features/Action/Category.cs" id="4_vltcb"] - -[resource] -script = ExtResource("4_vltcb") -Name = "Offensive" -Description = "Offensive category description." -Icon = ExtResource("3_42rmu") -DefaultRequiredEnergy = Array[ExtResource("2_300jt")]([]) -DefaultEffects = Array[ExtResource("1_e6ljw")]([]) -Id = "150c7969-ce0b-4ddb-a048-5f15939f225a" -metadata/_custom_type_script = ExtResource("4_vltcb") diff --git a/src/resources/Actions/CleaveAttack.tres b/src/resources/Actions/CleaveAttack.tres index 1df00419..76e0fc5a 100644 --- a/src/resources/Actions/CleaveAttack.tres +++ b/src/resources/Actions/CleaveAttack.tres @@ -1,20 +1,18 @@ -[gd_resource type="Resource" script_class="ActionType" load_steps=8 format=3 uid="uid://cly4t230cu6ii"] +[gd_resource type="Resource" script_class="ActionType" load_steps=7 format=3 uid="uid://cly4t230cu6ii"] -[ext_resource type="Resource" uid="uid://dwtue01tv131s" path="res://resources/Actions/Categories/Offensive.tres" id="1_8m2td"] -[ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://features/Effect/EffectType.cs" id="2_s1o36"] +[ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://models/data/Effect/EffectType.cs" id="2_s1o36"] [ext_resource type="Resource" uid="uid://b43duhk6atdos" path="res://resources/Effects/DamageEffect.tres" id="3_wmqqs"] [ext_resource type="Texture2D" uid="uid://fmaq315605ce" path="res://assets/icons/actions/wide_cleave.png" id="4_s1o36"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="5_yp8id"] +[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://models/data/Dice/DiceEnergy.cs" id="5_yp8id"] [ext_resource type="Resource" uid="uid://qxd24e6b177u" path="res://resources/Dice/Mana/ManaRed.tres" id="6_vbjrv"] -[ext_resource type="Script" uid="uid://dk6es2dobyja5" path="res://features/Action/ActionType.cs" id="8_0ol17"] +[ext_resource type="Script" uid="uid://dk6es2dobyja5" path="res://models/data/Action/ActionType.cs" id="8_0ol17"] [resource] script = ExtResource("8_0ol17") Name = "Cleave Attack" -Category = ExtResource("1_8m2td") Description = "Cleave Attack description." Icon = ExtResource("4_s1o36") RequiredEnergy = Array[ExtResource("5_yp8id")]([ExtResource("6_vbjrv")]) Effects = Array[ExtResource("2_s1o36")]([ExtResource("3_wmqqs")]) Id = "1575f70b-f7b7-44e6-959c-3e0d347517a2" -metadata/_custom_type_script = ExtResource("8_0ol17") +metadata/_custom_type_script = "uid://dk6es2dobyja5" diff --git a/src/resources/Actions/MagicMissiles.tres b/src/resources/Actions/MagicMissiles.tres index 7ed4c02c..79746748 100644 --- a/src/resources/Actions/MagicMissiles.tres +++ b/src/resources/Actions/MagicMissiles.tres @@ -1,11 +1,11 @@ [gd_resource type="Resource" script_class="ActionType" load_steps=10 format=3 uid="uid://cvojckruuqrn6"] -[ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://features/Effect/EffectType.cs" id="2_s3uan"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="4_s3uan"] +[ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://models/data/Effect/EffectType.cs" id="1_evn5j"] +[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://models/data/Dice/DiceEnergy.cs" id="3_7glge"] [ext_resource type="Texture2D" uid="uid://bemp486qms5lb" path="res://assets/icons/actions/magic_missiles.png" id="4_wo1pe"] -[ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://features/Grid/GridType.cs" id="5_bbx2m"] -[ext_resource type="Script" uid="uid://1fvttm4h5sf3" path="res://features/Target/TargetBoardType.cs" id="6_kaqn3"] -[ext_resource type="Script" uid="uid://dk6es2dobyja5" path="res://features/Action/ActionType.cs" id="7_gvq84"] +[ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://models/data/Grid/GridType.cs" id="5_bbx2m"] +[ext_resource type="Script" uid="uid://1fvttm4h5sf3" path="res://models/data/Target/TargetBoardType.cs" id="6_kaqn3"] +[ext_resource type="Script" uid="uid://dk6es2dobyja5" path="res://models/data/Action/ActionType.cs" id="7_gvq84"] [sub_resource type="Resource" id="Resource_7glge"] script = ExtResource("5_bbx2m") @@ -38,7 +38,7 @@ script = ExtResource("7_gvq84") Name = "Magic Missiles" Description = "Magic Missiles description." Icon = ExtResource("4_wo1pe") -RequiredEnergy = Array[ExtResource("4_s3uan")]([]) -Effects = Array[ExtResource("2_s3uan")]([]) +RequiredEnergy = Array[ExtResource("3_7glge")]([]) +Effects = Array[ExtResource("1_evn5j")]([]) TargetBoard = SubResource("Resource_bbx2m") Id = "1c94c7cf-b863-43f1-bb4b-ed141e35638b" diff --git a/src/resources/Actions/QuickSlash.tres b/src/resources/Actions/QuickSlash.tres index 1fc9e1c0..6ee296e8 100644 --- a/src/resources/Actions/QuickSlash.tres +++ b/src/resources/Actions/QuickSlash.tres @@ -1,10 +1,8 @@ -[gd_resource type="Resource" script_class="ActionType" load_steps=9 format=3 uid="uid://cs65w4r75ugap"] +[gd_resource type="Resource" load_steps=7 format=3 uid="uid://cs65w4r75ugap"] -[ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://features/Effect/EffectType.cs" id="1_i76yk"] -[ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://features/Grid/GridType.cs" id="2_i76yk"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="2_qhrue"] -[ext_resource type="Script" uid="uid://1fvttm4h5sf3" path="res://features/Target/TargetBoardType.cs" id="3_qhrue"] -[ext_resource type="Script" uid="uid://dk6es2dobyja5" path="res://features/Action/ActionType.cs" id="4_8ielr"] +[ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://models/data/Grid/GridType.cs" id="2_i76yk"] +[ext_resource type="Script" uid="uid://1fvttm4h5sf3" path="res://models/data/Target/TargetBoardType.cs" id="3_qhrue"] +[ext_resource type="Script" uid="uid://dk6es2dobyja5" path="res://models/data/Action/ActionType.cs" id="4_8ielr"] [sub_resource type="Resource" id="Resource_5ohu7"] script = ExtResource("2_i76yk") @@ -29,15 +27,15 @@ metadata/_custom_type_script = ExtResource("2_i76yk") [sub_resource type="Resource" id="Resource_0oh7q"] script = ExtResource("3_qhrue") IsSingleTarget = true -Grids = Array[ExtResource("2_i76yk")]([SubResource("Resource_5ohu7"), SubResource("Resource_ntci2")]) +Grids = [SubResource("Resource_5ohu7"), SubResource("Resource_ntci2")] metadata/_custom_type_script = ExtResource("3_qhrue") [resource] script = ExtResource("4_8ielr") Name = "Quick Slash" Description = "Quick slash description" -RequiredEnergy = Array[ExtResource("2_qhrue")]([]) -Effects = Array[ExtResource("1_i76yk")]([]) +RequiredEnergy = [] +Effects = [] TargetBoard = SubResource("Resource_0oh7q") Id = "1575f70b-f7b7-44e6-959c-3e0d347517a2" metadata/_custom_type_script = ExtResource("4_8ielr") diff --git a/src/resources/Actions/Stare.tres b/src/resources/Actions/Stare.tres index c129a1a0..d9b7df0e 100644 --- a/src/resources/Actions/Stare.tres +++ b/src/resources/Actions/Stare.tres @@ -1,12 +1,12 @@ [gd_resource type="Resource" script_class="ActionType" load_steps=11 format=3 uid="uid://cgac6lxa06rf8"] [ext_resource type="Resource" uid="uid://dw1d38425v5rd" path="res://resources/Actions/Categories/Defensive.tres" id="1_f256u"] -[ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://features/Effect/EffectType.cs" id="2_f256u"] +[ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://models/data/Effect/EffectType.cs" id="2_f256u"] [ext_resource type="Texture2D" uid="uid://b5tap0qunatiw" path="res://assets/icons/actions/stare.png" id="3_i6kiq"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="4_2x0xn"] -[ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://features/Grid/GridType.cs" id="4_f256u"] -[ext_resource type="Script" uid="uid://1fvttm4h5sf3" path="res://features/Target/TargetBoardType.cs" id="5_2x0xn"] -[ext_resource type="Script" uid="uid://dk6es2dobyja5" path="res://features/Action/ActionType.cs" id="6_i6kiq"] +[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://models/data/Dice/DiceEnergy.cs" id="4_2x0xn"] +[ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://models/data/Grid/GridType.cs" id="4_f256u"] +[ext_resource type="Script" uid="uid://1fvttm4h5sf3" path="res://models/data/Target/TargetBoardType.cs" id="5_2x0xn"] +[ext_resource type="Script" uid="uid://dk6es2dobyja5" path="res://models/data/Action/ActionType.cs" id="6_i6kiq"] [sub_resource type="Resource" id="Resource_8bxoq"] script = ExtResource("4_f256u") diff --git a/src/resources/Attributes/Armor.tres b/src/resources/Attributes/Armor.tres index c3c4fc56..c5e28c6e 100644 --- a/src/resources/Attributes/Armor.tres +++ b/src/resources/Attributes/Armor.tres @@ -1,6 +1,6 @@ -[gd_resource type="Resource" script_class="AttributeType" load_steps=2 format=3 uid="uid://d37vh6vtgnxkp"] +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://d37vh6vtgnxkp"] -[ext_resource type="Script" uid="uid://dv3nebxjhpuk0" path="res://features/Attribute/AttributeType.cs" id="1_73wod"] +[ext_resource type="Script" uid="uid://dv3nebxjhpuk0" path="res://models/data/Attribute/AttributeType.cs" id="1_73wod"] [resource] script = ExtResource("1_73wod") diff --git a/src/resources/Attributes/AttributesStore.tres b/src/resources/Attributes/AttributesStore.tres index 059759fc..96e93b08 100644 --- a/src/resources/Attributes/AttributesStore.tres +++ b/src/resources/Attributes/AttributesStore.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=6 format=3 uid="uid://b4niu7ewhuinj"] -[ext_resource type="Script" uid="uid://dv3nebxjhpuk0" path="res://features/Attribute/AttributeType.cs" id="1_42jcx"] -[ext_resource type="Script" uid="uid://bated1t84ka4j" path="res://features/Attribute/AttributesStore.cs" id="1_prhg5"] +[ext_resource type="Script" uid="uid://dv3nebxjhpuk0" path="res://models/data/Attribute/AttributeType.cs" id="1_42jcx"] +[ext_resource type="Script" uid="uid://bated1t84ka4j" path="res://models/stores/AttributesStore.cs" id="1_prhg5"] [ext_resource type="Resource" uid="uid://d37vh6vtgnxkp" path="res://resources/Attributes/Armor.tres" id="2_bqg3v"] [ext_resource type="Resource" uid="uid://c765rrtwoaq76" path="res://resources/Attributes/Health.tres" id="3_v4ucr"] [ext_resource type="Resource" uid="uid://blv7vekuqpawn" path="res://resources/Attributes/Speed.tres" id="4_6ixqo"] diff --git a/src/resources/Attributes/Health.tres b/src/resources/Attributes/Health.tres index a3b9fc3d..6e4cfb00 100644 --- a/src/resources/Attributes/Health.tres +++ b/src/resources/Attributes/Health.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="AttributeType" load_steps=2 format=3 uid="uid://c765rrtwoaq76"] -[ext_resource type="Script" uid="uid://dv3nebxjhpuk0" path="res://features/Attribute/AttributeType.cs" id="1_rmadn"] +[ext_resource type="Script" uid="uid://dv3nebxjhpuk0" path="res://models/data/Attribute/AttributeType.cs" id="1_rmadn"] [resource] script = ExtResource("1_rmadn") diff --git a/src/resources/Attributes/Speed.tres b/src/resources/Attributes/Speed.tres index c6be72a3..26f57ccc 100644 --- a/src/resources/Attributes/Speed.tres +++ b/src/resources/Attributes/Speed.tres @@ -1,6 +1,6 @@ -[gd_resource type="Resource" script_class="AttributeType" load_steps=2 format=3 uid="uid://blv7vekuqpawn"] +[gd_resource type="Resource" load_steps=2 format=3 uid="uid://blv7vekuqpawn"] -[ext_resource type="Script" uid="uid://dv3nebxjhpuk0" path="res://features/Attribute/AttributeType.cs" id="1_8nsa1"] +[ext_resource type="Script" uid="uid://dv3nebxjhpuk0" path="res://models/data/Attribute/AttributeType.cs" id="1_8nsa1"] [resource] script = ExtResource("1_8nsa1") diff --git a/src/resources/Characters/Categories/Ally.tres b/src/resources/Characters/Categories/Ally.tres index f1d550f1..ab65b9d4 100644 --- a/src/resources/Characters/Categories/Ally.tres +++ b/src/resources/Characters/Categories/Ally.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="Category" load_steps=2 format=3 uid="uid://t3w4bnrvi1i5"] -[ext_resource type="Script" uid="uid://bykcf8sd8a8hu" path="res://features/Character/Category.cs" id="1_5ua1s"] +[ext_resource type="Script" uid="uid://bykcf8sd8a8hu" path="res://models/data/Character/Category.cs" id="1_5ua1s"] [resource] script = ExtResource("1_5ua1s") diff --git a/src/resources/Characters/Categories/Enemy.tres b/src/resources/Characters/Categories/Enemy.tres index 6c8ed383..e6c61fe4 100644 --- a/src/resources/Characters/Categories/Enemy.tres +++ b/src/resources/Characters/Categories/Enemy.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="Category" load_steps=3 format=3 uid="uid://sfhb0dqjsixc"] -[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://features/Character/CharacterType.cs" id="1_jbtim"] -[ext_resource type="Script" uid="uid://bykcf8sd8a8hu" path="res://features/Character/Category.cs" id="2_8p5kw"] +[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://models/data/Character/CharacterType.cs" id="1_jbtim"] +[ext_resource type="Script" path="res://models/data/Character/Category.cs" id="2_8p5kw"] [resource] script = ExtResource("2_8p5kw") diff --git a/src/resources/Characters/Categories/Neutral.tres b/src/resources/Characters/Categories/Neutral.tres index 44e129ac..3608bab7 100644 --- a/src/resources/Characters/Categories/Neutral.tres +++ b/src/resources/Characters/Categories/Neutral.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="Category" load_steps=3 format=3 uid="uid://d0mpi6sabk5li"] -[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://features/Character/CharacterType.cs" id="1_aiurc"] -[ext_resource type="Script" uid="uid://bykcf8sd8a8hu" path="res://features/Character/Category.cs" id="2_pdbs6"] +[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://models/data/Character/CharacterType.cs" id="1_aiurc"] +[ext_resource type="Script" path="res://models/data/Character/Category.cs" id="2_pdbs6"] [resource] script = ExtResource("2_pdbs6") diff --git a/src/resources/Characters/Dummy.tres b/src/resources/Characters/Dummy.tres index ab4985e9..d0e6ae8c 100644 --- a/src/resources/Characters/Dummy.tres +++ b/src/resources/Characters/Dummy.tres @@ -1,10 +1,8 @@ -[gd_resource type="Resource" script_class="CharacterType" load_steps=6 format=3 uid="uid://ctp5er4mb8u3k"] +[gd_resource type="Resource" load_steps=4 format=3 uid="uid://ctp5er4mb8u3k"] -[ext_resource type="Script" uid="uid://cxt7qolwarsf1" path="res://features/Character/CharacterAction.cs" id="1_4pvhh"] -[ext_resource type="Script" uid="uid://6shb3cqcf2bt" path="res://features/Character/CharacterAttribute.cs" id="2_5s1he"] [ext_resource type="Resource" uid="uid://bjc78p06uwuy3" path="res://resources/Locations/EnemySquad.tres" id="4_5s1he"] [ext_resource type="SpriteFrames" uid="uid://bkvhu7v1tmcfy" path="res://assets/characters/dummyOtsoga/DummyOtsogaSprites.tres" id="5_giux7"] -[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://features/Character/CharacterType.cs" id="8_ktuse"] +[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://models/data/Character/CharacterType.cs" id="8_ktuse"] [resource] script = ExtResource("8_ktuse") @@ -13,8 +11,8 @@ CharacterSprite = ExtResource("5_giux7") ShowShadow = false SpritePositionX = 0.0 SpritePositionY = 0.0 -Attributes = Array[ExtResource("2_5s1he")]([]) -Actions = Array[ExtResource("1_4pvhh")]([]) +Attributes = [] +Actions = [] Location = ExtResource("4_5s1he") SlotIndex = 0 Id = "a98288c9-8795-4e16-801f-5fed51abd905" diff --git a/src/resources/Characters/Eleonore.tres b/src/resources/Characters/Eleonore.tres index 8330ce53..934e9601 100644 --- a/src/resources/Characters/Eleonore.tres +++ b/src/resources/Characters/Eleonore.tres @@ -1,12 +1,9 @@ -[gd_resource type="Resource" script_class="CharacterType" load_steps=19 format=3 uid="uid://clrt1eby68x42"] +[gd_resource type="Resource" load_steps=16 format=3 uid="uid://clrt1eby68x42"] -[ext_resource type="Script" uid="uid://cxt7qolwarsf1" path="res://features/Character/CharacterAction.cs" id="1_22iko"] -[ext_resource type="Script" uid="uid://6shb3cqcf2bt" path="res://features/Character/CharacterAttribute.cs" id="2_3cii4"] -[ext_resource type="Resource" uid="uid://d1dsndqu7on50" path="res://resources/Locations/PlayerSquad.tres" id="4_mck33"] -[ext_resource type="Resource" uid="uid://bgx5eoqdsu100" path="res://resources/Roles/Playable/Mage.tres" id="5_3cii4"] +[ext_resource type="Resource" uid="uid://d1dsndqu7on50" path="res://resources/Locations/PlayerSquad.tres" id="4_3cii4"] [ext_resource type="SpriteFrames" uid="uid://bskb8ffl72voq" path="res://assets/characters/eleonoreOtsoga/EleonoreOtsogaSprites.tres" id="6_balo1"] [ext_resource type="Texture2D" uid="uid://dqpa6f8n80d61" path="res://assets/characters/eleonoreOtsoga/EleonoreOtsogaPortrait.png" id="8_7y5lj"] -[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://features/Character/CharacterType.cs" id="10_crg3w"] +[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://models/data/Character/CharacterType.cs" id="10_crg3w"] [sub_resource type="CompressedTexture2D" id="CompressedTexture2D_ikwiv"] @@ -90,9 +87,8 @@ ShadowSprite = SubResource("SpriteFrames_o11qe") ShowShadow = false SpritePositionX = 0.0 SpritePositionY = 0.0 -Role = ExtResource("5_3cii4") -Attributes = Array[ExtResource("2_3cii4")]([]) -Actions = Array[ExtResource("1_22iko")]([]) -Location = ExtResource("4_mck33") +Attributes = [] +Actions = [] +Location = ExtResource("4_3cii4") SlotIndex = 2 Id = "4ea655f0-4c3e-4fba-bafe-fe361e68db9e" diff --git a/src/resources/Characters/EnemyCharacterStore.tres b/src/resources/Characters/EnemyCharacterStore.tres index 70a38a94..27851e2e 100644 --- a/src/resources/Characters/EnemyCharacterStore.tres +++ b/src/resources/Characters/EnemyCharacterStore.tres @@ -1,10 +1,9 @@ -[gd_resource type="Resource" script_class="CharacterStore" load_steps=4 format=3 uid="uid://d22hmntd0rfq2"] +[gd_resource type="Resource" load_steps=3 format=3 uid="uid://d22hmntd0rfq2"] -[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://features/Character/CharacterType.cs" id="1_e35d6"] [ext_resource type="Resource" uid="uid://ctp5er4mb8u3k" path="res://resources/Characters/Dummy.tres" id="2_e35d6"] -[ext_resource type="Script" uid="uid://c0ludr6rojb3c" path="res://features/Character/CharacterStore.cs" id="3_m0fko"] +[ext_resource type="Script" uid="uid://c0ludr6rojb3c" path="res://models/stores/CharacterStore.cs" id="3_m0fko"] [resource] script = ExtResource("3_m0fko") -Characters = Array[ExtResource("1_e35d6")]([ExtResource("2_e35d6")]) +Characters = [ExtResource("2_e35d6")] metadata/_custom_type_script = ExtResource("3_m0fko") diff --git a/src/resources/Characters/Joanna.tres b/src/resources/Characters/Joanna.tres index 8dc9f9a5..54ad3b35 100644 --- a/src/resources/Characters/Joanna.tres +++ b/src/resources/Characters/Joanna.tres @@ -1,12 +1,10 @@ -[gd_resource type="Resource" script_class="CharacterType" load_steps=8 format=3 uid="uid://bkolttux1bvi1"] +[gd_resource type="Resource" load_steps=6 format=3 uid="uid://bkolttux1bvi1"] -[ext_resource type="Script" uid="uid://cxt7qolwarsf1" path="res://features/Character/CharacterAction.cs" id="1_hfipu"] -[ext_resource type="Script" uid="uid://6shb3cqcf2bt" path="res://features/Character/CharacterAttribute.cs" id="2_ffsgs"] [ext_resource type="Resource" uid="uid://d1dsndqu7on50" path="res://resources/Locations/PlayerSquad.tres" id="4_5q3u5"] [ext_resource type="Resource" uid="uid://bad7cxgeb8mqp" path="res://resources/Roles/Playable/Fighter.tres" id="5_ffsgs"] [ext_resource type="SpriteFrames" uid="uid://fdkgmyh24b0q" path="res://assets/characters/joannaOtsoga/JoannaOtsogaSprites.tres" id="6_d10er"] [ext_resource type="Texture2D" uid="uid://8e45l4n0kh6" path="res://assets/characters/joannaOtsoga/JoannaOtsogaPortrait.png" id="8_62ltr"] -[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://features/Character/CharacterType.cs" id="10_iwykt"] +[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://models/data/Character/CharacterType.cs" id="10_iwykt"] [resource] script = ExtResource("10_iwykt") @@ -17,8 +15,8 @@ ShowShadow = false SpritePositionX = 0.0 SpritePositionY = -0.167 Role = ExtResource("5_ffsgs") -Attributes = Array[ExtResource("2_ffsgs")]([]) -Actions = Array[ExtResource("1_hfipu")]([]) +Attributes = [] +Actions = [] Location = ExtResource("4_5q3u5") SlotIndex = 5 Id = "d98ec50f-3df3-47e6-b266-cbc7b8fbb745" diff --git a/src/resources/Characters/PlayerCharacterStore.tres b/src/resources/Characters/PlayerCharacterStore.tres index 1e1c985d..ceab380c 100644 --- a/src/resources/Characters/PlayerCharacterStore.tres +++ b/src/resources/Characters/PlayerCharacterStore.tres @@ -1,10 +1,9 @@ -[gd_resource type="Resource" script_class="CharacterStore" load_steps=5 format=3 uid="uid://snt34yslyn4f"] +[gd_resource type="Resource" load_steps=4 format=3 uid="uid://snt34yslyn4f"] -[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://features/Character/CharacterType.cs" id="1_i0bvh"] -[ext_resource type="Resource" uid="uid://clrt1eby68x42" path="res://resources/Characters/Eleonore.tres" id="2_oxbo1"] -[ext_resource type="Resource" uid="uid://bkolttux1bvi1" path="res://resources/Characters/Joanna.tres" id="3_2yhi7"] -[ext_resource type="Script" uid="uid://c0ludr6rojb3c" path="res://features/Character/CharacterStore.cs" id="10_xofbh"] +[ext_resource type="Resource" uid="uid://clrt1eby68x42" path="res://resources/Characters/Eleonore.tres" id="2_tf880"] +[ext_resource type="Resource" uid="uid://bkolttux1bvi1" path="res://resources/Characters/Joanna.tres" id="3_oxbo1"] +[ext_resource type="Script" uid="uid://c0ludr6rojb3c" path="res://models/stores/CharacterStore.cs" id="10_xofbh"] [resource] script = ExtResource("10_xofbh") -Characters = Array[ExtResource("1_i0bvh")]([ExtResource("2_oxbo1"), ExtResource("3_2yhi7")]) +Characters = [ExtResource("2_tf880"), ExtResource("3_oxbo1")] diff --git a/src/resources/Dice/DiceEnergyStore.tres b/src/resources/Dice/DiceEnergyStore.tres index 08dac676..06474145 100644 --- a/src/resources/Dice/DiceEnergyStore.tres +++ b/src/resources/Dice/DiceEnergyStore.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=9 format=3 uid="uid://2miun4ox1np8"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="1_2dewc"] -[ext_resource type="Script" uid="uid://gfcl3cu0htms" path="res://features/Dice/DiceEnergyStore.cs" id="1_46bd6"] +[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://models/data/Dice/DiceEnergy.cs" id="1_2dewc"] +[ext_resource type="Script" uid="uid://gfcl3cu0htms" path="res://models/stores/DiceEnergyStore.cs" id="1_46bd6"] [ext_resource type="Resource" uid="uid://xcyti3lh5xkx" path="res://resources/Dice/Mana/ManaEmpty.tres" id="2_r1adj"] [ext_resource type="Resource" uid="uid://d1fdrw7p7rywt" path="res://resources/Dice/Mana/ManaBlue.tres" id="3_qqaa6"] [ext_resource type="Resource" uid="uid://djkgjo1axl23k" path="res://resources/Dice/Mana/ManaGreen.tres" id="4_yh246"] diff --git a/src/resources/Dice/DiceIconStore.tres b/src/resources/Dice/DiceIconStore.tres index 14a67034..409371eb 100644 --- a/src/resources/Dice/DiceIconStore.tres +++ b/src/resources/Dice/DiceIconStore.tres @@ -1,13 +1,13 @@ [gd_resource type="Resource" load_steps=9 format=3 uid="uid://brnsqgtvg2ttv"] -[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://features/Dice/DiceIcon.cs" id="1_us74m"] +[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://models/data/Dice/DiceIcon.cs" id="1_us74m"] [ext_resource type="Resource" uid="uid://s8serfaeaqbw" path="res://resources/Dice/Icons/DiceIconD4.tres" id="1_v5rg5"] [ext_resource type="Resource" uid="uid://c4no8xkxk78sb" path="res://resources/Dice/Icons/DiceIconD6.tres" id="2_arn78"] [ext_resource type="Resource" uid="uid://c5klaa3cprv8n" path="res://resources/Dice/Icons/DiceIconD8.tres" id="3_q7fig"] [ext_resource type="Resource" uid="uid://d3yefsxux40r" path="res://resources/Dice/Icons/DiceIconD10.tres" id="4_ldo3q"] [ext_resource type="Resource" uid="uid://cve8x85oec2k" path="res://resources/Dice/Icons/DiceIconD20.tres" id="5_5xy1a"] [ext_resource type="Resource" uid="uid://b74vrqn7d8gvt" path="res://resources/Dice/Icons/DiceIconD100.tres" id="6_8rc3v"] -[ext_resource type="Script" uid="uid://bye7fb7fqwv70" path="res://features/Dice/DiceIconStore.cs" id="7_r1ldi"] +[ext_resource type="Script" uid="uid://bye7fb7fqwv70" path="res://models/stores/DiceIconStore.cs" id="7_r1ldi"] [resource] script = ExtResource("7_r1ldi") diff --git a/src/resources/Dice/Icons/DiceIconD10.tres b/src/resources/Dice/Icons/DiceIconD10.tres index 3a1a1500..b6e7c765 100644 --- a/src/resources/Dice/Icons/DiceIconD10.tres +++ b/src/resources/Dice/Icons/DiceIconD10.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=3 format=3 uid="uid://d3yefsxux40r"] [ext_resource type="Texture2D" uid="uid://cmu4xole4lpv2" path="res://assets/icons/dice/mdi_d10.svg" id="1_dy8i8"] -[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://features/Dice/DiceIcon.cs" id="2_uo2c0"] +[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://models/data/Dice/DiceIcon.cs" id="2_uo2c0"] [resource] script = ExtResource("2_uo2c0") diff --git a/src/resources/Dice/Icons/DiceIconD100.tres b/src/resources/Dice/Icons/DiceIconD100.tres index d8e26284..c8296320 100644 --- a/src/resources/Dice/Icons/DiceIconD100.tres +++ b/src/resources/Dice/Icons/DiceIconD100.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=3 format=3 uid="uid://b74vrqn7d8gvt"] [ext_resource type="Texture2D" uid="uid://tax48gwkx4rt" path="res://assets/icons/dice/tabler_percentage.svg" id="1_efih6"] -[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://features/Dice/DiceIcon.cs" id="2_ph51v"] +[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://models/data/Dice/DiceIcon.cs" id="2_ph51v"] [resource] script = ExtResource("2_ph51v") diff --git a/src/resources/Dice/Icons/DiceIconD20.tres b/src/resources/Dice/Icons/DiceIconD20.tres index d2e5943e..32b440ae 100644 --- a/src/resources/Dice/Icons/DiceIconD20.tres +++ b/src/resources/Dice/Icons/DiceIconD20.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=3 format=3 uid="uid://cve8x85oec2k"] [ext_resource type="Texture2D" uid="uid://bh23u3ip7f8l6" path="res://assets/icons/dice/mdi_d20.svg" id="1_my640"] -[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://features/Dice/DiceIcon.cs" id="2_8ps5s"] +[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://models/data/Dice/DiceIcon.cs" id="2_8ps5s"] [resource] script = ExtResource("2_8ps5s") diff --git a/src/resources/Dice/Icons/DiceIconD4.tres b/src/resources/Dice/Icons/DiceIconD4.tres index 308853ca..699cc11c 100644 --- a/src/resources/Dice/Icons/DiceIconD4.tres +++ b/src/resources/Dice/Icons/DiceIconD4.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=3 format=3 uid="uid://s8serfaeaqbw"] [ext_resource type="Texture2D" uid="uid://c6lstssc785up" path="res://assets/icons/dice/mdi_d4.svg" id="1_t0k2x"] -[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://features/Dice/DiceIcon.cs" id="2_262ii"] +[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://models/data/Dice/DiceIcon.cs" id="2_262ii"] [resource] script = ExtResource("2_262ii") diff --git a/src/resources/Dice/Icons/DiceIconD6.tres b/src/resources/Dice/Icons/DiceIconD6.tres index 30c14ffa..d89461d5 100644 --- a/src/resources/Dice/Icons/DiceIconD6.tres +++ b/src/resources/Dice/Icons/DiceIconD6.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=3 format=3 uid="uid://c4no8xkxk78sb"] [ext_resource type="Texture2D" uid="uid://12j2c8so0c2s" path="res://assets/icons/dice/mdi_d6.svg" id="1_qka50"] -[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://features/Dice/DiceIcon.cs" id="2_ikiwv"] +[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://models/data/Dice/DiceIcon.cs" id="2_ikiwv"] [resource] script = ExtResource("2_ikiwv") diff --git a/src/resources/Dice/Icons/DiceIconD8.tres b/src/resources/Dice/Icons/DiceIconD8.tres index 8acd1204..e76d8f7c 100644 --- a/src/resources/Dice/Icons/DiceIconD8.tres +++ b/src/resources/Dice/Icons/DiceIconD8.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=3 format=3 uid="uid://c5klaa3cprv8n"] [ext_resource type="Texture2D" uid="uid://10yhel1twdr6" path="res://assets/icons/dice/mdi_d8.svg" id="1_bjg3e"] -[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://features/Dice/DiceIcon.cs" id="2_w1p8j"] +[ext_resource type="Script" uid="uid://3pgpgwxyswse" path="res://models/data/Dice/DiceIcon.cs" id="2_w1p8j"] [resource] script = ExtResource("2_w1p8j") diff --git a/src/resources/Dice/Mana/ManaBlue.tres b/src/resources/Dice/Mana/ManaBlue.tres index 19423fae..32b9fd92 100644 --- a/src/resources/Dice/Mana/ManaBlue.tres +++ b/src/resources/Dice/Mana/ManaBlue.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="DiceEnergy" load_steps=2 format=3 uid="uid://d1fdrw7p7rywt"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="1_agb81"] +[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://models/data/Dice/DiceEnergy.cs" id="1_agb81"] [resource] script = ExtResource("1_agb81") diff --git a/src/resources/Dice/Mana/ManaEmpty.tres b/src/resources/Dice/Mana/ManaEmpty.tres index 1a75f810..23c86730 100644 --- a/src/resources/Dice/Mana/ManaEmpty.tres +++ b/src/resources/Dice/Mana/ManaEmpty.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="DiceEnergy" load_steps=3 format=3 uid="uid://xcyti3lh5xkx"] [ext_resource type="Texture2D" uid="uid://7edt57k6ta68" path="res://assets/icons/diceMana/drop.png" id="1_0qi7q"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="2_6dvv5"] +[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://models/data/Dice/DiceEnergy.cs" id="2_6dvv5"] [resource] script = ExtResource("2_6dvv5") diff --git a/src/resources/Dice/Mana/ManaGreen.tres b/src/resources/Dice/Mana/ManaGreen.tres index 38f9e376..dfa345b9 100644 --- a/src/resources/Dice/Mana/ManaGreen.tres +++ b/src/resources/Dice/Mana/ManaGreen.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="DiceEnergy" load_steps=3 format=3 uid="uid://djkgjo1axl23k"] [ext_resource type="Texture2D" uid="uid://7edt57k6ta68" path="res://assets/icons/diceMana/drop.png" id="1_fv2o0"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="2_46u2n"] +[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://models/data/Dice/DiceEnergy.cs" id="2_46u2n"] [resource] script = ExtResource("2_46u2n") diff --git a/src/resources/Dice/Mana/ManaPurple.tres b/src/resources/Dice/Mana/ManaPurple.tres index 76079ab9..d5562ed8 100644 --- a/src/resources/Dice/Mana/ManaPurple.tres +++ b/src/resources/Dice/Mana/ManaPurple.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="DiceEnergy" load_steps=3 format=3 uid="uid://durkekx3qanwb"] [ext_resource type="Texture2D" uid="uid://7edt57k6ta68" path="res://assets/icons/diceMana/drop.png" id="1_7goys"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="2_ixep7"] +[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://models/data/Dice/DiceEnergy.cs" id="2_ixep7"] [resource] script = ExtResource("2_ixep7") diff --git a/src/resources/Dice/Mana/ManaRed.tres b/src/resources/Dice/Mana/ManaRed.tres index 044997cd..b4346b9c 100644 --- a/src/resources/Dice/Mana/ManaRed.tres +++ b/src/resources/Dice/Mana/ManaRed.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" script_class="DiceEnergy" load_steps=3 format=3 uid="uid://qxd24e6b177u"] [ext_resource type="Texture2D" uid="uid://7edt57k6ta68" path="res://assets/icons/diceMana/drop.png" id="1_wj5qk"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="2_sqy8i"] +[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://models/data/Dice/DiceEnergy.cs" id="2_sqy8i"] [resource] script = ExtResource("2_sqy8i") diff --git a/src/resources/Dice/Mana/ManaYellow.tres b/src/resources/Dice/Mana/ManaYellow.tres index a540e6f1..a20429c6 100644 --- a/src/resources/Dice/Mana/ManaYellow.tres +++ b/src/resources/Dice/Mana/ManaYellow.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="DiceEnergy" load_steps=2 format=3 uid="uid://cnfykne4hnexp"] -[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://features/Dice/DiceEnergy.cs" id="1_7bur8"] +[ext_resource type="Script" uid="uid://yxgkinium01u" path="res://models/data/Dice/DiceEnergy.cs" id="1_7bur8"] [resource] script = ExtResource("1_7bur8") diff --git a/src/resources/Effects/DamageEffect.tres b/src/resources/Effects/DamageEffect.tres index cb8924bf..4cd7224a 100644 --- a/src/resources/Effects/DamageEffect.tres +++ b/src/resources/Effects/DamageEffect.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" load_steps=2 format=3 uid="uid://b43duhk6atdos"] -[ext_resource type="Script" uid="uid://dg2lc30fx0iba" path="res://features/Effect/DamageEffect.cs" id="3_m732g"] +[ext_resource type="Script" uid="uid://dg2lc30fx0iba" path="res://models/data/Effect/DamageEffect.cs" id="3_m732g"] [resource] script = ExtResource("3_m732g") diff --git a/src/resources/Locations/EnemySquad.tres b/src/resources/Locations/EnemySquad.tres index 1c179f76..3cc47e46 100644 --- a/src/resources/Locations/EnemySquad.tres +++ b/src/resources/Locations/EnemySquad.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="LocationType" load_steps=2 format=3 uid="uid://bjc78p06uwuy3"] -[ext_resource type="Script" uid="uid://cros738yxei40" path="res://features/Location/LocationType.cs" id="1_ynjms"] +[ext_resource type="Script" uid="uid://cros738yxei40" path="res://models/data/Location/LocationType.cs" id="1_ynjms"] [resource] script = ExtResource("1_ynjms") diff --git a/src/resources/Locations/PlayerRoster.tres b/src/resources/Locations/PlayerRoster.tres index 7286054a..dfc31c7a 100644 --- a/src/resources/Locations/PlayerRoster.tres +++ b/src/resources/Locations/PlayerRoster.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="LocationType" load_steps=2 format=3 uid="uid://d33paxl6cc38l"] -[ext_resource type="Script" uid="uid://cros738yxei40" path="res://features/Location/LocationType.cs" id="1_xwydy"] +[ext_resource type="Script" uid="uid://cros738yxei40" path="res://models/data/Location/LocationType.cs" id="1_xwydy"] [resource] script = ExtResource("1_xwydy") diff --git a/src/resources/Locations/PlayerSquad.tres b/src/resources/Locations/PlayerSquad.tres index 203fb1f0..c2c3e20d 100644 --- a/src/resources/Locations/PlayerSquad.tres +++ b/src/resources/Locations/PlayerSquad.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" script_class="LocationType" load_steps=2 format=3 uid="uid://d1dsndqu7on50"] -[ext_resource type="Script" uid="uid://cros738yxei40" path="res://features/Location/LocationType.cs" id="1_cb8ns"] +[ext_resource type="Script" uid="uid://cros738yxei40" path="res://models/data/Location/LocationType.cs" id="1_cb8ns"] [resource] script = ExtResource("1_cb8ns") diff --git a/src/resources/Roles/Playable/Fighter.tres b/src/resources/Roles/Playable/Fighter.tres index ce58b7da..9d49de1c 100644 --- a/src/resources/Roles/Playable/Fighter.tres +++ b/src/resources/Roles/Playable/Fighter.tres @@ -1,37 +1,29 @@ -[gd_resource type="Resource" script_class="RoleType" load_steps=12 format=3 uid="uid://bad7cxgeb8mqp"] +[gd_resource type="Resource" load_steps=8 format=3 uid="uid://bad7cxgeb8mqp"] -[ext_resource type="Script" uid="uid://dva25u156vwmb" path="res://features/Role/RoleAction.cs" id="1_iytx6"] -[ext_resource type="Resource" uid="uid://cs65w4r75ugap" path="res://resources/Actions/QuickSlash.tres" id="2_jvjr4"] -[ext_resource type="Script" uid="uid://dg8bedxsn6cm7" path="res://features/Role/RoleAttribute.cs" id="3_j81qd"] -[ext_resource type="Resource" uid="uid://c765rrtwoaq76" path="res://resources/Attributes/Health.tres" id="4_ytwvq"] -[ext_resource type="Resource" uid="uid://d37vh6vtgnxkp" path="res://resources/Attributes/Armor.tres" id="5_1kxng"] -[ext_resource type="Resource" uid="uid://blv7vekuqpawn" path="res://resources/Attributes/Speed.tres" id="6_p46ct"] -[ext_resource type="Script" uid="uid://bf8grw0ulmqkc" path="res://features/Role/RoleType.cs" id="7_x8hfl"] +[ext_resource type="Script" uid="uid://dva25u156vwmb" path="res://models/data/Role/RoleAction.cs" id="1_iytx6"] +[ext_resource type="Script" uid="uid://dg8bedxsn6cm7" path="res://models/data/Role/RoleAttribute.cs" id="3_j81qd"] +[ext_resource type="Script" uid="uid://bf8grw0ulmqkc" path="res://models/data/Role/RoleType.cs" id="7_x8hfl"] [sub_resource type="Resource" id="Resource_rp15h"] script = ExtResource("1_iytx6") -Type = ExtResource("2_jvjr4") metadata/_custom_type_script = ExtResource("1_iytx6") [sub_resource type="Resource" id="Resource_g0hcp"] script = ExtResource("3_j81qd") -Type = ExtResource("4_ytwvq") BaseValue = 100 [sub_resource type="Resource" id="Resource_8w8fm"] script = ExtResource("3_j81qd") -Type = ExtResource("5_1kxng") BaseValue = 50 [sub_resource type="Resource" id="Resource_xurgi"] script = ExtResource("3_j81qd") -Type = ExtResource("6_p46ct") BaseValue = 50 [resource] script = ExtResource("7_x8hfl") Name = "Fighter" Description = "Fighter Description" -RoleAttributes = Array[ExtResource("3_j81qd")]([SubResource("Resource_g0hcp"), SubResource("Resource_8w8fm"), SubResource("Resource_xurgi")]) -RoleActions = Array[ExtResource("1_iytx6")]([SubResource("Resource_rp15h")]) +RoleAttributes = [SubResource("Resource_g0hcp"), SubResource("Resource_8w8fm"), SubResource("Resource_xurgi")] +RoleActions = [SubResource("Resource_rp15h")] Id = "d617ceaf-d1be-425f-80e3-5e662e73dba6" diff --git a/src/resources/Roles/Playable/Mage.tres b/src/resources/Roles/Playable/Mage.tres index 3685ece5..0f724149 100644 --- a/src/resources/Roles/Playable/Mage.tres +++ b/src/resources/Roles/Playable/Mage.tres @@ -1,12 +1,12 @@ [gd_resource type="Resource" script_class="RoleType" load_steps=12 format=3 uid="uid://bgx5eoqdsu100"] -[ext_resource type="Script" uid="uid://dva25u156vwmb" path="res://features/Role/RoleAction.cs" id="1_e1455"] +[ext_resource type="Script" uid="uid://dva25u156vwmb" path="res://models/data/Role/RoleAction.cs" id="1_e1455"] [ext_resource type="Resource" uid="uid://cvojckruuqrn6" path="res://resources/Actions/MagicMissiles.tres" id="2_6jo5k"] [ext_resource type="Resource" uid="uid://c8xr12tkory0k" path="res://resources/Actions/ArcaneStrike.tres" id="3_7dyxt"] -[ext_resource type="Script" uid="uid://dg8bedxsn6cm7" path="res://features/Role/RoleAttribute.cs" id="4_h5xh8"] +[ext_resource type="Script" uid="uid://dg8bedxsn6cm7" path="res://models/data/Role/RoleAttribute.cs" id="4_h5xh8"] [ext_resource type="Resource" uid="uid://c765rrtwoaq76" path="res://resources/Attributes/Health.tres" id="5_3q0ws"] [ext_resource type="Resource" uid="uid://blv7vekuqpawn" path="res://resources/Attributes/Speed.tres" id="6_s2fk3"] -[ext_resource type="Script" uid="uid://bf8grw0ulmqkc" path="res://features/Role/RoleType.cs" id="7_psdi4"] +[ext_resource type="Script" uid="uid://bf8grw0ulmqkc" path="res://models/data/Role/RoleType.cs" id="7_psdi4"] [sub_resource type="Resource" id="Resource_fqxkr"] script = ExtResource("1_e1455") diff --git a/src/resources/Roles/Unplayable/DummyRole.tres b/src/resources/Roles/Unplayable/DummyRole.tres index 29d5c637..ec64234e 100644 --- a/src/resources/Roles/Unplayable/DummyRole.tres +++ b/src/resources/Roles/Unplayable/DummyRole.tres @@ -1,11 +1,11 @@ [gd_resource type="Resource" script_class="RoleType" load_steps=10 format=3 uid="uid://bviiaflcxorr0"] -[ext_resource type="Script" uid="uid://dva25u156vwmb" path="res://features/Role/RoleAction.cs" id="1_d8cls"] +[ext_resource type="Script" uid="uid://dva25u156vwmb" path="res://models/data/Role/RoleAction.cs" id="1_d8cls"] [ext_resource type="Resource" uid="uid://cgac6lxa06rf8" path="res://resources/Actions/Stare.tres" id="2_3rgbr"] -[ext_resource type="Script" uid="uid://dg8bedxsn6cm7" path="res://features/Role/RoleAttribute.cs" id="3_2fus8"] +[ext_resource type="Script" uid="uid://dg8bedxsn6cm7" path="res://models/data/Role/RoleAttribute.cs" id="3_2fus8"] [ext_resource type="Resource" uid="uid://c765rrtwoaq76" path="res://resources/Attributes/Health.tres" id="4_hdasj"] [ext_resource type="Resource" uid="uid://d37vh6vtgnxkp" path="res://resources/Attributes/Armor.tres" id="5_xkma8"] -[ext_resource type="Script" uid="uid://bf8grw0ulmqkc" path="res://features/Role/RoleType.cs" id="6_ebtsc"] +[ext_resource type="Script" uid="uid://bf8grw0ulmqkc" path="res://models/data/Role/RoleType.cs" id="6_ebtsc"] [sub_resource type="Resource" id="Resource_3ckpd"] script = ExtResource("1_d8cls") diff --git a/src/views/ISelectable.cs.uid b/src/views/ISelectable.cs.uid new file mode 100644 index 00000000..482ce3c0 --- /dev/null +++ b/src/views/ISelectable.cs.uid @@ -0,0 +1 @@ +uid://oidejvjfu5vq diff --git a/src/views/SelectionHandler.cs.uid b/src/views/SelectionHandler.cs.uid new file mode 100644 index 00000000..f8a4b72c --- /dev/null +++ b/src/views/SelectionHandler.cs.uid @@ -0,0 +1 @@ +uid://olf4wcu5rne4 diff --git a/src/components/CharacterComponent/CharacterComponent.cs b/src/views/components/CharacterComponent/CharacterComponent.cs similarity index 100% rename from src/components/CharacterComponent/CharacterComponent.cs rename to src/views/components/CharacterComponent/CharacterComponent.cs diff --git a/src/components/CharacterComponent/CharacterComponent.cs.uid b/src/views/components/CharacterComponent/CharacterComponent.cs.uid similarity index 100% rename from src/components/CharacterComponent/CharacterComponent.cs.uid rename to src/views/components/CharacterComponent/CharacterComponent.cs.uid diff --git a/src/components/CharacterComponent/CharacterComponent.tscn b/src/views/components/CharacterComponent/CharacterComponent.tscn similarity index 96% rename from src/components/CharacterComponent/CharacterComponent.tscn rename to src/views/components/CharacterComponent/CharacterComponent.tscn index 5bd8024f..ac5d31cc 100644 --- a/src/components/CharacterComponent/CharacterComponent.tscn +++ b/src/views/components/CharacterComponent/CharacterComponent.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=3 uid="uid://d3lkjx05elcwq"] -[ext_resource type="Script" uid="uid://f1lqpaw1xng7" path="res://components/CharacterComponent/CharacterComponent.cs" id="1_t0krx"] +[ext_resource type="Script" uid="uid://f1lqpaw1xng7" path="res://views/components/CharacterComponent/CharacterComponent.cs" id="1_t0krx"] [ext_resource type="Texture2D" uid="uid://cytb6ea63fslt" path="res://assets/icons/hud/select.png" id="3_gxxii"] [ext_resource type="SpriteFrames" uid="uid://fdkgmyh24b0q" path="res://assets/characters/joannaOtsoga/JoannaOtsogaSprites.tres" id="4_svr47"] diff --git a/src/components/CharacterGrid/Arrow.tscn b/src/views/components/CharacterGrid/Arrow.tscn similarity index 100% rename from src/components/CharacterGrid/Arrow.tscn rename to src/views/components/CharacterGrid/Arrow.tscn diff --git a/src/components/CharacterGrid/CharacterGrid.cs b/src/views/components/CharacterGrid/CharacterGrid.cs similarity index 100% rename from src/components/CharacterGrid/CharacterGrid.cs rename to src/views/components/CharacterGrid/CharacterGrid.cs diff --git a/src/components/CharacterGrid/CharacterGrid.cs.uid b/src/views/components/CharacterGrid/CharacterGrid.cs.uid similarity index 100% rename from src/components/CharacterGrid/CharacterGrid.cs.uid rename to src/views/components/CharacterGrid/CharacterGrid.cs.uid diff --git a/src/components/CharacterGrid/CharacterGrid.tscn b/src/views/components/CharacterGrid/CharacterGrid.tscn similarity index 61% rename from src/components/CharacterGrid/CharacterGrid.tscn rename to src/views/components/CharacterGrid/CharacterGrid.tscn index 1332bd12..0b7b85df 100644 --- a/src/components/CharacterGrid/CharacterGrid.tscn +++ b/src/views/components/CharacterGrid/CharacterGrid.tscn @@ -1,17 +1,14 @@ -[gd_scene load_steps=9 format=3 uid="uid://dmw0cm136sn4p"] +[gd_scene load_steps=7 format=3 uid="uid://dmw0cm136sn4p"] -[ext_resource type="Script" uid="uid://gymkyw1r3mtn" path="res://components/CharacterGrid/CharacterGrid.cs" id="1_tabhr"] -[ext_resource type="Resource" uid="uid://snt34yslyn4f" path="res://resources/Characters/PlayerCharacterStore.tres" id="2_3uydg"] -[ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://features/Grid/GridType.cs" id="2_ml3sj"] -[ext_resource type="PackedScene" uid="uid://d3lkjx05elcwq" path="res://components/CharacterComponent/CharacterComponent.tscn" id="4_3uydg"] -[ext_resource type="Resource" uid="uid://d22hmntd0rfq2" path="res://resources/Characters/EnemyCharacterStore.tres" id="4_r0k5p"] -[ext_resource type="PackedScene" uid="uid://bltesg17i4ul8" path="res://components/CharacterGrid/Arrow.tscn" id="5_og5wa"] +[ext_resource type="Script" uid="uid://gymkyw1r3mtn" path="res://views/components/CharacterGrid/CharacterGrid.cs" id="1_tabhr"] +[ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://models/data/Grid/GridType.cs" id="2_ml3sj"] +[ext_resource type="PackedScene" uid="uid://d3lkjx05elcwq" path="res://views/components/CharacterComponent/CharacterComponent.tscn" id="4_3uydg"] +[ext_resource type="PackedScene" uid="uid://bltesg17i4ul8" path="res://views/components/CharacterGrid/Arrow.tscn" id="5_og5wa"] [sub_resource type="Resource" id="Resource_jan7r"] script = ExtResource("2_ml3sj") Prefix = "P" Offset = 0 -CharacterStore = ExtResource("2_3uydg") Direction = 0 Rows = 2 Columns = 3 @@ -22,7 +19,6 @@ metadata/_custom_type_script = ExtResource("2_ml3sj") script = ExtResource("2_ml3sj") Prefix = "E" Offset = 2 -CharacterStore = ExtResource("4_r0k5p") Direction = 0 Rows = 2 Columns = 3 diff --git a/src/components/CharacterGrid/Grid3D.cs b/src/views/components/CharacterGrid/Grid3D.cs similarity index 100% rename from src/components/CharacterGrid/Grid3D.cs rename to src/views/components/CharacterGrid/Grid3D.cs diff --git a/src/components/CharacterGrid/Grid3D.cs.uid b/src/views/components/CharacterGrid/Grid3D.cs.uid similarity index 100% rename from src/components/CharacterGrid/Grid3D.cs.uid rename to src/views/components/CharacterGrid/Grid3D.cs.uid diff --git a/src/components/CharacterGrid/GridCell3D.cs b/src/views/components/CharacterGrid/GridCell3D.cs similarity index 100% rename from src/components/CharacterGrid/GridCell3D.cs rename to src/views/components/CharacterGrid/GridCell3D.cs diff --git a/src/components/CharacterGrid/GridCell3D.cs.uid b/src/views/components/CharacterGrid/GridCell3D.cs.uid similarity index 100% rename from src/components/CharacterGrid/GridCell3D.cs.uid rename to src/views/components/CharacterGrid/GridCell3D.cs.uid diff --git a/src/components/CharacterInspector/CharacterInspector.cs b/src/views/components/CharacterInspector/CharacterInspector.cs similarity index 100% rename from src/components/CharacterInspector/CharacterInspector.cs rename to src/views/components/CharacterInspector/CharacterInspector.cs diff --git a/src/components/CharacterInspector/CharacterInspector.cs.uid b/src/views/components/CharacterInspector/CharacterInspector.cs.uid similarity index 100% rename from src/components/CharacterInspector/CharacterInspector.cs.uid rename to src/views/components/CharacterInspector/CharacterInspector.cs.uid diff --git a/src/components/CharacterInspector/CharacterInspector.tscn b/src/views/components/CharacterInspector/CharacterInspector.tscn similarity index 98% rename from src/components/CharacterInspector/CharacterInspector.tscn rename to src/views/components/CharacterInspector/CharacterInspector.tscn index 0fca1c11..a431d2b0 100644 --- a/src/components/CharacterInspector/CharacterInspector.tscn +++ b/src/views/components/CharacterInspector/CharacterInspector.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://dgyegipn74jj5"] -[ext_resource type="Script" uid="uid://b24cvjmwq5kc" path="res://components/CharacterInspector/CharacterInspector.cs" id="1_72g88"] +[ext_resource type="Script" uid="uid://b24cvjmwq5kc" path="res://views/components/CharacterInspector/CharacterInspector.cs" id="1_72g88"] [ext_resource type="Texture2D" uid="uid://dqpa6f8n80d61" path="res://assets/characters/eleonoreOtsoga/EleonoreOtsogaPortrait.png" id="1_jybd2"] [node name="CharacterInspector" type="HBoxContainer" node_paths=PackedStringArray("PortraitNode", "CharacterNameNode", "CharacterRoleNode", "AttributesListNode", "AttributeTemplateNode", "AttributeTemplateTitleNode", "ValueContainerNode", "AttributeCurrentValueNode", "AttributeMaxValueNode", "ActionGridNode", "ActionButtonTemplate")] diff --git a/src/components/GameLog/GameLogComponent.cs b/src/views/components/GameLog/GameLogComponent.cs similarity index 100% rename from src/components/GameLog/GameLogComponent.cs rename to src/views/components/GameLog/GameLogComponent.cs diff --git a/src/components/GameLog/GameLogComponent.cs.uid b/src/views/components/GameLog/GameLogComponent.cs.uid similarity index 100% rename from src/components/GameLog/GameLogComponent.cs.uid rename to src/views/components/GameLog/GameLogComponent.cs.uid diff --git a/src/components/GameLog/GameLogComponent.tscn b/src/views/components/GameLog/GameLogComponent.tscn similarity index 97% rename from src/components/GameLog/GameLogComponent.tscn rename to src/views/components/GameLog/GameLogComponent.tscn index 56191e85..69dd9ef5 100644 --- a/src/components/GameLog/GameLogComponent.tscn +++ b/src/views/components/GameLog/GameLogComponent.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://21o4pt7dm2n0"] -[ext_resource type="Script" uid="uid://c00f3g3y8eujg" path="res://components/GameLog/GameLogComponent.cs" id="1_h5njw"] +[ext_resource type="Script" uid="uid://c00f3g3y8eujg" path="res://views/components/GameLog/GameLogComponent.cs" id="1_h5njw"] [node name="GameLog" type="ScrollContainer" node_paths=PackedStringArray("_messageContainerNode", "_messageTemplateNode", "_headingLabelTemplateNode", "_timestampLabelTemplateNode", "_lineTemplateNode")] anchors_preset = 15 diff --git a/src/components/HUDComponent/HUDComponent.tscn b/src/views/components/HUDComponent/HUDComponent.tscn similarity index 88% rename from src/components/HUDComponent/HUDComponent.tscn rename to src/views/components/HUDComponent/HUDComponent.tscn index c3aab2cb..5d256e26 100644 --- a/src/components/HUDComponent/HUDComponent.tscn +++ b/src/views/components/HUDComponent/HUDComponent.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=6 format=3 uid="uid://c22tpnmaefgn4"] -[ext_resource type="PackedScene" uid="uid://dsbegy218josn" path="res://components/TurnOrderComponent/TurnOrderComponent.tscn" id="1_c8j77"] -[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://features/UI/SceneTransitionButton.cs" id="2_ink42"] -[ext_resource type="PackedScene" uid="uid://dgyegipn74jj5" path="res://components/CharacterInspector/CharacterInspector.tscn" id="3_xfvph"] -[ext_resource type="PackedScene" uid="uid://bt73g5fssa68h" path="res://components/InventoryComponent/InventoryComponent.tscn" id="4_313b0"] -[ext_resource type="PackedScene" uid="uid://21o4pt7dm2n0" path="res://components/GameLog/GameLogComponent.tscn" id="5_no7pv"] +[ext_resource type="PackedScene" uid="uid://dsbegy218josn" path="res://views/components/TurnOrderComponent/TurnOrderComponent.tscn" id="1_c8j77"] +[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://views/ui/SceneTransitionButton.cs" id="2_ink42"] +[ext_resource type="PackedScene" uid="uid://dgyegipn74jj5" path="res://views/components/CharacterInspector/CharacterInspector.tscn" id="3_xfvph"] +[ext_resource type="PackedScene" uid="uid://bt73g5fssa68h" path="res://views/components/InventoryComponent/InventoryComponent.tscn" id="4_313b0"] +[ext_resource type="PackedScene" uid="uid://21o4pt7dm2n0" path="res://views/components/GameLog/GameLogComponent.tscn" id="5_no7pv"] [node name="HUDComponent" type="VBoxContainer"] clip_contents = true diff --git a/src/components/InventoryComponent/InventoryComponent.cs b/src/views/components/InventoryComponent/InventoryComponent.cs similarity index 100% rename from src/components/InventoryComponent/InventoryComponent.cs rename to src/views/components/InventoryComponent/InventoryComponent.cs diff --git a/src/components/InventoryComponent/InventoryComponent.cs.uid b/src/views/components/InventoryComponent/InventoryComponent.cs.uid similarity index 100% rename from src/components/InventoryComponent/InventoryComponent.cs.uid rename to src/views/components/InventoryComponent/InventoryComponent.cs.uid diff --git a/src/components/InventoryComponent/InventoryComponent.tscn b/src/views/components/InventoryComponent/InventoryComponent.tscn similarity index 82% rename from src/components/InventoryComponent/InventoryComponent.tscn rename to src/views/components/InventoryComponent/InventoryComponent.tscn index 35982516..a4c64388 100644 --- a/src/components/InventoryComponent/InventoryComponent.tscn +++ b/src/views/components/InventoryComponent/InventoryComponent.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://bt73g5fssa68h"] -[ext_resource type="Script" uid="uid://bx8bk0ye5tevv" path="res://components/InventoryComponent/InventoryComponent.cs" id="2"] -[ext_resource type="PackedScene" uid="uid://tomctv14euva" path="res://components/InventoryItemComponent/InventoryItemComponent.tscn" id="2_rwo4n"] +[ext_resource type="Script" uid="uid://bx8bk0ye5tevv" path="res://views/components/InventoryComponent/InventoryComponent.cs" id="2"] +[ext_resource type="PackedScene" uid="uid://tomctv14euva" path="res://views/components/InventoryItemComponent/InventoryItemComponent.tscn" id="2_rwo4n"] [node name="Inventory" type="ScrollContainer"] anchors_preset = 15 diff --git a/src/components/InventoryComponent/slot.png b/src/views/components/InventoryComponent/slot.png similarity index 100% rename from src/components/InventoryComponent/slot.png rename to src/views/components/InventoryComponent/slot.png diff --git a/src/components/InventoryComponent/slot.png.import b/src/views/components/InventoryComponent/slot.png.import similarity index 71% rename from src/components/InventoryComponent/slot.png.import rename to src/views/components/InventoryComponent/slot.png.import index 6f74d20b..9ccc1f0b 100644 --- a/src/components/InventoryComponent/slot.png.import +++ b/src/views/components/InventoryComponent/slot.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://c1flt0c431x4o" -path="res://.godot/imported/slot.png-ccc67c4e40c6c52b675d7ce11da5f24e.ctex" +path="res://.godot/imported/slot.png-ad7fc8b2142cd56dc33b71f6771816fe.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://components/InventoryComponent/slot.png" -dest_files=["res://.godot/imported/slot.png-ccc67c4e40c6c52b675d7ce11da5f24e.ctex"] +source_file="res://views/components/InventoryComponent/slot.png" +dest_files=["res://.godot/imported/slot.png-ad7fc8b2142cd56dc33b71f6771816fe.ctex"] [params] diff --git a/src/components/InventoryComponent/test.tscn b/src/views/components/InventoryComponent/test.tscn similarity index 95% rename from src/components/InventoryComponent/test.tscn rename to src/views/components/InventoryComponent/test.tscn index 77d2faee..46bb6ac3 100644 --- a/src/components/InventoryComponent/test.tscn +++ b/src/views/components/InventoryComponent/test.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://b5dtfnowy3m0q"] -[ext_resource type="PackedScene" uid="uid://tomctv14euva" path="res://components/InventoryItemComponent/InventoryItemComponent.tscn" id="1_7fx0t"] +[ext_resource type="PackedScene" uid="uid://tomctv14euva" path="res://views/components/InventoryItemComponent/InventoryItemComponent.tscn" id="1_7fx0t"] [node name="Test" type="Node2D"] diff --git a/src/components/InventoryItemComponent/InventoryItemComponent.cs b/src/views/components/InventoryItemComponent/InventoryItemComponent.cs similarity index 100% rename from src/components/InventoryItemComponent/InventoryItemComponent.cs rename to src/views/components/InventoryItemComponent/InventoryItemComponent.cs diff --git a/src/components/InventoryItemComponent/InventoryItemComponent.cs.uid b/src/views/components/InventoryItemComponent/InventoryItemComponent.cs.uid similarity index 100% rename from src/components/InventoryItemComponent/InventoryItemComponent.cs.uid rename to src/views/components/InventoryItemComponent/InventoryItemComponent.cs.uid diff --git a/src/components/InventoryItemComponent/InventoryItemComponent.tscn b/src/views/components/InventoryItemComponent/InventoryItemComponent.tscn similarity index 79% rename from src/components/InventoryItemComponent/InventoryItemComponent.tscn rename to src/views/components/InventoryItemComponent/InventoryItemComponent.tscn index cc39ad95..fc4cb342 100644 --- a/src/components/InventoryItemComponent/InventoryItemComponent.tscn +++ b/src/views/components/InventoryItemComponent/InventoryItemComponent.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://tomctv14euva"] -[ext_resource type="Script" uid="uid://5drla5c75a4b" path="res://components/InventoryItemComponent/InventoryItemComponent.cs" id="1_sc2gm"] -[ext_resource type="PackedScene" uid="uid://bwvsdedui54tw" path="res://components/TooltipComponent/TooltipComponent.tscn" id="2_7j7lb"] +[ext_resource type="Script" uid="uid://5drla5c75a4b" path="res://views/components/InventoryItemComponent/InventoryItemComponent.cs" id="1_sc2gm"] +[ext_resource type="PackedScene" uid="uid://bwvsdedui54tw" path="res://views/components/TooltipComponent/TooltipComponent.tscn" id="2_7j7lb"] [node name="InventoryItemComponent" type="Control"] layout_mode = 3 diff --git a/src/components/TooltipComponent/TooltipComponent.cs b/src/views/components/TooltipComponent/TooltipComponent.cs similarity index 100% rename from src/components/TooltipComponent/TooltipComponent.cs rename to src/views/components/TooltipComponent/TooltipComponent.cs diff --git a/src/components/TooltipComponent/TooltipComponent.cs.uid b/src/views/components/TooltipComponent/TooltipComponent.cs.uid similarity index 100% rename from src/components/TooltipComponent/TooltipComponent.cs.uid rename to src/views/components/TooltipComponent/TooltipComponent.cs.uid diff --git a/src/components/TooltipComponent/TooltipComponent.tscn b/src/views/components/TooltipComponent/TooltipComponent.tscn similarity index 97% rename from src/components/TooltipComponent/TooltipComponent.tscn rename to src/views/components/TooltipComponent/TooltipComponent.tscn index e18e3df4..afc19e6e 100644 --- a/src/components/TooltipComponent/TooltipComponent.tscn +++ b/src/views/components/TooltipComponent/TooltipComponent.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://bwvsdedui54tw"] -[ext_resource type="Script" uid="uid://cmptfsd2i8ro8" path="res://components/TooltipComponent/TooltipComponent.cs" id="1_ma61s"] -[ext_resource type="Texture2D" uid="uid://dvfapg1a2gi00" path="res://components/TooltipComponent/icon.png" id="2_jkd58"] +[ext_resource type="Script" uid="uid://cmptfsd2i8ro8" path="res://views/components/TooltipComponent/TooltipComponent.cs" id="1_ma61s"] +[ext_resource type="Texture2D" uid="uid://dvfapg1a2gi00" path="res://views/components/TooltipComponent/icon.png" id="2_jkd58"] [node name="TooltipComponent" type="Control"] custom_minimum_size = Vector2(290, 360) diff --git a/src/components/TooltipComponent/icon.png b/src/views/components/TooltipComponent/icon.png similarity index 100% rename from src/components/TooltipComponent/icon.png rename to src/views/components/TooltipComponent/icon.png diff --git a/src/components/TooltipComponent/icon.png.import b/src/views/components/TooltipComponent/icon.png.import similarity index 71% rename from src/components/TooltipComponent/icon.png.import rename to src/views/components/TooltipComponent/icon.png.import index 5282396d..761b1da2 100644 --- a/src/components/TooltipComponent/icon.png.import +++ b/src/views/components/TooltipComponent/icon.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dvfapg1a2gi00" -path="res://.godot/imported/icon.png-52995f8c46839d4f8b7d37344a0ac169.ctex" +path="res://.godot/imported/icon.png-f043f3dac923498ba0daee33a78363fc.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://components/TooltipComponent/icon.png" -dest_files=["res://.godot/imported/icon.png-52995f8c46839d4f8b7d37344a0ac169.ctex"] +source_file="res://views/components/TooltipComponent/icon.png" +dest_files=["res://.godot/imported/icon.png-f043f3dac923498ba0daee33a78363fc.ctex"] [params] diff --git a/src/components/TurnOrderComponent/TurnOrderComponent.cs b/src/views/components/TurnOrderComponent/TurnOrderComponent.cs similarity index 100% rename from src/components/TurnOrderComponent/TurnOrderComponent.cs rename to src/views/components/TurnOrderComponent/TurnOrderComponent.cs diff --git a/src/components/TurnOrderComponent/TurnOrderComponent.cs.uid b/src/views/components/TurnOrderComponent/TurnOrderComponent.cs.uid similarity index 100% rename from src/components/TurnOrderComponent/TurnOrderComponent.cs.uid rename to src/views/components/TurnOrderComponent/TurnOrderComponent.cs.uid diff --git a/src/components/TurnOrderComponent/TurnOrderComponent.tscn b/src/views/components/TurnOrderComponent/TurnOrderComponent.tscn similarity index 96% rename from src/components/TurnOrderComponent/TurnOrderComponent.tscn rename to src/views/components/TurnOrderComponent/TurnOrderComponent.tscn index ae9fe1dd..d06df495 100644 --- a/src/components/TurnOrderComponent/TurnOrderComponent.tscn +++ b/src/views/components/TurnOrderComponent/TurnOrderComponent.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=7 format=3 uid="uid://dsbegy218josn"] [ext_resource type="Texture2D" uid="uid://dqpa6f8n80d61" path="res://assets/characters/eleonoreOtsoga/EleonoreOtsogaPortrait.png" id="1_fnlle"] -[ext_resource type="Theme" uid="uid://dxg2mh1ceh3pc" path="res://components/TurnOrderComponent/TurnOrderTheme.tres" id="1_o2pqp"] -[ext_resource type="Script" uid="uid://016w4jxplp8d" path="res://components/TurnOrderComponent/TurnOrderComponent.cs" id="2_aj4ue"] +[ext_resource type="Theme" uid="uid://dxg2mh1ceh3pc" path="res://views/components/TurnOrderComponent/TurnOrderTheme.tres" id="1_o2pqp"] +[ext_resource type="Script" uid="uid://016w4jxplp8d" path="res://views/components/TurnOrderComponent/TurnOrderComponent.cs" id="2_aj4ue"] [ext_resource type="Resource" uid="uid://clrt1eby68x42" path="res://resources/Characters/Eleonore.tres" id="3_8cip4"] [ext_resource type="Resource" uid="uid://b4niu7ewhuinj" path="res://resources/Attributes/AttributesStore.tres" id="3_vlbb0"] [ext_resource type="Resource" uid="uid://bkolttux1bvi1" path="res://resources/Characters/Joanna.tres" id="5_ntmsh"] diff --git a/src/components/TurnOrderComponent/TurnOrderTheme.tres b/src/views/components/TurnOrderComponent/TurnOrderTheme.tres similarity index 100% rename from src/components/TurnOrderComponent/TurnOrderTheme.tres rename to src/views/components/TurnOrderComponent/TurnOrderTheme.tres diff --git a/src/scenes/GameplayTransitionManager.tscn b/src/views/scenes/GameplayTransitionManager.tscn similarity index 70% rename from src/scenes/GameplayTransitionManager.tscn rename to src/views/scenes/GameplayTransitionManager.tscn index 49de3df8..bc7671b0 100644 --- a/src/scenes/GameplayTransitionManager.tscn +++ b/src/views/scenes/GameplayTransitionManager.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=5 format=3 uid="uid://pmm3h25102wg"] -[ext_resource type="Script" uid="uid://bph4r6o283db6" path="res://features/UI/GameplayTransitionManager.cs" id="1_wx56g"] -[ext_resource type="PackedScene" uid="uid://bqbiqwyfv8mfg" path="res://scenes/gameplay/Lobby.tscn" id="3_kecqp"] -[ext_resource type="PackedScene" uid="uid://cbiewt2yq1klj" path="res://scenes/gameplay/Dungeon.tscn" id="3_s5y8n"] -[ext_resource type="PackedScene" uid="uid://8n50xik7xid3" path="res://scenes/gameplay/Battle.tscn" id="4_ml5um"] +[ext_resource type="Script" uid="uid://bph4r6o283db6" path="res://controllers/GameplayTransitionManager.cs" id="1_wx56g"] +[ext_resource type="PackedScene" uid="uid://bqbiqwyfv8mfg" path="res://views/scenes/gameplay/Lobby.tscn" id="3_kecqp"] +[ext_resource type="PackedScene" uid="uid://cbiewt2yq1klj" path="res://views/scenes/gameplay/Dungeon.tscn" id="3_s5y8n"] +[ext_resource type="PackedScene" uid="uid://8n50xik7xid3" path="res://views/scenes/gameplay/Battle.tscn" id="4_ml5um"] [node name="GameplayTransitionManager" type="Node"] script = ExtResource("1_wx56g") diff --git a/src/scenes/MenuTransitionManager.tscn b/src/views/scenes/MenuTransitionManager.tscn similarity index 70% rename from src/scenes/MenuTransitionManager.tscn rename to src/views/scenes/MenuTransitionManager.tscn index 9db0593a..6c17f66f 100644 --- a/src/scenes/MenuTransitionManager.tscn +++ b/src/views/scenes/MenuTransitionManager.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=5 format=3 uid="uid://m2cjh6t2impm"] -[ext_resource type="Script" uid="uid://de5a1nv2c7r1a" path="res://features/UI/MenuTransitionManager.cs" id="1_lkj8k"] -[ext_resource type="PackedScene" uid="uid://myouhbwr3b27" path="res://scenes/menus/MainMenu.tscn" id="2_db3kg"] -[ext_resource type="PackedScene" uid="uid://bqbiqwyfv8mfg" path="res://scenes/gameplay/Lobby.tscn" id="3_7yx2c"] -[ext_resource type="PackedScene" uid="uid://dp330lfyi8bfk" path="res://scenes/menus/GameOver.tscn" id="4_rilil"] +[ext_resource type="Script" uid="uid://de5a1nv2c7r1a" path="res://controllers/MenuTransitionManager.cs" id="1_lkj8k"] +[ext_resource type="PackedScene" uid="uid://myouhbwr3b27" path="res://views/scenes/menus/MainMenu.tscn" id="2_db3kg"] +[ext_resource type="PackedScene" uid="uid://bqbiqwyfv8mfg" path="res://views/scenes/gameplay/Lobby.tscn" id="3_7yx2c"] +[ext_resource type="PackedScene" uid="uid://dp330lfyi8bfk" path="res://views/scenes/menus/GameOver.tscn" id="4_rilil"] [node name="MenuTransitionManager" type="Node"] script = ExtResource("1_lkj8k") diff --git a/src/scenes/gameplay/Battle.tscn b/src/views/scenes/gameplay/Battle.tscn similarity index 98% rename from src/scenes/gameplay/Battle.tscn rename to src/views/scenes/gameplay/Battle.tscn index 245c0f9d..1f3932c4 100644 --- a/src/scenes/gameplay/Battle.tscn +++ b/src/views/scenes/gameplay/Battle.tscn @@ -1,13 +1,13 @@ [gd_scene load_steps=16 format=3 uid="uid://8n50xik7xid3"] -[ext_resource type="Script" uid="uid://jc3rfy1j13nu" path="res://features/Scenes/Battle/BattleManager.cs" id="1_oeh3a"] -[ext_resource type="SpriteFrames" uid="uid://fdkgmyh24b0q" path="res://assets/characters/joannaOtsoga/JoannaOtsogaSprites.tres" id="2_cgh0m"] -[ext_resource type="PackedScene" uid="uid://c22tpnmaefgn4" path="res://components/HUDComponent/HUDComponent.tscn" id="2_k1t2d"] -[ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://features/Grid/GridType.cs" id="6_6v2rn"] -[ext_resource type="Resource" uid="uid://d22hmntd0rfq2" path="res://resources/Characters/EnemyCharacterStore.tres" id="7_6v2rn"] -[ext_resource type="Texture2D" uid="uid://byujdpnhcw2vd" path="res://assets/prototype/Dark/texture_01.png" id="8_vpfel"] -[ext_resource type="Resource" uid="uid://snt34yslyn4f" path="res://resources/Characters/PlayerCharacterStore.tres" id="9_eybki"] -[ext_resource type="PackedScene" uid="uid://dmw0cm136sn4p" path="res://components/CharacterGrid/CharacterGrid.tscn" id="10_hsrxk"] +[ext_resource type="Script" uid="uid://jc3rfy1j13nu" path="res://controllers/BattleManager.cs" id="1_hf7dd"] +[ext_resource type="PackedScene" uid="uid://c22tpnmaefgn4" path="res://views/components/HUDComponent/HUDComponent.tscn" id="2_dcsho"] +[ext_resource type="SpriteFrames" uid="uid://fdkgmyh24b0q" path="res://assets/characters/joannaOtsoga/JoannaOtsogaSprites.tres" id="3_0d3nu"] +[ext_resource type="PackedScene" uid="uid://dmw0cm136sn4p" path="res://views/components/CharacterGrid/CharacterGrid.tscn" id="4_8j5p5"] +[ext_resource type="Resource" uid="uid://snt34yslyn4f" path="res://resources/Characters/PlayerCharacterStore.tres" id="5_0omgf"] +[ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://models/data/Grid/GridType.cs" id="6_cvc4r"] +[ext_resource type="Resource" uid="uid://d22hmntd0rfq2" path="res://resources/Characters/EnemyCharacterStore.tres" id="7_rbvwj"] +[ext_resource type="Texture2D" uid="uid://byujdpnhcw2vd" path="res://assets/prototype/Dark/texture_01.png" id="8_ymf4h"] [sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_vpfel"] sky_horizon_color = Color(0.662243, 0.671743, 0.686743, 1) @@ -26,40 +26,40 @@ sdfgi_enabled = true glow_enabled = true [sub_resource type="Resource" id="Resource_vpfel"] -script = ExtResource("6_6v2rn") +script = ExtResource("6_cvc4r") Prefix = "P" Offset = 0 -CharacterStore = ExtResource("9_eybki") +CharacterStore = ExtResource("5_0omgf") Direction = 0 Rows = 2 Columns = 3 Cells = Array[int]([0, 0, 0, 0, 0, 0]) -metadata/_custom_type_script = ExtResource("6_6v2rn") +metadata/_custom_type_script = ExtResource("6_cvc4r") [sub_resource type="Resource" id="Resource_hsrxk"] -script = ExtResource("6_6v2rn") +script = ExtResource("6_cvc4r") Prefix = "E" Offset = 2 -CharacterStore = ExtResource("7_6v2rn") +CharacterStore = ExtResource("7_rbvwj") Direction = 1 Rows = 2 Columns = 3 Cells = Array[int]([0, 0, 0, 0, 0, 0]) -metadata/_custom_type_script = ExtResource("6_6v2rn") +metadata/_custom_type_script = ExtResource("6_cvc4r") [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_hsrxk"] -albedo_texture = ExtResource("8_vpfel") +albedo_texture = ExtResource("8_ymf4h") uv1_scale = Vector3(5, 5, 5) uv1_triplanar = true [sub_resource type="BoxMesh" id="BoxMesh_eybki"] [node name="Battle" type="Node3D"] -script = ExtResource("1_oeh3a") +script = ExtResource("1_hf7dd") [node name="HUD" type="CanvasLayer" parent="."] -[node name="HUDContainer" parent="HUD" instance=ExtResource("2_k1t2d")] +[node name="HUDContainer" parent="HUD" instance=ExtResource("2_dcsho")] [node name="Characters" type="VBoxContainer" parent="."] visible = false @@ -170,7 +170,7 @@ size_flags_vertical = 10 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Rolling/VBoxContainer/Control3"] scale = Vector2(5, 5) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" offset = Vector2(0, -32) @@ -301,7 +301,7 @@ size_flags_vertical = 10 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Rolling/VBoxContainer2/Control3"] scale = Vector2(5, 5) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" offset = Vector2(0, -32) @@ -432,7 +432,7 @@ size_flags_vertical = 10 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Rolling/VBoxContainer3/Control3"] scale = Vector2(5, 5) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" offset = Vector2(0, -32) @@ -607,7 +607,7 @@ size_flags_vertical = 10 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Rolling/VBoxContainer4/Control3"] scale = Vector2(5, 5) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" offset = Vector2(0, -32) @@ -738,7 +738,7 @@ size_flags_vertical = 10 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Rolling/VBoxContainer5/Control3"] scale = Vector2(5, 5) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" offset = Vector2(0, -32) @@ -979,7 +979,7 @@ size_flags_vertical = 10 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Rolling/VBoxContainer6/Control3"] scale = Vector2(5, 5) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" offset = Vector2(0, -32) @@ -1220,7 +1220,7 @@ size_flags_vertical = 10 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Rolling/VBoxContainer7/Control3"] scale = Vector2(5, 5) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" offset = Vector2(0, -32) @@ -1461,7 +1461,7 @@ size_flags_vertical = 10 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Rolling/VBoxContainer8/Control3"] scale = Vector2(5, 5) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" offset = Vector2(0, -32) @@ -1702,7 +1702,7 @@ size_flags_vertical = 10 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Rolling/VBoxContainer9/Control3"] scale = Vector2(5, 5) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" offset = Vector2(0, -32) @@ -1943,7 +1943,7 @@ size_flags_vertical = 10 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Rolling/VBoxContainer10/Control3"] scale = Vector2(5, 5) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" offset = Vector2(0, -32) @@ -2184,7 +2184,7 @@ size_flags_vertical = 10 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Rolling/VBoxContainer11/Control3"] scale = Vector2(5, 5) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" offset = Vector2(0, -32) @@ -2425,7 +2425,7 @@ size_flags_vertical = 10 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Rolling/VBoxContainer12/Control3"] scale = Vector2(5, 5) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" offset = Vector2(0, -32) @@ -2666,7 +2666,7 @@ size_flags_vertical = 10 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Rolling/VBoxContainer13/Control3"] scale = Vector2(5, 5) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" offset = Vector2(0, -32) @@ -2689,7 +2689,7 @@ size_flags_vertical = 4 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Versus/Control3"] scale = Vector2(10, 10) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" @@ -2700,7 +2700,7 @@ size_flags_vertical = 4 [node name="AnimatedCharacter" type="AnimatedSprite2D" parent="Characters/Middle/Versus/Control4"] scale = Vector2(10, 10) -sprite_frames = ExtResource("2_cgh0m") +sprite_frames = ExtResource("3_0d3nu") animation = &"idle" autoplay = "idle" flip_h = true @@ -2724,7 +2724,7 @@ shadow_blur = 3.0 [node name="Camera3D" type="Camera3D" parent="."] transform = Transform3D(1, 0, 0, 0, 0.766045, 0.642787, 0, -0.642787, 0.766045, 0, 3, 2.5) -[node name="CharacterGrid3D" parent="." instance=ExtResource("10_hsrxk")] +[node name="CharacterGrid3D" parent="." instance=ExtResource("4_8j5p5")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4, 0, 0) GridConfigurations = [SubResource("Resource_vpfel"), SubResource("Resource_hsrxk")] CellPadding = 0.25 diff --git a/src/scenes/gameplay/Dungeon.tscn b/src/views/scenes/gameplay/Dungeon.tscn similarity index 95% rename from src/scenes/gameplay/Dungeon.tscn rename to src/views/scenes/gameplay/Dungeon.tscn index 98b738aa..46ff0902 100644 --- a/src/scenes/gameplay/Dungeon.tscn +++ b/src/views/scenes/gameplay/Dungeon.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://cbiewt2yq1klj"] -[ext_resource type="Script" uid="uid://245qm3j5dd5t" path="res://features/Dungeon/DungeonManager.cs" id="1_5cacr"] -[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://features/UI/SceneTransitionButton.cs" id="2_p0c6y"] +[ext_resource type="Script" uid="uid://245qm3j5dd5t" path="res://models/data/Dungeon/DungeonManager.cs" id="1_5cacr"] +[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://views/ui/SceneTransitionButton.cs" id="2_p0c6y"] [node name="Dungeon" type="Node2D"] script = ExtResource("1_5cacr") diff --git a/src/scenes/gameplay/Lobby.tscn b/src/views/scenes/gameplay/Lobby.tscn similarity index 94% rename from src/scenes/gameplay/Lobby.tscn rename to src/views/scenes/gameplay/Lobby.tscn index a111691f..c7d61a53 100644 --- a/src/scenes/gameplay/Lobby.tscn +++ b/src/views/scenes/gameplay/Lobby.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://bqbiqwyfv8mfg"] -[ext_resource type="Script" uid="uid://dtwnb70hiivar" path="res://features/Scenes/Lobby/LobbyManager.cs" id="1_rkuy2"] -[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://features/UI/SceneTransitionButton.cs" id="2_34wiv"] +[ext_resource type="Script" uid="uid://dtwnb70hiivar" path="res://controllers/LobbyManager.cs" id="1_rkuy2"] +[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://views/ui/SceneTransitionButton.cs" id="2_34wiv"] [node name="Lobby" type="Node2D"] script = ExtResource("1_rkuy2") diff --git a/src/scenes/menus/GameOver.tscn b/src/views/scenes/menus/GameOver.tscn similarity index 77% rename from src/scenes/menus/GameOver.tscn rename to src/views/scenes/menus/GameOver.tscn index ad162db9..51c9e40f 100644 --- a/src/scenes/menus/GameOver.tscn +++ b/src/views/scenes/menus/GameOver.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://dp330lfyi8bfk"] -[ext_resource type="Script" uid="uid://ch1237iccw3mf" path="res://features/Scenes/Menus/GameOverManager.cs" id="1_cjjvc"] +[ext_resource type="Script" uid="uid://ch1237iccw3mf" path="res://controllers/GameOverManager.cs" id="1_cjjvc"] [node name="GameOverMenu" type="Node2D"] script = ExtResource("1_cjjvc") diff --git a/src/scenes/menus/MainMenu.tscn b/src/views/scenes/menus/MainMenu.tscn similarity index 88% rename from src/scenes/menus/MainMenu.tscn rename to src/views/scenes/menus/MainMenu.tscn index 441c39cb..83f1bee2 100644 --- a/src/scenes/menus/MainMenu.tscn +++ b/src/views/scenes/menus/MainMenu.tscn @@ -1,11 +1,11 @@ [gd_scene load_steps=4 format=3 uid="uid://myouhbwr3b27"] -[ext_resource type="Script" uid="uid://p2tg6o2lnf5" path="res://features/Scenes/Menus/MainMenuManager.cs" id="1_hfxp8"] -[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://features/UI/SceneTransitionButton.cs" id="2_u85me"] -[ext_resource type="Script" uid="uid://bk4vy3txoi8tv" path="res://features/UI/CloseGameButton.cs" id="3_rlojh"] +[ext_resource type="Script" uid="uid://p2tg6o2lnf5" path="res://controllers/MainMenuManager.cs" id="1_vwte4"] +[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://views/ui/SceneTransitionButton.cs" id="2_mpm8c"] +[ext_resource type="Script" uid="uid://bk4vy3txoi8tv" path="res://views/ui/CloseGameButton.cs" id="3_uq48m"] [node name="MainMenu" type="Node2D"] -script = ExtResource("1_hfxp8") +script = ExtResource("1_vwte4") [node name="CanvasLayer" type="CanvasLayer" parent="."] @@ -70,10 +70,10 @@ size_flags_vertical = 3 [node name="StartGameButton" type="Button" parent="CanvasLayer/BottomContainer/ButtonsContainer"] layout_mode = 2 text = "Start Game" -script = ExtResource("2_u85me") +script = ExtResource("2_mpm8c") TypeOfTransition = 2 [node name="ExitGameButton" type="Button" parent="CanvasLayer/BottomContainer/ButtonsContainer"] layout_mode = 2 text = "Exit" -script = ExtResource("3_rlojh") +script = ExtResource("3_uq48m") diff --git a/src/features/UI/CloseGameButton.cs b/src/views/ui/CloseGameButton.cs similarity index 100% rename from src/features/UI/CloseGameButton.cs rename to src/views/ui/CloseGameButton.cs diff --git a/src/features/UI/CloseGameButton.cs.uid b/src/views/ui/CloseGameButton.cs.uid similarity index 100% rename from src/features/UI/CloseGameButton.cs.uid rename to src/views/ui/CloseGameButton.cs.uid diff --git a/src/features/UI/SceneTransitionButton.cs b/src/views/ui/SceneTransitionButton.cs similarity index 100% rename from src/features/UI/SceneTransitionButton.cs rename to src/views/ui/SceneTransitionButton.cs diff --git a/src/features/UI/SceneTransitionButton.cs.uid b/src/views/ui/SceneTransitionButton.cs.uid similarity index 100% rename from src/features/UI/SceneTransitionButton.cs.uid rename to src/views/ui/SceneTransitionButton.cs.uid diff --git a/src/helpers/Arc2D.cs b/src/views/utils/Arc2D.cs similarity index 100% rename from src/helpers/Arc2D.cs rename to src/views/utils/Arc2D.cs diff --git a/src/helpers/Arc2D.cs.uid b/src/views/utils/Arc2D.cs.uid similarity index 100% rename from src/helpers/Arc2D.cs.uid rename to src/views/utils/Arc2D.cs.uid diff --git a/src/helpers/Arc3DRenderer/Arc3DRenderer.cs b/src/views/utils/Arc3DRenderer/Arc3DRenderer.cs similarity index 100% rename from src/helpers/Arc3DRenderer/Arc3DRenderer.cs rename to src/views/utils/Arc3DRenderer/Arc3DRenderer.cs diff --git a/src/helpers/Arc3DRenderer/Arc3DRenderer.cs.uid b/src/views/utils/Arc3DRenderer/Arc3DRenderer.cs.uid similarity index 100% rename from src/helpers/Arc3DRenderer/Arc3DRenderer.cs.uid rename to src/views/utils/Arc3DRenderer/Arc3DRenderer.cs.uid diff --git a/src/helpers/Arc3DRenderer/Arc3DRenderer.tscn b/src/views/utils/Arc3DRenderer/Arc3DRenderer.tscn similarity index 79% rename from src/helpers/Arc3DRenderer/Arc3DRenderer.tscn rename to src/views/utils/Arc3DRenderer/Arc3DRenderer.tscn index 2273eec9..88ac4c5a 100644 --- a/src/helpers/Arc3DRenderer/Arc3DRenderer.tscn +++ b/src/views/utils/Arc3DRenderer/Arc3DRenderer.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://djth012ehvnu2"] -[ext_resource type="Script" uid="uid://bneeqn85v2ons" path="res://helpers/Arc3DRenderer/Arc3DRenderer.cs" id="1_umdm2"] +[ext_resource type="Script" uid="uid://bneeqn85v2ons" path="res://views/utils/Arc3DRenderer/Arc3DRenderer.cs" id="1_umdm2"] [node name="Arc3DRenderer" type="Node3D"] script = ExtResource("1_umdm2") diff --git a/src/helpers/Arc3DRenderer/Arc3DRenderer.uid b/src/views/utils/Arc3DRenderer/Arc3DRenderer.uid similarity index 100% rename from src/helpers/Arc3DRenderer/Arc3DRenderer.uid rename to src/views/utils/Arc3DRenderer/Arc3DRenderer.uid diff --git a/src/features/UI/ArcDrawer.cs b/src/views/utils/ArcDrawer.cs similarity index 100% rename from src/features/UI/ArcDrawer.cs rename to src/views/utils/ArcDrawer.cs diff --git a/src/features/UI/ArcDrawer.cs.uid b/src/views/utils/ArcDrawer.cs.uid similarity index 100% rename from src/features/UI/ArcDrawer.cs.uid rename to src/views/utils/ArcDrawer.cs.uid From 8fa71e81fa06a5448b36953003d2662fa9c683b5 Mon Sep 17 00:00:00 2001 From: Danilo Nobre Date: Sun, 9 Mar 2025 21:50:00 -0300 Subject: [PATCH 03/13] implementing the basic structure for renderers as entities and components --- src/README.md | 38 ++-- src/assets/editor/component-2d.svg | 1 + src/assets/editor/component-2d.svg.import | 37 +++ src/assets/editor/component-3d.svg | 1 + src/assets/editor/component-3d.svg.import | 37 +++ src/assets/editor/component-ui.svg | 1 + src/assets/editor/component-ui.svg.import | 37 +++ src/assets/editor/entity-3d.svg | 1 + src/assets/editor/entity-3d.svg.import | 37 +++ src/assets/game_icon.svg | 1 + src/assets/{icons => }/game_icon.svg.import | 6 +- src/assets/icons/game_icon.svg | 1 - src/events/EventBus.cs | 2 - src/helpers/SignalHelper.cs | 50 ++++ src/helpers/SignalHelper.cs.uid | 1 + src/models/data/Character/CharacterType.cs | 9 +- .../data/Character/ICharacterAssetSheet.cs | 1 + src/project.godot | 16 +- src/{views => renderers}/ISelectable.cs.uid | 0 .../SelectionHandler.cs.uid | 0 .../components/AnimatedSpriteComponent.cs | 53 +++++ .../components/AnimatedSpriteComponent.cs.uid | 1 + .../CharacterComponent/CharacterComponent.cs | 0 .../CharacterComponent.cs.uid | 0 .../CharacterComponent.tscn | 2 +- .../components/CharacterGrid/Arrow.tscn | 0 .../components/CharacterGrid/CharacterGrid.cs | 0 .../CharacterGrid/CharacterGrid.cs.uid | 0 .../CharacterGrid/CharacterGrid.tscn | 6 +- .../components/CharacterGrid/Grid3D.cs | 0 .../components/CharacterGrid/Grid3D.cs.uid | 0 .../components/CharacterGrid/GridCell3D.cs | 0 .../CharacterGrid/GridCell3D.cs.uid | 0 .../CharacterInspector/CharacterInspector.cs | 0 .../CharacterInspector.cs.uid | 0 .../CharacterInspector.tscn | 2 +- .../components/GameLog/GameLogComponent.cs | 0 .../GameLog/GameLogComponent.cs.uid | 0 .../components/GameLog/GameLogComponent.tscn | 2 +- .../components/HUDComponent/HUDComponent.tscn | 10 +- .../InventoryComponent/InventoryComponent.cs | 0 .../InventoryComponent.cs.uid | 0 .../InventoryComponent.tscn | 4 +- .../components/InventoryComponent/slot.png | Bin .../InventoryComponent/slot.png.import | 6 +- .../components/InventoryComponent/test.tscn | 2 +- .../InventoryItemComponent.cs | 0 .../InventoryItemComponent.cs.uid | 0 .../InventoryItemComponent.tscn | 4 +- .../components/SelectableComponent.cs | 215 ++++++++++++++++++ .../components/SelectableComponent.cs.uid | 1 + .../TooltipComponent/TooltipComponent.cs | 0 .../TooltipComponent/TooltipComponent.cs.uid | 0 .../TooltipComponent/TooltipComponent.tscn | 4 +- .../components/TooltipComponent/icon.png | Bin .../TooltipComponent/icon.png.import | 6 +- .../TurnOrderComponent/TurnOrderComponent.cs | 0 .../TurnOrderComponent.cs.uid | 0 .../TurnOrderComponent.tscn | 4 +- .../TurnOrderComponent/TurnOrderTheme.tres | 0 .../CharacterEntity/CharacterEntity.cs | 17 ++ .../CharacterEntity/CharacterEntity.cs.uid | 1 + .../CharacterEntity/CharacterEntity.tscn | 32 +++ src/renderers/entities/Enitity.cs.uid | 1 + src/renderers/entities/Entity3D.cs | 54 +++++ src/renderers/entities/Entity3D.cs.uid | 1 + .../scenes/GameplayTransitionManager.tscn | 6 +- .../scenes/MenuTransitionManager.tscn | 6 +- .../scenes/gameplay/Battle.tscn | 10 +- .../scenes/gameplay/Dungeon.tscn | 2 +- .../scenes/gameplay/Lobby.tscn | 2 +- .../scenes/menus/GameOver.tscn | 0 .../scenes/menus/MainMenu.tscn | 4 +- .../ui/CloseGameButton.cs | 0 .../ui/CloseGameButton.cs.uid | 0 .../ui/SceneTransitionButton.cs | 0 .../ui/SceneTransitionButton.cs.uid | 0 src/{views => renderers}/utils/Arc2D.cs | 0 src/{views => renderers}/utils/Arc2D.cs.uid | 0 .../utils/Arc3DRenderer/Arc3DRenderer.cs | 0 .../utils/Arc3DRenderer/Arc3DRenderer.cs.uid | 0 .../utils/Arc3DRenderer/Arc3DRenderer.tscn | 2 +- .../utils/Arc3DRenderer/Arc3DRenderer.uid | 0 src/{views => renderers}/utils/ArcDrawer.cs | 0 .../utils/ArcDrawer.cs.uid | 0 src/resources/Attributes/Armor.tres | 2 +- src/resources/Attributes/Speed.tres | 2 +- src/resources/Characters/Dummy.tres | 9 +- src/resources/Characters/Eleonore.tres | 9 +- .../Characters/EnemyCharacterStore.tres | 5 +- src/resources/Characters/Joanna.tres | 11 +- .../Characters/PlayerCharacterStore.tres | 5 +- src/resources/Roles/Playable/Fighter.tres | 6 +- 93 files changed, 689 insertions(+), 97 deletions(-) create mode 100644 src/assets/editor/component-2d.svg create mode 100644 src/assets/editor/component-2d.svg.import create mode 100644 src/assets/editor/component-3d.svg create mode 100644 src/assets/editor/component-3d.svg.import create mode 100644 src/assets/editor/component-ui.svg create mode 100644 src/assets/editor/component-ui.svg.import create mode 100644 src/assets/editor/entity-3d.svg create mode 100644 src/assets/editor/entity-3d.svg.import create mode 100644 src/assets/game_icon.svg rename src/assets/{icons => }/game_icon.svg.import (75%) delete mode 100644 src/assets/icons/game_icon.svg create mode 100644 src/helpers/SignalHelper.cs create mode 100644 src/helpers/SignalHelper.cs.uid rename src/{views => renderers}/ISelectable.cs.uid (100%) rename src/{views => renderers}/SelectionHandler.cs.uid (100%) create mode 100644 src/renderers/components/AnimatedSpriteComponent.cs create mode 100644 src/renderers/components/AnimatedSpriteComponent.cs.uid rename src/{views => renderers}/components/CharacterComponent/CharacterComponent.cs (100%) rename src/{views => renderers}/components/CharacterComponent/CharacterComponent.cs.uid (100%) rename src/{views => renderers}/components/CharacterComponent/CharacterComponent.tscn (96%) rename src/{views => renderers}/components/CharacterGrid/Arrow.tscn (100%) rename src/{views => renderers}/components/CharacterGrid/CharacterGrid.cs (100%) rename src/{views => renderers}/components/CharacterGrid/CharacterGrid.cs.uid (100%) rename src/{views => renderers}/components/CharacterGrid/CharacterGrid.tscn (83%) rename src/{views => renderers}/components/CharacterGrid/Grid3D.cs (100%) rename src/{views => renderers}/components/CharacterGrid/Grid3D.cs.uid (100%) rename src/{views => renderers}/components/CharacterGrid/GridCell3D.cs (100%) rename src/{views => renderers}/components/CharacterGrid/GridCell3D.cs.uid (100%) rename src/{views => renderers}/components/CharacterInspector/CharacterInspector.cs (100%) rename src/{views => renderers}/components/CharacterInspector/CharacterInspector.cs.uid (100%) rename src/{views => renderers}/components/CharacterInspector/CharacterInspector.tscn (98%) rename src/{views => renderers}/components/GameLog/GameLogComponent.cs (100%) rename src/{views => renderers}/components/GameLog/GameLogComponent.cs.uid (100%) rename src/{views => renderers}/components/GameLog/GameLogComponent.tscn (97%) rename src/{views => renderers}/components/HUDComponent/HUDComponent.tscn (88%) rename src/{views => renderers}/components/InventoryComponent/InventoryComponent.cs (100%) rename src/{views => renderers}/components/InventoryComponent/InventoryComponent.cs.uid (100%) rename src/{views => renderers}/components/InventoryComponent/InventoryComponent.tscn (81%) rename src/{views => renderers}/components/InventoryComponent/slot.png (100%) rename src/{views => renderers}/components/InventoryComponent/slot.png.import (70%) rename src/{views => renderers}/components/InventoryComponent/test.tscn (95%) rename src/{views => renderers}/components/InventoryItemComponent/InventoryItemComponent.cs (100%) rename src/{views => renderers}/components/InventoryItemComponent/InventoryItemComponent.cs.uid (100%) rename src/{views => renderers}/components/InventoryItemComponent/InventoryItemComponent.tscn (78%) create mode 100644 src/renderers/components/SelectableComponent.cs create mode 100644 src/renderers/components/SelectableComponent.cs.uid rename src/{views => renderers}/components/TooltipComponent/TooltipComponent.cs (100%) rename src/{views => renderers}/components/TooltipComponent/TooltipComponent.cs.uid (100%) rename src/{views => renderers}/components/TooltipComponent/TooltipComponent.tscn (96%) rename src/{views => renderers}/components/TooltipComponent/icon.png (100%) rename src/{views => renderers}/components/TooltipComponent/icon.png.import (71%) rename src/{views => renderers}/components/TurnOrderComponent/TurnOrderComponent.cs (100%) rename src/{views => renderers}/components/TurnOrderComponent/TurnOrderComponent.cs.uid (100%) rename src/{views => renderers}/components/TurnOrderComponent/TurnOrderComponent.tscn (96%) rename src/{views => renderers}/components/TurnOrderComponent/TurnOrderTheme.tres (100%) create mode 100644 src/renderers/entities/CharacterEntity/CharacterEntity.cs create mode 100644 src/renderers/entities/CharacterEntity/CharacterEntity.cs.uid create mode 100644 src/renderers/entities/CharacterEntity/CharacterEntity.tscn create mode 100644 src/renderers/entities/Enitity.cs.uid create mode 100644 src/renderers/entities/Entity3D.cs create mode 100644 src/renderers/entities/Entity3D.cs.uid rename src/{views => renderers}/scenes/GameplayTransitionManager.tscn (76%) rename src/{views => renderers}/scenes/MenuTransitionManager.tscn (76%) rename src/{views => renderers}/scenes/gameplay/Battle.tscn (99%) rename src/{views => renderers}/scenes/gameplay/Dungeon.tscn (97%) rename src/{views => renderers}/scenes/gameplay/Lobby.tscn (97%) rename src/{views => renderers}/scenes/menus/GameOver.tscn (100%) rename src/{views => renderers}/scenes/menus/MainMenu.tscn (95%) rename src/{views => renderers}/ui/CloseGameButton.cs (100%) rename src/{views => renderers}/ui/CloseGameButton.cs.uid (100%) rename src/{views => renderers}/ui/SceneTransitionButton.cs (100%) rename src/{views => renderers}/ui/SceneTransitionButton.cs.uid (100%) rename src/{views => renderers}/utils/Arc2D.cs (100%) rename src/{views => renderers}/utils/Arc2D.cs.uid (100%) rename src/{views => renderers}/utils/Arc3DRenderer/Arc3DRenderer.cs (100%) rename src/{views => renderers}/utils/Arc3DRenderer/Arc3DRenderer.cs.uid (100%) rename src/{views => renderers}/utils/Arc3DRenderer/Arc3DRenderer.tscn (78%) rename src/{views => renderers}/utils/Arc3DRenderer/Arc3DRenderer.uid (100%) rename src/{views => renderers}/utils/ArcDrawer.cs (100%) rename src/{views => renderers}/utils/ArcDrawer.cs.uid (100%) diff --git a/src/README.md b/src/README.md index ea51b2bd..e12669cd 100644 --- a/src/README.md +++ b/src/README.md @@ -20,35 +20,33 @@ ```bash . └── src - ├── addons # bibliotecas third party - │ └── @spacewiz # plugins desenvolvidos para o projeto + ├── addons # bibliotecas third party + │ └── @spacewiz # plugins desenvolvidos para o projeto │ - ├── assets # assets como sprites, sons, texturas e seus arquivos de configuração + ├── assets # assets como sprites, sons, texturas e seus arquivos de configuração │ - ├── controllers # comunicação entre a view e o model, interatividade e controle de eventos - │ # lógica de alto nível, como o controle do estado do jogo, cenas e transições + ├── controllers # comunicação entre a view e o model, interatividade e controle de eventos + │ # lógica de alto nível, como o controle do estado do jogo, cenas e transições │ - ├── events # comunicação entre os models, views e controllers - │ # TODO: bus, handlers, types + ├── events # comunicação por signals entre os models, views e controllers + │ # TODO: bus, handlers, types │ ├── models - │ ├── data # tipos de dados (resources) que representam informações do jogo - │ ├── services # regras de negócios e acesso aos dados - │ │ # processamento e manipulação dos dados, interação direta com as stores - │ └── stores # estado e armazenamento persistente dos dados + │ ├── data # estruturas dos dados + │ ├── services # manipulação de dados e regras de negócio + │ └── stores # estado em tempo de execução (cache e gerenciamento) │ - ├── views # View layer: visualização - │ ├── - │ ├── - │ ├── - │ ├── - │ └── + ├── renderers # visualização e renderização do jogo + │ ├── components # componentes reutilizáveis + │ ├── entities # entidades do jogo + │ ├── scenes # cenas do jogo + │ └── ui # elementos de interface do usuário │ - ├── helpers # classes utilitárias + ├── helpers # classes utilitárias │ - ├── resources # arquivos de configuração dos dados do jogo + ├── resources # arquivos de configuração estáticos do jogo │ - └── tests # testes unitários e cenas específicas para testes + └── tests # testes unitários e cenas específicas para testes ``` ## Ambiente de Desenvolvimento diff --git a/src/assets/editor/component-2d.svg b/src/assets/editor/component-2d.svg new file mode 100644 index 00000000..84c51d76 --- /dev/null +++ b/src/assets/editor/component-2d.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/editor/component-2d.svg.import b/src/assets/editor/component-2d.svg.import new file mode 100644 index 00000000..7d05466e --- /dev/null +++ b/src/assets/editor/component-2d.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://8qjof4th0hph" +path="res://.godot/imported/component-2d.svg-693354b67b6ec21bc062de4e69cf7860.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/editor/component-2d.svg" +dest_files=["res://.godot/imported/component-2d.svg-693354b67b6ec21bc062de4e69cf7860.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/src/assets/editor/component-3d.svg b/src/assets/editor/component-3d.svg new file mode 100644 index 00000000..b67cf5a9 --- /dev/null +++ b/src/assets/editor/component-3d.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/editor/component-3d.svg.import b/src/assets/editor/component-3d.svg.import new file mode 100644 index 00000000..4130a0d6 --- /dev/null +++ b/src/assets/editor/component-3d.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d1dsrwcub67sk" +path="res://.godot/imported/component-3d.svg-29408208e061cd0e639da0df2b3ccd98.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/editor/component-3d.svg" +dest_files=["res://.godot/imported/component-3d.svg-29408208e061cd0e639da0df2b3ccd98.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/src/assets/editor/component-ui.svg b/src/assets/editor/component-ui.svg new file mode 100644 index 00000000..bea20254 --- /dev/null +++ b/src/assets/editor/component-ui.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/editor/component-ui.svg.import b/src/assets/editor/component-ui.svg.import new file mode 100644 index 00000000..bd1c29e4 --- /dev/null +++ b/src/assets/editor/component-ui.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bp82a77vxajmr" +path="res://.godot/imported/component-ui.svg-af62a7b148b3125632c192120a76800f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/editor/component-ui.svg" +dest_files=["res://.godot/imported/component-ui.svg-af62a7b148b3125632c192120a76800f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/src/assets/editor/entity-3d.svg b/src/assets/editor/entity-3d.svg new file mode 100644 index 00000000..22891b7a --- /dev/null +++ b/src/assets/editor/entity-3d.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/editor/entity-3d.svg.import b/src/assets/editor/entity-3d.svg.import new file mode 100644 index 00000000..57af453d --- /dev/null +++ b/src/assets/editor/entity-3d.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d3ht0y574oi3k" +path="res://.godot/imported/entity-3d.svg-5df10caed523e7365f87027315567534.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/editor/entity-3d.svg" +dest_files=["res://.godot/imported/entity-3d.svg-5df10caed523e7365f87027315567534.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/src/assets/game_icon.svg b/src/assets/game_icon.svg new file mode 100644 index 00000000..910728a3 --- /dev/null +++ b/src/assets/game_icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/src/assets/icons/game_icon.svg.import b/src/assets/game_icon.svg.import similarity index 75% rename from src/assets/icons/game_icon.svg.import rename to src/assets/game_icon.svg.import index 4e251889..da9fdc39 100644 --- a/src/assets/icons/game_icon.svg.import +++ b/src/assets/game_icon.svg.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://bmcfxb2srpt1o" -path="res://.godot/imported/game_icon.svg-41ccc983228d67910926b618217510d7.ctex" +path="res://.godot/imported/game_icon.svg-3b3ba44fde827daca58c84390ae3f62b.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/icons/game_icon.svg" -dest_files=["res://.godot/imported/game_icon.svg-41ccc983228d67910926b618217510d7.ctex"] +source_file="res://assets/game_icon.svg" +dest_files=["res://.godot/imported/game_icon.svg-3b3ba44fde827daca58c84390ae3f62b.ctex"] [params] diff --git a/src/assets/icons/game_icon.svg b/src/assets/icons/game_icon.svg deleted file mode 100644 index 164ac3ee..00000000 --- a/src/assets/icons/game_icon.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/src/events/EventBus.cs b/src/events/EventBus.cs index 846a4b7b..a348edb6 100644 --- a/src/events/EventBus.cs +++ b/src/events/EventBus.cs @@ -54,7 +54,6 @@ public void OnCharacterSelected(CharacterComponent character) { var characterName = character?.Character?.Name ?? "Unknown"; if (character is not null) { - // GD.Print("Emitting CharacterSelected signal with character: ", characterName); EmitSignal(nameof(CharacterSelected), character); } else { @@ -65,5 +64,4 @@ public void OnCharacterSelected(CharacterComponent character) { public void OnCharacterUnselected() { EmitSignal(nameof(CharacterUnselected)); } - } \ No newline at end of file diff --git a/src/helpers/SignalHelper.cs b/src/helpers/SignalHelper.cs new file mode 100644 index 00000000..bb8fc2fe --- /dev/null +++ b/src/helpers/SignalHelper.cs @@ -0,0 +1,50 @@ +using Godot; + +namespace DiceRolling.Helpers; + +/// +/// Helper class for safely connecting and disconnecting signals in Godot +/// +public static class SignalHelper { + /// + /// Safely connects a signal from a source object to a target method + /// + /// The source object that emits the signal + /// Name of the signal to connect + /// The target object that will receive the signal + /// Name of the method to call when the signal is emitted + public static void ConnectSignal(GodotObject? source, string signalName, GodotObject target, string methodName) { + if (source == null) + return; + + if (!source.HasSignal(signalName)) { + GD.PushWarning($"Object of type {source.GetType()} does not have signal '{signalName}'"); + return; + } + + // Check if the signal is already connected to avoid duplicates + if (source.IsConnected(signalName, new Callable(target, methodName))) + return; + + source.Connect(signalName, new Callable(target, methodName)); + } + + /// + /// Safely disconnects a signal from a source object + /// + /// The source object that emits the signal + /// Name of the signal to disconnect + /// The target object that was receiving the signal + /// Name of the method that was called when the signal was emitted + public static void DisconnectSignal(GodotObject? source, string signalName, GodotObject target, string methodName) { + if (source == null) + return; + + if (!source.HasSignal(signalName)) + return; + + // Only disconnect if the signal is actually connected + if (source.IsConnected(signalName, new Callable(target, methodName))) + source.Disconnect(signalName, new Callable(target, methodName)); + } +} \ No newline at end of file diff --git a/src/helpers/SignalHelper.cs.uid b/src/helpers/SignalHelper.cs.uid new file mode 100644 index 00000000..0ed03bd6 --- /dev/null +++ b/src/helpers/SignalHelper.cs.uid @@ -0,0 +1 @@ +uid://b0caks2q4dvjo diff --git a/src/models/data/Character/CharacterType.cs b/src/models/data/Character/CharacterType.cs index fc0d7109..e3bac3c7 100644 --- a/src/models/data/Character/CharacterType.cs +++ b/src/models/data/Character/CharacterType.cs @@ -22,9 +22,9 @@ public partial class CharacterType : IdentifiableResource, ICharacter { private float _spritePositionX; private float _spritePositionY; private RoleType? _role; - private readonly Dictionary _attributeCurrentValueCache = new Dictionary(); - private readonly Dictionary _attributeMaxValueCache = new Dictionary(); - private readonly Dictionary _attributeBaseValueCache = new Dictionary(); + private readonly Dictionary _attributeCurrentValueCache = []; + private readonly Dictionary _attributeMaxValueCache = []; + private readonly Dictionary _attributeBaseValueCache = []; [Signal] public delegate void AttributeChangedEventHandler(CharacterType character, AttributeType attributeType); @@ -52,6 +52,9 @@ public string Name { [Export] public SpriteFrames? CharacterSprite { get; set; } + [Export] + public float PixelSize { get; set; } = 0.01f; + [Export] public SpriteFrames? ShadowSprite { get; set; } diff --git a/src/models/data/Character/ICharacterAssetSheet.cs b/src/models/data/Character/ICharacterAssetSheet.cs index 38b9bce8..e2fa704a 100644 --- a/src/models/data/Character/ICharacterAssetSheet.cs +++ b/src/models/data/Character/ICharacterAssetSheet.cs @@ -8,6 +8,7 @@ namespace DiceRolling.Characters; public interface ICharacterAssetSheet { Texture2D? Portrait { get; set; } SpriteFrames? CharacterSprite { get; set; } + float PixelSize { get; set; } SpriteFrames? ShadowSprite { get; set; } bool ShowShadow { get; set; } float SpritePositionX { get; set; } diff --git a/src/project.godot b/src/project.godot index 97545f67..a81e46fa 100644 --- a/src/project.godot +++ b/src/project.godot @@ -11,17 +11,15 @@ config_version=5 [application] config/name="dice-rolling" -run/main_scene="res://views/scenes/menus/MainMenu.tscn" +run/main_scene="res://renderers/scenes/menus/MainMenu.tscn" config/features=PackedStringArray("4.4", "C#", "Forward Plus") config/icon="uid://bmcfxb2srpt1o" [autoload] -GameplayTransitionManager="*res://views/scenes/GameplayTransitionManager.tscn" -MenuTransitionManager="*res://views/scenes/MenuTransitionManager.tscn" -DiceStore="*res://models/stores/DiceStore.cs" -GameLogStore="*res://models/stores/GameLogStore.cs" Shaker="*res://addons/shaker/src/Shaker.gd" +Signal_Debugger="*res://addons/SignalVisualizer/Debugger/SignalDebugger.gd" +EventBus="*res://events/EventBus.cs" [collada] @@ -49,7 +47,7 @@ version_control/autoload_on_startup=true [editor_plugins] -enabled=PackedStringArray("res://addons/@spacewiz/Arc3DEditorPlugin/plugin.cfg", "res://addons/@spacewiz/TargetBoardEditorPlugin/plugin.cfg", "res://addons/DragNDropNodes/plugin.cfg", "res://addons/gdUnit4/plugin.cfg", "res://addons/imrp/plugin.cfg", "res://addons/shaker/plugin.cfg") +enabled=PackedStringArray("res://addons/@spacewiz/Arc3DEditorPlugin/plugin.cfg", "res://addons/@spacewiz/TargetBoardEditorPlugin/plugin.cfg", "res://addons/SignalVisualizer/plugin.cfg", "res://addons/gdUnit4/plugin.cfg", "res://addons/imrp/plugin.cfg", "res://addons/shaker/plugin.cfg") [file_customization] @@ -61,10 +59,10 @@ folder_colors={ "res://events/": "green", "res://helpers/": "gray", "res://models/": "blue", +"res://renderers/": "orange", +"res://renderers/scenes/": "orange", "res://resources/": "pink", -"res://tests/": "gray", -"res://views/": "orange", -"res://views/scenes/": "orange" +"res://tests/": "gray" } [gdunit4] diff --git a/src/views/ISelectable.cs.uid b/src/renderers/ISelectable.cs.uid similarity index 100% rename from src/views/ISelectable.cs.uid rename to src/renderers/ISelectable.cs.uid diff --git a/src/views/SelectionHandler.cs.uid b/src/renderers/SelectionHandler.cs.uid similarity index 100% rename from src/views/SelectionHandler.cs.uid rename to src/renderers/SelectionHandler.cs.uid diff --git a/src/renderers/components/AnimatedSpriteComponent.cs b/src/renderers/components/AnimatedSpriteComponent.cs new file mode 100644 index 00000000..a33808ac --- /dev/null +++ b/src/renderers/components/AnimatedSpriteComponent.cs @@ -0,0 +1,53 @@ +using Godot; +using DiceRolling.Entities; +using DiceRolling.Characters; +using DiceRolling.Helpers; + +namespace DiceRolling.Components; + +[Tool] +[GlobalClass] +[Icon("res://assets/editor/component-3d.svg")] +public partial class AnimatedSpriteComponent : AnimatedSprite3D { + private Entity3D? _parent; + + public override void _Ready() { + _parent = GetParent(); + + if (_parent != null) { + SignalHelper.ConnectSignal(_parent, nameof(Entity3D.EntityUpdated), this, nameof(OnEntityUpdated)); + UpdateSprite(); + } + } + + public override void _ExitTree() { + if (_parent != null) { + SignalHelper.DisconnectSignal(_parent, nameof(Entity3D.EntityUpdated), this, nameof(OnEntityUpdated)); + } + } + + private void OnEntityUpdated() { + UpdateSprite(); + } + + private void UpdateSprite() { + if (_parent == null) return; + + var characterData = _parent.GetData(); + if (characterData == null) return; + + if (characterData.CharacterSprite != null) { + SpriteFrames = characterData.CharacterSprite; + } + + PixelSize = characterData.PixelSize; + + Offset = new Vector2( + characterData.SpritePositionX, + characterData.SpritePositionY + ); + + Play("idle"); + + } +} \ No newline at end of file diff --git a/src/renderers/components/AnimatedSpriteComponent.cs.uid b/src/renderers/components/AnimatedSpriteComponent.cs.uid new file mode 100644 index 00000000..3741ad39 --- /dev/null +++ b/src/renderers/components/AnimatedSpriteComponent.cs.uid @@ -0,0 +1 @@ +uid://cejuccgxo60qs diff --git a/src/views/components/CharacterComponent/CharacterComponent.cs b/src/renderers/components/CharacterComponent/CharacterComponent.cs similarity index 100% rename from src/views/components/CharacterComponent/CharacterComponent.cs rename to src/renderers/components/CharacterComponent/CharacterComponent.cs diff --git a/src/views/components/CharacterComponent/CharacterComponent.cs.uid b/src/renderers/components/CharacterComponent/CharacterComponent.cs.uid similarity index 100% rename from src/views/components/CharacterComponent/CharacterComponent.cs.uid rename to src/renderers/components/CharacterComponent/CharacterComponent.cs.uid diff --git a/src/views/components/CharacterComponent/CharacterComponent.tscn b/src/renderers/components/CharacterComponent/CharacterComponent.tscn similarity index 96% rename from src/views/components/CharacterComponent/CharacterComponent.tscn rename to src/renderers/components/CharacterComponent/CharacterComponent.tscn index ac5d31cc..28489e58 100644 --- a/src/views/components/CharacterComponent/CharacterComponent.tscn +++ b/src/renderers/components/CharacterComponent/CharacterComponent.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=3 uid="uid://d3lkjx05elcwq"] -[ext_resource type="Script" uid="uid://f1lqpaw1xng7" path="res://views/components/CharacterComponent/CharacterComponent.cs" id="1_t0krx"] +[ext_resource type="Script" uid="uid://f1lqpaw1xng7" path="res://renderers/components/CharacterComponent/CharacterComponent.cs" id="1_t0krx"] [ext_resource type="Texture2D" uid="uid://cytb6ea63fslt" path="res://assets/icons/hud/select.png" id="3_gxxii"] [ext_resource type="SpriteFrames" uid="uid://fdkgmyh24b0q" path="res://assets/characters/joannaOtsoga/JoannaOtsogaSprites.tres" id="4_svr47"] diff --git a/src/views/components/CharacterGrid/Arrow.tscn b/src/renderers/components/CharacterGrid/Arrow.tscn similarity index 100% rename from src/views/components/CharacterGrid/Arrow.tscn rename to src/renderers/components/CharacterGrid/Arrow.tscn diff --git a/src/views/components/CharacterGrid/CharacterGrid.cs b/src/renderers/components/CharacterGrid/CharacterGrid.cs similarity index 100% rename from src/views/components/CharacterGrid/CharacterGrid.cs rename to src/renderers/components/CharacterGrid/CharacterGrid.cs diff --git a/src/views/components/CharacterGrid/CharacterGrid.cs.uid b/src/renderers/components/CharacterGrid/CharacterGrid.cs.uid similarity index 100% rename from src/views/components/CharacterGrid/CharacterGrid.cs.uid rename to src/renderers/components/CharacterGrid/CharacterGrid.cs.uid diff --git a/src/views/components/CharacterGrid/CharacterGrid.tscn b/src/renderers/components/CharacterGrid/CharacterGrid.tscn similarity index 83% rename from src/views/components/CharacterGrid/CharacterGrid.tscn rename to src/renderers/components/CharacterGrid/CharacterGrid.tscn index 0b7b85df..fd760992 100644 --- a/src/views/components/CharacterGrid/CharacterGrid.tscn +++ b/src/renderers/components/CharacterGrid/CharacterGrid.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=7 format=3 uid="uid://dmw0cm136sn4p"] -[ext_resource type="Script" uid="uid://gymkyw1r3mtn" path="res://views/components/CharacterGrid/CharacterGrid.cs" id="1_tabhr"] +[ext_resource type="Script" uid="uid://gymkyw1r3mtn" path="res://renderers/components/CharacterGrid/CharacterGrid.cs" id="1_tabhr"] [ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://models/data/Grid/GridType.cs" id="2_ml3sj"] -[ext_resource type="PackedScene" uid="uid://d3lkjx05elcwq" path="res://views/components/CharacterComponent/CharacterComponent.tscn" id="4_3uydg"] -[ext_resource type="PackedScene" uid="uid://bltesg17i4ul8" path="res://views/components/CharacterGrid/Arrow.tscn" id="5_og5wa"] +[ext_resource type="PackedScene" uid="uid://d3lkjx05elcwq" path="res://renderers/components/CharacterComponent/CharacterComponent.tscn" id="4_3uydg"] +[ext_resource type="PackedScene" uid="uid://bltesg17i4ul8" path="res://renderers/components/CharacterGrid/Arrow.tscn" id="5_og5wa"] [sub_resource type="Resource" id="Resource_jan7r"] script = ExtResource("2_ml3sj") diff --git a/src/views/components/CharacterGrid/Grid3D.cs b/src/renderers/components/CharacterGrid/Grid3D.cs similarity index 100% rename from src/views/components/CharacterGrid/Grid3D.cs rename to src/renderers/components/CharacterGrid/Grid3D.cs diff --git a/src/views/components/CharacterGrid/Grid3D.cs.uid b/src/renderers/components/CharacterGrid/Grid3D.cs.uid similarity index 100% rename from src/views/components/CharacterGrid/Grid3D.cs.uid rename to src/renderers/components/CharacterGrid/Grid3D.cs.uid diff --git a/src/views/components/CharacterGrid/GridCell3D.cs b/src/renderers/components/CharacterGrid/GridCell3D.cs similarity index 100% rename from src/views/components/CharacterGrid/GridCell3D.cs rename to src/renderers/components/CharacterGrid/GridCell3D.cs diff --git a/src/views/components/CharacterGrid/GridCell3D.cs.uid b/src/renderers/components/CharacterGrid/GridCell3D.cs.uid similarity index 100% rename from src/views/components/CharacterGrid/GridCell3D.cs.uid rename to src/renderers/components/CharacterGrid/GridCell3D.cs.uid diff --git a/src/views/components/CharacterInspector/CharacterInspector.cs b/src/renderers/components/CharacterInspector/CharacterInspector.cs similarity index 100% rename from src/views/components/CharacterInspector/CharacterInspector.cs rename to src/renderers/components/CharacterInspector/CharacterInspector.cs diff --git a/src/views/components/CharacterInspector/CharacterInspector.cs.uid b/src/renderers/components/CharacterInspector/CharacterInspector.cs.uid similarity index 100% rename from src/views/components/CharacterInspector/CharacterInspector.cs.uid rename to src/renderers/components/CharacterInspector/CharacterInspector.cs.uid diff --git a/src/views/components/CharacterInspector/CharacterInspector.tscn b/src/renderers/components/CharacterInspector/CharacterInspector.tscn similarity index 98% rename from src/views/components/CharacterInspector/CharacterInspector.tscn rename to src/renderers/components/CharacterInspector/CharacterInspector.tscn index a431d2b0..9c7fab70 100644 --- a/src/views/components/CharacterInspector/CharacterInspector.tscn +++ b/src/renderers/components/CharacterInspector/CharacterInspector.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://dgyegipn74jj5"] -[ext_resource type="Script" uid="uid://b24cvjmwq5kc" path="res://views/components/CharacterInspector/CharacterInspector.cs" id="1_72g88"] +[ext_resource type="Script" uid="uid://b24cvjmwq5kc" path="res://renderers/components/CharacterInspector/CharacterInspector.cs" id="1_72g88"] [ext_resource type="Texture2D" uid="uid://dqpa6f8n80d61" path="res://assets/characters/eleonoreOtsoga/EleonoreOtsogaPortrait.png" id="1_jybd2"] [node name="CharacterInspector" type="HBoxContainer" node_paths=PackedStringArray("PortraitNode", "CharacterNameNode", "CharacterRoleNode", "AttributesListNode", "AttributeTemplateNode", "AttributeTemplateTitleNode", "ValueContainerNode", "AttributeCurrentValueNode", "AttributeMaxValueNode", "ActionGridNode", "ActionButtonTemplate")] diff --git a/src/views/components/GameLog/GameLogComponent.cs b/src/renderers/components/GameLog/GameLogComponent.cs similarity index 100% rename from src/views/components/GameLog/GameLogComponent.cs rename to src/renderers/components/GameLog/GameLogComponent.cs diff --git a/src/views/components/GameLog/GameLogComponent.cs.uid b/src/renderers/components/GameLog/GameLogComponent.cs.uid similarity index 100% rename from src/views/components/GameLog/GameLogComponent.cs.uid rename to src/renderers/components/GameLog/GameLogComponent.cs.uid diff --git a/src/views/components/GameLog/GameLogComponent.tscn b/src/renderers/components/GameLog/GameLogComponent.tscn similarity index 97% rename from src/views/components/GameLog/GameLogComponent.tscn rename to src/renderers/components/GameLog/GameLogComponent.tscn index 69dd9ef5..1eabc896 100644 --- a/src/views/components/GameLog/GameLogComponent.tscn +++ b/src/renderers/components/GameLog/GameLogComponent.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://21o4pt7dm2n0"] -[ext_resource type="Script" uid="uid://c00f3g3y8eujg" path="res://views/components/GameLog/GameLogComponent.cs" id="1_h5njw"] +[ext_resource type="Script" uid="uid://c00f3g3y8eujg" path="res://renderers/components/GameLog/GameLogComponent.cs" id="1_h5njw"] [node name="GameLog" type="ScrollContainer" node_paths=PackedStringArray("_messageContainerNode", "_messageTemplateNode", "_headingLabelTemplateNode", "_timestampLabelTemplateNode", "_lineTemplateNode")] anchors_preset = 15 diff --git a/src/views/components/HUDComponent/HUDComponent.tscn b/src/renderers/components/HUDComponent/HUDComponent.tscn similarity index 88% rename from src/views/components/HUDComponent/HUDComponent.tscn rename to src/renderers/components/HUDComponent/HUDComponent.tscn index 5d256e26..c8c73220 100644 --- a/src/views/components/HUDComponent/HUDComponent.tscn +++ b/src/renderers/components/HUDComponent/HUDComponent.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=6 format=3 uid="uid://c22tpnmaefgn4"] -[ext_resource type="PackedScene" uid="uid://dsbegy218josn" path="res://views/components/TurnOrderComponent/TurnOrderComponent.tscn" id="1_c8j77"] -[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://views/ui/SceneTransitionButton.cs" id="2_ink42"] -[ext_resource type="PackedScene" uid="uid://dgyegipn74jj5" path="res://views/components/CharacterInspector/CharacterInspector.tscn" id="3_xfvph"] -[ext_resource type="PackedScene" uid="uid://bt73g5fssa68h" path="res://views/components/InventoryComponent/InventoryComponent.tscn" id="4_313b0"] -[ext_resource type="PackedScene" uid="uid://21o4pt7dm2n0" path="res://views/components/GameLog/GameLogComponent.tscn" id="5_no7pv"] +[ext_resource type="PackedScene" uid="uid://dsbegy218josn" path="res://renderers/components/TurnOrderComponent/TurnOrderComponent.tscn" id="1_c8j77"] +[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://renderers/ui/SceneTransitionButton.cs" id="2_ink42"] +[ext_resource type="PackedScene" uid="uid://dgyegipn74jj5" path="res://renderers/components/CharacterInspector/CharacterInspector.tscn" id="3_xfvph"] +[ext_resource type="PackedScene" uid="uid://bt73g5fssa68h" path="res://renderers/components/InventoryComponent/InventoryComponent.tscn" id="4_313b0"] +[ext_resource type="PackedScene" uid="uid://21o4pt7dm2n0" path="res://renderers/components/GameLog/GameLogComponent.tscn" id="5_no7pv"] [node name="HUDComponent" type="VBoxContainer"] clip_contents = true diff --git a/src/views/components/InventoryComponent/InventoryComponent.cs b/src/renderers/components/InventoryComponent/InventoryComponent.cs similarity index 100% rename from src/views/components/InventoryComponent/InventoryComponent.cs rename to src/renderers/components/InventoryComponent/InventoryComponent.cs diff --git a/src/views/components/InventoryComponent/InventoryComponent.cs.uid b/src/renderers/components/InventoryComponent/InventoryComponent.cs.uid similarity index 100% rename from src/views/components/InventoryComponent/InventoryComponent.cs.uid rename to src/renderers/components/InventoryComponent/InventoryComponent.cs.uid diff --git a/src/views/components/InventoryComponent/InventoryComponent.tscn b/src/renderers/components/InventoryComponent/InventoryComponent.tscn similarity index 81% rename from src/views/components/InventoryComponent/InventoryComponent.tscn rename to src/renderers/components/InventoryComponent/InventoryComponent.tscn index a4c64388..c7675d26 100644 --- a/src/views/components/InventoryComponent/InventoryComponent.tscn +++ b/src/renderers/components/InventoryComponent/InventoryComponent.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://bt73g5fssa68h"] -[ext_resource type="Script" uid="uid://bx8bk0ye5tevv" path="res://views/components/InventoryComponent/InventoryComponent.cs" id="2"] -[ext_resource type="PackedScene" uid="uid://tomctv14euva" path="res://views/components/InventoryItemComponent/InventoryItemComponent.tscn" id="2_rwo4n"] +[ext_resource type="Script" uid="uid://bx8bk0ye5tevv" path="res://renderers/components/InventoryComponent/InventoryComponent.cs" id="2"] +[ext_resource type="PackedScene" uid="uid://tomctv14euva" path="res://renderers/components/InventoryItemComponent/InventoryItemComponent.tscn" id="2_rwo4n"] [node name="Inventory" type="ScrollContainer"] anchors_preset = 15 diff --git a/src/views/components/InventoryComponent/slot.png b/src/renderers/components/InventoryComponent/slot.png similarity index 100% rename from src/views/components/InventoryComponent/slot.png rename to src/renderers/components/InventoryComponent/slot.png diff --git a/src/views/components/InventoryComponent/slot.png.import b/src/renderers/components/InventoryComponent/slot.png.import similarity index 70% rename from src/views/components/InventoryComponent/slot.png.import rename to src/renderers/components/InventoryComponent/slot.png.import index 9ccc1f0b..636fdb47 100644 --- a/src/views/components/InventoryComponent/slot.png.import +++ b/src/renderers/components/InventoryComponent/slot.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://c1flt0c431x4o" -path="res://.godot/imported/slot.png-ad7fc8b2142cd56dc33b71f6771816fe.ctex" +path="res://.godot/imported/slot.png-94fc42857427c0b6a480f5e4db0f319f.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://views/components/InventoryComponent/slot.png" -dest_files=["res://.godot/imported/slot.png-ad7fc8b2142cd56dc33b71f6771816fe.ctex"] +source_file="res://renderers/components/InventoryComponent/slot.png" +dest_files=["res://.godot/imported/slot.png-94fc42857427c0b6a480f5e4db0f319f.ctex"] [params] diff --git a/src/views/components/InventoryComponent/test.tscn b/src/renderers/components/InventoryComponent/test.tscn similarity index 95% rename from src/views/components/InventoryComponent/test.tscn rename to src/renderers/components/InventoryComponent/test.tscn index 46bb6ac3..5d0c57d9 100644 --- a/src/views/components/InventoryComponent/test.tscn +++ b/src/renderers/components/InventoryComponent/test.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://b5dtfnowy3m0q"] -[ext_resource type="PackedScene" uid="uid://tomctv14euva" path="res://views/components/InventoryItemComponent/InventoryItemComponent.tscn" id="1_7fx0t"] +[ext_resource type="PackedScene" uid="uid://tomctv14euva" path="res://renderers/components/InventoryItemComponent/InventoryItemComponent.tscn" id="1_7fx0t"] [node name="Test" type="Node2D"] diff --git a/src/views/components/InventoryItemComponent/InventoryItemComponent.cs b/src/renderers/components/InventoryItemComponent/InventoryItemComponent.cs similarity index 100% rename from src/views/components/InventoryItemComponent/InventoryItemComponent.cs rename to src/renderers/components/InventoryItemComponent/InventoryItemComponent.cs diff --git a/src/views/components/InventoryItemComponent/InventoryItemComponent.cs.uid b/src/renderers/components/InventoryItemComponent/InventoryItemComponent.cs.uid similarity index 100% rename from src/views/components/InventoryItemComponent/InventoryItemComponent.cs.uid rename to src/renderers/components/InventoryItemComponent/InventoryItemComponent.cs.uid diff --git a/src/views/components/InventoryItemComponent/InventoryItemComponent.tscn b/src/renderers/components/InventoryItemComponent/InventoryItemComponent.tscn similarity index 78% rename from src/views/components/InventoryItemComponent/InventoryItemComponent.tscn rename to src/renderers/components/InventoryItemComponent/InventoryItemComponent.tscn index fc4cb342..5428f5de 100644 --- a/src/views/components/InventoryItemComponent/InventoryItemComponent.tscn +++ b/src/renderers/components/InventoryItemComponent/InventoryItemComponent.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://tomctv14euva"] -[ext_resource type="Script" uid="uid://5drla5c75a4b" path="res://views/components/InventoryItemComponent/InventoryItemComponent.cs" id="1_sc2gm"] -[ext_resource type="PackedScene" uid="uid://bwvsdedui54tw" path="res://views/components/TooltipComponent/TooltipComponent.tscn" id="2_7j7lb"] +[ext_resource type="Script" uid="uid://5drla5c75a4b" path="res://renderers/components/InventoryItemComponent/InventoryItemComponent.cs" id="1_sc2gm"] +[ext_resource type="PackedScene" uid="uid://bwvsdedui54tw" path="res://renderers/components/TooltipComponent/TooltipComponent.tscn" id="2_7j7lb"] [node name="InventoryItemComponent" type="Control"] layout_mode = 3 diff --git a/src/renderers/components/SelectableComponent.cs b/src/renderers/components/SelectableComponent.cs new file mode 100644 index 00000000..37584d90 --- /dev/null +++ b/src/renderers/components/SelectableComponent.cs @@ -0,0 +1,215 @@ +using Godot; +using DiceRolling.Entities; +using DiceRolling.Events; +using DiceRolling.Helpers; + +namespace DiceRolling.Components; + +[Tool] +[GlobalClass] +[Icon("res://assets/editor/component-3d.svg")] +public partial class SelectableComponent : Node3D { + private static SelectableComponent? _currentlySelectedComponent; + + public enum CollisionShapeType { Box, Capsule } + + [Export] public CollisionShapeType ShapeType { get; set; } = CollisionShapeType.Box; + [Export] public Vector3 BoxSize { get; set; } = new Vector3(1.0f, 1.0f, 1.0f); + [Export] public float CapsuleHeight { get; set; } = 1.0f; + [Export] public float CapsuleRadius { get; set; } = 0.5f; + + [Export] public Sprite3D? SelectorSprite { get; set; } + [Export] public Sprite3D? HoverSpriteNode { get; set; } + + private Area3D? _inputArea; + private Entity3D? _parent; + + private bool _isSelected = false; + [Export] + public bool IsSelected { + get => _isSelected; + set { + if (_isSelected != value) { + _isSelected = value; + OnIsSelectedSet(value); + } + } + } + + private bool _isHovered = false; + [Export] + public bool IsHovered { + get => _isHovered; + set { + if (_isHovered != value) { + _isHovered = value; + OnIsHoveredSet(value); + } + } + } + + public override void _Ready() { + _parent = GetParent(); + + // Create area and collision shape + CreateInputArea(); + + // Initialize visuals + if (SelectorSprite is not null) { + SelectorSprite.Visible = false; + } + if (HoverSpriteNode is not null) { + HoverSpriteNode.Visible = false; + } + + // Connect to entity if available + if (_parent != null) { + SignalHelper.ConnectSignal(_parent, nameof(Entity3D.EntityUpdated), this, nameof(OnEntityUpdated)); + } + + EventBus.Instance.Connect(nameof(EventBus.CharacterUnselected), new Callable(this, nameof(OnCharacterUnselected))); + } + + private void CreateInputArea() { + // Create area node + _inputArea = new Area3D { + Name = "SelectionArea" + }; + AddChild(_inputArea); + + // Create collision shape + var collisionShape = new CollisionShape3D { + Name = "CollisionShape" + }; + + // Set shape based on configuration + if (ShapeType == CollisionShapeType.Box) { + var boxShape = new BoxShape3D { + Size = BoxSize + }; + collisionShape.Shape = boxShape; + } + else { // Capsule + var capsuleShape = new CapsuleShape3D { + Height = CapsuleHeight, + Radius = CapsuleRadius + }; + collisionShape.Shape = capsuleShape; + } + + _inputArea.AddChild(collisionShape); + ConnectSignals(); + } + + public override void _ExitTree() { + DisconnectSignals(); + + if (_parent != null) { + SignalHelper.DisconnectSignal(_parent, nameof(Entity3D.EntityUpdated), this, nameof(OnEntityUpdated)); + } + + EventBus.Instance.Disconnect(nameof(EventBus.CharacterUnselected), new Callable(this, nameof(OnCharacterUnselected))); + } + + private void ConnectSignals() { + if (_inputArea != null) { + _inputArea.Connect("input_event", new Callable(this, nameof(OnInputEvent))); + _inputArea.Connect("mouse_entered", new Callable(this, nameof(OnMouseEntered))); + _inputArea.Connect("mouse_exited", new Callable(this, nameof(OnMouseExited))); + } + } + + private void DisconnectSignals() { + if (_inputArea != null) { + if (_inputArea.IsConnected("input_event", new Callable(this, nameof(OnInputEvent)))) { + _inputArea.Disconnect("input_event", new Callable(this, nameof(OnInputEvent))); + } + if (_inputArea.IsConnected("mouse_entered", new Callable(this, nameof(OnMouseEntered)))) { + _inputArea.Disconnect("mouse_entered", new Callable(this, nameof(OnMouseEntered))); + } + if (_inputArea.IsConnected("mouse_exited", new Callable(this, nameof(OnMouseExited)))) { + _inputArea.Disconnect("mouse_exited", new Callable(this, nameof(OnMouseExited))); + } + } + } + + private void OnMouseEntered() { + IsHovered = true; + } + + private void OnMouseExited() { + IsHovered = false; + } + + private void OnEntityUpdated() { + // Update selectable state based on entity data if needed + } + + private void OnInputEvent(Node camera, InputEvent @event, Vector3 clickPosition, Vector3 normal, int shapeIdx) { + if (@event is InputEventMouseButton { Pressed: true }) { + HandleSelection(this); + } + } + + private static void HandleSelection(SelectableComponent current) { + if (_currentlySelectedComponent == current) { + current.IsSelected = false; + _currentlySelectedComponent = null; + EventBus.Instance.EmitSignal(nameof(EventBus.CharacterUnselected)); + } + else { + if (_currentlySelectedComponent is not null) { + _currentlySelectedComponent.IsSelected = false; + } + current.IsSelected = true; + _currentlySelectedComponent = current; + + // Pass the parent entity to the selection event if available + var entity = current.GetParent(); + if (entity != null) { + EventBus.Instance.EmitSignal(nameof(EventBus.CharacterSelected), entity); + } + else { + EventBus.Instance.EmitSignal(nameof(EventBus.CharacterSelected), current); + } + } + } + + private void OnCharacterUnselected() { + IsSelected = false; + } + + private void OnIsSelectedSet(bool isSelected) { + if (SelectorSprite is not null) { + SelectorSprite.Visible = isSelected; + } + } + + private void OnIsHoveredSet(bool isHovered) { + if (HoverSpriteNode is not null) { + HoverSpriteNode.Visible = isHovered; + } + } + + // Called by the inspector to update the collision shape when properties change + public void UpdateShape() { + if (_inputArea == null || !IsInstanceValid(_inputArea)) + return; + + var collisionShape = _inputArea.GetChild(0); + if (collisionShape == null) + return; + + if (ShapeType == CollisionShapeType.Box) { + var boxShape = collisionShape.Shape as BoxShape3D ?? new BoxShape3D(); + boxShape.Size = BoxSize; + collisionShape.Shape = boxShape; + } + else { // Capsule + var capsuleShape = collisionShape.Shape as CapsuleShape3D ?? new CapsuleShape3D(); + capsuleShape.Height = CapsuleHeight; + capsuleShape.Radius = CapsuleRadius; + collisionShape.Shape = capsuleShape; + } + } +} \ No newline at end of file diff --git a/src/renderers/components/SelectableComponent.cs.uid b/src/renderers/components/SelectableComponent.cs.uid new file mode 100644 index 00000000..aed02e36 --- /dev/null +++ b/src/renderers/components/SelectableComponent.cs.uid @@ -0,0 +1 @@ +uid://bs8ip2rdvho4s diff --git a/src/views/components/TooltipComponent/TooltipComponent.cs b/src/renderers/components/TooltipComponent/TooltipComponent.cs similarity index 100% rename from src/views/components/TooltipComponent/TooltipComponent.cs rename to src/renderers/components/TooltipComponent/TooltipComponent.cs diff --git a/src/views/components/TooltipComponent/TooltipComponent.cs.uid b/src/renderers/components/TooltipComponent/TooltipComponent.cs.uid similarity index 100% rename from src/views/components/TooltipComponent/TooltipComponent.cs.uid rename to src/renderers/components/TooltipComponent/TooltipComponent.cs.uid diff --git a/src/views/components/TooltipComponent/TooltipComponent.tscn b/src/renderers/components/TooltipComponent/TooltipComponent.tscn similarity index 96% rename from src/views/components/TooltipComponent/TooltipComponent.tscn rename to src/renderers/components/TooltipComponent/TooltipComponent.tscn index afc19e6e..49cdb892 100644 --- a/src/views/components/TooltipComponent/TooltipComponent.tscn +++ b/src/renderers/components/TooltipComponent/TooltipComponent.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://bwvsdedui54tw"] -[ext_resource type="Script" uid="uid://cmptfsd2i8ro8" path="res://views/components/TooltipComponent/TooltipComponent.cs" id="1_ma61s"] -[ext_resource type="Texture2D" uid="uid://dvfapg1a2gi00" path="res://views/components/TooltipComponent/icon.png" id="2_jkd58"] +[ext_resource type="Script" uid="uid://cmptfsd2i8ro8" path="res://renderers/components/TooltipComponent/TooltipComponent.cs" id="1_ma61s"] +[ext_resource type="Texture2D" uid="uid://dvfapg1a2gi00" path="res://renderers/components/TooltipComponent/icon.png" id="2_jkd58"] [node name="TooltipComponent" type="Control"] custom_minimum_size = Vector2(290, 360) diff --git a/src/views/components/TooltipComponent/icon.png b/src/renderers/components/TooltipComponent/icon.png similarity index 100% rename from src/views/components/TooltipComponent/icon.png rename to src/renderers/components/TooltipComponent/icon.png diff --git a/src/views/components/TooltipComponent/icon.png.import b/src/renderers/components/TooltipComponent/icon.png.import similarity index 71% rename from src/views/components/TooltipComponent/icon.png.import rename to src/renderers/components/TooltipComponent/icon.png.import index 761b1da2..ccfa9ed0 100644 --- a/src/views/components/TooltipComponent/icon.png.import +++ b/src/renderers/components/TooltipComponent/icon.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://dvfapg1a2gi00" -path="res://.godot/imported/icon.png-f043f3dac923498ba0daee33a78363fc.ctex" +path="res://.godot/imported/icon.png-c57217450ffb0aaf0f127cf389aa6d7d.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://views/components/TooltipComponent/icon.png" -dest_files=["res://.godot/imported/icon.png-f043f3dac923498ba0daee33a78363fc.ctex"] +source_file="res://renderers/components/TooltipComponent/icon.png" +dest_files=["res://.godot/imported/icon.png-c57217450ffb0aaf0f127cf389aa6d7d.ctex"] [params] diff --git a/src/views/components/TurnOrderComponent/TurnOrderComponent.cs b/src/renderers/components/TurnOrderComponent/TurnOrderComponent.cs similarity index 100% rename from src/views/components/TurnOrderComponent/TurnOrderComponent.cs rename to src/renderers/components/TurnOrderComponent/TurnOrderComponent.cs diff --git a/src/views/components/TurnOrderComponent/TurnOrderComponent.cs.uid b/src/renderers/components/TurnOrderComponent/TurnOrderComponent.cs.uid similarity index 100% rename from src/views/components/TurnOrderComponent/TurnOrderComponent.cs.uid rename to src/renderers/components/TurnOrderComponent/TurnOrderComponent.cs.uid diff --git a/src/views/components/TurnOrderComponent/TurnOrderComponent.tscn b/src/renderers/components/TurnOrderComponent/TurnOrderComponent.tscn similarity index 96% rename from src/views/components/TurnOrderComponent/TurnOrderComponent.tscn rename to src/renderers/components/TurnOrderComponent/TurnOrderComponent.tscn index d06df495..653ae131 100644 --- a/src/views/components/TurnOrderComponent/TurnOrderComponent.tscn +++ b/src/renderers/components/TurnOrderComponent/TurnOrderComponent.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=7 format=3 uid="uid://dsbegy218josn"] [ext_resource type="Texture2D" uid="uid://dqpa6f8n80d61" path="res://assets/characters/eleonoreOtsoga/EleonoreOtsogaPortrait.png" id="1_fnlle"] -[ext_resource type="Theme" uid="uid://dxg2mh1ceh3pc" path="res://views/components/TurnOrderComponent/TurnOrderTheme.tres" id="1_o2pqp"] -[ext_resource type="Script" uid="uid://016w4jxplp8d" path="res://views/components/TurnOrderComponent/TurnOrderComponent.cs" id="2_aj4ue"] +[ext_resource type="Theme" uid="uid://dxg2mh1ceh3pc" path="res://renderers/components/TurnOrderComponent/TurnOrderTheme.tres" id="1_o2pqp"] +[ext_resource type="Script" uid="uid://016w4jxplp8d" path="res://renderers/components/TurnOrderComponent/TurnOrderComponent.cs" id="2_aj4ue"] [ext_resource type="Resource" uid="uid://clrt1eby68x42" path="res://resources/Characters/Eleonore.tres" id="3_8cip4"] [ext_resource type="Resource" uid="uid://b4niu7ewhuinj" path="res://resources/Attributes/AttributesStore.tres" id="3_vlbb0"] [ext_resource type="Resource" uid="uid://bkolttux1bvi1" path="res://resources/Characters/Joanna.tres" id="5_ntmsh"] diff --git a/src/views/components/TurnOrderComponent/TurnOrderTheme.tres b/src/renderers/components/TurnOrderComponent/TurnOrderTheme.tres similarity index 100% rename from src/views/components/TurnOrderComponent/TurnOrderTheme.tres rename to src/renderers/components/TurnOrderComponent/TurnOrderTheme.tres diff --git a/src/renderers/entities/CharacterEntity/CharacterEntity.cs b/src/renderers/entities/CharacterEntity/CharacterEntity.cs new file mode 100644 index 00000000..8389a241 --- /dev/null +++ b/src/renderers/entities/CharacterEntity/CharacterEntity.cs @@ -0,0 +1,17 @@ +using Godot; +using DiceRolling.Characters; + +namespace DiceRolling.Entities; + +[Tool] +[GlobalClass] +public partial class CharacterEntity : Entity3D { + [Export] + public CharacterType? CharacterData { + get => GetData(); + set => Data = value; + } + + [ExportToolButton("Update Character")] + public Callable UpdateCharacterData => Callable.From(() => NotifyUpdate()); +} \ No newline at end of file diff --git a/src/renderers/entities/CharacterEntity/CharacterEntity.cs.uid b/src/renderers/entities/CharacterEntity/CharacterEntity.cs.uid new file mode 100644 index 00000000..697d1901 --- /dev/null +++ b/src/renderers/entities/CharacterEntity/CharacterEntity.cs.uid @@ -0,0 +1 @@ +uid://cyt7peem686tr diff --git a/src/renderers/entities/CharacterEntity/CharacterEntity.tscn b/src/renderers/entities/CharacterEntity/CharacterEntity.tscn new file mode 100644 index 00000000..7971cb10 --- /dev/null +++ b/src/renderers/entities/CharacterEntity/CharacterEntity.tscn @@ -0,0 +1,32 @@ +[gd_scene load_steps=6 format=3 uid="uid://b5fpv2rdkq5c"] + +[ext_resource type="Script" uid="uid://cyt7peem686tr" path="res://renderers/entities/CharacterEntity/CharacterEntity.cs" id="1_sly7g"] +[ext_resource type="Resource" uid="uid://clrt1eby68x42" path="res://resources/Characters/Eleonore.tres" id="2_vbwm8"] +[ext_resource type="SpriteFrames" uid="uid://bskb8ffl72voq" path="res://assets/characters/eleonoreOtsoga/EleonoreOtsogaSprites.tres" id="3_lytje"] +[ext_resource type="Script" uid="uid://cejuccgxo60qs" path="res://renderers/components/AnimatedSpriteComponent.cs" id="3_q1qiw"] +[ext_resource type="Script" uid="uid://bs8ip2rdvho4s" path="res://renderers/components/SelectableComponent.cs" id="4_lytje"] + +[node name="CharacterEntity" type="Node3D"] +script = ExtResource("1_sly7g") +CharacterData = ExtResource("2_vbwm8") +Data = ExtResource("2_vbwm8") +metadata/_custom_type_script = "uid://cyt7peem686tr" + +[node name="AnimatedSpriteComponent" type="AnimatedSprite3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) +pixel_size = 0.016 +billboard = 1 +shaded = true +texture_filter = 0 +sprite_frames = ExtResource("3_lytje") +animation = &"idle" +frame_progress = 0.9642 +script = ExtResource("3_q1qiw") +metadata/_custom_type_script = "uid://cejuccgxo60qs" + +[node name="SelectableComponent" type="Node3D" parent="."] +script = ExtResource("4_lytje") +ShapeType = 1 +BoxSize = Vector3(0, 1, 0) +CapsuleRadius = 0.25 +metadata/_custom_type_script = "uid://bs8ip2rdvho4s" diff --git a/src/renderers/entities/Enitity.cs.uid b/src/renderers/entities/Enitity.cs.uid new file mode 100644 index 00000000..635cee8b --- /dev/null +++ b/src/renderers/entities/Enitity.cs.uid @@ -0,0 +1 @@ +uid://d0xykenrpepev diff --git a/src/renderers/entities/Entity3D.cs b/src/renderers/entities/Entity3D.cs new file mode 100644 index 00000000..60d70794 --- /dev/null +++ b/src/renderers/entities/Entity3D.cs @@ -0,0 +1,54 @@ +using Godot; +using DiceRolling.Helpers; + +namespace DiceRolling.Entities; + +[Tool] +[GlobalClass] +[Icon("res://assets/editor/entity-3d.svg")] +public abstract partial class Entity3D : Node3D { + [Signal] public delegate void EntityUpdatedEventHandler(); + + private Resource? _data; + + [Export] + public Resource? Data { + get => _data; + set { + if (_data == value) { + return; + } + + // Disconnect from old data if exists + // SignalHelper.DisconnectSignal(_data, "Changed", this, nameof(OnDataChanged)); + + _data = value; + + // Connect to new data if exists + // SignalHelper.ConnectSignal(_data, "Changed", this, nameof(OnDataChanged)); + + NotifyUpdate(); + } + } + + protected void NotifyUpdate() { + EmitSignal(nameof(EntityUpdated)); + } + + // Changed from protected to public to allow components to access it + public T? GetData() where T : Resource { + return Data as T; + } + + public override void _Ready() { + // SignalHelper.ConnectSignal(_data, "Changed", this, nameof(OnDataChanged)); + } + + public override void _ExitTree() { + // SignalHelper.DisconnectSignal(_data, "Changed", this, nameof(OnDataChanged)); + } + + private void OnDataChanged() { + NotifyUpdate(); + } +} \ No newline at end of file diff --git a/src/renderers/entities/Entity3D.cs.uid b/src/renderers/entities/Entity3D.cs.uid new file mode 100644 index 00000000..22b8b566 --- /dev/null +++ b/src/renderers/entities/Entity3D.cs.uid @@ -0,0 +1 @@ +uid://ckjk7gwhqh700 diff --git a/src/views/scenes/GameplayTransitionManager.tscn b/src/renderers/scenes/GameplayTransitionManager.tscn similarity index 76% rename from src/views/scenes/GameplayTransitionManager.tscn rename to src/renderers/scenes/GameplayTransitionManager.tscn index bc7671b0..ad4b0564 100644 --- a/src/views/scenes/GameplayTransitionManager.tscn +++ b/src/renderers/scenes/GameplayTransitionManager.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=5 format=3 uid="uid://pmm3h25102wg"] [ext_resource type="Script" uid="uid://bph4r6o283db6" path="res://controllers/GameplayTransitionManager.cs" id="1_wx56g"] -[ext_resource type="PackedScene" uid="uid://bqbiqwyfv8mfg" path="res://views/scenes/gameplay/Lobby.tscn" id="3_kecqp"] -[ext_resource type="PackedScene" uid="uid://cbiewt2yq1klj" path="res://views/scenes/gameplay/Dungeon.tscn" id="3_s5y8n"] -[ext_resource type="PackedScene" uid="uid://8n50xik7xid3" path="res://views/scenes/gameplay/Battle.tscn" id="4_ml5um"] +[ext_resource type="PackedScene" uid="uid://bqbiqwyfv8mfg" path="res://renderers/scenes/gameplay/Lobby.tscn" id="3_kecqp"] +[ext_resource type="PackedScene" uid="uid://cbiewt2yq1klj" path="res://renderers/scenes/gameplay/Dungeon.tscn" id="3_s5y8n"] +[ext_resource type="PackedScene" uid="uid://8n50xik7xid3" path="res://renderers/scenes/gameplay/Battle.tscn" id="4_ml5um"] [node name="GameplayTransitionManager" type="Node"] script = ExtResource("1_wx56g") diff --git a/src/views/scenes/MenuTransitionManager.tscn b/src/renderers/scenes/MenuTransitionManager.tscn similarity index 76% rename from src/views/scenes/MenuTransitionManager.tscn rename to src/renderers/scenes/MenuTransitionManager.tscn index 6c17f66f..0b11890a 100644 --- a/src/views/scenes/MenuTransitionManager.tscn +++ b/src/renderers/scenes/MenuTransitionManager.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=5 format=3 uid="uid://m2cjh6t2impm"] [ext_resource type="Script" uid="uid://de5a1nv2c7r1a" path="res://controllers/MenuTransitionManager.cs" id="1_lkj8k"] -[ext_resource type="PackedScene" uid="uid://myouhbwr3b27" path="res://views/scenes/menus/MainMenu.tscn" id="2_db3kg"] -[ext_resource type="PackedScene" uid="uid://bqbiqwyfv8mfg" path="res://views/scenes/gameplay/Lobby.tscn" id="3_7yx2c"] -[ext_resource type="PackedScene" uid="uid://dp330lfyi8bfk" path="res://views/scenes/menus/GameOver.tscn" id="4_rilil"] +[ext_resource type="PackedScene" uid="uid://myouhbwr3b27" path="res://renderers/scenes/menus/MainMenu.tscn" id="2_db3kg"] +[ext_resource type="PackedScene" uid="uid://bqbiqwyfv8mfg" path="res://renderers/scenes/gameplay/Lobby.tscn" id="3_7yx2c"] +[ext_resource type="PackedScene" uid="uid://dp330lfyi8bfk" path="res://renderers/scenes/menus/GameOver.tscn" id="4_rilil"] [node name="MenuTransitionManager" type="Node"] script = ExtResource("1_lkj8k") diff --git a/src/views/scenes/gameplay/Battle.tscn b/src/renderers/scenes/gameplay/Battle.tscn similarity index 99% rename from src/views/scenes/gameplay/Battle.tscn rename to src/renderers/scenes/gameplay/Battle.tscn index 1f3932c4..21f99b5f 100644 --- a/src/views/scenes/gameplay/Battle.tscn +++ b/src/renderers/scenes/gameplay/Battle.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=16 format=3 uid="uid://8n50xik7xid3"] [ext_resource type="Script" uid="uid://jc3rfy1j13nu" path="res://controllers/BattleManager.cs" id="1_hf7dd"] -[ext_resource type="PackedScene" uid="uid://c22tpnmaefgn4" path="res://views/components/HUDComponent/HUDComponent.tscn" id="2_dcsho"] +[ext_resource type="PackedScene" uid="uid://c22tpnmaefgn4" path="res://renderers/components/HUDComponent/HUDComponent.tscn" id="2_dcsho"] [ext_resource type="SpriteFrames" uid="uid://fdkgmyh24b0q" path="res://assets/characters/joannaOtsoga/JoannaOtsogaSprites.tres" id="3_0d3nu"] -[ext_resource type="PackedScene" uid="uid://dmw0cm136sn4p" path="res://views/components/CharacterGrid/CharacterGrid.tscn" id="4_8j5p5"] +[ext_resource type="PackedScene" uid="uid://dmw0cm136sn4p" path="res://renderers/components/CharacterGrid/CharacterGrid.tscn" id="4_8j5p5"] [ext_resource type="Resource" uid="uid://snt34yslyn4f" path="res://resources/Characters/PlayerCharacterStore.tres" id="5_0omgf"] [ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://models/data/Grid/GridType.cs" id="6_cvc4r"] [ext_resource type="Resource" uid="uid://d22hmntd0rfq2" path="res://resources/Characters/EnemyCharacterStore.tres" id="7_rbvwj"] @@ -34,6 +34,8 @@ Direction = 0 Rows = 2 Columns = 3 Cells = Array[int]([0, 0, 0, 0, 0, 0]) +_rows = 2 +_columns = 3 metadata/_custom_type_script = ExtResource("6_cvc4r") [sub_resource type="Resource" id="Resource_hsrxk"] @@ -45,6 +47,8 @@ Direction = 1 Rows = 2 Columns = 3 Cells = Array[int]([0, 0, 0, 0, 0, 0]) +_rows = 2 +_columns = 3 metadata/_custom_type_script = ExtResource("6_cvc4r") [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_hsrxk"] @@ -2726,8 +2730,8 @@ transform = Transform3D(1, 0, 0, 0, 0.766045, 0.642787, 0, -0.642787, 0.766045, [node name="CharacterGrid3D" parent="." instance=ExtResource("4_8j5p5")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4, 0, 0) -GridConfigurations = [SubResource("Resource_vpfel"), SubResource("Resource_hsrxk")] CellPadding = 0.25 +GridConfigurations = [SubResource("Resource_vpfel"), SubResource("Resource_hsrxk")] [node name="CSGMesh3D" type="CSGMesh3D" parent="."] transform = Transform3D(10, 0, 0, 0, 0.1, 0, 0, 0, 10, 0, -0.05, 0) diff --git a/src/views/scenes/gameplay/Dungeon.tscn b/src/renderers/scenes/gameplay/Dungeon.tscn similarity index 97% rename from src/views/scenes/gameplay/Dungeon.tscn rename to src/renderers/scenes/gameplay/Dungeon.tscn index 46ff0902..7743c880 100644 --- a/src/views/scenes/gameplay/Dungeon.tscn +++ b/src/renderers/scenes/gameplay/Dungeon.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://cbiewt2yq1klj"] [ext_resource type="Script" uid="uid://245qm3j5dd5t" path="res://models/data/Dungeon/DungeonManager.cs" id="1_5cacr"] -[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://views/ui/SceneTransitionButton.cs" id="2_p0c6y"] +[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://renderers/ui/SceneTransitionButton.cs" id="2_p0c6y"] [node name="Dungeon" type="Node2D"] script = ExtResource("1_5cacr") diff --git a/src/views/scenes/gameplay/Lobby.tscn b/src/renderers/scenes/gameplay/Lobby.tscn similarity index 97% rename from src/views/scenes/gameplay/Lobby.tscn rename to src/renderers/scenes/gameplay/Lobby.tscn index c7d61a53..e720afd3 100644 --- a/src/views/scenes/gameplay/Lobby.tscn +++ b/src/renderers/scenes/gameplay/Lobby.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://bqbiqwyfv8mfg"] [ext_resource type="Script" uid="uid://dtwnb70hiivar" path="res://controllers/LobbyManager.cs" id="1_rkuy2"] -[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://views/ui/SceneTransitionButton.cs" id="2_34wiv"] +[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://renderers/ui/SceneTransitionButton.cs" id="2_34wiv"] [node name="Lobby" type="Node2D"] script = ExtResource("1_rkuy2") diff --git a/src/views/scenes/menus/GameOver.tscn b/src/renderers/scenes/menus/GameOver.tscn similarity index 100% rename from src/views/scenes/menus/GameOver.tscn rename to src/renderers/scenes/menus/GameOver.tscn diff --git a/src/views/scenes/menus/MainMenu.tscn b/src/renderers/scenes/menus/MainMenu.tscn similarity index 95% rename from src/views/scenes/menus/MainMenu.tscn rename to src/renderers/scenes/menus/MainMenu.tscn index 83f1bee2..11a07784 100644 --- a/src/views/scenes/menus/MainMenu.tscn +++ b/src/renderers/scenes/menus/MainMenu.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=3 uid="uid://myouhbwr3b27"] [ext_resource type="Script" uid="uid://p2tg6o2lnf5" path="res://controllers/MainMenuManager.cs" id="1_vwte4"] -[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://views/ui/SceneTransitionButton.cs" id="2_mpm8c"] -[ext_resource type="Script" uid="uid://bk4vy3txoi8tv" path="res://views/ui/CloseGameButton.cs" id="3_uq48m"] +[ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://renderers/ui/SceneTransitionButton.cs" id="2_mpm8c"] +[ext_resource type="Script" uid="uid://bk4vy3txoi8tv" path="res://renderers/ui/CloseGameButton.cs" id="3_uq48m"] [node name="MainMenu" type="Node2D"] script = ExtResource("1_vwte4") diff --git a/src/views/ui/CloseGameButton.cs b/src/renderers/ui/CloseGameButton.cs similarity index 100% rename from src/views/ui/CloseGameButton.cs rename to src/renderers/ui/CloseGameButton.cs diff --git a/src/views/ui/CloseGameButton.cs.uid b/src/renderers/ui/CloseGameButton.cs.uid similarity index 100% rename from src/views/ui/CloseGameButton.cs.uid rename to src/renderers/ui/CloseGameButton.cs.uid diff --git a/src/views/ui/SceneTransitionButton.cs b/src/renderers/ui/SceneTransitionButton.cs similarity index 100% rename from src/views/ui/SceneTransitionButton.cs rename to src/renderers/ui/SceneTransitionButton.cs diff --git a/src/views/ui/SceneTransitionButton.cs.uid b/src/renderers/ui/SceneTransitionButton.cs.uid similarity index 100% rename from src/views/ui/SceneTransitionButton.cs.uid rename to src/renderers/ui/SceneTransitionButton.cs.uid diff --git a/src/views/utils/Arc2D.cs b/src/renderers/utils/Arc2D.cs similarity index 100% rename from src/views/utils/Arc2D.cs rename to src/renderers/utils/Arc2D.cs diff --git a/src/views/utils/Arc2D.cs.uid b/src/renderers/utils/Arc2D.cs.uid similarity index 100% rename from src/views/utils/Arc2D.cs.uid rename to src/renderers/utils/Arc2D.cs.uid diff --git a/src/views/utils/Arc3DRenderer/Arc3DRenderer.cs b/src/renderers/utils/Arc3DRenderer/Arc3DRenderer.cs similarity index 100% rename from src/views/utils/Arc3DRenderer/Arc3DRenderer.cs rename to src/renderers/utils/Arc3DRenderer/Arc3DRenderer.cs diff --git a/src/views/utils/Arc3DRenderer/Arc3DRenderer.cs.uid b/src/renderers/utils/Arc3DRenderer/Arc3DRenderer.cs.uid similarity index 100% rename from src/views/utils/Arc3DRenderer/Arc3DRenderer.cs.uid rename to src/renderers/utils/Arc3DRenderer/Arc3DRenderer.cs.uid diff --git a/src/views/utils/Arc3DRenderer/Arc3DRenderer.tscn b/src/renderers/utils/Arc3DRenderer/Arc3DRenderer.tscn similarity index 78% rename from src/views/utils/Arc3DRenderer/Arc3DRenderer.tscn rename to src/renderers/utils/Arc3DRenderer/Arc3DRenderer.tscn index 88ac4c5a..734128d2 100644 --- a/src/views/utils/Arc3DRenderer/Arc3DRenderer.tscn +++ b/src/renderers/utils/Arc3DRenderer/Arc3DRenderer.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=3 uid="uid://djth012ehvnu2"] -[ext_resource type="Script" uid="uid://bneeqn85v2ons" path="res://views/utils/Arc3DRenderer/Arc3DRenderer.cs" id="1_umdm2"] +[ext_resource type="Script" uid="uid://bneeqn85v2ons" path="res://renderers/utils/Arc3DRenderer/Arc3DRenderer.cs" id="1_umdm2"] [node name="Arc3DRenderer" type="Node3D"] script = ExtResource("1_umdm2") diff --git a/src/views/utils/Arc3DRenderer/Arc3DRenderer.uid b/src/renderers/utils/Arc3DRenderer/Arc3DRenderer.uid similarity index 100% rename from src/views/utils/Arc3DRenderer/Arc3DRenderer.uid rename to src/renderers/utils/Arc3DRenderer/Arc3DRenderer.uid diff --git a/src/views/utils/ArcDrawer.cs b/src/renderers/utils/ArcDrawer.cs similarity index 100% rename from src/views/utils/ArcDrawer.cs rename to src/renderers/utils/ArcDrawer.cs diff --git a/src/views/utils/ArcDrawer.cs.uid b/src/renderers/utils/ArcDrawer.cs.uid similarity index 100% rename from src/views/utils/ArcDrawer.cs.uid rename to src/renderers/utils/ArcDrawer.cs.uid diff --git a/src/resources/Attributes/Armor.tres b/src/resources/Attributes/Armor.tres index c5e28c6e..835e33a2 100644 --- a/src/resources/Attributes/Armor.tres +++ b/src/resources/Attributes/Armor.tres @@ -1,4 +1,4 @@ -[gd_resource type="Resource" load_steps=2 format=3 uid="uid://d37vh6vtgnxkp"] +[gd_resource type="Resource" script_class="AttributeType" load_steps=2 format=3 uid="uid://d37vh6vtgnxkp"] [ext_resource type="Script" uid="uid://dv3nebxjhpuk0" path="res://models/data/Attribute/AttributeType.cs" id="1_73wod"] diff --git a/src/resources/Attributes/Speed.tres b/src/resources/Attributes/Speed.tres index 26f57ccc..90211aa6 100644 --- a/src/resources/Attributes/Speed.tres +++ b/src/resources/Attributes/Speed.tres @@ -1,4 +1,4 @@ -[gd_resource type="Resource" load_steps=2 format=3 uid="uid://blv7vekuqpawn"] +[gd_resource type="Resource" script_class="AttributeType" load_steps=2 format=3 uid="uid://blv7vekuqpawn"] [ext_resource type="Script" uid="uid://dv3nebxjhpuk0" path="res://models/data/Attribute/AttributeType.cs" id="1_8nsa1"] diff --git a/src/resources/Characters/Dummy.tres b/src/resources/Characters/Dummy.tres index d0e6ae8c..0d4465fa 100644 --- a/src/resources/Characters/Dummy.tres +++ b/src/resources/Characters/Dummy.tres @@ -1,5 +1,7 @@ -[gd_resource type="Resource" load_steps=4 format=3 uid="uid://ctp5er4mb8u3k"] +[gd_resource type="Resource" script_class="CharacterType" load_steps=6 format=3 uid="uid://ctp5er4mb8u3k"] +[ext_resource type="Script" uid="uid://cxt7qolwarsf1" path="res://models/data/Character/CharacterAction.cs" id="1_5s1he"] +[ext_resource type="Script" uid="uid://6shb3cqcf2bt" path="res://models/data/Character/CharacterAttribute.cs" id="2_suo5q"] [ext_resource type="Resource" uid="uid://bjc78p06uwuy3" path="res://resources/Locations/EnemySquad.tres" id="4_5s1he"] [ext_resource type="SpriteFrames" uid="uid://bkvhu7v1tmcfy" path="res://assets/characters/dummyOtsoga/DummyOtsogaSprites.tres" id="5_giux7"] [ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://models/data/Character/CharacterType.cs" id="8_ktuse"] @@ -8,11 +10,12 @@ script = ExtResource("8_ktuse") Name = "Dummy" CharacterSprite = ExtResource("5_giux7") +PixelSize = 0.01 ShowShadow = false SpritePositionX = 0.0 SpritePositionY = 0.0 -Attributes = [] -Actions = [] +Attributes = Array[ExtResource("2_suo5q")]([]) +Actions = Array[ExtResource("1_5s1he")]([]) Location = ExtResource("4_5s1he") SlotIndex = 0 Id = "a98288c9-8795-4e16-801f-5fed51abd905" diff --git a/src/resources/Characters/Eleonore.tres b/src/resources/Characters/Eleonore.tres index 934e9601..61a123a9 100644 --- a/src/resources/Characters/Eleonore.tres +++ b/src/resources/Characters/Eleonore.tres @@ -1,5 +1,7 @@ -[gd_resource type="Resource" load_steps=16 format=3 uid="uid://clrt1eby68x42"] +[gd_resource type="Resource" script_class="CharacterType" load_steps=18 format=3 uid="uid://clrt1eby68x42"] +[ext_resource type="Script" uid="uid://cxt7qolwarsf1" path="res://models/data/Character/CharacterAction.cs" id="1_3cii4"] +[ext_resource type="Script" uid="uid://6shb3cqcf2bt" path="res://models/data/Character/CharacterAttribute.cs" id="2_mck33"] [ext_resource type="Resource" uid="uid://d1dsndqu7on50" path="res://resources/Locations/PlayerSquad.tres" id="4_3cii4"] [ext_resource type="SpriteFrames" uid="uid://bskb8ffl72voq" path="res://assets/characters/eleonoreOtsoga/EleonoreOtsogaSprites.tres" id="6_balo1"] [ext_resource type="Texture2D" uid="uid://dqpa6f8n80d61" path="res://assets/characters/eleonoreOtsoga/EleonoreOtsogaPortrait.png" id="8_7y5lj"] @@ -83,12 +85,13 @@ script = ExtResource("10_crg3w") Name = "Eleonore" Portrait = ExtResource("8_7y5lj") CharacterSprite = ExtResource("6_balo1") +PixelSize = 0.016 ShadowSprite = SubResource("SpriteFrames_o11qe") ShowShadow = false SpritePositionX = 0.0 SpritePositionY = 0.0 -Attributes = [] -Actions = [] +Attributes = Array[ExtResource("2_mck33")]([]) +Actions = Array[ExtResource("1_3cii4")]([]) Location = ExtResource("4_3cii4") SlotIndex = 2 Id = "4ea655f0-4c3e-4fba-bafe-fe361e68db9e" diff --git a/src/resources/Characters/EnemyCharacterStore.tres b/src/resources/Characters/EnemyCharacterStore.tres index 27851e2e..948207e0 100644 --- a/src/resources/Characters/EnemyCharacterStore.tres +++ b/src/resources/Characters/EnemyCharacterStore.tres @@ -1,9 +1,10 @@ -[gd_resource type="Resource" load_steps=3 format=3 uid="uid://d22hmntd0rfq2"] +[gd_resource type="Resource" script_class="CharacterStore" load_steps=4 format=3 uid="uid://d22hmntd0rfq2"] +[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://models/data/Character/CharacterType.cs" id="1_e35d6"] [ext_resource type="Resource" uid="uid://ctp5er4mb8u3k" path="res://resources/Characters/Dummy.tres" id="2_e35d6"] [ext_resource type="Script" uid="uid://c0ludr6rojb3c" path="res://models/stores/CharacterStore.cs" id="3_m0fko"] [resource] script = ExtResource("3_m0fko") -Characters = [ExtResource("2_e35d6")] +Characters = Array[ExtResource("1_e35d6")]([ExtResource("2_e35d6")]) metadata/_custom_type_script = ExtResource("3_m0fko") diff --git a/src/resources/Characters/Joanna.tres b/src/resources/Characters/Joanna.tres index 54ad3b35..f7dab045 100644 --- a/src/resources/Characters/Joanna.tres +++ b/src/resources/Characters/Joanna.tres @@ -1,5 +1,7 @@ -[gd_resource type="Resource" load_steps=6 format=3 uid="uid://bkolttux1bvi1"] +[gd_resource type="Resource" script_class="CharacterType" load_steps=8 format=3 uid="uid://bkolttux1bvi1"] +[ext_resource type="Script" uid="uid://cxt7qolwarsf1" path="res://models/data/Character/CharacterAction.cs" id="1_5q3u5"] +[ext_resource type="Script" uid="uid://6shb3cqcf2bt" path="res://models/data/Character/CharacterAttribute.cs" id="2_6bp7c"] [ext_resource type="Resource" uid="uid://d1dsndqu7on50" path="res://resources/Locations/PlayerSquad.tres" id="4_5q3u5"] [ext_resource type="Resource" uid="uid://bad7cxgeb8mqp" path="res://resources/Roles/Playable/Fighter.tres" id="5_ffsgs"] [ext_resource type="SpriteFrames" uid="uid://fdkgmyh24b0q" path="res://assets/characters/joannaOtsoga/JoannaOtsogaSprites.tres" id="6_d10er"] @@ -11,12 +13,13 @@ script = ExtResource("10_iwykt") Name = "Joanna" Portrait = ExtResource("8_62ltr") CharacterSprite = ExtResource("6_d10er") +PixelSize = 0.016 ShowShadow = false SpritePositionX = 0.0 -SpritePositionY = -0.167 +SpritePositionY = -10.0 Role = ExtResource("5_ffsgs") -Attributes = [] -Actions = [] +Attributes = Array[ExtResource("2_6bp7c")]([]) +Actions = Array[ExtResource("1_5q3u5")]([]) Location = ExtResource("4_5q3u5") SlotIndex = 5 Id = "d98ec50f-3df3-47e6-b266-cbc7b8fbb745" diff --git a/src/resources/Characters/PlayerCharacterStore.tres b/src/resources/Characters/PlayerCharacterStore.tres index ceab380c..982dce65 100644 --- a/src/resources/Characters/PlayerCharacterStore.tres +++ b/src/resources/Characters/PlayerCharacterStore.tres @@ -1,9 +1,10 @@ -[gd_resource type="Resource" load_steps=4 format=3 uid="uid://snt34yslyn4f"] +[gd_resource type="Resource" script_class="CharacterStore" load_steps=5 format=3 uid="uid://snt34yslyn4f"] +[ext_resource type="Script" uid="uid://0ip2w43r0d2a" path="res://models/data/Character/CharacterType.cs" id="1_tf880"] [ext_resource type="Resource" uid="uid://clrt1eby68x42" path="res://resources/Characters/Eleonore.tres" id="2_tf880"] [ext_resource type="Resource" uid="uid://bkolttux1bvi1" path="res://resources/Characters/Joanna.tres" id="3_oxbo1"] [ext_resource type="Script" uid="uid://c0ludr6rojb3c" path="res://models/stores/CharacterStore.cs" id="10_xofbh"] [resource] script = ExtResource("10_xofbh") -Characters = [ExtResource("2_tf880"), ExtResource("3_oxbo1")] +Characters = Array[ExtResource("1_tf880")]([ExtResource("2_tf880"), ExtResource("3_oxbo1")]) diff --git a/src/resources/Roles/Playable/Fighter.tres b/src/resources/Roles/Playable/Fighter.tres index 9d49de1c..83535a13 100644 --- a/src/resources/Roles/Playable/Fighter.tres +++ b/src/resources/Roles/Playable/Fighter.tres @@ -1,4 +1,4 @@ -[gd_resource type="Resource" load_steps=8 format=3 uid="uid://bad7cxgeb8mqp"] +[gd_resource type="Resource" script_class="RoleType" load_steps=8 format=3 uid="uid://bad7cxgeb8mqp"] [ext_resource type="Script" uid="uid://dva25u156vwmb" path="res://models/data/Role/RoleAction.cs" id="1_iytx6"] [ext_resource type="Script" uid="uid://dg8bedxsn6cm7" path="res://models/data/Role/RoleAttribute.cs" id="3_j81qd"] @@ -24,6 +24,6 @@ BaseValue = 50 script = ExtResource("7_x8hfl") Name = "Fighter" Description = "Fighter Description" -RoleAttributes = [SubResource("Resource_g0hcp"), SubResource("Resource_8w8fm"), SubResource("Resource_xurgi")] -RoleActions = [SubResource("Resource_rp15h")] +RoleAttributes = Array[ExtResource("3_j81qd")]([SubResource("Resource_g0hcp"), SubResource("Resource_8w8fm"), SubResource("Resource_xurgi")]) +RoleActions = Array[ExtResource("1_iytx6")]([SubResource("Resource_rp15h")]) Id = "d617ceaf-d1be-425f-80e3-5e662e73dba6" From ed8d2dc308c434bf8b1cbeedf4ef32135014e094 Mon Sep 17 00:00:00 2001 From: Danilo Nobre Date: Tue, 11 Mar 2025 19:49:13 -0300 Subject: [PATCH 04/13] Refactor EventBus to use generic component signals and update Entity3D to support identifiable resources --- src/events/EventBus.cs | 53 ++++--------------- src/helpers/SignalHelper.cs | 14 ----- .../CharacterEntity/CharacterEntity.tscn | 38 ++++++++++--- src/renderers/entities/Entity3D.cs | 7 +-- 4 files changed, 47 insertions(+), 65 deletions(-) diff --git a/src/events/EventBus.cs b/src/events/EventBus.cs index a348edb6..efb88ff4 100644 --- a/src/events/EventBus.cs +++ b/src/events/EventBus.cs @@ -1,24 +1,19 @@ using Godot; -using DiceRolling.Characters; -using DiceRolling.Attributes; -using DiceRolling.Targets; - -using DiceRolling.Components.Characters; +using DiceRolling.Entities; +using DiceRolling.Components; namespace DiceRolling.Events; [Tool] public partial class EventBus : Node { - [Signal] public delegate void AttributeChangedEventHandler(); - [Signal] public delegate void CharacterSelectedEventHandler(CharacterComponent character); - [Signal] public delegate void CharacterUnselectedEventHandler(); - [Signal] public delegate void ActionSelectedEventHandler(TargetBoardType targetBoard); + [Signal] public delegate void ComponentSelectedEventHandler(Node component); + [Signal] public delegate void ComponentUnselectedEventHandler(Node component); private static EventBus? _instance; public static EventBus Instance { get { - _instance ??= GetInstance(); + _instance ??= new EventBus(); return _instance; } } @@ -27,41 +22,15 @@ public override void _Ready() { _instance = this; } - public override void _Input(InputEvent @event) { - if (@event.IsActionPressed("ui_cancel")) { - OnCharacterUnselected(); - } - } + public void OnComponentSelected(Node component) { + EmitSignal(nameof(ComponentSelected), component); - private static EventBus GetInstance() { - var root = (Engine.GetMainLoop() as SceneTree)?.Root; - if (root is null) { - return new EventBus(); - } - var eventBus = root.GetNodeOrNull("/root/EventBus"); - if (eventBus is null) { - eventBus = new EventBus(); - root.CallDeferred("add_child", eventBus); - } - return eventBus; - } - - public void EmitAttributeChanged(CharacterType character, AttributeType attributeType) { - EmitSignal(nameof(AttributeChanged), character, attributeType); - } - - public void OnCharacterSelected(CharacterComponent character) { - var characterName = character?.Character?.Name ?? "Unknown"; - - if (character is not null) { - EmitSignal(nameof(CharacterSelected), character); - } - else { - GD.PrintErr("Character is null, cannot emit CharacterSelected signal."); + if (component is SelectableComponent selectableComponent && selectableComponent.GetParent() is Entity3D parentEntity && parentEntity.Data is { } data) { + GD.Print("Selected Data ID:", data.Id); } } - public void OnCharacterUnselected() { - EmitSignal(nameof(CharacterUnselected)); + public void OnComponentUnselected(Node component) { + EmitSignal(nameof(ComponentUnselected), component); } } \ No newline at end of file diff --git a/src/helpers/SignalHelper.cs b/src/helpers/SignalHelper.cs index bb8fc2fe..0712175c 100644 --- a/src/helpers/SignalHelper.cs +++ b/src/helpers/SignalHelper.cs @@ -6,13 +6,6 @@ namespace DiceRolling.Helpers; /// Helper class for safely connecting and disconnecting signals in Godot /// public static class SignalHelper { - /// - /// Safely connects a signal from a source object to a target method - /// - /// The source object that emits the signal - /// Name of the signal to connect - /// The target object that will receive the signal - /// Name of the method to call when the signal is emitted public static void ConnectSignal(GodotObject? source, string signalName, GodotObject target, string methodName) { if (source == null) return; @@ -29,13 +22,6 @@ public static void ConnectSignal(GodotObject? source, string signalName, GodotOb source.Connect(signalName, new Callable(target, methodName)); } - /// - /// Safely disconnects a signal from a source object - /// - /// The source object that emits the signal - /// Name of the signal to disconnect - /// The target object that was receiving the signal - /// Name of the method that was called when the signal was emitted public static void DisconnectSignal(GodotObject? source, string signalName, GodotObject target, string methodName) { if (source == null) return; diff --git a/src/renderers/entities/CharacterEntity/CharacterEntity.tscn b/src/renderers/entities/CharacterEntity/CharacterEntity.tscn index 7971cb10..a72acff9 100644 --- a/src/renderers/entities/CharacterEntity/CharacterEntity.tscn +++ b/src/renderers/entities/CharacterEntity/CharacterEntity.tscn @@ -1,10 +1,16 @@ -[gd_scene load_steps=6 format=3 uid="uid://b5fpv2rdkq5c"] +[gd_scene load_steps=9 format=3 uid="uid://b5fpv2rdkq5c"] [ext_resource type="Script" uid="uid://cyt7peem686tr" path="res://renderers/entities/CharacterEntity/CharacterEntity.cs" id="1_sly7g"] [ext_resource type="Resource" uid="uid://clrt1eby68x42" path="res://resources/Characters/Eleonore.tres" id="2_vbwm8"] [ext_resource type="SpriteFrames" uid="uid://bskb8ffl72voq" path="res://assets/characters/eleonoreOtsoga/EleonoreOtsogaSprites.tres" id="3_lytje"] [ext_resource type="Script" uid="uid://cejuccgxo60qs" path="res://renderers/components/AnimatedSpriteComponent.cs" id="3_q1qiw"] [ext_resource type="Script" uid="uid://bs8ip2rdvho4s" path="res://renderers/components/SelectableComponent.cs" id="4_lytje"] +[ext_resource type="Texture2D" uid="uid://drfm6uc8yvpwi" path="res://assets/icons/hud/plain-arrow.png" id="6_56jxl"] +[ext_resource type="Texture2D" uid="uid://cytb6ea63fslt" path="res://assets/icons/hud/select.png" id="7_5h2tr"] + +[sub_resource type="CapsuleShape3D" id="CapsuleShape3D_x22vy"] +radius = 0.280048 +height = 1.007 [node name="CharacterEntity" type="Node3D"] script = ExtResource("1_sly7g") @@ -20,13 +26,33 @@ shaded = true texture_filter = 0 sprite_frames = ExtResource("3_lytje") animation = &"idle" -frame_progress = 0.9642 +frame_progress = 0.403001 script = ExtResource("3_q1qiw") metadata/_custom_type_script = "uid://cejuccgxo60qs" -[node name="SelectableComponent" type="Node3D" parent="."] +[node name="SelectableComponent" type="Node3D" parent="." node_paths=PackedStringArray("SelectorSprite", "HoverSpriteNode", "InputAreaNode")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) script = ExtResource("4_lytje") -ShapeType = 1 -BoxSize = Vector3(0, 1, 0) -CapsuleRadius = 0.25 +SelectorSprite = NodePath("Selector") +HoverSpriteNode = NodePath("Hover") +InputAreaNode = NodePath("Area3D") metadata/_custom_type_script = "uid://bs8ip2rdvho4s" + +[node name="Selector" type="Sprite3D" parent="SelectableComponent"] +transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0.75, 0) +pixel_size = 0.002 +billboard = 1 +texture = ExtResource("6_56jxl") + +[node name="Hover" type="Sprite3D" parent="SelectableComponent"] +pixel_size = 0.002 +billboard = 1 +texture = ExtResource("7_5h2tr") + +[node name="Area3D" type="Area3D" parent="SelectableComponent"] + +[node name="CollisionShape3D" type="CollisionShape3D" parent="SelectableComponent/Area3D"] +shape = SubResource("CapsuleShape3D_x22vy") + +[node name="Camera3D" type="Camera3D" parent="."] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 2) diff --git a/src/renderers/entities/Entity3D.cs b/src/renderers/entities/Entity3D.cs index 60d70794..efbc8eda 100644 --- a/src/renderers/entities/Entity3D.cs +++ b/src/renderers/entities/Entity3D.cs @@ -1,5 +1,6 @@ using Godot; using DiceRolling.Helpers; +using DiceRolling.Id; namespace DiceRolling.Entities; @@ -9,10 +10,10 @@ namespace DiceRolling.Entities; public abstract partial class Entity3D : Node3D { [Signal] public delegate void EntityUpdatedEventHandler(); - private Resource? _data; + private IdentifiableResource? _data; [Export] - public Resource? Data { + public IdentifiableResource? Data { get => _data; set { if (_data == value) { @@ -36,7 +37,7 @@ protected void NotifyUpdate() { } // Changed from protected to public to allow components to access it - public T? GetData() where T : Resource { + public T? GetData() where T : IdentifiableResource { return Data as T; } From c178fcca19fbc8d253cfc39dd9ea9131df46d4fb Mon Sep 17 00:00:00 2001 From: Danilo Nobre Date: Tue, 11 Mar 2025 19:49:33 -0300 Subject: [PATCH 05/13] Remove CharacterComponent and comment out EventBus connections in related components --- .../CharacterComponent/CharacterComponent.cs | 145 ------------------ .../CharacterComponent.cs.uid | 1 - .../CharacterComponent.tscn | 56 ------- .../components/CharacterGrid/CharacterGrid.cs | 2 +- .../CharacterGrid/CharacterGrid.tscn | 4 +- .../components/CharacterGrid/Grid3D.cs | 46 +++--- .../components/CharacterGrid/GridCell3D.cs | 10 +- .../CharacterInspector/CharacterInspector.cs | 16 +- .../components/SelectableComponent.cs | 137 ++++------------- .../TurnOrderComponent/TurnOrderComponent.cs | 2 +- src/renderers/utils/ArcDrawer.cs | 33 ++-- 11 files changed, 87 insertions(+), 365 deletions(-) delete mode 100644 src/renderers/components/CharacterComponent/CharacterComponent.cs delete mode 100644 src/renderers/components/CharacterComponent/CharacterComponent.cs.uid delete mode 100644 src/renderers/components/CharacterComponent/CharacterComponent.tscn diff --git a/src/renderers/components/CharacterComponent/CharacterComponent.cs b/src/renderers/components/CharacterComponent/CharacterComponent.cs deleted file mode 100644 index 1c83bbd6..00000000 --- a/src/renderers/components/CharacterComponent/CharacterComponent.cs +++ /dev/null @@ -1,145 +0,0 @@ -using Godot; - -using DiceRolling.Events; -using DiceRolling.Characters; - -namespace DiceRolling.Components.Characters; - -[Tool] -public partial class CharacterComponent : Node3D { - private static CharacterComponent? _currentlySelectedCharacter; - - [ExportGroup("🪵 Resources")] - private CharacterType? _characterResource; - - [Export] - public CharacterType? Character { - get => _characterResource; - set { - _characterResource = value; - OnCharacterResourceSet(); - } - } - - [ExportGroup("🏳️ Flags")] - [Export] - public bool IsEnemy { get; set; } - - private bool _isHovered = false; - [Export] - public bool IsHovered { - get => _isHovered; - set { - _isHovered = value; - OnIsHoveredSet(value); - } - } - - private bool _isSelected = false; - [Export] - public bool IsSelected { - get => _isSelected; - set { - if (_isSelected != value) { - _isSelected = value; - OnIsSelectedSet(value); - } - } - } - - [ExportGroup("🔘 Nodes")] - [Export] public AnimatedSprite3D? AnimatedSpriteNode { get; set; } - [Export] public Sprite3D? HoverSpriteNode { get; set; } - [Export] public Sprite3D? SelectorSpriteNode { get; set; } - [Export] public Area3D? InputAreaNode { get; set; } - - public override void _Ready() { - ConnectSignals(); - if (HoverSpriteNode is not null) { - HoverSpriteNode.Visible = false; - } - if (SelectorSpriteNode is not null) { - SelectorSpriteNode.Visible = false; - } - - // Connect the CharacterUnselected signal from EventBus to the OnCharacterUnselected method - EventBus.Instance.Connect(nameof(EventBus.CharacterUnselected), new Callable(this, nameof(OnCharacterUnselected))); - } - - private void ConnectSignals() { - InputAreaNode?.Connect("input_event", new Callable(this, nameof(OnInputEvent))); - InputAreaNode?.Connect("mouse_entered", Callable.From(OnMouseEntered)); - InputAreaNode?.Connect("mouse_exited", Callable.From(OnMouseExited)); - } - - private void OnInputEvent(Node camera, InputEvent @event, Vector3 click_position, Vector3 normal, int shape_idx) { - if (@event is InputEventMouseButton { Pressed: true }) { - if (!IsEnemy) { - HandleSelection(this); - } - } - } - - private static void HandleSelection(CharacterComponent current) { - if (_currentlySelectedCharacter == current) { - current.IsSelected = false; - _currentlySelectedCharacter = null; - EventBus.Instance.EmitSignal(nameof(EventBus.CharacterUnselected)); - } - else { - if (_currentlySelectedCharacter is not null) { - _currentlySelectedCharacter.IsSelected = false; - } - current.IsSelected = true; - _currentlySelectedCharacter = current; - EventBus.Instance.EmitSignal(nameof(EventBus.CharacterSelected), current); - } - } - - private void OnCharacterUnselected() { - IsSelected = false; - } - - private void OnMouseEntered() { - IsHovered = true; - } - - private void OnMouseExited() { - IsHovered = false; - } - - private void OnIsHoveredSet(bool isHovered) { - if (HoverSpriteNode is not null) { - HoverSpriteNode.Visible = isHovered; - } - } - - private void OnIsSelectedSet(bool isSelected) { - if (SelectorSpriteNode is not null) { - SelectorSpriteNode.Visible = isSelected; - } - } - - public void FlipSprite(bool flip) { - if (AnimatedSpriteNode is not null) { - AnimatedSpriteNode.FlipH = flip; - } - } - - private void OnCharacterResourceSet() { - if (Character is null) { - return; - } - - if (AnimatedSpriteNode is null) { - return; - } - - if (Character.CharacterSprite is not null) { - AnimatedSpriteNode.SpriteFrames = Character.CharacterSprite; - AnimatedSpriteNode.Transform = new Transform3D(Basis.Identity, new Vector3(Character.SpritePositionX, 0.5f + Character.SpritePositionY, 0)); - AnimatedSpriteNode.Play("idle"); - } - - } -} \ No newline at end of file diff --git a/src/renderers/components/CharacterComponent/CharacterComponent.cs.uid b/src/renderers/components/CharacterComponent/CharacterComponent.cs.uid deleted file mode 100644 index e508b7ed..00000000 --- a/src/renderers/components/CharacterComponent/CharacterComponent.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://f1lqpaw1xng7 diff --git a/src/renderers/components/CharacterComponent/CharacterComponent.tscn b/src/renderers/components/CharacterComponent/CharacterComponent.tscn deleted file mode 100644 index 28489e58..00000000 --- a/src/renderers/components/CharacterComponent/CharacterComponent.tscn +++ /dev/null @@ -1,56 +0,0 @@ -[gd_scene load_steps=5 format=3 uid="uid://d3lkjx05elcwq"] - -[ext_resource type="Script" uid="uid://f1lqpaw1xng7" path="res://renderers/components/CharacterComponent/CharacterComponent.cs" id="1_t0krx"] -[ext_resource type="Texture2D" uid="uid://cytb6ea63fslt" path="res://assets/icons/hud/select.png" id="3_gxxii"] -[ext_resource type="SpriteFrames" uid="uid://fdkgmyh24b0q" path="res://assets/characters/joannaOtsoga/JoannaOtsogaSprites.tres" id="4_svr47"] - -[sub_resource type="BoxShape3D" id="BoxShape3D_tiklp"] -size = Vector3(0.5, 1, 0.5) - -[node name="CharacterComponent" type="Node3D" node_paths=PackedStringArray("AnimatedSpriteNode", "HoverSpriteNode", "SelectorSpriteNode", "InputAreaNode")] -script = ExtResource("1_t0krx") -AnimatedSpriteNode = NodePath("Character/AnimatedSprite3D") -HoverSpriteNode = NodePath("Selector/HoverSprite") -SelectorSpriteNode = NodePath("Selector/SelectorSprite") -InputAreaNode = NodePath("Selector/Area3D") - -[node name="Selector" type="Node3D" parent="."] - -[node name="Area3D" type="Area3D" parent="Selector"] - -[node name="SelectionArea" type="CollisionShape3D" parent="Selector/Area3D"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) -shape = SubResource("BoxShape3D_tiklp") - -[node name="HoverSprite" type="Sprite3D" parent="Selector"] -transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0.5, 0) -visible = false -pixel_size = 0.002 -billboard = 1 -double_sided = false -texture_filter = 0 -texture = ExtResource("3_gxxii") - -[node name="SelectorSprite" type="Sprite3D" parent="Selector"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) -visible = false -pixel_size = 0.002 -billboard = 1 -double_sided = false -texture_filter = 0 -texture = ExtResource("3_gxxii") - -[node name="Character" type="Node3D" parent="."] - -[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="Character"] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.5, 0) -extra_cull_margin = 1.0 -pixel_size = 0.0156 -billboard = 1 -shaded = true -double_sided = false -alpha_cut = 2 -texture_filter = 0 -sprite_frames = ExtResource("4_svr47") -animation = &"idle" -frame_progress = 0.520203 diff --git a/src/renderers/components/CharacterGrid/CharacterGrid.cs b/src/renderers/components/CharacterGrid/CharacterGrid.cs index 26a7d8af..15fdfaba 100644 --- a/src/renderers/components/CharacterGrid/CharacterGrid.cs +++ b/src/renderers/components/CharacterGrid/CharacterGrid.cs @@ -26,7 +26,7 @@ public partial class CharacterGrid : Node3D { public override void _Ready() { base._Ready(); GenerateGrids(); - EventBus.Instance.Connect(nameof(EventBus.ActionSelected), new Callable(this, nameof(OnActionSelected))); + // EventBus.Instance.Connect(nameof(EventBus.ActionSelected), new Callable(this, nameof(OnActionSelected))); } public override void _ExitTree() { diff --git a/src/renderers/components/CharacterGrid/CharacterGrid.tscn b/src/renderers/components/CharacterGrid/CharacterGrid.tscn index fd760992..de23b293 100644 --- a/src/renderers/components/CharacterGrid/CharacterGrid.tscn +++ b/src/renderers/components/CharacterGrid/CharacterGrid.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=7 format=3 uid="uid://dmw0cm136sn4p"] +[gd_scene load_steps=6 format=3 uid="uid://dmw0cm136sn4p"] [ext_resource type="Script" uid="uid://gymkyw1r3mtn" path="res://renderers/components/CharacterGrid/CharacterGrid.cs" id="1_tabhr"] [ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://models/data/Grid/GridType.cs" id="2_ml3sj"] -[ext_resource type="PackedScene" uid="uid://d3lkjx05elcwq" path="res://renderers/components/CharacterComponent/CharacterComponent.tscn" id="4_3uydg"] [ext_resource type="PackedScene" uid="uid://bltesg17i4ul8" path="res://renderers/components/CharacterGrid/Arrow.tscn" id="5_og5wa"] [sub_resource type="Resource" id="Resource_jan7r"] @@ -28,6 +27,5 @@ metadata/_custom_type_script = ExtResource("2_ml3sj") [node name="CharacterGrid" type="Node3D"] script = ExtResource("1_tabhr") GridConfigurations = [SubResource("Resource_jan7r"), SubResource("Resource_3uydg")] -CharacterComponentScene = ExtResource("4_3uydg") ArrowMesh = ExtResource("5_og5wa") CellPadding = 0.055 diff --git a/src/renderers/components/CharacterGrid/Grid3D.cs b/src/renderers/components/CharacterGrid/Grid3D.cs index ed064296..44005f51 100644 --- a/src/renderers/components/CharacterGrid/Grid3D.cs +++ b/src/renderers/components/CharacterGrid/Grid3D.cs @@ -130,29 +130,29 @@ private void RenderBattleSquadCharacters() { return; } - foreach (var character in CharacterStore.Characters) { - if (character.Location?.Name == "Player Squad" || character.Location?.Name == "Enemy Squad" && character.SlotIndex >= 0 && character.SlotIndex < gridCells.Length) { - // Instantiate the CharacterComponent from the packed scene - var characterComponent = CharacterComponentScene.Instantiate(); - if (characterComponent is null) { - GD.PrintErr("Failed to instantiate CharacterComponent"); - continue; - } - - characterComponent.Character = character; - - // Position the character at the center of the cell - var gridCell = gridCells[character.SlotIndex / Columns, character.SlotIndex % Columns]; - if (gridCell is null) { - GD.PrintErr($"Grid cell at index {character.SlotIndex} is null"); - continue; - } - var cellPosition = gridCell.CellMarker.Transform.Origin; - var cellCenter = new Vector3(cellPosition.X + 0.5f, 0, cellPosition.Z + 0.5f); // Use exact grid positions - characterComponent.Transform = new Transform3D(Basis.Identity, cellCenter); - gridCell.SetCharacter(characterComponent); - } - } + // foreach (var character in CharacterStore.Characters) { + // if (character.Location?.Name == "Player Squad" || character.Location?.Name == "Enemy Squad" && character.SlotIndex >= 0 && character.SlotIndex < gridCells.Length) { + // // Instantiate the CharacterComponent from the packed scene + // var characterComponent = CharacterComponentScene.Instantiate(); + // if (characterComponent is null) { + // GD.PrintErr("Failed to instantiate CharacterComponent"); + // continue; + // } + + // characterComponent.Character = character; + + // // Position the character at the center of the cell + // var gridCell = gridCells[character.SlotIndex / Columns, character.SlotIndex % Columns]; + // if (gridCell is null) { + // GD.PrintErr($"Grid cell at index {character.SlotIndex} is null"); + // continue; + // } + // var cellPosition = gridCell.CellMarker.Transform.Origin; + // var cellCenter = new Vector3(cellPosition.X + 0.5f, 0, cellPosition.Z + 0.5f); // Use exact grid positions + // characterComponent.Transform = new Transform3D(Basis.Identity, cellCenter); + // gridCell.SetCharacter(characterComponent); + // } + // } } public void UpdateCellColor(int index, Color color) { diff --git a/src/renderers/components/CharacterGrid/GridCell3D.cs b/src/renderers/components/CharacterGrid/GridCell3D.cs index 9a13c24e..ef77667d 100644 --- a/src/renderers/components/CharacterGrid/GridCell3D.cs +++ b/src/renderers/components/CharacterGrid/GridCell3D.cs @@ -6,7 +6,7 @@ namespace DiceRolling.Components.Grids; public partial class GridCell3D : Node3D { public Marker3D CellMarker { get; private set; } public Label3D CellLabel { get; private set; } - public CharacterComponent? Character { get; private set; } + // public CharacterComponent? Character { get; private set; } // Parameterless constructor public GridCell3D() { @@ -26,8 +26,8 @@ public GridCell3D(Vector3 position, string labelText) : this() { CellLabel.Transform = new Transform3D(Basis.Identity, new Vector3(position.X + 0.55f, 0.25f, position.Z + 1)); } - public void SetCharacter(CharacterComponent character) { - Character = character; - AddChild(character); - } + // public void SetCharacter(CharacterComponent character) { + // Character = character; + // AddChild(character); + // } } \ No newline at end of file diff --git a/src/renderers/components/CharacterInspector/CharacterInspector.cs b/src/renderers/components/CharacterInspector/CharacterInspector.cs index 1951c7dc..c2fcdd41 100644 --- a/src/renderers/components/CharacterInspector/CharacterInspector.cs +++ b/src/renderers/components/CharacterInspector/CharacterInspector.cs @@ -46,15 +46,15 @@ public CharacterType? Character { public override void _Ready() { Visible = false; - EventBus.Instance.Connect(nameof(EventBus.CharacterSelected), new Callable(this, nameof(OnCharacterSelected))); - EventBus.Instance.Connect(nameof(EventBus.CharacterUnselected), new Callable(this, nameof(OnCharacterUnselected))); + // EventBus.Instance.Connect(nameof(EventBus.CharacterSelected), new Callable(this, nameof(OnCharacterSelected))); + // EventBus.Instance.Connect(nameof(EventBus.CharacterUnselected), new Callable(this, nameof(OnCharacterUnselected))); } - private void OnCharacterSelected(CharacterComponent characterComponent) { - _character = characterComponent.Character; - Visible = true; - UpdateCharacterDetails(); - } + // private void OnCharacterSelected(CharacterComponent characterComponent) { + // _character = characterComponent.Character; + // Visible = true; + // UpdateCharacterDetails(); + // } private void OnCharacterUnselected() { _character = null; @@ -174,7 +174,7 @@ private void OnActionButtonPressed(Button button) { if (_actionButtons.TryGetValue(button, out var action)) { if (action.Type?.TargetBoard is not null) { // GD.Print("Emitting ActionSelected signal with target configuration: ", action.Type.TargetBoard); - EventBus.Instance.EmitSignal(nameof(EventBus.ActionSelected), action.Type.TargetBoard); + // EventBus.Instance.EmitSignal(nameof(EventBus.ActionSelected), action.Type.TargetBoard); } } } diff --git a/src/renderers/components/SelectableComponent.cs b/src/renderers/components/SelectableComponent.cs index 37584d90..ceab3df5 100644 --- a/src/renderers/components/SelectableComponent.cs +++ b/src/renderers/components/SelectableComponent.cs @@ -2,6 +2,7 @@ using DiceRolling.Entities; using DiceRolling.Events; using DiceRolling.Helpers; +using DiceRolling.Characters; namespace DiceRolling.Components; @@ -9,22 +10,18 @@ namespace DiceRolling.Components; [GlobalClass] [Icon("res://assets/editor/component-3d.svg")] public partial class SelectableComponent : Node3D { + private Entity3D? _parent; + private static SelectableComponent? _currentlySelectedComponent; - public enum CollisionShapeType { Box, Capsule } + private bool _isSelected = false; - [Export] public CollisionShapeType ShapeType { get; set; } = CollisionShapeType.Box; - [Export] public Vector3 BoxSize { get; set; } = new Vector3(1.0f, 1.0f, 1.0f); - [Export] public float CapsuleHeight { get; set; } = 1.0f; - [Export] public float CapsuleRadius { get; set; } = 0.5f; + private bool _isHovered = false; [Export] public Sprite3D? SelectorSprite { get; set; } [Export] public Sprite3D? HoverSpriteNode { get; set; } + [Export] public Area3D? InputAreaNode { get; set; } - private Area3D? _inputArea; - private Entity3D? _parent; - - private bool _isSelected = false; [Export] public bool IsSelected { get => _isSelected; @@ -36,7 +33,6 @@ public bool IsSelected { } } - private bool _isHovered = false; [Export] public bool IsHovered { get => _isHovered; @@ -51,9 +47,6 @@ public bool IsHovered { public override void _Ready() { _parent = GetParent(); - // Create area and collision shape - CreateInputArea(); - // Initialize visuals if (SelectorSprite is not null) { SelectorSprite.Visible = false; @@ -62,74 +55,46 @@ public override void _Ready() { HoverSpriteNode.Visible = false; } - // Connect to entity if available + ConnectSignals(); + + } + + public override void _ExitTree() { + DisconnectSignals(); + } + + + private void ConnectSignals() { if (_parent != null) { SignalHelper.ConnectSignal(_parent, nameof(Entity3D.EntityUpdated), this, nameof(OnEntityUpdated)); } - EventBus.Instance.Connect(nameof(EventBus.CharacterUnselected), new Callable(this, nameof(OnCharacterUnselected))); - } + SignalHelper.ConnectSignal(EventBus.Instance, nameof(EventBus.ComponentUnselected), this, nameof(OnComponentUnselected)); - private void CreateInputArea() { - // Create area node - _inputArea = new Area3D { - Name = "SelectionArea" - }; - AddChild(_inputArea); - - // Create collision shape - var collisionShape = new CollisionShape3D { - Name = "CollisionShape" - }; - - // Set shape based on configuration - if (ShapeType == CollisionShapeType.Box) { - var boxShape = new BoxShape3D { - Size = BoxSize - }; - collisionShape.Shape = boxShape; + if (InputAreaNode != null) { + SignalHelper.ConnectSignal(InputAreaNode, "input_event", this, nameof(OnInputEvent)); + SignalHelper.ConnectSignal(InputAreaNode, "mouse_entered", this, nameof(OnMouseEntered)); + SignalHelper.ConnectSignal(InputAreaNode, "mouse_exited", this, nameof(OnMouseExited)); } - else { // Capsule - var capsuleShape = new CapsuleShape3D { - Height = CapsuleHeight, - Radius = CapsuleRadius - }; - collisionShape.Shape = capsuleShape; - } - - _inputArea.AddChild(collisionShape); - ConnectSignals(); } - public override void _ExitTree() { - DisconnectSignals(); - + private void DisconnectSignals() { if (_parent != null) { SignalHelper.DisconnectSignal(_parent, nameof(Entity3D.EntityUpdated), this, nameof(OnEntityUpdated)); } - EventBus.Instance.Disconnect(nameof(EventBus.CharacterUnselected), new Callable(this, nameof(OnCharacterUnselected))); - } + SignalHelper.DisconnectSignal(EventBus.Instance, nameof(EventBus.ComponentUnselected), this, nameof(OnComponentUnselected)); - private void ConnectSignals() { - if (_inputArea != null) { - _inputArea.Connect("input_event", new Callable(this, nameof(OnInputEvent))); - _inputArea.Connect("mouse_entered", new Callable(this, nameof(OnMouseEntered))); - _inputArea.Connect("mouse_exited", new Callable(this, nameof(OnMouseExited))); + if (InputAreaNode != null) { + SignalHelper.DisconnectSignal(InputAreaNode, "input_event", this, nameof(OnInputEvent)); + SignalHelper.DisconnectSignal(InputAreaNode, "mouse_entered", this, nameof(OnMouseEntered)); + SignalHelper.DisconnectSignal(InputAreaNode, "mouse_exited", this, nameof(OnMouseExited)); } } - private void DisconnectSignals() { - if (_inputArea != null) { - if (_inputArea.IsConnected("input_event", new Callable(this, nameof(OnInputEvent)))) { - _inputArea.Disconnect("input_event", new Callable(this, nameof(OnInputEvent))); - } - if (_inputArea.IsConnected("mouse_entered", new Callable(this, nameof(OnMouseEntered)))) { - _inputArea.Disconnect("mouse_entered", new Callable(this, nameof(OnMouseEntered))); - } - if (_inputArea.IsConnected("mouse_exited", new Callable(this, nameof(OnMouseExited)))) { - _inputArea.Disconnect("mouse_exited", new Callable(this, nameof(OnMouseExited))); - } + private void OnComponentUnselected(Node component) { + if (component == this) { + IsSelected = false; } } @@ -141,8 +106,7 @@ private void OnMouseExited() { IsHovered = false; } - private void OnEntityUpdated() { - // Update selectable state based on entity data if needed + private static void OnEntityUpdated() { } private void OnInputEvent(Node camera, InputEvent @event, Vector3 clickPosition, Vector3 normal, int shapeIdx) { @@ -155,30 +119,19 @@ private static void HandleSelection(SelectableComponent current) { if (_currentlySelectedComponent == current) { current.IsSelected = false; _currentlySelectedComponent = null; - EventBus.Instance.EmitSignal(nameof(EventBus.CharacterUnselected)); + EventBus.Instance.OnComponentUnselected(current); } else { if (_currentlySelectedComponent is not null) { _currentlySelectedComponent.IsSelected = false; + EventBus.Instance.OnComponentUnselected(_currentlySelectedComponent); } current.IsSelected = true; _currentlySelectedComponent = current; - - // Pass the parent entity to the selection event if available - var entity = current.GetParent(); - if (entity != null) { - EventBus.Instance.EmitSignal(nameof(EventBus.CharacterSelected), entity); - } - else { - EventBus.Instance.EmitSignal(nameof(EventBus.CharacterSelected), current); - } + EventBus.Instance.OnComponentSelected(current); } } - private void OnCharacterUnselected() { - IsSelected = false; - } - private void OnIsSelectedSet(bool isSelected) { if (SelectorSprite is not null) { SelectorSprite.Visible = isSelected; @@ -190,26 +143,4 @@ private void OnIsHoveredSet(bool isHovered) { HoverSpriteNode.Visible = isHovered; } } - - // Called by the inspector to update the collision shape when properties change - public void UpdateShape() { - if (_inputArea == null || !IsInstanceValid(_inputArea)) - return; - - var collisionShape = _inputArea.GetChild(0); - if (collisionShape == null) - return; - - if (ShapeType == CollisionShapeType.Box) { - var boxShape = collisionShape.Shape as BoxShape3D ?? new BoxShape3D(); - boxShape.Size = BoxSize; - collisionShape.Shape = boxShape; - } - else { // Capsule - var capsuleShape = collisionShape.Shape as CapsuleShape3D ?? new CapsuleShape3D(); - capsuleShape.Height = CapsuleHeight; - capsuleShape.Radius = CapsuleRadius; - collisionShape.Shape = capsuleShape; - } - } } \ No newline at end of file diff --git a/src/renderers/components/TurnOrderComponent/TurnOrderComponent.cs b/src/renderers/components/TurnOrderComponent/TurnOrderComponent.cs index da1fc33b..eb988aeb 100644 --- a/src/renderers/components/TurnOrderComponent/TurnOrderComponent.cs +++ b/src/renderers/components/TurnOrderComponent/TurnOrderComponent.cs @@ -83,7 +83,7 @@ public override void _Ready() { } // Connect the AttributeChanged signal from EventBus to the OnCharacterAttributeChanged method - EventBus.Instance.Connect(nameof(EventBus.AttributeChanged), new Callable(this, nameof(OnCharacterAttributeChanged))); + // EventBus.Instance.Connect(nameof(EventBus.AttributeChanged), new Callable(this, nameof(OnCharacterAttributeChanged))); } diff --git a/src/renderers/utils/ArcDrawer.cs b/src/renderers/utils/ArcDrawer.cs index bf6f86ef..8ea6851d 100644 --- a/src/renderers/utils/ArcDrawer.cs +++ b/src/renderers/utils/ArcDrawer.cs @@ -4,15 +4,13 @@ namespace DiceRolling.UI; -public partial class ArcDrawer : Node2D -{ - private CharacterComponent? _selectedCharacter; - private CharacterComponent? _selectedEnemy; +public partial class ArcDrawer : Node2D { + // private CharacterComponent? _selectedCharacter; + // private CharacterComponent? _selectedEnemy; private Arc2D? _arc; private bool _isDrawing; - public override void _Ready() - { + public override void _Ready() { if (Engine.IsEditorHint()) return; _arc = new Arc2D(); @@ -26,13 +24,13 @@ public override void _Ready() // } // } - public void SetSelectedCharacter(CharacterComponent character) - { - _selectedCharacter = character; - _selectedEnemy = null; // Reset the selected enemy - _isDrawing = true; - QueueRedraw(); - } + // public void SetSelectedCharacter(CharacterComponent character) + // { + // _selectedCharacter = character; + // _selectedEnemy = null; // Reset the selected enemy + // _isDrawing = true; + // QueueRedraw(); + // } // public void SetSelectedEnemy(CharacterComponent enemy) { // _selectedEnemy = enemy; @@ -43,15 +41,12 @@ public void SetSelectedCharacter(CharacterComponent character) // QueueRedraw(); // } - private void DrawArc(Vector2 start, Vector2 end) - { - if (_arc is not null) - { + private void DrawArc(Vector2 start, Vector2 end) { + if (_arc is not null) { _arc.Points = new Vector2[] { start, end }; _arc.QueueRedraw(); } - else - { + else { GD.PrintErr("_arc is null, cannot draw arc."); } } From 93819eb288a9356d0e8c31dd59ad620dcd52efda Mon Sep 17 00:00:00 2001 From: Danilo Nobre Date: Tue, 11 Mar 2025 19:49:42 -0300 Subject: [PATCH 06/13] Update README to reflect the addition of helpers directory --- src/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/README.md b/src/README.md index e12669cd..e4085977 100644 --- a/src/README.md +++ b/src/README.md @@ -31,6 +31,8 @@ ├── events # comunicação por signals entre os models, views e controllers │ # TODO: bus, handlers, types │ + ├── helpers # classes utilitárias + │ ├── models │ ├── data # estruturas dos dados │ ├── services # manipulação de dados e regras de negócio @@ -42,8 +44,6 @@ │ ├── scenes # cenas do jogo │ └── ui # elementos de interface do usuário │ - ├── helpers # classes utilitárias - │ ├── resources # arquivos de configuração estáticos do jogo │ └── tests # testes unitários e cenas específicas para testes From 7b1da1a9d8e5714833f99dd70d88cf1396d34b72 Mon Sep 17 00:00:00 2001 From: Danilo Nobre Date: Tue, 11 Mar 2025 19:59:12 -0300 Subject: [PATCH 07/13] Refactoring namespaces --- src/controllers/BattleManager.cs | 2 +- src/{models/data/Dungeon => controllers}/DungeonManager.cs | 0 .../data/Dungeon => controllers}/DungeonManager.cs.uid | 0 src/controllers/GameOverManager.cs | 2 +- src/controllers/GameplayTransitionManager.cs | 2 +- src/controllers/LobbyManager.cs | 2 +- src/controllers/MainMenuManager.cs | 2 +- src/controllers/MenuTransitionManager.cs | 2 +- src/helpers/AttributesHelper.cs | 1 + src/models/services/CharacterService.cs | 3 ++- src/models/stores/AttributesStore.cs | 4 +++- src/models/stores/CharacterStore.cs | 4 +++- src/models/stores/DiceEnergyStore.cs | 5 ++++- src/models/stores/DiceIconStore.cs | 4 +++- src/models/stores/DiceStore.cs | 6 ++++-- src/models/stores/GameLogStore.cs | 4 +++- src/renderers/components/CharacterGrid/Grid3D.cs | 1 + src/renderers/components/GameLog/GameLogComponent.cs | 1 + .../components/TurnOrderComponent/TurnOrderComponent.cs | 5 +++-- src/renderers/scenes/gameplay/Dungeon.tscn | 2 +- 20 files changed, 35 insertions(+), 17 deletions(-) rename src/{models/data/Dungeon => controllers}/DungeonManager.cs (100%) rename src/{models/data/Dungeon => controllers}/DungeonManager.cs.uid (100%) diff --git a/src/controllers/BattleManager.cs b/src/controllers/BattleManager.cs index 9b2950cc..5f6a6511 100644 --- a/src/controllers/BattleManager.cs +++ b/src/controllers/BattleManager.cs @@ -4,7 +4,7 @@ using DiceRolling.Logs; -namespace DiceRolling.Battle; +namespace DiceRolling.Controllers; public partial class BattleManager : Node3D { public override void _Ready() { diff --git a/src/models/data/Dungeon/DungeonManager.cs b/src/controllers/DungeonManager.cs similarity index 100% rename from src/models/data/Dungeon/DungeonManager.cs rename to src/controllers/DungeonManager.cs diff --git a/src/models/data/Dungeon/DungeonManager.cs.uid b/src/controllers/DungeonManager.cs.uid similarity index 100% rename from src/models/data/Dungeon/DungeonManager.cs.uid rename to src/controllers/DungeonManager.cs.uid diff --git a/src/controllers/GameOverManager.cs b/src/controllers/GameOverManager.cs index 46734316..1fe91591 100644 --- a/src/controllers/GameOverManager.cs +++ b/src/controllers/GameOverManager.cs @@ -1,6 +1,6 @@ using Godot; -namespace DiceRolling.Menus; +namespace DiceRolling.Controllers; public partial class GameOverManager : Node2D { public override void _Ready() { diff --git a/src/controllers/GameplayTransitionManager.cs b/src/controllers/GameplayTransitionManager.cs index eb781d7f..1502acf8 100644 --- a/src/controllers/GameplayTransitionManager.cs +++ b/src/controllers/GameplayTransitionManager.cs @@ -1,6 +1,6 @@ using Godot; -namespace DiceRolling.UI; +namespace DiceRolling.Controllers; public enum GameplayScenes { GameplayLobby, diff --git a/src/controllers/LobbyManager.cs b/src/controllers/LobbyManager.cs index 20ff2ca1..c178c107 100644 --- a/src/controllers/LobbyManager.cs +++ b/src/controllers/LobbyManager.cs @@ -1,6 +1,6 @@ using Godot; -namespace DiceRolling.Lobby; +namespace DiceRolling.Controllers; public partial class LobbyManager : Node2D { public override void _Ready() { diff --git a/src/controllers/MainMenuManager.cs b/src/controllers/MainMenuManager.cs index 400fccf9..56c3ce0b 100644 --- a/src/controllers/MainMenuManager.cs +++ b/src/controllers/MainMenuManager.cs @@ -1,6 +1,6 @@ using Godot; -namespace DiceRolling.Menus; +namespace DiceRolling.MenuControllers; public partial class MainMenuManager : Node2D { public override void _Ready() { diff --git a/src/controllers/MenuTransitionManager.cs b/src/controllers/MenuTransitionManager.cs index cf11f125..03b8d860 100644 --- a/src/controllers/MenuTransitionManager.cs +++ b/src/controllers/MenuTransitionManager.cs @@ -1,6 +1,6 @@ using Godot; -namespace DiceRolling.UI; +namespace DiceRolling.Controllers; public enum MenuScenes { MainMenu, diff --git a/src/helpers/AttributesHelper.cs b/src/helpers/AttributesHelper.cs index 54a428df..a395c5dd 100644 --- a/src/helpers/AttributesHelper.cs +++ b/src/helpers/AttributesHelper.cs @@ -1,5 +1,6 @@ using Godot; using DiceRolling.Attributes; +using DiceRolling.Stores; namespace DiceRolling.Helpers; diff --git a/src/models/services/CharacterService.cs b/src/models/services/CharacterService.cs index 31ca0a03..e83ec5a4 100644 --- a/src/models/services/CharacterService.cs +++ b/src/models/services/CharacterService.cs @@ -3,8 +3,9 @@ using System; using DiceRolling.Attributes; +using DiceRolling.Characters; -namespace DiceRolling.Characters; +namespace DiceRolling.Services; /// /// Fornece métodos para manipulação dos dados de personagens. diff --git a/src/models/stores/AttributesStore.cs b/src/models/stores/AttributesStore.cs index 9c1b8940..aca84501 100644 --- a/src/models/stores/AttributesStore.cs +++ b/src/models/stores/AttributesStore.cs @@ -1,6 +1,8 @@ using Godot; -namespace DiceRolling.Attributes; +using DiceRolling.Attributes; + +namespace DiceRolling.Stores; [Tool] [GlobalClass] diff --git a/src/models/stores/CharacterStore.cs b/src/models/stores/CharacterStore.cs index 4515a13b..f2253e60 100644 --- a/src/models/stores/CharacterStore.cs +++ b/src/models/stores/CharacterStore.cs @@ -1,9 +1,11 @@ using Godot; using System; using System.Linq; + using DiceRolling.Locations; +using DiceRolling.Characters; -namespace DiceRolling.Characters; +namespace DiceRolling.Stores; /// /// Armazena dados dos personagens em coleções e facilita a manipulação desses personagens. diff --git a/src/models/stores/DiceEnergyStore.cs b/src/models/stores/DiceEnergyStore.cs index 1d3a9db3..776c7026 100644 --- a/src/models/stores/DiceEnergyStore.cs +++ b/src/models/stores/DiceEnergyStore.cs @@ -1,5 +1,8 @@ using Godot; -namespace DiceRolling.Dice; + +using DiceRolling.Dice; + +namespace DiceRolling.Stores; [Tool] [GlobalClass] diff --git a/src/models/stores/DiceIconStore.cs b/src/models/stores/DiceIconStore.cs index 2a2cd72f..722478b1 100644 --- a/src/models/stores/DiceIconStore.cs +++ b/src/models/stores/DiceIconStore.cs @@ -1,6 +1,8 @@ using Godot; -namespace DiceRolling.Dice; +using DiceRolling.Dice; + +namespace DiceRolling.Stores; [Tool] [GlobalClass] diff --git a/src/models/stores/DiceStore.cs b/src/models/stores/DiceStore.cs index 5d23309b..c2e6c5b6 100644 --- a/src/models/stores/DiceStore.cs +++ b/src/models/stores/DiceStore.cs @@ -1,9 +1,11 @@ using Godot; using System; -using System.Collections.Generic; using System.Linq; +using System.Collections.Generic; + +using DiceRolling.Dice; -namespace DiceRolling.Dice; +namespace DiceRolling.Stores; [Tool] [GlobalClass] diff --git a/src/models/stores/GameLogStore.cs b/src/models/stores/GameLogStore.cs index 9492c10a..92e787f1 100644 --- a/src/models/stores/GameLogStore.cs +++ b/src/models/stores/GameLogStore.cs @@ -1,7 +1,9 @@ using Godot; using System.Collections.Generic; -namespace DiceRolling.Logs; +using DiceRolling.Logs; + +namespace DiceRolling.Stores; [Tool] [GlobalClass] diff --git a/src/renderers/components/CharacterGrid/Grid3D.cs b/src/renderers/components/CharacterGrid/Grid3D.cs index 44005f51..0edf8251 100644 --- a/src/renderers/components/CharacterGrid/Grid3D.cs +++ b/src/renderers/components/CharacterGrid/Grid3D.cs @@ -6,6 +6,7 @@ using DiceRolling.Characters; using DiceRolling.Components.Characters; +using DiceRolling.Stores; namespace DiceRolling.Components.Grids; diff --git a/src/renderers/components/GameLog/GameLogComponent.cs b/src/renderers/components/GameLog/GameLogComponent.cs index fe52b1fc..9aee5696 100644 --- a/src/renderers/components/GameLog/GameLogComponent.cs +++ b/src/renderers/components/GameLog/GameLogComponent.cs @@ -1,5 +1,6 @@ using Godot; using DiceRolling.Logs; +using DiceRolling.Stores; namespace DiceRolling.Components.UI; diff --git a/src/renderers/components/TurnOrderComponent/TurnOrderComponent.cs b/src/renderers/components/TurnOrderComponent/TurnOrderComponent.cs index eb988aeb..8684691a 100644 --- a/src/renderers/components/TurnOrderComponent/TurnOrderComponent.cs +++ b/src/renderers/components/TurnOrderComponent/TurnOrderComponent.cs @@ -5,6 +5,7 @@ using DiceRolling.Events; using DiceRolling.Characters; using DiceRolling.Attributes; +using DiceRolling.Stores; namespace DiceRolling.Components; @@ -70,8 +71,8 @@ public CharacterType[] Characters { public override void _Ready() { if (AttributeConfigResource is AttributesStore attributeConfig) { _AttributesStore = attributeConfig; - SpeedAttributeType = AttributesHelper.GetAttributeType(_AttributesStore, "Speed"); - HealthAttributeType = AttributesHelper.GetAttributeType(_AttributesStore, "Health"); + // SpeedAttributeType = AttributesHelper.GetAttributeType(_AttributesStore, "Speed"); + // HealthAttributeType = AttributesHelper.GetAttributeType(_AttributesStore, "Health"); // Update turn order if characters are already set if (_characters.Length > 0) { diff --git a/src/renderers/scenes/gameplay/Dungeon.tscn b/src/renderers/scenes/gameplay/Dungeon.tscn index 7743c880..b1ad53e0 100644 --- a/src/renderers/scenes/gameplay/Dungeon.tscn +++ b/src/renderers/scenes/gameplay/Dungeon.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=3 uid="uid://cbiewt2yq1klj"] -[ext_resource type="Script" uid="uid://245qm3j5dd5t" path="res://models/data/Dungeon/DungeonManager.cs" id="1_5cacr"] +[ext_resource type="Script" uid="uid://245qm3j5dd5t" path="res://controllers/DungeonManager.cs" id="1_5cacr"] [ext_resource type="Script" uid="uid://dpbxdw7s7l3mh" path="res://renderers/ui/SceneTransitionButton.cs" id="2_p0c6y"] [node name="Dungeon" type="Node2D"] From b6214c4c96c13383bc56ca59aac3cf974219b14a Mon Sep 17 00:00:00 2001 From: Danilo Nobre Date: Tue, 11 Mar 2025 20:06:41 -0300 Subject: [PATCH 08/13] OPS --- src/controllers/BattleManager.cs | 1 + src/models/data/Dice/DiceFactory.cs | 1 + src/models/data/Grid/GridType.cs | 1 + src/renderers/ui/SceneTransitionButton.cs | 1 + src/tests/CharacterTypeTests.cs | 1 + 5 files changed, 5 insertions(+) diff --git a/src/controllers/BattleManager.cs b/src/controllers/BattleManager.cs index 5f6a6511..735893b2 100644 --- a/src/controllers/BattleManager.cs +++ b/src/controllers/BattleManager.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using DiceRolling.Logs; +using DiceRolling.Stores; namespace DiceRolling.Controllers; diff --git a/src/models/data/Dice/DiceFactory.cs b/src/models/data/Dice/DiceFactory.cs index e5fff634..e27ad55c 100644 --- a/src/models/data/Dice/DiceFactory.cs +++ b/src/models/data/Dice/DiceFactory.cs @@ -1,4 +1,5 @@ using System; +using DiceRolling.Stores; namespace DiceRolling.Dice; public static class DiceFactory { diff --git a/src/models/data/Grid/GridType.cs b/src/models/data/Grid/GridType.cs index 037b5030..deb86c4e 100644 --- a/src/models/data/Grid/GridType.cs +++ b/src/models/data/Grid/GridType.cs @@ -2,6 +2,7 @@ using DiceRolling.Services; using System; using DiceRolling.Characters; +using DiceRolling.Stores; namespace DiceRolling.Grids; diff --git a/src/renderers/ui/SceneTransitionButton.cs b/src/renderers/ui/SceneTransitionButton.cs index 8c529537..47c1bbf0 100644 --- a/src/renderers/ui/SceneTransitionButton.cs +++ b/src/renderers/ui/SceneTransitionButton.cs @@ -1,3 +1,4 @@ +using DiceRolling.Controllers; using Godot; namespace DiceRolling.UI; diff --git a/src/tests/CharacterTypeTests.cs b/src/tests/CharacterTypeTests.cs index 850cc6ad..54fb0e3b 100644 --- a/src/tests/CharacterTypeTests.cs +++ b/src/tests/CharacterTypeTests.cs @@ -6,6 +6,7 @@ using DiceRolling.Attributes; using DiceRolling.Helpers; using DiceRolling.Actions; +using DiceRolling.Stores; namespace DiceRolling.Tests.Characters; From 609e3645276d4cefa4ef3684cdc65b18cf06764b Mon Sep 17 00:00:00 2001 From: Danilo Nobre Date: Tue, 11 Mar 2025 23:02:49 -0300 Subject: [PATCH 09/13] Refactor EventBus singleton implementation for improved instance management --- src/events/EventBus.cs | 26 +++++++++++++++---- src/project.godot | 2 +- .../CharacterEntity/CharacterEntity.tscn | 7 +++-- 3 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/events/EventBus.cs b/src/events/EventBus.cs index efb88ff4..82d39914 100644 --- a/src/events/EventBus.cs +++ b/src/events/EventBus.cs @@ -6,26 +6,42 @@ namespace DiceRolling.Events; [Tool] public partial class EventBus : Node { + private static EventBus? _instance; + [Signal] public delegate void ComponentSelectedEventHandler(Node component); [Signal] public delegate void ComponentUnselectedEventHandler(Node component); - private static EventBus? _instance; - public static EventBus Instance { get { - _instance ??= new EventBus(); + if (_instance == null) { + // Tenta obter do Autoload primeiro (quando em cena) + if (Engine.GetMainLoop() is SceneTree tree) { + _instance = tree.Root.GetNodeOrNull("/root/EventBus"); + } + + // Se não encontrar na árvore, cria uma nova instância + _instance ??= new EventBus(); + } return _instance; } } public override void _Ready() { - _instance = this; + // Limpa a instância estática se for diferente desta + if (_instance != null && _instance != this) { + _instance = this; + } + else { + _instance = this; + } } public void OnComponentSelected(Node component) { EmitSignal(nameof(ComponentSelected), component); - if (component is SelectableComponent selectableComponent && selectableComponent.GetParent() is Entity3D parentEntity && parentEntity.Data is { } data) { + if (component is SelectableComponent selectableComponent && + selectableComponent.GetParent() is Entity3D parentEntity && + parentEntity.Data is { } data) { GD.Print("Selected Data ID:", data.Id); } } diff --git a/src/project.godot b/src/project.godot index a81e46fa..319492f1 100644 --- a/src/project.godot +++ b/src/project.godot @@ -47,7 +47,7 @@ version_control/autoload_on_startup=true [editor_plugins] -enabled=PackedStringArray("res://addons/@spacewiz/Arc3DEditorPlugin/plugin.cfg", "res://addons/@spacewiz/TargetBoardEditorPlugin/plugin.cfg", "res://addons/SignalVisualizer/plugin.cfg", "res://addons/gdUnit4/plugin.cfg", "res://addons/imrp/plugin.cfg", "res://addons/shaker/plugin.cfg") +enabled=PackedStringArray("res://addons/@spacewiz/Arc3DEditorPlugin/plugin.cfg", "res://addons/@spacewiz/TargetBoardEditorPlugin/plugin.cfg", "res://addons/gdUnit4/plugin.cfg", "res://addons/imrp/plugin.cfg", "res://addons/shaker/plugin.cfg") [file_customization] diff --git a/src/renderers/entities/CharacterEntity/CharacterEntity.tscn b/src/renderers/entities/CharacterEntity/CharacterEntity.tscn index a72acff9..20be325c 100644 --- a/src/renderers/entities/CharacterEntity/CharacterEntity.tscn +++ b/src/renderers/entities/CharacterEntity/CharacterEntity.tscn @@ -26,7 +26,7 @@ shaded = true texture_filter = 0 sprite_frames = ExtResource("3_lytje") animation = &"idle" -frame_progress = 0.403001 +frame_progress = 0.982385 script = ExtResource("3_q1qiw") metadata/_custom_type_script = "uid://cejuccgxo60qs" @@ -40,11 +40,13 @@ metadata/_custom_type_script = "uid://bs8ip2rdvho4s" [node name="Selector" type="Sprite3D" parent="SelectableComponent"] transform = Transform3D(0.5, 0, 0, 0, 0.5, 0, 0, 0, 0.5, 0, 0.75, 0) +visible = false pixel_size = 0.002 billboard = 1 texture = ExtResource("6_56jxl") [node name="Hover" type="Sprite3D" parent="SelectableComponent"] +visible = false pixel_size = 0.002 billboard = 1 texture = ExtResource("7_5h2tr") @@ -53,6 +55,3 @@ texture = ExtResource("7_5h2tr") [node name="CollisionShape3D" type="CollisionShape3D" parent="SelectableComponent/Area3D"] shape = SubResource("CapsuleShape3D_x22vy") - -[node name="Camera3D" type="Camera3D" parent="."] -transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 2) From bd3cfa1434a5dea834b35a621f83e301a326d93c Mon Sep 17 00:00:00 2001 From: Danilo Nobre Date: Tue, 11 Mar 2025 23:14:27 -0300 Subject: [PATCH 10/13] =?UTF-8?q?corre=C3=A7=C3=A3o?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/events/EventBus.cs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/events/EventBus.cs b/src/events/EventBus.cs index 82d39914..3bef1176 100644 --- a/src/events/EventBus.cs +++ b/src/events/EventBus.cs @@ -27,13 +27,7 @@ public static EventBus Instance { } public override void _Ready() { - // Limpa a instância estática se for diferente desta - if (_instance != null && _instance != this) { - _instance = this; - } - else { - _instance = this; - } + _instance = this; } public void OnComponentSelected(Node component) { From e425295be759e3efcd696d3751dc21a4c4528b1c Mon Sep 17 00:00:00 2001 From: Danilo Nobre Date: Thu, 13 Mar 2025 23:12:40 -0300 Subject: [PATCH 11/13] Feature/6.4.b refactoring grids (#180) * Add new grid and cell components, update entity structure, and clean up unused files * Add 'Pickable' to developer terms for spell checking * Add grid cell assignment functionality and refactor grid components * improving grid and character entity components for structure and functionality * Refactor CharacterService methods to static and update usage in CharacterType --- .cspell/developer-terms.txt | 1 + .../BoardMatrixEditor.cs | 16 +- src/events/EventBus.cs | 7 +- src/models/data/Character/CharacterType.cs | 12 +- src/models/data/Grid/GridType.cs | 42 ++-- src/models/data/Grid/IGrid.cs | 7 +- src/models/data/Grid/IGridCells.cs | 30 +-- src/models/data/Grid/IGridConfiguration.cs | 15 -- src/models/data/GridCell/GridCellType.cs | 25 +++ src/models/data/GridCell/GridCellType.cs.uid | 1 + src/models/services/CharacterService.cs | 12 +- src/models/services/GridService.cs | 130 +++++++++-- .../components/CharacterGrid/Arrow.tscn | 9 - .../components/CharacterGrid/CharacterGrid.cs | 204 ------------------ .../CharacterGrid/CharacterGrid.cs.uid | 1 - .../CharacterGrid/CharacterGrid.tscn | 31 --- .../components/CharacterGrid/Grid3D.cs | 179 --------------- .../components/CharacterGrid/Grid3D.cs.uid | 1 - .../components/CharacterGrid/GridCell3D.cs | 33 --- .../CharacterGrid/GridCell3D.cs.uid | 1 - .../components/CharacterGridCellComponent.cs | 142 ++++++++++++ .../CharacterGridCellComponent.cs.uid | 1 + src/renderers/components/GridCellComponent.cs | 131 +++++++++++ .../components/GridCellComponent.cs.uid | 1 + .../components/GridCellRenderer.cs.uid | 1 + .../GridCellsContainerComponent.cs.uid | 1 + src/renderers/components/GridComponent.cs.uid | 1 + .../components/GridContainerComponent.cs | 67 ++++++ .../components/GridContainerComponent.cs.uid | 1 + src/renderers/components/GridRenderer.cs.uid | 1 + .../components/GridRendererComponent.cs.uid | 1 + .../components/GridSelectableComponent.cs.uid | 1 + .../CharacterEntity/CharacterEntity.cs | 1 + .../CharacterEntity/CharacterEntity.tscn | 7 +- src/renderers/entities/Entity3D.cs | 21 +- .../entities/GridCellEntity/GridCellEntity.cs | 18 ++ .../GridCellEntity/GridCellEntity.cs.uid | 1 + .../GridCellEntity/GridCellEntity.tscn | 51 +++++ .../entities/GridEntity/GridEntity.cs | 26 +++ .../entities/GridEntity/GridEntity.cs.uid | 1 + .../entities/GridEntity/GridEntity.tscn | 100 +++++++++ src/resources/Actions/ArcaneStrike.tres | 166 +++++++++++++- 42 files changed, 919 insertions(+), 579 deletions(-) create mode 100644 src/models/data/GridCell/GridCellType.cs create mode 100644 src/models/data/GridCell/GridCellType.cs.uid delete mode 100644 src/renderers/components/CharacterGrid/Arrow.tscn delete mode 100644 src/renderers/components/CharacterGrid/CharacterGrid.cs delete mode 100644 src/renderers/components/CharacterGrid/CharacterGrid.cs.uid delete mode 100644 src/renderers/components/CharacterGrid/CharacterGrid.tscn delete mode 100644 src/renderers/components/CharacterGrid/Grid3D.cs delete mode 100644 src/renderers/components/CharacterGrid/Grid3D.cs.uid delete mode 100644 src/renderers/components/CharacterGrid/GridCell3D.cs delete mode 100644 src/renderers/components/CharacterGrid/GridCell3D.cs.uid create mode 100644 src/renderers/components/CharacterGridCellComponent.cs create mode 100644 src/renderers/components/CharacterGridCellComponent.cs.uid create mode 100644 src/renderers/components/GridCellComponent.cs create mode 100644 src/renderers/components/GridCellComponent.cs.uid create mode 100644 src/renderers/components/GridCellRenderer.cs.uid create mode 100644 src/renderers/components/GridCellsContainerComponent.cs.uid create mode 100644 src/renderers/components/GridComponent.cs.uid create mode 100644 src/renderers/components/GridContainerComponent.cs create mode 100644 src/renderers/components/GridContainerComponent.cs.uid create mode 100644 src/renderers/components/GridRenderer.cs.uid create mode 100644 src/renderers/components/GridRendererComponent.cs.uid create mode 100644 src/renderers/components/GridSelectableComponent.cs.uid create mode 100644 src/renderers/entities/GridCellEntity/GridCellEntity.cs create mode 100644 src/renderers/entities/GridCellEntity/GridCellEntity.cs.uid create mode 100644 src/renderers/entities/GridCellEntity/GridCellEntity.tscn create mode 100644 src/renderers/entities/GridEntity/GridEntity.cs create mode 100644 src/renderers/entities/GridEntity/GridEntity.cs.uid create mode 100644 src/renderers/entities/GridEntity/GridEntity.tscn diff --git a/.cspell/developer-terms.txt b/.cspell/developer-terms.txt index 8e516a55..c0775c2c 100644 --- a/.cspell/developer-terms.txt +++ b/.cspell/developer-terms.txt @@ -29,6 +29,7 @@ Newtonsoft nunit panzoom paramref +Pickable premult pwsh Qube diff --git a/src/addons/@spacewiz/TargetBoardEditorPlugin/BoardMatrixEditor.cs b/src/addons/@spacewiz/TargetBoardEditorPlugin/BoardMatrixEditor.cs index e112689a..406f0a45 100644 --- a/src/addons/@spacewiz/TargetBoardEditorPlugin/BoardMatrixEditor.cs +++ b/src/addons/@spacewiz/TargetBoardEditorPlugin/BoardMatrixEditor.cs @@ -55,7 +55,7 @@ public void ClearGridInputs() { foreach (var grid in _grids) { for (int y = 0; y < grid.Rows; y++) { for (int x = 0; x < grid.Columns; x++) { - grid.SetCell(y, x, 0); + grid.SetCellValue(y, x, 0); } } } @@ -97,7 +97,11 @@ private void DrawGrid(GridType grid, float offsetX) { for (int x = 0; x < grid.Columns; x++) { int drawX = isFlippedHorizontally ? grid.Columns - 1 - x : x; var rect = new Rect2(drawX * CellSize + Padding + offsetX, y * CellSize + Padding + offsetY, CellSize, CellSize); - int value = grid.GetCell(y, x); + + // Get GridCellType and extract its value + var cellData = grid.GetCell(y, x); + int value = cellData?.Value ?? 0; + Color bgColor = ColorsArray[Mathf.Clamp(value, 0, ColorsArray.Length - 1)]; DrawRect(rect, bgColor); DrawRect(rect, Colors.Black, false); @@ -130,13 +134,15 @@ private bool HandleMouseInput(InputEventMouseButton mouseEvent, GridType grid, f } if (x >= 0 && x < grid.Columns && y >= 0 && y < grid.Rows) { - int value = grid.GetCell(y, x); + // Get GridCellType and extract its value + var cellData = grid.GetCell(y, x); + int value = cellData?.Value ?? 0; if (mouseEvent.ButtonIndex == MouseButton.Left) { - grid.SetCell(y, x, (value + 1) % ColorsArray.Length); + grid.SetCellValue(y, x, (value + 1) % ColorsArray.Length); } else if (mouseEvent.ButtonIndex == MouseButton.Right) { - grid.SetCell(y, x, (value - 1 + ColorsArray.Length) % ColorsArray.Length); + grid.SetCellValue(y, x, (value - 1 + ColorsArray.Length) % ColorsArray.Length); } QueueRedraw(); return true; diff --git a/src/events/EventBus.cs b/src/events/EventBus.cs index 3bef1176..e4ea99bb 100644 --- a/src/events/EventBus.cs +++ b/src/events/EventBus.cs @@ -27,7 +27,12 @@ public static EventBus Instance { } public override void _Ready() { - _instance = this; + if (_instance == null || _instance != this) { + _instance = this; + } + else if (_instance != this) { + GD.PushWarning("Múltiplas instâncias de EventBus detectadas. Considere usar apenas o EventBus do Autoload."); + } } public void OnComponentSelected(Node component) { diff --git a/src/models/data/Character/CharacterType.cs b/src/models/data/Character/CharacterType.cs index e3bac3c7..ea29a952 100644 --- a/src/models/data/Character/CharacterType.cs +++ b/src/models/data/Character/CharacterType.cs @@ -130,7 +130,7 @@ public void InitializeActions() { public int GetAttributeCurrentValue(AttributeType type) { if (!_attributeCurrentValueCache.TryGetValue(type, out var value)) { - value = CharacterService.Instance.GetAttributeCurrentValue(this, type); + value = CharacterService.GetAttributeCurrentValue(this, type); _attributeCurrentValueCache[type] = value; } return value; @@ -138,7 +138,7 @@ public int GetAttributeCurrentValue(AttributeType type) { public int GetAttributeMaxValue(AttributeType type) { if (!_attributeMaxValueCache.TryGetValue(type, out var value)) { - value = CharacterService.Instance.GetAttributeMaxValue(this, type); + value = CharacterService.GetAttributeMaxValue(this, type); _attributeMaxValueCache[type] = value; } return value; @@ -146,23 +146,23 @@ public int GetAttributeMaxValue(AttributeType type) { public int GetAttributeBaseValue(AttributeType type) { if (!_attributeBaseValueCache.TryGetValue(type, out var value)) { - value = CharacterService.Instance.GetAttributeBaseValue(this, type); + value = CharacterService.GetAttributeBaseValue(this, type); _attributeBaseValueCache[type] = value; } return value; } public void UpdateAttributeCurrentValue(AttributeType type, int newValue) { - CharacterService.Instance.UpdateAttributeCurrentValue(this, type, newValue); + CharacterService.UpdateAttributeCurrentValue(this, type, newValue); _attributeCurrentValueCache[type] = newValue; } public void AddAction(CharacterAction action) { - CharacterService.Instance.AddAction(this, action); + CharacterService.AddAction(this, action); } public void RemoveAction(CharacterAction action) { - CharacterService.Instance.RemoveAction(this, action); + CharacterService.RemoveAction(this, action); } public void ValidateConstructor() { diff --git a/src/models/data/Grid/GridType.cs b/src/models/data/Grid/GridType.cs index deb86c4e..215f6a3e 100644 --- a/src/models/data/Grid/GridType.cs +++ b/src/models/data/Grid/GridType.cs @@ -1,17 +1,19 @@ using Godot; -using DiceRolling.Services; using System; -using DiceRolling.Characters; + +using DiceRolling.Id; using DiceRolling.Stores; +using DiceRolling.Services; namespace DiceRolling.Grids; [Tool] [GlobalClass] -public partial class GridType : Resource, IGrid { +public partial class GridType : IdentifiableResource, IGrid { [Signal] public delegate void GridChangedEventHandler(); private int _rows = 1; private int _columns = 1; + private CharacterStore? _characterStore; [Export] public string Prefix { get; set; } = "G"; @@ -20,7 +22,15 @@ public partial class GridType : Resource, IGrid { public int Offset { get; set; } = 0; [Export] - public CharacterStore? CharacterStore { get; set; } + public CharacterStore? CharacterStore { + get => _characterStore; + set { + _characterStore = value; + if (_characterStore != null && Engine.IsEditorHint()) { + AssignCharacters(); + } + } + } [Export(PropertyHint.Enum, "LeftToRight,RightToLeft")] public GridDirection Direction { get; set; } = GridDirection.LeftToRight; @@ -46,7 +56,7 @@ public int Columns { } [Export] - public Godot.Collections.Array Cells { get; set; } = new(); + public Godot.Collections.Array? Cells { get; set; } = []; public GridType() { ResizeCells(); @@ -66,7 +76,10 @@ private void ResizeCells() { GD.PrintErr("Invalid grid size: Rows and Columns must be greater than 0."); return; } - GridService.ResizeCells(Cells, _rows, _columns); + + Cells ??= []; + + GridService.ResizeGridCells(Cells, _rows, _columns, Prefix); EmitSignal(nameof(GridChanged)); } @@ -74,19 +87,24 @@ public int GetCellIndex(int row, int column) { return GridService.GetCellIndex(row, column, _columns); } - public int GetCell(int row, int column) { - return GridService.GetCell(Cells, row, column, _columns); + public GridCellType? GetCell(int row, int column) { + return GridService.GetGridCell(Cells, row, column, _columns); } - public void SetCell(int row, int column, int value) { - if (row < 0 || row >= _rows || column < 0 || column >= _columns) { - GD.PrintErr("Invalid cell position."); + public void SetCellValue(int row, int column, int value) { + if (Cells == null) { + GD.PrintErr("Cells collection is null."); return; } - GridService.SetCell(Cells, row, column, value, _columns); + + GridService.SetGridCellValue(Cells, row, column, value, _columns); EmitSignal(nameof(GridChanged)); } + public void AssignCharacters() { + GridService.AssignCharactersToGrid(this); + } + public void ValidateConstructor() { if (Rows <= 0) { throw new ArgumentException("O número de Rows não pode ser 0 ou menor.", nameof(_rows)); diff --git a/src/models/data/Grid/IGrid.cs b/src/models/data/Grid/IGrid.cs index 6b1fedf7..d0196b79 100644 --- a/src/models/data/Grid/IGrid.cs +++ b/src/models/data/Grid/IGrid.cs @@ -1,10 +1,13 @@ +using DiceRolling.Id; + namespace DiceRolling.Grids; /// /// Interface que define uma grid completa no jogo. /// public interface IGrid : - IGridConfiguration, - IGridCells { + IIdentifiable, + IGridCells, + IGridConfiguration { void ValidateConstructor(); } \ No newline at end of file diff --git a/src/models/data/Grid/IGridCells.cs b/src/models/data/Grid/IGridCells.cs index 82faaa39..9ba608fe 100644 --- a/src/models/data/Grid/IGridCells.cs +++ b/src/models/data/Grid/IGridCells.cs @@ -1,5 +1,3 @@ -using Godot; - using Godot.Collections; namespace DiceRolling.Grids; @@ -8,32 +6,10 @@ namespace DiceRolling.Grids; /// Interface que define as células de uma grid. /// public interface IGridCells { - /// - /// Células da grid. - /// - Array Cells { get; } - - /// - /// Obtém o índice de uma célula. - /// - /// Linha da célula. - /// Coluna da célula. - /// Índice da célula. + Godot.Collections.Array? Cells { get; } int GetCellIndex(int row, int column); - /// - /// Obtém o valor de uma célula. - /// - /// Linha da célula. - /// Coluna da célula. - /// Valor da célula. - int GetCell(int row, int column); + GridCellType? GetCell(int row, int column); - /// - /// Define o valor de uma célula. - /// - /// Linha da célula. - /// Coluna da célula. - /// Valor da célula. - void SetCell(int row, int column, int value); + void SetCellValue(int row, int column, int value); } \ No newline at end of file diff --git a/src/models/data/Grid/IGridConfiguration.cs b/src/models/data/Grid/IGridConfiguration.cs index f47ac5be..937fac13 100644 --- a/src/models/data/Grid/IGridConfiguration.cs +++ b/src/models/data/Grid/IGridConfiguration.cs @@ -4,28 +4,13 @@ namespace DiceRolling.Grids; /// Interface que define a configuração de uma grid. /// public interface IGridConfiguration { - /// - /// Número de linhas da grid. - /// int Rows { get; } - /// - /// Número de colunas da grid. - /// int Columns { get; } - /// - /// Prefixo da grid. - /// string Prefix { get; } - /// - /// Offset da grid. - /// int Offset { get; } - /// - /// Direção da grid. - /// GridDirection Direction { get; } } \ No newline at end of file diff --git a/src/models/data/GridCell/GridCellType.cs b/src/models/data/GridCell/GridCellType.cs new file mode 100644 index 00000000..adfa03f5 --- /dev/null +++ b/src/models/data/GridCell/GridCellType.cs @@ -0,0 +1,25 @@ +using Godot; +using DiceRolling.Id; +using DiceRolling.Characters; + +namespace DiceRolling.Grids; + +[Tool] +[GlobalClass] +public partial class GridCellType : IdentifiableResource { + [Export] public CharacterType? Character { get; set; } + [Export] public int Value { get; set; } + [Export] public int Row { get; set; } + [Export] public int Column { get; set; } + [Export] public int Index { get; set; } + [Export] public string Label { get; set; } = string.Empty; + [Export] public bool IsWalkable { get; set; } = true; + [Export] public bool IsOccupied { get; set; } + [Signal] public delegate void CellChangedEventHandler(); + + public void NotifyChanged() { + EmitSignal(SignalName.CellChanged); + + EmitChanged(); + } +} \ No newline at end of file diff --git a/src/models/data/GridCell/GridCellType.cs.uid b/src/models/data/GridCell/GridCellType.cs.uid new file mode 100644 index 00000000..8257ff07 --- /dev/null +++ b/src/models/data/GridCell/GridCellType.cs.uid @@ -0,0 +1 @@ +uid://bnrom8367617i diff --git a/src/models/services/CharacterService.cs b/src/models/services/CharacterService.cs index e83ec5a4..5e47eac0 100644 --- a/src/models/services/CharacterService.cs +++ b/src/models/services/CharacterService.cs @@ -55,22 +55,22 @@ public virtual void InitializeActions(CharacterType character) { } } - public int GetAttributeCurrentValue(CharacterType character, AttributeType type) { + public static int GetAttributeCurrentValue(CharacterType character, AttributeType type) { var attribute = character.Attributes.FirstOrDefault(attr => attr.Type == type); return attribute is not null ? attribute.CurrentValue : 0; } - public int GetAttributeMaxValue(CharacterType character, AttributeType type) { + public static int GetAttributeMaxValue(CharacterType character, AttributeType type) { var attribute = character.Attributes.FirstOrDefault(attr => attr.Type == type); return attribute is not null ? attribute.MaxValue : 0; } - public int GetAttributeBaseValue(CharacterType character, AttributeType type) { + public static int GetAttributeBaseValue(CharacterType character, AttributeType type) { var attribute = character.Attributes.FirstOrDefault(attr => attr.Type == type); return attribute is not null ? attribute.BaseValue : 0; } - public void UpdateAttributeCurrentValue(CharacterType character, AttributeType type, int newValue) { + public static void UpdateAttributeCurrentValue(CharacterType character, AttributeType type, int newValue) { var attribute = character.Attributes.FirstOrDefault(attr => attr.Type == type); if (attribute is not null) { attribute.CurrentValue = newValue; @@ -78,12 +78,12 @@ public void UpdateAttributeCurrentValue(CharacterType character, AttributeType t } } - public void AddAction(CharacterType character, CharacterAction action) { + public static void AddAction(CharacterType character, CharacterAction action) { ArgumentNullException.ThrowIfNull(action); character.Actions.Add(action); } - public void RemoveAction(CharacterType character, CharacterAction action) { + public static void RemoveAction(CharacterType character, CharacterAction action) { ArgumentNullException.ThrowIfNull(action); character.Actions.Remove(action); } diff --git a/src/models/services/GridService.cs b/src/models/services/GridService.cs index 79b1422b..03bfd417 100644 --- a/src/models/services/GridService.cs +++ b/src/models/services/GridService.cs @@ -1,5 +1,7 @@ using System; using Godot; +using Godot.Collections; +using DiceRolling.Grids; namespace DiceRolling.Services; @@ -9,33 +11,119 @@ public class GridService { private GridService() { } - public static void ResizeCells(Godot.Collections.Array cells, int rows, int columns) { - // ArgumentNullException.ThrowIfNull(cells); - // if (rows <= 0) - // throw new ArgumentException("O número de Rows não pode ser 0 ou menor.", nameof(rows)); - // if (columns <= 0) - // throw new ArgumentException("O número de Columns não pode ser 0 ou menor.", nameof(columns)); - cells.Resize(rows * columns); - } - public static int GetCellIndex(int row, int column, int columns) { - // if (row <= 0) { - // throw new ArgumentException("O número de Rows não pode ser 0 ou menor.", nameof(row)); - // } - // if (column <= 0) { - // throw new ArgumentException("O número de Columns não pode ser 0 ou menor.", nameof(column)); - // } return row * columns + column; } - public static int GetCell(Godot.Collections.Array cells, int row, int column, int columns) { - GD.Print($"Getting cell at Row: {row}, Column: {column}"); - ArgumentNullException.ThrowIfNull(cells); - return cells[GetCellIndex(row, column, columns)]; + public static GridCellType CreateCellType(int value, int row, int column, int columns, string prefix = "") { + int index = GetCellIndex(row, column, columns); + return new GridCellType { + Value = value, + Row = row, + Column = column, + Index = index, + Label = string.IsNullOrEmpty(prefix) ? $"({row},{column})" : $"{prefix}{index}" + }; } - public static void SetCell(Godot.Collections.Array cells, int row, int column, int value, int columns) { + public static void ResizeGridCells(Godot.Collections.Array? cells, int rows, int columns, string prefix = "") { ArgumentNullException.ThrowIfNull(cells); - cells[GetCellIndex(row, column, columns)] = value; + + int requiredSize = rows * columns; + int currentSize = cells.Count; + + if (requiredSize > currentSize) { + // Add new cells + for (int i = currentSize; i < requiredSize; i++) { + int row = i / columns; + int col = i % columns; + cells.Add(CreateCellType(0, row, col, columns, prefix)); + } + } + else if (requiredSize < currentSize) { + // Remove excess cells + cells.Resize(requiredSize); + } + + // Update existing cells' positions + for (int i = 0; i < requiredSize; i++) { + var cell = cells[i]; + if (cell != null) { + int row = i / columns; + int col = i % columns; + cell.Row = row; + cell.Column = col; + cell.Index = i; + cell.Label = $"{prefix}{i}"; + } + } + } + + public static GridCellType? GetGridCell(Godot.Collections.Array? cells, int row, int column, int columns) { + if (cells == null) return null; + + int index = GetCellIndex(row, column, columns); + return (index >= 0 && index < cells.Count) ? cells[index] : null; + } + + public static void SetGridCellValue(Godot.Collections.Array? cells, int row, int column, int value, int columns) { + if (cells == null) return; + + if (row < 0 || column < 0 || row >= (cells.Count / columns) || column >= columns) { + GD.PrintErr("Invalid cell position"); + return; + } + + int index = GetCellIndex(row, column, columns); + if (index >= 0 && index < cells.Count) { + var cell = cells[index]; + if (cell != null) { + cell.Value = value; + cell.NotifyChanged(); + } + } + } + + public static void AssignCharactersToGrid(GridType grid) { + if (grid.CharacterStore == null) { + GD.PrintErr("Cannot assign characters: CharacterStore is null"); + return; + } + + if (grid.Cells == null) { + GD.PrintErr("Cannot assign characters: Grid Cells collection is null"); + return; + } + + // Clear all character references first + foreach (var cell in grid.Cells) { + if (cell != null) { + cell.Character = null; + cell.IsOccupied = false; + } + } + + // Get all characters from the store + foreach (var character in grid.CharacterStore.Characters) { + // Check if character is in the right location for this grid + // Assuming each grid has a LocationType property to check against + if (character.Location != null && character.SlotIndex >= 0) { + // Map the slot index to a cell in the grid + int row = character.SlotIndex / grid.Columns; + int column = character.SlotIndex % grid.Columns; + + // Check if the cell position is valid + if (row < grid.Rows && column < grid.Columns) { + var cell = grid.GetCell(row, column); + if (cell != null) { + cell.Character = character; + cell.IsOccupied = true; + cell.NotifyChanged(); + } + } + } + } + + grid.EmitSignal(nameof(grid.GridChanged)); } } \ No newline at end of file diff --git a/src/renderers/components/CharacterGrid/Arrow.tscn b/src/renderers/components/CharacterGrid/Arrow.tscn deleted file mode 100644 index aa11d645..00000000 --- a/src/renderers/components/CharacterGrid/Arrow.tscn +++ /dev/null @@ -1,9 +0,0 @@ -[gd_scene load_steps=2 format=3 uid="uid://bltesg17i4ul8"] - -[sub_resource type="PrismMesh" id="PrismMesh_54lxy"] - -[node name="Arrow" type="Node3D"] - -[node name="MeshInstance3D" type="MeshInstance3D" parent="."] -transform = Transform3D(-2.18557e-08, 0.5, 0, -0.5, -2.18557e-08, 0, 0, 0, 0.1, 0, 0, 0) -mesh = SubResource("PrismMesh_54lxy") diff --git a/src/renderers/components/CharacterGrid/CharacterGrid.cs b/src/renderers/components/CharacterGrid/CharacterGrid.cs deleted file mode 100644 index 15fdfaba..00000000 --- a/src/renderers/components/CharacterGrid/CharacterGrid.cs +++ /dev/null @@ -1,204 +0,0 @@ -using Godot; -using System.Collections.Generic; - -using DiceRolling.Events; -using DiceRolling.Grids; -using DiceRolling.Targets; - -namespace DiceRolling.Components.Grids; - -/// -/// Represents a 3D grid of characters in the game. -/// -[Tool] -public partial class CharacterGrid : Node3D { - [Export] public GridType[] GridConfigurations = []; - [Export] public PackedScene? CharacterComponentScene { get; set; } - [Export] public PackedScene? ArrowMesh { get; set; } - - private readonly Dictionary _connections = []; - private readonly Dictionary _initialPositions = []; - [Export] public float CellPadding { get; set; } = 0.1f; - - [ExportToolButton("Generate Grid")] - private Callable GenerateGridButton => Callable.From(GenerateGrids); - - public override void _Ready() { - base._Ready(); - GenerateGrids(); - // EventBus.Instance.Connect(nameof(EventBus.ActionSelected), new Callable(this, nameof(OnActionSelected))); - } - - public override void _ExitTree() { - base._ExitTree(); - DisconnectGridConfigurations(); - } - - /// - /// Generates the grids based on the configurations. - /// - private void GenerateGrids() { - if (GridConfigurations is null || GridConfigurations.Length == 0) { - GD.PrintErr("GridConfigurations is null or empty"); - return; - } - - ClearExistingGrids(); - CreateNewGrids(); - } - - /// - /// Clears existing grids from the scene. - /// - private void ClearExistingGrids() { - foreach (var child in GetChildren()) { - if (child is Grid3D grid) { - CallDeferred("remove_child", grid); - grid.QueueFree(); - } - } - } - - /// - /// Creates new grids based on the configurations. - /// - private void CreateNewGrids() { - float currentXPosition = 0; - - foreach (var config in GridConfigurations) { - if (IsValidGridConfiguration(config)) { - var grid = CreateGrid(config, ref currentXPosition); - CallDeferred("add_child", grid); - _initialPositions[grid] = currentXPosition; - } - else { - GD.PrintErr($"Invalid grid configuration: {config}"); - } - } - } - - /// - /// Validates the grid configuration. - /// - /// The grid configuration to validate. - /// True if the configuration is valid, otherwise false. - private static bool IsValidGridConfiguration(GridType config) { - return config is not null && config.Rows > 0 && config.Columns > 0; - } - - /// - /// Creates a new grid based on the configuration. - /// - /// The grid configuration. - /// The current X position for the grid. - /// The created grid. - private Grid3D CreateGrid(GridType config, ref float currentXPosition) { - var grid = new Grid3D { - Rows = config.Rows, - Columns = config.Columns, - Prefix = config.Prefix, - CharacterStore = config.CharacterStore, - CharacterComponentScene = CharacterComponentScene, - CellPadding = CellPadding - }; - - - float centerZPosition = -config.Rows / 2.0f; - - // Add arrow to indicate direction - if (ArrowMesh != null) { - var arrowMeshInstance = ArrowMesh.Instantiate(); - arrowMeshInstance.Transform = new Transform3D(Basis.Identity, new Vector3(currentXPosition, 2, centerZPosition)); - - // Rotate arrow based on direction - if (config.Direction == GridDirection.RightToLeft) { - arrowMeshInstance.RotateY(Mathf.Pi); - } - - grid.AddChild(arrowMeshInstance); - } - - currentXPosition += config.Offset; - grid.Transform = new Transform3D(Basis.Identity, new Vector3(currentXPosition, 0, centerZPosition)); - grid.GenerateGridCells(); - currentXPosition += config.Columns; - return grid; - } - - /// - /// Disconnects the grid configurations. - /// - private void DisconnectGridConfigurations() { - foreach (var config in GridConfigurations) { - if (_connections.TryGetValue(config, out var callable)) { - config.Disconnect("changed", callable); - } - } - _connections.Clear(); - } - - private void OnActionSelected(TargetBoardType targetBoard) { - UpdateCellColors(targetBoard); - } - - private static Color GetCellColor(int value) { - return value switch { - 0 => new Color(Colors.White), // Ignored (white) - 1 => new Color(Colors.Yellow), // Placement (yellow) - 2 => new Color(Colors.Green), // Ally (green) - 3 => new Color(Colors.Red), // Enemy (red) - _ => new Color(Colors.DimGray) // Default (gray) - }; - } - - private void UpdateCellColors(TargetBoardType targetBoard) { - if (targetBoard == null || targetBoard.Grids.Count < 2) { - GD.PrintErr("Expected at least two grids in the target configuration."); - return; - } - - var gridConfig1 = targetBoard.Grids[0]; - var gridConfig2 = targetBoard.Grids[1]; - - var grid3DInstances = new List(); - foreach (Node child in GetChildren()) { - if (child is Grid3D grid3D) { - grid3DInstances.Add(grid3D); - } - } - - if (grid3DInstances.Count < 2) { - GD.PrintErr("Expected at least two Grid3D instances in the scene."); - return; - } - - var grid3D1 = grid3DInstances[0]; - var grid3D2 = grid3DInstances[1]; - - // GD.Print("Target Configuration for Grid 1:"); - // for (int i = 0; i < gridConfig1.Cells.Count; i++) { - // GD.Print($"Cell {i}: Value = {gridConfig1.Cells[i]}"); - // } - - // GD.Print("Applying colors to Grid 1:"); - for (int i = 0; i < gridConfig1.Cells.Count; i++) { - int value1 = gridConfig1.Cells[i]; - Color cellColor1 = GetCellColor(value1); - // GD.Print($"Grid 1 Cell {i}: Value = {value1}, Color = {cellColor1}"); - grid3D1.UpdateCellColor(i, cellColor1); - } - - // GD.Print("Target Configuration for Grid 2:"); - // for (int j = 0; j < gridConfig2.Cells.Count; j++) { - // GD.Print($"Cell {j}: Value = {gridConfig2.Cells[j]}"); - // } - - // GD.Print("Applying colors to Grid 2:"); - for (int j = 0; j < gridConfig2.Cells.Count; j++) { - int value2 = gridConfig2.Cells[j]; - Color cellColor2 = GetCellColor(value2); - // GD.Print($"Grid 2 Cell {j}: Value = {value2}, Color = {cellColor2}"); - grid3D2.UpdateCellColor(j, cellColor2); - } - } -} \ No newline at end of file diff --git a/src/renderers/components/CharacterGrid/CharacterGrid.cs.uid b/src/renderers/components/CharacterGrid/CharacterGrid.cs.uid deleted file mode 100644 index bc1a2425..00000000 --- a/src/renderers/components/CharacterGrid/CharacterGrid.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://gymkyw1r3mtn diff --git a/src/renderers/components/CharacterGrid/CharacterGrid.tscn b/src/renderers/components/CharacterGrid/CharacterGrid.tscn deleted file mode 100644 index de23b293..00000000 --- a/src/renderers/components/CharacterGrid/CharacterGrid.tscn +++ /dev/null @@ -1,31 +0,0 @@ -[gd_scene load_steps=6 format=3 uid="uid://dmw0cm136sn4p"] - -[ext_resource type="Script" uid="uid://gymkyw1r3mtn" path="res://renderers/components/CharacterGrid/CharacterGrid.cs" id="1_tabhr"] -[ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://models/data/Grid/GridType.cs" id="2_ml3sj"] -[ext_resource type="PackedScene" uid="uid://bltesg17i4ul8" path="res://renderers/components/CharacterGrid/Arrow.tscn" id="5_og5wa"] - -[sub_resource type="Resource" id="Resource_jan7r"] -script = ExtResource("2_ml3sj") -Prefix = "P" -Offset = 0 -Direction = 0 -Rows = 2 -Columns = 3 -Cells = Array[int]([0, 0, 0, 0, 0, 0]) -metadata/_custom_type_script = ExtResource("2_ml3sj") - -[sub_resource type="Resource" id="Resource_3uydg"] -script = ExtResource("2_ml3sj") -Prefix = "E" -Offset = 2 -Direction = 0 -Rows = 2 -Columns = 3 -Cells = Array[int]([0, 0, 0, 0, 0, 0]) -metadata/_custom_type_script = ExtResource("2_ml3sj") - -[node name="CharacterGrid" type="Node3D"] -script = ExtResource("1_tabhr") -GridConfigurations = [SubResource("Resource_jan7r"), SubResource("Resource_3uydg")] -ArrowMesh = ExtResource("5_og5wa") -CellPadding = 0.055 diff --git a/src/renderers/components/CharacterGrid/Grid3D.cs b/src/renderers/components/CharacterGrid/Grid3D.cs deleted file mode 100644 index 0edf8251..00000000 --- a/src/renderers/components/CharacterGrid/Grid3D.cs +++ /dev/null @@ -1,179 +0,0 @@ -using Godot; -using System; -using System.Collections.Generic; - -using DiceRolling.Grids; -using DiceRolling.Characters; - -using DiceRolling.Components.Characters; -using DiceRolling.Stores; - -namespace DiceRolling.Components.Grids; - -[Tool] -public partial class Grid3D : Node3D { - [Export] public GridType? GridInstance { get; set; } - [Export] public int Rows { get; set; } = 1; - [Export] public int Columns { get; set; } = 1; - [Export] public string Prefix { get; set; } = "G"; - [Export] public CharacterStore? CharacterStore { get; set; } - [Export] public PackedScene? CharacterComponentScene { get; set; } - [Export] public float CellPadding { get; set; } - private GridCell3D[,]? gridCells; - private readonly List cellMeshes = []; - - public override void _Ready() { - base._Ready(); - GenerateGridCells(); - RenderBattleSquadCharacters(); - } - - public void GenerateGridCells() { - ClearExistingCells(); - CreateNewCells(); - CreateCellRenderMeshes(); - } - - private void ClearExistingCells() { - if (gridCells != null) { - foreach (var cell in gridCells) { - if (cell != null) { - RemoveChild(cell); - cell.QueueFree(); - } - } - } - - gridCells = new GridCell3D[Rows, Columns]; - - foreach (var mesh in cellMeshes) { - RemoveChild(mesh); - mesh.QueueFree(); - } - - cellMeshes.Clear(); - } - - private void CreateNewCells() { - gridCells = new GridCell3D[Rows, Columns]; - // GD.Print($"Creating new cells for grid with {Rows} rows and {Columns} columns."); - ForEachCell((y, x) => { - var position = new Vector3(x, 0, y); - var labelText = $"{Prefix}{GridInstance?.GetCellIndex(y, x)}({x},{y})"; - var gridCell = new GridCell3D(position, labelText); - AddChild(gridCell); - gridCells[y, x] = gridCell; - // GD.Print($"Created cell at ({y}, {x}) with label {labelText}."); - }); - } - - private void CreateCellRenderMeshes() { - float halfPadding = CellPadding / 2.0f; - - ForEachCell((y, x) => { - var topLeft = new Vector3(x + halfPadding, 0, y + halfPadding); - var topRight = new Vector3(x + 1 - halfPadding, 0, y + halfPadding); - var bottomLeft = new Vector3(x + halfPadding, 0, y + 1 - halfPadding); - var bottomRight = new Vector3(x + 1 - halfPadding, 0, y + 1 - halfPadding); - - var surfaceTool = new SurfaceTool(); - surfaceTool.Begin(Mesh.PrimitiveType.Triangles); - - var cellColor = new Color(0.5f, 0.5f, 0.5f, 0.5f); - - // First triangle - surfaceTool.SetColor(cellColor); - surfaceTool.AddVertex(topLeft); - surfaceTool.SetColor(cellColor); - surfaceTool.AddVertex(topRight); - surfaceTool.SetColor(cellColor); - surfaceTool.AddVertex(bottomLeft); - - // Second triangle - surfaceTool.SetColor(cellColor); - surfaceTool.AddVertex(topRight); - surfaceTool.SetColor(cellColor); - surfaceTool.AddVertex(bottomRight); - surfaceTool.SetColor(cellColor); - surfaceTool.AddVertex(bottomLeft); - - var mesh = new ArrayMesh(); - surfaceTool.Commit(mesh); - - var material = new StandardMaterial3D { - AlbedoColor = cellColor - }; - - var meshInstance = new MeshInstance3D { - Mesh = mesh, - MaterialOverride = material, - Transform = new Transform3D(Basis.Identity, new Vector3(0, 0, 0)) - }; - - AddChild(meshInstance); - cellMeshes.Add(meshInstance); - }); - } - - private void RenderBattleSquadCharacters() { - if (CharacterStore is null) { - GD.PrintErr("CharacterStore is null"); - return; - } - - if (CharacterComponentScene is null) { - GD.PrintErr("CharacterComponentScene is null"); - return; - } - - if (gridCells is null) { - GD.PrintErr("gridCells is null"); - return; - } - - // foreach (var character in CharacterStore.Characters) { - // if (character.Location?.Name == "Player Squad" || character.Location?.Name == "Enemy Squad" && character.SlotIndex >= 0 && character.SlotIndex < gridCells.Length) { - // // Instantiate the CharacterComponent from the packed scene - // var characterComponent = CharacterComponentScene.Instantiate(); - // if (characterComponent is null) { - // GD.PrintErr("Failed to instantiate CharacterComponent"); - // continue; - // } - - // characterComponent.Character = character; - - // // Position the character at the center of the cell - // var gridCell = gridCells[character.SlotIndex / Columns, character.SlotIndex % Columns]; - // if (gridCell is null) { - // GD.PrintErr($"Grid cell at index {character.SlotIndex} is null"); - // continue; - // } - // var cellPosition = gridCell.CellMarker.Transform.Origin; - // var cellCenter = new Vector3(cellPosition.X + 0.5f, 0, cellPosition.Z + 0.5f); // Use exact grid positions - // characterComponent.Transform = new Transform3D(Basis.Identity, cellCenter); - // gridCell.SetCharacter(characterComponent); - // } - // } - } - - public void UpdateCellColor(int index, Color color) { - if (index < 0 || index >= cellMeshes.Count) { - GD.PrintErr($"Invalid cell index: {index}"); - return; - } - - var meshInstance = cellMeshes[index]; - var material = meshInstance.MaterialOverride as StandardMaterial3D; - if (material != null) { - material.AlbedoColor = color; - } - } - - public void ForEachCell(Action action) { - for (int y = 0; y < Rows; y++) { - for (int x = 0; x < Columns; x++) { - action(y, x); - } - } - } -} \ No newline at end of file diff --git a/src/renderers/components/CharacterGrid/Grid3D.cs.uid b/src/renderers/components/CharacterGrid/Grid3D.cs.uid deleted file mode 100644 index b511954f..00000000 --- a/src/renderers/components/CharacterGrid/Grid3D.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://buc1ew422ayst diff --git a/src/renderers/components/CharacterGrid/GridCell3D.cs b/src/renderers/components/CharacterGrid/GridCell3D.cs deleted file mode 100644 index ef77667d..00000000 --- a/src/renderers/components/CharacterGrid/GridCell3D.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Godot; -using DiceRolling.Components.Characters; - -namespace DiceRolling.Components.Grids; - -public partial class GridCell3D : Node3D { - public Marker3D CellMarker { get; private set; } - public Label3D CellLabel { get; private set; } - // public CharacterComponent? Character { get; private set; } - - // Parameterless constructor - public GridCell3D() { - CellMarker = new Marker3D(); - AddChild(CellMarker); - - CellLabel = new Label3D { - Billboard = BaseMaterial3D.BillboardModeEnum.Enabled, - }; - AddChild(CellLabel); - } - - // Constructor with parameters - public GridCell3D(Vector3 position, string labelText) : this() { - CellMarker.Transform = new Transform3D(Basis.Identity, position); - CellLabel.Text = labelText; - CellLabel.Transform = new Transform3D(Basis.Identity, new Vector3(position.X + 0.55f, 0.25f, position.Z + 1)); - } - - // public void SetCharacter(CharacterComponent character) { - // Character = character; - // AddChild(character); - // } -} \ No newline at end of file diff --git a/src/renderers/components/CharacterGrid/GridCell3D.cs.uid b/src/renderers/components/CharacterGrid/GridCell3D.cs.uid deleted file mode 100644 index a28f542a..00000000 --- a/src/renderers/components/CharacterGrid/GridCell3D.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dcfqksp2k6huo diff --git a/src/renderers/components/CharacterGridCellComponent.cs b/src/renderers/components/CharacterGridCellComponent.cs new file mode 100644 index 00000000..5ab16f85 --- /dev/null +++ b/src/renderers/components/CharacterGridCellComponent.cs @@ -0,0 +1,142 @@ +using Godot; +using DiceRolling.Entities; +using DiceRolling.Grids; +using DiceRolling.Characters; +using DiceRolling.Helpers; + +namespace DiceRolling.Components.Grids; + +[Tool] +[GlobalClass] +[Icon("res://assets/editor/component-3d.svg")] +public partial class CharacterGridCellComponent : Node3D { + private GridCellEntity? _parent; + private GridCellType? _cellData; + private CharacterEntity? _characterEntity; + + [Export] public PackedScene? CharacterEntityScene { get; set; } + [Export] public Vector3 CharacterOffset { get; set; } = new Vector3(0, 0, 0); + + public override void _Ready() { + _parent = GetParent(); + + if (_parent != null) { + // Connect to entity updates + SignalHelper.ConnectSignal(_parent, nameof(Entity3D.EntityUpdated), this, nameof(OnEntityUpdated)); + + // Get initial data + _cellData = _parent.CellData; + + if (_cellData != null) { + // Connect to cell data changes + SignalHelper.ConnectSignal(_cellData, nameof(GridCellType.CellChanged), this, nameof(OnCellDataChanged)); + + // Initial update + UpdateCharacter(); + } + } + } + + public override void _ExitTree() { + if (_parent != null) { + SignalHelper.DisconnectSignal(_parent, nameof(Entity3D.EntityUpdated), this, nameof(OnEntityUpdated)); + } + + if (_cellData != null) { + SignalHelper.DisconnectSignal(_cellData, nameof(GridCellType.CellChanged), this, nameof(OnCellDataChanged)); + } + + DestroyCharacterEntity(); + } + + private void OnEntityUpdated() { + if (_parent != null) { + var newCellData = _parent.CellData; + + // If cell data reference changed + if (_cellData != newCellData) { + if (_cellData != null) { + SignalHelper.DisconnectSignal(_cellData, nameof(GridCellType.CellChanged), this, nameof(OnCellDataChanged)); + } + + _cellData = newCellData; + + if (_cellData != null) { + SignalHelper.ConnectSignal(_cellData, nameof(GridCellType.CellChanged), this, nameof(OnCellDataChanged)); + } + + UpdateCharacter(); + } + } + } + + private void OnCellDataChanged() { + UpdateCharacter(); + } + + private void UpdateCharacter() { + if (_cellData == null) { + GD.Print("CharacterGridCellComponent: _cellData é null, destruindo CharacterEntity"); + DestroyCharacterEntity(); + return; + } + + GD.Print($"UpdateCharacter: Cell '{_cellData.Label}', IsOccupied: {_cellData.IsOccupied}, Has Character: {_cellData.Character != null}"); + + if (_cellData.Character != null && !_cellData.IsOccupied) { + _cellData.IsOccupied = true; + _cellData.NotifyChanged(); + } + + bool hasCharacter = _cellData.IsOccupied && _cellData.Character != null; + + if (hasCharacter) { + if (_characterEntity == null) { + GD.Print("CharacterGridCellComponent: Criando nova CharacterEntity"); + CreateCharacterEntity(); + } + + if (_characterEntity != null && _cellData.Character != null) { + GD.Print($"CharacterGridCellComponent: Atualizando CharacterData para {_cellData.Character.Name}"); + _characterEntity.CharacterData = _cellData.Character; + _characterEntity.Visible = true; + + _characterEntity.UpdateCharacterData.Call(); + } + } + else { + if (_characterEntity != null) { + GD.Print("CharacterGridCellComponent: Escondendo CharacterEntity existente"); + _characterEntity.Visible = false; + } + } + } + + private void CreateCharacterEntity() { + if (CharacterEntityScene == null) { + GD.PrintErr("Cannot create character entity: CharacterEntityScene is null"); + return; + } + + DestroyCharacterEntity(); // Clean up any existing entity + + _characterEntity = CharacterEntityScene.Instantiate(); + _characterEntity.Position = CharacterOffset; + AddChild(_characterEntity); + + // If we have character data already, set it + if (_cellData?.Character != null) { + _characterEntity.CharacterData = _cellData.Character; + } + else { + _characterEntity.Visible = false; + } + } + + private void DestroyCharacterEntity() { + if (_characterEntity != null) { + _characterEntity.QueueFree(); + _characterEntity = null; + } + } +} \ No newline at end of file diff --git a/src/renderers/components/CharacterGridCellComponent.cs.uid b/src/renderers/components/CharacterGridCellComponent.cs.uid new file mode 100644 index 00000000..ef6eb180 --- /dev/null +++ b/src/renderers/components/CharacterGridCellComponent.cs.uid @@ -0,0 +1 @@ +uid://yl5hkmseiouh diff --git a/src/renderers/components/GridCellComponent.cs b/src/renderers/components/GridCellComponent.cs new file mode 100644 index 00000000..9f849d7d --- /dev/null +++ b/src/renderers/components/GridCellComponent.cs @@ -0,0 +1,131 @@ +using Godot; +using DiceRolling.Entities; +using DiceRolling.Grids; +using DiceRolling.Characters; +using DiceRolling.Helpers; + +namespace DiceRolling.Components.Grids; + +[Tool] +[GlobalClass] +[Icon("res://assets/editor/component-3d.svg")] +public partial class GridCellComponent : Node3D { + private Entity3D? _parent; + private GridCellEntity? _cellEntity; + private GridCellType? _cellData; + + [Export] public MeshInstance3D? CellMeshNode { get; set; } + [Export] public Label3D? LabelNode { get; set; } + [Export] public bool ShowLabel { get; set; } = true; + [Export] public Color HighlightColor { get; set; } = new Color(1, 1, 0, 0.5f); + [Export] public Color DefaultColor { get; set; } = new Color(1, 1, 1, 1); + [Export] public Color OccupiedColor { get; set; } = new Color(0.8f, 0.8f, 1, 1); + + [ExportToolButton("Refresh Character")] + public Callable RefreshCharacter => Callable.From(() => { + if (_cellData != null && _cellData.Character != null) { + _cellData.IsOccupied = true; + _cellData.NotifyChanged(); + + // Use a API pública do GridCellEntity para notificar atualizações + if (_cellEntity != null) { + _cellEntity.UpdateCellData.Call(); + GD.Print($"Refreshing character in cell {_cellData.Label}"); + } + } + }); + + public override void _Ready() { + _parent = GetParent(); + _cellEntity = _parent as GridCellEntity; + + if (_cellEntity != null) { + // Connect to entity updates + SignalHelper.ConnectSignal(_cellEntity, nameof(Entity3D.EntityUpdated), this, nameof(OnEntityUpdated)); + + // Get initial data + _cellData = _cellEntity.CellData; + + if (_cellData != null) { + // Connect to cell data changes + SignalHelper.ConnectSignal(_cellData, nameof(GridCellType.CellChanged), this, nameof(OnCellDataChanged)); + + // Initial update + UpdateVisual(); + } + } + } + + public override void _ExitTree() { + if (_cellEntity != null) { + SignalHelper.DisconnectSignal(_cellEntity, nameof(Entity3D.EntityUpdated), this, nameof(OnEntityUpdated)); + } + + if (_cellData != null) { + SignalHelper.DisconnectSignal(_cellData, nameof(GridCellType.CellChanged), this, nameof(OnCellDataChanged)); + } + } + + private void OnEntityUpdated() { + if (_cellEntity != null) { + // Get possibly updated data reference + var newCellData = _cellEntity.CellData; + + // If data reference changed, reconnect signals + if (_cellData != newCellData) { + if (_cellData != null) { + SignalHelper.DisconnectSignal(_cellData, nameof(GridCellType.CellChanged), this, nameof(OnCellDataChanged)); + } + + _cellData = newCellData; + + if (_cellData != null) { + SignalHelper.ConnectSignal(_cellData, nameof(GridCellType.CellChanged), this, nameof(OnCellDataChanged)); + } + } + + UpdateVisual(); + } + } + + private void OnCellDataChanged() { + UpdateVisual(); + } + + private void UpdateVisual() { + if (_cellData == null) return; + + // Update label text if we have a label component + if (LabelNode != null && ShowLabel) { + LabelNode.Text = _cellData.Label; + LabelNode.Visible = true; + } + else if (LabelNode != null) { + LabelNode.Visible = false; + } + + // Update cell color/appearance based on state + if (CellMeshNode != null) { + // Set different appearance based on whether cell is occupied + if (_cellData.IsOccupied) { + SetCellMaterial(OccupiedColor); + } + else { + SetCellMaterial(DefaultColor); + } + } + } + + private void SetCellMaterial(Color color) { + if (CellMeshNode == null) return; + + // Creating a new material if needed + if (CellMeshNode.MaterialOverride is not StandardMaterial3D currentMat) { + currentMat = new StandardMaterial3D(); + CellMeshNode.MaterialOverride = currentMat; + } + + // Update material properties + ((StandardMaterial3D)CellMeshNode.MaterialOverride).AlbedoColor = color; + } +} \ No newline at end of file diff --git a/src/renderers/components/GridCellComponent.cs.uid b/src/renderers/components/GridCellComponent.cs.uid new file mode 100644 index 00000000..cf6e1c11 --- /dev/null +++ b/src/renderers/components/GridCellComponent.cs.uid @@ -0,0 +1 @@ +uid://xekdm6ih1oi3 diff --git a/src/renderers/components/GridCellRenderer.cs.uid b/src/renderers/components/GridCellRenderer.cs.uid new file mode 100644 index 00000000..ff96595a --- /dev/null +++ b/src/renderers/components/GridCellRenderer.cs.uid @@ -0,0 +1 @@ +uid://c2x7iqog8um diff --git a/src/renderers/components/GridCellsContainerComponent.cs.uid b/src/renderers/components/GridCellsContainerComponent.cs.uid new file mode 100644 index 00000000..2dd5eb71 --- /dev/null +++ b/src/renderers/components/GridCellsContainerComponent.cs.uid @@ -0,0 +1 @@ +uid://duw5lywg2vq2b diff --git a/src/renderers/components/GridComponent.cs.uid b/src/renderers/components/GridComponent.cs.uid new file mode 100644 index 00000000..7082a019 --- /dev/null +++ b/src/renderers/components/GridComponent.cs.uid @@ -0,0 +1 @@ +uid://de0fpfw15bgvs diff --git a/src/renderers/components/GridContainerComponent.cs b/src/renderers/components/GridContainerComponent.cs new file mode 100644 index 00000000..2a45823b --- /dev/null +++ b/src/renderers/components/GridContainerComponent.cs @@ -0,0 +1,67 @@ +using Godot; +using System.Collections.Generic; +using DiceRolling.Entities; +using DiceRolling.Grids; + +namespace DiceRolling.Components.Grids; + +[Tool] +[GlobalClass] +[Icon("res://assets/editor/component-3d.svg")] +public partial class GridContainerComponent : Node3D { + private GridEntity? _parent; + + [Export] public PackedScene? CellScene { get; set; } + [Export] public Vector3 CellSize { get; set; } = new Vector3(1, 0, 1); + [Export] public Vector3 GridOffset { get; set; } = Vector3.Zero; + + private readonly Dictionary _cellEntities = []; + + public override void _Ready() { + _parent = GetParent() as GridEntity; + if (_parent != null) { + _parent.Connect(Entity3D.SignalName.EntityUpdated, Callable.From(RebuildGrid)); + RebuildGrid(); + } + } + + private void RebuildGrid() { + ClearGrid(); + if (_parent?.GridData?.Cells == null || CellScene == null) return; + + foreach (var cell in _parent.GridData.Cells) { + if (cell == null) continue; + + CreateCellEntity(cell); + } + } + + private void ClearGrid() { + foreach (var entity in _cellEntities.Values) { + entity.QueueFree(); + } + _cellEntities.Clear(); + } + + private GridCellEntity CreateCellEntity(GridCellType cell) { + if (CellScene == null) { + GD.PrintErr("Cannot create cell entity: CellScene is null."); + throw new System.ArgumentNullException(nameof(CellScene), "CellScene must be assigned to create grid cell entities."); + } + + var instance = CellScene.Instantiate(); + instance.CellData = cell; + instance.Position = CalculateCellPosition(cell); + AddChild(instance); + _cellEntities[cell.Id] = instance; + return instance; + } + + private Vector3 CalculateCellPosition(GridCellType cell) { + return new Vector3( + cell.Column * CellSize.X + GridOffset.X, + GridOffset.Y, + cell.Row * CellSize.Z + GridOffset.Z + ); + } +} \ No newline at end of file diff --git a/src/renderers/components/GridContainerComponent.cs.uid b/src/renderers/components/GridContainerComponent.cs.uid new file mode 100644 index 00000000..1d627425 --- /dev/null +++ b/src/renderers/components/GridContainerComponent.cs.uid @@ -0,0 +1 @@ +uid://cycvmb2ix6vas diff --git a/src/renderers/components/GridRenderer.cs.uid b/src/renderers/components/GridRenderer.cs.uid new file mode 100644 index 00000000..c0cd3459 --- /dev/null +++ b/src/renderers/components/GridRenderer.cs.uid @@ -0,0 +1 @@ +uid://cbn65cqokoehh diff --git a/src/renderers/components/GridRendererComponent.cs.uid b/src/renderers/components/GridRendererComponent.cs.uid new file mode 100644 index 00000000..5771652a --- /dev/null +++ b/src/renderers/components/GridRendererComponent.cs.uid @@ -0,0 +1 @@ +uid://dwj4o578uxude diff --git a/src/renderers/components/GridSelectableComponent.cs.uid b/src/renderers/components/GridSelectableComponent.cs.uid new file mode 100644 index 00000000..26f1d161 --- /dev/null +++ b/src/renderers/components/GridSelectableComponent.cs.uid @@ -0,0 +1 @@ +uid://ppxfixik5cax diff --git a/src/renderers/entities/CharacterEntity/CharacterEntity.cs b/src/renderers/entities/CharacterEntity/CharacterEntity.cs index 8389a241..89701e59 100644 --- a/src/renderers/entities/CharacterEntity/CharacterEntity.cs +++ b/src/renderers/entities/CharacterEntity/CharacterEntity.cs @@ -6,6 +6,7 @@ namespace DiceRolling.Entities; [Tool] [GlobalClass] public partial class CharacterEntity : Entity3D { + [Export] public CharacterType? CharacterData { get => GetData(); diff --git a/src/renderers/entities/CharacterEntity/CharacterEntity.tscn b/src/renderers/entities/CharacterEntity/CharacterEntity.tscn index 20be325c..ecf28e61 100644 --- a/src/renderers/entities/CharacterEntity/CharacterEntity.tscn +++ b/src/renderers/entities/CharacterEntity/CharacterEntity.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=9 format=3 uid="uid://b5fpv2rdkq5c"] [ext_resource type="Script" uid="uid://cyt7peem686tr" path="res://renderers/entities/CharacterEntity/CharacterEntity.cs" id="1_sly7g"] -[ext_resource type="Resource" uid="uid://clrt1eby68x42" path="res://resources/Characters/Eleonore.tres" id="2_vbwm8"] +[ext_resource type="Resource" uid="uid://bkolttux1bvi1" path="res://resources/Characters/Joanna.tres" id="2_56jxl"] [ext_resource type="SpriteFrames" uid="uid://bskb8ffl72voq" path="res://assets/characters/eleonoreOtsoga/EleonoreOtsogaSprites.tres" id="3_lytje"] [ext_resource type="Script" uid="uid://cejuccgxo60qs" path="res://renderers/components/AnimatedSpriteComponent.cs" id="3_q1qiw"] [ext_resource type="Script" uid="uid://bs8ip2rdvho4s" path="res://renderers/components/SelectableComponent.cs" id="4_lytje"] @@ -14,8 +14,7 @@ height = 1.007 [node name="CharacterEntity" type="Node3D"] script = ExtResource("1_sly7g") -CharacterData = ExtResource("2_vbwm8") -Data = ExtResource("2_vbwm8") +CharacterData = ExtResource("2_56jxl") metadata/_custom_type_script = "uid://cyt7peem686tr" [node name="AnimatedSpriteComponent" type="AnimatedSprite3D" parent="."] @@ -26,7 +25,7 @@ shaded = true texture_filter = 0 sprite_frames = ExtResource("3_lytje") animation = &"idle" -frame_progress = 0.982385 +frame_progress = 0.133684 script = ExtResource("3_q1qiw") metadata/_custom_type_script = "uid://cejuccgxo60qs" diff --git a/src/renderers/entities/Entity3D.cs b/src/renderers/entities/Entity3D.cs index efbc8eda..34d45c8d 100644 --- a/src/renderers/entities/Entity3D.cs +++ b/src/renderers/entities/Entity3D.cs @@ -1,5 +1,4 @@ using Godot; -using DiceRolling.Helpers; using DiceRolling.Id; namespace DiceRolling.Entities; @@ -12,43 +11,25 @@ public abstract partial class Entity3D : Node3D { private IdentifiableResource? _data; - [Export] public IdentifiableResource? Data { get => _data; set { if (_data == value) { return; } - - // Disconnect from old data if exists - // SignalHelper.DisconnectSignal(_data, "Changed", this, nameof(OnDataChanged)); - _data = value; - - // Connect to new data if exists - // SignalHelper.ConnectSignal(_data, "Changed", this, nameof(OnDataChanged)); - NotifyUpdate(); } } protected void NotifyUpdate() { + GD.Print($"Entity Updated: {Data?.Id}"); EmitSignal(nameof(EntityUpdated)); } - // Changed from protected to public to allow components to access it public T? GetData() where T : IdentifiableResource { return Data as T; } - - public override void _Ready() { - // SignalHelper.ConnectSignal(_data, "Changed", this, nameof(OnDataChanged)); - } - - public override void _ExitTree() { - // SignalHelper.DisconnectSignal(_data, "Changed", this, nameof(OnDataChanged)); - } - private void OnDataChanged() { NotifyUpdate(); } diff --git a/src/renderers/entities/GridCellEntity/GridCellEntity.cs b/src/renderers/entities/GridCellEntity/GridCellEntity.cs new file mode 100644 index 00000000..d587e0ab --- /dev/null +++ b/src/renderers/entities/GridCellEntity/GridCellEntity.cs @@ -0,0 +1,18 @@ +using Godot; +using DiceRolling.Grids; + +namespace DiceRolling.Entities; + +[Tool] +[GlobalClass] +public partial class GridCellEntity : Entity3D { + + [Export] + public GridCellType? CellData { + get => GetData(); + set => Data = value; + } + + [ExportToolButton("Update Cell")] + public Callable UpdateCellData => Callable.From(() => NotifyUpdate()); +} \ No newline at end of file diff --git a/src/renderers/entities/GridCellEntity/GridCellEntity.cs.uid b/src/renderers/entities/GridCellEntity/GridCellEntity.cs.uid new file mode 100644 index 00000000..59b2b72c --- /dev/null +++ b/src/renderers/entities/GridCellEntity/GridCellEntity.cs.uid @@ -0,0 +1 @@ +uid://d2163e68sbuxu diff --git a/src/renderers/entities/GridCellEntity/GridCellEntity.tscn b/src/renderers/entities/GridCellEntity/GridCellEntity.tscn new file mode 100644 index 00000000..95a4748d --- /dev/null +++ b/src/renderers/entities/GridCellEntity/GridCellEntity.tscn @@ -0,0 +1,51 @@ +[gd_scene load_steps=10 format=3 uid="uid://2jqadvotpskf"] + +[ext_resource type="Script" uid="uid://d2163e68sbuxu" path="res://renderers/entities/GridCellEntity/GridCellEntity.cs" id="1_ms2v1"] +[ext_resource type="Resource" uid="uid://bkolttux1bvi1" path="res://resources/Characters/Joanna.tres" id="2_5dr04"] +[ext_resource type="Script" uid="uid://bnrom8367617i" path="res://models/data/GridCell/GridCellType.cs" id="2_k85n8"] +[ext_resource type="Script" uid="uid://xekdm6ih1oi3" path="res://renderers/components/GridCellComponent.cs" id="3_e3qvn"] +[ext_resource type="PackedScene" uid="uid://b5fpv2rdkq5c" path="res://renderers/entities/CharacterEntity/CharacterEntity.tscn" id="4_dnb4r"] +[ext_resource type="Script" uid="uid://yl5hkmseiouh" path="res://renderers/components/CharacterGridCellComponent.cs" id="5_detn8"] + +[sub_resource type="Resource" id="Resource_e3qvn"] +script = ExtResource("2_k85n8") +Character = ExtResource("2_5dr04") +Value = 0 +Row = 1 +Column = 1 +Index = 0 +Label = "" +IsWalkable = false +IsOccupied = true +Id = "c9d78c06-2e53-4e44-9fd1-11e5f4e97afc" +metadata/_custom_type_script = "uid://bnrom8367617i" + +[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_dnb4r"] +albedo_color = Color(0.8, 0.8, 1, 1) + +[sub_resource type="BoxMesh" id="BoxMesh_dnb4r"] + +[node name="GridCellEntity" type="Node3D"] +script = ExtResource("1_ms2v1") +CellData = SubResource("Resource_e3qvn") +metadata/_custom_type_script = "uid://d2163e68sbuxu" + +[node name="GridCellComponent" type="Node3D" parent="." node_paths=PackedStringArray("CellMeshNode", "LabelNode")] +script = ExtResource("3_e3qvn") +CellMeshNode = NodePath("MeshInstance3D") +LabelNode = NodePath("Label3D") +metadata/_custom_type_script = "uid://xekdm6ih1oi3" + +[node name="MeshInstance3D" type="MeshInstance3D" parent="GridCellComponent"] +transform = Transform3D(1, 0, 0, 0, 0.0393298, 0, 0, 0, 1, 0, 0, 0) +material_override = SubResource("StandardMaterial3D_dnb4r") +mesh = SubResource("BoxMesh_dnb4r") +skeleton = NodePath("../..") + +[node name="Label3D" type="Label3D" parent="GridCellComponent"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.28578, 0) + +[node name="CharacterGridCellComponent" type="Node3D" parent="."] +script = ExtResource("5_detn8") +CharacterEntityScene = ExtResource("4_dnb4r") +metadata/_custom_type_script = "uid://yl5hkmseiouh" diff --git a/src/renderers/entities/GridEntity/GridEntity.cs b/src/renderers/entities/GridEntity/GridEntity.cs new file mode 100644 index 00000000..a5b5e827 --- /dev/null +++ b/src/renderers/entities/GridEntity/GridEntity.cs @@ -0,0 +1,26 @@ +using Godot; +using DiceRolling.Grids; + +namespace DiceRolling.Entities; + +[Tool] +[GlobalClass] +public partial class GridEntity : Entity3D { + + [Export] + public GridType? GridData { + get => GetData(); + set => Data = value; + } + + [ExportToolButton("Update Grid")] + public Callable UpdateGridData => Callable.From(() => NotifyUpdate()); + + [ExportToolButton("Assign Characters")] + public Callable AssignCharactersButton => Callable.From(() => { + if (GridData != null) { + GridData.AssignCharacters(); + NotifyUpdate(); + } + }); +} \ No newline at end of file diff --git a/src/renderers/entities/GridEntity/GridEntity.cs.uid b/src/renderers/entities/GridEntity/GridEntity.cs.uid new file mode 100644 index 00000000..bebe6690 --- /dev/null +++ b/src/renderers/entities/GridEntity/GridEntity.cs.uid @@ -0,0 +1 @@ +uid://ctc1mk501yyuj diff --git a/src/renderers/entities/GridEntity/GridEntity.tscn b/src/renderers/entities/GridEntity/GridEntity.tscn new file mode 100644 index 00000000..7eda447f --- /dev/null +++ b/src/renderers/entities/GridEntity/GridEntity.tscn @@ -0,0 +1,100 @@ +[gd_scene load_steps=16 format=3 uid="uid://bqux57kvwbyix"] + +[ext_resource type="Script" uid="uid://ctc1mk501yyuj" path="res://renderers/entities/GridEntity/GridEntity.cs" id="1_0ephl"] +[ext_resource type="Script" uid="uid://bnrom8367617i" path="res://models/data/GridCell/GridCellType.cs" id="2_jqupx"] +[ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://models/data/Grid/GridType.cs" id="2_yi2bp"] +[ext_resource type="Resource" uid="uid://snt34yslyn4f" path="res://resources/Characters/PlayerCharacterStore.tres" id="3_3sa72"] +[ext_resource type="Resource" uid="uid://clrt1eby68x42" path="res://resources/Characters/Eleonore.tres" id="3_go7ud"] +[ext_resource type="Resource" uid="uid://bkolttux1bvi1" path="res://resources/Characters/Joanna.tres" id="4_x231g"] +[ext_resource type="Script" uid="uid://cycvmb2ix6vas" path="res://renderers/components/GridContainerComponent.cs" id="5_jqupx"] +[ext_resource type="PackedScene" uid="uid://2jqadvotpskf" path="res://renderers/entities/GridCellEntity/GridCellEntity.tscn" id="6_3sa72"] + +[sub_resource type="Resource" id="Resource_rfibt"] +script = ExtResource("2_jqupx") +Value = 0 +Row = 0 +Column = 0 +Index = 0 +Label = "G0" +IsWalkable = true +IsOccupied = false +Id = "f97aa9cf-9d8a-438a-9b3b-b1fcb33b1548" + +[sub_resource type="Resource" id="Resource_irwyf"] +script = ExtResource("2_jqupx") +Value = 0 +Row = 0 +Column = 1 +Index = 1 +Label = "G1" +IsWalkable = true +IsOccupied = false +Id = "936e4634-0b70-422d-8dda-5bae6054c3d5" + +[sub_resource type="Resource" id="Resource_mkisb"] +script = ExtResource("2_jqupx") +Character = ExtResource("3_go7ud") +Value = 0 +Row = 0 +Column = 2 +Index = 2 +Label = "G2" +IsWalkable = true +IsOccupied = true +Id = "a2b5459b-c9b4-45f8-b069-e769f5ecd5de" + +[sub_resource type="Resource" id="Resource_0yhms"] +script = ExtResource("2_jqupx") +Value = 0 +Row = 1 +Column = 0 +Index = 3 +Label = "G3" +IsWalkable = true +IsOccupied = false +Id = "5ec3a7be-f3ed-4804-b021-c9b90d23ae46" + +[sub_resource type="Resource" id="Resource_tdpn2"] +script = ExtResource("2_jqupx") +Value = 0 +Row = 1 +Column = 1 +Index = 4 +Label = "G4" +IsWalkable = true +IsOccupied = false +Id = "bcb49902-bad3-42d1-8e27-339ff571723a" + +[sub_resource type="Resource" id="Resource_p6s3l"] +script = ExtResource("2_jqupx") +Character = ExtResource("4_x231g") +Value = 0 +Row = 1 +Column = 2 +Index = 5 +Label = "G5" +IsWalkable = true +IsOccupied = true +Id = "e2d08d64-26d1-4070-ad02-88c0c9293a19" + +[sub_resource type="Resource" id="Resource_pohop"] +script = ExtResource("2_yi2bp") +Prefix = "G" +Offset = 0 +CharacterStore = ExtResource("3_3sa72") +Direction = 0 +Rows = 2 +Columns = 3 +Cells = Array[ExtResource("2_jqupx")]([SubResource("Resource_rfibt"), SubResource("Resource_irwyf"), SubResource("Resource_mkisb"), SubResource("Resource_0yhms"), SubResource("Resource_tdpn2"), SubResource("Resource_p6s3l")]) +Id = "db049eb9-815c-40eb-a0bd-e483b7f3fd32" +metadata/_custom_type_script = "uid://ca6up1de7fo4q" + +[node name="GridEntity" type="Node3D"] +script = ExtResource("1_0ephl") +GridData = SubResource("Resource_pohop") +metadata/_custom_type_script = "uid://ctc1mk501yyuj" + +[node name="GridContainerComponent" type="Node3D" parent="."] +script = ExtResource("5_jqupx") +CellScene = ExtResource("6_3sa72") +metadata/_custom_type_script = "uid://cycvmb2ix6vas" diff --git a/src/resources/Actions/ArcaneStrike.tres b/src/resources/Actions/ArcaneStrike.tres index da9cebb4..9ce33622 100644 --- a/src/resources/Actions/ArcaneStrike.tres +++ b/src/resources/Actions/ArcaneStrike.tres @@ -1,14 +1,178 @@ -[gd_resource type="Resource" script_class="ActionType" load_steps=4 format=3 uid="uid://c8xr12tkory0k"] +[gd_resource type="Resource" script_class="ActionType" load_steps=22 format=3 uid="uid://c8xr12tkory0k"] [ext_resource type="Script" uid="uid://dunaxvn3b6xe0" path="res://models/data/Effect/EffectType.cs" id="1_ce1no"] [ext_resource type="Script" uid="uid://yxgkinium01u" path="res://models/data/Dice/DiceEnergy.cs" id="2_3fo7f"] +[ext_resource type="Script" uid="uid://ca6up1de7fo4q" path="res://models/data/Grid/GridType.cs" id="3_kqwk7"] +[ext_resource type="Script" uid="uid://bnrom8367617i" path="res://models/data/GridCell/GridCellType.cs" id="4_8r31q"] +[ext_resource type="Script" uid="uid://1fvttm4h5sf3" path="res://models/data/Target/TargetBoardType.cs" id="5_n366w"] [ext_resource type="Script" uid="uid://dk6es2dobyja5" path="res://models/data/Action/ActionType.cs" id="7_wv8if"] +[sub_resource type="Resource" id="Resource_xi31x"] +script = ExtResource("4_8r31q") +Value = 0 +Row = 0 +Column = 0 +Index = 0 +Label = "G0" +IsWalkable = true +IsOccupied = false +Id = "1d706315-3bf3-4bd9-9d87-fb3520ef5d94" + +[sub_resource type="Resource" id="Resource_mxrco"] +script = ExtResource("4_8r31q") +Value = 0 +Row = 0 +Column = 1 +Index = 1 +Label = "G1" +IsWalkable = true +IsOccupied = false +Id = "c8af82ae-b890-48c7-b70e-c1d9c756ed3d" + +[sub_resource type="Resource" id="Resource_wv8if"] +script = ExtResource("4_8r31q") +Value = 0 +Row = 0 +Column = 2 +Index = 2 +Label = "G2" +IsWalkable = true +IsOccupied = false +Id = "717203a1-3223-4553-aab9-60019c62d935" + +[sub_resource type="Resource" id="Resource_icgfc"] +script = ExtResource("4_8r31q") +Value = 0 +Row = 1 +Column = 0 +Index = 3 +Label = "G3" +IsWalkable = true +IsOccupied = false +Id = "7ff2b494-4436-4fc1-b23a-a3347222aa35" + +[sub_resource type="Resource" id="Resource_rsgia"] +script = ExtResource("4_8r31q") +Value = 0 +Row = 1 +Column = 1 +Index = 4 +Label = "G4" +IsWalkable = true +IsOccupied = false +Id = "4fe02d86-ec14-4aff-a607-fd85428d6d17" + +[sub_resource type="Resource" id="Resource_fpbdf"] +script = ExtResource("4_8r31q") +Value = 0 +Row = 1 +Column = 2 +Index = 5 +Label = "G5" +IsWalkable = true +IsOccupied = false +Id = "81f48fe1-c368-4dc1-8643-a78949629305" + +[sub_resource type="Resource" id="Resource_qkl28"] +script = ExtResource("3_kqwk7") +Prefix = "G" +Offset = 0 +Direction = 0 +Rows = 2 +Columns = 3 +Cells = Array[ExtResource("4_8r31q")]([SubResource("Resource_xi31x"), SubResource("Resource_mxrco"), SubResource("Resource_wv8if"), SubResource("Resource_icgfc"), SubResource("Resource_rsgia"), SubResource("Resource_fpbdf")]) +Id = "bf0b1e24-3d97-4dc5-975f-a754fa73eda7" +metadata/_custom_type_script = "uid://ca6up1de7fo4q" + +[sub_resource type="Resource" id="Resource_udwiu"] +script = ExtResource("4_8r31q") +Value = 0 +Row = 0 +Column = 0 +Index = 0 +Label = "G0" +IsWalkable = true +IsOccupied = false +Id = "97eb2b49-5dff-4890-b389-f20847385f5b" + +[sub_resource type="Resource" id="Resource_im6sk"] +script = ExtResource("4_8r31q") +Value = 0 +Row = 0 +Column = 1 +Index = 1 +Label = "G1" +IsWalkable = true +IsOccupied = false +Id = "ec972158-5864-4a37-a25b-88e584dc45ae" + +[sub_resource type="Resource" id="Resource_opck1"] +script = ExtResource("4_8r31q") +Value = 0 +Row = 0 +Column = 2 +Index = 2 +Label = "G2" +IsWalkable = true +IsOccupied = false +Id = "c96730f0-6175-4e6e-af41-1780cf57e9a2" + +[sub_resource type="Resource" id="Resource_2xohs"] +script = ExtResource("4_8r31q") +Value = 0 +Row = 1 +Column = 0 +Index = 3 +Label = "G3" +IsWalkable = true +IsOccupied = false +Id = "4f4be816-94e0-43f5-b041-e5d7d90474b9" + +[sub_resource type="Resource" id="Resource_cs1c4"] +script = ExtResource("4_8r31q") +Value = 0 +Row = 1 +Column = 1 +Index = 4 +Label = "G4" +IsWalkable = true +IsOccupied = false +Id = "7d4da2fb-3987-487a-9cad-67417df1dcd3" + +[sub_resource type="Resource" id="Resource_xc6bq"] +script = ExtResource("4_8r31q") +Value = 0 +Row = 1 +Column = 2 +Index = 5 +Label = "G5" +IsWalkable = true +IsOccupied = false +Id = "dd7d38e4-0b10-4051-b8d7-c4d948553c70" + +[sub_resource type="Resource" id="Resource_ym6qs"] +script = ExtResource("3_kqwk7") +Prefix = "G" +Offset = 0 +Direction = 0 +Rows = 2 +Columns = 3 +Cells = Array[ExtResource("4_8r31q")]([SubResource("Resource_udwiu"), SubResource("Resource_im6sk"), SubResource("Resource_opck1"), SubResource("Resource_2xohs"), SubResource("Resource_cs1c4"), SubResource("Resource_xc6bq")]) +Id = "7df93483-4546-4371-bc69-624c5fa019f8" +metadata/_custom_type_script = "uid://ca6up1de7fo4q" + +[sub_resource type="Resource" id="Resource_qf6s8"] +script = ExtResource("5_n366w") +IsSingleTarget = false +Grids = Array[ExtResource("3_kqwk7")]([SubResource("Resource_qkl28"), SubResource("Resource_ym6qs")]) +metadata/_custom_type_script = "uid://1fvttm4h5sf3" + [resource] script = ExtResource("7_wv8if") Name = "Arcane Strike" Description = "" RequiredEnergy = Array[ExtResource("2_3fo7f")]([]) Effects = Array[ExtResource("1_ce1no")]([]) +TargetBoard = SubResource("Resource_qf6s8") Id = "75ab151b-3832-4391-ab5b-77341639ec0e" metadata/_custom_type_script = "uid://dk6es2dobyja5" From 7addbd0eacb4054cd16a43c600347423d829a4a6 Mon Sep 17 00:00:00 2001 From: Danilo Nobre Date: Fri, 14 Mar 2025 00:15:28 -0300 Subject: [PATCH 12/13] Remove obsolete documentation files and add new model documentation for grids, attributes, roles, targets, and locations --- docs/content/architecture/00-intro/overview.md | 2 +- docs/content/architecture/02-features/common/events.md | 1 - docs/content/architecture/02-features/common/id.md | 1 - docs/content/architecture/02-features/common/logs.md | 1 - .../architecture/02-features/common/validation_service.md | 1 - docs/content/architecture/02-features/index.md | 3 --- docs/content/architecture/02-features/scenes/battle.md | 1 - docs/content/architecture/02-features/scenes/city.md | 1 - docs/content/architecture/02-features/scenes/dungeon.md | 1 - .../content/architecture/02-features/scenes/menus/game_over.md | 1 - .../content/architecture/02-features/scenes/menus/main_menu.md | 1 - docs/content/architecture/02-features/ui/buttons.md | 1 - docs/content/architecture/02-features/ui/transitions.md | 1 - .../content/architecture/{02-features => 02-models}/actions.md | 0 .../architecture/{02-features => 02-models}/attributes.md | 0 .../architecture/{02-features => 02-models}/characters.md | 0 docs/content/architecture/{02-features => 02-models}/dice.md | 0 docs/content/architecture/{02-features => 02-models}/effect.md | 0 docs/content/architecture/{02-features => 02-models}/grids.md | 0 docs/content/architecture/02-models/index.md | 3 +++ .../architecture/{02-features => 02-models}/location.md | 0 docs/content/architecture/{02-features => 02-models}/roles.md | 0 docs/content/architecture/{02-features => 02-models}/target.md | 0 23 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 docs/content/architecture/02-features/common/events.md delete mode 100644 docs/content/architecture/02-features/common/id.md delete mode 100644 docs/content/architecture/02-features/common/logs.md delete mode 100644 docs/content/architecture/02-features/common/validation_service.md delete mode 100644 docs/content/architecture/02-features/index.md delete mode 100644 docs/content/architecture/02-features/scenes/battle.md delete mode 100644 docs/content/architecture/02-features/scenes/city.md delete mode 100644 docs/content/architecture/02-features/scenes/dungeon.md delete mode 100644 docs/content/architecture/02-features/scenes/menus/game_over.md delete mode 100644 docs/content/architecture/02-features/scenes/menus/main_menu.md delete mode 100644 docs/content/architecture/02-features/ui/buttons.md delete mode 100644 docs/content/architecture/02-features/ui/transitions.md rename docs/content/architecture/{02-features => 02-models}/actions.md (100%) rename docs/content/architecture/{02-features => 02-models}/attributes.md (100%) rename docs/content/architecture/{02-features => 02-models}/characters.md (100%) rename docs/content/architecture/{02-features => 02-models}/dice.md (100%) rename docs/content/architecture/{02-features => 02-models}/effect.md (100%) rename docs/content/architecture/{02-features => 02-models}/grids.md (100%) create mode 100644 docs/content/architecture/02-models/index.md rename docs/content/architecture/{02-features => 02-models}/location.md (100%) rename docs/content/architecture/{02-features => 02-models}/roles.md (100%) rename docs/content/architecture/{02-features => 02-models}/target.md (100%) diff --git a/docs/content/architecture/00-intro/overview.md b/docs/content/architecture/00-intro/overview.md index 60f5bab2..cab0c2cc 100644 --- a/docs/content/architecture/00-intro/overview.md +++ b/docs/content/architecture/00-intro/overview.md @@ -17,7 +17,7 @@ Dessa forma, a **lógica do jogo** é centralizada nos Controladores, a **repres --- -## Modelos +## Modelos de dados Os Modelos são estruturados em `Resources` do Godot, possibilitando expansão como a criação de novos tipos de personagens, atributos, classes, ações e efeitos com o mínimo de alterações no código. diff --git a/docs/content/architecture/02-features/common/events.md b/docs/content/architecture/02-features/common/events.md deleted file mode 100644 index 1f187df0..00000000 --- a/docs/content/architecture/02-features/common/events.md +++ /dev/null @@ -1 +0,0 @@ -# Events diff --git a/docs/content/architecture/02-features/common/id.md b/docs/content/architecture/02-features/common/id.md deleted file mode 100644 index 8c6bb587..00000000 --- a/docs/content/architecture/02-features/common/id.md +++ /dev/null @@ -1 +0,0 @@ -# Id diff --git a/docs/content/architecture/02-features/common/logs.md b/docs/content/architecture/02-features/common/logs.md deleted file mode 100644 index 66d7b1c1..00000000 --- a/docs/content/architecture/02-features/common/logs.md +++ /dev/null @@ -1 +0,0 @@ -# Logs diff --git a/docs/content/architecture/02-features/common/validation_service.md b/docs/content/architecture/02-features/common/validation_service.md deleted file mode 100644 index 29452fba..00000000 --- a/docs/content/architecture/02-features/common/validation_service.md +++ /dev/null @@ -1 +0,0 @@ -# Validation Service diff --git a/docs/content/architecture/02-features/index.md b/docs/content/architecture/02-features/index.md deleted file mode 100644 index e37aee88..00000000 --- a/docs/content/architecture/02-features/index.md +++ /dev/null @@ -1,3 +0,0 @@ -# Features - -Este documento descreve as features de **DICE ROLLING FRAMEWORK**. diff --git a/docs/content/architecture/02-features/scenes/battle.md b/docs/content/architecture/02-features/scenes/battle.md deleted file mode 100644 index 9dd7e885..00000000 --- a/docs/content/architecture/02-features/scenes/battle.md +++ /dev/null @@ -1 +0,0 @@ -# Battle diff --git a/docs/content/architecture/02-features/scenes/city.md b/docs/content/architecture/02-features/scenes/city.md deleted file mode 100644 index 817b9843..00000000 --- a/docs/content/architecture/02-features/scenes/city.md +++ /dev/null @@ -1 +0,0 @@ -# City diff --git a/docs/content/architecture/02-features/scenes/dungeon.md b/docs/content/architecture/02-features/scenes/dungeon.md deleted file mode 100644 index 979ff4d8..00000000 --- a/docs/content/architecture/02-features/scenes/dungeon.md +++ /dev/null @@ -1 +0,0 @@ -# Dungeon diff --git a/docs/content/architecture/02-features/scenes/menus/game_over.md b/docs/content/architecture/02-features/scenes/menus/game_over.md deleted file mode 100644 index 2f16d4b6..00000000 --- a/docs/content/architecture/02-features/scenes/menus/game_over.md +++ /dev/null @@ -1 +0,0 @@ -# Game Over diff --git a/docs/content/architecture/02-features/scenes/menus/main_menu.md b/docs/content/architecture/02-features/scenes/menus/main_menu.md deleted file mode 100644 index b479d426..00000000 --- a/docs/content/architecture/02-features/scenes/menus/main_menu.md +++ /dev/null @@ -1 +0,0 @@ -# Main Menu diff --git a/docs/content/architecture/02-features/ui/buttons.md b/docs/content/architecture/02-features/ui/buttons.md deleted file mode 100644 index 8694b481..00000000 --- a/docs/content/architecture/02-features/ui/buttons.md +++ /dev/null @@ -1 +0,0 @@ -# Buttons diff --git a/docs/content/architecture/02-features/ui/transitions.md b/docs/content/architecture/02-features/ui/transitions.md deleted file mode 100644 index bbe279ab..00000000 --- a/docs/content/architecture/02-features/ui/transitions.md +++ /dev/null @@ -1 +0,0 @@ -# Transitions diff --git a/docs/content/architecture/02-features/actions.md b/docs/content/architecture/02-models/actions.md similarity index 100% rename from docs/content/architecture/02-features/actions.md rename to docs/content/architecture/02-models/actions.md diff --git a/docs/content/architecture/02-features/attributes.md b/docs/content/architecture/02-models/attributes.md similarity index 100% rename from docs/content/architecture/02-features/attributes.md rename to docs/content/architecture/02-models/attributes.md diff --git a/docs/content/architecture/02-features/characters.md b/docs/content/architecture/02-models/characters.md similarity index 100% rename from docs/content/architecture/02-features/characters.md rename to docs/content/architecture/02-models/characters.md diff --git a/docs/content/architecture/02-features/dice.md b/docs/content/architecture/02-models/dice.md similarity index 100% rename from docs/content/architecture/02-features/dice.md rename to docs/content/architecture/02-models/dice.md diff --git a/docs/content/architecture/02-features/effect.md b/docs/content/architecture/02-models/effect.md similarity index 100% rename from docs/content/architecture/02-features/effect.md rename to docs/content/architecture/02-models/effect.md diff --git a/docs/content/architecture/02-features/grids.md b/docs/content/architecture/02-models/grids.md similarity index 100% rename from docs/content/architecture/02-features/grids.md rename to docs/content/architecture/02-models/grids.md diff --git a/docs/content/architecture/02-models/index.md b/docs/content/architecture/02-models/index.md new file mode 100644 index 00000000..ab53bf68 --- /dev/null +++ b/docs/content/architecture/02-models/index.md @@ -0,0 +1,3 @@ +# Modelos de dados + +Este documento descreve os **Modelos de Dados** da Framework e como eles são estruturados. diff --git a/docs/content/architecture/02-features/location.md b/docs/content/architecture/02-models/location.md similarity index 100% rename from docs/content/architecture/02-features/location.md rename to docs/content/architecture/02-models/location.md diff --git a/docs/content/architecture/02-features/roles.md b/docs/content/architecture/02-models/roles.md similarity index 100% rename from docs/content/architecture/02-features/roles.md rename to docs/content/architecture/02-models/roles.md diff --git a/docs/content/architecture/02-features/target.md b/docs/content/architecture/02-models/target.md similarity index 100% rename from docs/content/architecture/02-features/target.md rename to docs/content/architecture/02-models/target.md From 7609c6f659873744ad117a861b0f1139810e9432 Mon Sep 17 00:00:00 2001 From: Danilo Nobre Date: Fri, 14 Mar 2025 00:15:35 -0300 Subject: [PATCH 13/13] Add documentation for Character Renderer and related components --- .../architecture/03-renderers/character.md | 55 +++++++++++++++++++ .../architecture/03-renderers/index.md | 1 + .../architecture/04-controllers/index.md | 1 + 3 files changed, 57 insertions(+) create mode 100644 docs/content/architecture/03-renderers/character.md create mode 100644 docs/content/architecture/03-renderers/index.md create mode 100644 docs/content/architecture/04-controllers/index.md diff --git a/docs/content/architecture/03-renderers/character.md b/docs/content/architecture/03-renderers/character.md new file mode 100644 index 00000000..025eff29 --- /dev/null +++ b/docs/content/architecture/03-renderers/character.md @@ -0,0 +1,55 @@ +# Character Renderer + +## Visão Geral + +O Character Renderer é responsável pela representação visual dos personagens, conectando os modelos de dados `CharacterType` com elementos visuais na cena. + +```mermaid +flowchart BT + CharacterType["CharacterType
(Resource)"] + CharacterEntity["CharacterEntity
(Entity3D)"] + + AnimatedSprite["AnimatedSpriteComponent"] + Selectable["SelectableComponent"] + + HoverSprite3D["Hover Sprite
(Sprite3D)"] + SelectSprite3D["Select Sprite
(Sprite3D)"] + Area3D["Area3D"] + + CharacterEntity-->|referencia|CharacterType + AnimatedSprite-->|compõe|CharacterEntity + Selectable-->|compõe|CharacterEntity + + Sprite3D-->|compõe|AnimatedSprite + + Area3D-->|compõe|Selectable + HoverSprite3D-->|compõe|Selectable + SelectSprite3D-->|compõe|Selectable +``` + +## Entidades + +### CharacterEntity + +- Herda de `Entity3D` e representa visualmente um personagem +- Encapsula um modelo de dados `CharacterType` +- Responde a mudanças nos dados através do método `NotifyUpdate()` +- Permite interação com o sistema de grid através de componentes + +## Componentes + +### AnimatedSpriteComponent + +- Renderiza o sprite do personagem usando os recursos visuais definidos no `CharacterType` +- Gerencia animações como idle + +### SelectableComponent + +- Adiciona funcionalidade de seleção ao personagem +- Gerencia indicadores visuais (hover, seleção) +- Emite sinais quando o personagem é selecionado/desselecionado + +## Interações com Outros Sistemas + +- Interage com `GridSystem` para posicionamento +- Recebe atualizações de estado do `CharacterService` diff --git a/docs/content/architecture/03-renderers/index.md b/docs/content/architecture/03-renderers/index.md new file mode 100644 index 00000000..3c75587b --- /dev/null +++ b/docs/content/architecture/03-renderers/index.md @@ -0,0 +1 @@ +# Renderizadores diff --git a/docs/content/architecture/04-controllers/index.md b/docs/content/architecture/04-controllers/index.md new file mode 100644 index 00000000..df314e90 --- /dev/null +++ b/docs/content/architecture/04-controllers/index.md @@ -0,0 +1 @@ +# Controladores