fixed camera script and restructured ui folder

This commit is contained in:
Luca 2024-09-27 21:31:03 +02:00
parent 877ebafc74
commit 5748d34b34
32 changed files with 781 additions and 162 deletions

View file

@ -0,0 +1,52 @@
[gd_scene load_steps=4 format=3 uid="uid://vxwg04fxtbxf"]
[ext_resource type="Texture2D" uid="uid://d1324yxmpvk8e" path="res://assets/textures/Game Icons/Vector/2x/wrench.png" id="1_2tmqf"]
[ext_resource type="Texture2D" uid="uid://ofkfd2bydpph" path="res://assets/textures/Generic/Vector/generic_button_circle_outline.svg" id="2_88fpt"]
[sub_resource type="LabelSettings" id="LabelSettings_ps1u1"]
font_size = 24
[node name="Move1" type="PanelContainer"]
offset_right = 236.0
offset_bottom = 73.0
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 2
theme_override_constants/margin_left = 6
theme_override_constants/margin_top = 6
theme_override_constants/margin_right = 6
theme_override_constants/margin_bottom = 6
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer"]
layout_mode = 2
texture = ExtResource("1_2tmqf")
expand_mode = 2
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
[node name="MoveName" type="Label" parent="MarginContainer/HBoxContainer/VBoxContainer"]
layout_mode = 2
text = "Move Name 1"
label_settings = SubResource("LabelSettings_ps1u1")
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/HBoxContainer/VBoxContainer"]
layout_mode = 2
[node name="TextureRect" type="TextureRect" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer"]
layout_mode = 2
texture = ExtResource("2_88fpt")
expand_mode = 2
[node name="Label" type="Label" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer"]
layout_mode = 2
text = "Effective"
[node name="Label2" type="Label" parent="MarginContainer/HBoxContainer/VBoxContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 10
text = "10 / 10"

18
ui/battle_ui/battle_ui.gd Normal file
View file

@ -0,0 +1,18 @@
extends Control
var move_button = preload("res://ui/battle_ui/battle_move_button.tscn")
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
self.visible = false
for i in range(4):
var button = move_button.instantiate()
$MarginContainer/HBoxContainer/BattleMovesMenu.add_child(button)
func _on_battle_button_pressed() -> void:
print("attack here")
# attack here
#%MainBattleMenu.visible = false
#%BattleMovesMenu.visible = true
pass # Replace with function body.

281
ui/battle_ui/battle_ui.tscn Normal file
View file

@ -0,0 +1,281 @@
[gd_scene load_steps=19 format=3 uid="uid://dyroahq85mhws"]
[ext_resource type="Script" path="res://ui/battle_ui/battle_ui.gd" id="1_jyqir"]
[ext_resource type="Texture2D" uid="uid://ve2k0qrfpwxw" path="res://assets/textures/Generic/Vector/generic_button_circle_fill.svg" id="2_keyyt"]
[ext_resource type="Texture2D" uid="uid://4t8cotroofge" path="res://assets/textures/Game Icons/Vector/2x/upRight.png" id="3_fa6tk"]
[ext_resource type="StyleBox" uid="uid://ddtjhp2lob6to" path="res://ui/styles/battle_ui_normal_button.tres" id="4_r2q1k"]
[ext_resource type="Texture2D" uid="uid://cxry7h4q17lir" path="res://assets/textures/Game Icons/Vector/2x/star.png" id="4_saqy8"]
[ext_resource type="Texture2D" uid="uid://c1dlsfah0ioi5" path="res://assets/textures/Game Icons/Vector/2x/massiveMultiplayer.png" id="5_pnobx"]
[ext_resource type="StyleBox" uid="uid://cv8ispcxuwjn5" path="res://ui/styles/battle_ui_pressed_button.tres" id="5_w48y1"]
[ext_resource type="Texture2D" uid="uid://dbycrn4i3wkhu" path="res://assets/textures/Game Icons/Vector/2x/menuList.png" id="6_ikm1n"]
[ext_resource type="Texture2D" uid="uid://cs84avwwjbn5q" path="res://assets/textures/Game Icons/Vector/2x/exitRight.png" id="7_tihhr"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6o8cs"]
content_margin_left = 20.0
content_margin_top = 2.0
content_margin_right = 20.0
content_margin_bottom = 2.0
bg_color = Color(0, 0, 0, 0.501961)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[sub_resource type="LabelSettings" id="LabelSettings_38ujs"]
font_size = 26
[sub_resource type="LabelSettings" id="LabelSettings_kcdfy"]
font_size = 26
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_auqmk"]
content_margin_top = 10.0
content_margin_right = 10.0
bg_color = Color(0, 0, 0, 0.392157)
border_width_left = 1
border_width_top = 1
border_width_right = 1
border_width_bottom = 1
border_color = Color(1, 1, 1, 1)
corner_radius_top_left = 4
corner_radius_top_right = 4
corner_radius_bottom_right = 4
corner_radius_bottom_left = 4
expand_margin_left = 3.0
expand_margin_top = 3.0
expand_margin_right = 3.0
expand_margin_bottom = 3.0
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_84eln"]
bg_color = Color(0, 0.712615, 0.446827, 1)
corner_radius_top_left = 3
corner_radius_top_right = 3
corner_radius_bottom_right = 3
corner_radius_bottom_left = 3
expand_margin_left = 1.0
expand_margin_top = 1.0
expand_margin_right = 1.0
expand_margin_bottom = 1.0
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_eqgks"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_4ki2k"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_cabkl"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_g6kqv"]
[node name="BattleUI" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("1_jyqir")
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
offset_top = -138.0
grow_horizontal = 2
grow_vertical = 0
theme_override_constants/margin_left = 30
theme_override_constants/margin_right = 30
theme_override_constants/margin_bottom = 50
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
layout_mode = 2
[node name="Left" type="HBoxContainer" parent="MarginContainer/HBoxContainer"]
layout_mode = 2
size_flags_vertical = 8
theme_override_constants/separation = 16
[node name="PartyAliveStatus" type="VBoxContainer" parent="MarginContainer/HBoxContainer/Left"]
layout_mode = 2
[node name="Monster1" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyAliveStatus"]
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
size_flags_horizontal = 0
texture = ExtResource("2_keyyt")
expand_mode = 2
[node name="Monster2" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyAliveStatus"]
self_modulate = Color(1, 1, 1, 0.392157)
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
size_flags_horizontal = 0
texture = ExtResource("2_keyyt")
expand_mode = 2
[node name="Monster3" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyAliveStatus"]
self_modulate = Color(1, 1, 1, 0.392157)
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
size_flags_horizontal = 0
texture = ExtResource("2_keyyt")
expand_mode = 2
[node name="Monster4" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyAliveStatus"]
self_modulate = Color(1, 1, 1, 0.392157)
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
size_flags_horizontal = 0
texture = ExtResource("2_keyyt")
expand_mode = 2
[node name="Monster5" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyAliveStatus"]
self_modulate = Color(1, 1, 1, 0.392157)
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
size_flags_horizontal = 0
texture = ExtResource("2_keyyt")
expand_mode = 2
[node name="Monster6" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyAliveStatus"]
self_modulate = Color(1, 1, 1, 0.392157)
custom_minimum_size = Vector2(32, 32)
layout_mode = 2
size_flags_horizontal = 0
texture = ExtResource("2_keyyt")
expand_mode = 2
[node name="PartyFighterInfo" type="VBoxContainer" parent="MarginContainer/HBoxContainer/Left"]
layout_mode = 2
size_flags_vertical = 0
theme_override_constants/separation = 10
[node name="LevelAndGender" type="HBoxContainer" parent="MarginContainer/HBoxContainer/Left/PartyFighterInfo"]
layout_mode = 2
[node name="Level" type="PanelContainer" parent="MarginContainer/HBoxContainer/Left/PartyFighterInfo/LevelAndGender"]
layout_mode = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_6o8cs")
[node name="Label" type="Label" parent="MarginContainer/HBoxContainer/Left/PartyFighterInfo/LevelAndGender/Level"]
layout_mode = 2
text = "Lv. 99"
label_settings = SubResource("LabelSettings_38ujs")
[node name="Gender" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/PartyFighterInfo/LevelAndGender"]
self_modulate = Color(0.450091, 0.470517, 0.93375, 1)
custom_minimum_size = Vector2(12, 12)
layout_mode = 2
texture = ExtResource("3_fa6tk")
expand_mode = 2
stretch_mode = 4
[node name="MonsterName" type="Label" parent="MarginContainer/HBoxContainer/Left/PartyFighterInfo"]
layout_mode = 2
text = "Monstername"
label_settings = SubResource("LabelSettings_kcdfy")
[node name="ProgressBar" type="ProgressBar" parent="MarginContainer/HBoxContainer/Left/PartyFighterInfo"]
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_auqmk")
theme_override_styles/fill = SubResource("StyleBoxFlat_84eln")
value = 50.0
show_percentage = false
[node name="Spacer" type="Control" parent="MarginContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.5
[node name="MainBattleMenu" type="VBoxContainer" parent="MarginContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
[node name="BattleButton" type="Button" parent="MarginContainer/HBoxContainer/MainBattleMenu"]
layout_mode = 2
theme_override_constants/h_separation = 18
theme_override_constants/icon_max_width = 20
theme_override_font_sizes/font_size = 26
theme_override_styles/focus = SubResource("StyleBoxEmpty_eqgks")
theme_override_styles/disabled_mirrored = ExtResource("4_r2q1k")
theme_override_styles/disabled = ExtResource("4_r2q1k")
theme_override_styles/hover_pressed_mirrored = ExtResource("4_r2q1k")
theme_override_styles/hover_pressed = ExtResource("4_r2q1k")
theme_override_styles/hover_mirrored = ExtResource("4_r2q1k")
theme_override_styles/hover = ExtResource("4_r2q1k")
theme_override_styles/pressed_mirrored = ExtResource("5_w48y1")
theme_override_styles/pressed = ExtResource("5_w48y1")
theme_override_styles/normal_mirrored = ExtResource("4_r2q1k")
theme_override_styles/normal = ExtResource("4_r2q1k")
text = "Battle"
icon = ExtResource("4_saqy8")
alignment = 0
[node name="PartyButton" type="Button" parent="MarginContainer/HBoxContainer/MainBattleMenu"]
layout_mode = 2
theme_override_constants/h_separation = 18
theme_override_constants/icon_max_width = 20
theme_override_font_sizes/font_size = 26
theme_override_styles/focus = SubResource("StyleBoxEmpty_4ki2k")
theme_override_styles/disabled_mirrored = ExtResource("4_r2q1k")
theme_override_styles/disabled = ExtResource("4_r2q1k")
theme_override_styles/hover_pressed_mirrored = ExtResource("4_r2q1k")
theme_override_styles/hover_pressed = ExtResource("4_r2q1k")
theme_override_styles/hover_mirrored = ExtResource("4_r2q1k")
theme_override_styles/hover = ExtResource("4_r2q1k")
theme_override_styles/pressed_mirrored = ExtResource("5_w48y1")
theme_override_styles/pressed = ExtResource("5_w48y1")
theme_override_styles/normal_mirrored = ExtResource("4_r2q1k")
theme_override_styles/normal = ExtResource("4_r2q1k")
text = "Party"
icon = ExtResource("5_pnobx")
alignment = 0
[node name="ItemsButton" type="Button" parent="MarginContainer/HBoxContainer/MainBattleMenu"]
layout_mode = 2
theme_override_constants/h_separation = 18
theme_override_constants/icon_max_width = 20
theme_override_font_sizes/font_size = 26
theme_override_styles/focus = SubResource("StyleBoxEmpty_cabkl")
theme_override_styles/disabled_mirrored = ExtResource("4_r2q1k")
theme_override_styles/disabled = ExtResource("4_r2q1k")
theme_override_styles/hover_pressed_mirrored = ExtResource("4_r2q1k")
theme_override_styles/hover_pressed = ExtResource("4_r2q1k")
theme_override_styles/hover_mirrored = ExtResource("4_r2q1k")
theme_override_styles/hover = ExtResource("4_r2q1k")
theme_override_styles/pressed_mirrored = ExtResource("5_w48y1")
theme_override_styles/pressed = ExtResource("5_w48y1")
theme_override_styles/normal_mirrored = ExtResource("4_r2q1k")
theme_override_styles/normal = ExtResource("4_r2q1k")
text = "Items"
icon = ExtResource("6_ikm1n")
alignment = 0
[node name="RunButton" type="Button" parent="MarginContainer/HBoxContainer/MainBattleMenu"]
layout_mode = 2
theme_override_constants/h_separation = 18
theme_override_constants/icon_max_width = 20
theme_override_font_sizes/font_size = 26
theme_override_styles/focus = SubResource("StyleBoxEmpty_g6kqv")
theme_override_styles/disabled_mirrored = ExtResource("4_r2q1k")
theme_override_styles/disabled = ExtResource("4_r2q1k")
theme_override_styles/hover_pressed_mirrored = ExtResource("4_r2q1k")
theme_override_styles/hover_pressed = ExtResource("4_r2q1k")
theme_override_styles/hover_mirrored = ExtResource("4_r2q1k")
theme_override_styles/hover = ExtResource("4_r2q1k")
theme_override_styles/pressed_mirrored = ExtResource("5_w48y1")
theme_override_styles/pressed = ExtResource("5_w48y1")
theme_override_styles/normal_mirrored = ExtResource("4_r2q1k")
theme_override_styles/normal = ExtResource("4_r2q1k")
text = "Run"
icon = ExtResource("7_tihhr")
alignment = 0
[node name="BattleMovesMenu" type="VBoxContainer" parent="MarginContainer/HBoxContainer"]
unique_name_in_owner = true
visible = false
layout_mode = 2
size_flags_horizontal = 3
[connection signal="pressed" from="MarginContainer/HBoxContainer/MainBattleMenu/BattleButton" to="." method="_on_battle_button_pressed"]

View file

@ -2,7 +2,15 @@ extends Control
var pressed: bool = false
var previous_position : Vector2 = Vector2.ZERO
var speed : float = 0.04
var speed : float = 0.5
var delta_position: Vector2 = Vector2.ZERO
var damping_factor: float = 0.08
func _process(delta: float) -> void:
simulate_joystick_motion(JOY_AXIS_RIGHT_X, delta_position.x * delta * speed, 0)
print(delta_position)
#delta_position *= 0.92
delta_position *= (1 - damping_factor)
func _gui_input(event: InputEvent) -> void:
# Filter touch or drag events only.
@ -11,16 +19,15 @@ func _gui_input(event: InputEvent) -> void:
if event is InputEventScreenTouch:
if event.is_pressed():
previous_position = event.position
pressed = true
else:
pressed = false
simulate_joystick_motion(JOY_AXIS_RIGHT_X, 0, 0)
previous_position = Vector2.ZERO
if pressed and event is InputEventScreenDrag:
var delta_position : Vector2 = event.position - previous_position
#print(delta_position)
simulate_joystick_motion(JOY_AXIS_RIGHT_X, -delta_position.x * speed, 0)
#simulate_joystick_motion(JOY_AXIS_RIGHT_Y, delta_position.y * speed, 0)
delta_position = clamp(previous_position - event.position, Vector2(-10, -10), Vector2(10, 10))
# finally update the previous position
previous_position = event.position

View file

@ -1,4 +1,4 @@
extends MarginContainer
extends Control
class_name IngameControls
signal menu_button_clicked

View file

@ -1,8 +1,8 @@
[gd_scene load_steps=11 format=3 uid="uid://1anjhvi173g3"]
[ext_resource type="Script" path="res://ui/ingame_controls.gd" id="1_iw1sp"]
[ext_resource type="Script" path="res://ui/ingame_controls/ingame_controls.gd" id="1_iw1sp"]
[ext_resource type="Texture2D" uid="uid://2vxx2waofxpw" path="res://assets/textures/Xbox Series/Vector/xbox_button_menu_outline.svg" id="1_wr5sh"]
[ext_resource type="Script" path="res://ui/joystick.gd" id="2_pyri2"]
[ext_resource type="Script" path="res://ui/ingame_controls/joystick.gd" id="2_pyri2"]
[ext_resource type="Texture2D" uid="uid://8anyvhkcy4ng" path="res://assets/textures/Xbox Series/Vector/xbox_button_a.svg" id="3_lgi8v"]
[ext_resource type="Texture2D" uid="uid://cbep021ykpb23" path="res://assets/textures/Game Icons/Vector/2x/save.png" id="5_2pil1"]
[ext_resource type="Texture2D" uid="uid://bwyoxxotdisyp" path="res://assets/textures/Game Icons/Vector/2x/gear.png" id="5_nwwsc"]
@ -15,12 +15,26 @@ corner_radius_top_left = 999
corner_radius_top_right = 999
corner_radius_bottom_right = 999
corner_radius_bottom_left = 999
corner_detail = 12
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_hfsbq"]
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_x4icw"]
[node name="IngameControls" type="MarginContainer"]
[node name="IngameControls" type="Control"]
layout_mode = 3
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 0
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("1_iw1sp")
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 1
anchors_preset = 12
anchor_top = 1.0
anchor_right = 1.0
@ -28,25 +42,23 @@ anchor_bottom = 1.0
offset_top = -338.0
grow_horizontal = 2
grow_vertical = 0
size_flags_vertical = 8
theme_override_constants/margin_left = 30
theme_override_constants/margin_right = 30
theme_override_constants/margin_bottom = 30
script = ExtResource("1_iw1sp")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"]
layout_mode = 2
size_flags_vertical = 8
alignment = 2
[node name="Left" type="VBoxContainer" parent="HBoxContainer"]
[node name="Left" type="VBoxContainer" parent="MarginContainer/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_override_constants/separation = 8
alignment = 2
[node name="MenuButton" type="Button" parent="HBoxContainer/Left"]
[node name="MenuButton" type="Button" parent="MarginContainer/HBoxContainer/Left"]
self_modulate = Color(0, 0, 0, 0.392157)
custom_minimum_size = Vector2(120, 120)
layout_mode = 2
@ -56,14 +68,14 @@ icon = ExtResource("1_wr5sh")
flat = true
expand_icon = true
[node name="JoystickPanel" type="Panel" parent="HBoxContainer/Left"]
[node name="JoystickPanel" type="Panel" parent="MarginContainer/HBoxContainer/Left"]
custom_minimum_size = Vector2(180, 180)
layout_mode = 2
size_flags_horizontal = 0
theme_override_styles/panel = SubResource("StyleBoxFlat_nfkty")
script = ExtResource("2_pyri2")
[node name="Thumbstick" type="TextureRect" parent="HBoxContainer/Left/JoystickPanel"]
[node name="Thumbstick" type="TextureRect" parent="MarginContainer/HBoxContainer/Left/JoystickPanel"]
self_modulate = Color(0, 0, 0, 0.392157)
layout_mode = 1
anchors_preset = 8
@ -81,13 +93,13 @@ texture = ExtResource("3_lgi8v")
expand_mode = 3
stretch_mode = 5
[node name="Right" type="VBoxContainer" parent="HBoxContainer"]
[node name="Right" type="VBoxContainer" parent="MarginContainer/HBoxContainer"]
layout_mode = 2
size_flags_vertical = 8
theme_override_constants/separation = 0
alignment = 2
[node name="SaveButton" type="Button" parent="HBoxContainer/Right"]
[node name="SaveButton" type="Button" parent="MarginContainer/HBoxContainer/Right"]
unique_name_in_owner = true
self_modulate = Color(0, 0, 0, 0.392157)
custom_minimum_size = Vector2(120, 120)
@ -98,7 +110,7 @@ flat = true
icon_alignment = 1
expand_icon = true
[node name="SettingsButton" type="Button" parent="HBoxContainer/Right"]
[node name="SettingsButton" type="Button" parent="MarginContainer/HBoxContainer/Right"]
self_modulate = Color(0, 0, 0, 0.392157)
custom_minimum_size = Vector2(120, 120)
layout_mode = 2
@ -108,9 +120,9 @@ flat = true
icon_alignment = 1
expand_icon = true
[connection signal="pressed" from="HBoxContainer/Left/MenuButton" to="." method="_on_menu_button_pressed"]
[connection signal="gui_input" from="HBoxContainer/Left/JoystickPanel" to="HBoxContainer/Left/JoystickPanel" method="_on_gui_input"]
[connection signal="resized" from="HBoxContainer/Left/JoystickPanel" to="HBoxContainer/Left/JoystickPanel" method="_on_resized"]
[connection signal="button_down" from="HBoxContainer/Right/SaveButton" to="." method="_on_save_button_button_down"]
[connection signal="button_up" from="HBoxContainer/Right/SaveButton" to="." method="_on_save_button_button_up"]
[connection signal="pressed" from="HBoxContainer/Right/SettingsButton" to="." method="_on_settings_button_pressed"]
[connection signal="pressed" from="MarginContainer/HBoxContainer/Left/MenuButton" to="." method="_on_menu_button_pressed"]
[connection signal="gui_input" from="MarginContainer/HBoxContainer/Left/JoystickPanel" to="MarginContainer/HBoxContainer/Left/JoystickPanel" method="_on_gui_input"]
[connection signal="resized" from="MarginContainer/HBoxContainer/Left/JoystickPanel" to="MarginContainer/HBoxContainer/Left/JoystickPanel" method="_on_resized"]
[connection signal="button_down" from="MarginContainer/HBoxContainer/Right/SaveButton" to="." method="_on_save_button_button_down"]
[connection signal="button_up" from="MarginContainer/HBoxContainer/Right/SaveButton" to="." method="_on_save_button_button_up"]
[connection signal="pressed" from="MarginContainer/HBoxContainer/Right/SettingsButton" to="." method="_on_settings_button_pressed"]

View file

@ -1,8 +1,8 @@
extends MarginContainer
extends Control
class_name MonsterList
@onready var monster_list_entry_container: MarginContainer = $MarginContainer/PanelContainer/VBoxContainer/MonsterListEntryContainer
@onready var monster_list_entry = preload("res://ui/monster_list_entry.tscn")
@onready var monster_list_entry = preload("res://ui/ingame_menu/party_list_entry.tscn")
func _ready() -> void:
visible = false

View file

@ -1,6 +1,6 @@
[gd_scene load_steps=8 format=3 uid="uid://bbvbnrcjatkrb"]
[ext_resource type="Script" path="res://ui/ingame_menu.gd" id="1_beinb"]
[ext_resource type="Script" path="res://ui/ingame_menu/ingame_menu.gd" id="1_beinb"]
[ext_resource type="FontFile" uid="uid://bjaavdnopfh0q" path="res://assets/fonts/aoboshi_one/AoboshiOne-Regular.ttf" id="2_1e4kf"]
[ext_resource type="Texture2D" uid="uid://bhh31i3wgww43" path="res://assets/textures/Game Icons/Vector/2x/singleplayer.png" id="2_c2ia0"]
[ext_resource type="Texture2D" uid="uid://c737p2osplq2o" path="res://assets/textures/Xbox Series/Vector/xbox_button_x_outline.svg" id="3_kgfth"]
@ -15,7 +15,8 @@ corner_radius_bottom_left = 64
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_flvbu"]
[node name="IngameMenu" type="MarginContainer"]
[node name="IngameMenu" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
@ -24,7 +25,12 @@ grow_vertical = 2
script = ExtResource("1_beinb")
[node name="MarginContainer" type="MarginContainer" parent="."]
layout_mode = 2
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_constants/margin_left = 50
theme_override_constants/margin_top = 50
theme_override_constants/margin_right = 50
@ -73,6 +79,22 @@ layout_mode = 2
texture = ExtResource("3_oo4iu")
expand_mode = 3
[node name="HBoxContainer2" type="HBoxContainer" parent="MarginContainer/PanelContainer/VBoxContainer"]
layout_mode = 2
alignment = 1
[node name="PartyButton" type="Button" parent="MarginContainer/PanelContainer/VBoxContainer/HBoxContainer2"]
layout_mode = 2
text = "Party"
[node name="Items" type="Button" parent="MarginContainer/PanelContainer/VBoxContainer/HBoxContainer2"]
layout_mode = 2
text = "Items"
[node name="Player" type="Button" parent="MarginContainer/PanelContainer/VBoxContainer/HBoxContainer2"]
layout_mode = 2
text = "Player"
[node name="MonsterInfoTitle" type="MarginContainer" parent="MarginContainer/PanelContainer/VBoxContainer"]
layout_mode = 2
theme_override_constants/margin_left = 40

View file

@ -1,11 +1,11 @@
extends HBoxContainer
class_name MonsterListEntry
class_name PartyListEntry
func populate(monster) -> void:
%MonsterID.text = str(0)
%MonsterName.text = monster.display_name
%MonsterName.text = monster.name
%MonsterLevel.text = "Lvl. %s" % monster.level
%HealthProgressBar.value = monster.health
%HealthProgressBar.max_value = monster.health
%ExperienceProgressBar.value = monster.xp
%ExperienceProgressBar.max_value = monster.base_xp_for_next_level
%ExperienceProgressBar.max_value = monster.base_xp

View file

@ -1,8 +1,8 @@
[gd_scene load_steps=9 format=3 uid="uid://brp2sljqnkuhe"]
[ext_resource type="Texture2D" uid="uid://b6ylra30qxf30" path="res://assets/logo/logo.png" id="1_16gb7"]
[ext_resource type="Script" path="res://ui/monster_list_entry.gd" id="1_spojl"]
[ext_resource type="Texture2D" uid="uid://2vxx2waofxpw" path="res://assets/textures/Xbox Series/Vector/xbox_button_menu_outline.svg" id="2_5n4ar"]
[ext_resource type="Script" path="res://ui/ingame_menu/party_list_entry.gd" id="1_gdhy7"]
[ext_resource type="Texture2D" uid="uid://b6ylra30qxf30" path="res://assets/logo/logo.png" id="2_rogma"]
[ext_resource type="Texture2D" uid="uid://2vxx2waofxpw" path="res://assets/textures/Xbox Series/Vector/xbox_button_menu_outline.svg" id="3_etjt6"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_s3mod"]
content_margin_top = 24.0
@ -25,13 +25,13 @@ anchors_preset = 10
anchor_right = 1.0
offset_bottom = 72.0
grow_horizontal = 2
script = ExtResource("1_spojl")
script = ExtResource("1_gdhy7")
[node name="Thumbnail" type="TextureRect" parent="."]
unique_name_in_owner = true
custom_minimum_size = Vector2(70, 70)
layout_mode = 2
texture = ExtResource("1_16gb7")
texture = ExtResource("2_rogma")
expand_mode = 3
[node name="VBoxContainer" type="VBoxContainer" parent="."]
@ -101,7 +101,7 @@ custom_minimum_size = Vector2(100, 100)
layout_mode = 2
size_flags_horizontal = 8
theme_override_styles/focus = SubResource("StyleBoxEmpty_x2rfb")
icon = ExtResource("2_5n4ar")
icon = ExtResource("3_etjt6")
flat = true
icon_alignment = 1
expand_icon = true

View file

@ -1,7 +1,7 @@
[gd_scene load_steps=10 format=3 uid="uid://dt00rjsodtady"]
[ext_resource type="Texture2D" uid="uid://b6ylra30qxf30" path="res://assets/logo/logo.png" id="1_1fmce"]
[ext_resource type="Script" path="res://ui/main_menu.gd" id="1_5gs73"]
[ext_resource type="Script" path="res://ui/main_menu/main_menu.gd" id="1_5gs73"]
[ext_resource type="FontFile" uid="uid://bjaavdnopfh0q" path="res://assets/fonts/aoboshi_one/AoboshiOne-Regular.ttf" id="2_aqmkw"]
[ext_resource type="Texture2D" uid="uid://da7o6lfuoliid" path="res://assets/textures/Backgrounds/meadow2.jpg" id="2_bb61v"]

View file

@ -0,0 +1,12 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://dccmukg8pfc66"]
[resource]
content_margin_left = 0.0
content_margin_top = 0.0
content_margin_right = 0.0
content_margin_bottom = 0.0
bg_color = Color(0, 0, 0, 0.705882)
corner_radius_top_left = 6
corner_radius_top_right = 6
corner_radius_bottom_right = 6
corner_radius_bottom_left = 6

View file

@ -0,0 +1,12 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://ddtjhp2lob6to"]
[resource]
content_margin_left = 16.0
content_margin_top = 16.0
content_margin_right = 16.0
content_margin_bottom = 16.0
bg_color = Color(0, 0, 0, 0.705882)
corner_radius_top_left = 6
corner_radius_top_right = 6
corner_radius_bottom_right = 6
corner_radius_bottom_left = 6

View file

@ -0,0 +1,12 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://cv8ispcxuwjn5"]
[resource]
content_margin_left = 16.0
content_margin_top = 16.0
content_margin_right = 16.0
content_margin_bottom = 16.0
bg_color = Color(0.92, 0.889333, 0, 0.901961)
corner_radius_top_left = 6
corner_radius_top_right = 6
corner_radius_bottom_right = 6
corner_radius_bottom_left = 6

View file

@ -5,12 +5,12 @@ extends Node
signal on_new_game_started
signal on_game_continued
@onready var root: CanvasLayer = $/root/Game/UI
@onready var main_menu: Control = $/root/Game/UI/MainMenu
@onready var ingame_controls: MarginContainer = $/root/Game/UI/IngameControls
@onready var ingame_menu: Control = $/root/Game/UI/IngameMenu
@onready var camera_control_area : Control = $/root/Game/UI/CameraControlArea
@onready var save_ui : Control = $/root/Game/UI/SaveUI
@onready var main_menu: Control = $MainMenu
@onready var ingame_controls: Control = $IngameControls
@onready var ingame_menu: Control = $IngameMenu
@onready var camera_control_area : Control = $CameraControlArea
@onready var save_ui : Control = $SaveUI
@onready var battle_ui : Control = $BattleUI
func _ready() -> void:
main_menu.connect("on_game_continued", _on_main_menu_on_game_continued)
@ -30,6 +30,9 @@ func show_main_menu(p_visible = true) -> void:
func show_ingame_controls(p_visible = true) -> void:
ingame_controls.visible = p_visible
func show_battle_ui(p_visible = true) -> void:
battle_ui.visible = p_visible
func _on_ingame_controls_menu_button_clicked() -> void:
ingame_menu.visible = true

View file

@ -1,11 +1,14 @@
[gd_scene load_steps=5 format=3 uid="uid://b5y7pdfe6ougf"]
[gd_scene load_steps=7 format=3 uid="uid://b5y7pdfe6ougf"]
[ext_resource type="Script" path="res://ui/camera_controls.gd" id="1_x56x6"]
[ext_resource type="PackedScene" uid="uid://dt00rjsodtady" path="res://ui/main_menu.tscn" id="3_tcmm8"]
[ext_resource type="PackedScene" uid="uid://1anjhvi173g3" path="res://ui/ingame_controls.tscn" id="4_likk0"]
[ext_resource type="PackedScene" uid="uid://bbvbnrcjatkrb" path="res://ui/ingame_menu.tscn" id="5_qjqu1"]
[ext_resource type="Script" path="res://ui/ui.gd" id="1_fkttd"]
[ext_resource type="Script" path="res://ui/ingame_controls/camera_controls.gd" id="1_x56x6"]
[ext_resource type="PackedScene" uid="uid://dt00rjsodtady" path="res://ui/main_menu/main_menu.tscn" id="3_tcmm8"]
[ext_resource type="PackedScene" uid="uid://1anjhvi173g3" path="res://ui/ingame_controls/ingame_controls.tscn" id="4_likk0"]
[ext_resource type="PackedScene" uid="uid://bbvbnrcjatkrb" path="res://ui/ingame_menu/ingame_menu.tscn" id="5_qjqu1"]
[ext_resource type="PackedScene" uid="uid://dyroahq85mhws" path="res://ui/battle_ui/battle_ui.tscn" id="6_uxa7j"]
[node name="UI" type="CanvasLayer"]
script = ExtResource("1_fkttd")
[node name="CameraControlArea" type="Control" parent="."]
layout_mode = 3
@ -51,6 +54,7 @@ vertical_alignment = 1
[node name="MainMenu" parent="." instance=ExtResource("3_tcmm8")]
unique_name_in_owner = true
visible = false
[node name="IngameControls" parent="." instance=ExtResource("4_likk0")]
unique_name_in_owner = true
@ -59,3 +63,5 @@ visible = false
[node name="IngameMenu" parent="." instance=ExtResource("5_qjqu1")]
unique_name_in_owner = true
visible = false
[node name="BattleUI" parent="." instance=ExtResource("6_uxa7j")]