developpement d'écran de chargement et d'écran de sélection de niveau
* modification de certains assets * optimisation de chunks * ajout d'un SceneManager * ajout d'un premier dialogue avec Demeter * changement des jour en charge * mise en place d'un système de run * etc...
This commit is contained in:
31
gui/dialogs/FullBackground/custom_full_background.tscn
Normal file
31
gui/dialogs/FullBackground/custom_full_background.tscn
Normal file
@@ -0,0 +1,31 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://y0yu2gu5lgfd"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://bqdylb4maacf0" path="res://addons/dialogic/Modules/DefaultLayoutParts/Layer_FullBackground/full_background_layer.gd" id="1_tu40u"]
|
||||
[ext_resource type="Script" uid="uid://oxcjhq2817c7" path="res://addons/dialogic/Modules/Background/node_background_holder.gd" id="2_ghan2"]
|
||||
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://common/vfx/materials/shaders/blur.gdshader" id="2_v1ioh"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_v1ioh"]
|
||||
shader = ExtResource("2_v1ioh")
|
||||
shader_parameter/strength = 3.3
|
||||
shader_parameter/mix_percentage = 0.3
|
||||
|
||||
[node name="BackgroundLayer" type="Control"]
|
||||
layout_direction = 2
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
script = ExtResource("1_tu40u")
|
||||
|
||||
[node name="DialogicNode_BackgroundHolder_Blur" type="ColorRect" parent="."]
|
||||
material = SubResource("ShaderMaterial_v1ioh")
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
script = ExtResource("2_ghan2")
|
||||
2
gui/dialogs/FullBackground/full_background_layer.gd
Normal file
2
gui/dialogs/FullBackground/full_background_layer.gd
Normal file
@@ -0,0 +1,2 @@
|
||||
@tool
|
||||
extends DialogicLayoutLayer
|
||||
1
gui/dialogs/FullBackground/full_background_layer.gd.uid
Normal file
1
gui/dialogs/FullBackground/full_background_layer.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://bdxrevfmc3x24
|
||||
7
gui/dialogs/base_layout.tscn
Normal file
7
gui/dialogs/base_layout.tscn
Normal file
@@ -0,0 +1,7 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://b4y8dnr0nugke"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c0qys72ixawvk" path="res://addons/dialogic/Resources/dialogic_layout_base.gd" id="1_kfib2"]
|
||||
|
||||
[node name="BaseLayout" type="Node"]
|
||||
script = ExtResource("1_kfib2")
|
||||
metadata/_custom_type_script = "uid://c0qys72ixawvk"
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=11 format=3 uid="uid://fnv0qhkh40mv"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_0ssee"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_0ssee"]
|
||||
[ext_resource type="Script" uid="uid://bvb4v66bqteuc" path="res://gui/game/announce/scripts/announce.gd" id="1_4evne"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="2_yrhd4"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="3_7nrno"]
|
||||
|
||||
320
gui/game/build_menu/build_menu.tscn
Normal file
320
gui/game/build_menu/build_menu.tscn
Normal file
@@ -0,0 +1,320 @@
|
||||
[gd_scene load_steps=13 format=3 uid="uid://xmfjxrn7m6vo"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://rxao2rluuwqq" path="res://gui/game/screen/screen.tscn" id="1_8bdn3"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_vpxyy"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="3_ou1lu"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_m0jcy"]
|
||||
[ext_resource type="Texture2D" uid="uid://n7hhyqhhtx0q" path="res://entities/interactables/truck/compost/assets/sprites/compost.png" id="4_ywwbf"]
|
||||
[ext_resource type="Texture2D" uid="uid://b0wy3dbpxbnt7" path="res://common/icons/seedling.svg" id="6_jn707"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="7_0715l"]
|
||||
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="8_8iodd"]
|
||||
[ext_resource type="Texture2D" uid="uid://ds4m14vl7he6v" path="res://common/icons/pick.svg" id="9_1f0ht"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_foxij"]
|
||||
content_margin_left = 20.0
|
||||
content_margin_top = 8.0
|
||||
content_margin_right = 8.0
|
||||
content_margin_bottom = 20.0
|
||||
draw_center = false
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(1, 1, 1, 0.54509807)
|
||||
corner_radius_top_left = 100
|
||||
corner_radius_top_right = 100
|
||||
corner_radius_bottom_right = 100
|
||||
corner_radius_bottom_left = 100
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hf34d"]
|
||||
content_margin_left = 20.0
|
||||
content_margin_top = 8.0
|
||||
content_margin_right = 8.0
|
||||
content_margin_bottom = 20.0
|
||||
draw_center = false
|
||||
border_width_left = 2
|
||||
border_width_top = 2
|
||||
border_width_right = 2
|
||||
border_width_bottom = 2
|
||||
border_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 100
|
||||
corner_radius_top_right = 100
|
||||
corner_radius_bottom_right = 100
|
||||
corner_radius_bottom_left = 100
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_t7tak"]
|
||||
font = ExtResource("4_m0jcy")
|
||||
|
||||
[node name="BuildMenu" type="MarginContainer"]
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/margin_left = 30
|
||||
theme_override_constants/margin_top = 30
|
||||
theme_override_constants/margin_right = 30
|
||||
theme_override_constants/margin_bottom = 30
|
||||
|
||||
[node name="Screen" parent="." instance=ExtResource("1_8bdn3")]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="Screen/ScreenContainer" index="0"]
|
||||
layout_mode = 2
|
||||
horizontal_scroll_mode = 0
|
||||
|
||||
[node name="Categories" type="GridContainer" parent="Screen/ScreenContainer/ScrollContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
theme = ExtResource("2_vpxyy")
|
||||
|
||||
[node name="TextEdit" type="TextEdit" parent="Screen/ScreenContainer/ScrollContainer/Categories"]
|
||||
custom_minimum_size = Vector2(0, 40)
|
||||
layout_mode = 2
|
||||
theme_override_styles/normal = SubResource("StyleBoxFlat_foxij")
|
||||
theme_override_styles/focus = SubResource("StyleBoxFlat_hf34d")
|
||||
placeholder_text = "Search blueprints..."
|
||||
|
||||
[node name="Category" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category"]
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("3_ou1lu")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Button" type="Button" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
flat = true
|
||||
expand_icon = true
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("4_ywwbf")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Compost"
|
||||
label_settings = SubResource("LabelSettings_t7tak")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_vpxyy")
|
||||
text = "2"
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("3_ou1lu")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label2" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_vpxyy")
|
||||
text = "3"
|
||||
|
||||
[node name="TextureRect2" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button/VBoxContainer/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("6_jn707")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Button2" type="Button" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
flat = true
|
||||
expand_icon = true
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("7_0715l")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Panneau solaire"
|
||||
label_settings = SubResource("LabelSettings_t7tak")
|
||||
horizontal_alignment = 1
|
||||
autowrap_mode = 2
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="Label2" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_vpxyy")
|
||||
text = "5"
|
||||
|
||||
[node name="TextureRect2" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category/Button2/VBoxContainer/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("6_jn707")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Category2" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2"]
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("8_8iodd")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Button" type="Button" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
flat = true
|
||||
expand_icon = true
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("7_0715l")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Fertiliseur"
|
||||
label_settings = SubResource("LabelSettings_t7tak")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_vpxyy")
|
||||
text = "2"
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("3_ou1lu")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label2" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_vpxyy")
|
||||
text = "3"
|
||||
|
||||
[node name="TextureRect2" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category2/Button/VBoxContainer/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("6_jn707")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Category3" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3"]
|
||||
custom_minimum_size = Vector2(50, 50)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("9_1f0ht")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Button" type="Button" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3"]
|
||||
custom_minimum_size = Vector2(100, 100)
|
||||
layout_mode = 2
|
||||
flat = true
|
||||
expand_icon = true
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme_override_constants/separation = 5
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
texture = ExtResource("7_0715l")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="Label" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "Foreuse"
|
||||
label_settings = SubResource("LabelSettings_t7tak")
|
||||
horizontal_alignment = 1
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="Label2" type="Label" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer/HBoxContainer"]
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_vpxyy")
|
||||
text = "5"
|
||||
|
||||
[node name="TextureRect2" type="TextureRect" parent="Screen/ScreenContainer/ScrollContainer/Categories/Category3/Button/VBoxContainer/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(20, 20)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("6_jn707")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[editable path="Screen"]
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=19 format=3 uid="uid://753270jjxmfg"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_m317d"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_m317d"]
|
||||
[ext_resource type="Script" uid="uid://b7f10wuounfan" path="res://gui/game/card/scripts/card.gd" id="2_kpm7h"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="2_plgbn"]
|
||||
[ext_resource type="Script" uid="uid://dj2pv1hiwjfv0" path="res://gui/game/card/scripts/card_info.gd" id="3_7wc8v"]
|
||||
@@ -52,7 +52,7 @@ _data = {
|
||||
[node name="Card" type="PanelContainer"]
|
||||
custom_minimum_size = Vector2(250, 0)
|
||||
offset_right = 250.0
|
||||
offset_bottom = 377.0
|
||||
offset_bottom = 229.0
|
||||
size_flags_horizontal = 0
|
||||
size_flags_vertical = 0
|
||||
theme = ExtResource("1_m317d")
|
||||
@@ -131,6 +131,7 @@ theme_override_constants/separation = 6
|
||||
|
||||
[node name="CardSections" type="MarginContainer" parent="GridContainer"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 2
|
||||
|
||||
[node name="CardSectionsContainer" type="VBoxContainer" parent="GridContainer/CardSections"]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://bghefrgaujjt6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://dcmee2jvohudl" path="res://gui/game/card/scripts/card_section.gd" id="1_41hkv"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_t7m3x"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_t7m3x"]
|
||||
[ext_resource type="Script" uid="uid://dgbh38j13g5kn" path="res://gui/game/card/scripts/card_section_info.gd" id="2_3ktqg"]
|
||||
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="2_41hkv"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="3_3ktqg"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=6 format=3 uid="uid://cpen6hj0rbw8x"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_6abif"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_6abif"]
|
||||
[ext_resource type="Script" uid="uid://c8xxhu28xm4hy" path="res://gui/game/card/scripts/card_stat.gd" id="2_30iht"]
|
||||
[ext_resource type="Texture2D" uid="uid://baaujfw8piywi" path="res://common/icons/dna.svg" id="3_30iht"]
|
||||
[ext_resource type="Script" uid="uid://b4tkium34c831" path="res://gui/game/card/scripts/card_stat_info.gd" id="3_c3wpw"]
|
||||
|
||||
@@ -46,8 +46,8 @@ metadata/_custom_type_script = "uid://dj2pv1hiwjfv0"
|
||||
shader = ExtResource("1_x54se")
|
||||
shader_parameter/fov = 90.0
|
||||
shader_parameter/cull_back = true
|
||||
shader_parameter/y_rot = 0.00018062632
|
||||
shader_parameter/x_rot = -0.00042293756
|
||||
shader_parameter/y_rot = -6.6836714e-05
|
||||
shader_parameter/x_rot = -7.941689e-05
|
||||
shader_parameter/inset = 0.0
|
||||
|
||||
[sub_resource type="Animation" id="Animation_1et8x"]
|
||||
@@ -110,10 +110,8 @@ theme_override_constants/margin_bottom = 25
|
||||
|
||||
[node name="Card" parent="SubViewportContainer/SubViewport/CardContainer" instance=ExtResource("1_we78f")]
|
||||
unique_name_in_owner = true
|
||||
self_modulate = Color(1, 1, 1, 0)
|
||||
layout_mode = 2
|
||||
mouse_filter = 2
|
||||
small_mode = true
|
||||
down_arrow = true
|
||||
info = SubResource("Resource_eb1v6")
|
||||
|
||||
|
||||
@@ -1,14 +1,13 @@
|
||||
[gd_scene load_steps=23 format=3 uid="uid://12nak7amd1uq"]
|
||||
[gd_scene load_steps=22 format=3 uid="uid://12nak7amd1uq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cqao7n800qy40" path="res://gui/game/scripts/game_gui.gd" id="1_udau0"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="2_nq5i2"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_nq5i2"]
|
||||
[ext_resource type="PackedScene" uid="uid://fnv0qhkh40mv" path="res://gui/game/announce/announce.tscn" id="4_h6540"]
|
||||
[ext_resource type="Texture2D" uid="uid://dcgnamu7sb3ov" path="res://common/icons/bolt.svg" id="4_k4juk"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="4_ujg5r"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="5_2wykm"]
|
||||
[ext_resource type="Script" uid="uid://0dhj8sdpil7q" path="res://gui/tools/control_animation_player.gd" id="6_id0t5"]
|
||||
[ext_resource type="Texture2D" uid="uid://bt3g5bmar0icf" path="res://common/icons/growth.svg" id="7_id0t5"]
|
||||
[ext_resource type="Texture2D" uid="uid://b5cuxgisrsfgt" path="res://common/icons/player-pause.svg" id="9_2wykm"]
|
||||
[ext_resource type="PackedScene" uid="uid://clicjf8ts51h8" path="res://gui/game/inventory_gui/inventory_gui.tscn" id="9_id0t5"]
|
||||
|
||||
[sub_resource type="Gradient" id="Gradient_2wykm"]
|
||||
@@ -210,12 +209,12 @@ stretch_mode = 5
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
|
||||
[node name="DayCount" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
[node name="ChargeCount" type="Label" parent="MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
size_flags_vertical = 0
|
||||
text = "Day 0"
|
||||
text = "%d_CHARGE_LEFT"
|
||||
label_settings = ExtResource("4_ujg5r")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
@@ -238,7 +237,7 @@ grow_vertical = 2
|
||||
theme_override_constants/separation = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="QuotaProgressText" type="Label" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"]
|
||||
[node name="ObjectiveProgressText" type="Label" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "X"
|
||||
@@ -246,27 +245,13 @@ label_settings = ExtResource("4_ujg5r")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"]
|
||||
[node name="ObjectiveIcon" type="TextureRect" parent="MarginContainer/VBoxContainer/QuotaProgressBar/HBoxContainer"]
|
||||
custom_minimum_size = Vector2(30, 30)
|
||||
layout_mode = 2
|
||||
texture = ExtResource("7_id0t5")
|
||||
expand_mode = 1
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="TopRightContent" type="HBoxContainer" parent="MarginContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 0
|
||||
alignment = 1
|
||||
|
||||
[node name="Pause" type="Button" parent="MarginContainer/TopRightContent"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 8
|
||||
size_flags_vertical = 0
|
||||
focus_mode = 0
|
||||
mouse_filter = 1
|
||||
icon = ExtResource("9_2wykm")
|
||||
|
||||
[node name="Inventory" parent="MarginContainer" instance=ExtResource("9_id0t5")]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
@@ -308,5 +293,3 @@ libraries = {
|
||||
libraries = {
|
||||
&"": SubResource("AnimationLibrary_p0xoq")
|
||||
}
|
||||
|
||||
[connection signal="pressed" from="MarginContainer/TopRightContent/Pause" to="." method="_on_pause_pressed"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dinju2m0oja38"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_1ddv5"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_1ddv5"]
|
||||
[ext_resource type="Script" uid="uid://ymn5layeoat8" path="res://gui/game/inspector/framed_info/scripts/framed_info.gd" id="1_7tmbd"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="2_7tmbd"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="3_1ddv5"]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://d3lff5fui1k0c"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_f5bv4"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_f5bv4"]
|
||||
[ext_resource type="Texture2D" uid="uid://lpik6kwqgmjx" path="res://gui/game/assets/texture/tablette_resized.png" id="1_qfinp"]
|
||||
[ext_resource type="Script" uid="uid://b36bjfq4sng36" path="res://gui/game/inspector/scripts/inspector.gd" id="3_a8c2j"]
|
||||
[ext_resource type="Texture2D" uid="uid://pltmnkqd5ut2" path="res://entities/plants/assets/sprites/seeds/grille_seeds.png" id="3_qfinp"]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://yghu53hja4xj" path="res://gui/game/inspector/stat_info/scripts/stat_info.gd" id="1_4pua2"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsvxhafoxwmw0" path="res://common/icons/cube-3d-sphere.svg" id="2_pdlch"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="3_pdlch"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="3_pdlch"]
|
||||
|
||||
[node name="StatInfo" type="HBoxContainer"]
|
||||
theme_override_constants/separation = 4
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[gd_scene load_steps=17 format=3 uid="uid://csiacsndm62ll"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_51ks3"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_51ks3"]
|
||||
[ext_resource type="Script" uid="uid://crt2d4m5ba25i" path="res://gui/game/pause/scripts/pause.gd" id="1_he4ox"]
|
||||
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://gui/game/pause/resources/blur.gdshader" id="2_apjlw"]
|
||||
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://common/vfx/materials/shaders/blur.gdshader" id="2_apjlw"]
|
||||
[ext_resource type="PackedScene" uid="uid://g6lbgg1fhc25" path="res://gui/menu/settings/settings.tscn" id="4_58dya"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="4_apjlw"]
|
||||
[ext_resource type="Texture2D" uid="uid://vmsn54d1ptih" path="res://common/icons/player-play.svg" id="5_apjlw"]
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
shader_type canvas_item;
|
||||
|
||||
uniform sampler2D SCREEN_TEXTURE: hint_screen_texture,repeat_disable, filter_nearest;
|
||||
/**
|
||||
* How blurry the result should be.
|
||||
* Limited to 20 because of performance, if you want feel free to break it.
|
||||
*/
|
||||
uniform float strength : hint_range(0.1, 20.0) = 3.3;
|
||||
/**
|
||||
* How dark the blur will be
|
||||
*/
|
||||
uniform float mix_percentage: hint_range(0.0, 1.0) = 0.3;
|
||||
|
||||
float gaussianDistribution(float x, float STD){ // STD stands for standard deviation
|
||||
return exp(-(x*x)/(2.*STD*STD))/(sqrt(2.*PI)*STD);
|
||||
}
|
||||
|
||||
vec3 gaussianblur(sampler2D sampler, vec2 pos, vec2 pixel_size, float sigmaUsed, int radius){
|
||||
vec3 blurredPixel = vec3(0.0);
|
||||
float total_weight = 0.0;
|
||||
// Loop over the radius (tecnically its a square)
|
||||
for(int i = -radius ; i <= radius; i++){
|
||||
for(int j = -radius; j <= radius; j++){
|
||||
// Calculate the offset from the current pixel
|
||||
vec2 offset = vec2(float(i), float(j))*pixel_size;
|
||||
vec2 changedPos = pos + offset;
|
||||
|
||||
// Calculate the weight based on the Gaussian distribution multiplying both dimentions (how far are X and Y form the center (pos))
|
||||
float weight = gaussianDistribution(float(i), sigmaUsed)*gaussianDistribution(float(j), sigmaUsed);
|
||||
// Add the weighted color value to the blurred pixel
|
||||
blurredPixel += texture(SCREEN_TEXTURE, changedPos).rgb * weight;
|
||||
total_weight += weight;
|
||||
}
|
||||
}
|
||||
// Normalize the blurred pixel color by the total weight
|
||||
blurredPixel/=total_weight;
|
||||
return blurredPixel;
|
||||
}
|
||||
void fragment() {
|
||||
vec3 PixelBlurred = gaussianblur(SCREEN_TEXTURE, SCREEN_UV, SCREEN_PIXEL_SIZE, strength, int(round(3.0 * strength)));
|
||||
vec3 color = mix(PixelBlurred, vec3(0.0), mix_percentage);
|
||||
// The radius is 3*strength because it is the point where the Gaussian weight is near zero.
|
||||
COLOR = vec4(color, 1.);
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
uid://cuni3ggtw2uuy
|
||||
@@ -2,39 +2,37 @@ extends CanvasLayer
|
||||
|
||||
var pause = false : set = set_pause
|
||||
|
||||
const PLANET_RUN_SCENE = preload("res://stages/planet_run/planet_run.tscn")
|
||||
|
||||
func set_pause(p):
|
||||
if p != pause:
|
||||
if p:
|
||||
%AnimationPlayer.play("pause")
|
||||
else:
|
||||
%AnimationPlayer.play_backwards("pause")
|
||||
pause = p
|
||||
get_tree().paused = pause
|
||||
%Settings.close_settings()
|
||||
%Controls.close_controls()
|
||||
if p != pause:
|
||||
if p:
|
||||
%AnimationPlayer.play("pause")
|
||||
else:
|
||||
%AnimationPlayer.play_backwards("pause")
|
||||
pause = p
|
||||
get_tree().paused = pause
|
||||
%Settings.close_settings()
|
||||
%Controls.close_controls()
|
||||
|
||||
func _input(_event):
|
||||
if Input.is_action_just_pressed("pause"):
|
||||
pause = not pause
|
||||
if Input.is_action_just_pressed("pause"):
|
||||
pause = not pause
|
||||
|
||||
func _on_resume_pressed():
|
||||
pause = false
|
||||
pause = false
|
||||
|
||||
func _on_restart_pressed():
|
||||
GameInfo.game_data.reset_all()
|
||||
pause = false
|
||||
get_tree().change_scene_to_packed(PLANET_RUN_SCENE)
|
||||
GameInfo.game_data.reset_all()
|
||||
pause = false
|
||||
SceneManager.change_scene(SceneManager.REGION_SELECTION_SCREEN)
|
||||
|
||||
func _on_quit_pressed():
|
||||
get_tree().quit()
|
||||
get_tree().quit()
|
||||
|
||||
func _on_game_gui_pause_asked():
|
||||
pause = true
|
||||
pause = true
|
||||
|
||||
func _on_settings_pressed():
|
||||
%Settings.open_settings()
|
||||
%Settings.open_settings()
|
||||
|
||||
func _on_controls_pressed():
|
||||
%Controls.open_controls()
|
||||
%Controls.open_controls()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://doxm7uab8i3tq"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://12kjdou2kp5y" path="res://gui/game/quota_reward/scripts/quota_reward.gd" id="1_gye62"]
|
||||
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://gui/game/pause/resources/blur.gdshader" id="2_6ibex"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="3_x2kx4"]
|
||||
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://common/vfx/materials/shaders/blur.gdshader" id="2_6ibex"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="3_x2kx4"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="4_trw0e"]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id="ShaderMaterial_gy0la"]
|
||||
|
||||
26
gui/game/screen/screen.tscn
Normal file
26
gui/game/screen/screen.tscn
Normal file
@@ -0,0 +1,26 @@
|
||||
[gd_scene load_steps=2 format=3 uid="uid://rxao2rluuwqq"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://dwbg8ec5hdall" path="res://gui/game/screen/textures/screen.png" id="1_cq61g"]
|
||||
|
||||
[node name="Screen" type="NinePatchRect"]
|
||||
z_index = 1
|
||||
offset_right = 235.0
|
||||
offset_bottom = 171.0
|
||||
texture = ExtResource("1_cq61g")
|
||||
region_rect = Rect2(0, 0, 491, 520)
|
||||
patch_margin_left = 64
|
||||
patch_margin_top = 58
|
||||
patch_margin_right = 171
|
||||
patch_margin_bottom = 113
|
||||
|
||||
[node name="ScreenContainer" 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 = 20
|
||||
theme_override_constants/margin_top = 55
|
||||
theme_override_constants/margin_right = 20
|
||||
theme_override_constants/margin_bottom = 20
|
||||
BIN
gui/game/screen/textures/screen.png
Normal file
BIN
gui/game/screen/textures/screen.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.2 KiB |
40
gui/game/screen/textures/screen.png.import
Normal file
40
gui/game/screen/textures/screen.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://dwbg8ec5hdall"
|
||||
path="res://.godot/imported/screen.png-1ecb35aaa1bf9bad00eac50aeedbccbb.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://gui/game/screen/textures/screen.png"
|
||||
dest_files=["res://.godot/imported/screen.png-1ecb35aaa1bf9bad00eac50aeedbccbb.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=0
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=false
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=1
|
||||
@@ -3,133 +3,110 @@ class_name GameGui
|
||||
|
||||
const SCORE_ICON : Texture = preload("res://common/icons/growth.svg")
|
||||
|
||||
@export var quota_reward : QuotaReward
|
||||
|
||||
func _ready():
|
||||
GameInfo.game_data.current_planet_data.updated.connect(_on_planet_updated)
|
||||
GameInfo.game_data.current_planet_data.plant_gaining_score.connect(_on_plant_gaining_score)
|
||||
GameInfo.game_data.current_planet_data.new_quota_started.connect(_on_planet_new_quota_started)
|
||||
GameInfo.game_data.player_data.updated.connect(_on_player_updated)
|
||||
GameInfo.game_data.player_data.inventory.updated.connect(_on_inventory_updated)
|
||||
GameInfo.game_data.current_planet_data.updated.connect(_on_planet_updated)
|
||||
GameInfo.game_data.current_planet_data.plant_gaining_score.connect(_on_plant_gaining_score)
|
||||
GameInfo.game_data.player_data.updated.connect(_on_player_updated)
|
||||
GameInfo.game_data.player_data.inventory.updated.connect(_on_inventory_updated)
|
||||
|
||||
planet_update(GameInfo.game_data.current_planet_data, false)
|
||||
player_update(GameInfo.game_data.player_data, false)
|
||||
inventory_update(GameInfo.game_data.player_data.inventory)
|
||||
|
||||
if not GameInfo.game_data.current_planet_data.is_quota_announced:
|
||||
await quota_reward.reward_chosen
|
||||
announce_quota(GameInfo.game_data.current_planet_data)
|
||||
GameInfo.game_data.current_planet_data.is_quota_announced = true
|
||||
%EnergyInfo.update_minimum_size()
|
||||
planet_update(GameInfo.game_data.current_planet_data, false)
|
||||
player_update(GameInfo.game_data.player_data, false)
|
||||
inventory_update(GameInfo.game_data.player_data.inventory)
|
||||
|
||||
%EnergyInfo.update_minimum_size()
|
||||
|
||||
|
||||
func _on_player_updated(player_data : PlayerData):
|
||||
player_update(player_data)
|
||||
player_update(player_data)
|
||||
|
||||
func player_update(player_data : PlayerData, with_animation = true):
|
||||
var energy_count_text = "[b]%d[/b] / %d" % [player_data.energy, player_data.max_energy]
|
||||
var energy_count_text = "[b]%d[/b] / %d" % [player_data.energy, player_data.max_energy]
|
||||
|
||||
if energy_count_text != %EnergyCount.text and with_animation:
|
||||
%EnergyAnimationPlayer.bounce()
|
||||
%EnergyCount.text = energy_count_text
|
||||
%EnergyInfo.modulate = Color.WHITE if player_data.energy > 0 else Color.RED
|
||||
if energy_count_text != %EnergyCount.text and with_animation:
|
||||
%EnergyAnimationPlayer.bounce()
|
||||
%EnergyCount.text = energy_count_text
|
||||
%EnergyInfo.modulate = Color.WHITE if player_data.energy > 0 else Color.RED
|
||||
|
||||
func _on_inventory_updated(inventory : Inventory):
|
||||
inventory_update(inventory)
|
||||
inventory_update(inventory)
|
||||
|
||||
func inventory_update(inventory : Inventory):
|
||||
%Inventory.update(inventory)
|
||||
%Inventory.update(inventory)
|
||||
|
||||
func _on_planet_updated(planet_data : PlanetData):
|
||||
planet_update(planet_data)
|
||||
planet_update(planet_data)
|
||||
|
||||
func planet_update(planet_data : PlanetData, with_animation = true):
|
||||
if planet_data:
|
||||
%DayCount.text = tr("%d_DAY_LEFT") % (planet_data.quota_days)
|
||||
if planet_data:
|
||||
%ChargeCount.text = tr("%d_CHARGE_LEFT") % (planet_data.charges)
|
||||
|
||||
var quota_progression_percent : float = (float(planet_data.garden_score) / float(planet_data.get_quota_score())) * 100
|
||||
%QuotaProgressText.text = "%d/%d" % [planet_data.garden_score, planet_data.get_quota_score()]
|
||||
var objective_progression_percent : float = (float(planet_data.garden_score) / float(planet_data.objective)) * 100
|
||||
%ObjectiveProgressText.text = "%d/%d" % [planet_data.garden_score, planet_data.objective]
|
||||
|
||||
if with_animation:
|
||||
get_tree().create_tween().tween_property(
|
||||
%QuotaProgressBar,
|
||||
"value",
|
||||
quota_progression_percent,
|
||||
0.5,
|
||||
)
|
||||
else: %QuotaProgressBar.value = quota_progression_percent
|
||||
if with_animation:
|
||||
get_tree().create_tween().tween_property(
|
||||
%QuotaProgressBar,
|
||||
"value",
|
||||
objective_progression_percent,
|
||||
0.5,
|
||||
)
|
||||
else: %QuotaProgressBar.value = objective_progression_percent
|
||||
|
||||
func _on_plant_gaining_score(plant: Plant, amount : int):
|
||||
for i in range(amount):
|
||||
var camera = get_viewport().get_camera_2d()
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
for i in range(amount):
|
||||
var camera = get_viewport().get_camera_2d()
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
|
||||
spawn_score_particle(
|
||||
plant.global_position - camera.global_position + screen_size / 2,
|
||||
%QuotaProgressBar.global_position + %QuotaProgressBar.size / 2,
|
||||
0.8
|
||||
)
|
||||
spawn_score_particle(
|
||||
plant.global_position - camera.global_position + screen_size / 2,
|
||||
%QuotaProgressBar.global_position + %QuotaProgressBar.size / 2,
|
||||
0.8
|
||||
)
|
||||
|
||||
await get_tree().create_timer(0.3 / max(1,i)).timeout
|
||||
await get_tree().create_timer(0.3 / max(1,i)).timeout
|
||||
|
||||
func spawn_score_particle(
|
||||
from_position,
|
||||
to_position,
|
||||
duration
|
||||
from_position,
|
||||
to_position,
|
||||
duration
|
||||
):
|
||||
var sprite_particle = Sprite2D.new()
|
||||
sprite_particle.texture = SCORE_ICON
|
||||
%ScoreParticles.add_child(sprite_particle)
|
||||
sprite_particle.position = from_position
|
||||
var sprite_particle = Sprite2D.new()
|
||||
sprite_particle.texture = SCORE_ICON
|
||||
%ScoreParticles.add_child(sprite_particle)
|
||||
sprite_particle.position = from_position
|
||||
|
||||
var tween = get_tree().create_tween()
|
||||
|
||||
tween.set_trans(Tween.TransitionType.TRANS_SPRING)
|
||||
|
||||
tween.tween_property(
|
||||
sprite_particle,
|
||||
"position",
|
||||
to_position,
|
||||
duration
|
||||
)
|
||||
var tween = get_tree().create_tween()
|
||||
|
||||
tween.set_trans(Tween.TransitionType.TRANS_SPRING)
|
||||
|
||||
tween.tween_property(
|
||||
sprite_particle,
|
||||
"position",
|
||||
to_position,
|
||||
duration
|
||||
)
|
||||
|
||||
|
||||
await tween.finished
|
||||
sprite_particle.queue_free()
|
||||
await tween.finished
|
||||
sprite_particle.queue_free()
|
||||
|
||||
|
||||
func _on_player_action_tried_without_energy():
|
||||
$AnimationPlayer.play("no_energy_left")
|
||||
|
||||
func _on_pause_pressed():
|
||||
Pause.pause = true
|
||||
$AnimationPlayer.play("no_energy_left")
|
||||
|
||||
func _on_player_upgraded():
|
||||
$EffectAnimation.play("upgrade")
|
||||
$EffectAnimation.play("upgrade")
|
||||
|
||||
func _on_planet_pass_day_started(planet):
|
||||
$PassDayAnimation.speed_scale = 1/(planet.PASS_DAY_ANIMATION_TIME)
|
||||
$PassDayAnimation.play("pass_day")
|
||||
await $PassDayAnimation.animation_finished
|
||||
$PassDayAnimation.speed_scale = 1
|
||||
|
||||
func _on_planet_new_quota_started(planet_data : PlanetData):
|
||||
planet_update(planet_data)
|
||||
await quota_reward.reward_chosen
|
||||
announce_quota(planet_data)
|
||||
planet_data.is_quota_announced = true
|
||||
|
||||
|
||||
func announce_quota(planet_data : PlanetData):
|
||||
%Announce.announce(
|
||||
tr("NEW_QUOTA"),
|
||||
tr("REACH_%d_GARDEN_SCORE_BEFORE_%d_DAYS") % [planet_data.get_quota_score(), planet_data.get_quota_duration()]
|
||||
)
|
||||
$PassDayAnimation.speed_scale = 1/(planet.PASS_DAY_ANIMATION_TIME)
|
||||
$PassDayAnimation.play("pass_day")
|
||||
await $PassDayAnimation.animation_finished
|
||||
$PassDayAnimation.speed_scale = 1
|
||||
|
||||
func _on_planet_pass_day_ended(planet:Planet):
|
||||
if planet.data.quota_days == 1:
|
||||
%Announce.announce(
|
||||
tr("LAST_DAY_FOR_REACHING_QUOTA"),
|
||||
tr("%d_GARDEN_SCORE_LEFT") % [planet.data.get_quota_score() - planet.garden.get_score()],
|
||||
Announce.RED_COLOR
|
||||
)
|
||||
if planet.data.charges == 1:
|
||||
%Announce.announce(
|
||||
tr("LAST_RECHARGE"),
|
||||
tr("%d_GARDEN_SCORE_LEFT") % [planet.data.objective - planet.garden.get_score()],
|
||||
Announce.RED_COLOR
|
||||
)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://fh3dsuvn5h78"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_ga3ae"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_ga3ae"]
|
||||
[ext_resource type="Texture2D" uid="uid://bsgmxvuphn73c" path="res://common/icons/arrow-narrow-down.svg" id="2_kc1j1"]
|
||||
[ext_resource type="Script" uid="uid://r6hgefyycute" path="res://gui/game/tutorial/in_game_indicator/scripts/in_game_indicator.gd" id="2_kij5i"]
|
||||
|
||||
|
||||
@@ -6,13 +6,13 @@ class_name InGameBaseIndicator
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready():
|
||||
setup(tr("GARDEN"))
|
||||
follow_game_position(GameInfo.game_data.current_planet_data.garden_size/2)
|
||||
follow_game_position(Planet.CHUNK_SIZE / 2. * Vector2.ONE)
|
||||
|
||||
func _process(_delta):
|
||||
visible = player and (
|
||||
player.global_position.x < 0
|
||||
or player.global_position.x > GameInfo.game_data.current_planet_data.garden_size.x
|
||||
or player.global_position.x > Planet.CHUNK_SIZE
|
||||
or player.global_position.y < 0
|
||||
or player.global_position.y > GameInfo.game_data.current_planet_data.garden_size.y
|
||||
or player.global_position.y > Planet.CHUNK_SIZE
|
||||
)
|
||||
update()
|
||||
|
||||
@@ -17,51 +17,51 @@ var arrow_right : Texture = preload("res://common/icons/arrow-narrow-right.svg")
|
||||
var arrow_left : Texture = preload("res://common/icons/arrow-narrow-left.svg")
|
||||
|
||||
func setup(text : String):
|
||||
%Label.text = text
|
||||
%Label.text = text
|
||||
|
||||
func follow_game_position(game_position : Vector2):
|
||||
following_game_position = game_position
|
||||
following_type = FollowingType.GAME_POS
|
||||
following_game_position = game_position
|
||||
following_type = FollowingType.GAME_POS
|
||||
|
||||
func follow_screen_position(screen_position : Vector2):
|
||||
following_screen_position = screen_position
|
||||
following_type = FollowingType.SCREEN_POS
|
||||
following_screen_position = screen_position
|
||||
following_type = FollowingType.SCREEN_POS
|
||||
|
||||
func follow_entity(entity : Node2D):
|
||||
following_entity = entity
|
||||
following_type = FollowingType.ENTITY
|
||||
following_entity = entity
|
||||
following_type = FollowingType.ENTITY
|
||||
|
||||
func _process(_d):
|
||||
show()
|
||||
update()
|
||||
show()
|
||||
update()
|
||||
|
||||
func update():
|
||||
var camera = get_viewport().get_camera_2d()
|
||||
var camera = get_viewport().get_camera_2d()
|
||||
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
|
||||
var abs_position : Vector2 = following_screen_position
|
||||
if following_type == FollowingType.GAME_POS:
|
||||
abs_position = following_game_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
|
||||
elif following_type == FollowingType.ENTITY and following_entity:
|
||||
abs_position = following_entity.global_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
|
||||
var abs_position : Vector2 = following_screen_position
|
||||
if following_type == FollowingType.GAME_POS:
|
||||
abs_position = following_game_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
|
||||
elif following_type == FollowingType.ENTITY and following_entity:
|
||||
abs_position = following_entity.global_position - camera.global_position + screen_size / 2 + Vector2.UP * UP_SHIFT - size/2
|
||||
|
||||
position = Vector2(
|
||||
min(max(abs_position.x, SCREEN_MARGIN), screen_size.x - SCREEN_MARGIN),
|
||||
min(max(abs_position.y, SCREEN_MARGIN), screen_size.y - SCREEN_MARGIN)
|
||||
)
|
||||
position = Vector2(
|
||||
min(max(abs_position.x, SCREEN_MARGIN), screen_size.x - SCREEN_MARGIN),
|
||||
min(max(abs_position.y, SCREEN_MARGIN), screen_size.y - SCREEN_MARGIN)
|
||||
)
|
||||
|
||||
var arrow_texture : Texture = arrow_down
|
||||
if abs_position.y < 0:
|
||||
arrow_texture = arrow_up
|
||||
if abs_position.x < 0 :
|
||||
arrow_texture = arrow_left
|
||||
if abs_position.x > screen_size.x :
|
||||
arrow_texture = arrow_right
|
||||
position.x -= size.x
|
||||
if abs_position.y > screen_size.y :
|
||||
arrow_texture = arrow_down
|
||||
position.y -= size.y
|
||||
var arrow_texture : Texture = arrow_down
|
||||
if abs_position.y < 0:
|
||||
arrow_texture = arrow_up
|
||||
if abs_position.x < 0 :
|
||||
arrow_texture = arrow_left
|
||||
if abs_position.x > screen_size.x :
|
||||
arrow_texture = arrow_right
|
||||
position.x -= size.x
|
||||
if abs_position.y > screen_size.y :
|
||||
arrow_texture = arrow_down
|
||||
position.y -= size.y
|
||||
|
||||
|
||||
%Arrow.texture = arrow_texture
|
||||
|
||||
%Arrow.texture = arrow_texture
|
||||
|
||||
@@ -84,7 +84,6 @@ class DigSeedStep extends Step:
|
||||
var player_tile = Math.get_tile_from_pos(p.global_position)
|
||||
|
||||
while closest_seed == null and actual_distance < limit_distance:
|
||||
print(player_tile)
|
||||
for x in range(actual_distance):
|
||||
for y in range(actual_distance):
|
||||
var coord = Vector2i(x,y) - Vector2i.ONE * floori(actual_distance/2.) + player_tile
|
||||
@@ -134,7 +133,6 @@ class PlantSeedStep extends Step:
|
||||
var player_tile = Math.get_tile_from_pos(p.global_position)
|
||||
|
||||
while closest_decontamination == null and actual_distance < limit_distance:
|
||||
print(player_tile)
|
||||
for x in range(actual_distance):
|
||||
for y in range(actual_distance):
|
||||
var coord = Vector2i(x,y) - Vector2i.ONE * floori(actual_distance/2.) + player_tile
|
||||
|
||||
@@ -13,7 +13,7 @@ func win(planet : Planet):
|
||||
func _on_restart_pressed():
|
||||
GameInfo.game_data.reset_all()
|
||||
get_tree().paused = false
|
||||
get_tree().change_scene_to_file(game_scene_path)
|
||||
SceneManager.change_scene(SceneManager.REGION_SELECTION_SCREEN)
|
||||
|
||||
func _on_quit_pressed():
|
||||
get_tree().quit()
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
[gd_scene load_steps=10 format=3 uid="uid://v41hfc7haaye"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_cl67j"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_cl67j"]
|
||||
[ext_resource type="Script" uid="uid://b3wuxv04clyed" path="res://gui/game/win/scripts/win.gd" id="1_sehw2"]
|
||||
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://gui/game/pause/resources/blur.gdshader" id="2_0b3c6"]
|
||||
[ext_resource type="Shader" uid="uid://cuni3ggtw2uuy" path="res://common/vfx/materials/shaders/blur.gdshader" id="2_0b3c6"]
|
||||
[ext_resource type="FontFile" uid="uid://cpnsnrqhfkj3k" path="res://gui/ressources/fonts/spincycle_ot.otf" id="2_sehw2"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="3_0b3c6"]
|
||||
[ext_resource type="Texture2D" uid="uid://bewr0t1wi8pff" path="res://common/icons/rotate.svg" id="4_8p3aj"]
|
||||
|
||||
79
gui/loading_screen/loading_screen.tscn
Normal file
79
gui/loading_screen/loading_screen.tscn
Normal file
@@ -0,0 +1,79 @@
|
||||
[gd_scene load_steps=7 format=3 uid="uid://dxfe3cr3qy45y"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://c41axxu2t3a8a" path="res://gui/loading_screen/scripts/loading_screen.gd" id="1_mrd8x"]
|
||||
[ext_resource type="LabelSettings" uid="uid://dqwayi8yjwau2" path="res://gui/ressources/title_label_settings.tres" id="1_vsl4m"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_sm2e5"]
|
||||
[ext_resource type="Script" uid="uid://0dhj8sdpil7q" path="res://gui/tools/control_animation_player.gd" id="4_h5vhe"]
|
||||
[ext_resource type="FontFile" uid="uid://c7k6ssq6ocwdk" path="res://gui/ressources/fonts/Ubuntu/Ubuntu-M.ttf" id="4_hjgyq"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_il1kt"]
|
||||
font = ExtResource("4_hjgyq")
|
||||
font_size = 20
|
||||
|
||||
[node name="LoadingScreen" type="CanvasLayer"]
|
||||
process_mode = 3
|
||||
layer = 1000000
|
||||
script = ExtResource("1_mrd8x")
|
||||
|
||||
[node name="LoadingInterface" type="Control" parent="."]
|
||||
unique_name_in_owner = true
|
||||
process_mode = 3
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_bottom = -0.00061035156
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="LoadingInterface"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
color = Color(0.05882353, 0.05882353, 0.16862746, 1)
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="LoadingInterface"]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
theme = ExtResource("2_sm2e5")
|
||||
theme_override_constants/margin_left = 30
|
||||
theme_override_constants/margin_top = 30
|
||||
theme_override_constants/margin_right = 30
|
||||
theme_override_constants/margin_bottom = 30
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="LoadingInterface/MarginContainer"]
|
||||
layout_mode = 2
|
||||
alignment = 1
|
||||
|
||||
[node name="LoadingTitle" type="Label" parent="LoadingInterface/MarginContainer/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
text = "LOADING"
|
||||
label_settings = ExtResource("1_vsl4m")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="LoadingText" type="Label" parent="LoadingInterface/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
text = "Preparing Scene"
|
||||
label_settings = SubResource("LabelSettings_il1kt")
|
||||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="LoadingProgressBar" type="ProgressBar" parent="LoadingInterface/MarginContainer/VBoxContainer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 50)
|
||||
layout_mode = 2
|
||||
theme = ExtResource("2_sm2e5")
|
||||
|
||||
[node name="LoadingAnimation" type="Node" parent="LoadingInterface"]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("4_h5vhe")
|
||||
metadata/_custom_type_script = "uid://0dhj8sdpil7q"
|
||||
32
gui/loading_screen/scripts/loading_screen.gd
Normal file
32
gui/loading_screen/scripts/loading_screen.gd
Normal file
@@ -0,0 +1,32 @@
|
||||
extends CanvasLayer
|
||||
|
||||
const LOADING_BAR_UPDATE_TIME := 0.2
|
||||
|
||||
var loading_value = 0.
|
||||
var loading_text = "" :
|
||||
set(v):
|
||||
%LoadingText.text = v
|
||||
loading_text = v
|
||||
|
||||
func _ready():
|
||||
%LoadingInterface.visible = false
|
||||
|
||||
func show_loading_screen(animation := true):
|
||||
%LoadingProgressBar.value = 0.
|
||||
if animation:
|
||||
await %LoadingAnimation.fade_in()
|
||||
else :
|
||||
%LoadingInterface.visible = true
|
||||
|
||||
func hide_loading_screen(animation := true):
|
||||
if animation and is_node_ready():
|
||||
if %LoadingAnimation.on_animation:
|
||||
await %LoadingAnimation.animation_ended
|
||||
await %LoadingAnimation.fade_out()
|
||||
else : %LoadingInterface.visible = false
|
||||
loading_value = 0.
|
||||
%LoadingProgressBar.value = 0
|
||||
|
||||
func _process(_d):
|
||||
if %LoadingInterface.visible:
|
||||
%LoadingProgressBar.value = lerp(%LoadingProgressBar.value, loading_value * 100, 0.1)
|
||||
1
gui/loading_screen/scripts/loading_screen.gd.uid
Normal file
1
gui/loading_screen/scripts/loading_screen.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://c41axxu2t3a8a
|
||||
@@ -10,6 +10,8 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
script = ExtResource("1_g86te")
|
||||
|
||||
[node name="ControlsWindow" parent="." instance=ExtResource("1_mnd1d")]
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://d3agt2njfgddb" path="res://gui/menu/window/content_label.tscn" id="1_ganst"]
|
||||
[ext_resource type="Script" uid="uid://dhs6kispjoecs" path="res://gui/menu/controls/scripts/input_group.gd" id="1_kkwd7"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="3_s602q"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="3_s602q"]
|
||||
|
||||
[node name="InputGroup" type="HBoxContainer"]
|
||||
size_flags_horizontal = 3
|
||||
|
||||
@@ -3,5 +3,4 @@ extends Node
|
||||
@export_file var start_scene_path : String
|
||||
|
||||
func _ready():
|
||||
get_tree().change_scene_to_file(start_scene_path)
|
||||
|
||||
SceneManager.change_scene(start_scene_path)
|
||||
|
||||
@@ -1 +1 @@
|
||||
uid://c54457tbocdwk
|
||||
uid://dls7t1m62lp5v
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
[ext_resource type="Script" uid="uid://bms0xtv8vh2qg" path="res://gui/menu/settings/scripts/settings.gd" id="1_7t8mv"]
|
||||
[ext_resource type="PackedScene" uid="uid://brxrl7sipyy6k" path="res://gui/menu/window/window.tscn" id="1_gkn1k"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="2_7t8mv"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="2_7t8mv"]
|
||||
[ext_resource type="PackedScene" uid="uid://cvjqp3oewr3rv" path="res://gui/menu/window/content_title.tscn" id="3_rbiwc"]
|
||||
[ext_resource type="PackedScene" uid="uid://d3agt2njfgddb" path="res://gui/menu/window/content_label.tscn" id="4_rbiwc"]
|
||||
|
||||
@@ -14,6 +14,8 @@ anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
mouse_filter = 1
|
||||
script = ExtResource("1_7t8mv")
|
||||
|
||||
@@ -22,7 +24,7 @@ unique_name_in_owner = true
|
||||
process_mode = 3
|
||||
layout_mode = 1
|
||||
offset_left = -349.99994
|
||||
offset_right = 350.00006
|
||||
offset_right = 350.00055
|
||||
mouse_filter = 0
|
||||
title = "SETTINGS"
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://d3agt2njfgddb"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_qjfiv"]
|
||||
[ext_resource type="Theme" uid="uid://5au2k3vf2po3" path="res://gui/ressources/menu.tres" id="1_qjfiv"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="2_klh4u"]
|
||||
|
||||
[sub_resource type="LabelSettings" id="LabelSettings_yj6f1"]
|
||||
@@ -9,6 +9,8 @@ font_size = 20
|
||||
font_color = Color(0.13725491, 0.39215687, 0.6666667, 1)
|
||||
|
||||
[node name="LanguageText" type="Label"]
|
||||
offset_right = 104.0
|
||||
offset_bottom = 24.0
|
||||
theme = ExtResource("1_qjfiv")
|
||||
text = "Language"
|
||||
label_settings = SubResource("LabelSettings_yj6f1")
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[gd_scene load_steps=5 format=3 uid="uid://cvjqp3oewr3rv"]
|
||||
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="1_g1qh5"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="1_g1qh5"]
|
||||
[ext_resource type="Script" uid="uid://cj3o5y7cyipcs" path="res://gui/menu/window/scripts/content_title.gd" id="1_xbmdr"]
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="2_xbmdr"]
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
[ext_resource type="Script" uid="uid://bvsjrf5n8jp1i" path="res://gui/menu/window/scripts/window.gd" id="1_8s3xn"]
|
||||
[ext_resource type="Texture2D" uid="uid://ottk0ccw1d1r" path="res://common/icons/square-rounded-x.svg" id="2_8s3xn"]
|
||||
[ext_resource type="Script" uid="uid://0dhj8sdpil7q" path="res://gui/tools/control_animation_player.gd" id="2_n80be"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/default_theme.tres" id="4_ghh86"]
|
||||
[ext_resource type="Theme" uid="uid://bgcmd213j6gk1" path="res://gui/ressources/hud.tres" id="4_ghh86"]
|
||||
[ext_resource type="Texture2D" uid="uid://bxrn0qho5jo7f" path="res://common/icons/square-rounded-x-nofill.svg" id="5_ghh86"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_yj6f1"]
|
||||
@@ -53,6 +53,7 @@ metadata/_custom_type_script = "uid://0dhj8sdpil7q"
|
||||
[node name="WindowHeader" type="Panel" parent="."]
|
||||
custom_minimum_size = Vector2(0, 50)
|
||||
layout_mode = 2
|
||||
theme = ExtResource("4_ghh86")
|
||||
theme_override_styles/panel = SubResource("StyleBoxFlat_yj6f1")
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="WindowHeader"]
|
||||
|
||||
@@ -137,7 +137,7 @@ anchor_top = 1.0
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 1.0
|
||||
offset_left = -175.0
|
||||
offset_top = -130.0
|
||||
offset_top = -60.0
|
||||
offset_right = 175.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
|
||||
@@ -10,148 +10,148 @@ const ZONE_DEACTIVATED_COLOR = Color.REBECCA_PURPLE
|
||||
const CARD_VISUALISATION_TIME = 0.5
|
||||
const CARD_UP_PADDING = 50
|
||||
|
||||
@export var default_cursor : Texture2D
|
||||
@export var default_cursor: Texture2D
|
||||
|
||||
var current_inspect : Node = null
|
||||
var inspected : Node = null
|
||||
var inspected_card_info : CardInfo = null
|
||||
var time_last_inspected : float = 0.
|
||||
var player : Player # renseigné par Player
|
||||
var can_interact : bool = false
|
||||
var current_selected_item : Item = null
|
||||
var have_energy_to_use_item : bool = false
|
||||
var could_use_item : bool = false
|
||||
var can_use_item : bool = false
|
||||
var current_inspect: Node = null
|
||||
var inspected: Node = null
|
||||
var inspected_card_info: CardInfo = null
|
||||
var time_last_inspected: float = 0.
|
||||
var player: Player # renseigné par Player
|
||||
var can_interact: bool = false
|
||||
var current_selected_item: Item = null
|
||||
var have_energy_to_use_item: bool = false
|
||||
var could_use_item: bool = false
|
||||
var can_use_item: bool = false
|
||||
|
||||
func _ready():
|
||||
Input.set_custom_mouse_cursor(default_cursor)
|
||||
%Action.visible = false
|
||||
Input.set_custom_mouse_cursor(default_cursor)
|
||||
%Action.visible = false
|
||||
|
||||
func _input(_event):
|
||||
if player:
|
||||
if Input.is_action_just_pressed("move_pointer"):
|
||||
player.try_move(
|
||||
player.get_global_mouse_position()
|
||||
)
|
||||
if Input.is_action_just_pressed("drop"):
|
||||
player.drop_item()
|
||||
if player:
|
||||
if Input.is_action_just_pressed("move_pointer"):
|
||||
player.try_move(
|
||||
player.get_global_mouse_position()
|
||||
)
|
||||
if Input.is_action_just_pressed("drop"):
|
||||
player.drop_item()
|
||||
|
||||
if Input.is_action_just_pressed("action"):
|
||||
if can_interact:
|
||||
var interactable = current_inspect as Interactable
|
||||
player.try_interact(interactable)
|
||||
elif can_use_item:
|
||||
player.try_use_item(
|
||||
player.data.inventory.get_item(),
|
||||
player.get_global_mouse_position()
|
||||
)
|
||||
if Input.is_action_just_pressed("action"):
|
||||
if can_interact:
|
||||
var interactable = current_inspect as Interactable
|
||||
player.try_interact(interactable)
|
||||
elif can_use_item:
|
||||
player.try_use_item(
|
||||
player.data.inventory.get_item(),
|
||||
player.get_global_mouse_position()
|
||||
)
|
||||
|
||||
func _process(delta):
|
||||
if current_inspect != inspected:
|
||||
time_last_inspected += delta
|
||||
%Inspector.position = get_viewport().get_mouse_position()
|
||||
if current_inspect != inspected:
|
||||
time_last_inspected += delta
|
||||
%Inspector.position = get_viewport().get_mouse_position()
|
||||
|
||||
if player:
|
||||
can_interact = (
|
||||
current_inspect
|
||||
and current_inspect is Interactable
|
||||
and player.can_interact(current_inspect)
|
||||
)
|
||||
if player:
|
||||
can_interact = (
|
||||
current_inspect
|
||||
and current_inspect is Interactable
|
||||
and player.can_interact(current_inspect)
|
||||
)
|
||||
|
||||
current_selected_item = player.data.inventory.get_item()
|
||||
current_selected_item = player.data.inventory.get_item()
|
||||
|
||||
could_use_item = (
|
||||
current_selected_item
|
||||
and player.preview_could_use_item(current_selected_item)
|
||||
)
|
||||
could_use_item = (
|
||||
current_selected_item
|
||||
and player.preview_could_use_item(current_selected_item)
|
||||
)
|
||||
|
||||
have_energy_to_use_item = (
|
||||
current_selected_item
|
||||
and player.has_energy_to_use_item(current_selected_item)
|
||||
)
|
||||
have_energy_to_use_item = (
|
||||
current_selected_item
|
||||
and player.has_energy_to_use_item(current_selected_item)
|
||||
)
|
||||
|
||||
can_use_item = could_use_item and have_energy_to_use_item
|
||||
can_use_item = could_use_item and have_energy_to_use_item
|
||||
|
||||
if current_selected_item:
|
||||
%ActionZone.radius = current_selected_item.usage_zone_radius
|
||||
%ActionZone.color = ZONE_ACTIVATED_COLOR if can_use_item else ZONE_DEACTIVATED_COLOR
|
||||
else:
|
||||
%ActionZone.radius = 0
|
||||
|
||||
%ActionZone.queue_redraw()
|
||||
if current_selected_item:
|
||||
%ActionZone.radius = current_selected_item.usage_zone_radius
|
||||
%ActionZone.color = ZONE_ACTIVATED_COLOR if can_use_item else ZONE_DEACTIVATED_COLOR
|
||||
else:
|
||||
%ActionZone.radius = 0
|
||||
|
||||
%ActionZone.queue_redraw()
|
||||
|
||||
update_card()
|
||||
update_card()
|
||||
|
||||
update_inspector()
|
||||
update_inspector()
|
||||
|
||||
func inspect(node : Node):
|
||||
if current_inspect and current_inspect != node and current_inspect.has_method("inspect"):
|
||||
current_inspect.inspect(false)
|
||||
current_inspect = node
|
||||
inspected = node
|
||||
if inspected is InspectableEntity:
|
||||
inspected_card_info = inspected.card_info()
|
||||
elif inspected is InventoryGuiItem and inspected.item != null:
|
||||
inspected_card_info = inspected.item.card_info()
|
||||
else :
|
||||
inspected_card_info = null
|
||||
time_last_inspected = 0
|
||||
if current_inspect.has_method("inspect"):
|
||||
current_inspect.inspect(true)
|
||||
update_inspector()
|
||||
func inspect(node: Node):
|
||||
if current_inspect and current_inspect != node and current_inspect.has_method("inspect"):
|
||||
current_inspect.inspect(false)
|
||||
current_inspect = node
|
||||
inspected = node
|
||||
if inspected is InspectableEntity:
|
||||
inspected_card_info = inspected.card_info()
|
||||
elif inspected is InventoryGuiItem and inspected.item != null:
|
||||
inspected_card_info = inspected.item.card_info()
|
||||
elif inspected is RegionPoint:
|
||||
inspected_card_info = inspected.card_info()
|
||||
else:
|
||||
inspected_card_info = null
|
||||
time_last_inspected = 0
|
||||
if current_inspect.has_method("inspect"):
|
||||
current_inspect.inspect(true)
|
||||
update_inspector()
|
||||
|
||||
func update_card():
|
||||
if (
|
||||
not inspected or inspected_card_info == null
|
||||
or time_last_inspected > CARD_VISUALISATION_TIME
|
||||
or get_tree().paused
|
||||
):
|
||||
%CardVisualiser.hide()
|
||||
if (
|
||||
not inspected or inspected_card_info == null
|
||||
or time_last_inspected > CARD_VISUALISATION_TIME
|
||||
or get_tree().paused
|
||||
):
|
||||
%CardVisualiser.hide()
|
||||
|
||||
elif inspected != null and (
|
||||
inspected is InspectableEntity
|
||||
or inspected is InventoryGuiItem
|
||||
):
|
||||
|
||||
if inspected_card_info != %CardVisualiser.card_info:
|
||||
%CardVisualiser.card_info = inspected_card_info
|
||||
%CardVisualiser.show()
|
||||
elif inspected != null :
|
||||
|
||||
if inspected_card_info != %CardVisualiser.card_info:
|
||||
%CardVisualiser.card_info = inspected_card_info
|
||||
%CardVisualiser.show()
|
||||
|
||||
var camera = get_viewport().get_camera_2d()
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
if inspected is InspectableEntity:
|
||||
%CardPosition.position = inspected.global_position - camera.global_position + screen_size / 2 + CARD_UP_PADDING * Vector2.UP
|
||||
elif inspected is InventoryGuiItem:
|
||||
%CardPosition.position = inspected.global_position + inspected.size/2 + CARD_UP_PADDING * Vector2.UP
|
||||
|
||||
if %CardVisualiser.is_mouse_over():
|
||||
time_last_inspected = 0.
|
||||
|
||||
var camera = get_viewport().get_camera_2d()
|
||||
var screen_size = get_viewport().get_visible_rect().size
|
||||
if inspected is InspectableEntity:
|
||||
%CardPosition.position = inspected.global_position - camera.global_position + screen_size / 2 + CARD_UP_PADDING * Vector2.UP
|
||||
elif inspected is Control:
|
||||
%CardPosition.position = inspected.global_position + inspected.size / 2 + CARD_UP_PADDING * Vector2.UP
|
||||
elif inspected is Node3D:
|
||||
%CardPosition.position = get_viewport().get_camera_3d().unproject_position(inspected.global_position) + CARD_UP_PADDING * Vector2.UP
|
||||
if %CardVisualiser.is_mouse_over():
|
||||
time_last_inspected = 0.
|
||||
|
||||
|
||||
func update_inspector():
|
||||
if player:
|
||||
if can_interact and current_inspect and current_inspect is Interactable:
|
||||
%Action.visible = true
|
||||
%ActionText.text = current_inspect.interact_text()
|
||||
%Action.modulate = DEFAULT_ACTION_COLOR if current_inspect.interaction_cost(player) == 0 else ENERGY_ACTION_COLOR
|
||||
%ActionEnergyImage.visible = current_inspect.interaction_cost(player) != 0
|
||||
elif current_selected_item and current_selected_item.use_text() != "":
|
||||
%Action.visible = true
|
||||
%ActionText.text = current_selected_item.use_text() + (tr("NO_ENERGY_LEFT") if not have_energy_to_use_item else "")
|
||||
if can_use_item:
|
||||
%Action.modulate = DEFAULT_ACTION_COLOR if current_selected_item.energy_usage == 0 else ENERGY_ACTION_COLOR
|
||||
else :
|
||||
%Action.modulate = NO_ENERGY_ACTION_COLOR
|
||||
%ActionEnergyImage.visible = current_selected_item.energy_usage != 0
|
||||
else:
|
||||
%Action.visible = false
|
||||
|
||||
else:
|
||||
%Action.visible = false
|
||||
if player:
|
||||
if can_interact and current_inspect and current_inspect is Interactable:
|
||||
%Action.visible = true
|
||||
%ActionText.text = current_inspect.interact_text()
|
||||
%Action.modulate = DEFAULT_ACTION_COLOR if current_inspect.interaction_cost(player) == 0 else ENERGY_ACTION_COLOR
|
||||
%ActionEnergyImage.visible = current_inspect.interaction_cost(player) != 0
|
||||
elif current_selected_item and current_selected_item.use_text() != "":
|
||||
%Action.visible = true
|
||||
%ActionText.text = current_selected_item.use_text() + (tr("NO_ENERGY_LEFT") if not have_energy_to_use_item else "")
|
||||
if can_use_item:
|
||||
%Action.modulate = DEFAULT_ACTION_COLOR if current_selected_item.energy_usage == 0 else ENERGY_ACTION_COLOR
|
||||
else:
|
||||
%Action.modulate = NO_ENERGY_ACTION_COLOR
|
||||
%ActionEnergyImage.visible = current_selected_item.energy_usage != 0
|
||||
else:
|
||||
%Action.visible = false
|
||||
|
||||
else:
|
||||
%Action.visible = false
|
||||
|
||||
func stop_inspect(node : Node):
|
||||
if node.has_method("inspect"):
|
||||
node.inspect(false)
|
||||
if current_inspect == node:
|
||||
current_inspect = null
|
||||
update_inspector()
|
||||
func stop_inspect(node: Node):
|
||||
if node.has_method("inspect"):
|
||||
node.inspect(false)
|
||||
if current_inspect == node:
|
||||
current_inspect = null
|
||||
update_inspector()
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_resource type="Theme" load_steps=35 format=3 uid="uid://bgcmd213j6gk1"]
|
||||
[gd_resource type="Theme" load_steps=36 format=3 uid="uid://bgcmd213j6gk1"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="1_g7s0b"]
|
||||
[ext_resource type="Texture2D" uid="uid://bqcsma3tkbefi" path="res://common/icons/square-rounded-check.svg" id="2_36amo"]
|
||||
@@ -123,8 +123,25 @@ corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_g7s0b"]
|
||||
bg_color = Color(0.043137256, 0.039215688, 0.11764706, 1)
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5ugto"]
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
shadow_color = Color(1, 0.6509804, 0.09019608, 1)
|
||||
shadow_size = 1
|
||||
shadow_offset = Vector2(0, -30)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qux7a"]
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
shadow_color = Color(1, 0.6509804, 0.09019608, 1)
|
||||
shadow_size = 1
|
||||
shadow_offset = Vector2(0, -30)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ab4w8"]
|
||||
bg_color = Color(0.03, 0.03, 0.03, 0.42745098)
|
||||
@@ -189,7 +206,10 @@ OptionButton/styles/focus = SubResource("StyleBoxFlat_4pupg")
|
||||
OptionButton/styles/hover = SubResource("StyleBoxFlat_c6ec6")
|
||||
OptionButton/styles/normal = SubResource("StyleBoxFlat_x0rpt")
|
||||
OptionButton/styles/pressed = SubResource("StyleBoxFlat_x0rpt")
|
||||
Panel/styles/panel = SubResource("StyleBoxFlat_g7s0b")
|
||||
Panel/styles/panel = SubResource("StyleBoxFlat_5ugto")
|
||||
PanelContainer/styles/panel = SubResource("StyleBoxFlat_qux7a")
|
||||
ProgressBar/font_sizes/font_size = 24
|
||||
ProgressBar/fonts/font = ExtResource("1_g7s0b")
|
||||
ProgressBar/styles/background = SubResource("StyleBoxFlat_ab4w8")
|
||||
ProgressBar/styles/fill = SubResource("StyleBoxFlat_36amo")
|
||||
RichTextLabel/font_sizes/bold_font_size = 12
|
||||
225
gui/ressources/menu.tres
Normal file
225
gui/ressources/menu.tres
Normal file
@@ -0,0 +1,225 @@
|
||||
[gd_resource type="Theme" load_steps=36 format=3 uid="uid://5au2k3vf2po3"]
|
||||
|
||||
[ext_resource type="FontFile" uid="uid://qt80w6o01q5s" path="res://gui/ressources/fonts/TitanOne-Regular.ttf" id="1_6ccgi"]
|
||||
[ext_resource type="Texture2D" uid="uid://bqcsma3tkbefi" path="res://common/icons/square-rounded-check.svg" id="2_26s3p"]
|
||||
[ext_resource type="Texture2D" uid="uid://b6dwhn0uotdgu" path="res://common/icons/square-rounded-nofill.svg" id="3_72f2k"]
|
||||
[ext_resource type="Texture2D" uid="uid://xt032oyjwdoy" path="res://gui/ressources/textures/slider.svg" id="4_wbb8a"]
|
||||
[ext_resource type="Texture2D" uid="uid://2hbbmhlgj8ue" path="res://gui/ressources/textures/slider-highlight.svg" id="5_c4kxq"]
|
||||
[ext_resource type="FontFile" uid="uid://c7k6ssq6ocwdk" path="res://gui/ressources/fonts/Ubuntu/Ubuntu-M.ttf" id="6_74wyx"]
|
||||
[ext_resource type="Texture2D" uid="uid://chelw5jxqyyi4" path="res://gui/ressources/textures/option-button-icon.svg" id="7_pcpk1"]
|
||||
[ext_resource type="FontFile" uid="uid://3workc27eb0r" path="res://gui/ressources/fonts/Ubuntu/Ubuntu-B.ttf" id="8_o5nqn"]
|
||||
[ext_resource type="FontFile" uid="uid://dxbmvk18hg103" path="res://gui/ressources/fonts/Ubuntu/Ubuntu-BI.ttf" id="9_1r3ae"]
|
||||
[ext_resource type="FontFile" uid="uid://bnmaweyw0kfcy" path="res://gui/ressources/fonts/Ubuntu/Ubuntu-MI.ttf" id="10_hh2bs"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_hv6r3"]
|
||||
bg_color = Color(0.976471, 0.741176, 0.4, 1)
|
||||
border_width_left = 10
|
||||
border_width_top = 10
|
||||
border_width_right = 10
|
||||
border_width_bottom = 10
|
||||
border_color = Color(0.975367, 0.740445, 0.401877, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_y48f0"]
|
||||
bg_color = Color(1, 0.6509804, 0.09019608, 1)
|
||||
border_width_left = 10
|
||||
border_width_top = 10
|
||||
border_width_right = 10
|
||||
border_width_bottom = 10
|
||||
border_color = Color(1, 0.6509804, 0.09019608, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_st1o2"]
|
||||
bg_color = Color(0.692349, 0.477218, 0.112321, 1)
|
||||
border_width_left = 10
|
||||
border_width_top = 10
|
||||
border_width_right = 10
|
||||
border_width_bottom = 10
|
||||
border_color = Color(0.694118, 0.478431, 0.113725, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_1lj4c"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_frr6k"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_4pupg"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_x0rpt"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_c6ec6"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_5ugto"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_qux7a"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_mqali"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_2ul3a"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_74wu0"]
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_2lmp7"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_feqcm"]
|
||||
bg_color = Color(1, 0.6509804, 0.09019608, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_1lj4c"]
|
||||
bg_color = Color(0.6852761, 0.4354346, 0, 1)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_frr6k"]
|
||||
bg_color = Color(0.45452476, 0.45452416, 0.4545238, 1)
|
||||
border_width_left = 15
|
||||
border_width_top = 5
|
||||
border_width_right = 15
|
||||
border_width_bottom = 5
|
||||
border_color = Color(0.45490196, 0.45490196, 0.45490196, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_4pupg"]
|
||||
bg_color = Color(0.9019608, 0.5568628, 0, 1)
|
||||
border_width_left = 15
|
||||
border_width_top = 5
|
||||
border_width_right = 15
|
||||
border_width_bottom = 5
|
||||
border_color = Color(0.9019608, 0.5568628, 0, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_c6ec6"]
|
||||
bg_color = Color(0.9019608, 0.5568628, 0, 1)
|
||||
border_width_left = 15
|
||||
border_width_top = 5
|
||||
border_width_right = 15
|
||||
border_width_bottom = 5
|
||||
border_color = Color(0.9019608, 0.5568628, 0, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_x0rpt"]
|
||||
bg_color = Color(1, 0.6509804, 0.09019608, 1)
|
||||
border_width_left = 15
|
||||
border_width_top = 5
|
||||
border_width_right = 15
|
||||
border_width_bottom = 5
|
||||
border_color = Color(1, 0.6509804, 0.09019608, 1)
|
||||
corner_radius_top_left = 10
|
||||
corner_radius_top_right = 10
|
||||
corner_radius_bottom_right = 10
|
||||
corner_radius_bottom_left = 10
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_5ugto"]
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
shadow_color = Color(1, 0.6509804, 0.09019608, 1)
|
||||
shadow_size = 1
|
||||
shadow_offset = Vector2(0, -30)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_qux7a"]
|
||||
bg_color = Color(1, 1, 1, 1)
|
||||
corner_radius_top_left = 20
|
||||
corner_radius_top_right = 20
|
||||
corner_radius_bottom_right = 20
|
||||
corner_radius_bottom_left = 20
|
||||
shadow_color = Color(1, 0.6509804, 0.09019608, 1)
|
||||
shadow_size = 1
|
||||
shadow_offset = Vector2(0, -30)
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_ab4w8"]
|
||||
bg_color = Color(0.03, 0.03, 0.03, 0.42745098)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_36amo"]
|
||||
bg_color = Color(1, 0.6509804, 0.09019608, 1)
|
||||
corner_radius_top_left = 5
|
||||
corner_radius_top_right = 5
|
||||
corner_radius_bottom_right = 5
|
||||
corner_radius_bottom_left = 5
|
||||
|
||||
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_hv6r3"]
|
||||
|
||||
[resource]
|
||||
Button/colors/font_color = Color(1, 1, 1, 1)
|
||||
Button/font_sizes/font_size = 25
|
||||
Button/fonts/font = ExtResource("1_6ccgi")
|
||||
Button/styles/hover = SubResource("StyleBoxFlat_hv6r3")
|
||||
Button/styles/normal = SubResource("StyleBoxFlat_y48f0")
|
||||
Button/styles/pressed = SubResource("StyleBoxFlat_st1o2")
|
||||
CheckBox/colors/checkbox_checked_color = Color(1, 0.6509804, 0.09019608, 1)
|
||||
CheckBox/colors/checkbox_unchecked_color = Color(0.45882353, 0.45882353, 0.45882353, 1)
|
||||
CheckBox/constants/icon_max_width = 30
|
||||
CheckBox/icons/checked = ExtResource("2_26s3p")
|
||||
CheckBox/icons/checked_disabled = ExtResource("2_26s3p")
|
||||
CheckBox/icons/radio_unchecked_disabled = ExtResource("3_72f2k")
|
||||
CheckBox/icons/unchecked = ExtResource("3_72f2k")
|
||||
CheckBox/icons/unchecked_disabled = ExtResource("3_72f2k")
|
||||
CheckBox/styles/disabled = SubResource("StyleBoxEmpty_1lj4c")
|
||||
CheckBox/styles/disabled_mirrored = SubResource("StyleBoxEmpty_frr6k")
|
||||
CheckBox/styles/focus = SubResource("StyleBoxEmpty_4pupg")
|
||||
CheckBox/styles/hover = SubResource("StyleBoxEmpty_x0rpt")
|
||||
CheckBox/styles/hover_mirrored = SubResource("StyleBoxEmpty_c6ec6")
|
||||
CheckBox/styles/hover_pressed = SubResource("StyleBoxEmpty_5ugto")
|
||||
CheckBox/styles/hover_pressed_mirrored = SubResource("StyleBoxEmpty_qux7a")
|
||||
CheckBox/styles/normal = SubResource("StyleBoxEmpty_mqali")
|
||||
CheckBox/styles/normal_mirrored = SubResource("StyleBoxEmpty_2ul3a")
|
||||
CheckBox/styles/pressed = SubResource("StyleBoxEmpty_74wu0")
|
||||
CheckBox/styles/pressed_mirrored = SubResource("StyleBoxEmpty_2lmp7")
|
||||
GridContainer/constants/h_separation = 15
|
||||
GridContainer/constants/v_separation = 15
|
||||
HBoxContainer/constants/separation = 15
|
||||
HSlider/icons/grabber = ExtResource("4_wbb8a")
|
||||
HSlider/icons/grabber_highlight = ExtResource("5_c4kxq")
|
||||
HSlider/styles/grabber_area = SubResource("StyleBoxFlat_feqcm")
|
||||
HSlider/styles/grabber_area_highlight = SubResource("StyleBoxFlat_1lj4c")
|
||||
Label/fonts/font = ExtResource("6_74wyx")
|
||||
MarginContainer/constants/margin_bottom = 15
|
||||
MarginContainer/constants/margin_left = 15
|
||||
MarginContainer/constants/margin_right = 15
|
||||
MarginContainer/constants/margin_top = 15
|
||||
OptionButton/colors/font_color = Color(1, 1, 1, 1)
|
||||
OptionButton/font_sizes/font_size = 18
|
||||
OptionButton/fonts/font = ExtResource("1_6ccgi")
|
||||
OptionButton/icons/arrow = ExtResource("7_pcpk1")
|
||||
OptionButton/styles/disabled = SubResource("StyleBoxFlat_frr6k")
|
||||
OptionButton/styles/focus = SubResource("StyleBoxFlat_4pupg")
|
||||
OptionButton/styles/hover = SubResource("StyleBoxFlat_c6ec6")
|
||||
OptionButton/styles/normal = SubResource("StyleBoxFlat_x0rpt")
|
||||
OptionButton/styles/pressed = SubResource("StyleBoxFlat_x0rpt")
|
||||
Panel/styles/panel = SubResource("StyleBoxFlat_5ugto")
|
||||
PanelContainer/styles/panel = SubResource("StyleBoxFlat_qux7a")
|
||||
ProgressBar/styles/background = SubResource("StyleBoxFlat_ab4w8")
|
||||
ProgressBar/styles/fill = SubResource("StyleBoxFlat_36amo")
|
||||
RichTextLabel/font_sizes/bold_font_size = 12
|
||||
RichTextLabel/font_sizes/bold_italics_font_size = 12
|
||||
RichTextLabel/font_sizes/italics_font_size = 12
|
||||
RichTextLabel/font_sizes/mono_font_size = 12
|
||||
RichTextLabel/font_sizes/normal_font_size = 12
|
||||
RichTextLabel/fonts/bold_font = ExtResource("8_o5nqn")
|
||||
RichTextLabel/fonts/bold_italics_font = ExtResource("9_1r3ae")
|
||||
RichTextLabel/fonts/italics_font = ExtResource("10_hh2bs")
|
||||
RichTextLabel/fonts/normal_font = ExtResource("6_74wyx")
|
||||
VBoxContainer/constants/separation = 15
|
||||
VSeparator/constants/separation = 15
|
||||
VSeparator/styles/separator = SubResource("StyleBoxEmpty_hv6r3")
|
||||
VSplitContainer/constants/separation = 15
|
||||
@@ -2,18 +2,77 @@
|
||||
extends Node
|
||||
class_name ControlAnimationPlayer
|
||||
|
||||
signal animation_ended
|
||||
|
||||
var on_animation = false
|
||||
|
||||
@onready var target : Control = get_parent()
|
||||
|
||||
var target_default_pos : Vector2
|
||||
var target_default_modulate = Color.WHITE
|
||||
|
||||
@export_tool_button("Test Shake", "Callable") var shake_action = shake
|
||||
@export_tool_button("Test Bounce", "Callable") var bounce_action = bounce
|
||||
@export_tool_button("Test Appear", "Callable") var appear_action = appear
|
||||
@export_tool_button("Test Disappear", "Callable") var disappear_action = disappear
|
||||
@export_tool_button("Test Slide In", "Callable") var slide_in_action = slide_in
|
||||
@export_tool_button("Test Slide Off", "Callable") var slide_off_action = slide_off
|
||||
@export_tool_button("Test Fade In", "Callable") var fade_in_action = fade_in
|
||||
@export_tool_button("Test Fade Out", "Callable") var fade_out_action = fade_out
|
||||
|
||||
func _ready():
|
||||
setup_default_values()
|
||||
get_tree().get_root().size_changed.connect(setup_default_values)
|
||||
|
||||
func setup_default_values():
|
||||
target_default_pos = target.global_position
|
||||
|
||||
func start_anim():
|
||||
on_animation = true
|
||||
|
||||
func end_anim():
|
||||
animation_ended.emit()
|
||||
on_animation = false
|
||||
|
||||
func fade_in(
|
||||
duration : float = 0.3,
|
||||
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR,
|
||||
):
|
||||
start_anim()
|
||||
target.visible = true
|
||||
|
||||
await add_tween(
|
||||
"modulate",
|
||||
target_default_modulate,
|
||||
duration,
|
||||
transition_type
|
||||
).finished
|
||||
|
||||
end_anim()
|
||||
|
||||
func fade_out(
|
||||
duration : float = 0.3,
|
||||
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR,
|
||||
):
|
||||
start_anim()
|
||||
target.visible = true
|
||||
|
||||
await add_tween(
|
||||
"modulate",
|
||||
Color.TRANSPARENT,
|
||||
duration,
|
||||
transition_type
|
||||
).finished
|
||||
|
||||
target.visible = false
|
||||
end_anim()
|
||||
|
||||
func disappear(
|
||||
duration : float = 0.3,
|
||||
offset : int = 20,
|
||||
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR,
|
||||
):
|
||||
start_anim()
|
||||
add_tween(
|
||||
"modulate",
|
||||
Color.TRANSPARENT,
|
||||
@@ -28,29 +87,68 @@ func disappear(
|
||||
transition_type
|
||||
).finished
|
||||
|
||||
target.position += Vector2.DOWN * offset
|
||||
target.position = target_default_pos
|
||||
end_anim()
|
||||
|
||||
func appear(
|
||||
duration : float = 0.3,
|
||||
offset : int = 20,
|
||||
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR,
|
||||
):
|
||||
start_anim()
|
||||
target.modulate = Color.TRANSPARENT
|
||||
|
||||
add_tween(
|
||||
"modulate",
|
||||
Color.WHITE,
|
||||
target_default_modulate,
|
||||
duration,
|
||||
transition_type
|
||||
).finished
|
||||
|
||||
target.position += Vector2.UP * offset
|
||||
target.position = target_default_pos + Vector2.UP * offset
|
||||
|
||||
await add_tween(
|
||||
"position",
|
||||
target.position + Vector2.DOWN * offset,
|
||||
target_default_pos,
|
||||
duration,
|
||||
transition_type
|
||||
).finished
|
||||
|
||||
|
||||
target.position = target_default_pos
|
||||
|
||||
end_anim()
|
||||
|
||||
func slide_in(
|
||||
duration : float = 0.3,
|
||||
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_CUBIC,
|
||||
):
|
||||
start_anim()
|
||||
target.position += Vector2.UP * target.size.y
|
||||
target.visible = true
|
||||
|
||||
await add_tween(
|
||||
"position",
|
||||
target_default_pos,
|
||||
duration,
|
||||
transition_type
|
||||
).finished
|
||||
end_anim()
|
||||
|
||||
func slide_off(
|
||||
duration : float = 0.3,
|
||||
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_CUBIC,
|
||||
):
|
||||
start_anim()
|
||||
await add_tween(
|
||||
"position",
|
||||
target.position - Vector2.UP * target.size.y,
|
||||
duration,
|
||||
transition_type
|
||||
).finished
|
||||
|
||||
target.visible = false
|
||||
target.position = target_default_pos
|
||||
end_anim()
|
||||
|
||||
func bounce(
|
||||
duration : float = 0.4,
|
||||
@@ -58,6 +156,7 @@ func bounce(
|
||||
direction : Vector2 = Vector2.UP,
|
||||
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_BOUNCE,
|
||||
):
|
||||
start_anim()
|
||||
await add_tween(
|
||||
"position",
|
||||
target.position + direction * amount,
|
||||
@@ -66,16 +165,18 @@ func bounce(
|
||||
).finished
|
||||
await add_tween(
|
||||
"position",
|
||||
target.position - direction * amount,
|
||||
target_default_pos,
|
||||
duration/2,
|
||||
transition_type
|
||||
).finished
|
||||
end_anim()
|
||||
|
||||
func shake(
|
||||
duration : float = 0.3,
|
||||
amount : float = 10,
|
||||
transition_type: Tween.TransitionType = Tween.TransitionType.TRANS_LINEAR,
|
||||
):
|
||||
start_anim()
|
||||
await add_tween(
|
||||
"position",
|
||||
target.position + Vector2.RIGHT * amount/2,
|
||||
@@ -95,6 +196,9 @@ func shake(
|
||||
transition_type
|
||||
).finished
|
||||
|
||||
target.position = target_default_pos
|
||||
end_anim()
|
||||
|
||||
|
||||
func add_tween(
|
||||
property : String,
|
||||
|
||||
Reference in New Issue
Block a user