diff --git a/assets/ui/37.png b/assets/ui/37.png new file mode 100644 index 0000000..5462748 Binary files /dev/null and b/assets/ui/37.png differ diff --git a/assets/ui/37.png.import b/assets/ui/37.png.import new file mode 100644 index 0000000..89ff6a4 --- /dev/null +++ b/assets/ui/37.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://sd28ri0okg8i" +path="res://.godot/imported/37.png-9eec6d7639ccb0cf201880eb3569a1d2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/37.png" +dest_files=["res://.godot/imported/37.png-9eec6d7639ccb0cf201880eb3569a1d2.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/assets/ui/38.png b/assets/ui/38.png new file mode 100644 index 0000000..1b71d24 Binary files /dev/null and b/assets/ui/38.png differ diff --git a/assets/ui/38.png.import b/assets/ui/38.png.import new file mode 100644 index 0000000..159b1a0 --- /dev/null +++ b/assets/ui/38.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://crmswytn4ulgk" +path="res://.godot/imported/38.png-f8bed482f70f9230a53d6aeebfabe38e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/38.png" +dest_files=["res://.godot/imported/38.png-f8bed482f70f9230a53d6aeebfabe38e.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/assets/ui/47.png b/assets/ui/47.png new file mode 100644 index 0000000..700c929 Binary files /dev/null and b/assets/ui/47.png differ diff --git a/assets/ui/47.png.import b/assets/ui/47.png.import new file mode 100644 index 0000000..99cbf11 --- /dev/null +++ b/assets/ui/47.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bwjjynjewaxt8" +path="res://.godot/imported/47.png-e8e2c355ac7856d1e8bbc8af6d69623d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/47.png" +dest_files=["res://.godot/imported/47.png-e8e2c355ac7856d1e8bbc8af6d69623d.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/assets/ui/48.png b/assets/ui/48.png new file mode 100644 index 0000000..6ed1086 Binary files /dev/null and b/assets/ui/48.png differ diff --git a/assets/ui/48.png.import b/assets/ui/48.png.import new file mode 100644 index 0000000..d2856d0 --- /dev/null +++ b/assets/ui/48.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bh1m4jokiqc0f" +path="res://.godot/imported/48.png-8b1ea5b883ab4f7ca2fd8fc6af87639f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/48.png" +dest_files=["res://.godot/imported/48.png-8b1ea5b883ab4f7ca2fd8fc6af87639f.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/assets/ui/51.png b/assets/ui/51.png new file mode 100644 index 0000000..91b15d0 Binary files /dev/null and b/assets/ui/51.png differ diff --git a/assets/ui/51.png.import b/assets/ui/51.png.import new file mode 100644 index 0000000..7162d91 --- /dev/null +++ b/assets/ui/51.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dmit17arnnwlj" +path="res://.godot/imported/51.png-af67245f0544274a6c60ff5ef0343823.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/51.png" +dest_files=["res://.godot/imported/51.png-af67245f0544274a6c60ff5ef0343823.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/scenes/auth/AuthScene.tscn b/scenes/auth/AuthScene.tscn new file mode 100644 index 0000000..e17b362 --- /dev/null +++ b/scenes/auth/AuthScene.tscn @@ -0,0 +1,209 @@ +[gd_scene load_steps=6 format=3 uid="uid://dl1ohomaanbth"] + +[ext_resource type="Script" uid="uid://bq76ikog47k8" path="res://scripts/ui/auth_ui.gd" id="1_uce43"] +[ext_resource type="Texture2D" uid="uid://cdasq4ydwp73d" path="res://scenes/auth/bg1.png" id="2_d1qp1"] +[ext_resource type="Texture2D" uid="uid://crmswytn4ulgk" path="res://assets/ui/38.png" id="3_m2uy0"] +[ext_resource type="Texture2D" uid="uid://sd28ri0okg8i" path="res://assets/ui/37.png" id="4_jd3mn"] + +[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_6c4wg"] + +[node name="AuthScene" type="CanvasLayer"] +script = ExtResource("1_uce43") + +[node name="Control" type="Control" parent="."] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Background" type="ColorRect" parent="Control"] +material = SubResource("CanvasItemMaterial_6c4wg") +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0.07284262, 0.072842635, 0.072842605, 1) + +[node name="TextureRect" type="TextureRect" parent="Control"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("2_d1qp1") +expand_mode = 1 + +[node name="Title" type="Label" parent="Control"] +layout_mode = 0 +offset_left = 392.0 +offset_top = 264.0 +offset_right = 550.0 +offset_bottom = 314.0 +theme_override_font_sizes/font_size = 36 +text = "Dungeon" + +[node name="Title2" type="Label" parent="Control"] +layout_mode = 0 +offset_left = 746.0 +offset_top = 274.0 +offset_right = 904.0 +offset_bottom = 324.0 +theme_override_font_sizes/font_size = 36 +text = "Divers" + +[node name="Login" type="Control" parent="Control"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Username" type="LineEdit" parent="Control/Login"] +layout_mode = 0 +offset_left = 659.0 +offset_top = 359.0 +offset_right = 748.0 +offset_bottom = 390.0 +theme_override_colors/font_color = Color(1, 1, 1, 1) +placeholder_text = "Username" +expand_to_text_length = true + +[node name="Password" type="LineEdit" parent="Control/Login"] +layout_mode = 0 +offset_left = 663.0 +offset_top = 414.0 +offset_right = 752.0 +offset_bottom = 445.0 +theme_override_colors/font_color = Color(1, 1, 1, 1) +placeholder_text = "Password" +expand_to_text_length = true +secret = true + +[node name="TextureButton" type="TextureButton" parent="Control/Login"] +layout_mode = 0 +offset_left = 541.0 +offset_top = 465.0 +offset_right = 730.0 +offset_bottom = 534.0 +texture_normal = ExtResource("3_m2uy0") +texture_pressed = ExtResource("4_jd3mn") + +[node name="Login" type="Label" parent="Control/Login/TextureButton"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -39.5 +offset_top = -22.5 +offset_right = 2.5 +offset_bottom = 0.5 +grow_horizontal = 2 +grow_vertical = 2 +scale = Vector2(1.8799988, 1.8799988) +theme_override_colors/font_color = Color(0, 0, 0, 1) +text = "Login" +horizontal_alignment = 1 + +[node name="LoginBtn" type="Button" parent="Control/Login"] +visible = false +layout_mode = 0 +offset_left = 617.0 +offset_top = 480.0 +offset_right = 667.0 +offset_bottom = 511.0 +text = "Login" + +[node name="RegisterBtn" type="Button" parent="Control/Login"] +layout_mode = 0 +offset_left = 661.0 +offset_top = 559.0 +offset_right = 733.0 +offset_bottom = 590.0 +text = "Register" + +[node name="Register" type="Control" parent="Control"] +visible = false +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="RegUsernameInput" type="LineEdit" parent="Control/Register"] +layout_mode = 0 +offset_left = 578.0 +offset_top = 269.0 +offset_right = 646.5625 +offset_bottom = 300.0 +placeholder_text = "Username" +expand_to_text_length = true + +[node name="CharNameInput" type="LineEdit" parent="Control/Register"] +layout_mode = 0 +offset_left = 558.0 +offset_top = 310.0 +offset_right = 694.0 +offset_bottom = 341.0 +placeholder_text = "Character Name" +expand_to_text_length = true + +[node name="RegEmailInput" type="LineEdit" parent="Control/Register"] +layout_mode = 0 +offset_left = 593.0 +offset_top = 355.0 +offset_right = 661.5625 +offset_bottom = 386.0 +placeholder_text = "Email" +expand_to_text_length = true + +[node name="RegPasswordInput" type="LineEdit" parent="Control/Register"] +layout_mode = 0 +offset_left = 585.0 +offset_top = 394.0 +offset_right = 653.5625 +offset_bottom = 425.0 +placeholder_text = "Password" +expand_to_text_length = true +secret = true + +[node name="RegConfirmPasswordInput" type="LineEdit" parent="Control/Register"] +layout_mode = 0 +offset_left = 549.0 +offset_top = 436.0 +offset_right = 700.0 +offset_bottom = 467.0 +placeholder_text = "Confirm Password" +expand_to_text_length = true +secret = true + +[node name="RegisterButton" type="Button" parent="Control/Register"] +layout_mode = 0 +offset_left = 547.0 +offset_top = 490.0 +offset_right = 619.0 +offset_bottom = 521.0 +text = "Register" + +[node name="BackBtn" type="Button" parent="Control/Register"] +layout_mode = 0 +offset_left = 644.0 +offset_top = 491.0 +offset_right = 689.0 +offset_bottom = 522.0 +text = "Back" + +[node name="StatusLabel" type="Label" parent="Control"] +layout_mode = 0 +offset_left = 604.0 +offset_top = 554.0 +offset_right = 644.0 +offset_bottom = 577.0 diff --git a/scenes/auth/AuthScene.tscn194108115634.tmp b/scenes/auth/AuthScene.tscn194108115634.tmp new file mode 100644 index 0000000..c52d4f9 --- /dev/null +++ b/scenes/auth/AuthScene.tscn194108115634.tmp @@ -0,0 +1,45 @@ +[gd_scene load_steps=3 format=3 uid="uid://dl1ohomaanbth"] + +[ext_resource type="Script" uid="uid://bq76ikog47k8" path="res://scripts/ui/auth_ui.gd" id="1_rgxl4"] +[ext_resource type="Texture2D" uid="uid://d2cd3lbrncg5a" path="res://scenes/auth/test.png" id="1_uce43"] + +[node name="AuthScene" type="CanvasLayer"] +script = ExtResource("1_rgxl4") + +[node name="ColorRect" type="ColorRect" parent="."] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0, 0, 0, 1) + +[node name="Test" type="Sprite2D" parent="."] +position = Vector2(667, 193) +texture = ExtResource("1_uce43") + +[node name="Username" type="LineEdit" parent="."] +offset_left = 538.0 +offset_top = 407.0 +offset_right = 738.0 +offset_bottom = 438.0 +text = "username" + +[node name="Password" type="LineEdit" parent="."] +offset_left = 538.0 +offset_top = 448.0 +offset_right = 738.0 +offset_bottom = 479.0 +text = "password" +secret = true + +[node name="submit" type="Button" parent="."] +offset_left = 621.0 +offset_top = 530.0 +offset_right = 684.0 +offset_bottom = 561.0 +text = "Submit" + +[node name="StatusLabel" type="Label" parent="."] +offset_right = 40.0 +offset_bottom = 23.0 diff --git a/scenes/auth/AuthScene.tscn194115780509.tmp b/scenes/auth/AuthScene.tscn194115780509.tmp new file mode 100644 index 0000000..c52d4f9 --- /dev/null +++ b/scenes/auth/AuthScene.tscn194115780509.tmp @@ -0,0 +1,45 @@ +[gd_scene load_steps=3 format=3 uid="uid://dl1ohomaanbth"] + +[ext_resource type="Script" uid="uid://bq76ikog47k8" path="res://scripts/ui/auth_ui.gd" id="1_rgxl4"] +[ext_resource type="Texture2D" uid="uid://d2cd3lbrncg5a" path="res://scenes/auth/test.png" id="1_uce43"] + +[node name="AuthScene" type="CanvasLayer"] +script = ExtResource("1_rgxl4") + +[node name="ColorRect" type="ColorRect" parent="."] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +color = Color(0, 0, 0, 1) + +[node name="Test" type="Sprite2D" parent="."] +position = Vector2(667, 193) +texture = ExtResource("1_uce43") + +[node name="Username" type="LineEdit" parent="."] +offset_left = 538.0 +offset_top = 407.0 +offset_right = 738.0 +offset_bottom = 438.0 +text = "username" + +[node name="Password" type="LineEdit" parent="."] +offset_left = 538.0 +offset_top = 448.0 +offset_right = 738.0 +offset_bottom = 479.0 +text = "password" +secret = true + +[node name="submit" type="Button" parent="."] +offset_left = 621.0 +offset_top = 530.0 +offset_right = 684.0 +offset_bottom = 561.0 +text = "Submit" + +[node name="StatusLabel" type="Label" parent="."] +offset_right = 40.0 +offset_bottom = 23.0 diff --git a/scenes/auth/bg1.png b/scenes/auth/bg1.png new file mode 100644 index 0000000..90e676b Binary files /dev/null and b/scenes/auth/bg1.png differ diff --git a/scenes/auth/bg1.png.import b/scenes/auth/bg1.png.import new file mode 100644 index 0000000..23941ef --- /dev/null +++ b/scenes/auth/bg1.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cdasq4ydwp73d" +path="res://.godot/imported/bg1.png-b0daa0a7b41f089a5649e1a0dddea136.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://scenes/auth/bg1.png" +dest_files=["res://.godot/imported/bg1.png-b0daa0a7b41f089a5649e1a0dddea136.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +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/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +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 diff --git a/scenes/dungeon/dungeon.tscn b/scenes/dungeon/dungeon.tscn index 042b195..94833a0 100644 --- a/scenes/dungeon/dungeon.tscn +++ b/scenes/dungeon/dungeon.tscn @@ -32,9 +32,7 @@ tile_set = ExtResource("2_frwky") [node name="Hud" parent="." instance=ExtResource("2_4f38h")] [node name="Inventory" parent="." instance=ExtResource("5_0fky6")] -visible = false [node name="Chat" parent="." instance=ExtResource("3_frwky")] -visible = false [node name="Camera2D" type="Camera2D" parent="."] diff --git a/scenes/hub/hub_screen.tscn b/scenes/hub/hub_screen.tscn index 0c8e849..8875e65 100644 --- a/scenes/hub/hub_screen.tscn +++ b/scenes/hub/hub_screen.tscn @@ -4,7 +4,7 @@ [ext_resource type="PackedScene" uid="uid://ctsfevsx6nnv2" path="res://scenes/hub/dungeon_browser.tscn" id="2_browser"] [ext_resource type="PackedScene" uid="uid://bwlmaoeg3gbrn" path="res://scenes/ui/inventory.tscn" id="3_inventory"] [ext_resource type="PackedScene" uid="uid://hsrxtbww60u" path="res://scenes/ui/crafting_ui.tscn" id="4_crafting"] -[ext_resource type="PackedScene" uid="uid://stash_panel_001" path="res://scenes/ui/stash.tscn" id="5_stash"] +[ext_resource type="PackedScene" path="res://scenes/ui/stash.tscn" id="5_stash"] [node name="HubScreen" type="CanvasLayer"] script = ExtResource("1_u7qci") diff --git a/scenes/main/main.tscn b/scenes/main/main.tscn index 6edf34f..8ffd25a 100644 --- a/scenes/main/main.tscn +++ b/scenes/main/main.tscn @@ -1,15 +1,15 @@ [gd_scene load_steps=6 format=3 uid="uid://cug0ub6ft1ka"] [ext_resource type="Script" uid="uid://dxdsmo8kp5ppi" path="res://scripts/ui/main.gd" id="1_hyk8p"] -[ext_resource type="PackedScene" uid="uid://bs15j065xsd8j" path="res://scenes/auth/auth_screen.tscn" id="2_auth"] +[ext_resource type="PackedScene" uid="uid://dl1ohomaanbth" path="res://scenes/auth/AuthScene.tscn" id="2_6q06x"] [ext_resource type="PackedScene" uid="uid://linskq5jx4uh" path="res://scenes/hub/hub_screen.tscn" id="3_hub"] [ext_resource type="PackedScene" uid="uid://cldp1w744fs2l" path="res://scenes/dungeon/dungeon.tscn" id="4_dungeon"] -[ext_resource type="PackedScene" path="res://scenes/ui/death_screen.tscn" id="5_death"] +[ext_resource type="PackedScene" uid="uid://cbpaygd2cw45c" path="res://scenes/ui/death_screen.tscn" id="5_death"] [node name="Main" type="Node"] script = ExtResource("1_hyk8p") -[node name="AuthScreen" parent="." instance=ExtResource("2_auth")] +[node name="AuthScreen" parent="." instance=ExtResource("2_6q06x")] [node name="HubScreen" parent="." instance=ExtResource("3_hub")] visible = false diff --git a/scenes/ui/chat.tscn b/scenes/ui/chat.tscn index a734fe2..c8e8cf9 100644 --- a/scenes/ui/chat.tscn +++ b/scenes/ui/chat.tscn @@ -3,6 +3,7 @@ [ext_resource type="Script" uid="uid://bknoefdelbqoo" path="res://scripts/ui/chat_ui.gd" id="1_6bdm3"] [node name="Chat" type="CanvasLayer"] +visible = false script = ExtResource("1_6bdm3") [node name="Control" type="Control" parent="."] diff --git a/scenes/ui/death_screen.tscn b/scenes/ui/death_screen.tscn index 15e17c0..13d97a3 100644 --- a/scenes/ui/death_screen.tscn +++ b/scenes/ui/death_screen.tscn @@ -4,6 +4,7 @@ [node name="DeathScreen" type="CanvasLayer"] layer = 20 +visible = false script = ExtResource("1_death") [node name="ColorRect" type="ColorRect" parent="."] diff --git a/scripts/dungeon/mob_visual.gd b/scripts/dungeon/mob_visual.gd index 71ee7d6..2846c71 100644 --- a/scripts/dungeon/mob_visual.gd +++ b/scripts/dungeon/mob_visual.gd @@ -21,6 +21,26 @@ var _last_animation: String = "" # Track animation to avoid spam var _current_state: String = "idle" var _facing_direction: String = "down" # down, up, left, right, front, back +#Temporary state translation: +const STATE_TO_ANIMATION := { + "idle": "idle", + "walking": "walk", + "chasing": "walk", + "returning": "walk", + "fleeing": "walk", + "kiting": "walk", + + "attacking": "attack", + "casting": "cast", + "summoning": "cast", + + "healing": "heal", + + "damaged": "hurt", + + "dead": "dead" +} + func _ready(): # Try to find child nodes (they may not exist in all mob scenes) fallback_sprite = get_node_or_null("Sprite2D") @@ -55,6 +75,10 @@ func _ready(): if UpdateManager: UpdateManager.file_downloaded.connect(_on_file_downloaded) +func _state_to_animation(state: String) -> String: + state = state.to_lower() + return STATE_TO_ANIMATION.get(state, "idle") + func update_data(data: Dictionary): mob_data = data @@ -91,9 +115,17 @@ func update_data(data: Dictionary): _initialized = true # Update visual state - var state = data.get("state", data.get("State", "idle")).to_lower() + #var state = data.get("state", data.get("State", "idle")).to_lower() + #var rotation = data.get("rotation", data.get("Rotation", 0.0)) + # + #_update_animation_state(state, rotation) + + var raw_state = data.get("state", data.get("State", "idle")).to_lower() + var animation_state := _state_to_animation(raw_state) var rotation = data.get("rotation", data.get("Rotation", 0.0)) - _update_animation_state(state, rotation) + + _update_animation_state(animation_state, rotation) + # Apply scale var mob_scale = data.get("scale", data.get("Scale", 1.0)) @@ -368,11 +400,11 @@ func _rotation_to_direction(rotation: float) -> String: if angle < PI * 0.25 or angle >= PI * 1.75: return "right" elif angle < PI * 0.75: - return "front" + return "down" elif angle < PI * 1.25: return "left" else: - return "back" + return "up" func _play_animation(state: String, direction: String): if not _animated_sprite or not _animated_sprite.sprite_frames: @@ -387,7 +419,12 @@ func _play_animation(state: String, direction: String): state, "idle_%s" % direction, "idle_%s" % _alt_direction(direction), - "idle" + "idle", + "walk_%s", + "run_%s", + "hurt_%s", + "death_%s", + "attack_%s" ] # Get flip info from sprite config (new format) diff --git a/scripts/dungeon/visual_tilemap_renderer.gd b/scripts/dungeon/visual_tilemap_renderer.gd index a073e9b..e0ebc54 100644 --- a/scripts/dungeon/visual_tilemap_renderer.gd +++ b/scripts/dungeon/visual_tilemap_renderer.gd @@ -149,7 +149,7 @@ func _render_tiles(tiles: Array) -> void: print("[VisualTileMap] Sheet textures keys: %s" % _sheet_textures.keys()) print("[VisualTileMap] Sheet info keys: %s" % _sheet_info.keys()) first_logged = true - + print("[VisualTileMap] other tiles: %s" % tile_data) if _render_tile(tile_data): rendered += 1 else: @@ -161,7 +161,7 @@ func _render_tiles(tiles: Array) -> void: func _render_tile(tile_data: Dictionary) -> bool: var x = int(tile_data.get("x", 0)) var y = int(tile_data.get("y", 0)) - var tile_def_id = int(tile_data.get("tid", 0)) + #var tile_def_id = int(tile_data.get("tid", 0)) var layer = int(tile_data.get("l", 0)) var rotation = int(tile_data.get("r", 0)) var flip_x = tile_data.get("fx", false) diff --git a/scripts/ui/auth_ui.gd b/scripts/ui/auth_ui.gd index 1980152..3f3a29e 100644 --- a/scripts/ui/auth_ui.gd +++ b/scripts/ui/auth_ui.gd @@ -1,21 +1,27 @@ extends CanvasLayer -@onready var username_input = $Control/CenterContainer/VBoxContainer/TabContainer/Login/UsernameInput -@onready var password_input = $Control/CenterContainer/VBoxContainer/TabContainer/Login/PasswordInput -@onready var login_button = $Control/CenterContainer/VBoxContainer/TabContainer/Login/LoginButton +@onready var login_control = $Control/Login +@onready var username_input = $Control/Login/Username #$Control/CenterContainer/VBoxContainer/TabContainer/Login/UsernameInput +@onready var password_input = $Control/Login/Password #$Control/CenterContainer/VBoxContainer/TabContainer/Login/PasswordInput +@onready var login_button = $Control/Login/TextureButton#$Control/Login/LoginBtn #$Control/CenterContainer/VBoxContainer/TabContainer/Login/LoginButton +@onready var register_btn = $Control/Login/RegisterBtn -@onready var reg_username = $Control/CenterContainer/VBoxContainer/TabContainer/Register/RegUsernameInput -@onready var reg_email = $Control/CenterContainer/VBoxContainer/TabContainer/Register/RegEmailInput -@onready var reg_password = $Control/CenterContainer/VBoxContainer/TabContainer/Register/RegPasswordInput -@onready var reg_passwordConfirm = $Control/CenterContainer/VBoxContainer/TabContainer/Register/RegConfirmPasswordInput -@onready var char_name = $Control/CenterContainer/VBoxContainer/TabContainer/Register/CharNameInput -@onready var register_button = $Control/CenterContainer/VBoxContainer/TabContainer/Register/RegisterButton +@onready var register_control = $Control/Register +@onready var reg_username = $Control/Register/RegUsernameInput #$Control/CenterContainer/VBoxContainer/TabContainer/Register/RegUsernameInput +@onready var reg_email = $Control/Register/RegEmailInput #$Control/CenterContainer/VBoxContainer/TabContainer/Register/RegEmailInput +@onready var reg_password = $Control/Register/RegPasswordInput #$Control/CenterContainer/VBoxContainer/TabContainer/Register/RegPasswordInput +@onready var reg_passwordConfirm = $Control/Register/RegConfirmPasswordInput #$Control/CenterContainer/VBoxContainer/TabContainer/Register/RegConfirmPasswordInput +@onready var char_name = $Control/Register/CharNameInput #$Control/CenterContainer/VBoxContainer/TabContainer/Register/CharNameInput +@onready var register_button = $Control/Register/RegisterButton #$Control/CenterContainer/VBoxContainer/TabContainer/Register/RegisterButton +@onready var back_btn = $Control/Register/BackBtn -@onready var status_label = $Control/CenterContainer/VBoxContainer/StatusLabel +@onready var status_label = $Control/StatusLabel#$Control/CenterContainer/VBoxContainer/StatusLabel func _ready(): login_button.pressed.connect(_on_login_pressed) register_button.pressed.connect(_on_register_pressed) + register_btn.pressed.connect(_on_register_btn_pressed) + back_btn.pressed.connect(_on_back_btn_pressed) # Defer network signal connections call_deferred("_connect_network_signals") @@ -86,6 +92,16 @@ func _on_register_pressed(): #"characterName": char_name_text }) +func _on_register_btn_pressed(): + login_control.visible = false + register_control.visible = true + #Maybe change BG here + +func _on_back_btn_pressed(): + register_control.visible = false + login_control.visible = true + #Maybe Change BG here + func _on_connected(): _set_status("Connected!", Color.GREEN) @@ -93,13 +109,26 @@ func _on_disconnected(): _set_status("Disconnected from server", Color.RED) func _on_message(opcode: int, data: Dictionary): - if opcode == OpCodes.AUTH_LOGIN_RESULT or opcode == OpCodes.AUTH_REGISTER_RESULT: + if opcode == OpCodes.AUTH_LOGIN_RESULT: var ok = data.get("Ok", data.get("ok", false)) if ok: _set_status("Logged in!", Color.GREEN) else: var error = data.get("Error", data.get("error", "Unknown error")) _set_status("Failed: " + error, Color.RED) + if opcode == OpCodes.AUTH_REGISTER_RESULT: + var ok = data.get("Ok", data.get("ok", false)) + if ok: + _set_status("Logging in!", Color.GREEN) + var user = reg_username.text.strip_edges() + var pass_text = reg_password.text + Network.send_message(OpCodes.AUTH_LOGIN, { + "UsernameOrEmail": user, + "Password": pass_text + }) + else: + var error = data.get("Error", data.get("error", "Unknown error")) + _set_status("Failed: " + error, Color.RED) func _set_status(text: String, color: Color = Color.WHITE): status_label.text = text