WIP: enhancing menu animations and adding predit roles

This commit is contained in:
betalars 2024-10-07 11:21:36 +02:00
parent 9566606bdc
commit 7f01336587
10 changed files with 987 additions and 159 deletions

BIN
src/import/interface-elements/cc-by-sa-nc.png (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://cnbhdfbtmci2b"
path="res://.godot/imported/cc-by-sa-nc.png-3d0bbadede093b950608759bc58e9246.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://import/interface-elements/cc-by-sa-nc.png"
dest_files=["res://.godot/imported/cc-by-sa-nc.png-3d0bbadede093b950608759bc58e9246.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

BIN
src/import/menu_music/Ambient 6.ogg (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -0,0 +1,19 @@
[remap]
importer="oggvorbisstr"
type="AudioStreamOggVorbis"
uid="uid://fej7yw25lgqy"
path="res://.godot/imported/Ambient 6.ogg-7d54683747f003d360aa52275d1fa2cc.oggvorbisstr"
[deps]
source_file="res://import/menu_music/Ambient 6.ogg"
dest_files=["res://.godot/imported/Ambient 6.ogg-7d54683747f003d360aa52275d1fa2cc.oggvorbisstr"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@ -1,22 +1,27 @@
extends Panel extends Panel
var has_stage: var has_stage: bool = false:
set(value): set(value):
value = has_stage has_stage = value
if is_node_ready(): if is_node_ready():
if has_stage: new_game_button.grab_focus()
new_game_button.disabled = not has_stage new_game_button.disabled = not has_stage
continue_button.disabled = not has_stage continue_button.disabled = not has_stage
load_game_button.disabled = not has_stage load_game_button.disabled = not has_stage
settings_button.disabled = not has_stage settings_button.disabled = not has_stage
credits_button.disabled = not has_stage
quit_button.disabled = not has_stage quit_button.disabled = not has_stage
signal start_game(savegame: SaveGame) signal start_game(savegame: SaveGame)
signal open_settings(new_game: bool) signal open_settings(new_game: bool)
signal roll_credits
@onready var new_game_button: Button = $PanelContainer/NewGameButton @onready var new_game_button: Button = $PanelContainer/NewGameButton
@onready var continue_button: Button = $PanelContainer/ContinueGameButton @onready var continue_button: Button = $PanelContainer/ContinueGameButton
@onready var load_game_button: Button = $PanelContainer/LoadGameButton @onready var load_game_button: Button = $PanelContainer/LoadGameButton
@onready var settings_button: Button = $PanelContainer/SettingsButton @onready var settings_button: MenuButton = $PanelContainer/SettingsButton
@onready var settings_popup: SettingsPopup = %SettingsPopup
@onready var credits_button: Button = $PanelContainer/CreditsButton
@onready var quit_button: Button = $PanelContainer/QuitButton @onready var quit_button: Button = $PanelContainer/QuitButton
@onready var save_game_handle: SaveGameHandle = %SaveGameHandle @onready var save_game_handle: SaveGameHandle = %SaveGameHandle
@ -30,11 +35,14 @@ var await_new_game: bool = false
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready() -> void: func _ready() -> void:
save_game_handle.picked.connect(_on_save_picked) save_game_handle.picked.connect(_on_save_picked)
new_game_button.pressed.connect(_on_new_game_pressed) continue_button.visible = save_game_handle.get_most_recent_save().current_room != 0
continue_button continue_button.pressed.connect(func(): start_game.emit(save_game_handle.get_most_recent_save()))
new_game_button.pressed.connect(func(): save_game_handle.pick_slot(true))
func _on_new_game_pressed(): load_game_button.pressed.connect(func(): save_game_handle.pick_slot(false))
save_game_handle.pick_slot(true) settings_button.get_popup().index_pressed.connect(settings_popup.show_settings)
quit_button.pressed.connect(get_tree().quit)
State.take_stage(self)
func _on_save_picked(save: SaveGame): func _on_save_picked(save: SaveGame):
start_game.emit(save) start_game.emit(save)

View File

@ -4,18 +4,23 @@ extends Node3D
@export_file(".tscn") var voluntary_room: String @export_file(".tscn") var voluntary_room: String
@export_file(".tscn") var study_room: String @export_file(".tscn") var study_room: String
@onready var loading_animation: AnimationTree = %MenuAnimationTree @onready var menu_animation: AnimationTree = %MenuAnimationTree
@onready var focus_forward = %"Main Menu"
var in_game = false
var current_loaded_room: Node3D var current_loaded_room: Node3D
var currently_loading_room: String = "": var currently_loading_room: String = "":
set(path): set(path):
if path != "": if path != "":
ResourceLoader.load_threaded_request(path, "PackedScene") ResourceLoader.load_threaded_request(path, "PackedScene")
loading_animation["parameters/conditions/loading_done"] = false menu_animation["parameters/conditions/loading_done"] = false
menu_animation["parameters/conditions/load_save"] = true
currently_loading_room = path currently_loading_room = path
else: else:
loading_animation["parameters/conditions/loading_done"] = true menu_animation["parameters/conditions/loading_done"] = true
menu_animation["parameters/conditions/load_save"] = false
# Called when the node enters the scene tree for the first time. # Called when the node enters the scene tree for the first time.
func _ready(): func _ready():

File diff suppressed because one or more lines are too long

View File

@ -1,10 +1,12 @@
[gd_scene load_steps=15 format=3 uid="uid://b51wdql4mby47"] [gd_scene load_steps=16 format=3 uid="uid://b51wdql4mby47"]
[ext_resource type="Theme" uid="uid://b056fn288p8ha" path="res://logic-scenes/themes/easy-handwriting.theme" id="1_2dg4n"] [ext_resource type="Theme" uid="uid://b056fn288p8ha" path="res://logic-scenes/themes/easy-handwriting.theme" id="1_2dg4n"]
[ext_resource type="Script" path="res://logic-scenes/main menu/main_menu.gd" id="2_rm576"] [ext_resource type="Script" path="res://logic-scenes/main menu/main_menu.gd" id="2_rm576"]
[ext_resource type="PackedScene" uid="uid://gmxenhavh1lp" path="res://logic-scenes/main menu/video_settings.tscn" id="3_f0dcd"] [ext_resource type="PackedScene" uid="uid://gmxenhavh1lp" path="res://logic-scenes/main menu/video_settings.tscn" id="3_f0dcd"]
[ext_resource type="Texture2D" uid="uid://d3ewjumh0b0g6" path="res://logic-scenes/main menu/logo.png" id="3_xb2np"] [ext_resource type="Texture2D" uid="uid://d3ewjumh0b0g6" path="res://logic-scenes/main menu/logo.png" id="3_xb2np"]
[ext_resource type="Script" path="res://dev-util/settings_popup.gd" id="4_k8jo0"]
[ext_resource type="PackedScene" uid="uid://dfhkfocy8axb8" path="res://logic-scenes/main menu/audio_settings.tscn" id="4_o07mg"] [ext_resource type="PackedScene" uid="uid://dfhkfocy8axb8" path="res://logic-scenes/main menu/audio_settings.tscn" id="4_o07mg"]
[ext_resource type="Script" path="res://tab_container.gd" id="5_lhfti"]
[ext_resource type="PackedScene" uid="uid://dxwqkxq6qjk7i" path="res://logic-scenes/main menu/gameplay_settings.tscn" id="6_p7ypt"] [ext_resource type="PackedScene" uid="uid://dxwqkxq6qjk7i" path="res://logic-scenes/main menu/gameplay_settings.tscn" id="6_p7ypt"]
[ext_resource type="PackedScene" uid="uid://chal0ioagspx0" path="res://logic-scenes/main menu/content_settings.tscn" id="7_pnd48"] [ext_resource type="PackedScene" uid="uid://chal0ioagspx0" path="res://logic-scenes/main menu/content_settings.tscn" id="7_pnd48"]
[ext_resource type="Script" path="res://logic-scenes/main menu/save_game_list.gd" id="8_o0cpj"] [ext_resource type="Script" path="res://logic-scenes/main menu/save_game_list.gd" id="8_o0cpj"]
@ -16,7 +18,7 @@ length = 0.001
tracks/0/type = "value" tracks/0/type = "value"
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
tracks/0/path = NodePath("../../Control/decoration:modulate") tracks/0/path = NodePath("../../Decoration/decoration:modulate")
tracks/0/interp = 1 tracks/0/interp = 1
tracks/0/loop_wrap = true tracks/0/loop_wrap = true
tracks/0/keys = { tracks/0/keys = {
@ -28,7 +30,7 @@ tracks/0/keys = {
tracks/1/type = "value" tracks/1/type = "value"
tracks/1/imported = false tracks/1/imported = false
tracks/1/enabled = true tracks/1/enabled = true
tracks/1/path = NodePath("../../Control/decoration:rotation") tracks/1/path = NodePath("../../Decoration/decoration:rotation")
tracks/1/interp = 1 tracks/1/interp = 1
tracks/1/loop_wrap = true tracks/1/loop_wrap = true
tracks/1/keys = { tracks/1/keys = {
@ -92,7 +94,7 @@ length = 2.0
tracks/0/type = "value" tracks/0/type = "value"
tracks/0/imported = false tracks/0/imported = false
tracks/0/enabled = true tracks/0/enabled = true
tracks/0/path = NodePath("../../Control/decoration:modulate") tracks/0/path = NodePath("../../Decoration/decoration:modulate")
tracks/0/interp = 1 tracks/0/interp = 1
tracks/0/loop_wrap = true tracks/0/loop_wrap = true
tracks/0/keys = { tracks/0/keys = {
@ -104,7 +106,7 @@ tracks/0/keys = {
tracks/1/type = "value" tracks/1/type = "value"
tracks/1/imported = false tracks/1/imported = false
tracks/1/enabled = true tracks/1/enabled = true
tracks/1/path = NodePath("../../Control/decoration:rotation") tracks/1/path = NodePath("../../Decoration/decoration:rotation")
tracks/1/interp = 1 tracks/1/interp = 1
tracks/1/loop_wrap = true tracks/1/loop_wrap = true
tracks/1/keys = { tracks/1/keys = {
@ -192,7 +194,7 @@ tracks/1/keys = {
tracks/2/type = "value" tracks/2/type = "value"
tracks/2/imported = false tracks/2/imported = false
tracks/2/enabled = true tracks/2/enabled = true
tracks/2/path = NodePath("../../Control/decoration:modulate") tracks/2/path = NodePath("../../Decoration/decoration:modulate")
tracks/2/interp = 1 tracks/2/interp = 1
tracks/2/loop_wrap = true tracks/2/loop_wrap = true
tracks/2/keys = { tracks/2/keys = {
@ -204,7 +206,7 @@ tracks/2/keys = {
tracks/3/type = "value" tracks/3/type = "value"
tracks/3/imported = false tracks/3/imported = false
tracks/3/enabled = true tracks/3/enabled = true
tracks/3/path = NodePath("../../Control/decoration:rotation") tracks/3/path = NodePath("../../Decoration/decoration:rotation")
tracks/3/interp = 2 tracks/3/interp = 2
tracks/3/loop_wrap = true tracks/3/loop_wrap = true
tracks/3/keys = { tracks/3/keys = {
@ -245,26 +247,6 @@ _data = {
"vanish": SubResource("Animation_a3iyq") "vanish": SubResource("Animation_a3iyq")
} }
[sub_resource type="GDScript" id="GDScript_mjmwc"]
script/source = "extends Popup
var has_stage:bool = false:
set(value):
has_stage = value
visible = has_stage
if has_stage:
$VBoxContainer/ConfirmOverwrite.grab_focus()
func _ready() -> void:
$VBoxContainer/ConfirmOverwrite.pressed.connect()
func on_confirm_pressed():
get_parent()._on_deletion_confirmed()
func on_cancel_pressed():
State.leave_stage(self)
"
[node name="Main Menu" type="Panel"] [node name="Main Menu" type="Panel"]
anchors_preset = 15 anchors_preset = 15
anchor_right = 1.0 anchor_right = 1.0
@ -323,11 +305,17 @@ popup/item_2/id = 2
popup/item_3/text = "Content Notes" popup/item_3/text = "Content Notes"
popup/item_3/id = 3 popup/item_3/id = 3
[node name="CreditsButton" type="Button" parent="PanelContainer"]
layout_mode = 2
tooltip_text = "Plays the Game Credits"
text = "Attribution"
[node name="QuitButton" type="Button" parent="PanelContainer"] [node name="QuitButton" type="Button" parent="PanelContainer"]
layout_mode = 2 layout_mode = 2
text = "quit" text = "quit"
[node name="SettingsPopup" type="PanelContainer" parent="."] [node name="SettingsPopup" type="PanelContainer" parent="."]
unique_name_in_owner = true
visible = false visible = false
self_modulate = Color(1, 1, 1, 0) self_modulate = Color(1, 1, 1, 0)
layout_mode = 1 layout_mode = 1
@ -343,6 +331,7 @@ offset_bottom = 335.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
scale = Vector2(1, 0.57) scale = Vector2(1, 0.57)
script = ExtResource("4_k8jo0")
[node name="AnimationPlayer" type="AnimationPlayer" parent="SettingsPopup"] [node name="AnimationPlayer" type="AnimationPlayer" parent="SettingsPopup"]
root_node = NodePath("../TabContainer/Video Settings") root_node = NodePath("../TabContainer/Video Settings")
@ -351,12 +340,12 @@ libraries = {
} }
autoplay = "RESET" autoplay = "RESET"
[node name="Control" type="Control" parent="SettingsPopup"] [node name="Decoration" type="Control" parent="SettingsPopup"]
layout_mode = 2 layout_mode = 2
size_flags_horizontal = 4 size_flags_horizontal = 4
size_flags_vertical = 4 size_flags_vertical = 4
[node name="decoration" type="PanelContainer" parent="SettingsPopup/Control"] [node name="decoration" type="PanelContainer" parent="SettingsPopup/Decoration"]
modulate = Color(1, 1, 1, 0) modulate = Color(1, 1, 1, 0)
layout_mode = 2 layout_mode = 2
offset_left = -374.0 offset_left = -374.0
@ -371,23 +360,28 @@ pivot_offset = Vector2(374, 378.5)
[node name="TabContainer" type="TabContainer" parent="SettingsPopup"] [node name="TabContainer" type="TabContainer" parent="SettingsPopup"]
modulate = Color(1, 1, 1, 0) modulate = Color(1, 1, 1, 0)
layout_mode = 2 layout_mode = 2
current_tab = 0 current_tab = 1
use_hidden_tabs_for_min_size = true use_hidden_tabs_for_min_size = true
script = ExtResource("5_lhfti")
[node name="Video Settings" parent="SettingsPopup/TabContainer" instance=ExtResource("3_f0dcd")] [node name="Video Settings" parent="SettingsPopup/TabContainer" instance=ExtResource("3_f0dcd")]
unique_name_in_owner = true
visible = false
layout_mode = 2 layout_mode = 2
metadata/_tab_index = 0 metadata/_tab_index = 0
[node name="Audio Settings" parent="SettingsPopup/TabContainer" instance=ExtResource("4_o07mg")] [node name="Audio Settings" parent="SettingsPopup/TabContainer" instance=ExtResource("4_o07mg")]
visible = false unique_name_in_owner = true
layout_mode = 2 layout_mode = 2
[node name="Gameplay Settings" parent="SettingsPopup/TabContainer" instance=ExtResource("6_p7ypt")] [node name="Gameplay Settings" parent="SettingsPopup/TabContainer" instance=ExtResource("6_p7ypt")]
unique_name_in_owner = true
visible = false visible = false
layout_mode = 2 layout_mode = 2
metadata/_tab_index = 2 metadata/_tab_index = 2
[node name="Content Notes" parent="SettingsPopup/TabContainer" instance=ExtResource("7_pnd48")] [node name="Content Notes" parent="SettingsPopup/TabContainer" instance=ExtResource("7_pnd48")]
unique_name_in_owner = true
visible = false visible = false
layout_mode = 2 layout_mode = 2
metadata/_tab_index = 3 metadata/_tab_index = 3
@ -402,23 +396,8 @@ anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("8_o0cpj") script = ExtResource("8_o0cpj")
save_1 = null
save_2 = null
save_3 = null
[node name="Popup" type="Popup" parent="SaveGameHandle"] [node name="ScrollContainer" type="ScrollContainer" parent="."]
script = SubResource("GDScript_mjmwc") layout_mode = 0
[node name="VBoxContainer" type="VBoxContainer" parent="SaveGameHandle/Popup"]
offset_right = 40.0 offset_right = 40.0
offset_bottom = 40.0 offset_bottom = 40.0
[node name="Label" type="Label" parent="SaveGameHandle/Popup/VBoxContainer"]
layout_mode = 2
text = "Slot is already occupied. Do you really want to overwrite it?"
[node name="ConfirmOverwrite" type="Button" parent="SaveGameHandle/Popup/VBoxContainer"]
layout_mode = 2
[node name="CancelOverwrite" type="Button" parent="SaveGameHandle/Popup/VBoxContainer"]
layout_mode = 2

View File

@ -39,7 +39,7 @@ mouse_cursor/custom_image="res://import/interface-elements/cursor.png"
[editor_plugins] [editor_plugins]
enabled=PackedStringArray("res://addons/LineRenderer/plugin.cfg") enabled=PackedStringArray("res://addons/LineRenderer/plugin.cfg", "res://addons/markdownlabel/plugin.cfg")
[filesystem] [filesystem]

View File

@ -115,7 +115,6 @@ func save_settings():
} }
var file = FileAccess.open(user_settings_path, FileAccess.WRITE) var file = FileAccess.open(user_settings_path, FileAccess.WRITE)
print(error_string(FileAccess.get_open_error()))
file.store_string(JSON.stringify(out_dict)) file.store_string(JSON.stringify(out_dict))
file.close() file.close()