update main menu
This commit is contained in:
@@ -4,12 +4,9 @@
|
|||||||
[ext_resource type="PackedScene" uid="uid://2tqofxxxnvhv" path="res://core/main_scene_ui/icon_button.tscn" id="1_ucnyb"]
|
[ext_resource type="PackedScene" uid="uid://2tqofxxxnvhv" path="res://core/main_scene_ui/icon_button.tscn" id="1_ucnyb"]
|
||||||
|
|
||||||
[node name="AudioPlayer" type="Control" unique_id=425192018]
|
[node name="AudioPlayer" type="Control" unique_id=425192018]
|
||||||
custom_minimum_size = Vector2(292, 142)
|
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchor_right = 0.15208334
|
anchor_right = 0.15208334
|
||||||
anchor_bottom = 0.13148148
|
anchor_bottom = 0.10925926
|
||||||
offset_right = -292.0
|
|
||||||
offset_bottom = -142.0
|
|
||||||
script = ExtResource("1_i2mrl")
|
script = ExtResource("1_i2mrl")
|
||||||
metadata/_edit_use_anchors_ = true
|
metadata/_edit_use_anchors_ = true
|
||||||
|
|
||||||
@@ -20,6 +17,7 @@ anchor_right = 1.0
|
|||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
|
metadata/_edit_use_anchors_ = true
|
||||||
|
|
||||||
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer" unique_id=1923985665]
|
[node name="VBoxContainer" type="VBoxContainer" parent="HBoxContainer" unique_id=1923985665]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
@@ -28,68 +26,63 @@ metadata/_edit_use_anchors_ = true
|
|||||||
[node name="TrackLabel" type="Label" parent="HBoxContainer/VBoxContainer" unique_id=1430240022]
|
[node name="TrackLabel" type="Label" parent="HBoxContainer/VBoxContainer" unique_id=1430240022]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
theme_override_font_sizes/font_size = 42
|
size_flags_horizontal = 4
|
||||||
|
theme_override_font_sizes/font_size = 24
|
||||||
text = "Test Test"
|
text = "Test Test"
|
||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
|
vertical_alignment = 1
|
||||||
|
|
||||||
[node name="IconButtonsRow" type="HBoxContainer" parent="HBoxContainer/VBoxContainer" unique_id=1734127019]
|
[node name="IconButtonsRow" type="HBoxContainer" parent="HBoxContainer/VBoxContainer" unique_id=1734127019]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_vertical = 3
|
|
||||||
alignment = 1
|
alignment = 1
|
||||||
|
|
||||||
[node name="PrevTrackIconButton" parent="HBoxContainer/VBoxContainer/IconButtonsRow" unique_id=1750448019 instance=ExtResource("1_ucnyb")]
|
[node name="PrevTrackIconButton" parent="HBoxContainer/VBoxContainer/IconButtonsRow" unique_id=1750448019 instance=ExtResource("1_ucnyb")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
custom_minimum_size = Vector2(80, 80)
|
custom_minimum_size = Vector2(80, 80)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 0
|
|
||||||
size_flags_vertical = 3
|
|
||||||
|
|
||||||
[node name="Texture" parent="HBoxContainer/VBoxContainer/IconButtonsRow/PrevTrackIconButton" index="0" unique_id=1071359322]
|
[node name="Texture" parent="HBoxContainer/VBoxContainer/IconButtonsRow/PrevTrackIconButton" index="0" unique_id=1071359322]
|
||||||
custom_minimum_size = Vector2(80, 80)
|
custom_minimum_size = Vector2(80, 80)
|
||||||
anchor_left = 0.0
|
anchor_left = 0.0
|
||||||
anchor_top = 0.24999991
|
anchor_top = 0.11538447
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 0.7499999
|
anchor_bottom = 0.88461524
|
||||||
offset_left = 116.66667
|
offset_left = 116.66667
|
||||||
offset_top = 108.14813
|
offset_top = 122.14813
|
||||||
offset_right = -116.666664
|
offset_right = -116.666664
|
||||||
offset_bottom = -108.14813
|
offset_bottom = -122.14813
|
||||||
|
|
||||||
[node name="PlayPauseIconButton" parent="HBoxContainer/VBoxContainer/IconButtonsRow" unique_id=1533336956 instance=ExtResource("1_ucnyb")]
|
[node name="PlayPauseIconButton" parent="HBoxContainer/VBoxContainer/IconButtonsRow" unique_id=1533336956 instance=ExtResource("1_ucnyb")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
custom_minimum_size = Vector2(80, 80)
|
custom_minimum_size = Vector2(80, 80)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 0
|
|
||||||
size_flags_vertical = 3
|
|
||||||
|
|
||||||
[node name="Texture" parent="HBoxContainer/VBoxContainer/IconButtonsRow/PlayPauseIconButton" index="0" unique_id=1071359322]
|
[node name="Texture" parent="HBoxContainer/VBoxContainer/IconButtonsRow/PlayPauseIconButton" index="0" unique_id=1071359322]
|
||||||
custom_minimum_size = Vector2(80, 80)
|
custom_minimum_size = Vector2(80, 80)
|
||||||
anchor_left = 0.0
|
anchor_left = 0.0
|
||||||
anchor_top = 0.24999991
|
anchor_top = 0.11538447
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 0.7499999
|
anchor_bottom = 0.88461524
|
||||||
offset_left = 116.66667
|
offset_left = 116.66667
|
||||||
offset_top = 108.14813
|
offset_top = 122.14813
|
||||||
offset_right = -116.666664
|
offset_right = -116.666664
|
||||||
offset_bottom = -108.14813
|
offset_bottom = -122.14813
|
||||||
|
|
||||||
[node name="NextTrackIconButton" parent="HBoxContainer/VBoxContainer/IconButtonsRow" unique_id=2108379455 instance=ExtResource("1_ucnyb")]
|
[node name="NextTrackIconButton" parent="HBoxContainer/VBoxContainer/IconButtonsRow" unique_id=2108379455 instance=ExtResource("1_ucnyb")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
custom_minimum_size = Vector2(80, 80)
|
custom_minimum_size = Vector2(80, 80)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 0
|
|
||||||
size_flags_vertical = 3
|
|
||||||
|
|
||||||
[node name="Texture" parent="HBoxContainer/VBoxContainer/IconButtonsRow/NextTrackIconButton" index="0" unique_id=1071359322]
|
[node name="Texture" parent="HBoxContainer/VBoxContainer/IconButtonsRow/NextTrackIconButton" index="0" unique_id=1071359322]
|
||||||
custom_minimum_size = Vector2(80, 80)
|
custom_minimum_size = Vector2(80, 80)
|
||||||
anchor_left = 0.0
|
anchor_left = 0.0
|
||||||
anchor_top = 0.24999991
|
anchor_top = 0.11538447
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 0.7499999
|
anchor_bottom = 0.88461524
|
||||||
offset_left = 116.66667
|
offset_left = 116.66667
|
||||||
offset_top = 108.14813
|
offset_top = 122.14813
|
||||||
offset_right = -116.666664
|
offset_right = -116.666664
|
||||||
offset_bottom = -108.14813
|
offset_bottom = -122.14813
|
||||||
|
|
||||||
[node name="VBoxContainer2" type="VBoxContainer" parent="HBoxContainer" unique_id=1843266535]
|
[node name="VBoxContainer2" type="VBoxContainer" parent="HBoxContainer" unique_id=1843266535]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ class_name IconButton
|
|||||||
|
|
||||||
signal on_pressed
|
signal on_pressed
|
||||||
|
|
||||||
|
@export var data: String
|
||||||
@export var image: Texture:
|
@export var image: Texture:
|
||||||
set(value):
|
set(value):
|
||||||
image = value
|
image = value
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ anchor_bottom = 1.0
|
|||||||
grow_horizontal = 2
|
grow_horizontal = 2
|
||||||
grow_vertical = 2
|
grow_vertical = 2
|
||||||
script = ExtResource("1_r8gxt")
|
script = ExtResource("1_r8gxt")
|
||||||
|
image = ExtResource("1_upldh")
|
||||||
|
|
||||||
[node name="Texture" type="TextureRect" parent="." unique_id=1071359322]
|
[node name="Texture" type="TextureRect" parent="." unique_id=1071359322]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
extends HBoxContainer
|
extends HBoxContainer
|
||||||
|
|
||||||
signal on_option_changed
|
signal on_option_changed(data: String)
|
||||||
|
|
||||||
@onready var current_icon_button: IconButton
|
@onready var current_icon_button: IconButton
|
||||||
@onready var icon_buttons_options: Array[IconButton]
|
@onready var icon_buttons_options: Array[IconButton]
|
||||||
@@ -23,7 +23,8 @@ func _on_icon_pressed_changed(in_icon_button: IconButton):
|
|||||||
for icon_button in icon_buttons_options:
|
for icon_button in icon_buttons_options:
|
||||||
if icon_button == in_icon_button:
|
if icon_button == in_icon_button:
|
||||||
current_icon_button.image = in_icon_button.image
|
current_icon_button.image = in_icon_button.image
|
||||||
on_option_changed.emit()
|
current_icon_button.data = in_icon_button.data
|
||||||
|
on_option_changed.emit(icon_button.data)
|
||||||
break
|
break
|
||||||
hide_options()
|
hide_options()
|
||||||
|
|
||||||
@@ -33,14 +34,15 @@ func on_current_icon_button_pressed() -> void:
|
|||||||
hide_options()
|
hide_options()
|
||||||
else:
|
else:
|
||||||
show_options()
|
show_options()
|
||||||
is_menu_open = !is_menu_open
|
|
||||||
|
|
||||||
|
|
||||||
func show_options() -> void:
|
func show_options() -> void:
|
||||||
for icon_button in icon_buttons_options:
|
for icon_button in icon_buttons_options:
|
||||||
icon_button.show()
|
icon_button.show()
|
||||||
|
is_menu_open = true
|
||||||
|
|
||||||
|
|
||||||
func hide_options() -> void:
|
func hide_options() -> void:
|
||||||
for icon_button in icon_buttons_options:
|
for icon_button in icon_buttons_options:
|
||||||
icon_button.hide()
|
icon_button.hide()
|
||||||
|
is_menu_open = false
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
|
enum Weather {RAIN, SNOW}
|
||||||
|
|
||||||
@onready var game_menu: Control = $%GameMenu
|
@onready var game_menu: Control = $%GameMenu
|
||||||
|
|
||||||
func _on_menu_icon_button_on_pressed() -> void:
|
func _on_menu_icon_button_on_pressed() -> void:
|
||||||
@@ -13,3 +15,33 @@ func _on_photo_icon_button_on_pressed() -> void:
|
|||||||
func _on_collectible_icon_button_on_pressed() -> void:
|
func _on_collectible_icon_button_on_pressed() -> void:
|
||||||
game_menu.on_tab_pressed(1, true)
|
game_menu.on_tab_pressed(1, true)
|
||||||
game_menu.show()
|
game_menu.show()
|
||||||
|
|
||||||
|
|
||||||
|
func _on_time_of_day_row_on_option_changed(data: String) -> void:
|
||||||
|
match data:
|
||||||
|
"Sunrise":
|
||||||
|
UIEvents.time_option_item_changed.emit(0)
|
||||||
|
"Day":
|
||||||
|
UIEvents.time_option_item_changed.emit(1)
|
||||||
|
"Sunset":
|
||||||
|
UIEvents.time_option_item_changed.emit(2)
|
||||||
|
"Night":
|
||||||
|
UIEvents.time_option_item_changed.emit(3)
|
||||||
|
_:
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
func _on_weather_row_on_option_changed(data: String) -> void:
|
||||||
|
match data:
|
||||||
|
"Snow":
|
||||||
|
UIEvents.toggle_snow.emit(true)
|
||||||
|
"Rain":
|
||||||
|
UIEvents.toggle_rain.emit(true)
|
||||||
|
"Storm":
|
||||||
|
UIEvents.toggle_storm.emit(true)
|
||||||
|
"Wind":
|
||||||
|
UIEvents.toggle_wind.emit(true)
|
||||||
|
"Random":
|
||||||
|
pass
|
||||||
|
_:
|
||||||
|
pass
|
||||||
|
|||||||
@@ -30,15 +30,40 @@ grow_vertical = 0
|
|||||||
[node name="TimeOfDayRow" parent="VBoxContainer" unique_id=1734127019 instance=ExtResource("1_87dkt")]
|
[node name="TimeOfDayRow" parent="VBoxContainer" unique_id=1734127019 instance=ExtResource("1_87dkt")]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
|
[node name="IconButton2" parent="VBoxContainer/TimeOfDayRow" index="1" unique_id=638856991]
|
||||||
|
data = "Sunrise"
|
||||||
|
|
||||||
|
[node name="IconButton3" parent="VBoxContainer/TimeOfDayRow" index="2" unique_id=1662483962]
|
||||||
|
data = "Day"
|
||||||
|
|
||||||
|
[node name="IconButton4" parent="VBoxContainer/TimeOfDayRow" index="3" unique_id=1375190490]
|
||||||
|
data = "Sunset"
|
||||||
|
|
||||||
|
[node name="IconButton5" parent="VBoxContainer/TimeOfDayRow" index="4" unique_id=315412403]
|
||||||
|
data = "Night"
|
||||||
|
|
||||||
[node name="WeatherRow" parent="VBoxContainer" unique_id=1803637359 instance=ExtResource("1_87dkt")]
|
[node name="WeatherRow" parent="VBoxContainer" unique_id=1803637359 instance=ExtResource("1_87dkt")]
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
|
|
||||||
[node name="IconButton6" parent="VBoxContainer/WeatherRow" unique_id=1750448019 instance=ExtResource("1_fjauj")]
|
[node name="IconButton2" parent="VBoxContainer/WeatherRow" index="1" unique_id=638856991]
|
||||||
|
data = "Snow"
|
||||||
|
|
||||||
|
[node name="IconButton3" parent="VBoxContainer/WeatherRow" index="2" unique_id=1662483962]
|
||||||
|
data = "Rain"
|
||||||
|
|
||||||
|
[node name="IconButton4" parent="VBoxContainer/WeatherRow" index="3" unique_id=1375190490]
|
||||||
|
data = "Storm"
|
||||||
|
|
||||||
|
[node name="IconButton5" parent="VBoxContainer/WeatherRow" index="4" unique_id=315412403]
|
||||||
|
data = "Wind"
|
||||||
|
|
||||||
|
[node name="IconButton6" parent="VBoxContainer/WeatherRow" unique_id=218253485 instance=ExtResource("1_fjauj")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
visible = false
|
visible = false
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 0
|
size_flags_horizontal = 0
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
|
data = "Random"
|
||||||
|
|
||||||
[node name="MenuIconButton" parent="." unique_id=707872474 instance=ExtResource("1_fjauj")]
|
[node name="MenuIconButton" parent="." unique_id=707872474 instance=ExtResource("1_fjauj")]
|
||||||
layout_mode = 1
|
layout_mode = 1
|
||||||
@@ -84,16 +109,19 @@ anchor_left = 1.0
|
|||||||
anchor_top = 1.0
|
anchor_top = 1.0
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
anchor_bottom = 1.0
|
anchor_bottom = 1.0
|
||||||
offset_left = -292.0
|
offset_left = -146.0
|
||||||
offset_top = -142.0
|
offset_top = -57.0
|
||||||
offset_right = 0.0
|
offset_right = -146.0
|
||||||
offset_bottom = 0.0
|
offset_bottom = -57.0
|
||||||
grow_horizontal = 0
|
grow_horizontal = 0
|
||||||
grow_vertical = 0
|
grow_vertical = 0
|
||||||
radio = NodePath("../Radio")
|
radio = NodePath("../Radio")
|
||||||
|
|
||||||
|
[connection signal="on_option_changed" from="VBoxContainer/TimeOfDayRow" to="." method="_on_time_of_day_row_on_option_changed"]
|
||||||
|
[connection signal="on_option_changed" from="VBoxContainer/WeatherRow" to="." method="_on_weather_row_on_option_changed"]
|
||||||
[connection signal="on_pressed" from="MenuIconButton" to="." method="_on_menu_icon_button_on_pressed"]
|
[connection signal="on_pressed" from="MenuIconButton" to="." method="_on_menu_icon_button_on_pressed"]
|
||||||
[connection signal="on_pressed" from="CollectionOptions/PhotoIconButton" to="." method="_on_photo_icon_button_on_pressed"]
|
[connection signal="on_pressed" from="CollectionOptions/PhotoIconButton" to="." method="_on_photo_icon_button_on_pressed"]
|
||||||
[connection signal="on_pressed" from="CollectionOptions/CollectibleIconButton" to="." method="_on_collectible_icon_button_on_pressed"]
|
[connection signal="on_pressed" from="CollectionOptions/CollectibleIconButton" to="." method="_on_collectible_icon_button_on_pressed"]
|
||||||
|
|
||||||
|
[editable path="VBoxContainer/TimeOfDayRow"]
|
||||||
[editable path="VBoxContainer/WeatherRow"]
|
[editable path="VBoxContainer/WeatherRow"]
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ var current_track_index: int = 0
|
|||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
finished.connect(next_track)
|
finished.connect(next_track)
|
||||||
if !playlist.is_empty():
|
#if !playlist.is_empty():
|
||||||
play_track(0)
|
#play_track(0)
|
||||||
|
|
||||||
func play_track(index: int = current_track_index):
|
func play_track(index: int = current_track_index):
|
||||||
if playlist.is_empty():
|
if playlist.is_empty():
|
||||||
|
|||||||
@@ -176,7 +176,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 28.635147, 0)
|
|||||||
|
|
||||||
[node name="PhotoModeController" parent="cameras" unique_id=695158870 node_paths=PackedStringArray("rotation_target", "iso_camera") instance=ExtResource("50_57hhv")]
|
[node name="PhotoModeController" parent="cameras" unique_id=695158870 node_paths=PackedStringArray("rotation_target", "iso_camera") instance=ExtResource("50_57hhv")]
|
||||||
transform = Transform3D(0.57785755, -0.57709646, 0.5770964, 0, 0.7071067, 0.7071068, -0.8161376, -0.40860704, 0.40860695, 225, 290, 173.7)
|
transform = Transform3D(0.57785755, -0.57709646, 0.5770964, 0, 0.7071067, 0.7071068, -0.8161376, -0.40860704, 0.40860695, 225, 290, 173.7)
|
||||||
movement_bounds = AABB(-20, -20, 0, 40, 30, 0)
|
|
||||||
rotation_target = NodePath("../pivot")
|
rotation_target = NodePath("../pivot")
|
||||||
iso_camera = NodePath("../camera_iso")
|
iso_camera = NodePath("../camera_iso")
|
||||||
|
|
||||||
@@ -220,7 +219,6 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -91.191925, 0, 539.03174)
|
|||||||
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -312.19193, 0, 349.03174)
|
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -312.19193, 0, 349.03174)
|
||||||
|
|
||||||
[node name="Control" type="Control" parent="." unique_id=630650980]
|
[node name="Control" type="Control" parent="." unique_id=630650980]
|
||||||
visible = false
|
|
||||||
layout_mode = 3
|
layout_mode = 3
|
||||||
anchors_preset = 0
|
anchors_preset = 0
|
||||||
offset_right = 40.0
|
offset_right = 40.0
|
||||||
@@ -452,6 +450,7 @@ theme_override_colors/font_outline_color = Color(1, 1, 1, 1)
|
|||||||
text = "Update Rails"
|
text = "Update Rails"
|
||||||
|
|
||||||
[node name="MainMenuUi" parent="." unique_id=1359391222 instance=ExtResource("49_exdk1")]
|
[node name="MainMenuUi" parent="." unique_id=1359391222 instance=ExtResource("49_exdk1")]
|
||||||
|
mouse_filter = 2
|
||||||
|
|
||||||
[connection signal="toggled" from="Control/Snow" to="Control" method="_on_snow_toggled"]
|
[connection signal="toggled" from="Control/Snow" to="Control" method="_on_snow_toggled"]
|
||||||
[connection signal="toggled" from="Control/Rain" to="Control" method="_on_rain_toggled"]
|
[connection signal="toggled" from="Control/Rain" to="Control" method="_on_rain_toggled"]
|
||||||
|
|||||||
Reference in New Issue
Block a user