diff --git a/addons/touch_screen_joystick/LICENSE.md b/addons/touch_screen_joystick/LICENSE.md new file mode 100644 index 0000000..cccc2fe --- /dev/null +++ b/addons/touch_screen_joystick/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) Kent Coyoca + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/addons/touch_screen_joystick/asset_icon.png b/addons/touch_screen_joystick/asset_icon.png new file mode 100644 index 0000000..31dbc55 Binary files /dev/null and b/addons/touch_screen_joystick/asset_icon.png differ diff --git a/addons/touch_screen_joystick/asset_icon.png.import b/addons/touch_screen_joystick/asset_icon.png.import new file mode 100644 index 0000000..9e43d36 --- /dev/null +++ b/addons/touch_screen_joystick/asset_icon.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://d0bpve8gcb12h" +path="res://.godot/imported/asset_icon.png-ce41ad0f41a3bd9fb8beaf5e77b0331e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/touch_screen_joystick/asset_icon.png" +dest_files=["res://.godot/imported/asset_icon.png-ce41ad0f41a3bd9fb8beaf5e77b0331e.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/addons/touch_screen_joystick/icon.png b/addons/touch_screen_joystick/icon.png new file mode 100644 index 0000000..5806e43 Binary files /dev/null and b/addons/touch_screen_joystick/icon.png differ diff --git a/addons/touch_screen_joystick/icon.png.import b/addons/touch_screen_joystick/icon.png.import new file mode 100644 index 0000000..c9b8474 --- /dev/null +++ b/addons/touch_screen_joystick/icon.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://hanm20q34nm7" +path="res://.godot/imported/icon.png-9855c8f44a6b30349331b2a290379bbb.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/touch_screen_joystick/icon.png" +dest_files=["res://.godot/imported/icon.png-9855c8f44a6b30349331b2a290379bbb.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/addons/touch_screen_joystick/mouseBall.png b/addons/touch_screen_joystick/mouseBall.png new file mode 100644 index 0000000..1885970 Binary files /dev/null and b/addons/touch_screen_joystick/mouseBall.png differ diff --git a/addons/touch_screen_joystick/mouseBall.png.import b/addons/touch_screen_joystick/mouseBall.png.import new file mode 100644 index 0000000..55602ff --- /dev/null +++ b/addons/touch_screen_joystick/mouseBall.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dhmh5yumt6ay5" +path="res://.godot/imported/mouseBall.png-069eb6b6e0a1f51225aac4ae605d865d.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/touch_screen_joystick/mouseBall.png" +dest_files=["res://.godot/imported/mouseBall.png-069eb6b6e0a1f51225aac4ae605d865d.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/addons/touch_screen_joystick/mouseRing.png b/addons/touch_screen_joystick/mouseRing.png new file mode 100644 index 0000000..fd82d45 Binary files /dev/null and b/addons/touch_screen_joystick/mouseRing.png differ diff --git a/addons/touch_screen_joystick/mouseRing.png.import b/addons/touch_screen_joystick/mouseRing.png.import new file mode 100644 index 0000000..97a0c4e --- /dev/null +++ b/addons/touch_screen_joystick/mouseRing.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://7o1jec4i8enj" +path="res://.godot/imported/mouseRing.png-85719f77fe994662e3e56da27430bfd4.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://addons/touch_screen_joystick/mouseRing.png" +dest_files=["res://.godot/imported/mouseRing.png-85719f77fe994662e3e56da27430bfd4.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/addons/touch_screen_joystick/touch_screen_joystick.gd b/addons/touch_screen_joystick/touch_screen_joystick.gd new file mode 100644 index 0000000..fc57e6d --- /dev/null +++ b/addons/touch_screen_joystick/touch_screen_joystick.gd @@ -0,0 +1,310 @@ +## Responsive joystick control tool for your +## Godot mobile games. It triggers input actions +## base on your touch and drag inputs. + +@tool +@icon("res://addons/touch_screen_joystick/icon.png") +extends Control +class_name TouchScreenJoystick + +## Enable Anti-aliasing for drawing +@export var antialiased : bool = false : + set(b): + antialiased = b + queue_redraw() + +## Deadzone size +@export_range(0, 9999, 0.1, "hide_slider") +var deadzone : float= 25.0 : + set(n): + deadzone = n + queue_redraw() + +## Radius for drawing the base +## and for max distance of knob from the center +@export_range(0, 9999, 0.1, "hide_slider") +var base_radius : float = 120.0 : + set(value): + base_radius = value + queue_redraw() +## Radius for drawing the knob +@export_range(0, 9999, 0.1, "hide_slider") +var knob_radius : float = 45.0 : + set(value): + knob_radius = value + queue_redraw() + + + +@export_group("Texture Joystick") +## Enable joystick textures +@export var use_textures : bool = false : + set(value): + use_textures = value + queue_redraw() + +@export_subgroup("Base") +## Texture for base drawing +@export var base_texture : Texture2D : + set(value): + base_texture = value + queue_redraw() +## Texture scale for base +@export var base_scale : Vector2 = Vector2.ONE : + set(value): + base_scale = value + queue_redraw() + +@export_subgroup("Knob") +## Texture for knob drawing +@export var knob_texture : Texture2D : + set(value): + knob_texture = value + queue_redraw() +## Texture scale for knob +@export var knob_scale : Vector2 = Vector2.ONE : + set(value): + knob_scale = value + queue_redraw() + +@export_group("Style") +## Main color +@export var color : Color = Color.WHITE : + set(value): + color = value + queue_redraw() +## Background color +@export var back_color : Color = Color(Color.BLACK, 0.5): + set(value): + back_color = value + queue_redraw() +## Base thickness +@export_range(0, 999, 0.1, "hide_slider") +var thickness := 3.0 : + set(value): + thickness = value + queue_redraw() + +@export_group("Input Actions") +## Enable input actions +@export var use_input_actions : bool +## Action for left direction (-X) +@export var action_left : StringName = "move_left" +## Action for right direction (+X) +@export var action_right : StringName = "move_right" +## Action for up direction (-Y) +@export var action_up : StringName = "move_up" +## Action for down direction (+Y) +@export var action_down : StringName = "move_down" + +@export_group("Debug") +## Enable debug draws +@export var show_debug : bool : + set(value): + show_debug = value + queue_redraw() + +## Deadzone color for debugging +@export var deadzone_debug_color : Color = Color.RED : + set(value): + deadzone_debug_color = value + queue_redraw() +## Base color for debugging +@export var base_debug_color : Color = Color.GREEN : + set(value): + base_debug_color = value + queue_redraw() + +## Emitted when the joystick is being pressed +signal on_press +## Emitted when the joystick is being released +signal on_release +## Emitted when the joystick is being dragged +signal on_drag(factor : float) + +## Property for knob draw position +var knob_position : Vector2 +## Property for press input +var is_pressing : bool +## Property for index of the input event +## that is currently touching the joystick +var event_index : int = -1 + +func _draw() -> void: + if not is_pressing : reset_knob() + + if not use_textures: + draw_default_joystick() + else: + draw_texture_joystick() + + if show_debug : draw_debug() + +## Draws the joystick +func draw_default_joystick() -> void: + # Base + draw_circle(size / 2.0, base_radius, back_color) + draw_circle(size / 2.0, base_radius, color, false, thickness, antialiased) + + # Knob + draw_circle(knob_position, knob_radius, color, true, -1.0, antialiased) + +## Draws the textured joystick instead of the default one +func draw_texture_joystick() -> void: + # Base + if base_texture: + var base_size := base_texture.get_size() * base_scale + draw_texture_rect(base_texture, Rect2(size / 2.0 - (base_size / 2.0), base_size), false) + + + # Knob + if knob_texture: + var knob_size := knob_texture.get_size() * knob_scale + draw_texture_rect(knob_texture, Rect2(knob_position - (knob_size / 2.0), knob_size), false) + +## Draws radius of base and deadzone size +func draw_debug() -> void: + draw_circle(size / 2.0, deadzone, deadzone_debug_color, false, 5.0) + draw_circle(size / 2.0, base_radius, base_debug_color, false, 5.0) + +func _input(event: InputEvent) -> void: + + if event is InputEventScreenTouch: + on_screen_touch(event) + + elif event is InputEventScreenDrag: + on_screen_drag(event) + +## Called when the joystick is touched +func on_screen_touch(event : InputEventScreenTouch) -> void: + var has_point := get_global_rect().has_point(event.position) + + if event.pressed and event_index == -1 and has_point: + event_index = event.index + touch_knob(event.position, event.index) + else: + release_knob(event.index) + + + +## Called when the joystick is pressed and +## moves the knob to the current touch position +func touch_knob(pos : Vector2, index : int) -> void: + if index == event_index: + move_knob(pos) + is_pressing = true + on_press.emit() + get_viewport().set_input_as_handled() + +## Called when the joystick is released +## and resets then input actions +func release_knob(index : int) -> void: + if index == event_index: + reset_actions() + reset_knob() + event_index = -1 + is_pressing = false + on_release.emit() + get_viewport().set_input_as_handled() + +## Called when the joystick is dragged +func on_screen_drag(event : InputEventScreenDrag) -> void: + var center := size / 2.0 + var dist := center.distance_to(knob_position) + + if event.index == event_index and is_pressing: + move_knob(event.position) + get_viewport().set_input_as_handled() + on_drag.emit(get_factor()) + + +## Moves the knob position relative to the current touch position +func move_knob(event_pos : Vector2) -> void: + var center := size / 2.0 + var touch_pos := (event_pos - global_position) / scale + var distance := touch_pos.distance_to(center) + var angle := center.angle_to_point(touch_pos) + + if distance < base_radius: + knob_position = touch_pos + else: + knob_position.x = center.x + cos(angle) * base_radius + knob_position.y = center.y + sin(angle) * base_radius + + if distance > deadzone: + trigger_actions() + else: + reset_actions() + + queue_redraw() + +## Triggers all the left, right, up, and down actions +## based on the direction of the knob +func trigger_actions() -> void: + if not use_input_actions: return + + var direction := get_direction().normalized() + + if direction.x < 0.0: + Input.action_release(action_right) + Input.action_press(action_left, -direction.x) + elif direction.x > 0.0: + Input.action_release(action_left) + Input.action_press(action_right, direction.x) + + if direction.y < 0.0: + Input.action_release(action_down) + Input.action_press(action_up, -direction.y) + elif direction.y > 0.0: + Input.action_release(action_up) + Input.action_press(action_down, direction.y) + + +## Resets all the input actions +func reset_actions() -> void: + Input.action_release(action_left) + Input.action_release(action_right) + Input.action_release(action_up) + Input.action_release(action_down) + + +## Returns a direction vector from the center of +## the joystick to the knob position +func get_direction() -> Vector2: + var center := size / 2.0 + var direction := center.direction_to(knob_position) + return direction + +## Returns the distance between the center +## to the knob position +func get_distance() -> float: + var center := size / 2.0 + var distance := center.distance_to(knob_position) + + return distance + +## Returns the angle in radians between the +## center position to the knob position +func get_angle() -> float: + var center := size / 2.0 + var angle := center.angle_to_point(knob_position) + return angle + +## Returns a value from 0 to 1 based how far the +## knob position is from the center +func get_factor() -> float: + var center := size / 2.0 + var distance := center.distance_to(knob_position) + return distance / base_radius + +## Returns true if the center to knob distance +## is greater than the deadzone size +func is_in_deadzone() -> bool: + var center := size / 2.0 + var distance := center.distance_to(knob_position) + return distance < deadzone + +## Resets the knob position the center +func reset_knob() -> void: + knob_position = size / 2.0 + queue_redraw() diff --git a/addons/touch_screen_joystick/touch_screen_joystick.gd.uid b/addons/touch_screen_joystick/touch_screen_joystick.gd.uid new file mode 100644 index 0000000..90767c1 --- /dev/null +++ b/addons/touch_screen_joystick/touch_screen_joystick.gd.uid @@ -0,0 +1 @@ +uid://ds8okf626rxye diff --git a/assets/ui/TextFrame.png b/assets/ui/TextFrame.png new file mode 100644 index 0000000..12bf71b Binary files /dev/null and b/assets/ui/TextFrame.png differ diff --git a/assets/ui/TextFrame.png.import b/assets/ui/TextFrame.png.import new file mode 100644 index 0000000..ac0a0c4 --- /dev/null +++ b/assets/ui/TextFrame.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://coefkwhawwkt8" +path="res://.godot/imported/TextFrame.png-a359cf19d3aa44b6ec4c6647fd54a40a.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/TextFrame.png" +dest_files=["res://.godot/imported/TextFrame.png-a359cf19d3aa44b6ec4c6647fd54a40a.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/bg1.png b/assets/ui/bg1.png similarity index 100% rename from scenes/auth/bg1.png rename to assets/ui/bg1.png diff --git a/scenes/auth/bg1.png.import b/assets/ui/bg1.png.import similarity index 78% rename from scenes/auth/bg1.png.import rename to assets/ui/bg1.png.import index 23941ef..bc8bbf0 100644 --- a/scenes/auth/bg1.png.import +++ b/assets/ui/bg1.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cdasq4ydwp73d" -path="res://.godot/imported/bg1.png-b0daa0a7b41f089a5649e1a0dddea136.ctex" +path="res://.godot/imported/bg1.png-3986640c29069ccadb300679988658c3.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://scenes/auth/bg1.png" -dest_files=["res://.godot/imported/bg1.png-b0daa0a7b41f089a5649e1a0dddea136.ctex"] +source_file="res://assets/ui/bg1.png" +dest_files=["res://.godot/imported/bg1.png-3986640c29069ccadb300679988658c3.ctex"] [params] diff --git a/assets/ui/border.png b/assets/ui/border.png new file mode 100644 index 0000000..a39d7f1 Binary files /dev/null and b/assets/ui/border.png differ diff --git a/assets/ui/border.png.import b/assets/ui/border.png.import new file mode 100644 index 0000000..d02ad83 --- /dev/null +++ b/assets/ui/border.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c5mayhik483jx" +path="res://.godot/imported/border.png-c7d17796590d77faba430ac1bb389de0.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/border.png" +dest_files=["res://.godot/imported/border.png-c7d17796590d77faba430ac1bb389de0.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/displayint.png b/assets/ui/displayint.png new file mode 100644 index 0000000..042856e Binary files /dev/null and b/assets/ui/displayint.png differ diff --git a/assets/ui/displayint.png.import b/assets/ui/displayint.png.import new file mode 100644 index 0000000..d8c48e0 --- /dev/null +++ b/assets/ui/displayint.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://obf6n8b324k7" +path="res://.godot/imported/displayint.png-1e70a2896f9b4acaf59785a9a459f2ab.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/displayint.png" +dest_files=["res://.godot/imported/displayint.png-1e70a2896f9b4acaf59785a9a459f2ab.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/exit.png b/assets/ui/exit.png new file mode 100644 index 0000000..c164cc3 Binary files /dev/null and b/assets/ui/exit.png differ diff --git a/assets/ui/exit.png.import b/assets/ui/exit.png.import new file mode 100644 index 0000000..edb94e8 --- /dev/null +++ b/assets/ui/exit.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dfuidw8kbikv5" +path="res://.godot/imported/exit.png-dabbf75caa2695889168f8207395e7bf.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/exit.png" +dest_files=["res://.godot/imported/exit.png-dabbf75caa2695889168f8207395e7bf.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/inventory.png b/assets/ui/inventory.png new file mode 100644 index 0000000..cbaabb8 Binary files /dev/null and b/assets/ui/inventory.png differ diff --git a/assets/ui/inventory.png.import b/assets/ui/inventory.png.import new file mode 100644 index 0000000..b2c97f1 --- /dev/null +++ b/assets/ui/inventory.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bniu06cdeknuj" +path="res://.godot/imported/inventory.png-e34a73a2bea549dae84b5a286c695085.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/inventory.png" +dest_files=["res://.godot/imported/inventory.png-e34a73a2bea549dae84b5a286c695085.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/plusBtn.png b/assets/ui/plusBtn.png new file mode 100644 index 0000000..a1cde58 Binary files /dev/null and b/assets/ui/plusBtn.png differ diff --git a/assets/ui/plusBtn.png.import b/assets/ui/plusBtn.png.import new file mode 100644 index 0000000..4516dfb --- /dev/null +++ b/assets/ui/plusBtn.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://bs0xtpelj7ka4" +path="res://.godot/imported/plusBtn.png-739aae340c5986e0c49734cf6e27a134.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/plusBtn.png" +dest_files=["res://.godot/imported/plusBtn.png-739aae340c5986e0c49734cf6e27a134.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/plusBtnDown.png b/assets/ui/plusBtnDown.png new file mode 100644 index 0000000..b233c20 Binary files /dev/null and b/assets/ui/plusBtnDown.png differ diff --git a/assets/ui/plusBtnDown.png.import b/assets/ui/plusBtnDown.png.import new file mode 100644 index 0000000..e367c33 --- /dev/null +++ b/assets/ui/plusBtnDown.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cweri4tanbppf" +path="res://.godot/imported/plusBtnDown.png-3de08561b39c7418f66ef2844c60ed1f.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/plusBtnDown.png" +dest_files=["res://.godot/imported/plusBtnDown.png-3de08561b39c7418f66ef2844c60ed1f.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/settings.png b/assets/ui/settings.png new file mode 100644 index 0000000..18e9302 Binary files /dev/null and b/assets/ui/settings.png differ diff --git a/assets/ui/settings.png.import b/assets/ui/settings.png.import new file mode 100644 index 0000000..872b273 --- /dev/null +++ b/assets/ui/settings.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c85g5ilsqpryf" +path="res://.godot/imported/settings.png-435f898c4db449a7f67af74c7b04347e.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/settings.png" +dest_files=["res://.godot/imported/settings.png-435f898c4db449a7f67af74c7b04347e.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/sheet.png b/assets/ui/sheet.png new file mode 100644 index 0000000..b9c0356 Binary files /dev/null and b/assets/ui/sheet.png differ diff --git a/assets/ui/sheet.png.import b/assets/ui/sheet.png.import new file mode 100644 index 0000000..c182ee9 --- /dev/null +++ b/assets/ui/sheet.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://ds0ugfvjt1ate" +path="res://.godot/imported/sheet.png-edcbb200acbd4bedbe9b320c8c4e6fd7.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/sheet.png" +dest_files=["res://.godot/imported/sheet.png-edcbb200acbd4bedbe9b320c8c4e6fd7.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/xpBarBorder.png b/assets/ui/xpBarBorder.png new file mode 100644 index 0000000..7275865 Binary files /dev/null and b/assets/ui/xpBarBorder.png differ diff --git a/assets/ui/xpBarBorder.png.import b/assets/ui/xpBarBorder.png.import new file mode 100644 index 0000000..ca07764 --- /dev/null +++ b/assets/ui/xpBarBorder.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dt0uqrxoh4kdj" +path="res://.godot/imported/xpBarBorder.png-966836f9ea47b4ea4239f80814e387f6.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/xpBarBorder.png" +dest_files=["res://.godot/imported/xpBarBorder.png-966836f9ea47b4ea4239f80814e387f6.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/xpprogress.png b/assets/ui/xpprogress.png new file mode 100644 index 0000000..f7f32f7 Binary files /dev/null and b/assets/ui/xpprogress.png differ diff --git a/assets/ui/xpprogress.png.import b/assets/ui/xpprogress.png.import new file mode 100644 index 0000000..866afda --- /dev/null +++ b/assets/ui/xpprogress.png.import @@ -0,0 +1,40 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://dxmbu484e2jyr" +path="res://.godot/imported/xpprogress.png-f283614a8e3291d44941c91c573a8e1c.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/ui/xpprogress.png" +dest_files=["res://.godot/imported/xpprogress.png-f283614a8e3291d44941c91c573a8e1c.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/project.godot b/project.godot index 1ec0334..5ab72a0 100644 --- a/project.godot +++ b/project.godot @@ -28,6 +28,7 @@ DragManager="*res://scripts/autoload/drag_manager.gd" window/size/viewport_width=1280 window/size/viewport_height=768 +window/size/borderless=true window/stretch/mode="canvas_items" [input] @@ -137,6 +138,16 @@ beltbar_4={ "events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":true,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":52,"key_label":0,"unicode":0,"location":0,"echo":false,"script":null) ] } +charSheet={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":67,"key_label":0,"unicode":99,"location":0,"echo":false,"script":null) +] +} +stash={ +"deadzone": 0.2, +"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":false,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":70,"key_label":0,"unicode":102,"location":0,"echo":false,"script":null) +] +} [rendering] diff --git a/scenes/auth/AuthScene.tscn b/scenes/auth/AuthScene.tscn index 7673c84..aa7a524 100644 --- a/scenes/auth/AuthScene.tscn +++ b/scenes/auth/AuthScene.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=18 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://cdasq4ydwp73d" path="res://assets/ui/bg1.png" id="2_d1qp1"] [ext_resource type="Texture2D" uid="uid://i8ew8xhb8wlt" path="res://assets/ui/4.png" id="3_6c4wg"] [ext_resource type="Texture2D" uid="uid://cbbd5opwb6ahf" path="res://assets/ui/bottomBorder.png" id="3_ppeww"] [ext_resource type="FontFile" uid="uid://bckbv8viuh6lm" path="res://assets/fonts/Berry Rotunda.ttf" id="4_ppeww"] @@ -226,6 +226,8 @@ offset_right = 122.0 offset_bottom = -217.0 grow_horizontal = 2 grow_vertical = 0 +focus_next = NodePath("../UsernameBG/Username") +focus_previous = NodePath("../LoginTextureBtn") texture_normal = ExtResource("6_0m802") texture_pressed = ExtResource("7_sffoi") texture_focused = ExtResource("9_0m802") diff --git a/scenes/hub/dungeon_browser.tscn b/scenes/hub/dungeon_browser.tscn index 176cb6e..9ebaa6f 100644 --- a/scenes/hub/dungeon_browser.tscn +++ b/scenes/hub/dungeon_browser.tscn @@ -1,6 +1,21 @@ -[gd_scene load_steps=2 format=3 uid="uid://dungeonbrowser"] +[gd_scene load_steps=7 format=3 uid="uid://ctsfevsx6nnv2"] -[ext_resource type="Script" path="res://scripts/ui/dungeon_browser.gd" id="1"] +[ext_resource type="Script" uid="uid://bgepph7eq4pfl" path="res://scripts/ui/dungeon_browser.gd" id="1"] +[ext_resource type="FontFile" uid="uid://bckbv8viuh6lm" path="res://assets/fonts/Berry Rotunda.ttf" id="3_lmk4a"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wt68x"] +bg_color = Color(0.40784314, 0.40784314, 0.32156864, 1) +border_width_left = 2 +border_width_top = 2 +border_width_right = 2 +border_width_bottom = 2 +border_color = Color(0, 0, 0, 1) + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_wt68x"] + +[sub_resource type="StyleBoxLine" id="StyleBoxLine_oawpy"] + +[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_8ybmu"] [node name="DungeonBrowser" type="Control"] layout_mode = 3 @@ -18,34 +33,51 @@ anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -offset_left = -300.0 -offset_top = -250.0 -offset_right = 300.0 -offset_bottom = 250.0 +offset_left = -430.0 +offset_top = -381.0 +offset_right = 170.0 +offset_bottom = 119.0 grow_horizontal = 2 grow_vertical = 2 +scale = Vector2(1.5200019, 1.5200019) +theme_override_styles/panel = SubResource("StyleBoxFlat_wt68x") [node name="VBoxContainer" type="VBoxContainer" parent="Panel"] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -offset_left = 10.0 -offset_top = 10.0 -offset_right = -10.0 -offset_bottom = -10.0 +offset_left = 42.105213 +offset_top = 28.947334 +offset_right = 42.105225 +offset_bottom = 28.947327 +grow_horizontal = 2 +grow_vertical = 2 +scale = Vector2(0.863487, 0.863487) +alignment = 1 [node name="TitleLabel" type="Label" parent="Panel/VBoxContainer"] layout_mode = 2 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_fonts/font = ExtResource("3_lmk4a") +theme_override_font_sizes/font_size = 27 +theme_override_styles/normal = SubResource("StyleBoxEmpty_wt68x") text = "Dungeon Browser" horizontal_alignment = 1 +[node name="HSeparator2" type="HSeparator" parent="Panel/VBoxContainer"] +layout_mode = 2 +theme_override_styles/separator = SubResource("StyleBoxLine_oawpy") + [node name="TopBar" type="HBoxContainer" parent="Panel/VBoxContainer"] layout_mode = 2 [node name="BracketLabel" type="Label" parent="Panel/VBoxContainer/TopBar"] layout_mode = 2 size_flags_horizontal = 3 +theme_override_colors/font_color = Color(0, 0, 0, 1) +theme_override_fonts/font = ExtResource("3_lmk4a") +theme_override_styles/normal = SubResource("StyleBoxEmpty_8ybmu") text = "Level 1 (Bracket 1-10)" [node name="TierSelector" type="OptionButton" parent="Panel/VBoxContainer/TopBar"] @@ -69,6 +101,7 @@ text = "X" [node name="HSeparator" type="HSeparator" parent="Panel/VBoxContainer"] layout_mode = 2 +theme_override_styles/separator = SubResource("StyleBoxLine_oawpy") [node name="ScrollContainer" type="ScrollContainer" parent="Panel/VBoxContainer"] layout_mode = 2 diff --git a/scenes/hub/dungeon_entry.tscn b/scenes/hub/dungeon_entry.tscn index 9477b85..dffe3dd 100644 --- a/scenes/hub/dungeon_entry.tscn +++ b/scenes/hub/dungeon_entry.tscn @@ -1,11 +1,21 @@ -[gd_scene load_steps=2 format=3 uid="uid://dungeonentry"] +[gd_scene load_steps=4 format=3 uid="uid://dungeonentry"] -[ext_resource type="Script" path="res://scripts/ui/dungeon_entry.gd" id="1"] +[ext_resource type="Script" uid="uid://pp3l2jiud6d6" path="res://scripts/ui/dungeon_entry.gd" id="1"] + +[sub_resource type="Gradient" id="Gradient_17ek4"] +colors = PackedColorArray(0.40784314, 0.40784314, 0.32156864, 1, 0.40784314, 0.40784314, 0.32156864, 0.64705884) + +[sub_resource type="GradientTexture2D" id="GradientTexture2D_vj3vt"] +gradient = SubResource("Gradient_17ek4") [node name="DungeonEntry" type="PanelContainer"] custom_minimum_size = Vector2(0, 60) script = ExtResource("1") +[node name="TextureRect" type="TextureRect" parent="."] +layout_mode = 2 +texture = SubResource("GradientTexture2D_vj3vt") + [node name="HBoxContainer" type="HBoxContainer" parent="."] layout_mode = 2 diff --git a/scenes/hub/hub_screen.tscn b/scenes/hub/hub_screen.tscn index 8875e65..09f0530 100644 --- a/scenes/hub/hub_screen.tscn +++ b/scenes/hub/hub_screen.tscn @@ -1,14 +1,45 @@ -[gd_scene load_steps=6 format=3 uid="uid://linskq5jx4uh"] +[gd_scene load_steps=20 format=3 uid="uid://linskq5jx4uh"] [ext_resource type="Script" uid="uid://c4v4vw32gyxbl" path="res://scripts/ui/hub_ui.gd" id="1_u7qci"] [ext_resource type="PackedScene" uid="uid://ctsfevsx6nnv2" path="res://scenes/hub/dungeon_browser.tscn" id="2_browser"] +[ext_resource type="Texture2D" uid="uid://cdasq4ydwp73d" path="res://assets/ui/bg1.png" id="2_x5h0m"] [ext_resource type="PackedScene" uid="uid://bwlmaoeg3gbrn" path="res://scenes/ui/inventory.tscn" id="3_inventory"] +[ext_resource type="Texture2D" uid="uid://c5mayhik483jx" path="res://assets/ui/border.png" id="3_nk3pq"] [ext_resource type="PackedScene" uid="uid://hsrxtbww60u" path="res://scenes/ui/crafting_ui.tscn" id="4_crafting"] +[ext_resource type="Texture2D" uid="uid://dt0uqrxoh4kdj" path="res://assets/ui/xpBarBorder.png" id="4_khm7y"] +[ext_resource type="Texture2D" uid="uid://coefkwhawwkt8" path="res://assets/ui/TextFrame.png" id="5_nk0ko"] [ext_resource type="PackedScene" path="res://scenes/ui/stash.tscn" id="5_stash"] +[ext_resource type="Texture2D" uid="uid://obf6n8b324k7" path="res://assets/ui/displayint.png" id="6_8wxbt"] +[ext_resource type="PackedScene" uid="uid://bevuo5j02po14" path="res://scenes/ui/char_sheet.tscn" id="7_7dxfp"] +[ext_resource type="Texture2D" uid="uid://bs0xtpelj7ka4" path="res://assets/ui/plusBtn.png" id="7_hx8vm"] +[ext_resource type="Texture2D" uid="uid://cweri4tanbppf" path="res://assets/ui/plusBtnDown.png" id="8_2dc6d"] +[ext_resource type="Texture2D" uid="uid://bniu06cdeknuj" path="res://assets/ui/inventory.png" id="9_nk0ko"] +[ext_resource type="Texture2D" uid="uid://ds0ugfvjt1ate" path="res://assets/ui/sheet.png" id="10_8wxbt"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_nobn3"] +texture = ExtResource("2_x5h0m") + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_v847t"] +bg_color = Color(0, 0, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pi7qk"] +bg_color = Color(0.2901961, 0.8784314, 0.28627452, 1) + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_4ghtg"] +texture = ExtResource("6_8wxbt") [node name="HubScreen" type="CanvasLayer"] script = ExtResource("1_u7qci") +[node name="TextureRect" type="TextureRect" parent="."] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("2_x5h0m") +expand_mode = 1 + [node name="Control" type="Control" parent="."] layout_mode = 3 anchors_preset = 15 @@ -16,7 +47,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -scale = Vector2(1.0018518, 1) +scale = Vector2(1.0038548, 1) [node name="HBoxContainer" type="HBoxContainer" parent="Control"] layout_mode = 1 @@ -25,10 +56,10 @@ anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -offset_left = -226.0 -offset_top = -168.5 -offset_right = 226.0 -offset_bottom = 168.5 +offset_left = -161.84317 +offset_top = -249.0 +offset_right = 351.15698 +offset_bottom = 88.0 grow_horizontal = 2 grow_vertical = 2 @@ -36,6 +67,7 @@ grow_vertical = 2 layout_mode = 2 [node name="CharacterInfo" type="VBoxContainer" parent="Control/HBoxContainer/LeftPanel"] +visible = false layout_mode = 2 [node name="NameLabel" type="Label" parent="Control/HBoxContainer/LeftPanel/CharacterInfo"] @@ -52,6 +84,7 @@ layout_mode = 2 text = "Gold: 0" [node name="StatsPanel" type="GridContainer" parent="Control/HBoxContainer/LeftPanel"] +visible = false layout_mode = 2 columns = 3 @@ -117,17 +150,10 @@ layout_mode = 2 layout_mode = 2 [node name="InventoryBtn" type="Button" parent="Control/HBoxContainer/LeftPanel/MenuButtons"] +visible = false layout_mode = 2 text = "Inventory" -[node name="CraftingBtn" type="Button" parent="Control/HBoxContainer/LeftPanel/MenuButtons"] -layout_mode = 2 -text = "Crafting" - -[node name="StashBtn" type="Button" parent="Control/HBoxContainer/LeftPanel/MenuButtons"] -layout_mode = 2 -text = "Stash 🔐" - [node name="RightPanel" type="VBoxContainer" parent="Control/HBoxContainer"] layout_mode = 2 alignment = 2 @@ -163,6 +189,332 @@ text = "Quick Join" layout_mode = 2 text = "Browse Dungeons" +[node name="Panel" type="Panel" parent="Control"] +visible = false +layout_mode = 0 +offset_left = 169.3472 +offset_top = 132.0 +offset_right = 569.34717 +offset_bottom = 632.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_nobn3") + +[node name="Border" type="Sprite2D" parent="Control/Panel"] +position = Vector2(200, 250) +scale = Vector2(1.231, 1.28) +texture = ExtResource("3_nk3pq") + +[node name="Name" type="Label" parent="Control/Panel"] +layout_mode = 0 +offset_left = 145.0 +offset_top = 13.0 +offset_right = 237.0 +offset_bottom = 36.0 +text = "Placeholder" + +[node name="Level" type="Label" parent="Control/Panel"] +layout_mode = 0 +offset_left = 147.0 +offset_top = 36.0 +offset_right = 239.0 +offset_bottom = 59.0 +text = "Level" + +[node name="ProgressBar" type="ProgressBar" parent="Control/Panel"] +layout_mode = 0 +offset_left = 99.0 +offset_top = 61.0 +offset_right = 299.0 +offset_bottom = 88.0 +theme_override_styles/background = SubResource("StyleBoxFlat_v847t") +theme_override_styles/fill = SubResource("StyleBoxFlat_pi7qk") +min_value = 50.0 +value = 50.0 + +[node name="XpBarBorder" type="Sprite2D" parent="Control/Panel/ProgressBar"] +position = Vector2(100, 14) +scale = Vector2(1.559995, 1.0799927) +texture = ExtResource("4_khm7y") + +[node name="Label" type="Label" parent="Control/Panel"] +layout_mode = 0 +offset_left = 85.0 +offset_top = 381.0 +offset_right = 130.0 +offset_bottom = 404.0 +text = "Gold: " + +[node name="HBoxContainer" type="HBoxContainer" parent="Control/Panel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="StrFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 180.5) +texture = ExtResource("5_nk0ko") + +[node name="StrLabel" type="Label" parent="Control/Panel/HBoxContainer/StrFrame"] +offset_left = -32.0 +offset_top = -26.0 +offset_right = 35.0 +offset_bottom = 23.0 +text = "Strength" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="DisplayCurrentStr" type="Panel" parent="Control/Panel/HBoxContainer/StrFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.5 +offset_right = 145.0 +offset_bottom = 15.5 +theme_override_styles/panel = SubResource("StyleBoxTexture_4ghtg") + +[node name="currentStrLabel" type="Label" parent="Control/Panel/HBoxContainer/StrFrame/DisplayCurrentStr"] +layout_mode = 0 +offset_left = 16.0 +offset_top = 4.5 +offset_right = 56.0 +offset_bottom = 27.5 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusStr" type="TextureButton" parent="Control/Panel/HBoxContainer/StrFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 185.0 +offset_bottom = 24.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("7_hx8vm") +texture_pressed = ExtResource("8_2dc6d") +flip_h = true + +[node name="IntFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 213.5) +texture = ExtResource("5_nk0ko") + +[node name="IntLabel" type="Label" parent="Control/Panel/HBoxContainer/IntFrame"] +offset_left = -45.0 +offset_top = -11.0 +offset_right = 45.0 +offset_bottom = 12.0 +text = "Intelligence" + +[node name="DisplayCurrentInt" type="Panel" parent="Control/Panel/HBoxContainer/IntFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_4ghtg") + +[node name="currentIntLabel" type="Label" parent="Control/Panel/HBoxContainer/IntFrame/DisplayCurrentInt"] +layout_mode = 0 +offset_left = 16.0 +offset_top = 5.0 +offset_right = 56.0 +offset_bottom = 28.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusInt" type="TextureButton" parent="Control/Panel/HBoxContainer/IntFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 209.0 +offset_bottom = 44.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("7_hx8vm") +texture_pressed = ExtResource("8_2dc6d") +flip_h = true + +[node name="DexFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 246.5) +texture = ExtResource("5_nk0ko") + +[node name="DexLabel" type="Label" parent="Control/Panel/HBoxContainer/DexFrame"] +offset_left = -35.0 +offset_top = -11.0 +offset_right = 37.0 +offset_bottom = 12.0 +text = "Dexterity" + +[node name="DisplayCurrentDex" type="Panel" parent="Control/Panel/HBoxContainer/DexFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_4ghtg") + +[node name="currentDexLabel" type="Label" parent="Control/Panel/HBoxContainer/DexFrame/DisplayCurrentDex"] +layout_mode = 0 +offset_left = 16.0 +offset_top = 5.0 +offset_right = 56.0 +offset_bottom = 28.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusDex" type="TextureButton" parent="Control/Panel/HBoxContainer/DexFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 209.0 +offset_bottom = 44.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("7_hx8vm") +texture_pressed = ExtResource("8_2dc6d") +flip_h = true + +[node name="WisFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 279.5) +texture = ExtResource("5_nk0ko") + +[node name="WisLabel" type="Label" parent="Control/Panel/HBoxContainer/WisFrame"] +offset_left = -30.0 +offset_top = -11.0 +offset_right = 33.0 +offset_bottom = 12.0 +text = "Wisdom" + +[node name="DisplayCurrentWis" type="Panel" parent="Control/Panel/HBoxContainer/WisFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_4ghtg") + +[node name="currentWisLabel" type="Label" parent="Control/Panel/HBoxContainer/WisFrame/DisplayCurrentWis"] +layout_mode = 0 +offset_left = 17.0 +offset_top = 4.0 +offset_right = 57.0 +offset_bottom = 27.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusWis" type="TextureButton" parent="Control/Panel/HBoxContainer/WisFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 209.0 +offset_bottom = 44.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("7_hx8vm") +texture_pressed = ExtResource("8_2dc6d") +flip_h = true + +[node name="EndFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 312.5) +texture = ExtResource("5_nk0ko") + +[node name="EndLabel" type="Label" parent="Control/Panel/HBoxContainer/EndFrame"] +offset_left = -41.0 +offset_top = -11.0 +offset_right = 42.0 +offset_bottom = 12.0 +text = "Endurance" +metadata/_edit_use_anchors_ = true + +[node name="DisplayCurrentEnd" type="Panel" parent="Control/Panel/HBoxContainer/EndFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_4ghtg") +metadata/_edit_use_anchors_ = true + +[node name="currentStrLabel" type="Label" parent="Control/Panel/HBoxContainer/EndFrame/DisplayCurrentEnd"] +layout_mode = 0 +offset_left = 18.0 +offset_top = 3.0 +offset_right = 58.0 +offset_bottom = 26.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusEnd" type="TextureButton" parent="Control/Panel/HBoxContainer/EndFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 209.0 +offset_bottom = 44.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("7_hx8vm") +texture_pressed = ExtResource("8_2dc6d") +flip_h = true + +[node name="RemainingPoints" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 345.5) +texture = ExtResource("5_nk0ko") + +[node name="RemainingPointsLabel" type="Label" parent="Control/Panel/HBoxContainer/RemainingPoints"] +offset_left = -52.5 +offset_top = -12.0 +offset_right = 51.5 +offset_bottom = 11.0 +text = "Stats to place" +metadata/_edit_use_anchors_ = true + +[node name="DisplayCurrentRP" type="Panel" parent="Control/Panel/HBoxContainer/RemainingPoints"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_4ghtg") +metadata/_edit_use_anchors_ = true + +[node name="currentRPLabel" type="Label" parent="Control/Panel/HBoxContainer/RemainingPoints/DisplayCurrentRP"] +layout_mode = 0 +offset_left = 18.0 +offset_top = 3.0 +offset_right = 58.0 +offset_bottom = 26.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="InventoryBtn" type="TextureButton" parent="Control"] +layout_mode = 0 +offset_left = 183.29343 +offset_top = 653.0 +offset_right = 366.29343 +offset_bottom = 836.0 +scale = Vector2(0.44, 0.44) +texture_normal = ExtResource("9_nk0ko") + +[node name="CraftingBtn" type="Button" parent="Control"] +layout_mode = 0 +offset_left = 292.87106 +offset_top = 681.0 +offset_right = 362.87106 +offset_bottom = 712.0 +text = "Crafting" + +[node name="StashBtn" type="Button" parent="Control"] +layout_mode = 0 +offset_left = 375.55234 +offset_top = 681.0 +offset_right = 452.55234 +offset_bottom = 712.0 +text = "Stash 🔐" + +[node name="CharSheetBtn" type="TextureButton" parent="Control"] +layout_mode = 0 +offset_left = 101.60833 +offset_top = 653.0 +offset_right = 284.60834 +offset_bottom = 836.0 +scale = Vector2(0.44000217, 0.44000217) +texture_normal = ExtResource("10_8wxbt") + [node name="DungeonBrowser" parent="." instance=ExtResource("2_browser")] visible = false @@ -171,3 +523,9 @@ visible = false [node name="CraftingUI" parent="." instance=ExtResource("4_crafting")] [node name="StashUI" parent="." instance=ExtResource("5_stash")] + +[node name="CharSheetUI" parent="." instance=ExtResource("7_7dxfp")] +visible = false +offset = Vector2(200, 150) +scale = Vector2(0.75, 0.75) +transform = Transform2D(0.75, 0, 0, 0.75, 200, 150) diff --git a/scenes/hub/hub_screen.tscn300804017574.tmp b/scenes/hub/hub_screen.tscn300804017574.tmp new file mode 100644 index 0000000..09f0530 --- /dev/null +++ b/scenes/hub/hub_screen.tscn300804017574.tmp @@ -0,0 +1,531 @@ +[gd_scene load_steps=20 format=3 uid="uid://linskq5jx4uh"] + +[ext_resource type="Script" uid="uid://c4v4vw32gyxbl" path="res://scripts/ui/hub_ui.gd" id="1_u7qci"] +[ext_resource type="PackedScene" uid="uid://ctsfevsx6nnv2" path="res://scenes/hub/dungeon_browser.tscn" id="2_browser"] +[ext_resource type="Texture2D" uid="uid://cdasq4ydwp73d" path="res://assets/ui/bg1.png" id="2_x5h0m"] +[ext_resource type="PackedScene" uid="uid://bwlmaoeg3gbrn" path="res://scenes/ui/inventory.tscn" id="3_inventory"] +[ext_resource type="Texture2D" uid="uid://c5mayhik483jx" path="res://assets/ui/border.png" id="3_nk3pq"] +[ext_resource type="PackedScene" uid="uid://hsrxtbww60u" path="res://scenes/ui/crafting_ui.tscn" id="4_crafting"] +[ext_resource type="Texture2D" uid="uid://dt0uqrxoh4kdj" path="res://assets/ui/xpBarBorder.png" id="4_khm7y"] +[ext_resource type="Texture2D" uid="uid://coefkwhawwkt8" path="res://assets/ui/TextFrame.png" id="5_nk0ko"] +[ext_resource type="PackedScene" path="res://scenes/ui/stash.tscn" id="5_stash"] +[ext_resource type="Texture2D" uid="uid://obf6n8b324k7" path="res://assets/ui/displayint.png" id="6_8wxbt"] +[ext_resource type="PackedScene" uid="uid://bevuo5j02po14" path="res://scenes/ui/char_sheet.tscn" id="7_7dxfp"] +[ext_resource type="Texture2D" uid="uid://bs0xtpelj7ka4" path="res://assets/ui/plusBtn.png" id="7_hx8vm"] +[ext_resource type="Texture2D" uid="uid://cweri4tanbppf" path="res://assets/ui/plusBtnDown.png" id="8_2dc6d"] +[ext_resource type="Texture2D" uid="uid://bniu06cdeknuj" path="res://assets/ui/inventory.png" id="9_nk0ko"] +[ext_resource type="Texture2D" uid="uid://ds0ugfvjt1ate" path="res://assets/ui/sheet.png" id="10_8wxbt"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_nobn3"] +texture = ExtResource("2_x5h0m") + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_v847t"] +bg_color = Color(0, 0, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_pi7qk"] +bg_color = Color(0.2901961, 0.8784314, 0.28627452, 1) + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_4ghtg"] +texture = ExtResource("6_8wxbt") + +[node name="HubScreen" type="CanvasLayer"] +script = ExtResource("1_u7qci") + +[node name="TextureRect" type="TextureRect" parent="."] +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +texture = ExtResource("2_x5h0m") +expand_mode = 1 + +[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 +scale = Vector2(1.0038548, 1) + +[node name="HBoxContainer" type="HBoxContainer" parent="Control"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -161.84317 +offset_top = -249.0 +offset_right = 351.15698 +offset_bottom = 88.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="LeftPanel" type="VBoxContainer" parent="Control/HBoxContainer"] +layout_mode = 2 + +[node name="CharacterInfo" type="VBoxContainer" parent="Control/HBoxContainer/LeftPanel"] +visible = false +layout_mode = 2 + +[node name="NameLabel" type="Label" parent="Control/HBoxContainer/LeftPanel/CharacterInfo"] +layout_mode = 2 + +[node name="LevelLabel" type="Label" parent="Control/HBoxContainer/LeftPanel/CharacterInfo"] +layout_mode = 2 + +[node name="XPBar" type="ProgressBar" parent="Control/HBoxContainer/LeftPanel/CharacterInfo"] +layout_mode = 2 + +[node name="GoldLabel" type="Label" parent="Control/HBoxContainer/LeftPanel/CharacterInfo"] +layout_mode = 2 +text = "Gold: 0" + +[node name="StatsPanel" type="GridContainer" parent="Control/HBoxContainer/LeftPanel"] +visible = false +layout_mode = 2 +columns = 3 + +[node name="StrLabel" type="Label" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 +text = "Strength" + +[node name="StrValue" type="Label" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 + +[node name="StrButton" type="Button" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 +text = "+" + +[node name="IntLabel" type="Label" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 +text = "Intelligence" + +[node name="IntValue" type="Label" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 + +[node name="IntButton" type="Button" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 +text = "+" + +[node name="DexLabel" type="Label" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 +text = "Dexterity" + +[node name="DexValue" type="Label" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 + +[node name="DexButton" type="Button" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 +text = "+" + +[node name="WisLabel" type="Label" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 +text = "Wisdom" + +[node name="WisValue" type="Label" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 + +[node name="WisButton" type="Button" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 +text = "+" + +[node name="EndLabel" type="Label" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 +text = "Endurance" + +[node name="EndValue" type="Label" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 + +[node name="EndButton" type="Button" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 +text = "+" + +[node name="PointsRemaining" type="Label" parent="Control/HBoxContainer/LeftPanel/StatsPanel"] +layout_mode = 2 + +[node name="MenuButtons" type="HBoxContainer" parent="Control/HBoxContainer/LeftPanel"] +layout_mode = 2 + +[node name="InventoryBtn" type="Button" parent="Control/HBoxContainer/LeftPanel/MenuButtons"] +visible = false +layout_mode = 2 +text = "Inventory" + +[node name="RightPanel" type="VBoxContainer" parent="Control/HBoxContainer"] +layout_mode = 2 +alignment = 2 + +[node name="TierSelection" type="HBoxContainer" parent="Control/HBoxContainer/RightPanel"] +layout_mode = 2 + +[node name="Tier1Btn" type="Button" parent="Control/HBoxContainer/RightPanel/TierSelection"] +layout_mode = 2 +text = "Tier 1" + +[node name="Tier2Btn" type="Button" parent="Control/HBoxContainer/RightPanel/TierSelection"] +layout_mode = 2 +text = "Tier 2" + +[node name="Tier3Btn" type="Button" parent="Control/HBoxContainer/RightPanel/TierSelection"] +layout_mode = 2 +text = "Tier 3" + +[node name="Tier4Btn" type="Button" parent="Control/HBoxContainer/RightPanel/TierSelection"] +layout_mode = 2 +text = "Tier 4" + +[node name="Tier5Btn" type="Button" parent="Control/HBoxContainer/RightPanel/TierSelection"] +layout_mode = 2 +text = "Tier 5" + +[node name="EnterDungeonBtn" type="Button" parent="Control/HBoxContainer/RightPanel"] +layout_mode = 2 +text = "Quick Join" + +[node name="BrowseDungeonsBtn" type="Button" parent="Control/HBoxContainer/RightPanel"] +layout_mode = 2 +text = "Browse Dungeons" + +[node name="Panel" type="Panel" parent="Control"] +visible = false +layout_mode = 0 +offset_left = 169.3472 +offset_top = 132.0 +offset_right = 569.34717 +offset_bottom = 632.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_nobn3") + +[node name="Border" type="Sprite2D" parent="Control/Panel"] +position = Vector2(200, 250) +scale = Vector2(1.231, 1.28) +texture = ExtResource("3_nk3pq") + +[node name="Name" type="Label" parent="Control/Panel"] +layout_mode = 0 +offset_left = 145.0 +offset_top = 13.0 +offset_right = 237.0 +offset_bottom = 36.0 +text = "Placeholder" + +[node name="Level" type="Label" parent="Control/Panel"] +layout_mode = 0 +offset_left = 147.0 +offset_top = 36.0 +offset_right = 239.0 +offset_bottom = 59.0 +text = "Level" + +[node name="ProgressBar" type="ProgressBar" parent="Control/Panel"] +layout_mode = 0 +offset_left = 99.0 +offset_top = 61.0 +offset_right = 299.0 +offset_bottom = 88.0 +theme_override_styles/background = SubResource("StyleBoxFlat_v847t") +theme_override_styles/fill = SubResource("StyleBoxFlat_pi7qk") +min_value = 50.0 +value = 50.0 + +[node name="XpBarBorder" type="Sprite2D" parent="Control/Panel/ProgressBar"] +position = Vector2(100, 14) +scale = Vector2(1.559995, 1.0799927) +texture = ExtResource("4_khm7y") + +[node name="Label" type="Label" parent="Control/Panel"] +layout_mode = 0 +offset_left = 85.0 +offset_top = 381.0 +offset_right = 130.0 +offset_bottom = 404.0 +text = "Gold: " + +[node name="HBoxContainer" type="HBoxContainer" parent="Control/Panel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="StrFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 180.5) +texture = ExtResource("5_nk0ko") + +[node name="StrLabel" type="Label" parent="Control/Panel/HBoxContainer/StrFrame"] +offset_left = -32.0 +offset_top = -26.0 +offset_right = 35.0 +offset_bottom = 23.0 +text = "Strength" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="DisplayCurrentStr" type="Panel" parent="Control/Panel/HBoxContainer/StrFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.5 +offset_right = 145.0 +offset_bottom = 15.5 +theme_override_styles/panel = SubResource("StyleBoxTexture_4ghtg") + +[node name="currentStrLabel" type="Label" parent="Control/Panel/HBoxContainer/StrFrame/DisplayCurrentStr"] +layout_mode = 0 +offset_left = 16.0 +offset_top = 4.5 +offset_right = 56.0 +offset_bottom = 27.5 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusStr" type="TextureButton" parent="Control/Panel/HBoxContainer/StrFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 185.0 +offset_bottom = 24.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("7_hx8vm") +texture_pressed = ExtResource("8_2dc6d") +flip_h = true + +[node name="IntFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 213.5) +texture = ExtResource("5_nk0ko") + +[node name="IntLabel" type="Label" parent="Control/Panel/HBoxContainer/IntFrame"] +offset_left = -45.0 +offset_top = -11.0 +offset_right = 45.0 +offset_bottom = 12.0 +text = "Intelligence" + +[node name="DisplayCurrentInt" type="Panel" parent="Control/Panel/HBoxContainer/IntFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_4ghtg") + +[node name="currentIntLabel" type="Label" parent="Control/Panel/HBoxContainer/IntFrame/DisplayCurrentInt"] +layout_mode = 0 +offset_left = 16.0 +offset_top = 5.0 +offset_right = 56.0 +offset_bottom = 28.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusInt" type="TextureButton" parent="Control/Panel/HBoxContainer/IntFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 209.0 +offset_bottom = 44.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("7_hx8vm") +texture_pressed = ExtResource("8_2dc6d") +flip_h = true + +[node name="DexFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 246.5) +texture = ExtResource("5_nk0ko") + +[node name="DexLabel" type="Label" parent="Control/Panel/HBoxContainer/DexFrame"] +offset_left = -35.0 +offset_top = -11.0 +offset_right = 37.0 +offset_bottom = 12.0 +text = "Dexterity" + +[node name="DisplayCurrentDex" type="Panel" parent="Control/Panel/HBoxContainer/DexFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_4ghtg") + +[node name="currentDexLabel" type="Label" parent="Control/Panel/HBoxContainer/DexFrame/DisplayCurrentDex"] +layout_mode = 0 +offset_left = 16.0 +offset_top = 5.0 +offset_right = 56.0 +offset_bottom = 28.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusDex" type="TextureButton" parent="Control/Panel/HBoxContainer/DexFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 209.0 +offset_bottom = 44.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("7_hx8vm") +texture_pressed = ExtResource("8_2dc6d") +flip_h = true + +[node name="WisFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 279.5) +texture = ExtResource("5_nk0ko") + +[node name="WisLabel" type="Label" parent="Control/Panel/HBoxContainer/WisFrame"] +offset_left = -30.0 +offset_top = -11.0 +offset_right = 33.0 +offset_bottom = 12.0 +text = "Wisdom" + +[node name="DisplayCurrentWis" type="Panel" parent="Control/Panel/HBoxContainer/WisFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_4ghtg") + +[node name="currentWisLabel" type="Label" parent="Control/Panel/HBoxContainer/WisFrame/DisplayCurrentWis"] +layout_mode = 0 +offset_left = 17.0 +offset_top = 4.0 +offset_right = 57.0 +offset_bottom = 27.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusWis" type="TextureButton" parent="Control/Panel/HBoxContainer/WisFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 209.0 +offset_bottom = 44.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("7_hx8vm") +texture_pressed = ExtResource("8_2dc6d") +flip_h = true + +[node name="EndFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 312.5) +texture = ExtResource("5_nk0ko") + +[node name="EndLabel" type="Label" parent="Control/Panel/HBoxContainer/EndFrame"] +offset_left = -41.0 +offset_top = -11.0 +offset_right = 42.0 +offset_bottom = 12.0 +text = "Endurance" +metadata/_edit_use_anchors_ = true + +[node name="DisplayCurrentEnd" type="Panel" parent="Control/Panel/HBoxContainer/EndFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_4ghtg") +metadata/_edit_use_anchors_ = true + +[node name="currentStrLabel" type="Label" parent="Control/Panel/HBoxContainer/EndFrame/DisplayCurrentEnd"] +layout_mode = 0 +offset_left = 18.0 +offset_top = 3.0 +offset_right = 58.0 +offset_bottom = 26.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusEnd" type="TextureButton" parent="Control/Panel/HBoxContainer/EndFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 209.0 +offset_bottom = 44.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("7_hx8vm") +texture_pressed = ExtResource("8_2dc6d") +flip_h = true + +[node name="RemainingPoints" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 345.5) +texture = ExtResource("5_nk0ko") + +[node name="RemainingPointsLabel" type="Label" parent="Control/Panel/HBoxContainer/RemainingPoints"] +offset_left = -52.5 +offset_top = -12.0 +offset_right = 51.5 +offset_bottom = 11.0 +text = "Stats to place" +metadata/_edit_use_anchors_ = true + +[node name="DisplayCurrentRP" type="Panel" parent="Control/Panel/HBoxContainer/RemainingPoints"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_4ghtg") +metadata/_edit_use_anchors_ = true + +[node name="currentRPLabel" type="Label" parent="Control/Panel/HBoxContainer/RemainingPoints/DisplayCurrentRP"] +layout_mode = 0 +offset_left = 18.0 +offset_top = 3.0 +offset_right = 58.0 +offset_bottom = 26.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="InventoryBtn" type="TextureButton" parent="Control"] +layout_mode = 0 +offset_left = 183.29343 +offset_top = 653.0 +offset_right = 366.29343 +offset_bottom = 836.0 +scale = Vector2(0.44, 0.44) +texture_normal = ExtResource("9_nk0ko") + +[node name="CraftingBtn" type="Button" parent="Control"] +layout_mode = 0 +offset_left = 292.87106 +offset_top = 681.0 +offset_right = 362.87106 +offset_bottom = 712.0 +text = "Crafting" + +[node name="StashBtn" type="Button" parent="Control"] +layout_mode = 0 +offset_left = 375.55234 +offset_top = 681.0 +offset_right = 452.55234 +offset_bottom = 712.0 +text = "Stash 🔐" + +[node name="CharSheetBtn" type="TextureButton" parent="Control"] +layout_mode = 0 +offset_left = 101.60833 +offset_top = 653.0 +offset_right = 284.60834 +offset_bottom = 836.0 +scale = Vector2(0.44000217, 0.44000217) +texture_normal = ExtResource("10_8wxbt") + +[node name="DungeonBrowser" parent="." instance=ExtResource("2_browser")] +visible = false + +[node name="InventoryUI" parent="." instance=ExtResource("3_inventory")] + +[node name="CraftingUI" parent="." instance=ExtResource("4_crafting")] + +[node name="StashUI" parent="." instance=ExtResource("5_stash")] + +[node name="CharSheetUI" parent="." instance=ExtResource("7_7dxfp")] +visible = false +offset = Vector2(200, 150) +scale = Vector2(0.75, 0.75) +transform = Transform2D(0.75, 0, 0, 0.75, 200, 150) diff --git a/scenes/ui/char_sheet.tscn b/scenes/ui/char_sheet.tscn new file mode 100644 index 0000000..181681f --- /dev/null +++ b/scenes/ui/char_sheet.tscn @@ -0,0 +1,323 @@ +[gd_scene load_steps=13 format=3 uid="uid://bevuo5j02po14"] + +[ext_resource type="Texture2D" uid="uid://cdasq4ydwp73d" path="res://assets/ui/bg1.png" id="1_n6ki4"] +[ext_resource type="Script" uid="uid://ixmjbaov0w5f" path="res://scripts/ui/char_sheet.gd" id="1_ntogj"] +[ext_resource type="Texture2D" uid="uid://c5mayhik483jx" path="res://assets/ui/border.png" id="2_5at6l"] +[ext_resource type="Texture2D" uid="uid://dt0uqrxoh4kdj" path="res://assets/ui/xpBarBorder.png" id="3_x3x6m"] +[ext_resource type="Texture2D" uid="uid://coefkwhawwkt8" path="res://assets/ui/TextFrame.png" id="4_tmr2d"] +[ext_resource type="Texture2D" uid="uid://obf6n8b324k7" path="res://assets/ui/displayint.png" id="5_83noc"] +[ext_resource type="Texture2D" uid="uid://bs0xtpelj7ka4" path="res://assets/ui/plusBtn.png" id="6_83noc"] +[ext_resource type="Texture2D" uid="uid://cweri4tanbppf" path="res://assets/ui/plusBtnDown.png" id="7_n43et"] + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_x3x6m"] +texture = ExtResource("1_n6ki4") + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_n6ki4"] +bg_color = Color(0, 0, 0, 1) + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5at6l"] +bg_color = Color(0.2901961, 0.8784314, 0.28627452, 1) + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_n43et"] +texture = ExtResource("5_83noc") + +[node name="CharSheet" type="CanvasLayer"] +script = ExtResource("1_ntogj") +metadata/_edit_vertical_guides_ = [-77.0] + +[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="Panel" type="Panel" parent="Control"] +layout_mode = 0 +offset_right = 400.0 +offset_bottom = 500.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_x3x6m") + +[node name="Border" type="Sprite2D" parent="Control/Panel"] +position = Vector2(200, 250) +scale = Vector2(1.231, 1.28) +texture = ExtResource("2_5at6l") + +[node name="Name" type="Label" parent="Control/Panel"] +layout_mode = 0 +offset_left = 145.0 +offset_top = 13.0 +offset_right = 237.0 +offset_bottom = 36.0 +text = "Placeholder" + +[node name="Level" type="Label" parent="Control/Panel"] +layout_mode = 0 +offset_left = 147.0 +offset_top = 36.0 +offset_right = 239.0 +offset_bottom = 59.0 +text = "Level" + +[node name="ProgressBar" type="ProgressBar" parent="Control/Panel"] +layout_mode = 0 +offset_left = 99.0 +offset_top = 61.0 +offset_right = 299.0 +offset_bottom = 88.0 +theme_override_styles/background = SubResource("StyleBoxFlat_n6ki4") +theme_override_styles/fill = SubResource("StyleBoxFlat_5at6l") +min_value = 50.0 +value = 50.0 + +[node name="XpBarBorder" type="Sprite2D" parent="Control/Panel/ProgressBar"] +position = Vector2(100, 14) +scale = Vector2(1.559995, 1.0799927) +texture = ExtResource("3_x3x6m") + +[node name="Label" type="Label" parent="Control/Panel"] +layout_mode = 0 +offset_left = 85.0 +offset_top = 381.0 +offset_right = 130.0 +offset_bottom = 404.0 +text = "Gold: " + +[node name="HBoxContainer" type="HBoxContainer" parent="Control/Panel"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="StrFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 180.5) +texture = ExtResource("4_tmr2d") + +[node name="StrLabel" type="Label" parent="Control/Panel/HBoxContainer/StrFrame"] +offset_left = -32.0 +offset_top = -26.0 +offset_right = 35.0 +offset_bottom = 23.0 +text = "Strength" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="DisplayCurrentStr" type="Panel" parent="Control/Panel/HBoxContainer/StrFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.5 +offset_right = 145.0 +offset_bottom = 15.5 +theme_override_styles/panel = SubResource("StyleBoxTexture_n43et") + +[node name="currentStrLabel" type="Label" parent="Control/Panel/HBoxContainer/StrFrame/DisplayCurrentStr"] +layout_mode = 0 +offset_left = 16.0 +offset_top = 4.5 +offset_right = 56.0 +offset_bottom = 27.5 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusStr" type="TextureButton" parent="Control/Panel/HBoxContainer/StrFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 185.0 +offset_bottom = 24.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("6_83noc") +texture_pressed = ExtResource("7_n43et") +flip_h = true + +[node name="IntFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 213.5) +texture = ExtResource("4_tmr2d") + +[node name="IntLabel" type="Label" parent="Control/Panel/HBoxContainer/IntFrame"] +offset_left = -45.0 +offset_top = -11.0 +offset_right = 45.0 +offset_bottom = 12.0 +text = "Intelligence" + +[node name="DisplayCurrentInt" type="Panel" parent="Control/Panel/HBoxContainer/IntFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_n43et") + +[node name="currentIntLabel" type="Label" parent="Control/Panel/HBoxContainer/IntFrame/DisplayCurrentInt"] +layout_mode = 0 +offset_left = 16.0 +offset_top = 5.0 +offset_right = 56.0 +offset_bottom = 28.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusInt" type="TextureButton" parent="Control/Panel/HBoxContainer/IntFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 209.0 +offset_bottom = 44.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("6_83noc") +texture_pressed = ExtResource("7_n43et") +flip_h = true + +[node name="DexFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 246.5) +texture = ExtResource("4_tmr2d") + +[node name="DexLabel" type="Label" parent="Control/Panel/HBoxContainer/DexFrame"] +offset_left = -35.0 +offset_top = -11.0 +offset_right = 37.0 +offset_bottom = 12.0 +text = "Dexterity" + +[node name="DisplayCurrentDex" type="Panel" parent="Control/Panel/HBoxContainer/DexFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_n43et") + +[node name="currentDexLabel" type="Label" parent="Control/Panel/HBoxContainer/DexFrame/DisplayCurrentDex"] +layout_mode = 0 +offset_left = 16.0 +offset_top = 5.0 +offset_right = 56.0 +offset_bottom = 28.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusDex" type="TextureButton" parent="Control/Panel/HBoxContainer/DexFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 209.0 +offset_bottom = 44.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("6_83noc") +texture_pressed = ExtResource("7_n43et") +flip_h = true + +[node name="WisFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 279.5) +texture = ExtResource("4_tmr2d") + +[node name="WisLabel" type="Label" parent="Control/Panel/HBoxContainer/WisFrame"] +offset_left = -30.0 +offset_top = -11.0 +offset_right = 33.0 +offset_bottom = 12.0 +text = "Wisdom" + +[node name="DisplayCurrentWis" type="Panel" parent="Control/Panel/HBoxContainer/WisFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_n43et") + +[node name="currentWisLabel" type="Label" parent="Control/Panel/HBoxContainer/WisFrame/DisplayCurrentWis"] +layout_mode = 0 +offset_left = 17.0 +offset_top = 4.0 +offset_right = 57.0 +offset_bottom = 27.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusWis" type="TextureButton" parent="Control/Panel/HBoxContainer/WisFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 209.0 +offset_bottom = 44.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("6_83noc") +texture_pressed = ExtResource("7_n43et") +flip_h = true + +[node name="EndFrame" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 312.5) +texture = ExtResource("4_tmr2d") + +[node name="EndLabel" type="Label" parent="Control/Panel/HBoxContainer/EndFrame"] +offset_left = -41.0 +offset_top = -11.0 +offset_right = 42.0 +offset_bottom = 12.0 +text = "Endurance" +metadata/_edit_use_anchors_ = true + +[node name="DisplayCurrentEnd" type="Panel" parent="Control/Panel/HBoxContainer/EndFrame"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_n43et") +metadata/_edit_use_anchors_ = true + +[node name="currentStrLabel" type="Label" parent="Control/Panel/HBoxContainer/EndFrame/DisplayCurrentEnd"] +layout_mode = 0 +offset_left = 18.0 +offset_top = 3.0 +offset_right = 58.0 +offset_bottom = 26.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 + +[node name="plusEnd" type="TextureButton" parent="Control/Panel/HBoxContainer/EndFrame"] +offset_left = 145.0 +offset_top = -16.0 +offset_right = 209.0 +offset_bottom = 44.0 +scale = Vector2(0.5200025, 0.5200025) +texture_normal = ExtResource("6_83noc") +texture_pressed = ExtResource("7_n43et") +flip_h = true + +[node name="RemainingPoints" type="Sprite2D" parent="Control/Panel/HBoxContainer"] +position = Vector2(154.5, 345.5) +texture = ExtResource("4_tmr2d") + +[node name="RemainingPointsLabel" type="Label" parent="Control/Panel/HBoxContainer/RemainingPoints"] +offset_left = -52.5 +offset_top = -12.0 +offset_right = 51.5 +offset_bottom = 11.0 +text = "Stats to place" +metadata/_edit_use_anchors_ = true + +[node name="DisplayCurrentRP" type="Panel" parent="Control/Panel/HBoxContainer/RemainingPoints"] +clip_contents = true +offset_left = 70.0 +offset_top = -16.0 +offset_right = 145.0 +offset_bottom = 16.0 +theme_override_styles/panel = SubResource("StyleBoxTexture_n43et") +metadata/_edit_use_anchors_ = true + +[node name="currentRPLabel" type="Label" parent="Control/Panel/HBoxContainer/RemainingPoints/DisplayCurrentRP"] +layout_mode = 0 +offset_left = 18.0 +offset_top = 3.0 +offset_right = 58.0 +offset_bottom = 26.0 +text = "0" +horizontal_alignment = 1 +vertical_alignment = 1 diff --git a/scenes/ui/hud.tscn b/scenes/ui/hud.tscn index e326d0f..4ce2adf 100644 --- a/scenes/ui/hud.tscn +++ b/scenes/ui/hud.tscn @@ -1,6 +1,9 @@ -[gd_scene load_steps=5 format=3 uid="uid://cctw06lt2ffgb"] +[gd_scene load_steps=8 format=3 uid="uid://cctw06lt2ffgb"] [ext_resource type="Script" uid="uid://dis78b7f8x3j0" path="res://scripts/ui/hud.gd" id="1_hud"] +[ext_resource type="Script" uid="uid://ds8okf626rxye" path="res://addons/touch_screen_joystick/touch_screen_joystick.gd" id="2_hqnrr"] +[ext_resource type="Texture2D" uid="uid://7o1jec4i8enj" path="res://addons/touch_screen_joystick/mouseRing.png" id="3_8qguk"] +[ext_resource type="Texture2D" uid="uid://dhmh5yumt6ay5" path="res://addons/touch_screen_joystick/mouseBall.png" id="4_136eg"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_0mwgc"] bg_color = Color(0.79607844, 0, 0, 1) @@ -209,3 +212,18 @@ grow_vertical = 2 text = "Escaping... 5.0" horizontal_alignment = 1 vertical_alignment = 1 + +[node name="TouchJoystick" type="Control" parent="."] +layout_mode = 3 +anchors_preset = 0 +offset_left = 63.0 +offset_top = 699.0 +offset_right = 103.0 +offset_bottom = 739.0 +scale = Vector2(0.3600018, 0.3600018) +script = ExtResource("2_hqnrr") +antialiased = true +use_textures = true +base_texture = ExtResource("3_8qguk") +knob_texture = ExtResource("4_136eg") +use_input_actions = true diff --git a/scenes/ui/inventory.tscn b/scenes/ui/inventory.tscn index 997fe3f..17a82bf 100644 --- a/scenes/ui/inventory.tscn +++ b/scenes/ui/inventory.tscn @@ -1,11 +1,33 @@ -[gd_scene load_steps=2 format=3 uid="uid://bwlmaoeg3gbrn"] +[gd_scene load_steps=3 format=3 uid="uid://bwlmaoeg3gbrn"] [ext_resource type="Script" uid="uid://dnt1s2c81111q" path="res://scripts/ui/inventory_ui.gd" id="1_s6ek7"] +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_s6ek7"] +bg_color = Color(0.40784314, 0.40784314, 0.32156864, 1) +border_width_left = 2 +border_width_top = 2 +border_width_right = 2 +border_width_bottom = 2 +border_color = Color(0, 0, 0, 1) + [node name="Inventory" type="CanvasLayer"] visible = false script = ExtResource("1_s6ek7") +[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="TextureRect" type="TextureRect" parent="."] +offset_left = 200.0 +offset_top = 101.0 +offset_right = 240.0 +offset_bottom = 141.0 + [node name="PanelContainer" type="PanelContainer" parent="."] anchors_preset = 8 anchor_left = 0.5 @@ -18,6 +40,7 @@ offset_right = 96.0 offset_bottom = 44.5 grow_horizontal = 2 grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_s6ek7") [node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"] layout_mode = 2 diff --git a/scripts/autoload/game_state.gd b/scripts/autoload/game_state.gd index f3ae99e..c7f6599 100644 --- a/scripts/autoload/game_state.gd +++ b/scripts/autoload/game_state.gd @@ -93,12 +93,17 @@ var _network_connected: bool = false func _ready(): call_deferred("_connect_to_network") + Network.disconnected.connect(_on_disconnected) + func _connect_to_network(): if Network: Network.message_received.connect(_on_message_received) _network_connected = true +func _on_disconnected(): + set_state(0) + func set_state(new_state: int): current_state = new_state var state_name = STATE_NAMES[new_state] if new_state < STATE_NAMES.size() else "UNKNOWN" diff --git a/scripts/autoload/network.gd b/scripts/autoload/network.gd index eb8457e..9c60d15 100644 --- a/scripts/autoload/network.gd +++ b/scripts/autoload/network.gd @@ -1,5 +1,13 @@ extends Node +## Network Connection Manager with Ping/Pong Keepalive Support +## +## This script handles WebSocket connection to the game server and implements +## automatic ping/pong keepalive mechanism to prevent idle timeout disconnections. +## +## The server will send PING messages every 30 seconds (configurable server-side). +## This client automatically responds with PONG to reset the server's idle timeout. + signal connected signal disconnected signal message_received(opcode: int, data: Dictionary) @@ -7,13 +15,24 @@ signal connection_error(error: String) const SERVER_URL = "wss://srs.aeternalisgames.com/ws" +# WebSocket connection instance var socket: WebSocketPeer = WebSocketPeer.new() + +# Buffer for handling fragmented messages var _receive_buffer: PackedByteArray = PackedByteArray() + +# Connection state tracking var _is_connected: bool = false +# Statistics for monitoring connection health +var _last_ping_received_time: float = 0.0 +var _ping_count: int = 0 +var _pong_sent_count: int = 0 + func _ready(): set_process(false) +## Main processing loop - polls WebSocket and handles incoming messages func _process(_delta): socket.poll() @@ -26,7 +45,7 @@ func _process(_delta): print("[Network] WebSocket connected successfully") connected.emit() - # Receive data + # Receive and process all available packets while socket.get_available_packet_count() > 0: var packet = socket.get_packet() print("[Network] Received packet, size: ", packet.size()) @@ -36,24 +55,30 @@ func _process(_delta): print("[Network] WebSocket closing...") WebSocketPeer.STATE_CLOSED: - var code = socket.get_close_code() - var reason = socket.get_close_reason() - print("[Network] WebSocket closed - code: %d, reason: %s" % [code, reason]) + var close_code = socket.get_close_code() + var close_reason = socket.get_close_reason() + print("[Network] WebSocket closed - code: %d, reason: %s" % [close_code, close_reason]) + if _is_connected: _is_connected = false disconnected.emit() + set_process(false) +## Establish connection to game server func connect_to_server() -> Error: _receive_buffer.clear() + _ping_count = 0 + _pong_sent_count = 0 + _last_ping_received_time = 0.0 # Reset socket for fresh connection socket = WebSocketPeer.new() - # Increase buffer sizes for large dungeon data - socket.inbound_buffer_size = 8 * 1024 * 1024 # 8MB - socket.outbound_buffer_size = 1024 * 1024 # 1MB - socket.max_queued_packets = 4096 + # Increase buffer sizes for large dungeon data transfers + socket.inbound_buffer_size = 8 * 1024 * 1024 # 8MB for large state updates + socket.outbound_buffer_size = 1024 * 1024 # 1MB for outgoing messages + socket.max_queued_packets = 4096 # Handle burst traffic print("[Network] Attempting connection to: ", SERVER_URL) var err = socket.connect_to_url(SERVER_URL) @@ -67,124 +92,151 @@ func connect_to_server() -> Error: return err +## Gracefully disconnect from server func disconnect_from_server(): if _is_connected: socket.close() + print("[Network] Disconnecting from server...") -func send_message(opcode: int, payload: Dictionary = {}): - if socket.get_ready_state() != WebSocketPeer.STATE_OPEN: - push_warning("[Network] Cannot send - socket not open (state: %d)" % socket.get_ready_state()) +## Send a message to the server +## @param opcode: Message type identifier (see opcodes.gd) +## @param data: Dictionary of message data to send +func send_message(opcode: int, data: Dictionary = {}): + if not _is_connected: + push_warning("[Network] Cannot send message - not connected") return - # Encode payload to JSON bytes - var payload_json = JSON.stringify(payload) - var payload_bytes = payload_json.to_utf8_buffer() + # Serialize message to JSON + var json_string = JSON.stringify(data) + var payload = json_string.to_utf8_buffer() - # Create message envelope - matching JS client exactly - var message = { - "OpCode": opcode, - "Payload": Array(payload_bytes) # Array of ints, same as JS Array.from() - } - var message_json = JSON.stringify(message) - var message_bytes = message_json.to_utf8_buffer() + # Create frame: [4 bytes length][1 byte opcode][payload] + var frame_length = 1 + payload.size() + var frame = PackedByteArray() - # Create framed message with 4-byte big-endian length prefix - var length = message_bytes.size() - var framed = PackedByteArray() - framed.resize(4 + length) + # Write length as big-endian 32-bit integer + frame.append((frame_length >> 24) & 0xFF) + frame.append((frame_length >> 16) & 0xFF) + frame.append((frame_length >> 8) & 0xFF) + frame.append(frame_length & 0xFF) - # Big-endian length prefix - framed[0] = (length >> 24) & 0xFF - framed[1] = (length >> 16) & 0xFF - framed[2] = (length >> 8) & 0xFF - framed[3] = length & 0xFF + # Write opcode + frame.append(opcode) - # Copy message bytes - for i in range(length): - framed[4 + i] = message_bytes[i] + # Write payload + frame.append_array(payload) - print("[Network] Sending opcode %d, payload: %s" % [opcode, payload_json]) - print("[Network] Framed message size: %d bytes" % framed.size()) - - # Send as binary (default) - var send_err = socket.send(framed) - if send_err != OK: - print("[Network] Send error: ", send_err) - else: - print("[Network] Message sent successfully") + # Send to server + var err = socket.send(frame) + if err != OK: + push_error("[Network] Failed to send message, error: ", err) -func _handle_received_data(data: PackedByteArray): - # Append to buffer - _receive_buffer.append_array(data) - print("[Network] Buffer size after append: ", _receive_buffer.size()) +## Handle incoming data packets from server +func _handle_received_data(packet: PackedByteArray): + # Add to buffer + _receive_buffer.append_array(packet) - # Process complete messages - while _receive_buffer.size() >= 4: - # Read length (big-endian) - var length = (_receive_buffer[0] << 24) | \ - (_receive_buffer[1] << 16) | \ - (_receive_buffer[2] << 8) | \ - _receive_buffer[3] + # Process all complete messages in buffer + while _receive_buffer.size() >= 5: # Minimum: 4 bytes length + 1 byte opcode + # Read length (big-endian 32-bit integer) + var message_length = ( + (_receive_buffer[0] << 24) | + (_receive_buffer[1] << 16) | + (_receive_buffer[2] << 8) | + _receive_buffer[3] + ) - print("[Network] Message length header: ", length) - - if length <= 0 or length > 4194304: - push_error("[Network] Invalid message length: %d" % length) + # Validate message length + if message_length < 1 or message_length > 4 * 1024 * 1024: + push_error("[Network] Invalid message length: ", message_length) _receive_buffer.clear() + disconnect_from_server() return - if _receive_buffer.size() < 4 + length: - print("[Network] Waiting for more data, have %d, need %d" % [_receive_buffer.size(), 4 + length]) - return # Wait for more data + # Check if we have the complete message + var total_frame_size = 4 + message_length + if _receive_buffer.size() < total_frame_size: + # Incomplete message, wait for more data + break - # Extract message - var message_bytes = _receive_buffer.slice(4, 4 + length) - _receive_buffer = _receive_buffer.slice(4 + length) + # Extract opcode + var opcode = _receive_buffer[4] - # Parse JSON - var message_text = message_bytes.get_string_from_utf8() - print("[Network] Raw message: ", message_text.substr(0, 200)) # First 200 chars + # Extract payload (if any) + var payload_size = message_length - 1 + var payload_bytes = PackedByteArray() + if payload_size > 0: + payload_bytes = _receive_buffer.slice(5, 5 + payload_size) - var json = JSON.new() - var parse_result = json.parse(message_text) + # Remove processed message from buffer + _receive_buffer = _receive_buffer.slice(total_frame_size) - if parse_result != OK: - push_error("[Network] Failed to parse message JSON: " + json.get_error_message()) - continue - - var msg = json.data - var opcode: int = msg.get("opCode", msg.get("OpCode", 0)) - print("[Network] Parsed opcode: ", opcode) - - # Decode payload - var payload_data = msg.get("payload", msg.get("Payload", null)) - var decoded_data = {} - - if payload_data != null: - var payload_string: String - if payload_data is String: - # Base64 encoded - print("[Network] Payload is base64 string") - payload_string = Marshalls.base64_to_utf8(payload_data) - elif payload_data is Array: - # Array of bytes - print("[Network] Payload is byte array, size: ", payload_data.size()) - var byte_array = PackedByteArray(payload_data) - payload_string = byte_array.get_string_from_utf8() - else: - print("[Network] Payload is other type: ", typeof(payload_data)) - payload_string = JSON.stringify(payload_data) - - print("[Network] Decoded payload string: ", payload_string.substr(0, 200)) - - var payload_json = JSON.new() - if payload_json.parse(payload_string) == OK: - decoded_data = payload_json.data - else: - decoded_data = {"raw": payload_string} - - print("[Network] Emitting message_received with opcode: ", opcode) - message_received.emit(opcode, decoded_data) + # Handle the message + _handle_message(opcode, payload_bytes) -func is_socket_connected() -> bool: - return _is_connected and socket.get_ready_state() == WebSocketPeer.STATE_OPEN +## Process a single decoded message +func _handle_message(opcode: int, payload: PackedByteArray): + # Handle ping/pong messages internally (don't emit to game logic) + match opcode: + 2: # PING from server + _handle_ping_message() + return + + 3: # PONG from server (shouldn't happen, but handle gracefully) + print("[Network] Unexpected PONG received from server") + return + + # For all other messages, parse JSON payload and emit to game + var data = {} + + if payload.size() > 0: + var json_string = payload.get_string_from_utf8() + var json = JSON.new() + var parse_result = json.parse(json_string) + + if parse_result == OK: + data = json.data + else: + push_warning("[Network] Failed to parse JSON for opcode ", opcode) + print("[Network] JSON parse error: ", json.get_error_message()) + print("[Network] Invalid JSON: ", json_string) + + # Emit message to game logic + message_received.emit(opcode, data) + +## Handle PING message from server - respond with PONG +func _handle_ping_message(): + _ping_count += 1 + _last_ping_received_time = Time.get_ticks_msec() / 1000.0 + + print("[Network] PING received (count: %d), sending PONG..." % _ping_count) + + # Send PONG response (OpCode 3, empty payload) + var pong_frame = PackedByteArray() + + # Length: 1 byte (just the opcode) + pong_frame.append(0) # High bytes of length + pong_frame.append(0) + pong_frame.append(0) + pong_frame.append(1) # Low byte of length = 1 + + # OpCode: 3 (PONG) + pong_frame.append(3) + + # Send directly without going through send_message to avoid JSON overhead + var err = socket.send(pong_frame) + if err == OK: + _pong_sent_count += 1 + print("[Network] PONG sent successfully (count: %d)" % _pong_sent_count) + else: + push_error("[Network] Failed to send PONG, error: ", err) + +## Get connection statistics for debugging +func get_connection_stats() -> Dictionary: + return { + "is_connected": _is_connected, + "ping_count": _ping_count, + "pong_sent_count": _pong_sent_count, + "last_ping_seconds_ago": (Time.get_ticks_msec() / 1000.0) - _last_ping_received_time if _last_ping_received_time > 0 else -1, + "socket_state": socket.get_ready_state() + } diff --git a/scripts/autoload/opcodes.gd b/scripts/autoload/opcodes.gd index fdb5f84..9ffe311 100644 --- a/scripts/autoload/opcodes.gd +++ b/scripts/autoload/opcodes.gd @@ -1,97 +1,264 @@ extends Node -# Auth +## Network OpCodes - Message Type Identifiers +## +## This file defines all message types (opcodes) used for client-server communication. +## Each opcode represents a specific type of message or action. + +# ===== Keepalive / Connection Management (1-9) ===== + +## Echo test message - server echoes back the received payload +const ECHO = 1 + +## Server -> Client: Keepalive ping to prevent idle timeout +## Client should automatically respond with PONG +const PING = 2 + +## Client -> Server: Response to PING message +## Handled automatically by network.gd +const PONG = 3 + +# ===== Authentication (100-119) ===== + +## Client -> Server: Register new account const AUTH_REGISTER = 100 + +## Server -> Client: Registration result const AUTH_REGISTER_RESULT = 101 + +## Client -> Server: Login with username and password const AUTH_LOGIN = 110 + +## Server -> Client: Login result const AUTH_LOGIN_RESULT = 111 -# Hub +## Client -> Server: Authenticate using stored session token +const AUTH_WITH_TOKEN = 112 + +## Server -> Client: Token authentication result +const AUTH_WITH_TOKEN_RESULT = 113 + +# ===== Hub / Character Selection (200-249) ===== + +## Server -> Client: Hub state with character info const HUB_STATE = 200 + +## Client -> Server: Allocate stat points const STAT_ALLOCATE = 201 -# Inventory +## Client -> Server: Create new character +const CHAR_CREATE = 202 + +## Server -> Client: Character creation result +const CHAR_CREATE_RESULT = 203 + +## Client -> Server: Select character to play +const CHAR_SELECT = 204 + +## Server -> Client: Character selection result +const CHAR_SELECT_RESULT = 205 + +# ===== Inventory Management (250-259) ===== + +## Client -> Server: Request current inventory state const INVENTORY_REQUEST = 250 + +## Server -> Client: Current inventory state const INVENTORY_STATE = 251 + +## Client -> Server: Equip an item const EQUIP_ITEM = 252 + +## Client -> Server: Unequip an item const UNEQUIP_ITEM = 253 + +## Client -> Server: Use a consumable item const USE_ITEM = 254 + +## Client -> Server: Drop an item from inventory const DROP_ITEM = 255 + +## Client -> Server: Assign item to hotbar slot const HOTBAR_ASSIGN = 256 -# Chat +# ===== Chat (260-269) ===== + +## Client -> Server: Send chat message const CHAT_SEND = 260 + +## Server -> Client: Chat message from player const CHAT_MESSAGE = 261 -# Loot Chests +# ===== Loot Chests (270-279) ===== + +## Client -> Server: Open a loot chest const LOOT_CHEST_OPEN = 270 + +## Server -> Client: Loot chest contents const LOOT_CHEST_STATE = 271 + +## Client -> Server: Take specific item from chest const LOOT_CHEST_TAKE_ITEM = 272 + +## Client -> Server: Take all items from chest const LOOT_CHEST_TAKE_ALL = 273 + +## Client -> Server: Close loot chest UI const LOOT_CHEST_CLOSE = 274 + +## Server -> Client: New loot chest spawned in dungeon const LOOT_CHEST_SPAWNED = 275 -# Player Death +## Server -> Client: Loot chest removed/destroyed +const LOOT_CHEST_REMOVED = 276 + +# ===== Player Death (280-289) ===== + +## Server -> Client: Notify player what loot they lost on death const PLAYER_DEATH_LOOT_LOST = 280 -# Crafting -const CRAFTING_SKILLS_REQUEST = 330 -const CRAFTING_SKILLS_STATE = 331 -const CRAFTING_RECIPES_REQUEST = 332 -const CRAFTING_RECIPES_STATE = 333 -const CRAFTING_ATTEMPT = 334 -const CRAFTING_RESULT = 335 -const CRAFTING_SKILL_LEVELUP = 336 -const RECIPE_DISCOVERED = 337 -const RECIPE_SCROLL_USE = 338 +# ===== Dungeon Core (300-309) ===== -# Dungeon +## Client -> Server: Request to enter a dungeon const DUNGEON_ENTER = 300 + +## Server -> Client: Dungeon entry result const DUNGEON_ENTER_RESULT = 301 + +## Server -> Client: Current dungeon state snapshot const DUNGEON_STATE = 302 + +## Client -> Server: Leave current dungeon const DUNGEON_LEAVE = 303 + +## Server -> Client: Dungeon has been cleared (boss defeated) const DUNGEON_CLEARED = 304 + +## Server -> Client: Tile update (door opened, destructible destroyed, etc.) const DUNGEON_TILE_UPDATE = 305 -# Dungeon Browser +# ===== Dungeon Browser (310-319) ===== + +## Client -> Server: Request list of available dungeons const DUNGEON_LIST_REQUEST = 310 + +## Server -> Client: List of dungeons const DUNGEON_LIST_RESPONSE = 311 + +## Client -> Server: Create a new dungeon instance const DUNGEON_CREATE = 312 + +## Client -> Server: Join an existing dungeon const DUNGEON_JOIN = 313 -# Asset Management +# ===== Asset Management (320-329) ===== + +## Client -> Server: Request asset manifest (sprites, tilesets, etc.) const ASSET_MANIFEST_REQUEST = 320 + +## Server -> Client: Asset manifest response const ASSET_MANIFEST_RESPONSE = 321 -# Input +# ===== Crafting System (330-349) ===== + +## Client -> Server: Request crafting skills state +const CRAFTING_SKILLS_REQUEST = 330 + +## Server -> Client: Crafting skills state +const CRAFTING_SKILLS_STATE = 331 + +## Client -> Server: Request known crafting recipes +const CRAFTING_RECIPES_REQUEST = 332 + +## Server -> Client: Crafting recipes state +const CRAFTING_RECIPES_STATE = 333 + +## Client -> Server: Attempt to craft an item +const CRAFTING_ATTEMPT = 334 + +## Server -> Client: Crafting attempt result +const CRAFTING_RESULT = 335 + +## Server -> Client: Crafting skill leveled up +const CRAFTING_SKILL_LEVELUP = 336 + +## Server -> Client: New recipe discovered +const RECIPE_DISCOVERED = 337 + +## Client -> Server: Use a recipe scroll to learn recipe +const RECIPE_SCROLL_USE = 338 + +# ===== Dungeon Input / Actions (400-449) ===== + +## Client -> Server: Movement input const INPUT_MOVE = 400 + +## Client -> Server: Attack action const INPUT_ATTACK = 401 + +## Client -> Server: Pickup item from ground const INPUT_PICKUP = 402 + +## Client -> Server: Interact with chest const INPUT_CHEST = 403 + +## Client -> Server: Use portal const INPUT_PORTAL = 404 -# Escape / Portal +# ===== Escape / Portal (450-459) ===== + +## Client -> Server: Start escape channel (return to hub) const ESCAPE_START = 450 + +## Client -> Server: Cancel escape channel const ESCAPE_CANCEL = 451 + +## Server -> Client: Escape interrupted (took damage) const ESCAPE_INTERRUPTED = 452 + +## Server -> Client: Escape successful, returning to hub const ESCAPE_SUCCESS = 453 + +## Server -> Client: Portal successfully used const PORTAL_USED = 454 -# Events +# ===== Game Events (500-599) ===== + +## Server -> Client: Damage event occurred const EVENT_DAMAGE = 500 + +## Server -> Client: Entity died const EVENT_DEATH = 501 + +## Server -> Client: Player leveled up const EVENT_LEVELUP = 502 + +## Server -> Client: Loot obtained const EVENT_LOOT = 503 -# Server Broadcast +# ===== Server Broadcasts (600-609) ===== + +## Server -> All Clients: Server-wide broadcast message const SERVER_BROADCAST = 600 -# Stash (VIP Feature) +# ===== Stash System - VIP Feature (610-619) ===== + +## Client -> Server: Request stash contents const STASH_REQUEST = 610 + +## Server -> Client: Stash contents const STASH_STATE = 611 + +## Client -> Server: Deposit item from inventory to stash const STASH_DEPOSIT = 612 + +## Client -> Server: Withdraw item from stash to inventory const STASH_WITHDRAW = 613 + +## Server -> Client: Stash operation result const STASH_RESULT = 614 -# Legacy +# ===== Legacy / Deprecated ===== + +## Legacy loot notification (consider consolidating with EVENT_LOOT) const LOOT_RECEIVED = 160 diff --git a/scripts/ui/char_sheet.gd b/scripts/ui/char_sheet.gd new file mode 100644 index 0000000..9305aa8 --- /dev/null +++ b/scripts/ui/char_sheet.gd @@ -0,0 +1,78 @@ +extends CanvasLayer + +@onready var name_label = $Control/Panel/Name#$Control/HBoxContainer/LeftPanel/CharacterInfo/NameLabel +@onready var level_label = $Control/Panel/Level#$Control/HBoxContainer/LeftPanel/CharacterInfo/LevelLabel +@onready var xp_bar = $Control/Panel/ProgressBar#$Control/HBoxContainer/LeftPanel/CharacterInfo/XPBar +@onready var gold_label = $Control/Panel/Label#$Control/HBoxContainer/LeftPanel/CharacterInfo/GoldLabel + +@onready var str_value = $Control/Panel/HBoxContainer/StrFrame/DisplayCurrentStr/currentStrLabel#$Control/HBoxContainer/LeftPanel/StatsPanel/StrValue +@onready var int_value = $Control/Panel/HBoxContainer/IntFrame/DisplayCurrentInt/currentIntLabel#$Control/HBoxContainer/LeftPanel/StatsPanel/IntValue +@onready var wis_value = $Control/Panel/HBoxContainer/WisFrame/DisplayCurrentWis/currentWisLabel#$Control/HBoxContainer/LeftPanel/StatsPanel/WisValue +@onready var end_value = $Control/Panel/HBoxContainer/EndFrame/DisplayCurrentEnd/currentStrLabel#$Control/HBoxContainer/LeftPanel/StatsPanel/EndValue +@onready var dex_value = $Control/Panel/HBoxContainer/DexFrame/DisplayCurrentDex/currentDexLabel#$Control/HBoxContainer/LeftPanel/StatsPanel/DexValue +@onready var points_label = $Control/Panel/HBoxContainer/RemainingPoints/DisplayCurrentRP/currentRPLabel#$Control/HBoxContainer/LeftPanel/StatsPanel/PointsRemaining + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + for stat in ["Str", "Int", "Wis", "End", "Dex"]: + var btnMap = "plus%s" % stat + var folderMap = "%sFrame" % stat + var btn_path = "Control/Panel/HBoxContainer/%s/%s" % [folderMap, btnMap] + #var btn_path = "Control/HBoxContainer/LeftPanel/StatsPanel/%sButton" % stat + if has_node(btn_path): + var btn = get_node(btn_path) + btn.pressed.connect(_on_stat_allocate.bind(stat.to_lower())) + + call_deferred("_connect_gamestate") + +func _connect_gamestate(): + if GameState: + GameState.character_updated.connect(_update_ui) + +func _update_ui(): + var c = GameState.character + name_label.text = c.name + level_label.text = "Level %d" % c.level + xp_bar.min_value = _xp_required_for_level(c.level) + xp_bar.max_value = _xp_required_for_level(c.level+1) + xp_bar.value = c.xp + xp_bar.tooltip_text = str(c.xp," / ", _xp_required_for_level(c.level+1)) + + # Gold display + if gold_label: + gold_label.text = "Gold: %d" % c.get("gold", 0) + + str_value.text = str(c.strength) + int_value.text = str(c.intelligence) + wis_value.text = str(c.wisdom) + end_value.text = str(c.endurance) + dex_value.text = str(c.dexterity) + + points_label.text = str(c.unspent_points) #"Points: %d" % + + # Enable/disable stat buttons based on available points + var has_points = c.unspent_points > 0 + for stat in ["Str", "Int", "Wis", "End", "Dex"]: + var btnMap = "plus%s" % stat + var folderMap = "%sFrame" % stat + var btn_path = "Control/Panel/HBoxContainer/%s/%s" % [folderMap, btnMap] #Control/HBoxContainer/LeftPanel/StatsPanel/%sButton" % stat + if has_node(btn_path): + var btn = get_node(btn_path) + btn.disabled = not has_points + +func _xp_for_level(level: int) -> int: + return int(round(100 * pow(1.15, level))) + +func _xp_to_next_level(level: int) -> int: + return int(round(100 * pow(1.15, level - 1))) + + +func _xp_required_for_level(level: int) -> int: + if level <= 1: + return 0 + var total := 100 * (pow(1.15, level - 1) - 1.0) / (1.15 - 1.0) + return int(round(total)) + +func _on_stat_allocate(stat: String): + if GameState.character.unspent_points > 0: + GameState.send_allocate_stat(stat) diff --git a/scripts/ui/char_sheet.gd.uid b/scripts/ui/char_sheet.gd.uid new file mode 100644 index 0000000..97b8974 --- /dev/null +++ b/scripts/ui/char_sheet.gd.uid @@ -0,0 +1 @@ +uid://ixmjbaov0w5f diff --git a/scripts/ui/hub_ui.gd b/scripts/ui/hub_ui.gd index b145dd5..434863e 100644 --- a/scripts/ui/hub_ui.gd +++ b/scripts/ui/hub_ui.gd @@ -1,27 +1,29 @@ extends CanvasLayer -@onready var name_label = $Control/HBoxContainer/LeftPanel/CharacterInfo/NameLabel -@onready var level_label = $Control/HBoxContainer/LeftPanel/CharacterInfo/LevelLabel -@onready var xp_bar = $Control/HBoxContainer/LeftPanel/CharacterInfo/XPBar -@onready var gold_label = $Control/HBoxContainer/LeftPanel/CharacterInfo/GoldLabel - -@onready var str_value = $Control/HBoxContainer/LeftPanel/StatsPanel/StrValue -@onready var int_value = $Control/HBoxContainer/LeftPanel/StatsPanel/IntValue -@onready var wis_value = $Control/HBoxContainer/LeftPanel/StatsPanel/WisValue -@onready var end_value = $Control/HBoxContainer/LeftPanel/StatsPanel/EndValue -@onready var dex_value = $Control/HBoxContainer/LeftPanel/StatsPanel/DexValue -@onready var points_label = $Control/HBoxContainer/LeftPanel/StatsPanel/PointsRemaining +#@onready var name_label = $Control/Panel/Name#$Control/HBoxContainer/LeftPanel/CharacterInfo/NameLabel +#@onready var level_label = $Control/Panel/Level#$Control/HBoxContainer/LeftPanel/CharacterInfo/LevelLabel +#@onready var xp_bar = $Control/Panel/ProgressBar#$Control/HBoxContainer/LeftPanel/CharacterInfo/XPBar +#@onready var gold_label = $Control/Panel/Label#$Control/HBoxContainer/LeftPanel/CharacterInfo/GoldLabel +# +#@onready var str_value = $Control/Panel/HBoxContainer/StrFrame/DisplayCurrentStr/currentStrLabel#$Control/HBoxContainer/LeftPanel/StatsPanel/StrValue +#@onready var int_value = $Control/Panel/HBoxContainer/IntFrame/DisplayCurrentInt/currentIntLabel#$Control/HBoxContainer/LeftPanel/StatsPanel/IntValue +#@onready var wis_value = $Control/Panel/HBoxContainer/WisFrame/DisplayCurrentWis/currentWisLabel#$Control/HBoxContainer/LeftPanel/StatsPanel/WisValue +#@onready var end_value = $Control/Panel/HBoxContainer/EndFrame/DisplayCurrentEnd/currentStrLabel#$Control/HBoxContainer/LeftPanel/StatsPanel/EndValue +#@onready var dex_value = $Control/Panel/HBoxContainer/DexFrame/DisplayCurrentDex/currentDexLabel#$Control/HBoxContainer/LeftPanel/StatsPanel/DexValue +#@onready var points_label = $Control/Panel/HBoxContainer/RemainingPoints/DisplayCurrentRP/currentRPLabel#$Control/HBoxContainer/LeftPanel/StatsPanel/PointsRemaining @onready var enter_btn = $Control/HBoxContainer/RightPanel/EnterDungeonBtn @onready var browse_btn = $Control/HBoxContainer/RightPanel/BrowseDungeonsBtn @onready var dungeon_browser = $DungeonBrowser -@onready var inventory_btn = $Control/HBoxContainer/LeftPanel/MenuButtons/InventoryBtn -@onready var crafting_btn = $Control/HBoxContainer/LeftPanel/MenuButtons/CraftingBtn -@onready var stash_btn = $Control/HBoxContainer/LeftPanel/MenuButtons/StashBtn +@onready var inventory_btn = $Control/InventoryBtn#$Control/HBoxContainer/LeftPanel/MenuButtons/InventoryBtn +@onready var crafting_btn = $Control/CraftingBtn#$Control/HBoxContainer/LeftPanel/MenuButtons/CraftingBtn +@onready var stash_btn = $Control/StashBtn#$Control/HBoxContainer/LeftPanel/MenuButtons/StashBtn @onready var inventory_ui = $InventoryUI @onready var crafting_ui = $CraftingUI @onready var stash_ui = $StashUI +@onready var char_sheet_ui = $CharSheetUI +@onready var char_sheet_btn = $Control/CharSheetBtn var selected_tier: int = 1 @@ -39,6 +41,9 @@ func _ready(): crafting_btn.pressed.connect(_on_crafting_pressed) if stash_btn: stash_btn.pressed.connect(_on_stash_pressed) + if char_sheet_btn: + char_sheet_btn.pressed.connect(_toggle_char_sheet) + # Setup tier buttons for i in range(1, 6): @@ -47,51 +52,27 @@ func _ready(): var btn = get_node(btn_path) btn.pressed.connect(_on_tier_selected.bind(i)) - # Setup stat buttons - for stat in ["Str", "Int", "Wis", "End", "Dex"]: - var btn_path = "Control/HBoxContainer/LeftPanel/StatsPanel/%sButton" % stat - if has_node(btn_path): - var btn = get_node(btn_path) - btn.pressed.connect(_on_stat_allocate.bind(stat.to_lower())) # Defer GameState connection call_deferred("_connect_gamestate") +func _process(delta: float) -> void: + _handle_input() + +func _handle_input(): + if Input.is_action_just_pressed("charSheet"): + _toggle_char_sheet() + #if Input.is_action_just_pressed("inventory"): + #_toggle_inventory() + func _connect_gamestate(): - if GameState: - GameState.character_updated.connect(_update_ui) + #if GameState: + #GameState.character_updated.connect(_update_ui) # Request inventory when hub loads if GameState: GameState.request_inventory() -func _update_ui(): - var c = GameState.character - name_label.text = c.name - level_label.text = "Level %d" % c.level - xp_bar.max_value = c.xp_next - xp_bar.value = c.xp - - - # Gold display - if gold_label: - gold_label.text = "Gold: %d" % c.get("gold", 0) - - str_value.text = str(c.strength) - int_value.text = str(c.intelligence) - wis_value.text = str(c.wisdom) - end_value.text = str(c.endurance) - dex_value.text = str(c.dexterity) - - points_label.text = "Points: %d" % c.unspent_points - - # Enable/disable stat buttons based on available points - var has_points = c.unspent_points > 0 - for stat in ["Str", "Int", "Wis", "End", "Dex"]: - var btn_path = "Control/HBoxContainer/LeftPanel/StatsPanel/%sButton" % stat - if has_node(btn_path): - var btn = get_node(btn_path) - btn.disabled = not has_points func _on_tier_selected(tier: int): selected_tier = tier @@ -102,10 +83,6 @@ func _on_tier_selected(tier: int): var btn = get_node(btn_path) btn.button_pressed = (i == tier) -func _on_stat_allocate(stat: String): - if GameState.character.unspent_points > 0: - GameState.send_allocate_stat(stat) - func _on_enter_dungeon(): # Quick join - uses old system for backwards compatibility GameState.send_enter_dungeon(selected_tier) @@ -128,3 +105,7 @@ func _on_crafting_pressed(): func _on_stash_pressed(): if stash_ui: stash_ui.show_stash() + +func _toggle_char_sheet(): + if char_sheet_ui: + char_sheet_ui.visible = not char_sheet_ui.visible diff --git a/scripts/ui/inventory_ui.gd b/scripts/ui/inventory_ui.gd index 2a711b8..73c089b 100644 --- a/scripts/ui/inventory_ui.gd +++ b/scripts/ui/inventory_ui.gd @@ -91,14 +91,14 @@ func _setup_inventory_slots(): func _create_slot_button() -> Button: var btn = Button.new() btn.custom_minimum_size = Vector2(48, 48) - btn.add_theme_stylebox_override("normal", _create_slot_style(Color(0.15, 0.15, 0.2))) - btn.add_theme_stylebox_override("hover", _create_slot_style(Color(0.25, 0.25, 0.35))) + btn.add_theme_stylebox_override("normal", _create_slot_style(Color(0.408, 0.408, 0.322, 1.0))) + btn.add_theme_stylebox_override("hover", _create_slot_style(Color(0.408, 0.408, 0.322, 0.902))) return btn func _create_slot_style(color: Color) -> StyleBoxFlat: var style = StyleBoxFlat.new() style.bg_color = color - style.border_color = Color(0.3, 0.3, 0.4) + style.border_color = Color(0.0, 0.0, 0.0, 1.0) style.set_border_width_all(2) style.set_corner_radius_all(4) return style