From 150fffadb96e2fd4edaaef17e45bd259f8209d25 Mon Sep 17 00:00:00 2001 From: Fujita Date: Wed, 4 Mar 2026 00:24:25 +0100 Subject: [PATCH] UI code reorganizing --- Dialogues/Patients/patient_43_file.cfg | 2 +- Dialogues/Patients/patient_47.dialogue | 12 +- Dialogues/Patients/patient_48.dialogue | 100 ++++---- Scenes/UI/load.gd | 20 ++ Scenes/UI/load.gd.uid | 1 + Scenes/UI/pause_menu.gd | 81 +++++++ Scenes/UI/pause_menu.gd.uid | 1 + Scenes/UI/save.gd | 20 ++ Scenes/UI/save.gd.uid | 1 + Scenes/UI/settings.gd | 8 + Scenes/UI/settings.gd.uid | 1 + Scenes/UI/submenu.gd | 13 ++ Scenes/UI/submenu.gd.uid | 1 + Scenes/UI/ui.gd | 148 +----------- Scenes/UI/ui.tscn | 308 ++++++++++--------------- Scenes/main/globals.gd | 6 + Scenes/main/main.gd | 42 ++-- 17 files changed, 349 insertions(+), 416 deletions(-) create mode 100644 Scenes/UI/load.gd create mode 100644 Scenes/UI/load.gd.uid create mode 100644 Scenes/UI/pause_menu.gd create mode 100644 Scenes/UI/pause_menu.gd.uid create mode 100644 Scenes/UI/save.gd create mode 100644 Scenes/UI/save.gd.uid create mode 100644 Scenes/UI/settings.gd create mode 100644 Scenes/UI/settings.gd.uid create mode 100644 Scenes/UI/submenu.gd create mode 100644 Scenes/UI/submenu.gd.uid diff --git a/Dialogues/Patients/patient_43_file.cfg b/Dialogues/Patients/patient_43_file.cfg index 59f8142..1ec9bd3 100644 --- a/Dialogues/Patients/patient_43_file.cfg +++ b/Dialogues/Patients/patient_43_file.cfg @@ -1,7 +1,7 @@ initial_emotion="worried" name="Samia Al-Adouani" age="31" -profession="Violonist" +profession="Violinist" psychiatric_assessment="AUDITORY HALLUCINATIONS" abnormal_symptoms="SUICIDAL IDEATIONS" status="random" diff --git a/Dialogues/Patients/patient_47.dialogue b/Dialogues/Patients/patient_47.dialogue index 08825dc..974ed23 100644 --- a/Dialogues/Patients/patient_47.dialogue +++ b/Dialogues/Patients/patient_47.dialogue @@ -44,18 +44,18 @@ Thomas Bertrand: [#peaceful] Ask your questions, young one. ~ part_2 -if Patient.marker[0] == 5 +if Patient.marker[2] >= 5 => part_3 - Why are you praying ? [if Patient.dialog_tree[21] == "not_asked"] set Patient.dialog_tree[21] = "asked" - do Patient.marker[0] += 1 + do Patient.marker[2] += 1 Thomas Bertrand: [#neutral] I am reinforcing my faith, child. Pray begets belief, and belief begets knowledge. Thomas Bertrand: [#praying] Thus through prayer the truth of the world shall be revealed unto me. - Who are you praying to ? [if Patient.dialog_tree[22] == "not_asked"] set Patient.dialog_tree[22] = "asked" - do Patient.marker[0] += 1 + do Patient.marker[2] += 1 Thomas Bertrand: [#smiling] Why, to myself of course. Who else ? - Does that mean you are a godly being ? @@ -72,19 +72,19 @@ if Patient.marker[0] == 5 - How can you be certain you are so special, so blessed ? [if Patient.dialog_tree[23] == "not_asked"] set Patient.dialog_tree[23] = "asked" - do Patient.marker[0] += 1 + do Patient.marker[2] += 1 Thomas Bertrand: [#neutral] Certainty is belief equated with knowledge. I am both. That is proof enough. => part_2 - Do you hear voices talking to you ? [if Patient.dialog_tree[24] == "not_asked"] set Patient.dialog_tree[24] = "asked" - do Patient.marker[0] += 1 + do Patient.marker[2] += 1 Thomas Bertrand: [#praying] Yes... I can hear myself whispering in my ears. My own mind, pondering upon itself. A loop of holy truth. => part_2 - Do you feel safe here ? Is there anyone trying to harm you ? [if Patient.dialog_tree[25] == "not_asked"] set Patient.dialog_tree[25] = "asked" - do Patient.marker[0] += 1 + do Patient.marker[2] += 1 if Patient.abnormal == true Thomas Bertrand: [#surprised] Are you referring to It ? It is here ?! Thomas Bertrand: [#scared] The Great Deceiver ! It That Thirsts for Truth ! If It finds me, I am in great danger ! diff --git a/Dialogues/Patients/patient_48.dialogue b/Dialogues/Patients/patient_48.dialogue index 9ac73e4..2ab748e 100644 --- a/Dialogues/Patients/patient_48.dialogue +++ b/Dialogues/Patients/patient_48.dialogue @@ -5,37 +5,36 @@ set Patient.dialog_tree = Patient.build_dialog_tree([11,12,21,22]) Phil Fossa: [#smiling] About time ! You there ! Release me at once ! +~ part_1 + - Hi. Let us talk first, and then we'll see what I can do about that. Phil Fossa: [#puzzled] Talk ? What's the point of talking when you could just ACT ? Phil Fossa: [#neutral] ... Fine, let's get this over with. Ask your petty questions. - => part_1 - + => part_2 - Greetings, sir. You may do well to lower your tone if you expect my help. Phil Fossa: [#irritated] Are you threatening me ?? How unpolite is that ?! I'll sue you ! - => part_0 - + => part_2 - Is that how you speak to your students ? Phil Fossa: [#puzzled] Well, obviously yes ? That's how you teach stuff to unruly youngsters. Through sheer authority and charisma. - => part_0 - + => part_2 - Big words for such a small dude... Phil Fossa: [#angry] The size of the body does not beget the size of the mind, you uneducated wretch ! Beware the anger of the cultivated intellect ! - => part_0 - - -~ part_0 -- Alright alright, let's chill. I just need to ask you some questions before I release you. Please bear with me. - Phil Fossa: [#irritated] Questions ? I guess I'll spare you some of my precious time. Make it quick, peasant. - => part_1 - -~ part_1 - -if Patient.marker[0] == 2 => part_2 -- Are there people conspiring against you or threatening you ? [if Patient.dialog_tree[11] == "not_asked"] - set Patient.dialog_tree[11] = "asked" - do Patient.marker[0] += 1 + +~ part_2 +- I just need to ask you some questions. Please bear with me. + Phil Fossa: [#irritated] Questions ? I guess I'll spare you some of my precious time. Make it quick, peasant. + => part_3 + + +~ part_3 +if Patient.marker[3] >= 2 + => part_end + +- Are there people conspiring against you or threatening you ? [if Patient.dialog_tree[31] == "not_asked"] + set Patient.dialog_tree[31] = "asked" + do Patient.marker[3] += 1 Phil Fossa: [#suspicious] How did you know ? Are you working for them ? I didn't think they'd find me again so quickly... Phil Fossa: [#smiling] Nah, you're too dumb to be one of them. You're safe. @@ -44,51 +43,34 @@ if Patient.marker[0] == 2 Phil Fossa: [#irritated] They try to mic up my flat every other Sunday, to steal my knowledge. They follow me when I'm outside. Phil Fossa: [#smiling] But they're no match for me. I outsmart them at every corner. - - Who are they ? - Phil Fossa: [#puzzled] Well, people from the Learning Rogues, of course. Thought it was common knowledge. How uncultured are you ? - Phil Fossa: [#irritated] They're a secret organization from times immemorial. They actively work to siphon knowledge from high-intellect individuals like me. - Phil Fossa: [#neutral] Satisfied ? Care to release me now ? - => part_1 - -- You seem to value yourself highly. Why is that ? [if Patient.dialog_tree[12] == "not_asked"] - set Patient.dialog_tree[12] = "asked" - do Patient.marker[0] += 1 - Phil Fossa: [#puzzled] Why ? You have one of the nine wise Sages standing before you, that's why ! Your lack of knowledge baffles me. - Phil Fossa: [#smiling] I was chosen at birth to learn the secrets of infinite Wisdom. I could utter a single word and hurl myself out of here in an instant if i wished to. + - Did they follow you here ? Are they watching you right now ? [if Patient.dialog_tree[41] == "not_asked"] + set Patient.dialog_tree[41] = "asked" + do Patient.marker[4] += 1 + Phil Fossa: [#suspicious] Yes, they followed me. They hid mics in my room. Trying to capture my secrets. I won't let them. - - Then why aren't you teleporting yourself out of here ? - Phil Fossa: [#irritated] I tried to, but it ain't working here. Probably a trick of the Learning Rogues. I need some time to decipher their scheming. - => part_1 + - How do you know they hid mics here ? + if Patient.abnormal == true + Phil Fossa: [#worried] Because I can hear them talking on the mics. Laughing about me. Telling jokes about how they'll steal my knowledge until I'm nothing. I'm nothing. + else + Phil Fossa: [#smiling] I just know it. Never doubt the instincts of a wise Sage. The world shows itself to me in paths beyond the ken of your limited abilities. + => part_3 - -~ part_2 - -if Patient.marker[1] == 2 +- You seem to value yourself highly. Why is that ? [if Patient.dialog_tree[32] == "not_asked"] + set Patient.dialog_tree[32] = "asked" + do Patient.marker[3] += 1 + Phil Fossa: [#puzzled] Why ? You have one of the nine wise Sages standing before you, that's why ! Your lack of knowledge baffles me. + Phil Fossa: [#smiling] I was chosen at birth to learn the secrets of infinite Wisdom. You are so pathetic, I almost feel pity towards you. => part_3 -- Did the Learning Rogues follow you here ? Are they watching you right now ? [if Patient.dialog_tree[21] == "not_asked"] - set Patient.dialog_tree[21] = "asked" - do Patient.marker[1] += 1 - Phil Fossa: [#suspicious] Yes, they followed me. They hid mics in my room. Trying to capture my secrets. I won't let them. - - - How do you know they hid mics here ? - if Patient.abnormal == true - Phil Fossa: [#worried] Because I can hear them talking on the mics. Laughing about me. Telling jokes about how they'll steal my knowledge until I'm nothing. I'm nothing. - else - Phil Fossa: [#smiling] I just know it. Never doubt the instincts of a wise Sage. The world shows itself to me in paths beyond the ken of your limited abilities. - => part_2 - -- Why a knowledge stealing organization ? Why this wise Sage bullshit ? [if Patient.dialog_tree[22] == "not_asked"] - set Patient.dialog_tree[22] = "asked" - do Patient.marker[1] += 1 - Phil Fossa: [#angry] What ?! How dare you speak to me like this ?! To one of the Nine ?? - Phil Fossa: [#worried] I... The kids... They never listen ! I teach them with all the passion in the world, but they don't do their homework, they stay on their phones during class ! - Phil Fossa: [#scared] I have so much to give them, but they don't care ! Why ? I give them my life, and what do I get in return ? What's the point ?? - Phil Fossa: [#smiling] The Learning Rogues do care ! They understand the importance of knowledge, they understand how wise I am ! - => part_2 +- How is your mood lately ? Have you been thinking about harming yourself ? [if Patient.dialog_tree[33] == "not_asked"] + set Patient.dialog_tree[33] = "asked" + do Patient.marker[3] += 1 + Phil Fossa: [#suspicious] Why would I even entertain such a thought ? Are you mentally handicapped ? + Phil Fossa: [#smiling] Nah, that's just how anyone is compared to my towering intellect. + => part_3 -~ part_3 +~ part_end Phil Fossa: [#irritated] That's enough ! I've anwered enough of your silly questions. Phil Fossa: [#angry] Now release me at once ! I'm not talking to you until you've done so. Phil Fossa: [#smiling] So the wise Sage hath spoken. diff --git a/Scenes/UI/load.gd b/Scenes/UI/load.gd new file mode 100644 index 0000000..9141e57 --- /dev/null +++ b/Scenes/UI/load.gd @@ -0,0 +1,20 @@ +extends PanelContainer + +@onready var auto_save_slot = $MarginContainer/VBoxContainer/AutoSaveSlot +@onready var back = $MarginContainer/VBoxContainer/Back + +var load_slot = [] + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + + load_slot.resize(Globals.save_slot_count + 1) #Resizes save_slot + + #Connecting signals + back.pressed.connect(func(): self.hide()) + + #Sets up save_slot array + for i in range(1, Globals.save_slot_count + 1): #Goes from 1 to 4 + var slot_path = "MarginContainer/VBoxContainer/LoadSlot" + str(i) + load_slot[i] = get_node(slot_path) diff --git a/Scenes/UI/load.gd.uid b/Scenes/UI/load.gd.uid new file mode 100644 index 0000000..05747d3 --- /dev/null +++ b/Scenes/UI/load.gd.uid @@ -0,0 +1 @@ +uid://c7lc7t6801rls diff --git a/Scenes/UI/pause_menu.gd b/Scenes/UI/pause_menu.gd new file mode 100644 index 0000000..d8aebb8 --- /dev/null +++ b/Scenes/UI/pause_menu.gd @@ -0,0 +1,81 @@ +extends Control + +@onready var submenu = $Submenu +@onready var save = $Save +@onready var load = $Load +@onready var settings = $Settings +@onready var menu_button = $MenuButton + +var ui_main + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + + #Referencing main node + ui_main = get_parent() + + reset() #Initial state + + #Connecting signals + menu_button.pressed.connect(func(): + submenu.show() + ui_main.masks.mask.show() + ) + submenu.resume.pressed.connect(func(): + reset() + ui_main.masks.mask.hide() + ) + submenu.save.pressed.connect(func(): save.show()) + submenu.load.pressed.connect(func(): load.show()) + submenu.settings.pressed.connect(func(): settings.show()) + submenu.main_menu.pressed.connect(self._on_main_menu_pressed) + submenu.quit.pressed.connect(func(): get_tree().quit()) + + for i in range(1, Globals.save_slot_count + 1): + save.save_slot[i].pressed.connect(self._on_save_slot_pressed.bind(i)) + load.load_slot[i].pressed.connect(self._on_load_slot_pressed.bind(i)) + + +#Emits save_slot signal +func _on_save_slot_pressed(save_slot_number: int): + + var save_slot = save.save_slot[save_slot_number] + + #Asking for confirmation if replacing existing save + if save_slot.text != "EMPTY": + var lambda = func(): ui_main.save_slot_pressed.emit(save_slot_number) + var choice_text = "[center]Replace existing save ?[/center]" + ui_main.ask_confirmation(lambda, Callable(), choice_text) + else: + ui_main.save_slot_pressed.emit(save_slot_number) + + +#Emits load_slot signal +func _on_load_slot_pressed(load_slot_number: int): + + var load_slot = load.load_slot[load_slot_number] + + #Asking for confirmation before loading + if load_slot.text != "EMPTY": + var lambda = func(): ui_main.load_slot_pressed.emit(load_slot_number) + var choice_text = "[center]Load save ? Any unsaved games will be lost.[/center]" + ui_main.ask_confirmation(lambda, Callable(), choice_text) + else: + pass + + +#Going back to main menu +func _on_main_menu_pressed(): + + #Asking for confirmation + var lambda = func(): ui_main.main_menu_pressed.emit() + var choice_text = "[center]Go back to main menu ? Unsaved changes will be lost.[/center]" + ui_main.ask_confirmation(lambda, Callable(), choice_text) + + +#Resets to initial state +func reset(): + show() + #Hiding everything except the menu button + for node in [submenu, save, load, settings, menu_button]: + node.hide() diff --git a/Scenes/UI/pause_menu.gd.uid b/Scenes/UI/pause_menu.gd.uid new file mode 100644 index 0000000..d1e52ee --- /dev/null +++ b/Scenes/UI/pause_menu.gd.uid @@ -0,0 +1 @@ +uid://dxyi7st0g4hdf diff --git a/Scenes/UI/save.gd b/Scenes/UI/save.gd new file mode 100644 index 0000000..9612b81 --- /dev/null +++ b/Scenes/UI/save.gd @@ -0,0 +1,20 @@ +extends PanelContainer + +@onready var auto_save_slot = $MarginContainer/VBoxContainer/AutoSaveSlot +@onready var back = $MarginContainer/VBoxContainer/Back + +var save_slot = [] + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + + save_slot.resize(Globals.save_slot_count + 1) #Resizes save_slot + + #Connecting signals + back.pressed.connect(func(): self.hide()) + + #Sets up save_slot array + for i in range(1, Globals.save_slot_count + 1): #Goes from 1 to 4 + var slot_path = "MarginContainer/VBoxContainer/SaveSlot" + str(i) + save_slot[i] = get_node(slot_path) diff --git a/Scenes/UI/save.gd.uid b/Scenes/UI/save.gd.uid new file mode 100644 index 0000000..5d51a84 --- /dev/null +++ b/Scenes/UI/save.gd.uid @@ -0,0 +1 @@ +uid://d2f2qod8t0umo diff --git a/Scenes/UI/settings.gd b/Scenes/UI/settings.gd new file mode 100644 index 0000000..3e60a16 --- /dev/null +++ b/Scenes/UI/settings.gd @@ -0,0 +1,8 @@ +extends PanelContainer + + + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass diff --git a/Scenes/UI/settings.gd.uid b/Scenes/UI/settings.gd.uid new file mode 100644 index 0000000..ff3dcfb --- /dev/null +++ b/Scenes/UI/settings.gd.uid @@ -0,0 +1 @@ +uid://c7r7iaoghw8lh diff --git a/Scenes/UI/submenu.gd b/Scenes/UI/submenu.gd new file mode 100644 index 0000000..54382a0 --- /dev/null +++ b/Scenes/UI/submenu.gd @@ -0,0 +1,13 @@ +extends PanelContainer + +@onready var resume = $MarginContainer/VBoxContainer/Resume +@onready var save = $MarginContainer/VBoxContainer/Save +@onready var load = $MarginContainer/VBoxContainer/Load +@onready var settings = $MarginContainer/VBoxContainer/Settings +@onready var main_menu = $MarginContainer/VBoxContainer/MainMenu +@onready var quit = $MarginContainer/VBoxContainer/Quit + + +# Called when the node enters the scene tree for the first time. +func _ready() -> void: + pass # Replace with function body. diff --git a/Scenes/UI/submenu.gd.uid b/Scenes/UI/submenu.gd.uid new file mode 100644 index 0000000..fc0bc1d --- /dev/null +++ b/Scenes/UI/submenu.gd.uid @@ -0,0 +1 @@ +uid://cvcuwg4hha1vr diff --git a/Scenes/UI/ui.gd b/Scenes/UI/ui.gd index 4567d41..71f6ea6 100644 --- a/Scenes/UI/ui.gd +++ b/Scenes/UI/ui.gd @@ -1,16 +1,13 @@ extends CanvasLayer #UI Elements -@onready var next = $UI/SkipContainer/NextButton @onready var confirmation_mask = $ConfirmationMask @onready var masks = $Masks +@onready var pause_menu = $PauseMenu #GameOver Scenes @onready var its_game_over = $ITSGameOverControl -#Signals for progressing through slides -signal next_slide - #Signals for saving and loading signal save_slot_pressed(save_slot_number: int) signal load_slot_pressed(load_slot_number: int) @@ -56,35 +53,6 @@ var resolution_list: Dictionary = { func _ready() -> void: #Connecting signals - #GameOver Signals - - #Menu Signals - $UI/UpperContainer/Menu.pressed.connect(_on_menu_pressed) - - $UI/Menu/MarginContainer/VBoxContainer/Resume.pressed.connect(_on_resume_pressed) - $UI/Menu/MarginContainer/VBoxContainer/Save.pressed.connect(_on_save_pressed) - $UI/Menu/MarginContainer/VBoxContainer/Load.pressed.connect(_on_load_pressed) - $UI/Menu/MarginContainer/VBoxContainer/Settings.pressed.connect(_on_settings_pressed) - $UI/Menu/MarginContainer/VBoxContainer/MainMenu.pressed.connect(_on_main_menu_pressed) - $UI/Menu/MarginContainer/VBoxContainer/Quit.pressed.connect(_on_quit_game_pressed) - $UI/Save/MarginContainer/VBoxContainer/Back.pressed.connect(_on_back_pressed) - $UI/Load/MarginContainer/VBoxContainer/Control/Back.pressed.connect(_on_back_pressed) - $UI/Load/MarginContainer/VBoxContainer/Control/BackTitle.pressed.connect(_on_back_title_pressed) - $UI/Settings/MarginContainer/VBoxContainer/Control/Back.pressed.connect(_on_back_pressed) - $UI/Settings/MarginContainer/VBoxContainer/Control/BackTitle.pressed.connect(_on_back_title_pressed) - - #Save Slots Signals - $UI/Save/MarginContainer/VBoxContainer/SaveSlot1.pressed.connect(func(): _on_save_slot_pressed(1)) - $UI/Save/MarginContainer/VBoxContainer/SaveSlot2.pressed.connect(func(): _on_save_slot_pressed(2)) - $UI/Save/MarginContainer/VBoxContainer/SaveSlot3.pressed.connect(func(): _on_save_slot_pressed(3)) - $UI/Save/MarginContainer/VBoxContainer/SaveSlot4.pressed.connect(func(): _on_save_slot_pressed(4)) - - #Load Slots Signals - $UI/Load/MarginContainer/VBoxContainer/LoadSlot1.pressed.connect(func(): _on_load_slot_pressed(1)) - $UI/Load/MarginContainer/VBoxContainer/LoadSlot2.pressed.connect(func(): _on_load_slot_pressed(2)) - $UI/Load/MarginContainer/VBoxContainer/LoadSlot3.pressed.connect(func(): _on_load_slot_pressed(3)) - $UI/Load/MarginContainer/VBoxContainer/LoadSlot4.pressed.connect(func(): _on_load_slot_pressed(4)) - #Text settings signals text_slider.value_changed.connect(_on_text_value_changed) auto_slider.value_changed.connect(_on_auto_value_changed) @@ -97,7 +65,7 @@ func _ready() -> void: #Initializes the auto-advance to false autoplay.button_pressed = false - auto_mask.visible = true + auto_mask.hide() #Screen settings signals and initialization display_button.item_selected.connect(_on_display_selected) @@ -108,9 +76,7 @@ func _ready() -> void: resolution_button.select(resolution_list.find_key(screen_size)) #Selects the computer resolution as initial screen resolution #Hiding everything at start - for node in $UI.get_children(): - node.hide() - confirmation_mask.visible = false + confirmation_mask.hide() #Brings up a Confirmation Dialog @@ -124,9 +90,9 @@ func ask_confirmation(function_yes: Callable, function_no: Callable, choice_text var choice_no = choice_dialog.get_node("ConfirmationDialog/MarginContainer/VBoxContainer/MarginContainer/HBoxContainer/NoButton") #Clears the Confirmation Dialog and Remove the Mask no matter what choice is made - choice_yes.pressed.connect(func(): confirmation_mask.visible = false) + choice_yes.pressed.connect(func(): confirmation_mask.hide()) choice_yes.pressed.connect(func(): choice_dialog.queue_free()) - choice_no.pressed.connect(func(): confirmation_mask.visible = false) + choice_no.pressed.connect(func(): confirmation_mask.hide()) choice_no.pressed.connect(func(): choice_dialog.queue_free()) choice_yes.text = ("YES") @@ -139,109 +105,7 @@ func ask_confirmation(function_yes: Callable, function_no: Callable, choice_text choice_no.pressed.connect(function_no, CONNECT_ONE_SHOT) choice_dialog.show() - confirmation_mask.visible = true - - -func _on_menu_pressed(): - UI.masks.mask.visible = true - $UI/Menu.show() - - - -#Back to the game -func _on_resume_pressed(): - UI.masks.mask.visible = false - $UI/Menu.hide() - - - -#Shows Save Slots -func _on_save_pressed(): - $UI/Menu.hide() - $UI/Save.show() - - - -#Shows Load Slots -func _on_load_pressed(): - $UI/Menu.hide() - $UI/Load.show() - $UI/Load/MarginContainer/VBoxContainer/Control/BackTitle.hide() - $UI/Load/MarginContainer/VBoxContainer/Control/Back.show() - - - -#Goes back to Menu -func _on_back_pressed(): - $UI/Save.hide() - $UI/Load.hide() - $UI/Settings.hide() - $UI/Menu.show() - - - -#Goes back to title screen -func _on_back_title_pressed(): - $UI/Load.hide() - $UI/Settings.hide() - UI.masks.mask.visible = false - - - -#Shows Settings Menu -func _on_settings_pressed(): - $UI/Menu.hide() - $UI/Settings.show() - $UI/Settings/MarginContainer/VBoxContainer/Control/BackTitle.hide() - $UI/Settings/MarginContainer/VBoxContainer/Control/Back.show() - - - -#Goes back to the main menu -func _on_main_menu_pressed(): - - #Asking for confirmation - var lambda = func(): main_menu_pressed.emit() - var choice_text = "[center]Go back to main menu ? Unsaved changes will be lost.[/center]" - ask_confirmation(lambda, Callable(), choice_text) - - - -#Quits the game -func _on_quit_game_pressed(): - get_tree().quit() - - - -#Emits save_slot signal -func _on_save_slot_pressed(save_slot_number: int): - - var save_slot_path = "UI/Save/MarginContainer/VBoxContainer/SaveSlot" + str(save_slot_number) - var save_slot = UI.get_node(save_slot_path) - - #Asking for confirmation if replacing existing save - if save_slot.text != "EMPTY": - var lambda = func(): save_slot_pressed.emit(save_slot_number) - var choice_text = "[center]Replace existing save ?[/center]" - ask_confirmation(lambda, Callable(), choice_text) - else: - save_slot_pressed.emit(save_slot_number) - - - -#Emits load_slot signal -func _on_load_slot_pressed(load_slot_number: int): - - var load_slot_path = "UI/Load/MarginContainer/VBoxContainer/LoadSlot" + str(load_slot_number) - var load_slot = UI.get_node(load_slot_path) - - #Asking for confirmation before loading - if load_slot.text != "EMPTY": - var lambda = func(): load_slot_pressed.emit(load_slot_number) - var choice_text = "[center]Load save ? Any unsaved games will be lost.[/center]" - ask_confirmation(lambda, Callable(), choice_text) - else: - pass + confirmation_mask.show() #Changes text_speed value diff --git a/Scenes/UI/ui.tscn b/Scenes/UI/ui.tscn index 0d8e99b..9b1b6b4 100644 --- a/Scenes/UI/ui.tscn +++ b/Scenes/UI/ui.tscn @@ -1,13 +1,18 @@ -[gd_scene load_steps=22 format=3 uid="uid://dy40jygog8t3k"] +[gd_scene load_steps=27 format=3 uid="uid://dy40jygog8t3k"] [ext_resource type="Script" uid="uid://c0q67t6m1i4dl" path="res://Scenes/UI/ui.gd" id="1_mg12k"] [ext_resource type="FontFile" uid="uid://dv8ppra5tgn1t" path="res://Art/Fonts/PixelatedEleganceRegular-ovyAA.ttf" id="2_vb7na"] [ext_resource type="Texture2D" uid="uid://l7786mlmvet8" path="res://Art/UI/menu_gear.png" id="3_ibj64"] [ext_resource type="Script" uid="uid://bru53a1mvu0t2" path="res://Scenes/UI/its_game_over_control.gd" id="4_duuxe"] +[ext_resource type="Script" uid="uid://dxyi7st0g4hdf" path="res://Scenes/UI/pause_menu.gd" id="4_s3gqk"] [ext_resource type="Shader" uid="uid://n2f3kv6b7k2o" path="res://Scenes/UI/its_game_over.gdshader" id="5_duuxe"] +[ext_resource type="Script" uid="uid://cvcuwg4hha1vr" path="res://Scenes/UI/submenu.gd" id="5_pmm6b"] [ext_resource type="Texture2D" uid="uid://qodbgs7d5mqs" path="res://Art/UI/its_game_over.png" id="6_duuxe"] [ext_resource type="Script" uid="uid://cjft0c0ui8yhs" path="res://Scenes/UI/its_game_over_background.gd" id="6_jfwrg"] +[ext_resource type="Script" uid="uid://d2f2qod8t0umo" path="res://Scenes/UI/save.gd" id="7_vy225"] +[ext_resource type="Script" uid="uid://c7lc7t6801rls" path="res://Scenes/UI/load.gd" id="8_fy0us"] [ext_resource type="Script" uid="uid://be2ypveoa0hf5" path="res://Scenes/UI/masks.gd" id="8_mbl0m"] +[ext_resource type="Script" uid="uid://c7r7iaoghw8lh" path="res://Scenes/UI/settings.gd" id="9_h6tq4"] [ext_resource type="Script" uid="uid://dbjei4d2lfwnb" path="res://Scenes/UI/fading_mask.gd" id="9_s3gqk"] [sub_resource type="Animation" id="Animation_n85x3"] @@ -162,14 +167,14 @@ shader_parameter/softness = 0.05 [node name="UILayer" type="CanvasLayer" node_paths=PackedStringArray("text_slider", "auto_slider", "text_counter", "auto_counter", "autoplay", "auto_mask", "display_button", "resolution_button")] layer = 100 script = ExtResource("1_mg12k") -text_slider = NodePath("UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed/TextSlider") -auto_slider = NodePath("UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control/AutoSpeed/AutoSlider") -text_counter = NodePath("UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed/TextCounter") -auto_counter = NodePath("UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control/AutoSpeed/AutoCounter") -autoplay = NodePath("UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/AutoPlay/AutoPlayCheckBox") -auto_mask = NodePath("UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control/AutoMask") -display_button = NodePath("UI/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer/Display/DisplayButton") -resolution_button = NodePath("UI/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer/Resolution/ResolutionButton") +text_slider = NodePath("PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed/TextSlider") +auto_slider = NodePath("PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control/AutoSpeed/AutoSlider") +text_counter = NodePath("PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed/TextCounter") +auto_counter = NodePath("PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control/AutoSpeed/AutoCounter") +autoplay = NodePath("PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/AutoPlay/AutoPlayCheckBox") +auto_mask = NodePath("PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control/AutoMask") +display_button = NodePath("PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer/Display/DisplayButton") +resolution_button = NodePath("PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer/Resolution/ResolutionButton") [node name="Masks" type="Control" parent="."] layout_mode = 3 @@ -211,7 +216,7 @@ grow_vertical = 2 mouse_force_pass_scroll_events = false color = Color(0, 0, 0, 0.470588) -[node name="UI" type="Control" parent="."] +[node name="PauseMenu" type="Control" parent="."] z_index = 12 layout_mode = 3 anchors_preset = 15 @@ -220,9 +225,9 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 +script = ExtResource("4_s3gqk") -[node name="Menu" type="PanelContainer" parent="UI"] -visible = false +[node name="Submenu" type="PanelContainer" parent="PauseMenu"] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -236,65 +241,67 @@ offset_bottom = 200.0 grow_horizontal = 2 grow_vertical = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_fo2i3") +script = ExtResource("5_pmm6b") -[node name="Background" type="ColorRect" parent="UI/Menu"] +[node name="Background" type="ColorRect" parent="PauseMenu/Submenu"] layout_mode = 2 color = Color(0, 0, 0, 1) -[node name="MarginContainer" type="MarginContainer" parent="UI/Menu"] +[node name="MarginContainer" type="MarginContainer" parent="PauseMenu/Submenu"] layout_mode = 2 theme_override_constants/margin_left = 25 theme_override_constants/margin_top = 25 theme_override_constants/margin_right = 25 theme_override_constants/margin_bottom = 25 -[node name="VBoxContainer" type="VBoxContainer" parent="UI/Menu/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="PauseMenu/Submenu/MarginContainer"] layout_mode = 2 -[node name="Resume" type="Button" parent="UI/Menu/MarginContainer/VBoxContainer"] +[node name="Resume" type="Button" parent="PauseMenu/Submenu/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "RESUME" -[node name="Save" type="Button" parent="UI/Menu/MarginContainer/VBoxContainer"] +[node name="Save" type="Button" parent="PauseMenu/Submenu/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "SAVE" -[node name="Load" type="Button" parent="UI/Menu/MarginContainer/VBoxContainer"] +[node name="Load" type="Button" parent="PauseMenu/Submenu/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "LOAD" -[node name="Settings" type="Button" parent="UI/Menu/MarginContainer/VBoxContainer"] +[node name="Settings" type="Button" parent="PauseMenu/Submenu/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "SETTINGS" -[node name="MainMenu" type="Button" parent="UI/Menu/MarginContainer/VBoxContainer"] +[node name="MainMenu" type="Button" parent="PauseMenu/Submenu/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "MAIN MENU" -[node name="Quit" type="Button" parent="UI/Menu/MarginContainer/VBoxContainer"] +[node name="Quit" type="Button" parent="PauseMenu/Submenu/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "QUIT GAME" -[node name="Save" type="PanelContainer" parent="UI"] -visible = false +[node name="Save" type="PanelContainer" parent="PauseMenu"] +z_index = 1 +custom_minimum_size = Vector2(0, 700) layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -302,28 +309,29 @@ anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 offset_left = -200.0 -offset_top = -300.0 +offset_top = -354.5 offset_right = 200.0 -offset_bottom = 300.0 +offset_bottom = 354.5 grow_horizontal = 2 grow_vertical = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_fo2i3") +script = ExtResource("7_vy225") -[node name="Background" type="ColorRect" parent="UI/Save"] +[node name="Background" type="ColorRect" parent="PauseMenu/Save"] layout_mode = 2 color = Color(0, 0, 0, 1) -[node name="MarginContainer" type="MarginContainer" parent="UI/Save"] +[node name="MarginContainer" type="MarginContainer" parent="PauseMenu/Save"] layout_mode = 2 theme_override_constants/margin_left = 25 theme_override_constants/margin_top = 10 theme_override_constants/margin_right = 25 theme_override_constants/margin_bottom = 0 -[node name="VBoxContainer" type="VBoxContainer" parent="UI/Save/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="PauseMenu/Save/MarginContainer"] layout_mode = 2 -[node name="RichTextLabel" type="RichTextLabel" parent="UI/Save/MarginContainer/VBoxContainer"] +[node name="RichTextLabel" type="RichTextLabel" parent="PauseMenu/Save/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/normal_font = ExtResource("2_vb7na") @@ -332,35 +340,42 @@ bbcode_enabled = true text = " [center]SAVE GAME[/center]" -[node name="SaveSlot1" type="Button" parent="UI/Save/MarginContainer/VBoxContainer"] +[node name="AutoSaveSlot" type="Button" parent="PauseMenu/Save/MarginContainer/VBoxContainer"] +custom_minimum_size = Vector2(0, 200) +layout_mode = 2 +theme_override_fonts/font = ExtResource("2_vb7na") +theme_override_font_sizes/font_size = 27 +text = "EMPTY" + +[node name="SaveSlot1" type="Button" parent="PauseMenu/Save/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "EMPTY" -[node name="SaveSlot2" type="Button" parent="UI/Save/MarginContainer/VBoxContainer"] +[node name="SaveSlot2" type="Button" parent="PauseMenu/Save/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "EMPTY" -[node name="SaveSlot3" type="Button" parent="UI/Save/MarginContainer/VBoxContainer"] +[node name="SaveSlot3" type="Button" parent="PauseMenu/Save/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "EMPTY" -[node name="SaveSlot4" type="Button" parent="UI/Save/MarginContainer/VBoxContainer"] +[node name="SaveSlot4" type="Button" parent="PauseMenu/Save/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "EMPTY" -[node name="Back" type="Button" parent="UI/Save/MarginContainer/VBoxContainer"] +[node name="Back" type="Button" parent="PauseMenu/Save/MarginContainer/VBoxContainer"] custom_minimum_size = Vector2(80, 40) layout_mode = 2 size_flags_horizontal = 4 @@ -369,8 +384,10 @@ theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 20 text = "BACK" -[node name="Load" type="PanelContainer" parent="UI"] +[node name="Load" type="PanelContainer" parent="PauseMenu"] visible = false +z_index = 1 +custom_minimum_size = Vector2(0, 700) layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 @@ -384,22 +401,23 @@ offset_bottom = 300.0 grow_horizontal = 2 grow_vertical = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_fo2i3") +script = ExtResource("8_fy0us") -[node name="Background" type="ColorRect" parent="UI/Load"] +[node name="Background" type="ColorRect" parent="PauseMenu/Load"] layout_mode = 2 color = Color(0, 0, 0, 1) -[node name="MarginContainer" type="MarginContainer" parent="UI/Load"] +[node name="MarginContainer" type="MarginContainer" parent="PauseMenu/Load"] layout_mode = 2 theme_override_constants/margin_left = 25 theme_override_constants/margin_top = 10 theme_override_constants/margin_right = 25 theme_override_constants/margin_bottom = 0 -[node name="VBoxContainer" type="VBoxContainer" parent="UI/Load/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="PauseMenu/Load/MarginContainer"] layout_mode = 2 -[node name="RichTextLabel" type="RichTextLabel" parent="UI/Load/MarginContainer/VBoxContainer"] +[node name="RichTextLabel" type="RichTextLabel" parent="PauseMenu/Load/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/normal_font = ExtResource("2_vb7na") @@ -408,81 +426,52 @@ bbcode_enabled = true text = " [center]LOAD GAME[/center]" -[node name="LoadSlot1" type="Button" parent="UI/Load/MarginContainer/VBoxContainer"] +[node name="AutoSaveSlot" type="Button" parent="PauseMenu/Load/MarginContainer/VBoxContainer"] +custom_minimum_size = Vector2(0, 200) +layout_mode = 2 +theme_override_fonts/font = ExtResource("2_vb7na") +theme_override_font_sizes/font_size = 27 +text = "EMPTY" + +[node name="LoadSlot1" type="Button" parent="PauseMenu/Load/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "EMPTY" -[node name="LoadSlot2" type="Button" parent="UI/Load/MarginContainer/VBoxContainer"] +[node name="LoadSlot2" type="Button" parent="PauseMenu/Load/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "EMPTY" -[node name="LoadSlot3" type="Button" parent="UI/Load/MarginContainer/VBoxContainer"] +[node name="LoadSlot3" type="Button" parent="PauseMenu/Load/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "EMPTY" -[node name="LoadSlot4" type="Button" parent="UI/Load/MarginContainer/VBoxContainer"] +[node name="LoadSlot4" type="Button" parent="PauseMenu/Load/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 27 text = "EMPTY" -[node name="Control" type="Control" parent="UI/Load/MarginContainer/VBoxContainer"] -layout_mode = 2 -size_flags_vertical = 3 -size_flags_stretch_ratio = 0.7 - -[node name="Back" type="Button" parent="UI/Load/MarginContainer/VBoxContainer/Control"] +[node name="Back" type="Button" parent="PauseMenu/Load/MarginContainer/VBoxContainer"] custom_minimum_size = Vector2(80, 40) -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -40.0 -offset_top = -20.0 -offset_right = 40.0 -offset_bottom = 20.0 -grow_horizontal = 2 -grow_vertical = 2 +layout_mode = 2 size_flags_horizontal = 4 size_flags_vertical = 6 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 20 text = "BACK" -[node name="BackTitle" type="Button" parent="UI/Load/MarginContainer/VBoxContainer/Control"] -custom_minimum_size = Vector2(80, 40) -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -40.0 -offset_top = -20.0 -offset_right = 40.0 -offset_bottom = 20.0 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_horizontal = 4 -size_flags_vertical = 6 -theme_override_fonts/font = ExtResource("2_vb7na") -theme_override_font_sizes/font_size = 20 -text = "BACK" - -[node name="Settings" type="PanelContainer" parent="UI"] -visible = false +[node name="Settings" type="PanelContainer" parent="PauseMenu"] +z_index = 1 custom_minimum_size = Vector2(1600, 600) layout_mode = 1 anchors_preset = 8 @@ -497,23 +486,24 @@ offset_bottom = 300.0 grow_horizontal = 2 grow_vertical = 2 theme_override_styles/panel = SubResource("StyleBoxFlat_fo2i3") +script = ExtResource("9_h6tq4") -[node name="Background" type="ColorRect" parent="UI/Settings"] +[node name="Background" type="ColorRect" parent="PauseMenu/Settings"] layout_mode = 2 color = Color(0, 0, 0, 1) -[node name="MarginContainer" type="MarginContainer" parent="UI/Settings"] +[node name="MarginContainer" type="MarginContainer" parent="PauseMenu/Settings"] layout_mode = 2 theme_override_constants/margin_left = 20 theme_override_constants/margin_top = 50 theme_override_constants/margin_right = 20 theme_override_constants/margin_bottom = 50 -[node name="VBoxContainer" type="VBoxContainer" parent="UI/Settings/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="PauseMenu/Settings/MarginContainer"] layout_mode = 2 theme_override_constants/separation = 40 -[node name="Settings" type="RichTextLabel" parent="UI/Settings/MarginContainer/VBoxContainer"] +[node name="Settings" type="RichTextLabel" parent="PauseMenu/Settings/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_fonts/normal_font = ExtResource("2_vb7na") @@ -521,13 +511,13 @@ theme_override_font_sizes/normal_font_size = 35 bbcode_enabled = true text = "[center]SETTINGS[/center]" -[node name="GridContainer" type="GridContainer" parent="UI/Settings/MarginContainer/VBoxContainer"] +[node name="GridContainer" type="GridContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 size_flags_stretch_ratio = 5.0 columns = 3 -[node name="DialogueContainer" type="MarginContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer"] +[node name="DialogueContainer" type="MarginContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -536,16 +526,16 @@ theme_override_constants/margin_top = 10 theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = 10 -[node name="VBoxContainer2" type="VBoxContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer"] +[node name="VBoxContainer2" type="VBoxContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer"] layout_mode = 2 -[node name="DialogueOptions" type="MarginContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2"] +[node name="DialogueOptions" type="MarginContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2"] layout_mode = 2 -[node name="VBoxContainer" type="VBoxContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions"] +[node name="VBoxContainer" type="VBoxContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions"] layout_mode = 2 -[node name="RichTextLabel" type="RichTextLabel" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer"] +[node name="RichTextLabel" type="RichTextLabel" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer"] custom_minimum_size = Vector2(0, 50) layout_mode = 2 theme_override_fonts/normal_font = ExtResource("2_vb7na") @@ -553,11 +543,11 @@ theme_override_font_sizes/normal_font_size = 25 bbcode_enabled = true text = "[center]DIALOGUE[/center]" -[node name="TextSpeed" type="HBoxContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer"] +[node name="TextSpeed" type="HBoxContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer"] custom_minimum_size = Vector2(0, 50) layout_mode = 2 -[node name="RichTextLabel" type="RichTextLabel" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed"] +[node name="RichTextLabel" type="RichTextLabel" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed"] custom_minimum_size = Vector2(160, 28) layout_mode = 2 size_flags_horizontal = 3 @@ -567,7 +557,7 @@ theme_override_font_sizes/normal_font_size = 16 bbcode_enabled = true text = "TYPING SPEED" -[node name="TextSlider" type="HSlider" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed"] +[node name="TextSlider" type="HSlider" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 1 @@ -578,7 +568,7 @@ value = 5.0 tick_count = 10 ticks_on_borders = true -[node name="TextCounter" type="RichTextLabel" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed"] +[node name="TextCounter" type="RichTextLabel" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed"] custom_minimum_size = Vector2(150, 25) layout_mode = 2 size_flags_horizontal = 3 @@ -587,11 +577,11 @@ theme_override_fonts/normal_font = ExtResource("2_vb7na") theme_override_font_sizes/normal_font_size = 16 bbcode_enabled = true -[node name="Control" type="Control" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer"] +[node name="Control" type="Control" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer"] custom_minimum_size = Vector2(0, 50) layout_mode = 2 -[node name="AutoSpeed" type="HBoxContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control"] +[node name="AutoSpeed" type="HBoxContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control"] custom_minimum_size = Vector2(0, 50) layout_mode = 1 anchors_preset = 15 @@ -600,7 +590,7 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -[node name="RichTextLabel" type="RichTextLabel" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control/AutoSpeed"] +[node name="RichTextLabel" type="RichTextLabel" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control/AutoSpeed"] custom_minimum_size = Vector2(160, 25) layout_mode = 2 size_flags_horizontal = 3 @@ -610,7 +600,7 @@ theme_override_font_sizes/normal_font_size = 16 bbcode_enabled = true text = "AUTO DELAY" -[node name="AutoSlider" type="HSlider" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control/AutoSpeed"] +[node name="AutoSlider" type="HSlider" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control/AutoSpeed"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 1 @@ -621,7 +611,7 @@ value = 5.0 tick_count = 10 ticks_on_borders = true -[node name="AutoCounter" type="RichTextLabel" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control/AutoSpeed"] +[node name="AutoCounter" type="RichTextLabel" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control/AutoSpeed"] custom_minimum_size = Vector2(150, 25) layout_mode = 2 size_flags_horizontal = 3 @@ -630,7 +620,7 @@ theme_override_fonts/normal_font = ExtResource("2_vb7na") theme_override_font_sizes/normal_font_size = 16 bbcode_enabled = true -[node name="AutoMask" type="ColorRect" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control"] +[node name="AutoMask" type="ColorRect" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/Control"] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -639,12 +629,12 @@ grow_horizontal = 2 grow_vertical = 2 color = Color(0, 0, 0, 0.784314) -[node name="AutoPlay" type="HBoxContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer"] +[node name="AutoPlay" type="HBoxContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer"] custom_minimum_size = Vector2(0, 50) layout_mode = 2 theme_override_constants/separation = 10 -[node name="RichTextLabel" type="RichTextLabel" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/AutoPlay"] +[node name="RichTextLabel" type="RichTextLabel" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/AutoPlay"] custom_minimum_size = Vector2(160, 25) layout_mode = 2 size_flags_vertical = 4 @@ -653,11 +643,11 @@ theme_override_font_sizes/normal_font_size = 16 bbcode_enabled = true text = "AUTOPLAY" -[node name="AutoPlayCheckBox" type="CheckBox" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/AutoPlay"] +[node name="AutoPlayCheckBox" type="CheckBox" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/DialogueContainer/VBoxContainer2/DialogueOptions/VBoxContainer/AutoPlay"] layout_mode = 2 size_flags_vertical = 4 -[node name="ScreenContainer" type="MarginContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer"] +[node name="ScreenContainer" type="MarginContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -666,17 +656,17 @@ theme_override_constants/margin_top = 10 theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = 10 -[node name="VBoxContainer2" type="VBoxContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer"] +[node name="VBoxContainer2" type="VBoxContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer"] layout_mode = 2 -[node name="ScreenSettings" type="MarginContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2"] +[node name="ScreenSettings" type="MarginContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2"] layout_mode = 2 -[node name="VBoxContainer" type="VBoxContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings"] +[node name="VBoxContainer" type="VBoxContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings"] layout_mode = 2 theme_override_constants/separation = 20 -[node name="RichTextLabel" type="RichTextLabel" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer"] +[node name="RichTextLabel" type="RichTextLabel" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer"] custom_minimum_size = Vector2(0, 50) layout_mode = 2 theme_override_fonts/normal_font = ExtResource("2_vb7na") @@ -684,11 +674,11 @@ theme_override_font_sizes/normal_font_size = 25 bbcode_enabled = true text = "[center]SCREEN[/center]" -[node name="Display" type="HBoxContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer"] +[node name="Display" type="HBoxContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer"] layout_mode = 2 theme_override_constants/separation = 20 -[node name="RichTextLabel" type="RichTextLabel" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer/Display"] +[node name="RichTextLabel" type="RichTextLabel" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer/Display"] custom_minimum_size = Vector2(140, 28) layout_mode = 2 size_flags_vertical = 4 @@ -697,7 +687,7 @@ theme_override_font_sizes/normal_font_size = 16 bbcode_enabled = true text = "DISPLAY" -[node name="DisplayButton" type="OptionButton" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer/Display"] +[node name="DisplayButton" type="OptionButton" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer/Display"] custom_minimum_size = Vector2(250, 0) layout_mode = 2 theme = SubResource("Theme_27bfm") @@ -712,11 +702,11 @@ popup/item_1/id = 1 popup/item_2/text = "FULLSCREEN" popup/item_2/id = 2 -[node name="Resolution" type="HBoxContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer"] +[node name="Resolution" type="HBoxContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer"] layout_mode = 2 theme_override_constants/separation = 20 -[node name="RichTextLabel" type="RichTextLabel" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer/Resolution"] +[node name="RichTextLabel" type="RichTextLabel" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer/Resolution"] custom_minimum_size = Vector2(140, 28) layout_mode = 2 size_flags_vertical = 4 @@ -725,12 +715,12 @@ theme_override_font_sizes/normal_font_size = 16 bbcode_enabled = true text = "RESOLUTION" -[node name="ResolutionButton" type="OptionButton" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer/Resolution"] +[node name="ResolutionButton" type="OptionButton" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/ScreenContainer/VBoxContainer2/ScreenSettings/VBoxContainer/Resolution"] custom_minimum_size = Vector2(250, 0) layout_mode = 2 theme = SubResource("Theme_k8uqd") -[node name="SoundContainer" type="MarginContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer"] +[node name="SoundContainer" type="MarginContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3 @@ -739,16 +729,16 @@ theme_override_constants/margin_top = 10 theme_override_constants/margin_right = 10 theme_override_constants/margin_bottom = 10 -[node name="VBoxContainer2" type="VBoxContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer"] +[node name="VBoxContainer2" type="VBoxContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer"] layout_mode = 2 -[node name="DialogueOptions" type="MarginContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2"] +[node name="DialogueOptions" type="MarginContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2"] layout_mode = 2 -[node name="VBoxContainer" type="VBoxContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2/DialogueOptions"] +[node name="VBoxContainer" type="VBoxContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2/DialogueOptions"] layout_mode = 2 -[node name="RichTextLabel" type="RichTextLabel" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2/DialogueOptions/VBoxContainer"] +[node name="RichTextLabel" type="RichTextLabel" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2/DialogueOptions/VBoxContainer"] custom_minimum_size = Vector2(0, 50) layout_mode = 2 theme_override_fonts/normal_font = ExtResource("2_vb7na") @@ -756,11 +746,11 @@ theme_override_font_sizes/normal_font_size = 25 bbcode_enabled = true text = "[center]AUDIO[/center]" -[node name="TextSpeed" type="HBoxContainer" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2/DialogueOptions/VBoxContainer"] +[node name="TextSpeed" type="HBoxContainer" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2/DialogueOptions/VBoxContainer"] custom_minimum_size = Vector2(0, 50) layout_mode = 2 -[node name="RichTextLabel" type="RichTextLabel" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed"] +[node name="RichTextLabel" type="RichTextLabel" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed"] custom_minimum_size = Vector2(140, 28) layout_mode = 2 size_flags_horizontal = 3 @@ -770,7 +760,7 @@ theme_override_font_sizes/normal_font_size = 16 bbcode_enabled = true text = "MASTER" -[node name="MasterVolume" type="HSlider" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed"] +[node name="MasterVolume" type="HSlider" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 1 @@ -781,7 +771,7 @@ value = 5.0 tick_count = 10 ticks_on_borders = true -[node name="MasterCounter" type="RichTextLabel" parent="UI/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed"] +[node name="MasterCounter" type="RichTextLabel" parent="PauseMenu/Settings/MarginContainer/VBoxContainer/GridContainer/SoundContainer/VBoxContainer2/DialogueOptions/VBoxContainer/TextSpeed"] custom_minimum_size = Vector2(150, 25) layout_mode = 2 size_flags_vertical = 4 @@ -789,77 +779,24 @@ theme_override_fonts/normal_font = ExtResource("2_vb7na") theme_override_font_sizes/normal_font_size = 16 bbcode_enabled = true -[node name="Control" type="Control" parent="UI/Settings/MarginContainer/VBoxContainer"] +[node name="Back" type="Button" parent="PauseMenu/Settings/MarginContainer/VBoxContainer"] +custom_minimum_size = Vector2(80, 40) layout_mode = 2 -size_flags_vertical = 3 -size_flags_stretch_ratio = 0.7 - -[node name="Back" type="Button" parent="UI/Settings/MarginContainer/VBoxContainer/Control"] -custom_minimum_size = Vector2(80, 40) -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -40.0 -offset_top = -20.0 -offset_right = 40.0 -offset_bottom = 20.0 -grow_horizontal = 2 -grow_vertical = 2 size_flags_horizontal = 4 size_flags_vertical = 6 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 20 text = "BACK" -[node name="BackTitle" type="Button" parent="UI/Settings/MarginContainer/VBoxContainer/Control"] -custom_minimum_size = Vector2(80, 40) -layout_mode = 1 -anchors_preset = 8 -anchor_left = 0.5 -anchor_top = 0.5 -anchor_right = 0.5 -anchor_bottom = 0.5 -offset_left = -40.0 -offset_top = -20.0 -offset_right = 40.0 -offset_bottom = 20.0 -grow_horizontal = 2 -grow_vertical = 2 -size_flags_horizontal = 4 -size_flags_vertical = 6 -theme_override_fonts/font = ExtResource("2_vb7na") -theme_override_font_sizes/font_size = 20 -text = "BACK" - -[node name="UpperContainer" type="HBoxContainer" parent="UI"] -layout_mode = 0 -offset_right = 1849.0 -offset_bottom = 85.0 - -[node name="Menu" type="Button" parent="UI/UpperContainer"] +[node name="MenuButton" type="Button" parent="PauseMenu"] custom_minimum_size = Vector2(0, 80) -layout_mode = 2 +layout_mode = 1 +offset_right = 80.0 +offset_bottom = 85.0 theme_override_fonts/font = ExtResource("2_vb7na") theme_override_font_sizes/font_size = 30 theme_override_icons/icon = ExtResource("3_ibj64") -[node name="SkipContainer" type="HBoxContainer" parent="UI"] -visible = false -layout_mode = 0 -offset_left = 1565.0 -offset_top = 997.0 -offset_right = 1895.0 -offset_bottom = 1059.0 - -[node name="NextButton" type="Button" parent="UI/SkipContainer"] -layout_mode = 2 -theme_override_fonts/font = ExtResource("2_vb7na") -theme_override_font_sizes/font_size = 20 -text = " Press Space to Next " - [node name="ConfirmationMask" type="ColorRect" parent="."] visible = false anchors_preset = 15 @@ -871,6 +808,7 @@ mouse_force_pass_scroll_events = false color = Color(0, 0, 0, 0.784314) [node name="ITSGameOverControl" type="Control" parent="."] +visible = false z_index = 12 layout_mode = 3 anchors_preset = 15 diff --git a/Scenes/main/globals.gd b/Scenes/main/globals.gd index 4cc0adb..3c9be4a 100644 --- a/Scenes/main/globals.gd +++ b/Scenes/main/globals.gd @@ -1,5 +1,6 @@ extends Node +#Variables for gameplay var day_count : int = 1 var floor_count : int = -1 var patient_count : int = 1 @@ -10,6 +11,11 @@ var patient_list = ["42", "43", "44", "45", "46", "47", "48", "49", "50", "51"] var patients_seen = [] var its_patients_seen = [] var patient_id + +#Variables for UI +var save_slot_count = 4 #How many save slots there are in the game, in addition to the autosave slot + +#Variables for text var interfloor_dialogue = load("res://Dialogues/interfloor.dialogue") var directives = "\n[center][font_size=22]INSTRUCTIONS[/font_size][/center] \n\n[font_size=18][color=forest_green]RELEASE[/color] HUMANS, [color=red]TERMINATE[/color] ABNORMALS diff --git a/Scenes/main/main.gd b/Scenes/main/main.gd index 67352b5..a49e8a2 100644 --- a/Scenes/main/main.gd +++ b/Scenes/main/main.gd @@ -29,13 +29,13 @@ func _ready() -> void: title_screen.show() #Connecting Signals - title_screen.connect("new_game_pressed", self._on_new_game_pressed) - UI.connect("save_slot_pressed", self._on_save_slot_pressed) - UI.connect("load_slot_pressed", self._on_load_slot_pressed) - UI.connect("main_menu_pressed", self._on_main_menu_pressed) + title_screen.new_game_pressed.connect(self._on_new_game_pressed) + UI.save_slot_pressed.connect(self._on_save_slot_pressed) + UI.load_slot_pressed.connect(self._on_load_slot_pressed) + UI.main_menu_pressed.connect(self._on_main_menu_pressed) - UI.connect("text_value_changed", self._on_text_value_changed) - UI.connect("auto_value_changed", self._on_auto_value_changed) + UI.text_value_changed.connect(self._on_text_value_changed) + UI.auto_value_changed.connect(self._on_auto_value_changed) UI.its_game_over.back_to_menu.pressed.connect(self._on_main_menu_pressed) @@ -83,7 +83,7 @@ func play_intro(): func start_day(): #Hiding Menu for cinematic impact - UI.get_node("UI/UpperContainer").hide() + UI.pause_menu.menu_button.hide() #Transitioning to day screen $TextScreens/Day.text = "[center]DAY " + str(Globals.day_count) + "[/center]" @@ -104,7 +104,7 @@ func start_day(): #Transitioning to the screening desk scenes_to_hide = scenes_to_show - scenes_to_show = [$ScreeningDesk, UI, UI.get_node("UI/UpperContainer")] + scenes_to_show = [$ScreeningDesk, UI.pause_menu.menu_button] UI.masks.transition(scenes_to_hide, scenes_to_show) await UI.masks.transition_finished @@ -145,12 +145,12 @@ func save_game(save_slot_number:int): print("Failed to open file for saving.") #Updating save/load slots information - var save_slot_path = "UI/Save/MarginContainer/VBoxContainer/SaveSlot" + str(save_slot_number) - var load_slot_path = "UI/Load/MarginContainer/VBoxContainer/LoadSlot" + str(save_slot_number) + var save_slot_path = "Menu/Save/MarginContainer/VBoxContainer/SaveSlot" + str(save_slot_number) + var load_slot_path = "Menu/Load/MarginContainer/VBoxContainer/LoadSlot" + str(save_slot_number) var save_slot = UI.get_node(save_slot_path) var load_slot = UI.get_node(load_slot_path) - save_slot.text = "DAY " + str(save_data["day_count"]) + ", FLOOR " + str(save_data["floor_count"]) + "\nSAVE DATE : " + str(save_data["save_date"]) + save_slot.text = "FLOOR " + str(save_data["floor_count"]) + "\nSAVE DATE : " + str(save_data["save_date"]) load_slot.text = save_slot.text @@ -162,10 +162,8 @@ func load_game(load_slot_number:int): clear_balloon() #Hiding loading menus and masks - UI.masks.mask.visible = false - UI.get_node("UI/Menu").hide() - UI.get_node("UI/UpperContainer").hide() - UI.get_node("UI/Load").hide() + UI.masks.mask.hide() + UI.pause_menu.reset() #Opening save file var file = FileAccess.open("res://Saves/save_" + str(load_slot_number) + ".json", FileAccess.READ) @@ -213,8 +211,8 @@ func _on_main_menu_pressed(): clear_balloon() #Hiding menus - UI.get_node("UI/Menu").hide() - UI.get_node("UI/UpperContainer").hide() + UI.get_node("Menu/Menu").hide() + UI.get_node("Menu/UpperContainer").hide() #Going back to main menu var scenes_to_hide = [$ScreeningDesk, $TextScreens, $TextScreens/Day, UI.its_game_over] @@ -232,13 +230,11 @@ func _on_main_menu_pressed(): func update_slots(): #Loops over the 4 save/load slots - for save_number in range(1, 5): + for save_number in range(1, Globals.save_slot_count + 1): #Retrieves save and load slots - var save_slot_path = "UI/Save/MarginContainer/VBoxContainer/SaveSlot" + str(save_number) - var load_slot_path = "UI/Load/MarginContainer/VBoxContainer/LoadSlot" + str(save_number) - var save_slot = UI.get_node(save_slot_path) - var load_slot = UI.get_node(load_slot_path) + var save_slot = UI.pause_menu.save.save_slot[save_number] + var load_slot = UI.pause_menu.load.load_slot[save_number] #Retrieves save path var save_path = "res://Saves/save_" + str(save_number) + ".json" @@ -252,7 +248,7 @@ func update_slots(): if typeof(load_data) == 27: #Checks if loaded data is a Dictionary #Updates save and load slots texts print("Initializing save slot #" + str(save_number) + " : " + str(load_data)) - save_slot.text = "DAY " + str(load_data["day_count"]) + ", FLOOR " + str(load_data["floor_count"]) + "\nSAVE DATE : " + str(load_data["save_date"]) + save_slot.text = "FLOOR " + str(load_data["floor_count"]) + "\nSAVE DATE : " + str(load_data["save_date"]) load_slot.text = save_slot.text else: print("Failed to parse Loading Data.")