added start menu and wait screen
This commit is contained in:
@ -7,6 +7,8 @@ class_name Desktop extends ColorRect
|
||||
@export var pof_icon: Texture
|
||||
@export var pof_scene: PackedScene
|
||||
|
||||
@export var start_menu: PanelContainer
|
||||
|
||||
var window_scene = preload("res://Quinnsoft94/program_window.tscn")
|
||||
|
||||
|
||||
@ -29,7 +31,6 @@ func spawn_program(program_scene, icon):
|
||||
var window = window_scene.instantiate() as DEWindow
|
||||
window_holder.add_child(window)
|
||||
var program = program_scene.instantiate() as Application
|
||||
program.save_file = SaveFile.load_profile_from_disk()
|
||||
add_child(program)
|
||||
window.set_program(program)
|
||||
var button = Button.new()
|
||||
@ -44,3 +45,22 @@ func _ready() -> void:
|
||||
add_desktop_icon(pof_icon, "Plentiful Fish", spawn_program.bind(pof_scene, pof_icon))
|
||||
#add_desktop_icon(uno_icon, "Uno", spawn_program.bind(uno_scene, uno_icon))
|
||||
#add_desktop_icon(snakes_and_ladders_icon, "Snakes and Ladders", spawn_program.bind(snakes_and_ladders_scene, snakes_and_ladders_icon))
|
||||
|
||||
|
||||
func _on_start_button_pressed() -> void:
|
||||
start_menu.visible = !start_menu.visible
|
||||
|
||||
|
||||
func _on_save_button_pressed() -> void:
|
||||
Data.save()
|
||||
start_menu.visible = false
|
||||
|
||||
|
||||
func _on_reset_save_button_pressed() -> void:
|
||||
Data.reset_fish()
|
||||
start_menu.visible = false
|
||||
|
||||
|
||||
func _on_quit_button_pressed() -> void:
|
||||
Data.save()
|
||||
get_tree().quit()
|
||||
|
@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=9 format=3 uid="uid://ddtcomingnoto"]
|
||||
[gd_scene load_steps=10 format=3 uid="uid://ddtcomingnoto"]
|
||||
|
||||
[ext_resource type="Script" path="res://Quinnsoft94/desktop.gd" id="1_7gagq"]
|
||||
[ext_resource type="Theme" uid="uid://cfsgvdm1la7nr" path="res://Quinnsoft94/quinnsoft94.tres" id="1_ipi37"]
|
||||
@ -6,10 +6,11 @@
|
||||
[ext_resource type="Texture2D" uid="uid://6y2jj10wkmu8" path="res://Assets/plentifulfish.png" id="3_acswl"]
|
||||
[ext_resource type="PackedScene" uid="uid://wa62w2wb4pmr" path="res://Menus/PlentifulFish/PoF.tscn" id="4_o0r25"]
|
||||
[ext_resource type="Texture2D" uid="uid://3ryvswnvtgpr" path="res://Assets/StartButton/start_button.png" id="5_0n3qh"]
|
||||
[ext_resource type="Texture2D" uid="uid://c80yh0lidbpn0" path="res://Assets/OffButton/off_button.png" id="5_c2v4l"]
|
||||
[ext_resource type="Texture2D" uid="uid://dp5oddddyocwu" path="res://Assets/StartButton/start_button_pushed.png" id="6_7cebq"]
|
||||
[ext_resource type="Texture2D" uid="uid://bhvbeyk2kv2lm" path="res://Assets/StartButton/start_button_hovered.png" id="7_uy8qo"]
|
||||
|
||||
[node name="PanelContainer" type="ColorRect" node_paths=PackedStringArray("window_holder", "taskbar", "desktop_icon_container")]
|
||||
[node name="PanelContainer" type="ColorRect" node_paths=PackedStringArray("window_holder", "taskbar", "desktop_icon_container", "start_menu")]
|
||||
texture_filter = 1
|
||||
anchors_preset = 15
|
||||
anchor_right = 1.0
|
||||
@ -25,6 +26,7 @@ taskbar = NodePath("PanelContainer/HBoxContainer/HBoxContainer")
|
||||
desktop_icon_container = NodePath("VBoxContainer")
|
||||
pof_icon = ExtResource("3_acswl")
|
||||
pof_scene = ExtResource("4_o0r25")
|
||||
start_menu = NodePath("StartMenu")
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="."]
|
||||
layout_mode = 2
|
||||
@ -45,6 +47,39 @@ grow_horizontal = 2
|
||||
grow_vertical = 2
|
||||
mouse_filter = 2
|
||||
|
||||
[node name="StartMenu" type="PanelContainer" parent="."]
|
||||
visible = false
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
anchor_top = 1.0
|
||||
anchor_bottom = 1.0
|
||||
offset_top = -100.0
|
||||
offset_right = 300.0
|
||||
offset_bottom = -40.0
|
||||
grow_vertical = 0
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="StartMenu"]
|
||||
layout_mode = 2
|
||||
|
||||
[node name="Button" type="Button" parent="StartMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "save game"
|
||||
alignment = 0
|
||||
|
||||
[node name="Button2" type="Button" parent="StartMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "reset save file"
|
||||
alignment = 0
|
||||
|
||||
[node name="Button3" type="Button" parent="StartMenu/VBoxContainer"]
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 4
|
||||
text = "quit"
|
||||
icon = ExtResource("5_c2v4l")
|
||||
alignment = 0
|
||||
|
||||
[node name="PanelContainer" type="PanelContainer" parent="."]
|
||||
layout_mode = 1
|
||||
anchors_preset = -1
|
||||
@ -91,3 +126,8 @@ text = "10:47pm"
|
||||
horizontal_alignment = 2
|
||||
vertical_alignment = 1
|
||||
script = ExtResource("1_vlwj3")
|
||||
|
||||
[connection signal="pressed" from="StartMenu/VBoxContainer/Button" to="." method="_on_save_button_pressed"]
|
||||
[connection signal="pressed" from="StartMenu/VBoxContainer/Button2" to="." method="_on_reset_save_button_pressed"]
|
||||
[connection signal="pressed" from="StartMenu/VBoxContainer/Button3" to="." method="_on_quit_button_pressed"]
|
||||
[connection signal="pressed" from="PanelContainer/HBoxContainer/MarginContainer/TextureButton" to="." method="_on_start_button_pressed"]
|
||||
|
@ -51,6 +51,7 @@ func minimize():
|
||||
|
||||
func close():
|
||||
closed.emit()
|
||||
Data.save()
|
||||
queue_free()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user