add animations
This commit is contained in:
13
core/game_menu/arrow_button.gd
Normal file
13
core/game_menu/arrow_button.gd
Normal file
@@ -0,0 +1,13 @@
|
||||
@tool
|
||||
extends Control
|
||||
|
||||
@export var image: Texture:
|
||||
set(value):
|
||||
image = value
|
||||
if is_inside_tree() and has_node("%Texture"):
|
||||
$%Texture.texture = image
|
||||
|
||||
|
||||
func _ready():
|
||||
if image != null and has_node("%Texture"):
|
||||
$%Texture.texture = image
|
||||
1
core/game_menu/arrow_button.gd.uid
Normal file
1
core/game_menu/arrow_button.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://3uxuhvua1036
|
||||
@@ -1,10 +1,31 @@
|
||||
[gd_scene format=3 uid="uid://dm3skv22c60tm"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cm7fok7lhrano" path="res://core/game_menu/assets/page_1/freccetta.png" id="1_vbu0v"]
|
||||
[ext_resource type="Script" uid="uid://3uxuhvua1036" path="res://core/game_menu/arrow_button.gd" id="2_xq7pl"]
|
||||
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/game_menu/hoover_tween.tscn" id="3_hu4cn"]
|
||||
|
||||
[node name="ArrowButton" type="TextureButton" unique_id=103192648]
|
||||
offset_left = 229.0
|
||||
offset_top = 652.0
|
||||
offset_right = 305.0
|
||||
offset_bottom = 756.0
|
||||
texture_normal = ExtResource("1_vbu0v")
|
||||
[node name="ArrowButton" type="Control" unique_id=1696751730]
|
||||
custom_minimum_size = Vector2(76, 104)
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 76.0
|
||||
offset_bottom = 104.0
|
||||
pivot_offset = Vector2(0.5, 0.5)
|
||||
script = ExtResource("2_xq7pl")
|
||||
image = ExtResource("1_vbu0v")
|
||||
|
||||
[node name="Texture" type="TextureRect" parent="." unique_id=194430609]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_right = -36.0
|
||||
offset_bottom = -64.0
|
||||
pivot_offset_ratio = Vector2(0.5, 0.5)
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("1_vbu0v")
|
||||
metadata/_edit_use_anchors_ = true
|
||||
|
||||
[node name="HooverTween" parent="." unique_id=2115829120 node_paths=PackedStringArray("detector_node", "visual_node") instance=ExtResource("3_hu4cn")]
|
||||
detector_node = NodePath("..")
|
||||
visual_node = NodePath("../Texture")
|
||||
|
||||
BIN
core/game_menu/assets/page_1/freccetta-1.png
Normal file
BIN
core/game_menu/assets/page_1/freccetta-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
40
core/game_menu/assets/page_1/freccetta-1.png.import
Normal file
40
core/game_menu/assets/page_1/freccetta-1.png.import
Normal file
@@ -0,0 +1,40 @@
|
||||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://clnfehvvft2vc"
|
||||
path="res://.godot/imported/freccetta-1.png-3151fb789e65ba70da1c83fc0dd12ea7.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://core/game_menu/assets/page_1/freccetta-1.png"
|
||||
dest_files=["res://.godot/imported/freccetta-1.png-3151fb789e65ba70da1c83fc0dd12ea7.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
|
||||
@@ -1,19 +1,22 @@
|
||||
[gd_scene format=3 uid="uid://bc60gon7fmvbr"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://rhun07060pnu" path="res://core/game_menu/assets/page_1/freccetta_grande.png" id="1_6vn80"]
|
||||
[ext_resource type="PackedScene" uid="uid://dm3skv22c60tm" path="res://core/game_menu/arrow_button.tscn" id="1_16l2d"]
|
||||
[ext_resource type="Texture2D" uid="uid://cin3kt42e6w3u" path="res://core/game_menu/assets/page_1/color_sx_biome.png" id="2_xjika"]
|
||||
[ext_resource type="Texture2D" uid="uid://dc0sl04wem136" path="res://core/game_menu/assets/page_1/color_main_biome.png" id="3_0noye"]
|
||||
[ext_resource type="Texture2D" uid="uid://dj6pt25w5i4jq" path="res://core/game_menu/assets/page_1/lucchetto.png" id="3_wyms5"]
|
||||
[ext_resource type="Texture2D" uid="uid://c3qcivnwuisju" path="res://core/game_menu/assets/page_1/color_dx_biome.png" id="4_0noye"]
|
||||
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/game_menu/hoover_tween.tscn" id="5_16l2d"]
|
||||
[ext_resource type="Texture2D" uid="uid://clnfehvvft2vc" path="res://core/game_menu/assets/page_1/freccetta-1.png" id="6_hjy5b"]
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" unique_id=291322067]
|
||||
offset_right = 751.0
|
||||
offset_bottom = 343.0
|
||||
theme_override_constants/separation = 24
|
||||
alignment = 1
|
||||
|
||||
[node name="FreccettaGrandeLeft" type="TextureButton" parent="." unique_id=1190316330]
|
||||
[node name="ArrowButtonLeft" parent="." unique_id=1696751730 instance=ExtResource("1_16l2d")]
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("1_6vn80")
|
||||
stretch_mode = 3
|
||||
size_flags_vertical = 4
|
||||
|
||||
[node name="HBoxContainer2" type="HBoxContainer" parent="." unique_id=1117886768]
|
||||
layout_mode = 2
|
||||
@@ -40,11 +43,28 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("3_wyms5")
|
||||
|
||||
[node name="Biome2" type="TextureButton" parent="HBoxContainer2" unique_id=1409565303]
|
||||
[node name="Control" type="Control" parent="HBoxContainer2" unique_id=1426883353]
|
||||
custom_minimum_size = Vector2(162, 0)
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Biome2" type="TextureButton" parent="HBoxContainer2/Control" unique_id=1409565303]
|
||||
layout_mode = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
pivot_offset_ratio = Vector2(0.5, 0.5)
|
||||
texture_normal = ExtResource("3_0noye")
|
||||
stretch_mode = 3
|
||||
|
||||
[node name="HooverTween" parent="HBoxContainer2/Control/Biome2" unique_id=160227524 node_paths=PackedStringArray("detector_node", "visual_node") instance=ExtResource("5_16l2d")]
|
||||
always_active = true
|
||||
detector_node = NodePath("../..")
|
||||
visual_node = NodePath("..")
|
||||
scale_amount = Vector2(1.05, 1.05)
|
||||
duration = 1.0
|
||||
|
||||
[node name="Biome3" type="TextureButton" parent="HBoxContainer2" unique_id=970033726]
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("4_0noye")
|
||||
@@ -65,11 +85,7 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
texture = ExtResource("3_wyms5")
|
||||
|
||||
[node name="FreccettaGrandeRight" type="TextureButton" parent="." unique_id=264353864]
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("1_6vn80")
|
||||
stretch_mode = 3
|
||||
flip_h = true
|
||||
|
||||
[node name="BiomeSelector" type="Control" parent="." unique_id=1957954960]
|
||||
[node name="ArrowButtonRight" parent="." unique_id=1741162553 instance=ExtResource("1_16l2d")]
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 4
|
||||
image = ExtResource("6_hjy5b")
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
@tool
|
||||
extends TextureButton
|
||||
extends Control
|
||||
|
||||
@export var image: Texture:
|
||||
set(value):
|
||||
image = value
|
||||
texture_normal = image
|
||||
if is_inside_tree() and has_node("%Texture"):
|
||||
$%Texture.texture = image
|
||||
|
||||
@onready var color: Color
|
||||
|
||||
func _ready():
|
||||
texture_normal = image
|
||||
if texture_normal != null:
|
||||
var img = texture_normal.get_image()
|
||||
if image != null and has_node("%Texture"):
|
||||
$%Texture.texture = image
|
||||
if $%Texture.texture != null:
|
||||
var img = $%Texture.texture.get_image()
|
||||
color = img.get_pixel(0, 0)
|
||||
else:
|
||||
color = Color.BLACK
|
||||
|
||||
@@ -2,8 +2,36 @@
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cdjwvwst3f10a" path="res://core/game_menu/assets/page_1/customizecolor-1.png" id="1_us0rx"]
|
||||
[ext_resource type="Script" uid="uid://crfw5whcjs0du" path="res://core/game_menu/color_picker.gd" id="2_323rd"]
|
||||
[ext_resource type="PackedScene" uid="uid://dxun0jk5t0n6" path="res://core/game_menu/hoover_tween.tscn" id="3_264kt"]
|
||||
|
||||
[node name="ColorPicker" type="TextureButton" unique_id=59169767]
|
||||
texture_normal = ExtResource("1_us0rx")
|
||||
[node name="ColorPicker" type="Control" unique_id=409505029]
|
||||
custom_minimum_size = Vector2(53, 53)
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
offset_right = 53.0
|
||||
offset_bottom = 53.0
|
||||
script = ExtResource("2_323rd")
|
||||
image = ExtResource("1_us0rx")
|
||||
|
||||
[node name="Texture" type="TextureRect" parent="." unique_id=329703623]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(53, 53)
|
||||
layout_mode = 1
|
||||
anchors_preset = 8
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
offset_left = -26.5
|
||||
offset_top = -26.5
|
||||
offset_right = 26.5
|
||||
offset_bottom = 26.5
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
pivot_offset_ratio = Vector2(0.5, 0.5)
|
||||
mouse_filter = 2
|
||||
texture = ExtResource("1_us0rx")
|
||||
|
||||
[node name="HooverTween" parent="." unique_id=160227524 node_paths=PackedStringArray("detector_node", "visual_node") instance=ExtResource("3_264kt")]
|
||||
detector_node = NodePath("..")
|
||||
visual_node = NodePath("../Texture")
|
||||
|
||||
@@ -8,6 +8,7 @@ func _ready() -> void:
|
||||
tab.on_tab_selected.connect(_on_tab_pressed)
|
||||
|
||||
tabs[0].select()
|
||||
pages[0].show()
|
||||
|
||||
func _on_tab_pressed(index: int):
|
||||
for page in pages:
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
[ext_resource type="PackedScene" uid="uid://c8b5sqnocx8dr" path="res://core/game_menu/page_3.tscn" id="5_yq2ch"]
|
||||
|
||||
[node name="GameMenu" type="Control" unique_id=2124096517]
|
||||
process_mode = 3
|
||||
layout_mode = 3
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@@ -20,31 +21,25 @@ mouse_filter = 2
|
||||
script = ExtResource("1_57vaj")
|
||||
|
||||
[node name="Tabs" type="HBoxContainer" parent="." unique_id=1745270897]
|
||||
layout_mode = 0
|
||||
offset_left = 1146.0
|
||||
offset_top = 214.0
|
||||
offset_right = 1754.0
|
||||
offset_bottom = 254.0
|
||||
layout_mode = 1
|
||||
offset_left = 1138.0
|
||||
offset_top = 208.0
|
||||
offset_right = 1734.0
|
||||
offset_bottom = 646.0
|
||||
|
||||
[node name="Tab1" parent="Tabs" unique_id=2026548604 instance=ExtResource("3_xmmnr")]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
image = ExtResource("4_y36g7")
|
||||
|
||||
[node name="Tab2" parent="Tabs" unique_id=640092511 instance=ExtResource("3_xmmnr")]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
index = 1
|
||||
|
||||
[node name="Tab3" parent="Tabs" unique_id=1769860923 instance=ExtResource("3_xmmnr")]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(200, 0)
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
index = 2
|
||||
image = ExtResource("5_7d256")
|
||||
|
||||
@@ -69,7 +64,6 @@ mouse_filter = 2
|
||||
|
||||
[node name="Page1" parent="Pages" unique_id=2037261222 instance=ExtResource("3_quxs6")]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
mouse_filter = 2
|
||||
|
||||
|
||||
@@ -5,24 +5,41 @@ class_name GameMenuTab
|
||||
|
||||
signal on_tab_selected(index: int)
|
||||
|
||||
@export var bob_height: float = 100
|
||||
@export var duration: float = 0.5
|
||||
@export var index: int = 0
|
||||
@export var image: Texture:
|
||||
set(value):
|
||||
image = value
|
||||
if is_inside_tree() and has_node("%Texture"):
|
||||
$%Texture.texture_normal = image
|
||||
|
||||
var is_selected: bool = false
|
||||
if is_inside_tree() and has_node("%TextureButton"):
|
||||
$%TextureButton.texture_normal = image
|
||||
|
||||
@onready var texture_button: TextureButton = $%TextureButton
|
||||
|
||||
var is_selected: bool = false
|
||||
var hover_tween: Tween
|
||||
|
||||
func _ready():
|
||||
if image != null and has_node("%Texture"):
|
||||
$%Texture.texture_normal = image
|
||||
if image != null and has_node("%TextureButton"):
|
||||
$%TextureButton.texture_normal = image
|
||||
|
||||
func _on_texture_pressed() -> void:
|
||||
on_tab_selected.emit(index)
|
||||
|
||||
func select():
|
||||
is_selected = true
|
||||
_move_up()
|
||||
|
||||
func deselect():
|
||||
is_selected = false
|
||||
_move_down()
|
||||
|
||||
func _move_up():
|
||||
if hover_tween: hover_tween.kill()
|
||||
hover_tween = create_tween()
|
||||
hover_tween.tween_property(texture_button, "position:y", -bob_height, duration).set_trans(Tween.TRANS_SINE)
|
||||
|
||||
func _move_down():
|
||||
if hover_tween: hover_tween.kill()
|
||||
var exit_tween = create_tween()
|
||||
exit_tween.tween_property(texture_button, "position:y", 0, duration).set_trans(Tween.TRANS_QUAD)
|
||||
|
||||
@@ -4,17 +4,19 @@
|
||||
[ext_resource type="Texture2D" uid="uid://ce1u34fp1h2o5" path="res://core/game_menu/assets/page_1/ticket1.png" id="2_giv8b"]
|
||||
|
||||
[node name="GameMenuTab" type="Control" unique_id=2026548604]
|
||||
custom_minimum_size = Vector2(196, 408)
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
anchor_right = 0.10208333
|
||||
anchor_bottom = 0.40648147
|
||||
script = ExtResource("1_5bcha")
|
||||
image = ExtResource("2_giv8b")
|
||||
|
||||
[node name="Texture" type="TextureButton" parent="." unique_id=1234672875]
|
||||
[node name="TextureButton" type="TextureButton" parent="." unique_id=1234672875]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 0
|
||||
layout_mode = 1
|
||||
offset_right = 196.0
|
||||
offset_bottom = 438.0
|
||||
texture_normal = ExtResource("2_giv8b")
|
||||
stretch_mode = 5
|
||||
|
||||
[connection signal="pressed" from="Texture" to="." method="_on_texture_pressed"]
|
||||
[connection signal="pressed" from="TextureButton" to="." method="_on_texture_pressed"]
|
||||
|
||||
38
core/game_menu/hoover_tween.gd
Normal file
38
core/game_menu/hoover_tween.gd
Normal file
@@ -0,0 +1,38 @@
|
||||
extends Node
|
||||
|
||||
|
||||
@export_group("Settings")
|
||||
@export var always_active: bool = false
|
||||
@export var detector_node: Control
|
||||
@export var visual_node: Control
|
||||
@export var scale_amount: Vector2 = Vector2(1.1, 1.1)
|
||||
@export var duration: float = 0.5
|
||||
|
||||
var hover_tween: Tween
|
||||
|
||||
func _ready():
|
||||
if not detector_node or not visual_node:
|
||||
return
|
||||
|
||||
if always_active:
|
||||
hover_tween = create_tween().set_loops()
|
||||
hover_tween.tween_property(visual_node, "scale", scale_amount, duration).set_trans(Tween.TRANS_SINE)
|
||||
hover_tween.tween_property(visual_node, "scale", Vector2.ONE, duration).set_trans(Tween.TRANS_SINE)
|
||||
return
|
||||
|
||||
detector_node.mouse_entered.connect(_on_mouse_entered)
|
||||
detector_node.mouse_exited.connect(_on_mouse_exited)
|
||||
|
||||
|
||||
func _on_mouse_entered():
|
||||
if hover_tween: hover_tween.kill()
|
||||
|
||||
hover_tween = create_tween().set_loops()
|
||||
hover_tween.tween_property(visual_node, "scale", scale_amount, duration).set_trans(Tween.TRANS_SINE)
|
||||
hover_tween.tween_property(visual_node, "scale", Vector2.ONE, duration).set_trans(Tween.TRANS_SINE)
|
||||
|
||||
func _on_mouse_exited():
|
||||
if hover_tween: hover_tween.kill()
|
||||
|
||||
var exit_tween = create_tween()
|
||||
exit_tween.tween_property(visual_node, "scale", Vector2.ONE, 0.2).set_trans(Tween.TRANS_QUAD)
|
||||
1
core/game_menu/hoover_tween.gd.uid
Normal file
1
core/game_menu/hoover_tween.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://ryxh3nm7ayvf
|
||||
6
core/game_menu/hoover_tween.tscn
Normal file
6
core/game_menu/hoover_tween.tscn
Normal file
@@ -0,0 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://dxun0jk5t0n6"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://ryxh3nm7ayvf" path="res://core/game_menu/hoover_tween.gd" id="1_gmaf4"]
|
||||
|
||||
[node name="HooverTween" type="Node" unique_id=160227524]
|
||||
script = ExtResource("1_gmaf4")
|
||||
29
core/game_menu/option_menu.gd
Normal file
29
core/game_menu/option_menu.gd
Normal file
@@ -0,0 +1,29 @@
|
||||
extends Control
|
||||
|
||||
@onready var play_button: TextureButton = $%PlayButton
|
||||
@onready var resume_button: TextureButton = $%ResumeButton
|
||||
|
||||
func _ready() -> void:
|
||||
GameState.on_game_paused.connect(_on_game_paused)
|
||||
GameState.on_game_resumed.connect(_on_game_resumed)
|
||||
resume_button.hide()
|
||||
|
||||
func _on_play_button_pressed() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
func _on_resume_button_pressed() -> void:
|
||||
GameState.resume_game()
|
||||
|
||||
func _on_save_button_pressed() -> void:
|
||||
GameState.save_game()
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
GameState.quit_game()
|
||||
|
||||
func _on_game_paused() -> void:
|
||||
play_button.hide()
|
||||
resume_button.show()
|
||||
|
||||
func _on_game_resumed() -> void:
|
||||
play_button.show()
|
||||
resume_button.hide()
|
||||
1
core/game_menu/option_menu.gd.uid
Normal file
1
core/game_menu/option_menu.gd.uid
Normal file
@@ -0,0 +1 @@
|
||||
uid://cvrjr02dpnafm
|
||||
@@ -1,5 +1,6 @@
|
||||
[gd_scene format=3 uid="uid://cxf8s80ivwj1p"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cvrjr02dpnafm" path="res://core/game_menu/option_menu.gd" id="1_cd2sv"]
|
||||
[ext_resource type="Texture2D" uid="uid://b4nymq3n3468g" path="res://core/game_menu/assets/page_3/play_button.png" id="1_xquiw"]
|
||||
[ext_resource type="Texture2D" uid="uid://dd1exrppb6bjq" path="res://core/game_menu/assets/page_3/resume_button.png" id="2_htoi2"]
|
||||
[ext_resource type="Texture2D" uid="uid://cmhx3mscwrwft" path="res://core/game_menu/assets/page_3/save_button.png" id="3_vwpol"]
|
||||
@@ -8,6 +9,7 @@
|
||||
[node name="OptionMenu" type="Control" unique_id=1055457221]
|
||||
layout_mode = 3
|
||||
anchors_preset = 0
|
||||
script = ExtResource("1_cd2sv")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="." unique_id=508055524]
|
||||
layout_mode = 1
|
||||
@@ -15,11 +17,13 @@ offset_right = 303.0
|
||||
offset_bottom = 373.0
|
||||
|
||||
[node name="PlayButton" type="TextureButton" parent="VBoxContainer" unique_id=46341665]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("1_xquiw")
|
||||
stretch_mode = 5
|
||||
|
||||
[node name="ResumeButton" type="TextureButton" parent="VBoxContainer" unique_id=814859927]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("2_htoi2")
|
||||
stretch_mode = 5
|
||||
@@ -33,3 +37,8 @@ stretch_mode = 5
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("4_cd2sv")
|
||||
stretch_mode = 5
|
||||
|
||||
[connection signal="pressed" from="VBoxContainer/PlayButton" to="." method="_on_play_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/ResumeButton" to="." method="_on_resume_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/SaveButton" to="." method="_on_save_button_pressed"]
|
||||
[connection signal="pressed" from="VBoxContainer/QuitButton" to="." method="_on_quit_button_pressed"]
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
[ext_resource type="Texture2D" uid="uid://bv07xhpe3kh0r" path="res://core/game_menu/assets/page_1/customizecolor-5.png" id="6_dxnpq"]
|
||||
[ext_resource type="Texture2D" uid="uid://cryqbi1av2x1c" path="res://core/game_menu/assets/page_1/customizecolor.png" id="7_d1sdr"]
|
||||
[ext_resource type="Texture2D" uid="uid://d4l5ih723j3md" path="res://core/game_menu/assets/page_1/customizecolor-2.png" id="8_tuh6m"]
|
||||
[ext_resource type="Texture2D" uid="uid://clnfehvvft2vc" path="res://core/game_menu/assets/page_1/freccetta-1.png" id="9_puip6"]
|
||||
|
||||
[node name="TrainSelector" type="VBoxContainer" unique_id=1039769375]
|
||||
offset_right = 568.0
|
||||
@@ -27,42 +28,36 @@ layout_mode = 2
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer2" unique_id=1364417494]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 18
|
||||
alignment = 1
|
||||
|
||||
[node name="ColorPicker" parent="HBoxContainer2/HBoxContainer" unique_id=59169767 instance=ExtResource("3_i2rs1")]
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("4_cfvtr")
|
||||
stretch_mode = 3
|
||||
size_flags_vertical = 4
|
||||
image = ExtResource("4_cfvtr")
|
||||
|
||||
[node name="ColorPicker2" parent="HBoxContainer2/HBoxContainer" unique_id=584054476 instance=ExtResource("3_i2rs1")]
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("5_jnto8")
|
||||
stretch_mode = 3
|
||||
size_flags_vertical = 4
|
||||
image = ExtResource("5_jnto8")
|
||||
|
||||
[node name="ColorPicker3" parent="HBoxContainer2/HBoxContainer" unique_id=889429149 instance=ExtResource("3_i2rs1")]
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("6_dxnpq")
|
||||
stretch_mode = 3
|
||||
size_flags_vertical = 4
|
||||
image = ExtResource("6_dxnpq")
|
||||
|
||||
[node name="ColorPicker4" parent="HBoxContainer2/HBoxContainer" unique_id=466686411 instance=ExtResource("3_i2rs1")]
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("7_d1sdr")
|
||||
stretch_mode = 3
|
||||
size_flags_vertical = 4
|
||||
image = ExtResource("7_d1sdr")
|
||||
|
||||
[node name="ColorPicker5" parent="HBoxContainer2/HBoxContainer" unique_id=675841518 instance=ExtResource("3_i2rs1")]
|
||||
layout_mode = 2
|
||||
stretch_mode = 3
|
||||
size_flags_vertical = 4
|
||||
|
||||
[node name="ColorPicker6" parent="HBoxContainer2/HBoxContainer" unique_id=1698412911 instance=ExtResource("3_i2rs1")]
|
||||
layout_mode = 2
|
||||
texture_normal = ExtResource("8_tuh6m")
|
||||
stretch_mode = 3
|
||||
size_flags_vertical = 4
|
||||
image = ExtResource("8_tuh6m")
|
||||
|
||||
[node name="ArrowButtonRight" parent="HBoxContainer2" unique_id=68298624 instance=ExtResource("2_puip6")]
|
||||
layout_mode = 2
|
||||
flip_h = true
|
||||
image = ExtResource("9_puip6")
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
extends Node
|
||||
|
||||
@warning_ignore("unused_signal")
|
||||
signal on_game_paused
|
||||
@warning_ignore("unused_signal")
|
||||
signal on_game_resumed
|
||||
|
||||
const SAVE_PATH: String = "user://savegame.json"
|
||||
|
||||
var save_data: SaveGameData = SaveGameData.new()
|
||||
@@ -30,3 +35,12 @@ func load_game() -> void:
|
||||
save_data = SaveGameData.from_dictionary(json.data)
|
||||
|
||||
is_loaded = true
|
||||
|
||||
func pause_game() -> void:
|
||||
get_tree().paused = true
|
||||
|
||||
func resume_game() -> void:
|
||||
get_tree().paused = false
|
||||
|
||||
func quit_game() -> void:
|
||||
get_tree().quit()
|
||||
|
||||
Reference in New Issue
Block a user