small changes
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
[gd_scene load_steps=11 format=3 uid="uid://bh0e0uhmtk0ck"]
|
[gd_scene load_steps=11 format=3 uid="uid://bh0e0uhmtk0ck"]
|
||||||
|
|
||||||
[ext_resource type="Script" path="res://Dialogues/balloon.gd" id="1_36de5"]
|
[ext_resource type="Script" path="res://Dialogues/balloon.gd" id="1_trhxk"]
|
||||||
[ext_resource type="PackedScene" uid="uid://ckvgyvclnwggo" path="res://addons/dialogue_manager/dialogue_label.tscn" id="2_a8ve6"]
|
[ext_resource type="FontFile" uid="uid://mi5v1uq78g7o" path="res://Art/XanhMono-Italic.ttf" id="2_8uhga"]
|
||||||
[ext_resource type="FontFile" uid="uid://mi5v1uq78g7o" path="res://Art/XanhMono-Italic.ttf" id="2_qju6n"]
|
[ext_resource type="PackedScene" uid="uid://ckvgyvclnwggo" path="res://addons/dialogue_manager/dialogue_label.tscn" id="3_ek02p"]
|
||||||
[ext_resource type="FontFile" uid="uid://ckg5x0oonnjtn" path="res://Art/XanhMono-Regular.ttf" id="3_66oah"]
|
[ext_resource type="FontFile" uid="uid://ckg5x0oonnjtn" path="res://Art/XanhMono-Regular.ttf" id="4_ovm88"]
|
||||||
[ext_resource type="Script" path="res://addons/dialogue_manager/dialogue_reponses_menu.gd" id="3_72ixx"]
|
[ext_resource type="Script" path="res://addons/dialogue_manager/dialogue_reponses_menu.gd" id="5_s4c7i"]
|
||||||
|
|
||||||
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_spyqn"]
|
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_spyqn"]
|
||||||
bg_color = Color(0, 0, 0, 1)
|
bg_color = Color(0, 0, 0, 1)
|
||||||
@@ -67,7 +67,7 @@ Panel/styles/panel = SubResource("StyleBoxFlat_uy0d5")
|
|||||||
|
|
||||||
[node name="ExampleBalloon" type="CanvasLayer"]
|
[node name="ExampleBalloon" type="CanvasLayer"]
|
||||||
layer = 100
|
layer = 100
|
||||||
script = ExtResource("1_36de5")
|
script = ExtResource("1_trhxk")
|
||||||
|
|
||||||
[node name="Balloon" type="Control" parent="."]
|
[node name="Balloon" type="Control" parent="."]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
@@ -107,22 +107,22 @@ unique_name_in_owner = true
|
|||||||
modulate = Color(1, 1, 1, 0.501961)
|
modulate = Color(1, 1, 1, 0.501961)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
mouse_filter = 1
|
mouse_filter = 1
|
||||||
theme_override_fonts/normal_font = ExtResource("2_qju6n")
|
theme_override_fonts/normal_font = ExtResource("2_8uhga")
|
||||||
theme_override_font_sizes/normal_font_size = 25
|
theme_override_font_sizes/normal_font_size = 25
|
||||||
bbcode_enabled = true
|
bbcode_enabled = true
|
||||||
text = "Character"
|
text = "Character"
|
||||||
fit_content = true
|
fit_content = true
|
||||||
scroll_active = false
|
scroll_active = false
|
||||||
|
|
||||||
[node name="DialogueLabel" parent="Balloon/Panel/Dialogue/VBoxContainer" instance=ExtResource("2_a8ve6")]
|
[node name="DialogueLabel" parent="Balloon/Panel/Dialogue/VBoxContainer" instance=ExtResource("3_ek02p")]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_vertical = 3
|
size_flags_vertical = 3
|
||||||
theme_override_fonts/normal_font = ExtResource("3_66oah")
|
theme_override_fonts/normal_font = ExtResource("4_ovm88")
|
||||||
theme_override_fonts/mono_font = ExtResource("3_66oah")
|
theme_override_fonts/mono_font = ExtResource("4_ovm88")
|
||||||
theme_override_fonts/italics_font = ExtResource("2_qju6n")
|
theme_override_fonts/italics_font = ExtResource("2_8uhga")
|
||||||
theme_override_fonts/bold_italics_font = ExtResource("2_qju6n")
|
theme_override_fonts/bold_italics_font = ExtResource("2_8uhga")
|
||||||
theme_override_fonts/bold_font = ExtResource("3_66oah")
|
theme_override_fonts/bold_font = ExtResource("4_ovm88")
|
||||||
theme_override_font_sizes/bold_italics_font_size = 30
|
theme_override_font_sizes/bold_italics_font_size = 30
|
||||||
theme_override_font_sizes/italics_font_size = 30
|
theme_override_font_sizes/italics_font_size = 30
|
||||||
theme_override_font_sizes/mono_font_size = 30
|
theme_override_font_sizes/mono_font_size = 30
|
||||||
@@ -149,7 +149,7 @@ unique_name_in_owner = true
|
|||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_vertical = 8
|
size_flags_vertical = 8
|
||||||
theme_override_constants/separation = 2
|
theme_override_constants/separation = 2
|
||||||
script = ExtResource("3_72ixx")
|
script = ExtResource("5_s4c7i")
|
||||||
response_template = NodePath("ResponseExample")
|
response_template = NodePath("ResponseExample")
|
||||||
|
|
||||||
[node name="ResponseExample" type="Button" parent="Balloon/Responses/ResponsesMenu"]
|
[node name="ResponseExample" type="Button" parent="Balloon/Responses/ResponsesMenu"]
|
||||||
@@ -4,9 +4,3 @@ extends Control
|
|||||||
# 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:
|
||||||
self.hide()
|
self.hide()
|
||||||
pass # Replace with function body.
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
pass
|
|
||||||
|
|||||||
@@ -22,9 +22,3 @@ func build_dialog_tree(tree_model: Array[int]) -> Dictionary:
|
|||||||
tree.merge(branch)
|
tree.merge(branch)
|
||||||
|
|
||||||
return tree
|
return tree
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
pass
|
|
||||||
|
|||||||
+22
-3
@@ -1,5 +1,6 @@
|
|||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
|
var balloon: Node
|
||||||
|
|
||||||
# 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:
|
||||||
@@ -7,6 +8,24 @@ func _ready() -> void:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
func start_balloon(dialogue_resource: Resource, start_title: String):
|
||||||
func _process(delta: float) -> void:
|
|
||||||
pass
|
#Freeing Previous Balloon and Disconnecting DialogueManager signals
|
||||||
|
clean_balloon()
|
||||||
|
|
||||||
|
#Instantiating a custom balloon
|
||||||
|
var balloon_path = "res://Dialogues/balloon_big.tscn"
|
||||||
|
var Balloon: Resource = load(balloon_path)
|
||||||
|
balloon = Balloon.instantiate()
|
||||||
|
get_tree().current_scene.add_child(balloon)
|
||||||
|
|
||||||
|
#Starting dialogue
|
||||||
|
balloon.start(dialogue_resource, start_title)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
func clean_balloon():
|
||||||
|
|
||||||
|
#Freeing Previous Balloon
|
||||||
|
if is_instance_valid(balloon):
|
||||||
|
balloon.queue_free()
|
||||||
|
|||||||
@@ -21,9 +21,3 @@ func get_save_date() -> String:
|
|||||||
dt.month, dt.day, dt.year,
|
dt.month, dt.day, dt.year,
|
||||||
dt.hour, dt.minute
|
dt.hour, dt.minute
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
pass
|
|
||||||
|
|||||||
+19
-11
@@ -6,6 +6,9 @@ extends Control
|
|||||||
@export var TextScreens: PackedScene
|
@export var TextScreens: PackedScene
|
||||||
@export var DialogueScreens: PackedScene
|
@export var DialogueScreens: PackedScene
|
||||||
|
|
||||||
|
var balloon: Node
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# 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:
|
||||||
@@ -45,12 +48,6 @@ func _ready() -> void:
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Starts a new game
|
# Starts a new game
|
||||||
func _on_new_game_pressed():
|
func _on_new_game_pressed():
|
||||||
Globals.day_count = 1
|
Globals.day_count = 1
|
||||||
@@ -76,7 +73,7 @@ func play_intro():
|
|||||||
TransitionScreen.transition("big", [$TextScreens, $TextScreens/MarginContainer, text_container.get_child(4), UI, UI.get_node("UI/SkipContainer")], [$DialogueScreens])
|
TransitionScreen.transition("big", [$TextScreens, $TextScreens/MarginContainer, text_container.get_child(4), UI, UI.get_node("UI/SkipContainer")], [$DialogueScreens])
|
||||||
await TransitionScreen.transition_finished
|
await TransitionScreen.transition_finished
|
||||||
|
|
||||||
DialogueManager.show_dialogue_balloon(Globals.dialogue_intro, "start")
|
$DialogueScreens.start_balloon(Globals.dialogue_intro, "start")
|
||||||
await DialogueManager.dialogue_ended
|
await DialogueManager.dialogue_ended
|
||||||
|
|
||||||
#Starting the day
|
#Starting the day
|
||||||
@@ -115,7 +112,7 @@ func _on_recovery_pressed():
|
|||||||
await TransitionScreen.transition_finished
|
await TransitionScreen.transition_finished
|
||||||
|
|
||||||
#End of day dialogue
|
#End of day dialogue
|
||||||
DialogueManager.show_dialogue_balloon(Globals.dialogue_recovery, "end_of_day_" + str(Globals.day_count))
|
$DialogueScreens.start_balloon(Globals.dialogue_recovery, "end_of_day_" + str(Globals.day_count))
|
||||||
await DialogueManager.dialogue_ended
|
await DialogueManager.dialogue_ended
|
||||||
|
|
||||||
#Start of the next day
|
#Start of the next day
|
||||||
@@ -160,11 +157,16 @@ func save_game(save_slot_number:int):
|
|||||||
#Loads save file from the selected load slot
|
#Loads save file from the selected load slot
|
||||||
func load_game(load_slot_number:int):
|
func load_game(load_slot_number:int):
|
||||||
|
|
||||||
|
#CLeaning balloons
|
||||||
|
$DialogueScreens.clean_balloon()
|
||||||
|
$ScreeningDesk.clean_balloon()
|
||||||
|
|
||||||
#Hiding loading menus and masks
|
#Hiding loading menus and masks
|
||||||
TransitionScreen.mask.visible = false
|
TransitionScreen.mask.visible = false
|
||||||
|
UI.get_node("UI/Menu").hide()
|
||||||
|
UI.get_node("UI/UpperContainer").hide()
|
||||||
UI.get_node("UI/Load").hide()
|
UI.get_node("UI/Load").hide()
|
||||||
UI.get_node("UI/LoadTitle").hide()
|
UI.get_node("UI/LoadTitle").hide()
|
||||||
UI.get_node("UI/Menu").hide()
|
|
||||||
|
|
||||||
#Opening save file
|
#Opening save file
|
||||||
var file = FileAccess.open("res://Saves/save_" + str(load_slot_number) + ".json", FileAccess.READ)
|
var file = FileAccess.open("res://Saves/save_" + str(load_slot_number) + ".json", FileAccess.READ)
|
||||||
@@ -202,10 +204,16 @@ func _on_load_slot_pressed(load_slot):
|
|||||||
|
|
||||||
func _on_main_menu_pressed():
|
func _on_main_menu_pressed():
|
||||||
|
|
||||||
#Hiding menu
|
#Removing mask
|
||||||
|
TransitionScreen.mask.visible = false
|
||||||
|
|
||||||
|
#Cleaning balloons
|
||||||
|
$DialogueScreens.clean_balloon()
|
||||||
|
$ScreeningDesk.clean_balloon()
|
||||||
|
|
||||||
|
#Hiding menus
|
||||||
UI.get_node("UI/Menu").hide()
|
UI.get_node("UI/Menu").hide()
|
||||||
UI.get_node("UI/UpperContainer").hide()
|
UI.get_node("UI/UpperContainer").hide()
|
||||||
TransitionScreen.mask.visible = false
|
|
||||||
|
|
||||||
#Going back to main menu
|
#Going back to main menu
|
||||||
var scenes_to_hide = [$ScreeningDesk, $Bedroom, $TextScreens, $TextScreens/Day, $ScreeningDesk.patient_controls, $ScreeningDesk.end_of_day_controls, $ScreeningDesk.patient_texture, $ScreeningDesk.panel_container, $ScreeningDesk.face_zoom] + $ScreeningDesk.margin_container.get_children()
|
var scenes_to_hide = [$ScreeningDesk, $Bedroom, $TextScreens, $TextScreens/Day, $ScreeningDesk.patient_controls, $ScreeningDesk.end_of_day_controls, $ScreeningDesk.patient_texture, $ScreeningDesk.panel_container, $ScreeningDesk.face_zoom] + $ScreeningDesk.margin_container.get_children()
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@ CurrentPatient="*res://current_patient.gd"
|
|||||||
|
|
||||||
[dialogue_manager]
|
[dialogue_manager]
|
||||||
|
|
||||||
general/balloon_path="res://Dialogues/balloon.tscn"
|
general/balloon_path="res://Dialogues/balloon_big.tscn"
|
||||||
|
|
||||||
[display]
|
[display]
|
||||||
|
|
||||||
|
|||||||
+12
-7
@@ -93,6 +93,7 @@ func new_patient(patient_id):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Show patient file
|
||||||
func _on_patient_file_pressed():
|
func _on_patient_file_pressed():
|
||||||
|
|
||||||
for node in margin_container.get_children():
|
for node in margin_container.get_children():
|
||||||
@@ -103,6 +104,7 @@ func _on_patient_file_pressed():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Show guidebook
|
||||||
func _on_guidebook_pressed():
|
func _on_guidebook_pressed():
|
||||||
|
|
||||||
for node in margin_container.get_children():
|
for node in margin_container.get_children():
|
||||||
@@ -113,6 +115,7 @@ func _on_guidebook_pressed():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Brings in next patient
|
||||||
func _on_call_next_patient_pressed():
|
func _on_call_next_patient_pressed():
|
||||||
|
|
||||||
#Hiding and Showing appropriate scenes
|
#Hiding and Showing appropriate scenes
|
||||||
@@ -126,6 +129,7 @@ func _on_call_next_patient_pressed():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Shows patient recording
|
||||||
func _on_patient_recording_pressed():
|
func _on_patient_recording_pressed():
|
||||||
|
|
||||||
for node in margin_container.get_children():
|
for node in margin_container.get_children():
|
||||||
@@ -136,6 +140,7 @@ func _on_patient_recording_pressed():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Records the dialogues
|
||||||
func _recording_text(dialogue_line):
|
func _recording_text(dialogue_line):
|
||||||
|
|
||||||
var line = dialogue_line.text
|
var line = dialogue_line.text
|
||||||
@@ -156,6 +161,7 @@ func _recording_text(dialogue_line):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Show face zoom
|
||||||
func _on_examine_pressed():
|
func _on_examine_pressed():
|
||||||
|
|
||||||
for node in margin_container.get_children():
|
for node in margin_container.get_children():
|
||||||
@@ -165,6 +171,7 @@ func _on_examine_pressed():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Change emotions following dialogue tags
|
||||||
func _change_emotion(dialogue_line) -> void:
|
func _change_emotion(dialogue_line) -> void:
|
||||||
|
|
||||||
var line_tag = dialogue_line.tags
|
var line_tag = dialogue_line.tags
|
||||||
@@ -178,6 +185,7 @@ func _change_emotion(dialogue_line) -> void:
|
|||||||
|
|
||||||
func _on_containment_pressed():
|
func _on_containment_pressed():
|
||||||
|
|
||||||
|
#Ask for confirmation
|
||||||
var lambda = func(): clear_patient("containment")
|
var lambda = func(): clear_patient("containment")
|
||||||
var choice_text = "[center]Do you really want to send this patient to [color=darkred]Containment[/color] ?[/center]"
|
var choice_text = "[center]Do you really want to send this patient to [color=darkred]Containment[/color] ?[/center]"
|
||||||
|
|
||||||
@@ -187,6 +195,7 @@ func _on_containment_pressed():
|
|||||||
|
|
||||||
func _on_psych_ward_pressed():
|
func _on_psych_ward_pressed():
|
||||||
|
|
||||||
|
#Ask for confirmation
|
||||||
var lambda = func(): clear_patient("psych_ward")
|
var lambda = func(): clear_patient("psych_ward")
|
||||||
var choice_text = "[center]Do you really want to send this patient to the [color=darkgreen]Psych Ward[/color] ?[/center]"
|
var choice_text = "[center]Do you really want to send this patient to the [color=darkgreen]Psych Ward[/color] ?[/center]"
|
||||||
|
|
||||||
@@ -194,6 +203,7 @@ func _on_psych_ward_pressed():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Starting dialogue
|
||||||
func start_balloon(dialogue_resource: Resource, start_title: String):
|
func start_balloon(dialogue_resource: Resource, start_title: String):
|
||||||
|
|
||||||
#Freeing Previous Balloon and Disconnecting DialogueManager signals
|
#Freeing Previous Balloon and Disconnecting DialogueManager signals
|
||||||
@@ -211,6 +221,7 @@ func start_balloon(dialogue_resource: Resource, start_title: String):
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Clears patient and transitions towards next patient or end of day
|
||||||
func clear_patient(choice:String):
|
func clear_patient(choice:String):
|
||||||
|
|
||||||
#Hiding Patient Controls and showing Patient Face
|
#Hiding Patient Controls and showing Patient Face
|
||||||
@@ -254,6 +265,7 @@ func _on_recovery_pressed():
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#Cleaning balloon
|
||||||
func clean_balloon():
|
func clean_balloon():
|
||||||
|
|
||||||
#Freeing Previous Balloon and Disconnecting DialogueManager signals
|
#Freeing Previous Balloon and Disconnecting DialogueManager signals
|
||||||
@@ -263,10 +275,3 @@ func clean_balloon():
|
|||||||
DialogueManager.disconnect("got_dialogue", _change_emotion)
|
DialogueManager.disconnect("got_dialogue", _change_emotion)
|
||||||
if DialogueManager.is_connected("got_dialogue", _recording_text):
|
if DialogueManager.is_connected("got_dialogue", _recording_text):
|
||||||
DialogueManager.disconnect("got_dialogue", _recording_text)
|
DialogueManager.disconnect("got_dialogue", _recording_text)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|||||||
+1
-7
@@ -7,15 +7,9 @@ extends CanvasLayer
|
|||||||
# 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:
|
||||||
|
|
||||||
|
#Hiding everything
|
||||||
self.hide()
|
self.hide()
|
||||||
for node in intro_text_container.get_children():
|
for node in intro_text_container.get_children():
|
||||||
node.hide()
|
node.hide()
|
||||||
$MarginContainer/IntroBoxContainer/Header.hide()
|
$MarginContainer/IntroBoxContainer/Header.hide()
|
||||||
|
|
||||||
$Day.hide()
|
$Day.hide()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
pass
|
|
||||||
|
|||||||
+5
-10
@@ -1,30 +1,25 @@
|
|||||||
extends CanvasLayer
|
extends CanvasLayer
|
||||||
|
|
||||||
signal new_game_pressed
|
signal new_game_pressed
|
||||||
signal load_pressed
|
|
||||||
signal settings_pressed
|
signal settings_pressed
|
||||||
|
|
||||||
|
|
||||||
# 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:
|
||||||
|
|
||||||
|
#Connecting signals
|
||||||
$TitleScreen/MenuContainer/NewGame.pressed.connect(_on_new_game_pressed)
|
$TitleScreen/MenuContainer/NewGame.pressed.connect(_on_new_game_pressed)
|
||||||
$TitleScreen/MenuContainer/Load.pressed.connect(_on_load_pressed)
|
$TitleScreen/MenuContainer/Load.pressed.connect(_on_load_pressed)
|
||||||
$TitleScreen/MenuContainer/Settings.pressed.connect(_on_settings_pressed)
|
$TitleScreen/MenuContainer/Settings.pressed.connect(_on_settings_pressed)
|
||||||
$TitleScreen/MenuContainer/QuitGame.pressed.connect(_on_quit_game_pressed)
|
$TitleScreen/MenuContainer/QuitGame.pressed.connect(_on_quit_game_pressed)
|
||||||
|
|
||||||
|
#Hiding everything
|
||||||
self.hide()
|
self.hide()
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _on_new_game_pressed() -> void:
|
func _on_new_game_pressed() -> void:
|
||||||
new_game_pressed.emit()
|
new_game_pressed.emit()
|
||||||
print("Starting New Game...")
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -33,9 +28,9 @@ func _on_load_pressed():
|
|||||||
TransitionScreen.mask.visible = true
|
TransitionScreen.mask.visible = true
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _on_settings_pressed() -> void:
|
func _on_settings_pressed() -> void:
|
||||||
settings_pressed.emit()
|
settings_pressed.emit()
|
||||||
pass
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -14,20 +14,26 @@ signal transition_finished
|
|||||||
# 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:
|
||||||
|
|
||||||
|
#Hiding masks
|
||||||
big_fading.visible = false
|
big_fading.visible = false
|
||||||
small_fading.visible = false
|
small_fading.visible = false
|
||||||
mask.visible = false
|
mask.visible = false
|
||||||
|
|
||||||
|
#Connecting signals
|
||||||
big_animation.connect("animation_finished", _on_animation_finished)
|
big_animation.connect("animation_finished", _on_animation_finished)
|
||||||
small_animation.connect("animation_finished", _on_animation_finished)
|
small_animation.connect("animation_finished", _on_animation_finished)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func _on_animation_finished(anim_name):
|
func _on_animation_finished(anim_name):
|
||||||
|
|
||||||
|
#Fades back to normal when fade_to_black is done
|
||||||
if anim_name == "fade_to_black":
|
if anim_name == "fade_to_black":
|
||||||
fading_finished.emit()
|
fading_finished.emit()
|
||||||
big_animation.play("fade_to_normal")
|
big_animation.play("fade_to_normal")
|
||||||
small_animation.play("fade_to_normal")
|
small_animation.play("fade_to_normal")
|
||||||
|
|
||||||
|
#Resets everything when fading_to_normal is done
|
||||||
elif anim_name == "fade_to_normal":
|
elif anim_name == "fade_to_normal":
|
||||||
transition_finished.emit()
|
transition_finished.emit()
|
||||||
Globals.is_transitioning = false
|
Globals.is_transitioning = false
|
||||||
@@ -53,10 +59,11 @@ func fading(size):
|
|||||||
#Transitions the scenes
|
#Transitions the scenes
|
||||||
func transition(fading_screen_size, scenes_to_hide, scenes_to_show):
|
func transition(fading_screen_size, scenes_to_hide, scenes_to_show):
|
||||||
|
|
||||||
|
#Fade in and out
|
||||||
fading(fading_screen_size)
|
fading(fading_screen_size)
|
||||||
|
|
||||||
await self.fading_finished
|
await self.fading_finished
|
||||||
|
|
||||||
|
#When the screen is black from fading, change the shown scenes before it fades back to normal
|
||||||
for scene in scenes_to_hide:
|
for scene in scenes_to_hide:
|
||||||
scene.hide()
|
scene.hide()
|
||||||
for scene in scenes_to_show:
|
for scene in scenes_to_show:
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ tracks/0/keys = {
|
|||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_20bx3"]
|
[sub_resource type="Animation" id="Animation_20bx3"]
|
||||||
resource_name = "fade_to_black"
|
resource_name = "fade_to_black"
|
||||||
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
|
||||||
@@ -35,7 +34,6 @@ tracks/0/keys = {
|
|||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_in743"]
|
[sub_resource type="Animation" id="Animation_in743"]
|
||||||
resource_name = "fade_to_normal"
|
resource_name = "fade_to_normal"
|
||||||
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
|
||||||
|
|||||||
@@ -204,12 +204,3 @@ func _on_load_slot_pressed(load_slot_number: int):
|
|||||||
ask_confirmation(lambda, Callable(), choice_text)
|
ask_confirmation(lambda, Callable(), choice_text)
|
||||||
else:
|
else:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Called every frame. 'delta' is the elapsed time since the previous frame.
|
|
||||||
func _process(delta: float) -> void:
|
|
||||||
pass
|
|
||||||
|
|||||||
Reference in New Issue
Block a user