fixed camera script and restructured ui folder
This commit is contained in:
parent
877ebafc74
commit
5748d34b34
32 changed files with 781 additions and 162 deletions
27
ui/ingame_menu/ingame_menu.gd
Normal file
27
ui/ingame_menu/ingame_menu.gd
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
extends Control
|
||||
class_name MonsterList
|
||||
|
||||
@onready var monster_list_entry_container: MarginContainer = $MarginContainer/PanelContainer/VBoxContainer/MonsterListEntryContainer
|
||||
@onready var monster_list_entry = preload("res://ui/ingame_menu/party_list_entry.tscn")
|
||||
|
||||
func _ready() -> void:
|
||||
visible = false
|
||||
|
||||
func _on_close_button_pressed() -> void:
|
||||
visible = false
|
||||
pass # Replace with function body.
|
||||
|
||||
func _update_monster_list() -> void:
|
||||
for i in SaveManager.current_save.party.size():
|
||||
var monster = SaveManager.current_save.party[i]
|
||||
var entry = monster_list_entry.instantiate()
|
||||
|
||||
# populate the new entry
|
||||
entry.populate(monster)
|
||||
|
||||
# add it to the list
|
||||
monster_list_entry_container.add_child(entry)
|
||||
|
||||
func _update_player_info() -> void:
|
||||
#%PlayerName.text =
|
||||
pass
|
||||
135
ui/ingame_menu/ingame_menu.tscn
Normal file
135
ui/ingame_menu/ingame_menu.tscn
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
[gd_scene load_steps=8 format=3 uid="uid://bbvbnrcjatkrb"]
|
||||
|
||||
[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"]
|
||||
[ext_resource type="Texture2D" uid="uid://cxry7h4q17lir" path="res://assets/textures/Game Icons/Vector/2x/star.png" id="3_oo4iu"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_co4a0"]
|
||||
bg_color = Color(0.9, 0.9, 0.9, 1)
|
||||
corner_radius_top_left = 64
|
||||
corner_radius_top_right = 64
|
||||
corner_radius_bottom_right = 64
|
||||
corner_radius_bottom_left = 64
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_flvbu"]
|
||||
|
||||
[node name="IngameMenu" type="Control"]
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_beinb")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="."]
|
||||
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
|
||||
theme_override_constants/margin_bottom = 50
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_co4a0")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/PanelContainer"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PlayerInfo" type="MarginContainer" parent="MarginContainer/PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_left = 40
|
||||
theme_override_constants/margin_top = 30
|
||||
theme_override_constants/margin_right = 40
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/PanelContainer/VBoxContainer/PlayerInfo"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="PlayerThumbnail" type="TextureRect" parent="MarginContainer/PanelContainer/VBoxContainer/PlayerInfo/HBoxContainer"]
|
||||
self_modulate = Color(0, 0, 0, 1)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("2_c2ia0")
|
||||
expand_mode = 3
|
||||
|
||||
[node name="PlayerName" type="Label" parent="MarginContainer/PanelContainer/VBoxContainer/PlayerInfo/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "PLAYER_NAME"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="MoneyValue" type="Label" parent="MarginContainer/PanelContainer/VBoxContainer/PlayerInfo/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "1.000.000"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="CurrencyIcon" type="TextureRect" parent="MarginContainer/PanelContainer/VBoxContainer/PlayerInfo/HBoxContainer"]
|
||||
self_modulate = Color(0.941789, 0.802506, 0.327877, 1)
|
||||
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
|
||||
theme_override_constants/margin_top = 30
|
||||
theme_override_constants/margin_right = 40
|
||||
|
||||
[node name="Label" type="Label" parent="MarginContainer/PanelContainer/VBoxContainer/MonsterInfoTitle"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_fonts/font = ExtResource("2_1e4kf")
|
||||
theme_override_font_sizes/font_size = 36
|
||||
text = "Your Monsters"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="MonsterListEntryContainer" type="MarginContainer" parent="MarginContainer/PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 2
|
||||
theme_override_constants/margin_left = 20
|
||||
theme_override_constants/margin_right = 20
|
||||
|
||||
[node name="CloseButtonContainer" type="MarginContainer" parent="MarginContainer/PanelContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_bottom = 32
|
||||
|
||||
[node name="CloseButton" type="Button" parent="MarginContainer/PanelContainer/VBoxContainer/CloseButtonContainer"]
|
||||
unique_name_in_owner = true
|
||||
self_modulate = Color(0, 0, 0, 1)
|
||||
custom_minimum_size = Vector2(120, 120)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_flvbu")
|
||||
icon = ExtResource("3_kgfth")
|
||||
flat = true
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/PanelContainer/VBoxContainer/CloseButtonContainer/CloseButton" to="." method="_on_close_button_pressed"]
|
||||
11
ui/ingame_menu/party_list_entry.gd
Normal file
11
ui/ingame_menu/party_list_entry.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
extends HBoxContainer
|
||||
class_name PartyListEntry
|
||||
|
||||
func populate(monster) -> void:
|
||||
%MonsterID.text = str(0)
|
||||
%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
|
||||
107
ui/ingame_menu/party_list_entry.tscn
Normal file
107
ui/ingame_menu/party_list_entry.tscn
Normal file
|
|
@ -0,0 +1,107 @@
|
|||
[gd_scene load_steps=9 format=3 uid="uid://brp2sljqnkuhe"]
|
||||
|
||||
[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
|
||||
bg_color = Color(0.4, 0.5, 0.455, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_nb1sm"]
|
||||
bg_color = Color(0, 0.843137, 0.466667, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_fkb5g"]
|
||||
content_margin_top = 12.0
|
||||
bg_color = Color(0.4, 0.466667, 0.5, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_b4pov"]
|
||||
bg_color = Color(0, 0.56, 0.84, 1)
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_x2rfb"]
|
||||
|
||||
[node name="MonsterListEntry" type="HBoxContainer"]
|
||||
anchors_preset = 10
|
||||
anchor_right = 1.0
|
||||
offset_bottom = 72.0
|
||||
grow_horizontal = 2
|
||||
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("2_rogma")
|
||||
expand_mode = 3
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
|
||||
[node name="NameAndLevelContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 10
|
||||
|
||||
[node name="MonsterID" type="Label" parent="VBoxContainer/NameAndLevelContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
text = "ID"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="MonsterName" type="Label" parent="VBoxContainer/NameAndLevelContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 24
|
||||
text = "Name"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="MonsterLevel" type="Label" parent="VBoxContainer/NameAndLevelContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 8
|
||||
theme_override_colors/font_color = Color(0, 0, 0, 1)
|
||||
theme_override_font_sizes/font_size = 24
|
||||
text = "Lvl"
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="ProgressBarContainer" type="VBoxContainer" parent="VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
theme_override_constants/separation = 0
|
||||
|
||||
[node name="HealthProgressBar" type="ProgressBar" parent="VBoxContainer/ProgressBarContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 4
|
||||
theme_override_styles/background = SubResource("StyleBoxFlat_s3mod")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_nb1sm")
|
||||
step = 1.0
|
||||
rounded = true
|
||||
show_percentage = false
|
||||
|
||||
[node name="ExperienceProgressBar" type="ProgressBar" parent="VBoxContainer/ProgressBarContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
theme_override_styles/background = SubResource("StyleBoxFlat_fkb5g")
|
||||
theme_override_styles/fill = SubResource("StyleBoxFlat_b4pov")
|
||||
step = 1.0
|
||||
rounded = true
|
||||
show_percentage = false
|
||||
|
||||
[node name="SwapPositionButton" type="Button" parent="."]
|
||||
unique_name_in_owner = true
|
||||
self_modulate = Color(0, 0, 0, 1)
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
theme_override_styles/focus = SubResource("StyleBoxEmpty_x2rfb")
|
||||
icon = ExtResource("3_etjt6")
|
||||
flat = true
|
||||
icon_alignment = 1
|
||||
expand_icon = true
|
||||
Loading…
Add table
Add a link
Reference in a new issue