added start menu and wait screen

This commit is contained in:
Lexi Quinn 2024-04-03 00:25:59 +11:00
parent 5f9db2d250
commit dd5618e709
14 changed files with 269 additions and 23 deletions

BIN
Assets/please_wait.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dbvhhwhqxo8ee"
path="res://.godot/imported/please_wait.png-6e953cab0e5e0495acea934f5355c058.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/please_wait.png"
dest_files=["res://.godot/imported/please_wait.png-6e953cab0e5e0495acea934f5355c058.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
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/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

View File

@ -3,13 +3,10 @@ extends PanelContainer
@export var profile_name: LineEdit
@export var enter_button: TextureButton
var save: SaveFile
func _ready() -> void:
save = SaveFile.load_profile_from_disk()
if save.catfish_name:
profile_name.text = save.catfish_name
if Data.save_file.catfish_name:
profile_name.text = Data.save_file.catfish_name
enter_button.visible = true
@ -19,12 +16,11 @@ func _on_texture_button_pressed() -> void:
func load_game() -> void:
if profile_name.text.length() > 0:
save.catfish_name = profile_name.text
save.save_to_disk()
Data.save_file.catfish_name = profile_name.text
get_tree().change_scene_to_file("res://Quinnsoft94/desktop.tscn")
func _on_line_edit_text_submitted(new_text: String) -> void:
func _on_line_edit_text_submitted(_new_text: String) -> void:
load_game()

View File

@ -6,8 +6,11 @@ signal open_message()
@export var fish_name_label: Label
@export var message_label: Label
var fish: FishProfile
func setup(profile: FishProfile, message: String):
fish = profile
pfp.texture = profile.picture
fish_name_label.text = profile.fish_name
message_label.text = message

View File

@ -2,9 +2,10 @@ class_name MessageMenu extends ScrollContainer
@export var message_preview_scene: PackedScene
@export var vbox: VBoxContainer
var save: SaveFile
func _ready() -> void:
var message = message_preview_scene.instantiate() as MessagePreview
vbox.add_child(message)
for profile: FishProfile in Data.save_file.accepted_fish:
var message = message_preview_scene.instantiate() as MessagePreview
message.setup(profile, "send a first message to " + str(profile.fish_name) + "!")
vbox.add_child(message)

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=19 format=3 uid="uid://wa62w2wb4pmr"]
[gd_scene load_steps=21 format=3 uid="uid://wa62w2wb4pmr"]
[ext_resource type="Script" path="res://Menus/PlentifulFish/application.gd" id="1_yl22y"]
[ext_resource type="PackedScene" uid="uid://dge7ymn0yd7ry" path="res://Menus/Swipe/fish_card.tscn" id="2_uajjj"]
@ -7,6 +7,7 @@
[ext_resource type="Resource" uid="uid://co03mjgi5q1xh" path="res://Fish/Goldfish/goldfish.tres" id="5_g7gvi"]
[ext_resource type="Resource" uid="uid://dun2uls53mmbq" path="res://Fish/Fishball/fishball.tres" id="6_6w8p5"]
[ext_resource type="Texture2D" uid="uid://06lxb843ndgp" path="res://Assets/ocean_bg.png" id="7_o2jv7"]
[ext_resource type="Texture2D" uid="uid://dbvhhwhqxo8ee" path="res://Assets/please_wait.png" id="7_uxgnr"]
[ext_resource type="Texture2D" uid="uid://co5knl5f3lui3" path="res://Assets/catfish.png" id="8_7dnbn"]
[ext_resource type="StyleBox" uid="uid://bhwii0745mi6s" path="res://Assets/darkpanel.tres" id="9_d6aw3"]
[ext_resource type="Texture2D" uid="uid://csowwaiokaooa" path="res://Assets/fish_icon.png" id="10_jb5xi"]
@ -19,11 +20,16 @@
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_th770"]
bg_color = Color(0.768627, 0.533333, 0.458824, 1)
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_17s8b"]
texture = ExtResource("7_uxgnr")
draw_center = false
[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_pap58"]
texture = ExtResource("7_uxgnr")
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_a7vhj"]
bg_color = Color(0.611765, 0.392157, 0.321569, 1)
[sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_hehe3"]
[node name="PoF" type="PanelContainer" node_paths=PackedStringArray("player_name_text", "contents_page")]
custom_minimum_size = Vector2(600, 680)
anchors_preset = 5
@ -40,6 +46,8 @@ fish_card_scene = ExtResource("2_uajjj")
messages_scene = ExtResource("3_42fn6")
fish_profiles = Array[Resource("res://Resources/fish_profile.gd")]([ExtResource("4_tkrdy"), ExtResource("5_g7gvi"), ExtResource("6_6w8p5")])
contents_page = NodePath("VBoxContainer/Content")
empty_panel = SubResource("StyleBoxTexture_17s8b")
wait_panel = SubResource("StyleBoxTexture_pap58")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 2
@ -75,9 +83,9 @@ text = "cool name"
vertical_alignment = 1
[node name="Content" type="PanelContainer" parent="VBoxContainer"]
texture_filter = 1
layout_mode = 2
size_flags_vertical = 3
theme_override_styles/panel = SubResource("StyleBoxEmpty_hehe3")
[node name="Footer" type="PanelContainer" parent="VBoxContainer"]
layout_mode = 2

View File

@ -7,8 +7,9 @@ class_name Application extends PanelContainer
@export var fish_profiles: Array[FishProfile]
@export var discarded_fish_profiles: Array[FishProfile]
@export var contents_page: Control
@export var empty_panel: StyleBoxTexture
@export var wait_panel: StyleBoxTexture
var has_current_fish: bool = false
var save_file: SaveFile
var current_card: int = 0
var window: DEWindow
@ -17,14 +18,29 @@ func setup_window_integration():
pass
func set_wait_message(enable: bool) -> void:
match enable:
true:
contents_page.add_theme_stylebox_override("panel", wait_panel)
false:
contents_page.add_theme_stylebox_override("panel", empty_panel)
func _ready() -> void:
player_name_text.text = save_file.catfish_name
player_name_text.text = Data.save_file.catfish_name
var fishes: Array[FishProfile] = []
for fish: FishProfile in fish_profiles:
if !Data.save_file.accepted_fish.has(fish):
fishes.append(fish)
fish_profiles = fishes
_on_fish_pressed()
func load_profile() -> void:
if has_current_fish or fish_profiles.size() <= current_card:
if fish_profiles.size() <= current_card:
set_wait_message(true)
return
set_wait_message(false)
var fish_card = fish_card_scene.instantiate() as FishCard
fish_card.set_display(fish_profiles[current_card])
fish_card.swiped.connect(process_fish_profile.bind(fish_card))
@ -35,8 +51,8 @@ func load_profile() -> void:
func process_fish_profile(outcome: bool, card: FishCard):
current_card += 1
has_current_fish = false
if outcome:
save_file.accepted_fish.append(card.profile)
if outcome and !Data.save_file.accepted_fish.has(card.profile):
Data.save_file.accepted_fish.append(card.profile)
else:
discarded_fish_profiles.append(card.profile)
if discarded_fish_profiles.size() > 0 and current_card >= fish_profiles.size():
@ -50,6 +66,8 @@ func recycle_profiles() -> void:
func _on_fish_pressed() -> void:
if has_current_fish:
return
for node: Node in contents_page.get_children():
node.queue_free()
load_profile()
@ -57,6 +75,7 @@ func _on_fish_pressed() -> void:
func _on_messages_pressed() -> void:
has_current_fish = false
set_wait_message(false)
for node: Node in contents_page.get_children():
node.queue_free()
var messages: MessageMenu = messages_scene.instantiate() as MessageMenu
@ -65,5 +84,6 @@ func _on_messages_pressed() -> void:
func _on_profile_pressed() -> void:
has_current_fish = false
set_wait_message(false)
for node: Node in contents_page.get_children():
node.queue_free()

View File

@ -19,6 +19,7 @@ func _on_no_pressed() -> void:
tween.set_trans(Tween.TRANS_CUBIC)
var dest: Vector2 = position + Vector2(-600, 0)
tween.tween_property(self, "position", dest, 0.6)
tween.tween_callback(set_visible.bind(false))
tween.tween_callback(func(): swiped.emit(false))
tween.tween_callback(queue_free)
@ -29,5 +30,6 @@ func _on_yes_pressed() -> void:
tween.set_trans(Tween.TRANS_CUBIC)
var dest: Vector2 = position + Vector2(600, 0)
tween.tween_property(self, "position", dest, 0.6)
tween.tween_callback(set_visible.bind(false))
tween.tween_callback(func(): swiped.emit(true))
tween.tween_callback(queue_free)

View File

@ -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()

View File

@ -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"]

View File

@ -51,6 +51,7 @@ func minimize():
func close():
closed.emit()
Data.save()
queue_free()

15
data.gd Normal file
View File

@ -0,0 +1,15 @@
extends Node
var save_file: SaveFile
func _ready() -> void:
save_file = SaveFile.load_profile_from_disk()
func save():
save_file.save_to_disk()
func reset_fish():
save_file.accepted_fish = []

102
export_presets.cfg Normal file
View File

@ -0,0 +1,102 @@
[preset.0]
name="Linux/X11"
platform="Linux/X11"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../fishfest2024/Linux/fishbowl.x86_64"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
[preset.0.options]
custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=1
binary_format/embed_pck=true
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
binary_format/architecture="x86_64"
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="#!/usr/bin/env bash
export DISPLAY=:0
unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\"
\"{temp_dir}/{exe_name}\" {cmd_args}"
ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash
kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\")
rm -rf \"{temp_dir}\""
[preset.1]
name="Windows Desktop"
platform="Windows Desktop"
runnable=true
dedicated_server=false
custom_features=""
export_filter="all_resources"
include_filter=""
exclude_filter=""
export_path="../../fishfest2024/Windows/fishbowl.exe"
encryption_include_filters=""
encryption_exclude_filters=""
encrypt_pck=false
encrypt_directory=false
[preset.1.options]
custom_template/debug=""
custom_template/release=""
debug/export_console_wrapper=1
binary_format/embed_pck=false
texture_format/bptc=true
texture_format/s3tc=true
texture_format/etc=false
texture_format/etc2=false
binary_format/architecture="x86_64"
codesign/enable=false
codesign/timestamp=true
codesign/timestamp_server_url=""
codesign/digest_algorithm=1
codesign/description=""
codesign/custom_options=PackedStringArray()
application/modify_resources=true
application/icon=""
application/console_wrapper_icon=""
application/icon_interpolation=4
application/file_version=""
application/product_version=""
application/company_name=""
application/product_name=""
application/file_description=""
application/copyright=""
application/trademarks=""
application/export_angle=0
ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22"
ssh_remote_deploy/extra_args_ssh=""
ssh_remote_deploy/extra_args_scp=""
ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}'
$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}'
$trigger = New-ScheduledTaskTrigger -Once -At 00:00
$settings = New-ScheduledTaskSettingsSet
$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings
Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true
Start-ScheduledTask -TaskName godot_remote_debug
while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 }
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue"
ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue
Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue
Remove-Item -Recurse -Force '{temp_dir}'"

View File

@ -14,6 +14,10 @@ config/name="Fishjam"
run/main_scene="res://Menus/MainMenu/main_menu.tscn"
config/features=PackedStringArray("4.2", "GL Compatibility")
[autoload]
Data="*res://data.gd"
[debug]
gdscript/warnings/inferred_declaration=2