fix: Huge cleanup (#420)

Co-authored-by: Dennis Ploeger <develop@dieploegers.de>
This commit is contained in:
Dennis Ploeger
2021-10-25 08:59:07 +02:00
committed by GitHub
parent 3de06adcf9
commit 94d86d24d5
101 changed files with 1091 additions and 67952 deletions

View File

@@ -1,86 +0,0 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://addons/escoria-core/game/assets/fonts/efmi/efmi_font.tres" type="DynamicFont" id=1]
[ext_resource path="res://addons/escoria-core/game/assets/images/no_image.png" type="Texture" id=2]
[ext_resource path="res://addons/escoria-core/template_scenes/dialog_scenes/dialog_box_inset.gd" type="Script" id=3]
[ext_resource path="res://game/ui/commons/dialogs/insets/dialog_box_avatars.tscn" type="PackedScene" id=4]
[node name="dialog_box" type="PanelContainer"]
anchor_left = 0.155
anchor_top = 0.334
anchor_right = 0.845
anchor_bottom = 0.666
margin_left = 0.100006
margin_top = -0.200012
margin_right = -0.100098
margin_bottom = 0.199951
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MarginContainer" type="MarginContainer" parent="."]
margin_left = 7.0
margin_top = 7.0
margin_right = 876.0
margin_bottom = 292.2
custom_constants/margin_right = 20
custom_constants/margin_top = 20
custom_constants/margin_left = 20
custom_constants/margin_bottom = 20
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HSplitContainer" type="HSplitContainer" parent="MarginContainer"]
margin_left = 20.0
margin_top = 20.0
margin_right = 849.0
margin_bottom = 265.0
custom_constants/separation = 35
dragger_visibility = 1
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/HSplitContainer"]
margin_right = 174.0
margin_bottom = 245.0
size_flags_horizontal = 3
size_flags_stretch_ratio = 0.3
[node name="avatar" type="TextureRect" parent="MarginContainer/HSplitContainer/VBoxContainer"]
margin_right = 174.0
margin_bottom = 217.0
size_flags_horizontal = 3
size_flags_vertical = 3
texture = ExtResource( 2 )
expand = true
[node name="name" type="Label" parent="MarginContainer/HSplitContainer/VBoxContainer"]
margin_top = 221.0
margin_right = 174.0
margin_bottom = 245.0
custom_fonts/font = ExtResource( 1 )
valign = 1
[node name="text" type="RichTextLabel" parent="MarginContainer/HSplitContainer"]
margin_left = 209.0
margin_right = 829.0
margin_bottom = 245.0
size_flags_horizontal = 3
custom_fonts/normal_font = ExtResource( 1 )
bbcode_enabled = true
bbcode_text = "Here be some text"
text = "Here be some text"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Tween" type="Tween" parent="MarginContainer/HSplitContainer/text"]
[node name="dialog_avatars" parent="." instance=ExtResource( 4 )]
visible = false
margin_left = 7.0
margin_top = 7.0
margin_right = 876.0
margin_bottom = 259.0
[node name="Timer" type="Timer" parent="."]

View File

@@ -1,22 +0,0 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://addons/escoria-core/game/assets/fonts/efmi/efmi_font.tres" type="DynamicFont" id=1]
[ext_resource path="res://addons/escoria-core/template_scenes/dialog_scenes/dialog_label.gd" type="Script" id=2]
[node name="dialog_label" type="RichTextLabel"]
margin_right = 643.0
margin_bottom = 60.0
custom_fonts/normal_font = ExtResource( 1 )
bbcode_enabled = true
bbcode_text = "[center]Here be some text.[/center]"
text = "Here be some text."
fit_content_height = true
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
text_speed_per_character = 0.0
[node name="Tween" type="Tween" parent="."]
[node name="Timer" type="Timer" parent="."]

View File

@@ -1,16 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://game/ui/commons/dialogs/insets/mark_talk_down_right_1.png" type="Texture" id=1]
[node name="dialog_avatars" type="Control"]
__meta__ = {
"_edit_use_anchors_": false
}
[node name="player" type="TextureRect" parent="."]
margin_right = 23.0
margin_bottom = 27.0
texture = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -1,67 +0,0 @@
extends ESCDialogOptionsChooser
export(Color, RGB) var color_normal = Color(1.0,1.0,1.0,1.0)
export(Color, RGB) var color_hover = Color(165.0,42.0,42.0, 1.0)
export(Font) var font
func _ready() -> void:
hide_chooser()
func _process(delta: float) -> void:
if $MarginContainer.visible and self.dialog and self.dialog.timeout > 0:
$TimerProgress.value = (
self.dialog.timeout - $Timer.time_left
) / self.dialog.timeout * 100
func show_chooser():
var _vbox = $MarginContainer/ScrollContainer/VBoxContainer
for option_node in _vbox.get_children():
_vbox.remove_child(option_node)
_remove_avatar()
for option in self.dialog.options:
var _option_node = Button.new()
_option_node.text = (option as ESCDialogOption).option
_option_node.flat = true
_option_node.add_color_override("font_color", color_normal)
_option_node.add_color_override("font_color_hover", color_hover)
_option_node.add_font_override("font", font)
_vbox.add_child(_option_node)
_option_node.connect("pressed", self, "_on_answer_selected", [option])
if self.dialog.avatar != "-":
$AvatarContainer.add_child(
ResourceLoader.load(self.dialog.avatar).instance()
)
$MarginContainer.show()
if self.dialog.timeout > 0:
$Timer.start(self.dialog.timeout)
func hide_chooser():
$MarginContainer.hide()
func _option_chosen(option: ESCDialogOption):
_remove_avatar()
$TimerProgress.value = 0
emit_signal("option_chosen", option)
func _on_answer_selected(option: ESCDialogOption):
_option_chosen(option)
func _on_Timer_timeout() -> void:
_option_chosen(self.dialog.options[self.dialog.timeout_option - 1])
func _remove_avatar():
if $AvatarContainer.get_child_count() > 0:
$AvatarContainer.remove_child($AvatarContainer.get_child(0))

View File

@@ -1,64 +0,0 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://addons/escoria-core/template_scenes/dialog_scenes/dialog_choosers/text_dialog_choice.gd" type="Script" id=1]
[ext_resource path="res://addons/escoria-core/game/assets/fonts/efmi/efmi_font.tres" type="DynamicFont" id=2]
[sub_resource type="Gradient" id=1]
colors = PoolColorArray( 1, 0, 0, 1, 1, 0, 0, 1 )
[sub_resource type="GradientTexture" id=2]
gradient = SubResource( 1 )
[node name="text_dialog_choice" type="Node"]
script = ExtResource( 1 )
color_hover = Color( 0.647059, 0.164706, 0.164706, 1 )
font = ExtResource( 2 )
[node name="MarginContainer" type="MarginContainer" parent="."]
margin_left = 20.0
margin_top = 20.0
margin_right = 1280.0
margin_bottom = 900.0
mouse_filter = 2
custom_constants/margin_top = 20
custom_constants/margin_left = 20
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ScrollContainer" type="ScrollContainer" parent="MarginContainer"]
margin_left = 20.0
margin_top = 20.0
margin_right = 1260.0
margin_bottom = 880.0
scroll_horizontal_enabled = false
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/ScrollContainer"]
margin_right = 1240.0
margin_bottom = 860.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 20
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Timer" type="Timer" parent="."]
one_shot = true
[node name="TimerProgress" type="TextureProgress" parent="."]
anchor_right = 1.0
rect_min_size = Vector2( 0, 20 )
texture_progress = SubResource( 2 )
nine_patch_stretch = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="AvatarContainer" type="Node2D" parent="."]
position = Vector2( 29.1458, 120.012 )
[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]

View File

@@ -1,7 +0,0 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://addons/escoria-core/game/assets/fonts/efmi/efmi.TTF" type="DynamicFontData" id=1]
[resource]
size = 21
font_data = ExtResource( 1 )

View File

@@ -1,30 +0,0 @@
extends Control
signal back_button_pressed
export(PackedScene) var slot_ui_scene
func _ready():
refresh_savegames()
func _on_slot_pressed(slot_id: int) -> void:
escoria.save_manager.load_game(slot_id)
func _on_back_pressed():
emit_signal("back_button_pressed")
func refresh_savegames():
for slot in $CenterContainer/VBoxContainer/\
ScrollContainer/slots.get_children():
$CenterContainer/VBoxContainer/\
ScrollContainer/slots.remove_child(slot)
var saves_list = escoria.save_manager.get_saves_list()
for i in saves_list.size():
var save_data = saves_list[i+1]
var new_slot = slot_ui_scene.instance()
$CenterContainer/VBoxContainer/ScrollContainer/slots.add_child(
new_slot
)
new_slot.set_slot_name_date(save_data["name"], save_data["date"])
new_slot.connect("pressed", self, "_on_slot_pressed", [i+1])

View File

@@ -1,60 +0,0 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=1]
[ext_resource path="res://game/ui/commons/load_save_slot/load_save_slot.tscn" type="PackedScene" id=2]
[ext_resource path="res://game/ui/commons/load/load_game.gd" type="Script" id=3]
[node name="load_game" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
slot_ui_scene = ExtResource( 2 )
[node name="CenterContainer" type="CenterContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
margin_left = 390.0
margin_top = 184.0
margin_right = 890.0
margin_bottom = 715.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ScrollContainer" type="ScrollContainer" parent="CenterContainer/VBoxContainer"]
margin_right = 500.0
margin_bottom = 500.0
rect_min_size = Vector2( 500, 500 )
scroll_horizontal_enabled = false
__meta__ = {
"_edit_use_anchors_": false
}
[node name="slots" type="VBoxContainer" parent="CenterContainer/VBoxContainer/ScrollContainer"]
margin_right = 500.0
margin_bottom = 500.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="back" type="Button" parent="CenterContainer/VBoxContainer"]
margin_top = 504.0
margin_right = 500.0
margin_bottom = 531.0
custom_fonts/font = ExtResource( 1 )
text = "OPTIONS_BACK"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="CenterContainer/VBoxContainer/back" to="." method="_on_back_pressed"]

View File

@@ -1,7 +0,0 @@
extends Button
func set_slot_name_date(p_name: String, p_date: String):
$VBoxContainer/slot_name.text = p_name
$VBoxContainer/date.text = p_date

View File

@@ -1,38 +0,0 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=1]
[ext_resource path="res://game/ui/commons/load_save_slot/load_save_slot.gd" type="Script" id=2]
[node name="slot" type="Button"]
margin_right = 665.0
margin_bottom = 86.0
rect_min_size = Vector2( 0, 100 )
size_flags_horizontal = 3
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
alignment = 1
__meta__ = {
"_edit_use_anchors_": false
}
[node name="slot_name" type="Label" parent="VBoxContainer"]
margin_top = 27.0
margin_right = 665.0
margin_bottom = 48.0
custom_fonts/font = ExtResource( 1 )
text = "slot_name"
align = 1
[node name="date" type="Label" parent="VBoxContainer"]
margin_top = 52.0
margin_right = 665.0
margin_bottom = 73.0
custom_fonts/font = ExtResource( 1 )
text = "date"
align = 1

View File

@@ -1,55 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=1]
[node name="main" type="VBoxContainer"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -179.0
margin_top = -35.746
margin_right = 179.0
margin_bottom = 227.254
custom_constants/separation = 10
__meta__ = {
"_edit_use_anchors_": false
}
[node name="new_game" type="Button" parent="."]
margin_right = 358.0
margin_bottom = 152.0
rect_min_size = Vector2( 0, 150 )
size_flags_vertical = 3
custom_fonts/font = ExtResource( 1 )
text = "NEW_GAME"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="load_game" type="Button" parent="."]
margin_top = 162.0
margin_right = 358.0
margin_bottom = 189.0
custom_fonts/font = ExtResource( 1 )
text = "LOAD_GAME"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="options" type="Button" parent="."]
margin_top = 199.0
margin_right = 358.0
margin_bottom = 226.0
custom_fonts/font = ExtResource( 1 )
text = "OPTIONS"
[node name="quit" type="Button" parent="."]
margin_top = 236.0
margin_right = 358.0
margin_bottom = 263.0
custom_fonts/font = ExtResource( 1 )
text = "QUIT"
__meta__ = {
"_edit_use_anchors_": false
}

View File

@@ -1,62 +0,0 @@
extends Control
func _ready():
var event = ESCEvent.new(":music")
event.statements.append(
ESCCommand.new(
"set_sound_state _music res://game/sfx/Game-Menu_Looping.mp3 true"
)
)
escoria.event_manager.queue_event(event)
var rc = yield(event, "finished")
if rc != ESCExecution.RC_OK:
escoria.logger.report_errors(
"main_menu: Can't start menu music",
[
"set_sound_state returned %d" % rc
]
)
return false
func _on_continue_pressed():
pass
func switch_language(lang: String):
TranslationServer.set_locale(lang)
func _on_new_game_pressed():
escoria.new_game()
func _on_load_game_pressed():
$Panel/CenterContainer/main.hide()
$Panel/load_game.refresh_savegames()
$Panel/load_game.show()
func _on_options_pressed():
$Panel/CenterContainer/main.hide()
$Panel/options.show()
func _on_quit_pressed():
get_tree().quit()
###########################################################################
###########################################################################
# OPTIONS
func _on_options_back_button_pressed():
$Panel/options.hide()
$Panel/CenterContainer/main.show()
func _on_load_game_back_button_pressed():
$Panel/load_game.hide()
$Panel/CenterContainer/main.show()

View File

@@ -1,86 +0,0 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://game/ui/commons/main_menu/main_menu.gd" type="Script" id=1]
[ext_resource path="res://game/ui/commons/main_menu/main.tscn" type="PackedScene" id=2]
[ext_resource path="res://addons/escoria-core/design/escoria-logo-small.png" type="Texture" id=3]
[ext_resource path="res://game/ui/commons/options/options.tscn" type="PackedScene" id=4]
[ext_resource path="res://game/ui/commons/load/load_game.tscn" type="PackedScene" id=5]
[node name="main_menu" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Panel" type="Panel" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false,
"_editor_description_": ""
}
[node name="CenterContainer" type="CenterContainer" parent="Panel"]
anchor_right = 1.0
anchor_bottom = 1.0
[node name="main" type="VBoxContainer" parent="Panel/CenterContainer"]
margin_left = 332.0
margin_top = 151.0
margin_right = 948.0
margin_bottom = 748.0
custom_constants/separation = 100
[node name="TextureRect" type="TextureRect" parent="Panel/CenterContainer/main"]
margin_right = 616.0
margin_bottom = 236.0
texture = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="buttons" parent="Panel/CenterContainer/main" instance=ExtResource( 2 )]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 0.0
margin_top = 336.0
margin_right = 616.0
margin_bottom = 597.0
[node name="new_game" parent="Panel/CenterContainer/main/buttons" index="0"]
margin_right = 616.0
margin_bottom = 150.0
[node name="load_game" parent="Panel/CenterContainer/main/buttons" index="1"]
margin_top = 160.0
margin_right = 616.0
margin_bottom = 187.0
[node name="options" parent="Panel/CenterContainer/main/buttons" index="2"]
margin_top = 197.0
margin_right = 616.0
margin_bottom = 224.0
[node name="quit" parent="Panel/CenterContainer/main/buttons" index="3"]
margin_top = 234.0
margin_right = 616.0
margin_bottom = 261.0
[node name="options" parent="Panel" instance=ExtResource( 4 )]
visible = false
[node name="load_game" parent="Panel" instance=ExtResource( 5 )]
visible = false
[connection signal="pressed" from="Panel/CenterContainer/main/buttons/new_game" to="." method="_on_new_game_pressed"]
[connection signal="pressed" from="Panel/CenterContainer/main/buttons/load_game" to="." method="_on_load_game_pressed"]
[connection signal="pressed" from="Panel/CenterContainer/main/buttons/options" to="." method="_on_options_pressed"]
[connection signal="pressed" from="Panel/CenterContainer/main/buttons/quit" to="." method="_on_quit_pressed"]
[connection signal="back_button_pressed" from="Panel/options" to="." method="_on_options_back_button_pressed"]
[connection signal="back_button_pressed" from="Panel/load_game" to="." method="_on_load_game_back_button_pressed"]
[editable path="Panel/CenterContainer/main/buttons"]

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

View File

@@ -1,86 +0,0 @@
extends Control
signal back_button_pressed
onready var settings_changed = false
var backup_settings
# A list of languages already added to the language selection
var _loaded_languages: Array = []
func _ready() -> void:
var _flags_container: HBoxContainer = \
$CenterContainer/VBoxContainer/MarginContainer/options/flags
for child in _flags_container.get_children():
_flags_container.remove_child(child)
_loaded_languages = []
for lang in TranslationServer.get_loaded_locales():
if not lang in _loaded_languages:
_loaded_languages.append(lang)
var _lang = TextureRect.new()
_lang.texture = load(
"res://game/ui/commons/options/flags/%s.png" % lang
)
_flags_container.add_child(_lang)
_lang.connect("gui_input", self, "_on_language_input", [lang])
func show():
backup_settings = escoria.settings.duplicate()
initialize_options(escoria.settings)
visible = true
func initialize_options(p_settings):
var _options = $CenterContainer/VBoxContainer/MarginContainer/options
_options.get_node("general_volume").value = p_settings["master_volume"]
_options.get_node("sound_volume").value = p_settings["sfx_volume"]
_options.get_node("music_volume").value = p_settings["music_volume"]
_options.get_node("speech_volume").value = p_settings["speech_volume"]
func _on_language_input(event: InputEvent, language: String):
if event.is_pressed():
TranslationServer.set_locale(language)
escoria.settings["text_lang"] = language
settings_changed = true
func _on_sound_volume_changed(value):
escoria.settings["sfx_volume"] = value
escoria._on_settings_loaded(escoria.settings)
settings_changed = true
func _on_music_volume_changed(value):
escoria.settings["music_volume"] = value
escoria._on_settings_loaded(escoria.settings)
settings_changed = true
func _on_general_volume_changed(value):
escoria.settings["master_volume"] = value
escoria._on_settings_loaded(escoria.settings)
settings_changed = true
func _on_apply_pressed():
escoria.save_manager.save_settings()
settings_changed = false
emit_signal("back_button_pressed")
func _on_back_pressed():
escoria.settings = backup_settings
escoria._on_settings_loaded(escoria.settings)
emit_signal("back_button_pressed")
func _on_speech_volume_value_changed(value: float) -> void:
escoria.settings["speech_volume"] = value
escoria._on_settings_loaded(escoria.settings)
settings_changed = true

View File

@@ -1,168 +0,0 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=1]
[ext_resource path="res://game/ui/commons/options/options.gd" type="Script" id=4]
[node name="options" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 4 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CenterContainer" type="CenterContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
margin_left = 482.0
margin_top = 354.0
margin_right = 798.0
margin_bottom = 546.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MarginContainer" type="MarginContainer" parent="CenterContainer/VBoxContainer"]
margin_right = 316.0
margin_bottom = 161.0
size_flags_vertical = 6
custom_constants/margin_right = 20
custom_constants/margin_top = 20
custom_constants/margin_left = 20
custom_constants/margin_bottom = 20
[node name="options" type="GridContainer" parent="CenterContainer/VBoxContainer/MarginContainer"]
margin_left = 20.0
margin_top = 20.0
margin_right = 296.0
margin_bottom = 141.0
size_flags_vertical = 6
custom_constants/hseparation = 40
columns = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="label" type="Label" parent="CenterContainer/VBoxContainer/MarginContainer/options"]
margin_right = 220.0
margin_bottom = 21.0
custom_fonts/font = ExtResource( 1 )
text = "OPTIONS_LANGUAGE"
[node name="flags" type="HBoxContainer" parent="CenterContainer/VBoxContainer/MarginContainer/options"]
margin_left = 260.0
margin_right = 276.0
margin_bottom = 21.0
size_flags_vertical = 3
custom_constants/separation = 30
alignment = 1
[node name="label2" type="Label" parent="CenterContainer/VBoxContainer/MarginContainer/options"]
margin_top = 25.0
margin_right = 220.0
margin_bottom = 46.0
custom_fonts/font = ExtResource( 1 )
text = "GENERAL_VOLUME"
[node name="general_volume" type="HSlider" parent="CenterContainer/VBoxContainer/MarginContainer/options"]
margin_left = 260.0
margin_top = 25.0
margin_right = 276.0
margin_bottom = 41.0
size_flags_horizontal = 3
min_value = 0.001
max_value = 1.0
step = 0.001
value = 0.001
[node name="label3" type="Label" parent="CenterContainer/VBoxContainer/MarginContainer/options"]
margin_top = 50.0
margin_right = 220.0
margin_bottom = 71.0
custom_fonts/font = ExtResource( 1 )
text = "SOUND_VOLUME"
[node name="sound_volume" type="HSlider" parent="CenterContainer/VBoxContainer/MarginContainer/options"]
margin_left = 260.0
margin_top = 50.0
margin_right = 276.0
margin_bottom = 66.0
size_flags_horizontal = 3
min_value = 0.001
max_value = 1.0
step = 0.001
value = 0.001
[node name="label4" type="Label" parent="CenterContainer/VBoxContainer/MarginContainer/options"]
margin_top = 75.0
margin_right = 220.0
margin_bottom = 96.0
custom_fonts/font = ExtResource( 1 )
text = "MUSIC_VOLUME"
[node name="music_volume" type="HSlider" parent="CenterContainer/VBoxContainer/MarginContainer/options"]
margin_left = 260.0
margin_top = 75.0
margin_right = 276.0
margin_bottom = 91.0
size_flags_horizontal = 3
min_value = 0.001
max_value = 1.0
step = 0.001
value = 0.001
[node name="label5" type="Label" parent="CenterContainer/VBoxContainer/MarginContainer/options"]
margin_top = 100.0
margin_right = 220.0
margin_bottom = 121.0
custom_fonts/font = ExtResource( 1 )
text = "SPEECH_VOLUME"
[node name="speech_volume" type="HSlider" parent="CenterContainer/VBoxContainer/MarginContainer/options"]
margin_left = 260.0
margin_top = 100.0
margin_right = 276.0
margin_bottom = 116.0
size_flags_horizontal = 3
min_value = 0.001
max_value = 1.0
step = 0.001
value = 0.001
[node name="HBoxContainer" type="HBoxContainer" parent="CenterContainer/VBoxContainer"]
margin_top = 165.0
margin_right = 316.0
margin_bottom = 192.0
custom_constants/separation = 20
alignment = 1
[node name="back" type="Button" parent="CenterContainer/VBoxContainer/HBoxContainer"]
margin_left = 22.0
margin_right = 196.0
margin_bottom = 27.0
custom_fonts/font = ExtResource( 1 )
text = "OPTIONS_BACK"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="apply" type="Button" parent="CenterContainer/VBoxContainer/HBoxContainer"]
margin_left = 216.0
margin_right = 293.0
margin_bottom = 27.0
custom_fonts/font = ExtResource( 1 )
text = "APPLY"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="value_changed" from="CenterContainer/VBoxContainer/MarginContainer/options/general_volume" to="." method="_on_general_volume_changed"]
[connection signal="value_changed" from="CenterContainer/VBoxContainer/MarginContainer/options/sound_volume" to="." method="_on_sound_volume_changed"]
[connection signal="value_changed" from="CenterContainer/VBoxContainer/MarginContainer/options/music_volume" to="." method="_on_music_volume_changed"]
[connection signal="value_changed" from="CenterContainer/VBoxContainer/MarginContainer/options/speech_volume" to="." method="_on_speech_volume_value_changed"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/HBoxContainer/back" to="." method="_on_back_pressed"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/HBoxContainer/apply" to="." method="_on_apply_pressed"]

View File

@@ -1,39 +0,0 @@
extends Control
func _ready():
self.pause_mode = Node.PAUSE_MODE_PROCESS
hide()
func _on_continue_pressed():
escoria.main.current_scene.game.pause_game()
func _on_save_game_pressed():
$Panel/CenterContainer/VBoxContainer.hide()
$save_game.show()
func _on_load_game_pressed():
$Panel/CenterContainer/VBoxContainer.hide()
$load_game.refresh_savegames()
$load_game.show()
func _on_quit_pressed():
get_tree().quit()
func _on_save_game_back_button_pressed():
$Panel/CenterContainer/VBoxContainer.show()
$save_game.hide()
func _on_load_game_back_button_pressed():
$Panel/CenterContainer/VBoxContainer.show()
$load_game.hide()
func set_save_enabled(p_enabled: bool):
$Panel/CenterContainer/VBoxContainer/menuitems/save_game.disabled = !p_enabled

View File

@@ -1,110 +0,0 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://game/ui/commons/pause_menu/pause_menu.gd" type="Script" id=1]
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=2]
[ext_resource path="res://addons/escoria-core/design/escoria-logo-small.png" type="Texture" id=3]
[ext_resource path="res://game/ui/commons/save/save_game.tscn" type="PackedScene" id=4]
[ext_resource path="res://game/ui/commons/load/load_game.tscn" type="PackedScene" id=5]
[node name="pause_menu" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Panel" type="Panel" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CenterContainer" type="CenterContainer" parent="Panel"]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/CenterContainer"]
margin_left = 332.0
margin_top = 151.0
margin_right = 948.0
margin_bottom = 748.0
custom_constants/separation = 100
[node name="TextureRect" type="TextureRect" parent="Panel/CenterContainer/VBoxContainer"]
margin_right = 616.0
margin_bottom = 236.0
texture = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="menuitems" type="VBoxContainer" parent="Panel/CenterContainer/VBoxContainer"]
margin_top = 336.0
margin_right = 616.0
margin_bottom = 597.0
custom_constants/separation = 10
__meta__ = {
"_edit_use_anchors_": false
}
[node name="continue" type="Button" parent="Panel/CenterContainer/VBoxContainer/menuitems"]
margin_right = 616.0
margin_bottom = 150.0
rect_min_size = Vector2( 0, 150 )
size_flags_vertical = 3
custom_fonts/font = ExtResource( 2 )
text = "CONTINUE_GAME"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="save_game" type="Button" parent="Panel/CenterContainer/VBoxContainer/menuitems"]
margin_top = 160.0
margin_right = 616.0
margin_bottom = 187.0
size_flags_vertical = 3
custom_fonts/font = ExtResource( 2 )
text = "SAVE_GAME"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="load_game" type="Button" parent="Panel/CenterContainer/VBoxContainer/menuitems"]
margin_top = 197.0
margin_right = 616.0
margin_bottom = 224.0
size_flags_vertical = 3
custom_fonts/font = ExtResource( 2 )
text = "LOAD_GAME"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="quit" type="Button" parent="Panel/CenterContainer/VBoxContainer/menuitems"]
margin_top = 234.0
margin_right = 616.0
margin_bottom = 261.0
size_flags_vertical = 3
custom_fonts/font = ExtResource( 2 )
text = "QUIT"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="save_game" parent="." instance=ExtResource( 4 )]
visible = false
[node name="load_game" parent="." instance=ExtResource( 5 )]
visible = false
[connection signal="pressed" from="Panel/CenterContainer/VBoxContainer/menuitems/continue" to="." method="_on_continue_pressed"]
[connection signal="pressed" from="Panel/CenterContainer/VBoxContainer/menuitems/save_game" to="." method="_on_save_game_pressed"]
[connection signal="pressed" from="Panel/CenterContainer/VBoxContainer/menuitems/load_game" to="." method="_on_load_game_pressed"]
[connection signal="pressed" from="Panel/CenterContainer/VBoxContainer/menuitems/quit" to="." method="_on_quit_pressed"]
[connection signal="back_button_pressed" from="save_game" to="." method="_on_save_game_back_button_pressed"]
[connection signal="back_button_pressed" from="load_game" to="." method="_on_load_game_back_button_pressed"]

View File

@@ -1,43 +0,0 @@
extends OptionButton
var selected_id = 0
var options_paths = []
func _ready():
var rooms_folder = "res://game/rooms/"
var dir = Directory.new()
var rooms_list: Array = []
var path = ProjectSettings.globalize_path(rooms_folder)
if not OS.has_feature("editor"):
path = OS.get_executable_path().get_base_dir().plus_file(path)
var tmp = dir.open(path)
if tmp == OK:
dir.list_dir_begin(true)
var file_name = dir.get_next()
while file_name != "":
if dir.current_is_dir():
rooms_list.push_back(file_name)
file_name = dir.get_next()
rooms_list.sort()
for room in rooms_list:
add_item(room)
options_paths.push_back("res://game/rooms/" + room + "/" +
room + ".tscn")
else:
escoria.logger.report_warnings("room_select.gd:_ready()",
["A problem occurred while opening rooms folder."])
func _on_button_pressed():
var script = escoria.esc_compiler.compile([
":debug",
"change_scene %s" % options_paths[selected_id]
])
escoria.event_manager.interrupt_running_event()
escoria.event_manager.queue_event(script.events['debug'])
func _on_option_item_selected(index):
selected_id = index

View File

@@ -1,25 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://game/ui/commons/room_select.gd" type="Script" id=1]
[node name="room_select" type="HBoxContainer"]
margin_right = 63.0
margin_bottom = 40.0005
__meta__ = {
"_edit_use_anchors_": false
}
[node name="option" type="OptionButton" parent="."]
margin_right = 29.0
margin_bottom = 40.0
size_flags_horizontal = 3
script = ExtResource( 1 )
[node name="button" type="Button" parent="."]
margin_left = 33.0
margin_right = 63.0
margin_bottom = 40.0
text = "Go"
[connection signal="item_selected" from="option" to="option" method="_on_option_item_selected"]
[connection signal="pressed" from="button" to="option" method="_on_button_pressed"]

View File

@@ -1,12 +0,0 @@
extends PopupDialog
signal confirm_yes
func _on_no_pressed():
hide()
func _on_yes_pressed():
emit_signal("confirm_yes")
hide()

View File

@@ -1,75 +0,0 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=1]
[ext_resource path="res://game/ui/commons/save/overwrite_confirm_popup.gd" type="Script" id=2]
[node name="overwrite_confirm_popup" type="PopupDialog"]
margin_left = 429.0
margin_top = 281.0
margin_right = 863.0
margin_bottom = 442.0
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MarginContainer" type="MarginContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
custom_constants/margin_right = 30
custom_constants/margin_top = 30
custom_constants/margin_left = 30
custom_constants/margin_bottom = 30
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
margin_left = 30.0
margin_top = 30.0
margin_right = 404.0
margin_bottom = 131.0
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer"]
margin_right = 374.0
margin_bottom = 21.0
custom_fonts/font = ExtResource( 1 )
text = "CONFIRM_OVERWRITE"
[node name="HBoxContainer" type="HBoxContainer" parent="."]
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -224.0
margin_top = -56.0
margin_right = -30.0
margin_bottom = -20.0
custom_constants/separation = 10
__meta__ = {
"_edit_use_anchors_": false
}
[node name="yes" type="Button" parent="HBoxContainer"]
margin_right = 92.0
margin_bottom = 36.0
size_flags_horizontal = 3
custom_fonts/font = ExtResource( 1 )
text = "YES"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="no" type="Button" parent="HBoxContainer"]
margin_left = 102.0
margin_right = 194.0
margin_bottom = 36.0
size_flags_horizontal = 3
custom_fonts/font = ExtResource( 1 )
text = "NO"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="HBoxContainer/yes" to="." method="_on_yes_pressed"]
[connection signal="pressed" from="HBoxContainer/no" to="." method="_on_no_pressed"]

View File

@@ -1,63 +0,0 @@
extends Control
signal back_button_pressed
export(PackedScene) var slot_ui_scene
var slot_pressed
func _ready():
refresh_savegames()
func _on_slot_pressed(p_slot_n: int):
slot_pressed = p_slot_n
if escoria.save_manager.save_game_exists(p_slot_n):
$overwrite_confirm_popup.popup()
else:
$save_name_popup.popup()
func refresh_savegames():
var _slots = $CenterContainer/VBoxContainer/ScrollContainer/slots
for slot in _slots.get_children():
_slots.remove_child(slot)
var saves_list = escoria.save_manager.get_saves_list()
for i in saves_list.size():
var save_data = saves_list[i+1]
var new_slot = slot_ui_scene.instance()
_slots.add_child(new_slot)
new_slot.set_slot_name_date(save_data["name"], save_data["date"])
new_slot.connect("pressed", self, "_on_slot_pressed", [i+1])
var datetime = OS.get_datetime()
var datetime_string = "%02d/%02d/%02d %02d:%02d" % [
datetime["day"],
datetime["month"],
datetime["year"],
datetime["hour"],
datetime["minute"],
]
var new_slot = slot_ui_scene.instance()
_slots.add_child(new_slot)
new_slot.set_slot_name_date(tr("New save"), datetime_string)
new_slot.connect("pressed", self, "_on_slot_pressed", [saves_list.size()+1])
func _on_back_pressed():
emit_signal("back_button_pressed")
func _on_save_name_popup_savegame_name_ok(p_savename: String):
escoria.save_manager.save_game(slot_pressed, p_savename)
refresh_savegames()
slot_pressed = null
func _on_save_name_popup_savegame_cancel():
pass
func _on_overwrite_confirm_popup_confirm_yes():
$save_name_popup.popup()

View File

@@ -1,65 +0,0 @@
[gd_scene load_steps=6 format=2]
[ext_resource path="res://game/ui/commons/load_save_slot/load_save_slot.tscn" type="PackedScene" id=1]
[ext_resource path="res://game/ui/commons/save/save_game.gd" type="Script" id=2]
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=3]
[ext_resource path="res://game/ui/commons/save/save_name_popup.tscn" type="PackedScene" id=4]
[ext_resource path="res://game/ui/commons/save/overwrite_confirm_popup.tscn" type="PackedScene" id=5]
[node name="save_game" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
slot_ui_scene = ExtResource( 1 )
[node name="save_name_popup" parent="." instance=ExtResource( 4 )]
[node name="overwrite_confirm_popup" parent="." instance=ExtResource( 5 )]
[node name="CenterContainer" type="CenterContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="CenterContainer"]
margin_left = 390.0
margin_top = 184.0
margin_right = 890.0
margin_bottom = 715.0
[node name="ScrollContainer" type="ScrollContainer" parent="CenterContainer/VBoxContainer"]
margin_right = 500.0
margin_bottom = 500.0
rect_min_size = Vector2( 500, 500 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="slots" type="VBoxContainer" parent="CenterContainer/VBoxContainer/ScrollContainer"]
margin_right = 500.0
margin_bottom = 500.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="back" type="Button" parent="CenterContainer/VBoxContainer"]
margin_top = 504.0
margin_right = 500.0
margin_bottom = 531.0
custom_fonts/font = ExtResource( 3 )
text = "OPTIONS_BACK"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="savegame_cancel" from="save_name_popup" to="." method="_on_save_name_popup_savegame_cancel"]
[connection signal="savegame_name_ok" from="save_name_popup" to="." method="_on_save_name_popup_savegame_name_ok"]
[connection signal="confirm_yes" from="overwrite_confirm_popup" to="." method="_on_overwrite_confirm_popup_confirm_yes"]
[connection signal="pressed" from="CenterContainer/VBoxContainer/back" to="." method="_on_back_pressed"]

View File

@@ -1,14 +0,0 @@
extends PopupDialog
signal savegame_name_ok(savegame_name)
signal savegame_cancel
func _on_cancel_pressed():
emit_signal("savegame_cancel")
hide()
func _on_ok_pressed():
if not $MarginContainer/VBoxContainer/LineEdit.text.empty():
emit_signal("savegame_name_ok", $MarginContainer/VBoxContainer/LineEdit.text)
$MarginContainer/VBoxContainer/LineEdit.clear()
hide()

View File

@@ -1,81 +0,0 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://game/ui/commons/fonts/caslonantique.tres" type="DynamicFont" id=1]
[ext_resource path="res://game/ui/commons/save/save_name_popup.gd" type="Script" id=2]
[node name="save_name_popup" type="PopupDialog"]
margin_left = 429.0
margin_top = 281.0
margin_right = 863.0
margin_bottom = 442.0
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="MarginContainer" type="MarginContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
custom_constants/margin_right = 30
custom_constants/margin_top = 30
custom_constants/margin_left = 30
custom_constants/margin_bottom = 30
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
margin_left = 30.0
margin_top = 30.0
margin_right = 404.0
margin_bottom = 131.0
[node name="Label" type="Label" parent="MarginContainer/VBoxContainer"]
margin_right = 374.0
margin_bottom = 21.0
custom_fonts/font = ExtResource( 1 )
text = "ENTER_SAVE_NAME"
[node name="LineEdit" type="LineEdit" parent="MarginContainer/VBoxContainer"]
margin_top = 25.0
margin_right = 374.0
margin_bottom = 56.0
custom_fonts/font = ExtResource( 1 )
[node name="HBoxContainer" type="HBoxContainer" parent="."]
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -224.0
margin_top = -56.0
margin_right = -30.0
margin_bottom = -20.0
custom_constants/separation = 10
__meta__ = {
"_edit_use_anchors_": false
}
[node name="cancel" type="Button" parent="HBoxContainer"]
margin_right = 96.0
margin_bottom = 36.0
size_flags_horizontal = 3
custom_fonts/font = ExtResource( 1 )
text = "CANCEL"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="ok" type="Button" parent="HBoxContainer"]
margin_left = 106.0
margin_right = 194.0
margin_bottom = 36.0
size_flags_horizontal = 3
custom_fonts/font = ExtResource( 1 )
text = "OK"
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="HBoxContainer/cancel" to="." method="_on_cancel_pressed"]
[connection signal="pressed" from="HBoxContainer/ok" to="." method="_on_ok_pressed"]