Compare commits

..

3 Commits

Author SHA1 Message Date
c6a7ab376e fix(scoreboard): show more than 25 scores, fixes #278
All checks were successful
Gymkhana exports / All exports (push) Successful in 2m51s
2025-12-29 19:57:35 +01:00
738b60248d fix(animations): godot autofixes 2025-11-23 18:33:42 +01:00
56b3007400 feat(escoria): Update Patches 2025-11-23 18:22:29 +01:00
53 changed files with 99 additions and 1157 deletions

View File

@@ -57,7 +57,9 @@ func _load_api_config() -> void:
func get_scores(collection: String) -> Array[RTMIScoreRow]:
var http_request = http_requests[collection]
var response_data = await _score_http_request(http_request, "%s/databases/%s/collections/%s/documents" % [api_url, database_id, collection])
var response_data = await _score_http_request(
http_request, '%s/databases/%s/collections/%s/documents?queries[1]={"method":"limit","values":[100]}' % [api_url, database_id, collection]
)
if not response_data:
return []

View File

@@ -1,21 +0,0 @@
@tool
extends GridContainer
func _ready() -> void:
refresh()
func refresh() -> void:
var characters := ESCEditorHelper.get_characters()
for character in characters:
var button = ESCCharacterGridButton.new()
button.text = character
button.character_path = characters[character]
add_child(button)
func _clear() -> void:
for child in get_children():
remove_child(child)
child.queue_free()

View File

@@ -1,14 +0,0 @@
@tool
class_name ESCCharacterGridButton
extends Button
var character_path: String
var _loaded_character = ESCPlayer
func _ready():
pressed.connect(_button_pressed)
func _button_pressed():
EditorInterface.open_scene_from_path(character_path)

View File

@@ -1,59 +0,0 @@
@tool
class_name ESCItemGridButton
extends VBoxContainer
const RESIZE_RATIO: float = 0.5
var _item_path: String
var _loaded_item: ESCItem
var _use_inventory_texture: bool = false
func _init(item_path: String, use_inventory_texture: bool):
_item_path = item_path
_use_inventory_texture = use_inventory_texture
func _ready():
_loaded_item = load(_item_path).instantiate()
var button = TextureButton.new()
var texture: Texture = _get_item_texture(_loaded_item)
#button.ignore_texture_size = true
button.stretch_mode = TextureButton.STRETCH_KEEP_CENTERED
button.texture_normal = texture
button.custom_minimum_size = Vector2i(150,150)
button.gui_input.connect(_on_button_gui_input)
add_child(button)
var label = Label.new()
label.text = _loaded_item.global_id
label.text_overrun_behavior = TextServer.OVERRUN_TRIM_ELLIPSIS_FORCE
label.custom_minimum_size = Vector2i(150, 0)
label.gui_input.connect(_on_label_gui_input)
label.tooltip_text = _item_path
add_child(label)
func _on_button_gui_input(event: InputEvent):
if event is InputEventMouseButton:
if event.button_index == MouseButton.MOUSE_BUTTON_LEFT and event.double_click:
EditorInterface.open_scene_from_path(_item_path)
EditorInterface.edit_node(EditorInterface.get_edited_scene_root())
func _on_label_gui_input(event: InputEvent):
if event is InputEventMouseButton:
print("D")
if event.button_index == MouseButton.MOUSE_BUTTON_LEFT and event.double_click:
DisplayServer.clipboard_set(_item_path)
escoria.logger.info(self, "%s copied." % _item_path)
func _get_item_texture(item: ESCItem):
if _use_inventory_texture:
return item._get_inventory_texture()
for c in item.get_children():
if c is TextureRect or c is Sprite2D:
return c.texture

View File

@@ -1,13 +0,0 @@
@tool
class_name ESCRoomGridButton
extends Button
var room_path: String
func _ready():
pressed.connect(_button_pressed)
func _button_pressed():
EditorInterface.open_scene_from_path(room_path)

View File

@@ -1,22 +0,0 @@
@tool
extends Control
class_name ESCRoomInspectorItem
@onready var label: Label = %Label
@onready var button_pinpoint: Button = %ButtonPinpoint
var _item: ESCItem
func _ready() -> void:
button_pinpoint.pressed.connect(_on_pinpoint_pressed)
func set_item(item: ESCItem) -> void:
_item = item
label.text = item.global_id
func _on_pinpoint_pressed():
print("PINPOINT: %s" % _item.global_id, "Owner: %s" % _item.owner)
EditorInterface.edit_node(_item)

View File

@@ -1,34 +0,0 @@
[gd_scene load_steps=2 format=3 uid="uid://uii3u2y0w3yo"]
[ext_resource type="Script" uid="uid://qk4h81i8pcsw" path="res://addons/escoria-ui-return-monkey-island/editor-tools/elements/esc_room_inspector_item.gd" id="1_lqbf8"]
[node name="Control" type="Control"]
custom_minimum_size = Vector2(0, 15)
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource("1_lqbf8")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Label" type="Label" parent="HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3
text = "turno_cocina"
[node name="ButtonPinpoint" type="Button" parent="HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "."

View File

@@ -1,89 +0,0 @@
@tool
class_name ESCEditorHelper
const FILE_EXTENSION_ASHES = "esc"
const DIRECTORIES_TO_EXCLUDE = ["addons"]
const BASE_PROJECT_DIR = "res://"
static func get_element(element_path: String) -> Dictionary:
var element_list: Dictionary = {}
var path = ProjectSettings.globalize_path(element_path)
if not OS.has_feature("editor"):
path = OS.get_executable_path().get_base_dir().path_join(path)
var dir = DirAccess.open(path)
if dir != null:
dir.list_dir_begin() # TODOConverter3To4 fill missing arguments https://github.com/godotengine/godot/pull/40547
var file_name = dir.get_next()
while file_name != "":
if dir.current_is_dir():
element_list.set(file_name, "%s/%s/%s.tscn" % [element_path, file_name, file_name])
file_name = dir.get_next()
element_list.sort()
else:
ESCSafeLogging.log_warn(
ESCEditorHelper, "A problem occurred while opening rooms folder %s." % str(path)
)
return element_list
static func get_rooms() -> Dictionary:
var rooms_folder = ESCProjectSettingsManager.get_setting(
ESCProjectSettingsManager.ROOM_SELECTOR_ROOM_DIR
)
if rooms_folder == "":
return {}
return get_element(rooms_folder)
static func get_characters() -> Dictionary:
var rooms_folder = "res://gymkhana/characters"
if rooms_folder == "":
return {}
return get_element(rooms_folder)
static func get_items() -> Array:
var items_path = (
ESCProjectSettingsManager
. get_setting(ESCProjectSettingsManager.INVENTORY_ITEMS_PATH)
. trim_suffix("/")
)
var files: Array = _get_files("tscn", items_path)
#var files = []
return files
static func _get_files(extension: String, path: String) -> Array:
var dir = DirAccess.open(path)
var files := []
if dir:
dir.list_dir_begin()
else:
ESCSafeLogging.log_warn(ESCEditorHelper, "Unable to open '%s'." % path)
return files
var filename: String = dir.get_next()
while not filename.is_empty():
var filename_with_path: String = _make_full_path(dir.get_current_dir(), filename)
if not dir.current_is_dir():
if filename.get_extension() == extension:
files.append(filename_with_path)
filename = dir.get_next()
return files
static func _make_full_path(directory: String, filename: String) -> String:
var separator: String = "" if directory.ends_with("/") else "/"
return directory + separator + filename

View File

@@ -1,12 +0,0 @@
@tool
class_name ESCEscoriaDock
extends Panel
@onready var tab_container: TabContainer = %TabContainer
func _ready() -> void:
tab_container.tab_changed.connect(_on_tab_changed)
func _on_tab_changed(current_tab) -> void:
print("Tab change %s" % current_tab)
return

View File

@@ -1,49 +0,0 @@
[gd_scene load_steps=5 format=3 uid="uid://cx10t424sepxe"]
[ext_resource type="Script" uid="uid://q3bxu7fjbxrb" path="res://addons/escoria-ui-return-monkey-island/editor-tools/esc_escoria_dock.gd" id="1_ff15v"]
[ext_resource type="Script" uid="uid://7r7dgsfeiuic" path="res://addons/escoria-ui-return-monkey-island/editor-tools/rooms_grid.gd" id="2_fm76t"]
[ext_resource type="PackedScene" uid="uid://y1u61mgoeluv" path="res://addons/escoria-ui-return-monkey-island/editor-tools/esc_escoria_dock_items.tscn" id="3_fm76t"]
[ext_resource type="Script" uid="uid://cprmhtbtpwqtn" path="res://addons/escoria-ui-return-monkey-island/editor-tools/characters_grid.gd" id="4_uu37h"]
[node name="Escoria" type="Panel"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_ff15v")
[node name="TabContainer" type="TabContainer" parent="."]
unique_name_in_owner = true
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
current_tab = 0
[node name="Rooms" type="ScrollContainer" parent="TabContainer"]
layout_mode = 2
metadata/_tab_index = 0
[node name="RoomsGrid" type="GridContainer" parent="TabContainer/Rooms"]
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
columns = 10
script = ExtResource("2_fm76t")
[node name="Items" parent="TabContainer" instance=ExtResource("3_fm76t")]
visible = false
layout_mode = 2
metadata/_tab_index = 1
[node name="Characters" type="ScrollContainer" parent="TabContainer"]
visible = false
layout_mode = 2
metadata/_tab_index = 2
[node name="CharactersGrid" type="GridContainer" parent="TabContainer/Characters"]
layout_mode = 2
script = ExtResource("4_uu37h")

View File

@@ -1,13 +0,0 @@
@tool
extends VBoxContainer
@onready var check_inventory_texture: CheckButton = %CheckInventoryTexture
@onready var items_grid: GridContainer = %ItemsGrid
func _ready():
check_inventory_texture.toggled.connect(_on_inventory_texture_toggled)
func _on_inventory_texture_toggled(is_toggled: bool):
items_grid.use_inventory_texture = is_toggled
items_grid.refresh()

View File

@@ -1,35 +0,0 @@
[gd_scene load_steps=3 format=3 uid="uid://y1u61mgoeluv"]
[ext_resource type="Script" uid="uid://dsrwrbxtdbccb" path="res://addons/escoria-ui-return-monkey-island/editor-tools/items_tab.gd" id="1_osotr"]
[ext_resource type="Script" uid="uid://cqrwlqhfdth14" path="res://addons/escoria-ui-return-monkey-island/editor-tools/esc_escoria_dock_items.gd" id="1_ukssm"]
[node name="Items" type="VBoxContainer"]
offset_right = 1227.0
offset_bottom = 285.0
size_flags_vertical = 3
script = ExtResource("1_ukssm")
[node name="MenuBar" type="MenuBar" parent="."]
custom_minimum_size = Vector2(0, 35)
layout_mode = 2
[node name="CheckInventoryTexture" type="CheckButton" parent="MenuBar"]
unique_name_in_owner = true
layout_mode = 0
offset_right = 44.0
offset_bottom = 24.0
text = "Invetory texture"
[node name="Items" type="ScrollContainer" parent="."]
layout_mode = 2
size_flags_vertical = 3
metadata/_tab_index = 2
[node name="ItemsGrid" type="GridContainer" parent="Items"]
unique_name_in_owner = true
clip_contents = true
layout_mode = 2
size_flags_horizontal = 3
size_flags_vertical = 3
columns = 7
script = ExtResource("1_osotr")

View File

@@ -1,49 +0,0 @@
@tool
class_name ESCRoomInspectorDock
extends Panel
@onready var current_room_label: Label = %CurrentRoomLabelValue
@onready var room_objects_list: VBoxContainer = %RoomObjectsList
const room_item_control = preload("res://addons/escoria-ui-return-monkey-island/editor-tools/elements/esc_room_inspector_item.tscn")
func scene_changed(root_node: Node) -> void:
_clear_room_objects_list()
var room_objects = []
if not root_node is ESCRoom:
current_room_label.text = "No room selected."
return
var room_node = root_node as ESCRoom
current_room_label.text = room_node.global_id
for child in root_node.get_children():
if child is ESCItem:
var ui_item = room_item_control.instantiate()
room_objects_list.add_child(ui_item)
ui_item.set_item(child)
func scene_closed(filepath: String) -> void:
check_open_scenes()
# From: https://github.com/carenalgas/popochiu/blob/develop/addons/popochiu/editor/main_dock/popochiu_dock.gd
func check_open_scenes() -> void:
# Fixes #273: Since Godot is not triggering the EditorPlugin.scene_changed signal when opening a
# scene when no other scenes are opened, listen to the EditorSelection.selection_changed signal
await get_tree().process_frame
if EditorInterface.get_open_scenes().is_empty():
EditorInterface.get_selection().selection_changed.connect(_on_editor_selection_changed)
func _on_editor_selection_changed() -> void:
if EditorInterface.get_edited_scene_root():
EditorInterface.get_selection().selection_changed.disconnect(_on_editor_selection_changed)
scene_changed(EditorInterface.get_edited_scene_root())
func _clear_room_objects_list() -> void:
for child in room_objects_list.get_children():
room_objects_list.remove_child(child)
child.queue_free()

View File

@@ -1,45 +0,0 @@
[gd_scene load_steps=2 format=3 uid="uid://dtb2gkj65kpug"]
[ext_resource type="Script" uid="uid://b2euhjc1kb6cn" path="res://addons/escoria-ui-return-monkey-island/editor-tools/esc_room_inspector_dock.gd" id="1_lnj8i"]
[node name="Room" type="Panel"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_lnj8i")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
layout_mode = 2
[node name="CurrentRoomLabel" type="Label" parent="VBoxContainer/HBoxContainer"]
layout_mode = 2
[node name="CurrentRoomLabelValue" type="Label" parent="VBoxContainer/HBoxContainer"]
unique_name_in_owner = true
layout_mode = 2
text = "CURRENT_ROOM"
[node name="TabContainer" type="TabContainer" parent="VBoxContainer"]
layout_mode = 2
size_flags_vertical = 3
current_tab = 0
[node name="Items" type="ScrollContainer" parent="VBoxContainer/TabContainer"]
layout_mode = 2
size_flags_vertical = 3
metadata/_tab_index = 0
[node name="RoomObjectsList" type="VBoxContainer" parent="VBoxContainer/TabContainer/Items"]
unique_name_in_owner = true
layout_mode = 2
size_flags_horizontal = 3

View File

@@ -1,21 +0,0 @@
@tool
extends GridContainer
@onready var items_grid: GridContainer = %ItemsGrid
var use_inventory_texture: bool = false
func _ready() -> void:
refresh()
func refresh() -> void:
_clear()
for item in ESCEditorHelper.get_items():
var button = ESCItemGridButton.new(item,use_inventory_texture)
items_grid.add_child(button)
func _clear() -> void:
for child in get_children():
remove_child(child)
child.queue_free()

View File

@@ -1 +0,0 @@
uid://dsrwrbxtdbccb

View File

@@ -1,21 +0,0 @@
@tool
extends GridContainer
func _ready() -> void:
refresh()
func refresh() -> void:
var rooms := ESCEditorHelper.get_rooms()
for room in rooms:
var button = ESCRoomGridButton.new()
button.text = room
button.room_path = rooms[room]
add_child(button)
func _clear() -> void:
for child in get_children():
remove_child(child)
child.queue_free()

View File

@@ -1 +0,0 @@
uid://7r7dgsfeiuic

View File

@@ -1,16 +1,15 @@
class_name RTMICompiler
extends ESCCompiler
class_name RTMICompiler
## Cached esc files
var _esc_cache: Dictionary
func load_esc_file(path: String, associated_global_id: String = "") -> ESCScript:
if _esc_cache.has(path):
escoria.logger.info(self, "CACHE HIT: %s" % path)
return _esc_cache.get(path)
escoria.logger.info(self, "CACHE MISS: %s" % path)
ESCSafeLogging.log_debug(self, "Loading file '%s' for parsing..." % path)
if not FileAccess.file_exists(path):
@@ -22,7 +21,6 @@ func load_esc_file(path: String, associated_global_id: String = "") -> ESCScript
return _compiler_shim(file.get_as_text(), path, associated_global_id)
func _compiler_shim(source: String, filename: String = "", associated_global_id: String = ""):
var script = super._compiler_shim(source, filename, associated_global_id)
_esc_cache[filename] = script

View File

@@ -2,9 +2,6 @@
# Plugin script to initialize Escoria simple mouse UI
extends EditorPlugin
var room_inspector_dock: ESCRoomInspectorDock
var escoria_dock: ESCEscoriaDock
var _srt_loader := SrtFormatLoader.new()
var _srt_saver := SrtFormatSaver.new()
@@ -20,15 +17,6 @@ func _enter_tree() -> void:
ResourceLoader.add_resource_format_loader(_txt_loader)
ResourceSaver.add_resource_format_saver(_txt_saver)
room_inspector_dock = preload("res://addons/escoria-ui-return-monkey-island/editor-tools/esc_room_inspector_dock.tscn").instantiate()
room_inspector_dock.ready.connect(_on_room_inspector_dock_ready)
room_inspector_dock.focus_mode = Control.FOCUS_ALL
add_control_to_dock(DOCK_SLOT_LEFT_BR, room_inspector_dock)
escoria_dock = preload("res://addons/escoria-ui-return-monkey-island/editor-tools/esc_escoria_dock.tscn").instantiate()
#escoria_dock.ready.connect(_on_dock_ready)
escoria_dock.focus_mode = Control.FOCUS_ALL
add_control_to_bottom_panel(escoria_dock, "Escoria")
func _exit_tree() -> void:
@@ -37,14 +25,7 @@ func _exit_tree() -> void:
ResourceLoader.remove_resource_format_loader(_txt_loader)
ResourceSaver.remove_resource_format_saver(_txt_saver)
# Clean-up of the plugin goes here.
# Remove the dock.
remove_control_from_docks(room_inspector_dock)
# Erase the control from the memory.
room_inspector_dock.free()
remove_control_from_bottom_panel(escoria_dock)
escoria_dock.free()
# Override function to return the plugin name.
func _get_plugin_name():
@@ -75,18 +56,3 @@ func _enable_plugin():
)
else:
get_editor_interface().set_plugin_enabled(_get_plugin_name(), false)
func _on_room_inspector_dock_ready() -> void:
# Fill the dock with Rooms, Characters, Inventory items, Dialogs and AudioCues
room_inspector_dock.grab_focus()
scene_changed.connect(room_inspector_dock.scene_changed)
scene_closed.connect(room_inspector_dock.scene_closed)
if EditorInterface.get_edited_scene_root():
room_inspector_dock.scene_changed(EditorInterface.get_edited_scene_root())
else:
room_inspector_dock.check_open_scenes()

View File

@@ -1,13 +1,8 @@
class_name BaseTextPlainFormatLoader
@abstract class_name BaseTextPlainFormatLoader
extends ResourceFormatLoader
const ResourceClass = preload(
"res://addons/escoria-ui-return-monkey-island/resources/text_plain_resource.gd"
)
func get_recognized_extensions() -> Array:
return []
const ResourceClass = preload("res://addons/escoria-ui-return-monkey-island/resources/text_plain_resource.gd")
@abstract func get_recognized_extensions() -> Array
func _get_recognized_extensions() -> PackedStringArray:

View File

@@ -1,13 +1,10 @@
class_name BaseTextPlainFormatSaver
@abstract class_name BaseTextPlainFormatSaver
extends ResourceFormatSaver
const ResourceClass = preload(
"res://addons/escoria-ui-return-monkey-island/resources/text_plain_resource.gd"
)
func get_recognized_extensions(_resource: Resource) -> Array:
return []
@abstract func get_recognized_extensions(_resource: Resource) -> Array
func _get_recognized_extensions(resource: Resource) -> PackedStringArray:
@@ -25,7 +22,7 @@ func _recognize(resource: Resource) -> bool:
func _save(resource: Resource, path: String, flags: int) -> int:
var err: int
var file = FileAccess.open(path, flags)
var file = FileAccess.open(path,flags)
file.store_string(resource.get("text"))
file.close()

View File

@@ -1,7 +0,0 @@
Copyright 2022-present Iceflower S (iceflower@gmx.de)
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -1,61 +0,0 @@
@tool
extends MarginContainer
@export var _reload_button: CheckButton
@export var _option_button: OptionButton
var _last_selection: String = ""
func _ready() -> void:
self._option_button.item_selected.connect(func(idx: int) -> void:
self._last_selection = self._option_button.get_item_metadata(idx)
self._update_button_bar()
)
self._reload_button.toggled.connect(func(toggled: bool) -> void:
EditorInterface.set_plugin_enabled("res://addons/" + self._last_selection + "/plugin.cfg", toggled)
self._reload_plugin_list()
)
EditorInterface.get_resource_filesystem().filesystem_changed.connect(self._reload_plugin_list)
self._reload_plugin_list()
func _update_button_bar() -> void:
if self._last_selection != "":
self._reload_button.set_pressed_no_signal(EditorInterface.is_plugin_enabled("res://addons/" + self._last_selection + "/plugin.cfg"))
self._option_button.icon = null
self._reload_button.disabled = self._last_selection == ""
func _reload_plugin_list() -> void:
self._option_button.clear()
for dir: String in DirAccess.get_directories_at("res://addons/"):
self._add_plugin_to_list(dir)
# subfolder
for sub_dir: String in DirAccess.get_directories_at("res://addons/" + dir):
self._add_plugin_to_list(dir + "/" + sub_dir)
if self._last_selection == "" && self._option_button.get_item_count() > 0:
self._last_selection = self._option_button.get_item_metadata(0)
self._update_button_bar()
func _add_plugin_to_list(plugin_id: String) -> void:
# ignore the current plugin
if plugin_id == "kenyoni/plugin_reloader":
return
var cfg_path: String = "res://addons/" + plugin_id + "/plugin.cfg"
if !FileAccess.file_exists(cfg_path):
return
var plugin_cfg: ConfigFile = ConfigFile.new()
plugin_cfg.load(cfg_path)
var plugin_name: String = plugin_cfg.get_value("plugin", "name", plugin_id)
self._option_button.add_item(plugin_name)
var idx: int = self._option_button.get_item_count() - 1
self._option_button.set_item_metadata(idx, plugin_id)
self._option_button.set_item_tooltip(idx, "res://addons/" + plugin_id + "/")
if EditorInterface.is_plugin_enabled(cfg_path):
self._option_button.set_item_icon(idx, self.get_theme_icon(&"TileChecked", &"EditorIcons"))
else:
self._option_button.set_item_icon(idx, self.get_theme_icon(&"TileUnchecked", &"EditorIcons"))
if plugin_id == self._last_selection:
self._option_button.select(idx)

View File

@@ -1 +0,0 @@
uid://b6eu3fxcktuu6

View File

@@ -1,21 +0,0 @@
[gd_scene load_steps=2 format=3 uid="uid://dryoyuj4vl0l5"]
[ext_resource type="Script" uid="uid://b6eu3fxcktuu6" path="res://addons/kenyoni/plugin_reloader/internal/reloader.gd" id="1_kd7gg"]
[node name="Reloader" type="MarginContainer" node_paths=PackedStringArray("_reload_button", "_option_button")]
offset_right = 76.0
offset_bottom = 24.0
script = ExtResource("1_kd7gg")
_reload_button = NodePath("HBoxContainer/reload_button")
_option_button = NodePath("HBoxContainer/OptionButton")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
layout_mode = 2
theme_override_constants/separation = 0
[node name="reload_button" type="CheckButton" parent="HBoxContainer"]
layout_mode = 2
[node name="OptionButton" type="OptionButton" parent="HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3

View File

@@ -1,19 +0,0 @@
[plugin]
name="Plugin Reloader"
description="Enable or disable plugins from within the editor main screen."
author="Kenyoni Software"
version="1.1.0"
script="plugin.gd"
license="MIT"
repository="https://github.com/kenyoni-software/godot-addons"
keywords=[
"tool"
]
classifiers=[
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License"
]
[plugin.dependencies]
godot=">=4.2"

View File

@@ -1,20 +0,0 @@
@tool
extends EditorPlugin
const ReloaderScene: PackedScene = preload("res://addons/kenyoni/plugin_reloader/internal/reloader.tscn")
const Reloader := preload("res://addons/kenyoni/plugin_reloader/internal/reloader.gd")
var _reloader: Reloader
func _get_plugin_name() -> String:
return "Plugin Reloader"
func _enter_tree() -> void:
self._reloader = ReloaderScene.instantiate()
self.add_control_to_container(CustomControlContainer.CONTAINER_TOOLBAR, self._reloader)
# move before editor run bar
self._reloader.get_parent().move_child(self._reloader, self._reloader.get_parent().find_child("@EditorRunBar@*", true, false).get_index())
func _exit_tree() -> void:
self.remove_control_from_container(CustomControlContainer.CONTAINER_TOOLBAR, self._reloader)
self._reloader.queue_free()

View File

@@ -1 +0,0 @@
uid://bcx3j4sbnf4mw

View File

@@ -9,13 +9,13 @@ DEFAULT_DESTINATION_PATH="../escoria-demo-game"
DESTINATION_PATH="${1:-$DEFAULT_DESTINATION_PATH}"
REMOTE_PATCHES=(
#"https://patch-diff.githubusercontent.com/raw/godot-escoria/escoria-demo-game/pull/777.patch"
"https://patch-diff.githubusercontent.com/raw/godot-escoria/escoria-demo-game/pull/791.patch"
"https://patch-diff.githubusercontent.com/raw/godot-escoria/escoria-demo-game/pull/792.patch"
"https://patch-diff.githubusercontent.com/raw/godot-escoria/escoria-demo-game/pull/793.patch"
"https://patch-diff.githubusercontent.com/raw/godot-escoria/escoria-demo-game/pull/794.patch"
https://patch-diff.githubusercontent.com/raw/godot-escoria/escoria-demo-game/pull/793.patch
https://patch-diff.githubusercontent.com/raw/godot-escoria/escoria-demo-game/pull/792.patch
https://patch-diff.githubusercontent.com/raw/godot-escoria/escoria-demo-game/pull/791.patch
)
WORKING_COMMIT="2f6ec324f7b5b37d9226dbc99fcd46f01283a3b6"
PROJECT_PATH=$PWD
echo -e
@@ -30,18 +30,13 @@ echo -e
echo -e "${BLUE}Cleaning and updating the repo${NOCOLOR}"
echo -e ==========================
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$BRANCH" != "main" ]
then
echo -e ${RED}Not on main branch. Aborting. ${NOCOLOR}
echo -e
exit 0
fi
git clean -fx
git reset --hard
git pull origin main
git fetch
git pull origin $WORKING_COMMIT
git checkout $WORKING_COMMIT
echo -e
echo -e "${BLUE}Applying remote patches...${NOCOLOR}"

View File

@@ -1,47 +0,0 @@
# Godot Addons
![maintained](https://img.shields.io/badge/Status-maintained-brightgreen.svg)
[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/IceflowRE/go-multiprogressbar/blob/master/LICENSE.md)
[![documentation](https://img.shields.io/badge/Documentation-D1D100.svg)](https://kenyoni-software.github.io/godot-addons)
Download [here](https://github.com/kenyoni-software/godot-addons/releases/tag/latest).
You can find a documentation with examples and detailed information [here](https://kenyoni-software.github.io/godot-addons).
## License
[MIT License](./LICENSE.md)
---
> [!NOTE]
> **Godot 4.3. or lower**
> If you import any plugin or open a Godot project for the first time, the plugins will throw errors. To ensure correct operation, reload the project and the errors are gone.
> *Background: most plugins are using `preload`, but on first import there is nothing which can be preloaded.*
## Addons
- [AspectRatioResizeContainer](https://kenyoni-software.github.io/godot-addons/addons/aspect_ratio_resize_container)
Extension of `AspectRatioContainer` to update it's own size.
- [Custom Theme Overrides](https://kenyoni-software.github.io/godot-addons/addons/custom_theme_overrides)
Utility to provide custom theme overrides for any node.
- [Git SHA Project Setting](https://kenyoni-software.github.io/godot-addons/addons/git_sha_project_setting)
Add Git SHA as project setting.
- [Hide Private Properties](https://kenyoni-software.github.io/godot-addons/addons/hide_private_properties)
Hide private properties of instantiated child scenes.
- [Icon Explorer](https://kenyoni-software.github.io/godot-addons/addons/icon_explorer)
Browse different icons and save them.
- [Icons Patcher](https://kenyoni-software.github.io/godot-addons/addons/icons_patcher)
Patch Pictogrammers icons to white.
- [License Manager](https://kenyoni-software.github.io/godot-addons/addons/licenses)
Manage license and copyright for third party graphics, software or libraries.
- [Logging](https://kenyoni-software.github.io/godot-addons/addons/glogging)
Simple logger.
- [Plugin Reloader](https://kenyoni-software.github.io/godot-addons/addons/plugin_reloader)
Enable or disable plugins from within the editor main screen.
- [QR Code](https://kenyoni-software.github.io/godot-addons/addons/qr_code)
QRCodeRect and QR Code generation.
- [Remove Orphan UID](https://kenyoni-software.github.io/godot-addons/addons/remove_orphan_uid)
Remove orphan UIDs from the project.
- [TextureButtonColored](https://kenyoni-software.github.io/godot-addons/addons/texture_button_colored)
Extension of `TextureButton` with color options.

View File

@@ -9,7 +9,7 @@ custom_features=""
export_filter="all_resources"
include_filter="*.esc, *.csv, *.ncsv, *.cfg, *.srt"
exclude_filter="*.xcf, saves/*, scripts/*,vscode-extension-ashes/*"
export_path="build/LasGymkhanikasDeUli.x86_64"
export_path="build/LasGymkhanikasDeUli.appimage.x86_64"
patches=PackedStringArray()
encryption_include_filters="*.cfg"
encryption_exclude_filters=""

View File

@@ -384,7 +384,6 @@
- "cocina_delante_eneko_action2_dialog_option7:Agur"
say($current_player, "Agur yogur!", "cocina_delante_eneko_action2_dialog_end")
done
#!include:
:action3 "turno_cocina_frontal"
if turno_cocina_frontal_debajo_sofa:

View File

@@ -1,8 +1,8 @@
[gd_resource type="Resource" script_class="ESCAnimationResource" load_steps=7 format=3 uid="uid://c4lhcwvjqx5ty"]
[ext_resource type="Script" uid="uid://sksvt0n8gle2" path="res://addons/escoria-core/game/core-scripts/resources/esc_animationresource.gd" id="1"]
[ext_resource type="Script" path="res://addons/escoria-core/game/core-scripts/resources/esc_directionangle.gd" id="2"]
[ext_resource type="Script" path="res://addons/escoria-core/game/core-scripts/resources/esc_animationname.gd" id="3"]
[ext_resource type="Script" uid="uid://bxc3dll30x8tl" path="res://addons/escoria-core/game/core-scripts/resources/esc_directionangle.gd" id="2"]
[ext_resource type="Script" uid="uid://clixil1u5exq7" path="res://addons/escoria-core/game/core-scripts/resources/esc_animationname.gd" id="3"]
[sub_resource type="Resource" id="1"]
script = ExtResource("2")
@@ -18,7 +18,7 @@ animation = "speak"
[resource]
script = ExtResource("1")
dir_angles = Array[ExtResource("2")]([SubResource("1")])
directions = Array[ExtResource("3")]([SubResource("2")])
idles = Array[ExtResource("3")]([SubResource("2")])
speaks = Array[ExtResource("3")]([SubResource("3")])
dir_angles = [SubResource("1")]
directions = [SubResource("2")]
idles = [SubResource("2")]
speaks = [SubResource("3")]

View File

@@ -1,8 +1,8 @@
[gd_resource type="Resource" script_class="ESCAnimationResource" load_steps=36 format=3 uid="uid://cyjo7aq0e4hbe"]
[ext_resource type="Script" uid="uid://sksvt0n8gle2" path="res://addons/escoria-core/game/core-scripts/resources/esc_animationresource.gd" id="1"]
[ext_resource type="Script" path="res://addons/escoria-core/game/core-scripts/resources/esc_directionangle.gd" id="2"]
[ext_resource type="Script" path="res://addons/escoria-core/game/core-scripts/resources/esc_animationname.gd" id="3"]
[ext_resource type="Script" uid="uid://bxc3dll30x8tl" path="res://addons/escoria-core/game/core-scripts/resources/esc_directionangle.gd" id="2"]
[ext_resource type="Script" uid="uid://clixil1u5exq7" path="res://addons/escoria-core/game/core-scripts/resources/esc_animationname.gd" id="3"]
[sub_resource type="Resource" id="1"]
script = ExtResource("2")

View File

@@ -2,23 +2,23 @@
[ext_resource type="Script" uid="uid://c7fcpp72w3dnj" path="res://addons/escoria-core/game/core-scripts/esc_room.gd" id="1"]
[ext_resource type="PackedScene" uid="uid://cjmsexhyhi4vs" path="res://gymkhana/characters/oier/oier.tscn" id="2"]
[ext_resource type="Texture2D" uid="uid://c8ytapkbj5t4p" path="res://gymkhana/rooms/turno_cocina/cocina/assets/cocina_interior_vista_completa.jpg" id="3_ccj1t"]
[ext_resource type="Texture2D" uid="uid://ckdiqb7cmmaqb" path="res://gymkhana/rooms/turno_cocina/cocina/assets/cocina_interior_vista_completa.jpg" id="3_ccj1t"]
[ext_resource type="Script" uid="uid://5pbcieq7gpdo" path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" id="4"]
[ext_resource type="Script" uid="uid://beh3ds4eapldu" path="res://addons/escoria-core/game/core-scripts/esc_location.gd" id="5"]
[ext_resource type="Script" uid="uid://ceym82rf2qnxu" path="res://addons/escoria-ui-return-monkey-island/esc_item_with_tooltip.gd" id="6"]
[ext_resource type="Texture2D" uid="uid://2mw8y41yha5" path="res://gymkhana/rooms/turno_cocina/cocina/assets/depth.png" id="7"]
[ext_resource type="Texture2D" uid="uid://hfsy8yh5msgu" path="res://gymkhana/rooms/turno_cocina/cocina/assets/foreground-mesa.png" id="8"]
[ext_resource type="Texture2D" uid="uid://p7ou513681ag" path="res://gymkhana/rooms/turno_cocina/cocina/assets/foreground-silla.png" id="9"]
[ext_resource type="Texture2D" uid="uid://crhfjda62540d" path="res://gymkhana/rooms/turno_cocina/cocina/assets/depth.png" id="7"]
[ext_resource type="Texture2D" uid="uid://bss0jcop7w5cx" path="res://gymkhana/rooms/turno_cocina/cocina/assets/foreground-mesa.png" id="8"]
[ext_resource type="Texture2D" uid="uid://bna12h746ucar" path="res://gymkhana/rooms/turno_cocina/cocina/assets/foreground-silla.png" id="9"]
[ext_resource type="PackedScene" uid="uid://cwlq5pqwktbul" path="res://gymkhana/items/turno_cocina_peso.tscn" id="10"]
[ext_resource type="PackedScene" uid="uid://cpeqaymxabewi" path="res://gymkhana/items/turno_cocina_bol.tscn" id="11"]
[ext_resource type="PackedScene" uid="uid://d1ust40cvfjtw" path="res://gymkhana/items/turno_cocina_olla_llena.tscn" id="12"]
[ext_resource type="Texture2D" uid="uid://brspvt17l2bsg" path="res://gymkhana/items/assets/turno_cocina_patata.png" id="13"]
[ext_resource type="Texture2D" uid="uid://djkmw4bj8siok" path="res://gymkhana/items/assets/turno_cocina_patata.png" id="13"]
[ext_resource type="PackedScene" uid="uid://bnf0ylqtnajms" path="res://gymkhana/items/turno_cocina_libro_de_cocina.tscn" id="14"]
[ext_resource type="Texture2D" uid="uid://xv1xya2lcavx" path="res://gymkhana/rooms/turno_cocina/cocina/assets/gas-apagado.png" id="15"]
[ext_resource type="Texture2D" uid="uid://chy7hyrqi6imp" path="res://gymkhana/rooms/turno_cocina/cocina/assets/gas-apagado.png" id="15"]
[ext_resource type="Script" uid="uid://db4ghc5f2fhb2" path="res://addons/escoria-ui-return-monkey-island/item_components/esc_item_component_global_observer.gd" id="15_fji2i"]
[ext_resource type="Texture2D" uid="uid://cwopnwjeljhk5" path="res://gymkhana/rooms/turno_cocina/cocina/assets/gas-encendido3.png" id="16"]
[ext_resource type="Texture2D" uid="uid://5hgjkw372o28" path="res://gymkhana/rooms/turno_cocina/cocina/assets/gas-encendido1.png" id="17"]
[ext_resource type="Texture2D" uid="uid://dh23qb40apphb" path="res://gymkhana/rooms/turno_cocina/cocina/assets/gas-encendido2.png" id="18"]
[ext_resource type="Texture2D" uid="uid://bebo52w582216" path="res://gymkhana/rooms/turno_cocina/cocina/assets/gas-encendido3.png" id="16"]
[ext_resource type="Texture2D" uid="uid://c13mgcko6vbd0" path="res://gymkhana/rooms/turno_cocina/cocina/assets/gas-encendido1.png" id="17"]
[ext_resource type="Texture2D" uid="uid://da2sep4pylffj" path="res://gymkhana/rooms/turno_cocina/cocina/assets/gas-encendido2.png" id="18"]
[ext_resource type="PackedScene" uid="uid://d7l30s558mvd" path="res://gymkhana/particles/SmokeParticles.tscn" id="19"]
[ext_resource type="PackedScene" uid="uid://igj2f3midaad" path="res://gymkhana/items/turno_cocina_cuerno.tscn" id="20"]
[ext_resource type="Script" uid="uid://uadel3g82io" path="res://gymkhana/items/scripts/turno_cocina_sin_olla_economica_encendida_observer.gd" id="21"]

View File

@@ -1,10 +1,10 @@
[gd_scene load_steps=19 format=3 uid="uid://dwvu5kn7qr35s"]
[ext_resource type="Script" uid="uid://c7fcpp72w3dnj" path="res://addons/escoria-core/game/core-scripts/esc_room.gd" id="1"]
[ext_resource type="Script" path="res://addons/escoria-core/game/core-scripts/esc_room.gd" id="1"]
[ext_resource type="PackedScene" uid="uid://cjmsexhyhi4vs" path="res://gymkhana/characters/oier/oier.tscn" id="2"]
[ext_resource type="Texture2D" uid="uid://b8re6n31thdb" path="res://gymkhana/rooms/turno_cocina/cocina_delante/assets/delante_cocina_full.jpg" id="3_us6ip"]
[ext_resource type="Script" uid="uid://5pbcieq7gpdo" path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" id="4"]
[ext_resource type="Script" uid="uid://beh3ds4eapldu" path="res://addons/escoria-core/game/core-scripts/esc_location.gd" id="5"]
[ext_resource type="Script" path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" id="4"]
[ext_resource type="Script" path="res://addons/escoria-core/game/core-scripts/esc_location.gd" id="5"]
[ext_resource type="Script" uid="uid://ceym82rf2qnxu" path="res://addons/escoria-ui-return-monkey-island/esc_item_with_tooltip.gd" id="6"]
[ext_resource type="Texture2D" uid="uid://dhj8k3ro2vayg" path="res://gymkhana/rooms/turno_cocina/cocina_delante/assets/light.png" id="6_ugqpr"]
[ext_resource type="Texture2D" uid="uid://js3u7hbljn2x" path="res://gymkhana/rooms/turno_cocina/cocina_delante/assets/depth.png" id="7"]

View File

@@ -18,7 +18,7 @@ animation = "speak"
[resource]
script = ExtResource("1")
dir_angles = [SubResource("1")]
directions = [SubResource("2")]
idles = [SubResource("2")]
speaks = [SubResource("3")]
dir_angles = Array[ExtResource("2")]([SubResource("1")])
directions = Array[ExtResource("3")]([SubResource("2")])
idles = Array[ExtResource("3")]([SubResource("2")])
speaks = Array[ExtResource("3")]([SubResource("3")])

View File

@@ -18,7 +18,7 @@ animation = "speak"
[resource]
script = ExtResource("1")
dir_angles = [SubResource("1")]
directions = [SubResource("2")]
idles = [SubResource("2")]
speaks = [SubResource("3")]
dir_angles = Array[ExtResource("2")]([SubResource("1")])
directions = Array[ExtResource("3")]([SubResource("2")])
idles = Array[ExtResource("3")]([SubResource("2")])
speaks = Array[ExtResource("3")]([SubResource("3")])

View File

@@ -42,8 +42,8 @@ navigation_polygon = SubResource("60")
process_mode = 1
position = Vector2(863, 175)
script = ExtResource("6")
custom_cursor = "east"
global_id = "turno_cocina_despensa_puerta_exterior"
custom_cursor = "east"
esc_script = "res://gymkhana/rooms/turno_cocina/despensa/esc/puerta_exterior.esc"
combine_when_selected_action_is_in = PackedStringArray()
is_exit = true

View File

@@ -0,0 +1,28 @@
diff --git a/addons/escoria-core/game/esc_autoload.gd b/addons/escoria-core/game/esc_autoload.gd
index 6c3377dd..bebbe862 100644
--- a/addons/escoria-core/game/esc_autoload.gd
+++ b/addons/escoria-core/game/esc_autoload.gd
@@ -2,6 +2,15 @@ extends Node
## This is Escoria's singleton script.
## It holds accessors to some utils, such as Escoria's logger.
+## Signal sent when Escoria starts a new game[br]
+## [br]
+## #### Parameters[br]
+## [br]
+## None.
+## [br]
+signal new_game_started
+
+
## Signal sent when Escoria is paused[br]
## [br]
## #### Parameters[br]
@@ -221,6 +230,7 @@ func set_game_paused(p_paused: bool):
## Returns nothing.
func new_game():
get_escoria().new_game()
+ new_game_started.emit()
## Called from main menu's "quit" button.[br]
## [br]

View File

@@ -0,0 +1,17 @@
diff --git a/addons/escoria-core/game/core-scripts/save_data/esc_settings_manager.gd b/addons/escoria-core/game/core-scripts/save_data/esc_settings_manager.gd
index 18d4247d..f631a10b 100644
--- a/addons/escoria-core/game/core-scripts/save_data/esc_settings_manager.gd
+++ b/addons/escoria-core/game/core-scripts/save_data/esc_settings_manager.gd
@@ -293,3 +293,11 @@ func save_settings():
self,
"There was an issue writing settings %s" % save_path
)
+
+
+## Returns a custom setting by key or an optional default value. Returns null if not found and no default value is defined.
+func get_custom_setting(key: String, default_value = null):
+ if custom_settings.has(key):
+ return custom_settings.get(key)
+
+ return default_value
\ No newline at end of file

View File

@@ -1,370 +0,0 @@
diff --git a/README.md b/README.md
index fd3d3e60..5e57540a 100644
--- a/README.md
+++ b/README.md
@@ -40,7 +40,10 @@ This is the demo game that acts as a testing ground for future Escoria developme
* “Mystical Ocean Puzzle Game” (Licence CC-BY 4.0)
by Eric Matyas
www.soundimage.org
-
+* "Ambient bird sounds"
+ License: CC0
+ [https://freesound.org/people/Garuda1982/sounds/691629/](https://freesound.org/people/Garuda1982/sounds/691629/)
+
## Cursors
* Pointers part 4 by "yd"
diff --git a/addons/escoria-core/buses/default_bus_layout.tres b/addons/escoria-core/buses/default_bus_layout.tres
index 6ff12e0a..90726934 100644
--- a/addons/escoria-core/buses/default_bus_layout.tres
+++ b/addons/escoria-core/buses/default_bus_layout.tres
@@ -19,3 +19,9 @@ bus/3/mute = false
bus/3/bypass_fx = false
bus/3/volume_db = 0.0
bus/3/send = &"Master"
+bus/4/name = &"Ambient"
+bus/4/solo = false
+bus/4/mute = false
+bus/4/bypass_fx = false
+bus/4/volume_db = 0.0
+bus/4/send = &"Master"
diff --git a/addons/escoria-core/game/core-scripts/esc/esc_object_manager.gd b/addons/escoria-core/game/core-scripts/esc/esc_object_manager.gd
index 8d1c7c1c..047fcabb 100644
--- a/addons/escoria-core/game/core-scripts/esc/esc_object_manager.gd
+++ b/addons/escoria-core/game/core-scripts/esc/esc_object_manager.gd
@@ -16,11 +16,15 @@ const SOUND = "_sound"
## Reserved speech player object.
const SPEECH = "_speech"
+## Reserved ambient player object.
+const AMBIENT = "_ambient"
+
## Array of objects that are reserved and automatically created when Escoria starts up.
const RESERVED_OBJECTS = [
MUSIC,
SOUND,
SPEECH,
+ AMBIENT,
]
@@ -489,7 +493,7 @@ func save_game(p_savegame: ESCSaveGame) -> void:
p_savegame.objects[room_obj.room_global_id] = room_objects_dict
- # Add in reserved objects (music, speech, sound), too.
+ # Add in reserved objects (music, speech, sound, ambient), too.
var reserved_objects: Dictionary = reserved_objects_container.objects
for obj_global_id in reserved_objects:
if not reserved_objects[obj_global_id] is ESCObject:
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_object.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_object.gd
index 76df48b1..64d3596b 100644
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_object.gd
+++ b/addons/escoria-core/game/core-scripts/esc/types/esc_object.gd
@@ -192,7 +192,7 @@ func get_save_data() -> Dictionary:
if self.node.has_method("get_custom_data"):
save_data["custom_data"] = self.node.get_custom_data()
- if self.global_id in ["_music", "_sound"] and self.node.get("state"):
+ if self.global_id in ["_music", "_sound", "_ambient"] and self.node.get("state"):
save_data["state"] = self.node.get("state")
save_data["playback_position"] = self.node.get_playback_position()
diff --git a/addons/escoria-core/game/core-scripts/save_data/esc_savesettings.gd b/addons/escoria-core/game/core-scripts/save_data/esc_savesettings.gd
index 9117d0ec..1df5a43e 100644
--- a/addons/escoria-core/game/core-scripts/save_data/esc_savesettings.gd
+++ b/addons/escoria-core/game/core-scripts/save_data/esc_savesettings.gd
@@ -37,6 +37,10 @@ class_name ESCSaveSettings
## Speech volume only.
@export var speech_volume: float = ProjectSettings.get_setting(
"escoria/sound/speech_volume")
+
+## Ambient volume only.
+@export var ambient_volume: float = ProjectSettings.get_setting(
+ "escoria/sound/ambient_volume")
## True if game has to be fullscreen.
@export var fullscreen: bool = ProjectSettings.get_setting(
diff --git a/addons/escoria-core/game/core-scripts/save_data/esc_settings_manager.gd b/addons/escoria-core/game/core-scripts/save_data/esc_settings_manager.gd
index 722f409e..23a9f855 100644
--- a/addons/escoria-core/game/core-scripts/save_data/esc_settings_manager.gd
+++ b/addons/escoria-core/game/core-scripts/save_data/esc_settings_manager.gd
@@ -77,6 +77,14 @@ func apply_settings() -> void:
)
)
)
+ AudioServer.set_bus_volume_db(
+ AudioServer.get_bus_index(escoria.BUS_AMBIENT),
+ linear_to_db(
+ ESCProjectSettingsManager.get_setting(
+ ESCProjectSettingsManager.AMBIENT_VOLUME
+ )
+ )
+ )
var mode = Window.MODE_EXCLUSIVE_FULLSCREEN if ESCProjectSettingsManager.get_setting(ESCProjectSettingsManager.FULLSCREEN) else Window.MODE_WINDOWED
DisplayServer.window_set_mode(mode)
@@ -130,6 +138,10 @@ func save_settings_resource_to_project_settings(settings: ESCSaveSettings):
ESCProjectSettingsManager.SPEECH_VOLUME,
settings.speech_volume
)
+ ESCProjectSettingsManager.set_setting(
+ ESCProjectSettingsManager.AMBIENT_VOLUME,
+ settings.ambient_volume
+ )
ESCProjectSettingsManager.set_setting(
ESCProjectSettingsManager.FULLSCREEN,
settings.fullscreen
@@ -196,6 +208,9 @@ func get_settings() -> ESCSaveSettings:
settings.speech_volume = ESCProjectSettingsManager.get_setting(
ESCProjectSettingsManager.SPEECH_VOLUME
)
+ settings.ambient_volume = ESCProjectSettingsManager.get_setting(
+ ESCProjectSettingsManager.AMBIENT_VOLUME
+ )
settings.fullscreen = ESCProjectSettingsManager.get_setting(
ESCProjectSettingsManager.WINDOW_MODE
) in [DisplayServer.WINDOW_MODE_FULLSCREEN, DisplayServer.WINDOW_MODE_EXCLUSIVE_FULLSCREEN]
@@ -278,3 +293,10 @@ func save_settings():
self,
"There was an issue writing settings %s" % save_path
)
+
+## Returns a custom setting by key or an optional default value. Returns null if not found and no default value is defined.
+func get_custom_setting(key: String, default_value = null):
+ if custom_settings.has(key):
+ return custom_settings.get(key)
+
+ return default_value
\ No newline at end of file
diff --git a/addons/escoria-core/game/esc_autoload.gd b/addons/escoria-core/game/esc_autoload.gd
index 24b14687..1a224469 100644
--- a/addons/escoria-core/game/esc_autoload.gd
+++ b/addons/escoria-core/game/esc_autoload.gd
@@ -2,6 +2,14 @@ extends Node
## This is Escoria's singleton script.
## It holds accessors to some utils, such as Escoria's logger.
+## Signal sent when Escoria starts a new game[br]
+## [br]
+## #### Parameters[br]
+## [br]
+## None.
+## [br]
+signal new_game_started
+
## Signal sent when Escoria is paused[br]
## [br]
## #### Parameters[br]
@@ -45,6 +53,9 @@ const BUS_MUSIC = "Music"
## Speech audio bus
const BUS_SPEECH = "Speech"
+## Ambient sound audio bus
+const BUS_AMBIENT = "Ambient"
+
# Path to camera scene
const CAMERA_SCENE_PATH = "res://addons/escoria-core/game/scenes/camera_player/camera.tscn"
@@ -218,6 +229,7 @@ func set_game_paused(p_paused: bool):
## Returns nothing.
func new_game():
get_escoria().new_game()
+ new_game_started.emit()
## Called from main menu's "quit" button.[br]
## [br]
diff --git a/addons/escoria-core/game/esc_project_settings_manager.gd b/addons/escoria-core/game/esc_project_settings_manager.gd
index 1e0bee53..3a2b10be 100644
--- a/addons/escoria-core/game/esc_project_settings_manager.gd
+++ b/addons/escoria-core/game/esc_project_settings_manager.gd
@@ -89,6 +89,8 @@ const SPEECH_EXTENSION = _ESCORIA_SETTINGS_ROOT + "/" + _SOUND_ROOT + "/" + "spe
const SPEECH_FOLDER = _ESCORIA_SETTINGS_ROOT + "/" + _SOUND_ROOT + "/" + "speech_folder"
## Path to the speech volume setting.
const SPEECH_VOLUME = _ESCORIA_SETTINGS_ROOT + "/" + _SOUND_ROOT + "/" + "speech_volume"
+## Path to the ambient volume setting.
+const AMBIENT_VOLUME = _ESCORIA_SETTINGS_ROOT + "/" + _SOUND_ROOT + "/" + "ambient_volume"
## Platform-related Escoria project settings root.
const _PLATFORM_ROOT = "platform"
diff --git a/addons/escoria-core/game/main.tscn b/addons/escoria-core/game/main.tscn
index 66e7755b..60f548b5 100644
--- a/addons/escoria-core/game/main.tscn
+++ b/addons/escoria-core/game/main.tscn
@@ -1,10 +1,11 @@
-[gd_scene load_steps=6 format=3 uid="uid://dwlr0gu4erswn"]
+[gd_scene load_steps=7 format=3 uid="uid://dwlr0gu4erswn"]
[ext_resource type="Script" uid="uid://cgvex4ltwyld6" path="res://addons/escoria-core/game/main.gd" id="1"]
[ext_resource type="PackedScene" uid="uid://b0q36us3uuimq" path="res://addons/escoria-core/game/scenes/esc_prompt/esc_prompt_popup.tscn" id="2"]
[ext_resource type="PackedScene" uid="uid://c1txn45mpksqd" path="res://addons/escoria-core/game/scenes/sound/esc_music_player.tscn" id="3"]
[ext_resource type="PackedScene" uid="uid://uwqpnwjmp6aq" path="res://addons/escoria-core/game/scenes/sound/esc_sound_player.tscn" id="5"]
[ext_resource type="PackedScene" uid="uid://c8ecyitwga1dx" path="res://addons/escoria-core/game/scenes/sound/esc_speech_player.tscn" id="6"]
+[ext_resource type="PackedScene" uid="uid://wsdpiju6bxqd" path="res://addons/escoria-core/game/scenes/sound/esc_ambient_player.tscn" id="6_sy38t"]
[node name="main" type="Node"]
script = ExtResource("1")
@@ -41,3 +42,11 @@ layout_mode = 3
anchors_preset = 15
grow_horizontal = 2
grow_vertical = 2
+
+[node name="bg_ambient" parent="." instance=ExtResource("6_sy38t")]
+layout_mode = 3
+anchors_preset = 15
+offset_right = 0.0
+offset_bottom = 0.0
+grow_horizontal = 2
+grow_vertical = 2
diff --git a/addons/escoria-core/game/scenes/sound/esc_sound_player.gd b/addons/escoria-core/game/scenes/sound/esc_sound_player.gd
index 05f839a8..2a9fa64c 100644
--- a/addons/escoria-core/game/scenes/sound/esc_sound_player.gd
+++ b/addons/escoria-core/game/scenes/sound/esc_sound_player.gd
@@ -2,7 +2,7 @@
extends Control
class_name ESCSoundPlayer
-## Global id of the background sound player.
+## Global id of the sfx sound player.
@export var global_id: String = "_sound"
## The state of the sound player. "default" or "off" disable sound. Any other
diff --git a/addons/escoria-core/game/scenes/sound/esc_speech_player.gd b/addons/escoria-core/game/scenes/sound/esc_speech_player.gd
index 74e2ceb8..31fc6681 100644
--- a/addons/escoria-core/game/scenes/sound/esc_speech_player.gd
+++ b/addons/escoria-core/game/scenes/sound/esc_speech_player.gd
@@ -2,7 +2,7 @@
extends Control
class_name ESCSpeechPlayer
-## Global id of the background music player.
+## Global id of the speech player.
@export var global_id: String = "_speech"
## Reference to the audio player.
diff --git a/addons/escoria-core/ui_library/menus/options/options.gd b/addons/escoria-core/ui_library/menus/options/options.gd
index 2ba85861..32a97586 100644
--- a/addons/escoria-core/ui_library/menus/options/options.gd
+++ b/addons/escoria-core/ui_library/menus/options/options.gd
@@ -61,6 +61,7 @@ func initialize_options(p_settings):
_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"]
+ _options.get_node("ambient_volume").value = p_settings["ambient_volume"]
_options.get_node("fullscreen").set_pressed_no_signal(p_settings["fullscreen"])
@@ -142,6 +143,21 @@ func _on_speech_volume_value_changed(value: float) -> void:
escoria.settings_manager.apply_settings()
changed = true
+# Ambient volume was changed
+#
+# #### Parameters
+# - value: The new volume level
+func _on_ambient_volume_value_changed(value: float) -> void:
+ if ESCProjectSettingsManager.get_setting(
+ ESCProjectSettingsManager.AMBIENT_VOLUME
+ ) != value:
+ ESCProjectSettingsManager.set_setting(
+ ESCProjectSettingsManager.AMBIENT_VOLUME,
+ value
+ )
+ escoria.settings_manager.apply_settings()
+ changed = true
+
# Fullscreen was changed
#
diff --git a/addons/escoria-core/ui_library/menus/options/options.tscn b/addons/escoria-core/ui_library/menus/options/options.tscn
index cbcab577..133315cf 100644
--- a/addons/escoria-core/ui_library/menus/options/options.tscn
+++ b/addons/escoria-core/ui_library/menus/options/options.tscn
@@ -1,6 +1,6 @@
[gd_scene load_steps=3 format=3 uid="uid://bhcfnds3yy2yv"]
-[ext_resource type="Texture2D" uid="uid://gwy5bljr0ik1" path="res://addons/escoria-core/ui_library/menus/options/flags/de.png" id="1"]
+[ext_resource type="Texture2D" uid="uid://r6b3dp6ipv5k" path="res://addons/escoria-core/ui_library/menus/options/flags/de.png" id="1"]
[ext_resource type="Script" uid="uid://btyrwps5h2qn7" path="res://addons/escoria-core/ui_library/menus/options/options.gd" id="4"]
[node name="options" type="Control"]
@@ -98,6 +98,16 @@ step = 0.001
[node name="label6" type="Label" parent="VBoxContainer/MarginContainer/options"]
layout_mode = 2
+text = "AMBIENT_VOLUME"
+
+[node name="ambient_volume" type="HSlider" parent="VBoxContainer/MarginContainer/options"]
+layout_mode = 2
+size_flags_horizontal = 3
+max_value = 1.0
+step = 0.001
+
+[node name="label7" type="Label" parent="VBoxContainer/MarginContainer/options"]
+layout_mode = 2
text = "FULLSCREEN"
[node name="fullscreen" type="CheckBox" parent="VBoxContainer/MarginContainer/options"]
@@ -120,6 +130,7 @@ text = "APPLY"
[connection signal="value_changed" from="VBoxContainer/MarginContainer/options/sound_volume" to="." method="_on_sound_volume_changed"]
[connection signal="value_changed" from="VBoxContainer/MarginContainer/options/music_volume" to="." method="_on_music_volume_changed"]
[connection signal="value_changed" from="VBoxContainer/MarginContainer/options/speech_volume" to="." method="_on_speech_volume_value_changed"]
+[connection signal="value_changed" from="VBoxContainer/MarginContainer/options/ambient_volume" to="." method="_on_ambient_volume_value_changed"]
[connection signal="toggled" from="VBoxContainer/MarginContainer/options/fullscreen" to="." method="_on_fullscreen_toggled"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/back" to="." method="_on_back_pressed"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/apply" to="." method="_on_apply_pressed"]
diff --git a/game/rooms/room04/esc/left_exit.esc b/game/rooms/room04/esc/left_exit.esc
index a5fe6648..bd0a2aa5 100644
--- a/game/rooms/room04/esc/left_exit.esc
+++ b/game/rooms/room04/esc/left_exit.esc
@@ -1,4 +1,5 @@
:exit_scene
+ stop_snd(_ambient)
change_scene("res://game/rooms/room03/room03.tscn")
:look
diff --git a/game/rooms/room04/esc/right_exit.esc b/game/rooms/room04/esc/right_exit.esc
index 20d5cd16..658ff435 100644
--- a/game/rooms/room04/esc/right_exit.esc
+++ b/game/rooms/room04/esc/right_exit.esc
@@ -1,2 +1,3 @@
:exit_scene
+ stop_snd(_ambient)
change_scene("res://game/rooms/room05/room05.tscn")
diff --git a/game/rooms/room04/esc/room04.esc b/game/rooms/room04/esc/room04.esc
index 6545739b..4e281146 100644
--- a/game/rooms/room04/esc/room04.esc
+++ b/game/rooms/room04/esc/room04.esc
@@ -1,6 +1,8 @@
:setup
global r4_door_look_count = 0
+ play_snd("res://game/sfx/sounds/birds_ambient_loop.ogg", _ambient)
+
if ESC_LAST_SCENE == "room3":
teleport($player, $l_exit)
# Set player look right
diff --git a/game/translations/main_menu.csv b/game/translations/main_menu.csv
index fae9a28a..9e51686f 100644
--- a/game/translations/main_menu.csv
+++ b/game/translations/main_menu.csv
@@ -11,6 +11,7 @@ GENERAL_VOLUME,General,Général,Allgemein,General
MUSIC_VOLUME,Music,Musique,Musik,Música
SOUND_VOLUME,Sound effects,Effets sonores,Soundeffekte,Efectos de sonido
SPEECH_VOLUME,Speech,Voix,Sprachausgabe,Voz
+AMBIENT_VOLUME,Ambient,Ambiance,Atmosphäre,Ambiente
FULLSCREEN,Fullscreen,Plein écran,Vollbild,Pantalla completa
CANCEL,Cancel,Annuler,Abbrechen,Cancelar
OK,OK,Ok,Ok,Ok
diff --git a/project.godot b/project.godot
index 742cd758..37462240 100644
--- a/project.godot
+++ b/project.godot
@@ -74,6 +74,7 @@ sound/sfx_volume=1
sound/speech_volume=1
sound/speech_folder="res://game/speech"
sound/speech_extension="ogg"
+sound/ambient_volume=1
platform/skip_cache=false
platform/skip_cache.mobile=true
sound/speech_enabled=1

View File

@@ -26,8 +26,8 @@ buses/default_bus_layout="res://addons/escoria-core/buses/default_bus_layout.tre
[autoload]
gymkhana="*res://addons/escoria-ui-return-monkey-island/gymkhana_autoload.gd"
escoria="*res://addons/escoria-core/game/esc_autoload.gd"
gymkhana="*res://addons/escoria-ui-return-monkey-island/gymkhana_autoload.gd"
[debug]
@@ -47,7 +47,7 @@ search_in_file_extensions=PackedStringArray("gd", "shader", "esc")
[editor_plugins]
enabled=PackedStringArray("res://addons/escoria-core/plugin.cfg", "res://addons/escoria-ui-return-monkey-island-dialog-simple/plugin.cfg", "res://addons/escoria-ui-return-monkey-island/plugin.cfg", "res://addons/kenyoni/plugin_reloader/plugin.cfg", "res://addons/tattomoosa.spinner/plugin.cfg")
enabled=PackedStringArray("res://addons/escoria-core/plugin.cfg", "res://addons/escoria-ui-return-monkey-island-dialog-simple/plugin.cfg", "res://addons/escoria-ui-return-monkey-island/plugin.cfg", "res://addons/tattomoosa.spinner/plugin.cfg")
[escoria]
@@ -101,6 +101,8 @@ rtmi_dialog_simple/clear_text_by_click_only=false
rtmi_dialog_simple/reading_speed_in_wpm=100
rtmi_dialog_simple/left_click_action="Speed up"
rtmi_dialog_simple/stop_talking_animation_on="End of audio"
rtmi_ui/sound_library_folder="res://gymkhana/sounds/"
rtmi_ui/savegame_enabled=true
rtmi_ui/debug_enabled=true
rtmi_ui/achievement_list=["coleccionista", "amenazas", "gourmet", "chistes", "palestina", "ordenado", "musica", "hambrientas"]
debug/enable_hover_stack_viewer=false
@@ -110,8 +112,6 @@ debug/perform_script_analysis_at_runtime.release=true
debug/perform_script_analysis_at_runtime.debug=true
debug/log_level.release="INFO"
debug/log_level.debug="INFO"
rtmi_ui/sound_library_folder="res://game/sounds"
rtmi_ui/savegame_enabled=true
[file_customization]