diff --git a/game/player/Body.gd b/game/player/Body.gd index 2e2090b..273e78b 100644 --- a/game/player/Body.gd +++ b/game/player/Body.gd @@ -499,7 +499,7 @@ func on_c_controlled_changed(): set_process_input(false) set_process_unhandled_input(false) - var nameplatescn : PackedScene = ResourceLoader.load("res://ui/nameplates/NamePlate.tscn") + var nameplatescn : PackedScene = ResourceLoader.load("res://ui/2d/world/nameplates/NamePlate.tscn") _nameplate = nameplatescn.instance() get_parent().add_child(_nameplate) diff --git a/game/project.godot b/game/project.godot index 9c0d2b8..0e4cae8 100644 --- a/game/project.godot +++ b/game/project.godot @@ -355,7 +355,7 @@ config/version="0.2" Server="*res://autoload/Server.tscn" ThemeAtlas="*res://ui/autoload/ThemeAtlas.tscn" -WorldNumbers="*res://ui/world_numbers_2d/WorldNumbers.tscn" +WorldNumbers="*res://ui/2d/world/world_numbers_2d/WorldNumbers.tscn" CursorManager="*res://cursors/autoload/CursorManager.tscn" Settings="*res://ui/autoload/SettingsManager.tscn" Logger="*res://autoload/Logger.tscn" @@ -511,6 +511,311 @@ sheath={ "events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":80,"physical_scancode":0,"unicode":0,"echo":false,"script":null) ] } +move_forward={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":87,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +move_backward={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +move_left={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":65,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +move_right={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +actionbar_2_0={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_2_1={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_2_2={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_2_3={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_2_4={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_2_5={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_2_6={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_2_7={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_2_8={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_2_9={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_2_10={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_2_11={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_2_12={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_3_0={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_3_1={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_3_2={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_3_3={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_3_4={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_3_5={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_3_6={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_3_7={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_3_8={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_3_9={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_3_10={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_3_11={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_3_12={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_4_0={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_4_1={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_4_2={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_4_3={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_4_4={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_4_5={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_4_6={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_4_7={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_4_8={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_4_9={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_4_10={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_4_11={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_4_12={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_5_0={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_5_1={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_5_2={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_5_3={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_5_4={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_5_5={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_5_6={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_5_7={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_5_8={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_5_9={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_5_10={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_5_11={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_5_12={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_6_0={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_6_1={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_6_2={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_6_3={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_6_4={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_6_5={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_6_6={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_6_7={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_6_8={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_6_9={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_6_10={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_6_11={ +"deadzone": 0.5, +"events": [ ] +} +actionbar_6_12={ +"deadzone": 0.5, +"events": [ ] +} +jump={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":32,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +ui_prev_page={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777244,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +ui_next_page={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777245,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +ui_prev_page_2={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777254,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} +ui_next_page_2={ +"deadzone": 0.5, +"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777255,"physical_scancode":0,"unicode":0,"echo":false,"script":null) + ] +} [layer_names] @@ -554,3 +859,8 @@ quality/reflections/atlas_size=0 quality/depth/hdr=false quality/2d/use_batching=true quality/shadows/enabled=false + +[ui] + +actionbar/show_keybind_text=true +actionbar/show_cooldown_text=true diff --git a/game/scenes/Menu.tscn b/game/scenes/Menu.tscn index 48afb09..860e825 100644 --- a/game/scenes/Menu.tscn +++ b/game/scenes/Menu.tscn @@ -1,22 +1,22 @@ [gd_scene load_steps=18 format=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1] -[ext_resource path="res://ui/menu/CharacterEntry.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/menu/CharacterEntry.tscn" type="PackedScene" id=2] [ext_resource path="res://scenes/Menu.gd" type="Script" id=3] -[ext_resource path="res://ui/menu/menu_character_button_group.tres" type="ButtonGroup" id=4] +[ext_resource path="res://ui/player/menu/menu_character_button_group.tres" type="ButtonGroup" id=4] [ext_resource path="res://scenes/CharacterSelectorMenu.gd" type="Script" id=5] [ext_resource path="res://scenes/CharacterCreationMenu.gd" type="Script" id=6] -[ext_resource path="res://ui/menu/character_creation_button_group.tres" type="ButtonGroup" id=7] -[ext_resource path="res://ui/options/Options.tscn" type="PackedScene" id=8] -[ext_resource path="res://ui/register/Register.tscn" type="PackedScene" id=9] -[ext_resource path="res://ui/login/Login.tscn" type="PackedScene" id=10] +[ext_resource path="res://ui/player/menu/character_creation_button_group.tres" type="ButtonGroup" id=7] +[ext_resource path="res://ui/windows/options/Options.tscn" type="PackedScene" id=8] +[ext_resource path="res://ui/menu/register/Register.tscn" type="PackedScene" id=9] +[ext_resource path="res://ui/menu/login/Login.tscn" type="PackedScene" id=10] [ext_resource path="res://scenes/ConnectButton.gd" type="Script" id=11] [ext_resource path="res://scenes/HostButton.gd" type="Script" id=12] [ext_resource path="res://scenes/DisconnectButton.gd" type="Script" id=13] [ext_resource path="res://scenes/ConnectServerButton.gd" type="Script" id=14] [ext_resource path="res://scenes/HostGameButton.gd" type="Script" id=15] -[ext_resource path="res://menu/ExitButton.gd" type="Script" id=16] -[ext_resource path="res://ui/about/About.tscn" type="PackedScene" id=20] +[ext_resource path="res://scenes/menu/ExitButton.gd" type="Script" id=16] +[ext_resource path="res://ui/windows/about/About.tscn" type="PackedScene" id=20] [node name="Menu" type="Control"] anchor_right = 1.0 diff --git a/game/menu/ExitButton.gd b/game/scenes/menu/ExitButton.gd similarity index 100% rename from game/menu/ExitButton.gd rename to game/scenes/menu/ExitButton.gd diff --git a/game/scripts/game_modules/DataManager.tscn b/game/scripts/game_modules/DataManager.tscn index bd79578..6a2af37 100644 --- a/game/scripts/game_modules/DataManager.tscn +++ b/game/scripts/game_modules/DataManager.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://scripts/game_modules/DataManager.gd" type="Script" id=1] -[ext_resource path="res://ui/player_ui/player_ui.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/player_ui/player_ui.tscn" type="PackedScene" id=2] [node name="DataManager" type="Node"] script = ExtResource( 1 ) diff --git a/game/ui/touch_movement_controls/TouchMovementControls.tscn b/game/ui/2d/touch_movement_controls/TouchMovementControls.tscn similarity index 91% rename from game/ui/touch_movement_controls/TouchMovementControls.tscn rename to game/ui/2d/touch_movement_controls/TouchMovementControls.tscn index 6a59c42..7105681 100644 --- a/game/ui/touch_movement_controls/TouchMovementControls.tscn +++ b/game/ui/2d/touch_movement_controls/TouchMovementControls.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://ui/touch_pad/analog.tscn" type="PackedScene" id=1] -[ext_resource path="res://ui/touch_pad/TurnPanel.gd" type="Script" id=2] -[ext_resource path="res://ui/touch_pad/analog.gd" type="Script" id=3] +[ext_resource path="res://ui/2d/touch_pad/analog.tscn" type="PackedScene" id=1] +[ext_resource path="res://ui/2d/touch_pad/TurnPanel.gd" type="Script" id=2] +[ext_resource path="res://ui/2d/touch_pad/analog.gd" type="Script" id=3] [node name="TouchMovementControls" type="MarginContainer"] anchor_right = 1.0 diff --git a/game/ui/touch_movement_controls/game_module.tres b/game/ui/2d/touch_movement_controls/game_module.tres similarity index 68% rename from game/ui/touch_movement_controls/game_module.tres rename to game/ui/2d/touch_movement_controls/game_module.tres index d6fe9a7..d8aa239 100644 --- a/game/ui/touch_movement_controls/game_module.tres +++ b/game/ui/2d/touch_movement_controls/game_module.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://scripts/game_modules/ui_gui_child_module.gd" type="Script" id=1] -[ext_resource path="res://ui/touch_movement_controls/TouchMovementControls.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/2d/touch_movement_controls/TouchMovementControls.tscn" type="PackedScene" id=2] [resource] script = ExtResource( 1 ) diff --git a/game/ui/touch_pad/TurnPanel.gd b/game/ui/2d/touch_pad/TurnPanel.gd similarity index 100% rename from game/ui/touch_pad/TurnPanel.gd rename to game/ui/2d/touch_pad/TurnPanel.gd diff --git a/game/ui/touch_pad/analog.gd b/game/ui/2d/touch_pad/analog.gd similarity index 100% rename from game/ui/touch_pad/analog.gd rename to game/ui/2d/touch_pad/analog.gd diff --git a/game/ui/touch_pad/analog.tscn b/game/ui/2d/touch_pad/analog.tscn similarity index 90% rename from game/ui/touch_pad/analog.tscn rename to game/ui/2d/touch_pad/analog.tscn index a5187c5..a839043 100644 --- a/game/ui/touch_pad/analog.tscn +++ b/game/ui/2d/touch_pad/analog.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=8 format=2] -[ext_resource path="res://ui/touch_pad/analog.gd" type="Script" id=1] -[ext_resource path="res://ui/touch_pad/big_circle.png" type="Texture" id=2] -[ext_resource path="res://ui/touch_pad/small_circle.png" type="Texture" id=3] +[ext_resource path="res://ui/2d/touch_pad/analog.gd" type="Script" id=1] +[ext_resource path="res://ui/2d/touch_pad/big_circle.png" type="Texture" id=2] +[ext_resource path="res://ui/2d/touch_pad/small_circle.png" type="Texture" id=3] [sub_resource type="Animation" id=1] length = 5.0 diff --git a/game/ui/touch_pad/analog.xml b/game/ui/2d/touch_pad/analog.xml similarity index 100% rename from game/ui/touch_pad/analog.xml rename to game/ui/2d/touch_pad/analog.xml diff --git a/game/ui/touch_pad/big_circle.png b/game/ui/2d/touch_pad/big_circle.png similarity index 100% rename from game/ui/touch_pad/big_circle.png rename to game/ui/2d/touch_pad/big_circle.png diff --git a/game/ui/touch_pad/big_circle.png.import b/game/ui/2d/touch_pad/big_circle.png.import similarity index 70% rename from game/ui/touch_pad/big_circle.png.import rename to game/ui/2d/touch_pad/big_circle.png.import index 204dd35..2161509 100644 --- a/game/ui/touch_pad/big_circle.png.import +++ b/game/ui/2d/touch_pad/big_circle.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/big_circle.png-3e7d1c39c6dde9ffecb18aecfb2a2a19.stex" +path="res://.import/big_circle.png-46414ca93bcc155a825eb53547a6b7ce.stex" metadata={ "vram_texture": false } [deps] -source_file="res://ui/touch_pad/big_circle.png" -dest_files=[ "res://.import/big_circle.png-3e7d1c39c6dde9ffecb18aecfb2a2a19.stex" ] +source_file="res://ui/2d/touch_pad/big_circle.png" +dest_files=[ "res://.import/big_circle.png-46414ca93bcc155a825eb53547a6b7ce.stex" ] [params] diff --git a/game/ui/touch_pad/small_circle.png b/game/ui/2d/touch_pad/small_circle.png similarity index 100% rename from game/ui/touch_pad/small_circle.png rename to game/ui/2d/touch_pad/small_circle.png diff --git a/game/ui/touch_pad/small_circle.png.import b/game/ui/2d/touch_pad/small_circle.png.import similarity index 69% rename from game/ui/touch_pad/small_circle.png.import rename to game/ui/2d/touch_pad/small_circle.png.import index 9d3390f..637aba1 100644 --- a/game/ui/touch_pad/small_circle.png.import +++ b/game/ui/2d/touch_pad/small_circle.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/small_circle.png-035ef8e6fee54222401287369836bd6a.stex" +path="res://.import/small_circle.png-ebc16ca003bd7bbabc3f0a34458e6ba7.stex" metadata={ "vram_texture": false } [deps] -source_file="res://ui/touch_pad/small_circle.png" -dest_files=[ "res://.import/small_circle.png-035ef8e6fee54222401287369836bd6a.stex" ] +source_file="res://ui/2d/touch_pad/small_circle.png" +dest_files=[ "res://.import/small_circle.png-ebc16ca003bd7bbabc3f0a34458e6ba7.stex" ] [params] diff --git a/game/ui/touch_target_controls/TouchTargetControls.tscn b/game/ui/2d/touch_target_controls/TouchTargetControls.tscn similarity index 73% rename from game/ui/touch_target_controls/TouchTargetControls.tscn rename to game/ui/2d/touch_target_controls/TouchTargetControls.tscn index 8aea33b..69cdef4 100644 --- a/game/ui/touch_target_controls/TouchTargetControls.tscn +++ b/game/ui/2d/touch_target_controls/TouchTargetControls.tscn @@ -1,7 +1,6 @@ -[gd_scene load_steps=3 format=2] +[gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/touch_pad/analog.tscn" type="PackedScene" id=1] -[ext_resource path="res://ui/touch_pad/analog.gd" type="Script" id=2] +[ext_resource path="res://ui/2d/touch_pad/analog.tscn" type="PackedScene" id=1] [node name="TouchTargetControls" type="MarginContainer"] visible = false @@ -45,11 +44,6 @@ __meta__ = { "_edit_use_anchors_": false } -[node name="Analog" type="Node2D" parent="HBoxContainer/TargetPad" instance=ExtResource( 1 )] +[node name="Analog" parent="HBoxContainer/TargetPad" instance=ExtResource( 1 )] position = Vector2( 40, 30 ) -script = ExtResource( 2 ) -__meta__ = { -"__editor_plugin_screen__": "2D" -} -isDynamicallyShowing = true padname = "TargetPad" diff --git a/game/ui/touch_target_controls/game_module.tres b/game/ui/2d/touch_target_controls/game_module.tres similarity index 69% rename from game/ui/touch_target_controls/game_module.tres rename to game/ui/2d/touch_target_controls/game_module.tres index dc68a36..a00e69a 100644 --- a/game/ui/touch_target_controls/game_module.tres +++ b/game/ui/2d/touch_target_controls/game_module.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://scripts/game_modules/ui_gui_child_module.gd" type="Script" id=1] -[ext_resource path="res://ui/touch_target_controls/TouchTargetControls.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/2d/touch_target_controls/TouchTargetControls.tscn" type="PackedScene" id=2] [resource] script = ExtResource( 1 ) diff --git a/game/ui/nameplates/NamePlate.tscn b/game/ui/2d/world/nameplates/NamePlate.tscn similarity index 90% rename from game/ui/nameplates/NamePlate.tscn rename to game/ui/2d/world/nameplates/NamePlate.tscn index 43518ef..ec9b5e8 100644 --- a/game/ui/nameplates/NamePlate.tscn +++ b/game/ui/2d/world/nameplates/NamePlate.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://ui/nameplates/name_plate_theme.tres" type="Theme" id=1] -[ext_resource path="res://ui/nameplates/texture_progress_fg.tres" type="Texture" id=2] +[ext_resource path="res://ui/2d/world/nameplates/name_plate_theme.tres" type="Theme" id=1] +[ext_resource path="res://ui/2d/world/nameplates/texture_progress_fg.tres" type="Texture" id=2] [ext_resource path="res://player/NamePlate.gd" type="Script" id=3] [node name="NamePlate" type="VBoxContainer"] diff --git a/game/ui/nameplates/name_plate_dynamicfont.tres b/game/ui/2d/world/nameplates/name_plate_dynamicfont.tres similarity index 100% rename from game/ui/nameplates/name_plate_dynamicfont.tres rename to game/ui/2d/world/nameplates/name_plate_dynamicfont.tres diff --git a/game/ui/nameplates/name_plate_theme.tres b/game/ui/2d/world/nameplates/name_plate_theme.tres similarity index 85% rename from game/ui/nameplates/name_plate_theme.tres rename to game/ui/2d/world/nameplates/name_plate_theme.tres index 83e5895..ed019d9 100644 --- a/game/ui/nameplates/name_plate_theme.tres +++ b/game/ui/2d/world/nameplates/name_plate_theme.tres @@ -1,6 +1,4 @@ -[gd_resource type="Theme" load_steps=4 format=2] - -[ext_resource path="res://ui/nameplates/name_plate_dynamicfont.tres" type="DynamicFont" id=1] +[gd_resource type="Theme" load_steps=3 format=2] [sub_resource type="StyleBoxFlat" id=1] bg_color = Color( 0.0627451, 0.0627451, 0.0627451, 0.823529 ) @@ -19,7 +17,6 @@ corner_radius_bottom_left = 5 anti_aliasing = false [resource] -default_font = ExtResource( 1 ) Label/colors/font_color = Color( 1, 1, 1, 1 ) Label/colors/font_color_shadow = Color( 0, 0, 0, 0 ) Label/colors/font_outline_modulate = Color( 1, 1, 1, 1 ) diff --git a/game/ui/nameplates/texture_progress_bg.tres b/game/ui/2d/world/nameplates/texture_progress_bg.tres similarity index 100% rename from game/ui/nameplates/texture_progress_bg.tres rename to game/ui/2d/world/nameplates/texture_progress_bg.tres diff --git a/game/ui/nameplates/texture_progress_fg.tres b/game/ui/2d/world/nameplates/texture_progress_fg.tres similarity index 100% rename from game/ui/nameplates/texture_progress_fg.tres rename to game/ui/2d/world/nameplates/texture_progress_fg.tres diff --git a/game/ui/world_numbers_2d/Number.gd b/game/ui/2d/world/world_numbers_2d/Number.gd similarity index 100% rename from game/ui/world_numbers_2d/Number.gd rename to game/ui/2d/world/world_numbers_2d/Number.gd diff --git a/game/ui/world_numbers_2d/Number.tscn b/game/ui/2d/world/world_numbers_2d/Number.tscn similarity index 93% rename from game/ui/world_numbers_2d/Number.tscn rename to game/ui/2d/world/world_numbers_2d/Number.tscn index f93c25c..d560480 100644 --- a/game/ui/world_numbers_2d/Number.tscn +++ b/game/ui/2d/world/world_numbers_2d/Number.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://ui/world_numbers_2d/Number.gd" type="Script" id=1] -[ext_resource path="res://ui/world_numbers_2d/number_font.tres" type="DynamicFont" id=2] +[ext_resource path="res://ui/2d/world/world_numbers_2d/Number.gd" type="Script" id=1] +[ext_resource path="res://ui/2d/world/world_numbers_2d/number_font.tres" type="DynamicFont" id=2] [sub_resource type="Animation" id=1] diff --git a/game/ui/world_numbers_2d/WorldNumbers.gd b/game/ui/2d/world/world_numbers_2d/WorldNumbers.gd similarity index 100% rename from game/ui/world_numbers_2d/WorldNumbers.gd rename to game/ui/2d/world/world_numbers_2d/WorldNumbers.gd diff --git a/game/ui/2d/world/world_numbers_2d/WorldNumbers.tscn b/game/ui/2d/world/world_numbers_2d/WorldNumbers.tscn new file mode 100644 index 0000000..8fe450c --- /dev/null +++ b/game/ui/2d/world/world_numbers_2d/WorldNumbers.tscn @@ -0,0 +1,8 @@ +[gd_scene load_steps=3 format=2] + +[ext_resource path="res://ui/2d/world/world_numbers_2d/WorldNumbers.gd" type="Script" id=1] +[ext_resource path="res://ui/2d/world/world_numbers_2d/Number.tscn" type="PackedScene" id=2] + +[node name="WorldNumbers" type="Node"] +script = ExtResource( 1 ) +number_scene = ExtResource( 2 ) diff --git a/game/ui/world_numbers_2d/number_font.tres b/game/ui/2d/world/world_numbers_2d/number_font.tres similarity index 100% rename from game/ui/world_numbers_2d/number_font.tres rename to game/ui/2d/world/world_numbers_2d/number_font.tres diff --git a/game/ui/autoload/SettingsManager.gd b/game/ui/autoload/SettingsManager.gd index 665f517..4adb7f0 100644 --- a/game/ui/autoload/SettingsManager.gd +++ b/game/ui/autoload/SettingsManager.gd @@ -1,6 +1,6 @@ extends Node -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -42,10 +42,14 @@ var _settings : Dictionary = { "use_vsync" : ProjectSettings.get("display/window/vsync/use_vsync"), "vsync_via_compositor" : ProjectSettings.get("display/window/vsync/vsync_via_compositor"), }, + "game" : { + }, "ui" : { "touchscreen_mode" : OS.has_touchscreen_ui_hint(), "ui_scale" : ProjectSettings.get("display/window/size/ui_scale"), "ui_scale_touch" : ProjectSettings.get("display/window/size/ui_scale_touch"), + "actionbar_show_keybind_text" : ProjectSettings.get("ui/actionbar/show_keybind_text"), + "actionbar_show_coldown_text" : ProjectSettings.get("ui/actionbar/show_cooldown_text"), }, "debug" : { "debug_info" : false @@ -183,6 +187,12 @@ func set_ui_ui_scale_touch(value : float) -> void: ProjectSettings.set("rendering/window/size/ui_scale_touch", value) set_stretch() +func set_ui_actionbar_show_keybind_text(value : bool) -> void: + ProjectSettings.set("ui/actionbar/show_keybind_text", value) + +func set_ui_actionbar_show_coldown_text(value : bool) -> void: + ProjectSettings.set("ui/actionbar/show_cooldown_text", value) + func set_stretch(): if !loaded: return diff --git a/game/ui/autoload/ThemeAtlas.gd b/game/ui/autoload/ThemeAtlas.gd index a343294..60ab3ac 100644 --- a/game/ui/autoload/ThemeAtlas.gd +++ b/game/ui/autoload/ThemeAtlas.gd @@ -1,6 +1,6 @@ extends TextureMerger -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/autoload/WorldNumbers.tscn b/game/ui/autoload/WorldNumbers.tscn deleted file mode 100644 index 2281e4d..0000000 --- a/game/ui/autoload/WorldNumbers.tscn +++ /dev/null @@ -1,8 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://ui/numbers/Number.tscn" type="PackedScene" id=1] -[ext_resource path="res://ui/autoload/WorldNumbers.gd" type="Script" id=2] - -[node name="WorldNumbers" type="Node"] -script = ExtResource( 2 ) -number_scene = ExtResource( 1 ) diff --git a/game/ui/debug/DebugInfo.gd b/game/ui/debug/DebugInfo.gd index 0a9b01a..960663e 100644 --- a/game/ui/debug/DebugInfo.gd +++ b/game/ui/debug/DebugInfo.gd @@ -1,6 +1,6 @@ extends Label -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/debug/debuginfo_font.tres b/game/ui/debug/debuginfo_font.tres index e07ee08..c2b720d 100644 --- a/game/ui/debug/debuginfo_font.tres +++ b/game/ui/debug/debuginfo_font.tres @@ -2,6 +2,7 @@ [ext_resource path="res://fonts/VT323-Regular.ttf" type="DynamicFontData" id=1] + [resource] size = 11 font_data = ExtResource( 1 ) diff --git a/game/ui/login/Login.tscn b/game/ui/menu/login/Login.tscn similarity index 100% rename from game/ui/login/Login.tscn rename to game/ui/menu/login/Login.tscn diff --git a/game/ui/register/Register.tscn b/game/ui/menu/register/Register.tscn similarity index 100% rename from game/ui/register/Register.tscn rename to game/ui/menu/register/Register.tscn diff --git a/game/ui/numbers/Number.gd b/game/ui/numbers/Number.gd deleted file mode 100644 index 6bd67d2..0000000 --- a/game/ui/numbers/Number.gd +++ /dev/null @@ -1,87 +0,0 @@ -extends Label - -# Copyright (c) 2019-2020 Péter Magyar -# -# 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. - -export(NodePath) var animation_player_path : NodePath = "AnimationPlayer" - -export(Color) var damage_color : Color = Color.yellow -export(Color) var heal_color : Color = Color.green - -var world_position : Vector3 = Vector3() -var animation_player : AnimationPlayer = null -var camera : Camera = null - -func _ready() -> void: - animation_player = get_node(animation_player_path) as AnimationPlayer - - animation_player.connect("animation_finished", self, "animation_finished") - - set_process(false) - -func _process(delta): - if camera == null: - return - - var cam_pos : Vector3 = camera.global_transform.xform(Vector3()) - var dstv : Vector3 = cam_pos - world_position - dstv.y = 0 -# var dst : float = dstv.length_squared() - - var cam_facing : Vector3 = -camera.global_transform.basis.z - var d : float = cam_facing.dot(dstv) - - if d > 0: - if visible: - hide() - return - else: - if not visible: - show() - - var screen_position : Vector2 = camera.unproject_position(world_position) - var new_pos : Vector2 = Vector2(screen_position.x + rect_position.x, screen_position.y + rect_position.y - 60) - - set_position(new_pos) - - -func damage(pos : Vector3, value : int, crit : bool) -> void: - setup(pos, damage_color, value, crit) - -func heal(pos : Vector3, value : int, crit : bool) -> void: - setup(pos, heal_color, value, crit) - -func setup(pos : Vector3, color : Color, value : int, crit : bool) -> void: - world_position = pos - - camera = get_tree().get_root().get_camera() as Camera - - text = str(value) - add_color_override("font_color", color) - - if crit: - animation_player.play("crit") - else: - animation_player.play("normal") - - set_process(true) - -func animation_finished(anim_name : String) -> void: - queue_free() diff --git a/game/ui/numbers/Number.tscn b/game/ui/numbers/Number.tscn deleted file mode 100644 index c9dc9dd..0000000 --- a/game/ui/numbers/Number.tscn +++ /dev/null @@ -1,92 +0,0 @@ -[gd_scene load_steps=5 format=2] - -[ext_resource path="res://ui/numbers/Number.gd" type="Script" id=1] -[ext_resource path="res://ui/numbers/number_font.tres" type="DynamicFont" id=2] - -[sub_resource type="Animation" id=1] -resource_name = "crit" -length = 1.5 -tracks/0/type = "value" -tracks/0/path = NodePath(".:rect_scale") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/keys = { -"times": PoolRealArray( 0, 0.05, 0.3, 1.5 ), -"transitions": PoolRealArray( 1, 0.307786, 1, 1.36604 ), -"update": 0, -"values": [ Vector2( 0.1, 0.1 ), Vector2( 1.5, 1.5 ), Vector2( 1.3, 1.3 ), Vector2( 1.3, 1.3 ) ] -} -tracks/1/type = "value" -tracks/1/path = NodePath(".:rect_position") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/keys = { -"times": PoolRealArray( 0, 0.6, 1.5 ), -"transitions": PoolRealArray( 1, 1, 1 ), -"update": 0, -"values": [ Vector2( -50, 20 ), Vector2( -50, 20 ), Vector2( -50, 10 ) ] -} -tracks/2/type = "value" -tracks/2/path = NodePath(".:modulate") -tracks/2/interp = 1 -tracks/2/loop_wrap = true -tracks/2/imported = false -tracks/2/enabled = true -tracks/2/keys = { -"times": PoolRealArray( 0, 1.2, 1.5 ), -"transitions": PoolRealArray( 1, 1, 4 ), -"update": 0, -"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ] -} - -[sub_resource type="Animation" id=2] -resource_name = "normal" -length = 2.0 -tracks/0/type = "value" -tracks/0/path = NodePath(".:rect_position") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/keys = { -"times": PoolRealArray( 0, 2 ), -"transitions": PoolRealArray( 1, 1 ), -"update": 0, -"values": [ Vector2( -50, 20 ), Vector2( -50, 0 ) ] -} -tracks/1/type = "value" -tracks/1/path = NodePath(".:modulate") -tracks/1/interp = 1 -tracks/1/loop_wrap = true -tracks/1/imported = false -tracks/1/enabled = true -tracks/1/keys = { -"times": PoolRealArray( 0, 1.5, 2 ), -"transitions": PoolRealArray( 1, 1, 4 ), -"update": 0, -"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ] -} - -[node name="Number" type="Label"] -modulate = Color( 1, 1, 1, 0 ) -margin_left = -50.0 -margin_right = 50.0 -margin_bottom = 40.0006 -rect_scale = Vector2( 1.3, 1.3 ) -rect_pivot_offset = Vector2( 50, 20 ) -custom_fonts/font = ExtResource( 2 ) -custom_colors/font_color = Color( 0.870588, 0.898039, 0.0117647, 1 ) -align = 1 -valign = 1 -script = ExtResource( 1 ) -__meta__ = { -"_edit_use_anchors_": false -} - -[node name="AnimationPlayer" type="AnimationPlayer" parent="."] -anims/crit = SubResource( 1 ) -anims/normal = SubResource( 2 ) diff --git a/game/ui/numbers/number_font.tres b/game/ui/numbers/number_font.tres deleted file mode 100644 index 6f185f3..0000000 --- a/game/ui/numbers/number_font.tres +++ /dev/null @@ -1,8 +0,0 @@ -[gd_resource type="DynamicFont" load_steps=2 format=2] - -[ext_resource path="res://fonts/VT323-Regular.ttf" type="DynamicFontData" id=1] - - -[resource] -size = 12 -font_data = ExtResource( 1 ) diff --git a/game/ui/actionbars/ActionBar.gd b/game/ui/player/actionbars/ActionBar.gd similarity index 97% rename from game/ui/actionbars/ActionBar.gd rename to game/ui/player/actionbars/ActionBar.gd index e69ed0d..613b3d7 100644 --- a/game/ui/actionbars/ActionBar.gd +++ b/game/ui/player/actionbars/ActionBar.gd @@ -1,6 +1,6 @@ extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/actionbars/ActionBar.tscn b/game/ui/player/actionbars/ActionBar.tscn similarity index 80% rename from game/ui/actionbars/ActionBar.tscn rename to game/ui/player/actionbars/ActionBar.tscn index 3a2b8da..22b4f74 100644 --- a/game/ui/actionbars/ActionBar.tscn +++ b/game/ui/player/actionbars/ActionBar.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/actionbars/ActionBarEntry.tscn" type="PackedScene" id=1] -[ext_resource path="res://ui/actionbars/ActionBar.gd" type="Script" id=2] +[ext_resource path="res://ui/player/actionbars/ActionBarEntry.tscn" type="PackedScene" id=1] +[ext_resource path="res://ui/player/actionbars/ActionBar.gd" type="Script" id=2] [node name="ActionBar" type="VBoxContainer"] anchor_left = 1.0 diff --git a/game/ui/actionbars/ActionBarEntry.gd b/game/ui/player/actionbars/ActionBarEntry.gd similarity index 91% rename from game/ui/actionbars/ActionBarEntry.gd rename to game/ui/player/actionbars/ActionBarEntry.gd index e3b10c2..3e64a25 100644 --- a/game/ui/actionbars/ActionBarEntry.gd +++ b/game/ui/player/actionbars/ActionBarEntry.gd @@ -1,6 +1,6 @@ extends Button -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -44,6 +44,9 @@ var categ_cd : float = 0 var has_gcd : bool = false var gcd : float = 0.0 +var show_keybind_text : bool = true +var show_cooldown_text : bool = true + func _ready() -> void: button = get_node(button_path) as Button icon_rect = get_node(icon_path) as TextureRect @@ -56,6 +59,19 @@ func _ready() -> void: ProfileManager.connect("keybinds_changed", self, "on_keybinds_changed") + show_keybind_text = Settings.get_value("ui", "actionbar_show_keybind_text") + show_cooldown_text = Settings.get_value("ui", "actionbar_show_coldown_text") + + Settings.connect("setting_changed", self, "on_setting_changed") + + if show_keybind_text: + keybind_text.show() + else: + keybind_text.hide() + + if !show_cooldown_text: + cooldown_text.hide() + func _exit_tree(): if icon_rect.texture != null: ThemeAtlas.unref_texture(icon_rect.texture) @@ -90,7 +106,9 @@ func _process(delta : float) -> void: func set_cooldown_time(time : float) -> void: cooldown_indicator.value = time - cooldown_text.text = str(int(time)) + + if show_cooldown_text: + cooldown_text.text = str(int(time)) func show_cooldown_timer(max_time : float) -> void: if cooldown_indicator.visible and cooldown_indicator.max_value < max_time: @@ -100,11 +118,15 @@ func show_cooldown_timer(max_time : float) -> void: cooldown_indicator.max_value = max_time cooldown_indicator.show() - cooldown_text.show() + + if show_cooldown_text: + cooldown_text.show() func hide_cooldown_timer() -> void: cooldown_indicator.hide() - cooldown_text.hide() + + if show_cooldown_text: + cooldown_text.hide() func set_button_entry(action_bar_button_entry: ActionBarButtonEntry, p_player: Entity) -> void: player = p_player @@ -386,3 +408,24 @@ func _cgcd_started(e : Entity, value :float) -> void: func _cgcd_finished(val) -> void: gcd = 0 + +func on_setting_changed(section, key, value): + if section == "ui": + if key == "actionbar_show_keybind_text": + show_keybind_text = value + + if show_keybind_text: + keybind_text.show() + else: + keybind_text.hide() + + elif key == "actionbar_show_coldown_text": + show_cooldown_text = value + + if cd > 0.2 || categ_cd > 0.2: + #The update loop should take care of the rest + if show_cooldown_text: + cooldown_text.show() + else: + cooldown_text.hide() + diff --git a/game/ui/actionbars/ActionBarEntry.tscn b/game/ui/player/actionbars/ActionBarEntry.tscn similarity index 94% rename from game/ui/actionbars/ActionBarEntry.tscn rename to game/ui/player/actionbars/ActionBarEntry.tscn index 06aa5e9..b6c0825 100644 --- a/game/ui/actionbars/ActionBarEntry.tscn +++ b/game/ui/player/actionbars/ActionBarEntry.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://ui/actionbars/ActionBarEntry.gd" type="Script" id=1] +[ext_resource path="res://ui/player/actionbars/ActionBarEntry.gd" type="Script" id=1] [ext_resource path="res://ui/theme/cooldown_progress.png" type="Texture" id=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=3] [ext_resource path="res://ui/theme/actionbar_dynamicfont.tres" type="DynamicFont" id=5] @@ -9,12 +9,10 @@ margin_right = 46.0 margin_bottom = 46.0 rect_min_size = Vector2( 46, 46 ) -focus_mode = 0 theme = ExtResource( 3 ) shortcut_in_tooltip = false action_mode = 0 button_mask = 3 -enabled_focus_mode = 0 keep_pressed_outside = true script = ExtResource( 1 ) __meta__ = { diff --git a/game/ui/actionbars/Actionbars.gd b/game/ui/player/actionbars/Actionbars.gd similarity index 94% rename from game/ui/actionbars/Actionbars.gd rename to game/ui/player/actionbars/Actionbars.gd index 2e0c96d..73e352f 100644 --- a/game/ui/actionbars/Actionbars.gd +++ b/game/ui/player/actionbars/Actionbars.gd @@ -1,6 +1,6 @@ extends Node -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -49,6 +49,7 @@ func _centity_data_changed(cls: EntityData) -> void: return _abp = _player.get_action_bar_profile() + _abp.connect("changed", self, "on_changed") for i in range(_abp.get_action_bar_count()): var abe = _abp.get_action_bar(i) @@ -67,4 +68,6 @@ func clear_actionbars() -> void: for c in children: c.queue_free() - +func on_changed() -> void: + #todo + pass diff --git a/game/ui/actionbars/Actionbars.tscn b/game/ui/player/actionbars/Actionbars.tscn similarity index 66% rename from game/ui/actionbars/Actionbars.tscn rename to game/ui/player/actionbars/Actionbars.tscn index af3f2b7..78095e8 100644 --- a/game/ui/actionbars/Actionbars.tscn +++ b/game/ui/player/actionbars/Actionbars.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/actionbars/Actionbars.gd" type="Script" id=1] -[ext_resource path="res://ui/actionbars/ActionBar.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/actionbars/Actionbars.gd" type="Script" id=1] +[ext_resource path="res://ui/player/actionbars/ActionBar.tscn" type="PackedScene" id=2] [node name="Actionbars" type="HBoxContainer"] anchor_right = 1.0 diff --git a/game/ui/actionbars/EditorKeybindSetup.gd b/game/ui/player/actionbars/EditorKeybindSetup.gd similarity index 97% rename from game/ui/actionbars/EditorKeybindSetup.gd rename to game/ui/player/actionbars/EditorKeybindSetup.gd index df71843..8ed0eb1 100644 --- a/game/ui/actionbars/EditorKeybindSetup.gd +++ b/game/ui/player/actionbars/EditorKeybindSetup.gd @@ -1,7 +1,7 @@ tool extends Node -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/actionbars/game_module.tres b/game/ui/player/actionbars/game_module.tres similarity index 72% rename from game/ui/actionbars/game_module.tres rename to game/ui/player/actionbars/game_module.tres index a301a86..6cf620a 100644 --- a/game/ui/actionbars/game_module.tres +++ b/game/ui/player/actionbars/game_module.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://scripts/game_modules/ui_gui_child_module.gd" type="Script" id=1] -[ext_resource path="res://ui/actionbars/Actionbars.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/actionbars/Actionbars.tscn" type="PackedScene" id=2] [resource] script = ExtResource( 1 ) diff --git a/game/ui/auraframe/AuraEntry.gd b/game/ui/player/auraframe/AuraEntry.gd similarity index 100% rename from game/ui/auraframe/AuraEntry.gd rename to game/ui/player/auraframe/AuraEntry.gd diff --git a/game/ui/auraframe/AuraEntry.tscn b/game/ui/player/auraframe/AuraEntry.tscn similarity index 97% rename from game/ui/auraframe/AuraEntry.tscn rename to game/ui/player/auraframe/AuraEntry.tscn index 7154325..c6659f7 100644 --- a/game/ui/auraframe/AuraEntry.tscn +++ b/game/ui/player/auraframe/AuraEntry.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/auraframe/AuraEntry.gd" type="Script" id=1] +[ext_resource path="res://ui/player/auraframe/AuraEntry.gd" type="Script" id=1] [ext_resource path="res://ui/theme/ui_dynamicfont_small.tres" type="DynamicFont" id=2] [node name="AuraEntry" type="VBoxContainer"] diff --git a/game/ui/auraframe/AuraFrame.gd b/game/ui/player/auraframe/AuraFrame.gd similarity index 100% rename from game/ui/auraframe/AuraFrame.gd rename to game/ui/player/auraframe/AuraFrame.gd diff --git a/game/ui/auraframe/AuraFrame.tscn b/game/ui/player/auraframe/AuraFrame.tscn similarity index 82% rename from game/ui/auraframe/AuraFrame.tscn rename to game/ui/player/auraframe/AuraFrame.tscn index 3290e0a..888023e 100644 --- a/game/ui/auraframe/AuraFrame.tscn +++ b/game/ui/player/auraframe/AuraFrame.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/auraframe/AuraFrame.gd" type="Script" id=1] -[ext_resource path="res://ui/auraframe/AuraEntry.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/auraframe/AuraFrame.gd" type="Script" id=1] +[ext_resource path="res://ui/player/auraframe/AuraEntry.tscn" type="PackedScene" id=2] [node name="AuraFrame" type="Control"] anchor_right = 1.0 @@ -20,6 +20,10 @@ anchor_left = 1.0 anchor_right = 1.0 margin_left = -335.0 margin_bottom = 157.0 +mouse_filter = 2 +__meta__ = { +"_edit_use_anchors_": false +} [node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"] margin_right = 335.0 diff --git a/game/ui/unitframes/game_module.tres b/game/ui/player/auraframe/game_module.tres similarity index 72% rename from game/ui/unitframes/game_module.tres rename to game/ui/player/auraframe/game_module.tres index 8a6ca14..01d05a3 100644 --- a/game/ui/unitframes/game_module.tres +++ b/game/ui/player/auraframe/game_module.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://scripts/game_modules/ui_gui_child_module.gd" type="Script" id=1] -[ext_resource path="res://ui/unitframes/Unitframes.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/auraframe/AuraFrame.tscn" type="PackedScene" id=2] [resource] script = ExtResource( 1 ) diff --git a/game/ui/bags/Bag.tscn b/game/ui/player/bags/Bag.tscn similarity index 96% rename from game/ui/bags/Bag.tscn rename to game/ui/player/bags/Bag.tscn index 08de2b7..16482a1 100644 --- a/game/ui/bags/Bag.tscn +++ b/game/ui/player/bags/Bag.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=6 format=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1] -[ext_resource path="res://ui/bags/InventoryGUI.gd" type="Script" id=2] -[ext_resource path="res://ui/bags/BagEntry.tscn" type="PackedScene" id=3] -[ext_resource path="res://ui/bags/EquipmentSlot.tscn" type="PackedScene" id=4] -[ext_resource path="res://ui/bags/ItemTooltip.tscn" type="PackedScene" id=5] +[ext_resource path="res://ui/player/bags/InventoryGUI.gd" type="Script" id=2] +[ext_resource path="res://ui/player/bags/BagEntry.tscn" type="PackedScene" id=3] +[ext_resource path="res://ui/player/bags/EquipmentSlot.tscn" type="PackedScene" id=4] +[ext_resource path="res://ui/player/bags/ItemTooltip.tscn" type="PackedScene" id=5] [node name="Inventory" type="Control"] anchor_right = 1.0 diff --git a/game/ui/bags/BagEntry.gd b/game/ui/player/bags/BagEntry.gd similarity index 99% rename from game/ui/bags/BagEntry.gd rename to game/ui/player/bags/BagEntry.gd index e502bbe..a9569c8 100644 --- a/game/ui/bags/BagEntry.gd +++ b/game/ui/player/bags/BagEntry.gd @@ -1,6 +1,6 @@ extends Button -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/bags/BagEntry.tscn b/game/ui/player/bags/BagEntry.tscn similarity index 96% rename from game/ui/bags/BagEntry.tscn rename to game/ui/player/bags/BagEntry.tscn index bd0587b..5c1be3b 100644 --- a/game/ui/bags/BagEntry.tscn +++ b/game/ui/player/bags/BagEntry.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=5 format=2] -[ext_resource path="res://ui/bags/BagEntry.gd" type="Script" id=1] +[ext_resource path="res://ui/player/bags/BagEntry.gd" type="Script" id=1] [ext_resource path="res://ui/theme/cooldown_progress.png" type="Texture" id=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=3] [ext_resource path="res://ui/theme/actionbar_dynamicfont.tres" type="DynamicFont" id=5] @@ -10,14 +10,12 @@ margin_top = 1.0 margin_right = 45.0 margin_bottom = 46.0 rect_min_size = Vector2( 45, 45 ) -focus_mode = 0 size_flags_horizontal = 3 size_flags_vertical = 3 theme = ExtResource( 3 ) shortcut_in_tooltip = false action_mode = 0 button_mask = 3 -enabled_focus_mode = 0 keep_pressed_outside = true script = ExtResource( 1 ) __meta__ = { diff --git a/game/ui/bags/BagFrame.gd b/game/ui/player/bags/BagFrame.gd similarity index 96% rename from game/ui/bags/BagFrame.gd rename to game/ui/player/bags/BagFrame.gd index f276638..a4b778d 100644 --- a/game/ui/bags/BagFrame.gd +++ b/game/ui/player/bags/BagFrame.gd @@ -1,6 +1,6 @@ extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/bags/BagFrame.tscn b/game/ui/player/bags/BagFrame.tscn similarity index 88% rename from game/ui/bags/BagFrame.tscn rename to game/ui/player/bags/BagFrame.tscn index 69607ab..9d6c5c6 100644 --- a/game/ui/bags/BagFrame.tscn +++ b/game/ui/player/bags/BagFrame.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/bags/Bag.tscn" type="PackedScene" id=1] -[ext_resource path="res://ui/bags/BagFrame.gd" type="Script" id=2] +[ext_resource path="res://ui/player/bags/Bag.tscn" type="PackedScene" id=1] +[ext_resource path="res://ui/player/bags/BagFrame.gd" type="Script" id=2] [node name="BagFrame" type="Control"] anchor_right = 1.0 diff --git a/game/ui/bags/BaseWindow.tscn b/game/ui/player/bags/BaseWindow.tscn similarity index 100% rename from game/ui/bags/BaseWindow.tscn rename to game/ui/player/bags/BaseWindow.tscn diff --git a/game/ui/bags/EquipmentSlot.gd b/game/ui/player/bags/EquipmentSlot.gd similarity index 98% rename from game/ui/bags/EquipmentSlot.gd rename to game/ui/player/bags/EquipmentSlot.gd index 3112fa0..67da1f9 100644 --- a/game/ui/bags/EquipmentSlot.gd +++ b/game/ui/player/bags/EquipmentSlot.gd @@ -1,6 +1,6 @@ extends Button -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/bags/EquipmentSlot.tscn b/game/ui/player/bags/EquipmentSlot.tscn similarity index 91% rename from game/ui/bags/EquipmentSlot.tscn rename to game/ui/player/bags/EquipmentSlot.tscn index 971fc46..2801c21 100644 --- a/game/ui/bags/EquipmentSlot.tscn +++ b/game/ui/player/bags/EquipmentSlot.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/bags/EquipmentSlot.gd" type="Script" id=1] +[ext_resource path="res://ui/player/bags/EquipmentSlot.gd" type="Script" id=1] [node name="EquipmentSlot" type="Button"] margin_left = 84.0 diff --git a/game/ui/bags/InventoryGUI.gd b/game/ui/player/bags/InventoryGUI.gd similarity index 99% rename from game/ui/bags/InventoryGUI.gd rename to game/ui/player/bags/InventoryGUI.gd index 9d2df43..b13ac2e 100644 --- a/game/ui/bags/InventoryGUI.gd +++ b/game/ui/player/bags/InventoryGUI.gd @@ -1,6 +1,6 @@ extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/bags/InventoryWindow.tscn b/game/ui/player/bags/InventoryWindow.tscn similarity index 96% rename from game/ui/bags/InventoryWindow.tscn rename to game/ui/player/bags/InventoryWindow.tscn index 7b090e4..dc3b4b8 100644 --- a/game/ui/bags/InventoryWindow.tscn +++ b/game/ui/player/bags/InventoryWindow.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/bags/ItemEntry.tscn" type="PackedScene" id=1] -[ext_resource path="res://ui/bags/BaseWindow.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/bags/ItemEntry.tscn" type="PackedScene" id=1] +[ext_resource path="res://ui/player/bags/BaseWindow.tscn" type="PackedScene" id=2] diff --git a/game/ui/bags/ItemEntry.tscn b/game/ui/player/bags/ItemEntry.tscn similarity index 100% rename from game/ui/bags/ItemEntry.tscn rename to game/ui/player/bags/ItemEntry.tscn diff --git a/game/ui/bags/ItemPupop.gd b/game/ui/player/bags/ItemPupop.gd similarity index 97% rename from game/ui/bags/ItemPupop.gd rename to game/ui/player/bags/ItemPupop.gd index 203d15d..a16f704 100644 --- a/game/ui/bags/ItemPupop.gd +++ b/game/ui/player/bags/ItemPupop.gd @@ -1,6 +1,6 @@ extends PopupPanel -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/bags/ItemTooltip.tscn b/game/ui/player/bags/ItemTooltip.tscn similarity index 96% rename from game/ui/bags/ItemTooltip.tscn rename to game/ui/player/bags/ItemTooltip.tscn index ac37109..abf9e31 100644 --- a/game/ui/bags/ItemTooltip.tscn +++ b/game/ui/player/bags/ItemTooltip.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/bags/ItemPupop.gd" type="Script" id=1] +[ext_resource path="res://ui/player/bags/ItemPupop.gd" type="Script" id=1] [node name="ItemTooltip" type="PopupPanel"] margin_right = 295.0 diff --git a/game/ui/bags/game_module.tres b/game/ui/player/bags/game_module.tres similarity index 82% rename from game/ui/bags/game_module.tres rename to game/ui/player/bags/game_module.tres index 3c5777c..6f64aec 100644 --- a/game/ui/bags/game_module.tres +++ b/game/ui/player/bags/game_module.tres @@ -2,7 +2,7 @@ [ext_resource path="res://ui/theme/bag_icon.tres" type="Texture" id=1] [ext_resource path="res://scripts/game_modules/ui_window_module.gd" type="Script" id=2] -[ext_resource path="res://ui/bags/Bag.tscn" type="PackedScene" id=3] +[ext_resource path="res://ui/player/bags/Bag.tscn" type="PackedScene" id=3] [resource] script = ExtResource( 2 ) diff --git a/game/ui/bags/weapon_set_button_group.tres b/game/ui/player/bags/weapon_set_button_group.tres similarity index 100% rename from game/ui/bags/weapon_set_button_group.tres rename to game/ui/player/bags/weapon_set_button_group.tres diff --git a/game/ui/castbar/Castbar.gd b/game/ui/player/castbar/Castbar.gd similarity index 98% rename from game/ui/castbar/Castbar.gd rename to game/ui/player/castbar/Castbar.gd index 1e464bd..6d379dc 100644 --- a/game/ui/castbar/Castbar.gd +++ b/game/ui/player/castbar/Castbar.gd @@ -1,6 +1,6 @@ extends VBoxContainer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/castbar/Castbar.tscn b/game/ui/player/castbar/Castbar.tscn similarity index 94% rename from game/ui/castbar/Castbar.tscn rename to game/ui/player/castbar/Castbar.tscn index d5bf1f4..2de2a16 100644 --- a/game/ui/castbar/Castbar.tscn +++ b/game/ui/player/castbar/Castbar.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/castbar/Castbar.gd" type="Script" id=1] +[ext_resource path="res://ui/player/castbar/Castbar.gd" type="Script" id=1] [ext_resource path="res://ui/theme/scrollbar_grabber_blue.tres" type="StyleBox" id=2] [node name="Castbar" type="VBoxContainer"] diff --git a/game/ui/castbar/game_module.tres b/game/ui/player/castbar/game_module.tres similarity index 73% rename from game/ui/castbar/game_module.tres rename to game/ui/player/castbar/game_module.tres index 2d4c9e7..9684505 100644 --- a/game/ui/castbar/game_module.tres +++ b/game/ui/player/castbar/game_module.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://scripts/game_modules/ui_gui_child_module.gd" type="Script" id=1] -[ext_resource path="res://ui/castbar/Castbar.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/castbar/Castbar.tscn" type="PackedScene" id=2] [resource] script = ExtResource( 1 ) diff --git a/game/ui/character/CharacterWindow.gd b/game/ui/player/character/CharacterWindow.gd similarity index 100% rename from game/ui/character/CharacterWindow.gd rename to game/ui/player/character/CharacterWindow.gd diff --git a/game/ui/character/CharacterWindow.tscn b/game/ui/player/character/CharacterWindow.tscn similarity index 98% rename from game/ui/character/CharacterWindow.tscn rename to game/ui/player/character/CharacterWindow.tscn index 25abd6d..58601ef 100644 --- a/game/ui/character/CharacterWindow.tscn +++ b/game/ui/player/character/CharacterWindow.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1] -[ext_resource path="res://ui/character/CharacterWindow.gd" type="Script" id=2] -[ext_resource path="res://ui/character/SingleStatRow.tscn" type="PackedScene" id=3] +[ext_resource path="res://ui/player/character/CharacterWindow.gd" type="Script" id=2] +[ext_resource path="res://ui/player/character/SingleStatRow.tscn" type="PackedScene" id=3] [node name="CharacterWindow" type="Control"] anchor_right = 1.0 diff --git a/game/ui/character/SingleStatRow.gd b/game/ui/player/character/SingleStatRow.gd similarity index 100% rename from game/ui/character/SingleStatRow.gd rename to game/ui/player/character/SingleStatRow.gd diff --git a/game/ui/character/SingleStatRow.tscn b/game/ui/player/character/SingleStatRow.tscn similarity index 86% rename from game/ui/character/SingleStatRow.tscn rename to game/ui/player/character/SingleStatRow.tscn index af3ffed..9684276 100644 --- a/game/ui/character/SingleStatRow.tscn +++ b/game/ui/player/character/SingleStatRow.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/character/SingleStatRow.gd" type="Script" id=1] +[ext_resource path="res://ui/player/character/SingleStatRow.gd" type="Script" id=1] [node name="SingleStatRow" type="HBoxContainer"] margin_right = 1016.0 diff --git a/game/ui/character/game_module.tres b/game/ui/player/character/game_module.tres similarity index 79% rename from game/ui/character/game_module.tres rename to game/ui/player/character/game_module.tres index 3efffa8..c8134ba 100644 --- a/game/ui/character/game_module.tres +++ b/game/ui/player/character/game_module.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=4 format=2] [ext_resource path="res://scripts/game_modules/ui_window_module.gd" type="Script" id=1] -[ext_resource path="res://ui/character/CharacterWindow.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/character/CharacterWindow.tscn" type="PackedScene" id=2] [ext_resource path="res://ui/theme/character_icon.tres" type="Texture" id=3] [resource] diff --git a/game/ui/crafting/CraftItemDescription.gd b/game/ui/player/crafting/CraftItemDescription.gd similarity index 97% rename from game/ui/crafting/CraftItemDescription.gd rename to game/ui/player/crafting/CraftItemDescription.gd index 3f5e0e7..11af84a 100644 --- a/game/ui/crafting/CraftItemDescription.gd +++ b/game/ui/player/crafting/CraftItemDescription.gd @@ -1,6 +1,6 @@ extends HBoxContainer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/crafting/CraftingWindow.gd b/game/ui/player/crafting/CraftingWindow.gd similarity index 99% rename from game/ui/crafting/CraftingWindow.gd rename to game/ui/player/crafting/CraftingWindow.gd index 0080c41..6182ea5 100644 --- a/game/ui/crafting/CraftingWindow.gd +++ b/game/ui/player/crafting/CraftingWindow.gd @@ -1,6 +1,6 @@ extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/crafting/CraftingWindow.tscn b/game/ui/player/crafting/CraftingWindow.tscn similarity index 97% rename from game/ui/crafting/CraftingWindow.tscn rename to game/ui/player/crafting/CraftingWindow.tscn index e8d411b..c6f9e77 100644 --- a/game/ui/crafting/CraftingWindow.tscn +++ b/game/ui/player/crafting/CraftingWindow.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=7 format=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1] -[ext_resource path="res://ui/crafting/CraftingWindow.gd" type="Script" id=2] -[ext_resource path="res://ui/crafting/RecipeSelector.tscn" type="PackedScene" id=3] -[ext_resource path="res://ui/crafting/ItemEntry.tscn" type="PackedScene" id=4] -[ext_resource path="res://ui/crafting/CraftItemDescription.gd" type="Script" id=5] +[ext_resource path="res://ui/player/crafting/CraftingWindow.gd" type="Script" id=2] +[ext_resource path="res://ui/player/crafting/RecipeSelector.tscn" type="PackedScene" id=3] +[ext_resource path="res://ui/player/crafting/ItemEntry.tscn" type="PackedScene" id=4] +[ext_resource path="res://ui/player/crafting/CraftItemDescription.gd" type="Script" id=5] [sub_resource type="ButtonGroup" id=1] diff --git a/game/ui/crafting/ItemEntry.gd b/game/ui/player/crafting/ItemEntry.gd similarity index 97% rename from game/ui/crafting/ItemEntry.gd rename to game/ui/player/crafting/ItemEntry.gd index d8c5152..0afb2c7 100644 --- a/game/ui/crafting/ItemEntry.gd +++ b/game/ui/player/crafting/ItemEntry.gd @@ -1,6 +1,6 @@ extends PanelContainer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/crafting/ItemEntry.tscn b/game/ui/player/crafting/ItemEntry.tscn similarity index 93% rename from game/ui/crafting/ItemEntry.tscn rename to game/ui/player/crafting/ItemEntry.tscn index 3b9026d..424f13c 100644 --- a/game/ui/crafting/ItemEntry.tscn +++ b/game/ui/player/crafting/ItemEntry.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/crafting/ItemEntry.gd" type="Script" id=1] +[ext_resource path="res://ui/player/crafting/ItemEntry.gd" type="Script" id=1] [node name="ItemEntry" type="PanelContainer"] margin_right = 695.0 diff --git a/game/ui/crafting/RecipeSelector.gd b/game/ui/player/crafting/RecipeSelector.gd similarity index 97% rename from game/ui/crafting/RecipeSelector.gd rename to game/ui/player/crafting/RecipeSelector.gd index c1c2b96..e2d06b9 100644 --- a/game/ui/crafting/RecipeSelector.gd +++ b/game/ui/player/crafting/RecipeSelector.gd @@ -1,6 +1,6 @@ extends Button -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/crafting/RecipeSelector.tscn b/game/ui/player/crafting/RecipeSelector.tscn similarity index 72% rename from game/ui/crafting/RecipeSelector.tscn rename to game/ui/player/crafting/RecipeSelector.tscn index 575485a..bb6cda9 100644 --- a/game/ui/crafting/RecipeSelector.tscn +++ b/game/ui/player/crafting/RecipeSelector.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/crafting/RecipeSelector.gd" type="Script" id=1] +[ext_resource path="res://ui/player/crafting/RecipeSelector.gd" type="Script" id=1] [node name="RecipeSelector" type="Button"] margin_right = 303.0 diff --git a/game/ui/crafting/game_module.tres b/game/ui/player/crafting/game_module.tres similarity index 80% rename from game/ui/crafting/game_module.tres rename to game/ui/player/crafting/game_module.tres index 71af8a5..b050ee5 100644 --- a/game/ui/crafting/game_module.tres +++ b/game/ui/player/crafting/game_module.tres @@ -2,7 +2,7 @@ [ext_resource path="res://ui/theme/crafting_icon.tres" type="Texture" id=1] [ext_resource path="res://scripts/game_modules/ui_window_module.gd" type="Script" id=2] -[ext_resource path="res://ui/crafting/CraftingWindow.tscn" type="PackedScene" id=3] +[ext_resource path="res://ui/player/crafting/CraftingWindow.tscn" type="PackedScene" id=3] [resource] script = ExtResource( 2 ) diff --git a/game/ui/errorframe/ErrorFrame.tscn b/game/ui/player/errorframe/ErrorFrame.tscn similarity index 100% rename from game/ui/errorframe/ErrorFrame.tscn rename to game/ui/player/errorframe/ErrorFrame.tscn diff --git a/game/ui/loot_window/LootEntry.gd b/game/ui/player/loot_window/LootEntry.gd similarity index 97% rename from game/ui/loot_window/LootEntry.gd rename to game/ui/player/loot_window/LootEntry.gd index 28df181..7599405 100644 --- a/game/ui/loot_window/LootEntry.gd +++ b/game/ui/player/loot_window/LootEntry.gd @@ -1,6 +1,6 @@ extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/loot_window/LootEntry.tscn b/game/ui/player/loot_window/LootEntry.tscn similarity index 94% rename from game/ui/loot_window/LootEntry.tscn rename to game/ui/player/loot_window/LootEntry.tscn index cd3a857..9a08c77 100644 --- a/game/ui/loot_window/LootEntry.tscn +++ b/game/ui/player/loot_window/LootEntry.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/loot_window/LootEntry.gd" type="Script" id=1] +[ext_resource path="res://ui/player/loot_window/LootEntry.gd" type="Script" id=1] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2] [node name="lootEntry" type="PanelContainer"] diff --git a/game/ui/loot_window/LootWindow.gd b/game/ui/player/loot_window/LootWindow.gd similarity index 98% rename from game/ui/loot_window/LootWindow.gd rename to game/ui/player/loot_window/LootWindow.gd index 7f525c2..3e6c5bb 100644 --- a/game/ui/loot_window/LootWindow.gd +++ b/game/ui/player/loot_window/LootWindow.gd @@ -1,6 +1,6 @@ extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/loot_window/LootWindow.tscn b/game/ui/player/loot_window/LootWindow.tscn similarity index 89% rename from game/ui/loot_window/LootWindow.tscn rename to game/ui/player/loot_window/LootWindow.tscn index 18807e4..7a410a1 100644 --- a/game/ui/loot_window/LootWindow.tscn +++ b/game/ui/player/loot_window/LootWindow.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://ui/loot_window/LootWindow.gd" type="Script" id=1] +[ext_resource path="res://ui/player/loot_window/LootWindow.gd" type="Script" id=1] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2] -[ext_resource path="res://ui/loot_window/LootEntry.tscn" type="PackedScene" id=3] +[ext_resource path="res://ui/player/loot_window/LootEntry.tscn" type="PackedScene" id=3] [node name="LootWindow" type="Control"] anchor_right = 1.0 diff --git a/game/ui/loot_window/game_module.tres b/game/ui/player/loot_window/game_module.tres similarity index 73% rename from game/ui/loot_window/game_module.tres rename to game/ui/player/loot_window/game_module.tres index 8a640a3..0310eb0 100644 --- a/game/ui/loot_window/game_module.tres +++ b/game/ui/player/loot_window/game_module.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://scripts/game_modules/ui_window_module.gd" type="Script" id=2] -[ext_resource path="res://ui/loot_window/LootWindow.tscn" type="PackedScene" id=3] +[ext_resource path="res://ui/player/loot_window/LootWindow.tscn" type="PackedScene" id=3] [resource] script = ExtResource( 2 ) diff --git a/game/ui/map/Map.tscn b/game/ui/player/map/Map.tscn similarity index 100% rename from game/ui/map/Map.tscn rename to game/ui/player/map/Map.tscn diff --git a/game/ui/menu/CharacterEntry.gd b/game/ui/player/menu/CharacterEntry.gd similarity index 98% rename from game/ui/menu/CharacterEntry.gd rename to game/ui/player/menu/CharacterEntry.gd index 0f35016..b48ee66 100644 --- a/game/ui/menu/CharacterEntry.gd +++ b/game/ui/player/menu/CharacterEntry.gd @@ -1,6 +1,6 @@ extends Button -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/menu/CharacterEntry.tscn b/game/ui/player/menu/CharacterEntry.tscn similarity index 97% rename from game/ui/menu/CharacterEntry.tscn rename to game/ui/player/menu/CharacterEntry.tscn index bcaeaa7..bc9c79a 100644 --- a/game/ui/menu/CharacterEntry.tscn +++ b/game/ui/player/menu/CharacterEntry.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1] -[ext_resource path="res://ui/menu/CharacterEntry.gd" type="Script" id=2] +[ext_resource path="res://ui/player/menu/CharacterEntry.gd" type="Script" id=2] [node name="CharacterEntry" type="Button"] margin_right = 224.0 diff --git a/game/ui/menu/character_creation_button_group.tres b/game/ui/player/menu/character_creation_button_group.tres similarity index 100% rename from game/ui/menu/character_creation_button_group.tres rename to game/ui/player/menu/character_creation_button_group.tres diff --git a/game/ui/menu/menu_character_button_group.tres b/game/ui/player/menu/menu_character_button_group.tres similarity index 100% rename from game/ui/menu/menu_character_button_group.tres rename to game/ui/player/menu/menu_character_button_group.tres diff --git a/game/ui/minimap/MiniMap.tscn b/game/ui/player/minimap/MiniMap.tscn similarity index 100% rename from game/ui/minimap/MiniMap.tscn rename to game/ui/player/minimap/MiniMap.tscn diff --git a/game/ui/player_ui/RemoveProfile.gd b/game/ui/player/player_ui/RemoveProfile.gd similarity index 97% rename from game/ui/player_ui/RemoveProfile.gd rename to game/ui/player/player_ui/RemoveProfile.gd index dff74d2..30cfc53 100644 --- a/game/ui/player_ui/RemoveProfile.gd +++ b/game/ui/player/player_ui/RemoveProfile.gd @@ -1,6 +1,6 @@ extends Button -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/buttons/Buttons.gd b/game/ui/player/player_ui/buttons/Buttons.gd similarity index 98% rename from game/ui/buttons/Buttons.gd rename to game/ui/player/player_ui/buttons/Buttons.gd index f69ae56..459d662 100644 --- a/game/ui/buttons/Buttons.gd +++ b/game/ui/player/player_ui/buttons/Buttons.gd @@ -1,6 +1,6 @@ extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/buttons/ImageButton.tscn b/game/ui/player/player_ui/buttons/ImageButton.tscn similarity index 93% rename from game/ui/buttons/ImageButton.tscn rename to game/ui/player/player_ui/buttons/ImageButton.tscn index 30a2305..ffecbd3 100644 --- a/game/ui/buttons/ImageButton.tscn +++ b/game/ui/player/player_ui/buttons/ImageButton.tscn @@ -7,9 +7,7 @@ margin_right = 25.0 margin_bottom = 40.0 rect_min_size = Vector2( 25, 30 ) hint_tooltip = "Inventory" -focus_mode = 0 toggle_mode = true -enabled_focus_mode = 0 keep_pressed_outside = true __meta__ = { "_edit_use_anchors_": false diff --git a/game/ui/ingame_menu/ExitButton.gd b/game/ui/player/player_ui/ingame_menu/ExitButton.gd similarity index 96% rename from game/ui/ingame_menu/ExitButton.gd rename to game/ui/player/player_ui/ingame_menu/ExitButton.gd index 51d0a9c..731a523 100644 --- a/game/ui/ingame_menu/ExitButton.gd +++ b/game/ui/player/player_ui/ingame_menu/ExitButton.gd @@ -1,6 +1,6 @@ extends Button -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/ingame_menu/IngameMenu.tscn b/game/ui/player/player_ui/ingame_menu/IngameMenu.tscn similarity index 84% rename from game/ui/ingame_menu/IngameMenu.tscn rename to game/ui/player/player_ui/ingame_menu/IngameMenu.tscn index 6795fe6..afe0555 100644 --- a/game/ui/ingame_menu/IngameMenu.tscn +++ b/game/ui/player/player_ui/ingame_menu/IngameMenu.tscn @@ -1,10 +1,10 @@ [gd_scene load_steps=6 format=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1] -[ext_resource path="res://ui/options/Options.tscn" type="PackedScene" id=2] -[ext_resource path="res://ui/ingame_menu/ExitButton.gd" type="Script" id=3] -[ext_resource path="res://ui/keybinds/Keybinds.tscn" type="PackedScene" id=4] -[ext_resource path="res://ui/interface/InterfaceOptions.tscn" type="PackedScene" id=5] +[ext_resource path="res://ui/player/player_ui/ingame_menu/ExitButton.gd" type="Script" id=2] +[ext_resource path="res://ui/windows/options/Options.tscn" type="PackedScene" id=3] +[ext_resource path="res://ui/windows/keybinds/Keybinds.tscn" type="PackedScene" id=4] +[ext_resource path="res://ui/player/player_ui/interface/InterfaceOptions.tscn" type="PackedScene" id=5] [node name="IngameMenu" type="Control"] anchor_right = 1.0 @@ -65,9 +65,9 @@ margin_top = 136.0 margin_right = 147.0 margin_bottom = 162.57 text = "Exit" -script = ExtResource( 3 ) +script = ExtResource( 2 ) -[node name="Options" parent="." instance=ExtResource( 2 )] +[node name="Options" parent="." instance=ExtResource( 3 )] visible = false anchor_left = 0.5 anchor_top = 0.5 diff --git a/game/ui/interface/InterfaceOptions.gd b/game/ui/player/player_ui/interface/InterfaceOptions.gd similarity index 100% rename from game/ui/interface/InterfaceOptions.gd rename to game/ui/player/player_ui/interface/InterfaceOptions.gd diff --git a/game/ui/interface/InterfaceOptions.tscn b/game/ui/player/player_ui/interface/InterfaceOptions.tscn similarity index 87% rename from game/ui/interface/InterfaceOptions.tscn rename to game/ui/player/player_ui/interface/InterfaceOptions.tscn index e4a20f3..a148005 100644 --- a/game/ui/interface/InterfaceOptions.tscn +++ b/game/ui/player/player_ui/interface/InterfaceOptions.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/interface/SetActionbarAsDefault.gd" type="Script" id=1] -[ext_resource path="res://ui/interface/InterfaceOptions.gd" type="Script" id=2] +[ext_resource path="res://ui/player/player_ui/interface/SetActionbarAsDefault.gd" type="Script" id=1] +[ext_resource path="res://ui/player/player_ui/interface/InterfaceOptions.gd" type="Script" id=2] [node name="InterfaceOptions" type="PanelContainer"] anchor_right = 1.0 @@ -49,4 +49,5 @@ margin_right = 1010.0 margin_bottom = 20.0 text = "Set current actionbar setup as default" script = ExtResource( 1 ) + [connection signal="pressed" from="VBoxContainer2/HBoxContainer/Button" to="." method="hide"] diff --git a/game/ui/interface/SetActionbarAsDefault.gd b/game/ui/player/player_ui/interface/SetActionbarAsDefault.gd similarity index 100% rename from game/ui/interface/SetActionbarAsDefault.gd rename to game/ui/player/player_ui/interface/SetActionbarAsDefault.gd diff --git a/game/ui/player_ui/player_ui.gd b/game/ui/player/player_ui/player_ui.gd similarity index 97% rename from game/ui/player_ui/player_ui.gd rename to game/ui/player/player_ui/player_ui.gd index 2752891..bbd8093 100644 --- a/game/ui/player_ui/player_ui.gd +++ b/game/ui/player/player_ui/player_ui.gd @@ -1,6 +1,6 @@ extends CanvasLayer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/player_ui/player_ui.tscn b/game/ui/player/player_ui/player_ui.tscn similarity index 72% rename from game/ui/player_ui/player_ui.tscn rename to game/ui/player/player_ui/player_ui.tscn index a3ca5d6..6779553 100644 --- a/game/ui/player_ui/player_ui.tscn +++ b/game/ui/player/player_ui/player_ui.tscn @@ -1,17 +1,17 @@ [gd_scene load_steps=10 format=2] -[ext_resource path="res://player/GUI.gd" type="Script" id=1] -[ext_resource path="res://ui/ingame_menu/IngameMenu.tscn" type="PackedScene" id=2] -[ext_resource path="res://ui/theme/menu_icon.tres" type="Texture" id=6] -[ext_resource path="res://ui/buttons/Buttons.gd" type="Script" id=9] -[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=10] -[ext_resource path="res://ui/theme/locked_icon.tres" type="Texture" id=25] -[ext_resource path="res://ui/theme/unlocked_icon.tres" type="Texture" id=26] -[ext_resource path="res://ui/player_ui/player_ui.gd" type="Script" id=28] -[ext_resource path="res://ui/buttons/ImageButton.tscn" type="PackedScene" id=30] +[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1] +[ext_resource path="res://ui/theme/locked_icon.tres" type="Texture" id=2] +[ext_resource path="res://ui/theme/menu_icon.tres" type="Texture" id=3] +[ext_resource path="res://ui/theme/unlocked_icon.tres" type="Texture" id=4] +[ext_resource path="res://player/GUI.gd" type="Script" id=5] +[ext_resource path="res://ui/player/player_ui/player_ui.gd" type="Script" id=6] +[ext_resource path="res://ui/player/player_ui/ingame_menu/IngameMenu.tscn" type="PackedScene" id=7] +[ext_resource path="res://ui/player/player_ui/buttons/Buttons.gd" type="Script" id=8] +[ext_resource path="res://ui/player/player_ui/buttons/ImageButton.tscn" type="PackedScene" id=9] [node name="GUILayer" type="CanvasLayer"] -script = ExtResource( 28 ) +script = ExtResource( 6 ) gui_base_path = NodePath("GUI") buttons_path = NodePath("GUI/Buttons") windows_path = NodePath("GUI/Windows") @@ -20,8 +20,8 @@ windows_path = NodePath("GUI/Windows") anchor_right = 1.0 anchor_bottom = 1.0 mouse_filter = 2 -theme = ExtResource( 10 ) -script = ExtResource( 1 ) +theme = ExtResource( 1 ) +script = ExtResource( 5 ) __meta__ = { "_edit_lock_": true } @@ -34,27 +34,25 @@ margin_right = 342.0 rect_min_size = Vector2( 0, 40 ) mouse_filter = 2 custom_constants/separation = 0 -script = ExtResource( 9 ) +script = ExtResource( 8 ) __meta__ = { "_edit_group_": true, "_edit_use_anchors_": false } -image_button = ExtResource( 30 ) +image_button = ExtResource( 9 ) lock_button_path = NodePath("LockButton") [node name="LockButton" type="Button" parent="GUI/Buttons"] margin_right = 25.0 margin_bottom = 40.0 rect_min_size = Vector2( 25, 30 ) -focus_mode = 0 toggle_mode = true -enabled_focus_mode = 0 keep_pressed_outside = true [node name="locked" type="TextureRect" parent="GUI/Buttons/LockButton"] anchor_right = 1.0 anchor_bottom = 1.0 -texture = ExtResource( 25 ) +texture = ExtResource( 2 ) expand = true stretch_mode = 6 __meta__ = { @@ -65,7 +63,7 @@ __meta__ = { visible = false anchor_right = 1.0 anchor_bottom = 1.0 -texture = ExtResource( 26 ) +texture = ExtResource( 4 ) expand = true stretch_mode = 6 __meta__ = { @@ -77,14 +75,12 @@ margin_left = 25.0 margin_right = 50.0 margin_bottom = 40.0 rect_min_size = Vector2( 25, 30 ) -focus_mode = 0 -enabled_focus_mode = 0 keep_pressed_outside = true [node name="TextureRect3" type="TextureRect" parent="GUI/Buttons/Menu"] anchor_right = 1.0 anchor_bottom = 1.0 -texture = ExtResource( 6 ) +texture = ExtResource( 3 ) expand = true stretch_mode = 6 __meta__ = { @@ -94,7 +90,7 @@ __meta__ = { [node name="Windows" type="CanvasLayer" parent="GUI"] layer = 2 -[node name="IngameMenu" parent="GUI" instance=ExtResource( 2 )] +[node name="IngameMenu" parent="GUI" instance=ExtResource( 7 )] visible = false [connection signal="pressed" from="GUI/Buttons/Menu" to="GUI/IngameMenu" method="show"] diff --git a/game/ui/spellbook/SpellBookWindow.gd b/game/ui/player/spellbook/SpellBookWindow.gd similarity index 96% rename from game/ui/spellbook/SpellBookWindow.gd rename to game/ui/player/spellbook/SpellBookWindow.gd index 4988b5e..b1ee5c3 100644 --- a/game/ui/spellbook/SpellBookWindow.gd +++ b/game/ui/player/spellbook/SpellBookWindow.gd @@ -1,6 +1,6 @@ extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -150,11 +150,13 @@ func set_player(p_player: Entity) -> void: if _player != null: _player.disconnect("cfree_spell_points_changed", self, "cfree_spell_points_changed") _player.disconnect("centity_data_changed", self, "centity_data_changed") + _player.disconnect("deserialized", self, "on_deserialized") _player = p_player _player.connect("cfree_spell_points_changed", self, "cfree_spell_points_changed") _player.connect("centity_data_changed", self, "centity_data_changed") + _player.connect("deserialized", self, "on_deserialized") if _player != null: centity_data_changed(_player.centity_data) @@ -183,7 +185,9 @@ func centity_data_changed(data: EntityData): _spells.append(_character_class.get_spell(i)) _spells.sort_custom(CustomSpellSorter, "sort") - + +func on_deserialized(data: Entity): + refresh_entries() class CustomSpellSorter: static func sort(a, b): diff --git a/game/ui/spellbook/SpellBookWindow.tscn b/game/ui/player/spellbook/SpellBookWindow.tscn similarity index 96% rename from game/ui/spellbook/SpellBookWindow.tscn rename to game/ui/player/spellbook/SpellBookWindow.tscn index 2f081fb..9279e0f 100644 --- a/game/ui/spellbook/SpellBookWindow.tscn +++ b/game/ui/player/spellbook/SpellBookWindow.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1] -[ext_resource path="res://ui/spellbook/SpellBookWindow.gd" type="Script" id=2] -[ext_resource path="res://ui/spellbook/SpellContainer.tscn" type="PackedScene" id=3] +[ext_resource path="res://ui/player/spellbook/SpellBookWindow.gd" type="Script" id=2] +[ext_resource path="res://ui/player/spellbook/SpellContainer.tscn" type="PackedScene" id=3] [node name="SpellBookWindow" type="Control"] anchor_right = 1.0 diff --git a/game/ui/spellbook/SpellContainer.gd b/game/ui/player/spellbook/SpellContainer.gd similarity index 99% rename from game/ui/spellbook/SpellContainer.gd rename to game/ui/player/spellbook/SpellContainer.gd index 5f6dfec..c6db829 100644 --- a/game/ui/spellbook/SpellContainer.gd +++ b/game/ui/player/spellbook/SpellContainer.gd @@ -1,6 +1,6 @@ extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/spellbook/SpellContainer.tscn b/game/ui/player/spellbook/SpellContainer.tscn similarity index 94% rename from game/ui/spellbook/SpellContainer.tscn rename to game/ui/player/spellbook/SpellContainer.tscn index 3dda6b0..5fddbd3 100644 --- a/game/ui/spellbook/SpellContainer.tscn +++ b/game/ui/player/spellbook/SpellContainer.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=5 format=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1] -[ext_resource path="res://ui/spellbook/SpellDragAndDropSpellBook.gd" type="Script" id=2] -[ext_resource path="res://ui/spellbook/SpellContainer.gd" type="Script" id=3] -[ext_resource path="res://ui/spellbook/SpellEntryPopup.gd" type="Script" id=4] +[ext_resource path="res://ui/player/spellbook/SpellDragAndDropSpellBook.gd" type="Script" id=2] +[ext_resource path="res://ui/player/spellbook/SpellContainer.gd" type="Script" id=3] +[ext_resource path="res://ui/player/spellbook/SpellEntryPopup.gd" type="Script" id=4] [node name="SpellContainer" type="Control"] margin_left = 290.0 diff --git a/game/ui/spellbook/SpellDragAndDropSpellBook.gd b/game/ui/player/spellbook/SpellDragAndDropSpellBook.gd similarity index 97% rename from game/ui/spellbook/SpellDragAndDropSpellBook.gd rename to game/ui/player/spellbook/SpellDragAndDropSpellBook.gd index 87e30be..acf3c55 100644 --- a/game/ui/spellbook/SpellDragAndDropSpellBook.gd +++ b/game/ui/player/spellbook/SpellDragAndDropSpellBook.gd @@ -1,6 +1,6 @@ extends Button -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/spellbook/SpellEntryPopup.gd b/game/ui/player/spellbook/SpellEntryPopup.gd similarity index 97% rename from game/ui/spellbook/SpellEntryPopup.gd rename to game/ui/player/spellbook/SpellEntryPopup.gd index 1db6ad6..418b57d 100644 --- a/game/ui/spellbook/SpellEntryPopup.gd +++ b/game/ui/player/spellbook/SpellEntryPopup.gd @@ -1,6 +1,6 @@ extends PopupPanel -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/spellbook/game_module.tres b/game/ui/player/spellbook/game_module.tres similarity index 79% rename from game/ui/spellbook/game_module.tres rename to game/ui/player/spellbook/game_module.tres index 9080b7e..9c22499 100644 --- a/game/ui/spellbook/game_module.tres +++ b/game/ui/player/spellbook/game_module.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=4 format=2] [ext_resource path="res://ui/theme/spellbook_icon.tres" type="Texture" id=1] -[ext_resource path="res://ui/spellbook/SpellBookWindow.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/spellbook/SpellBookWindow.tscn" type="PackedScene" id=2] [ext_resource path="res://scripts/game_modules/ui_window_module.gd" type="Script" id=3] [resource] diff --git a/game/ui/starmap/StarMap.tscn b/game/ui/player/starmap/StarMap.tscn similarity index 100% rename from game/ui/starmap/StarMap.tscn rename to game/ui/player/starmap/StarMap.tscn diff --git a/game/ui/talents/Spec.gd b/game/ui/player/talents/Spec.gd similarity index 100% rename from game/ui/talents/Spec.gd rename to game/ui/player/talents/Spec.gd diff --git a/game/ui/talents/Spec.tscn b/game/ui/player/talents/Spec.tscn similarity index 73% rename from game/ui/talents/Spec.tscn rename to game/ui/player/talents/Spec.tscn index 18b157a..71f48f7 100644 --- a/game/ui/talents/Spec.tscn +++ b/game/ui/player/talents/Spec.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/talents/Spec.gd" type="Script" id=1] -[ext_resource path="res://ui/talents/TalentRow.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/talents/Spec.gd" type="Script" id=1] +[ext_resource path="res://ui/player/talents/TalentRow.tscn" type="PackedScene" id=2] [node name="Spec" type="ScrollContainer"] margin_right = 882.0 diff --git a/game/ui/talents/TalentEntry.gd b/game/ui/player/talents/TalentEntry.gd similarity index 100% rename from game/ui/talents/TalentEntry.gd rename to game/ui/player/talents/TalentEntry.gd diff --git a/game/ui/talents/TalentEntry.tscn b/game/ui/player/talents/TalentEntry.tscn similarity index 97% rename from game/ui/talents/TalentEntry.tscn rename to game/ui/player/talents/TalentEntry.tscn index 7878372..7f83fa6 100644 --- a/game/ui/talents/TalentEntry.tscn +++ b/game/ui/player/talents/TalentEntry.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/talents/TalentEntry.gd" type="Script" id=1] +[ext_resource path="res://ui/player/talents/TalentEntry.gd" type="Script" id=1] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2] [node name="TalentEntry" type="CenterContainer"] diff --git a/game/ui/talents/TalentRow.gd b/game/ui/player/talents/TalentRow.gd similarity index 100% rename from game/ui/talents/TalentRow.gd rename to game/ui/player/talents/TalentRow.gd diff --git a/game/ui/talents/TalentRow.tscn b/game/ui/player/talents/TalentRow.tscn similarity index 68% rename from game/ui/talents/TalentRow.tscn rename to game/ui/player/talents/TalentRow.tscn index 4376857..17c137a 100644 --- a/game/ui/talents/TalentRow.tscn +++ b/game/ui/player/talents/TalentRow.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://ui/talents/TalentEntry.tscn" type="PackedScene" id=1] +[ext_resource path="res://ui/player/talents/TalentEntry.tscn" type="PackedScene" id=1] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2] -[ext_resource path="res://ui/talents/TalentRow.gd" type="Script" id=3] +[ext_resource path="res://ui/player/talents/TalentRow.gd" type="Script" id=3] [node name="TalentRow" type="HBoxContainer"] anchor_right = 1.0 diff --git a/game/ui/talents/TalentWindow.gd b/game/ui/player/talents/TalentWindow.gd similarity index 100% rename from game/ui/talents/TalentWindow.gd rename to game/ui/player/talents/TalentWindow.gd diff --git a/game/ui/talents/TalentWindow.tscn b/game/ui/player/talents/TalentWindow.tscn similarity index 93% rename from game/ui/talents/TalentWindow.tscn rename to game/ui/player/talents/TalentWindow.tscn index 5af265d..28b8e0c 100644 --- a/game/ui/talents/TalentWindow.tscn +++ b/game/ui/player/talents/TalentWindow.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=5 format=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1] -[ext_resource path="res://ui/talents/Spec.tscn" type="PackedScene" id=2] -[ext_resource path="res://ui/talents/TalentWindow.gd" type="Script" id=3] -[ext_resource path="res://ui/talents/talent_switcher_button.tscn" type="PackedScene" id=4] +[ext_resource path="res://ui/player/talents/Spec.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/talents/TalentWindow.gd" type="Script" id=3] +[ext_resource path="res://ui/player/talents/talent_switcher_button.tscn" type="PackedScene" id=4] [node name="TalentWindow" type="Control"] anchor_right = 1.0 diff --git a/game/ui/talents/game_module.tres b/game/ui/player/talents/game_module.tres similarity index 80% rename from game/ui/talents/game_module.tres rename to game/ui/player/talents/game_module.tres index c343d87..e631d54 100644 --- a/game/ui/talents/game_module.tres +++ b/game/ui/player/talents/game_module.tres @@ -2,7 +2,7 @@ [ext_resource path="res://ui/theme/talent_icon.tres" type="Texture" id=1] [ext_resource path="res://scripts/game_modules/ui_window_module.gd" type="Script" id=2] -[ext_resource path="res://ui/talents/TalentWindow.tscn" type="PackedScene" id=3] +[ext_resource path="res://ui/player/talents/TalentWindow.tscn" type="PackedScene" id=3] [resource] script = ExtResource( 2 ) diff --git a/game/ui/talents/talent_switcher_button.gd b/game/ui/player/talents/talent_switcher_button.gd similarity index 100% rename from game/ui/talents/talent_switcher_button.gd rename to game/ui/player/talents/talent_switcher_button.gd diff --git a/game/ui/talents/talent_switcher_button.tscn b/game/ui/player/talents/talent_switcher_button.tscn similarity index 73% rename from game/ui/talents/talent_switcher_button.tscn rename to game/ui/player/talents/talent_switcher_button.tscn index 637bbe7..eda6a51 100644 --- a/game/ui/talents/talent_switcher_button.tscn +++ b/game/ui/player/talents/talent_switcher_button.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/talents/talent_switcher_button.gd" type="Script" id=1] +[ext_resource path="res://ui/player/talents/talent_switcher_button.gd" type="Script" id=1] [node name="TalentSwitcher" type="Button"] margin_left = 301.0 diff --git a/game/ui/trainer/TrainerWindow.gd b/game/ui/player/trainer/TrainerWindow.gd similarity index 93% rename from game/ui/trainer/TrainerWindow.gd rename to game/ui/player/trainer/TrainerWindow.gd index 7b8bf55..2e19153 100644 --- a/game/ui/trainer/TrainerWindow.gd +++ b/game/ui/player/trainer/TrainerWindow.gd @@ -1,6 +1,6 @@ extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -41,6 +41,7 @@ var _spell_description_label : Label var _spell_requirements_label : Label var _player : Entity +var _trainer : Entity var _entity_data : EntityData var _character_class : EntityClassData @@ -49,6 +50,8 @@ var _spells : Array var _spell_button_group : ButtonGroup +var _timer : float = 0 + func _ready() -> void: _spell_button_group = ButtonGroup.new() @@ -65,6 +68,25 @@ func _ready() -> void: _learn_button.connect("pressed", self, "learn") connect("visibility_changed", self, "_visibility_changed") + + set_process(false) + +func _process(delta): + _timer += delta + + if _timer > 1: + _timer = 0 + + if _player == null: + return + + var target : Entity = _player.getc_target() + + if target != _trainer: + hide() + + if !_player.isc_target_in_interact_range(): + hide() func learn() -> void: if _character_class == null: @@ -128,6 +150,10 @@ func refresh_all() -> void: func _visibility_changed() -> void: if visible: refresh_all() + else: + _trainer = null + + set_process(visible) func set_player(p_player: Entity) -> void: if _player != null: @@ -221,6 +247,8 @@ func onc_open_winow_request(window_id : int) -> void: if window_id != EntityEnums.ENTITY_WINDOW_TRAINER: return + _trainer = _player.getc_target() + show() # if player.has_signal("player_moved") && !player.is_connected("player_moved", self, "on_player_moved"): diff --git a/game/ui/trainer/TrainerWindow.tscn b/game/ui/player/trainer/TrainerWindow.tscn similarity index 97% rename from game/ui/trainer/TrainerWindow.tscn rename to game/ui/player/trainer/TrainerWindow.tscn index a92599b..71c5e73 100644 --- a/game/ui/trainer/TrainerWindow.tscn +++ b/game/ui/player/trainer/TrainerWindow.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/trainer/TrainerWindow.gd" type="Script" id=1] +[ext_resource path="res://ui/player/trainer/TrainerWindow.gd" type="Script" id=1] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2] [node name="TrainerWindow" type="Control"] @@ -11,6 +11,9 @@ size_flags_horizontal = 3 size_flags_vertical = 3 theme = ExtResource( 2 ) script = ExtResource( 1 ) +__meta__ = { +"_edit_use_anchors_": false +} spell_entry_container_path = NodePath("PanelContainer/VBoxContainer/PanelContainer3/ScrollContainer/Spells") learn_button_path = NodePath("PanelContainer/VBoxContainer/HBoxContainer/Train") cost_label_path = NodePath("PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer2/Price") @@ -154,4 +157,5 @@ margin_right = 379.0 margin_bottom = 26.5702 rect_min_size = Vector2( 100, 0 ) text = "Learn" + [connection signal="pressed" from="PanelContainer/VBoxContainer/HBoxContainer2/Button" to="." method="hide"] diff --git a/game/ui/trainer/game_module.tres b/game/ui/player/trainer/game_module.tres similarity index 73% rename from game/ui/trainer/game_module.tres rename to game/ui/player/trainer/game_module.tres index 816bec2..38be54e 100644 --- a/game/ui/trainer/game_module.tres +++ b/game/ui/player/trainer/game_module.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" load_steps=3 format=2] -[ext_resource path="res://ui/trainer/TrainerWindow.tscn" type="PackedScene" id=1] +[ext_resource path="res://ui/player/trainer/TrainerWindow.tscn" type="PackedScene" id=1] [ext_resource path="res://scripts/game_modules/ui_window_module.gd" type="Script" id=2] [resource] diff --git a/game/ui/unitframes/TargetUnitframe.gd b/game/ui/player/unitframes/TargetUnitframe.gd similarity index 92% rename from game/ui/unitframes/TargetUnitframe.gd rename to game/ui/player/unitframes/TargetUnitframe.gd index e8bbc1c..71802f6 100644 --- a/game/ui/unitframes/TargetUnitframe.gd +++ b/game/ui/player/unitframes/TargetUnitframe.gd @@ -1,6 +1,6 @@ extends VBoxContainer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -23,6 +23,7 @@ extends VBoxContainer export (PackedScene) var aura_entry_scene : PackedScene export (NodePath) var name_text_path : NodePath +export (NodePath) var level_text_path : NodePath export (NodePath) var health_range_path : NodePath export (NodePath) var health_text_path : NodePath export (NodePath) var resource_range_path : NodePath @@ -30,6 +31,7 @@ export (NodePath) var resource_text_path : NodePath export (NodePath) var aura_grid_path : NodePath var _name_text : Label +var _level_text : Label var _health_range : Range var _health_text : Label var _resource_range : Range @@ -43,6 +45,7 @@ var _health : EntityResourceHealth # Called when the node enters the scene tree for the first time. func _ready() -> void: _name_text = get_node(name_text_path) as Label + _level_text = get_node(level_text_path) as Label _health_range = get_node(health_range_path) as Range _health_text = get_node(health_text_path) as Label _resource_range = get_node(resource_range_path) as Range @@ -55,7 +58,8 @@ func set_player(p_player : Entity) -> void: _player.disconnect("notification_caura", self, "on_notification_caura") _player.disconnect("diecd", self, "diecd") _player.disconnect("centity_resource_added", self, "centity_resource_added") - + _player.disconnect("con_level_changed", self, "con_level_changed") + if _mana != null: _mana.disconnect("changed", self, "_on_mana_changed") _mana = null @@ -81,6 +85,7 @@ func set_player(p_player : Entity) -> void: _player.connect("notification_caura", self, "on_notification_caura") _player.connect("diecd", self, "diecd", [], CONNECT_DEFERRED) _player.connect("centity_resource_added", self, "centity_resource_added") + _player.connect("con_level_changed", self, "con_level_changed") for i in range(_player.resource_getc_count()): centity_resource_added(_player.resource_getc_index(i)) @@ -90,6 +95,7 @@ func set_player(p_player : Entity) -> void: _health.connect("changed", self, "_on_player_health_changed") _name_text.text = _player.centity_name + _level_text.text = str(_player.clevel) set_process(true) show() @@ -149,3 +155,6 @@ func _on_player_health_changed() -> void: func diecd(entity : Entity) -> void: set_player(null) + +func con_level_changed(entity: Entity, level: int): + _level_text.text = str(entity.clevel) diff --git a/game/ui/unitframes/TargetUnitframe.tscn b/game/ui/player/unitframes/TargetUnitframe.tscn similarity index 79% rename from game/ui/unitframes/TargetUnitframe.tscn rename to game/ui/player/unitframes/TargetUnitframe.tscn index 17ad3b1..433a62b 100644 --- a/game/ui/unitframes/TargetUnitframe.tscn +++ b/game/ui/player/unitframes/TargetUnitframe.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=6 format=2] -[ext_resource path="res://ui/unitframes/TargetUnitframe.gd" type="Script" id=1] -[ext_resource path="res://ui/auraframe/AuraEntry.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/unitframes/TargetUnitframe.gd" type="Script" id=1] +[ext_resource path="res://ui/player/auraframe/AuraEntry.tscn" type="PackedScene" id=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=3] [ext_resource path="res://ui/theme/scrollbar_grabber_red.tres" type="StyleBox" id=4] [ext_resource path="res://ui/theme/scrollbar_grabber_blue.tres" type="StyleBox" id=5] @@ -16,7 +16,8 @@ __meta__ = { "_edit_use_anchors_": false } aura_entry_scene = ExtResource( 2 ) -name_text_path = NodePath("MarginContainer/VBoxContainer/Label") +name_text_path = NodePath("MarginContainer/VBoxContainer/HBoxContainer/Label") +level_text_path = NodePath("MarginContainer/VBoxContainer/HBoxContainer/Label2") health_range_path = NodePath("MarginContainer/VBoxContainer/MarginContainer/ProgressBar") health_text_path = NodePath("MarginContainer/VBoxContainer/MarginContainer/Label") resource_range_path = NodePath("MarginContainer/VBoxContainer/MarginContainer2/ProgressBar") @@ -36,10 +37,24 @@ margin_bottom = 49.0 size_flags_horizontal = 3 custom_constants/separation = 0 -[node name="Label" type="Label" parent="MarginContainer/VBoxContainer"] +[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"] margin_right = 141.0 margin_bottom = 15.0 size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="Label" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer"] +margin_right = 137.0 +margin_bottom = 15.0 +size_flags_horizontal = 3 +size_flags_vertical = 7 +valign = 1 + +[node name="Label2" type="Label" parent="MarginContainer/VBoxContainer/HBoxContainer"] +margin_left = 141.0 +margin_right = 141.0 +margin_bottom = 15.0 +size_flags_horizontal = 0 valign = 1 [node name="MarginContainer" type="MarginContainer" parent="MarginContainer/VBoxContainer"] diff --git a/game/ui/unitframes/UnitframeBase.gd b/game/ui/player/unitframes/UnitframeBase.gd similarity index 99% rename from game/ui/unitframes/UnitframeBase.gd rename to game/ui/player/unitframes/UnitframeBase.gd index 3776057..229ce48 100644 --- a/game/ui/unitframes/UnitframeBase.gd +++ b/game/ui/player/unitframes/UnitframeBase.gd @@ -1,6 +1,6 @@ extends Container -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/unitframes/UnitframeBase.tscn b/game/ui/player/unitframes/UnitframeBase.tscn similarity index 97% rename from game/ui/unitframes/UnitframeBase.tscn rename to game/ui/player/unitframes/UnitframeBase.tscn index a3d6a38..9b3154a 100644 --- a/game/ui/unitframes/UnitframeBase.tscn +++ b/game/ui/player/unitframes/UnitframeBase.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=6 format=2] -[ext_resource path="res://ui/unitframes/UnitframeBase.gd" type="Script" id=1] +[ext_resource path="res://ui/player/unitframes/UnitframeBase.gd" type="Script" id=1] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2] [ext_resource path="res://ui/theme/scrollbar_grabber_red.tres" type="StyleBox" id=3] [ext_resource path="res://ui/theme/scrollbar_grabber_blue.tres" type="StyleBox" id=4] diff --git a/game/ui/unitframes/Unitframes.tscn b/game/ui/player/unitframes/Unitframes.tscn similarity index 75% rename from game/ui/unitframes/Unitframes.tscn rename to game/ui/player/unitframes/Unitframes.tscn index 9cb9175..930c6a2 100644 --- a/game/ui/unitframes/Unitframes.tscn +++ b/game/ui/player/unitframes/Unitframes.tscn @@ -1,8 +1,8 @@ [gd_scene load_steps=4 format=2] [ext_resource path="res://player/Unitframes.gd" type="Script" id=2] -[ext_resource path="res://ui/unitframes/UnitframeBase.tscn" type="PackedScene" id=6] -[ext_resource path="res://ui/unitframes/TargetUnitframe.tscn" type="PackedScene" id=7] +[ext_resource path="res://ui/player/unitframes/UnitframeBase.tscn" type="PackedScene" id=6] +[ext_resource path="res://ui/player/unitframes/TargetUnitframe.tscn" type="PackedScene" id=7] [node name="Unitframes" type="Control"] anchor_right = 1.0 diff --git a/game/ui/auraframe/game_module.tres b/game/ui/player/unitframes/game_module.tres similarity index 72% rename from game/ui/auraframe/game_module.tres rename to game/ui/player/unitframes/game_module.tres index bf19038..69e1398 100644 --- a/game/ui/auraframe/game_module.tres +++ b/game/ui/player/unitframes/game_module.tres @@ -1,7 +1,7 @@ [gd_resource type="Resource" load_steps=3 format=2] [ext_resource path="res://scripts/game_modules/ui_gui_child_module.gd" type="Script" id=1] -[ext_resource path="res://ui/auraframe/AuraFrame.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/player/unitframes/Unitframes.tscn" type="PackedScene" id=2] [resource] script = ExtResource( 1 ) diff --git a/game/ui/vendor_window/ItemContainer.gd b/game/ui/player/vendor_window/ItemContainer.gd similarity index 98% rename from game/ui/vendor_window/ItemContainer.gd rename to game/ui/player/vendor_window/ItemContainer.gd index cacb70f..5fd205a 100644 --- a/game/ui/vendor_window/ItemContainer.gd +++ b/game/ui/player/vendor_window/ItemContainer.gd @@ -1,6 +1,6 @@ extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/vendor_window/ItemContainer.tscn b/game/ui/player/vendor_window/ItemContainer.tscn similarity index 94% rename from game/ui/vendor_window/ItemContainer.tscn rename to game/ui/player/vendor_window/ItemContainer.tscn index 8308cf2..e21d931 100644 --- a/game/ui/vendor_window/ItemContainer.tscn +++ b/game/ui/player/vendor_window/ItemContainer.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=5 format=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1] -[ext_resource path="res://ui/vendor_window/VendorEntryPopup.gd" type="Script" id=2] -[ext_resource path="res://ui/vendor_window/ItemDragAndDropVendor.gd" type="Script" id=3] -[ext_resource path="res://ui/vendor_window/ItemContainer.gd" type="Script" id=4] +[ext_resource path="res://ui/player/vendor_window/VendorEntryPopup.gd" type="Script" id=2] +[ext_resource path="res://ui/player/vendor_window/ItemDragAndDropVendor.gd" type="Script" id=3] +[ext_resource path="res://ui/player/vendor_window/ItemContainer.gd" type="Script" id=4] [node name="ItemContainer" type="Control"] margin_left = 290.0 diff --git a/game/ui/vendor_window/ItemDragAndDropVendor.gd b/game/ui/player/vendor_window/ItemDragAndDropVendor.gd similarity index 97% rename from game/ui/vendor_window/ItemDragAndDropVendor.gd rename to game/ui/player/vendor_window/ItemDragAndDropVendor.gd index 37e5fd0..02658fd 100644 --- a/game/ui/vendor_window/ItemDragAndDropVendor.gd +++ b/game/ui/player/vendor_window/ItemDragAndDropVendor.gd @@ -1,6 +1,6 @@ extends Button -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/vendor_window/VendorEntryPopup.gd b/game/ui/player/vendor_window/VendorEntryPopup.gd similarity index 97% rename from game/ui/vendor_window/VendorEntryPopup.gd rename to game/ui/player/vendor_window/VendorEntryPopup.gd index 6e3d64e..139c466 100644 --- a/game/ui/vendor_window/VendorEntryPopup.gd +++ b/game/ui/player/vendor_window/VendorEntryPopup.gd @@ -1,6 +1,6 @@ extends PopupPanel -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/vendor_window/VendorWindow.gd b/game/ui/player/vendor_window/VendorWindow.gd similarity index 89% rename from game/ui/vendor_window/VendorWindow.gd rename to game/ui/player/vendor_window/VendorWindow.gd index 0fec5ca..2d2a2f3 100644 --- a/game/ui/vendor_window/VendorWindow.gd +++ b/game/ui/player/vendor_window/VendorWindow.gd @@ -1,6 +1,6 @@ extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -37,14 +37,17 @@ var _prev_button : Button var _next_button : Button var _player : Entity +var _vendor : Entity var _page : int = 0 var _max_pages : int = 0 var _vendor_item_data : VendorItemData +var _timer : float = 0 + func _ready() -> void: - opener_button = get_node_or_null(opener_button_path) as BaseButton + opener_button = get_node_or_null(opener_button_path) _item_entries.clear() @@ -60,6 +63,25 @@ func _ready() -> void: _next_button.connect("pressed", self, "inc_page") connect("visibility_changed", self, "_visibility_changed") + + set_process(false) + +func _process(delta): + _timer += delta + + if _timer > 1: + _timer = 0 + + if _player == null: + return + + var target : Entity = _player.getc_target() + + if target != _vendor: + hide() + + if !_player.isc_target_in_interact_range(): + hide() func inc_page() -> void: if _vendor_item_data == null: @@ -138,8 +160,10 @@ func _visibility_changed() -> void: _page = 0 refresh_all() + else: + _vendor = null - + set_process(visible) func set_player(p_player: Entity) -> void: if _player != null: @@ -155,6 +179,8 @@ func onc_open_winow_request(window_id : int) -> void: if window_id != EntityEnums.ENTITY_WINDOW_VENDOR: return + _vendor = _player.getc_target() + show() # if player.has_signal("player_moved") && !player.is_connected("player_moved", self, "on_player_moved"): diff --git a/game/ui/vendor_window/VendorWindow.tscn b/game/ui/player/vendor_window/VendorWindow.tscn similarity index 96% rename from game/ui/vendor_window/VendorWindow.tscn rename to game/ui/player/vendor_window/VendorWindow.tscn index 887493c..fa9538f 100644 --- a/game/ui/vendor_window/VendorWindow.tscn +++ b/game/ui/player/vendor_window/VendorWindow.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=4 format=2] -[ext_resource path="res://ui/vendor_window/ItemContainer.tscn" type="PackedScene" id=1] -[ext_resource path="res://ui/vendor_window/VendorWindow.gd" type="Script" id=4] +[ext_resource path="res://ui/player/vendor_window/ItemContainer.tscn" type="PackedScene" id=1] +[ext_resource path="res://ui/player/vendor_window/VendorWindow.gd" type="Script" id=4] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=5] [node name="VendorWindow" type="Control"] @@ -172,4 +172,5 @@ margin_bottom = 26.5702 size_flags_horizontal = 3 size_flags_vertical = 3 text = "Next page >" + [connection signal="pressed" from="PanelContainer/PagedContent/Header/Button" to="." method="hide"] diff --git a/game/ui/vendor_window/game_module.tres b/game/ui/player/vendor_window/game_module.tres similarity index 72% rename from game/ui/vendor_window/game_module.tres rename to game/ui/player/vendor_window/game_module.tres index df5688e..0a05a2b 100644 --- a/game/ui/vendor_window/game_module.tres +++ b/game/ui/player/vendor_window/game_module.tres @@ -1,6 +1,6 @@ [gd_resource type="Resource" load_steps=3 format=2] -[ext_resource path="res://ui/vendor_window/VendorWindow.tscn" type="PackedScene" id=1] +[ext_resource path="res://ui/player/vendor_window/VendorWindow.tscn" type="PackedScene" id=1] [ext_resource path="res://scripts/game_modules/ui_window_module.gd" type="Script" id=2] [resource] diff --git a/game/ui/scripts/KeyboardTabContainer.gd b/game/ui/scripts/KeyboardTabContainer.gd new file mode 100644 index 0000000..964dddb --- /dev/null +++ b/game/ui/scripts/KeyboardTabContainer.gd @@ -0,0 +1,60 @@ +extends TabContainer + +# Copyright (c) 2019-2021 Péter Magyar +# +# 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. + +export(NodePath) var focus_control_on_tab_change_path : NodePath + +export(String) var prev_tab_action : String = "ui_prev_page" +export(String) var next_tab_action : String = "ui_next_page" + +var _focus_control_on_tab_change : Control = null + +func _ready(): + _focus_control_on_tab_change = get_node(focus_control_on_tab_change_path) as Control + + connect("visibility_changed", self, "on_visibility_changed") + on_visibility_changed() + +func _input(event : InputEvent) -> void: + if event.is_action_pressed(next_tab_action, false): + var oct : int = current_tab + + current_tab += 1 + + if current_tab != oct: + _focus_control_on_tab_change.grab_focus() + + get_tree().set_input_as_handled() + elif event.is_action_pressed(prev_tab_action, false): + var oct : int = current_tab + + current_tab -= 1 + + if current_tab != oct: + _focus_control_on_tab_change.grab_focus() + + get_tree().set_input_as_handled() + +func on_visibility_changed() -> void: + if is_visible_in_tree(): + set_process_input(true) + else: + set_process_input(false) diff --git a/game/ui/autoload/WorldNumbers.gd b/game/ui/scripts/Window.gd similarity index 50% rename from game/ui/autoload/WorldNumbers.gd rename to game/ui/scripts/Window.gd index c27b707..8570e7f 100644 --- a/game/ui/autoload/WorldNumbers.gd +++ b/game/ui/scripts/Window.gd @@ -1,6 +1,6 @@ -extends Node +extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal @@ -20,35 +20,56 @@ extends Node # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -export(PackedScene) var number_scene +export(NodePath) var focus_button_path : NodePath = "" -func damage(entity_position : Vector3, entity_height : float, value : int, crit : bool) -> void: - var scene : Node = number_scene.instance() - - add_child(scene) - scene.owner = self - - entity_position.y += entity_height + (0.2 * randf()) - entity_position.x += entity_height * 0.4 - entity_height * 0.8 * randf() - entity_position.z += entity_height * 0.4 - entity_height * 0.8 * randf() - - scene.damage(entity_position, value, crit) - -func heal(entity_position : Vector3, entity_height : float, value : int, crit : bool) -> void: - var scene : Node = number_scene.instance() - - add_child(scene) - scene.owner = self - - randomize() - - entity_position.y += entity_height + (0.3 * randf()) - entity_position.x += entity_height * 0.4 - entity_height * 0.8 * randf() - entity_position.z += entity_height * 0.4 - entity_height * 0.8 * randf() - - - scene.heal(entity_position, value, crit) +var _previous : Control = null +var _current_focus : Control = null -func clear() -> void: - for child in get_children(): - child.queue_free() +var _viewport : Viewport = null + + +func _ready(): + connect("visibility_changed", self, "on_visibility_changed") + +func _enter_tree() -> void: + #find the viewport + var n : Node = self + + while n: + n = n.get_parent() + + if n is Viewport: + _viewport = n as Viewport + _viewport.connect("gui_focus_changed", self, "_on_control_focus_changed") + break + +func _exit_tree(): + if _viewport: + _viewport.disconnect("gui_focus_changed", self, "_on_control_focus_changed") + + _viewport = null + +func _on_control_focus_changed(node : Control) -> void: + _current_focus = node + + +func on_visibility_changed() -> void: + if visible: + focus() + else: + unfocus() + +func focus(): + _previous = _current_focus + + var n : Control = get_node(focus_button_path) + + if n: + n.grab_focus() + +func unfocus(): + if _previous: + _previous.grab_focus() + _previous = null + else: + release_focus() diff --git a/game/ui/theme/actionbar_dynamicfont.tres b/game/ui/theme/actionbar_dynamicfont.tres index 52051c6..cfd8048 100644 --- a/game/ui/theme/actionbar_dynamicfont.tres +++ b/game/ui/theme/actionbar_dynamicfont.tres @@ -2,6 +2,7 @@ [ext_resource path="res://fonts/VT323-Regular.ttf" type="DynamicFontData" id=1] + [resource] size = 21 font_data = ExtResource( 1 ) diff --git a/game/ui/theme/button_bg_stylebox_focus.tres b/game/ui/theme/button_bg_stylebox_focus.tres index 91ef13d..f014d34 100644 --- a/game/ui/theme/button_bg_stylebox_focus.tres +++ b/game/ui/theme/button_bg_stylebox_focus.tres @@ -11,4 +11,4 @@ margin_top = 5.82727 margin_bottom = 5.0562 axis_stretch_horizontal = 2 axis_stretch_vertical = 2 -modulate_color = Color( 0.807843, 0.807843, 0.807843, 1 ) +modulate_color = Color( 0.552941, 0.552941, 0.552941, 1 ) diff --git a/game/ui/theme/ui_dynamicfont_small.tres b/game/ui/theme/ui_dynamicfont_small.tres index de5e337..6f185f3 100644 --- a/game/ui/theme/ui_dynamicfont_small.tres +++ b/game/ui/theme/ui_dynamicfont_small.tres @@ -2,6 +2,7 @@ [ext_resource path="res://fonts/VT323-Regular.ttf" type="DynamicFontData" id=1] + [resource] size = 12 font_data = ExtResource( 1 ) diff --git a/game/ui/about/About.tscn b/game/ui/windows/about/About.tscn similarity index 88% rename from game/ui/about/About.tscn rename to game/ui/windows/about/About.tscn index 35ac75e..04de467 100644 --- a/game/ui/about/About.tscn +++ b/game/ui/windows/about/About.tscn @@ -1,21 +1,25 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=10 format=2] -[ext_resource path="res://ui/about/GodotAuthors.gd" type="Script" id=1] -[ext_resource path="res://ui/about/GodotDonors.gd" type="Script" id=2] +[ext_resource path="res://ui/windows/about/GodotAuthors.gd" type="Script" id=1] +[ext_resource path="res://ui/windows/about/GodotDonors.gd" type="Script" id=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=3] -[ext_resource path="res://ui/about/GodotLicense.gd" type="Script" id=4] -[ext_resource path="res://ui/about/GodotThirdPartyLicenses.gd" type="Script" id=5] -[ext_resource path="res://ui/about/Authors.gd" type="Script" id=6] -[ext_resource path="res://ui/about/Third-Party Licenses.gd" type="Script" id=7] +[ext_resource path="res://ui/windows/about/GodotLicense.gd" type="Script" id=4] +[ext_resource path="res://ui/windows/about/GodotThirdPartyLicenses.gd" type="Script" id=5] +[ext_resource path="res://ui/windows/about/Authors.gd" type="Script" id=6] +[ext_resource path="res://ui/windows/about/Third-Party Licenses.gd" type="Script" id=7] +[ext_resource path="res://ui/scripts/Window.gd" type="Script" id=8] +[ext_resource path="res://ui/scripts/KeyboardTabContainer.gd" type="Script" id=9] [node name="About" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 mouse_filter = 2 theme = ExtResource( 3 ) +script = ExtResource( 8 ) __meta__ = { "_edit_use_anchors_": false } +focus_button_path = NodePath("PanelContainer/VBoxContainer/Close") [node name="PanelContainer" type="PanelContainer" parent="."] anchor_left = 0.5 @@ -42,6 +46,8 @@ margin_bottom = 431.0 size_flags_horizontal = 3 size_flags_vertical = 3 tab_align = 0 +script = ExtResource( 9 ) +focus_control_on_tab_change_path = NodePath("../Close") [node name="Authors" type="ScrollContainer" parent="PanelContainer/VBoxContainer/TabContainer"] anchor_right = 1.0 @@ -72,7 +78,7 @@ margin_right = 720.0 margin_bottom = 396.0 size_flags_horizontal = 3 size_flags_vertical = 3 -text = "Copyright (c) 2019-2020 Péter Magyar +text = "Copyright (c) 2019-2021 Péter Magyar Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal @@ -152,6 +158,10 @@ margin_right = -4.0 margin_bottom = -4.0 size_flags_horizontal = 3 size_flags_vertical = 3 +script = ExtResource( 9 ) +focus_control_on_tab_change_path = NodePath("../../Close") +prev_tab_action = "ui_prev_page_2" +next_tab_action = "ui_next_page_2" [node name="Authors" type="ScrollContainer" parent="PanelContainer/VBoxContainer/TabContainer/Godot"] anchor_right = 1.0 @@ -260,4 +270,5 @@ margin_top = 439.0 margin_right = 728.0 margin_bottom = 465.57 text = "Close" + [connection signal="pressed" from="PanelContainer/VBoxContainer/Close" to="." method="hide"] diff --git a/game/ui/about/Authors.gd b/game/ui/windows/about/Authors.gd similarity index 100% rename from game/ui/about/Authors.gd rename to game/ui/windows/about/Authors.gd diff --git a/game/ui/about/GodotAuthors.gd b/game/ui/windows/about/GodotAuthors.gd similarity index 100% rename from game/ui/about/GodotAuthors.gd rename to game/ui/windows/about/GodotAuthors.gd diff --git a/game/ui/about/GodotDonors.gd b/game/ui/windows/about/GodotDonors.gd similarity index 100% rename from game/ui/about/GodotDonors.gd rename to game/ui/windows/about/GodotDonors.gd diff --git a/game/ui/about/GodotLicense.gd b/game/ui/windows/about/GodotLicense.gd similarity index 100% rename from game/ui/about/GodotLicense.gd rename to game/ui/windows/about/GodotLicense.gd diff --git a/game/ui/about/GodotThirdPartyLicenses.gd b/game/ui/windows/about/GodotThirdPartyLicenses.gd similarity index 100% rename from game/ui/about/GodotThirdPartyLicenses.gd rename to game/ui/windows/about/GodotThirdPartyLicenses.gd diff --git a/game/ui/about/Third-Party Licenses.gd b/game/ui/windows/about/Third-Party Licenses.gd similarity index 100% rename from game/ui/about/Third-Party Licenses.gd rename to game/ui/windows/about/Third-Party Licenses.gd diff --git a/game/ui/windows/keybinds/InputMapEditor.tscn b/game/ui/windows/keybinds/InputMapEditor.tscn new file mode 100644 index 0000000..dd2d4df --- /dev/null +++ b/game/ui/windows/keybinds/InputMapEditor.tscn @@ -0,0 +1,8 @@ +[gd_scene format=2] + +[node name="InputMapEditor" type="InputMapEditor"] +anchor_right = 1.0 +anchor_bottom = 1.0 +__meta__ = { +"_edit_use_anchors_": false +} diff --git a/game/ui/keybinds/KeybindCategory.gd b/game/ui/windows/keybinds/KeybindCategory.gd similarity index 96% rename from game/ui/keybinds/KeybindCategory.gd rename to game/ui/windows/keybinds/KeybindCategory.gd index ed3d0f9..f2b6f4c 100644 --- a/game/ui/keybinds/KeybindCategory.gd +++ b/game/ui/windows/keybinds/KeybindCategory.gd @@ -1,6 +1,6 @@ extends VBoxContainer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/keybinds/KeybindCategory.tscn b/game/ui/windows/keybinds/KeybindCategory.tscn similarity index 71% rename from game/ui/keybinds/KeybindCategory.tscn rename to game/ui/windows/keybinds/KeybindCategory.tscn index f66ca13..a47b75c 100644 --- a/game/ui/keybinds/KeybindCategory.tscn +++ b/game/ui/windows/keybinds/KeybindCategory.tscn @@ -1,16 +1,16 @@ [gd_scene load_steps=3 format=2] -[ext_resource path="res://ui/keybinds/KeybindCategory.gd" type="Script" id=1] -[ext_resource path="res://ui/keybinds/KeybindEntry.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/windows/keybinds/KeybindEntry.tscn" type="PackedScene" id=1] +[ext_resource path="res://ui/windows/keybinds/KeybindCategory.gd" type="Script" id=2] [node name="KeybindCategory" type="VBoxContainer"] margin_right = 1016.0 margin_bottom = 23.0 -script = ExtResource( 1 ) +script = ExtResource( 2 ) __meta__ = { "_edit_use_anchors_": false } -keybind_entry_scene = ExtResource( 2 ) +keybind_entry_scene = ExtResource( 1 ) content_container_path = NodePath("VBoxContainer/content") [node name="Label" type="Label" parent="."] diff --git a/game/ui/keybinds/KeybindEntry.gd b/game/ui/windows/keybinds/KeybindEntry.gd similarity index 97% rename from game/ui/keybinds/KeybindEntry.gd rename to game/ui/windows/keybinds/KeybindEntry.gd index 848faf3..0bd091c 100644 --- a/game/ui/keybinds/KeybindEntry.gd +++ b/game/ui/windows/keybinds/KeybindEntry.gd @@ -1,6 +1,6 @@ extends HBoxContainer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/keybinds/KeybindEntry.tscn b/game/ui/windows/keybinds/KeybindEntry.tscn similarity index 90% rename from game/ui/keybinds/KeybindEntry.tscn rename to game/ui/windows/keybinds/KeybindEntry.tscn index 9da6f5d..bcf83b6 100644 --- a/game/ui/keybinds/KeybindEntry.tscn +++ b/game/ui/windows/keybinds/KeybindEntry.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/keybinds/KeybindEntry.gd" type="Script" id=1] +[ext_resource path="res://ui/windows/keybinds/KeybindEntry.gd" type="Script" id=1] [node name="KeybindEntry" type="HBoxContainer"] margin_right = 996.0 @@ -30,5 +30,6 @@ margin_right = 996.0 margin_bottom = 37.0 rect_min_size = Vector2( 200, 30 ) text = "empty" + [connection signal="pressed" from="Button" to="." method="query_keybind_1"] [connection signal="pressed" from="Button2" to="." method="query_keybind_2"] diff --git a/game/ui/keybinds/Keybinds.gd b/game/ui/windows/keybinds/Keybinds.gd similarity index 99% rename from game/ui/keybinds/Keybinds.gd rename to game/ui/windows/keybinds/Keybinds.gd index bcc3db4..484c5cb 100644 --- a/game/ui/keybinds/Keybinds.gd +++ b/game/ui/windows/keybinds/Keybinds.gd @@ -1,6 +1,6 @@ extends Control -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/keybinds/Keybinds.tscn b/game/ui/windows/keybinds/Keybinds.tscn similarity index 82% rename from game/ui/keybinds/Keybinds.tscn rename to game/ui/windows/keybinds/Keybinds.tscn index c5046e3..9420e96 100644 --- a/game/ui/keybinds/Keybinds.tscn +++ b/game/ui/windows/keybinds/Keybinds.tscn @@ -1,25 +1,25 @@ [gd_scene load_steps=11 format=2] -[ext_resource path="res://ui/keybinds/Keybinds.gd" type="Script" id=1] -[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2] -[ext_resource path="res://ui/keybinds/KeybindCategory.tscn" type="PackedScene" id=3] -[ext_resource path="res://ui/icons/icon_mouse.png" type="Texture" id=4] -[ext_resource path="res://ui/icons/icon_keyboard.png" type="Texture" id=5] -[ext_resource path="res://ui/icons/icon_joy_button.png" type="Texture" id=6] -[ext_resource path="res://ui/icons/icon_remove.png" type="Texture" id=7] -[ext_resource path="res://ui/icons/icon_add.png" type="Texture" id=8] -[ext_resource path="res://ui/icons/icon_edit.png" type="Texture" id=9] +[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1] +[ext_resource path="res://ui/icons/icon_add.png" type="Texture" id=2] +[ext_resource path="res://ui/icons/icon_edit.png" type="Texture" id=3] +[ext_resource path="res://ui/icons/icon_remove.png" type="Texture" id=4] +[ext_resource path="res://ui/windows/keybinds/KeybindCategory.tscn" type="PackedScene" id=5] +[ext_resource path="res://ui/windows/keybinds/Keybinds.gd" type="Script" id=6] +[ext_resource path="res://ui/icons/icon_joy_button.png" type="Texture" id=7] +[ext_resource path="res://ui/icons/icon_mouse.png" type="Texture" id=8] +[ext_resource path="res://ui/icons/icon_keyboard.png" type="Texture" id=9] [ext_resource path="res://ui/icons/icon_joy_axis.png" type="Texture" id=10] [node name="KeybindWindow" type="PanelContainer"] anchor_right = 1.0 anchor_bottom = 1.0 -theme = ExtResource( 2 ) -script = ExtResource( 1 ) +theme = ExtResource( 1 ) +script = ExtResource( 6 ) __meta__ = { "_edit_use_anchors_": false } -keybind_category_scene = ExtResource( 3 ) +keybind_category_scene = ExtResource( 5 ) [node name="VBoxContainer" type="VBoxContainer" parent="."] margin_left = 4.0 @@ -51,13 +51,13 @@ margin_right = 1016.0 margin_bottom = 554.0 size_flags_horizontal = 3 size_flags_vertical = 3 -add_texture = ExtResource( 8 ) -remove_texture = ExtResource( 7 ) -edit_texture = ExtResource( 9 ) -keyboard_texture = ExtResource( 5 ) -joybutton_texture = ExtResource( 6 ) +add_texture = ExtResource( 2 ) +remove_texture = ExtResource( 4 ) +edit_texture = ExtResource( 3 ) +keyboard_texture = ExtResource( 9 ) +joybutton_texture = ExtResource( 7 ) joyaxis_texture = ExtResource( 10 ) -mouse_texture = ExtResource( 4 ) +mouse_texture = ExtResource( 8 ) [node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"] margin_top = 562.0 @@ -78,6 +78,7 @@ margin_right = 1016.0 margin_bottom = 30.0 rect_min_size = Vector2( 80, 30 ) text = "OK" + [connection signal="pressed" from="VBoxContainer/HBoxContainer/Button" to="." method="hide"] [connection signal="pressed" from="VBoxContainer/HBoxContainer2/Button" to="." method="hide"] [connection signal="pressed" from="VBoxContainer/HBoxContainer2/Button2" to="." method="close"] diff --git a/game/ui/options/OptionButtonRow.gd b/game/ui/windows/options/OptionButtonRow.gd similarity index 97% rename from game/ui/options/OptionButtonRow.gd rename to game/ui/windows/options/OptionButtonRow.gd index c9c5bee..8e39d80 100644 --- a/game/ui/options/OptionButtonRow.gd +++ b/game/ui/windows/options/OptionButtonRow.gd @@ -1,6 +1,6 @@ extends HBoxContainer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/options/OptionButtonRow.tscn b/game/ui/windows/options/OptionButtonRow.tscn similarity index 85% rename from game/ui/options/OptionButtonRow.tscn rename to game/ui/windows/options/OptionButtonRow.tscn index c86e532..061c2e0 100644 --- a/game/ui/options/OptionButtonRow.tscn +++ b/game/ui/windows/options/OptionButtonRow.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/options/OptionButtonRow.gd" type="Script" id=1] +[ext_resource path="res://ui/windows/options/OptionButtonRow.gd" type="Script" id=1] [node name="OptionButtonRow" type="HBoxContainer"] margin_right = 527.0 diff --git a/game/ui/options/OptionCheckBox.gd b/game/ui/windows/options/OptionCheckBox.gd similarity index 97% rename from game/ui/options/OptionCheckBox.gd rename to game/ui/windows/options/OptionCheckBox.gd index 9a53aa2..ce12778 100644 --- a/game/ui/options/OptionCheckBox.gd +++ b/game/ui/windows/options/OptionCheckBox.gd @@ -1,6 +1,6 @@ extends CheckBox -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/options/OptionCheckboxRow.tscn b/game/ui/windows/options/OptionCheckboxRow.tscn similarity index 86% rename from game/ui/options/OptionCheckboxRow.tscn rename to game/ui/windows/options/OptionCheckboxRow.tscn index 92ab19a..b694c9a 100644 --- a/game/ui/options/OptionCheckboxRow.tscn +++ b/game/ui/windows/options/OptionCheckboxRow.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/options/OptionToggleRow.gd" type="Script" id=1] +[ext_resource path="res://ui/windows/options/OptionToggleRow.gd" type="Script" id=1] [node name="OptionToggleRow" type="HBoxContainer"] margin_top = 34.0 diff --git a/game/ui/options/OptionEnumRow.gd b/game/ui/windows/options/OptionEnumRow.gd similarity index 97% rename from game/ui/options/OptionEnumRow.gd rename to game/ui/windows/options/OptionEnumRow.gd index 29b3f31..edf5e09 100644 --- a/game/ui/options/OptionEnumRow.gd +++ b/game/ui/windows/options/OptionEnumRow.gd @@ -1,7 +1,7 @@ tool extends HBoxContainer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/options/OptionEnumRow.tscn b/game/ui/windows/options/OptionEnumRow.tscn similarity index 86% rename from game/ui/options/OptionEnumRow.tscn rename to game/ui/windows/options/OptionEnumRow.tscn index 6f900d9..81a9938 100644 --- a/game/ui/options/OptionEnumRow.tscn +++ b/game/ui/windows/options/OptionEnumRow.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/options/OptionEnumRow.gd" type="Script" id=1] +[ext_resource path="res://ui/windows/options/OptionEnumRow.gd" type="Script" id=1] [node name="OptionEnumRow" type="HBoxContainer"] margin_top = 34.0 diff --git a/game/ui/options/OptionToggleRow.gd b/game/ui/windows/options/OptionToggleRow.gd similarity index 97% rename from game/ui/options/OptionToggleRow.gd rename to game/ui/windows/options/OptionToggleRow.gd index 6ab985c..7a7b006 100644 --- a/game/ui/options/OptionToggleRow.gd +++ b/game/ui/windows/options/OptionToggleRow.gd @@ -1,7 +1,7 @@ tool extends HBoxContainer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/options/Options.tscn b/game/ui/windows/options/Options.tscn similarity index 66% rename from game/ui/options/Options.tscn rename to game/ui/windows/options/Options.tscn index 2316be6..f937e1d 100644 --- a/game/ui/options/Options.tscn +++ b/game/ui/windows/options/Options.tscn @@ -1,21 +1,25 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=10 format=2] [ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1] -[ext_resource path="res://ui/player_ui/RemoveProfile.gd" type="Script" id=2] -[ext_resource path="res://ui/options/OptionsViewportLabel.tscn" type="PackedScene" id=3] -[ext_resource path="res://ui/options/OptionCheckboxRow.tscn" type="PackedScene" id=4] -[ext_resource path="res://ui/options/OptionCheckBox.gd" type="Script" id=5] -[ext_resource path="res://ui/options/OptionEnumRow.tscn" type="PackedScene" id=6] -[ext_resource path="res://ui/options/OptionsSpinboxRow.tscn" type="PackedScene" id=8] +[ext_resource path="res://ui/windows/options/OptionEnumRow.tscn" type="PackedScene" id=2] +[ext_resource path="res://ui/windows/options/OptionCheckboxRow.tscn" type="PackedScene" id=3] +[ext_resource path="res://ui/player/player_ui/RemoveProfile.gd" type="Script" id=4] +[ext_resource path="res://ui/windows/options/OptionsViewportLabel.tscn" type="PackedScene" id=5] +[ext_resource path="res://ui/windows/options/OptionCheckBox.gd" type="Script" id=6] +[ext_resource path="res://ui/scripts/Window.gd" type="Script" id=7] +[ext_resource path="res://ui/scripts/KeyboardTabContainer.gd" type="Script" id=8] +[ext_resource path="res://ui/windows/options/OptionsSpinboxRow.tscn" type="PackedScene" id=9] [node name="Options" type="Control"] anchor_right = 1.0 anchor_bottom = 1.0 mouse_filter = 2 theme = ExtResource( 1 ) +script = ExtResource( 7 ) __meta__ = { "_edit_use_anchors_": false } +focus_button_path = NodePath("PanelContainer/VBoxContainer/Close") [node name="PanelContainer" type="PanelContainer" parent="."] anchor_left = 0.5 @@ -42,6 +46,8 @@ margin_bottom = 431.0 size_flags_horizontal = 3 size_flags_vertical = 3 tab_align = 0 +script = ExtResource( 8 ) +focus_control_on_tab_change_path = NodePath("../Close") [node name="Video" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer"] anchor_right = 1.0 @@ -52,17 +58,17 @@ margin_right = -4.0 margin_bottom = -4.0 size_flags_horizontal = 3 -[node name="ViewportWidth" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 3 )] +[node name="ViewportWidth" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 5 )] margin_bottom = 15.0 property_label = "Viewport Width" -[node name="ViewportHeight" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 3 )] +[node name="ViewportHeight" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 5 )] margin_top = 23.0 margin_bottom = 38.0 property_label = "Viewport Height" width = false -[node name="ViewportScale" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 8 )] +[node name="ViewportScale" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 9 )] margin_top = 46.0 margin_bottom = 70.0 property_category = "rendering" @@ -72,28 +78,28 @@ min_value = 20.0 step = 5.0 suffix = "%" -[node name="Borderless" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 4 )] +[node name="Borderless" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 3 )] margin_top = 78.0 margin_bottom = 104.0 property_category = "rendering" property_name = "borderless" property_label = "Borderless Window" -[node name="FullScreen" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 4 )] +[node name="FullScreen" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 3 )] margin_top = 112.0 margin_bottom = 138.0 property_category = "rendering" property_name = "fullscreen" property_label = "Fullscreen" -[node name="AlwaysOnTop" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 4 )] +[node name="AlwaysOnTop" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 3 )] margin_top = 146.0 margin_bottom = 172.0 property_category = "rendering" property_name = "always_on_top" property_label = "Always On Top" -[node name="ThreadModel" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 6 )] +[node name="ThreadModel" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 2 )] margin_top = 180.0 margin_bottom = 206.0 property_category = "rendering" @@ -101,27 +107,37 @@ property_name = "thread_model" property_label = "Thread Model" options = [ "Single-Unsafe", "Single-Safe", "Multi Threaded" ] -[node name="Shadows" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 4 )] +[node name="Shadows" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 3 )] margin_top = 214.0 margin_bottom = 240.0 property_category = "rendering" property_name = "shadows_enabled" property_label = "Shadows Enabled" -[node name="VSync" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 4 )] +[node name="VSync" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 3 )] margin_top = 248.0 margin_bottom = 274.0 property_category = "rendering" property_name = "use_vsync" property_label = "VSync" -[node name="VSyncViaCompositor" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 4 )] +[node name="VSyncViaCompositor" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 3 )] margin_top = 282.0 margin_bottom = 308.0 property_category = "rendering" property_name = "vsync_via_compositor" property_label = "VSync Via Compositor" +[node name="Game" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer"] +visible = false +anchor_right = 1.0 +anchor_bottom = 1.0 +margin_left = 4.0 +margin_top = 31.0 +margin_right = -4.0 +margin_bottom = -4.0 +size_flags_horizontal = 3 + [node name="Interface" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer"] visible = false anchor_right = 1.0 @@ -132,16 +148,16 @@ margin_right = -4.0 margin_bottom = -4.0 size_flags_horizontal = 3 -[node name="OptionToggleRow" parent="PanelContainer/VBoxContainer/TabContainer/Interface" instance=ExtResource( 4 )] +[node name="OptionToggleRow" parent="PanelContainer/VBoxContainer/TabContainer/Interface" instance=ExtResource( 3 )] margin_top = 0.0 margin_bottom = 26.0 property_category = "ui" property_name = "touchscreen_mode" property_label = "Touchscreen Mode" -[node name="OptionsSpinboxRow" parent="PanelContainer/VBoxContainer/TabContainer/Interface" instance=ExtResource( 8 )] -margin_top = 58.0 -margin_bottom = 82.0 +[node name="OptionsSpinboxRow" parent="PanelContainer/VBoxContainer/TabContainer/Interface" instance=ExtResource( 9 )] +margin_top = 34.0 +margin_bottom = 58.0 property_category = "ui" property_name = "ui_scale" property_label = "UI Scale" @@ -150,9 +166,9 @@ max_value = 2.4 step = 0.01 rounded = false -[node name="OptionsSpinboxRow2" parent="PanelContainer/VBoxContainer/TabContainer/Interface" instance=ExtResource( 8 )] -margin_top = 90.0 -margin_bottom = 114.0 +[node name="OptionsSpinboxRow2" parent="PanelContainer/VBoxContainer/TabContainer/Interface" instance=ExtResource( 9 )] +margin_top = 66.0 +margin_bottom = 90.0 property_category = "ui" property_name = "ui_scale_touch" property_label = "UI Scale Touch" @@ -161,6 +177,20 @@ max_value = 2.4 step = 0.01 rounded = false +[node name="OptionToggleRow2" parent="PanelContainer/VBoxContainer/TabContainer/Interface" instance=ExtResource( 3 )] +margin_top = 98.0 +margin_bottom = 124.0 +property_category = "ui" +property_name = "actionbar_show_keybind_text" +property_label = "Show Keybind Text" + +[node name="OptionToggleRow3" parent="PanelContainer/VBoxContainer/TabContainer/Interface" instance=ExtResource( 3 )] +margin_top = 132.0 +margin_bottom = 158.0 +property_category = "ui" +property_name = "actionbar_show_coldown_text" +property_label = "Show Cooldown Text" + [node name="Debug" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer"] visible = false anchor_right = 1.0 @@ -175,7 +205,7 @@ size_flags_horizontal = 3 margin_right = 527.0 margin_bottom = 26.269 text = "Show Debug info" -script = ExtResource( 5 ) +script = ExtResource( 6 ) property_category = "debug" property_name = "debug_info" @@ -185,7 +215,7 @@ margin_right = 527.0 margin_bottom = 60.269 size_flags_horizontal = 3 text = "Remove Profile" -script = ExtResource( 2 ) +script = ExtResource( 4 ) [node name="Close" type="Button" parent="PanelContainer/VBoxContainer"] margin_top = 439.0 diff --git a/game/ui/options/OptionsSliderRow.gd b/game/ui/windows/options/OptionsSliderRow.gd similarity index 97% rename from game/ui/options/OptionsSliderRow.gd rename to game/ui/windows/options/OptionsSliderRow.gd index 1468a35..a06249e 100644 --- a/game/ui/options/OptionsSliderRow.gd +++ b/game/ui/windows/options/OptionsSliderRow.gd @@ -1,7 +1,7 @@ tool extends HBoxContainer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/options/OptionsSliderRow.tscn b/game/ui/windows/options/OptionsSliderRow.tscn similarity index 86% rename from game/ui/options/OptionsSliderRow.tscn rename to game/ui/windows/options/OptionsSliderRow.tscn index 7017178..f9ac8e3 100644 --- a/game/ui/options/OptionsSliderRow.tscn +++ b/game/ui/windows/options/OptionsSliderRow.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/options/OptionsSliderRow.gd" type="Script" id=1] +[ext_resource path="res://ui/windows/options/OptionsSliderRow.gd" type="Script" id=1] [node name="OptionsSliderRow" type="HBoxContainer"] margin_top = 46.0 diff --git a/game/ui/options/OptionsSpinboxRow.gd b/game/ui/windows/options/OptionsSpinboxRow.gd similarity index 98% rename from game/ui/options/OptionsSpinboxRow.gd rename to game/ui/windows/options/OptionsSpinboxRow.gd index ac26d37..89d3b28 100644 --- a/game/ui/options/OptionsSpinboxRow.gd +++ b/game/ui/windows/options/OptionsSpinboxRow.gd @@ -1,7 +1,7 @@ tool extends HBoxContainer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/options/OptionsSpinboxRow.tscn b/game/ui/windows/options/OptionsSpinboxRow.tscn similarity index 89% rename from game/ui/options/OptionsSpinboxRow.tscn rename to game/ui/windows/options/OptionsSpinboxRow.tscn index dbe44e5..d6914b5 100644 --- a/game/ui/options/OptionsSpinboxRow.tscn +++ b/game/ui/windows/options/OptionsSpinboxRow.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/options/OptionsSpinboxRow.gd" type="Script" id=1] +[ext_resource path="res://ui/windows/options/OptionsSpinboxRow.gd" type="Script" id=1] [node name="OptionsSpinboxRow" type="HBoxContainer"] margin_top = 70.0 diff --git a/game/ui/options/OptionsViewportLabel.gd b/game/ui/windows/options/OptionsViewportLabel.gd similarity index 97% rename from game/ui/options/OptionsViewportLabel.gd rename to game/ui/windows/options/OptionsViewportLabel.gd index aff9ede..7903e7d 100644 --- a/game/ui/options/OptionsViewportLabel.gd +++ b/game/ui/windows/options/OptionsViewportLabel.gd @@ -1,6 +1,6 @@ extends HBoxContainer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/options/OptionsViewportLabel.tscn b/game/ui/windows/options/OptionsViewportLabel.tscn similarity index 85% rename from game/ui/options/OptionsViewportLabel.tscn rename to game/ui/windows/options/OptionsViewportLabel.tscn index f4cd861..5c2313f 100644 --- a/game/ui/options/OptionsViewportLabel.tscn +++ b/game/ui/windows/options/OptionsViewportLabel.tscn @@ -1,6 +1,6 @@ [gd_scene load_steps=2 format=2] -[ext_resource path="res://ui/options/OptionsViewportLabel.gd" type="Script" id=1] +[ext_resource path="res://ui/windows/options/OptionsViewportLabel.gd" type="Script" id=1] [node name="OptionsViewportLabel" type="HBoxContainer"] margin_right = 527.0 diff --git a/game/ui/options/Threads.gd b/game/ui/windows/options/Threads.gd similarity index 97% rename from game/ui/options/Threads.gd rename to game/ui/windows/options/Threads.gd index 7e7596b..e8ee726 100644 --- a/game/ui/options/Threads.gd +++ b/game/ui/windows/options/Threads.gd @@ -1,6 +1,6 @@ extends HBoxContainer -# Copyright (c) 2019-2020 Péter Magyar +# Copyright (c) 2019-2021 Péter Magyar # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal diff --git a/game/ui/world_numbers_2d/WorldNumbers.tscn b/game/ui/world_numbers_2d/WorldNumbers.tscn deleted file mode 100644 index 4fe4581..0000000 --- a/game/ui/world_numbers_2d/WorldNumbers.tscn +++ /dev/null @@ -1,8 +0,0 @@ -[gd_scene load_steps=3 format=2] - -[ext_resource path="res://ui/world_numbers_2d/WorldNumbers.gd" type="Script" id=1] -[ext_resource path="res://ui/world_numbers_2d/Number.tscn" type="PackedScene" id=2] - -[node name="WorldNumbers" type="Node"] -script = ExtResource( 1 ) -number_scene = ExtResource( 2 )