diff --git a/addons b/addons
new file mode 120000
index 00000000..473b8cc6
--- /dev/null
+++ b/addons
@@ -0,0 +1 @@
+../escoria-demo-game/addons/
\ No newline at end of file
diff --git a/addons/escoria-core/_test/test_esc_compiler.gd b/addons/escoria-core/_test/test_esc_compiler.gd
deleted file mode 100644
index f2453740..00000000
--- a/addons/escoria-core/_test/test_esc_compiler.gd
+++ /dev/null
@@ -1,300 +0,0 @@
-extends Control
-
-
-func _test_basic() -> bool:
- var esc = """
-:test
-# first group
->
- say player "Test"
- # Second group
- > [test]
- say player "Test2 BLANK"
- say player "Test3" [test2]
- # Third group
- >
-
- say player "Test4"
-# Fourth group
->
- say player "Test5"
- say player "Test 6"
- say player TEST:"Test 7"
- """
- var script = escoria.esc_compiler.compile(esc.split("\n"))
-
- var subject = script
- assert(subject is ESCScript)
-
- subject = script.events.keys()
- assert(subject.size() == 1)
- assert(subject[0] == "test")
-
- subject = script.events["test"].statements
- assert(subject.size() == 2)
-
- subject = script.events["test"].statements[0]
- assert(subject is ESCGroup)
- assert(subject.statements.size() == 4)
-
- subject = script.events["test"].statements[0].statements[0]
- assert(subject is ESCCommand)
- assert(subject.name == "say")
- assert(subject.parameters.size() == 2)
- assert(subject.parameters[0] == "player")
- assert(subject.parameters[1] == '"Test"')
-
- subject = script.events["test"].statements[0].statements[1]
- assert(subject is ESCGroup)
- assert(subject.conditions.size() == 1)
- assert(subject.conditions[0] is ESCCondition)
- assert(subject.conditions[0].flag == "test")
-
- subject = script.events["test"].statements[0].statements[1].statements[0]
- assert(subject is ESCCommand)
- assert(subject.name == "say")
- assert(subject.parameters.size() == 2)
- assert(subject.parameters[0] == "player")
- assert(subject.parameters[1] == '"Test2 BLANK"')
-
- subject = script.events["test"].statements[0].statements[2]
- assert(subject is ESCCommand)
- assert(subject.name == "say")
- assert(subject.parameters.size() == 2)
- assert(subject.parameters[0] == "player")
- assert(subject.parameters[1] == '"Test3"')
- assert(subject.conditions.size() == 1)
- assert(subject.conditions[0].flag == "test2")
-
- subject = script.events["test"].statements[0].statements[3]
- assert(subject is ESCGroup)
- assert(subject.statements.size() == 1)
-
- subject = script.events["test"].statements[1]
- assert(subject is ESCGroup)
- assert(subject.statements.size() == 3)
-
- subject = script.events["test"].statements[1].statements[1]
- assert(subject is ESCCommand)
- assert(subject.name == "say")
- assert(subject.parameters[1] == '"Test 6"')
-
- subject = script.events["test"].statements[1].statements[2]
- assert(subject is ESCCommand)
- assert(subject.name == "say")
- assert(subject.parameters[1] == "TEST:\"Test 7\"")
-
- return true
-
-
-func _test_conditions() -> bool:
- var esc = """
-:test
-say player "Test" [flag]
-say player "Test" [flag1,flag2]
-say player "Test" [!flag]
-say player "Test" [i/flag]
-say player "Test" [i/flag,flag]
-say player "Test" [i/flag,flag,!flag2]
-say player "Test" [eq flag 3]
-say player "Test" [eq flag 3,gt flag 5]
-say player "Test" [!eq flag 3]
- """
- var script = escoria.esc_compiler.compile(esc.split("\n"))
-
- var subject = script.events["test"].statements[0]
- assert(subject is ESCCommand)
- assert(subject.conditions.size() == 1)
-
- subject = script.events["test"].statements[0].conditions[0]
- assert(subject.flag == "flag")
- assert(not subject.negated)
- assert(not subject.inventory)
- assert(subject.comparison == ESCCondition.COMPARISON_NONE)
-
- subject = script.events["test"].statements[1].conditions
- assert(subject.size() == 2)
- assert(subject[0].flag == "flag1")
- assert(subject[1].flag == "flag2")
-
- subject = script.events["test"].statements[2].conditions
- assert(subject.size() == 1)
- assert(subject[0].flag == "flag")
- assert(subject[0].negated)
-
- subject = script.events["test"].statements[3].conditions
- assert(subject.size() == 1)
- assert(subject[0].flag == "flag")
- assert(subject[0].inventory)
-
- subject = script.events["test"].statements[4].conditions
- assert(subject.size() == 2)
- assert(subject[0].flag == "flag")
- assert(subject[0].inventory)
- assert(subject[1].flag == "flag")
- assert(not subject[1].inventory)
-
- subject = script.events["test"].statements[5].conditions
- assert(subject.size() == 3)
- assert(subject[0].flag == "flag")
- assert(subject[0].inventory)
- assert(subject[1].flag == "flag")
- assert(not subject[1].inventory)
- assert(subject[2].flag == "flag2")
- assert(not subject[2].inventory)
- assert(subject[2].negated)
-
- subject = script.events["test"].statements[6].conditions
- assert(subject.size() == 1)
- assert(subject[0].flag == "flag")
- assert(subject[0].comparison == ESCCondition.COMPARISON_EQ)
- assert(subject[0].comparison_value == 3)
-
- subject = script.events["test"].statements[7].conditions
- assert(subject.size() == 2)
- assert(subject[0].flag == "flag")
- assert(subject[0].comparison == ESCCondition.COMPARISON_EQ)
- assert(subject[0].comparison_value == 3)
- assert(subject[1].flag == "flag")
- assert(subject[1].comparison == ESCCondition.COMPARISON_GT)
- assert(subject[1].comparison_value == 5)
-
- subject = script.events["test"].statements[8].conditions
- assert(subject.size() == 1)
- assert(subject[0].flag == "flag")
- assert(subject[0].comparison == ESCCondition.COMPARISON_EQ)
- assert(subject[0].comparison_value == 3)
- assert(subject[0].negated)
-
- return true
-
-
-func _test_event_flags() -> bool:
- var esc = """
-:test | TK
-:test2 | TK NO_TT
-:test3 | TK NO_TT NO_UI
- """
- var script = escoria.esc_compiler.compile(esc.split("\n"))
-
- var subject = script.events
- assert(subject.keys().size() == 3)
- assert("test" in subject.keys())
- assert("test2" in subject.keys())
- assert("test3" in subject.keys())
-
- subject = script.events["test"]
- assert(subject.name == "test")
- assert(subject.flags & ESCEvent.FLAG_TK != 0)
- assert(subject.flags & ESCEvent.FLAG_NO_TT == 0)
-
- subject = script.events["test2"]
- assert(subject.name == "test2")
- assert(subject.flags & ESCEvent.FLAG_TK != 0)
- assert(subject.flags & ESCEvent.FLAG_NO_TT != 0)
-
- subject = script.events["test3"]
- assert(subject.name == "test3")
- assert(subject.flags & ESCEvent.FLAG_TK != 0)
- assert(subject.flags & ESCEvent.FLAG_NO_TT != 0)
- assert(subject.flags & ESCEvent.FLAG_NO_UI != 0)
-
- return true
-
-
-func _test_dialog() -> bool:
- var esc = """
-:test
-?
- - "Option 1"
- say player "test"
- say player "testb"
- say player "testb?"
- - "Option 2" [flag]
- say player "test2"
- ?
- - "Suboption 1"
- say player "test21"
- - "Suboption 2"
- say player "test22"
- !
- - "Option 3"
- >
- say player "test3"
- - TEST:"Option 4"
- say player "test4"
-!
- """
- var script = escoria.esc_compiler.compile(esc.split("\n"))
-
- var subject = script.events["test"].statements
- assert(subject.size() == 1)
-
- assert(subject[0] is ESCDialog)
- assert(subject[0].options.size() == 4)
-
- subject = script.events["test"].statements[0].options[0]
- assert(subject is ESCDialogOption)
- assert(subject.option == "Option 1")
-
- subject = script.events["test"].statements[0].options[0].statements
- assert(subject.size() == 3)
- assert(subject[0] is ESCCommand)
- assert(subject[0].name == "say")
- assert(subject[0].parameters.size() == 2)
- assert(subject[1] is ESCCommand)
- assert(subject[1].name == "say")
- assert(subject[1].parameters.size() == 2)
- assert(subject[1].parameters[1] == '"testb"')
- assert(subject[2] is ESCCommand)
- assert(subject[2].name == "say")
- assert(subject[2].parameters.size() == 2)
- assert(subject[2].parameters[1] == '"testb?"')
-
- subject = script.events["test"].statements[0].options[1]
- assert(subject is ESCDialogOption)
- assert(subject.option == "Option 2")
- assert(subject.conditions.size() == 1)
- assert(subject.conditions[0].flag == "flag")
-
- subject = script.events["test"].statements[0].options[1].statements
- assert(subject.size() == 2)
- assert(subject[0] is ESCCommand)
- assert(subject[0].name == "say")
- assert(subject[0].parameters.size() == 2)
-
- assert(subject[1] is ESCDialog)
- assert(subject[1].options.size() == 2)
-
- subject = script.events["test"].statements[0].options[2]
- assert(subject is ESCDialogOption)
- assert(subject.option == "Option 3")
-
- subject = script.events["test"].statements[0].options[2].statements
- assert(subject.size() == 1)
- assert(subject[0] is ESCGroup)
- assert(subject[0].statements.size() == 1)
- assert(subject[0].statements[0] is ESCCommand)
- assert(subject[0].statements[0].parameters.size() == 2)
-
- subject = script.events["test"].statements[0].options[3]
- assert(subject is ESCDialogOption)
- assert(subject.option == "TEST")
-
- return true
-
-
-func _on_BasicFunctionality_pressed():
- $VBoxContainer/VBoxContainer/BasicFunctionality.pressed = self._test_basic()
-
-
-func _on_Conditions_pressed():
- $VBoxContainer/VBoxContainer/Conditions.pressed = self._test_conditions()
-
-
-func _on_EventFlags_pressed():
- $VBoxContainer/VBoxContainer/EventFlags.pressed = self._test_event_flags()
-
-
-func _on_Dialog_pressed():
- $VBoxContainer/VBoxContainer/Dialog.pressed = self._test_dialog()
diff --git a/addons/escoria-core/_test/test_esc_compiler.tscn b/addons/escoria-core/_test/test_esc_compiler.tscn
deleted file mode 100644
index 3022be8a..00000000
--- a/addons/escoria-core/_test/test_esc_compiler.tscn
+++ /dev/null
@@ -1,58 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-core/_test/test_esc_compiler.gd" type="Script" id=1]
-
-[node name="Testsuite" type="Control"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-anchor_right = 1.0
-anchor_bottom = 1.0
-margin_right = 1.0
-margin_bottom = 1.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer"]
-margin_right = 1281.0
-margin_bottom = 172.0
-
-[node name="BasicFunctionality" type="CheckButton" parent="VBoxContainer/VBoxContainer"]
-margin_right = 1281.0
-margin_bottom = 40.0
-text = "Basic Functionality"
-align = 1
-
-[node name="Conditions" type="CheckButton" parent="VBoxContainer/VBoxContainer"]
-margin_top = 44.0
-margin_right = 1281.0
-margin_bottom = 84.0
-text = "Check conditions"
-align = 1
-
-[node name="EventFlags" type="CheckButton" parent="VBoxContainer/VBoxContainer"]
-margin_top = 88.0
-margin_right = 1281.0
-margin_bottom = 128.0
-text = "Check event flags"
-align = 1
-
-[node name="Dialog" type="CheckButton" parent="VBoxContainer/VBoxContainer"]
-margin_top = 132.0
-margin_right = 1281.0
-margin_bottom = 172.0
-text = "Check dialogs"
-align = 1
-
-[connection signal="pressed" from="VBoxContainer/VBoxContainer/BasicFunctionality" to="." method="_on_BasicFunctionality_pressed"]
-[connection signal="pressed" from="VBoxContainer/VBoxContainer/Conditions" to="." method="_on_Conditions_pressed"]
-[connection signal="pressed" from="VBoxContainer/VBoxContainer/EventFlags" to="." method="_on_EventFlags_pressed"]
-[connection signal="pressed" from="VBoxContainer/VBoxContainer/Dialog" to="." method="_on_Dialog_pressed"]
diff --git a/addons/escoria-core/_test/test_migrations.gd b/addons/escoria-core/_test/test_migrations.gd
deleted file mode 100644
index 19ecb45d..00000000
--- a/addons/escoria-core/_test/test_migrations.gd
+++ /dev/null
@@ -1,20 +0,0 @@
-extends Control
-
-
-
-func _on_CheckESCMigrationManager_pressed() -> bool:
- var savegame: ESCSaveGame = ESCSaveGame.new()
-
- savegame.globals["test"] = "testa"
-
- var migration_manager: ESCMigrationManager = ESCMigrationManager.new()
- savegame = migration_manager.migrate(
- savegame,
- "1.0.0",
- "2.0.0",
- "res://addons/escoria-core/_test/testversions"
- )
-
- assert(savegame.globals["test"] == "testc")
-
- return true
diff --git a/addons/escoria-core/_test/test_migrations.tscn b/addons/escoria-core/_test/test_migrations.tscn
deleted file mode 100644
index bd8eadcf..00000000
--- a/addons/escoria-core/_test/test_migrations.tscn
+++ /dev/null
@@ -1,25 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-core/_test/test_migrations.gd" type="Script" id=1]
-
-[node name="Control" type="Control"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-anchor_right = 1.0
-anchor_bottom = 1.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="CheckESCMigrationManager" type="CheckButton" parent="VBoxContainer"]
-margin_right = 1280.0
-margin_bottom = 40.0
-text = "Check ESCMigrationManager"
-
-[connection signal="pressed" from="VBoxContainer/CheckESCMigrationManager" to="." method="_on_CheckESCMigrationManager_pressed"]
diff --git a/addons/escoria-core/_test/testversions/1.0.1.gd b/addons/escoria-core/_test/testversions/1.0.1.gd
deleted file mode 100644
index a1cf8b8c..00000000
--- a/addons/escoria-core/_test/testversions/1.0.1.gd
+++ /dev/null
@@ -1,5 +0,0 @@
-extends ESCMigration
-
-func migrate():
- self._savegame.globals["test"] = "testb"
-
diff --git a/addons/escoria-core/_test/testversions/1.1.0.gd b/addons/escoria-core/_test/testversions/1.1.0.gd
deleted file mode 100644
index 78404903..00000000
--- a/addons/escoria-core/_test/testversions/1.1.0.gd
+++ /dev/null
@@ -1,5 +0,0 @@
-extends ESCMigration
-
-func migrate():
- self._savegame.globals["test"] = "testc"
-
diff --git a/addons/escoria-core/default_bus_layout.tres b/addons/escoria-core/default_bus_layout.tres
deleted file mode 100644
index 196e4fec..00000000
--- a/addons/escoria-core/default_bus_layout.tres
+++ /dev/null
@@ -1,21 +0,0 @@
-[gd_resource type="AudioBusLayout" format=2]
-
-[resource]
-bus/1/name = "SFX"
-bus/1/solo = false
-bus/1/mute = false
-bus/1/bypass_fx = false
-bus/1/volume_db = 0.0
-bus/1/send = "Master"
-bus/2/name = "Music"
-bus/2/solo = false
-bus/2/mute = false
-bus/2/bypass_fx = false
-bus/2/volume_db = 0.0
-bus/2/send = "Master"
-bus/3/name = "Speech"
-bus/3/solo = false
-bus/3/mute = false
-bus/3/bypass_fx = false
-bus/3/volume_db = 0.0
-bus/3/send = "Master"
diff --git a/addons/escoria-core/design/esc_background.svg b/addons/escoria-core/design/esc_background.svg
deleted file mode 100644
index 01762fa6..00000000
--- a/addons/escoria-core/design/esc_background.svg
+++ /dev/null
@@ -1,17 +0,0 @@
-
-
- esc_background
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/escoria-core/design/esc_exit.svg b/addons/escoria-core/design/esc_exit.svg
deleted file mode 100644
index 5b1fcf14..00000000
--- a/addons/escoria-core/design/esc_exit.svg
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
- esc_exit
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/escoria-core/design/esc_item.svg b/addons/escoria-core/design/esc_item.svg
deleted file mode 100644
index 86e28f06..00000000
--- a/addons/escoria-core/design/esc_item.svg
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
- esc_item
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/escoria-core/design/esc_location.svg b/addons/escoria-core/design/esc_location.svg
deleted file mode 100644
index 56d3c5bb..00000000
--- a/addons/escoria-core/design/esc_location.svg
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- esc_location
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/escoria-core/design/esc_player.svg b/addons/escoria-core/design/esc_player.svg
deleted file mode 100644
index 9a58d5ea..00000000
--- a/addons/escoria-core/design/esc_player.svg
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
- esc_player
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/escoria-core/design/esc_room.svg b/addons/escoria-core/design/esc_room.svg
deleted file mode 100644
index 917cbb6f..00000000
--- a/addons/escoria-core/design/esc_room.svg
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
- esc_room
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/escoria-core/design/esc_terrain.svg b/addons/escoria-core/design/esc_terrain.svg
deleted file mode 100644
index 51be6a06..00000000
--- a/addons/escoria-core/design/esc_terrain.svg
+++ /dev/null
@@ -1,14 +0,0 @@
-
-
- esc_terrain
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/addons/escoria-core/design/escoria-logo-small.png b/addons/escoria-core/design/escoria-logo-small.png
deleted file mode 100644
index 50b62486..00000000
Binary files a/addons/escoria-core/design/escoria-logo-small.png and /dev/null differ
diff --git a/addons/escoria-core/design/escoria-logo.png b/addons/escoria-core/design/escoria-logo.png
deleted file mode 100644
index 2a5a52d3..00000000
Binary files a/addons/escoria-core/design/escoria-logo.png and /dev/null differ
diff --git a/addons/escoria-core/design/escoria-logo.svg b/addons/escoria-core/design/escoria-logo.svg
deleted file mode 100644
index 115d9abd..00000000
--- a/addons/escoria-core/design/escoria-logo.svg
+++ /dev/null
@@ -1,594 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- image/svg+xml
-
-
-
-
-
-
-
-
-
- ESC
- RIA
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/escoria-core/design/icons.sketch b/addons/escoria-core/design/icons.sketch
deleted file mode 100644
index 348e920a..00000000
Binary files a/addons/escoria-core/design/icons.sketch and /dev/null differ
diff --git a/addons/escoria-core/game/assets/images/no_image.png b/addons/escoria-core/game/assets/images/no_image.png
deleted file mode 100644
index 7c06dbb1..00000000
Binary files a/addons/escoria-core/game/assets/images/no_image.png and /dev/null differ
diff --git a/addons/escoria-core/game/assets/images/no_image.png.import b/addons/escoria-core/game/assets/images/no_image.png.import
deleted file mode 100644
index d59713d9..00000000
--- a/addons/escoria-core/game/assets/images/no_image.png.import
+++ /dev/null
@@ -1,34 +0,0 @@
-[remap]
-
-importer="texture"
-type="StreamTexture"
-path="res://.import/no_image.png-7e4632ad2d21010b279ddaa4725bacb7.stex"
-metadata={
-"vram_texture": false
-}
-
-[deps]
-
-source_file="res://addons/escoria-core/game/assets/images/no_image.png"
-dest_files=[ "res://.import/no_image.png-7e4632ad2d21010b279ddaa4725bacb7.stex" ]
-
-[params]
-
-compress/mode=0
-compress/lossy_quality=0.7
-compress/hdr_mode=0
-compress/bptc_ldr=0
-compress/normal_map=0
-flags/repeat=0
-flags/filter=false
-flags/mipmaps=false
-flags/anisotropic=false
-flags/srgb=2
-process/fix_alpha_border=true
-process/premult_alpha=false
-process/HDR_as_SRGB=false
-process/invert_color=false
-stream=false
-size_limit=0
-detect_3d=true
-svg/scale=1.0
diff --git a/addons/escoria-core/game/assets/images/no_image.xcf b/addons/escoria-core/game/assets/images/no_image.xcf
deleted file mode 100644
index 2a7ef082..00000000
Binary files a/addons/escoria-core/game/assets/images/no_image.xcf and /dev/null differ
diff --git a/addons/escoria-core/game/assets/images/white.png b/addons/escoria-core/game/assets/images/white.png
deleted file mode 100644
index 573faa33..00000000
Binary files a/addons/escoria-core/game/assets/images/white.png and /dev/null differ
diff --git a/addons/escoria-core/game/core-scripts/behaviors/esc_movable.gd b/addons/escoria-core/game/core-scripts/behaviors/esc_movable.gd
deleted file mode 100644
index a2367f83..00000000
--- a/addons/escoria-core/game/core-scripts/behaviors/esc_movable.gd
+++ /dev/null
@@ -1,517 +0,0 @@
-# Node that performs the moving (walk, teleport, terrain scaling...) actions on
-# its parent node.
-extends Node
-class_name ESCMovable
-
-
-# Tasks carried out by this walkable node
-# NONE - The node is inactive
-# WALK - The node walks the parent somewhere
-# SLIDE - The node slides the parent somewhere
-enum MovableTask {
- NONE,
- WALK,
- SLIDE
-}
-
-
-# Character path through the scene as calculated by the Pathfinder
-var walk_path: Array = []
-
-# Current active walk path entry
-var path_ofs: int
-
-# The destination where the character should be moving to
-var walk_destination: Vector2
-
-# The walk context currently carried out by this movable node
-var walk_context: ESCWalkContext = null
-
-# Whether the character was moved at all
-var moved: bool
-
-# Player Direction used to reflect the movement to the new position
-var last_dir: int
-
-# The last scaling applied to the parent
-var last_scale: Vector2
-
-# Whether the current direction animation is flipped
-var is_mirrored: bool
-
-
-var _orig_speed: float = 0.0
-
-
-# Shortcut variable that references the node's parent
-onready var parent = get_parent()
-
-
-# Currenly running task
-onready var task = MovableTask.NONE
-
-
-# Add the signal "arrived" to the parent node, which is emitted when
-# the destination position was reached
-func _ready() -> void:
- if not parent.has_user_signal("arrived"):
- parent.add_user_signal("arrived")
-
-
-# Main processing loop
-#
-# #### Parameters
-#
-# - delta: Time that has passed since the last call to this function
-func _process(delta: float) -> void:
- if Engine.is_editor_hint():
- return
-
- if task == MovableTask.WALK or task == MovableTask.SLIDE:
- var old_pos = parent.get_position()
- var new_pos = _calculate_movement(delta)
- if new_pos == null:
- return
-
- if task == MovableTask.WALK:
- # Get the angle of the object to face the position to reach.
- var angle: float = (old_pos.angle_to_point(new_pos))
- _perform_walk_orientation(angle)
-
- update_terrain()
- else:
- moved = false
- set_process(false)
-
-
-# Calculates the next position of the object.
-#
-# #### Parameters
-#
-# - delta: the time elapsed from last frame
-#
-# *Returns*
-# The new Vector2 position of the object, or null if stop walking.
-func _calculate_movement(delta: float):
- # Initialize the current pos and previous pos variables
- var pos: Vector2 = parent.get_position()
- var old_pos: Vector2 = pos
-
- # Get next waypoint from the walkpath array.
- var next: Vector2
- if walk_path.size() > 1:
- next = walk_path[path_ofs + 1]
- else:
- next = walk_path[path_ofs]
-
- # Movement speed calculation
- var movement_speed: float = parent.speed * delta * pow(last_scale.x, 2) * \
- parent.terrain.player_speed_multiplier
- if walk_context.fast:
- movement_speed *= parent.terrain.player_doubleclick_speed_multiplier
-
- # Calculate the direction vector from current position and next waypoint
- var dir: Vector2 = (next - pos).normalized()
-
- # If we're close to the next waypoint (ie. distance < necessary movement
- # speed to get to this waypoint, we consider the waypoint reached
- # and pass to the next one.
- # Else, calculate the new position.
- var new_pos: Vector2
- if pos.distance_to(next) < movement_speed:
- new_pos = next
- path_ofs += 1
- else:
- new_pos = pos + dir * movement_speed * parent.v_speed_damp
-
- # If current waypoint id is >= the number of waypoints, were're at the
- # end of the walk: stop walking.
- if path_ofs >= walk_path.size() - 1:
- walk_stop(walk_destination)
- return
-
- # Update current position variable
- pos = new_pos
- parent.set_position(pos)
- return pos
-
-# Calculates the orientation of the object while walking, to play the right
-# animation according to this orientation.
-#
-# #### Parameters
-#
-# - angle: the angle X axis and object's facing direction.
-func _perform_walk_orientation(angle: float):
- last_dir = _get_dir_deg(ESCUtils.get_deg_from_rad(angle),
- parent.animations)
-
- var animation_player: ESCAnimationPlayer = \
- parent.get_animation_player()
-
- var current_animation = animation_player.get_animation()
-
- var animation_to_play = \
- parent.animations.directions[last_dir].animation
- if current_animation != animation_to_play and \
- animation_player.has_animation(animation_to_play):
- animation_player.play(animation_to_play)
- elif current_animation != animation_to_play and \
- not animation_player.has_animation(animation_to_play):
- current_animation = animation_to_play
- escoria.logger.warn(
- self,
- "Character %s has no animation %s\nBypassing the missing animation and movement command."
- % [parent.global_id, animation_to_play]
- )
-
- is_mirrored = parent.animations.directions[last_dir].mirrored
-
-
-# Teleports this item to the target position.
-#
-# #### Parameters
-#
-# - target: Position2d or ESCItem to teleport to
-func teleport(target: Node) -> void:
- if target.has_method("get_interact_position"):
- parent.global_position = target.get_interact_position()
- escoria.logger.info(
- self,
- "Object %s is teleported to position %s."
- % [target.name, parent.global_position]
- )
- elif "position" in target:
- escoria.logger.info(
- self,
- "Object %s teleported to position %s."
- % [parent.global_id, str(target.global_position)]
- )
- parent.global_position = target.global_position
- else:
- escoria.logger.error(
- self,
- "Target %s could not be teleported. Please configure the interact position parameter or create a child ESCLocation node." % target
- )
-
-
-# Teleports this item to the target position.
-#
-# #### Parameters
-#
-# - target: Vector2 target position to teleport to
-func teleport_to(target: Vector2) -> void:
- escoria.logger.info(
- self,
- "Object %s teleported to position %s."
- % [parent.global_id, str(target)]
- )
- parent.global_position = target
-
-
-# Walk to a given position
-#
-# #### Parameters
-#
-# - pos: Position to walk to
-# - p_walk_context: Walk context to use
-func walk_to(pos: Vector2, p_walk_context: ESCWalkContext = null) -> void:
- if not parent.terrain:
- walk_stop(parent.get_position())
- return
-
- if task == MovableTask.WALK:
- if walk_context.target_object == p_walk_context.target_object \
- or walk_context.target_position \
- == p_walk_context.target_position:
- walk_context.fast = p_walk_context.fast
-
- walk_context = p_walk_context
-
- if task == MovableTask.NONE:
- task = MovableTask.WALK
-
- walk_path = parent.terrain.get_simple_path(parent.get_position(), pos, true)
-
- if walk_path.size() == 0:
- task = MovableTask.NONE
- walk_stop(parent.get_position())
- set_process(false)
- return
- moved = true
- walk_destination = walk_path[walk_path.size()-1]
- path_ofs = 0
- task = MovableTask.WALK
- set_process(true)
-
-
-# We have finished walking. Set the idle pose and complete
-#
-# #### Parameters
-#
-# - pos: Final target position
-func walk_stop(pos: Vector2) -> void:
- parent.global_position = pos
-# parent.interact_status = parent.INTERACT_STATES.INTERACT_NONE
- walk_path = []
-
- if _orig_speed > 0:
- parent.speed = _orig_speed
- _orig_speed = 0.0
-
- task = MovableTask.NONE
- moved = false
- set_process(false)
-
- # If we're heading to an object and reached its interaction position,
- # orient towards the defined interaction direction set on the object
- # (if any), can be ESCItem or ESCLocation
- if walk_context.target_object and \
- walk_context.target_object.node.player_orients_on_arrival:
- var orientation = walk_context.target_object.node.interaction_direction
- last_dir = orientation
- parent.get_animation_player().play(
- parent.animations.idles[orientation].animation
- )
- is_mirrored = parent.animations.idles[orientation].mirrored
- else:
- parent.get_animation_player().play(
- parent.animations.idles[last_dir].animation
- )
- is_mirrored = parent.animations.idles[last_dir].mirrored
-
- update_terrain()
-
- if walk_context.target_object:
- escoria.logger.debug(
- self,
- "%s arrived at %s." % [
- parent.global_id,
- walk_context.target_object.global_id
- ]
- )
- else:
- escoria.logger.debug(
- self,
- "%s arrived at %s." % [
- parent.global_id,
- walk_context.target_position
- ]
- )
- parent.emit_signal("arrived", walk_context)
-
-
-# Update the sprite scale and lighting
-#
-# #### Parameters
-#
-# - on_event_finished_name: Used if this function is called from an ESC event
-func update_terrain(on_event_finished_name = null) -> void:
- if !parent.terrain or parent.terrain == null \
- or !is_instance_valid(parent.terrain):
- return
- if on_event_finished_name != null \
- and on_event_finished_name != ESCEventManager.EVENT_SETUP:
- return
- if parent.get("is_exit"):
- return
- if parent.get("dont_apply_terrain_scaling"):
- return
- if not parent.is_inside_tree():
- return
-
- var pos = parent.global_position
- if pos.y <= VisualServer.CANVAS_ITEM_Z_MAX:
- parent.z_index = pos.y
- else:
- parent.z_index = VisualServer.CANVAS_ITEM_Z_MAX
-
- var factor = parent.terrain.get_terrain(pos)
- var scal = parent.terrain.get_scale_range(factor)
- if scal != parent.get_scale():
- last_scale = scal
- parent.scale = last_scale
-
- var color = parent.terrain.get_light(pos)
- parent.modulate = color
-
- var sprite: Node = parent.get_sprite()
-
- # Do not flip the entire character, because that would conflict
- # with shadows that expect to be siblings of $texture
- #
- # - Current sprite scale is >0, meaning it's currently heading to right
- # - but calculated is_mirrored is <0, meaning it's going to head to left
- # Or, on the contrary:
- # - current sprite scale is <0, meaning it's currently heading to left
- # - but calculated is_mirrored is >0, meaning it's going to head to right
- # We're operating a 180° turn (from right to left, or from left to right)
- # So we just inverse the sprite scale.
- if is_mirrored and sprite.scale.x > 0 \
- or not is_mirrored and sprite.scale.x < 0:
- sprite.scale.x *= -1
- parent.collision.scale.x *= -1
-
-
-# Get the player direction index based on degrees
-#
-# #### Parameters
-#
-# - deg: Degrees
-# - animations: Player animations script
-func _get_dir_deg(deg: int, animations: ESCAnimationResource) -> int:
- # We turn the angle by -90° because angle_to_point gives the angle
- # against X axis, not Y
- deg = wrapi(deg - 90, 0, 360)
- var dir = -1
- var i = 0
-
- for direction_angle in animations.dir_angles:
- if _is_angle_in_interval(deg, direction_angle):
- dir = i
- break
- else:
- i += 1
- continue
-
- # It's an error to have the animations misconfigured
- if dir == -1:
- escoria.logger.error(
- self,
- "No animation has been configured for angle %s." % str(deg)
- )
-
- return dir
-
-
-# Returns true if given angle is inside the interval given by a starting_angle
-# and the size.
-#
-# #### Parameters
-#
-# - angle: Angle to test
-# - direction_angle: ESCDirectionAngle resource, containing the starting angle,
-# and the size of interval
-# eg: angle_start=90, angle_size=40 corresponds to angle between 90° and 130°
-func _is_angle_in_interval(
- angle: float,
- direction_angle: ESCDirectionAngle
-) -> bool:
- var start_angle = direction_angle.angle_start
- var end_angle = direction_angle.angle_start + direction_angle.angle_size
-
- if end_angle > 360 and angle < start_angle:
- angle += 360
-
- return (start_angle <= angle and angle <= end_angle)
-
-
-# Sets character's angle and plays according animation.
-#
-# #### Parameters
-#
-# - deg int angle to set the character
-# - wait float Wait this amount of seconds until continuing with turning around
-func set_angle(deg: int, wait: float = 0.0) -> void:
- if deg < 0 or deg > 360:
- escoria.logger.error(
- self,
- "Invalid degree to turn to : %s. Valid angles are between 0 and 360." % str(deg)
- )
- moved = true
-
- var current_dir = last_dir
- var target_dir = _get_dir_deg(deg, parent.animations)
-
- var way_to_turn = get_shortest_way_to_dir(current_dir, target_dir)
-
- var dir = current_dir
- while dir != target_dir:
- dir += way_to_turn
- if dir >= parent.animations.dir_angles.size():
- dir = 0
- if dir < 0:
- dir = parent.animations.dir_angles.size() - 1
-
- parent.get_animation_player().play(
- parent.animations.idles[dir].animation
- )
- if wait > 0.0:
- yield(get_tree().create_timer(wait), "timeout")
- is_mirrored = parent.animations.idles[dir].mirrored
-
- last_dir = _get_dir_deg(deg, parent.animations)
-
- # The character may have a state animation from before, which would be
- # resumed, so we immediately force the correct idle animation
- if parent.get_animation_player().get_animation() != \
- parent.animations.idles[last_dir].animation:
- parent.get_animation_player().play(
- parent.animations.idles[last_dir].animation
- )
- update_terrain()
-
-
-# Turns the character to face another item or character.
-#
-# #### Parameters
-#
-# - item_id id of the object to face.
-# - float Wait this amount of seconds until continuing with turning around
-func turn_to(item: Node, wait: float = 0.0) -> void:
- set_angle(
- wrapi(
- rad2deg(parent.get_position().angle_to_point(item.get_position())),
- 0,
- 360
- ),
- wait
- )
-
-
-# Returns the angle that corresponds to the current direction of the object.
-func _get_angle() -> int:
- return parent.animations.dir_angles[last_dir].angle_start
-
-
-#Â Return the shortest way to turn from a direction to another. Returned way is
-# either:
-# -1 (shortest way is to turn anti-clockwise)
-# 0 (already at the right direction)
-# 1 (clockwise).
-#
-# ####Parameters
-# - current_dir: integer corresponding to the starting direction as defined in
-# the attached ESCAnimationResource.directions.
-# - target_dir: integer corresponding to the target direction as defined in
-# the attached ESCAnimationResource.directions.
-#
-# *Returns*
-# Integer: -1 (anti-clockwise), 1 (clockwise) or 0 (no movement needed).
-func get_shortest_way_to_dir(current_dir: int, target_dir: int) -> int:
- if current_dir < 0 or current_dir > parent.animations.dir_angles.size() - 1:
- escoria.logger.error(
- self,
- "Invalid direction (current_dir) %s" % str(current_dir)
- )
-
- if target_dir < 0 or target_dir > parent.animations.dir_angles.size() - 1:
- escoria.logger.error(
- self,
- "Invalid direction (target_dir) %s " % str(target_dir)
- )
-
- if current_dir == target_dir:
- return 0
-
- var internal = false
- if max(current_dir, target_dir) - min(current_dir, target_dir) \
- < parent.animations.dir_angles.size() / 2:
- internal = true
- else:
- internal = false
-
- if internal and current_dir < target_dir or \
- (not internal and current_dir > target_dir):
- return 1
- else:
- return -1
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/accept_input.gd b/addons/escoria-core/game/core-scripts/esc/commands/accept_input.gd
deleted file mode 100644
index 9a1e6c65..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/accept_input.gd
+++ /dev/null
@@ -1,74 +0,0 @@
-# `accept_input [type]`
-#
-# Sets how much input the game is to accept. This allows for cut scenes
-# in which dialogue can be skipped (if [type] is set to SKIP), and ones where
-# it can't (if [type] is set to NONE).
-#
-# **Parameters**
-#
-# - *type*: Type of inputs to accept (ALL)
-# `ALL`: Accept all types of user input
-# `SKIP`: Accept skipping dialogues but nothing else
-# `NONE`: Deny all inputs (including opening menus)
-#
-# **Warning**: `SKIP` and `NONE` also disable autosaves.
-#
-# **Warning**: The type of user input accepted will persist even after the
-# current event has ended. Remember to reset the input type at the end of
-# cut-scenes!
-#
-# @ESC
-extends ESCBaseCommand
-class_name AcceptInputCommand
-
-
-# The list of supported input types
-const SUPPORTED_INPUT_TYPES = ["ALL", "NONE", "SKIP"]
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_STRING],
- ["ALL"]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not arguments[0] in SUPPORTED_INPUT_TYPES:
- escoria.logger.error(
- self,
- "[%s]: invalid parameter. %s is not a valid parameter value." +
- "Should be one of %s"
- % [
- get_command_name(),
- arguments[0],
- str(SUPPORTED_INPUT_TYPES)
- ]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- var mode = escoria.inputs_manager.INPUT_ALL
- match command_params[0]:
- "NONE":
- mode = escoria.inputs_manager.INPUT_NONE
- "SKIP":
- mode = escoria.inputs_manager.INPUT_SKIP
-
- escoria.inputs_manager.input_mode = mode
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/anim.gd b/addons/escoria-core/game/core-scripts/esc/commands/anim.gd
deleted file mode 100644
index 3525c547..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/anim.gd
+++ /dev/null
@@ -1,61 +0,0 @@
-# `anim object name [reverse]`
-#
-# Executes the animation specified in "name" on "object" without blocking.
-# The next command in the event will be executed immediately after the
-# animation is started.
-#
-# **Parameters**
-#
-# * *object*: Global ID of the object with the animation
-# * *name*: Name of the animation to play
-# * *reverse*: Plays the animation in reverse when true
-#
-# @ESC
-extends ESCBaseCommand
-class_name AnimCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_STRING, TYPE_BOOL],
- [null, null, false]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid object. Object with global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- var obj = escoria.object_manager.get_object(command_params[0])
- var anim_id = command_params[1]
- var reverse = command_params[2]
- var animator: ESCAnimationPlayer = \
- (obj.node as ESCItem).get_animation_player()
- if reverse:
- animator.play_backwards(anim_id)
- else:
- animator.play(anim_id)
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/anim_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/anim_block.gd
deleted file mode 100644
index a96a5cb7..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/anim_block.gd
+++ /dev/null
@@ -1,67 +0,0 @@
-# `anim_block object name [reverse]`
-#
-# Executes the animation specified in "name" on "object" while blocking other
-# events from starting.
-# The next command in the event will be executed when the animation is
-# finished playing.
-#
-# **Parameters**
-#
-# * *object*: Global ID of the object with the animation
-# * *name*: Name of the animation to play
-# * *reverse*: Plays the animation in reverse when true
-#
-# @ESC
-extends ESCBaseCommand
-class_name AnimBlockCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_STRING, TYPE_BOOL],
- [null, null, false]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: Object with global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- var obj = escoria.object_manager.get_object(command_params[0])
- var anim_id = command_params[1]
- var reverse = command_params[2]
- var animator: ESCAnimationPlayer = \
- (obj.node as ESCItem).get_animation_player()
- if reverse:
- animator.play_backwards(anim_id)
- else:
- animator.play(anim_id)
- if animator.get_length(anim_id) < 1.0:
- return ESCExecution.RC_OK
- var animation_finished = yield(animator, "animation_finished")
- while animation_finished != anim_id:
- animation_finished = yield(animator, "animation_finished")
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/block_say.gd b/addons/escoria-core/game/core-scripts/esc/commands/block_say.gd
deleted file mode 100644
index 990c8f8e..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/block_say.gd
+++ /dev/null
@@ -1,62 +0,0 @@
-# `block_say`
-#
-# `say` commands called subsequent to using the `block_say` command will reuse the
-# dialog box type of the previous `say` command if both dialog box types between the two `say`
-# commands match.
-#
-# Different dialog box types can be used across multiple `say` commands, with the latest one
-# used being preserved for reuse by the next `say` command should the dialog box type specified by
-# both `say` commands match.
-#
-# This reuse will continue until a call to `end_block_say` is made.
-#
-# Using `block_say` more than once prior to calling `end_block_say` is idempotent and has the
-# following behaviour:
-#
-# - If no `say` command has yet been encountered since the first use of `block_say`,
-# the result of using this command will be as described above.
-# - If a `say` command has been encountered since the previous use of `block_say`,
-# the dialog box used with that `say` command will continue to be reused for subsequent
-# `say` commands should the dialog box type requested match. Note that the dialog box used with
-# the next `say` command may be different than the one currently being reused.
-#
-# Example:
-# `block say`
-# `say player "Picture's looking good."`
-# `say player "And so am I."`
-# `end_block_say`
-#
-# This example will reuse the same dialog box type since they are the same between both `say` calls.
-#
-# @ESC
-extends ESCBaseCommand
-class_name BlockSayCommand
-
-
-# Constructor
-func _init() -> void:
- pass
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(0)
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.dialog_player.enable_preserve_dialog_box()
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_push.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_push.gd
deleted file mode 100644
index 700f1662..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/camera_push.gd
+++ /dev/null
@@ -1,112 +0,0 @@
-# `camera_push target [time] [type]`
-#
-# Pushes (moves) the camera so it points at a specific `target`. If the camera
-# was following a target (like the player) previously, it will no longer follow
-# this target.
-#
-# Make sure the target is reachable if camera limits have been configured.
-#
-# **Parameters**
-#
-# - *target*: Global ID of the `ESCItem` to push the camera to. `ESCItem`s have
-# a "camera_node" property that can be set to point to a node (usually an
-# `ESCLocation` node). If the "camera_node" property is empty, `camera_push`
-# will point the camera at the `ESCItem`s location. If however, the `ESCItem`
-# has its "camera_node" property set, the command will instead point the
-# camera at the node referenced by the `ESCItem`s "camera_node" property.
-# - *time*: Number of seconds the transition should take (default: `1`)
-# - *type*: Transition type to use (default: `QUAD`)
-#
-# Supported transitions include the names of the values used
-# in the "TransitionType" enum of the "Tween" type (without the "TRANS_" prefix):
-#
-# See https://docs.godotengine.org/en/stable/classes/class_tween.html?highlight=tween#enumerations
-#
-# For more details see: https://docs.escoria-framework.org/camera
-#
-# @ESC
-extends ESCCameraBaseCommand
-class_name CameraPushCommand
-
-# The list of supported transitions as per the link mentioned above
-const SUPPORTED_TRANSITIONS = ["LINEAR","SINE","QUINT","QUART","QUAD" ,"EXPO","ELASTIC","CUBIC",
- "CIRC","BOUNCE","BACK"]
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_STRING, [TYPE_REAL, TYPE_INT], TYPE_STRING],
- [null, 1, "QUAD"]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid object. Object global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
-
- var target_pos = _get_target_pos(arguments[0])
- var camera: ESCCamera = escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera
-
- if not camera.check_point_is_inside_viewport_limits(target_pos):
- generate_viewport_warning(target_pos, camera)
- return false
-
- if not arguments[2] in SUPPORTED_TRANSITIONS:
- escoria.logger.error(
- self,
- (
- "[{command_name}]: invalid transition type. Transition type {t_type} " +
- "is not one of the accepted types : {allowed_types}"
- ).format(
- {
- "command_name":get_command_name(),
- "t_type":arguments[2],
- "allowed_types":SUPPORTED_TRANSITIONS
- }
- )
- )
- return false
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera)\
- .push(
- escoria.object_manager.get_object(command_params[0]).node,
- command_params[1],
- ClassDB.class_get_integer_constant("Tween", "TRANS_%s" % command_params[2])
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
-
-
-# Gets the appropriate target position from the `ESCItem`, as used by the camera.
-#
-# #### Parameters
-#
-# - target_global_id: The `global_id` of the `ESCItem` to check.
-#
-# **Returns** the item's position based on its camera node.
-func _get_target_pos(target_global_id: String) -> Vector2:
- var target = escoria.object_manager.get_object(target_global_id).node as ESCItem
- return target.get_camera_node().global_position
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_push_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_push_block.gd
deleted file mode 100644
index 61c213c7..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/camera_push_block.gd
+++ /dev/null
@@ -1,127 +0,0 @@
-# `camera_push_block target [time] [type]`
-#
-# Pushes (moves) the camera so it points at a specific `target`. If the camera
-# was following a target (like the player) previously, it will no longer follow
-# this target. Blocks until the command completes.
-#
-# Make sure the target is reachable if camera limits have been configured.
-#
-# **Parameters**
-#
-# - *target*: Global ID of the `ESCItem` to push the camera to. `ESCItem`s have
-# a "camera_node" property that can be set to point to a node (usually an
-# `ESCLocation` node). If the "camera_node" property is empty, `camera_push_block`
-# will point the camera at the `ESCItem`s location. If however, the `ESCItem`
-# has its "camera_node" property set, the command will instead point the
-# camera at the node referenced by the `ESCItem`s "camera_node" property.
-# - *time*: Number of seconds the transition should take (default: `1`)
-# - *type*: Transition type to use (default: `QUAD`)
-#
-# Supported transitions include the names of the values used
-# in the "TransitionType" enum of the "Tween" type (without the "TRANS_" prefix).
-#
-# See https://docs.godotengine.org/en/stable/classes/class_tween.html?highlight=tween#enumerations
-#
-# For more details see: https://docs.escoria-framework.org/camera
-#
-# @ESC
-extends ESCCameraBaseCommand
-class_name CameraPushBlockCommand
-
-
-# The list of supported transitions as per the link mentioned above
-const SUPPORTED_TRANSITIONS = ["LINEAR","SINE","QUINT","QUART","QUAD" ,"EXPO","ELASTIC","CUBIC",
- "CIRC","BOUNCE","BACK"]
-
-
-# Tween for blocking
-var _camera_tween: Tween
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_STRING, [TYPE_REAL, TYPE_INT], TYPE_STRING],
- [null, 1, "QUAD"]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid object. Object global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
-
- var target_pos = _get_target_pos(arguments[0])
- var camera: ESCCamera = escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera
-
- if not camera.check_point_is_inside_viewport_limits(target_pos):
- generate_viewport_warning(target_pos, camera)
- return false
-
- if not arguments[2] in SUPPORTED_TRANSITIONS:
- escoria.logger.error(
- self,
- (
- "[{command_name}]: invalid transition type. Transition type {t_type} " +
- "is not one of the accepted types : {allowed_types}"
- ).format(
- {
- "command_name":get_command_name(),
- "t_type":arguments[2],
- "allowed_types":SUPPORTED_TRANSITIONS
- }
- )
- )
- return false
-
- _camera_tween = camera.get_tween()
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera)\
- .push(
- escoria.object_manager.get_object(command_params[0]).node,
- command_params[1],
- ClassDB.class_get_integer_constant("Tween", "TRANS_%s" % command_params[2])
- )
-
- if command_params[1] > 0.0:
- yield(_camera_tween, "tween_completed")
- escoria.logger.debug(
- self,
- "camera_push_block tween complete."
- )
-
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
-
-
-# Gets the appropriate target position from the `ESCItem`, as used by the camera.
-#
-# #### Parameters
-#
-# - target_global_id: The `global_id` of the `ESCItem` to check.
-#
-# **Returns** the ESCitem's position based on its camera node.
-func _get_target_pos(target_global_id: String) -> Vector2:
- var target = escoria.object_manager.get_object(target_global_id).node as ESCItem
- return target.get_camera_node().global_position
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_limits.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_limits.gd
deleted file mode 100644
index 3a08797e..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_limits.gd
+++ /dev/null
@@ -1,64 +0,0 @@
-# `camera_set_limits camlimits_id`
-#
-# Limits the current camera's movement to a limit defined in the `ESCRoom`'s
-# definition. A limit is defined as an upper-left (x, y) coordinate, a width
-# and a height that the camera must stay within. Multiple limits can be
-# defined for a room, allowing for new areas to be seen once they have
-# been 'unlocked'.
-#
-# **Parameters**
-#
-# - *camlimits_id*: Index of the camera limit defined in the `camera limits`
-# list of the current `ESCRoom`
-#
-# For more details see: https://docs.escoria-framework.org/camera
-#
-# @ESC
-extends ESCCameraBaseCommand
-class_name CameraSetLimitsCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_INT],
- [null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if escoria.main.current_scene.camera_limits.size() < arguments[0]:
- escoria.logger.error(
- self,
- "[%s]: invalid limits id. Camera limit id (%d) is larger than the number of limits defined in this scene (%d)."
- % [
- get_command_name(),
- arguments[0],
- escoria.main.current_scene.camera_limits.size()
- ]
- )
- return false
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- var camera: ESCCamera = escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera
- camera.clamp_to_viewport_limits()
- escoria.main.set_camera_limits(command_params[0])
-
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos.gd
deleted file mode 100644
index 70d4cd12..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos.gd
+++ /dev/null
@@ -1,57 +0,0 @@
-# `camera_set_pos time x y`
-#
-# Moves the camera to the given absolute position over a time period.
-#
-# **Parameters**
-#
-# - *time*: Number of seconds the transition should take
-# - *x*: Target X coordinate
-# - "y*: Target Y coordinate
-#
-# For more details see: https://docs.escoria-framework.org/camera
-#
-# @ESC
-extends ESCCameraBaseCommand
-class_name CameraSetPosCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 3,
- [[TYPE_REAL, TYPE_INT], TYPE_INT, TYPE_INT],
- [null, null, null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- var new_pos: Vector2 = Vector2(arguments[1], arguments[2])
- var camera: ESCCamera = escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera
-
- if not camera.check_point_is_inside_viewport_limits(new_pos):
- generate_viewport_warning(new_pos, camera)
- return false
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera)\
- .set_target(
- Vector2(command_params[1], command_params[2]),
- command_params[0]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos_block.gd
deleted file mode 100644
index 5978c189..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_pos_block.gd
+++ /dev/null
@@ -1,73 +0,0 @@
-# `camera_set_pos_block time x y`
-#
-# Moves the camera to the given absolute position over a time period. Blocks
-# until the command completes.
-#
-# Make sure the coordinates are reachable if camera limits have been configured.
-#
-# **Parameters**
-#
-# - *time*: Number of seconds the transition should take
-# - *x*: Target X coordinate
-# - "y*: Target Y coordinate
-#
-# For more details see: https://docs.escoria-framework.org/camera
-#
-# @ESC
-extends ESCCameraBaseCommand
-class_name CameraSetPosBlockCommand
-
-
-# Tween for blocking
-var _camera_tween: Tween
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 3,
- [[TYPE_REAL, TYPE_INT], TYPE_INT, TYPE_INT],
- [null, null, null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- var new_pos: Vector2 = Vector2(arguments[1], arguments[2])
- var camera: ESCCamera = escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera
-
- if not camera.check_point_is_inside_viewport_limits(new_pos):
- generate_viewport_warning(new_pos, camera)
- return false
-
- _camera_tween = camera.get_tween()
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera)\
- .set_target(
- Vector2(command_params[1], command_params[2]),
- command_params[0]
- )
-
- if command_params[0] > 0.0:
- yield(_camera_tween, "tween_completed")
- escoria.logger.debug(
- self,
- "camera_set_pos_block tween complete."
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target.gd
deleted file mode 100644
index a4ba45b3..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target.gd
+++ /dev/null
@@ -1,60 +0,0 @@
-# `camera_set_target time object`
-#
-# Configures the camera to follow the specified target `object` as it moves
-# around the current room. The transition to focus on the `object` will happen
-# over a time period.
-#
-# **Parameters**
-#
-# - *time*: Number of seconds the transition should take to move the camera
-# to follow `object`
-# - *object*: Global ID of the target object
-#
-# For more details see: https://docs.escoria-framework.org/camera
-#
-# @ESC
-extends ESCCameraBaseCommand
-class_name CameraSetTargetCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [[TYPE_REAL, TYPE_INT], TYPE_STRING],
- [null, null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[1]):
- escoria.logger.error(
- self,
- "[%s]: Invalid object: Object with global id %s not found."
- % [get_command_name(), arguments[1]]
- )
- return false
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera)\
- .set_target(
- escoria.object_manager.get_object(command_params[1]).node,
- command_params[0]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target_block.gd
deleted file mode 100644
index abcb9266..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_target_block.gd
+++ /dev/null
@@ -1,77 +0,0 @@
-# `camera_set_target_block time object`
-#
-# Configures the camera to follow the specified target `object` (ESCItem) as it moves
-# around the current room. The transition to focus on the `object` will happen
-# over a time period. Blocks until the command completes.
-#
-# The camera will move as close as it can if camera limits have been configured
-# and the `object` is at coordinates that are not reachable.
-#
-# **Parameters**
-#
-# - *time*: Number of seconds the transition should take to move the camera
-# to follow `object`
-# - *object*: Global ID of the target object
-#
-# For more details see: https://docs.escoria-framework.org/camera
-#
-# @ESC
-extends ESCCameraBaseCommand
-class_name CameraSetTargetBlockCommand
-
-
-# Tween for blocking
-var _camera_tween: Tween
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [[TYPE_REAL, TYPE_INT], TYPE_STRING],
- [null, null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[1]):
- escoria.logger.error(
- self,
- "[%s]: Invalid object: Object with global id %s not found."
- % [get_command_name(), arguments[1]]
- )
- return false
-
- var camera: ESCCamera = escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera
- _camera_tween = camera.get_tween()
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera)\
- .set_target(
- escoria.object_manager.get_object(command_params[1]).node,
- command_params[0]
- )
-
- if command_params[0] > 0.0:
- yield(_camera_tween, "tween_completed")
- escoria.logger.debug(
- self,
- "camera_set_target_block tween complete."
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom.gd
deleted file mode 100644
index d0827042..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom.gd
+++ /dev/null
@@ -1,46 +0,0 @@
-# `camera_set_zoom magnitude [time]`
-#
-# Zooms the camera in/out to the desired `magnitude`. Values larger than '1' zoom
-# the camera out while smaller values zoom in. These values are relative to the
-# default zoom value of '1', not the current value. As such, while using a value
-# of '0.5' would double the size of the graphics, running the same command again
-# would result in no change. The zoom will happen over the given time period.
-#
-# **Parameters**
-#
-# - *magnitude*: Magnitude of zoom
-# - *time*: Number of seconds the transition should take, with a value of `0`
-# meaning the zoom should happen instantly (default: `0`)
-#
-# For more details see: https://docs.escoria-framework.org/camera
-#
-# @ESC
-extends ESCCameraBaseCommand
-class_name CameraSetZoomCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [[TYPE_REAL, TYPE_INT], [TYPE_REAL, TYPE_INT]],
- [null, 0.0]
- )
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera)\
- .set_camera_zoom(
- command_params[0],
- command_params[1]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_block.gd
deleted file mode 100644
index dfce5491..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_block.gd
+++ /dev/null
@@ -1,73 +0,0 @@
-# `camera_set_zoom_block magnitude [time]`
-#
-# Zooms the camera in/out to the desired `magnitude`. Values larger than '1' zoom
-# the camera out while smaller values zoom in. These values are relative to the
-# default zoom value of '1', not the current value. As such, while using a value
-# of '0.5' would double the size of the graphics, running the same command again
-# would result in no change. The zoom will happen over the given time period.
-# Blocks until the command completes.
-#
-# Zoom operations might not be as smooth as desired if the requested zoom
-# level results in an edge of the camera meeting any defined camera limits.
-#
-# **Parameters**
-#
-# - *magnitude*: Magnitude of zoom
-# - *time*: Number of seconds the transition should take, with a value of `0`
-# meaning the zoom should happen instantly (default: `0`)
-#
-# For more details see: https://docs.escoria-framework.org/camera
-#
-# @ESC
-extends ESCCameraBaseCommand
-class_name CameraSetZoomBlockCommand
-
-
-var _camera_tween: Tween
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [[TYPE_REAL, TYPE_INT], [TYPE_REAL, TYPE_INT]],
- [null, 0.0]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- var camera: ESCCamera = escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera
- _camera_tween = camera.get_tween()
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- var camera: ESCCamera = escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera
-
- camera\
- .set_camera_zoom(
- command_params[0],
- command_params[1]
- )
-
- if command_params[1] > 0.0:
- yield(_camera_tween, "tween_completed")
- escoria.logger.debug(
- self,
- "camera_set_zoom_block tween complete."
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height.gd
deleted file mode 100644
index 1e3de82e..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height.gd
+++ /dev/null
@@ -1,58 +0,0 @@
-# `camera_set_zoom_height pixels [time]`
-#
-# Zooms the camera in/out so it occupies the given height in pixels.
-#
-# **Parameters**
-#
-# - *pixels*: Target height in pixels
-# - *time*: Number of seconds the transition should take, with a value of `0`
-# meaning the zoom should happen instantly (default: `0`)
-#
-# For more details see: https://docs.escoria-framework.org/camera
-#
-# @ESC
-extends ESCBaseCommand
-class_name CameraSetZoomHeightCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_INT, [TYPE_INT, TYPE_REAL]],
- [null, 0.0]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if arguments[0] < 0:
- escoria.logger.error(
- self,
- "[%s]: invalid height. Can't zoom to a negative height (%d)."
- % [get_command_name(), arguments[0]]
- )
- return false
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera)\
- .set_camera_zoom(
- command_params[0] / escoria.game_size.y,
- command_params[1]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height_block.gd
deleted file mode 100644
index a573f732..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/camera_set_zoom_height_block.gd
+++ /dev/null
@@ -1,73 +0,0 @@
-# `camera_set_zoom_height_block pixels [time]`
-#
-# Zooms the camera in/out so it occupies the given height in pixels.
-# Blocks until the command completes.
-#
-# **Parameters**
-#
-# - *pixels*: Target height in pixels (integer values only)
-# - *time*: Number of seconds the transition should take, with a value of `0`
-# meaning the zoom should happen instantly (default: `0`)
-#
-# For more details see: https://docs.escoria-framework.org/camera
-#
-# @ESC
-extends ESCBaseCommand
-class_name CameraSetZoomHeightBlockCommand
-
-
-# Tween for blocking
-var _camera_tween: Tween
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_INT, [TYPE_INT, TYPE_REAL]],
- [null, 0.0]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if arguments[0] <= 0:
- escoria.logger.error(
- self,
- "[%s]: invalid height. Can't zoom to a negative height (%d)."
- % [get_command_name(), arguments[0]]
- )
- return false
-
- var camera: ESCCamera = escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera
- _camera_tween = camera.get_tween()
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera)\
- .set_camera_zoom(
- command_params[0] / escoria.game_size.y,
- command_params[1]
- )
-
- if command_params[1] > 0.0:
- yield(_camera_tween, "tween_completed")
- escoria.logger.debug(
- self,
- "camera_set_zoom_height_block tween complete."
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_shift.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_shift.gd
deleted file mode 100644
index f92fa09a..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/camera_shift.gd
+++ /dev/null
@@ -1,94 +0,0 @@
-# `camera_shift x y [time] [type]`
-#
-# Shifts the camera by the given horizontal and vertical amounts relative to the
-# current location.
-#
-# **Parameters**
-#
-# - *x*: Shift by x pixels along the x-axis
-# - *y*: Shift by y pixels along the y-axis
-# - *time*: Number of seconds the transition should take, with a value of `0`
-# meaning the zoom should happen instantly (default: `1`)
-# - *type*: Transition type to use (default: `QUAD`)
-#
-# Supported transitions include the names of the values used
-# in the "TransitionType" enum of the "Tween" type (without the "TRANS_" prefix):
-#
-# https://docs.godotengine.org/en/stable/classes/class_tween.html?highlight=tween#enumerations
-#
-# For more details see: https://docs.escoria-framework.org/camera
-#
-# @ESC
-extends ESCCameraBaseCommand
-class_name CameraShiftCommand
-
-# The list of supported transitions as per the link mentioned above
-const SUPPORTED_TRANSITIONS = ["LINEAR","SINE","QUINT","QUART","QUAD" ,"EXPO","ELASTIC","CUBIC",
- "CIRC","BOUNCE","BACK"]
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [
- [TYPE_INT, TYPE_REAL],
- [TYPE_INT, TYPE_REAL],
- [TYPE_INT, TYPE_REAL],
- TYPE_STRING
- ],
- [null, null, 1, "QUAD"]
- )
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera)\
- .shift(
- Vector2(
- command_params[0],
- command_params[1]
- ),
- command_params[2],
- ClassDB.class_get_integer_constant("Tween", "TRANS_%s" % command_params[3])
- )
- return ESCExecution.RC_OK
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not arguments[3] in SUPPORTED_TRANSITIONS:
- escoria.logger.error(
- self,
- (
- "[{command_name}]: invalid transition type" +
- "Transition type {t_type} is not one of the accepted types : {allowed_types}"
- ).format(
- {
- "command_name": get_command_name(),
- "t_type":arguments[3],
- "allowed_types":SUPPORTED_TRANSITIONS
- }
- )
- )
- return false
-
- var camera: ESCCamera = escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera
- var shift_by: Vector2 = Vector2(arguments[0], arguments[1])
- var new_pos: Vector2 = Vector2(camera.position.x + shift_by.x, camera.position.y + shift_by.y)
-
- if not camera.check_point_is_inside_viewport_limits(new_pos):
- generate_viewport_warning(new_pos, camera)
- return false
-
- return true
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/camera_shift_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/camera_shift_block.gd
deleted file mode 100644
index af62cfa4..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/camera_shift_block.gd
+++ /dev/null
@@ -1,112 +0,0 @@
-# `camera_shift_block x y [time] [type]`
-#
-# Shifts the camera by the given horizontal and vertical amounts relative to the
-# current location. Blocks until the command completes.
-#
-# Make sure the destination coordinates are reachable if
-# camera limits have been configured.
-#
-# **Parameters**
-#
-# - *x*: Shift by x pixels along the x-axis
-# - *y*: Shift by y pixels along the y-axis
-# - *time*: Number of seconds the transition should take, with a value of `0`
-# meaning the zoom should happen instantly (default: `1`)
-# - *type*: Transition type to use (default: `QUAD`)
-#
-# Supported transitions include the names of the values used
-# in the "TransitionType" enum of the "Tween" type (without the "TRANS_" prefix).
-#
-# See https://docs.godotengine.org/en/stable/classes/class_tween.html?highlight=tween#enumerations
-#
-# For more details see: https://docs.escoria-framework.org/camera
-#
-# @ESC
-extends ESCCameraBaseCommand
-class_name CameraShiftBlockCommand
-
-
-# The list of supported transitions as per the link mentioned above
-const SUPPORTED_TRANSITIONS = ["LINEAR","SINE","QUINT","QUART","QUAD" ,"EXPO","ELASTIC","CUBIC",
- "CIRC","BOUNCE","BACK"]
-
-
-# Tween for blocking
-var _camera_tween: Tween
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [
- [TYPE_INT, TYPE_REAL],
- [TYPE_INT, TYPE_REAL],
- [TYPE_INT, TYPE_REAL],
- TYPE_STRING
- ],
- [null, null, 1, "QUAD"]
- )
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera)\
- .shift(
- Vector2(
- command_params[0],
- command_params[1]
- ),
- command_params[2],
- ClassDB.class_get_integer_constant("Tween", "TRANS_%s" % command_params[3])
- )
-
- if command_params[2] > 0.0:
- yield(_camera_tween, "tween_completed")
- escoria.logger.debug(
- self,
- "camera_shift_block tween complete."
- )
- return ESCExecution.RC_OK
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not arguments[3] in SUPPORTED_TRANSITIONS:
- escoria.logger.error(
- self,
- (
- "[{command_name}]: invalid transition type" +
- "Transition type {t_type} is not one of the accepted types : {allowed_types}"
- ).format(
- {
- "command_name": get_command_name(),
- "t_type":arguments[3],
- "allowed_types":SUPPORTED_TRANSITIONS
- }
- )
- )
- return false
-
- var camera: ESCCamera = escoria.object_manager.get_object(escoria.object_manager.CAMERA).node as ESCCamera
- var shift_by: Vector2 = Vector2(arguments[0], arguments[1])
- var new_pos: Vector2 = Vector2(camera.position.x + shift_by.x, camera.position.y + shift_by.y)
-
- if not camera.check_point_is_inside_viewport_limits(new_pos):
- generate_viewport_warning(new_pos, camera)
- return false
-
- _camera_tween = camera.get_tween()
-
- return true
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/change_scene.gd b/addons/escoria-core/game/core-scripts/esc/commands/change_scene.gd
deleted file mode 100644
index 76487e3d..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/change_scene.gd
+++ /dev/null
@@ -1,80 +0,0 @@
-# `change_scene path [enable_automatic_transition] [run_events]`
-#
-# Switches the game from the current scene to another scene. Use this to move
-# the player to a new room when they walk through an unlocked door, for
-# example.
-#
-# **Parameters**
-#
-# - *path*: Path of the new scene
-# - *enable_automatic_transition*: Automatically transition to the new scene
-# (default: `true`)
-# - *run_events*: Run the standard ESC events of the new scene (default: `true`)
-#
-# @ESC
-extends ESCBaseCommand
-class_name ChangeSceneCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_STRING, TYPE_BOOL, TYPE_BOOL],
- [null, true, true]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array) -> bool:
- if not .validate(arguments):
- return false
-
- if not ResourceLoader.exists(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: Invalid scene. Scene %s was not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- if not ResourceLoader.exists(
- ESCProjectSettingsManager.get_setting(ESCProjectSettingsManager.GAME_SCENE)
- ):
- escoria.logger.error(
- self,
- "[%s]: Game scene not found. The path set in 'ui/game_scene' was not found: %s."
- % [
- get_command_name(),
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.GAME_SCENE
- )
- ]
- )
- return false
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.logger.info(
- self,
- "[%s] Changing scene to %s (enable_automatic_transition = %s)."
- % [
- get_command_name(),
- command_params[0], # scene file
- command_params[1] #Â enable_automatic_transition
- ]
- )
-
- escoria.room_manager.change_scene(command_params[0], command_params[1])
-
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/custom.gd b/addons/escoria-core/game/core-scripts/esc/commands/custom.gd
deleted file mode 100644
index 849f24ab..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/custom.gd
+++ /dev/null
@@ -1,100 +0,0 @@
-# `custom object node func_name [params...]`
-#
-#
-# Executes the specified Godot function. This function must be in a script
-# attached to a child node of a registered `ESCItem`.
-#
-# **Parameters**
-#
-# - *object*: Global ID of the target `ESCItem`
-# - *node*: Name of the child node of the target `ESCItem`
-# - *func_name*: Name of the function to be called
-# - params: Any arguments to be passed to the function (array and object parameters are not supported).
-# Multiple parameters can be passed by simply passing them in as additional arguments separated by
-# spaces, e.g. `custom the_object the_node the_function arg1 arg2 arg3`
-#
-# @ESC
-extends ESCBaseCommand
-class_name CustomCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 3,
- [TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_ARRAY],
- [null, null, null, []],
- [true],
- true
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid object. Object with global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- elif not escoria.object_manager.get_object(arguments[0]).node.has_node(
- arguments[1]
- ):
- escoria.logger.error(
- self,
- "[%s]: invalid node. Object with global id %s has no child node called %s."
- % [
- get_command_name(),
- arguments[0],
- arguments[1],
- ]
- )
- return false
- elif not escoria.object_manager.get_object(arguments[0]).node\
- .get_node(
- arguments[1]
- )\
- .has_method(
- arguments[2]
- ):
- escoria.logger.error(
- self,
- "[%s]: invalid function. Object with global id %s and node %s has no function called %s."
- % [
- get_command_name(),
- arguments[0],
- arguments[1],
- arguments[2],
- ]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- var object = escoria.object_manager.get_object(
- command_params[0]
- )
- # Global variables can be substituted into the command arguments by wrapping the global
- # name in braces.
- for loop in command_params[3].size():
- command_params[3][loop] = escoria.globals_manager.replace_globals(command_params[3][loop])
-
- object.node.get_node(command_params[1]).call(
- command_params[2],
- command_params[3]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/dec_global.gd b/addons/escoria-core/game/core-scripts/esc/commands/dec_global.gd
deleted file mode 100644
index 98c095a5..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/dec_global.gd
+++ /dev/null
@@ -1,52 +0,0 @@
-# `dec_global name value`
-#
-# Subtract the given value from the specified global.
-#
-# **Parameters**
-#
-# - *name*: Name of the global to be changed
-# - *value*: Value to be subtracted (default: 1)
-#
-# @ESC
-extends ESCBaseCommand
-class_name DecGlobalCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_STRING, TYPE_INT],
- [null, 1]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.globals_manager.get_global(arguments[0]) is int:
- escoria.logger.error(
- self,
- "[%s]: invalid global. Global %s isn't an integer value."
- % [get_command_name(), arguments[0]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.globals_manager.set_global(
- command_params[0],
- escoria.globals_manager.get_global(command_params[0]) - \
- command_params[1]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/enable_terrain.gd b/addons/escoria-core/game/core-scripts/esc/commands/enable_terrain.gd
deleted file mode 100644
index 63228710..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/enable_terrain.gd
+++ /dev/null
@@ -1,50 +0,0 @@
-# `enable_terrain node_name`
-#
-# Enables the `ESCTerrain`'s `NavigationPolygonInstance` specified by the given
-# node name. It will also disable the previously-activated
-# `NavigationPolygonInstance`.
-# Use this to change where the player can walk, allowing them to walk into the
-# next room once a door has been opened, for example.
-#
-# **Parameters**
-#
-# - *node_name*: Name of the `NavigationPolygonInstance` node to activate
-#
-# @ESC
-extends ESCBaseCommand
-class_name EnableTerrainCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_STRING],
- [null]
- )
-
-
-# Run the command
-func run(command_params: Array) -> int:
- var name: String = command_params[0]
- if escoria.room_terrain.has_node(name):
- var new_active_navigation_instance = \
- escoria.room_terrain.get_node(name)
- escoria.room_terrain.current_active_navigation_instance.enabled = false
- escoria.room_terrain.current_active_navigation_instance = \
- new_active_navigation_instance
- escoria.room_terrain.current_active_navigation_instance.enabled = true
- return ESCExecution.RC_OK
- else:
- escoria.logger.error(
- self,
- "[%s]: Can not find terrain node. Terrain node %s could not be found."
- % [get_command_name(), name]
- )
- return ESCExecution.RC_ERROR
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/end_block_say.gd b/addons/escoria-core/game/core-scripts/esc/commands/end_block_say.gd
deleted file mode 100644
index 4ef23e53..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/end_block_say.gd
+++ /dev/null
@@ -1,47 +0,0 @@
-# `end_block_say`
-#
-# `say` commands used subsequent to using the `end_block_say` command will no longer
-# reuse the dialog box type used by the previous `say` command(s) encountered.
-#
-# Using `end_block_say` more than once is safe and idempotent.
-#
-# Example:
-# `block say`
-# `say player "Picture's looking good."`
-# `say player "And so am I."`
-# `end_block_say`
-#
-# This example will reuse the same dialog box type since they are the same between both `say` calls.
-#
-# @ESC
-extends ESCBaseCommand
-class_name EndBlockSayCommand
-
-
-# Constructor
-func _init() -> void:
- pass
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(0)
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.dialog_player.disable_preserve_dialog_box()
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/hide_menu.gd b/addons/escoria-core/game/core-scripts/esc/commands/hide_menu.gd
deleted file mode 100644
index bf58b789..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/hide_menu.gd
+++ /dev/null
@@ -1,76 +0,0 @@
-# `hide_menu menu_type`
-#
-# Hides either the main menu or the pause menu. Transitions from the menu using
-# the default transition type (set in the Escoria project settings).
-#
-# **Parameters**
-#
-# - *menu_type*: Which menu to hide. Can be either `main` or `pause` (default: `main`)
-#
-# @ESC
-extends ESCBaseCommand
-class_name HideMenuCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 0,
- [TYPE_STRING],
- ["main"]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not arguments[0] in ["main", "pause"]:
- escoria.logger.error(
- self,
- "[%s]: menu %s is invalid." % [get_command_name(), arguments[0]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- var transition_id: int
-
- # Transition out from menu
- transition_id = escoria.main.scene_transition.transition(
- "",
- ESCTransitionPlayer.TRANSITION_MODE.OUT
- )
-
- if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
- while yield(
- escoria.main.scene_transition,
- "transition_done"
- ) != transition_id:
- pass
-
- if command_params[0] == "main":
- escoria.game_scene.hide_main_menu()
- elif command_params[0] == "pause":
- escoria.game_scene.unpause_game()
-
- if escoria.main.current_scene != null:
- transition_id = escoria.main.scene_transition.transition()
-
- if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
- while yield(
- escoria.main.scene_transition,
- "transition_done"
- ) != transition_id:
- pass
-
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/inc_global.gd b/addons/escoria-core/game/core-scripts/esc/commands/inc_global.gd
deleted file mode 100644
index 1c161aa8..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/inc_global.gd
+++ /dev/null
@@ -1,59 +0,0 @@
-# `inc_global name value`
-#
-# Adds the given value to the specified global.
-#
-# **Parameters**
-#
-# - *name*: Name of the global to be changed
-# - *value*: Value to be added (default: 1)
-#
-# @ESC
-extends ESCBaseCommand
-class_name IncGlobalCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_STRING, TYPE_INT],
- [null, 1]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.globals_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid global. Global %s does not exist."
- % [get_command_name(), arguments[0]]
- )
- return false
- if not escoria.globals_manager.get_global(arguments[0]) is int:
- escoria.logger.error(
- self,
- "[%s]: invalid global. Global %s isn't an integer value."
- % [get_command_name(), arguments[0]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.globals_manager.set_global(
- command_params[0],
- escoria.globals_manager.get_global(command_params[0]) +\
- command_params[1]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/inventory_add.gd b/addons/escoria-core/game/core-scripts/esc/commands/inventory_add.gd
deleted file mode 100644
index 6d274e53..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/inventory_add.gd
+++ /dev/null
@@ -1,54 +0,0 @@
-# `inventory_add item`
-#
-# Adds an item to the inventory. If the player is picking up an object, you may
-# want to use this command in conjunction with the `set_active` command so that
-# the object 'disappears' from the scene as it's added to the inventory.
-#
-# **Parameters**
-#
-# - *item*: Global ID of the `ESCItem` to add to the inventory
-#
-# @ESC
-extends ESCBaseCommand
-class_name InventoryAddCommand
-
-
-const ILLEGAL_STRINGS = ["/"]
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_STRING],
- [null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- for s in ILLEGAL_STRINGS:
- if s in arguments[0]:
- escoria.logger.error(
- self,
- "[%s]: invalid item name. Item name %s cannot contain the string '%s'."
- % [get_command_name(), arguments[0], s]
- )
- return false
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.inventory_manager.add_item(command_params[0])
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/inventory_remove.gd b/addons/escoria-core/game/core-scripts/esc/commands/inventory_remove.gd
deleted file mode 100644
index 55f04771..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/inventory_remove.gd
+++ /dev/null
@@ -1,54 +0,0 @@
-# `inventory_remove item`
-#
-# Removes an item from the inventory. You may wish to use this command in
-# conjuction with the `set_active` command to show an item in the scene,
-# simulating placing the item somewhere, for example.
-#
-# **Parameters**
-#
-# - *item*: Global ID of the `ESCItem` to remove from the inventory
-#
-# @ESC
-extends ESCBaseCommand
-class_name InventoryRemoveCommand
-
-
-const ILLEGAL_STRINGS = ["/"]
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_STRING],
- [null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- for s in ILLEGAL_STRINGS:
- if s in arguments[0]:
- escoria.logger.error(
- self,
- "[%s]: invalid item name. Item name %s cannot contain the string '%s'."
- % [get_command_name(), arguments[0], s]
- )
- return false
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.inventory_manager.remove_item(command_params[0])
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/play_snd.gd b/addons/escoria-core/game/core-scripts/esc/commands/play_snd.gd
deleted file mode 100644
index dad8290f..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/play_snd.gd
+++ /dev/null
@@ -1,58 +0,0 @@
-# `play_snd file [player]`
-#
-# Plays the specified sound without blocking the currently running event.
-#
-# **Parameters**
-#
-# - *file*: Sound file to play
-# - *player*: Sound player to use. Can either be `_sound`, which is used to play non-
-# looping sound effects; `_music`, which plays looping music; or `_speech`, which
-# plays non-looping voice files (default: `_sound`)
-#
-# @ESC
-extends ESCBaseCommand
-class_name PlaySndCommand
-
-
-# The specified sound player
-var _snd_player: String
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_STRING, TYPE_STRING],
- [null, "_sound"]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[1]):
- escoria.logger.error(
- self,
- "[%s]: invalid sound player. Sound player %s not registered."
- % [get_command_name(), arguments[1]]
- )
- return false
- if not ResourceLoader.exists(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid parameter. File %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- _snd_player = arguments[1]
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.object_manager.get_object(command_params[1]).node.set_state(
- command_params[0]
- )
- return ESCExecution.RC_OK
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/print.gd b/addons/escoria-core/game/core-scripts/esc/commands/print.gd
deleted file mode 100644
index 3c14a03a..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/print.gd
+++ /dev/null
@@ -1,34 +0,0 @@
-# `print string`
-#
-# Prints a message to the Godot debug window.
-# Use this for debugging game state.
-#
-# **Parameters**
-#
-# - *string*: The string to log
-#
-# @ESC
-extends ESCBaseCommand
-class_name PrintCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_STRING],
- [""]
- )
-
-
-# Run the command
-func run(command_params: Array) -> int:
- # Replace the names of any globals in "{ }" with their value
- print(escoria.globals_manager.replace_globals(command_params[0]))
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/queue_event.gd b/addons/escoria-core/game/core-scripts/esc/commands/queue_event.gd
deleted file mode 100644
index 96822f7a..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/queue_event.gd
+++ /dev/null
@@ -1,89 +0,0 @@
-# `queue_event object event [channel] [block]`
-#
-# Queue an event to run.
-#
-# If you queue multiple events on a channel and none of them are blocking
-# events, all events will effectively run at the same time. As the events are
-# placed on the channel's queue, if one event contains a blocking command, the
-# next event on that channel's queue won't be processed until the blocking
-# command finishes.
-#
-# **Parameters**
-#
-# - object: Object that holds the ESC script with the event
-# - event: Name of the event to queue
-# - channel: Channel to run the event on (default: `_front`). Using a
-# previously unused channel name will create a new channel.
-# - block: Whether to wait for the queue to finish. This is only possible, if
-# the queued event is not to be run on the same event as this command
-# (default: `false`)
-#
-# @ESC
-extends ESCBaseCommand
-class_name QueueEventCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_STRING, TYPE_STRING, TYPE_BOOL],
- [null, null, "_front", false]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "Object with global id %s not found." % arguments[0]
- )
- return false
- var node = escoria.object_manager.get_object(
- arguments[0]
- ).node
- if not "esc_script" in node or node.esc_script == "":
- escoria.logger.error(
- self,
- "Object with global id %s has no ESC script." % arguments[0]
- )
- return false
- var esc_script = escoria.esc_compiler.load_esc_file(node.esc_script)
- if not arguments[1] in esc_script.events:
- escoria.logger.error(
- self,
- "Event with name %s not found." % arguments[1]
- )
- return false
- if arguments[3] and not escoria.event_manager.is_channel_free(arguments[2]):
- escoria.logger.error(
- self,
- "The queue %s doesn't accept a new event." % arguments[2]
- )
- return false
- return true
-
-
-# Run the command
-func run(arguments: Array) -> int:
- var node = escoria.object_manager.get_object(
- arguments[0]
- ).node
- var esc_script = escoria.esc_compiler.load_esc_file(node.esc_script)
-
- return escoria.event_manager.queue_event_from_esc(
- esc_script,
- arguments[1], # event name
- arguments[2], # channel name
- arguments[3] # whether to block
- )
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/queue_resource.gd b/addons/escoria-core/game/core-scripts/esc/commands/queue_resource.gd
deleted file mode 100644
index faf37474..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/queue_resource.gd
+++ /dev/null
@@ -1,52 +0,0 @@
-# `queue_resource path [front_of_queue]`
-#
-# Queues the loading of the given resource into the resource cache.
-#
-# **Parameters**
-#
-# - *path*: Path of the resource to cache
-# - *front_of_queue*: Whether to put the resource at the front of the
-# queue in order to load it as soon as possible (default: `false`)
-#
-# @ESC
-extends ESCBaseCommand
-class_name QueueResourceCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [],
- [null, false]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array) -> bool:
- if not .validate(arguments):
- return false
-
- if not ResourceLoader.exists(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: Invalid resource. Resource %s was not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.resource_cache.queue_resource(
- command_params[0],
- command_params[1]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/rand_global.gd b/addons/escoria-core/game/core-scripts/esc/commands/rand_global.gd
deleted file mode 100644
index c7bcc240..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/rand_global.gd
+++ /dev/null
@@ -1,40 +0,0 @@
-# `rand_global name max_value`
-#
-# Sets the given global to a random integer between 0 and `max_value`
-# (inclusive). e.g. Setting `max_value` to 2 could result in '0', '1' or '2'
-# being returned.
-#
-# **Parameters**
-#
-# - *name*: Name of the global to set
-# - *max_value*: Maximum possible integer value (inclusive) (default: 1)
-#
-# @ESC
-extends ESCBaseCommand
-class_name RandGlobalCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_STRING, TYPE_INT],
- [null, 1]
- )
-
-
-# Run the command
-func run(command_params: Array) -> int:
- randomize()
- var rnd = randi() % (command_params[1] + 1)
- escoria.globals_manager.set_global(
- command_params[0],
- rnd
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/repeat.gd b/addons/escoria-core/game/core-scripts/esc/commands/repeat.gd
deleted file mode 100644
index f07eee33..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/repeat.gd
+++ /dev/null
@@ -1,29 +0,0 @@
-# `repeat`
-#
-# Makes the current script loop back to the start. Currently the only way to
-# exit the loop is via the `stop` command which will stop the script
-# completely.
-#
-# @ESC
-extends ESCBaseCommand
-class_name RepeatCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 0,
- [],
- []
- )
-
-
-# Run the command
-func run(command_params: Array) -> int:
- return ESCExecution.RC_CANCEL
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/say.gd b/addons/escoria-core/game/core-scripts/esc/commands/say.gd
deleted file mode 100644
index 958dc27d..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/say.gd
+++ /dev/null
@@ -1,130 +0,0 @@
-# `say player text [type]`
-#
-# Displays the specified string as dialog spoken by the player. This command
-# blocks further event execution until the dialog has finished being 'said'
-# (either as displayed text or as audible speech from a file).
-#
-# Global variables can be substituted into the text by wrapping the global
-# name in braces.
-# e.g. say player "I have {coin_count} coins remaining".
-#
-# **Parameters**
-#
-# - *player*: Global ID of the `ESCPlayer` or `ESCItem` object that is active.
-# You can specify `current_player` in order to refer to the currently active
-# player, e.g. in cases where multiple players are playable such as in games
-# like Maniac Mansion or Day of the Tentacle.
-# - *text*: Text to display.
-# - *type*: Dialog type to use. One of `floating` or `avatar`.
-# (default: the value set in the setting "Escoria/UI/Default Dialog Type")
-#
-# The text supports translation keys by prepending the key followed by
-# a colon (`:`) to the text.
-# For more details see: https://docs.escoria-framework.org/en/devel/getting_started/dialogs.html#translations
-#
-# Playing an audio file while the text is being
-# displayed is also supported by this mechanism.
-# For more details see: https://docs.escoria-framework.org/en/devel/getting_started/dialogs.html#recorded_speech
-#
-# Example: `say player ROOM1_PICTURE:"Picture's looking good."`
-#
-# @ESC
-extends ESCBaseCommand
-class_name SayCommand
-
-
-const CURRENT_PLAYER_KEYWORD = "CURRENT_PLAYER"
-
-
-var globals_regex : RegEx # Regex to match global variables in strings
-
-
-# Constructor
-func _init() -> void:
- globals_regex = RegEx.new()
- # Use look-ahead/behind to capture the term (i.e. global) in braces
- globals_regex.compile("(?<=\\{)(.*)(?=\\})")
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_STRING, TYPE_STRING],
- [
- null,
- null,
- ""
- ],
- [
- true,
- false,
- true
- ]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if arguments[0].to_upper() != CURRENT_PLAYER_KEYWORD \
- and not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: Invalid object: Object with global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- var dict: Dictionary
-
- escoria.current_state = escoria.GAME_STATE.DIALOG
-
- if !escoria.dialog_player:
- escoria.logger.error(
- self,
- "[%s]: No dialog player was registered and the say command was encountered."
- % get_command_name()
- )
- escoria.current_state = escoria.GAME_STATE.DEFAULT
- return ESCExecution.RC_ERROR
-
- if not escoria.main.current_scene.player:
- escoria.logger.warn(
- self,
- "[%s]: No player item in the current scene was registered and the say command was encountered."
- % get_command_name()
- )
- escoria.current_state = escoria.GAME_STATE.DEFAULT
- return ESCExecution.RC_CANCEL
-
- # Replace the names of any globals in "{ }" with their value
- command_params[1] = escoria.globals_manager.replace_globals(command_params[1])
-
- var speaking_character_global_id = escoria.main.current_scene.player.global_id \
- if command_params[0].to_upper() == CURRENT_PLAYER_KEYWORD \
- else command_params[0]
-
- escoria.dialog_player.say(
- speaking_character_global_id,
- command_params[2],
- command_params[1]
- )
- yield(escoria.dialog_player, "say_finished")
- escoria.current_state = escoria.GAME_STATE.DEFAULT
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/sched_event.gd b/addons/escoria-core/game/core-scripts/esc/commands/sched_event.gd
deleted file mode 100644
index 2424b590..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/sched_event.gd
+++ /dev/null
@@ -1,69 +0,0 @@
-# `sched_event time object event`
-#
-# Schedules an event to run at a later time.
-#
-# If another event is already running when the scheduled
-# event is supposed to start, execution of the scheduled event
-# begins when the already-running event ends.
-#
-# **Parameters**
-#
-# - *time*: Time in seconds until the scheduled event starts
-# - *object*: Global ID of the ESCItem that holds the ESC script
-# - *event*: Name of the event to schedule
-#
-# @ESC
-extends ESCBaseCommand
-class_name SchedEventCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 3,
- [TYPE_INT, TYPE_STRING, TYPE_STRING],
- [null, null, null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[1]):
- escoria.logger.error(
- self,
- "[%s]: invalid object. Object with global id %s not found."
- % [get_command_name(), arguments[1]]
- )
- return false
- elif not escoria.object_manager.get_object(arguments[1]).events\
- .has(arguments[2]):
- escoria.logger.error(
- self,
- "[%s]: invalid object event. Object with global id %s has no event %s."
- % [
- get_command_name(),
- arguments[1],
- arguments[2],
- ]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.event_manager.schedule_event(
- escoria.object_manager.get_object(command_params[1])\
- .events[command_params[2]],
- command_params[0]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_active.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_active.gd
deleted file mode 100644
index fce251e0..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/set_active.gd
+++ /dev/null
@@ -1,50 +0,0 @@
-# `set_active object active`
-#
-# Changes the "active" state of the object.
-# Inactive objects are invisible in the room.
-#
-# **Parameters**
-#
-# - *object* Global ID of the object
-# - *active* Whether `object` should be active. `active` can be `true` or `false`.
-#
-# @ESC
-extends ESCBaseCommand
-class_name SetActiveCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_BOOL],
- [null, null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid object. Object with global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.object_manager.get_object(command_params[0]).active = \
- command_params[1]
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_active_if_exists.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_active_if_exists.gd
deleted file mode 100644
index dbf2149c..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/set_active_if_exists.gd
+++ /dev/null
@@ -1,41 +0,0 @@
-# `set_active_if_exists object active`
-#
-# *** FOR INTERNAL USE ONLY ***
-#
-# Changes the "active" state of the object in the current room if it currently
-# exists in the object manager. If it doesn't, then, unlike set_active, we don't
-# fail and we just carry on.
-#
-# Inactive objects are invisible in the room.
-#
-# **Parameters**
-#
-# - *object* Global ID of the object
-# - *active* Whether `object` should be active. `active` can be `true` or `false`.
-#
-# @ESC
-extends ESCBaseCommand
-class_name SetActiveIfExistsCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_BOOL],
- [null, null]
- )
-
-
-# Run the command
-func run(command_params: Array) -> int:
- if escoria.object_manager.has(command_params[0]):
- escoria.object_manager.get_object(command_params[0]).active = \
- command_params[1]
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_angle.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_angle.gd
deleted file mode 100644
index a7759fbe..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/set_angle.gd
+++ /dev/null
@@ -1,79 +0,0 @@
-# `set_angle object target_degrees [wait]`
-#
-# Turns a movable `ESCItem` or `ESCPlayer` to face a given target direction.
-#
-# Angles 0 and 360 are the same and correspond to UP/NORTH,
-# 90 is RIGHT/EAST, 180 is DOWN/SOUTH, 270 is LEFT/WEST etc.
-# The rotation direction will be determined by the shortest path - e.g.
-# rotating from facing up (0 degrees) to left (270) will be a 90 degree turn
-# anti-clockwise rather than a 270 degree clockwise turn.
-#
-# The final animation used is determined by the directions which have
-# been configured for the object. If the item has a direction configured which
-# has been drawn to show it facing to the right, and this direction has been
-# defined to cover the angle from 45 to 135 degrees, setting the target angle
-# to 120 degrees will result in the right-facing animation being used.
-#
-# The number of intermediate animations shown while turning the
-# item will depend on the directions specified in the item's definition. A 16
-# direction character will turn through 8 different directions to turn 180
-# degrees, a 4 direction character only 2. The wait time will determine how
-# long the idle animation for each direction is played before using the next
-# direction's animation. As such, if wait was set to 1 second, a 16 direction
-# character would take 8 seconds to turn 180 degrees, a 4 direction character
-# would take 2 seconds.
-#
-# **Parameters**
-#
-# - *object*: Global ID of the object to turn
-# - *target_degrees*: Number of degrees by which `object` is to be turned
-# - *wait*: Number of seconds to wait for while playing each animation occurring
-# between the current angle of `object` and the target angle. A value of
-# `0` will complete the turn immediately (default: `0`)
-#
-# @ESC
-extends ESCBaseCommand
-class_name SetAngleCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, [TYPE_REAL, TYPE_INT], [TYPE_REAL, TYPE_INT]],
- [null, null, 0.0]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid object. Object with global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- # HACK Countering the fact that angle_to_point() function gives
- # angle against X axis not Y, we need to check direction using (angle-90°).
- # Since the ESC command already gives the right angle, we add 90.
- escoria.object_manager.get_object(command_params[0]).node\
- .set_angle(
- wrapi(int(command_params[1]) + 90, 0, 360),
- command_params[2]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_animations.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_animations.gd
deleted file mode 100644
index 627008bf..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/set_animations.gd
+++ /dev/null
@@ -1,77 +0,0 @@
-# `set_animations object animations`
-#
-# Sets the animation resource for the given `ESCPlayer` or movable `ESCItem`.
-#
-# **Parameters**
-#
-# - *object*: Global ID of the object whose animation resource is to be updated
-# - *animations*: The path of the animation resource to use
-#
-# @ESC
-extends ESCBaseCommand
-class_name SetAnimationsCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_STRING],
- [null, null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid object. Object with global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- if not ResourceLoader.exists(arguments[1]):
- escoria.logger.error(
- self,
- "[%s]: invalid animation resource. The animation resource %s was not found."
- % [get_command_name(), arguments[1]]
- )
- return false
-
- (escoria.object_manager.get_object(arguments[0]).node as ESCPlayer).validate_animations(load(arguments[1]))
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(command_params[0]).node as ESCPlayer)\
- .animations = load(command_params[1])
- if not escoria.globals_manager.has(
- escoria.room_manager.GLOBAL_ANIMATION_RESOURCES
- ):
- escoria.globals_manager.set_global(
- escoria.room_manager.GLOBAL_ANIMATION_RESOURCES,
- {},
- true
- )
- var animations = escoria.globals_manager.get_global(
- escoria.room_manager.GLOBAL_ANIMATION_RESOURCES
- )
- animations[command_params[0]] = command_params[1]
- escoria.globals_manager.set_global(
- escoria.room_manager.GLOBAL_ANIMATION_RESOURCES,
- animations,
- true
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
-
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_global.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_global.gd
deleted file mode 100644
index 88328b5f..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/set_global.gd
+++ /dev/null
@@ -1,61 +0,0 @@
-# `set_global name value [force=false]`
-#
-# Changes the value of a global.
-#
-# **Parameters**
-#
-# - *name*: Name of the global
-# - *value*: Value to set the global to (can be of type string, boolean, integer
-# or float)
-# - *force*: if false, setting a global whose name is reserved will
-# trigger an error. Defaults to false. Reserved globals are: ESC_LAST_SCENE,
-# FORCE_LAST_SCENE_NULL, ANIMATION_RESOURCES, ESC_CURRENT_SCENE
-#
-# @ESC
-extends ESCBaseCommand
-class_name SetGlobalCommand
-
-
-const ILLEGAL_STRINGS = ["/"]
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, [TYPE_INT, TYPE_BOOL, TYPE_STRING], TYPE_BOOL],
- [null, null, false]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- for s in ILLEGAL_STRINGS:
- if s in arguments[0]:
- escoria.logger.error(
- self,
- "[%s]: invalid global variable. Global variable %s cannot contain the string '%s'."
- % [get_command_name(), arguments[0], s]
- )
- return false
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.globals_manager.set_global(
- command_params[0],
- command_params[1],
- command_params[2]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_globals.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_globals.gd
deleted file mode 100644
index a4b91166..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/set_globals.gd
+++ /dev/null
@@ -1,38 +0,0 @@
-# `set_globals pattern value`
-#
-# Changes the value of multiple globals using a wildcard pattern, where `*`
-# matches zero or more arbitrary characters and `?` matches any single
-# character except a period (".").
-#
-# **Parameters**
-#
-# - *pattern*: Pattern to use to match the names of the globals to change
-# - *value*: Value to set (can be of type string, boolean, integer or float)
-#
-# @ESC
-extends ESCBaseCommand
-class_name SetGlobalsCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, [TYPE_BOOL, TYPE_STRING, TYPE_INT]],
- [null, null]
- )
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.globals_manager.set_global_wildcard(
- command_params[0],
- command_params[1]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_gui_visible.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_gui_visible.gd
deleted file mode 100644
index dcc1e696..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/set_gui_visible.gd
+++ /dev/null
@@ -1,35 +0,0 @@
-# `set_gui_visible visible`
-#
-# Show or hide the GUI.
-#
-# **Parameters**
-#
-# - *visible*: Whether the GUI should be visible (`true` or `false`)
-#
-# @ESC
-extends ESCBaseCommand
-class_name SetGuiVisibleCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [TYPE_BOOL],
- [null]
- )
-
-
-# Run the command
-func run(command_params: Array) -> int:
- if command_params[0]:
- escoria.main.current_scene.game.show_ui()
- else:
- escoria.main.current_scene.game.hide_ui()
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_interactive.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_interactive.gd
deleted file mode 100644
index af8f4f3e..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/set_interactive.gd
+++ /dev/null
@@ -1,49 +0,0 @@
-# `set_interactive object interactive`
-#
-# Sets whether an object is interactive.
-#
-# **Parameters**
-#
-# - *object*: Global ID of the object to change
-# - *interactive*: Whether the object should be interactive
-#
-# @ESC
-extends ESCBaseCommand
-class_name SetInteractiveCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_BOOL],
- [null, null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid object. Object with global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.object_manager.get_object(command_params[0]).interactive = \
- command_params[1]
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_speed.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_speed.gd
deleted file mode 100644
index 6c1698e5..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/set_speed.gd
+++ /dev/null
@@ -1,47 +0,0 @@
-# `set_speed object speed`
-#
-# Sets the speed of a `ESCPlayer` or movable `ESCItem`.
-#
-# **Parameters**
-#
-# - *object*: Global ID of the `ESCPlayer` or movable `ESCItem`
-# - *speed*: Speed value for `object` in pixels per second.
-#
-# @ESC
-extends ESCBaseCommand
-class_name SetSpeedCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_INT],
- [null, null]
- )
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid object. Object with global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- return true
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(command_params[0]).node as ESCItem).\
- set_speed(command_params[1])
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/set_state.gd b/addons/escoria-core/game/core-scripts/esc/commands/set_state.gd
deleted file mode 100644
index 9de99887..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/set_state.gd
+++ /dev/null
@@ -1,62 +0,0 @@
-# `set_state object state [immediate]`
-#
-# Changes the state of `object` to the one specified.
-# This command is primarily used to play animations.
-#
-# If the specified object's associated animation player has an animation
-# with the same name, that animation is also played.
-#
-# When the "state" of the object is set - for example, a door may be set
-# to a "closed" state - this plays the matching "close" animation if one exists
-# (to show the door closing in the game). When you re-enter the room (via a
-# different entry), or restore a saved game, the state of the door object
-# will be restored - showing the door as a closed door.
-#
-# **Parameters**
-#
-# - *object*: Global ID of the object whose state is to be changed
-# - *immediate*: If an animation for the state exists, specifies
-# whether it is to skip to the last frame. Can be `true` or `false`.
-#
-# @ESC
-extends ESCBaseCommand
-class_name SetStateCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_STRING, TYPE_BOOL],
- [null, null, false]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid object. Object %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(command_params[0]) as ESCObject).set_state(
- command_params[1],
- command_params[2]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/show_menu.gd b/addons/escoria-core/game/core-scripts/esc/commands/show_menu.gd
deleted file mode 100644
index c8dd5dd7..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/show_menu.gd
+++ /dev/null
@@ -1,77 +0,0 @@
-# `show_menu menu_type`
-#
-# Shows either the main menu or the pause menu. Transitions to the menu using
-# the default transition type (set in the Escoria project settings).
-#
-# **Parameters**
-#
-# - *menu_type*: Which menu to show. Can be either `main` or `pause` (default: `main`)
-#
-# @ESC
-extends ESCBaseCommand
-class_name ShowMenuCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 0,
- [TYPE_STRING],
- ["main"]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not arguments[0] in ["main", "pause"]:
- escoria.logger.error(
- self,
- "[%s]: menu %s is invalid." % [get_command_name(), arguments[0]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- if not escoria.game_scene.is_inside_tree():
- escoria.add_child(escoria.game_scene)
-
- # Transition out from current scene
- var transition_id = escoria.main.scene_transition.transition(
- "",
- ESCTransitionPlayer.TRANSITION_MODE.OUT
- )
-
- if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
- while yield(
- escoria.main.scene_transition,
- "transition_done"
- ) != transition_id:
- pass
-
- if command_params[0] == "main":
- escoria.game_scene.show_main_menu()
- elif command_params[0] == "pause":
- escoria.game_scene.pause_game()
-
- # Transition in to menu
- transition_id = escoria.main.scene_transition.transition()
-
- if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
- while yield(
- escoria.main.scene_transition,
- "transition_done"
- ) != transition_id:
- pass
-
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/slide.gd b/addons/escoria-core/game/core-scripts/esc/commands/slide.gd
deleted file mode 100644
index 158d545a..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/slide.gd
+++ /dev/null
@@ -1,122 +0,0 @@
-# `slide object target [speed]`
-#
-# Moves `object` towards the position of `target`. This command is
-# non-blocking.
-#
-# - *object*: Global ID of the object to move
-# - *target*: Global ID of the target object
-# - *speed*: The speed at which to slide in pixels per second (will default to
-# the speed configured on the `object`)
-#
-# **Warning** This command does not respect the room's navigation polygons, so
-# `object` can be moved even when outside walkable areas.
-#
-# @ESC
-extends ESCBaseCommand
-class_name SlideCommand
-
-
-# A hash of tweens currently active for animated items
-var _tweens: Dictionary
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_STRING, TYPE_INT],
- [null, null, -1]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid first object. Object with global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- if not escoria.object_manager.has(arguments[1]):
- escoria.logger.error(
- self,
- "[%s]: invalid second object. Object with global id %s not found."
- % [get_command_name(), arguments[1]]
- )
- return false
- return true
-
-
-# Slide the object by generating a tween
-#
-# #### Parameters
-#
-# - *source*: The item to slide
-# - *destination*: The destination item to slide to
-# - *speed*: The speed at which to slide in pixels per second (will default to
-# the speed configured on the `object`)
-#
-#
-# **Returns** The generated (and started) tween
-func _slide_object(
- source: ESCObject,
- destination: ESCObject,
- speed: int = -1
-) -> Tween:
- if speed == -1:
- speed = source.node.speed
-
- if _tweens.has(source.global_id):
- var tween = (_tweens.get(source.global_id) as Tween)
- tween.stop_all()
- if (escoria.main as Node).has_node(tween.name):
- (escoria.main as Node).remove_child(tween)
-
- var tween = Tween.new()
- (escoria.main as Node).add_child(tween)
-
- tween.connect("tween_completed", self, "_on_tween_completed")
-
- var duration = source.node.position.distance_to(
- destination.node.position
- ) / speed
-
- tween.interpolate_property(
- source.node,
- "global_position",
- source.node.global_position,
- destination.node.global_position,
- duration
- )
-
- tween.start()
-
- _tweens[source.global_id] = tween
-
- return tween
-
-
-
-# Run the command
-func run(command_params: Array) -> int:
- _slide_object(
- escoria.object_manager.get_object(command_params[0]),
- escoria.object_manager.get_object(command_params[1]),
- command_params[2]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- for tween in _tweens:
- tween.stop_all()
-
-
-func _on_tween_completed(tween: Tween, _key: NodePath):
- if tween:
- tween.queue_free()
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/slide_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/slide_block.gd
deleted file mode 100644
index c88b616f..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/slide_block.gd
+++ /dev/null
@@ -1,32 +0,0 @@
-# `slide_block object target [speed]`
-#
-# Moves `object` towards the position of `target`. This command is
-# blocking.
-#
-# - *object*: Global ID of the object to move
-# - *target*: Global ID of the target object
-# - *speed*: The speed at which to slide in pixels per second (will default to
-# the speed configured on the `object`)
-#
-# **Warning** This command does not respect the room's navigation polygons, so
-# `object` can be moved even when outside walkable areas.
-#
-# @ESC
-extends SlideCommand
-class_name SlideBlockCommand
-
-
-# Run the command
-func run(command_params: Array) -> int:
- var tween = _slide_object(
- escoria.object_manager.get_object(command_params[0]),
- escoria.object_manager.get_object(command_params[1]),
- command_params[2]
- )
- yield(tween, "tween_all_completed")
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- .interrupt()
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/spawn.gd b/addons/escoria-core/game/core-scripts/esc/commands/spawn.gd
deleted file mode 100644
index f91c9b47..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/spawn.gd
+++ /dev/null
@@ -1,95 +0,0 @@
-# `spawn identifier path [is_active] [position_target]`
-#
-# Programmatically adds a new item to the scene.
-#
-# **Parameters**
-#
-# - *identifier*: Global ID to use for the new object
-# - *path*: Path to the scene file of the object
-# - *is_active*: Whether the new object should be set to active (default: `true`)
-# - *position_target*: Global ID of another object that will be used to
-# position the new object (when omitted, the new object's position is not specified)
-#
-# @ESC
-extends ESCBaseCommand
-class_name SpawnCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_STRING, TYPE_BOOL, TYPE_STRING],
- [null, null, true, null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if arguments[0].empty() \
- or arguments[0] in escoria.object_manager.RESERVED_OBJECTS:
- escoria.logger.error(
- self,
- "[%s]: global_id (%s) is invalid. The global_id was either empty or is reserved."
- % [get_command_name(), arguments[0]]
- )
- return false
- if not ResourceLoader.exists(arguments[1]):
- escoria.logger.error(
- self,
- "[%s]: Invalid scene path: %s not found."
- % [get_command_name(), arguments[1]]
- )
- return false
- if arguments[3] and not escoria.object_manager.has(arguments[3]):
- escoria.logger.error(
- self,
- "[%s]: invalid object: Object with global id %s not found."
- % [get_command_name(), arguments[3]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- var res_scene = escoria.resource_cache.get_resource(command_params[1])
-
- # Load room scene
- var scene = res_scene.instance()
- if scene:
- escoria.main.get_node("/root").add_child(scene)
- if command_params[3]:
- var obj = escoria.object_manager.get_object(command_params[3])
- scene.set_position(obj.get_global_position())
- escoria.inputs_manager.hotspot_focused = ""
-
- escoria.object_manager.register_object(
- ESCObject.new(
- command_params[0],
- scene
- ),
- null,
- true
- )
-
- escoria.object_manager.get_object(command_params[0]).active = \
- command_params[2]
-
- else:
- escoria.logger.error(
- self,
- "[%s]: Invalid scene. Failed to load scene %s."
- % [get_command_name(), command_params[1]]
- )
-
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/stop.gd b/addons/escoria-core/game/core-scripts/esc/commands/stop.gd
deleted file mode 100644
index 7b59f333..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/stop.gd
+++ /dev/null
@@ -1,29 +0,0 @@
-# `stop`
-#
-# Stops the current event's execution. Note that this will stop the current
-# script entirely - if you're within a conditional block, the code after the
-# conditional block will not be executed.
-#
-# @ESC
-extends ESCBaseCommand
-class_name StopCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 0,
- [],
- []
- )
-
-
-# Run the command
-func run(command_params: Array) -> int:
- return ESCExecution.RC_CANCEL
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/stop_snd.gd b/addons/escoria-core/game/core-scripts/esc/commands/stop_snd.gd
deleted file mode 100644
index c9c9b12b..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/stop_snd.gd
+++ /dev/null
@@ -1,68 +0,0 @@
-# `stop_snd [audio_bus]`
-#
-# Stops the given audio bus's stream.
-#
-# By default there are 3 audio buses set up by Escoria : `_sound`, which is
-# used to play non-looping sound effects; `_music`, which plays looping music;
-# and `_speech`, which plays non-looping voice files (default: `_music`).
-#
-# Each simultaneous sound (e.g. multiple game sound effects) will require its
-# own bus. To create additional buses, see the Godot sound documentation :
-# [Audio buses](https://docs.godotengine.org/en/stable/tutorials/audio/audio_buses.html#doc-audio-buses)
-#
-# **Parameters**
-#
-# - *audio_bus*: Bus to stop ("_sound", "_music", "_speech", or a custom
-# audio bus you have created.)
-#
-# @ESC
-extends ESCBaseCommand
-class_name StopSndCommand
-
-
-# The specified sound player
-var _snd_player: String
-
-# The previous sound state, saved for interrupting
-var previous_snd_state: String
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 0,
- [TYPE_STRING],
- ["_music"]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid sound player. Sound player %s not registered."
- % [get_command_name(), arguments[0]]
- )
- return false
- _snd_player = arguments[0]
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- previous_snd_state = escoria.object_manager.get_object(command_params[0]).node.state
- escoria.object_manager.get_object(command_params[0]).node.set_state(
- "off"
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.object_manager.get_object(_snd_player).node.set_state(
- previous_snd_state
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/teleport.gd b/addons/escoria-core/game/core-scripts/esc/commands/teleport.gd
deleted file mode 100644
index af276ea1..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/teleport.gd
+++ /dev/null
@@ -1,68 +0,0 @@
-# `teleport object target`
-#
-# Instantly moves an object to a new position.
-#
-# **Parameters**
-#
-# - *object*: Global ID of the object to move
-# - *target*: Global ID of the object to use as the destination coordinates
-# for `object`
-#
-# @ESC
-extends ESCBaseCommand
-class_name TeleportCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_STRING],
- [null, null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid first object. Object to teleport with global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
-
- if not (escoria.object_manager.get_object(arguments[0]).node as ESCItem):
- escoria.logger.error(
- self,
- "[%s]: invalid first object. Object to teleport with global id %s must be of or derived from type ESCItem."
- % [get_command_name(), arguments[0]]
- )
- return false
-
- if not escoria.object_manager.has(arguments[1]):
- escoria.logger.error(
- self,
- "[%s]: invalid second object. Destination location to teleport to with global id %s not found."
- % [get_command_name(), arguments[1]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(command_params[0]).node as ESCItem) \
- .teleport(
- escoria.object_manager.get_object(command_params[1]).node
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/teleport_pos.gd b/addons/escoria-core/game/core-scripts/esc/commands/teleport_pos.gd
deleted file mode 100644
index e2a8bba5..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/teleport_pos.gd
+++ /dev/null
@@ -1,62 +0,0 @@
-# `teleport_pos object x y`
-#
-# Instantly moves an object to the specified (absolute) coordinates.
-#
-# **Parameters**
-#
-# - *object*: Global ID of the object to move
-# - *x*: X-coordinate of destination position
-# - *y*: Y-coordinate of destination position
-#
-# @ESC
-extends ESCBaseCommand
-class_name TeleportPosCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 3,
- [TYPE_STRING, TYPE_INT, TYPE_INT],
- [null, null, null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid first object. Object to teleport with global id %s not found."
- % [get_command_name(), arguments[0]]
- )
- return false
-
- if not (escoria.object_manager.get_object(arguments[0]).node as ESCItem):
- escoria.logger.error(
- self,
- "[%s]: invalid first object. Object to teleport with global id %s must be of or derived from type ESCItem."
- % [get_command_name(), arguments[0]]
- )
- return false
-
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(command_params[0]).node as ESCItem) \
- .teleport_to(
- Vector2(int(command_params[1]), int(command_params[2])
- )
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/transition.gd b/addons/escoria-core/game/core-scripts/esc/commands/transition.gd
deleted file mode 100644
index d67f2846..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/transition.gd
+++ /dev/null
@@ -1,90 +0,0 @@
-# `transition transition_name mode [delay]`
-#
-# Runs a transition effect - generally used when entering or leaving a room.
-# Transitions are implemented as Godot shaders. Custom transitions can be made
-# by creating a shader in the `game/scenes/transitions/shaders/` folder within
-# the escoria-core plugin folder.
-#
-# **Parameters**
-#
-# - *transition_name*: Name of the transition shader from one of the transition
-# directories
-# - *mode*: Set to `in` to transition into or `out` to transition out of the room
-# - *delay*: Delay in seconds before starting the transition (default: `1.0`)
-#
-# @ESC
-extends ESCBaseCommand
-class_name TransitionCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_STRING, TYPE_REAL],
- [null, null, 1.0]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.main.scene_transition.has_transition(arguments[0]) \
- and not arguments[0].empty():
- escoria.logger.error(
- self,
- "[%s]: argument invalid. Transition with name '%s' doesn't exist."
- % [get_command_name(), arguments[0]]
- )
- return false
- if not arguments[1] in ["in", "out"]:
- escoria.logger.error(
- self,
- "[%s]: argument invalid" +
- "Transition type 'in' or 'out' expected, but '%s' was provided."
- % [get_command_name(), arguments[1]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- var transition_id = escoria.main.scene_transition.transition(
- command_params[0],
- ESCTransitionPlayer.TRANSITION_MODE.OUT if command_params[1] == "out" \
- else ESCTransitionPlayer.TRANSITION_MODE.IN,
- command_params[2]
- )
-
- if transition_id == ESCTransitionPlayer.TRANSITION_ID_INSTANT:
- escoria.logger.debug(
- self,
- "Performing instant transition."
- )
- escoria.main.scene_transition.reset_shader_cutoff()
- return ESCExecution.RC_OK
-
- escoria.logger.debug(
- self,
- "Starting transition #%s [%s, %s]."
- % [transition_id, command_params[0], command_params[1]]
- )
- while yield(
- escoria.main.scene_transition,
- "transition_done"
- ) != transition_id:
- pass
- escoria.logger.debug(
- self,
- "Ending transition #%s [%s, %s]."
- % [transition_id, command_params[0], command_params[1]])
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- # Do nothing
- pass
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/turn_to.gd b/addons/escoria-core/game/core-scripts/esc/commands/turn_to.gd
deleted file mode 100644
index 4fe4c120..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/turn_to.gd
+++ /dev/null
@@ -1,79 +0,0 @@
-# `turn_to object object_to_face [wait]`
-#
-# Turns `object` to face another object.
-#
-# Unlike movement commands, `turn_to` will not automatically reference an
-# `ESCLocation` that is a child of an `ESCItem.`
-# To turn towards an `ESCLocation` that is a child of an `ESCItem`, give the
-# `ESCLocation` a `Global ID` and use this value as the `object_to_face`
-# parameter.
-#
-# While turning, the number of directions the item faces will depend on
-# the number of `directions` defined for the object. A 16 direction character
-# for example will display 8 directions of animation while turning to face an
-# object that is 180 degrees away, a 4 direction character would only face 2
-# directions to make the same turn. As the idle animation will be played for
-# `wait` seconds for each direction the object faces, a 16 direction character
-# would take 8 seconds to rotate 180 degrees with a 1 second `wait` time,
-# whereas a 4 direction character would only take 2 seconds to make the same
-# rotation.
-#
-# **Parameters**
-#
-# - *object*: Global ID of the object to be turned
-# - *object_to_face*: Global ID of the object to turn towards
-# - *wait*: Length of time to wait in seconds for each intermediate angle.
-# If set to 0, the turnaround is immediate (default: `0`)
-#
-# @ESC
-extends ESCBaseCommand
-class_name TurnToCommand
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_STRING, TYPE_REAL],
- [null, null, 0.0]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: Cannot turn \"%s\". Object not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- if not escoria.object_manager.has(arguments[1]):
- escoria.logger.error(
- self,
- "[%s]: Cannot turn \"%s\" towards \"%s\". \"%s\" was not found."
- % [get_command_name(), arguments[0], arguments[1] , arguments[1]]
- )
- return false
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- (escoria.object_manager.get_object(command_params[0]).node as ESCItem)\
- .turn_to(
- escoria.object_manager.get_object(command_params[1]).node,
- command_params[2]
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "[%s] interrupt() function not implemented." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/wait.gd b/addons/escoria-core/game/core-scripts/esc/commands/wait.gd
deleted file mode 100644
index d408e6c3..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/wait.gd
+++ /dev/null
@@ -1,58 +0,0 @@
-# `wait seconds`
-#
-# Blocks execution of the current event.
-#
-# **Parameters**
-#
-# - *seconds*: Number of seconds to block
-#
-# @ESC
-extends ESCBaseCommand
-class_name WaitCommand
-
-# Timer to wait for
-var timer: Timer
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 1,
- [[TYPE_INT, TYPE_REAL]],
- [null]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- # We can't wait for 0 or fewer seconds, now, can we?
- if arguments[0] <= 0.0:
- escoria.logger.error(
- self,
- "[%s]: argument invalid. %s is an invalid amount of time to wait (must be positive)."
- % [get_command_name(), arguments[0]]
- )
- return false
-
- return true
-
-# Run the command
-func run(command_params: Array) -> int:
- timer = Timer.new()
- timer.wait_time = float(command_params[0])
- escoria.add_child(timer)
- timer.start()
- yield(timer, "timeout")
- escoria.remove_child(timer)
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- if timer == null:
- return
-
- timer.emit_signal("timeout")
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/walk.gd b/addons/escoria-core/game/core-scripts/esc/commands/walk.gd
deleted file mode 100644
index a5debcda..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/walk.gd
+++ /dev/null
@@ -1,77 +0,0 @@
-# `walk object target [walk_fast]`
-#
-# Moves the specified `ESCPlayer` or movable `ESCItem` to the `target`
-# ESCItem's location while playing `object`'s walking animation. This command
-# is non-blocking.
-# This command will use the normal walk speed by default.
-# If the `target` ESCItem has a child ESCLocation node, the walk destination
-# will be the position of the ESCLocation.
-#
-# **Parameters**
-#
-# - *object*: Global ID of the object to move
-# - *target*: Global ID of the target object
-# - *walk_fast*: Whether to walk fast (`true`) or normal speed (`false`)
-# (default: false)
-#
-# @ESC
-extends ESCBaseCommand
-class_name WalkCommand
-
-
-# Walking object
-var walking_object_node: ESCItem
-
-# Target object
-var target_object_node: ESCObject
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_STRING, TYPE_BOOL],
- [null, null, false]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid first object. The object with global id %s to make walk was not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- if not escoria.object_manager.has(arguments[1]):
- escoria.logger.error(
- self,
- "[%s]: invalid second object. The object to walk to with global id %s was not found."
- % [get_command_name(), arguments[1]]
- )
- return false
-
- walking_object_node = (escoria.object_manager.get_object(
- arguments[0]).node as ESCItem
- )
- target_object_node = escoria.object_manager.get_object(arguments[1])
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.BACKGROUND_CLICK,
- command_params
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- if walking_object_node != null:
- walking_object_node.stop_walking_now()
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/walk_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/walk_block.gd
deleted file mode 100644
index d3179478..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/walk_block.gd
+++ /dev/null
@@ -1,79 +0,0 @@
-# `walk_block object target [walk_fast]`
-#
-# Moves the specified `ESCPlayer` or movable `ESCItem` to the `target`
-# ESCItem's location while playing `object`'s walking animation. This command
-# is blocking.
-# This command will use the normal walk speed by default.
-# If the `target` ESCItem has a child ESCLocation node, the walk destination
-# will be the position of the ESCLocation.
-#
-# **Parameters**
-#
-# - *object*: Global ID of the object to move
-# - *target*: Global ID of the target object
-# - *walk_fast*: Whether to walk fast (`true`) or normal speed (`false`).
-# (default: false)
-#
-# @ESC
-extends ESCBaseCommand
-class_name WalkBlockCommand
-
-
-# Walking object
-var walking_object_node: ESCItem
-
-# Target object
-var target_object_node: ESCObject
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 2,
- [TYPE_STRING, TYPE_STRING, TYPE_BOOL],
- [null, null, false]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid first object. The object to make walk with global id %s was not found."
- % [get_command_name(), arguments[0]]
- )
- return false
- if not escoria.object_manager.has(arguments[1]):
- escoria.logger.error(
- self,
- "[%s]: invalid second object. The object to walk to with global id %s was not found."
- % [get_command_name(), arguments[1]]
- )
- return false
-
- walking_object_node = (escoria.object_manager.get_object(
- arguments[0]).node as ESCItem
- )
- target_object_node = escoria.object_manager.get_object(arguments[1])
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.BACKGROUND_CLICK,
- command_params
- )
- yield(walking_object_node, "arrived")
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- if walking_object_node != null and is_instance_valid(walking_object_node) \
- and not walking_object_node is ESCPlayer:
- walking_object_node.stop_walking_now()
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos.gd b/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos.gd
deleted file mode 100644
index d24faccd..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos.gd
+++ /dev/null
@@ -1,65 +0,0 @@
-# `walk_to_pos object x y [walk_fast]`
-#
-# Moves the specified `ESCPlayer` or movable `ESCItem` to the absolute
-# coordinates provided while playing the `object`'s walking animation.
-# This command is non-blocking.
-# This command will use the normal walk speed by default.
-#
-# **Parameters**
-#
-# - *object*: Global ID of the object to move
-# - *x*: X-coordinate of target position
-# - *y*: Y-coordinate of target position
-# - *walk_fast*: Whether to walk fast (`true`) or normal speed (`false`).
-# (default: false)
-#
-# @ESC
-extends ESCBaseCommand
-class_name WalkToPosCommand
-
-
-# Walking object
-var walking_object_node: ESCItem
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 3,
- [TYPE_STRING, TYPE_INT, TYPE_INT, TYPE_BOOL],
- [null, null, null, false]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid first object. The object to make walk with global id %s was not found."
- % [get_command_name(), arguments[0]]
- )
- return false
-
- walking_object_node = (escoria.object_manager.get_object(
- arguments[0]).node as ESCItem
- )
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.action_manager.do(escoria.action_manager.ACTION.BACKGROUND_CLICK, [
- command_params[0],
- Vector2(command_params[1], command_params[2]), command_params[3]
- ])
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- if walking_object_node != null and not walking_object_node is ESCPlayer:
- walking_object_node.stop_walking_now()
diff --git a/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos_block.gd b/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos_block.gd
deleted file mode 100644
index 4776cd29..00000000
--- a/addons/escoria-core/game/core-scripts/esc/commands/walk_to_pos_block.gd
+++ /dev/null
@@ -1,69 +0,0 @@
-# `walk_to_pos_block object x y [walk_fast]`
-#
-# Moves the specified `ESCPlayer` or movable `ESCItem` to the absolute
-# coordinates provided while playing the `object`'s walking animation.
-# This command is blocking.
-# This command will use the normal walk speed by default.
-#
-# **Parameters**
-#
-# - *object*: Global ID of the object to move
-# - *x*: X-coordinate of target position
-# - *y*: Y-coordinate of target position
-# - *walk_fast*: Whether to walk fast (`true`) or normal speed (`false`).
-# (default: false)
-#
-# @ESC
-extends ESCBaseCommand
-class_name WalkToPosBlockCommand
-
-
-# Walking object
-var walking_object_node: ESCItem
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- return ESCCommandArgumentDescriptor.new(
- 3,
- [TYPE_STRING, TYPE_INT, TYPE_INT, TYPE_BOOL],
- [null, null, null, false]
- )
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array):
- if not .validate(arguments):
- return false
-
- if not escoria.object_manager.has(arguments[0]):
- escoria.logger.error(
- self,
- "[%s]: invalid first object. The object to make walk with global id %s was not found."
- % [get_command_name(), arguments[0]]
- )
- return false
-
- walking_object_node = (escoria.object_manager.get_object(
- arguments[0]).node as ESCItem
- )
- return true
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.action_manager.do(escoria.action_manager.ACTION.BACKGROUND_CLICK, [
- command_params[0],
- Vector2(command_params[1], command_params[2]), command_params[3]
- ])
- yield(
- (escoria.object_manager.get_object(command_params[0]).node as ESCItem),
- "arrived"
- )
- return ESCExecution.RC_OK
-
-
-# Function called when the command is interrupted.
-func interrupt():
- if walking_object_node != null and not walking_object_node is ESCPlayer:
- walking_object_node.stop_walking_now()
diff --git a/addons/escoria-core/game/core-scripts/esc/esc_action_manager.gd b/addons/escoria-core/game/core-scripts/esc/esc_action_manager.gd
deleted file mode 100644
index 877f341c..00000000
--- a/addons/escoria-core/game/core-scripts/esc/esc_action_manager.gd
+++ /dev/null
@@ -1,769 +0,0 @@
-# Manages currently carried out actions
-extends Resource
-class_name ESCActionManager
-
-
-# The current action verb was changed
-signal action_changed
-
-# Emitted, when an action has been completed
-signal action_finished
-
-# Emitted when the action input state has changed
-signal action_input_state_changed
-
-
-# States of the action input (verb, item, target)
-# (I) -> AWAITING_VERB_OR_ITEM -> AWAITING_ITEM -> COMPLETED -> (E)
-# or
-# (I) -> AWAITING_VERB_OR_ITEM -> AWAITING_ITEM -> AWAITING_TARGET_ITEM -> COMPLETED -> (E)
-# or
-# (I) -> AWAITING_VERB_OR_ITEM -> AWAITING_VERB -> AWAITING_VERB_CONFIRMATION -> COMPLETED -> (E)
-enum ACTION_INPUT_STATE {
- # Initial state
- AWAITING_VERB_OR_ITEM,
- # After initial state, verb is defined
- AWAITING_ITEM,
- # Item defined requires combine, waiting for  target
- AWAITING_TARGET_ITEM
- # After initial state, item is defined
- AWAITING_VERB,
- # Item was defined first, next verb, need verb confirmation
- AWAITING_VERB_CONFIRMATION,
- #Â Final state
- COMPLETED
-}
-
-# Actions understood by the do(...) method
-# * BACKGROUND_CLICK: Object is to move from its current position
-# * ITEM_LEFT_CLICK: Item has been clicked on with LMB.
-# * ITEM_RIGHT_CLICK: Item has been clicked on with RMB.
-# * TRIGGER_IN: Character has moved into a trigger area.
-# * TRIGGER_OUT: Character has moved out of a trigger area.
-enum ACTION {
- BACKGROUND_CLICK,
- ITEM_LEFT_CLICK,
- ITEM_RIGHT_CLICK,
- TRIGGER_IN,
- TRIGGER_OUT
-}
-
-
-# Basic required internal actions
-const ACTION_ARRIVED = "arrived"
-const ACTION_EXIT_SCENE = "exit_scene"
-const ACTION_WALK = "walk"
-
-
-# Current verb used
-var current_action: String = "" setget set_current_action
-
-# Current tool (ESCItem/ESCInventoryItem) used
-var current_tool: ESCObject
-
-# Current target where the tool is being used on/with (if any)
-var current_target: ESCObject
-
-# Current action input state
-var action_state = ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM \
- setget set_action_input_state
-
-
-# Run a generic action
-#
-# #### Parameters
-#
-# - action: type of the action to run
-# - params: Parameters for the action
-# - BACKGROUND_CLICK: [moving_obj, target, walk_fast]
-# - ITEM_LEFT_CLICK: [item, input_event]
-# - ITEM_RIGHT_CLICK: [item, input_event]
-# - TRIGGER_IN: [trigger_id, object_id, trigger_in_verb]
-# - TRIGGER_OUT: [trigger_id, object_id, trigger_out_verb]
-# - can_interrupt: if true, this command will interrupt any ongoing event
-# before it is finished
-func do(action: int, params: Array = [], can_interrupt: bool = false) -> void:
- if escoria.current_state == escoria.GAME_STATE.DEFAULT:
- match action:
- ACTION.BACKGROUND_CLICK:
- if can_interrupt:
- escoria.event_manager.interrupt()
-
- var walk_fast = false
- if params.size() > 2:
- walk_fast = true if params[2] else false
-
- # Check moving object.
- if not escoria.object_manager.has(params[0]):
- escoria.logger.error(
- self,
- "Walk action requested for nonexisting object: %s."
- % params[0]
- )
- return
-
- var moving_obj = escoria.object_manager.get_object(params[0])
- var target
-
- if params[1] is String:
- if not escoria.object_manager.has(params[1]):
- escoria.logger.error(
- self,
- "Walk action requested to nonexisting destination object: %s."
- % params[1]
- )
- return
-
- target = escoria.object_manager.get_object(params[1])
- elif params[1] is Vector2:
- target = params[1]
-
- self.perform_walk(moving_obj, target, walk_fast)
-
- ACTION.ITEM_LEFT_CLICK:
- if params[0] is String:
- escoria.logger.info(
- self,
- "item_left_click on item %s." % params[0]
- )
-
- if can_interrupt:
- escoria.event_manager.interrupt()
-
- var item = escoria.object_manager.get_object(params[0])
-
- self.perform_inputevent_on_object(item, params[1])
-
- ACTION.ITEM_RIGHT_CLICK:
- if params[0] is String:
- escoria.logger.info(
- self,
- "item_right_click on item %s." % params[0]
- )
-
- if can_interrupt:
- escoria.event_manager.interrupt()
-
- var item = escoria.object_manager.get_object(params[0])
-
- self.perform_inputevent_on_object(item, params[1], true)
-
- ACTION.TRIGGER_IN:
- var trigger_id = params[0]
- var object_id = params[1]
- var trigger_in_verb = params[2]
- escoria.logger.info(
- self,
- "trigger_in on trigger %s activated by %s." % [
- trigger_id,
- object_id
- ]
- )
- escoria.event_manager.queue_event(
- escoria.object_manager.get_object(trigger_id).events[
- trigger_in_verb
- ]
- )
-
- ACTION.TRIGGER_OUT:
- var trigger_id = params[0]
- var object_id = params[1]
- var trigger_out_verb = params[2]
- escoria.logger.info(
- self,
- "trigger_out on trigger %s activated by %s." % [
- trigger_id,
- object_id
- ]
- )
- escoria.event_manager.queue_event(
- escoria.object_manager.get_object(trigger_id).events[
- trigger_out_verb
- ]
- )
-
- _:
- escoria.logger.warn(
- self,
- "Action received: %s with params %s.", [action, params]
- )
- elif escoria.current_state == escoria.GAME_STATE.WAIT:
- pass
-
-
-# Sets the current state of action input.
-#
-# ## Parameters
-# - p_state: the action input state to set
-func set_action_input_state(p_state):
- action_state = p_state
- emit_signal("action_input_state_changed")
-
-
-# Set the current action verb
-#
-# ## Parameters
-# - action: The action verb to set
-func set_current_action(action: String):
- if action != current_action:
- clear_current_tool()
-
- current_action = action
-
- if action_state == ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM:
- set_action_input_state(ACTION_INPUT_STATE.AWAITING_ITEM)
- elif action_state == ACTION_INPUT_STATE.AWAITING_VERB:
- set_action_input_state(ACTION_INPUT_STATE.AWAITING_VERB_CONFIRM)
-
- emit_signal("action_changed")
-
-
-# Clear the current action
-func clear_current_action():
- set_current_action("")
- set_action_input_state(ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM)
- emit_signal("action_changed")
-
-
-# Clear the current tool
-func clear_current_tool():
- current_tool = null
- current_target = null
- if action_state == ACTION_INPUT_STATE.AWAITING_VERB:
- set_action_input_state(ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM)
- elif action_state == ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
- set_action_input_state(ACTION_INPUT_STATE.AWAITING_ITEM)
-
-
-# Checks if the specified action is valid and returns the associated event;
-# otherwise, we see if there's a "fallback" event and use that if necessary and,
-# if not, we return no event as there's nothing to do.
-#
-# #### Parameters
-#
-# - action: Action to execute (defined in attached ESC file and in
-# action verbs UI) eg: arrived, use, look, pickup...
-# - target: Target ESC object
-# - combine_with: ESC object to combine with
-#
-# *Returns* the appropriate ESCEvent to queue/run, or null if none can be found
-# or there's a reason not to run an event.
-func _get_event_to_queue(
- action: String,
- target: ESCObject,
- combine_with: ESCObject = null
-) -> ESCEvent:
-
- escoria.logger.info(
- self,
- "Checking if action '%s' on '%s' is valid..." % [action, target]
- )
-
- var event_to_return: ESCEvent = null
-
- # If we're using an action which item requires to combine
- if target.node is ESCItem \
- and action in target.node.combine_when_selected_action_is_in:
-
- # Check if object must be in inventory to be used
- if target.node.use_from_inventory_only:
- if escoria.inventory_manager.inventory_has(target.global_id):
- # Player has item in inventory, we check the element to use on
- if combine_with:
- var do_combine = true
- if combine_with.node is ESCItem \
- and combine_with.node.use_from_inventory_only\
- and not escoria.inventory_manager.inventory_has(
- combine_with.global_id
- ):
- do_combine = false
-
- if do_combine:
- var target_event = "%s %s" % [
- action,
- combine_with.global_id
- ]
- var combine_with_event = "%s %s" % [
- action,
- target.global_id
- ]
-
- if target.events.has(target_event):
- event_to_return = target.events[target_event]
- elif combine_with.events.has(combine_with_event)\
- and not combine_with.node.combine_is_one_way:
-
- event_to_return = combine_with.events[combine_with_event]
- else:
- # Check to see if there isn't a "fallback" action to
- # run before we declare this a failure.
- if escoria.action_default_script \
- and escoria.action_default_script.events.has(action):
-
- event_to_return = escoria.action_default_script.events[action]
- else:
- var errors = [
- "Attempted to execute action %s between item %s and item %s" % [
- action,
- target.global_id,
- combine_with.global_id
- ]
- ]
-
- if combine_with.node.combine_is_one_way:
- errors.append(
- ("Reason: %s's item interaction " + \
- "is one-way.") % combine_with.global_id
- )
-
- escoria.logger.warn(
- self,
- "Invalid action: " + str(errors)
- )
- else:
- escoria.logger.warn(
- self,
- "Invalid action on item: " +
- (
- "Trying to combine object %s with %s, "+
- "but %s is not in inventory."
- ) % [
- target.global_id,
- combine_with.global_id,
- combine_with.global_id
- ]
- )
- else:
- escoria.logger.warn(
- self,
- "Invalid action on item: " +
- "Trying to run action %s on object %s, " %
- [
- action,
- target.node.global_id
- ]
- + "but item must be in inventory."
- )
- else:
- if target.events.has(action):
- event_to_return = target.events[action]
- elif escoria.action_default_script \
- and escoria.action_default_script.events.has(action):
-
- # If there's a "fallback" action to run, return it
- event_to_return = escoria.action_default_script.events[action]
- else:
- escoria.logger.warn(
- self,
- "Invalid action: " +
- "Event for action %s on object %s not found." % [
- action,
- target.global_id
- ]
- )
-
- return event_to_return
-
-
-# Runs the specified event.
-#
-# #### Parameters
-#
-# - event: the event to be run
-#
-# *Returns* the return code of the event once executed
-func _run_event(event: ESCEvent) -> int:
- escoria.event_manager.queue_event(event)
-
- var event_returned = yield(
- escoria.event_manager,
- "event_finished"
- )
-
- while event_returned[1] != event.name:
- event_returned = yield(
- escoria.event_manager,
- "event_finished"
- )
-
- clear_current_action()
- emit_signal("action_finished")
-
- return event_returned[0]
-
-
-# Makes an object walk to a destination. This can be either a 2D position or
-# another object.
-#
-# #### Parameters
-#
-# - moving_obj_id: global id of the object that needs to move
-# - destination: Position2D or ESCObject holding the moving object to head to
-# - is_fast: if true, the walk is performed at fast speed (defined in the moving
-#Â object.
-func perform_walk(
- moving_obj: ESCObject,
- destination,
- is_fast: bool = false
-):
- # Walk to Position2D.
- if destination is Vector2:
- var walk_context = ESCWalkContext.new(
- null,
- destination,
- is_fast,
- true
- )
- moving_obj.node.walk_to(destination, walk_context)
-
- # Walk to object
- elif destination is ESCObject:
- if destination.node:
- var target_position: Vector2
- if destination.node is ESCLocation:
- target_position = destination.node.global_position
- else:
- target_position = destination.node.get_interact_position()
-
- var walk_context = ESCWalkContext.new(
- destination,
- target_position,
- is_fast,
- true
- )
-
- moving_obj.node.walk_to(target_position, walk_context)
-
- else:
- escoria.logger.error(
- self,
- "Function expected either a Vector2 or ESCObject type " + \
- "for destination parameter. Destination provided was: %s." % destination
- )
- return
-
-
-# Event handler when an object/item was clicked
-#
-# #### Parameters
-#
-# - obj: Object that was left clicked
-# - event: Input event that was received
-# - default_action: if true, run the inventory default action
-func perform_inputevent_on_object(
- obj: ESCObject,
- event: InputEvent,
- default_action: bool = false
-):
- """
- This algorithm:
- - validates the requested action
- - grabs the corresponding event for the action, if available
- - makes the player move to the clicked object location, if needed
- (if it is located in the room for example) and wait for reaching.
- - when reached, performs an action depending on current defined action
- * no current action defined: do nothing else
- * current action defined:
- * item requires no combination: perform the current action
- on the item
- * item requires combination: check the status of the combination
- A combination requires 3 elements to fulfill:
- 1/ a verb action
- 2/ a first "tool" (item to use)
- 3/ a second "tool" (item to use ON)
- Whatever the user inputs to fulfill the combination (this is
- determined by gamedev in his game.gd script)
- - combination not fulfilled: no not perform until fulfilled
- - combination fulfilled: perform the combination.
- * else do nothing, except if default_action is requested.
- In this case, perform the default_action on the item.
- """
-
- escoria.logger.info(
- self,
- "%s to perform event %s." % [obj.global_id, event]
- )
-
- # Don't interact after player movement towards object
- # (because object is inactive for example)
- var dont_interact = false
-
- #Â We need to have the new action input state BEFORE initiating the player
- # move so we determine now if the object clicked will require a combination
- # depending on the used action verb.
- var tool_just_set = _set_tool_and_action(obj, default_action)
- var need_combine = _check_item_needs_combine()
-
- # If the current tool was not set, this is our first item, make it the tool
- if not current_tool or (current_tool and not need_combine):
- current_tool = obj
- #Â Else, if we have a tool and combination required, this is our second item,
- # make it the target.
- elif need_combine and not tool_just_set:
- current_target = obj
-
- # Update the action input state
- if action_state == ACTION_INPUT_STATE.AWAITING_TARGET_ITEM and current_target:
- set_action_input_state(ACTION_INPUT_STATE.COMPLETED)
- elif action_state == ACTION_INPUT_STATE.AWAITING_ITEM and \
- not need_combine:
- set_action_input_state(ACTION_INPUT_STATE.COMPLETED)
- elif action_state == ACTION_INPUT_STATE.AWAITING_ITEM and need_combine and not tool_just_set:
- set_action_input_state(ACTION_INPUT_STATE.AWAITING_TARGET_ITEM)
-
- var event_to_queue: ESCEvent = null
-
- # Manage exits
- if obj.node.is_exit and current_action in ["", ACTION_WALK]:
- event_to_queue = _get_event_to_queue(ACTION_EXIT_SCENE, obj)
- else:
- # Manage movements towards object before activating it
- if current_action in ["", ACTION_WALK] and \
- not escoria.inventory_manager.inventory_has(obj.global_id):
- event_to_queue = _get_event_to_queue(ACTION_ARRIVED, obj)
- # Manage action on object
- elif not current_action in ["", ACTION_WALK]:
- if need_combine and current_target:
- event_to_queue = _get_event_to_queue(
- current_action,
- current_tool,
- current_target
- )
- else:
- # Check if object must be in inventory to be used and update
- # action state if necessary
- if obj.node.use_from_inventory_only and \
- escoria.inventory_manager.inventory_has(obj.global_id) and \
- need_combine:
-
- # We're missing a target here for our tool to be used on
- current_tool = obj
- set_action_input_state(
- ACTION_INPUT_STATE.AWAITING_TARGET_ITEM
- )
-
- # We need to wait for that target
- return
- else:
- event_to_queue = _get_event_to_queue(
- current_action,
- obj
- )
-
- # Get out of here if there's a specified action but an event couldn't be found.
- # Note that `event_to_queue` may still be null, but we do need to start the
- # player walking towards the destination.
- if current_action and not event_to_queue:
- clear_current_action()
- emit_signal("action_finished")
- return
-
- var event_flags = event_to_queue.flags if event_to_queue else 0
-
- if escoria.main.current_scene.player:
- var destination_position: Vector2 = escoria.main.current_scene.player \
- .global_position
-
- #Â If clicked object not in inventory, player walks towards it
- if not obj.node is ESCPlayer and \
- not escoria.inventory_manager.inventory_has(obj.global_id) and \
- not event_flags & ESCEvent.FLAG_TK:
- var context = _walk_towards_object(
- obj,
- event.position,
- event.doubleclick
- )
-
- if context is GDScriptFunctionState:
- context = yield(context, "completed")
-
- # In case of an interrupted walk, we don't want to proceed.
- if context == null:
- return
-
- destination_position = context.target_position
- dont_interact = context.dont_interact_on_arrival
-
- var player_global_pos = escoria.main.current_scene.player.global_position
- var clicked_position = event.position
-
- # Using this instead of is_equal_approx due to
- # https://github.com/godotengine/godot/issues/65257
- if (player_global_pos - destination_position).length() > 1:
- dont_interact = true
- escoria.logger.info(
- self,
- "Player could not reach destination coordinates %s. " % str(destination_position) \
- + "Any requested action for %s will not fire." % obj.global_id
- )
- if escoria.event_manager.EVENT_CANT_REACH in obj.events:
- escoria.event_manager.queue_event(obj.events[escoria.event_manager.EVENT_CANT_REACH])
- else:
- escoria.logger.info(
- self,
- "%s event not found for object %s so nothing to do." % \
- [escoria.event_manager.EVENT_CANT_REACH, obj.global_id]
- )
-
- # If no interaction should happen after player has arrived, leave
- # immediately.
- if not dont_interact and event_to_queue:
- _run_event(event_to_queue)
-
-
-# Determines whether the object in question can be acted upon.
-#
-# #### Parameters
-#
-# - global_id: the global ID of the item to examine
-#
-# *Returns* True iff the item represented by global_id can be acted upon.
-func is_object_actionable(global_id: String) -> bool:
- var obj: ESCObject = escoria.object_manager.get_object(global_id) as ESCObject
-
- return _is_object_actionable(obj)
-
-
-# Prepare the "obj" object for current_action: if required, set the object as
-# current tool.
-#
-# #### Parameters
-#
-# - obj: the ESCObject to prepare
-# - default_action: if true, the default action set on the item is used
-#
-# *Returns* True if the tool was set in this function
-func _set_tool_and_action(obj: ESCObject, default_action: bool):
- var tool_just_set: bool = false
- # Check if current_action and current_tool are already set
- if current_action and current_tool:
- if not current_action in escoria.action_manager\
- .current_tool.node.combine_when_selected_action_is_in:
- current_tool = obj
- tool_just_set = true
- elif default_action:
- if escoria.inventory_manager.inventory_has(obj.global_id):
- current_action = obj.node.default_action_inventory
- else:
- current_action = obj.node.default_action
- elif current_action in obj.node.combine_when_selected_action_is_in:
- current_tool = obj
- tool_just_set = true
- return tool_just_set
-
-
-# Checks if object requires a combination with another, according to
-# currently selected action verb (or check with default action of the item).
-#
-# *Returns* True if current action on "obj" requires a combination
-func _check_item_needs_combine() -> bool:
- return current_action \
- and current_tool \
- and current_action in current_tool.node.combine_when_selected_action_is_in
-
-
-# Makes the player character walk towards the clicked item.
-# Returns the resulting walk context.
-#
-# #### Parameters
-#
-# - obj: the object that was clicked
-# - clicked_position: the Position2D of the input click
-#Â - walk_fast: if true, the player will walk fast to the object
-func _walk_towards_object(
- obj: ESCObject,
- clicked_position: Vector2,
- walk_fast: bool
-) -> ESCWalkContext:
- var destination_position: Vector2
- var dont_interact: bool = false
-
- if obj == null || obj.node == null:
- escoria.logger.error(
- self,
- "walk_towards_object error. obj or obj.node not populated."
- )
- var interact_position = obj.node.get_interact_position()
- #Â If clicked object is interactive, get destination position from it.
- if escoria.object_manager.get_object(obj.global_id).interactive:
- if interact_position != null:
- destination_position = interact_position
- else:
- destination_position = obj.node.position
- else:
- destination_position = clicked_position
- dont_interact = true
-
- # Create walk context
- var walk_context = ESCWalkContext.new(
- obj,
- destination_position,
- walk_fast,
- dont_interact
- )
-
- # Walk towards the clicked object
- escoria.main.current_scene.player.walk_to(destination_position,
- walk_context)
-
- escoria.logger.debug(
- self,
- "Player walking to destination. Yielding."
-)
-
- # Wait for the player to arrive before continuing with action.
- var context: ESCWalkContext = yield(
- escoria.main.current_scene.player,
- "arrived"
- )
-
- if context.target_object != obj:
- escoria.logger.debug(
- self,
- "Original walk context target does not match " \
- + "yielded walk context. Likely interrutped walk.")
- return
-
- escoria.logger.info(
- self,
- "Context arrived: %s." % context
- )
-
- # Confirm that reached item was the one user clicked in the first place.
- # Don't interact if that is not the case.
- if (context.target_object and context.target_object.\
- global_id != walk_context.\
- target_object.global_id) or \
- (context.target_position != walk_context.target_position):
- walk_context.dont_interact_on_arrival = true
-
- return context
-
-
-# Determines whether the object in question can be acted upon.
-#
-# #### Parameters
-#
-# - obj: the ESCObject to examine
-#
-# *Returns* True iff 'obj' can be acted upon.
-func _is_object_actionable(obj: ESCObject) -> bool:
- var object_is_actionable: bool = true
-
- if not obj:
- return false
-
- if not obj.active:
- escoria.logger.trace(
- self,
- "Item %s is not active." % obj.global_id
- )
- object_is_actionable = false
- elif not obj.interactive:
- escoria.logger.trace(
- self,
- "Item %s is not interactive." % obj.global_id
- )
- object_is_actionable = false
-
- return object_is_actionable
diff --git a/addons/escoria-core/game/core-scripts/esc/esc_command_registry.gd b/addons/escoria-core/game/core-scripts/esc/esc_command_registry.gd
deleted file mode 100644
index 6b5aabf1..00000000
--- a/addons/escoria-core/game/core-scripts/esc/esc_command_registry.gd
+++ /dev/null
@@ -1,48 +0,0 @@
-# A registry of ESC command objects
-extends Reference
-class_name ESCCommandRegistry
-
-
-# The registry of registered commands
-var registry: Dictionary = {}
-
-
-# Load a command by its name
-#
-# #### Parameters
-#
-# - command_name: Name of command to load
-# **Returns** The command object
-func load_command(command_name: String) -> ESCBaseCommand:
- for command_directory in ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.COMMAND_DIRECTORIES
- ):
- if ResourceLoader.exists("%s/%s.gd" % [command_directory, command_name]):
- registry[command_name] = load(
- "%s/%s.gd" % [
- command_directory.trim_suffix("/"),
- command_name
- ]
- ).new()
- return registry[command_name]
-
- escoria.logger.error(
- self,
- "No command class could be found for command %s."
- % command_name
- )
-
- return null
-
-
-# Retrieve a command from the command registry
-#
-# #### Parameters
-#
-# - command_name: The name of the command
-# **Returns** The command object
-func get_command(command_name: String) -> ESCBaseCommand:
- if self.registry.has(command_name):
- return self.registry[command_name]
- else:
- return self.load_command(command_name)
diff --git a/addons/escoria-core/game/core-scripts/esc/esc_compiler.gd b/addons/escoria-core/game/core-scripts/esc/esc_compiler.gd
deleted file mode 100644
index 189d3c68..00000000
--- a/addons/escoria-core/game/core-scripts/esc/esc_compiler.gd
+++ /dev/null
@@ -1,291 +0,0 @@
-# Compiler of the ESC language
-extends Resource
-class_name ESCCompiler
-
-
-# A RegEx for comment lines
-const COMMENT_REGEX = '^\\s*#.*$'
-
-# A RegEx for empty lines
-const EMPTY_REGEX = '^\\s*$'
-
-# A RegEx for finding out the indent of a line
-const INDENT_REGEX_GROUP = "indent"
-const INDENT_REGEX = '^(?<%s>\\s*)' % INDENT_REGEX_GROUP
-
-# This must match ESCProjectSettingsManager.COMMAND_DIRECTORIES.
-# We do not reference it directly to avoid circular dependencies.
-const COMMAND_DIRECTORIES = "escoria/main/command_directories"
-
-# RegEx objects for use by the ESC compiler
-var _comment_regex
-var _empty_regex
-var _indent_regex
-var _event_regex
-var _command_regex
-var _dialog_regex
-var _dialog_end_regex
-var _dialog_option_regex
-var _group_regex
-# Regex to match globals in debug strings
-var _globals_regex: RegEx
-
-# The currently compiled event
-var _current_event = null
-
-# A stack of groups currently compiling
-var _groups_stack = []
-
-# A stack of dialogs currently compiling
-var _dialogs_stack = []
-
-# A stack of dialog options currently compiling
-var _dialogs_option_stack = []
-
-# A pointer to the current container (group, dialog option)
-# that should get the current command
-var _command_container = []
-
-# The currently identified indent
-var _current_indent = 0
-
-
-func _init():
- # Assure command list preference
- # (we use ProjectSettings instead of ESCProjectSettingsManager
- # here because this is called from escoria._init())
- if not ProjectSettings.has_setting(COMMAND_DIRECTORIES):
- ProjectSettings.set_setting(COMMAND_DIRECTORIES, [
- "res://addons/escoria-core/game/core-scripts/esc/commands"
- ])
- var property_info = {
- "name": COMMAND_DIRECTORIES,
- "type": TYPE_STRING_ARRAY
- }
- ProjectSettings.add_property_info(property_info)
-
- # Compile all regex objects just once
- _comment_regex = RegEx.new()
- _comment_regex.compile(COMMENT_REGEX)
- _empty_regex = RegEx.new()
- _empty_regex.compile(EMPTY_REGEX)
- _indent_regex = RegEx.new()
- _indent_regex.compile(INDENT_REGEX)
-
- _event_regex = RegEx.new()
- _event_regex.compile(ESCEvent.REGEX)
- _command_regex = RegEx.new()
- _command_regex.compile(ESCCommand.REGEX)
- _dialog_regex = RegEx.new()
- _dialog_regex.compile(ESCDialog.REGEX)
- _dialog_end_regex = RegEx.new()
- _dialog_end_regex.compile(ESCDialog.END_REGEX)
- _dialog_option_regex = RegEx.new()
- _dialog_option_regex.compile(ESCDialogOption.REGEX)
- _group_regex = RegEx.new()
- _group_regex.compile(ESCGroup.REGEX)
- # Use look-ahead/behind to capture the term in braces
- _globals_regex = RegEx.new()
- _globals_regex.compile("(?<=\\{)(.*)(?=\\})")
-
-# Load an ESC file from a file resource
-func load_esc_file(path: String) -> ESCScript:
- escoria.logger.debug(self, "Parsing file %s." % path)
- if File.new().file_exists(path):
- var file = File.new()
- file.open(path, File.READ)
- var lines = []
- while not file.eof_reached():
- lines.append(file.get_line())
- return self.compile(lines, path)
- else:
- escoria.logger.error(
- self,
- "Can not find ESC file: file %s could not be found." % path
- )
- return null
-
-
-# Compiles an array of ESC script strings to an ESCScript
-func compile(lines: Array, path: String = "") -> ESCScript:
- var script = ESCScript.new()
-
- if lines.size() > 0:
- var events = self._compile(lines, path)
- for event in events:
- event.source = path
- script.events[event.name] = event
-
- return script
-
-
-# Compile an array of ESC script lines into an array of ESC objects
-func _compile(lines: Array, path: String = "") -> Array:
- var returned = []
-
- while lines.size() > 0:
- var line = lines.pop_front().strip_edges(false, true)
- escoria.logger.trace(
- self,
- "Parsing line %s." % line
- )
- if _comment_regex.search(line) or _empty_regex.search(line):
- # Ignore comments and empty lines
- escoria.logger.trace(
- self,
- "Line is empty or a comment. Skipping."
- )
- continue
- var indent = \
- ESCUtils.get_re_group(
- _indent_regex.search(line),
- INDENT_REGEX_GROUP
- ).length()
-
- if _event_regex.search(line):
- var event = ESCEvent.new(line)
- escoria.logger.trace(
- self,
- "Line is the event %s." % event.name
- )
- var event_lines = []
- while lines.size() > 0:
- var next_line = lines.pop_front()
- if not _event_regex.search(next_line):
- event_lines.append(next_line)
- else:
- lines.push_front(next_line)
- break
- if event_lines.size() > 0:
- escoria.logger.trace(
- self,
- "Compiling the next %d lines into the event." % \
- event_lines.size()
- )
- event.statements = self._compile(event_lines, path)
- returned.append(event)
- elif _group_regex.search(line):
- var group = ESCGroup.new(line)
- escoria.logger.trace(
- self,
- "Line is a group."
- )
- var group_lines = []
- while lines.size() > 0:
- var next_line = lines.pop_front()
- if _comment_regex.search(next_line) or \
- _empty_regex.search(next_line):
- continue
- var next_line_indent = \
- ESCUtils.get_re_group(
- _indent_regex.search(next_line),
- INDENT_REGEX_GROUP
- ).length()
- if next_line_indent > indent:
- group_lines.append(next_line)
- else:
- lines.push_front(next_line)
- break
- if group_lines.size() > 0:
- escoria.logger.trace(
- self,
- "Compiling the next %d lines into the group." % \
- group_lines.size()
- )
- group.statements = self._compile(group_lines, path)
- returned.append(group)
- elif _dialog_regex.search(line):
- var dialog = ESCDialog.new()
- dialog.load_string(line)
- escoria.logger.trace(
- self,
- "Line is a dialog."
- )
- var dialog_lines = []
- while lines.size() > 0:
- var next_line = lines.pop_front()
- if _comment_regex.search(next_line) or \
- _empty_regex.search(next_line):
- continue
- var end_line = _dialog_end_regex.search(next_line)
- if end_line and \
- ESCUtils.get_re_group(
- end_line,
- INDENT_REGEX_GROUP
- ).length() == indent:
- break
- else:
- dialog_lines.append(next_line)
- if dialog_lines.size() > 0:
- escoria.logger.trace(
- self,
- "Compiling the next %d lines into the dialog." % \
- dialog_lines.size()
- )
- dialog.options = self._compile(dialog_lines, path)
- # Remove the end line from the stack
- lines.pop_front()
- returned.append(dialog)
- elif _dialog_option_regex.search(line):
- var dialog_option = ESCDialogOption.new()
- dialog_option.load_string(line)
- escoria.logger.trace(
- self,
- "Line is the dialog option %s." % \
- dialog_option.option
- )
- var dialog_option_lines = []
- while lines.size() > 0:
- var next_line = lines.pop_front()
- if _comment_regex.search(next_line) or \
- _empty_regex.search(next_line):
- continue
- var next_line_indent = \
- ESCUtils.get_re_group(
- _indent_regex.search(next_line),
- INDENT_REGEX_GROUP
- ).length()
- if next_line_indent > indent:
- dialog_option_lines.append(next_line)
- else:
- if _dialog_end_regex.search(next_line) or \
- _dialog_option_regex.search(next_line):
- lines.push_front(next_line)
- break
-
- # There MUST be AT LEAST ONE statement/line for a dialog
- # option's block that's properly indented
- escoria.logger.error(
- self,
- "Dialog option '%s' has at least one line in its block that is not indented sufficiently." \
- % line
- )
- if dialog_option_lines.size() > 0:
- escoria.logger.trace(
- self,
- "Compiling the next %d lines into the event."
- % dialog_option_lines.size()
- )
- dialog_option.statements = self._compile(dialog_option_lines, path)
- returned.append(dialog_option)
- elif _command_regex.search(line):
- var command = ESCCommand.new(line)
- if command.command_exists():
- returned.append(command)
- else:
- escoria.logger.error(
- self,
- "Command \"%s\" cannot be found under folder %s.\nPlease confirm setting \"%s\" is set to the folder where ESC commands are stored."
- % [
- command.name,
- ProjectSettings.get_setting(COMMAND_DIRECTORIES),
- ESCProjectSettingsManager.COMMAND_DIRECTORIES
- ]
- )
- else:
- escoria.logger.error(
- self,
- "Invalid ESC line detected.\nLine couldn't be compiled: %s."
- % line
- )
- return returned
diff --git a/addons/escoria-core/game/core-scripts/esc/esc_event_manager.gd b/addons/escoria-core/game/core-scripts/esc/esc_event_manager.gd
deleted file mode 100644
index 926419d3..00000000
--- a/addons/escoria-core/game/core-scripts/esc/esc_event_manager.gd
+++ /dev/null
@@ -1,478 +0,0 @@
-# A manager for running events
-# There are different "channels" an event can run on.
-# The usual events happen in the foreground channel _front, but
-# additional event queues can be added as required.
-# Additionally, events can be scheduled to be queued in the future
-extends Node
-class_name ESCEventManager
-
-
-# Emitted when the event started execution
-signal event_started(event_name)
-
-# Emitted when an event is started in a channel of the background queue
-signal background_event_started(channel_name, event_name)
-
-# Emitted when the event did finish running
-signal event_finished(return_code, event_name)
-
-# Emitted when a background event was finished
-signal background_event_finished(return_code, event_name, channel_name)
-
-
-# Pre-defined ESC events
-const EVENT_PRINT = "print"
-const EVENT_EXIT_SCENE = "exit_scene"
-const EVENT_INIT = "init"
-const EVENT_LOAD = "load"
-const EVENT_NEW_GAME = "newgame"
-const EVENT_READY = "ready"
-const EVENT_ROOM_SELECTOR = "room_selector"
-const EVENT_SETUP = "setup"
-const EVENT_TRANSITION_IN = "transition_in"
-const EVENT_TRANSITION_OUT = "transition_out"
-const EVENT_CANT_REACH = "cant_reach"
-
-
-# Event channel names
-const CHANNEL_FRONT = "_front"
-
-
-# A list of currently scheduled events
-var scheduled_events: Array = []
-
-# A list of constantly running events in multiple background channels
-var events_queue: Dictionary = {
- CHANNEL_FRONT: []
-}
-
-# Currently running event in background channels
-var _running_events: Dictionary = {}
-
-# Whether an event can be played on a specific channel
-var _channels_state: Dictionary = {}
-
-# Whether we're currently waiting for an async event to complete, per channel
-var _yielding: Dictionary = {}
-
-# Whether we're currently changing the scene.
-var _changing_scene: bool = false setget set_changing_scene
-
-# ESC "change_scene" command.
-var _change_scene: ChangeSceneCommand
-
-
-# Constructor
-func _init():
- _change_scene = ChangeSceneCommand.new()
-
-
-# Make sure to stop when pausing the game
-func _ready():
- self.pause_mode = Node.PAUSE_MODE_STOP
-
-
-# Handle the events queue and scheduled events
-#
-# #### Parameters
-# - delta: Time passed since the last process call
-func _process(delta: float) -> void:
- var channel_yielding: bool
-
- for channel_name in events_queue.keys():
- channel_yielding = _yielding.get(channel_name, false)
-
- if events_queue[channel_name].size() == 0 or channel_yielding:
- continue
- if is_channel_free(channel_name):
- _channels_state[channel_name] = false
- _running_events[channel_name] = \
- events_queue[channel_name].pop_front()
- escoria.logger.debug(
- self,
- "Popping event '%s' from background queue %s " % [
- _running_events[channel_name].name,
- channel_name,
- ] +
- "to source %s." % _running_events[channel_name].source \
- if not _running_events[channel_name].source.empty()
- else "(unknown)"
- )
- if not _running_events[channel_name].is_connected(
- "finished", self, "_on_event_finished"
- ):
- _running_events[channel_name].connect(
- "finished",
- self,
- "_on_event_finished",
- [channel_name],
- CONNECT_ONESHOT
- )
- if not _running_events[channel_name].is_connected(
- "interrupted", self, "_on_event_finished"
- ):
- _running_events[channel_name].connect(
- "interrupted",
- self,
- "_on_event_finished",
- [channel_name],
- CONNECT_ONESHOT
- )
-
- if channel_name == CHANNEL_FRONT:
- emit_signal(
- "event_started",
- _running_events[channel_name].name
- )
- else:
- emit_signal(
- "background_event_started",
- channel_name,
- _running_events[channel_name].name
- )
-
- var event_flags = _running_events[channel_name].flags
- if event_flags & ESCEvent.FLAG_NO_TT:
- escoria.main.current_scene.game.tooltip_node.hide()
-
- if event_flags & ESCEvent.FLAG_NO_UI:
- escoria.main.current_scene.game.hide_ui()
-
- if event_flags & ESCEvent.FLAG_NO_SAVE:
- escoria.save_manager.save_enabled = false
-
- var rc = _running_events[channel_name].run()
-
- if rc is GDScriptFunctionState:
- _yielding[channel_name] = true
- rc = yield(rc, "completed")
- _yielding[channel_name] = false
-
- for event in self.scheduled_events:
- (event as ESCScheduledEvent).timeout -= delta
- if (event as ESCScheduledEvent).timeout <= 0:
- self.scheduled_events.erase(event)
- self.events_queue[CHANNEL_FRONT].append(event.event)
-
-
-# Queue a new event based on input from an ESC command, most likely "queue_event"
-#
-# #### Parameters
-# - script_object: Compiled script object, i.e. the one with the event to queue
-# - event: Name of the event to queue
-# - channel: Channel to run the event on (default: `_front`)
-# - block: Whether to wait for the queue to finish. This is only possible, if
-# the queued event is not to be run on the same event as this command
-# (default: `false`)
-#
-# **Returns** indicator of success/status
-func queue_event_from_esc(script_object: ESCScript, event: String,
- channel: String, block: bool) -> int:
-
- if _changing_scene:
- return ESCExecution.RC_WONT_QUEUE
-
- if channel == CHANNEL_FRONT:
- queue_event(script_object.events[event])
- else:
- queue_background_event(
- channel,
- script_object.events[event]
- )
- if block:
- if channel == CHANNEL_FRONT:
- var rc = yield(self, "event_finished")
- while rc[1] != event:
- rc = yield(self, "event_finished")
- return rc[0]
- else:
- var rc = yield(self, "background_event_finished")
- while rc[1] != event and rc[2] != channel:
- rc = yield(self, "background_event_finished")
- return rc[0]
-
- return ESCExecution.RC_OK
-
-
-# Queue a new event to run in the foreground
-#
-# #### Parameters
-# - event: Event to run
-func queue_event(event: ESCEvent, force: bool = false) -> void:
- if _changing_scene and not force:
- escoria.logger.info(
- self,
- "Changing scenes. Won't queue event '%s'." % event.name
- )
- return
-
- # Don't queue the same event more than once in a row.
- var last_event = _get_last_event_queued(CHANNEL_FRONT)
-
- # Check the queue first to see if appending the event will result in
- # consecutive occurrences of the event. If not, be sure to check if the same
- # event is currently running.
- if last_event != null and last_event.name == event.name:
- var message = "Event '%s' is already the most-recently queued event in channel '%s'." + \
- " Won't be queued again."
-
- escoria.logger.debug(self, message % [event.name, CHANNEL_FRONT])
- return
- elif _is_event_running(event, CHANNEL_FRONT):
- # Don't queue the same event if it's already running.
- escoria.logger.debug(
- self,
- "Event %s already running in channel '%s'. Won't be queued."
- % [event.name, CHANNEL_FRONT]
- )
-
- return
-
- escoria.logger.debug(
- self,
- "Queueing event %s in channel %s." % [event.name, CHANNEL_FRONT]
- )
- self.events_queue[CHANNEL_FRONT].append(event)
-
-
-# Schedule an event to run after a timeout
-#
-# #### Parameters
-# - event: Event to run
-# - timeout: Number of seconds to wait before adding the event to the
-# front queue
-func schedule_event(event: ESCEvent, timeout: float) -> void:
- scheduled_events.append(ESCScheduledEvent.new(event, timeout))
-
-
-# Queue the run of an event in a background channel
-#
-# #### Parameters
-# - channel_name: Name of the channel to use
-# - event: Event to run
-func queue_background_event(channel_name: String, event: ESCEvent) -> void:
- if not channel_name in events_queue:
- events_queue[channel_name] = []
-
- # Don't queue the same event more than once in a row.
- var last_event = _get_last_event_queued(channel_name)
-
- # Check the queue first to see if appending the event will result in
- # consecutive occurrences of the event. If not, be sure to check if the same
- # event is currently running.
- if last_event != null and last_event.name == event.name:
- var message = "Event '%s' is already the most-recently queued event in channel '%s'." + \
- " Won't be queued again."
-
- escoria.logger.debug(self, message % [event.name, channel_name])
- return
- elif _is_event_running(event, CHANNEL_FRONT):
- # Don't queue the same event if it's already running.
- escoria.logger.debug(
- self,
- "Event %s already running in channel '%s'. Won't be queued."
- % [event.name, channel_name]
- )
-
- return
-
- events_queue[channel_name].append(event)
-
-
-# Interrupt the events currently running and any that are pending.
-#
-# #### Parameters
-# - exceptions: an optional list of events which should be left running or queued
-func interrupt(exceptions: PoolStringArray = []) -> void:
- if escoria.main.current_scene != null \
- and escoria.main.current_scene.player != null \
- and escoria.main.current_scene.player.is_moving():
- escoria.main.current_scene.player.stop_walking_now()
-
- for channel_name in _running_events.keys():
- if _running_events[channel_name] != null and not _running_events[channel_name].name in exceptions:
- escoria.logger.debug(
- self,
- "Interrupting running event %s in channel %s..."
- % [_running_events[channel_name].name, channel_name])
- _running_events[channel_name].interrupt()
- _channels_state[channel_name] = true
-
- var events_to_clear: Array = []
-
- for channel_name in events_queue.keys():
- if events_queue[channel_name] != null:
- var found_exception: bool = false
-
- for event in events_queue[channel_name]:
- if event.name in exceptions:
- found_exception = true
- continue
-
- escoria.logger.debug(
- self,
- "Interrupting queued event %s in channel %s..."
- % [event.name, channel_name])
- event.interrupt()
- events_to_clear.append(event)
-
- # If we found an exception, we can't just clear out the entire
- # channel's queue and so we remove everything but the exceptions in
- # the channel. Otherwise, we're safe to just clear it out.
- if found_exception:
- for event in events_to_clear:
- if events_queue[channel_name].has(event):
- events_queue[channel_name].erase(event)
- else:
- events_queue[channel_name].clear()
-
-
-# Clears the event queues.
-func clear_event_queue():
- for channel_name in events_queue.keys():
- events_queue[channel_name].clear()
-
-
-# Check whether a channel is free to run more events
-#
-# #### Parameters
-# - name: Name of the channel to test
-# **Returns** Whether the channel can currently accept a new event
-func is_channel_free(name: String) -> bool:
- return _channels_state[name] if name in _channels_state else true
-
-
-# Get the currently running event in a channel
-#
-# #### Parameters
-# - name: Name of the channel
-# **Returns** The currently running event or null
-func get_running_event(name: String) -> ESCEvent:
- return _running_events[name] if name in _running_events else null
-
-
-# Setter for _changing_scene.
-#
-# #### Parameterse
-# - value: boolean value to set _changing_scene to
-func set_changing_scene(p_is_changing_scene: bool) -> void:
- escoria.logger.trace(
- self,
- "Setting _changing_scene to %s." % p_is_changing_scene
- )
-
- _changing_scene = p_is_changing_scene
-
- # If we're changing scenes, interrupt any (other) running events and purge
- # all event queues.
- if _changing_scene:
- interrupt([EVENT_INIT, EVENT_EXIT_SCENE, _change_scene.get_command_name()])
-
-
-# The event finished running
-#
-# #### Parameters
-# - finished_event: statement object representing the event that finished
-# - finished_statement: statement object representing the "deepest" statement (most likely a command)
-# that just completed; this is useful for interrupted or failed statements especially
-# - return_code: Return code of the finished event
-# - channel_name: Name of the channel that the event came from
-func _on_event_finished(finished_event: ESCStatement, finished_statement: ESCStatement, return_code: int, channel_name: String) -> void:
- var event = _running_events[channel_name]
- if not event:
- escoria.logger.warn(
- self,
- "Event '%s' finished without being in _running_events[%s]."
- % [finished_event.name, channel_name]
- )
- return
-
- escoria.logger.debug(
- self,
- "Event '%s' ended with return code %d." % [event.name, return_code]
- )
-
- var event_flags = event.flags
- if event_flags & ESCEvent.FLAG_NO_TT:
- escoria.main.current_scene.game.tooltip_node.show()
-
- if event_flags & ESCEvent.FLAG_NO_UI:
- escoria.main.current_scene.game.show_ui()
-
- if event_flags & ESCEvent.FLAG_NO_SAVE:
- escoria.save_manager.save_enabled = true
-
- # If the return code was RC_CANCEL due to an event finishing with "stop" command for example
- # we convert it to RC_OK so that other processed waiting for RC_OK can carry on.
- #
- # We also make sure that a failed command/event doesn't leave the game in a state where it
- # isn't accepting inputs, e.g. if a previous command in the event was `accept_input NONE`.
- if return_code == ESCExecution.RC_CANCEL:
- return_code = ESCExecution.RC_OK
- elif return_code == ESCExecution.RC_ERROR:
- _generate_statement_error_warning(finished_statement, event.name)
-
- escoria.inputs_manager.input_mode = escoria.inputs_manager.INPUT_ALL
-
- _running_events[channel_name] = null
- _channels_state[channel_name] = true
-
- if channel_name == CHANNEL_FRONT:
- emit_signal(
- "event_finished",
- return_code,
- event.name
- )
- else:
- emit_signal(
- "background_event_finished",
- return_code,
- event.name,
- channel_name
- )
-
-
-# Gets the event at the tail of the specified channel's event queue, if one
-# exists.
-#
-# #### Parameters
-# - channel_name: The name of the channel to check.
-#
-# *Returns* the last ESCEvent queued for the given channel, or null if the
-# channel's queue is empty.
-func _get_last_event_queued(channel_name: String) -> ESCEvent:
- if self.events_queue[channel_name].size() > 0:
- return self.events_queue[channel_name].back()
-
- return null
-
-
-# Checks to see if the specified event is already running in the given channel.
-#
-# #### Parameters
-# - event: The event to check to see if it's already running.
-# - channel_name: The name of the channel to check.
-#
-# *Returns* true iff event is currently running in the specified channel.
-func _is_event_running(event: ESCEvent, channel_name: String) -> bool:
- var running_event: ESCEvent = get_running_event(channel_name)
-
- return running_event != null and running_event.name == event.name
-
-
-# Generates a logger warning concerning an errored-out statement.
-func _generate_statement_error_warning(statement: ESCStatement, event_name: String) -> void:
- var warning_string: String = "Statement '%s' returned an error in event '%s'" \
- % [statement.name, event_name]
-
- if statement is ESCCommand and statement.parameters.size() > 0:
- var statement_params: String = "[" + PoolStringArray(statement.parameters).join(", ") + "]"
-
- warning_string += " with parameters: %s" % statement_params
-
- warning_string += ". Resetting input mode to 'ALL'."
-
- escoria.logger.warn(
- self,
- warning_string
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/esc_globals_manager.gd b/addons/escoria-core/game/core-scripts/esc/esc_globals_manager.gd
deleted file mode 100644
index 4458a2c1..00000000
--- a/addons/escoria-core/game/core-scripts/esc/esc_globals_manager.gd
+++ /dev/null
@@ -1,149 +0,0 @@
-# A resource that manages the ESC global states
-# The ESC global state is basically simply a dictionary of keys with
-# values. Values can be bool, integer or strings
-extends Resource
-class_name ESCGlobalsManager
-
-
-# Emitted when a global is changed
-signal global_changed(global, old_value, new_value)
-
-
-# The globals registry
-export(Dictionary) var _globals = {}
-
-
-# Registry of globals that are to be reserved for internal use only.
-var _reserved_globals: Dictionary = {}
-
-# Use look-ahead/behind to capture the term in braces
-var globals_regex: RegEx = RegEx.new()
-
-# Constructor
-func _init():
- globals_regex.compile("(?<=\\{)(.*)(?=\\})")
-
-
-# Check if a global was registered
-#
-# #### Parameters
-#
-# - key: The global key to check
-# **Returns** Whether the global was registered
-func has(key: String) -> bool:
- return _globals.has(key)
-
-
-# Registers a global as being reserved and initializes it.
-#
-# #### Parameters
-#
-# - key: The key of the global to register
-# - value: The initial value (optional)
-func register_reserved_global(key: String, value = null) -> void:
- if key in _reserved_globals:
- escoria.logger.error(
- self,
- "Can not override reserved global: Global key %s is already " +
- "registered as reserved."
- % key
- )
- var old_value = _globals[key] if _globals.has(key) else ""
- _reserved_globals[key] = value
- _globals[key] = value
-
- if value != null:
- emit_signal("global_changed", key, old_value, _globals[key])
-
-
-# Get the current value of a global
-#
-# #### Parameters
-#
-# - key: The key of the global to return the value
-# **Returns** The value of the global
-func get_global(key: String):
- if _globals.has(key):
- return _globals[key]
- return null
-
-
-# Filter the globals and return all matching keys and their values as
-# a dictionary
-# Check out [the Godot docs](https://docs.godotengine.org/en/stable/classes/class_string.html#class-string-method-match)
-# for the pattern format
-#
-# #### Parameters
-#
-# - pattern: The pattern that the keys have to match
-# **Returns** A dictionary of matching keys and their values
-func filter(pattern: String) -> Dictionary:
- var ret = {}
- for global_key in _globals.keys():
- if global_key.match(pattern):
- ret[global_key] = _globals[global_key]
- return ret
-
-
-# Set the value of a global
-#
-# #### Parameters
-#
-# - key: The key of the global to modify
-# - value: The new value
-func set_global(key: String, value, ignore_reserved: bool = false) -> void:
- if key in _reserved_globals and not ignore_reserved:
- escoria.logger.error(
- self,
- "Global key %s is reserved and can not be overridden." % key
- )
-
- emit_signal(
- "global_changed",
- key,
- _globals[key] if _globals.has(key) else null,
- value
- )
- _globals[key] = value
-
-
-# Set all globals that match the pattern to the value
-# Check out [the Godot docs](https://docs.godotengine.org/en/stable/classes/class_string.html#class-string-method-match)
-# for the pattern format
-#
-# #### Parameters
-#
-# - pattern: The wildcard pattern to match
-# - value: The new value
-func set_global_wildcard(pattern: String, value) -> void:
- for global_key in _globals.keys:
- if global_key.match(pattern):
- self.set_global(global_key, value)
-
-
-# Look to see if any globals (names in braces) should be interpreted
-#
-# #### Parameters
-#
-# * string: Text in which to replace globals
-#
-# *Returns* the provided string with globals variables replaced with their values
-func replace_globals(string: String) -> String:
- for result in globals_regex.search_all(string):
- var globresult = escoria.globals_manager.get_global(
- str(result.get_string())
- )
- string = string.replace(
- "{" + result.get_string() + "}", str(globresult)
- )
- return string
-
-
-# Save the state of globals in the savegame.
-#
-# #### Parameters
-# - p_savegame: ESCSaveGame resource that holds all data of the save
-func save_game(p_savegame: ESCSaveGame) -> void:
- p_savegame.globals = {}
- for g in _globals:
- p_savegame.globals[g] = _globals[g]
diff --git a/addons/escoria-core/game/core-scripts/esc/esc_inventory_manager.gd b/addons/escoria-core/game/core-scripts/esc/esc_inventory_manager.gd
deleted file mode 100644
index 28958518..00000000
--- a/addons/escoria-core/game/core-scripts/esc/esc_inventory_manager.gd
+++ /dev/null
@@ -1,49 +0,0 @@
-# A manager for inventory objects
-extends Resource
-class_name ESCInventoryManager
-
-
-# Check if the player has an inventory item
-#
-# #### Parameters
-#
-# - item: Inventory item id
-# **Returns** Whether the player has the inventory
-func inventory_has(item: String) -> bool:
- return escoria.globals_manager.has("i/%s" % item)
-
-
-# Get all inventory items
-# **Returns** The items in the inventory
-func items_in_inventory() -> Array:
- var items = []
- var filtered = escoria.globals_manager.filter("i/*")
- for glob in filtered.keys():
- if filtered[glob]:
- items.append(glob.rsplit("i/", false)[0])
- return items
-
-
-# Remove an item from the inventory
-#
-# #### Parameters
-#
-# - item: Inventory item id
-func remove_item(item: String):
- if not inventory_has(item):
- escoria.logger.error(
- self,
- "Error removing inventory item: " +
- "Trying to remove non-existent item %s." % item
- )
- else:
- escoria.globals_manager.set_global("i/%s" % item, false)
-
-
-# Add an item to the inventory
-#
-# #### Parameters
-#
-# - item: Inventory item id
-func add_item(item: String):
- escoria.globals_manager.set_global("i/%s" % item, true)
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
deleted file mode 100644
index 1ff09932..00000000
--- a/addons/escoria-core/game/core-scripts/esc/esc_object_manager.gd
+++ /dev/null
@@ -1,533 +0,0 @@
-# A manager for ESC objects
-extends Resource
-class_name ESCObjectManager
-
-
-const CAMERA = "_camera"
-const MUSIC = "_music"
-const SOUND = "_sound"
-const SPEECH = "_speech"
-
-const RESERVED_OBJECTS = [
- MUSIC,
- SOUND,
- SPEECH,
-]
-
-
-# The array of registered objects (organized by room, so each entry is a structure
-# representing a room and its registered objects). This also includes one
-# "room" for reserved objects; that is, we use one entry of the array to
-# hold all reserved objects. This entry can be identified by the "is_reserved"
-# property being set to true.
-#
-# "Reserved objects" are those which are named in the RESERVED_OBJECTS const
-# array and include objects that are used internally by Escoria in every room,
-# e.g. a music player, a sound player, a speech player, the main camera.
-#
-# In almost all cases, the reserved objects' entry doesn't need updating once
-# created.
-#
-# Example structure:
-#
-# [
-# {
-# is_reserved: true, # Indicates this is the "reserved objects" entry
-# room: "",
-# room_instance_id: "",
-# objects:
-# {
-# "_camera": camera
-# },
-# },
-# {
-# is_reserved: false, # Indicates this an entry for a room's objectss
-# room_global_id: "",
-# room_instance_id: "",
-# objects:
-# {
-# "obj1": val1,
-# "obj2": val2
-# }
-# }
-# ]
-var room_objects: Array = []
-
-# We also store the current room's ids for retrieving the right objects.
-var current_room_key: ESCRoomObjectsKey
-
-# To avoid having to look this up all the time, we hold a reference.
-var reserved_objects_container: ESCRoomObjects
-
-
-func _init() -> void:
- reserved_objects_container = ESCRoomObjects.new()
- reserved_objects_container.is_reserved = true
- reserved_objects_container.objects = {}
- room_objects.push_back(reserved_objects_container)
-
- current_room_key = ESCRoomObjectsKey.new()
-
-
-# Updates which object manager room is to be treated as the currently active one.
-#
-# #### Parameters
-#
-# - room: Room to register the object with in the object manager
-func set_current_room(room: ESCRoom) -> void:
- if room == null:
- escoria.logger.error(
- self,
- "Unable to set current room: No room was specified.\n" +
- "Please pass in a valid ESCRoom as an argument to the method."
- )
-
- current_room_key.room_global_id = room.global_id
- current_room_key.room_instance_id = room.get_instance_id()
-
-
-# Register the object in the manager
-#
-# #### Parameters
-#
-# - object: Object to register
-# - room: Room to register the object with in the object manager
-# - force: Register the object, even if it has already been registered
-# - auto_unregister: Automatically unregister object on tree_exited
-func register_object(object: ESCObject, room: ESCRoom = null, force: bool = false, \
- auto_unregister: bool = true) -> void:
-
- if object.global_id.empty():
- object.global_id = str(object.node.get_path()).split("/root/", false)[0]
- object.node.global_id = object.global_id
- escoria.logger.warn(
- self,
- "Registering ESCObject %s with empty global_id." % object.node.name +
- "Using node's full path as global_id: %s"
- % object.node.global_id
- )
-
- # If this is a reserved object, let's make sure it's in the right place.
- # Note that we also don't allow it to auto unregister and, as such, we need
- # to make sure we clean these up when the application exits.
- if object.global_id in RESERVED_OBJECTS:
- reserved_objects_container.objects[object.global_id] = object
- return
-
- var room_key: ESCRoomObjectsKey = ESCRoomObjectsKey.new()
-
- # If a room was passed in, then we're going to register the object with it;
- # otherwise, we register the object with the "current room".
- if room == null or room.global_id.empty():
- # We duplicate the key so as to not hold a reference when current_room_key
- # changes.
- if current_room_key.room_global_id.empty():
- escoria.logger.error(
- self,
- "The current room has no Global ID.\n" +
- "Please set the ESCRoom's Global ID property."
- )
- room_key.room_global_id = current_room_key.room_global_id
- room_key.room_instance_id = current_room_key.room_instance_id
-
- if not room_key.is_valid():
- # This condition should very likely never happen.
- escoria.logger.error(
- self,
- "No room was specified to register object with, and no current room is properly set.\n" +
- "Please either pass in a valid ESCRoom to this method, or " + \
- "call set_current_room() with a valid ESCRoom first."
- )
- else:
- room_key.room_global_id = room.global_id
- room_key.room_instance_id = room.get_instance_id()
-
- if not force and _object_exists_in_room(object, room_key) \
- and _object_state_in_room_is_default(object, room_key):
- escoria.logger.warn(
- self,
- "Object with global id '%s' in room %s already registered from node path %s."
- % [
- object.global_id,
- room_key.room_global_id,
- get_object(object.global_id, room).node.get_path()
- ]
- )
- return
- # Object exists in room, set it to is last state (if different from
- # "default")
- elif _object_exists_in_room(object, room_key):
- # Object is already known, set its state to last known state
- object.set_state(get_object(object.global_id).state)
-
- # If the object is already connected, disconnect it for the case of
- # forcing the registration, since we don't know if this object will be
- # overwritten ("forced") in the future and, if it is, if it's set to
- # auto-unregister or not. In most cases, objects are set to auto unregister.
- if object.node.is_connected(
- "tree_exited",
- self,
- "unregister_object"
- ):
- object.node.disconnect(
- "tree_exited",
- self,
- "unregister_object"
- )
-
- if force:
- # If this ID already exists and we're about to overwrite it, do the
- # safe thing and unregister the old object first
- unregister_object_by_global_id(object.global_id, room_key)
-
- if auto_unregister:
- object.node.connect(
- "tree_exited",
- self,
- "unregister_object",
- [object, room_key]
- )
-
- if "is_interactive" in object.node and object.node.is_interactive:
- object.interactive = true
-
- if "esc_script" in object.node and not object.node.esc_script.empty():
- var script = escoria.esc_compiler.load_esc_file(
- object.node.esc_script
- )
- object.events = script.events
-
- var objects: Dictionary = _get_room_objects_objects(room_key)
- objects[object.global_id] = object
-
- # If object state is not STATE_DEFAULT, save it in manager's object states
- if object.state != ESCObject.STATE_DEFAULT:
- if get_object(object.global_id) == null:
- escoria.logger.error(
- self,
- "Object with global id %s in room (%s, %s) not found in Object Manager."
- % [
- object.global_id,
- room_key.room_global_id,
- room_key.room_instance_id
- ]
- )
- else:
- get_object(object.global_id).state = object.state
-
- # If this is the first object for the room, that means we have a brand new
- # room and it needs to be setup and tracked.
- if objects.size() == 1:
- var room_container: ESCRoomObjects = ESCRoomObjects.new()
- room_container.room_global_id = room_key.room_global_id
- room_container.room_instance_id = room_key.room_instance_id
- room_container.is_reserved = false
- room_container.objects = objects
- room_objects.push_back(room_container)
-
-
-# Check whether an object was registered
-#
-# #### Parameters
-#
-# - global_id: Global ID of object
-# - room: ESCRoom instance the object is registered with.
-# ***Returns*** Whether the object exists in the object registry
-func has(global_id: String, room: ESCRoom = null) -> bool:
- if global_id in RESERVED_OBJECTS:
- if reserved_objects_container == null:
- return false
-
- return reserved_objects_container.objects.has(global_id)
-
- var room_key: ESCRoomObjectsKey
-
- if room == null:
- room_key = current_room_key
- else:
- room_key = ESCRoomObjectsKey.new()
- room_key.room_global_id = room.global_id
- room_key.room_instance_id = room.get_instance_id()
-
- if not _room_exists(room_key):
- return false
-
- return _object_exists_in_room(ESCObject.new(global_id, null), room_key)
-
-
-# Get the object from the object registry
-#
-# #### Parameters
-#
-# - global_id: The global id of the object to retrieve
-# - room: ESCRoom instance the object is registered with.
-# ***Returns*** The retrieved object, or null if not found
-func get_object(global_id: String, room: ESCRoom = null) -> ESCObject:
- if global_id in RESERVED_OBJECTS:
- if reserved_objects_container.objects.has(global_id):
- return reserved_objects_container.objects[global_id]
- else:
- escoria.logger.warn(
- self,
- "Reserved object with global id %s not found in object manager!"
- % global_id
- )
- return null
-
- var room_key: ESCRoomObjectsKey
-
- if room == null:
- room_key = current_room_key
- else:
- room_key = ESCRoomObjectsKey.new()
- room_key.room_global_id = room.global_id
- room_key.room_instance_id = room.get_instance_id()
-
- if not _room_exists(room_key):
- escoria.logger.warn(
- self,
- "Specified room is empty/not found.\n" +
- "Object with global id %s in room instance (%s, %s) not found."
- % [global_id, room_key.room_global_id, room_key.room_instance_id]
- )
- return null
-
- var objects: Dictionary = _get_room_objects_objects(room_key)
-
- if objects.has(global_id):
- return objects[global_id]
- else:
- escoria.logger.warn(
- self,
- "Object with global id %s in room instance (%s, %s) not found."
- % [global_id, room_key.room_global_id, room_key.room_instance_id]
- )
- if escoria.inventory_manager.inventory_has(global_id):
- # item is in the inventory and may be registered to a different room
- for single_room in room_objects:
- # these are arrays of the objects still registered for each room
- if single_room.objects.has(global_id):
- escoria.logger.info(
- self,
- "Object with global id %s found in room instance (%s, %s) through the inventory."
- % [global_id, room_key.room_global_id, room_key.room_instance_id]
- )
- return single_room.objects[global_id]
- return null
-
-
-# Remove an object from the registry
-#
-# #### Parameters
-#
-# - object: The object to unregister
-# - room_key: The room under which the object should be unregistered.
-func unregister_object(object: ESCObject, room_key: ESCRoomObjectsKey) -> void:
- if not _object_exists_in_room(object, room_key):
- # Report this as a warning and not an error since this method may be
- # called as part of an objectd's forced registration and the object not
- # yet being managed.
- escoria.logger.debug(
- self,
- "Unable to unregister object.\n" +
- "Object with global ID %s room (%s, %s) not found. If this was "
- % [
- "?" if object == null else object.global_id,
- room_key.room_global_id,
- room_key.room_instance_id
- ] +
- "part of a 'forced' registration, ignore this warning."
- )
-
- return
-
- var room_objects = _get_room_objects_objects(room_key)
-
- if not escoria.is_quitting and escoria.inventory_manager.inventory_has(object.global_id):
- # Re-instance the node if it is an item present in inventory; that is,
- # re-register it with the new current room.
- if object.node != null:
- object.node = object.node.duplicate()
- register_object(object, null, true)
-
- if object.state == ESCObject.STATE_DEFAULT:
- room_objects.erase(object.global_id)
-
- # If this room is truly empty, it's time to do away with it.
- if room_objects.size() == 0:
- _erase_room(room_key)
-
-
-# Remove an object from the registry by global_id
-#
-# #### Parameters
-#
-# - global_id: The global_id of the object to unregister
-# - room_key: The room under which the object should be unregistered.
-func unregister_object_by_global_id(global_id: String, room_key: ESCRoomObjectsKey) -> void:
- unregister_object(ESCObject.new(global_id, null), room_key)
-
-
-# Insert data to save into savegame. For now, we only save the current room's
-# objects.
-#
-# #### Parameters
-#
-# - p_savegame: The savegame resource
-func save_game(p_savegame: ESCSaveGame) -> void:
- if not current_room_key.is_valid() or not _room_exists(current_room_key):
- escoria.logger.error(
- self,
- "No current room specified or found."
- )
-
- var objects: Dictionary = _get_room_objects_objects(current_room_key)
-
- p_savegame.objects = {}
-
- for obj_global_id in objects:
- if not objects[obj_global_id] is ESCObject:
- continue
- p_savegame.objects[obj_global_id] = \
- objects[obj_global_id].get_save_data()
-
- # Add in reserved objects, too.
- objects = reserved_objects_container.objects
-
- for obj_global_id in objects:
- if not objects[obj_global_id] is ESCObject:
- continue
- p_savegame.objects[obj_global_id] = \
- objects[obj_global_id].get_save_data()
-
-
-# Returns the current room's starting location. If more than one exists, the
-# first one encountered is returned.
-func get_start_location() -> ESCLocation:
- if _room_exists(current_room_key):
- for object in _get_room_objects_objects(current_room_key).values():
- if is_instance_valid(object.node) \
- and object.node is ESCLocation \
- and object.node.is_start_location:
- return object
-
- escoria.logger.warn(
- self,
- "Room has no ESCLocation node with 'is_start_location' enabled. " +
- "Player will be set at position (0,0)."
- )
- return null
-
-
-# Determines whether 'container' represents the current room the player is in.
-#
-# #### Parameters
-#
-# - container: The entry in the object manager array being checked.
-# **Returns** True iff container represents the the current room the player is in.
-func _is_current_room(container: ESCRoomObjects) -> bool:
- return _compare_container_to_key(container, current_room_key)
-
-
-# Determines whether 'container' represents the room specified.
-#
-# #### Parameters
-#
-# - container: The entry in the object manager array being checked.
-# - room_key: The key representing the desired room in the object manager array.
-# **Returns** True iff container represents the the object manager entry specified
-# by room_key.
-func _compare_container_to_key(container: ESCRoomObjects, room_key: ESCRoomObjectsKey) -> bool:
- return container.room_global_id == room_key.room_global_id
-
-
-# Checks whether an entry in the object manager array corresponds to the passed in
-# room key.
-#
-# #### Parameters
-#
-# - room_key: The key representing the desired room in the object manager array.
-# **Returns** True iff an entry in the object manager array corresponds to room_key.
-func _room_exists(room_key: ESCRoomObjectsKey) -> bool:
- for room_container in room_objects:
- if _compare_container_to_key(room_container, room_key):
- return true
-
- return false
-
-
-# Checks whether the specified object exists in the specified object manager entry.
-#
-# #### Parameters
-#
-# - object: The object to check for existence.
-# - room_key: The key representing the desired room in the object manager array.
-# **Returns** True iff object exists in the object manager entry specified by room_key.
-func _object_exists_in_room(object: ESCObject, room_key: ESCRoomObjectsKey) -> bool:
- if object == null:
- escoria.logger.warn(
- self,
- "Cannot check room for \"null\" objects."
- )
-
- return false
-
- for room_container in room_objects:
- if _compare_container_to_key(room_container, room_key) \
- and room_container.objects.has(object.global_id):
- return true
-
- return false
-
-
-# Checks whether the specified object's state is "default" in the specified object manager entry.
-#
-# #### Parameters
-#
-# - object: The object to check for existence.
-# - room_key: The key representing the desired room in the object manager array.
-# **Returns** True if object's state is "default" in the object manager entry specified by room_key.
-func _object_state_in_room_is_default(object: ESCObject, room_key: ESCRoomObjectsKey) -> bool:
- if object == null:
- escoria.logger.warn(
- self,
- "Cannot check room for \"null\" objects."
- )
-
- return false
-
- for room_container in room_objects:
- if _compare_container_to_key(room_container, room_key) \
- and room_container.objects.get(object.global_id).state == ESCObject.STATE_DEFAULT:
- return true
-
- return false
-
-
-# Returns the objects currently being managed in the object manager entry specified
-# by the specified room key.
-#
-# #### Parameters
-#
-# - room_key: The key representing the desired room in the object manager array.
-# **Returns** A reference to the dictionary of the entry's objects, or an empty
-# dictionary otherwise.
-func _get_room_objects_objects(room_key: ESCRoomObjectsKey) -> Dictionary:
- for room_container in room_objects:
- if _compare_container_to_key(room_container, room_key):
- return room_container.objects
-
- return {}
-
-
-# Completely removes the entry in the object manager array specified by the room
-# key.
-#
-# #### Parameters
-#
-# - room_key: The key representing the desired room in the object manager array.
-func _erase_room(room_key: ESCRoomObjectsKey) -> void:
- for room_container in room_objects:
- if _compare_container_to_key(room_container, room_key):
- room_objects.erase(room_container)
- return
diff --git a/addons/escoria-core/game/core-scripts/esc/esc_room_manager.gd b/addons/escoria-core/game/core-scripts/esc/esc_room_manager.gd
deleted file mode 100644
index df75e5a1..00000000
--- a/addons/escoria-core/game/core-scripts/esc/esc_room_manager.gd
+++ /dev/null
@@ -1,448 +0,0 @@
-extends Resource
-class_name ESCRoomManager
-
-
-# Reserved globals which can not be overridden; prefixed with "GLOBAL_"
-#
-#Â Contains the global_id of previous room
-const GLOBAL_LAST_SCENE = "ESC_LAST_SCENE"
-
-# If true, ESC_LAST_SCENE is not considered for automatic transitions
-const GLOBAL_FORCE_LAST_SCENE_NULL = "FORCE_LAST_SCENE_NULL"
-
-const GLOBAL_ANIMATION_RESOURCES = "ANIMATION_RESOURCES"
-
-# Contains the global_id of the current room
-const GLOBAL_CURRENT_SCENE = "ESC_CURRENT_SCENE"
-
-# Dict of the reserved globals to register and their initial values.
-const RESERVED_GLOBALS = {
- GLOBAL_LAST_SCENE: "",
- GLOBAL_FORCE_LAST_SCENE_NULL: false,
- GLOBAL_ANIMATION_RESOURCES: {},
- GLOBAL_CURRENT_SCENE: ""
-}
-
-
-# ESC commands kept around for references to their command names.
-var _transition: TransitionCommand
-var _wait: WaitCommand
-var _accept_input: AcceptInputCommand
-
-
-func _init() -> void:
- _transition = TransitionCommand.new()
- _wait = WaitCommand.new()
- _accept_input = AcceptInputCommand.new()
-
-
-# Registers all reserved global flags for use.
-func register_reserved_globals() -> void:
- for key in RESERVED_GLOBALS:
- escoria.globals_manager.register_reserved_global( \
- key,
- RESERVED_GLOBALS[key])
-
-
-# Performs the actions needed in order to change the current scene to the one
-# specified by room_path.
-#
-# #### Parameters
-#
-# - room_path: Node path to the room that is to become the new current room.
-# - enable_automatic_transitions: Whether to play the transition between rooms
-# automatically or to leave the responsibility to the developer.
-func change_scene(room_path: String, enable_automatic_transitions: bool) -> void:
- if escoria.main and escoria.main.current_scene and escoria.main.current_scene.filename == room_path:
- escoria.logger.info(
- self,
- "Attempting to change scene to same scene as the current scene. Aborting."
- )
- return
-
- # We're changing scenes, so users shouldn't be able to do stuff during.
- escoria.inputs_manager.input_mode = escoria.inputs_manager.INPUT_NONE
-
- # Clear the event queue to remove other events (there could be duplicate
- # events in there so we avoid running these multiple times). Also sets a
- # flag indicating a changing scene and interrupts any other currently-running
- # events.
- escoria.event_manager.set_changing_scene(true)
-
- # If FORCE_LAST_SCENE_NULL is true, force ESC_LAST_SCENE to empty
- if escoria.globals_manager.get_global( \
- GLOBAL_FORCE_LAST_SCENE_NULL):
-
- escoria.globals_manager.set_global(
- GLOBAL_LAST_SCENE,
- null,
- true
- )
- elif escoria.main.current_scene:
- # If FORCE_LAST_SCENE_NULL is false, set ESC_LAST_SCENE = current roomid
- escoria.globals_manager.set_global(
- GLOBAL_LAST_SCENE,
- escoria.main.current_scene.global_id,
- true
- )
-
- if escoria.dialog_player:
- escoria.dialog_player.interrupt()
-
- escoria.inputs_manager.hover_stack.clear()
-
- # Check if game scene was loaded
- if not escoria.game_scene:
- escoria.logger.error(
- self,
- "Failed loading game scene %s." % \
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.GAME_SCENE
- )
- )
-
- if escoria.main.current_scene \
- and escoria.game_scene.get_parent() == escoria.main.current_scene:
- escoria.main.current_scene.remove_child(escoria.game_scene)
-
- # Load room scene
- var res_room = escoria.resource_cache.get_resource(room_path)
-
- var room_scene = res_room.instance()
- if room_scene:
- if enable_automatic_transitions \
- and escoria.event_manager.get_running_event(
- escoria.event_manager.CHANNEL_FRONT
- ) != null \
- and escoria.event_manager.get_running_event(
- escoria.event_manager.CHANNEL_FRONT
- ).name == escoria.event_manager.EVENT_ROOM_SELECTOR:
- room_scene.enabled_automatic_transitions = true
- else:
- room_scene.enabled_automatic_transitions = enable_automatic_transitions
-
- # If the game scene is already in the tree but not a child of the room
- # we remove it
- if escoria.game_scene.is_inside_tree() \
- and escoria.game_scene.get_parent() != room_scene:
- var game_parent = escoria.game_scene.get_parent()
- game_parent.remove_child(escoria.game_scene)
-
- room_scene.add_child(escoria.game_scene)
- room_scene.move_child(escoria.game_scene, 0)
- room_scene.game = escoria.game_scene
- escoria.main.set_scene(room_scene)
-
- # We know the scene has been loaded. Make its global ID available for
- # use by ESC script.
- escoria.globals_manager.set_global(
- escoria.room_manager.GLOBAL_CURRENT_SCENE,
- room_scene.global_id,
- true
- )
-
- # Clear queued resources
- escoria.resource_cache.clear()
-
- escoria.inputs_manager.hotspot_focused = ""
- else:
- escoria.logger.error(
- self,
- "Failed loading room scene %s." % room_path
- )
-
-
-# Sanitize camera limits, add player node and set the global id to the
-# name of this node if it's not set manually
-#
-# #### Parameters
-#
-# - room: The ESCRoom to be initialized for use.
-func init_room(room: ESCRoom) -> void:
- if not is_instance_valid(room) || room == null:
- escoria.logger.error(
- self,
- "No valid room was specified for initialization."
- )
-
- if room.camera_limits.empty():
- room.camera_limits.push_back(Rect2())
-
- if room.camera_limits.size() == 1 and room.camera_limits[0].has_no_area():
- for child in room.get_children():
- if child is ESCBackground:
- room.camera_limits[0] = \
- Rect2(0, 0, child.rect_size.x, child.rect_size.y)
-
- if Engine.is_editor_hint():
- return
-
- if room.has_node("game"):
- room.game = room.get_node("game")
-
- if room.game == null:
- room.game = escoria.game_scene
- room.add_child(room.game)
- room.move_child(room.game, 0)
-
- if room.is_run_directly:
- if escoria.main.current_scene == null:
- escoria.main.set_scene(room)
-
- # If the room node isn't at (0,0), the walk_stop function will offset the
- # player by the same number of pixels when they're at the terrain edge and
- # move them when it shouldn't.
- if room.position != Vector2(0,0):
- escoria.logger.error(
- self,
- "The room node's coordinates must be (0,0) instead of %s."
- % room.position
- )
-
- _perform_script_events(room)
-
-
-# Performs the ESC script events "setup" and "ready", in this order, if they are
-# present. Also manages automatic transitions.
-#
-# #### Parameters
-#
-# - room: The ESCRoom to be initialized for use.
-func _perform_script_events(room: ESCRoom) -> void:
- # Used to track whether any yields have been executed before the call to
- # set_scene_finish.
- var yielded: bool = false
-
- if room.enabled_automatic_transitions \
- and not room.is_run_directly:
- var script_transition_out = escoria.esc_compiler.compile([
- "%s%s" % [ESCEvent.PREFIX, escoria.event_manager.EVENT_TRANSITION_OUT],
- "%s %s out" %
- [
- _transition.get_command_name(),
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.DEFAULT_TRANSITION
- )
- ],
- "%s 0.1" % _wait.get_command_name()
- ],
- get_class()
- )
- escoria.event_manager.queue_event(
- script_transition_out.events[escoria.event_manager.EVENT_TRANSITION_OUT],
- true
- )
-
- # Unpause the game if it was
- escoria.set_game_paused(false)
-
- #Â Wait for transition_out event to be done
- var rc = yield(escoria.event_manager, "event_finished")
- while rc[1] != escoria.event_manager.EVENT_TRANSITION_OUT:
- rc = yield(escoria.event_manager, "event_finished")
- if rc[0] != ESCExecution.RC_OK:
- return rc[0]
-
- yielded = true
-
- # With the room transitioned out, finish any room prep and run :setup if
- # it exists.
- if room.player_scene:
- room.player = room.player_scene.instance()
- room.add_child(room.player)
- escoria.object_manager.register_object(
- ESCObject.new(
- room.player.global_id,
- room.player
- ),
- room,
- true
- )
-
- if escoria.globals_manager.has(
- escoria.room_manager.GLOBAL_ANIMATION_RESOURCES
- ):
- var animations = escoria.globals_manager.get_global(
- escoria.room_manager.GLOBAL_ANIMATION_RESOURCES
- )
-
- if room.player.global_id in animations and \
- ResourceLoader.exists(animations[room.player.global_id]):
- room.player.animations = ResourceLoader.load(
- animations[room.player.global_id]
- )
- room.player.update_idle()
-
- #escoria.object_manager.get_object(escoria.object_manager.CAMERA).node.set_target(room.player)
-
- if room.global_id.empty():
- room.global_id = room.name
-
- #Â Manage player location at room start
- if room.player != null \
- and escoria.object_manager.get_start_location() != null:
- room.player.teleport(escoria.object_manager.get_start_location().node)
-
- # We make sure 'room' is set as the new current_scene, but without making
- # it visible/the current scene tree.
- if not yielded:
- escoria.main.finish_current_scene_init(room)
-
- # Add new camera to scene being prepared.
- var new_player_camera: ESCCamera = escoria.resource_cache.get_resource(
- escoria.CAMERA_SCENE_PATH
- ).instance()
- new_player_camera.register()
- room.player_camera = new_player_camera
-
- # We must first set the camera limits, and then worry about subsequent
- # player setup since it relies on this.
- escoria.main.set_camera_limits(0, room)
-
- # Add the camera in to the scene tree but don't make it active just yet.
- new_player_camera.current = false
- room.add_child(new_player_camera)
- room.move_child(new_player_camera, 0)
-
- var setup_event_added: bool = false
-
- # Run the setup event, if there is one.
- setup_event_added = _run_script_event(escoria.event_manager.EVENT_SETUP, room)
-
- if setup_event_added:
- #Â Wait for setup event to be done
- var rc = yield(escoria.event_manager, "event_finished")
- while rc[1] != escoria.event_manager.EVENT_SETUP:
- rc = yield(escoria.event_manager, "event_finished")
- if rc[0] != ESCExecution.RC_OK:
- return rc[0]
-
- yielded = true
-
- # As far as the event manager is concerned, we're done changing scenes and
- # so should resume allowing events to be queued and processed.
- escoria.event_manager.set_changing_scene(false)
-
- if room.player:
- escoria.object_manager.get_object(escoria.object_manager.CAMERA).node.set_target(room.player)
-
- # Conclude the call to set_scene (thankyouverymuch, coroutines), including
- # making the new room visible.
- escoria.main.set_scene_finish()
-
- #Â Hide main and pause menus
- escoria.game_scene.hide_main_menu()
- escoria.game_scene.unpause_game()
-
- # Maybe this is ok to put in set_scene_finish() above? But it might be a bit
- # confusing to not see the matching camera.current updates.
- new_player_camera.make_current()
-
- # We know the scene has been loaded. Make its global ID available for
- # use by ESC script.
- escoria.globals_manager.set_global(
- escoria.room_manager.GLOBAL_CURRENT_SCENE,
- room.global_id,
- true
- )
-
- # Clear queued resources
- escoria.resource_cache.clear()
-
- escoria.inputs_manager.hotspot_focused = ""
-
- var command_strings: PoolStringArray = []
-
- command_strings.append("%s%s" % [ESCEvent.PREFIX, escoria.event_manager.EVENT_TRANSITION_IN])
-
- if room.enabled_automatic_transitions \
- or (
- not room.enabled_automatic_transitions \
- and escoria.globals_manager.get_global( \
- escoria.room_manager.GLOBAL_FORCE_LAST_SCENE_NULL)
- ):
-
- command_strings.append("%s %s in" %
- [
- _transition.get_command_name(),
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.DEFAULT_TRANSITION
- )
- ]
- )
-
- command_strings.append("%s 0.1" % _wait.get_command_name())
-
- command_strings.append("%s ALL" % _accept_input.get_command_name())
-
- var script_transition_in = escoria.esc_compiler.compile(command_strings, get_class())
-
- escoria.event_manager.queue_event(
- script_transition_in.events[escoria.event_manager.EVENT_TRANSITION_IN]
- )
-
- var ready_event_added: bool = false
- # Run the ready event, if there is one.
- ready_event_added = _run_script_event(escoria.event_manager.EVENT_READY, room)
-
- if ready_event_added:
- #Â Wait for ready event to be done
- var rc = yield(escoria.event_manager, "event_finished")
- while rc[1] != escoria.event_manager.EVENT_READY:
- rc = yield(escoria.event_manager, "event_finished")
- if rc[0] != ESCExecution.RC_OK:
- return rc[0]
-
- # Now that :ready is finished, if FORCE_LAST_SCENE_NULL was true, reset it
- # to false
- if escoria.globals_manager.get_global( \
- escoria.room_manager.GLOBAL_FORCE_LAST_SCENE_NULL):
-
- escoria.globals_manager.set_global(
- escoria.room_manager.GLOBAL_FORCE_LAST_SCENE_NULL,
- false,
- true
- )
- escoria.globals_manager.set_global(
- escoria.room_manager.GLOBAL_LAST_SCENE,
- escoria.main.current_scene.global_id \
- if escoria.main.current_scene != null else "",
- true
- )
-
- # Make the room's global ID available for use in ESC script.
- escoria.globals_manager.set_global(
- escoria.room_manager.GLOBAL_CURRENT_SCENE,
- escoria.main.current_scene.global_id \
- if escoria.main.current_scene != null else "",
- true
- )
-
-
-# Runs the script event from the script attached, if any.
-#
-#Â #### Parameters
-#
-# - event_name: the name of the event to run
-# - room: The ESCRoom to be initialized for use.
-#
-# *Returns* true if the event was correctly added. Will be false if the event
-# does not exist in the script.
-func _run_script_event(event_name: String, room: ESCRoom):
- if not room.esc_script:
- return false
- if room.compiled_script == null:
- room.compiled_script = \
- escoria.esc_compiler.load_esc_file(room.esc_script)
-
- if room.compiled_script.events.has(event_name):
- escoria.logger.debug(
- self,
- "Queuing room script event %s " % event_name +
- "composed of %s statements."
- % room.compiled_script.events[event_name].statements.size()
- )
- escoria.event_manager.queue_event(room.compiled_script.events[event_name], true)
- return true
- else:
- return false
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_base_command.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_base_command.gd
deleted file mode 100644
index b750afa7..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_base_command.gd
+++ /dev/null
@@ -1,56 +0,0 @@
-# A base class for every ESC command.
-# Extending classes have to override the configure and run function
-extends Resource
-class_name ESCBaseCommand
-
-
-# Regex for creating command name based on the script's filename, including
-# named groups
-const PATH_REGEX_GROUP = "path"
-const FILE_REGEX_GROUP = "file"
-const EXTENSION_REGEX_GROUP = "extension"
-const COMMAND_NAME_REGEX = "(?<%s>.+)\/(?<%s>[^.]+)(?<%s>\\.[^.]*$|$)" % \
- [PATH_REGEX_GROUP, FILE_REGEX_GROUP, EXTENSION_REGEX_GROUP]
-
-# Regex matcher for command names
-var command_name_regex: RegEx = RegEx.new()
-
-
-func _init() -> void:
- command_name_regex.compile(COMMAND_NAME_REGEX)
-
-
-# Return the descriptor of the arguments of this command
-func configure() -> ESCCommandArgumentDescriptor:
- escoria.logger.error(
- self,
- "Command %s did not override configure. Please implement a configure() function." % get_command_name()
- )
- return ESCCommandArgumentDescriptor.new()
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(arguments: Array) -> bool:
- return self.configure().validate(get_command_name(), arguments)
-
-
-# Run the command
-func run(command_params: Array) -> int:
- escoria.logger.error(
- self,
- "Command %s did not override run. Please implement a run() function." % get_command_name()
- )
- return 0
-
-
-# Return the name of the command based on the script's filename
-func get_command_name() -> String:
- return command_name_regex.search(get_script().get_path()).get_string(FILE_REGEX_GROUP)
-
-
-# Function called when the command is interrupted.
-func interrupt():
- escoria.logger.debug(
- self,
- "Command %s did not override interrupt. Please implement an interrupt() function." % get_command_name()
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_camera_base_command.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_camera_base_command.gd
deleted file mode 100644
index a5869f57..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_camera_base_command.gd
+++ /dev/null
@@ -1,29 +0,0 @@
-extends ESCBaseCommand
-class_name ESCCameraBaseCommand
-
-
-# Generaters a log entry when attempting to move the camera to an invalid position.
-#
-# #### Parameters
-#
-# - pos: The offending position.
-# - camera: The camera object that `pos` was checked against.
-func generate_viewport_warning(pos: Vector2, camera: ESCCamera) -> void:
- var camera_limit: Rect2 = camera.get_camera_limit_rect()
- var message: String = \
- """
- [%s]: Invalid camera position. Camera cannot be moved to %s as this is outside the viewport with current camera limit %s.
- Current valid ranges for positions are: x = %s inclusive; y = %s inclusive.
- """
-
- escoria.logger.warn(
- self,
- message
- % [
- get_command_name(),
- pos.floor(),
- camera_limit,
- camera.get_current_valid_viewport_values_x(),
- camera.get_current_valid_viewport_values_y()
- ]
- )
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_command.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_command.gd
deleted file mode 100644
index 9311fc98..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_command.gd
+++ /dev/null
@@ -1,159 +0,0 @@
-# An ESC command
-extends ESCStatement
-class_name ESCCommand
-
-
-# Regex matching command lines
-const REGEX = \
- '^(\\s*)(?[^\\s]+)(\\s(?([^\\[]|$)+))?' +\
- '(\\[(?[^\\]]+)\\])?'
-
-
-# The name of this command
-var name: String
-
-# Parameters of this command
-var parameters: Array = []
-
-# A list of ESCConditions to run this command.
-# Conditions are combined using logical AND
-var conditions: Array = []
-
-
-# Create a command from a command string
-func _init(command_string):
- var command_regex = RegEx.new()
- command_regex.compile(REGEX)
-
- if command_regex.search(command_string):
- for result in command_regex.search_all(command_string):
- if "name" in result.names:
- self.name = ESCUtils.get_re_group(result, "name")
- if "parameters" in result.names:
- # Split parameters by whitespace but allow quoted
- # parameters
- var quote_open = false
- var parameter_values = PoolStringArray([])
- var parsed_parameters = \
- ESCUtils.sanitize_whitespace(
- ESCUtils.get_re_group(
- result,
- "parameters"
- ).strip_edges()
- )
- for parameter in parsed_parameters.split(" "):
- if len(parameter) > 1 and parameter.begins_with('"') and parameter.ends_with('"'):
- parameters.append(
- parameter
- )
- elif not quote_open \
- and parameter.count(":") == 1 \
- and ':"' in parameter \
- and (parameter.ends_with(':"') or not parameter.ends_with('"')):
- # The second clause in this helps to handle dialogue that starts with a space
- # and also allowing single-word dialogue to be handled in a separate elif.
- quote_open = true
- parameter_values.append(parameter)
- elif not quote_open and parameter.begins_with('"'):
- quote_open = true
- parameter_values.append(parameter)
- elif parameter.ends_with('"'):
- quote_open = false
- parameter_values.append(
- parameter.substr(0, len(parameter))
- )
- parameters.append(parameter_values.join(" "))
- parameter_values.resize(0)
- elif quote_open:
- parameter_values.append(parameter)
- else:
- parameters.append(parameter)
- if "conditions" in result.names:
- for condition in ESCUtils.get_re_group(
- result,
- "conditions"
- ).split(","):
- self.conditions.append(
- ESCCondition.new(condition.strip_edges())
- )
- else:
- escoria.logger.error(
- self,
- "Invalid command detected: %s\nCommand regexp didn't match."
- % command_string
- )
-
-
-# Check, if conditions match
-func is_valid() -> bool:
- if not command_exists():
- escoria.logger.error(
- self,
- "Invalid command detected: %s" % self.name +
- "Command implementation not found in any command directory."
- )
- return false
-
- return .is_valid()
-
-
-# Checks that the command exists
-#
-# *Returns* True if the command exists, else false.
-func command_exists() -> bool:
- for base_path in ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.COMMAND_DIRECTORIES
- ):
- var command_path = "%s/%s.gd" % [
- base_path.trim_suffix("/"),
- self.name
- ]
- if ResourceLoader.exists(command_path):
- return true
- return false
-
-
-# Run this command
-func run() -> int:
- var command_object = escoria.command_registry.get_command(self.name)
- if command_object == null:
- return ESCExecution.RC_ERROR
- else:
- var argument_descriptor = command_object.configure()
- var prepared_arguments = argument_descriptor.prepare_arguments(
- self.parameters
- )
-
- if command_object.validate(prepared_arguments):
- escoria.logger.debug(
- self,
- "Running command %s with parameters %s."
- % [self.name, prepared_arguments]
- )
- var rc = command_object.run(prepared_arguments)
- if rc is GDScriptFunctionState:
- rc = yield(rc, "completed")
-
- escoria.logger.debug(
- self,
- "[%s] Return code: %d." % [self.name, rc]
- )
- return rc
- else:
- return ESCExecution.RC_ERROR
-
-
-# This function interrupts the command. If it was not started, it will not run.
-# If it had already started, the execution will be considered as finished
-# immediately and finish. If it was already finished, nothing will happen.
-func interrupt():
- _is_interrupted = true
- var command = escoria.command_registry.get_command(self.name)
- if command.has_method("interrupt"):
- command.interrupt()
-
-
-# Override of built-in _to_string function to display the statement.
-func _to_string() -> String:
- return "Command %s with parameters: %s" % [name, str(parameters)]
-
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_command_argument_descriptor.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_command_argument_descriptor.gd
deleted file mode 100644
index c25c5016..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_command_argument_descriptor.gd
+++ /dev/null
@@ -1,187 +0,0 @@
-# The descriptor of the arguments of an ESC command
-extends Reference
-class_name ESCCommandArgumentDescriptor
-
-# As the get_type command was deprecated with Godot 2.x w we need a way to determine
-# variable types. Ideally these wouldn't be hardcoded but there's no GDScript 3.x command to
-# turn a type back to its name.
-const GODOT_TYPE_LIST = ["nil", "bool", "int", "real", "string", \
- "vector2", "rect2", "vector3", "matrix32", "plane", "quat", \
- "aabb", "matrix3", "transform", "color", "image", "node_path", \
- "rid", "object", "input_event", "dictionary", "array", \
- "raw_array", "int_array", "real_array", "string_array", \
- "vector2_array", "vector3_array", "color_array", "max"]
-
-
-# Maximum number of total arugments the command can handle
-var max_args: int = 0
-
-# Number of required arguments the command expects
-var min_args: int = 0
-
-# The types the arguments as TYPE_ constants. If the command is called with
-# more arguments than there are entries in the types array, the additional
-# arguments will be checked against the last entry of the types array.
-var types: Array = []
-
-# The default values for the arguments
-var defaults: Array = []
-
-# Whether to strip quotes on specific arguments
-var strip_quotes: Array = []
-
-# Whether the final argument is a series of varargs
-var has_varargs: bool = false
-
-
-# Initialize the descriptor
-func _init(
- p_min_args: int = 0,
- p_types: Array = [],
- p_defaults: Array = [],
- p_strip_quotes: Array = [true],
- p_has_varargs: bool = false
-):
- max_args = p_types.size()
- min_args = p_min_args
- types = p_types
- defaults = p_defaults
- strip_quotes = p_strip_quotes
- has_varargs = p_has_varargs
-
-
-# Combine the default argument values with the given arguments
-func prepare_arguments(arguments: Array) -> Array:
- var complete_arguments = defaults
- var varargs = []
-
- for index in range(arguments.size()):
- # If we have too many arguments passed in, complete_arguments won't
- # be able to match 1:1. This condition will be validated later but so
- # to avoid duplicating validation code, just grow complete_arguments
- # since the arguments won't be used anyway.
- if index >= complete_arguments.size():
- if has_varargs:
- varargs.append(arguments[index])
- else:
- complete_arguments.append(arguments[index])
- elif index == complete_arguments.size() - 1 and has_varargs:
- # Varargs are a special case and need to be gathered and added at
- # the end as an array, untyped and unchecked. They should also only
- # appear at the very end of a command's argument list.
- varargs.append(arguments[index])
- else:
- complete_arguments[index] = ESCUtils.get_typed_value(
- arguments[index],
- types[index]
- )
- var strip = strip_quotes[0]
- if strip_quotes.size() == complete_arguments.size():
- strip = strip_quotes[index]
-
- if strip and typeof(complete_arguments[index]) == TYPE_STRING:
- complete_arguments[index] = complete_arguments[index].replace(
- '"',
- ''
- )
-
- if has_varargs:
- complete_arguments[complete_arguments.size() - 1] = varargs
-
- return complete_arguments
-
-
-# Validate whether the given arguments match the command descriptor
-func validate(command: String, arguments: Array) -> bool:
- var required_args_count: int = _count_leading_non_null_values(arguments, min_args)
-
- if required_args_count < min_args:
- var verb = "was" if required_args_count == 1 else "were"
-
- escoria.logger.error(
- self,
- "Invalid arguments for command %s. " % command +
- "Arguments didn't match minimum size {num}: Only {args} {verb} found." \
- .format({"num":self.min_args,"args":required_args_count,"verb":verb})
- )
-
- if arguments.size() > self.max_args and not has_varargs:
- escoria.logger.error(
- self,
- "Invalid arguments for command %s" % command +
- "Maximum number of arguments ({num}) exceeded: {args}.".format(
- {"num":self.max_args,"args":arguments}
- )
- )
-
- for index in range(arguments.size()):
- if arguments[index] == null:
- # No type checking for null values
- continue
-
- if has_varargs and index == arguments.size() - 1:
- # If we have varargs at the end, do not validate them.
- continue
-
- var correct = false
- var types_index = index
- if types_index > types.size():
- types_index = types.size() - 1
- if not self.types[types_index] is Array:
- self.types[types_index] = [self.types[index]]
- for type in self.types[types_index]:
- if not correct:
- correct = self._is_type(arguments[index], type)
-
- if not correct:
- var allowed_types = "[ "
- for type in self.types[types_index]:
- allowed_types += GODOT_TYPE_LIST[type] + " or "
- allowed_types = allowed_types.substr(0, allowed_types.length() - 3) + "]"
- escoria.logger.error(
- self,
- "Argument type did not match descriptor for command \"%s\"\n"
- % command +
- "Argument %d (\"%s\") is of type %s. Expected %s."
- % [
- index,
- arguments[index],
- GODOT_TYPE_LIST[typeof(arguments[index])],
- allowed_types
- ]
- )
- return true
-
-
-# Check whether the given argument is of the given type
-#
-# #### Parameters
-#
-# - argument: Argument to test
-# - type: Type to check
-# *Returns* Whether the argument is of the given type
-func _is_type(argument, type: int) -> bool:
- return typeof(argument) == type
-
-
-# Counts the number of non-null values that exist at the beginning of the array up
-# to a specified index.
-#
-# #### Parameters
-#
-# - array_to_check: Array to check for leading non-null values
-# - max_index: Maximum (inclusive) index to check in array_to_check
-#
-# *Returns* the total number of entries at the start of
-# array_to_check that are not null
-func _count_leading_non_null_values(array_to_check: Array, max_index: int) -> int:
- if array_to_check == null or max_index < 0:
- return 0
-
- var leading_non_nulls_count: int = 0
-
- for i in range(max_index):
- if array_to_check[i] != null:
- leading_non_nulls_count += 1
-
- return leading_non_nulls_count
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_condition.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_condition.gd
deleted file mode 100644
index 8662f305..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_condition.gd
+++ /dev/null
@@ -1,145 +0,0 @@
-# A condition to run a command
-extends Reference
-class_name ESCCondition
-
-
-# Valid comparison types
-enum {
- COMPARISON_NONE,
- COMPARISON_EQ,
- COMPARISON_GT,
- COMPARISON_LT,
- COMPARISON_ACTIVITY
-}
-
-
-# Regex that matches condition lines
-const REGEX = \
- '^(?!)?(?eq|gt|lt)? ?(?i\/)?' + \
- '(?a\/)?(?[^ ]+)( (?.+))?$'
-
-
-const COMPARISON_DESCRIPTION = [
- "Checking if %s %s %s true%s",
- "Checking if %s %s %s equals %s",
- "Checking if %s %s %s greater than %s",
- "Checking if %s %s %s less than %s",
- "Checking if %s %s %s active%s"
-]
-
-
-# Name of the flag compared
-var flag: String
-
-# Whether this condition is negated
-var negated: bool = false
-
-# Whether this condition is regarding an inventory item ("i/...")
-var inventory: bool = false
-
-# An optional comparison type. Use the COMPARISON-Enum
-var comparison: int = COMPARISON_NONE
-
-# The value used together with the comparison type
-var comparison_value
-
-
-# Create a new condition from an ESC condition string
-func _init(comparison_string: String):
- var comparison_regex = RegEx.new()
- comparison_regex.compile(
- REGEX
- )
-
- if comparison_regex.search(comparison_string):
- for result in comparison_regex.search_all(comparison_string):
- if "is_negated" in result.names:
- self.negated = true
- if "comparison" in result.names:
- match ESCUtils.get_re_group(result, "comparison"):
- "eq": self.comparison = COMPARISON_EQ
- "gt": self.comparison = COMPARISON_GT
- "lt": self.comparison = COMPARISON_LT
- _:
- escoria.logger.error(
- self,
- "Invalid comparison type detected: %s" %
- comparison_string +
- "Comparison type %s unknown" %
- ESCUtils.get_re_group(
- result,
- "comparison"
- )
- )
- if "comparison_value" in result.names:
- self.comparison_value = ESCUtils.get_typed_value(
- ESCUtils.get_re_group(
- result,
- "comparison_value"
- )
- )
- if "is_inventory" in result.names:
- self.inventory = true
- if "is_activity" in result.names:
- self.comparison = COMPARISON_ACTIVITY
- if "flag" in result.names:
- self.flag = ESCUtils.get_re_group(result, "flag")
- else:
- escoria.logger.error(
- self,
- "Invalid comparison detected: %s\nComparison regexp didn't match."
- % comparison_string
- )
-
-
-# Run this comparison against the globals
-func run() -> bool:
- var global_name = self.flag
-
- escoria.logger.debug(
- self,
- COMPARISON_DESCRIPTION[self.comparison] % [
- "inventory item" if self.inventory else "global value",
- self.flag,
- "is not" if self.negated else "is",
- "" if self.comparison in [COMPARISON_NONE, COMPARISON_ACTIVITY] \
- else self.comparison_value
- ]
- )
-
- if self.inventory:
- global_name = "i/%s" % flag
-
- var return_value = false
-
- if self.comparison == COMPARISON_NONE and \
- escoria.globals_manager.has(global_name) and \
- escoria.globals_manager.get_global(global_name) is bool and \
- escoria.globals_manager.get_global(global_name):
- return_value = true
- elif self.comparison == COMPARISON_EQ and \
- escoria.globals_manager.get_global(global_name) == \
- self.comparison_value:
- return_value = true
- elif self.comparison == COMPARISON_GT and \
- escoria.globals_manager.get_global(global_name) > \
- self.comparison_value:
- return_value = true
- elif self.comparison == COMPARISON_LT and \
- escoria.globals_manager.get_global(global_name) < \
- self.comparison_value:
- return_value = true
- elif self.comparison == COMPARISON_ACTIVITY and \
- escoria.object_manager.has(global_name) and \
- escoria.object_manager.get_object(global_name).active:
- return_value = true
-
- if self.negated:
- return_value = not return_value
-
- escoria.logger.debug(
- self,
- "It is" if return_value else "It isn't"
- )
-
- return return_value
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_dialog.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_dialog.gd
deleted file mode 100644
index 8e874c9b..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_dialog.gd
+++ /dev/null
@@ -1,116 +0,0 @@
-# An ESC dialog
-extends ESCStatement
-class_name ESCDialog
-
-
-# Regex that matches dialog lines
-const REGEX = \
- '^(\\s*)\\?( (?[^ ]+))?' +\
- '( (?[^ ]+))?( (?.+))?$'
-
-
-# A Regex that matches the end of a dialog
-const END_REGEX = \
- '^(?\\s*)!.*$'
-
-
-# Avatar used in the dialog
-var avatar: String = "-"
-
-# Timeout until the timeout_option option is selected. Use 0 for no timeout
-var timeout: int = 0
-
-# The dialog option to select when timeout is reached
-var timeout_option: int = 0
-
-# A list of ESCDialogOptions
-var options: Array
-
-
-# Construct a dialog from an ESC dialog string
-#
-# #### Parameters
-# - dialog_string: ESC dialog string
-func load_string(dialog_string: String):
- var dialog_regex = RegEx.new()
- dialog_regex.compile(REGEX)
-
- if dialog_regex.search(dialog_string):
- for result in dialog_regex.search_all(dialog_string):
- if "avatar" in result.names:
- self.avatar = ESCUtils.get_re_group(result, "avatar")
- if "timeout" in result.names:
- self.timeout = int(
- ESCUtils.get_re_group(result, "timeout")
- )
- if "timeout_option" in result.names:
- self.timeout_option = int(
- ESCUtils.get_re_group(result, "timeout_option")
- )
- else:
- escoria.logger.error(
- self,
- "Invalid dialog detected: %s\nDialog regexp didn't match."
- % dialog_string
- )
-
-
-# Check if dialog is valid
-func is_valid() -> bool:
- if self.avatar != "-" and not ResourceLoader.exists(self.avatar):
- escoria.logger.error(
- self,
- "Avatar scene not found: %s." % self.avatar
- )
- return false
- if self.timeout_option > self.options.size() \
- or self.timeout_option < 0:
- escoria.logger.error(
- self,
- "Invalid timeout_option parameter given: %d." % self.timeout_option
- )
- return false
-
- return true
-
-
-# Run this dialog
-func run():
- escoria.logger.debug(
- self,
- "Starting dialog."
- )
-
- escoria.current_state = escoria.GAME_STATE.DIALOG
-
- if !escoria.dialog_player:
- escoria.dialog_player = escoria.main.current_scene.get_node(
- "game/ui/dialog_layer/dialog_player"
- )
-
- escoria.dialog_player.start_dialog_choices(self)
-
- var option = yield(
- escoria.dialog_player,
- "option_chosen"
- ) as ESCDialogOption
-
- var rc = ESCExecution.RC_OK
-
- # If no valid option was returned, it means this level of dialog is done.
- # If this is the case and the current level of dialog has a parent, it means
- # it is still yielding and so will be shown again.
- if option:
- rc = option.run()
- if rc is GDScriptFunctionState:
- rc = yield(rc, "completed")
- if rc != ESCExecution.RC_CANCEL:
- # We also set this here in case a chosen option doesn't yield, since this block
- # will return normally and not allow the current_state reset at the bottom of this
- # method to run.
- escoria.current_state = escoria.GAME_STATE.DEFAULT
- return self.run()
-
- escoria.current_state = escoria.GAME_STATE.DEFAULT
-
- return rc
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_dialog_option.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_dialog_option.gd
deleted file mode 100644
index 7dd85294..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_dialog_option.gd
+++ /dev/null
@@ -1,75 +0,0 @@
-# An option of an ESC dialog
-extends ESCStatement
-class_name ESCDialogOption
-
-
-# Regex that matches dialog option lines
-const REGEX = \
- '^[^-]*- (?[^:]+)?:?"' +\
- '(?[^"]+)"( \\[(?[^\\]]+)\\])?$'
-
-
-# Option displayed in the HUD
-var option: String setget ,get_option
-
-# Conditions to show this dialog
-var conditions: Array = []
-
-
-# Create a dialog option from an ESC string
-#
-# #### Parameter
-# - option_string: ESC string for the dialog option
-func load_string(option_string: String):
- var option_regex = RegEx.new()
- option_regex.compile(REGEX)
-
- if option_regex.search(option_string):
- for result in option_regex.search_all(option_string):
- if "option" in result.names:
- var _trans_key = ""
- if "trans_key" in result.names:
- _trans_key = "%s:" % \
- ESCUtils.get_re_group(result, "trans_key")
- self.option = "%s%s" % [
- _trans_key,
- ESCUtils.get_re_group(result, "option")
- ]
- if "conditions" in result.names:
- for condition_text in ESCUtils.get_re_group(
- result,
- "conditions"
- ).split(","):
- self.conditions.append(
- ESCCondition.new(condition_text.strip_edges())
- )
- else:
- escoria.logger.error(
- self,
- "Invalid dialog option detected: %s." % option_string,
- "Dialog option regexp didn't match"
- )
-
-
-func get_option():
- # Check if text has a key
- if ":" in option:
- var splitted_text = option.split(":")
- var key = splitted_text[0]
- var translated_text = tr(key)
-
- # If no translation is found use default text
- if key != translated_text:
- return tr(key)
- if splitted_text.size() > 1:
- return splitted_text[1]
-
- return option
-
-
-# Check, if conditions match
-func is_valid() -> bool:
- for condition in self.conditions:
- if not (condition as ESCCondition).run():
- return false
- return true
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_event.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_event.gd
deleted file mode 100644
index 9549b3f4..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_event.gd
+++ /dev/null
@@ -1,94 +0,0 @@
-# An event in the ESC language
-#
-# Events are triggered from various sources. Common events include
-#
-# * :setup : This event is always the first to be called each time the room is visited.
-# It allows elements in the room to be prepared *before* the room is displayed to the
-# player (e.g. starting particle effects).
-# * :ready : This event is the second to be called each time the room is visited.
-# It is run immediately after `:setup` finishes execution, if it exists. Otherwise,
-# `:ready` will be the first event to run. Regardless, this event is run *after*
-# the room is displayed to the player, allowing cutscenes or animations to be
-# run once the room is visible.
-# * :use Called from the current item when it is used with the item
-# with the global id
-extends ESCStatement
-class_name ESCEvent
-
-
-# Regex identifying an ESC event
-const REGEX = \
- '^:(?[^|]+)( \\|\\s*(?( ' + \
- '(TK|NO_TT|NO_UI|NO_SAVE)' + \
- ')+))?$'
-
-# Prefix to identify this as an ESC event.
-const PREFIX = ":"
-
-
-# Valid event flags
-# * TK: stands for "telekinetic". It means the player won't walk over to
-# the item to say the line.
-# * NO_TT: stands for "No tooltip". It hides the tooltip for the duration of
-# the event. Probably not very useful, because events having multiple
-# say commands in them are automatically hidden.
-# * NO_UI: stands for "No User Inteface". It hides the UI for the duration of
-#Â the event. Useful when you want something to look like a cut scene but not
-# disable input for skipping dialog.
-# * NO_SAVE: disables saving. Use this in cut scenes and anywhere a
-# badly-timed autosave would leave your game in a messed-up state.
-enum {
- FLAG_TK = 1,
- FLAG_NO_TT = 2,
- FLAG_NO_UI = 4,
- FLAG_NO_SAVE = 8
-}
-
-
-# Name of event
-var name: String
-
-# Flags set to this event
-var flags: int = 0
-
-
-# Create a new event from an event line
-func _init(event_string: String):
- var event_regex = RegEx.new()
- event_regex.compile(REGEX)
-
- if event_regex.search(event_string):
- for result in event_regex.search_all(event_string):
- if "name" in result.names:
- self.name = ESCUtils.get_re_group(result, "name") \
- .strip_edges()
- if "flags" in result.names:
- var _flags = ESCUtils.get_re_group(
- result,
- "flags"
- ).strip_edges().split(" ")
- if "TK" in _flags:
- self.flags |= FLAG_TK
- if "NO_TT" in _flags:
- self.flags |= FLAG_NO_TT
- if "NO_UI" in _flags:
- self.flags |= FLAG_NO_UI
- if "NO_SAVE" in _flags:
- self.flags |= FLAG_NO_SAVE
- else:
- escoria.logger.error(
- self,
- "Invalid event detected: %s\nEvent regexp didn't match."
- % event_string
- )
-
-
-# Execute this statement and return its return code
-func run() -> int:
- reset_interrupt()
- escoria.logger.debug(
- self,
- "Event %s started." % name
- )
- return .run()
-
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_execution.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_execution.gd
deleted file mode 100644
index e11eebca..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_execution.gd
+++ /dev/null
@@ -1,14 +0,0 @@
-# Basic features and informations about ESC executions
-extends Resource
-class_name ESCExecution
-
-
-# Return codes handled by events
-# * RC_OK: Event run okay
-# * RC_CANCEL: Cancel all scheduled and queued events. This return code tells the Event Manager
-# that no execution is required for this command (such as "stop" and "repeat")
-# * RC_ERROR: Error running a command
-# * RC_REPEAT: Repeat the current scope from the beginning
-# * RC_INTERRUPTED: Event was interrupted
-# * RC_WONT_QUEUE: Event won't or can't be queued
-enum {RC_OK, RC_CANCEL, RC_ERROR, RC_REPEAT, RC_INTERRUPTED, RC_WONT_QUEUE}
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_group.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_group.gd
deleted file mode 100644
index 5a9a6dc7..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_group.gd
+++ /dev/null
@@ -1,35 +0,0 @@
-# A group of ESC commands
-extends ESCStatement
-class_name ESCGroup
-
-
-# A RegEx identifying a group
-const REGEX = '^([^>]*)>\\s*(\\[(?[^\\]]+)\\])?$'
-
-
-# A list of ESCConditions to run this group
-# Conditions are combined using logical AND
-var conditions: Array = []
-
-
-# Construct an ESC group of an ESC script line
-func _init(group_string: String):
- var group_regex = RegEx.new()
- group_regex.compile(REGEX)
-
- if group_regex.search(group_string):
- for result in group_regex.search_all(group_string):
- if "conditions" in result.names:
- for condition in ESCUtils.get_re_group(
- result,
- "conditions"
- ).split(","):
- self.conditions.append(
- ESCCondition.new(condition.strip_edges())
- )
- else:
- escoria.logger.error(
- self,
- "Invalid group detected: %s\nGroup regexp didn't match."
- % group_string
- )
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
deleted file mode 100644
index 3ad66d9f..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_object.gd
+++ /dev/null
@@ -1,125 +0,0 @@
-extends Reference
-# An object handled in Escoria
-class_name ESCObject
-
-
-# Default object state
-const STATE_DEFAULT: String = "default"
-
-
-# The global id of the object
-var global_id: String
-
-# Whether the object is active (visible to the player)
-var active: bool = true setget _set_active
-
-# Whether the object is interactive (clickable by the player)
-var interactive: bool = true setget _set_interactive, _get_interactive
-
-# The state of the object. If the object has a respective animation,
-# it will be played
-var state: String = STATE_DEFAULT
-
-# The events registered with the object
-var events: Dictionary = {}
-
-# The node in the scene. Can be an ESCItem or an ESCCamera
-var node: Node
-
-
-func _init(p_global_id: String, p_node: Node):
- global_id = p_global_id
- node = p_node
-
-
-# Set the state and start a possible animation
-#
-# #### Parameters
-#
-# - p_state: State to set
-# - immediate: If true, skip directly to the end
-func set_state(p_state: String, immediate: bool = false):
- state = p_state
-
- if node.has_method("get_animation_player"):
- var animation_node: ESCAnimationPlayer = node.get_animation_player()
-
- if animation_node != null and animation_node.is_valid():
- animation_node.stop()
- var actual_animator
- if animation_node.has_animation(p_state):
- if immediate:
- escoria.logger.debug(
- self,
- "State \"%s\" set. Matching immediate animation executing."
- % p_state
- )
- animation_node.seek_end(p_state)
- else:
- escoria.logger.debug(
- self,
- "State \"%s\" set. Matching non-immediate animation executing."
- % p_state
- )
- animation_node.play(p_state)
- else:
- escoria.logger.debug(
- self,
- "State \"%s\" set. No matching animation found."
- % p_state
- )
-
-
-# Set the active value, thus hiding or showing the object
-#
-# #### Parameters
-#
-# - value: Value to set
-func _set_active(value: bool):
- active = value
- self.node.visible = value
-
-
-# Get the interactive value from the node
-#
-# **Returns** Whether the node is interactive or not
-func _get_interactive() -> bool:
- if is_instance_valid(self.node) and "is_interactive" in self.node:
- return self.node.is_interactive
- else:
- return true
-
-
-# Set the interactive value in the node
-#
-# #### Parameters
-# - value: Whether the object is interactive or not
-func _set_interactive(value: bool):
- if "is_interactive" in self.node:
- self.node.is_interactive = value
- if not value:
- escoria.game_scene.clear_tooltip()
- escoria.inputs_manager.on_item_non_interactive(self.node)
-
-
-# Return the data of the object to be inserted in a savegame file.
-#
-# **Returns**
-# A dictionary containing the data to be saved for this object.
-func get_save_data() -> Dictionary:
- var save_data: Dictionary = {}
- save_data["active"] = self.active
- save_data["interactive"] = self.interactive
- save_data["state"] = self.state
-
- if is_instance_valid(self.node) and \
- self.node.get("is_movable") and self.node.is_movable:
- save_data["global_transform"] = self.node.global_transform
- save_data["last_deg"] = wrapi(self.node._movable._get_angle() + 1, 0, 360)
- save_data["last_dir"] = self.node._movable.last_dir
-
- if (self.global_id == "_music" or self.global_id == "_sound") \
- and self.node.get("state"):
- save_data["state"] = self.node.get("state")
-
- return save_data
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_room_objects.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_room_objects.gd
deleted file mode 100644
index 41419e3a..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_room_objects.gd
+++ /dev/null
@@ -1,18 +0,0 @@
-# Container for ESCObjects stored in the object manager.
-extends Reference
-class_name ESCRoomObjects
-
-
-# Designated whether 'objects' is the container for all reserved objects.
-var is_reserved: bool = false
-
-# Global ID of the room to which the objects in 'objects' are registered.
-var room_global_id: String = ""
-
-# Instance ID of the room to which the objects in 'objects' are registered.
-# This is used to disambiguate in cases where more than one of the same room
-# exist in the object manager.
-var room_instance_id: int = -1
-
-# The hash of objects registered to the room specified above.
-var objects: Dictionary = {}
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_room_objects_key.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_room_objects_key.gd
deleted file mode 100644
index a0b2f93f..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_room_objects_key.gd
+++ /dev/null
@@ -1,18 +0,0 @@
-# Simple pair container to store a room's identifying information for use in
-# the object manager.
-extends Reference
-class_name ESCRoomObjectsKey
-
-
-# Contains the global_id of the room being represented by this key.
-var room_global_id: String = ""
-
-# Contains the instance ID of the room being represented by this key.
-var room_instance_id: int = -1
-
-
-# Checks whether this key is valid and represents an actual room.
-#
-# **Returns** true iff the key has a valid global_id and room instance ID.
-func is_valid() -> bool:
- return not room_global_id.empty() and room_instance_id > -1
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_scheduled_event.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_scheduled_event.gd
deleted file mode 100644
index 9bd18eb1..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_scheduled_event.gd
+++ /dev/null
@@ -1,24 +0,0 @@
-# An event that is scheduled to run later
-extends Reference
-class_name ESCScheduledEvent
-
-
-# Event to run when timeout is reached
-var event: ESCEvent
-
-
-# The number of seconds until the event is run
-var timeout: float
-
-
-# Create a new scheduled event
-func _init(p_event: ESCEvent, p_timeout: float):
- self.event = p_event
- self.timeout = p_timeout
-
-
-# Run the event
-#
-# **Returns** The execution code
-func run() -> int:
- return event.run()
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_script.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_script.gd
deleted file mode 100644
index 00e200dd..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_script.gd
+++ /dev/null
@@ -1,7 +0,0 @@
-# A compiled ESC script
-extends Resource
-class_name ESCScript
-
-
-# A dictionary of ESCEvents in this script
-var events: Dictionary
diff --git a/addons/escoria-core/game/core-scripts/esc/types/esc_statement.gd b/addons/escoria-core/game/core-scripts/esc/types/esc_statement.gd
deleted file mode 100644
index a743b29d..00000000
--- a/addons/escoria-core/game/core-scripts/esc/types/esc_statement.gd
+++ /dev/null
@@ -1,80 +0,0 @@
-# A statement in an ESC file
-extends Reference
-class_name ESCStatement
-
-
-# Emitted when the event did finish running
-signal finished(event, return_code)
-
-# Emitted when the event was interrupted
-signal interrupted(event, return_code)
-
-
-# The list of ESC commands
-var statements: Array = []
-
-# The source of this statement, e.g. an ESC script or a class.
-var source: String = ""
-
-# Indicates whether this event was interrupted.
-var _is_interrupted: bool = false
-
-
-# Check whether the statement should be run based on its conditions
-func is_valid() -> bool:
- for condition in self.conditions:
- if not (condition as ESCCondition).run():
- return false
- return true
-
-
-# Execute this statement and return its return code
-func run() -> int:
- var final_rc = ESCExecution.RC_OK
- var current_statement: ESCStatement
-
- for statement in statements:
- current_statement = statement
-
- if _is_interrupted:
- final_rc = ESCExecution.RC_INTERRUPTED
- statement.interrupt()
- emit_signal("interrupted", self, statement, final_rc)
- return final_rc
-
- if statement.is_valid():
- var rc = statement.run()
- if rc is GDScriptFunctionState:
- rc = yield(rc, "completed")
- escoria.logger.debug(
- self,
- "Statement (%s) was completed." % statement
- )
- if rc == ESCExecution.RC_REPEAT:
- return self.run()
- elif rc != ESCExecution.RC_OK:
- final_rc = rc
- break
-
- emit_signal("finished", self, current_statement, final_rc)
- return final_rc
-
-
-# Interrupt the statement in the middle of its execution.
-func interrupt():
- escoria.logger.info(
- self,
- "Interrupting event %s (%s)."
- % [self.name if "name" in self else "group", str(self)]
- )
- _is_interrupted = true
- for statement in statements:
- if statement.has_method("interrupt"):
- statement.interrupt()
-
-
-# Resets an interrupted event
-func reset_interrupt():
- _is_interrupted = false
- for statement in statements:
- statement.reset_interrupt()
diff --git a/addons/escoria-core/game/core-scripts/esc_animation_player.gd b/addons/escoria-core/game/core-scripts/esc_animation_player.gd
deleted file mode 100644
index 5b347330..00000000
--- a/addons/escoria-core/game/core-scripts/esc_animation_player.gd
+++ /dev/null
@@ -1,186 +0,0 @@
-# An abstraction class to expose the same animation methods for noth
-# AnimatedSprite and AnimationPlayer
-extends Node
-class_name ESCAnimationPlayer
-
-
-# Emitted when the animation finsihed playing
-signal animation_finished(name)
-
-
-# The actual player node
-var _player_node: Node
-
-# A AnimationPlayer typed reference to the player node (for intellisense)
-var _animation_player: AnimationPlayer
-
-# A AnimationPlayer typed reference to the player node (for intellisense)
-var _animated_sprite: AnimatedSprite
-
-# Whether the player node is of type AnimationPlayer (just for convenience)
-var _is_animation_player: bool = false
-
-# Currently running animation
-var _current_animation: String = ""
-
-
-# Create a new animation player
-#
-# #### Parameters
-#
-# - node: The actual player node
-func _init(node: Node):
- _player_node = node
- if node is AnimationPlayer:
- _is_animation_player = true
- _animation_player = node
- else:
- _animated_sprite = node
- node.add_child(self)
-
-
-# Connect animation signals
-func _ready() -> void:
- if _is_animation_player:
- _player_node.connect(
- "animation_finished",
- self,
- "_on_animation_finished"
- )
- else:
- _player_node.connect(
- "animation_finished",
- self,
- "_on_animation_finished_animated_sprite"
- )
-
-
-# Return the currently playing animation
-# **Returns** the currently playing animation name
-func get_animation() -> String:
- if _is_animation_player:
- return _animation_player.current_animation
- else:
- return _animated_sprite.animation
-
-
-# Returns a list of all animation names
-# **Returns** A list of all animation names
-func get_animations() -> PoolStringArray:
- if _is_animation_player:
- return _animation_player.get_animation_list()
- else:
- return _animated_sprite.frames.get_animation_names()
-
-
-# Whether the animation is playing
-# **Returns: Whether the animation is playing**
-func is_playing() -> bool:
- return _player_node.is_playing()
-
-
-# Stop the animation
-func stop():
- _player_node.stop()
-
-
-# Play the animation
-#
-# #### Parameters
-#
-# - name: The animation name to play
-# - backwards: Play backwards
-func play(name: String, backwards: bool = false):
- if _is_animation_player and _animation_player.current_animation != "":
- _animation_player.seek(0)
- elif not _is_animation_player:
- _animated_sprite.frame = 0
-
- _current_animation = name
-
- if backwards and _is_animation_player:
- _animation_player.play_backwards(name)
- elif backwards:
- _animated_sprite.play(name, true)
- else:
- _player_node.play(name)
-
- # Instead of waiting for the next frame, start the animation now.
- if _is_animation_player:
- _player_node.advance(0)
-
-
-# Play the given animation backwards
-#
-# #### Parameters
-#
-# - name: Animation to play
-func play_backwards(name: String):
- self.play(name, true)
-
-
-# Check if the given animation exists
-#
-# #### Parameters
-#
-# - name: Name of the animation to check
-# **Returns** Whether the animation player has the animation
-func has_animation(name: String) -> bool:
- if _is_animation_player:
- return _animation_player.has_animation(name)
- else:
- return _animated_sprite.frames.has_animation(name)
-
-
-# Play an animation and directly skip to the end
-#
-# #### Parameters
-#
-# - name: Name of the animation to play
-func seek_end(name: String):
- if _is_animation_player:
- _animation_player.current_animation = name
- _animation_player.seek(_animation_player.get_animation(name).length, true)
- else:
- _animated_sprite.animation = name
- _animated_sprite.frame = _animated_sprite.frames.get_frame_count(name)
-
-
-# Get the length of the specified animation
-#
-# #### Parameters
-#
-# - name: Name of the animation
-# **Returns** The length of the animation in seconds
-func get_length(name: String) -> float:
- if _is_animation_player:
- return _animation_player.get_animation(name).length
- else:
- return _animated_sprite.frames.get_frame_count(name) - 1 * \
- _animated_sprite.frames.get_animation_speed(name)
-
-
-# Return true if the ESCAnimationPlayer node is valid, ie. it has a valid player
-# node.
-# **Returns: true if the ESCAnimationPlayer has a valid player node,
-# else false**
-func is_valid() -> bool:
- return _player_node != null and _player_node is Node
-
-
-# Transport the animation_finished signal
-#
-# #### Parameters
-#
-# - name: Name of the animation played
-func _on_animation_finished(name: String):
- if _is_animation_player and not _animation_player.get_animation(name).loop:
- _animation_player.stop()
- elif not _animated_sprite.frames.get_animation_loop(name):
- _animated_sprite.stop()
- emit_signal("animation_finished", name)
-
-
-# Special signal handler for animated sprites
-func _on_animation_finished_animated_sprite():
- _on_animation_finished(_current_animation)
diff --git a/addons/escoria-core/game/core-scripts/esc_background.gd b/addons/escoria-core/game/core-scripts/esc_background.gd
deleted file mode 100644
index 8ae1bf7a..00000000
--- a/addons/escoria-core/game/core-scripts/esc_background.gd
+++ /dev/null
@@ -1,135 +0,0 @@
-# ESCBackground's purpose is to display a background image and receive input
-# events on the background. More precisely, the TextureRect under ESCBackground
-# does not receive events itself - if it did, it would also eat all events like
-# hotspot focusing and such. Instead, we set the TextureRect mouse filter to
-# MOUSE_FILTER_IGNORE, and we use an Area2D node to receive the input events.
-#
-# If ESCBackground doesn't contain a texture, it is important that its rect_size
-# is set over the whole scene, because its rect_size is then used to create the
-# Area2D node under it. If the rect_size is wrongly set, the background may
-# receive no input.
-tool
-extends TextureRect
-class_name ESCBackground, "res://addons/escoria-core/design/esc_background.svg"
-
-
-# The background was double clicked
-#
-# #### Parameters
-#
-# - position: The position where the player clicked
-signal double_left_click_on_bg(position)
-
-# The background was left clicked
-#
-# #### Parameters
-#
-# - position: The position where the player clicked
-signal left_click_on_bg(position)
-
-# The background was right clicked
-#
-# #### Parameters
-#
-# - position: The position where the player clicked
-signal right_click_on_bg(position)
-
-# Emitted when the mouse wheel was turned up
-signal mouse_wheel_up
-
-# Emitted when the mouse wheel was turned down
-signal mouse_wheel_down
-
-
-# The ESC script connected to this background
-export(String, FILE, "*.esc") var esc_script = ""
-
-
-# Create the underlying Area2D as an input device
-func _enter_tree():
- var size
- if get_texture():
- size = get_texture().get_size()
- else:
- size = rect_size
-
- var area = Area2D.new()
- var shape = RectangleShape2D.new()
-
- var sid = area.create_shape_owner(area)
-
- # Move origin of Area2D to center of Sprite
- var transform = area.shape_owner_get_transform(sid)
- transform.origin = size / 2
- area.shape_owner_set_transform(sid, transform)
-
- # Set extents of RectangleShape2D to cover entire TextureRect
- shape.set_extents(size / 2)
- area.shape_owner_add_shape(sid, shape)
-
- add_child(area)
-
-# Disable mouse filter events and connect our own events to the ESC input
-# manager
-func _ready():
- mouse_filter = MOUSE_FILTER_IGNORE
-
- # If background has no texture, set its rect size to viewport size
- if texture == null and rect_size == Vector2.ZERO:
- rect_size = escoria.game_size
-
- if !Engine.is_editor_hint():
- escoria.inputs_manager.register_background(self)
-
-
-# Manage inputs reaching the Area2D and emit the events to the input manager
-#
-# #### Parameters
-# - event: Event received
-func _unhandled_input(event: InputEvent) -> void:
- var is_default_state = escoria.current_state == escoria.GAME_STATE.DEFAULT
- if escoria.inputs_manager.try_custom_input_handler(event, is_default_state):
- return
- if not is_default_state:
- return
- if InputMap.has_action(escoria.inputs_manager.SWITCH_ACTION_VERB) \
- and event.is_action_pressed(escoria.inputs_manager.SWITCH_ACTION_VERB):
- if event.button_index == BUTTON_WHEEL_UP:
- emit_signal("mouse_wheel_up")
- elif event.button_index == BUTTON_WHEEL_DOWN:
- emit_signal("mouse_wheel_down")
- if event is InputEventMouseButton and event.is_pressed():
- var p = get_global_mouse_position()
- var size
- if get_texture():
- size = get_texture().get_size()
- else:
- size = rect_size
- if Rect2(rect_position, size).has_point(p):
- if event.doubleclick and event.button_index == BUTTON_LEFT:
- emit_signal("double_left_click_on_bg", p)
- elif event.button_index == BUTTON_LEFT:
- emit_signal("left_click_on_bg", p)
- elif event.button_index == BUTTON_RIGHT:
- emit_signal("right_click_on_bg", p)
-
-
-# Calculate the actual area taken by this background depending on its
-# Texture or set size
-# **Returns** The correct area size
-func get_full_area_rect2() -> Rect2:
- var area_rect2: Rect2 = Rect2()
- var pos = get_global_position()
- var size: Vector2
- if get_texture():
- size = get_texture().get_size()
- else:
- size = rect_size
-
- if rect_scale.x != 1 or rect_scale.y != 1:
- size.x *= rect_scale.x
- size.y *= rect_scale.y
-
- area_rect2 = area_rect2.expand(pos)
- area_rect2 = area_rect2.expand(pos + size)
- return area_rect2
diff --git a/addons/escoria-core/game/core-scripts/esc_exit.gd b/addons/escoria-core/game/core-scripts/esc_exit.gd
deleted file mode 100644
index 2a053abb..00000000
--- a/addons/escoria-core/game/core-scripts/esc_exit.gd
+++ /dev/null
@@ -1,64 +0,0 @@
-# An ESCExit is a minimal feature node that provides an exit to a room.
-#
-# For exits that don't require scripts, the ``ESCExit`` node is provided.
-# The only things you will need to configure on the node are the
-# "target_scene" to change to, and optionally, a "switch
-# sound" (the sound to play when changing rooms).
-#
-# If you want to attach the exit to a script to perform additional actions -
-# a cutscene for example - use an ``ESCItem`` with "Is Exit" selected instead.
-#
-# The game character will automatically walk to an ``ESCLocation`` created as a
-# child of an ``ESCExit`` node.
-extends ESCItem
-class_name ESCExit, "res://addons/escoria-core/design/esc_exit.svg"
-
-
-# Path to the target scene to change to
-export(String, FILE, "*.tscn") var target_scene = ""
-
-# Sound effect to play when changing the scene
-export(String, FILE, "*.ogg,*.mp3,*.wav") var switch_sound = ""
-
-# ESC commands kept around for references to their command names.
-var _play_snd: PlaySndCommand
-var _change_scene: ChangeSceneCommand
-
-
-func _enter_tree():
- is_exit = true
- player_orients_on_arrival = false
-
-
-func _ready():
- _play_snd = PlaySndCommand.new()
- _change_scene = ChangeSceneCommand.new()
-
- call_deferred("_register_event")
-
-
-# Registers the exit_scene event based on the properties
-func _register_event():
- if escoria.object_manager.has(self.global_id) and\
- not escoria.event_manager.EVENT_EXIT_SCENE in escoria.object_manager.get_object(
- self.global_id
- ).events:
- var exit_scene_event_script = [
- "%s%s" % [ESCEvent.PREFIX, escoria.event_manager.EVENT_EXIT_SCENE]
- ]
-
- if switch_sound != "":
- exit_scene_event_script.append(
- "%s %s" % [_play_snd.get_command_name(), switch_sound]
- )
-
- exit_scene_event_script.append(
- "%s %s" % [_change_scene.get_command_name(), target_scene]
- )
-
- var exit_scene_event = escoria.esc_compiler.compile(
- exit_scene_event_script,
- get_class()
- ).events[escoria.event_manager.EVENT_EXIT_SCENE]
- escoria.object_manager.get_object(self.global_id)\
- .events[escoria.event_manager.EVENT_EXIT_SCENE] = exit_scene_event
diff --git a/addons/escoria-core/game/core-scripts/esc_game.gd b/addons/escoria-core/game/core-scripts/esc_game.gd
deleted file mode 100644
index 38ed9c4f..00000000
--- a/addons/escoria-core/game/core-scripts/esc_game.gd
+++ /dev/null
@@ -1,515 +0,0 @@
-# A base class for ESC game scenes
-# An extending class can be used in the project settings and is responsible
-# for managing very basic game features and controls
-extends Node2D
-class_name ESCGame
-
-
-# Emitted when the user has confirmed the crash popup
-signal crash_popup_confirmed
-
-# Signal sent when pause menu has to be displayed
-signal request_pause_menu
-
-
-# Editor debug modes
-# NONE - No debugging
-# MOUSE_TOOLTIP_LIMITS - Visualize the tooltip limits
-enum EDITOR_GAME_DEBUG_DISPLAY {
- NONE,
- MOUSE_TOOLTIP_LIMITS
-}
-
-
-# The main menu node
-export(NodePath) var main_menu
-
-# The main menu node
-export(NodePath) var pause_menu
-
-# The safe margin around tooltips
-export(float) var mouse_tooltip_margin = 50.0
-
-# Which (if any) debug mode for the editor is used
-export(EDITOR_GAME_DEBUG_DISPLAY) var editor_debug_mode = \
- EDITOR_GAME_DEBUG_DISPLAY.NONE setget _set_editor_debug_mode
-
-# The Control node underneath which all UI must be placed.
-# This should be a Control node and NOT a CanvasLayer (or any other type of) node.
-export(NodePath) var ui_parent_control_node
-
-# A reference to the node handling tooltips
-var tooltip_node: Object
-
-# Boolean indicating whether the game scene is ready to accept inputs
-# from the player. This enables using escoria.is_ready_for_inputs() in _input()
-# function of game.gd script.
-var room_ready_for_inputs: bool = false
-
-# Displayer node for hover stack debugging
-var hover_stack_displayer
-
-
-# Function called when ESCGame enters the scene tree.
-func _enter_tree():
- escoria.event_manager.connect(
- "event_finished",
- self,
- "_on_event_done"
- )
- escoria.action_manager.connect(
- "action_finished",
- self,
- "_on_action_finished"
- )
- escoria.main.connect(
- "room_ready",
- self,
- "_on_room_ready"
- )
-
- # Debug display for hover stack
- if ProjectSettings.get_setting(ESCProjectSettingsManager.ENABLE_HOVER_STACK_VIEWER) and \
- get_node_or_null("hover_stack_layer") == null:
- hover_stack_displayer = preload(
- "res://addons/escoria-core/ui_library/tools/hover_stack/hover_stack.tscn"
- ).instance()
- add_child(hover_stack_displayer)
- escoria.inputs_manager.hover_stack.connect("hover_stack_changed", hover_stack_displayer, "update")
-
-
-# Function called when ESCGame exits the scene tree.
-func _exit_tree():
- escoria.event_manager.disconnect(
- "event_finished",
- self,
- "_on_event_done"
- )
- escoria.action_manager.disconnect(
- "action_finished",
- self,
- "_on_action_finished"
- )
-
- escoria.main.disconnect(
- "room_ready",
- self,
- "_on_room_ready"
- )
-
-
-#Â Ready function
-func _ready():
- escoria.settings_manager.apply_settings()
- connect("crash_popup_confirmed", escoria, "quit",
- [], CONNECT_ONESHOT)
-
-
-# Handle debugging visualizations
-func _draw():
- if not Engine.is_editor_hint():
- return
- if editor_debug_mode == EDITOR_GAME_DEBUG_DISPLAY.NONE:
- return
-
- if editor_debug_mode == EDITOR_GAME_DEBUG_DISPLAY.MOUSE_TOOLTIP_LIMITS:
- var mouse_limits: Rect2 = get_viewport_rect().grow(
- -mouse_tooltip_margin
- )
- print("ESC {0}".format([mouse_limits]))
-
- # Draw lines for tooltip limits
- draw_rect(mouse_limits, ColorN("red"), false, 10.0)
-
-
-# Clears the tooltip content (if an ESCTooltip node exists in UI)
-func clear_tooltip():
- if tooltip_node != null:
- (tooltip_node as ESCTooltip).clear()
-
-
-# Sets up and performs default walking action
-#
-# #### Parameters
-#
-# - destination: Destination to walk to
-# - params: Parameters for the action
-# - can_interrupt: if true, this command will interrupt any ongoing event
-func do_walk(destination, params: Array = [], can_interrupt: bool = false) -> void:
- if can_interrupt:
- escoria.event_manager.interrupt()
-
- escoria.action_manager.clear_current_action()
-
- var walk_fast = false
-
- if params.size() > 1:
- walk_fast = true if params[1] else false
-
- # Check moving object.
- if not escoria.object_manager.has(params[0]):
- escoria.logger.error(
- self,
- "Walk action requested on nonexisting object: %s." % params[0]
- )
- return
-
- var moving_obj = escoria.object_manager.get_object(params[0])
- var target
-
- if destination is String:
- if not escoria.object_manager.has(destination):
- escoria.logger.error(
- self,
- "Walk action requested to nonexisting object: %s." % destination
- )
- return
-
- target = escoria.object_manager.get_object(destination)
- elif destination is Vector2:
- target = destination
-
- escoria.action_manager.perform_walk(moving_obj, target, walk_fast)
-
-
-# Called when the player left clicks on the background
-# (Needs to be overridden, if supported)
-#
-# #### Parameters
-#
-# - position: Position clicked
-func left_click_on_bg(position: Vector2) -> void:
- if escoria.main.current_scene.player:
- do_walk(
- position,
- [escoria.main.current_scene.player.global_id],
- true
- )
- else:
- escoria.logger.trace(
- self,
- "No player loaded for current scene. Ignoring left click on background."
- )
-
-
-# Called when the player right clicks on the background
-# (Needs to be overridden, if supported)
-#
-# #### Parameters
-#
-# - position: Position clicked
-func right_click_on_bg(position: Vector2) -> void:
- if escoria.main.current_scene.player:
- do_walk(
- position,
- [escoria.main.current_scene.player.global_id],
- true
- )
- else:
- escoria.logger.trace(
- self,
- "No player loaded for current scene. Ignoring right click on background."
- )
-
-
-# Called when the player double clicks on the background
-# (Needs to be overridden, if supported)
-#
-# #### Parameters
-#
-# - position: Position clicked
-func left_double_click_on_bg(position: Vector2) -> void:
- if escoria.main.current_scene.player:
- do_walk(
- position,
- [escoria.main.current_scene.player.global_id, true],
- true
- )
- else:
- escoria.logger.trace(
- self,
- "No player loaded for current scene. Ignoring left double-click on background."
- )
-
-
-# Called when an element in the scene was focused
-# (Needs to be overridden, if supported)
-#
-# #### Parameters
-#
-# - element_id: Global id of the element focused
-func element_focused(element_id: String) -> void:
- pass
-
-
-# Called when no element is focused anymore
-# (Needs to be overridden, if supported)
-func element_unfocused() -> void:
- pass
-
-
-# Called when an item was left clicked
-# (Needs to be overridden, if supported)
-#
-# #### Parameters
-#
-# - item_global_id: Global id of the item that was clicked
-# - event: The received input event
-func left_click_on_item(item_global_id: String, event: InputEvent) -> void:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
- [item_global_id, event],
- true
- )
-
-
-# Called when an item was right clicked
-# (Needs to be overridden, if supported)
-#
-# #### Parameters
-#
-# - item_global_id: Global id of the item that was clicked
-# - event: The received input event
-func right_click_on_item(item_global_id: String, event: InputEvent) -> void:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_RIGHT_CLICK,
- [item_global_id, event],
- true
- )
-
-
-# Called when an item was double clicked
-# (Needs to be overridden, if supported)
-#
-# #### Parameters
-#
-# - item_global_id: Global id of the item that was clicked
-# - event: The received input event
-func left_double_click_on_item(
- item_global_id: String,
- event: InputEvent
-) -> void:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
- [item_global_id, event],
- true
- )
-
-
-# Called when an inventory item was left clicked
-# (Needs to be overridden, if supported)
-#
-# #### Parameters
-#
-# - inventory_item_global_id: Global id of the inventory item was clicked
-# - event: The received input event
-func left_click_on_inventory_item(
- inventory_item_global_id: String,
- event: InputEvent
-) -> void:
- pass
-
-
-# Called when an inventory item was right clicked
-# (Needs to be overridden, if supported)
-#
-# #### Parameters
-#
-# - inventory_item_global_id: Global id of the inventory item was clicked
-# - event: The received input event
-func right_click_on_inventory_item(
- inventory_item_global_id: String,
- event: InputEvent
-) -> void:
- pass
-
-
-# Called when an inventory item was double clicked
-# (Needs to be overridden, if supported)
-#
-# #### Parameters
-#
-# - inventory_item_global_id: Global id of the inventory item was clicked
-# - event: The received input event
-func left_double_click_on_inventory_item(
- inventory_item_global_id: String,
- event: InputEvent
-) -> void:
- pass
-
-
-# Called when an inventory item was focused
-# (Needs to be overridden, if supported)
-#
-# #### Parameters
-#
-# - inventory_item_global_id: Global id of the inventory item that was focused
-func inventory_item_focused(inventory_item_global_id: String) -> void:
- pass
-
-
-# Called when no inventory item is focused anymore
-# (Needs to be overridden, if supported)
-func inventory_item_unfocused() -> void:
- pass
-
-
-# Called when the inventory was opened
-# (Needs to be overridden, if supported)
-func open_inventory():
- pass
-
-
-# Called when the inventory was closed
-# (Needs to be overridden, if supported)
-func close_inventory():
- pass
-
-
-# Called when the mousewheel was used
-# (Needs to be overridden, if supported)
-#
-# #### Parameter
-#
-# - direction: The direction in which the mouse wheel was rotated
-func mousewheel_action(direction: int):
- pass
-
-
-# Called when the UI should be hidden
-# (Needs to be overridden, if supported)
-func hide_ui():
- pass
-
-
-# Called when the UI should be shown
-# (Needs to be overridden, if supported)
-func show_ui():
- pass
-
-
-# Set the Editor debug mode
-#
-# #### Parameter
-#
-# - p_editor_debug_mode: EDITOR_GAME_DEBUG_DISPLAY enum (int) value
-# corresponding to the desired editor debug mode
-func _set_editor_debug_mode(p_editor_debug_mode: int) -> void:
- editor_debug_mode = p_editor_debug_mode
- update()
-
-
-# Automatically called whenever an event is finished. Can be used to reset some
-# UI elements to their default/empty state. This function can be called before
-# _on_action_finished() if the player input started an event.
-# Reimplement to performed desired actions.
-#
-# #### Parameter
-#
-# - _return_code: return code of the event (type ESCExecution)
-# - _event_name: name of the event that was just done (can be unused)
-func _on_event_done(_return_code: int, _event_name: String) -> void:
- pass
-
-
-# Automatically called whenever an action initiated by the player is finished.
-#Â Can be used to reset some UI elements to their default/empty state.
-#Â Reimplement to performed desired actions.
-func _on_action_finished() -> void:
- pass
-
-
-# Pauses the game. Reimplement to eventually show a specific UI.
-func pause_game():
- escoria.set_game_paused(true)
-
-
-# Unpause the game. Reimplement to eventually hide a specific UI.
-func unpause_game():
- escoria.set_game_paused(false)
-
-
-#Â Shows the main menu. Reimplement to show a specific UI.
-func show_main_menu():
- pass
-
-
-# Hides the main menu. Reimplement to hide a specific UI.
-func hide_main_menu():
- pass
-
-
-# Custom function that is meant to apply custom settings. Called right after
-# Escoria settings file was loaded.
-func apply_custom_settings(custom_settings: Dictionary):
- pass
-
-
-# Custom function automatically called when save game is created.
-#
-# *Returns* A Dictionary containing the custom data to be saved within the
-# game file.
-func get_custom_data() -> Dictionary:
- return {}
-
-
-# Shows the crash popup when a crash occurs
-#
-# #### Parameters
-#
-# - files: Array of strings containing the paths to the files generated on crash
-func show_crash_popup(files: Array = []) -> void:
- var crash_popup = AcceptDialog.new()
- crash_popup.popup_exclusive = true
- crash_popup.pause_mode = Node.PAUSE_MODE_PROCESS
- add_child(crash_popup)
- var files_to_send: String = ""
- for file in files:
- files_to_send += "- %s\n" % file
- crash_popup.dialog_text = tr(ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.CRASH_MESSAGE)
- ) % files_to_send
- crash_popup.popup_centered()
- escoria.set_game_paused(true)
- yield(crash_popup, "confirmed")
- emit_signal("crash_popup_confirmed")
-
-
-# *** FOR USE BY ESCORIA CORE ONLY ***
-# Hides everything under the UI Control node.
-func escoria_hide_ui():
- if ui_parent_control_node != null and not ui_parent_control_node.is_empty():
- (get_node(ui_parent_control_node) as Control).visible = false
- else:
- escoria.logger.warn(
- self,
- "UI parent Control node not defined!"
- )
-
-
-# *** FOR USE BY ESCORIA CORE ONLY ***
-# Show everything under the UI Control node.
-func escoria_show_ui():
- if ui_parent_control_node != null and not ui_parent_control_node.is_empty():
- (get_node(ui_parent_control_node) as Control).visible = true
- else:
- escoria.logger.warn(
- self,
- "UI parent Control node not defined!"
- )
-
-
-# Manage signal room_deady from main.gd.
-func _on_room_ready():
- room_ready_for_inputs = true
-
-
-# Input function to manage specific input keys.
-# Note that if any child of this class wishes to override _input, the overriding
-# method MUST call its parent's version (i.e. this method).
-func _input(event):
- if escoria.inputs_manager.input_mode == escoria.inputs_manager.INPUT_NONE:
- return
-
- if event.is_action_pressed("ui_cancel"):
- emit_signal("request_pause_menu")
diff --git a/addons/escoria-core/game/core-scripts/esc_inventory_item.gd b/addons/escoria-core/game/core-scripts/esc_inventory_item.gd
deleted file mode 100644
index e492969b..00000000
--- a/addons/escoria-core/game/core-scripts/esc_inventory_item.gd
+++ /dev/null
@@ -1,16 +0,0 @@
-# Basic information about an inventory item
-class_name ESCInventoryItem
-
-
-# Global ID of the ESCItem that uses this ESCInventoryItem
-var global_id: String = ""
-
-# The texture for the item
-var texture: Texture = null
-
-
-func _init(p_item: ESCItem) -> void:
- global_id = p_item.global_id
- texture = p_item._get_inventory_texture()
- p_item.register_components()
-
diff --git a/addons/escoria-core/game/core-scripts/esc_item.gd b/addons/escoria-core/game/core-scripts/esc_item.gd
deleted file mode 100644
index acbb50e2..00000000
--- a/addons/escoria-core/game/core-scripts/esc_item.gd
+++ /dev/null
@@ -1,882 +0,0 @@
-# An ``ESCItem`` defines a (usually interactive) item in the game.
-#
-# When interacting with an ``ESCItem``, the game character will automatically
-# walk to an ``ESCLocation`` that is created as a child of an ``ESCItem``.
-#
-# By selecting the "Is Exit" checkbox when you create an ``ESCItem``
-# node, Escoria will look for an ``:exit_scene`` event in the attached script file.
-# Any commands you place in the ``:exit_scene`` event will be run when the player
-# chooses to "use" the exit - for example, saying a goodbye, or running a
-# cutscene. Place a ``change_scene`` command inside this event to move the
-# character to the next room.
-tool
-extends Area2D
-class_name ESCItem, "res://addons/escoria-core/design/esc_item.svg"
-
-
-# Emitted when the mouse has entered this item
-#
-# #### Parameters
-#
-# - items: The inventory item node
-signal mouse_entered_item(item)
-
-# Emitted when the mouse has exited this item
-#
-# #### Parameters
-#
-# - items: The inventory item node
-signal mouse_exited_item(item)
-
-# Emitted when the item was left cliced
-#
-# #### Parameters
-#
-# - global_id: ID of this item
-signal mouse_left_clicked_item(global_id)
-
-# Emitted when the item was double cliced
-#
-# #### Parameters
-#
-# - global_id: ID of this item
-signal mouse_double_left_clicked_item(global_id)
-
-# Emitted when the item was right cliced
-#
-# #### Parameters
-#
-# - global_id: ID of this item
-signal mouse_right_clicked_item(global_id)
-
-# Emitted when the item walked to a destination
-#
-# #### Parameters
-#
-# - walk_context: The walk context of the command
-signal arrived(walk_context)
-
-
-# Group for ESCItem's that can be collided with in a scene. Used for quick
-# retrieval of such nodes to easily change their attributes at the same time.
-const GROUP_ITEM_CAN_COLLIDE = "item_can_collide"
-
-
-# The global ID of this item
-export(String) var global_id
-
-# The ESC script for this item
-export(String, FILE, "*.esc") var esc_script
-
-# If true, the ESC script may have an ``:exit_scene`` event to manage scene changes.
-# For simple exits that do not require scripted actions, the ``ESCExit`` node may be
-# preferred.
-export(bool) var is_exit
-
-# If true, object is considered as trigger. Allows using :trigger_in and
-# :trigger_out verbs in ESC scripts.
-export(bool) var is_trigger
-
-# The verb used for the trigger in ESC events
-export(String) var trigger_in_verb = "trigger_in"
-
-# The verb used for the trigger out ESC events
-export(String) var trigger_out_verb = "trigger_out"
-
-# If true, the player can interact with this item
-export(bool) var is_interactive = true
-
-# Whether this item is movable. A movable item will be scaled with the terrain
-# and be moved with commands like teleport and turn_to.
-export(bool) var is_movable = false
-
-# If true, player orients towards 'interaction_direction' as
-# player character arrives.
-export(bool) var player_orients_on_arrival = true
-
-# Let the player turn to this direction when the player arrives at the
-# item
-export(int) var interaction_direction
-
-# The name for the tooltip of this item
-export(String) var tooltip_name
-
-# Default action to use if object is not in the inventory
-export(String) var default_action
-
-# Default action to use if object is in the inventory
-export(String) var default_action_inventory
-
-# If action used by player is in this list, the game will wait for a second
-# click on another item to combine objects together (typical
-# `USE WITH `, `GIVE TO `)
-export(PoolStringArray) var combine_when_selected_action_is_in = []
-
-# If true, combination must be done in the way it is written in ESC script
-# ie. :use ON_ITEM
-# If false, combination will be tried in the other way.
-export(bool) var combine_is_one_way = false
-
-# If true, then the object must have been picked up before using it.
-# A false value is useful for items in the background, such as buttons.
-export(bool) var use_from_inventory_only = false
-
-# The visual representation for this item when its in the inventory
-export(Texture) var inventory_texture: Texture = null \
- setget ,_get_inventory_texture
-
-# Color used for dialogs
-export(Color) var dialog_color = ColorN("white")
-
-# If true, terrain scaling will not be applied and
-# node will remain at the scale set in the scene.
-export(bool) var dont_apply_terrain_scaling = false
-
-# Speed of this item ifmovable
-export(int) var speed: int = 300
-
-# Speed damp of this item if movable
-export(float) var v_speed_damp: float = 1.0
-
-# The node used to play animations
-export(NodePath) var animation_player_node: NodePath = "" \
- setget _set_animation_player_node
-
-# The node that references the camera position and zoom if this item is used
-# as a camera target
-export(NodePath) var camera_node
-
-
-#Â ESCAnimationsResource (for walking, idling...)
-var animations: ESCAnimationResource setget set_animations
-
-# Reference to the animation node (null if none was found)
-var animation_sprite = null
-
-# Reference to the current terrain
-var terrain: ESCTerrain
-
-# Reference to this items collision shape node
-var collision: Node
-
-
-# Reference to the sprite node
-var _sprite_node: Node = null
-
-# The movable subnode
-var _movable: ESCMovable = null
-
-# The identified animation player
-var _animation_player: ESCAnimationPlayer = null
-
-# Whether to force regsitration with the object manager. Defaults to false.
-var _force_registration: bool = false
-
-# Warnings for scene.
-var _scene_warnings: PoolStringArray = []
-
-
-# Add the movable node, connect signals, detect child nodes
-# and register this item
-func _ready():
- self.pause_mode = Node.PAUSE_MODE_STOP
-
- _detect_children()
-
- # We add ourselves to this group so we can easily get a reference to all
- # items in a scene tree.
- add_to_group(GROUP_ITEM_CAN_COLLIDE)
-
- validate_animations(animations)
-
- if not self.is_connected("input_event", self, "_on_input_event"):
- connect("input_event", self, "_on_input_event")
- if not self.is_connected("mouse_exited", self, "_on_mouse_exited"):
- connect("mouse_exited", self, "_on_mouse_exited")
-
- # Register and connect all elements to Escoria backoffice.
- if not Engine.is_editor_hint():
-
- if is_movable:
- _movable = ESCMovable.new()
-
- add_child(_movable)
-
- if not escoria.event_manager.is_connected(
- "event_finished",
- self,
- "_update_terrain"
- ):
- escoria.event_manager.connect(
- "event_finished",
- self,
- "_update_terrain"
- )
-
- escoria.object_manager.register_object(
- ESCObject.new(
- global_id,
- self
- ),
- null,
- _force_registration
- )
-
- terrain = escoria.room_terrain
-
- if !is_trigger:
- if not self.is_connected(
- "mouse_entered_item",
- escoria.inputs_manager,
- "_on_mouse_entered_item"
- ):
- connect(
- "mouse_entered_item",
- escoria.inputs_manager,
- "_on_mouse_entered_item"
- )
- if not self.is_connected(
- "mouse_exited_item",
- escoria.inputs_manager,
- "_on_mouse_exited_item"
- ):
- connect(
- "mouse_exited_item",
- escoria.inputs_manager,
- "_on_mouse_exited_item"
- )
- if not self.is_connected(
- "mouse_left_clicked_item",
- escoria.inputs_manager,
- "_on_mouse_left_clicked_item"
- ):
- connect(
- "mouse_left_clicked_item",
- escoria.inputs_manager,
- "_on_mouse_left_clicked_item"
- )
- if not self.is_connected(
- "mouse_double_left_clicked_item",
- escoria.inputs_manager,
- "_on_mouse_left_double_clicked_item"
- ):
- connect(
- "mouse_double_left_clicked_item",
- escoria.inputs_manager,
- "_on_mouse_left_double_clicked_item"
- )
- if not self.is_connected(
- "mouse_right_clicked_item",
- escoria.inputs_manager,
- "_on_mouse_right_clicked_item"
- ):
- connect(
- "mouse_right_clicked_item",
- escoria.inputs_manager,
- "_on_mouse_right_clicked_item"
- )
- else:
- if not self.is_connected("area_entered", self, "element_entered"):
- connect("area_entered", self, "element_entered")
- if not self.is_connected("area_exited", self, "element_exited"):
- connect("area_exited", self, "element_exited")
- if not self.is_connected("body_entered", self, "element_entered"):
- connect("body_entered", self, "element_entered")
- if not self.is_connected("body_exited", self, "element_exited"):
- connect("body_exited", self, "element_exited")
-
- # If object can be in the inventory, set default_action_inventory to same as
- # default_action, if default_action_inventory is not set
- if use_from_inventory_only and default_action_inventory.empty():
- default_action_inventory = default_action
-
- # Perform a first terrain scaling if we have to.
- if (not is_exit or dont_apply_terrain_scaling) and is_movable:
- _movable.last_scale = scale
- _movable.update_terrain()
-
-
-# Mouse exited happens on any item that mouse cursor exited, even those UNDER
-# the top level of overlapping stack.
-func _on_mouse_exited():
- if escoria.inputs_manager.hover_stack.has(self):
- escoria.inputs_manager.hover_stack.erase_item(self)
- escoria.inputs_manager.unset_hovered_node(self)
-
-
-class HoverStackSorter:
- static func sort_ascending_z_index(a, b):
- if a.z_index < b.z_index:
- return true
- return false
-
-
-# Manage input events on the item
-#
-# #### Parameters
-#
-# - _viewport: the viewport node the event entered
-# - event: the input event
-# - _shape_idx is the child index of the clicked Shape2D.
-func _on_input_event(_viewport: Object, event: InputEvent, _shape_idx: int):
- if event is InputEventMouseMotion:
- var physics2d_dss: Physics2DDirectSpaceState = get_world_2d().direct_space_state
- var colliding: Array = physics2d_dss.intersect_point(get_global_mouse_position(), 32, [], 0x7FFFFFFF, true, true)
- var colliding_nodes = []
- for c in colliding:
- if c.collider.get("global_id") \
- and escoria.action_manager.is_object_actionable(c.collider.global_id):
- colliding_nodes.push_back(c.collider)
-
- if colliding_nodes.empty():
- return
- colliding_nodes.sort_custom(HoverStackSorter, "sort_ascending_z_index")
- escoria.inputs_manager.hover_stack.clear()
- escoria.inputs_manager.hover_stack.add_items(colliding_nodes)
- escoria.inputs_manager.set_hovered_node(colliding_nodes.back())
-
-
-# Manage mouse button clicks on this item by sending out signals
-#
-# #### Parameters
-#
-# - input_event: Triggered event
-func _unhandled_input(input_event: InputEvent) -> void:
- # If this is a trigger, then escoria.inputs_manager is not wired up to
- # receive the signals this function might dispatch. In particular,
- # calling get_tree().set_input_as_handled() unnecessarily will prevent
- # the ESCBackground from being able to process the event.
- # See https://github.com/godot-escoria/escoria-issues/issues/147.
- if is_trigger:
- return
-
- var event = input_event
- # Note that event could be InputEventMouseButton, InputEventJoypadButton,
- # or something else. As such, the value of the `button_index` property
- # must be read in the context of the type of input event.
- if input_event is InputEventJoypadButton:
- if not input_event.is_action_pressed(escoria.inputs_manager.ESC_UI_PRIMARY_ACTION):
- return
-
- # For now, rather than refactor input handling to be more generic
- # to accommodate gamepad support, we create a synthetic mouse event
- # based on the InputEventJoypadButton.
- event = InputEventMouseButton.new()
- event.button_index = BUTTON_LEFT
- event.doubleclick = false
- event.pressed = true
- # ESCActionManager expects to read the position off of the event.
- event.position = get_global_mouse_position()
-
- if event is InputEventMouseButton and event.is_pressed():
- if not escoria.current_state == escoria.GAME_STATE.DEFAULT:
- escoria.logger.info(
- self,
- "Current game state doesn't accept interactions."
- )
- return
- var p = get_global_mouse_position()
- if _is_in_shape(p) and escoria.action_manager.is_object_actionable(global_id):
- if event.doubleclick and event.button_index == BUTTON_LEFT:
- emit_signal("mouse_double_left_clicked_item", self, event)
- get_tree().set_input_as_handled()
- elif event.button_index == BUTTON_LEFT:
- emit_signal("mouse_left_clicked_item", self, event)
- get_tree().set_input_as_handled()
- elif event.button_index == BUTTON_RIGHT:
- emit_signal("mouse_right_clicked_item", self, event)
- get_tree().set_input_as_handled()
-
-
-# To display warnings in the scene tree should there be any.
-func _get_configuration_warning():
- validate_animations(animations)
- return _scene_warnings.join("\n")
-
-
-func _is_in_shape(position: Vector2) -> bool:
- var colliders = get_world_2d().direct_space_state.intersect_point(
- position,
- 32,
- [],
- 2147483647,
- true,
- true
- )
- for _owner in get_shape_owners():
- for _shape_id in range(0, shape_owner_get_shape_count(_owner)):
- for _collider in colliders:
- if _collider.collider == self and _collider.shape == _shape_id:
- return true
- return false
-
-
-# Validates the ESCAnimationResource if it exists. Note that we pass in the
-# ESCAnimationResource as an argument so that it can also be used to validate
-# an ESCAnimationResource prior to being set.
-#
-# #### Parameters
-#
-# - animation_resource: the ESCAnimationResource to validate.
-func validate_animations(animations_resource: ESCAnimationResource) -> void:
- if not is_instance_valid(animations_resource):
- return
-
- # This initialization must always be here since this is a tool script.
- _scene_warnings = []
-
- if is_instance_valid(animations_resource):
- _validate_animations_property_all_not_null(animations_resource.dir_angles, "dir_angles")
-
- var num_dir_angles = animations_resource.dir_angles.size()
-
- if animations_resource.directions.size() != num_dir_angles:
- _scene_warnings.append("%s animation angles specified but %s 'directions' animation(s) given. [%s]" \
- % [num_dir_angles, animations_resource.directions.size(), _get_identifier_as_key_value()])
- else:
- _validate_animations_property_all_not_null(animations_resource.directions, "directions")
-
- if animations_resource.idles.size() != num_dir_angles:
- _scene_warnings.append("%s animation angles specified but %s 'idles' animation(s) given. [%s]" \
- % [num_dir_angles, animations_resource.idles.size(), _get_identifier_as_key_value()])
- else:
- _validate_animations_property_all_not_null(animations_resource.idles, "idles")
-
- if animations_resource.speaks.size() != num_dir_angles:
- _scene_warnings.append("%s animation angles specified but %s 'speaks' animation(s) given. [%s]" \
- % [num_dir_angles, animations_resource.speaks.size(), _get_identifier_as_key_value()])
- else:
- _validate_animations_property_all_not_null(animations_resource.speaks, "speaks")
-
- if Engine.is_editor_hint():
- update_configuration_warning()
- elif _scene_warnings.size() > 0:
- escoria.logger.error(
- self,
- _scene_warnings.join(", ")
- )
-
-
-# Setter for the animations property.
-func set_animations(p_animations: ESCAnimationResource) -> void:
- if p_animations == null:
- return
-
- animations = p_animations
-
- if not animations.is_connected("changed", self, "_validate_animations"):
- animations.connect("changed", self, "_validate_animations")
-
-
-# Return the animation player node
-func get_animation_player() -> Node:
- if _animation_player == null:
- var player_node_path = animation_player_node
- if player_node_path == "":
- for child in self.get_children():
- if child is AnimatedSprite or \
- child is AnimationPlayer:
- player_node_path = child.get_path()
- if player_node_path == "":
- escoria.logger.warn(
- self,
- "Can not find animation_player or animated sprite for %s." % global_id
- )
- elif not has_node(player_node_path):
- escoria.logger.warn(
- self,
- "Can not find animation_player node at path %s for %s." % [player_node_path, global_id]
- )
- else:
- _animation_player = ESCAnimationPlayer.new(
- get_node(player_node_path)
- )
- return _animation_player
-
-
-# Return the position the player needs to walk to to interact with this
-# item. That can either be a direct Position2D child or a collision shape
-#
-# **Returns** The interaction position
-func get_interact_position() -> Vector2:
- var multiple_positions_found = false
- var interact_position = null
- for c in get_children():
- if c is Position2D:
- if interact_position != null:
- multiple_positions_found = true
- interact_position = c.global_position
-
- if interact_position == null and collision != null:
- interact_position = collision.global_position
- escoria.logger.warn(
- self,
- "No ESCLocation found to walk to for object " +
- "%s. Middle of collision shape will be used." % global_id)
-
- if multiple_positions_found:
- escoria.logger.warn(
- self,
- "Multiple ESClocations found to walk to for object " +
- "%s. Last one will be used." % global_id)
- return interact_position
-
-
-# React to the mouse entering the item by emitting the respective signal
-func mouse_entered():
- if escoria.action_manager.is_object_actionable(global_id):
- emit_signal("mouse_entered_item", self)
-
-
-# React to the mouse exiting the item by emitting the respective signal
-func mouse_exited():
- emit_signal("mouse_exited_item", self)
-
-
-# Another item (e.g. the player) has entered this item
-#
-# #### Parameters
-#
-# - body: Other object that has entered the item
-func element_entered(body):
- if body is ESCBackground or body.get_parent() is ESCBackground:
- return
- escoria.action_manager.do(
- escoria.action_manager.ACTION.TRIGGER_IN,
- [global_id, body.global_id, trigger_in_verb]
- )
-
-
-# Another item (e.g. the player) has exited this element
-# #### Parameters
-#
-# - body: Other object that has entered the item
-func element_exited(body):
- if body is ESCBackground or body.get_parent() is ESCBackground:
- return
- escoria.action_manager.do(
- escoria.action_manager.ACTION.TRIGGER_OUT,
- [global_id, body.global_id, trigger_out_verb]
- )
-
-
-# Use the movable node to teleport this item to the target item
-#
-# #### Parameters
-#
-# - target: Target node to teleport to
-func teleport(target: Node) -> void:
- if is_movable:
- _movable.teleport(target)
- else:
- escoria.logger.warn(
- self,
- "Node %s cannot \"teleport\". Its \"is_movable\" parameter is false." %self
- )
-
-
-# Use the movable node to teleport this item to the target position
-#
-# #### Parameters
-#
-# - target: Vector2 position to teleport to
-func teleport_to(target: Vector2) -> void:
- if is_movable:
- _movable.teleport_to(target)
- else:
- escoria.logger.warn(
- self,
- "Node %s cannot \"teleport_to\". Its \"is_movable\" parameter is false." %self
- )
-
-
-# Use the movable node to make the item walk to the given position
-#
-# #### Parameters
-#
-# - pos: Position to walk to
-# - p_walk_context: Walk context to use
-func walk_to(pos: Vector2, p_walk_context: ESCWalkContext = null) -> void:
- if is_movable:
- _movable.walk_to(pos, p_walk_context)
- else:
- escoria.logger.warn(
- self,
- "Node %s cannot use \"walk_to\". Its \"is_movable\" parameter is false." %self
- )
-
-
-# Stop the movable node immediately and remain where it is at this moment,
-# or teleport it directly at destination position if 'to_target' is true.
-#
-# #### Parameters
-#
-# - to_target: if true, the movable node is teleport directly at its target
-# destination
-func stop_walking_now(to_target: bool = false) -> void:
- if is_movable:
- var where: Vector2 = position
- if to_target:
- where = _movable.walk_destination
- _movable.walk_stop(where)
- else:
- escoria.logger.warn(
- self,
- "Node %s cannot use \"stop_walking_now\". Its \"is_movable\" parameter is false." %self
- )
-
-
-# Set the moving speed
-#
-# #### Parameters
-#
-# - speed_value: Set the new speed
-func set_speed(speed_value: int) -> void:
- speed = speed_value
-
-
-# Check whether this item moved
-func has_moved() -> bool:
- return _movable.moved if is_movable else false
-
-
-# Return the sprite node
-func get_sprite() -> Node:
- if _sprite_node == null:
- for child in self.get_children():
- if child is AnimatedSprite or child is Sprite:
- _sprite_node = child
- if _sprite_node == null:
- escoria.logger.error(
- self,
- "No sprite node found in the scene %s." % get_path()
- )
- return _sprite_node
-
-
-# Set the angle
-#
-# #### Parameters
-#
-# - deg: The angle degree to set
-# - wait: Wait this amount of seconds until continuing with turning around
-func set_angle(deg: int, wait: float = 0.0):
- if is_movable:
- _movable.set_angle(deg, wait)
- else:
- escoria.logger.warn(
- self,
- "Node %s cannot use \"set_angle\". Its \"is_movable\" parameter is false." % self
- )
-
-
-# Turn to face another object
-#
-# #### Parameters
-#
-# - deg: The angle degree to set
-# - float Wait this amount of seconds until continuing with turning around
-func turn_to(object: Node, wait: float = 0.0):
- if is_movable:
- _movable.turn_to(object, wait)
- else:
- escoria.logger.warn(
- self,
- "Node %s cannot use \"turn_to\". Its \"is_movable\" parameter is false." % self
- )
-
-
-# Check everything is in place to play talk animations
-func check_talk_possible():
- if is_movable and (_movable.last_dir < 0 \
- or _movable.last_dir >= animations.speaks.size()):
- escoria.logger.warn(
- self,
- "Node %s cannot talk. Its \"last_dir\" parameter is invalid: %s." \
- % [self, _movable.last_dir]
- )
- return false
- if not is_instance_valid(animations):
- escoria.logger.warn(
- self,
- "Node %s cannot talk. Its \"animations\" parameter is empty." \
- % self
- )
- return false
- if animations.speaks.size() == 0:
- escoria.logger.warn(
- self,
- "Node %s cannot talk. Its \"animations.speaks\" array is empty." \
- % self
- )
- return false
- if not get_animation_player():
- escoria.logger.warn(
- self,
- "Node %s cannot talk. Its animation player can't be found." \
- % self
- )
- return false
- return true
-
-
-# Play the talking animation
-func start_talking():
- if not check_talk_possible():
- return
-
- var animation_player = get_animation_player()
-
- if animation_player.is_playing():
- animation_player.stop()
-
- if is_movable and animations.speaks[_movable.last_dir].mirrored \
- and not _movable.is_mirrored:
- _sprite_node.scale.x *= -1
-
- var animation_direction = _movable.last_dir if is_movable else 0
- animation_player.play(
- animations.speaks[animation_direction].animation
- )
-
-
-# Stop playing the talking animation
-func stop_talking():
- if not check_talk_possible():
- return
-
- var animation_player = get_animation_player()
-
- if animation_player.is_playing():
- animation_player.stop()
-
- if is_movable:
- if animations.speaks[_movable.last_dir].mirrored \
- and not _movable.is_mirrored:
- # Allow this function to be called multiple times without setting
- # the direction incorrectly
- if _sprite_node.scale.x < 1:
- _sprite_node.scale.x *= -1
-
- animation_player.play(
- animations.idles[_movable.last_dir].animation
- )
- else:
- animation_player.play(
- animations.idles[0].animation
- )
-
-# Replay the last idle animation
-func update_idle():
- get_animation_player().play(
- animations.idles[_movable.last_dir].animation
- )
-
-
-# Return the camera position if a camera_position_node exists or the
-# global position of the player
-func get_camera_node():
- if has_node(camera_node):
- escoria.logger.debug(
- self,
- "Camera node found - directing camera to the camera_node on %s."
- % global_id
- )
- return get_node(camera_node)
- return self
-
-
-# Detect the child nodes and set respective references
-func _detect_children() -> void:
- # Initialize collision variable.
- for c in get_children():
- if c is CollisionShape2D or c is CollisionPolygon2D:
- collision = c
-
-
-# Upate the terrain when an event finished
-func _update_terrain(rc: int, event_name: String) -> void:
- if is_movable:
- _movable.update_terrain(event_name)
-
-
-func _get_property_list():
- var properties = []
- properties.append({
- "name": "animations",
- "type": TYPE_OBJECT,
- "hint": PROPERTY_HINT_RESOURCE_TYPE,
- "hint_string": "ESCAnimationResource"
- })
- return properties
-
-
-# Set the node path to the animation player
-#
-# #### Parameters
-#
-# - node_path: Path to the player node
-func _set_animation_player_node(node_path: NodePath):
- if not Engine.is_editor_hint():
- return
-
- if node_path == "":
- animation_player_node = node_path
- return
-
- assert(has_node(node_path), "Node with path %s not found" % node_path)
- assert(
- get_node(node_path) is AnimatedSprite or \
- get_node(node_path) is AnimationPlayer,
- "Selected node has to be an AnimatedSprite or AnimationPlayer node"
- )
-
- animation_player_node = node_path
-
-
-# Returns either the set inventory texture or the texture of a TextureRect
-# found as a child if it is null
-func _get_inventory_texture() -> Texture:
- if inventory_texture == null:
- for c in get_children():
- if c is TextureRect or c is Sprite:
- return c.texture
- return null
- else:
- return inventory_texture
-
-
-# Checks whether the given ESCAnimationResource property array has all non-null entries, and adds
-# to the scene's warnings if not.
-#
-# #### Parameters
-#
-# - property: ESCAnimationResource property. Must be an array.
-# - property_name: the name of the property being passed in.
-func _validate_animations_property_all_not_null(property: Array, property_name: String) -> void:
- var has_empty_entry: bool = false
-
- for item in property:
- if item == null:
- has_empty_entry = true
- break
-
- if has_empty_entry:
- _scene_warnings.append("At least one entry in '%s' is empty. [%s]" % [property_name, _get_identifier_as_key_value()])
-
-
-# Returns the global ID as a key/value pair. If none is specified, use the node name.
-# Used to tag messages.
-func _get_identifier_as_key_value() -> String:
- if self.global_id:
- return "global_id: %s" % self.global_id
- else:
- return "node: %s" % get_name()
-
-
-# Whether the item is currently moving.
-#
-# *Returns*
-# Returns true if the player is currently moving, false otherwise
-func is_moving() -> bool:
- return _movable.task != ESCMovable.MovableTask.NONE if is_movable else false
diff --git a/addons/escoria-core/game/core-scripts/esc_location.gd b/addons/escoria-core/game/core-scripts/esc_location.gd
deleted file mode 100644
index d8e2f3a1..00000000
--- a/addons/escoria-core/game/core-scripts/esc_location.gd
+++ /dev/null
@@ -1,80 +0,0 @@
-#Â A simple node extending Position2D with a global ID so that it can be
-# referenced in ESC Scripts. Movement-based commands like `walk_to_pos` will
-# automatically use an `ESCLocation` that is a child of the destination node.
-# Commands like `turn_to`--which are not movement-based--will ignore child
-# `ESCLocation`s and refer to the parent node.
-tool
-extends Position2D
-class_name ESCLocation, "res://addons/escoria-core/design/esc_location.svg"
-
-
-signal is_start_location_set
-
-
-const MULTIPLE_START_LOCATIONS_WARNING = \
- "Only 1 ESCLocation should have is_start_location set to true in an ESCRoom"
-
-
-# The global ID of this item
-export(String) var global_id
-
-# If true, this ESCLocation is considered as a player start location
-export(bool) var is_start_location = false setget set_is_start_location
-
-# If true, player orients towards 'interaction_direction' as
-# player character arrives.
-export(bool) var player_orients_on_arrival = true
-
-# Let the player turn to this direction when the player arrives
-# at the item
-export(int) var interaction_direction
-
-
-var _multiple_start_locations_exist: bool = false setget set_multiple_locations_exist
-
-
-# Used by "is" keyword to check whether a node's class_name
-# is the same as p_classname.
-#
-# ##Â Parameters
-#
-# p_classname: String class to compare against
-func is_class(p_classname: String) -> bool:
- return p_classname == "ESCLocation"
-
-
-# Ready function
-func _ready():
- if not Engine.is_editor_hint():
- if not self.global_id.empty():
- escoria.object_manager.register_object(
- ESCObject.new(
- self.global_id,
- self
- )
- )
-
-
-func _exit_tree():
- if Engine.is_editor_hint():
- if is_start_location:
- emit_signal("is_start_location_set", self)
-
-
-func _get_configuration_warning():
- if _multiple_start_locations_exist:
- return MULTIPLE_START_LOCATIONS_WARNING
-
- return ""
-
-
-func set_multiple_locations_exist(value: bool) -> void:
- _multiple_start_locations_exist = value
- update_configuration_warning()
-
-
-func set_is_start_location(value: bool) -> void:
- is_start_location = value
-
- if Engine.is_editor_hint() and is_instance_valid(get_owner()):
- emit_signal("is_start_location_set")
diff --git a/addons/escoria-core/game/core-scripts/esc_player.gd b/addons/escoria-core/game/core-scripts/esc_player.gd
deleted file mode 100644
index 31371bad..00000000
--- a/addons/escoria-core/game/core-scripts/esc_player.gd
+++ /dev/null
@@ -1,24 +0,0 @@
-# A playable character
-tool
-extends ESCItem
-class_name ESCPlayer, "res://addons/escoria-core/design/esc_player.svg"
-
-
-
-
-# Whether the player can be selected like an item
-export(bool) var selectable = false
-
-
-# A player is always movable
-func _init():
- is_movable = true
- _force_registration = true
-
-
-# Ready function
-func _ready():
- if selectable:
- ._ready()
- else:
- tooltip_name = ""
diff --git a/addons/escoria-core/game/core-scripts/esc_resource_cache.gd b/addons/escoria-core/game/core-scripts/esc_resource_cache.gd
deleted file mode 100644
index 3dc2fada..00000000
--- a/addons/escoria-core/game/core-scripts/esc_resource_cache.gd
+++ /dev/null
@@ -1,147 +0,0 @@
-# A cache for resources
-extends Node
-class_name ESCResourceCache
-
-
-signal resource_loading_progress(path, progress)
-signal resource_loading_done(path)
-signal resource_queue_progress(queue_size)
-
-
-var queue: Array = []
-var pending: Dictionary = {}
-
-
-func queue_resource(path: String, p_in_front: bool = false, p_permanent: bool = false):
- if path in pending:
- return
-
- elif ResourceLoader.has(path):
- var res = ResourceLoader.load(path)
- pending[path] = ESCResourceDescriptor.new(res, p_permanent)
- else:
- var res = ResourceLoader.load_interactive(path)
- res.set_meta("path", path)
- if p_in_front:
- queue.insert(0, res)
- else:
- queue.push_back(res)
- pending[path] = ESCResourceDescriptor.new(res, p_permanent)
-
-
-func cancel_resource(path):
- if path in pending:
- if pending[path].res is ResourceInteractiveLoader:
- queue.erase(pending[path].res)
- pending.erase(path)
-
-
-func clear():
- for p in pending.keys():
- if pending[p].permanent:
- continue
- cancel_resource(p)
- #queue = []
- #pending = {}
-
-
-func get_progress(path):
- var ret = -1
- if path in pending:
- if pending[path].res is ResourceInteractiveLoader:
- ret = float(pending[path].res.get_stage()) / float(pending[path].res.get_stage_count())
- else:
- ret = 1.0
- emit_signal("resource_loading_done", path)
- emit_signal("resource_loading_progress", path, ret)
-
- return ret
-
-
-func is_ready(path):
- var ret
-
- if path in pending:
- ret = !(pending[path].res is ResourceInteractiveLoader)
- else:
- ret = false
-
- return ret
-
-
-func _wait_for_resource(res, path):
- while true:
- #VisualServer.call("sync") # workaround because sync is a keyword
- VisualServer.force_sync()
- OS.delay_usec(16000) # wait 1 frame
-
- if queue.size() == 0 || queue[0] != res:
- return pending[path].res
-
-
-func get_resource(path):
- if path in pending:
- if pending[path].res is ResourceInteractiveLoader:
- var res = pending[path].res
- if res != queue[0]:
- var pos = queue.find(res)
- queue.remove(pos)
- queue.insert(0, res)
-
- res = _wait_for_resource(res, path)
-
- if !pending[path].permanent:
- pending.erase(path)
-
- return res
-
- else:
- var res = pending[path].res
- if !pending[path].permanent:
- pending.erase(path)
-
- return res
- else:
- # We can't use ESCProjectSettingsManager here since this method
- # can be called from escoria._init()
- if not ProjectSettings.get_setting("escoria/platform/skip_cache"):
- var res = ResourceLoader.load(path)
- pending[path] = ESCResourceDescriptor.new(res, true)
- return res
- return ResourceLoader.load(path)
-
-
-func print_progress(p_path, p_progress):
- printt(p_path, "loading", round(p_progress * 100), "%")
-
-
-func res_loaded(p_path):
- printt("loaded resource", p_path)
-
-
-func print_queue_progress(p_queue_size):
- printt("queue size:", p_queue_size)
-
-
-func start():
- pass
- ## Uncomment these for debug, or wait for someone to implement log levels
- # connect("resource_loading_progress", self, "print_progress")
- # connect("resource_loading_done", self, "res_loaded")
- # connect("resource_queue_progress", self, "print_queue_progress")
-
-
-func _process(_delta) -> void:
- while queue.size() > 0:
- var res = queue[0]
-
- var ret = res.poll()
-
- var path = res.get_meta("path")
- if ret == ERR_FILE_EOF || ret != OK:
- printt("finished loading ", path)
- if path in pending: # else it was already retrieved
- pending[res.get_meta("path")].res = res.get_resource()
-
- queue.erase(res) # something might have been put at the front of the queue while we polled, so use erase instead of remove
- emit_signal("resource_queue_progress", queue.size())
diff --git a/addons/escoria-core/game/core-scripts/esc_room.gd b/addons/escoria-core/game/core-scripts/esc_room.gd
deleted file mode 100644
index 12c2d6c0..00000000
--- a/addons/escoria-core/game/core-scripts/esc_room.gd
+++ /dev/null
@@ -1,188 +0,0 @@
-# A room in an Escora based game
-tool
-extends Node2D
-class_name ESCRoom, "res://addons/escoria-core/design/esc_room.svg"
-
-
-# Debugging displays for a room
-# NONE: No debug display
-# CAMERA_LIMITS: Display the camera limits
-enum EditorRoomDebugDisplay {
- NONE,
- CAMERA_LIMITS
-}
-
-const ESC_BACKGROUND_NAME = "escbackground"
-
-
-# The global id of this room
-export(String) var global_id = ""
-
-# The ESC script of this room
-export(String, FILE, "*.esc") var esc_script = ""
-
-# The player inside this scene
-export(PackedScene) var player_scene
-
-# The camera limits available in this room
-export(Array, Rect2) var camera_limits: Array \
- = [Rect2()] setget set_camera_limits
-
-# The editor debug display mode
-export(EditorRoomDebugDisplay) var editor_debug_mode \
- = EditorRoomDebugDisplay.NONE setget set_editor_debug_mode
-
-
-# The player scene instance
-var player
-
-# The player camera
-var player_camera: ESCCamera
-
-# The game scene instance
-var game
-
-# Compiled ESCScript
-var compiled_script: ESCScript
-
-#Â Whether automatic transition are enabled or not
-var enabled_automatic_transitions = true
-
-# Whether this room was run directly with Play Scene (F6)
-var is_run_directly = false
-
-
-# Start the random number generator when the camera limits should be displayed
-func _enter_tree():
- if editor_debug_mode == EditorRoomDebugDisplay.CAMERA_LIMITS:
- randomize()
-
-
-# Sanitize camera limits, add player node and set the global id to the
-# name of this node if it's not set manually
-func _ready():
- # Might as well just check here.
- if get_parent() == get_tree().root \
- and ESCProjectSettingsManager.get_setting(
- "application/run/main_scene"
- ) != self.filename:
- is_run_directly = true
-
- if Engine.is_editor_hint():
- _connect_location_nodes()
- _validate_start_locations()
- return
-
- # If room has no ESCBackground child, add one
- var found_escbackground: bool = false
- for child in get_children():
- if child is ESCBackground:
- found_escbackground = true
- move_child(child, 0)
- if not found_escbackground:
- var esc_bg = ESCBackground.new()
- esc_bg.name = ESC_BACKGROUND_NAME
- if not camera_limits.empty():
- esc_bg.set_size(camera_limits.front().size)
- add_child(esc_bg)
- move_child(esc_bg, 0)
-
- escoria.room_manager.init_room(self)
-
-
-# Draw the camera limits visualization if enabled
-func _draw():
- if not Engine.is_editor_hint():
- return
- if editor_debug_mode == EditorRoomDebugDisplay.NONE:
- return
-
- var camera_limits_colors: Array = [
- ColorN("red"), ColorN("blue"), ColorN("green")
- ]
-
- # If there are more camera limits than colors defined for them, add more.
- if camera_limits.size() > camera_limits_colors.size():
- for i in camera_limits.size() - camera_limits_colors.size():
- camera_limits_colors.push_back(Color(randf(), randf(), randf(), 1.0))
-
- # Draw lines for camera limits
- for i in camera_limits.size():
- draw_rect(camera_limits[i], camera_limits_colors[i], false, 10.0)
- var temp_control = Control.new()
- var default_font = temp_control.get_font("font")
- temp_control.queue_free()
-
- draw_string(default_font, Vector2(camera_limits[i].position.x + 30,
- camera_limits[i].position.y + 30), str(i), camera_limits_colors[i])
-
-
-# Listen for any signals from ESCLocation indicating that the is_start_location attribute
-# has been set/unset in order to update start location validation.
-func _connect_location_nodes() -> void:
- _connect_location_nodes_in_tree(self)
-
-
-func _connect_location_nodes_in_tree(node: Node):
- for n in node.get_children():
- if n is ESCLocation:
- if not n.is_connected("is_start_location_set", self, "_validate_start_locations"):
- n.connect("is_start_location_set", self, "_validate_start_locations")
-
- if n.get_child_count() > 0:
- _connect_location_nodes_in_tree(n)
-
-
-# Validate that we only have one start location for this scene. If we don't, call it out in the
-# scene tree via configuration warnings.
-#
-# We may have to ignore a node if it's being removed/deleted from the scene tree.
-func _validate_start_locations(to_ignore: ESCLocation = null):
- var esc_locations: Array = _find_esc_locations(self)
- var num_start_locations: int = 0
-
- for n in esc_locations:
- if n == to_ignore:
- continue
-
- num_start_locations += 1 if n.is_start_location else 0
-
- for n in esc_locations:
- if n == to_ignore:
- continue
-
- n.set_multiple_locations_exist(n.is_start_location and num_start_locations > 1)
-
-
-func _find_esc_locations(node: Node) -> Array:
- var esc_locations: Array = []
-
- for n in node.get_children():
- if n is ESCLocation:
- esc_locations.append(n)
-
- if n.get_child_count() > 0:
- esc_locations.append_array(_find_esc_locations(n))
-
- return esc_locations
-
-
-# Set the camera limits
-#
-# #### Parameters
-#
-# - p_camera_limits: An array of Rect2Ds as camera limits
-func set_camera_limits(p_camera_limits: Array) -> void:
- camera_limits = p_camera_limits
- update()
-
-
-# Set the editor debug mode
-#
-# #### Parameters
-#
-# - p_editor_debug_mode: The debug mode to set for the room
-func set_editor_debug_mode(p_editor_debug_mode: int) -> void:
- editor_debug_mode = p_editor_debug_mode
- update()
-
diff --git a/addons/escoria-core/game/core-scripts/esc_terrain.gd b/addons/escoria-core/game/core-scripts/esc_terrain.gd
deleted file mode 100644
index 69028a36..00000000
--- a/addons/escoria-core/game/core-scripts/esc_terrain.gd
+++ /dev/null
@@ -1,263 +0,0 @@
-# A walkable Terrains
-tool
-extends Navigation2D
-class_name ESCTerrain, "res://addons/escoria-core/design/esc_terrain.svg"
-
-
-# Logger class
-const Logger = preload("res://addons/escoria-core/game/esc_logger.gd")
-
-
-# Visualize scales or the lightmap for debugging purposes
-enum DebugMode {
- NONE
- SCALES
- LIGHTMAP
-}
-
-
-# Scaling texture
-export(Texture) var scales setget _set_scales
-
-# Minimum scaling
-export(float) var scale_min = 0.3
-
-# Maximum scaling
-export(float) var scale_max = 1.0
-
-# Lightmap texture
-export(Texture) var lightmap setget _set_lightmap
-
-# The scaling factor for the scale and light maps
-export(Vector2) var bitmaps_scale = Vector2(1,1) setget _set_bm_scale
-
-# Multiplier applied to the player speed on this terrain
-export(float) var player_speed_multiplier = 1.0
-
-# Multiplier how much faster the player will walk when fast mode is on
-# (double clicked)
-export(float) var player_doubleclick_speed_multiplier = 1.5
-
-# Additional modulator to the lightmap texture
-export(Color) var lightmap_modulate = Color(1, 1, 1, 1)
-
-# Currently selected debug visualize mode
-export(int, "None", "Scales", "Lightmap") var debug_mode = DebugMode.NONE \
- setget _set_debug_mode
-
-
-# The currently activ navigation polygon
-var current_active_navigation_instance: NavigationPolygonInstance = null
-
-# Currently visualized texture for debug mode
-var _texture = null
-
-# The image from the lightmap texture
-var _lightmap_data
-
-# Prohibits multiple calls to update_texture
-var _texture_in_update = false
-
-# Logger instance
-onready var logger = Logger.ESCLoggerFile.new()
-
-# Set a reference to the active navigation polygon, register to Escoria
-# and update the texture
-func _ready():
- connect("child_entered_tree", self, "_check_multiple_enabled_navpolys")
- connect("child_exiting_tree", self, "_check_multiple_enabled_navpolys", [true])
-
- _check_multiple_enabled_navpolys()
- if !Engine.is_editor_hint():
- escoria.room_terrain = self
- _update_texture()
-
-
-# Checks whether multiple navigation polygons are enabled.
-# Shows a warning in the terminal if this happens.
-# TODO: change this "simple" console log for an editor warning
-# by overriding Node._get_configuration_warning() after we get rid of
-# deprecated Navigation2D.
-#
-# #### Parameters
-#
-# - node: if this method is triggered by child_entered_tree or
-# child_exited_tree signals, parameter is the added node.
-func _check_multiple_enabled_navpolys(node: Node = null, is_exiting: bool = false) -> void:
- var navigation_enabled_found = false
- if node != null \
- and not is_exiting\
- and node is NavigationPolygonInstance \
- and node.enabled:
- navigation_enabled_found = true
-
- for n in get_children():
- if is_exiting and n == node:
- continue
- if n is NavigationPolygonInstance and n.enabled:
- if navigation_enabled_found:
- if Engine.is_editor_hint():
- logger.warn(
- self,
- "Multiple NavigationPolygonInstances enabled " + \
- "at the same time."
- )
- else:
- logger.error(
- self,
- "Multiple NavigationPolygonInstances enabled " + \
- "at the same time."
- )
- return
- else:
- navigation_enabled_found = true
- current_active_navigation_instance = n
-
-
-# Return the Color of the lightmap pixel for the specified position
-#
-# #### Parameters
-#
-# - pos: Position to calculate lightmap for
-# **Returns** The color of the given point
-func get_light(pos: Vector2) -> Color:
- if not lightmap or lightmap.get_data().is_empty():
- return Color(1, 1, 1, 1)
- var c = _get_color(_lightmap_data, pos)
- return _get_color(_lightmap_data, pos) * lightmap_modulate
-
-
-# Calculate the scale inside the scale range for a given scale factor
-#
-# #### Parameters
-#
-# - factor: The factor for the scaling according to the scale map
-# **Returns** The scaling
-func get_scale_range(factor: float) -> Vector2:
- factor = scale_min + (scale_max - scale_min) * factor
- return Vector2(factor, factor)
-
-
-# Get the terrain scale factor for a given position
-#
-# #### Parameters
-#
-# - pos: The position to calculate for
-# **Returns** The scale factor for the given position
-func get_terrain(pos: Vector2) -> float:
- if scales == null || scales.get_data().is_empty():
- return 1.0
- return _get_color(scales.get_data(), pos).v
-
-
-# Small helper to get the color of an image at a position
-func _get_color(image: Image, pos: Vector2) -> Color:
- image.lock()
- var color=image.get_pixel(pos.x, pos.y)
- image.unlock()
- return color
-
-
-# Set the bitmap scaling
-#
-# #### Parameters
-#
-# - p_scale: Scale to set
-func _set_bm_scale(p_scale: Vector2):
- bitmaps_scale = p_scale
- _update_texture()
-
-
-# Set the lightmap texture
-#
-# #### Parameters
-#
-# - p_lightmap: Lightmap texture to set
-func _set_lightmap(p_lightmap: Texture):
- var need_init = (lightmap != p_lightmap) or (lightmap and not _lightmap_data)
-
- lightmap = p_lightmap
-
- # It's bad enough a new copy is created when reading a pixel, we don't
- # also need to get the data for every read to make yet another copy
- if need_init:
- if _lightmap_data:
- _lightmap_data.unlock()
- _lightmap_data = lightmap.get_data()
- _lightmap_data.lock()
-
- _update_texture()
-
-
-# Set the scales texture
-#
-# #### Parameters
-#
-# - p_scales: Scale texture to set
-func _set_scales(p_scales: Texture):
- scales = p_scales
- _update_texture()
-
-
-# Set the debug mode
-#
-# #### Parameters
-#
-# - p_mode: Debug mode to set
-func _set_debug_mode(p_mode: int):
- debug_mode = p_mode
- _update_texture()
-
-
-# Update the debug texture, if it is dirty
-func _update_texture():
- if _texture_in_update:
- return
- _texture_in_update = true
- call_deferred("_do_update_texture")
-
-
-# Update the texture and optionally set the debug texture
-func _do_update_texture():
- _texture_in_update = false
- if !is_inside_tree() or !Engine.is_editor_hint():
- return
-
- if debug_mode == DebugMode.NONE:
- update()
- return
-
- _texture = ImageTexture.new()
- if debug_mode == DebugMode.SCALES:
- if scales != null:
- _texture = scales
- elif debug_mode == DebugMode.LIGHTMAP:
- if lightmap != null:
- _texture = lightmap
-
- update()
-
-
-# Draw debugging visualizations
-func _draw():
- if _texture == null or \
- not Engine.is_editor_hint() or \
- debug_mode == DebugMode.NONE:
- if current_active_navigation_instance:
- current_active_navigation_instance.visible = true
- return
-
- var scale_vect = bitmaps_scale
-
- if current_active_navigation_instance:
- current_active_navigation_instance.visible = false
-
- var src = Rect2(0, 0, _texture.get_width(), _texture.get_height())
- var dst = Rect2(
- 0,
- 0,
- _texture.get_width() * scale_vect.x,
- _texture.get_height() * scale_vect.y
- )
-
- draw_texture_rect_region(_texture, dst, src)
diff --git a/addons/escoria-core/game/core-scripts/esc_tooltip.gd b/addons/escoria-core/game/core-scripts/esc_tooltip.gd
deleted file mode 100644
index 8e87a5dc..00000000
--- a/addons/escoria-core/game/core-scripts/esc_tooltip.gd
+++ /dev/null
@@ -1,212 +0,0 @@
-# A tooltip displaying []
-tool
-extends RichTextLabel
-class_name ESCTooltip
-
-
-# Maximum width of the label
-const MAX_WIDTH = 200
-
-#Â Minimum height of the label
-const MIN_HEIGHT = 30
-
-# Maximum height of the label
-const MAX_HEIGHT = 500
-
-# Height of one line in the label
-const ONE_LINE_HEIGHT = 16
-
-
-# Color of the label
-export(Color) var color setget set_color
-
-# Vector2 defining the offset from the cursor
-export(Vector2) var offset_from_cursor = Vector2(10,0)
-
-# Activates debug mode. If enabled, shows the label with a white background.
-export(bool) var debug_mode = false setget set_debug_mode
-
-
-# Infinitive verb
-var current_action: String
-
-# Target item/hotspot
-var current_target: String setget set_target
-
-# Preposition: on, with...
-var current_prep: String = "with"
-
-# Target 2 item/hotspot
-var current_target2: String
-
-# True if tooltip is waiting for a click on second target (use x with y)
-var waiting_for_target2 = false
-
-# Node containing the debug white background
-var debug_texturerect_node: TextureRect
-
-# Indicates whether the current room is loaded and ready
-var _room_is_ready: bool = false
-
-
-#Â Connect relevant functions
-func _ready():
- escoria.main.connect("room_ready", self, "_on_room_ready")
- escoria.action_manager.connect("action_changed", self, "_on_action_selected")
-
-
-#Â Set the color of the label
-#
-# ## Parameters
-#Â - p_color: the color to set the label
-func set_color(p_color: Color):
- color = p_color
- if _room_is_ready:
- update_tooltip_text()
-
-
-#Â Enable/disable debug mode of the label. If enabled, the label is displayed
-# with a white background.
-#
-# ## Parameters
-# - p_debug_mode: if true, enable debug mode. False to disable
-func set_debug_mode(p_debug_mode: bool):
- debug_mode = p_debug_mode
- if debug_mode:
- # Add a white TextureRect behind the RTL to see its actual size
- debug_texturerect_node = TextureRect.new()
- add_child(debug_texturerect_node)
- debug_texturerect_node.texture = load("res://addons/escoria-core/game/assets/images/white.png")
- debug_texturerect_node.expand = true
- debug_texturerect_node.stretch_mode = TextureRect.STRETCH_TILE
- debug_texturerect_node.size_flags_horizontal = SIZE_EXPAND_FILL
- debug_texturerect_node.size_flags_vertical = SIZE_EXPAND_FILL
- debug_texturerect_node.show_behind_parent = true
- debug_texturerect_node.anchor_right = 1.0
- debug_texturerect_node.anchor_bottom = 1.0
- debug_texturerect_node.mouse_filter = Control.MOUSE_FILTER_IGNORE
- move_child(debug_texturerect_node, 2)
- else:
- if debug_texturerect_node:
- remove_child(debug_texturerect_node)
- debug_texturerect_node.queue_free()
-
-
-#Â Set the first target of the label.
-#
-# ##Â Parameters
-# - target: String the target to add to the label
-# - needs_second_target: if true, the label will prepare for a second target
-func set_target(target: String, needs_second_target: bool = false) -> void:
- current_target = target
- waiting_for_target2 = needs_second_target
- if _room_is_ready:
- update_tooltip_text()
-
-
-#Â Set the second target of the label
-#
-# ##Â Parameters
-# - target2: String the second target to add to the label
-func set_target2(target2: String) -> void:
- current_target2 = target2
- if _room_is_ready:
- update_tooltip_text()
-
-
-# Update the tooltip text.
-func update_tooltip_text():
- """
- Overriden method. Should not be called directly.
- """
- pass
-
-
-# Update the tooltip size according to the text.
-func update_size():
- if not get_tree():
- # We're not in the tree anymore. Return
- return
- rect_size = get_font("normal_font").get_string_size(current_target)
-
-
-# Calculate the offset of the label depending on its position.
-#
-# ##Â Parameters
-# - position: the position to test
-#
-# **Return**
-# The calculated offset
-func _offset(position: Vector2) -> Vector2:
- var center_offset_x = rect_size.x / 2
- var offset_y = 5
-
- position.x -= center_offset_x
- position.y += offset_y
-
- return position
-
-
-# Return the tooltip distance to top edge.
-#
-# ##Â Parameters
-# - position: the position to test
-#
-# **Return**
-# The distance to the edge.
-func tooltip_distance_to_edge_top(position: Vector2):
- return position.y
-
-
-# Return the tooltip distance to bottom edge.
-#
-# ##Â Parameters
-# - position: the position to test
-#
-# **Return**
-# The distance to the edge.
-func tooltip_distance_to_edge_bottom(position: Vector2):
- return escoria.game_size.y - position.y
-
-
-# Return the tooltip distance to left edge.
-#
-# ##Â Parameters
-# - position: the position to test
-#
-# **Return**
-# The distance to the edge.
-func tooltip_distance_to_edge_left(position: Vector2):
- return position.x
-
-
-# Return the tooltip distance to right edge.
-#
-# ##Â Parameters
-# - position: the position to test
-#
-# **Return**
-# The distance to the edge.
-func tooltip_distance_to_edge_right(position: Vector2):
- return escoria.game_size.x - position.x
-
-
-# Clear the tooltip targets texts
-func clear():
- waiting_for_target2 = false
- set_target("")
- set_target2("")
-
-
-#Â Called when the room is loaded to setup the label.
-func _on_room_ready():
- escoria.main.current_scene.game.tooltip_node = self
- _room_is_ready = true
-
-
-# Called when an action is selected in Escoria
-func _on_action_selected() -> void:
- current_action = escoria.action_manager.current_action
-
- if _room_is_ready:
- update_tooltip_text()
diff --git a/addons/escoria-core/game/core-scripts/esc_walk_context.gd b/addons/escoria-core/game/core-scripts/esc_walk_context.gd
deleted file mode 100644
index 1f98c54e..00000000
--- a/addons/escoria-core/game/core-scripts/esc_walk_context.gd
+++ /dev/null
@@ -1,29 +0,0 @@
-# The walk context describes the target of a walk command and if that command
-# should be executed fast
-extends Reference
-class_name ESCWalkContext
-
-
-# Target object that the walk command tries to reach
-var target_object: ESCObject = null
-
-# The target position
-var target_position: Vector2 = Vector2()
-
-# Whether to move fast
-var fast: bool
-
-# Whether an interaction should NOT happen after walk reaches destination
-var dont_interact_on_arrival: bool
-
-
-func _init(
- p_target_object: ESCObject,
- p_target_position: Vector2,
- p_fast: bool,
- p_dont_interact_on_arrival: bool
-):
- target_object = p_target_object
- target_position = p_target_position
- fast = p_fast
- dont_interact_on_arrival = p_dont_interact_on_arrival
diff --git a/addons/escoria-core/game/core-scripts/migrations/esc_migration.gd b/addons/escoria-core/game/core-scripts/migrations/esc_migration.gd
deleted file mode 100644
index ef277bce..00000000
--- a/addons/escoria-core/game/core-scripts/migrations/esc_migration.gd
+++ /dev/null
@@ -1,27 +0,0 @@
-# Base class for all migration version scripts. Extending scripts should be
-# named like the version they migrate the savegame to. (e.g. 1.0.0.gd, 1.0.1.gd)
-extends Reference
-class_name ESCMigration
-
-
-var _savegame: ESCSaveGame
-
-
-# Set the savegame
-#
-# #### Parameters
-# - savegame: Savegame to modify
-func set_savegame(savegame: ESCSaveGame):
- _savegame = savegame
-
-
-# Get the savegame
-# **Returns** Savegame
-func get_savegame():
- return _savegame
-
-
-# Override this function in the version script with
-# the things that need to be applied to the savegame
-func migrate():
- pass
diff --git a/addons/escoria-core/game/core-scripts/migrations/esc_migration_manager.gd b/addons/escoria-core/game/core-scripts/migrations/esc_migration_manager.gd
deleted file mode 100644
index b401a697..00000000
--- a/addons/escoria-core/game/core-scripts/migrations/esc_migration_manager.gd
+++ /dev/null
@@ -1,177 +0,0 @@
-# Class that handles migrations between different game or escoria versions
-extends Reference
-class_name ESCMigrationManager
-
-
-# Regular expression that matches a simple semver version string
-const VERSION_REGEX = "^(?\\d+)\\.(?\\d+)\\.(?\\d+)$"
-
-
-# Compiled regex
-var version_regex: RegEx
-
-
-func _init() -> void:
- version_regex = RegEx.new()
- version_regex.compile(VERSION_REGEX)
-
-
-# Migrates the specified savegame from a specified version to another version
-# based on a directory of migration scripts.
-#
-# The migration manager searches for scripts from after the given version up
-# to the target version in this directory, loads them and applies the version.
-#
-# Each migration will return a modified version of the given savegame
-func migrate(
- savegame: ESCSaveGame,
- from: String,
- to: String,
- versions_directory: String
-) -> ESCSaveGame:
- escoria.logger.info(
- self,
- "Migrating savegame from version %s to version %s."
- % [from, to]
- )
-
- var from_info = version_regex.search(from)
- var to_info = version_regex.search(to)
-
- var wrong_version: bool = false
- if from_info.get_string("major") > to_info.get_string("major"):
- wrong_version = true
- elif from_info.get_string("major") == to_info.get_string("major") and\
- from_info.get_string("minor") > to_info.get_string("minor"):
- wrong_version = true
- elif from_info.get_string("major") == to_info.get_string("major") and\
- from_info.get_string("minor") == to_info.get_string("minor") and\
- from_info.get_string("patch") > to_info.get_string("patch"):
- wrong_version = true
-
- if wrong_version:
- escoria.logger.error(
- self,
- "Can not migrate savegame from version %s to version %s." +
- " \"To\" version must be later than \"from\" version."
- % [from, to]
- )
-
- var versions = _find_versions(versions_directory, from, to)
- versions.sort_custom(self, "_compare_version")
- if versions[0].get_file().get_basename() == from:
- versions.pop_front()
-
- for version in versions:
- var migration_script = load(version).new()
- if not migration_script is ESCMigration:
- escoria.logger.error(
- self,
- "File %s is not a valid migration script." % version
- )
- escoria.logger.debug(
- self,
- "Migrating savegame to version %s." % version
- )
- (migration_script as ESCMigration).set_savegame(savegame)
- (migration_script as ESCMigration).migrate()
- savegame = (migration_script as ESCMigration).get_savegame()
-
- return savegame
-
-
-# Find all fitting version scripts between the given versions in a directory
-# and all its subdirectories
-#
-# #### Parameters
-# - directory: Directory to search in
-# - from: Start version to check
-# - to: End version to check
-# **Returns** A list of version scripts
-func _find_versions(directory: String, from: String, to: String) -> Array:
- escoria.logger.trace(
- self,
- "Searching directory %s." % directory
- )
- var versions = []
- var dir = Directory.new()
- dir.open(directory)
- dir.list_dir_begin(true, true)
- var file_name = dir.get_next()
- while file_name != "":
- var version = file_name.get_basename()
- var regex_result = version_regex.search(version)
- if dir.current_is_dir():
- versions += _find_versions(
- directory.plus_file(file_name),
- from,
- to
- )
- elif regex_result and _version_between(version, from, to):
- escoria.logger.trace(
- self,
- "Found compatible savegame migration script for version %s." % version
- )
- versions.append(
- directory.plus_file(file_name)
- )
- file_name = dir.get_next()
- return versions
-
-
-# Check, whether the given version is >= from and <= to
-#
-# #### Parameters
-# - version: Version to check
-# - from: Start version
-# - to: End version
-# **Returns** Whether the version matches
-func _version_between(version: String, from: String, to: String) -> bool:
- var version_info = version_regex.search(version)
- var from_info = version_regex.search(from)
- var to_info = version_regex.search(to)
-
- if from_info.get_string("major") < version_info.get_string("major") and \
- version_info.get_string("major") < to_info.get_string("major"):
- return true
- elif from_info.get_string("major") == version_info.get_string("major") and \
- from_info.get_string("minor") < version_info.get_string("minor"):
- return true
- elif from_info.get_string("major") == version_info.get_string("major") and \
- from_info.get_string("minor") == \
- version_info.get_string("minor") and \
- from_info.get_string("patch") < version_info.get_string("patch"):
- return true
- elif to_info.get_string("major") == version_info.get_string("major") and \
- to_info.get_string("minor") > version_info.get_string("minor"):
- return true
- elif to_info.get_string("major") == version_info.get_string("major") and \
- to_info.get_string("minor") == version_info.get_string("minor") and\
- to_info.get_string("patch") > version_info.get_string("patch"):
- return true
-
- return false
-
-
-# Compare to version strings
-#
-# #### Parameters
-# - version_a: First version to compare
-# - version_b: Second version to compare
-# **Returns** true when version_b should be sorted after version_a
-func _compare_version(version_a: String, version_b: String) -> bool:
- var a_info = version_regex.search(version_a.get_file().get_basename())
- var b_info = version_regex.search(version_b.get_file().get_basename())
-
- if a_info.get_string("major") < b_info.get_string("major"):
- return true
- elif a_info.get_string("major") == b_info.get_string("major") and \
- a_info.get_string("minor") < b_info.get_string("minor"):
- return true
- elif a_info.get_string("major") == b_info.get_string("major") and \
- a_info.get_string("minor") == b_info.get_string("minor") and \
- a_info.get_string("patch") < b_info.get_string("patch"):
- return true
-
- return false
-
diff --git a/addons/escoria-core/game/core-scripts/plugins/escoria_plugin.gd b/addons/escoria-core/game/core-scripts/plugins/escoria_plugin.gd
deleted file mode 100644
index bdc1b405..00000000
--- a/addons/escoria-core/game/core-scripts/plugins/escoria_plugin.gd
+++ /dev/null
@@ -1,102 +0,0 @@
-class_name EscoriaPlugin
-
-# Register a user interface. This should be called in a deferred way
-# from the addon's _enter_tree.
-#
-# #### Parameters
-# - plugin: the plugin that registers
-# - game_scene: Path to the game scene extending ESCGame
-#
-# *Returns* a boolean indicating whether the ui could be successfully registered
-static func register_ui(plugin: EditorPlugin, game_scene: String) -> bool:
- if not plugin.get_editor_interface().is_plugin_enabled(
- Escoria.ESCORIA_CORE_PLUGIN_NAME
- ):
- push_error("Escoria Core must be enabled.")
- return false
-
- var game_scene_setting_value = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.GAME_SCENE
- )
-
- if not game_scene_setting_value in [
- "",
- game_scene
- ]:
- push_error("Can't register user interface because user interface %s is registered."
- % game_scene_setting_value
- )
- return false
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.GAME_SCENE,
- game_scene
- )
- return true
-
-# Deregister a user interface
-#
-# #### Parameters
-# - game_scene: Path to the game scene extending ESCGame
-static func deregister_ui(game_scene: String):
- # If the currently configured game scene is not the one we're disabling, exit now.
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.GAME_SCENE
- ) != game_scene:
- return
-
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.GAME_SCENE,
- ""
- )
-
-
-# Register a dialog manager addon. This should be called in a deferred way
-# from the addon's _enter_tree.
-#
-# #### Parameters
-# - plugin: the plugin that registers
-# - manager_class: Path to the manager class script
-#
-# *Returns* a boolean value indicating whether the dialog manager was registered
-static func register_dialog_manager(plugin: EditorPlugin, manager_class: String) -> bool:
- if not plugin.get_editor_interface().is_plugin_enabled(
- Escoria.ESCORIA_CORE_PLUGIN_NAME
- ):
- push_error("Escoria Core must be enabled.")
- return false
-
- var dialog_managers: Array = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.DIALOG_MANAGERS
- )
-
- if manager_class in dialog_managers:
- return true
-
- dialog_managers.push_back(manager_class)
-
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.DIALOG_MANAGERS,
- dialog_managers
- )
-
- return true
-
-# Deregister a dialog manager addon
-#
-# #### Parameters
-# - manager_class: Path to the manager class script
-static func deregister_dialog_manager(manager_class: String):
- var dialog_managers: Array = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.DIALOG_MANAGERS
- )
-
- # If the dialog manager we're removing in not in the registered list, return quietly.
- if not manager_class in dialog_managers:
- return
-
- dialog_managers.erase(manager_class)
-
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.DIALOG_MANAGERS,
- dialog_managers
- )
diff --git a/addons/escoria-core/game/core-scripts/resources/esc_animationname.gd b/addons/escoria-core/game/core-scripts/resources/esc_animationname.gd
deleted file mode 100644
index 044e05db..00000000
--- a/addons/escoria-core/game/core-scripts/resources/esc_animationname.gd
+++ /dev/null
@@ -1,10 +0,0 @@
-# Class defining an animation to use for an angle.
-tool
-extends Resource
-class_name ESCAnimationName
-
-# Name of the animation
-export(String) var animation: String
-
-# Animation mirror (false is no mirror, true is mirrored)
-export(bool) var mirrored: bool
diff --git a/addons/escoria-core/game/core-scripts/resources/esc_animationresource.gd b/addons/escoria-core/game/core-scripts/resources/esc_animationresource.gd
deleted file mode 100644
index 3e339c96..00000000
--- a/addons/escoria-core/game/core-scripts/resources/esc_animationresource.gd
+++ /dev/null
@@ -1,68 +0,0 @@
-# Resource containing all defined animations and angles for
-# characters movement.
-tool
-extends Resource
-class_name ESCAnimationResource
-
-
-# Array containing the different angles available for animations.
-# Each angle is defined by an array [start_angle, angle_size].
-# start_angle must be between 0 and 360.
-# Angles 0 and 360 are the same and correspond to UP/NORTH,
-# 90 is RIGHT/EAST, 180 is DOWN/SOUTH, 270 is LEFT/WEST etc.
-export(Array, Resource) var dir_angles: Array = [] setget set_dir_angles
-
-# Array of animations for each direction, from UP to RIGHT_UP clockwise
-# [animation_name, scale]: scale parameter can be set to -1 to mirror
-# the animation
-export(Array, Resource) var directions: Array = [] setget set_directions
-
-# Array containing the idle animations for each direction (in the
-# order defined by dir_angles): scale parameter can be set to -1 to mirror
-# the animation
-export(Array, Resource) var idles: Array = [] setget set_idles
-
-# Array containing the speak animations for each direction (in the
-# order defined by dir_angles): scale parameter can be set to -1 to mirror
-# the animation
-export(Array, Resource) var speaks: Array = [] setget set_speaks
-
-
-# Sets the dir_angles property.
-#
-# #### Parameters
-#
-# - p_dir_angles: array of direction angle resources to set.
-func set_dir_angles(p_dir_angles: Array) -> void:
- dir_angles = p_dir_angles
- emit_changed()
-
-
-# Sets the directions property.
-#
-# #### Parameters
-#
-# - p_directions: array of direction resources to set.
-func set_directions(p_set_directions: Array) -> void:
- directions = p_set_directions
- emit_changed()
-
-
-# Sets the idles property.
-#
-# #### Parameters
-#
-# - p_set_idles: array of idle resources to set.
-func set_idles(p_set_idles: Array) -> void:
- idles = p_set_idles
- emit_changed()
-
-
-# Sets the speaks property.
-#
-# #### Parameters
-#
-# - p_set_idles: array of speak resources to set.
-func set_speaks(p_set_speaks: Array) -> void:
- speaks = p_set_speaks
- emit_changed()
diff --git a/addons/escoria-core/game/core-scripts/resources/esc_directionangle.gd b/addons/escoria-core/game/core-scripts/resources/esc_directionangle.gd
deleted file mode 100644
index 853aedc9..00000000
--- a/addons/escoria-core/game/core-scripts/resources/esc_directionangle.gd
+++ /dev/null
@@ -1,11 +0,0 @@
-#Â Class defining an angle, with a start angle (between 0 and 360) and a size.
-tool
-extends Resource
-class_name ESCDirectionAngle
-
-
-# Start angle of the directional angle.
-export(int) var angle_start: int
-
-# Size of the angle
-export(int) var angle_size: int
diff --git a/addons/escoria-core/game/core-scripts/resources/esc_resource_descriptor.gd b/addons/escoria-core/game/core-scripts/resources/esc_resource_descriptor.gd
deleted file mode 100644
index e5820796..00000000
--- a/addons/escoria-core/game/core-scripts/resources/esc_resource_descriptor.gd
+++ /dev/null
@@ -1,15 +0,0 @@
-# Describes a resource for use in the resource cache
-extends Resource
-class_name ESCResourceDescriptor
-
-
-# The resource being described
-var res
-
-# Whether the resource is permanent
-var permanent: bool
-
-
-func _init(res_in, permanent_in: bool) -> void:
- res = res_in
- permanent = permanent_in
diff --git a/addons/escoria-core/game/core-scripts/save_data/esc_save_manager.gd b/addons/escoria-core/game/core-scripts/save_data/esc_save_manager.gd
deleted file mode 100644
index 89885c42..00000000
--- a/addons/escoria-core/game/core-scripts/save_data/esc_save_manager.gd
+++ /dev/null
@@ -1,453 +0,0 @@
-# Saves and loads savegame and settings files
-class_name ESCSaveManager
-
-
-# Template for settings filename
-const SETTINGS_TEMPLATE: String = "settings.tres"
-
-# Template for savegames filenames
-const SAVE_NAME_TEMPLATE: String = "save_%03d.tres"
-
-# Template for crash savegames filenames
-const CRASH_SAVE_NAME_TEMPLATE: String = "crash_autosave_%s_%s.tres"
-
-
-# If true, saving a game is enabled. Else, saving is disabled
-var save_enabled: bool = true
-
-# Variable containing the saves folder obtained from Project Settings
-var save_folder: String
-
-# Filename of the latest crash savegame file
-var crash_savegame_filename: String
-
-# Variable containing the settings folder obtained from Project Settings
-var settings_folder: String
-
-# ESC commands kept around for references to their command names.
-var _transition: TransitionCommand
-var _hide_menu: HideMenuCommand
-var _change_scene: ChangeSceneCommand
-var _set_active: SetActiveCommand
-var _set_active_if_exists: SetActiveIfExistsCommand
-var _set_interactive: SetInteractiveCommand
-var _teleport_pos: TeleportPosCommand
-var _set_angle: SetAngleCommand
-var _set_global: SetGlobalCommand
-var _set_state: SetStateCommand
-var _stop_snd: StopSndCommand
-var _play_snd: PlaySndCommand
-
-
-# Constructor of ESCSaveManager object.
-func _init():
- # We leave the calls to ProjectSettings as-is since this constructor can be
- # called from escoria.gd's own.
- save_folder = ProjectSettings.get_setting("escoria/main/savegames_path")
- settings_folder = ProjectSettings.get_setting("escoria/main/settings_path")
-
- _transition = TransitionCommand.new()
- _hide_menu = HideMenuCommand.new()
- _change_scene = ChangeSceneCommand.new()
- _set_active = SetActiveCommand.new()
- _set_active_if_exists = SetActiveIfExistsCommand.new()
- _set_interactive = SetInteractiveCommand.new()
- _teleport_pos = TeleportPosCommand.new()
- _set_angle = SetAngleCommand.new()
- _set_global = SetGlobalCommand.new()
- _set_state = SetStateCommand.new()
- _stop_snd = StopSndCommand.new()
- _play_snd = PlaySndCommand.new()
-
-
-# Return a list of savegames metadata (id, date, name and game version)
-func get_saves_list() -> Dictionary:
- var regex = RegEx.new()
- regex.compile("save_(?[0-9]{3})\\.tres")
-
- var saves = {}
- var dirsave = Directory.new()
- if dirsave.open(save_folder) == OK:
- dirsave.list_dir_begin(true, true)
- var nextfile = dirsave.get_next()
- while nextfile != "":
- var save_path = save_folder.plus_file(nextfile)
- var file: File = File.new()
- var save_game_res: Resource = load(save_path)
-
- if save_game_res == null:
- escoria.logger.warn(
- self,
- "Savegame file %s is corrupted. Skipping." % save_path
- )
- else:
- var save_game_data = {
- "date": save_game_res["date"],
- "name": save_game_res["name"],
- "game_version": save_game_res["game_version"],
- }
-
- var matches = regex.search(nextfile)
- if matches != null and matches.get_string("slotnumber") != null:
- saves[int(matches.get_string("slotnumber"))] = save_game_data
- else:
- escoria.logger.warn(
- self,
- "Savegame file %s contains valid data but doesn't match filename format %s. Skipping."
- % [save_path, regex.get_pattern()]
- )
- nextfile = dirsave.get_next()
- return saves
-
-
-# Returns true whether the savegame identified by id does exist
-#
-# ##Â Parameters
-# - id: integer suffix of the savegame file
-func save_game_exists(id: int) -> bool:
- var save_file_path: String = save_folder.plus_file(SAVE_NAME_TEMPLATE % id)
- var file: File = File.new()
- return file.file_exists(save_file_path)
-
-
-# Save the current state of the game in a file suffixed with the id value.
-# This id can help with slots development for the game developer.
-#
-#Â ##Â Parameters
-# - id: integer suffix of the savegame file
-# - p_savename: name of the savegame
-func save_game(id: int, p_savename: String):
- if not save_enabled:
- escoria.logger.debug(
- self,
- "Save requested while saving is not possible. Save cancelled."
- )
- return
-
- var save_game := _do_save_game(p_savename)
-
- var directory: Directory = Directory.new()
- if not directory.dir_exists(save_folder):
- directory.make_dir_recursive(save_folder)
-
- var save_path = save_folder.plus_file(SAVE_NAME_TEMPLATE % id)
- var error: int = ResourceSaver.save(save_path, save_game)
- if error != OK:
- escoria.logger.error(
- self,
- "There was an issue writing savegame number %s to %s." % [id, save_path]
- )
-
-
-# Performs an emergency savegame in case of crash.
-func save_game_crash():
- var datetime = OS.get_datetime()
- var datetime_string = "%02d/%02d/%02d %02d:%02d" % [
- datetime["day"],
- datetime["month"],
- datetime["year"],
- datetime["hour"],
- datetime["minute"],
- ]
-
- var save_game := _do_save_game("Crash %s" % datetime_string)
-
- var save_file_path: String = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.LOG_FILE_PATH
- )
- crash_savegame_filename = save_file_path.plus_file(
- CRASH_SAVE_NAME_TEMPLATE % [
- str(datetime["year"]) + str(datetime["month"])
- + str(datetime["day"]),
- str(datetime["hour"]) + str(datetime["minute"])
- + str(datetime["second"])
- ]
- )
-
- var error: int = ResourceSaver.save(crash_savegame_filename, save_game)
- if error != OK:
- escoria.logger.error(
- self,
- "There was an issue writing the crash save to %s."
- % crash_savegame_filename
- )
- return error
-
-
-# Actual savegame function.
-#
-#Â ##Â Parameters
-# - p_savename: name of the savegame
-func _do_save_game(p_savename: String) -> ESCSaveGame:
- var save_game = ESCSaveGame.new()
-
- var plugin_config = ConfigFile.new()
- plugin_config.load("res://addons/escoria-core/plugin.cfg")
- save_game.escoria_version = plugin_config.get_value("plugin", "version")
-
- save_game.game_version = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.GAME_VERSION
- )
- save_game.name = p_savename
-
- var datetime = OS.get_datetime()
- var datetime_string = "%02d/%02d/%02d %02d:%02d" % [
- datetime["day"],
- datetime["month"],
- datetime["year"],
- datetime["hour"],
- datetime["minute"],
- ]
- save_game.date = datetime_string
-
- escoria.globals_manager.save_game(save_game)
- escoria.object_manager.save_game(save_game)
- escoria.main.save_game(save_game)
- save_game.custom_data = escoria.game_scene.get_custom_data()
-
- return save_game
-
-
-# Load a savegame file from its id.
-#
-#Â ## Parameters
-# - id: integer suffix of the savegame file
-func load_game(id: int):
- var save_file_path: String = save_folder.plus_file(SAVE_NAME_TEMPLATE % id)
- var file: File = File.new()
- if not file.file_exists(save_file_path):
- escoria.logger.error(
- self,
- "Save file %s doesn't exist." % save_file_path
- )
- return
-
- escoria.logger.info(
- self,
- "Loading savegame %s." % str(id)
- )
-
- var save_game: ESCSaveGame = ResourceLoader.load(save_file_path)
-
- var plugin_config = ConfigFile.new()
- plugin_config.load("res://addons/escoria-core/plugin.cfg")
- var escoria_version = plugin_config.get_value("plugin", "version")
-
- # Migrate savegame through escoria versions
-
- if escoria_version != save_game.escoria_version:
- var migration_manager: ESCMigrationManager = ESCMigrationManager.new()
- save_game = migration_manager.migrate(
- save_game,
- save_game.escoria_version,
- escoria_version,
- "res://addons/escoria-core/game/core-scripts/migrations/versions"
- )
-
- # Migrate savegame through game versions
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.GAME_VERSION
- ) != save_game.game_version \
- and ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.GAME_MIGRATION_PATH
- ) != "":
- var migration_manager: ESCMigrationManager = ESCMigrationManager.new()
- save_game = migration_manager.migrate(
- save_game,
- save_game.game_version,
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.GAME_VERSION
- ),
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.GAME_MIGRATION_PATH
- )
- )
-
- escoria.event_manager.interrupt()
-
- var load_event = ESCEvent.new("%s%s" % [ESCEvent.PREFIX, escoria.event_manager.EVENT_LOAD])
- var load_statements = []
-
- load_statements.append(
- ESCCommand.new(
- "%s %s out" %
- [
- _transition.get_command_name(),
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.DEFAULT_TRANSITION
- )]
- )
- )
- load_statements.append(
- ESCCommand.new("%s main" % _hide_menu.get_command_name())
- )
- load_statements.append(
- ESCCommand.new("%s pause" % _hide_menu.get_command_name())
- )
-
- ##Â ROOM
- load_statements.append(
- ESCCommand.new("%s %s false" %
- [
- _change_scene.get_command_name(),
- save_game.main["current_scene_filename"]
- ]
- )
- )
-
- ## GLOBALS
- for k in save_game.globals.keys():
- var global_value = save_game.globals[k]
-
- if global_value is String and global_value.empty():
- global_value = "''"
-
- load_statements.append(
- ESCCommand.new("%s %s %s true" %
- [
- _set_global.get_command_name(),
- k,
- global_value
- ]
- )
- )
-
- ## OBJECTS
- for object_global_id in save_game.objects.keys():
- if save_game.objects[object_global_id].has("active"):
- load_statements.append(ESCCommand.new("%s %s %s" \
- % [
- _set_active_if_exists.get_command_name(),
- object_global_id,
- save_game.objects[object_global_id]["active"]
- ]
- )
- )
-
- if save_game.objects[object_global_id].has("interactive"):
- load_statements.append(ESCCommand.new("%s %s %s" \
- % [
- _set_interactive.get_command_name(),
- object_global_id,
- save_game.objects[object_global_id]["interactive"]
- ]
- )
- )
-
- if save_game.objects[object_global_id].has("state"):
- load_statements.append(ESCCommand.new("%s %s %s true" \
- % [
- _set_state.get_command_name(),
- object_global_id,
- save_game.objects[object_global_id]["state"]
- ]
- )
- )
-
- if save_game.objects[object_global_id].has("global_transform"):
- load_statements.append(ESCCommand.new("%s %s %s %s" \
- % [
- _teleport_pos.get_command_name(),
- object_global_id,
- int(save_game.objects[object_global_id] \
- ["global_transform"].origin.x),
- int(save_game.objects[object_global_id] \
- ["global_transform"].origin.y)
- ]
- )
- )
- load_statements.append(ESCCommand.new("%s %s %s" \
- % [
- _set_angle.get_command_name(),
- object_global_id,
- save_game.objects[object_global_id]["last_deg"]
- ]
- )
- )
-
- if object_global_id in [
- escoria.object_manager.MUSIC,
- escoria.object_manager.SOUND, escoria.object_manager.SPEECH
- ]:
- if save_game.objects[object_global_id]["state"] in [
- "default",
- "off"
- ]:
- load_statements.append(
- ESCCommand.new("%s %s" % [
- _stop_snd.get_command_name(),
- object_global_id,
- ])
- )
- else:
- load_statements.append(
- ESCCommand.new("%s %s %s" % [
- _play_snd.get_command_name(),
- save_game.objects[object_global_id]["state"],
- object_global_id,
- ])
- )
-
- load_statements.append(
- ESCCommand.new(
- "%s %s in" %
- [
- _transition.get_command_name(),
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.DEFAULT_TRANSITION
- )]
- )
- )
-
- load_event.statements = load_statements
-
- escoria.set_game_paused(false)
-
- escoria.event_manager.queue_event(load_event)
- escoria.logger.debug(self, "Load event queued.")
-
-
-# Save the game settings in the settings file.
-func save_settings():
- var settings_res := ESCSaveSettings.new()
- var plugin_config = ConfigFile.new()
- plugin_config.load("res://addons/escoria-core/plugin.cfg")
-
- settings_res.escoria_version = plugin_config.get_value("plugin", "version")
- settings_res.text_lang = escoria.settings.text_lang
- settings_res.voice_lang = escoria.settings.voice_lang
- settings_res.speech_enabled = escoria.settings.speech_enabled
- settings_res.master_volume = escoria.settings.master_volume
- settings_res.music_volume = escoria.settings.music_volume
- settings_res.sfx_volume = escoria.settings.sfx_volume
- settings_res.speech_volume = escoria.settings.speech_volume
- settings_res.fullscreen = escoria.settings.fullscreen
- settings_res.custom_settings = escoria.settings.custom_settings
-
- var directory: Directory = Directory.new()
- if not directory.dir_exists(settings_folder):
- directory.make_dir_recursive(settings_folder)
-
- var save_path = settings_folder.plus_file(SETTINGS_TEMPLATE)
- var error: int = ResourceSaver.save(save_path, settings_res)
- if error != OK:
- escoria.logger.error(
- "esc_save_manager.gd:save_settings()",
- ["There was an issue writing settings file %s." % save_path])
-
-
-# Load the game settings from the settings file
-# **Returns** The Resource structure loaded from settings file
-func load_settings() -> Resource:
- var save_settings_path: String = \
- settings_folder.plus_file(SETTINGS_TEMPLATE)
- var file: File = File.new()
- if not file.file_exists(save_settings_path):
- escoria.logger.warn(
- self,
- "Settings file %s doesn't exist. Using default settings."
- % save_settings_path
- )
- save_settings()
-
- return load(save_settings_path)
diff --git a/addons/escoria-core/game/core-scripts/save_data/esc_savegame.gd b/addons/escoria-core/game/core-scripts/save_data/esc_savegame.gd
deleted file mode 100644
index 5c4de199..00000000
--- a/addons/escoria-core/game/core-scripts/save_data/esc_savegame.gd
+++ /dev/null
@@ -1,32 +0,0 @@
-# Resource used for holding savegames data.
-extends Resource
-class_name ESCSaveGame
-
-# Access key for the main data last_scene_global_id
-const MAIN_LAST_SCENE_GLOBAL_ID_KEY = "last_scene_global_id"
-# Access key for the main data current_scene_filename
-const MAIN_CURRENT_SCENE_FILENAME_KEY = "current_scene_filename"
-
-# Escoria version which the savegame was created with.
-export var escoria_version: String
-
-# Game version which the savegame was created with.
-export var game_version: String = ""
-
-#Â Name of the savegame. Can be custom value, provided by the player.
-export var name: String = ""
-
-#Â Date of creation of the savegame.
-export var date: String = ""
-
-#Â Main data to be saved
-export var main: Dictionary = {}
-
-# Escoria Global variables exported from ESCGlobalsManager
-export var globals: Dictionary = {}
-
-# Escoria objects exported from ESCObjectsManager
-export var objects: Dictionary = {}
-
-# Custom data
-export var custom_data: Dictionary = {}
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
deleted file mode 100644
index f7d42836..00000000
--- a/addons/escoria-core/game/core-scripts/save_data/esc_savesettings.gd
+++ /dev/null
@@ -1,46 +0,0 @@
-# Resource holding game settings. Note that we call directly to ProjectSettings
-# for instance variable initialization since this class is instantiated from
-# escoria.gd.
-extends Resource
-class_name ESCSaveSettings
-
-#Â Version of ESCORIA Framework
-export var escoria_version: String
-
-#Â Language of displayed text
-export var text_lang: String = ProjectSettings.get_setting(
- "escoria/main/text_lang"
-)
-
-# Language of voice speech
-export var voice_lang: String = ProjectSettings.get_setting(
- "escoria/main/voice_lang"
-)
-
-# Whether speech is enabled
-export var speech_enabled: bool = ProjectSettings.get_setting(
- "escoria/sound/speech_enabled")
-
-#Â Master volume (mix of music, voice and sfx)
-export var master_volume: float = ProjectSettings.get_setting(
- "escoria/sound/master_volume")
-
-# Volume of music only
-export var music_volume: float = ProjectSettings.get_setting(
- "escoria/sound/music_volume")
-
-#Â Volume of SFX only
-export var sfx_volume: float = ProjectSettings.get_setting(
- "escoria/sound/sfx_volume"
-)
-
-# Speech volume only
-export var speech_volume: float = ProjectSettings.get_setting(
- "escoria/sound/speech_volume")
-
-#Â True if game has to be fullscreen
-export var fullscreen: bool = ProjectSettings.get_setting(
- "display/window/size/fullscreen")
-
-# Dictionary containing all user-defined settings.
-export var custom_settings: Dictionary
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
deleted file mode 100644
index 7324f8f6..00000000
--- a/addons/escoria-core/game/core-scripts/save_data/esc_settings_manager.gd
+++ /dev/null
@@ -1,179 +0,0 @@
-# Manages settings
-class_name ESCSettingsManager
-
-
-# Template for settings filename
-const SETTINGS_TEMPLATE: String = "settings.tres"
-
-# Variable containing the settings folder obtained from Project Settings
-var settings_folder: String
-
-# Dictionary containing specific settings that gamedev wants to save in settings
-# This variable is access-free. Getting its content is gamedev's duty.
-# It is saved with other Escoria settings data when save_settings() is called.
-var custom_settings: Dictionary
-
-
-# Constructor of ESCSaveManager object.
-func _init():
- # We leave the calls to ProjectSettings as-is since this constructor can be
- # called from escoria.gd's own.
- settings_folder = ProjectSettings.get_setting("escoria/main/settings_path")
-
-
-# Apply the loaded settings
-func apply_settings() -> void:
- if not Engine.is_editor_hint():
- escoria.logger.info(
- self,
- "******* settings loaded"
- )
-
- AudioServer.set_bus_volume_db(
- AudioServer.get_bus_index(escoria.BUS_MASTER),
- linear2db(
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.MASTER_VOLUME
- )
- )
- )
- AudioServer.set_bus_volume_db(
- AudioServer.get_bus_index(escoria.BUS_SFX),
- linear2db(
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.SFX_VOLUME
- )
- )
- )
- AudioServer.set_bus_volume_db(
- AudioServer.get_bus_index(escoria.BUS_MUSIC),
- linear2db(
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.MUSIC_VOLUME
- )
- )
- )
- AudioServer.set_bus_volume_db(
- AudioServer.get_bus_index(escoria.BUS_SPEECH),
- linear2db(
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.SPEECH_VOLUME
- )
- )
- )
- OS.window_fullscreen = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.FULLSCREEN
- )
- TranslationServer.set_locale(
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.TEXT_LANG
- )
- )
-
- escoria.game_scene.apply_custom_settings(custom_settings)
-
-
-func save_settings_resource_to_project_settings(settings: ESCSaveSettings):
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.TEXT_LANG,
- settings.text_lang
- )
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.VOICE_LANG,
- settings.voice_lang
- )
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.SPEECH_ENABLED,
- settings.speech_enabled
- )
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.MASTER_VOLUME,
- settings.master_volume
- )
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.MUSIC_VOLUME,
- settings.music_volume
- )
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.SFX_VOLUME,
- settings.sfx_volume
- )
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.SPEECH_VOLUME,
- settings.speech_volume
- )
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.FULLSCREEN,
- settings.fullscreen
- )
- custom_settings = settings.custom_settings
-
-
-# Load the game settings from the settings file
-func load_settings():
- var save_settings_path: String = \
- settings_folder.plus_file(SETTINGS_TEMPLATE)
- var file: File = File.new()
- if not file.file_exists(save_settings_path):
- escoria.logger.warn(
- self,
- "Settings file %s doesn't exist" % save_settings_path
- + "Setting default settings."
- )
- save_settings()
-
- var settings: ESCSaveSettings = load(save_settings_path)
- save_settings_resource_to_project_settings(settings)
-
-
-func get_settings() -> ESCSaveSettings:
- var settings: ESCSaveSettings = ESCSaveSettings.new()
- var plugin_config = ConfigFile.new()
- plugin_config.load("res://addons/escoria-core/plugin.cfg")
- settings.escoria_version = plugin_config.get_value("plugin", "version")
-
- settings.text_lang = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.TEXT_LANG
- )
- settings.voice_lang = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.VOICE_LANG
- )
- settings.speech_enabled = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.SPEECH_ENABLED
- )
- settings.master_volume = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.MASTER_VOLUME
- )
- settings.music_volume = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.MUSIC_VOLUME
- )
- settings.sfx_volume = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.SFX_VOLUME
- )
- settings.speech_volume = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.SPEECH_VOLUME
- )
- settings.fullscreen = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.FULLSCREEN
- )
- settings.custom_settings = custom_settings
-
- return settings
-
-
-
-# Save the game settings in the settings file.
-func save_settings():
- var settings = get_settings()
-
- var directory: Directory = Directory.new()
- if not directory.dir_exists(settings_folder):
- directory.make_dir_recursive(settings_folder)
-
- var save_path = settings_folder.plus_file(SETTINGS_TEMPLATE)
- var error: int = ResourceSaver.save(save_path, settings)
- if error != OK:
- escoria.logger.error(
- self,
- "There was an issue writing settings %s" % save_path
- )
diff --git a/addons/escoria-core/game/core-scripts/utils/esc_utils.gd b/addons/escoria-core/game/core-scripts/utils/esc_utils.gd
deleted file mode 100644
index 05f5ad63..00000000
--- a/addons/escoria-core/game/core-scripts/utils/esc_utils.gd
+++ /dev/null
@@ -1,80 +0,0 @@
-# A set of common utilities
-extends Reference
-class_name ESCUtils
-
-
-# Convert radians to degrees
-#
-# #### Parameters
-#
-# - rad_angle: Angle in radians
-# **Returns** Degrees
-static func get_deg_from_rad(rad_angle: float):
- var deg = rad2deg(rad_angle)
- if deg >= 360.0:
- deg = clamp(deg, 0.0, 360.0)
- if deg == 360.0:
- deg = 0.0
- return deg
-
-
-# Get the content of a reg exp group by name
-#
-# #### Parameters
-#
-# - re_match: The RegExMatch object
-# - group: The name of the group
-# **Returns** The value of the named regex group in the match
-static func get_re_group(re_match: RegExMatch, group: String) -> String:
- if group in re_match.names:
- return re_match.strings[re_match.names[group]]
- else:
- return ""
-
-
-# Return a string value in the correct infered type
-#
-# #### Parameters
-#
-# - value: The original value
-# - type_hint: The type it should be
-# **Returns** The typed value according to the type inference
-static func get_typed_value(value: String, type_hint = []):
- var regex_bool = RegEx.new()
- regex_bool.compile("^true|false$")
- var regex_float = RegEx.new()
- regex_float.compile("^-?[0-9]*\\.[0-9]+$")
- var regex_int = RegEx.new()
- regex_int.compile("^-?[0-9]+$")
-
- if regex_float.search(value):
- return float(value)
- elif regex_int.search(value):
- return int(value)
- elif regex_bool.search(value.to_lower()):
- return true if value.to_lower() == "true" else false
- elif (typeof(type_hint) != TYPE_ARRAY and type_hint == TYPE_ARRAY) or \
- (typeof(type_hint) == TYPE_ARRAY and TYPE_ARRAY in type_hint) \
- and "," in value:
- return value.split(",")
- else:
- return str(value)
-
-
-# Sanitize use of whitespaces in a string. Removes double whitespaces
-# and converts tabs into space.
-#
-# #### Paramters
-#
-# - value: String to work on
-# **Returns** the string with sanitized whitespaces
-static func sanitize_whitespace(value: String) -> String:
- var tab_regex = RegEx.new()
- tab_regex.compile("\\t")
- var double_regex = RegEx.new()
- double_regex.compile("\\s\\s+")
- return double_regex.sub(
- tab_regex.sub(value, " "),
- " ",
- true
- )
diff --git a/addons/escoria-core/game/esc_autoload.gd b/addons/escoria-core/game/esc_autoload.gd
deleted file mode 100644
index c2e4f8b6..00000000
--- a/addons/escoria-core/game/esc_autoload.gd
+++ /dev/null
@@ -1,165 +0,0 @@
-# This is Escoria's singleton script.
-# It holds accessors to some utils, such as Escoria's logger.
-
-extends Node
-
-
-#Â Signal sent when Escoria is paused
-signal paused
-
-# Signal sent when Escoria is resumed from pause
-signal resumed
-
-
-# Current game state
-# * DEFAULT: Common game function
-# * DIALOG: Game is playing a dialog
-# * WAIT: Game is waiting
-enum GAME_STATE {
- DEFAULT,
- DIALOG,
- WAIT
-}
-
-
-# Audio bus indices.
-const BUS_MASTER = "Master"
-const BUS_SFX = "SFX"
-const BUS_MUSIC = "Music"
-const BUS_SPEECH = "Speech"
-
-# Path to camera scene
-const CAMERA_SCENE_PATH = "res://addons/escoria-core/game/scenes/camera_player/camera.tscn"
-
-
-# Logger class
-const Logger = preload("res://addons/escoria-core/game/esc_logger.gd")
-
-
-# Logger instance
-var logger = Logger.ESCLoggerFile.new()
-
-# ESC Compiler
-var esc_compiler = ESCCompiler.new()
-
-# ESC Object Manager
-var object_manager = ESCObjectManager.new()
-
-# ESC Room Manager
-var room_manager = ESCRoomManager.new()
-
-# Terrain of the current room
-var room_terrain
-
-# The inventory manager instance
-var inventory_manager: ESCInventoryManager
-
-# The action manager instance
-var action_manager: ESCActionManager
-
-# ESC Event manager instance
-var event_manager: ESCEventManager
-
-# ESC globals registry instance
-var globals_manager: ESCGlobalsManager
-
-# ESC command registry instance
-var command_registry: ESCCommandRegistry
-
-# Manager of game settings (resolution, sound, etc)
-var settings_manager: ESCSettingsManager
-
-# Resource cache handler
-var resource_cache: ESCResourceCache
-
-# Dialog player instantiator. This instance is called directly for dialogs.
-var dialog_player: ESCDialogPlayer
-
-# Inventory scene
-var inventory
-
-# The main scene
-var main
-
-# The escoria inputs manager
-var inputs_manager: ESCInputsManager
-
-# Savegames and settings manager
-var save_manager: ESCSaveManager
-
-#Â The game scene loaded
-var game_scene: ESCGame
-
-# The main player camera
-var player_camera: ESCCamera
-
-# The compiled start script loaded from ProjectSettings
-# escoria/main/game_start_script
-var start_script: ESCScript
-
-# The "fallback" script to use when an action is tried on an item that hasn't
-# been explicitly scripted.
-var action_default_script: ESCScript
-
-# Whether we ran a room directly from editor, not a full game
-var is_direct_room_run: bool = false
-
-# Whether we're quitting the game
-var is_quitting: bool = false
-
-
-# The game resolution
-onready var game_size = get_viewport().size
-
-# The current state of the game
-onready var current_state = GAME_STATE.DEFAULT
-
-
-# Ready function
-func _ready():
- # We check if we run the full game or a room scene directly
- if not get_tree().current_scene is ESCMain:
- # Running a room scene. We need to instantiate the main scene ourselves
- # so that the Escoria scene is created and managers are instanced as well.
- is_direct_room_run = true
- var main_scene = preload("res://addons/escoria-core/game/main_scene.tscn").instance()
- add_child(main_scene)
-
-
-# Get the Escoria node. That node gives access to the Escoria scene that's
-# instanced by the main_scene (if full game is run) or by this autoload if
-# room is run directly.
-func get_escoria():
- # We check if we run the full game or a room scene directly
- if get_tree().current_scene is ESCMain:
- return get_node("/root/main_scene").escoria_node
- else:
- return get_node("main_scene").escoria_node
-
-
-# Pauses or unpause the game
-#
-# #### Parameters
-# - p_paused: if true, pauses the game. If false, unpauses the game.
-func set_game_paused(p_paused: bool):
- if p_paused:
- emit_signal("paused")
- else:
- emit_signal("resumed")
-
- var scene_tree = get_tree()
-
- if is_instance_valid(scene_tree):
- scene_tree.paused = p_paused
-
-
-# Called from main menu's "new game" button
-func new_game():
- get_escoria().new_game()
-
-
-# Called from main menu's "quit" button
-func quit():
- is_quitting = true
- get_escoria().quit()
-
diff --git a/addons/escoria-core/game/esc_inputs_manager.gd b/addons/escoria-core/game/esc_inputs_manager.gd
deleted file mode 100644
index d81e2498..00000000
--- a/addons/escoria-core/game/esc_inputs_manager.gd
+++ /dev/null
@@ -1,726 +0,0 @@
-# Escoria inputs manager
-# Catches, handles and distributes input events for the game
-extends Resource
-class_name ESCInputsManager
-
-
-# Valid input flags
-# * INPUT_ALL: All input is allowed
-# * INPUT_NONE: No input is allowed at all
-# * INPUT_SKIP: Only skipping dialogs is allowed
-enum {
- INPUT_ALL,
- INPUT_NONE,
- INPUT_SKIP,
-}
-
-
-# Input action for use by InputMap
-const SWITCH_ACTION_VERB = "switch_action_verb"
-
-# Input action for use by InputMap
-const ESC_SHOW_DEBUG_PROMPT = "esc_show_debug_prompt"
-
-# Input action for use by InputMap that represents a "primary action" from an
-# input device, such as a left-click on a mouse or the X button on an XBox
-# controller
-const ESC_UI_PRIMARY_ACTION = "esc_ui_primary_action"
-
-# The current input mode
-var input_mode = INPUT_ALL
-
-# A LIFO stack of hovered items
-var hover_stack: HoverStack
-
-# The global id of the topmost item from the hover_stack
-var hotspot_focused: String = ""
-
-# Function reference that can be used to intercept and process input events.
-# If set, this function must have the following signature:
-#
-# (event: InputEvent, is_default_state: bool) -> bool
-#
-# #### Parameters
-#
-# - event: The event to process
-# - is_default_state: Whether the current state is escoria.GAME_STATE.DEFAULT
-#
-# **Returns** Whether the function processed the event.
-var custom_input_handler = null
-
-# The currently hovered element. Usually the one on top of the hover stack.
-var _hovered_element = null
-
-
-# Constructor
-func _init():
- escoria.event_manager.connect("event_finished", self, "_on_event_finished")
- hover_stack = HoverStack.new()
- hover_stack.connect("hover_stack_changed", self, "_on_hover_stack_changed")
-
-
-# Called when an event is finished, so that the current hotspot is reset
-#
-# #### Parameters
-#
-# - return_code: The return code of the event
-# - event_name: the name of the event
-#
-func _on_event_finished(return_code: int, event_name: String):
- if _hovered_element == null:
- hotspot_focused = ""
-
-
-# Register core signals (from escoria.gd)
-func register_core():
- escoria.game_scene.connect(
- "request_pause_menu",
- self,
- "_on_pause_menu_requested"
- )
-
-
-# Connect the item signals to the local methods
-func register_inventory_item(item: Node):
- item.connect(
- "mouse_left_inventory_item",
- self,
- "_on_mouse_left_click_inventory_item"
- )
- item.connect(
- "mouse_double_left_inventory_item",
- self,
- "_on_mouse_double_left_click_inventory_item"
- )
- item.connect(
- "mouse_right_inventory_item",
- self,
- "_on_mouse_right_click_inventory_item"
- )
-
- item.connect(
- "inventory_item_focused",
- self,
- "_on_mouse_entered_inventory_item"
- )
- item.connect(
- "inventory_item_unfocused",
- self,
- "_on_mouse_exited_inventory_item"
- )
-
-
-func register_background(background: ESCBackground):
- background.connect(
- "left_click_on_bg",
- self,
- "_on_left_click_on_bg"
- )
- background.connect(
- "right_click_on_bg",
- escoria.inputs_manager,
- "_on_right_click_on_bg"
- )
- background.connect(
- "double_left_click_on_bg",
- escoria.inputs_manager,
- "_on_double_left_click_on_bg"
- )
- background.connect(
- "mouse_wheel_up",
- self,
- "_on_mousewheel_action",
- [1]
- )
- background.connect(
- "mouse_wheel_down",
- self,
- "_on_mousewheel_action",
- [-1]
- )
-
-
-# Registers a function that can be used to intercept and process input events.
-# `callback` must have the following signature:
-#
-# (event: InputEvent, is_default_state: bool) -> bool
-#
-# where
-#
-# - event: The event to process
-# - is_default_state: Whether the current state is escoria.GAME_STATE.DEFAULT
-# - returns whether the function processed the event
-#
-# `callback` is responsible for calling `get_tree().set_input_as_handled()`,
-# if appropriate.
-#
-# #### Parameters
-# - callback: Function reference satisfying the above contract
-func register_custom_input_handler(callback) -> void:
- custom_input_handler = callback
-
-
-# If a callback was specified via `register_custom_input_handler()`,
-# forwards the event to the callback and returns its result; otherwise,
-# returns `false`.
-#
-# #### Parameters
-#
-# - event: The event to process
-# - is_default_state: Whether the current state is escoria.GAME_STATE.DEFAULT
-#
-# **Returns** Result of `custom_input_handler` if set; otherwise, `false`
-func try_custom_input_handler(event: InputEvent, is_default_state: bool) -> bool:
- if custom_input_handler:
- return custom_input_handler.call_func(event, is_default_state)
- else:
- return false
-
-
-# Callback called by hover stack content change.
-func _on_hover_stack_changed():
- if hover_stack.empty():
- unset_hovered_node(_hovered_element)
- else:
- set_hovered_node(hover_stack.get_top_item())
-
-
-# Sets the hovered node and calls its mouse_entered() method if it was the top
-# most item in hover_stack.
-#
-# #### Parameters
-#
-# - item: the item that was focused (mouse_entered)
-#
-# **Returns**
-# True if item is the new top hovered object
-func set_hovered_node(item: ESCItem) -> bool:
- if _hovered_element != item \
- and escoria.action_manager.is_object_actionable(item.global_id) \
- or (item is ESCPlayer and not (item as ESCPlayer).selectable):
- _hovered_element = item
- _hovered_element.mouse_entered()
- return true
- # If tested item was already hovered
- # or is not actionable (not selectable for ESCPlayer) then do nothing
- if _hovered_element == item \
- or not escoria.action_manager.is_object_actionable(item.global_id) \
- or (item is ESCPlayer and not (item as ESCPlayer).selectable):
- return true
- # Else if the tested item is on top of hover stack (or null)
- # Set that item as hovered and call that item's mouse_entered()
- if not is_instance_valid(_hovered_element) or hover_stack.get_top_item() != item:
- _hovered_element = item
- _hovered_element.mouse_entered()
- return true
- # Else, the tested item is currently on top of hover stack, then do nothing
- else:
- return false
-
-
-# Unsets the hovered node.
-#
-# **Parameters**
-#
-# - item: the item that was unfocused (mouse_exited)
-func unset_hovered_node(item: ESCItem):
- if item == null:
- return
- if _hovered_element == item:
- _hovered_element.mouse_exited()
- _hovered_element = null
- hotspot_focused = ""
-
-
-# The background was clicked with the LMB
-#
-# #### Parameters
-#
-# - position: Position of the click
-func _on_left_click_on_bg(position: Vector2) -> void:
- if input_mode == INPUT_ALL: # and hotspot_focused.empty():
- hotspot_focused = ""
- escoria.logger.info(
- self,
- "Left click on background at %s." % str(position)
- )
- escoria.main.current_scene.game.left_click_on_bg(position)
-
-
-# The background was double-clicked with the LMB
-#
-# #### Parameters
-#
-# - position: Position of the click
-func _on_double_left_click_on_bg(position: Vector2) -> void:
- if input_mode == INPUT_ALL: # and hotspot_focused.empty():
- hotspot_focused = ""
- escoria.logger.info(
- self,
- "Double left click on background at %s." % str(position)
- )
- escoria.main.current_scene.game.left_double_click_on_bg(position)
-
-
-# The background was clicked with the RMB
-#
-# #### Parameters
-#
-# - position: Position of the click
-func _on_right_click_on_bg(position: Vector2) -> void:
- if input_mode == INPUT_ALL and hotspot_focused.empty():
- escoria.logger.info(
- self,
- "Right click on background at %s." % str(position)
- )
- escoria.main.current_scene.game.right_click_on_bg(position)
-
-
-# An inventory item was clicked with the LMB
-#
-# #### Parameters
-#
-# - inventory_item_global_id: The global id of the clicked inventory item
-# - event: The input event received
-func _on_mouse_left_click_inventory_item(
- inventory_item_global_id: String,
- event: InputEvent
-) -> void:
- escoria.logger.info(
- self,
- "Inventory item %s left clicked." % inventory_item_global_id
- )
- escoria.main.current_scene.game.left_click_on_inventory_item(
- inventory_item_global_id,
- event
- )
-
-
-# An inventory item was clicked with the RMB
-#
-# #### Parameters
-#
-# - inventory_item_global_id: The global id of the clicked inventory item
-# - event: The input event received
-func _on_mouse_right_click_inventory_item(
- inventory_item_global_id: String,
- event: InputEvent
-) -> void:
- if input_mode == INPUT_ALL:
- escoria.logger.info(
- self,
- "Inventory item %s right clicked." % inventory_item_global_id
- )
- escoria.main.current_scene.game.right_click_on_inventory_item(
- inventory_item_global_id,
- event
- )
-
-
-# An inventory item was doublce-clicked with the LMB
-#
-# #### Parameters
-#
-# - inventory_item_global_id: The global id of the clicked inventory item
-# - event: The input event received
-func _on_mouse_double_left_click_inventory_item(
- inventory_item_global_id: String,
- event: InputEvent
-) -> void:
- if input_mode == INPUT_ALL:
- escoria.logger.info(
- self,
- "Inventory item %s double left clicked." % inventory_item_global_id
- )
- escoria.main.current_scene.game.left_double_click_on_inventory_item(
- inventory_item_global_id,
- event
- )
-
-
-# The mouse entered an inventory item
-#
-# #### Parameters
-#
-# - inventory_item_global_id: The global id of the inventory item
-# that is hovered
-func _on_mouse_entered_inventory_item(inventory_item_global_id: String) -> void:
- escoria.logger.info(
- self,
- "Inventory item %s focused." % inventory_item_global_id
- )
- escoria.main.current_scene.game.inventory_item_focused(
- inventory_item_global_id
- )
-
-
-# The mouse exited an inventory item
-func _on_mouse_exited_inventory_item() -> void:
- escoria.logger.info(
- self,
- "Inventory item unfocused."
- )
- escoria.main.current_scene.game.inventory_item_unfocused()
-
-
-# The mouse entered an Escoria item
-#
-# #### Parameters
-#
-# - item: The Escoria item hovered
-func _on_mouse_entered_item(item: ESCItem) -> void:
- if item as ESCPlayer and not (item as ESCPlayer).selectable:
- escoria.logger.trace(
- self,
- "Ignoring mouse entering player %s: Player not selectable." % [item.global_id]
- )
- if hover_stack.empty():
- hotspot_focused = ""
- escoria.main.current_scene.game.element_unfocused()
- else:
- hotspot_focused = hover_stack.get_top_item().global_id
- escoria.main.current_scene.game.element_focused(hotspot_focused)
- return
-
- if not escoria.action_manager.is_object_actionable(item.global_id):
- escoria.logger.debug(
- self,
- "Ignoring mouse entering item %s." % [item.global_id]
- )
- return
-
- escoria.logger.info(
- self,
- "Item focused: %s" % item.global_id
- )
-
- hotspot_focused = item.global_id
- escoria.main.current_scene.game.element_focused(item.global_id)
-
-
-# The mouse exited an Escoria item
-#
-# #### Parameters
-#
-# - item: The Escoria item hovered
-func _on_mouse_exited_item(item: ESCItem) -> void:
- var object: ESCObject = escoria.object_manager.get_object(item.global_id)
- if object and not object.interactive:
- hover_stack.erase_item(item)
- escoria.main.current_scene.game.element_unfocused()
- return
-
- if object and not object.interactive:
- return
- if object and object.node is ESCPlayer and not (object.node as ESCPlayer).selectable:
- hotspot_focused = ""
- return
-
- escoria.logger.info(
- self,
- "Item unfocused: %s" % hotspot_focused
- )
-
- if hover_stack.empty():
- hotspot_focused = ""
- escoria.main.current_scene.game.element_unfocused()
- else:
- hotspot_focused = hover_stack.get_top_item().global_id
- escoria.main.current_scene.game.element_focused(hotspot_focused)
-
-
-# Function called when the item is set interactive, to re-trigger an input on
-# underlying item.
-#
-# #### Parameters
-#
-# - item: The ESCCItem that was set non-interactive
-func on_item_non_interactive(item: ESCItem) -> void:
- var object: ESCObject = escoria.object_manager.get_object(item.global_id)
- if object and not object.interactive:
- hover_stack.erase_item(item)
- escoria.main.current_scene.game.element_unfocused()
-
- if hover_stack.empty():
- return
- else:
- var new_item = hover_stack.get_top_item()
- escoria.action_manager.set_action_input_state(ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM)
- new_item.mouse_entered()
-
-# An Escoria item was clicked with the LMB
-#
-# #### Parameters
-#
-# - item: The Escoria item clicked
-# - event: The input event from the click
-func _on_mouse_left_clicked_item(item: ESCItem, event: InputEvent) -> void:
- if input_mode == INPUT_ALL:
- # Manage clicking through ESCPlayer (if ESCPlayer.selectable is false)
- if item as ESCPlayer and not (item as ESCPlayer).selectable:
- escoria.logger.trace(
- self,
- "Ignoring left click on player %s: Player not selectable."
- % [item.global_id]
- )
-
- # Get next object in hover stack and forward event to it
- if not hover_stack.empty():
- var next_item = hover_stack.pop_top_item()
- _on_mouse_left_clicked_item(next_item, event)
- else: # if no next object, consider this click as background click
- hotspot_focused = ""
- _on_left_click_on_bg(event.position)
- return
-
- # Clicked object can't be actioned and there is no other object behind
- # We consider this click as a background click
- if not escoria.action_manager.is_object_actionable(item.global_id) \
- and hover_stack.empty():
- hotspot_focused = ""
- _on_left_click_on_bg(event.position)
- return
-
- # Finally, execute the action on the ESCItem
- hotspot_focused = item.global_id
- escoria.main.current_scene.game.left_click_on_item(
- item.global_id,
- event
- )
-
-
-# An Escoria item was double-clicked with the LMB
-#
-# #### Parameters
-#
-# - item: The Escoria item clicked
-# - event: The input event from the click
-func _on_mouse_left_double_clicked_item(
- item: ESCItem,
- event: InputEvent
-) -> void:
- if input_mode == INPUT_ALL:
- # Manage clicking through ESCPlayer (if ESCPlayer.selectable is false)
- if item as ESCPlayer and not (item as ESCPlayer).selectable:
- escoria.logger.trace(
- self,
- "Ignoring double left click on player %s: Player not selectable."
- % [item.global_id]
- )
-
- # Get next object in hover stack and forward event to it
- if not hover_stack.empty():
- var next_item = hover_stack.pop_top_item()
- _on_mouse_left_double_clicked_item(next_item, event)
- else: # if no next object, consider this click as background click
- hotspot_focused = ""
- _on_double_left_click_on_bg(event.position)
- return
-
- # Clicked object can't be actioned and there is no other object behind
- # We consider this click as a background click
- if not escoria.action_manager.is_object_actionable(item.global_id) \
- and hover_stack.empty():
- hotspot_focused = ""
- _on_double_left_click_on_bg(event.position)
- return
-
- # Finally, execute the action on the ESCItem
- hotspot_focused = item.global_id
- escoria.main.current_scene.game.left_double_click_on_item(
- item.global_id,
- event
- )
-
-
-# An Escoria item was clicked with the RMB
-#
-# #### Parameters
-#
-# - item: The Escoria item clicked
-# - event: The input event from the click
-func _on_mouse_right_clicked_item(item: ESCItem, event: InputEvent) -> void:
- if input_mode == INPUT_ALL:
- if item as ESCPlayer and not (item as ESCPlayer).selectable:
- escoria.logger.debug(
- self,
- "Ignoring right click on player %s: Player not selectable." % [item.global_id]
- )
-
- if not hover_stack.empty():
- var next_item = hover_stack.pop_top_item()
- _on_mouse_right_clicked_item(next_item, event)
- return
-
- if not escoria.action_manager.is_object_actionable(item.global_id) \
- and hover_stack.empty():
- # Treat this as a background click now
- hotspot_focused = ""
- _on_right_click_on_bg(event.position)
- return
-
- var actual_item
-
- # We check if the clicked object is ESCPlayer and not selectable. If so
- # we consider we clicked through it.
- var object: ESCObject = escoria.object_manager.get_object(item.global_id)
- if object.node is ESCPlayer and not (object.node as ESCPlayer).selectable:
- actual_item = hover_stack.get_top_item()
- else:
- actual_item = item
-
- if actual_item == null:
- if event.position:
- (escoria.main.current_scene.game as ESCGame).right_click_on_bg(event.position)
- else:
- escoria.logger.info(
- self,
- "Clicked item %s with event %s cannot be activated (player not selectable or not interactive).\n"
- % [item.global_id, event] +
- "No valid item found in the items stack. Action cancelled."
- )
- else:
- escoria.logger.info(
- self,
- "Item %s right clicked with event %s." % [actual_item.global_id, event]
- )
- hotspot_focused = actual_item.global_id
- escoria.main.current_scene.game.right_click_on_item(
- actual_item.global_id,
- event
- )
-
-
-
-# The mousewheel was turned
-#
-# #### Parameters
-#
-# - direction: The direction the wheel was turned. 1 = up, -1 = down
-func _on_mousewheel_action(direction: int):
- escoria.main.current_scene.game.mousewheel_action(direction)
-
-
-# Event when the pause menu was requested
-func _on_pause_menu_requested():
- escoria.main.current_scene.game.pause_game()
-
-
-# Hover Stack implementation.
-class HoverStack:
-
-
- # Emitted when the content of the hover stack has changed
- signal hover_stack_changed
-
- # Emitted when the hover stack was emptied
- signal hover_stack_emptied
-
-
- # Array representing the hover stack
- var hover_stack: Array = []
-
-
- # Add the given item to the stack if not already in it.
- #
- # #### Parameters
- # - item: the item to add to the hover stack
- func add_item(item):
- if item is ESCPlayer and not (item as ESCPlayer).selectable:
- return
- if not hover_stack.has(item):
- hover_stack.push_back(item)
- _sort()
- emit_signal("hover_stack_changed")
-
-
- # Add the items contained in given list to the stack if not already in it.
- #
- # #### Parameters
- # - items: the items list (array) to add to the hover stack
- func add_items(items: Array):
- for item in items:
- if escoria.action_manager.is_object_actionable(item.global_id):
- add_item(item)
-
-
- # Clean the hover stack
- func clean():
- for e in hover_stack:
- if e == null or !is_instance_valid(e):
- hover_stack.erase(e)
- emit_signal("hover_stack_changed")
-
-
- # Pops the top element of the hover stack and returns it
- #
- # **Returns**
- # The top element of the hover stack
- func pop_top_item():
- var ret = hover_stack.pop_back()
- if is_instance_valid(ret):
- emit_signal("hover_stack_changed")
- return ret
-
-
- # Returns the top element of the hover stack a
- #
- # **Returns**
- # The top element of the hover stack
- func get_top_item():
- return hover_stack.back()
-
-
- # Remove the given item from the stack
- #
- # #### Parameters
- # - item: the item to remove from the hover stack
- func erase_item(item):
- hover_stack.erase(item)
- _sort()
- emit_signal("hover_stack_changed")
-
-
- # Clear the stack of hovered items
- func clear():
- hover_stack = []
- emit_signal("hover_stack_emptied")
-
-
- # Returns true if the hover stack is empty, else false
- #
- # **Returns**
- # True if hover stack is empty, else false
- func empty() -> bool:
- return hover_stack.empty()
-
-
- # Sort the hover stack by items' z-index
- func _sort():
- hover_stack.sort_custom(HoverStackSorter, "sort_ascending_z_index")
-
-
- # Returns true if the hover stack contains the given item
- #
- # #### Parameters
- # - item: the item to search
- #
- # **Returns**
- # True if hover stack contains given item, else false
- func has(item) -> bool:
- return hover_stack.has(item)
-
-
- # Returns the hover stack array
- #
- # **Returns**
- # The hover stack array
- func get_all() -> Array:
- return hover_stack
-
- # Z Sorter class for hover stack
- class HoverStackSorter:
- static func sort_ascending_z_index(a, b):
- if a.z_index < b.z_index:
- return true
- return false
diff --git a/addons/escoria-core/game/esc_logger.gd b/addons/escoria-core/game/esc_logger.gd
deleted file mode 100644
index a1826adc..00000000
--- a/addons/escoria-core/game/esc_logger.gd
+++ /dev/null
@@ -1,195 +0,0 @@
-class ESCLoggerBase:
- # Perform emergency savegame
- signal perform_emergency_savegame
-
- # Valid log levels
- enum { LOG_ERROR, LOG_WARNING, LOG_INFO, LOG_DEBUG, LOG_TRACE }
-
- # Log file format
- const LOG_FILE_FORMAT: String = "log_%s_%s.log"
-
- # A map of log level names to log level ints
- var _level_map: Dictionary = {
- "ERROR": LOG_ERROR,
- "WARNING": LOG_WARNING,
- "INFO": LOG_INFO,
- "DEBUG": LOG_DEBUG,
- "TRACE": LOG_TRACE,
- }
-
- # Configured log level
- var _log_level: int
-
-
- # Constructor
- func _init():
- _log_level = _level_map[ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.LOG_LEVEL
- ).to_upper()]
-
-
- func formatted_message(context: String, msg: String, letter: String) -> String:
- return "ESC ({0}) {1} {2}: {3}".format([_formatted_date(), letter, context, msg])
-
-
- func trace(owner: Object, msg: String):
- var context = owner.get_script().resource_path.get_file()
- print(formatted_message(context, msg, "T"))
-
-
- # Debug log
- func debug(owner: Object, msg: String):
- var context = owner.get_script().resource_path.get_file()
- print(formatted_message(context, msg, "D"))
-
-
- func info(owner: Object, msg: String):
- var context = owner.get_script().resource_path.get_file()
- print(formatted_message(context, msg, "I"))
-
-
- # Warning log
- func warn(owner: Object, msg: String):
- var context = owner.get_script().resource_path.get_file()
- print(formatted_message(context, msg, "W"))
- push_warning(formatted_message(context, msg, "W"))
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.TERMINATE_ON_WARNINGS
- ):
- assert(false)
- escoria.get_tree().quit()
-
-
- # Error log
- func error(owner: Object, msg: String):
- var context = owner.get_script().resource_path.get_file()
- printerr(formatted_message(context, msg, "E"))
- push_error(formatted_message(context, msg, "E"))
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.TERMINATE_ON_ERRORS
- ):
- assert(false)
- escoria.get_tree().quit()
-
-
- func get_log_level() -> int:
- return _log_level
-
- func _formatted_date():
- var info = OS.get_datetime()
- info["year"] = "%04d" % info["year"]
- info["month"] = "%02d" % info["month"]
- info["day"] = "%02d" % info["day"]
- info["hour"] = "%02d" % info["hour"]
- info["minute"] = "%02d" % info["minute"]
- info["second"] = "%02d" % info["second"]
- return "{year}-{month}-{day}T{hour}:{minute}:{second}".format(info)
-
-
-# A logger that logs to the terminal and to a log file.
-class ESCLoggerFile extends ESCLoggerBase:
- # Log file handler
- var log_file: File
-
- # Constructor
- func _init():
- # Open logfile in write mode
- log_file = File.new()
-
- # This is left alone as this constructor is called from escoria.gd's own
- # constructor
- var log_file_path = ProjectSettings.get_setting(
- ESCProjectSettingsManager.LOG_FILE_PATH
- )
- var date = OS.get_datetime()
- log_file_path = log_file_path.plus_file(LOG_FILE_FORMAT % [
- str(date["year"]) + str(date["month"]) + str(date["day"]),
- str(date["hour"]) + str(date["minute"]) + str(date["second"])
- ])
- log_file.open(
- log_file_path,
- File.WRITE
- )
-
- func trace(owner: Object, msg: String):
- if _log_level >= LOG_TRACE:
- _log_to_file(owner, msg, "T")
- .trace(owner, msg)
-
- # Debug log
- func debug(owner: Object, msg: String):
- if _log_level >= LOG_DEBUG:
- _log_to_file(owner, msg, "D")
- .debug(owner, msg)
-
- func info(owner: Object, msg: String):
- if _log_level >= LOG_INFO:
- _log_to_file(owner, msg, "I")
- .info(owner, msg)
-
- # Warning log
- func warn(owner: Object, msg: String):
- if _log_level >= LOG_WARNING:
- _log_to_file(owner, msg, "W")
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.TERMINATE_ON_WARNINGS
- ):
- _log_stack_trace_to_file(owner)
- print_stack()
- close_logs()
- .warn(owner, msg)
-
- # Error log
- func error(owner: Object, msg: String):
- if _log_level >= LOG_ERROR:
- _log_to_file(owner, msg, "E")
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.TERMINATE_ON_ERRORS
- ):
- _log_stack_trace_to_file(owner)
- print_stack()
- close_logs()
- .error(owner, msg)
-
-
- # Close the log file cleanly
- func close_logs():
- print("Closing logs peacefully.")
- _log_line_to_file("Closing logs peacefully.")
- log_file.close()
-
-
- func _log_to_file(owner: Object, msg: String, letter: String):
- if log_file.is_open():
- var context = ""
- if owner != null:
- context = owner.get_script().resource_path.get_file()
- log_file.store_string(formatted_message(context, msg, letter) + "\n")
-
- func _log_line_to_file(msg: String):
- if log_file.is_open():
- log_file.store_string(msg + "\n")
-
- func _log_stack_trace_to_file(owner: Object):
- var frame_number = 0
- for stack in get_stack().slice(2, get_stack().size()):
- _log_line_to_file(
- "Frame %s - %s:%s in function '%s'" % [
- str(frame_number),
- stack["source"],
- stack["line"],
- stack["function"],
- ]
- )
- frame_number += 1
-
-
-# A simple logger that logs to terminal using debug() function
-class ESCLoggerVerbose extends ESCLoggerBase:
- func _init():
- pass
-
- func debug(owner: Object, msg: String):
- var context = owner.get_script().resource_path.get_file()
- print(context, ": ", msg)
-
diff --git a/addons/escoria-core/game/esc_project_settings_manager.gd b/addons/escoria-core/game/esc_project_settings_manager.gd
deleted file mode 100644
index f9a3fdfd..00000000
--- a/addons/escoria-core/game/esc_project_settings_manager.gd
+++ /dev/null
@@ -1,147 +0,0 @@
-# Registers and allows access to Escoria-specific project settings.
-extends Resource
-class_name ESCProjectSettingsManager
-
-
-# Root for Escoria-specific project settings
-const _ESCORIA_SETTINGS_ROOT = "escoria"
-
-# UI-related Escoria project settings
-const _UI_ROOT = "ui"
-
-const DEFAULT_DIALOG_TYPE = "%s/%s/default_dialog_type" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]
-const DEFAULT_TRANSITION = "%s/%s/default_transition" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]
-const DIALOG_MANAGERS = "%s/%s/dialog_managers" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]
-const GAME_SCENE = "%s/%s/game_scene" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]
-const INVENTORY_ITEM_SIZE = "%s/%s/inventory_item_size" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]
-const INVENTORY_ITEMS_PATH = "%s/%s/inventory_items_path" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]
-const TRANSITION_PATHS = "%s/%s/transition_paths" % [_ESCORIA_SETTINGS_ROOT, _UI_ROOT]
-
-
-# Main Escoria project settings
-const _MAIN_ROOT = "main"
-
-const COMMAND_DIRECTORIES = "%s/%s/command_directories" % [_ESCORIA_SETTINGS_ROOT, _MAIN_ROOT]
-const FORCE_QUIT = "%s/%s/force_quit" % [_ESCORIA_SETTINGS_ROOT, _MAIN_ROOT]
-const GAME_MIGRATION_PATH = "%s/%s/game_migration_path" % [_ESCORIA_SETTINGS_ROOT, _MAIN_ROOT]
-const GAME_VERSION = "%s/%s/game_version" % [_ESCORIA_SETTINGS_ROOT, _MAIN_ROOT]
-const GAME_START_SCRIPT = "%s/%s/game_start_script" % [_ESCORIA_SETTINGS_ROOT, _MAIN_ROOT]
-const ACTION_DEFAULT_SCRIPT = "%s/%s/action_default_script" % [_ESCORIA_SETTINGS_ROOT, _MAIN_ROOT]
-const SAVEGAMES_PATH = "%s/%s/savegames_path" % [_ESCORIA_SETTINGS_ROOT, _MAIN_ROOT]
-const SETTINGS_PATH = "%s/%s/settings_path" % [_ESCORIA_SETTINGS_ROOT, _MAIN_ROOT]
-const TEXT_LANG = "%s/%s/text_lang" % [_ESCORIA_SETTINGS_ROOT, _MAIN_ROOT]
-const VOICE_LANG = "%s/%s/voice_lang" % [_ESCORIA_SETTINGS_ROOT, _MAIN_ROOT]
-
-# Debug-related Escoria project settings
-const _DEBUG_ROOT = "debug"
-
-const CRASH_MESSAGE = "%s/%s/crash_message" % [_ESCORIA_SETTINGS_ROOT, _DEBUG_ROOT]
-const DEVELOPMENT_LANG = "%s/%s/development_lang" % [_ESCORIA_SETTINGS_ROOT, _DEBUG_ROOT]
-# If enabled, displays the room selection box for quick room change
-const ENABLE_ROOM_SELECTOR = "%s/%s/enable_room_selector" % [_ESCORIA_SETTINGS_ROOT, _DEBUG_ROOT]
-const LOG_FILE_PATH = "%s/%s/log_file_path" % [_ESCORIA_SETTINGS_ROOT, _DEBUG_ROOT]
-const LOG_LEVEL = "%s/%s/log_level" % [_ESCORIA_SETTINGS_ROOT, _DEBUG_ROOT]
-const ROOM_SELECTOR_ROOM_DIR = "%s/%s/room_selector_room_dir" % [_ESCORIA_SETTINGS_ROOT, _DEBUG_ROOT]
-const TERMINATE_ON_ERRORS = "%s/%s/terminate_on_errors" % [_ESCORIA_SETTINGS_ROOT, _DEBUG_ROOT]
-const TERMINATE_ON_WARNINGS = "%s/%s/terminate_on_warnings" % [_ESCORIA_SETTINGS_ROOT, _DEBUG_ROOT]
-# If enabled, displays the hover stack on screen
-const ENABLE_HOVER_STACK_VIEWER = "%s/%s/enable_hover_stack_viewer" % [_ESCORIA_SETTINGS_ROOT, _DEBUG_ROOT]
-
-# Sound-related Escoria project settings
-const _SOUND_ROOT = "sound"
-
-const MASTER_VOLUME = "%s/%s/master_volume" % [_ESCORIA_SETTINGS_ROOT, _SOUND_ROOT]
-const MUSIC_VOLUME = "%s/%s/music_volume" % [_ESCORIA_SETTINGS_ROOT, _SOUND_ROOT]
-const SFX_VOLUME = "%s/%s/sfx_volume" % [_ESCORIA_SETTINGS_ROOT, _SOUND_ROOT]
-const SPEECH_ENABLED = "%s/%s/speech_enabled" % [_ESCORIA_SETTINGS_ROOT, _SOUND_ROOT]
-const SPEECH_EXTENSION = "%s/%s/speech_extension" % [_ESCORIA_SETTINGS_ROOT, _SOUND_ROOT]
-const SPEECH_FOLDER = "%s/%s/speech_folder" % [_ESCORIA_SETTINGS_ROOT, _SOUND_ROOT]
-const SPEECH_VOLUME = "%s/%s/speech_volume" % [_ESCORIA_SETTINGS_ROOT, _SOUND_ROOT]
-
-# Platform-related Escoria project settings
-const _PLATFORM_ROOT = "platform"
-
-const SKIP_CACHE = "%s/%s/skip_cache" % [_ESCORIA_SETTINGS_ROOT, _PLATFORM_ROOT]
-const SKIP_CACHE_MOBILE = "%s/%s/skip_cache.mobile" % [_ESCORIA_SETTINGS_ROOT, _PLATFORM_ROOT]
-
-# Godot Windows project settings
-const DISPLAY = "display"
-const WINDOW = "window"
-const SIZE = "size"
-const FULLSCREEN = "%s/%s/%s/fullscreen" % [DISPLAY, WINDOW, SIZE]
-
-
-# Register a new project setting if it hasn't been defined already
-#
-# #### Parameters
-#
-# - name: Name of the project setting
-# - default_value: Default value
-# - info: Property info for the setting
-static func register_setting(name: String, default_value, info: Dictionary) -> void:
- if default_value == null:
- push_error("Default_value cannot be null. Use remove_setting function to remove settings.")
- assert(false)
-
- ProjectSettings.set_setting(
- name,
- default_value
- )
- if default_value != null:
- info.name = name
-
- # Project settings require a "type" to be set
- if not "type" in info:
- info.type=typeof(default_value)
- ProjectSettings.add_property_info(info)
-
-
-# Removes the specified project setting.
-#
-# #### Parameters
-#
-# - name: Name of the project setting
-static func remove_setting(name: String) -> void:
- if not ProjectSettings.has_setting(name):
- push_error("Cannot remove project setting %s - it does not exist." % name)
- assert(false)
- ProjectSettings.set_setting(
- name,
- null
- )
-
-
-# Retrieves the specified project setting.
-#
-# #### Parameters
-#
-# - key: Project setting name.
-#
-# *Returns* the value of the project setting located with key.
-static func get_setting(key: String):
- if not ProjectSettings.has_setting(key):
- push_error("Parameter %s is not set!" % key)
- assert(false)
-
- return ProjectSettings.get_setting(key)
-
-
-# Sets the specified project setting to the provided value.
-#
-# #### Parameters
-#
-# - key: Project setting name.
-# - value: Project setting value.
-static func set_setting(key: String, value) -> void:
- ProjectSettings.set_setting(key, value)
-
-
-# Simple wrapper for consistency's sake.
-#
-# #### Parameters
-#
-# - key: Project setting name.
-#
-# *Returns* true iff the project setting exists.
-static func has_setting(key: String) -> bool:
- return ProjectSettings.has_setting(key)
diff --git a/addons/escoria-core/game/escoria.gd b/addons/escoria-core/game/escoria.gd
deleted file mode 100644
index ea75ed0d..00000000
--- a/addons/escoria-core/game/escoria.gd
+++ /dev/null
@@ -1,196 +0,0 @@
-# The escoria main script
-tool
-extends Node
-class_name Escoria
-
-# Signal sent when pause menu has to be displayed
-signal request_pause_menu
-
-
-# Name of the Escoria core plugin
-const ESCORIA_CORE_PLUGIN_NAME: String = "escoria-core"
-
-
-# The main scene
-onready var main = $main
-
-
-
-func _init():
- escoria.inventory_manager = ESCInventoryManager.new()
- escoria.action_manager = ESCActionManager.new()
- escoria.event_manager = ESCEventManager.new()
- escoria.globals_manager = ESCGlobalsManager.new()
- add_child(escoria.event_manager)
- escoria.object_manager = ESCObjectManager.new()
- escoria.command_registry = ESCCommandRegistry.new()
- escoria.resource_cache = ESCResourceCache.new()
- escoria.save_manager = ESCSaveManager.new()
- escoria.inputs_manager = ESCInputsManager.new()
- escoria.settings_manager = ESCSettingsManager.new()
-
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.GAME_SCENE
- ).empty():
- escoria.logger.error(
- self,
- "Project setting '%s' is not set!" % ESCProjectSettingsManager.GAME_SCENE
- )
- else:
- escoria.game_scene = escoria.resource_cache.get_resource(
- ESCProjectSettingsManager.get_setting(ESCProjectSettingsManager.GAME_SCENE)
- ).instance()
-
-
-# Load settings
-func _ready():
- add_child(escoria.resource_cache)
-
- _handle_direct_scene_run()
-
- escoria.settings_manager.load_settings()
- escoria.settings_manager.apply_settings()
-
- escoria.room_manager.register_reserved_globals()
- escoria.inputs_manager.register_core()
-
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.GAME_START_SCRIPT
- ).empty():
- escoria.logger.error(
- self,
- "Project setting '%s' is not set!"
- % ESCProjectSettingsManager.GAME_START_SCRIPT
- )
- escoria.start_script = escoria.esc_compiler.load_esc_file(
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.GAME_START_SCRIPT
- )
- )
-
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.ACTION_DEFAULT_SCRIPT
- ).empty():
- escoria.logger.info(
- self,
- "Project setting '%s' is not set. No action defaults will be used."
- % ESCProjectSettingsManager.ACTION_DEFAULT_SCRIPT
- )
- else:
- escoria.action_default_script = escoria.esc_compiler.load_esc_file(
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.ACTION_DEFAULT_SCRIPT
- )
- )
-
- escoria.main = main
-
- _perform_plugins_checks()
-
-
-# Verifies that the game is configured with required plugin(s).
-# If a required plugin is missing (or disabled) we stop immediately.
-func _perform_plugins_checks():
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.DIALOG_MANAGERS
- ).empty():
- escoria.logger.error(
- self,
- "No dialog manager configured. Please add a dialog manager plugin."
- )
-
-
-# Manage notifications received from OS
-#
-# #### Parameters
-# - what: the notification constant received (usually defined in MainLoop)
-func _notification(what: int):
- match what:
- MainLoop.NOTIFICATION_WM_QUIT_REQUEST:
- escoria.logger.close_logs()
- escoria.is_quitting = true
- get_tree().quit()
- MainLoop.NOTIFICATION_WM_GO_BACK_REQUEST:
- escoria.logger.close_logs()
- escoria.is_quitting = true
- get_tree().quit()
-
-
-# Called by Escoria's main_scene as very very first event EVER.
-# Usually you'll want to show some logos animations before spawning the main
-# menu in the escoria/main/game_start_script 's :init event
-func init():
- # Don't show the UI until we're ready in order to avoid a sometimes-noticeable
- # blink. The UI will be "shown" later via a visibility update to the first room.
- escoria.game_scene.escoria_hide_ui()
- run_event_from_script(escoria.start_script, escoria.event_manager.EVENT_INIT)
- pass
-
-
-# Input function to manage specific input keys
-#
-# #### Parameters
-# - event: the input event to manage.
-func _input(event: InputEvent):
- if InputMap.has_action(ESCInputsManager.ESC_SHOW_DEBUG_PROMPT) \
- and event.is_action_pressed(ESCInputsManager.ESC_SHOW_DEBUG_PROMPT):
- main.get_node("layers/debug_layer/esc_prompt_popup").popup()
-
- if event.is_action_pressed("ui_cancel"):
- emit_signal("request_pause_menu")
- pass
-
-
-# Runs the event "event_name" from the "script" ESC script.
-#
-# #### Parameters
-# - script: ESC script containing the event to run. The script must have been
-# loaded.
-# - event_name: Name of the event to run
-func run_event_from_script(script: ESCScript, event_name: String):
- if script == null:
- escoria.logger.error(
- self,
- "Requested action %s on unloaded script %s." % [event_name, script] +
- "Please load the ESC script using esc_compiler.load_esc_file()."
- )
- escoria.event_manager.queue_event(script.events[event_name])
- var rc = yield(escoria.event_manager, "event_finished")
- while rc[1] != event_name:
- rc = yield(escoria.event_manager, "event_finished")
-
- if rc[0] != ESCExecution.RC_OK:
- escoria.logger.error(
- self,
- "Start event of the start script returned unsuccessful: %d." % rc[0]
- )
- return
-
-
-# Called from escoria autoload to start a new game.
-func new_game():
- escoria.game_scene.escoria_show_ui()
- run_event_from_script(escoria.start_script, escoria.event_manager.EVENT_NEW_GAME)
-
-
-# Function called to quit the game.
-func quit():
- get_tree().notification(MainLoop.NOTIFICATION_WM_QUIT_REQUEST)
-
-
-# Handle anything necessary if the game started a scene directly.
-func _handle_direct_scene_run() -> void:
- if escoria.is_direct_room_run:
- escoria.object_manager.set_current_room(get_tree().get_current_scene())
-
-
-# Used by game.gd to determine whether the game scene is ready to take inputs
-# from the _input() function. To do so, the current_scene must be set, the game
-# scene must be set, and the game scene must've been notified that the room
-# is ready.
-#
-# *Returns*
-# true if game scene is ready for inputs
-func is_ready_for_inputs() -> bool:
- return main.current_scene and main.current_scene.game \
- and main.current_scene.game.room_ready_for_inputs
diff --git a/addons/escoria-core/game/escoria.tscn b/addons/escoria-core/game/escoria.tscn
deleted file mode 100644
index 7c1167a5..00000000
--- a/addons/escoria-core/game/escoria.tscn
+++ /dev/null
@@ -1,11 +0,0 @@
-[gd_scene load_steps=3 format=2]
-
-[ext_resource path="res://addons/escoria-core/game/main.tscn" type="PackedScene" id=2]
-[ext_resource path="res://addons/escoria-core/game/escoria.gd" type="Script" id=3]
-
-[node name="escoria_scene" type="Node"]
-script = ExtResource( 3 )
-
-[node name="main" parent="." instance=ExtResource( 2 )]
-
-[editable path="main"]
diff --git a/addons/escoria-core/game/main.gd b/addons/escoria-core/game/main.gd
deleted file mode 100644
index 0a72542d..00000000
--- a/addons/escoria-core/game/main.gd
+++ /dev/null
@@ -1,263 +0,0 @@
-# Escoria main room handling and scene switcher
-extends Node
-
-# This script is basically the scene-switcher.
-
-
-# Signal sent when the room is loaded and ready.
-signal room_ready
-
-
-# Global id of the last scene the player was before current scene
-var last_scene_global_id: String
-
-# Current scene room being displayed
-var current_scene: Node
-
-# Scene that was previously the current scene.
-var previous_scene: Node
-
-# The Escoria context currently in wait state
-var wait_level
-
-# Reference to the scene transition node
-onready var scene_transition: ESCTransitionPlayer
-
-
-# Connect the wait timer event
-func _ready() -> void:
- scene_transition = ESCTransitionPlayer.new()
- $layers/curtain.add_child(scene_transition)
- $layers/wait_timer.connect("timeout", self, "_on_wait_finished")
-
-
-func _exit_tree():
- $layers/curtain.remove_child(scene_transition)
- scene_transition.queue_free()
-
-# Set current scene
-#
-# #### Parameters
-#
-# - p_scene: Scene to set
-func set_scene(p_scene: Node) -> void:
- if !p_scene:
- escoria.logger.error(
- self,
- "Can't change to an empty scene. Please specify the scene name."
- )
-
- previous_scene = current_scene
-
- if is_instance_valid(previous_scene):
- _disable_collisions()
-
- if not p_scene.is_inside_tree():
- # Set the scene's visiblity for :setup events if the new room is not the
- # same one as the current room.
- if not _is_same_scene(current_scene, p_scene):
- p_scene.visible = false
-
- escoria.object_manager.set_current_room(p_scene)
- add_child(p_scene)
-
- # In cases where the room being created doesn't return because of a
- # coroutine, finish_current_scene_init() will already have been called
- # and so we don't want to risk repeating ourselves.
- if p_scene == current_scene:
- return
-
- # This actually moves the scene closest to the root node, but will
- # still be drawn behind the next node, which should be the previous
- # room.
- move_child(p_scene, 0)
-
- current_scene = p_scene
-
-
-# Only called by the room manager in the case where it hasn't executed a
-# coroutine prior to calling set_scene_finish().
-#
-# ### Parameters
-#
-# - p_scene: The scene currently being initialized by set_scene.
-func finish_current_scene_init(p_scene: Node) -> void:
- if is_a_parent_of(p_scene):
- move_child(p_scene, 0)
-
- current_scene = p_scene
-
-
-# Completes the room swap and should be called by the room manager at the
-# appropriate time.
-func set_scene_finish() -> void:
- # Final check for the critical game scene's existence.
- check_game_scene_methods()
-
- # Make our new scene visible.
- current_scene.visible = true
-
- clear_previous_scene()
- emit_signal("room_ready")
-
-
-
-# Cleanup the previous scene if there was one.
-func clear_previous_scene() -> void:
- if previous_scene == null:
- return
-
- escoria.action_manager.clear_current_action()
- escoria.action_manager.clear_current_tool()
-
- if escoria.game_scene.get_parent() == previous_scene:
- previous_scene.remove_child(escoria.game_scene)
-
- previous_scene.visible = false
- previous_scene.get_parent().remove_child(previous_scene)
-
- previous_scene.queue_free()
- previous_scene = null
-
-
-# Triggered, when the wait has finished
-func _on_wait_finished() -> void:
- escoria.esc_level_runner.finished(wait_level)
-
-
-# Set the camera limits
-#
-# #### Parameters
-#
-# * camera_limits_id: The id of the room's camera limits to set
-# * scene: The scene to set the camera limits for. We make this optional since
-# most times it'll be current_scene that needs setting; however, e.g. when
-# starting up Escoria, we might not have already set the current_scene.
-func set_camera_limits(camera_limit_id: int = 0, scene: Node = current_scene) -> void:
- var limits = {}
- var last_available_camera_limit = scene.camera_limits.size() - 1
- if camera_limit_id > last_available_camera_limit:
- escoria.logger.error(
- self,
- "Camera limit %d requested. Last available camera limit is %d." % [
- camera_limit_id,
- last_available_camera_limit
- ]
- )
- var scene_camera_limits = scene.camera_limits[camera_limit_id]
- if scene_camera_limits.size.x == 0 and scene_camera_limits.size.y == 0:
- var area = Rect2()
- for child in scene.get_children():
- if child is ESCBackground:
- area = child.get_full_area_rect2()
- break
-
- # if the background is smaller than the viewport, we want the camera
- # to stick centered on the background
- if area.size.x == 0 or area.size.y == 0 \
- or area.size < get_viewport().size:
- escoria.logger.warn(
- self,
- "Defined camera is smaller than the viewport. Using viewport size."
- )
- area.size = get_viewport().size
-
- escoria.logger.info(
- self,
- "Setting camera limits from scene " + str(area)
- )
- limits = ESCCameraLimits.new(
- area.position.x,
- area.position.x + area.size.x,
- area.position.y,
- area.position.y + area.size.y
- )
- else:
- limits = ESCCameraLimits.new(
- scene_camera_limits.position.x,
- scene_camera_limits.position.x + \
- scene_camera_limits.size.x,
- scene_camera_limits.position.y,
- scene_camera_limits.position.y + \
- scene_camera_limits.size.y
- )
- escoria.logger.info(
- self,
- "Setting camera limits using configured parameters " + str(scene_camera_limits)
- )
-
- escoria.object_manager.get_object(
- escoria.object_manager.CAMERA
- ).node.set_limits(limits)
-
-
-func save_game(p_savegame_res: Resource) -> void:
- p_savegame_res.main = {
- ESCSaveGame.MAIN_LAST_SCENE_GLOBAL_ID_KEY: last_scene_global_id,
- ESCSaveGame.MAIN_CURRENT_SCENE_FILENAME_KEY: current_scene.filename \
- if current_scene != null \
- else "No current scene (not loaded yet)"
- }
-
-
-# Sanity check that the game.tscn scene's root node script MUST
-# implement the following methods. If they do not exist, stop immediately.
-# Implement them, even if empty
-func check_game_scene_methods():
- assert(current_scene.game.has_method("left_click_on_bg"))
- assert(current_scene.game.has_method("right_click_on_bg"))
- assert(current_scene.game.has_method("left_double_click_on_bg"))
-
- assert(current_scene.game.has_method("element_focused"))
- assert(current_scene.game.has_method("element_unfocused"))
-
- assert(current_scene.game.has_method("left_click_on_item"))
- assert(current_scene.game.has_method("right_click_on_item"))
- assert(current_scene.game.has_method("left_double_click_on_item"))
-
- assert(current_scene.game.has_method("open_inventory"))
- assert(current_scene.game.has_method("close_inventory"))
-
- assert(current_scene.game.has_method("left_click_on_inventory_item"))
- assert(current_scene.game.has_method("right_click_on_inventory_item"))
- assert(current_scene.game.has_method("left_double_click_on_inventory_item"))
-
- assert(current_scene.game.has_method("inventory_item_focused"))
- assert(current_scene.game.has_method("inventory_item_unfocused"))
-
- assert(current_scene.game.has_method("mousewheel_action"))
-
- assert(current_scene.game.has_method("hide_ui"))
- assert(current_scene.game.has_method("show_ui"))
- assert(current_scene.game.has_method("escoria_hide_ui"))
- assert(current_scene.game.has_method("escoria_show_ui"))
- assert(current_scene.game.has_method("_on_event_done"))
-
-
-# Determines whether two scenes represent the same room.
-#
-# ### Parameters
-#
-# - scene_1: Scene to be compared.
-# - scene_2: Other scene to be compared.
-#
-# **Returns** true iff the two scenes represent the same room.
-func _is_same_scene(scene_1: Node, scene_2: Node) -> bool:
- if scene_1 is ESCRoom and scene_2 is ESCRoom:
- return scene_1.global_id == scene_2.global_id
-
- return false
-
-
-# Disable collisions in the previous scene so if we have two scenes in the same
-# game tree, collisions won't result.
-func _disable_collisions() -> void:
- var items_to_disable = previous_scene.get_tree().get_nodes_in_group(ESCItem.GROUP_ITEM_CAN_COLLIDE)
-
- for item in items_to_disable:
- if is_instance_valid(item.collision):
- item.collision.disabled = true
- if item is Area2D:
- item.monitoring = false
- item.monitorable = false
-
diff --git a/addons/escoria-core/game/main.tscn b/addons/escoria-core/game/main.tscn
deleted file mode 100644
index 0bb8f378..00000000
--- a/addons/escoria-core/game/main.tscn
+++ /dev/null
@@ -1,27 +0,0 @@
-[gd_scene load_steps=6 format=2]
-
-[ext_resource path="res://addons/escoria-core/game/main.gd" type="Script" id=1]
-[ext_resource path="res://addons/escoria-core/game/scenes/esc_prompt/esc_prompt_popup.tscn" type="PackedScene" id=2]
-[ext_resource path="res://addons/escoria-core/game/scenes/sound/esc_music_player.tscn" type="PackedScene" id=3]
-[ext_resource path="res://addons/escoria-core/game/scenes/sound/esc_sound_player.tscn" type="PackedScene" id=5]
-[ext_resource path="res://addons/escoria-core/game/scenes/sound/esc_speech_player.tscn" type="PackedScene" id=6]
-
-[node name="main" type="Node"]
-script = ExtResource( 1 )
-
-[node name="layers" type="Node" parent="."]
-
-[node name="curtain" type="CanvasLayer" parent="layers"]
-layer = 20
-
-[node name="wait_timer" type="Timer" parent="layers"]
-
-[node name="debug_layer" type="CanvasLayer" parent="layers"]
-
-[node name="esc_prompt_popup" parent="layers/debug_layer" instance=ExtResource( 2 )]
-
-[node name="bg_music" parent="." instance=ExtResource( 3 )]
-
-[node name="bg_sound" parent="." instance=ExtResource( 5 )]
-
-[node name="speech" parent="." instance=ExtResource( 6 )]
diff --git a/addons/escoria-core/game/main_scene.gd b/addons/escoria-core/game/main_scene.gd
deleted file mode 100644
index f556f535..00000000
--- a/addons/escoria-core/game/main_scene.gd
+++ /dev/null
@@ -1,17 +0,0 @@
-# Main_scene is the entry point for Godot Engine.
-# This scene sets up the main menu scene to load.
-extends Node
-class_name ESCMain
-
-var escoria_node: Escoria
-
-
-# Start the main menu
-func _ready():
- escoria.logger.info(self, "Escoria starts...")
-
- escoria_node = preload("res://addons/escoria-core/game/escoria.tscn").instance()
- add_child(escoria_node)
-
- if not escoria.is_direct_room_run:
- escoria_node.init()
diff --git a/addons/escoria-core/game/main_scene.tscn b/addons/escoria-core/game/main_scene.tscn
deleted file mode 100644
index 60490b71..00000000
--- a/addons/escoria-core/game/main_scene.tscn
+++ /dev/null
@@ -1,6 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-core/game/main_scene.gd" type="Script" id=1]
-
-[node name="main_scene" type="Node"]
-script = ExtResource( 1 )
diff --git a/addons/escoria-core/game/scenes/camera_player/camera.tscn b/addons/escoria-core/game/scenes/camera_player/camera.tscn
deleted file mode 100644
index e2277335..00000000
--- a/addons/escoria-core/game/scenes/camera_player/camera.tscn
+++ /dev/null
@@ -1,9 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-core/game/scenes/camera_player/esc_camera.gd" type="Script" id=1]
-
-[node name="camera" type="Camera2D"]
-current = true
-drag_margin_h_enabled = true
-drag_margin_v_enabled = true
-script = ExtResource( 1 )
diff --git a/addons/escoria-core/game/scenes/camera_player/esc_camera.gd b/addons/escoria-core/game/scenes/camera_player/esc_camera.gd
deleted file mode 100644
index 2a4e656d..00000000
--- a/addons/escoria-core/game/scenes/camera_player/esc_camera.gd
+++ /dev/null
@@ -1,442 +0,0 @@
-# Camera handling
-extends Camera2D
-class_name ESCCamera
-
-
-# Reference to the tween node for animating camera movements
-var _tween: Tween
-
-# Target position of the camera
-var _target: Vector2 = Vector2()
-
-# The object to follow
-var _follow_target: Node = null
-
-# Target zoom of the camera
-var _zoom_target: Vector2
-
-
-# Prepare the tween
-func _ready():
- _tween = Tween.new()
- add_child(_tween)
- _tween.connect("tween_all_completed", self, "_target_reached")
-
-
-func _exit_tree():
- if is_instance_valid(_tween):
- remove_child(_tween)
- _tween.queue_free()
-
-
-# Update the position if the followed target is moving
-func _process(_delta):
- if is_instance_valid(_follow_target) and not _tween.is_active() and _follow_target.has_moved():
- self.global_position = _follow_target.global_position
-
-
-# Register this camera with the object manager. We do it out here so we can
-# work with the camera before it's made active as part of the current scene
-# tree.
-#
-# #### Parameters
-#
-# - room: The room with which to register the camera.
-func register(room = null):
- escoria.object_manager.register_object(
- ESCObject.new(
- escoria.object_manager.CAMERA,
- self
- ),
- room,
- true
- )
-
-
-# Returns the camera's tween.
-#
-# **Returns** the tween owned by this camera.
-func get_tween() -> Tween:
- return _tween
-
-
-# Sets camera limits so it doesn't go out of the scene
-#
-# #### Parameters
-#
-# - limits: The limits to set
-func set_limits(limits: ESCCameraLimits):
- self.limit_left = limits.limit_left
- self.limit_right = limits.limit_right
- self.limit_top = limits.limit_top
- self.limit_bottom = limits.limit_bottom
-
-
-func set_drag_margin_enabled(p_dm_h_enabled, p_dm_v_enabled):
- self.drag_margin_h_enabled = p_dm_h_enabled
- self.drag_margin_v_enabled = p_dm_v_enabled
-
-
-# Set the target for the camera
-#
-# #### Parameters
-# - p_target: Object to target
-# - p_time: Number of seconds for the camera to reach the target
-func set_target(p_target, p_time : float = 0.0):
- _resolve_target_and_zoom(p_target)
-
- escoria.logger.info(
- self,
- "Current camera position = %s." % str(self.global_position)
- )
-
- if p_time == 0.0:
- self.global_position = _target
- else:
- # Need to wait a frame in order to ensure the screen centre position is
- # recalculated. Also to allow any close-calls with the tween to finish.
- yield(get_tree(), "idle_frame")
-
- if _tween.is_active():
- escoria.logger.debug(
- self,
- "set_target tween is still active: %f seconds of %f completed." % [
- _tween.tell(),
- _tween.get_runtime()
- ]
- )
- _tween.stop_all()
-
- set_drag_margin_enabled(false, false)
-
- _convert_current_global_pos_for_disabled_drag_margin()
- _target = _convert_pos_for_disabled_drag_margin(_target)
-
- _tween.interpolate_property(
- self,
- "global_position",
- self.global_position,
- _target,
- p_time,
- Tween.TRANS_LINEAR,
- Tween.EASE_IN_OUT
- )
- _tween.start()
-
-
-# Set the camera zoom level
-#
-# #### Parameters
-# - p_zoom_level: Zoom level to set
-# - p_time: Number of seconds for the camera to reach the zoom level
-func set_camera_zoom(p_zoom_level: float, p_time: float):
- if p_zoom_level <= 0.0:
- escoria.logger.error(
- self,
- "Tried to set negative or zero zoom level."
- )
-
- _zoom_target = Vector2(1, 1) * p_zoom_level
-
- if p_time == 0:
- self.zoom = _zoom_target
- else:
- # Need to wait a frame in order to ensure the screen centre position is
- # recalculated. Also to allow any close-calls with the tween to finish.
- yield(get_tree(), "idle_frame")
-
- if _tween.is_active():
- escoria.logger.debug(
- self,
- "set_camera_zoom tween is still active: %f seconds of %f completed." % [
- _tween.tell(),
- _tween.get_runtime()
- ]
- )
- _tween.stop_all()
-
- set_drag_margin_enabled(false, false)
-
- _convert_current_global_pos_for_disabled_drag_margin()
-
- _tween.interpolate_property(
- self,
- "zoom",
- self.zoom,
- _zoom_target,
- p_time,
- Tween.TRANS_LINEAR,
- Tween.EASE_IN_OUT
- )
- _tween.start()
-
-
-# Push the camera towards the target in terms of position and zoom level
-# using a given transition type and time.
-# See
-# https://docs.godotengine.org/en/stable/classes/class_tween.html#enumerations
-#
-# #### Parameters
-# - p_target: Target to push to
-# - p_time: Number of seconds for the transition to take
-# - p_type: Tween transition type
-func push(p_target, p_time: float = 0.0, p_type: int = 0):
- _resolve_target_and_zoom(p_target)
-
- var push_target = null
-
- if _follow_target != null:
- push_target = p_target.position
- else:
- push_target = _target
-
- if p_time == 0:
- self.global_position = push_target
-
- if _zoom_target != Vector2():
- self.zoom = _zoom_target
- else:
- # Need to wait a frame in order to ensure the screen centre position is
- # recalculated. Also to allow any close-calls with the tween to finish.
- yield(get_tree(), "idle_frame")
-
- if _tween.is_active():
- escoria.logger.debug(
- self,
- "camera push tween is still active: %f seconds of %f completed." % [
- _tween.tell(),
- _tween.get_runtime()
- ]
- )
- _tween.stop_all()
-
- if _zoom_target != Vector2():
- _tween.interpolate_property(
- self,
- "zoom",
- self.zoom,
- _zoom_target,
- p_time,
- p_type,
- Tween.EASE_IN_OUT
- )
-
- set_drag_margin_enabled(false, false)
-
- _convert_current_global_pos_for_disabled_drag_margin()
-
- _tween.interpolate_property(
- self,
- "global_position",
- self.global_position,
- push_target,
- p_time,
- p_type,
- Tween.EASE_IN_OUT
- )
-
- _tween.start()
-
-
-# Shift the camera by the given vector in a given time and using a specific
-# Tween transition type.
-#
-# See
-# https://docs.godotengine.org/en/stable/classes/class_tween.html#enumerations
-#
-# #### Parameters
-# - p_target: Vector to shift the camera by
-# - p_time: Number of seconds for the transition to take
-# - p_type: Tween transition type
-func shift(p_target: Vector2, p_time: float, p_type: int):
- _follow_target = null
-
- var new_pos = self.global_position + p_target
- _target = new_pos
-
- if _tween.is_active():
- # Need to wait a frame in order to ensure the screen centre position is
- # recalculated. Also to allow any close-calls with the tween to finish.
- yield(get_tree(), "idle_frame")
-
- escoria.logger.debug(
- self,
- "camera shift tween is still active: %f seconds of %f completed." % [
- _tween.tell(),
- _tween.get_runtime()
- ]
- )
- _tween.stop_all()
-
- set_drag_margin_enabled(false, false)
-
- _convert_current_global_pos_for_disabled_drag_margin()
-
- _tween.interpolate_property(
- self,
- "global_position",
- self.global_position,
- _target,
- p_time,
- p_type,
- Tween.EASE_IN_OUT
- )
- _tween.start()
-
-
-# Checks whether the given point is contained within the viewport's limits.
-# Note that this is different from the camera's limits when using anchor mode
-# DRAG_CENTER.
-#
-# #### Parameters
-# - point: Point to be tested against viewport limits.
-#
-# **Returns** true iff point is inside the calculated viewport's limits (inclusive)
-func check_point_is_inside_viewport_limits(point: Vector2) -> bool:
- var viewport_rect: Rect2 = get_viewport_rect()
- var screen_half_size: Vector2 = viewport_rect.size * 0.5
-
- var limits_to_test: Rect2 = Rect2(
- limit_left + screen_half_size.x,
- limit_top + screen_half_size.y,
- limit_right - limit_left - viewport_rect.size.x + 1,
- limit_bottom - limit_top - viewport_rect.size.y + 1
- )
-
- return limits_to_test.has_point(point)
-
-
-# Returns the inclusive minimum and maximum values for the x-component of the current valid viewport.
-# Mainly used in any logging messages related to same.
-#
-# **Returns** the inclusive minimum and maximum values for the x-component of the current valid viewport.
-func get_current_valid_viewport_values_x() -> Array:
- var viewport_rect: Rect2 = get_viewport_rect()
-
- return [limit_left + viewport_rect.size.x * 0.5, limit_right - viewport_rect.size.x * 0.5]
-
-
-# Returns the inclusive minimum and maximum values for the y-component of the current valid viewport.
-# Mainly used in any logging messages related to same.
-#
-# **Returns* the inclusive minimum and maximum values for the y-component of the current valid viewport.
-func get_current_valid_viewport_values_y() -> Array:
- var viewport_rect: Rect2 = get_viewport_rect()
-
- return [limit_top + viewport_rect.size.y * 0.5, limit_bottom - viewport_rect.size.y * 0.5]
-
-
-# Returns the camera's current limits as a Rect2.
-# Mainly used in any logging messages related to same.
-#
-# **Returns** the camera's current limits as a Rect2.
-func get_camera_limit_rect() -> Rect2:
- return Rect2(limit_left, limit_top, limit_right - limit_left, limit_bottom - limit_top)
-
-
-# Used when drag margins are enabled. Clamps the camera so it respects the viewport limits inside
-# the camera limits.
-func clamp_to_viewport_limits() -> void:
- var viewport_rect: Rect2 = get_viewport_rect()
-
- var cur_camera_pos: Vector2 = self.get_camera_screen_center()
- var ret_position: Vector2 = cur_camera_pos
-
- if cur_camera_pos.x - viewport_rect.size.x * 0.5 * zoom.x <= limit_left:
- ret_position.x = limit_left + viewport_rect.size.x * 0.5 * zoom.x * (1 + drag_margin_left)
- elif cur_camera_pos.x + viewport_rect.size.x * 0.5 * zoom.x >= limit_right:
- ret_position.x = limit_right - viewport_rect.size.x * 0.5 * zoom.x * (1 + drag_margin_right)
-
- if cur_camera_pos.y - viewport_rect.size.y * 0.5 * zoom.y <= limit_top:
- ret_position.y = limit_top + viewport_rect.size.y * 0.5 * zoom.y * (1 + drag_margin_top)
- elif cur_camera_pos.y + viewport_rect.size.y * 0.5 * zoom.y >= limit_bottom:
- ret_position.y = limit_bottom - viewport_rect.size.y * 0.5 * zoom.y * (1 + drag_margin_bottom)
-
- self.global_position = ret_position
-
-
-func _target_reached():
- _tween.stop_all()
- set_drag_margin_enabled(true, true)
-
-
-# Use this to compensate the camera's current global_position when disabling drag margins.
-#
-# (See https://github.com/godotengine/godot/blob/3.5/scene/2d/camera_2d.cpp for more details.)
-#
-# This helps to ensure that when we disable or enable drag margins that the position on the screen
-# is maintained without the camera "jumping".
-#
-# This is something of a hack until we decide on whether we implement an Escoria-specific camera
-# instead of relying on Camera2D.
-func _convert_current_global_pos_for_disabled_drag_margin() -> void:
- var cur_camera_pos: Vector2 = self.get_camera_screen_center()
- var ret_position: Vector2 = _convert_pos_for_disabled_drag_margin(cur_camera_pos)
-
- self.global_position = ret_position
-
-
-# Converts the given position set with drag margins enabled to the same position when calculated
-# with drag margins disabled.
-#
-# This is helpful for preventing the camera from "jumping" when disabling drag margins, e.g. in
-# order to perform some camera translations/tweening.
-#
-# #### Parameters
-# - pos: Position to be converted.
-#
-# **Returns** the position on the screen that would be the equivalent of `pos` when rendered with
-# drag margins disabled.
-func _convert_pos_for_disabled_drag_margin(pos: Vector2) -> Vector2:
- var viewport_rect: Rect2 = get_viewport_rect()
- var ret_position: Vector2 = pos
-
- # If the current calculated centre of the camera/viewport is close enough to the set camera
- # limits (i.e. the centre is upto and including half the viewport's size to the limit being
- # tested), then we make sure the global_position is at the same coordinates since Camera2D will
- # recalculate that position to the exact same position (i.e. no funny math).
- #
- # Otherwise, we set the global_position to be the value that would allow Camera2D to convert it
- # to the value of the current calculated centre. This compensates for the switch when disabling
- # drag margins.
- if ret_position.x - viewport_rect.size.x * 0.5 * zoom.x <= limit_left:
- ret_position.x = limit_left + viewport_rect.size.x * 0.5 * zoom.x
- elif ret_position.x + viewport_rect.size.x * 0.5 * zoom.x >= limit_right:
- ret_position.x = limit_right - viewport_rect.size.x * 0.5 * zoom.x
-
- if ret_position.y - viewport_rect.size.y * 0.5 * zoom.y <= limit_top:
- ret_position.y = limit_top + viewport_rect.size.y * 0.5 * zoom.y
- elif ret_position.y + viewport_rect.size.y * 0.5 * zoom.y >= limit_bottom:
- ret_position.y = limit_bottom - viewport_rect.size.y * 0.5 * zoom.y
-
- return ret_position
-
-
-# Resolve the correct position and zoom of the target object
-#
-# #### Parameters
-# - p_target: The target to resolve
-func _resolve_target_and_zoom(p_target) -> void:
- _target = Vector2()
- _zoom_target = Vector2()
- _follow_target = null
-
- if p_target is Node and "is_movable" in p_target and p_target.is_movable:
- _follow_target = p_target
-
- if p_target is Vector2:
- _target = p_target
- elif p_target is Array and p_target.size() > 0:
- var target_pos = Vector2()
-
- for obj in p_target:
- target_pos += obj.get_camera_pos()
-
- _target = target_pos / p_target.size()
- elif p_target.has_method("get_camera_node"):
- if "global_position" in p_target.get_camera_node():
- _target = p_target.get_camera_node().global_position
- if "zoom" in p_target.get_camera_node():
- _zoom_target = p_target.get_camera_node().zoom
- else:
- _target = p_target.global_position
diff --git a/addons/escoria-core/game/scenes/camera_player/esc_camera_limits.gd b/addons/escoria-core/game/scenes/camera_player/esc_camera_limits.gd
deleted file mode 100644
index b4897464..00000000
--- a/addons/escoria-core/game/scenes/camera_player/esc_camera_limits.gd
+++ /dev/null
@@ -1,28 +0,0 @@
-# Describes a bounding box that limits the camera movement in the scene
-extends Reference
-class_name ESCCameraLimits
-
-
-# The left side of the bounding box
-var limit_left: int = -10000
-
-# The right side of the bounding box
-var limit_right: int = 10000
-
-# The top side of the bounding box
-var limit_top: int = -10000
-
-# The bottom side of the bounding box
-var limit_bottom: int = 10000
-
-
-func _init(
- left: int,
- right: int,
- top: int,
- bottom: int
-):
- limit_left = left
- limit_right = right
- limit_top = top
- limit_bottom = bottom
diff --git a/addons/escoria-core/game/scenes/dialogs/esc_dialog_manager.gd b/addons/escoria-core/game/scenes/dialogs/esc_dialog_manager.gd
deleted file mode 100644
index d190a6eb..00000000
--- a/addons/escoria-core/game/scenes/dialogs/esc_dialog_manager.gd
+++ /dev/null
@@ -1,98 +0,0 @@
-# A base class for dialog plugins to work with Escoria
-extends Control
-class_name ESCDialogManager
-
-
-# Emitted when the say function has completed showing the text
-signal say_finished
-
-# Emitted when text has just become fully visible
-signal say_visible
-
-# Emitted when the player has chosen an option
-signal option_chosen(option)
-
-
-# Check whether a specific type is supported by the
-# dialog plugin
-#
-# #### Parameters
-# - type: required type
-# *Returns* Whether the type is supported or not
-func has_type(type: String) -> bool:
- return false
-
-
-# Check whether a specific chooser type is supported by the
-# dialog plugin
-#
-# #### Parameters
-# - type: required chooser type
-# *Returns* Whether the type is supported or not
-func has_chooser_type(type: String) -> bool:
- return false
-
-
-# Output a text said by the item specified by the global id. Emit
-# `say_finished` after finishing displaying the text.
-#
-# #### Parameters
-# - dialog_player: Node of the dialog player in the UI
-# - global_id: Global id of the item that is speaking
-# - text: Text to say, optional prefixed by a translation key separated
-# by a ":"
-# - type: Type of dialog box to use
-func say(dialog_player: Node, global_id: String, text: String, type: String):
- pass
-
-
-# Instructs the dialog manager to preserve the next dialog box used by a `say`
-# command until a call to `disable_preserve_dialog_box` is made.
-#
-# This method should be idempotent, i.e. if called after the first time and
-# prior to `disable_preserve_dialog_box` being called, the result should be the
-# same.
-func enable_preserve_dialog_box() -> void:
- pass
-
-
-# Instructs the dialog manager to no longer preserve the currently-preserved
-# dialog box or to not preserve the next dialog box used by a `say` command
-# (this is the default state).
-#
-# This method should be idempotent, i.e. if called after the first time and
-# prior to `enable_preserve_dialog_box` being called, the result should be the
-# same.
-func disable_preserve_dialog_box() -> void:
- pass
-
-
-# Present an option chooser to the player and sends the signal
-# `option_chosen` with the chosen dialog option
-#
-# #### Parameters
-# - dialog_player: Node of the dialog player in the UI
-# - dialog: Information about the dialog to display
-# - type: The dialog chooser type to use
-func choose(dialog_player: Node, dialog: ESCDialog, type: String):
- pass
-
-
-# Trigger running the dialogue faster
-func speedup():
- pass
-
-
-# Trigger an instant finish of the current dialog
-func finish():
- pass
-
-
-# The say command has been interrupted, cancel the dialog display
-func interrupt():
- pass
-
-
-# To be called if voice audio has finished.
-func voice_audio_finished():
- pass
diff --git a/addons/escoria-core/game/scenes/dialogs/esc_dialog_options_chooser.gd b/addons/escoria-core/game/scenes/dialogs/esc_dialog_options_chooser.gd
deleted file mode 100644
index 4cb9d424..00000000
--- a/addons/escoria-core/game/scenes/dialogs/esc_dialog_options_chooser.gd
+++ /dev/null
@@ -1,40 +0,0 @@
-# Base class for all dialog options implementations
-extends Control
-class_name ESCDialogOptionsChooser
-
-
-# An option was chosen
-#
-# ##### Parameters
-#
-# - option: The dialog option that was chosen
-signal option_chosen(option)
-
-
-# The dialog to show
-var dialog: ESCDialog
-
-
-# Set the dialog used for the chooser
-#
-# #### Parameters
-#
-# - new_dialog: Dialog to set
-func set_dialog(new_dialog: ESCDialog) -> void:
- self.dialog = new_dialog
-
-
-# Show the dialog chooser UI
-func show_chooser() -> void:
- escoria.logger.error(
- self,
- "Dialog chooser does not implement the show method."
- )
-
-
-# Hide the dialog chooser UI
-func hide_chooser() -> void:
- escoria.logger.error(
- self,
- "Dialog chooser does not implement the hide method."
- )
diff --git a/addons/escoria-core/game/scenes/dialogs/esc_dialog_player.gd b/addons/escoria-core/game/scenes/dialogs/esc_dialog_player.gd
deleted file mode 100644
index c52af820..00000000
--- a/addons/escoria-core/game/scenes/dialogs/esc_dialog_player.gd
+++ /dev/null
@@ -1,198 +0,0 @@
-# Escoria dialog player
-extends Node
-class_name ESCDialogPlayer
-
-
-# Emitted when an answer as chosem
-#
-# ##### Parameters
-#
-# - option: The dialog option that was chosen
-signal option_chosen(option)
-
-# Emitted when a say command finished
-signal say_finished
-
-
-# Used when specifying dialog types in various methods
-const DIALOG_TYPE_SAY = "say"
-
-const DIALOG_TYPE_CHOOSE = "choose"
-
-
-# Reference to the currently playing "say" dialog manager
-var _say_dialog_manager: ESCDialogManager = null
-
-# Reference to the currently playing "choose" dialog manager
-var _choose_dialog_manager: ESCDialogManager = null
-
-# Whether to use the "dialog box preservation" feature
-var _block_say_enabled: bool = false
-
-
-# Register the dialog player and load the dialog resources
-func _ready():
- if Engine.is_editor_hint():
- return
-
- escoria.dialog_player = self
-
-
-# Instructs the dialog manager to preserve the next dialog box used by a `say`
-# command until a call to `disable_preserve_dialog_box` is made.
-#
-# This method should be idempotent, i.e. if called after the first time and
-# prior to `disable_preserve_dialog_box` being called, the result should be the
-# same.
-func enable_preserve_dialog_box() -> void:
- _block_say_enabled = true
-
-
-# Instructs the dialog manager to no longer preserve the currently-preserved
-# dialog box or to not preserve the next dialog box used by a `say` command
-# (this is the default state).
-#
-# This method should be idempotent, i.e. if called after the first time and
-# prior to `enable_preserve_dialog_box` being called, the result should be the
-# same.
-func disable_preserve_dialog_box() -> void:
- _block_say_enabled = false
- _say_dialog_manager.disable_preserve_dialog_box()
-
-
-# Make a character say some text
-#
-# #### Parameters
-#
-# - character: Character that is talking
-# - type: UI to use for the dialog
-# - text: Text to say
-func say(character: String, type: String, text: String) -> void:
- if type == "":
- type = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.DEFAULT_DIALOG_TYPE
- )
-
- # We only need to remove the dialog manager from the scene tree if the dialog manager type
- # has changed since the last use of this method.
- _update_dialog_manager(DIALOG_TYPE_SAY, _say_dialog_manager, type)
-
- if _block_say_enabled:
- _say_dialog_manager.enable_preserve_dialog_box()
-
- _say_dialog_manager.say(self, character, text, type)
-
-
-# Display a list of choices
-#
-# #### Parameters
-#
-# - dialog: The dialog to start
-# - type: The dialog chooser type to use (default: "simple")
-func start_dialog_choices(dialog: ESCDialog, type: String = "simple"):
- # We only need to remove the dialog manager from the scene tree if the dialog manager type
- # has changed since the last use of this method.
- _update_dialog_manager(DIALOG_TYPE_CHOOSE, _choose_dialog_manager, type)
-
- _choose_dialog_manager.choose(self, dialog, type)
-
-
-# Interrupt the currently running dialog
-func interrupt() -> void:
- if is_instance_valid(_say_dialog_manager):
- _say_dialog_manager.interrupt()
-
-
-# Loads the first dialog manager that supports the specified "say" type; otherwise,
-# the engine throws an error and stops.
-#
-# #### Parameters
-# - type: The type the dialog manager should support, e.g. "floating"
-func _determine_say_dialog_manager(type: String) -> void:
- var dialog_manager: ESCDialogManager = null
-
- for _manager_class in ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.DIALOG_MANAGERS
- ):
- if ResourceLoader.exists(_manager_class):
- var _manager: ESCDialogManager = load(_manager_class).new()
- if _manager.has_type(type):
- dialog_manager = _manager
- else:
- dialog_manager = null
-
- if not is_instance_valid(dialog_manager):
- escoria.logger.error(
- self,
- "No dialog manager called '%s' configured." % type
- )
-
- _say_dialog_manager = dialog_manager
-
-
-# Loads the first dialog manager that supports the specified "choose" type; otherwise,
-# the engine throws an error and stops.
-#
-# #### Parameters
-# - type: The type the dialog manager should support, e.g. "simple"
-func _determine_choose_dialog_manager(type: String) -> void:
- var dialog_manager: ESCDialogManager = null
-
- for _manager_class in ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.DIALOG_MANAGERS
- ):
- if ResourceLoader.exists(_manager_class):
- var _manager: ESCDialogManager = load(_manager_class).new()
- if _manager.has_chooser_type(type):
- dialog_manager = _manager
- else:
- dialog_manager = null
-
- if not is_instance_valid(dialog_manager):
- escoria.logger.error(
- self,
- "No dialog manager called '%s' configured." % type
- )
-
- _choose_dialog_manager = dialog_manager
-
-
-# If necessary, updates the dialog manager for the specified dialog type.
-#
-# #### Parameters
-#
-# - dialog_type: The type of dialog that will be managed, e.g. "say" or "choose"
-# - current_dialog_manager: The dialog manager currently being used (if any) for the specified
-# dialog type
-# - dialog_manager_type: The dialog manager type specific to the dialog manager being requested
-func _update_dialog_manager(dialog_type: String, current_dialog_manager: ESCDialogManager, \
- dialog_manager_type: String) -> void:
-
- if is_instance_valid(current_dialog_manager):
- if not current_dialog_manager.has_type(dialog_manager_type):
- if is_a_parent_of(current_dialog_manager):
- remove_child(current_dialog_manager)
-
- add_child(_determine_dialog_manager(dialog_type, dialog_manager_type))
- else:
- add_child(_determine_dialog_manager(dialog_type, dialog_manager_type))
-
-
-# Sets the requested dialog manager type for the specified dialog function.
-#
-# #### Parameters
-#
-# - dialog_type: The type of dialog that will be managed, e.g. "say" or "choose"
-# - dialog_manager_type: The dialog manager type specific to the dialog manager being requested
-#
-# *Returns* the newly-resolved dialog manager
-func _determine_dialog_manager(dialog_type: String, dialog_manager_type: String) -> ESCDialogManager:
- if dialog_type == DIALOG_TYPE_SAY:
- _determine_say_dialog_manager(dialog_manager_type)
- return _say_dialog_manager
- elif dialog_type == DIALOG_TYPE_CHOOSE:
- _determine_choose_dialog_manager(dialog_manager_type)
- return _choose_dialog_manager
-
- # This line will never be hit as a failure above will result in an Escoria error
- return null
diff --git a/addons/escoria-core/game/scenes/esc_prompt/esc_prompt_popup.gd b/addons/escoria-core/game/scenes/esc_prompt/esc_prompt_popup.gd
deleted file mode 100644
index 096bc72b..00000000
--- a/addons/escoria-core/game/scenes/esc_prompt/esc_prompt_popup.gd
+++ /dev/null
@@ -1,51 +0,0 @@
-# A debug window which can run esc commands
-extends WindowDialog
-
-
-# Reference to the past actions display
-onready var past_actions = $VBoxContainer/past_actions
-
-# Reference to the command input
-onready var command = $VBoxContainer/command
-
-# ESC commands kept around for references to their command names.
-var _print: PrintCommand
-
-
-func _ready() -> void:
- _print = PrintCommand.new()
-
-
-# Run a command
-#
-# #### Parameters
-#
-# - p_command_str: Command to execute
-func _on_command_text_entered(p_command_str : String):
- if p_command_str.empty():
- return
-
- command.text = ""
- past_actions.text += "\n"
- past_actions.text += "# " + p_command_str
- past_actions.text += "\n"
-
- var errors = []
- var script = escoria.esc_compiler.compile([
- "%s%s" % [ESCEvent.PREFIX, _print.get_command_name()],
- p_command_str
- ],
- get_class()
- )
-
- if script:
- escoria.event_manager.queue_event(script.events[escoria.event_manager.EVENT_PRINT])
- var ret = yield(escoria.event_manager, "event_finished")
- while ret[1] != _print.get_command_name():
- ret = yield(escoria.event_manager, "event_finished")
- past_actions.text += "Returned code: %d" % ret[0]
-
-
-# Set the focus to the command
-func _on_esc_prompt_popup_about_to_show():
- command.grab_focus()
diff --git a/addons/escoria-core/game/scenes/esc_prompt/esc_prompt_popup.tscn b/addons/escoria-core/game/scenes/esc_prompt/esc_prompt_popup.tscn
deleted file mode 100644
index 6bc30c88..00000000
--- a/addons/escoria-core/game/scenes/esc_prompt/esc_prompt_popup.tscn
+++ /dev/null
@@ -1,42 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-core/game/scenes/esc_prompt/esc_prompt_popup.gd" type="Script" id=1]
-
-[node name="esc_prompt_popup" type="WindowDialog"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-margin_left = 64.0
-margin_top = 68.0
-margin_right = -617.0
-margin_bottom = -456.0
-window_title = "ESC debug prompt"
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-anchor_right = 1.0
-anchor_bottom = 1.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="past_actions" type="TextEdit" parent="VBoxContainer"]
-margin_right = 599.0
-margin_bottom = 240.0
-size_flags_vertical = 3
-
-[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
-margin_top = 244.0
-margin_right = 599.0
-margin_bottom = 248.0
-
-[node name="command" type="LineEdit" parent="VBoxContainer"]
-margin_top = 252.0
-margin_right = 599.0
-margin_bottom = 276.0
-caret_blink = true
-
-[connection signal="about_to_show" from="." to="." method="_on_esc_prompt_popup_about_to_show"]
-[connection signal="text_entered" from="VBoxContainer/command" to="." method="_on_command_text_entered"]
diff --git a/addons/escoria-core/game/scenes/inventory/inventory_ui.gd b/addons/escoria-core/game/scenes/inventory/inventory_ui.gd
deleted file mode 100644
index b596bf4b..00000000
--- a/addons/escoria-core/game/scenes/inventory/inventory_ui.gd
+++ /dev/null
@@ -1,177 +0,0 @@
-# Manages the inventory on the GUI connected to the inventory_ui_container
-# variable
-extends Control
-class_name ESCInventory
-
-
-# Define the actual container node to add items as children of.
-# Should be a Container.
-export(NodePath) var inventory_ui_container
-
-
-# A registry of inventory ESCInventoryItem nodes
-var items_ids_in_inventory: Dictionary = {}
-
-
-# Fill the items the player has from the start, do sanity checks and
-# listen when a global has changed
-func _ready():
- if inventory_ui_container == null or inventory_ui_container.is_empty():
- escoria.logger.error(
- self,
- "Inventory items container is empty."
- )
- return
-
- for item_id in escoria.inventory_manager.items_in_inventory():
- call_deferred("add_new_item_by_id", item_id)
-
- escoria.inventory = self
-
- escoria.globals_manager.connect(
- "global_changed", #
- self,
- "_on_escoria_global_changed"
- )
-
-
-# add item to Inventory UI using its id set in its scene
-func add_new_item_by_id(item_id: String) -> void:
- if item_id.begins_with("i/"):
- item_id = item_id.rsplit("i/", false)[0]
- if not items_ids_in_inventory.has(item_id):
- if not escoria.object_manager.has(item_id) or not is_instance_valid( \
- escoria.object_manager.get_object(item_id).node):
- var inventory_file = "%s/%s.tscn" % [
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.INVENTORY_ITEMS_PATH
- ).trim_suffix("/"),
- item_id
- ]
- if ResourceLoader.exists(inventory_file):
- escoria.object_manager.register_object(
- ESCObject.new(
- item_id,
- ResourceLoader.load(inventory_file).instance()
- ),
- null,
- true
- )
- else:
- escoria.logger.error(
- self,
- (
- "Item global id '%s' is not registered because the item's scene file was not found.\n"
- + "Attempted scene file path: %s.\n"
- + "Please ensure that the '%s' project setting points at **your inventory items folder** (current is: \"%s\")."
- )
- % [
- item_id,
- inventory_file,
- ESCProjectSettingsManager.INVENTORY_ITEMS_PATH,
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.INVENTORY_ITEMS_PATH
- )
- ]
- )
-
- var inventory_item = ESCInventoryItem.new(
- escoria.object_manager.get_object(item_id).node
- )
- var inventory_item_button = get_node(
- inventory_ui_container
- ).add_item(inventory_item)
-
- items_ids_in_inventory[item_id] = inventory_item
-
- if not escoria.object_manager.has(item_id):
- escoria.object_manager.register_object(
- ESCObject.new(
- item_id,
- inventory_item_button
- ),
- null,
- true
- )
-
- escoria.inputs_manager.register_inventory_item(inventory_item_button)
-
-
-# remove item fromInventory UI using its id set in its scene
-func remove_item_by_id(item_id: String) -> void:
- if items_ids_in_inventory.has(item_id):
- var item_inventory = items_ids_in_inventory[item_id]
- var item_inventory_button = get_node(
- inventory_ui_container
- ).get_inventory_button(item_inventory)
-
- if item_inventory_button.is_connected(
- "mouse_left_inventory_item",
- escoria.inputs_manager,
- "_on_mouse_left_click_inventory_item"
- ):
- item_inventory_button.disconnect(
- "mouse_left_inventory_item",
- escoria.inputs_manager,
- "_on_mouse_left_click_inventory_item"
- )
- if item_inventory_button.is_connected(
- "mouse_double_left_inventory_item",
- escoria.inputs_manager,
- "_on_mouse_double_left_click_inventory_item"
- ):
- item_inventory_button.disconnect(
- "mouse_double_left_inventory_item",
- escoria.inputs_manager,
- "_on_mouse_double_left_click_inventory_item"
- )
- if item_inventory_button.is_connected(
- "mouse_right_inventory_item",
- escoria.inputs_manager,
- "_on_mouse_right_click_inventory_item"
- ):
- item_inventory_button.disconnect(
- "mouse_right_inventory_item",
- escoria.inputs_manager,
- "_on_mouse_right_click_inventory_item"
- )
- if item_inventory_button.is_connected(
- "inventory_item_focused",
- escoria.inputs_manager,
- "_on_mouse_entered_inventory_item"
- ):
- item_inventory_button.disconnect(
- "inventory_item_focused",
- escoria.inputs_manager,
- "_on_mouse_entered_inventory_item"
- )
- if item_inventory_button.is_connected(
- "inventory_item_unfocused",
- escoria.inputs_manager,
- "_on_mouse_exited_inventory_item"
- ):
- item_inventory_button.disconnect(
- "inventory_item_unfocused",
- escoria.inputs_manager,
- "_on_mouse_exited_inventory_item"
- )
-
- get_node(inventory_ui_container).remove_item(item_inventory)
- items_ids_in_inventory.erase(item_id)
-
-
-# React to changes to inventory globals adding items or removing them
-func _on_escoria_global_changed(global: String, old_value, new_value) -> void:
- if !global.begins_with("i/"):
- return
- var item = global.rsplit("i/", false)
- if item.size() == 1:
- if new_value:
- add_new_item_by_id(item[0])
- else:
- remove_item_by_id(item[0])
- else:
- escoria.logger.error(
- self,
- "Global must contain only one item name (received: %s)." % global
- )
diff --git a/addons/escoria-core/game/scenes/sound/esc_music_player.gd b/addons/escoria-core/game/scenes/sound/esc_music_player.gd
deleted file mode 100644
index b6ab5df8..00000000
--- a/addons/escoria-core/game/scenes/sound/esc_music_player.gd
+++ /dev/null
@@ -1,58 +0,0 @@
-# Background music player
-extends Control
-class_name ESCMusicPlayer
-
-
-# Global id of the background music player
-export var global_id: String = "_music"
-
-
-# The state of the music player. "default" or "off" disable music
-# Any other state refers to a music stream that should be played
-var state: String = "default"
-
-
-# Reference to the audio player
-onready var stream: AudioStreamPlayer = $AudioStreamPlayer
-
-
-# Set the state of this player
-#
-# #### Parameters
-#
-# - p_state: New state to use
-# - p_force: Override the existing state even if the stream is still playing
-func set_state(p_state: String, p_force: bool = false) -> void:
- # If already playing this stream, keep playing, unless p_force
- if p_state == state and not p_force and stream.is_playing():
- return
-
- state = p_state
-
- # If state is "off"/"default", turn off music
- if state == "off" or state == "default":
- stream.stream = null
- return
-
- var resource = load(p_state)
-
- stream.stream = resource
-
- if stream.stream:
- if resource is AudioStreamSample:
- resource.loop_mode = AudioStreamSample.LOOP_FORWARD
- resource.loop_end = resource.mix_rate * resource.get_length()
- elif "loop" in resource:
- resource.loop = true
- stream.play()
-
-
-# Register to the object registry
-func _ready():
- pause_mode = Node.PAUSE_MODE_STOP
- escoria.object_manager.register_object(
- ESCObject.new(global_id, self),
- null,
- true
- )
-
diff --git a/addons/escoria-core/game/scenes/sound/esc_music_player.tscn b/addons/escoria-core/game/scenes/sound/esc_music_player.tscn
deleted file mode 100644
index ae4f951c..00000000
--- a/addons/escoria-core/game/scenes/sound/esc_music_player.tscn
+++ /dev/null
@@ -1,15 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-core/game/scenes/sound/esc_music_player.gd" type="Script" id=1]
-
-[node name="bg_music" type="Control"]
-pause_mode = 2
-anchor_right = 1.0
-anchor_bottom = 1.0
-margin_right = -1680.0
-margin_bottom = -1050.0
-mouse_filter = 2
-script = ExtResource( 1 )
-
-[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
-bus = "Music"
diff --git a/addons/escoria-core/game/scenes/sound/esc_sound_player.gd b/addons/escoria-core/game/scenes/sound/esc_sound_player.gd
deleted file mode 100644
index 9b56e299..00000000
--- a/addons/escoria-core/game/scenes/sound/esc_sound_player.gd
+++ /dev/null
@@ -1,60 +0,0 @@
-# Background sound player
-extends Control
-class_name ESCSoundPlayer
-
-
-# Global id of the background sound player
-export var global_id: String = "_sound"
-
-
-# The state of the sound player. "default" or "off" disable sound
-# Any other state refers to a sound stream that should be played
-var state: String = "default"
-
-
-# Reference to the audio player
-onready var stream: AudioStreamPlayer = $AudioStreamPlayer
-
-
-# Set the state of this player
-#
-# #### Parameters
-#
-# - p_state: New state to use
-# - p_force: Override the existing state even if the stream is still playing
-func set_state(p_state: String, p_force: bool = false):
- # If already playing this stream, keep playing, unless p_force
- if p_state == state and not p_force and stream.is_playing():
- return
-
- state = p_state
-
- # If state is "off"/"default", turn off music
- if state == "off" or state == "default":
- stream.stream = null
- return
-
- var resource = load(p_state)
-
- stream.stream = resource
-
- if stream.stream:
- if resource is AudioStreamSample:
- resource.loop_mode = AudioStreamSample.LOOP_DISABLED
- elif "loop" in resource:
- resource.loop = false
- stream.play()
-
-
-# Register to the object registry
-func _ready():
- pause_mode = Node.PAUSE_MODE_STOP
- escoria.object_manager.register_object(
- ESCObject.new(global_id, self),
- null,
- true
- )
-
-# Set state to default when finished playing.
-func _on_sound_finished():
- state = "default"
diff --git a/addons/escoria-core/game/scenes/sound/esc_sound_player.tscn b/addons/escoria-core/game/scenes/sound/esc_sound_player.tscn
deleted file mode 100644
index 00f1762e..00000000
--- a/addons/escoria-core/game/scenes/sound/esc_sound_player.tscn
+++ /dev/null
@@ -1,20 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-core/game/scenes/sound/esc_sound_player.gd" type="Script" id=1]
-
-[node name="bg_sound" type="Control"]
-pause_mode = 2
-anchor_right = 1.0
-anchor_bottom = 1.0
-margin_right = -1680.0
-margin_bottom = -1050.0
-mouse_filter = 2
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
-bus = "SFX"
-
-[connection signal="finished" from="AudioStreamPlayer" to="." method="_on_sound_finished"]
diff --git a/addons/escoria-core/game/scenes/sound/esc_speech_player.gd b/addons/escoria-core/game/scenes/sound/esc_speech_player.gd
deleted file mode 100644
index 8fa4a442..00000000
--- a/addons/escoria-core/game/scenes/sound/esc_speech_player.gd
+++ /dev/null
@@ -1,61 +0,0 @@
-# Speech player
-extends Control
-class_name ESCSpeechPlayer
-
-
-# Global id of the background music player
-export var global_id: String = "_speech"
-
-# Reference to the audio player
-onready var stream: AudioStreamPlayer = $AudioStreamPlayer
-
-
-# Set the state of this player
-#
-# #### Parameters
-#
-# - p_state: New state to use
-# - p_force: Override the existing state even if the stream is still playing
-func set_state(p_state: String, p_force: bool = false) -> void:
- # If speech is disabled, return
- if not ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.SPEECH_ENABLED
- ):
- return
-
- # If state is "off"/"default", turn off speech
- if p_state in ["off", "default"]:
- stream.stream = null
- return
-
- var resource = load(p_state)
- stream.stream = resource
-
- if stream.stream:
- stream.stream.set_loop(false)
- $AudioStreamPlayer.play()
-
-
-# Register to the object registry
-func _ready():
- pause_mode = Node.PAUSE_MODE_STOP
- escoria.object_manager.register_object(
- ESCObject.new(global_id, self),
- null,
- true
- )
-
-
-# Callback called when the audio stream player finished playing.
-func _on_AudioStreamPlayer_finished() -> void:
- set_state("off")
-
-
-# Pause the speech player
-func pause():
- stream.stream_paused = true
-
-
-# Unpause the speech player
-func resume():
- stream.stream_paused = false
diff --git a/addons/escoria-core/game/scenes/sound/esc_speech_player.tscn b/addons/escoria-core/game/scenes/sound/esc_speech_player.tscn
deleted file mode 100644
index 6c4a7d97..00000000
--- a/addons/escoria-core/game/scenes/sound/esc_speech_player.tscn
+++ /dev/null
@@ -1,18 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-core/game/scenes/sound/esc_speech_player.gd" type="Script" id=1]
-
-[node name="Control" type="Control"]
-pause_mode = 2
-anchor_right = 1.0
-anchor_bottom = 1.0
-mouse_filter = 2
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."]
-bus = "Speech"
-
-[connection signal="finished" from="AudioStreamPlayer" to="." method="_on_AudioStreamPlayer_finished"]
diff --git a/addons/escoria-core/game/scenes/transitions/esc_transition_player.gd b/addons/escoria-core/game/scenes/transitions/esc_transition_player.gd
deleted file mode 100644
index 16a7a6cf..00000000
--- a/addons/escoria-core/game/scenes/transitions/esc_transition_player.gd
+++ /dev/null
@@ -1,158 +0,0 @@
-# A transition player for scene changes
-extends ColorRect
-class_name ESCTransitionPlayer
-
-
-# Emitted when the transition was played
-signal transition_done(transition_id)
-
-
-# The valid transition modes
-enum TRANSITION_MODE {
- IN,
- OUT
-}
-
-
-# Id to represent instant/no transitions
-const TRANSITION_ID_INSTANT = -1
-
-# Instant transition type
-const TRANSITION_INSTANT = "instant"
-
-
-# Id of the transition. Allows keeping track of the actual transition
-# being played or finished
-var transition_id: int = 0
-
-# The tween instance to animate
-var _tween: Tween
-
-# If the current tween was canceled
-var _was_canceled: bool = false
-
-
-# Fade in when the scene is starting
-func _ready() -> void:
- anchor_left = 0
- anchor_top = 0
- anchor_right = 1
- anchor_bottom = 1
- color = Color.white
- color.a = 0
- mouse_filter = MOUSE_FILTER_IGNORE
- _tween = Tween.new()
-
-
-# Play a transition animation
-#
-# ## Parameters
-#
-# - transition_name: name of the transition to play (if empty string, uses
-# the default transition)
-# - mode: Mode to transition (in/out)
-# - duration: The duration the transition should take
-func transition(
- transition_name: String = "",
- mode: int = TRANSITION_MODE.IN,
- duration: float = 1.0
-) -> int:
-
- # We put this here instead of the constructor since if we have it in the
- # constructor, the transition will ALWAYS happen on game start, which might
- # not be desired if 'false' is used for automatic_transitions in a
- # change_scene call in :init.
- if not _tween.is_inside_tree():
- add_child(_tween)
- _tween.connect("tween_all_completed", self, "_on_tween_completed")
-
- if transition_name.empty():
- transition_name = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.DEFAULT_TRANSITION
- )
-
- if not has_transition(transition_name):
- escoria.logger.error(
- self,
- "transition: Transition %s not found" % transition_name
- )
-
- # If this is an "instant" transition, we need to set the alpha of the base
- # ColorRect to 0, since the transition materials used have a final state
- # that sets this scene's root (ColorRect) alpha to 0.
- if transition_name == TRANSITION_INSTANT:
- color.a = 0
- return TRANSITION_ID_INSTANT
-
- var material_path = get_transition(transition_name)
-
- material = ResourceLoader.load(get_transition(transition_name))
- transition_id += 1
-
- var start = 0.0
- var end = 1.0
-
- if mode == TRANSITION_MODE.OUT:
- start = 1.0
- end = 0.0
-
- if _tween.is_active():
- _was_canceled = true
- _tween.stop_all()
- _tween.remove_all()
- emit_signal("transition_done", transition_id-1)
-
- _tween.interpolate_property(
- $".",
- "material:shader_param/cutoff",
- start,
- end,
- duration
- )
- _was_canceled = false
- _tween.start()
- return transition_id
-
-
-# Returns the full path for a transition shader based on its name
-#
-# ## Parameters
-#
-# - name: The name of the transition to test
-#
-# *Returns* the full path to the shader or an empty string, if it can't be found
-func get_transition(name: String) -> String:
- for directory in ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.TRANSITION_PATHS
- ):
- if ResourceLoader.exists(directory.plus_file("%s.material" % name)):
- return directory.plus_file("%s.material" % name)
- return ""
-
-
-# Returns true whether the transition scene has a transition corresponding
-# to name provided.
-#
-# ## Parameters
-#
-# - name: The name of the transition to test
-#
-# *Returns* true if a transition exists with given name.
-func has_transition(name: String) -> bool:
- return name == TRANSITION_INSTANT or get_transition(name) != ""
-
-
-# Resets the current material's cutoff parameter instantly.
-func reset_shader_cutoff() -> void:
- if not is_instance_valid(material):
- return
-
- material.set_shader_param("cutoff", 1.0)
-
-
-func _on_tween_completed():
- if not _was_canceled:
- _tween.stop_all()
- _tween.remove_all()
- escoria.logger.debug(self, "Transition %s done." % str(transition_id))
- emit_signal("transition_done", transition_id)
diff --git a/addons/escoria-core/game/scenes/transitions/masks/curtain.png b/addons/escoria-core/game/scenes/transitions/masks/curtain.png
deleted file mode 100644
index befa82af..00000000
Binary files a/addons/escoria-core/game/scenes/transitions/masks/curtain.png and /dev/null differ
diff --git a/addons/escoria-core/game/scenes/transitions/masks/from_center.png b/addons/escoria-core/game/scenes/transitions/masks/from_center.png
deleted file mode 100644
index 1c28b7af..00000000
Binary files a/addons/escoria-core/game/scenes/transitions/masks/from_center.png and /dev/null differ
diff --git a/addons/escoria-core/game/scenes/transitions/masks/shards.png b/addons/escoria-core/game/scenes/transitions/masks/shards.png
deleted file mode 100644
index 1d62b47b..00000000
Binary files a/addons/escoria-core/game/scenes/transitions/masks/shards.png and /dev/null differ
diff --git a/addons/escoria-core/game/scenes/transitions/shaders/curtain.material b/addons/escoria-core/game/scenes/transitions/shaders/curtain.material
deleted file mode 100644
index b1fab907..00000000
Binary files a/addons/escoria-core/game/scenes/transitions/shaders/curtain.material and /dev/null differ
diff --git a/addons/escoria-core/game/scenes/transitions/shaders/fade_black.material b/addons/escoria-core/game/scenes/transitions/shaders/fade_black.material
deleted file mode 100644
index 92721d20..00000000
Binary files a/addons/escoria-core/game/scenes/transitions/shaders/fade_black.material and /dev/null differ
diff --git a/addons/escoria-core/game/scenes/transitions/shaders/fade_white.material b/addons/escoria-core/game/scenes/transitions/shaders/fade_white.material
deleted file mode 100644
index 973fdfbe..00000000
Binary files a/addons/escoria-core/game/scenes/transitions/shaders/fade_white.material and /dev/null differ
diff --git a/addons/escoria-core/game/scenes/transitions/shaders/from_center.material b/addons/escoria-core/game/scenes/transitions/shaders/from_center.material
deleted file mode 100644
index 54b509ad..00000000
Binary files a/addons/escoria-core/game/scenes/transitions/shaders/from_center.material and /dev/null differ
diff --git a/addons/escoria-core/game/scenes/transitions/shaders/shards.material b/addons/escoria-core/game/scenes/transitions/shaders/shards.material
deleted file mode 100644
index ef86a67a..00000000
Binary files a/addons/escoria-core/game/scenes/transitions/shaders/shards.material and /dev/null differ
diff --git a/addons/escoria-core/game/scenes/transitions/transition.tscn b/addons/escoria-core/game/scenes/transitions/transition.tscn
deleted file mode 100644
index 1bc0e81b..00000000
--- a/addons/escoria-core/game/scenes/transitions/transition.tscn
+++ /dev/null
@@ -1,14 +0,0 @@
-[gd_scene load_steps=3 format=2]
-
-[ext_resource path="res://addons/escoria-core/game/scenes/transitions/esc_transition_player.gd" type="Script" id=1]
-[ext_resource path="res://addons/escoria-core/game/scenes/transitions/shaders/curtain.material" type="Material" id=2]
-
-[node name="scene_transition" type="ColorRect"]
-material = ExtResource( 2 )
-anchor_right = 1.0
-anchor_bottom = 1.0
-mouse_filter = 2
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
diff --git a/addons/escoria-core/patterns/state_machine/state.gd b/addons/escoria-core/patterns/state_machine/state.gd
deleted file mode 100644
index 7e0c0ba5..00000000
--- a/addons/escoria-core/patterns/state_machine/state.gd
+++ /dev/null
@@ -1,32 +0,0 @@
-"""
-Base interface for all states: it doesn't do anything in itself
-but forces us to pass the right arguments to the methods below
-and makes sure every State object had all of these methods.
-"""
-extends Node
-class_name State
-
-
-signal finished(next_state_name)
-
-
-# Initialize the state. E.g. change the animation
-func enter():
- return
-
-
-# Clean up the state. Reinitialize values like a timer
-func exit():
- return
-
-
-func handle_input(_event):
- return
-
-
-func update(_delta):
- return
-
-
-func _on_animation_finished(_anim_name):
- return
diff --git a/addons/escoria-core/patterns/state_machine/state_machine.gd b/addons/escoria-core/patterns/state_machine/state_machine.gd
deleted file mode 100644
index 949e6e7e..00000000
--- a/addons/escoria-core/patterns/state_machine/state_machine.gd
+++ /dev/null
@@ -1,93 +0,0 @@
-"""
-Base interface for a generic state machine
-It handles initializing, setting the machine active or not
-delegating _physics_process, _input calls to the State nodes,
-and changing the current/active state.
-"""
-extends Node
-class_name StateMachine
-
-
-signal state_changed(current_state)
-
-
-"""
-You must set a starting node from the inspector or on
-the node that inherits from this state machine interface
-If you don't the game will crash (on purpose, so you won't
-forget to initialize the state machine)
-"""
-export(NodePath) var START_STATE
-var states_map = {}
-
-var states_stack = [] # can also be used as a pushdown automaton
-var current_state = null
-var current_state_name = ""
-var _active = false setget set_active
-
-
-func initialize(start_state):
- for child in get_children():
- child.connect("finished", self, "_change_state")
-
- set_active(true)
- states_stack.push_front(start_state)
- current_state = states_stack[0]
- current_state.enter()
-
-
-func set_active(value):
- _active = value
- set_physics_process(value)
- set_process_input(value)
- if not _active:
- states_stack = []
- current_state = null
-
-
-func _input(event):
- current_state.handle_input(event)
-
-
-func _physics_process(delta):
- current_state.update(delta)
-
-
-func _on_animation_finished(anim_name):
- if not _active:
- return
- current_state._on_animation_finished(anim_name)
-
-
-func _change_state(state_name):
- if not _active:
- return
-
- escoria.logger.trace(
- self,
- "Dialog State Machine: Changing state from '%s' to '%s'." % [current_state_name, state_name]
- )
-
- current_state.exit()
-
- if state_name == "previous":
- states_stack.pop_front()
- else:
- states_stack[0] = states_map[state_name]
-
- current_state = states_stack[0]
-
- emit_signal("state_changed", current_state)
-
- #if state_name != "previous":
- current_state.enter()
-
- current_state_name = state_name
-
-
-func get_current_state_name():
- for key in states_map.keys():
- if states_map[key] == current_state:
- return key
-
- return null
diff --git a/addons/escoria-core/plugin.cfg b/addons/escoria-core/plugin.cfg
deleted file mode 100755
index d0ad6748..00000000
--- a/addons/escoria-core/plugin.cfg
+++ /dev/null
@@ -1,7 +0,0 @@
-[plugin]
-
-name="Escoria"
-description="A point'n'click framework within Godot Engine."
-author="StraToN"
-version="1.0.0"
-script="plugin.gd"
diff --git a/addons/escoria-core/plugin.gd b/addons/escoria-core/plugin.gd
deleted file mode 100644
index 0f701e20..00000000
--- a/addons/escoria-core/plugin.gd
+++ /dev/null
@@ -1,423 +0,0 @@
-# Plugin script to initialize Escoria
-tool
-extends EditorPlugin
-
-# The warning popup displayed on escoria-core enabling.
-var popup_info: AcceptDialog
-
-
-# Virtual function called when plugin is enabled.
-func enable_plugin():
- add_autoload_singleton(
- "escoria",
- "res://addons/escoria-core/game/esc_autoload.gd"
- )
- # Prepare settings
- set_escoria_main_settings()
- set_escoria_debug_settings()
- set_escoria_ui_settings()
- set_escoria_sound_settings()
- set_escoria_platform_settings()
-
- # Add input actions in InputMap
-# if not InputMap.has_action(ESCInputsManager.SWITCH_ACTION_VERB):
-# InputMap.add_action(ESCInputsManager.SWITCH_ACTION_VERB)
-# if not InputMap.has_action(ESCInputsManager.ESC_SHOW_DEBUG_PROMPT):
-# InputMap.add_action(ESCInputsManager.ESC_SHOW_DEBUG_PROMPT)
-
- # Define standard settings
- ProjectSettings.set_setting(
- "application/run/main_scene",
- "res://addons/escoria-core/game/main_scene.tscn"
- )
-
- ProjectSettings.set_setting(
- "audio/default_bus_layout",
- "res://addons/escoria-core/default_bus_layout.tres"
- )
-
- popup_info = AcceptDialog.new()
- popup_info.dialog_text = """You enabled escoria-core plugin.
-
- Please ignore error messages in Output console and reload your project using
- Godot editor's "Project / Reload Current Project" menu.
- """
- popup_info.connect("confirmed", self, "_on_warning_popup_confirmed", [], CONNECT_ONESHOT)
- get_editor_interface().get_editor_viewport().add_child(popup_info)
- popup_info.popup_centered()
-
-
-func _on_warning_popup_confirmed():
- popup_info.queue_free()
-
-
-# Virtual function called when plugin is disabled.
-func disable_plugin():
- remove_autoload_singleton("escoria")
-# if InputMap.has_action(ESCInputsManager.SWITCH_ACTION_VERB):
-# InputMap.erase_action(ESCInputsManager.SWITCH_ACTION_VERB)
-# if InputMap.has_action(ESCInputsManager.SWITCH_ACTION_VERB):
-# InputMap.erase_action(ESCInputsManager.SWITCH_ACTION_VERB)
-
-
-# Setup Escoria
-func _enter_tree():
- pass
-
-
-# Prepare the settings in the Escoria UI category
-func set_escoria_ui_settings():
- register_setting(
- ESCProjectSettingsManager.DEFAULT_DIALOG_TYPE,
- "",
- {
- "type": TYPE_STRING
- }
- )
- print("DEFAULT DIALOG TYPE RESET !!!")
-
- register_setting(
- ESCProjectSettingsManager.GAME_SCENE,
- "",
- {
- "name": ESCProjectSettingsManager.GAME_SCENE,
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_FILE,
- "hint_string": "*.tscn, *.scn"
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.INVENTORY_ITEMS_PATH,
- "res://game/items/inventory/",
- {
- "name": ESCProjectSettingsManager.INVENTORY_ITEMS_PATH,
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_DIR
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.DEFAULT_TRANSITION,
- "curtain",
- {
- "name": ESCProjectSettingsManager.DEFAULT_TRANSITION,
- "type": TYPE_STRING
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.TRANSITION_PATHS,
- [
- "res://addons/escoria-core/game/scenes/transitions/shaders/"
- ],
- {
- "name": ESCProjectSettingsManager.TRANSITION_PATHS,
- "type": TYPE_STRING_ARRAY,
- "hint": PROPERTY_HINT_DIR
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.INVENTORY_ITEM_SIZE,
- Vector2(72, 72),
- {
- "name": ESCProjectSettingsManager.INVENTORY_ITEM_SIZE,
- "type": TYPE_VECTOR2
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.DIALOG_MANAGERS,
- [],
- {
- "type": TYPE_STRING_ARRAY
- }
- )
-
-
-# Prepare the settings in the Escoria main category
-func set_escoria_main_settings():
- register_setting(
- ESCProjectSettingsManager.GAME_VERSION,
- "",
- {
- "type": TYPE_STRING
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.GAME_START_SCRIPT,
- "",
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_FILE,
- "hint_string": "*.esc"
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.ACTION_DEFAULT_SCRIPT,
- "",
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_FILE,
- "hint_string": "*.esc"
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.FORCE_QUIT,
- true,
- {
- "type": TYPE_BOOL
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.COMMAND_DIRECTORIES,
- [
- "res://addons/escoria-core/game/core-scripts/esc/commands"
- ],
- {
- "type": TYPE_ARRAY,
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.TEXT_LANG,
- TranslationServer.get_locale(),
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_NONE
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.VOICE_LANG,
- TranslationServer.get_locale(),
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_NONE
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.SAVEGAMES_PATH,
- "user://saves/",
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_DIR
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.SETTINGS_PATH,
- "user://",
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_DIR
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.GAME_MIGRATION_PATH,
- "",
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_DIR
- }
- )
-
-
-# Prepare the settings in the Escoria debug category
-func set_escoria_debug_settings():
- register_setting(
- ESCProjectSettingsManager.TERMINATE_ON_WARNINGS,
- false,
- {
- "type": TYPE_BOOL
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.TERMINATE_ON_ERRORS,
- true,
- {
- "type": TYPE_BOOL
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.DEVELOPMENT_LANG,
- "en",
- {
- "type": TYPE_STRING
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.LOG_LEVEL,
- "ERROR",
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_ENUM,
- "hint_string": "ERROR,WARNING,INFO,DEBUG,TRACE"
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.LOG_FILE_PATH,
- "user://",
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_DIR
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.CRASH_MESSAGE,
- "We're sorry, but the game crashed. Please send us the " +
- "following files:\n\n%s",
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_MULTILINE_TEXT
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.ENABLE_ROOM_SELECTOR,
- false,
- {
- "type": TYPE_BOOL
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.ROOM_SELECTOR_ROOM_DIR,
- "",
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_DIR
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.ENABLE_HOVER_STACK_VIEWER,
- false,
- {
- "type": TYPE_BOOL
- }
- )
-
-
-# Prepare the settings in the Escoria sound settings
-func set_escoria_sound_settings():
- register_setting(
- ESCProjectSettingsManager.MASTER_VOLUME,
- 1,
- {
- "type": TYPE_REAL,
- "hint": PROPERTY_HINT_RANGE,
- "hint_string": "0,1"
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.MUSIC_VOLUME,
- 1,
- {
- "type": TYPE_REAL,
- "hint": PROPERTY_HINT_RANGE,
- "hint_string": "0,1"
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.SFX_VOLUME,
- 1,
- {
- "type": TYPE_REAL,
- "hint": PROPERTY_HINT_RANGE,
- "hint_string": "0,1"
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.SPEECH_VOLUME,
- 1,
- {
- "type": TYPE_REAL,
- "hint": PROPERTY_HINT_RANGE,
- "hint_string": "0,1"
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.SPEECH_ENABLED,
- true,
- {
- "type": TYPE_BOOL
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.SPEECH_FOLDER,
- "res://speech",
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_DIR
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.SPEECH_EXTENSION,
- "ogg",
- {
- "type": TYPE_STRING
- }
- )
-
-
-# Prepare the settings in the Escoria platform category and may need special
-# setting per build
-func set_escoria_platform_settings():
- # Skip cache - certain platforms (esp. mobile) lack memory for caching
- # scenes.
- # If set to true, all generic scenes (UI, inventory, etc) will be loaded
- # as any other scene.
- register_setting(
- ESCProjectSettingsManager.SKIP_CACHE,
- false,
- {
- "type": TYPE_BOOL
- }
- )
-
- register_setting(
- ESCProjectSettingsManager.SKIP_CACHE_MOBILE,
- true,
- {
- "type": TYPE_BOOL
- }
- )
-
-
-# Register a new project setting if it hasn't been defined already
-#
-# #### Parameters
-#
-# - name: Name of the project setting
-# - default: Default value
-# - info: Property info for the setting
-static func register_setting(name: String, default, info: Dictionary) -> void:
- if not ProjectSettings.has_setting(name):
- # Only core settings should set this to true. Settings configured in
- # plugins should not set this to true.
- info["core_setting"] = "true"
- ProjectSettings.set_setting(
- name,
- default
- )
- info.name = name
- ProjectSettings.add_property_info(info)
diff --git a/addons/escoria-core/testing/NotoSans-Regular.ttf b/addons/escoria-core/testing/NotoSans-Regular.ttf
deleted file mode 100644
index 0a01a062..00000000
Binary files a/addons/escoria-core/testing/NotoSans-Regular.ttf and /dev/null differ
diff --git a/addons/escoria-core/testing/README b/addons/escoria-core/testing/README
deleted file mode 100644
index b81e0cbb..00000000
--- a/addons/escoria-core/testing/README
+++ /dev/null
@@ -1,8 +0,0 @@
-In this folder, you can find various scenes and tools to test some of the scenes of your actual game project.
-
-These scenes are not intended to be shipped with your game, you may want to use them only for testing purposes, such as:
-
-- RichTextLabels screen clamping (rtl_screen_clamping.tscn)
- This scene helps you test the RichTextLabels used in your game, such as labels used when pointing an item or NPC or dialogs.
- To use this testing scene, simply add your actual label scene as a child of the root node and set the path to this node in it.
- You can then run the scene, move your mouse around the edges of the screen and see if the label reacts properly.
diff --git a/addons/escoria-core/testing/player_angles_finder.gd b/addons/escoria-core/testing/player_angles_finder.gd
deleted file mode 100644
index c69aa7d2..00000000
--- a/addons/escoria-core/testing/player_angles_finder.gd
+++ /dev/null
@@ -1,231 +0,0 @@
-extends Node2D
-
-# This scenes purpose is to help determining the angles between X and Y axis
-#Â when clicking somewhere on the screen.
-# Let us consider that player position is always 0,0.
-#Â Clicking right above his head is angle 0.
-#Â Clicking on the right is angle 90.
-# Clicking under his feet is angle 180.
-# etc.
-
-var number_of_directions: int
-var angle_horizontal_axes: float
-var angle_vertical_axes: float
-var angle_diagonal_axes: float
-const POLYGON_DISTANCE = 400
-
-enum Directions {
- NORTH, # 0
- NORTHEAST, # 1
- EAST, # 2
- SOUTHEAST, # 3
- SOUTH, # 4
- SOUTHWEST, # 5
- WEST, # 6
- NORTHWEST # 7
-}
-
-const starting_angles = [
- 0, #Â 0 NORTH
- PI/4, # 1 NORTHEAST
- PI/2, # 2 EAST
- 3*PI/4, # 3 SOUTHEAST
- PI, # 4 SOUTH
- 5*PI/4, #Â 5 SOUTHWEST
- 3*PI/2, #Â 6 WEST
- 7*PI/4, # 7 NORTHWEST
-]
-
-var colors = [
- ColorN("red"), #Â 0 NORTH
- ColorN("green"), # 1 NORTHEAST
- ColorN("blue"), # 2 EAST
- ColorN("black"), # 3 SOUTHEAST
- ColorN("yellow"), # 4 SOUTH
- ColorN("cyan"), #Â 5 SOUTHWEST
- ColorN("white"), #Â 6 WEST
- ColorN("purple") # 7 NORTHWEST
-]
-
-var result_angles = []
-
-#onready var result_angles_anim = {
-# "angle_offset_rad": PI/2,
-# Directions.NORTH: {
-# "direction_base_angle_rad": 0,
-# "angle_start_deg": 0,
-# "angle_area_deg": 0,
-# "animations": {}
-# },
-# Directions.NORTHEAST: {
-# "direction_base_angle_rad": PI/4,
-# "angle_start_deg": 0,
-# "angle_area_deg": 0,
-# "animation": ""
-# },
-# Directions.EAST: {
-# "direction_base_angle_rad": PI/2,
-# "angle_start_deg": 0,
-# "angle_area_deg": 0,
-# "animation": ""
-# },
-# Directions.SOUTHEAST: {
-# "direction_base_angle_rad": 3*PI/4,
-# "angle_start_deg": 0,
-# "angle_area_deg": 0,
-# "animation": ""
-# },
-# Directions.SOUTH: {
-# "direction_base_angle_rad": PI,
-# "angle_start_deg": 0,
-# "angle_area_deg": 0,
-# "animation": ""
-#
-# },
-# Directions.SOUTHWEST: {
-# "direction_base_angle_rad": 5*PI/4,
-# "angle_start_deg": 0,
-# "angle_area_deg": 0,
-# "animation": ""
-# },
-# Directions.WEST: {
-# "direction_base_angle_rad": 3*PI/2,
-# "angle_start_deg": 0,
-# "angle_area_deg": 0,
-# "animation": ""
-# },
-# Directions.NORTHWEST: {
-# "direction_base_angle_rad": 7*PI/4,
-# "angle_start_deg": 0,
-# "angle_area_deg": 0,
-# "animation": ""
-# }
-# }
-
-
-
-func _ready():
- # Find player animations
- $player_animations.add_item("")
- for anim_name in $player.get_animation_player().get_animations():
- $player_animations.add_item(anim_name)
-
- #Â Set initial angles
- var initial_angle: float = 360.0 / 8.0
- $VBoxContainer/angle_x/angle_horiz.text = str(40)
- $VBoxContainer/angle_y/angle_vert.text = str(40)
- $VBoxContainer/angle_diag/angle_diag.text = str(50)
- angle_horizontal_axes = 40
- angle_vertical_axes = 40
- angle_diagonal_axes = 50
-
- calculate_areas()
-
-
-func _on_number_of_directions_text_changed(new_text: String):
- if !new_text.is_valid_integer():
- return
- number_of_directions = int(new_text)
- calculate_areas(number_of_directions)
-
-
-func clear_areas_node():
- for n in $areas.get_children():
- n.queue_free()
-
-
-func calculate_areas(nb_directions: int = 8):
- clear_areas_node()
- var angles = []
- for i in range(nb_directions):
- var angle_area: float = 0.0
- var start_angle: float = 0.0
- # MANUAL
- match i:
- Directions.EAST,Directions.WEST:
- angle_area = deg2rad(angle_horizontal_axes)
- Directions.NORTH,Directions.SOUTH:
- angle_area = deg2rad(angle_vertical_axes)
- Directions.NORTHEAST,Directions.NORTHWEST,Directions.SOUTHEAST,Directions.SOUTHWEST:
- angle_area = deg2rad(angle_diagonal_axes)
-
- # Since angles start from EAST, offset by -PI/2 (= -90°) to start on up direction
- #Â Then minus angle_area/2 to align on direction
- start_angle = PI/2 + angle_area / 2
-
- var angle_start = starting_angles[i] - start_angle
- var angle_end = angle_start + angle_area
- angles.push_back([angle_start, angle_end])
-
- result_angles.push_back([clamp360(rad2deg(angle_start) + rad2deg(PI/2)),clamp360(rad2deg(angle_area))])
-
- $VBoxContainer/VBoxContainer/angles/angle_array.text = str(result_angles)
- construct_scene_nodes(angles)
-
-
-func construct_scene_nodes(angles):
- var areas_nodes = []
- for i in angles.size():
- var polygon_node = Polygon2D.new()
- polygon_node.color = colors[i]
- var area_node = Area2D.new()
- area_node.name = Directions.keys()[i]
- area_node.connect("input_event", self, "_on_area_click", [area_node.name])
- polygon_node.add_child(area_node)
-
- var collision = CollisionShape2D.new()
- var collision_shape = ConvexPolygonShape2D.new()
-
- var p_points = []
- p_points.push_back($player.position)
- p_points.push_back(polar2cartesian(POLYGON_DISTANCE, angles[i][0]) + $player.position)
- p_points.push_back(polar2cartesian(POLYGON_DISTANCE, angles[i][1]) + $player.position)
- polygon_node.polygon = p_points
- collision_shape.points = p_points
- collision.set_shape(collision_shape)
- area_node.add_child(collision)
-
- $areas.add_child(polygon_node)
-
-
-func _on_angle_horiz_text_changed(new_text: String):
- if !new_text.is_valid_float():
- return
- angle_horizontal_axes = float(new_text)
-# result_angles_anim.Directions.EAST.angle_area_deg = clamp360(angle_horizontal_axes)
-# result_angles_anim.Directions.WEST.angle_area_deg = clamp360(angle_horizontal_axes)
- calculate_areas()
-
-
-func _on_angle_vert_text_changed(new_text: String):
- if !new_text.is_valid_float():
- return
- angle_vertical_axes = float(new_text)
-# result_angles_anim.Directions.NORTH.angle_area_deg = clamp360(angle_vertical_axes)
-# result_angles_anim.Directions.SOUTH.angle_area_deg = clamp360(angle_vertical_axes)
- calculate_areas()
-
-
-func _on_angle_diag_text_changed(new_text: String):
- if !new_text.is_valid_float():
- return
- angle_diagonal_axes = float(new_text)
-# result_angles_anim.Directions.NORTHEAST.angle_area_deg = clamp360(angle_diagonal_axes)
-# result_angles_anim.Directions.SOUTHEAST.angle_area_deg = clamp360(angle_diagonal_axes)
-# result_angles_anim.Directions.NORTHWEST.angle_area_deg = clamp360(angle_diagonal_axes)
-# result_angles_anim.Directions.SOUTHWEST.angle_area_deg = clamp360(angle_diagonal_axes)
- calculate_areas()
-
-
-func _on_area_click(viewport: Object, event: InputEvent, shape_idx: int, area_name: String):
- if event is InputEventMouseButton and event.is_pressed():
- pass
-
-func clamp360(angle: float):
- if angle < 0.0:
- while angle < 0.0:
- angle += 360.0
- elif angle >= 360.0:
- while angle >= 360.0:
- angle -= 360.0
- return angle
diff --git a/addons/escoria-core/testing/player_angles_finder.tscn b/addons/escoria-core/testing/player_angles_finder.tscn
deleted file mode 100644
index 9121a244..00000000
--- a/addons/escoria-core/testing/player_angles_finder.tscn
+++ /dev/null
@@ -1,220 +0,0 @@
-[gd_scene load_steps=3 format=2]
-
-[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=1]
-[ext_resource path="res://addons/escoria-core/testing/player_angles_finder.gd" type="Script" id=2]
-
-[node name="player_angles_finder" type="Node2D"]
-script = ExtResource( 2 )
-
-[node name="areas" type="Node2D" parent="."]
-
-[node name="player" parent="." instance=ExtResource( 1 )]
-position = Vector2( 640, 480 )
-dialog_position_node = NodePath("../../player_angles_finder/player/dialog_position")
-
-[node name="x_axis" type="Line2D" parent="."]
-points = PoolVector2Array( -10, 480, 1300, 480 )
-width = 2.0
-default_color = Color( 0.980392, 0.00392157, 0.00392157, 1 )
-
-[node name="y_axis" type="Line2D" parent="."]
-points = PoolVector2Array( 640, -20, 640, 810 )
-width = 2.0
-default_color = Color( 0.156863, 0.0117647, 0.984314, 1 )
-
-[node name="three" type="Node2D" parent="."]
-visible = false
-
-[node name="Line2D" type="Line2D" parent="three"]
-points = PoolVector2Array( 160, 0, 1120, 960 )
-width = 2.0
-default_color = Color( 1, 1, 1, 1 )
-
-[node name="Line2D2" type="Line2D" parent="three"]
-points = PoolVector2Array( 160, 960, 1120, 0 )
-width = 2.0
-default_color = Color( 1, 1, 1, 1 )
-
-[node name="six" type="Node2D" parent="."]
-visible = false
-
-[node name="Line2D" type="Line2D" parent="six"]
-points = PoolVector2Array( 0, 210, 640, 480 )
-width = 2.0
-default_color = Color( 1, 1, 1, 1 )
-
-[node name="Line2D4" type="Line2D" parent="six"]
-points = PoolVector2Array( 320, 0, 640, 480 )
-width = 2.0
-default_color = Color( 1, 1, 1, 1 )
-
-[node name="Line2D2" type="Line2D" parent="six"]
-points = PoolVector2Array( 640, 480, 1280, 210 )
-width = 2.0
-default_color = Color( 1, 1, 1, 1 )
-
-[node name="Line2D3" type="Line2D" parent="six"]
-points = PoolVector2Array( 640, 480, 960, 0 )
-width = 2.0
-default_color = Color( 1, 1, 1, 1 )
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-margin_right = 370.0
-margin_bottom = 170.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
-visible = false
-margin_right = 420.0
-margin_bottom = 24.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer"]
-margin_top = 5.0
-margin_right = 136.0
-margin_bottom = 19.0
-text = "Number of directions"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="number_of_directions" type="LineEdit" parent="VBoxContainer/HBoxContainer"]
-margin_left = 140.0
-margin_right = 198.0
-margin_bottom = 24.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="angle_x" type="HBoxContainer" parent="VBoxContainer"]
-margin_right = 370.0
-margin_bottom = 24.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="Label" type="Label" parent="VBoxContainer/angle_x"]
-margin_top = 5.0
-margin_right = 173.0
-margin_bottom = 19.0
-text = "Angle on horizontal axis (X)"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="angle_horiz" type="LineEdit" parent="VBoxContainer/angle_x"]
-margin_left = 177.0
-margin_right = 235.0
-margin_bottom = 24.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="angle_y" type="HBoxContainer" parent="VBoxContainer"]
-margin_top = 28.0
-margin_right = 370.0
-margin_bottom = 52.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="Label" type="Label" parent="VBoxContainer/angle_y"]
-margin_top = 5.0
-margin_right = 155.0
-margin_bottom = 19.0
-text = "Angle on vertical axis (Y)"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="angle_vert" type="LineEdit" parent="VBoxContainer/angle_y"]
-margin_left = 159.0
-margin_right = 217.0
-margin_bottom = 24.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="angle_diag" type="HBoxContainer" parent="VBoxContainer"]
-margin_top = 56.0
-margin_right = 370.0
-margin_bottom = 80.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="Label" type="Label" parent="VBoxContainer/angle_diag"]
-margin_top = 5.0
-margin_right = 146.0
-margin_bottom = 19.0
-text = "Angle on diagonal axes"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="angle_diag" type="LineEdit" parent="VBoxContainer/angle_diag"]
-margin_left = 150.0
-margin_right = 208.0
-margin_bottom = 24.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
-margin_top = 84.0
-margin_right = 370.0
-margin_bottom = 88.0
-
-[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer"]
-margin_top = 92.0
-margin_right = 370.0
-margin_bottom = 170.0
-size_flags_vertical = 3
-__meta__ = {
-"_editor_description_": ""
-}
-
-[node name="angles" type="HBoxContainer" parent="VBoxContainer/VBoxContainer"]
-margin_right = 370.0
-margin_bottom = 78.0
-size_flags_vertical = 3
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/angles"]
-margin_top = 32.0
-margin_right = 78.0
-margin_bottom = 46.0
-text = "Angles array"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="angle_array" type="TextEdit" parent="VBoxContainer/VBoxContainer/angles"]
-margin_left = 82.0
-margin_right = 370.0
-margin_bottom = 78.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-wrap_enabled = true
-
-[node name="player_animations" type="OptionButton" parent="."]
-visible = false
-margin_left = 470.0
-margin_top = 10.0
-margin_right = 638.0
-margin_bottom = 33.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[connection signal="text_changed" from="VBoxContainer/HBoxContainer/number_of_directions" to="." method="_on_number_of_directions_text_changed"]
-[connection signal="text_changed" from="VBoxContainer/angle_x/angle_horiz" to="." method="_on_angle_horiz_text_changed"]
-[connection signal="text_changed" from="VBoxContainer/angle_y/angle_vert" to="." method="_on_angle_vert_text_changed"]
-[connection signal="text_changed" from="VBoxContainer/angle_diag/angle_diag" to="." method="_on_angle_diag_text_changed"]
-[connection signal="text_changed" from="VBoxContainer/VBoxContainer/angles/angle_array" to="." method="_on_angle_diag_text_changed"]
diff --git a/addons/escoria-core/testing/rtl_screen_offset_testing.gd b/addons/escoria-core/testing/rtl_screen_offset_testing.gd
deleted file mode 100644
index f83a5066..00000000
--- a/addons/escoria-core/testing/rtl_screen_offset_testing.gd
+++ /dev/null
@@ -1,166 +0,0 @@
-extends Control
-
-onready var screen_width = get_tree().get_root().get_viewport().size.x
-onready var screen_height = get_tree().get_root().get_viewport().size.y
-var global_distance_to_clamp = 40 setget set_global_dist_clamp,get_global_dist_clamp
-
-signal mouse_moved(position)
-signal text_selected(text)
-
-export(NodePath) var path_to_richtextlabel
-const ONE_LINE_HEIGHT = 16
-export(int) var max_width = 200
-const MIN_HEIGHT = 30
-const MAX_HEIGHT = 500
-
-func _ready():
- assert(!path_to_richtextlabel.is_empty())
- $VBoxContainer/HBoxContainer/clamp_distance.text = str(global_distance_to_clamp)
-
- # Add a white TextureRect behind the RTL to see its actual size
- var texturerect_node = TextureRect.new()
- get_node(path_to_richtextlabel).add_child(texturerect_node)
- texturerect_node.texture = load("res://addons/escoria-core/game/assets/images/white.png")
- texturerect_node.expand = true
- texturerect_node.stretch_mode = TextureRect.STRETCH_TILE
- texturerect_node.size_flags_horizontal = SIZE_EXPAND_FILL
- texturerect_node.size_flags_vertical = SIZE_EXPAND_FILL
- texturerect_node.show_behind_parent = true
- texturerect_node.anchor_right = 1.0
- texturerect_node.anchor_bottom = 1.0
- move_child(get_node(path_to_richtextlabel), 1)
-
- update_line2d()
- _on_new_text_pressed()
- set_process_input(true)
-
-func set_path_to_richtextlabel(path):
- path_to_richtextlabel = path
-
-
-func _input(event):
- if event is InputEventMouseMotion:
- emit_signal("mouse_moved", event.position)
-
-func set_global_dist_clamp(d):
- global_distance_to_clamp = d
- update_line2d()
-
-func get_global_dist_clamp():
- return global_distance_to_clamp
-
-func update_line2d():
- $Line2D.clear_points()
- $Line2D.add_point(Vector2(global_distance_to_clamp, global_distance_to_clamp))
- $Line2D.add_point(Vector2(global_distance_to_clamp, screen_height - global_distance_to_clamp))
- $Line2D.add_point(Vector2(screen_width - global_distance_to_clamp, screen_height - global_distance_to_clamp))
- $Line2D.add_point(Vector2(screen_width - global_distance_to_clamp, global_distance_to_clamp))
- $Line2D.add_point(Vector2(global_distance_to_clamp, global_distance_to_clamp))
-
-
-func _on_new_text_pressed():
- var pressed_button = $HBoxContainer2/foo.group.get_pressed_button()
- printt(pressed_button.name, pressed_button.text)
- emit_signal("text_selected", pressed_button.text)
-
-
-func tooltip_distance_to_edge_top(position: Vector2):
- return position.y
-
-func tooltip_distance_to_edge_bottom(position: Vector2):
- return screen_height - position.y
-
-func tooltip_distance_to_edge_left(position: Vector2):
- return position.x
-
-func tooltip_distance_to_edge_right(position: Vector2):
- return screen_width - position.x
-
-func _on_Control_mouse_moved(mouse_pos):
-# printt("mousepos", mouse_pos)
-# printt("label_container_pos", rect_position)
-
- #var corrected_position = _offset(new_pos)
- var corrected_position = mouse_pos
-
- # clamp TOP
- if tooltip_distance_to_edge_top(mouse_pos) <= global_distance_to_clamp:
- corrected_position.y = global_distance_to_clamp
-
- # clamp BOTTOM
- if tooltip_distance_to_edge_bottom(mouse_pos + get_node(path_to_richtextlabel).rect_size) <= global_distance_to_clamp:
- corrected_position.y = screen_height - global_distance_to_clamp - get_node(path_to_richtextlabel).rect_size.y
-
- # clamp LEFT
- if tooltip_distance_to_edge_left(mouse_pos - get_node(path_to_richtextlabel).rect_size/2) <= global_distance_to_clamp:
- corrected_position.x = global_distance_to_clamp
-
- # clamp RIGHT
- if tooltip_distance_to_edge_right(mouse_pos + get_node(path_to_richtextlabel).rect_size/2) <= global_distance_to_clamp:
- corrected_position.x = screen_width - global_distance_to_clamp - get_node(path_to_richtextlabel).rect_size.x
-
- get_node(path_to_richtextlabel).anchor_right = 0.2
- get_node(path_to_richtextlabel).rect_position = corrected_position
-
-
-func _on_Control_text_selected(text):
- get_node(path_to_richtextlabel).bbcode_text = "[color=red]" + text.replace(" ", "\n") + "[/color]"
- update_size()
-
-func _on_clamp_distance_text_changed(new_text):
- global_distance_to_clamp = int(new_text)
- update_line2d()
-
-
-func _offset(position):
- var center_offset_x = rect_size.x / 2
- var offset_y = 5
-
- position.x -= center_offset_x
- position.y += offset_y
- return position
-
-
-func update_size():
- ##Â RECT_SIZE ##
- var rtl_node = get_node(path_to_richtextlabel)
- var rtl_width = rtl_node.rect_size.x
- var rtl_height = rtl_node.rect_size.y
- var content_height = rtl_node.get_content_height()
- var nb_visible_characters = rtl_node.visible_characters
- var nb_visible_lines = rtl_node.get_visible_line_count()
-
- printt("BEFORE", "text_height", content_height, "rtl_height", rtl_node.rect_size.y)
-
- # if text is too long and is wrapped
-# var nblines = float(rtl_node.get_content_height()) / float(ONE_LINE_HEIGHT)
- var nblines = nb_visible_lines
- if nblines >= 1:
-
- yield(get_tree(), "idle_frame")
- yield(get_tree(), "idle_frame")
- var text_height = rtl_node.get_content_height()
- if text_height > MAX_HEIGHT:
- text_height = MAX_HEIGHT
- if text_height <= MIN_HEIGHT:
- text_height = MIN_HEIGHT
-
- var parent_width = rtl_node.rect_size.x
-
- # first, try to increase width until it goes above max_width
- while parent_width < max_width && float(text_height) / float(ONE_LINE_HEIGHT) > 1.0:
- rtl_node.rect_size.x += 1
- parent_width = rtl_node.rect_size.x
-
-
- rtl_node.rect_size.y = text_height
-
- if rtl_node.rect_size.x >= max_width:
- rtl_node.rect_size.x = max_width
-
- ##Â END RECT_SIZE ##
- rtl_node.anchor_top = 0.0
- rtl_node.anchor_right = 0.0
- rtl_node.anchor_bottom = 0.0
- rtl_node.anchor_left = 0.0
- printt("AFTER", "text_height", get_node(path_to_richtextlabel).get_content_height(), "rtl_height", rtl_node.rect_size.y)
diff --git a/addons/escoria-core/testing/rtl_screen_offset_testing.tscn b/addons/escoria-core/testing/rtl_screen_offset_testing.tscn
deleted file mode 100644
index 282814a0..00000000
--- a/addons/escoria-core/testing/rtl_screen_offset_testing.tscn
+++ /dev/null
@@ -1,91 +0,0 @@
-[gd_scene load_steps=4 format=2]
-
-[ext_resource path="res://addons/escoria-core/testing/rtl_screen_offset_testing.gd" type="Script" id=1]
-[ext_resource path="res://game/ui/ui_mouse_icons/tooltip/target_tooltip.tscn" type="PackedScene" id=2]
-
-[sub_resource type="ButtonGroup" id=1]
-
-[node name="rtl_screen_offset" type="Control"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-margin_right = -1280.0
-margin_bottom = -800.0
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_lock_": true
-}
-path_to_richtextlabel = NodePath("tooltip")
-
-[node name="Line2D" type="Line2D" parent="."]
-points = PoolVector2Array( 40, 40, 40, 976, 1808, 976, 1808, 40, 40, 40 )
-width = 2.51
-texture_mode = 116
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-margin_left = 315.72
-margin_top = 269.104
-margin_right = 475.72
-margin_bottom = 321.104
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
-margin_right = 160.0
-margin_bottom = 24.0
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer"]
-margin_top = 5.0
-margin_right = 98.0
-margin_bottom = 19.0
-text = "Clamp distance"
-
-[node name="clamp_distance" type="LineEdit" parent="VBoxContainer/HBoxContainer"]
-margin_left = 102.0
-margin_right = 160.0
-margin_bottom = 24.0
-text = "40"
-max_length = 4
-
-[node name="HBoxContainer2" type="VBoxContainer" parent="."]
-margin_left = 310.0
-margin_top = 340.0
-margin_right = 470.0
-margin_bottom = 380.0
-
-[node name="foo" type="CheckBox" parent="HBoxContainer2"]
-margin_right = 588.0
-margin_bottom = 24.0
-pressed = true
-group = SubResource( 1 )
-text = "Foo"
-
-[node name="foobar" type="CheckBox" parent="HBoxContainer2"]
-margin_top = 28.0
-margin_right = 588.0
-margin_bottom = 52.0
-group = SubResource( 1 )
-text = "Foo bar"
-
-[node name="whatisit" type="CheckBox" parent="HBoxContainer2"]
-margin_top = 56.0
-margin_right = 588.0
-margin_bottom = 80.0
-group = SubResource( 1 )
-text = "A super extremely long sentence to test the behaviour of that RichTextLabel node..."
-
-[node name="tooltip" parent="." instance=ExtResource( 2 )]
-margin_left = 238.815
-margin_top = 131.18
-margin_right = 638.815
-margin_bottom = 231.18
-rect_min_size = Vector2( 400, 0 )
-bbcode_text = "[center][color=#200606][/color][/center]"
-text = "[center][color=#200606][/color][/center]"
-
-[connection signal="mouse_moved" from="." to="." method="_on_Control_mouse_moved"]
-[connection signal="text_selected" from="." to="." method="_on_Control_text_selected"]
-[connection signal="text_changed" from="VBoxContainer/HBoxContainer/clamp_distance" to="." method="_on_clamp_distance_text_changed"]
-[connection signal="pressed" from="HBoxContainer2/foo" to="." method="_on_new_text_pressed"]
-[connection signal="pressed" from="HBoxContainer2/foobar" to="." method="_on_new_text_pressed"]
-[connection signal="pressed" from="HBoxContainer2/whatisit" to="." method="_on_new_text_pressed"]
diff --git a/addons/escoria-core/ui_library/inventory/esc_inventory_button.gd b/addons/escoria-core/ui_library/inventory/esc_inventory_button.gd
deleted file mode 100644
index 26e4952f..00000000
--- a/addons/escoria-core/ui_library/inventory/esc_inventory_button.gd
+++ /dev/null
@@ -1,114 +0,0 @@
-# The inventory representation of an ESC item if pickable (only used by
-# the inventory components)
-extends TextureButton
-class_name ESCInventoryButton
-
-
-# Signal emitted when the item was left clicked
-#
-# #### Parameters
-#
-# - item_id: Global ID of the clicked item
-signal mouse_left_inventory_item(item_id)
-
-# Signal emitted when the item was right clicked
-#
-# #### Parameters
-#
-# - item_id: Global ID of the clicked item
-signal mouse_right_inventory_item(item_id)
-
-# Signal emitted when the item was double clicked
-#
-# #### Parameters
-#
-# - item_id: Global ID of the clicked item
-signal mouse_double_left_inventory_item(item_id)
-
-# Signal emitted when the item was focused
-#
-# #### Parameters
-#
-# - item_id: Global ID of the clicked item
-signal inventory_item_focused(item_id)
-
-# Signal emitted when the item is not focused anymore
-signal inventory_item_unfocused()
-
-
-# Global ID of the ESCItem that uses this ESCInventoryItem
-var global_id: String = ""
-
-
-func _init(p_item: ESCInventoryItem) -> void:
- global_id = p_item.global_id
- texture_normal = p_item.texture
- expand = true
- stretch_mode = TextureButton.STRETCH_KEEP_ASPECT
-
-
-func _process(_delta: float) -> void:
- rect_size = ProjectSettings.get_setting("escoria/ui/inventory_item_size")
- rect_min_size = ProjectSettings.get_setting(
- "escoria/ui/inventory_item_size"
- )
-
-# Connect input handlers
-func _ready():
- connect("gui_input", self, "_on_inventory_item_gui_input")
- connect("mouse_entered", self, "_on_inventory_item_mouse_enter")
- connect("mouse_exited", self, "_on_inventory_item_mouse_exit")
-
-
-# Handle the gui input and emit the respective signals
-#
-# #### Parameters
-#
-# - event: The event received
-func _on_inventory_item_gui_input(event: InputEvent):
- if InputMap.has_action("switch_action_verb") \
- and event.is_action_pressed("switch_action_verb"):
- if event.button_index == BUTTON_WHEEL_UP:
- escoria.inputs_manager._on_mousewheel_action(-1)
- elif event.button_index == BUTTON_WHEEL_DOWN:
- escoria.inputs_manager._on_mousewheel_action(1)
- if event is InputEventMouseButton:
-# var p = get_global_mouse_position()
- if event.doubleclick:
- if event.button_index == BUTTON_LEFT:
- emit_signal(
- "mouse_double_left_inventory_item",
- global_id,
- event
- )
- # Make sure fast right clicks in the inventory aren't ignored
- elif event.button_index == BUTTON_RIGHT:
- emit_signal(
- "mouse_right_inventory_item",
- global_id,
- event
- )
- else:
- if event.is_pressed():
- if event.button_index == BUTTON_LEFT:
- emit_signal(
- "mouse_left_inventory_item",
- global_id,
- event
- )
- if event.button_index == BUTTON_RIGHT:
- emit_signal(
- "mouse_right_inventory_item",
- global_id,
- event
- )
-
-
-# Handle mouse entering the item and send the respecitve signal
-func _on_inventory_item_mouse_enter():
- emit_signal("inventory_item_focused", global_id)
-
-
-# Handle mouse leaving the item and send the respecitve signal
-func _on_inventory_item_mouse_exit():
- emit_signal("inventory_item_unfocused")
diff --git a/addons/escoria-core/ui_library/inventory/esc_inventory_container.gd b/addons/escoria-core/ui_library/inventory/esc_inventory_container.gd
deleted file mode 100644
index 09855878..00000000
--- a/addons/escoria-core/ui_library/inventory/esc_inventory_container.gd
+++ /dev/null
@@ -1,44 +0,0 @@
-# Inventory container handler that acts as a base for UIs inventory containers
-extends Control
-class_name ESCInventoryContainer
-
-
-# Get whether the inventory container currently is empty
-# **Returns** Whether the container is empty or not
-func is_empty() -> bool:
- return get_child_count() > 0
-
-# Add a new item into the container and return the control generated for it
-# so its events can be handled by the inputs manager
-#
-# #### Parameters
-# - inventory_item: Item to add
-# **Returns** The button generated for the item
-func add_item(inventory_item: ESCInventoryItem) -> ESCInventoryButton:
- var button = ESCInventoryButton.new(inventory_item)
- add_child(button)
- return button
-
-
-# Remove an item from the container
-#
-# #### Parameters
-# - inventory_item: Item to remove
-func remove_item(inventory_item: ESCInventoryItem):
- for c in get_children():
- if c is ESCInventoryButton and c.global_id == inventory_item.global_id:
- remove_child(c)
- c.queue_free()
-
-
-# Return an Inventory button from the container, using an ESCInventoryItem
-#
-# #### Parameters
-# - inventory_item: Inventory item to return the button node from
-func get_inventory_button(inventory_item: ESCInventoryItem) -> ESCInventoryButton:
- var inventory_button = null
- for c in get_children():
- if c.global_id == inventory_item.global_id:
- inventory_button = c
- break
- return inventory_button
diff --git a/addons/escoria-core/ui_library/menus/load_save/load/load_game.gd b/addons/escoria-core/ui_library/menus/load_save/load/load_game.gd
deleted file mode 100644
index e5e9e0cb..00000000
--- a/addons/escoria-core/ui_library/menus/load_save/load/load_game.gd
+++ /dev/null
@@ -1,46 +0,0 @@
-# A container for loading from a save slot
-extends Control
-
-
-# Emitted when the back button is pressed
-signal back_button_pressed
-
-
-# The scene to display a slot
-export(PackedScene) var slot_ui_scene
-
-
-# Load the savegames when loaded
-func _ready():
- refresh_savegames()
-
-
-# A slot was pressed. Load the game
-#
-# #### Parameters
-# - slot_id: The slot that was pressed
-func _on_slot_pressed(slot_id: int) -> void:
- escoria.save_manager.load_game(slot_id)
-
-
-# The back button was pressed
-func _on_back_pressed():
- emit_signal("back_button_pressed")
-
-
-# Create the slots from the list of savegames
-func refresh_savegames():
- for slot in $VBoxContainer/ScrollContainer/slots.get_children():
- $VBoxContainer/ScrollContainer/slots.remove_child(slot)
-
- var saves_list = escoria.save_manager.get_saves_list()
- if not saves_list.empty():
- for save_key in saves_list.keys():
- var new_slot = slot_ui_scene.instance()
- $VBoxContainer/ScrollContainer/slots.add_child(
- new_slot
- )
- # Move newest save to the top of the list
- $VBoxContainer/ScrollContainer/slots.move_child(new_slot, 0)
- new_slot.set_slot_name_date(saves_list[save_key]["name"], saves_list[save_key]["date"])
- new_slot.connect("pressed", self, "_on_slot_pressed", [save_key])
diff --git a/addons/escoria-core/ui_library/menus/load_save/load/load_game.tscn b/addons/escoria-core/ui_library/menus/load_save/load/load_game.tscn
deleted file mode 100644
index 9da16b5f..00000000
--- a/addons/escoria-core/ui_library/menus/load_save/load/load_game.tscn
+++ /dev/null
@@ -1,60 +0,0 @@
-[gd_scene load_steps=3 format=2]
-
-[ext_resource path="res://addons/escoria-core/ui_library/menus/load_save/load_save_slot/load_save_slot.tscn" type="PackedScene" id=2]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/load_save/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="Panel" type="Panel" parent="."]
-anchor_right = 1.0
-anchor_bottom = 1.0
-__meta__ = {
-"_editor_description_": ""
-}
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-anchor_left = 0.3
-anchor_top = 0.3
-anchor_right = 0.7
-anchor_bottom = 0.7
-margin_left = -55.5
-margin_right = 55.5
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
-margin_right = 623.0
-margin_bottom = 336.0
-size_flags_vertical = 3
-scroll_horizontal_enabled = false
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="slots" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"]
-margin_right = 623.0
-margin_bottom = 336.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="back" type="Button" parent="VBoxContainer"]
-margin_top = 340.0
-margin_right = 623.0
-margin_bottom = 360.0
-text = "OPTIONS_BACK"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[connection signal="pressed" from="VBoxContainer/back" to="." method="_on_back_pressed"]
diff --git a/addons/escoria-core/ui_library/menus/load_save/load_save_slot/load_save_slot.gd b/addons/escoria-core/ui_library/menus/load_save/load_save_slot/load_save_slot.gd
deleted file mode 100644
index 9de5d905..00000000
--- a/addons/escoria-core/ui_library/menus/load_save/load_save_slot/load_save_slot.gd
+++ /dev/null
@@ -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
-
diff --git a/addons/escoria-core/ui_library/menus/load_save/load_save_slot/load_save_slot.tscn b/addons/escoria-core/ui_library/menus/load_save/load_save_slot/load_save_slot.tscn
deleted file mode 100644
index 1863dee8..00000000
--- a/addons/escoria-core/ui_library/menus/load_save/load_save_slot/load_save_slot.tscn
+++ /dev/null
@@ -1,35 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-core/ui_library/menus/load_save/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 = 34.0
-margin_right = 665.0
-margin_bottom = 48.0
-text = "slot_name"
-align = 1
-
-[node name="date" type="Label" parent="VBoxContainer"]
-margin_top = 52.0
-margin_right = 665.0
-margin_bottom = 66.0
-text = "date"
-align = 1
diff --git a/addons/escoria-core/ui_library/menus/load_save/save/overwrite_confirm_popup.gd b/addons/escoria-core/ui_library/menus/load_save/save/overwrite_confirm_popup.gd
deleted file mode 100644
index ce7b090f..00000000
--- a/addons/escoria-core/ui_library/menus/load_save/save/overwrite_confirm_popup.gd
+++ /dev/null
@@ -1,12 +0,0 @@
-extends PopupDialog
-
-signal confirm_yes
-
-func _on_no_pressed():
- hide()
-
-
-func _on_yes_pressed():
- emit_signal("confirm_yes")
- hide()
-
diff --git a/addons/escoria-core/ui_library/menus/load_save/save/overwrite_confirm_popup.tscn b/addons/escoria-core/ui_library/menus/load_save/save/overwrite_confirm_popup.tscn
deleted file mode 100644
index d244c463..00000000
--- a/addons/escoria-core/ui_library/menus/load_save/save/overwrite_confirm_popup.tscn
+++ /dev/null
@@ -1,67 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-core/ui_library/menus/load_save/save/overwrite_confirm_popup.gd" type="Script" id=2]
-
-[node name="overwrite_confirm_popup" type="PopupDialog"]
-visible = true
-anchor_right = 1.0
-anchor_bottom = 1.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 = 423.0
-margin_right = 1250.0
-margin_bottom = 477.0
-size_flags_vertical = 4
-custom_constants/separation = 20
-
-[node name="Label" type="Label" parent="MarginContainer/VBoxContainer"]
-margin_right = 1220.0
-margin_bottom = 14.0
-text = "CONFIRM_OVERWRITE"
-
-[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
-margin_top = 34.0
-margin_right = 1220.0
-margin_bottom = 54.0
-custom_constants/separation = 10
-alignment = 2
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="yes" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer"]
-margin_left = 1144.0
-margin_right = 1177.0
-margin_bottom = 20.0
-text = "YES"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="no" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer"]
-margin_left = 1187.0
-margin_right = 1220.0
-margin_bottom = 20.0
-text = "NO"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/yes" to="." method="_on_yes_pressed"]
-[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/no" to="." method="_on_no_pressed"]
diff --git a/addons/escoria-core/ui_library/menus/load_save/save/save_game.gd b/addons/escoria-core/ui_library/menus/load_save/save/save_game.gd
deleted file mode 100644
index aee7e5ab..00000000
--- a/addons/escoria-core/ui_library/menus/load_save/save/save_game.gd
+++ /dev/null
@@ -1,75 +0,0 @@
-# A container for saving to a save slot
-extends Control
-
-# Emitted when the back button is pressed
-signal back_button_pressed
-
-
-# The scene to display a slot
-export(PackedScene) var slot_ui_scene
-
-
-# The slot that was pressed
-var _slot_pressed = null
-
-
-# Load the savegames when loaded
-func _ready():
- refresh_savegames()
-
-
-# A slot was pressed, save the game
-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_centered_ratio(.3)
- else:
- $save_name_popup.popup_centered_ratio(.3)
-
-
-# Create the slots from the list of savegames
-func refresh_savegames():
- var _slots = $VBoxContainer/ScrollContainer/slots
- for slot in _slots.get_children():
- _slots.remove_child(slot)
-
- var saves_list = escoria.save_manager.get_saves_list()
- if not saves_list.empty():
- for save_key in saves_list.keys():
- var new_slot = slot_ui_scene.instance()
- _slots.add_child(new_slot)
- new_slot.set_slot_name_date(saves_list[save_key]["name"], saves_list[save_key]["date"])
- new_slot.connect("pressed", self, "_on_slot_pressed", [save_key])
-
- 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])
-
-
-# The back button was pressed
-func _on_back_pressed():
- emit_signal("back_button_pressed")
-
-
-# The name for the save game was given, save the game.
-#
-# #### Parameters
-# - p_savename: The name of the savegame entered
-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
-
-
-# Overwriting the savegame was confirmed, show the save name popup
-func _on_overwrite_confirm_popup_confirm_yes():
- $save_name_popup.popup_centered_ratio(.3)
diff --git a/addons/escoria-core/ui_library/menus/load_save/save/save_game.tscn b/addons/escoria-core/ui_library/menus/load_save/save/save_game.tscn
deleted file mode 100644
index 44cd0803..00000000
--- a/addons/escoria-core/ui_library/menus/load_save/save/save_game.tscn
+++ /dev/null
@@ -1,72 +0,0 @@
-[gd_scene load_steps=5 format=2]
-
-[ext_resource path="res://addons/escoria-core/ui_library/menus/load_save/load_save_slot/load_save_slot.tscn" type="PackedScene" id=1]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/load_save/save/save_game.gd" type="Script" id=2]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/load_save/save/save_name_popup.tscn" type="PackedScene" id=4]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/load_save/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="Panel" type="Panel" parent="."]
-anchor_right = 1.0
-anchor_bottom = 1.0
-margin_top = -1.0
-margin_bottom = -1.0
-__meta__ = {
-"_editor_description_": ""
-}
-
-[node name="save_name_popup" parent="." instance=ExtResource( 4 )]
-visible = false
-
-[node name="overwrite_confirm_popup" parent="." instance=ExtResource( 5 )]
-visible = false
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-anchor_left = 0.3
-anchor_top = 0.3
-anchor_right = 0.7
-anchor_bottom = 0.7
-margin_left = -55.5
-margin_right = 55.5
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
-margin_right = 623.0
-margin_bottom = 336.0
-size_flags_vertical = 3
-scroll_horizontal_enabled = false
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="slots" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"]
-margin_right = 623.0
-margin_bottom = 336.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="back" type="Button" parent="VBoxContainer"]
-margin_top = 340.0
-margin_right = 623.0
-margin_bottom = 360.0
-text = "OPTIONS_BACK"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[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="VBoxContainer/back" to="." method="_on_back_pressed"]
diff --git a/addons/escoria-core/ui_library/menus/load_save/save/save_name_popup.gd b/addons/escoria-core/ui_library/menus/load_save/save/save_name_popup.gd
deleted file mode 100644
index eed9ec37..00000000
--- a/addons/escoria-core/ui_library/menus/load_save/save/save_name_popup.gd
+++ /dev/null
@@ -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()
diff --git a/addons/escoria-core/ui_library/menus/load_save/save/save_name_popup.tscn b/addons/escoria-core/ui_library/menus/load_save/save/save_name_popup.tscn
deleted file mode 100644
index e18cf00b..00000000
--- a/addons/escoria-core/ui_library/menus/load_save/save/save_name_popup.tscn
+++ /dev/null
@@ -1,72 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-core/ui_library/menus/load_save/save/save_name_popup.gd" type="Script" id=2]
-
-[node name="save_name_popup" type="PopupDialog"]
-visible = true
-anchor_right = 1.0
-anchor_bottom = 1.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 = 401.0
-margin_right = 1250.0
-margin_bottom = 499.0
-size_flags_vertical = 4
-custom_constants/separation = 20
-
-[node name="Label" type="Label" parent="MarginContainer/VBoxContainer"]
-margin_right = 1220.0
-margin_bottom = 14.0
-text = "ENTER_SAVE_NAME"
-
-[node name="LineEdit" type="LineEdit" parent="MarginContainer/VBoxContainer"]
-margin_top = 34.0
-margin_right = 1220.0
-margin_bottom = 58.0
-
-[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer/VBoxContainer"]
-margin_top = 78.0
-margin_right = 1220.0
-margin_bottom = 98.0
-custom_constants/separation = 10
-alignment = 2
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="cancel" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer"]
-margin_left = 1118.0
-margin_right = 1179.0
-margin_bottom = 20.0
-text = "CANCEL"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="ok" type="Button" parent="MarginContainer/VBoxContainer/HBoxContainer"]
-margin_left = 1189.0
-margin_right = 1220.0
-margin_bottom = 20.0
-text = "OK"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/cancel" to="." method="_on_cancel_pressed"]
-[connection signal="pressed" from="MarginContainer/VBoxContainer/HBoxContainer/ok" to="." method="_on_ok_pressed"]
diff --git a/addons/escoria-core/ui_library/menus/main_menu/main_menu.gd b/addons/escoria-core/ui_library/menus/main_menu/main_menu.gd
deleted file mode 100644
index dac988b2..00000000
--- a/addons/escoria-core/ui_library/menus/main_menu/main_menu.gd
+++ /dev/null
@@ -1,42 +0,0 @@
-# A simple main menu
-extends Control
-
-
-# Start the game
-func _on_new_game_pressed():
- escoria.new_game()
-
-
-# Show the load slots
-func _on_load_game_pressed():
- $main.hide()
- $load_game.refresh_savegames()
- $load_game.show()
-
-
-# Show the options panel
-func _on_options_pressed():
- $main.hide()
- $options.show()
-
-
-# Quit the game
-func _on_quit_pressed():
- escoria.quit()
-
-
-# Hide the options panel again
-func _on_options_back_button_pressed():
- reset()
-
-
-# Hide the load panel
-func _on_load_game_back_button_pressed():
- reset()
-
-
-# Resets the UI to initial state
-func reset():
- $load_game.hide()
- $options.hide()
- $main.show()
diff --git a/addons/escoria-core/ui_library/menus/main_menu/main_menu.tscn b/addons/escoria-core/ui_library/menus/main_menu/main_menu.tscn
deleted file mode 100644
index 1a5e0676..00000000
--- a/addons/escoria-core/ui_library/menus/main_menu/main_menu.tscn
+++ /dev/null
@@ -1,100 +0,0 @@
-[gd_scene load_steps=5 format=2]
-
-[ext_resource path="res://addons/escoria-core/ui_library/menus/main_menu/main_menu.gd" type="Script" id=1]
-[ext_resource path="res://addons/escoria-core/design/escoria-logo-small.png" type="Texture" id=3]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/options/options.tscn" type="PackedScene" id=4]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/load_save/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 )
-
-[node name="load_game" parent="." instance=ExtResource( 5 )]
-visible = false
-
-[node name="options" parent="." instance=ExtResource( 4 )]
-visible = false
-
-[node name="main" type="Control" parent="."]
-anchor_right = 1.0
-anchor_bottom = 1.0
-
-[node name="Panel" type="Panel" parent="main"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-__meta__ = {
-"_edit_use_anchors_": false,
-"_editor_description_": ""
-}
-
-[node name="main" type="VBoxContainer" parent="main"]
-anchor_left = 0.5
-anchor_right = 0.5
-anchor_bottom = 1.0
-margin_left = -308.0
-margin_right = 308.0
-custom_constants/separation = 100
-alignment = 1
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="TextureRect" type="TextureRect" parent="main/main"]
-margin_top = 92.0
-margin_right = 616.0
-margin_bottom = 318.0
-texture = ExtResource( 3 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="buttons" type="VBoxContainer" parent="main/main"]
-margin_top = 418.0
-margin_right = 616.0
-margin_bottom = 658.0
-custom_constants/separation = 10
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="new_game" type="Button" parent="main/main/buttons"]
-margin_right = 616.0
-margin_bottom = 150.0
-rect_min_size = Vector2( 0, 150 )
-size_flags_vertical = 3
-text = "NEW_GAME"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="load_game" type="Button" parent="main/main/buttons"]
-margin_top = 160.0
-margin_right = 616.0
-margin_bottom = 180.0
-text = "LOAD_GAME"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="options" type="Button" parent="main/main/buttons"]
-margin_top = 190.0
-margin_right = 616.0
-margin_bottom = 210.0
-text = "OPTIONS"
-
-[node name="quit" type="Button" parent="main/main/buttons"]
-margin_top = 220.0
-margin_right = 616.0
-margin_bottom = 240.0
-text = "QUIT"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[connection signal="back_button_pressed" from="load_game" to="." method="_on_load_game_back_button_pressed"]
-[connection signal="back_button_pressed" from="options" to="." method="_on_options_back_button_pressed"]
-[connection signal="pressed" from="main/main/buttons/new_game" to="." method="_on_new_game_pressed"]
-[connection signal="pressed" from="main/main/buttons/load_game" to="." method="_on_load_game_pressed"]
-[connection signal="pressed" from="main/main/buttons/options" to="." method="_on_options_pressed"]
-[connection signal="pressed" from="main/main/buttons/quit" to="." method="_on_quit_pressed"]
diff --git a/addons/escoria-core/ui_library/menus/options/flags/de.png b/addons/escoria-core/ui_library/menus/options/flags/de.png
deleted file mode 100644
index 4fe98a89..00000000
Binary files a/addons/escoria-core/ui_library/menus/options/flags/de.png and /dev/null differ
diff --git a/addons/escoria-core/ui_library/menus/options/flags/en.png b/addons/escoria-core/ui_library/menus/options/flags/en.png
deleted file mode 100644
index 05892848..00000000
Binary files a/addons/escoria-core/ui_library/menus/options/flags/en.png and /dev/null differ
diff --git a/addons/escoria-core/ui_library/menus/options/flags/es.png b/addons/escoria-core/ui_library/menus/options/flags/es.png
deleted file mode 100644
index 7178ce42..00000000
Binary files a/addons/escoria-core/ui_library/menus/options/flags/es.png and /dev/null differ
diff --git a/addons/escoria-core/ui_library/menus/options/flags/fr.png b/addons/escoria-core/ui_library/menus/options/flags/fr.png
deleted file mode 100644
index fcaf2cc1..00000000
Binary files a/addons/escoria-core/ui_library/menus/options/flags/fr.png and /dev/null differ
diff --git a/addons/escoria-core/ui_library/menus/options/options.gd b/addons/escoria-core/ui_library/menus/options/options.gd
deleted file mode 100644
index 1004a96e..00000000
--- a/addons/escoria-core/ui_library/menus/options/options.gd
+++ /dev/null
@@ -1,174 +0,0 @@
-# An options menu
-extends Control
-
-
-# The back button was pressed
-signal back_button_pressed
-
-
-# Custom setting key
-const CUSTOM_SETTING: String = "a_custom_setting"
-
-
-# The current settings
-var backup_settings
-
-
-# A list of languages already added to the language selection
-var _loaded_languages: Array = []
-
-
-# The settings changed
-onready var settings_changed = false
-
-
-# Initialize the flags
-func _ready() -> void:
- var _flags_container: HBoxContainer = \
- $VBoxContainer/MarginContainer/options/flags
- for child in _flags_container.get_children():
- _flags_container.remove_child(child)
- child.queue_free()
-
- _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://addons/escoria-core/ui_library" + \
- "/menus/options/flags/%s.png" % lang
- )
- _flags_container.add_child(_lang)
- _lang.connect("gui_input", self, "_on_language_input", [lang])
-
-
-# Show the options
-func show():
- backup_settings = escoria.settings_manager.get_settings()
- initialize_options(backup_settings)
- visible = true
-
-
-# Set the sliders to the values of the settings
-#
-# #### Parameters
-# - p_settings: The settings to use
-func initialize_options(p_settings):
- var _options = $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"]
- _options.get_node("fullscreen").set_pressed_no_signal(p_settings["fullscreen"])
-
-
-# The language was changed
-#
-# #### Parameters
-# - event: The input event from the flag
-# - language: The language to set
-func _on_language_input(event: InputEvent, language: String):
- if event.is_pressed():
- TranslationServer.set_locale(language)
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.TEXT_LANG,
- language
- )
- settings_changed = true
-
-
-# Sound volume was changed
-#
-# #### Parameters
-# - value: The new volume level
-func _on_sound_volume_changed(value):
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.SFX_VOLUME
- ) != value:
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.SFX_VOLUME,
- value
- )
- escoria.settings_manager.apply_settings()
- settings_changed = true
-
-
-# Music volume was changed
-#
-# #### Parameters
-# - value: The new volume level
-func _on_music_volume_changed(value):
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.MUSIC_VOLUME
- ) != value:
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.MUSIC_VOLUME,
- value
- )
- escoria.settings_manager.apply_settings()
- settings_changed = true
-
-
-# General volume was changed
-#
-# #### Parameters
-# - value: The new volume level
-func _on_general_volume_changed(value):
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.MASTER_VOLUME
- ) != value:
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.MASTER_VOLUME,
- value
- )
- escoria.settings_manager.apply_settings()
- settings_changed = true
-
-
-# Speech volume was changed
-#
-# #### Parameters
-# - value: The new volume level
-func _on_speech_volume_value_changed(value: float) -> void:
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.SPEECH_VOLUME
- ) != value:
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.SPEECH_VOLUME,
- value
- )
- escoria.settings_manager.apply_settings()
- settings_changed = true
-
-
-# Fullscreen was changed
-#
-# #### Parameters
-# - button_pressed: Fullscreen (true) or windowed (false)
-func _on_fullscreen_toggled(button_pressed: bool) -> void:
- if ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.FULLSCREEN
- ) != button_pressed:
- ESCProjectSettingsManager.set_setting(
- ESCProjectSettingsManager.FULLSCREEN,
- button_pressed
- )
- escoria.settings_manager.apply_settings()
- settings_changed = true
-
-
-# Save the settings
-func _on_apply_pressed():
- escoria.settings_manager.custom_settings[CUSTOM_SETTING] = 100
- escoria.settings_manager.save_settings()
- settings_changed = false
- emit_signal("back_button_pressed")
-
-
-# The back button was pressed
-func _on_back_pressed():
- escoria.settings_manager.save_settings_resource_to_project_settings(backup_settings)
- escoria.settings_manager.apply_settings()
- emit_signal("back_button_pressed")
diff --git a/addons/escoria-core/ui_library/menus/options/options.tscn b/addons/escoria-core/ui_library/menus/options/options.tscn
deleted file mode 100644
index e364336f..00000000
--- a/addons/escoria-core/ui_library/menus/options/options.tscn
+++ /dev/null
@@ -1,177 +0,0 @@
-[gd_scene load_steps=3 format=2]
-
-[ext_resource path="res://addons/escoria-core/ui_library/menus/options/flags/de.png" type="Texture" id=1]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/options/options.gd" type="Script" id=4]
-
-[node name="options" type="Control"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-script = ExtResource( 4 )
-
-[node name="Panel" type="Panel" parent="."]
-anchor_right = 1.0
-anchor_bottom = 1.0
-__meta__ = {
-"_editor_description_": ""
-}
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-anchor_right = 1.0
-anchor_bottom = 1.0
-alignment = 1
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
-margin_left = 391.0
-margin_top = 251.0
-margin_right = 888.0
-margin_bottom = 474.0
-size_flags_horizontal = 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="VBoxContainer/MarginContainer"]
-margin_left = 20.0
-margin_top = 20.0
-margin_right = 477.0
-margin_bottom = 203.0
-size_flags_vertical = 6
-custom_constants/hseparation = 40
-columns = 2
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="label" type="Label" parent="VBoxContainer/MarginContainer/options"]
-margin_top = 30.0
-margin_right = 137.0
-margin_bottom = 44.0
-text = "OPTIONS_LANGUAGE"
-
-[node name="flags" type="HBoxContainer" parent="VBoxContainer/MarginContainer/options"]
-margin_left = 177.0
-margin_right = 457.0
-margin_bottom = 75.0
-size_flags_vertical = 3
-custom_constants/separation = 30
-alignment = 1
-
-[node name="TextureRect2" type="TextureRect" parent="VBoxContainer/MarginContainer/options/flags"]
-margin_right = 125.0
-margin_bottom = 75.0
-texture = ExtResource( 1 )
-
-[node name="TextureRect3" type="TextureRect" parent="VBoxContainer/MarginContainer/options/flags"]
-margin_left = 155.0
-margin_right = 280.0
-margin_bottom = 75.0
-texture = ExtResource( 1 )
-
-[node name="label2" type="Label" parent="VBoxContainer/MarginContainer/options"]
-margin_top = 80.0
-margin_right = 137.0
-margin_bottom = 94.0
-text = "GENERAL_VOLUME"
-
-[node name="general_volume" type="HSlider" parent="VBoxContainer/MarginContainer/options"]
-margin_left = 177.0
-margin_top = 79.0
-margin_right = 457.0
-margin_bottom = 95.0
-size_flags_horizontal = 3
-max_value = 1.0
-step = 0.001
-
-[node name="label3" type="Label" parent="VBoxContainer/MarginContainer/options"]
-margin_top = 100.0
-margin_right = 137.0
-margin_bottom = 114.0
-text = "SOUND_VOLUME"
-
-[node name="sound_volume" type="HSlider" parent="VBoxContainer/MarginContainer/options"]
-margin_left = 177.0
-margin_top = 99.0
-margin_right = 457.0
-margin_bottom = 115.0
-size_flags_horizontal = 3
-max_value = 1.0
-step = 0.001
-
-[node name="label4" type="Label" parent="VBoxContainer/MarginContainer/options"]
-margin_top = 120.0
-margin_right = 137.0
-margin_bottom = 134.0
-text = "MUSIC_VOLUME"
-
-[node name="music_volume" type="HSlider" parent="VBoxContainer/MarginContainer/options"]
-margin_left = 177.0
-margin_top = 119.0
-margin_right = 457.0
-margin_bottom = 135.0
-size_flags_horizontal = 3
-max_value = 1.0
-step = 0.001
-
-[node name="label5" type="Label" parent="VBoxContainer/MarginContainer/options"]
-margin_top = 140.0
-margin_right = 137.0
-margin_bottom = 154.0
-text = "SPEECH_VOLUME"
-
-[node name="speech_volume" type="HSlider" parent="VBoxContainer/MarginContainer/options"]
-margin_left = 177.0
-margin_top = 139.0
-margin_right = 457.0
-margin_bottom = 155.0
-size_flags_horizontal = 3
-max_value = 1.0
-step = 0.001
-
-[node name="label6" type="Label" parent="VBoxContainer/MarginContainer/options"]
-margin_top = 164.0
-margin_right = 137.0
-margin_bottom = 178.0
-text = "FULLSCREEN"
-
-[node name="fullscreen" type="CheckBox" parent="VBoxContainer/MarginContainer/options"]
-margin_left = 177.0
-margin_top = 159.0
-margin_right = 457.0
-margin_bottom = 183.0
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
-margin_top = 478.0
-margin_right = 1280.0
-margin_bottom = 498.0
-custom_constants/separation = 20
-alignment = 1
-
-[node name="back" type="Button" parent="VBoxContainer/HBoxContainer"]
-margin_left = 549.0
-margin_right = 660.0
-margin_bottom = 20.0
-text = "OPTIONS_BACK"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="apply" type="Button" parent="VBoxContainer/HBoxContainer"]
-margin_left = 680.0
-margin_right = 731.0
-margin_bottom = 20.0
-text = "APPLY"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[connection signal="value_changed" from="VBoxContainer/MarginContainer/options/general_volume" to="." method="_on_general_volume_changed"]
-[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="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/addons/escoria-core/ui_library/menus/pause_menu/pause_menu.gd b/addons/escoria-core/ui_library/menus/pause_menu/pause_menu.gd
deleted file mode 100644
index c25ddf58..00000000
--- a/addons/escoria-core/ui_library/menus/pause_menu/pause_menu.gd
+++ /dev/null
@@ -1,68 +0,0 @@
-# A menu shown in game
-extends Control
-
-
-# Make the pause menu process in pause mode and hide it just to be sure
-func _ready():
- self.pause_mode = Node.PAUSE_MODE_PROCESS
- hide()
-
-
-# Continue the game
-func _on_continue_pressed():
- escoria.main.current_scene.game.unpause_game()
-
-
-# Show the save slots
-func _on_save_game_pressed():
- $VBoxContainer.hide()
- $save_game.show()
-
-
-# Show the load slots
-func _on_load_game_pressed():
- $VBoxContainer.hide()
- $load_game.refresh_savegames()
- $load_game.show()
-
-
-# Show the options menu
-func _on_options_pressed():
- $VBoxContainer.hide()
- $options.show()
-
-
-# Quit the game
-func _on_quit_pressed():
- escoria.quit()
-
-
-# Hide the save slots after clicking back button
-func _on_save_game_back_button_pressed():
- reset()
-
-
-# Hide the load slots after clicking back button
-func _on_load_game_back_button_pressed():
- reset()
-
-
-# Hide options menu after clicking back button
-func _on_options_back_button_pressed():
- reset()
-
-
-# Set whether saving is enabled currently
-#
-# #### Parameters
-# - p_enabled: Enable or disable saving
-func set_save_enabled(p_enabled: bool):
- $VBoxContainer/menuitems/save_game.disabled = !p_enabled
-
-
-# Resets the UI to initial state
-func reset():
- $save_game.hide()
- $load_game.hide()
- $options.hide()
- $VBoxContainer.show()
diff --git a/addons/escoria-core/ui_library/menus/pause_menu/pause_menu.tscn b/addons/escoria-core/ui_library/menus/pause_menu/pause_menu.tscn
deleted file mode 100644
index 3ea98f9b..00000000
--- a/addons/escoria-core/ui_library/menus/pause_menu/pause_menu.tscn
+++ /dev/null
@@ -1,115 +0,0 @@
-[gd_scene load_steps=6 format=2]
-
-[ext_resource path="res://addons/escoria-core/ui_library/menus/pause_menu/pause_menu.gd" type="Script" id=1]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/options/options.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://addons/escoria-core/ui_library/menus/load_save/save/save_game.tscn" type="PackedScene" id=4]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/load_save/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="save_game" parent="." instance=ExtResource( 4 )]
-visible = false
-
-[node name="load_game" parent="." instance=ExtResource( 5 )]
-visible = false
-
-[node name="options" parent="." instance=ExtResource( 2 )]
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-anchor_left = 0.5
-anchor_right = 0.5
-anchor_bottom = 1.0
-margin_left = -308.0
-margin_right = 308.0
-custom_constants/separation = 100
-alignment = 1
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="TextureRect" type="TextureRect" parent="VBoxContainer"]
-margin_top = 147.0
-margin_right = 616.0
-margin_bottom = 383.0
-texture = ExtResource( 3 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="menuitems" type="VBoxContainer" parent="VBoxContainer"]
-margin_top = 483.0
-margin_right = 616.0
-margin_bottom = 753.0
-custom_constants/separation = 10
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="continue" type="Button" parent="VBoxContainer/menuitems"]
-margin_right = 616.0
-margin_bottom = 150.0
-rect_min_size = Vector2( 0, 150 )
-size_flags_vertical = 3
-text = "CONTINUE_GAME"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="save_game" type="Button" parent="VBoxContainer/menuitems"]
-margin_top = 160.0
-margin_right = 616.0
-margin_bottom = 180.0
-size_flags_vertical = 3
-text = "SAVE_GAME"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="load_game" type="Button" parent="VBoxContainer/menuitems"]
-margin_top = 190.0
-margin_right = 616.0
-margin_bottom = 210.0
-size_flags_vertical = 3
-text = "LOAD_GAME"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="options" type="Button" parent="VBoxContainer/menuitems"]
-margin_top = 220.0
-margin_right = 616.0
-margin_bottom = 240.0
-text = "OPTIONS"
-
-[node name="quit" type="Button" parent="VBoxContainer/menuitems"]
-margin_top = 250.0
-margin_right = 616.0
-margin_bottom = 270.0
-size_flags_vertical = 3
-text = "QUIT"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[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"]
-[connection signal="back_button_pressed" from="options" to="." method="_on_options_back_button_pressed"]
-[connection signal="pressed" from="VBoxContainer/menuitems/continue" to="." method="_on_continue_pressed"]
-[connection signal="pressed" from="VBoxContainer/menuitems/save_game" to="." method="_on_save_game_pressed"]
-[connection signal="pressed" from="VBoxContainer/menuitems/load_game" to="." method="_on_load_game_pressed"]
-[connection signal="pressed" from="VBoxContainer/menuitems/options" to="." method="_on_options_pressed"]
-[connection signal="pressed" from="VBoxContainer/menuitems/quit" to="." method="_on_quit_pressed"]
diff --git a/addons/escoria-core/ui_library/tools/hover_stack/hover_stack.gd b/addons/escoria-core/ui_library/tools/hover_stack/hover_stack.gd
deleted file mode 100644
index b5c201cf..00000000
--- a/addons/escoria-core/ui_library/tools/hover_stack/hover_stack.gd
+++ /dev/null
@@ -1,14 +0,0 @@
-extends CanvasLayer
-
-onready var list = $VBoxContainer/hover_stack
-
-func update() -> void:
- for e in list.get_children():
- list.remove_child(e)
- e.queue_free()
- if escoria.inputs_manager.hover_stack.empty():
- return
- for e in escoria.inputs_manager.hover_stack.get_all():
- var l = Label.new()
- l.text = e.global_id
- list.add_child(l)
diff --git a/addons/escoria-core/ui_library/tools/hover_stack/hover_stack.tscn b/addons/escoria-core/ui_library/tools/hover_stack/hover_stack.tscn
deleted file mode 100644
index 9f734d3f..00000000
--- a/addons/escoria-core/ui_library/tools/hover_stack/hover_stack.tscn
+++ /dev/null
@@ -1,27 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-core/ui_library/tools/hover_stack/hover_stack.gd" type="Script" id=1]
-
-[node name="hover_stack_layer" type="CanvasLayer"]
-script = ExtResource( 1 )
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-margin_top = 32.0
-margin_right = 99.0
-margin_bottom = 72.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="title" type="RichTextLabel" parent="VBoxContainer"]
-margin_right = 99.0
-margin_bottom = 18.0
-size_flags_vertical = 3
-bbcode_enabled = true
-bbcode_text = "[u]Hover stack[/u]"
-text = "Hover stack"
-
-[node name="hover_stack" type="VBoxContainer" parent="VBoxContainer"]
-margin_top = 22.0
-margin_right = 99.0
-margin_bottom = 40.0
-size_flags_vertical = 3
diff --git a/addons/escoria-core/ui_library/tools/room_select/room_select.gd b/addons/escoria-core/ui_library/tools/room_select/room_select.gd
deleted file mode 100644
index f43b7922..00000000
--- a/addons/escoria-core/ui_library/tools/room_select/room_select.gd
+++ /dev/null
@@ -1,81 +0,0 @@
-# A small utility to quickly switch to a room while developing
-extends OptionButton
-
-
-# The selected option
-var _selected_id = 0
-
-
-# The path to available rooms
-var _options_paths = []
-
-
-# Build up the list of rooms
-func _ready():
- var rooms_folder = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.ROOM_SELECTOR_ROOM_DIR
- )
- if rooms_folder == "" or \
- not ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.ENABLE_ROOM_SELECTOR
- ):
- return
- 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("%s/%s/%s.tscn" %[
- rooms_folder,
- room,
- room
- ])
-
- else:
- escoria.logger.warn(
- self,
- "A problem occurred while opening rooms folder %s." % str(path)
- )
-
-
-# Switch to the selected room
-func _on_button_pressed():
- # When next room is loaded, we don't want to consider ESC_LAST_SCENE for
- # automatic transitions.
- #Â If FORCE_LAST_SCENE_NULL is True when change_scene starts:
- #Â - ESC_LAST_SCENE is set to empty
- escoria.globals_manager.set_global(
- escoria.room_manager.GLOBAL_FORCE_LAST_SCENE_NULL,
- true,
- true
- )
-
- var script = escoria.esc_compiler.compile([
- ":room_selector",
- "change_scene %s" % _options_paths[_selected_id]
- ],
- get_class()
- )
- escoria.event_manager.interrupt()
- escoria.event_manager.queue_event(script.events['room_selector'])
-
-
-
-# A room was selected, store the selection
-#
-# #### Parameters
-# - index: The index of the selected room in the paths list
-func _on_option_item_selected(index):
- _selected_id = index
diff --git a/addons/escoria-core/ui_library/tools/room_select/room_select.tscn b/addons/escoria-core/ui_library/tools/room_select/room_select.tscn
deleted file mode 100644
index 8c35f79f..00000000
--- a/addons/escoria-core/ui_library/tools/room_select/room_select.tscn
+++ /dev/null
@@ -1,25 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-core/ui_library/tools/room_select/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"]
diff --git a/addons/escoria-dialog-simple/chooser/simple.gd b/addons/escoria-dialog-simple/chooser/simple.gd
deleted file mode 100644
index 278629af..00000000
--- a/addons/escoria-dialog-simple/chooser/simple.gd
+++ /dev/null
@@ -1,100 +0,0 @@
-# A simple dialog chooser that shows selectable lines of text
-# Supports timeout and avatar display
-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)
-
-
-var _no_more_options: bool = false
-
-
-# Hide the chooser at the start just to be safe
-func _ready() -> void:
- hide_chooser()
- pause_mode = PAUSE_MODE_STOP
-
-
-# Process the timeout display
-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
-
-
-# Show the chooser
-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:
- if option.is_valid():
- 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)
- _vbox.add_child(_option_node)
- _option_node.connect("pressed", self, "_on_answer_selected", [
- option
- ])
-
- # If we've no options left, signify as much and start the timer with a
- # very short interval so the appropriate signal can be fired. Note that
- # we have to fire the signal AFTER this method returns as the caller
- # is almost certainly yielding after this method returns.
- if _vbox.get_child_count() == 0:
- _no_more_options = true
- $Timer.start(0.05)
- return
-
- 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)
-
-
-# Hide the chooser
-func hide_chooser():
- $MarginContainer.hide()
-
-
-# An option was choosen, emit the option
-#
-# #### Parameters
-# - option: Option that was chosen
-func _option_chosen(option: ESCDialogOption):
- _remove_avatar()
- $TimerProgress.value = 0
- emit_signal("option_chosen", option)
-
-
-# An option was chosen directly from the list
-#
-# #### Parameters
-# - option: Option that was chosen
-func _on_answer_selected(option: ESCDialogOption):
- _option_chosen(option)
-
-
-# The timeout came and a option was selected
-func _on_Timer_timeout() -> void:
- var option_chosen = null if _no_more_options else self.dialog.options[self.dialog.timeout_option - 1]
- _no_more_options = false
- _option_chosen(option_chosen)
-
-
-# Remove the avatar
-func _remove_avatar():
- if $AvatarContainer.get_child_count() > 0:
- $AvatarContainer.remove_child($AvatarContainer.get_child(0))
diff --git a/addons/escoria-dialog-simple/chooser/simple.tscn b/addons/escoria-dialog-simple/chooser/simple.tscn
deleted file mode 100644
index fe3e0a12..00000000
--- a/addons/escoria-dialog-simple/chooser/simple.tscn
+++ /dev/null
@@ -1,63 +0,0 @@
-[gd_scene load_steps=4 format=2]
-
-[ext_resource path="res://addons/escoria-dialog-simple/chooser/simple.gd" type="Script" id=1]
-
-[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="Control"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-script = ExtResource( 1 )
-
-[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( 94, 68 )
-
-[connection signal="timeout" from="Timer" to="." method="_on_Timer_timeout"]
diff --git a/addons/escoria-dialog-simple/esc_dialog_simple.gd b/addons/escoria-dialog-simple/esc_dialog_simple.gd
deleted file mode 100644
index 64b3dec9..00000000
--- a/addons/escoria-dialog-simple/esc_dialog_simple.gd
+++ /dev/null
@@ -1,213 +0,0 @@
-# A simple dialog manager for Escoria
-extends ESCDialogManager
-
-
-# State machine that governs how the dialog manager behaves
-var state_machine = preload("res://addons/escoria-dialog-simple/esc_dialog_simple_state_machine.gd").new()
-
-# The currently running player
-var _type_player: Node = null
-var _preserved_type_player_type: String = ""
-
-# Reference to the dialog player
-var _dialog_player: Node = null
-
-# Basic state tracking
-var _is_saying: bool = false
-
-# Whether to preserve the next dialog box used by `say`, or, if already
-# preserving a dialog box, whether to continue using that dialog box
-var _should_preserve_dialog_box: bool = false
-
-
-func _ready() -> void:
- add_child(state_machine)
-
-
-# Check whether a specific type is supported by the
-# dialog plugin
-#
-# #### Parameters
-# - type: required type
-# *Returns* Whether the type is supported or not
-func has_type(type: String) -> bool:
- return true if type in ["floating", "avatar"] else false
-
-
-# Check whether a specific chooser type is supported by the
-# dialog plugin
-#
-# #### Parameters
-# - type: required chooser type
-# *Returns* Whether the type is supported or not
-func has_chooser_type(type: String) -> bool:
- return true if type == "simple" else false
-
-
-# Instructs the dialog manager to preserve the next dialog box used by a `say`
-# command until a call to `disable_preserve_dialog_box` is made.
-#
-# This method should be idempotent, i.e. if called after the first time and
-# prior to `disable_preserve_dialog_box` being called, the result should be the
-# same.
-func enable_preserve_dialog_box() -> void:
- _should_preserve_dialog_box = true
-
-
-# Instructs the dialog manager to no longer preserve the currently-preserved
-# dialog box or to not preserve the next dialog box used by a `say` command
-# (this is the default state).
-#
-# This method should be idempotent, i.e. if called after the first time and
-# prior to `enable_preserve_dialog_box` being called, the result should be the
-# same.
-func disable_preserve_dialog_box() -> void:
- _should_preserve_dialog_box = false
-
- if is_instance_valid(_dialog_player) and _dialog_player.get_children().has(_type_player):
- _dialog_player.remove_child(_type_player)
- _preserved_type_player_type = ""
-
-
-# Output a text said by the item specified by the global id. Emit
-# `say_finished` after finishing displaying the text.
-#
-# #### Parameters
-# - dialog_player: Node of the dialog player in the UI
-# - global_id: Global id of the item that is speaking
-# - text: Text to say, optional prefixed by a translation key separated
-# by a ":"
-# - type: Type of dialog box to use
-func say(dialog_player: Node, global_id: String, text: String, type: String):
- _dialog_player = dialog_player
-
- _initialize_say_states(global_id, text, type)
-
- if _should_preserve_dialog_box:
- # If the dialog box type doesn't match what's currently being reused (if anything),
- # we want to remove the old one (if it exists) and then initialize and add the new dialog
- # box type to the dialog player
- if type != _preserved_type_player_type:
- if _dialog_player.get_children().has(_type_player):
- _dialog_player.remove_child(_type_player)
-
- _init_type_player(type)
-
- _preserved_type_player_type = type
- else:
- _init_type_player(type)
-
- state_machine._change_state("say")
-
-# yield(_type_player, "say_finished")
-# if _dialog_player.get_children().has(_type_player):
-# _dialog_player.remove_child(_type_player)
-# emit_signal("say_finished")
-
-
-func do_say(global_id: String, text: String) -> void:
- # Only add_child here in order to prevent _type_player from running its _process method
- # before we're ready, and only if it's necessary
- if not _dialog_player.get_children().has(_type_player):
- _dialog_player.add_child(_type_player)
-
- _type_player.say(global_id, text)
-
-
-func _init_type_player(type: String) -> void:
- if type == "floating":
- _type_player = preload(\
- "res://addons/escoria-dialog-simple/types/floating.tscn"\
- ).instance()
- else:
- _type_player = preload(\
- "res://addons/escoria-dialog-simple/types/avatar.tscn"\
- ).instance()
-
- _type_player.connect("say_finished", self, "_on_say_finished")
- _type_player.connect("say_visible", self, "_on_say_visible")
-
-
-func _initialize_say_states(global_id: String, text: String, type: String) -> void:
- state_machine.states_map["say"].initialize(self, global_id, text, type)
- state_machine.states_map["finish"].initialize(_dialog_player)
- state_machine.states_map["say_fast"].initialize(self)
- state_machine.states_map["say_finish"].initialize(self)
- state_machine.states_map["visible"].initialize(self)
- state_machine.states_map["interrupt"].initialize(self)
-
-
-func _on_say_finished():
- if not _should_preserve_dialog_box and _dialog_player.get_children().has(_type_player):
- _dialog_player.remove_child(_type_player)
-
- _is_saying = false
-
- emit_signal("say_finished")
-
-
-func _on_say_visible():
- emit_signal("say_visible")
-
-
-# Present an option chooser to the player and sends the signal
-# `option_chosen` with the chosen dialog option
-#
-# #### Parameters
-# - dialog_player: Node of the dialog player in the UI
-# - dialog: Information about the dialog to display
-# - type: The dialog chooser type to use
-func choose(dialog_player: Node, dialog: ESCDialog, type: String):
- _dialog_player = dialog_player
-
- state_machine.states_map["choices"].initialize(dialog_player, self, dialog, type)
- state_machine._change_state("choices")
-
-
-func do_choose(dialog_player: Node, dialog: ESCDialog, type: String = "simple"):
- var chooser
-
- if type == "simple" or type == "":
- chooser = preload(\
- "res://addons/escoria-dialog-simple/chooser/simple.tscn"\
- ).instance()
-
- dialog_player.add_child(chooser)
- chooser.set_dialog(dialog)
- chooser.show_chooser()
-
- var option = yield(chooser, "option_chosen")
- dialog_player.remove_child(chooser)
- emit_signal("option_chosen", option)
-
-
-# Trigger running the dialogue faster
-func speedup():
- if is_instance_valid(_type_player):
- _type_player.speedup()
-
-
-# Trigger an instant finish of the current dialog
-func finish():
- if is_instance_valid(_type_player):
- _type_player.finish()
-
-
-# The say command has been interrupted, cancel the dialog display
-func interrupt():
- if _dialog_player.get_children().has(_type_player):
- (
- escoria.object_manager.get_object(escoria.object_manager.SPEECH).node\
- as ESCSpeechPlayer
- ).set_state("off")
-
- if not _should_preserve_dialog_box and _dialog_player.get_children().has(_type_player):
- _dialog_player.remove_child(_type_player)
-
- emit_signal("say_finished")
-
-
-# To be called if voice audio has finished.
-func voice_audio_finished():
- if is_instance_valid(_type_player):
- _type_player.voice_audio_finished()
diff --git a/addons/escoria-dialog-simple/esc_dialog_simple_settings.gd b/addons/escoria-dialog-simple/esc_dialog_simple_settings.gd
deleted file mode 100644
index 8bbf9dba..00000000
--- a/addons/escoria-dialog-simple/esc_dialog_simple_settings.gd
+++ /dev/null
@@ -1,20 +0,0 @@
-extends Resource
-class_name SimpleDialogSettings
-
-const SETTINGS_ROOT = "escoria/dialog_simple"
-
-const AVATARS_PATH = "%s/avatars_path" % SETTINGS_ROOT
-const TEXT_TIME_PER_LETTER_MS = "%s/text_time_per_letter_ms" % SETTINGS_ROOT
-const TEXT_TIME_PER_LETTER_MS_FAST = "%s/text_time_per_fast_letter_ms" % SETTINGS_ROOT
-const READING_SPEED_IN_WPM = "%s/reading_speed_in_wpm" % SETTINGS_ROOT
-const CLEAR_TEXT_BY_CLICK_ONLY = "%s/clear_text_by_click_only" % SETTINGS_ROOT
-const LEFT_CLICK_ACTION = "%s/left_click_action" % SETTINGS_ROOT
-
-const STOP_TALKING_ANIMATION_ON = "%s/stop_talking_animation_on" % SETTINGS_ROOT
-
-const LEFT_CLICK_ACTION_SPEED_UP = "Speed up"
-const LEFT_CLICK_ACTION_INSTANT_FINISH = "Instant finish"
-const LEFT_CLICK_ACTION_NOTHING = "None"
-
-const STOP_TALKING_ANIMATION_ON_END_OF_TEXT = "End of text"
-const STOP_TALKING_ANIMATION_ON_END_OF_AUDIO = "End of audio"
diff --git a/addons/escoria-dialog-simple/esc_dialog_simple_state_machine.gd b/addons/escoria-dialog-simple/esc_dialog_simple_state_machine.gd
deleted file mode 100644
index e2051ad9..00000000
--- a/addons/escoria-dialog-simple/esc_dialog_simple_state_machine.gd
+++ /dev/null
@@ -1,31 +0,0 @@
-extends "res://addons/escoria-dialog-simple/patterns/state_machine/state_machine.gd"
-
-
-func _init():
- _create_states()
- _add_states_to_machine()
-
- current_state_name = "idle"
- START_STATE = states_map[current_state_name]
-
- initialize(START_STATE)
-
-
-# Creates the states for this state machine.
-func _create_states() -> void:
- states_map = {
- "idle": preload("res://addons/escoria-dialog-simple/states/dialog_idle.gd").new(),
- "say": preload("res://addons/escoria-dialog-simple/states/dialog_say.gd").new(),
- "say_fast": preload("res://addons/escoria-dialog-simple/states/dialog_say_fast.gd").new(),
- "say_finish": preload("res://addons/escoria-dialog-simple/states/dialog_say_finish.gd").new(),
- "visible": preload("res://addons/escoria-dialog-simple/states/dialog_visible.gd").new(),
- "finish": preload("res://addons/escoria-dialog-simple/states/dialog_finish.gd").new(),
- "interrupt": preload("res://addons/escoria-dialog-simple/states/dialog_interrupt.gd").new(),
- "choices": preload("res://addons/escoria-dialog-simple/states/dialog_choices.gd").new(),
- }
-
-
-# Adds any created states into the state machine as children.
-func _add_states_to_machine() -> void:
- for key in states_map:
- add_child(states_map[key])
diff --git a/addons/escoria-dialog-simple/patterns/state_machine/state.gd b/addons/escoria-dialog-simple/patterns/state_machine/state.gd
deleted file mode 100644
index 9e928083..00000000
--- a/addons/escoria-dialog-simple/patterns/state_machine/state.gd
+++ /dev/null
@@ -1,31 +0,0 @@
-"""
-Base interface for all states: it doesn't do anything in itself
-but forces us to pass the right arguments to the methods below
-and makes sure every State object had all of these methods.
-"""
-extends Node
-
-
-signal finished(next_state_name)
-
-
-# Initialize the state. E.g. change the animation
-func enter():
- return
-
-
-# Clean up the state. Reinitialize values like a timer
-func exit():
- return
-
-
-func handle_input(_event):
- return
-
-
-func update(_delta):
- return
-
-
-func _on_animation_finished(_anim_name):
- return
diff --git a/addons/escoria-dialog-simple/patterns/state_machine/state_machine.gd b/addons/escoria-dialog-simple/patterns/state_machine/state_machine.gd
deleted file mode 100644
index cd5ab1a1..00000000
--- a/addons/escoria-dialog-simple/patterns/state_machine/state_machine.gd
+++ /dev/null
@@ -1,92 +0,0 @@
-"""
-Base interface for a generic state machine
-It handles initializing, setting the machine active or not
-delegating _physics_process, _input calls to the State nodes,
-and changing the current/active state.
-"""
-extends Node
-
-
-signal state_changed(current_state)
-
-
-"""
-You must set a starting node from the inspector or on
-the node that inherits from this state machine interface
-If you don't the game will crash (on purpose, so you won't
-forget to initialize the state machine)
-"""
-export(NodePath) var START_STATE
-var states_map = {}
-
-var states_stack = [] # can also be used as a pushdown automaton
-var current_state = null
-var current_state_name = ""
-var _active = false setget set_active
-
-
-func initialize(start_state):
- for child in get_children():
- child.connect("finished", self, "_change_state")
-
- set_active(true)
- states_stack.push_front(start_state)
- current_state = states_stack[0]
- current_state.enter()
-
-
-func set_active(value):
- _active = value
- set_physics_process(value)
- set_process_input(value)
- if not _active:
- states_stack = []
- current_state = null
-
-
-func _input(event):
- current_state.handle_input(event)
-
-
-func _physics_process(delta):
- current_state.update(delta)
-
-
-func _on_animation_finished(anim_name):
- if not _active:
- return
- current_state._on_animation_finished(anim_name)
-
-
-func _change_state(state_name):
- if not _active:
- return
-
- escoria.logger.trace(
- self,
- "Dialog State Machine: Changing state from '%s' to '%s'." % [current_state_name, state_name]
- )
-
- current_state.exit()
-
- if state_name == "previous":
- states_stack.pop_front()
- else:
- states_stack[0] = states_map[state_name]
-
- current_state = states_stack[0]
-
- emit_signal("state_changed", current_state)
-
- #if state_name != "previous":
- current_state.enter()
-
- current_state_name = state_name
-
-
-func get_current_state_name():
- for key in states_map.keys():
- if states_map[key] == current_state:
- return key
-
- return null
diff --git a/addons/escoria-dialog-simple/plugin.cfg b/addons/escoria-dialog-simple/plugin.cfg
deleted file mode 100644
index 70cad5aa..00000000
--- a/addons/escoria-dialog-simple/plugin.cfg
+++ /dev/null
@@ -1,7 +0,0 @@
-[plugin]
-
-name="Escoria Simple Dialogs"
-description="Very basic dialogs for Escoria based games"
-author="Escoria project"
-version="0.1.0"
-script="plugin.gd"
diff --git a/addons/escoria-dialog-simple/plugin.gd b/addons/escoria-dialog-simple/plugin.gd
deleted file mode 100644
index 8e49013d..00000000
--- a/addons/escoria-dialog-simple/plugin.gd
+++ /dev/null
@@ -1,149 +0,0 @@
-# A simple dialog manager for Escoria
-tool
-extends EditorPlugin
-
-const MANAGER_CLASS = "res://addons/escoria-dialog-simple/esc_dialog_simple.gd"
-
-const READING_SPEED_IN_WPM_DEFAULT_VALUE = 200
-const TEXT_TIME_PER_LETTER_MS_DEFAULT_VALUE = 100
-const TEXT_TIME_PER_LETTER_MS_FAST_DEFAULT_VALUE = 25
-
-
-var left_click_actions: PoolStringArray = [
- SimpleDialogSettings.LEFT_CLICK_ACTION_SPEED_UP,
- SimpleDialogSettings.LEFT_CLICK_ACTION_INSTANT_FINISH,
- SimpleDialogSettings.LEFT_CLICK_ACTION_NOTHING
-]
-
-var stop_talking_animation_on_options: PoolStringArray = [
- SimpleDialogSettings.STOP_TALKING_ANIMATION_ON_END_OF_TEXT,
- SimpleDialogSettings.STOP_TALKING_ANIMATION_ON_END_OF_AUDIO
-]
-
-
-# Override function to return the plugin name.
-func get_plugin_name():
- return "escoria-dialog-simple"
-
-
-# Unregister ourselves
-func disable_plugin():
- print("Disabling plugin Escoria Dialog Simple")
- ESCProjectSettingsManager.remove_setting(
- ESCProjectSettingsManager.DEFAULT_DIALOG_TYPE
- )
-
- ESCProjectSettingsManager.remove_setting(
- SimpleDialogSettings.AVATARS_PATH
- )
-
- ESCProjectSettingsManager.remove_setting(
- SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS
- )
-
- ESCProjectSettingsManager.remove_setting(
- SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST
- )
-
- ESCProjectSettingsManager.remove_setting(
- SimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY
- )
-
- ESCProjectSettingsManager.remove_setting(
- SimpleDialogSettings.READING_SPEED_IN_WPM
- )
-
- ESCProjectSettingsManager.remove_setting(
- SimpleDialogSettings.LEFT_CLICK_ACTION
- )
-
- ESCProjectSettingsManager.remove_setting(
- SimpleDialogSettings.STOP_TALKING_ANIMATION_ON
- )
-
- EscoriaPlugin.deregister_dialog_manager(MANAGER_CLASS)
-
-
-# Add ourselves to the list of dialog managers
-func enable_plugin():
- print("Enabling plugin Escoria Dialog Simple")
-
- if EscoriaPlugin.register_dialog_manager(self, MANAGER_CLASS):
- ESCProjectSettingsManager.register_setting(
- ESCProjectSettingsManager.DEFAULT_DIALOG_TYPE,
- "floating",
- {
- "type": TYPE_STRING
- }
- )
-
- ESCProjectSettingsManager.register_setting(
- SimpleDialogSettings.AVATARS_PATH,
- "res://game/dialog_avatars",
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_DIR
- }
- )
-
- ESCProjectSettingsManager.register_setting(
- SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS,
- TEXT_TIME_PER_LETTER_MS_DEFAULT_VALUE,
- {
- "type": TYPE_REAL
- }
- )
-
- ESCProjectSettingsManager.register_setting(
- SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST,
- TEXT_TIME_PER_LETTER_MS_FAST_DEFAULT_VALUE,
- {
- "type": TYPE_REAL
- }
- )
-
- ESCProjectSettingsManager.register_setting(
- SimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY,
- false,
- {
- "type": TYPE_BOOL
- }
- )
-
- ESCProjectSettingsManager.register_setting(
- SimpleDialogSettings.READING_SPEED_IN_WPM,
- READING_SPEED_IN_WPM_DEFAULT_VALUE,
- {
- "type": TYPE_INT
- }
- )
-
- var left_click_actions_string: String = left_click_actions.join(",")
-
- ESCProjectSettingsManager.register_setting(
- SimpleDialogSettings.LEFT_CLICK_ACTION,
- SimpleDialogSettings.LEFT_CLICK_ACTION_SPEED_UP,
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_ENUM,
- "hint_string": left_click_actions_string
- }
- )
-
- var stop_talking_animation_on_options_string: String = stop_talking_animation_on_options.join(",")
-
- ESCProjectSettingsManager.register_setting(
- SimpleDialogSettings.STOP_TALKING_ANIMATION_ON,
- SimpleDialogSettings.STOP_TALKING_ANIMATION_ON_END_OF_AUDIO,
- {
- "type": TYPE_STRING,
- "hint": PROPERTY_HINT_ENUM,
- "hint_string": stop_talking_animation_on_options_string
- }
- )
-
- else:
- get_editor_interface().set_plugin_enabled(
- get_plugin_name(),
- false
- )
diff --git a/addons/escoria-dialog-simple/states/dialog_choices.gd b/addons/escoria-dialog-simple/states/dialog_choices.gd
deleted file mode 100644
index 635d6831..00000000
--- a/addons/escoria-dialog-simple/states/dialog_choices.gd
+++ /dev/null
@@ -1,44 +0,0 @@
-extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
-
-
-# The owning dialog player.
-var _dialog_player
-
-# The dialog to start.
-var _dialog: ESCDialog
-var _type: String = "simple"
-
-var _dialog_chooser_ui: ESCDialogManager = null
-
-var _ready_to_choose: bool
-
-
-func initialize(dialog_player, dialog_chooser_ui: ESCDialogManager, dialog: ESCDialog, type: String) -> void:
- _dialog_player = dialog_player
- _dialog_chooser_ui = dialog_chooser_ui
- _dialog = dialog
- _type = type
-
-
-func enter():
- escoria.logger.trace(self, "Dialog State Machine: Entered 'choices'.")
-
- if _dialog.options.empty():
- escoria.logger.error(
- self,
- "Received dialog options array was empty."
- )
-
- _ready_to_choose = true
-
-
-func update(_delta):
- if _ready_to_choose:
- _ready_to_choose = false
- _dialog_chooser_ui.do_choose(_dialog_player, _dialog, _type)
- var option = yield(_dialog_chooser_ui, "option_chosen")
-
- escoria.logger.trace(self, "Dialog State Machine: 'choices' -> 'idle'")
-
- emit_signal("finished", "idle")
- _dialog_player.emit_signal("option_chosen", option)
diff --git a/addons/escoria-dialog-simple/states/dialog_finish.gd b/addons/escoria-dialog-simple/states/dialog_finish.gd
deleted file mode 100644
index 3bdccd76..00000000
--- a/addons/escoria-dialog-simple/states/dialog_finish.gd
+++ /dev/null
@@ -1,19 +0,0 @@
-extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
-
-
-# Owning dialog player
-var _dialog_player
-
-
-func initialize(dialog_player) -> void:
- _dialog_player = dialog_player
-
-
-func enter():
- escoria.logger.trace(self, "Dialog State Machine: Entered 'finish'.")
-
-
-func update(_delta):
- escoria.logger.trace(self, "Dialog State Machine: 'finish' -> 'idle'")
- emit_signal("finished", "idle")
- _dialog_player.emit_signal("say_finished")
diff --git a/addons/escoria-dialog-simple/states/dialog_idle.gd b/addons/escoria-dialog-simple/states/dialog_idle.gd
deleted file mode 100644
index b36d254d..00000000
--- a/addons/escoria-dialog-simple/states/dialog_idle.gd
+++ /dev/null
@@ -1,5 +0,0 @@
-extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
-
-
-func enter():
- escoria.logger.trace(self, "Dialog State Machine: Entered 'idle'.")
diff --git a/addons/escoria-dialog-simple/states/dialog_interrupt.gd b/addons/escoria-dialog-simple/states/dialog_interrupt.gd
deleted file mode 100644
index e9bd54c0..00000000
--- a/addons/escoria-dialog-simple/states/dialog_interrupt.gd
+++ /dev/null
@@ -1,25 +0,0 @@
-extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
-
-
-# Reference to the currently playing dialog manager
-var _dialog_manager: ESCDialogManager = null
-
-
-func initialize(dialog_manager: ESCDialogManager) -> void:
- _dialog_manager = dialog_manager
-
-
-func enter():
- escoria.logger.trace(self, "Dialog State Machine: Entered 'interrupt'.")
-
- if _dialog_manager != null:
- if not _dialog_manager.is_connected("say_finished", self, "_on_say_finished"):
- _dialog_manager.connect("say_finished", self, "_on_say_finished")
-
- _dialog_manager.interrupt()
-
-
-func _on_say_finished() -> void:
- escoria.logger.trace(self, "Dialog State Machine: 'interrupt' -> 'finish'")
- emit_signal("finished", "finish")
-
diff --git a/addons/escoria-dialog-simple/states/dialog_say.gd b/addons/escoria-dialog-simple/states/dialog_say.gd
deleted file mode 100644
index a057f4f3..00000000
--- a/addons/escoria-dialog-simple/states/dialog_say.gd
+++ /dev/null
@@ -1,181 +0,0 @@
-extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
-
-
-# A regular expression that separates the translation key from the text
-const KEYTEXT_REGEX = "^((?[^:]+):)?\"(?.+)\""
-
-
-# Reference to the currently playing dialog manager
-var _dialog_manager: ESCDialogManager = null
-
-# Character that is talking
-var _character: String
-
-# UI to use for the dialog
-var _type: String
-
-# Text to say
-var _text: String
-
-# Regular expression object for the separation of key and text
-var _keytext_regex: RegEx = RegEx.new()
-
-var _ready_to_say: bool
-
-var _stop_talking_animation_on_option: String
-
-
-# Constructor
-func _init() -> void:
- _keytext_regex.compile(KEYTEXT_REGEX)
-
-
-func initialize(dialog_manager: ESCDialogManager, character: String, text: String, type: String) -> void:
- _dialog_manager = dialog_manager
- _character = character
- _text = text
- _type = type
- _stop_talking_animation_on_option = \
- ESCProjectSettingsManager.get_setting(SimpleDialogSettings.STOP_TALKING_ANIMATION_ON)
-
-
-func handle_input(_event):
- if _event is InputEventMouseButton and _event.pressed:
- if escoria.inputs_manager.input_mode != \
- escoria.inputs_manager.INPUT_NONE and \
- _dialog_manager != null:
-
- var left_click_action = ESCProjectSettingsManager.get_setting(SimpleDialogSettings.LEFT_CLICK_ACTION)
-
- _handle_left_click_action(left_click_action)
-
-
-func _handle_left_click_action(left_click_action: String) -> void:
- match left_click_action:
- SimpleDialogSettings.LEFT_CLICK_ACTION_SPEED_UP:
- if _dialog_manager.is_connected("say_visible", self, "_on_say_visible"):
- _dialog_manager.disconnect("say_visible", self, "_on_say_visible")
-
- escoria.logger.trace(self, "Dialog State Machine: 'say' -> 'say_fast'")
- emit_signal("finished", "say_fast")
- SimpleDialogSettings.LEFT_CLICK_ACTION_INSTANT_FINISH:
- if _dialog_manager.is_connected("say_visible", self, "_on_say_visible"):
- _dialog_manager.disconnect("say_visible", self, "_on_say_visible")
-
- escoria.logger.trace(self, "Dialog State Machine: 'say' -> 'say_finish'")
- emit_signal("finished", "say_finish")
-
- get_tree().set_input_as_handled()
-
-
-func enter():
- escoria.logger.trace(self, "Dialog State Machine: Entered 'say'.")
-
- if not _dialog_manager.is_connected("say_visible", self, "_on_say_visible"):
- _dialog_manager.connect("say_visible", self, "_on_say_visible")
-
- var matches = _keytext_regex.search(_text)
-
- if not matches:
- escoria.logger.error(
- self,
- "Unexpected text encountered: %s." % _text
- )
-
- var key = matches.get_string("key")
-
- if matches.get_string("key") != "":
- var _speech_resource = _get_voice_file(
- matches.get_string("key")
- )
-
- if _speech_resource == "":
- escoria.logger.warn(
- self,
- "Unable to find voice file with key '%s'." % matches.get_string("key")
- )
- else:
- (
- escoria.object_manager.get_object(escoria.object_manager.SPEECH).node\
- as ESCSpeechPlayer
- ).set_state(_speech_resource)
-
- if _stop_talking_animation_on_option == SimpleDialogSettings.STOP_TALKING_ANIMATION_ON_END_OF_AUDIO:
- if not (
- escoria.object_manager.get_object(escoria.object_manager.SPEECH).node\
- as ESCSpeechPlayer
- ).stream.is_connected("finished", self, "_on_audio_finished"):
-
- (
- escoria.object_manager.get_object(escoria.object_manager.SPEECH).node\
- as ESCSpeechPlayer
- ).stream.connect("finished", self, "_on_audio_finished")
-
- var translated_text: String = tr(matches.get_string("key"))
-
- # Only update the text if the translated text was found; otherwise, raise
- # a warning and use the original, untranslated text.
- if translated_text == matches.get_string("key"):
- escoria.logger.warn(
- self,
- "Unable to find translation key '%s'. Using untranslated text." % matches.get_string("key")
- )
- _text = matches.get_string("text")
- else:
- _text = translated_text
- else:
- _text = matches.get_string("text")
-
- _ready_to_say = true
-
-
-func update(_delta):
- if _ready_to_say:
- _dialog_manager.do_say(_character, _text)
- _ready_to_say = false
-
-
-# Find the matching voice output file for the given key
-#
-# #### Parameters
-#
-# - key: Text key provided
-# - start: Starting folder to search for voices
-#
-# *Returns* The path to the matching voice file
-func _get_voice_file(key: String, start: String = "") -> String:
- if start == "":
- start = ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.SPEECH_FOLDER
- )
- var _dir = Directory.new()
- if _dir.open(start) == OK:
- _dir.list_dir_begin(true, true)
- var file_name = _dir.get_next()
- while file_name != "":
- if _dir.current_is_dir():
- var _voice_file = _get_voice_file(
- key,
- start.plus_file(file_name)
- )
- if _voice_file != "":
- return _voice_file
- else:
- if file_name == "%s.%s.import" % [
- key,
- ESCProjectSettingsManager.get_setting(
- ESCProjectSettingsManager.SPEECH_EXTENSION
- )
- ]:
- return start.plus_file(file_name.trim_suffix(".import"))
- file_name = _dir.get_next()
- return ""
-
-
-func _on_say_visible() -> void:
- escoria.logger.trace(self, "Dialog State Machine: 'say' -> 'visible'")
- emit_signal("finished", "visible")
-
-
-func _on_audio_finished() -> void:
- _dialog_manager.voice_audio_finished()
diff --git a/addons/escoria-dialog-simple/states/dialog_say_fast.gd b/addons/escoria-dialog-simple/states/dialog_say_fast.gd
deleted file mode 100644
index f0cfaa44..00000000
--- a/addons/escoria-dialog-simple/states/dialog_say_fast.gd
+++ /dev/null
@@ -1,29 +0,0 @@
-extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
-
-
-# Reference to the currently playing dialog manager
-var _dialog_manager: ESCDialogManager = null
-
-
-func initialize(dialog_manager: ESCDialogManager) -> void:
- _dialog_manager = dialog_manager
-
-
-func enter():
- escoria.logger.trace(self, "Dialog State Machine: Entered 'say_fast'.")
-
- if escoria.inputs_manager.input_mode != \
- escoria.inputs_manager.INPUT_NONE and \
- _dialog_manager != null:
-
- if not _dialog_manager.is_connected("say_visible", self, "_on_say_visible"):
- _dialog_manager.connect("say_visible", self, "_on_say_visible")
-
- _dialog_manager.speedup()
- else:
- escoria.logger.error(self, "Illegal state.")
-
-
-func _on_say_visible() -> void:
- escoria.logger.trace(self, "Dialog State Machine: 'say_fast' -> 'visible'")
- emit_signal("finished", "visible")
diff --git a/addons/escoria-dialog-simple/states/dialog_say_finish.gd b/addons/escoria-dialog-simple/states/dialog_say_finish.gd
deleted file mode 100644
index ac3efe44..00000000
--- a/addons/escoria-dialog-simple/states/dialog_say_finish.gd
+++ /dev/null
@@ -1,29 +0,0 @@
-extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
-
-
-# Reference to the currently playing dialog manager
-var _dialog_manager: ESCDialogManager = null
-
-
-func initialize(dialog_manager: ESCDialogManager) -> void:
- _dialog_manager = dialog_manager
-
-
-func enter():
- escoria.logger.trace(self, "Dialog State Machine: Entered 'say_finish'.")
-
- if escoria.inputs_manager.input_mode != \
- escoria.inputs_manager.INPUT_NONE and \
- _dialog_manager != null:
-
- if not _dialog_manager.is_connected("say_visible", self, "_on_say_visible"):
- _dialog_manager.connect("say_visible", self, "_on_say_visible")
-
- _dialog_manager.finish()
- else:
- escoria.logger.error(self, "Illegal state.")
-
-
-func _on_say_visible() -> void:
- escoria.logger.trace(self, "Dialog State Machine: 'say_finish' -> 'visible'")
- emit_signal("finished", "visible")
diff --git a/addons/escoria-dialog-simple/states/dialog_visible.gd b/addons/escoria-dialog-simple/states/dialog_visible.gd
deleted file mode 100644
index f340d174..00000000
--- a/addons/escoria-dialog-simple/states/dialog_visible.gd
+++ /dev/null
@@ -1,34 +0,0 @@
-extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
-
-
-# Reference to the currently playing dialog manager
-var _dialog_manager: ESCDialogManager = null
-
-
-func initialize(dialog_manager: ESCDialogManager) -> void:
- _dialog_manager = dialog_manager
-
-
-func enter():
- escoria.logger.trace(self, "Dialog State Machine: Entered 'visible'.")
-
- if not _dialog_manager.is_connected("say_finished", self, "_on_say_finished"):
- _dialog_manager.connect("say_finished", self, "_on_say_finished")
-
-
-func handle_input(_event):
- if _event is InputEventMouseButton and _event.pressed:
- if escoria.inputs_manager.input_mode != \
- escoria.inputs_manager.INPUT_NONE:
-
- if _dialog_manager.is_connected("say_finished", self, "_on_say_finished"):
- _dialog_manager.disconnect("say_finished", self, "_on_say_finished")
-
- emit_signal("finished", "interrupt")
- get_tree().set_input_as_handled()
-
-
-# Handles the end of a say function after it has emitted say_finished.
-func _on_say_finished():
- escoria.logger.trace(self, "Dialog State Machine: 'visible' -> 'finish'")
- emit_signal("finished", "finish")
diff --git a/addons/escoria-dialog-simple/types/avatar.gd b/addons/escoria-dialog-simple/types/avatar.gd
deleted file mode 100644
index 284afb13..00000000
--- a/addons/escoria-dialog-simple/types/avatar.gd
+++ /dev/null
@@ -1,242 +0,0 @@
-# A dialog GUI showing a dialog box and character portraits
-extends Popup
-
-
-# Signal emitted when text has been said
-signal say_finished
-
-# Signal emitted when text has just become fully visible
-signal say_visible
-
-
-# The text speed per character for normal display
-var _text_time_per_character: float
-
-# The text speed per character if the dialog line is skipped
-var _fast_text_time_per_character: float
-
-# The reading speed to be used in determining the length of time text remains
-# on the screen.
-var _reading_speed_in_wpm: int
-
-# Used to extract words from lines of text.
-var _word_regex: RegEx = RegEx.new()
-
-# Whether the current dialog is speeding up
-var _is_speeding_up: bool = false
-
-# The current line of text being displayed.
-var _current_line: String
-
-
-# The node holding the avatar
-onready var avatar_node = $Panel/MarginContainer/HSplitContainer/VBoxContainer\
- /avatar
-
-# The node showing the text
-onready var text_node = $Panel/MarginContainer/HSplitContainer/text
-
-# The tween node for text animations
-onready var tween = $Panel/MarginContainer/HSplitContainer/text/Tween
-
-# Whether the dialog manager is paused
-onready var is_paused: bool = true
-
-
-
-# Build up the UI
-func _ready():
- _text_time_per_character = ProjectSettings.get_setting(
- SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS
- )
-
- if _text_time_per_character < 0:
- escoria.logger.warn(
- self,
- "%s setting must be a non-negative number. Will use default value of %s." %
- [
- SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS,
- SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_DEFAULT_VALUE
- ]
- )
-
- _text_time_per_character = SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_DEFAULT_VALUE
-
- _fast_text_time_per_character = ProjectSettings.get_setting(
- SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST
- )
-
- if _fast_text_time_per_character < 0:
- escoria.logger.warn(
- self,
- "%s setting must be a non-negative number. Will use default value of %s." %
- [
- SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST,
- SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST_DEFAULT_VALUE
- ]
- )
-
- _fast_text_time_per_character = SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST_DEFAULT_VALUE
-
- _reading_speed_in_wpm = ProjectSettings.get_setting(
- SimpleDialogSettings.READING_SPEED_IN_WPM
- )
-
- if _reading_speed_in_wpm <= 0:
- escoria.logger.warn(
- self,
- "%s setting must be a positive number. Will use default value of %s." %
- [
- SimpleDialogSettings.READING_SPEED_IN_WPM,
- SimpleDialogSettings.READING_SPEED_IN_WPM_DEFAULT_VALUE
- ]
- )
-
- _reading_speed_in_wpm = SimpleDialogSettings.READING_SPEED_IN_WPM_DEFAULT_VALUE
-
- _word_regex.compile("\\S+")
-
- text_node.bbcode_enabled = true
- tween.connect(
- "tween_completed",
- self,
- "_on_dialog_line_typed"
- )
-
- escoria.connect("paused", self, "_on_paused")
- escoria.connect("resumed", self, "_on_resumed")
-
- connect("tree_exited", self, "_on_tree_exited")
-
-
-# Switch the current character
-#
-# #### Parameters
-# - name: The name of the current character
-func set_current_character(name: String):
- if ProjectSettings.get_setting("escoria/dialog_simple/avatars_path").empty():
- escoria.logger.warn(self, "Unable to load avatar '%s': Avatar path not specified" % name)
- return
-
- var avatar = "%s/%s.tres" % [
- ProjectSettings.get_setting("escoria/dialog_simple/avatars_path"),
- name
- ]
- if ResourceLoader.exists(avatar):
- avatar_node.texture = ResourceLoader.load(avatar)
-
- if avatar_node.texture is AnimatedTexture:
- avatar_node.texture.current_frame = 0
- avatar_node.texture.pause = false
- else:
- escoria.logger.warn(self, "Unable to load avatar '%s': Resource not found in path '%s'" %
- [name, ProjectSettings.get_setting("escoria/dialog_simple/avatars_path")])
-
-
-# Make a character say something
-#
-# #### Parameters
-# - character: The global id of the character speaking
-# - line: Line to say
-func say(character: String, line: String):
- _current_line = line
-
- _is_speeding_up = false
- popup_centered()
- set_current_character(character)
-
- text_node.bbcode_text = tr(line)
-
- text_node.percent_visible = 0.0
- var time_show_full_text = _text_time_per_character / 1000 * len(line)
-
- tween.interpolate_property(text_node, "percent_visible",
- 0.0, 1.0, time_show_full_text,
- Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
- tween.start()
-
-
-# Called by the dialog player when the
-func speedup():
- if not _is_speeding_up:
- _is_speeding_up = true
- var time_show_full_text = _fast_text_time_per_character / 1000 * len(_current_line)
- tween.remove_all()
- tween.interpolate_property(text_node, "percent_visible",
- text_node.percent_visible, 1.0, time_show_full_text,
- Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
- tween.start()
-
-
-# Called by the dialog player when user wants to finish dialogue immediately.
-func finish():
- tween.remove_all()
- tween.interpolate_property(text_node, "percent_visible",
- text_node.percent_visible, 1.0, 0.0)
- tween.start()
-
-
-# To be called if voice audio has finished.
-func voice_audio_finished():
- if avatar_node and avatar_node.texture:
- avatar_node.texture.current_frame = 0
- avatar_node.texture.pause = true
-
-
-# The dialog line was printed, start the waiting time and then finish
-# the dialog
-func _on_dialog_line_typed(object, key):
- if avatar_node.texture is AnimatedTexture:
- avatar_node.texture.current_frame = 0
- avatar_node.texture.pause = true
-
- text_node.visible_characters = -1
-
- var time_to_disappear: float = _calculate_time_to_disappear()
-
- if not $Timer.is_connected("timeout", self, "_on_dialog_finished"):
- $Timer.connect("timeout", self, "_on_dialog_finished")
-
- $Timer.start(time_to_disappear)
-
- emit_signal("say_visible")
-
-
-func _calculate_time_to_disappear() -> float:
- return (_get_number_of_words() / _reading_speed_in_wpm as float) * 60
-
-
-func _get_number_of_words() -> int:
- return _word_regex.search_all(text_node.get_text()).size()
-
-
-# Ending the dialog
-func _on_dialog_finished():
- $Timer.stop()
-
- # Only trigger to clear the text if we aren't limiting the clearing trigger to a click.
- if not ESCProjectSettingsManager.get_setting(SimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY):
- emit_signal("say_finished")
-
-
-# Handler managing pause notification from Escoria
-func _on_paused():
- if tween.is_active():
- is_paused = true
- tween.stop_all()
-
-
-# Handler managing resume notification from Escoria
-func _on_resumed():
- if not tween.is_active():
- # We can't rely on "show()" to make an invisible popup reappear, as per the docs for
- # CanvasItem. Instead, we need to use one of the popup_* methods.
- if is_inside_tree():
- popup_centered()
-
- is_paused = false
- tween.resume_all()
-
-
-func _on_tree_exited():
- queue_free()
diff --git a/addons/escoria-dialog-simple/types/avatar.tscn b/addons/escoria-dialog-simple/types/avatar.tscn
deleted file mode 100644
index 282ea329..00000000
--- a/addons/escoria-dialog-simple/types/avatar.tscn
+++ /dev/null
@@ -1,68 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-dialog-simple/types/avatar.gd" type="Script" id=1]
-
-[node name="dialog_box" type="Popup"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-margin_right = -782.0
-margin_bottom = -734.0
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="Timer" type="Timer" parent="."]
-
-[node name="Panel" type="Panel" parent="."]
-anchor_right = 1.0
-anchor_bottom = 1.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="MarginContainer" type="MarginContainer" parent="Panel"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-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="Panel/MarginContainer"]
-margin_left = 20.0
-margin_top = 20.0
-margin_right = 478.0
-margin_bottom = 146.0
-custom_constants/separation = 35
-dragger_visibility = 1
-
-[node name="VBoxContainer" type="VBoxContainer" parent="Panel/MarginContainer/HSplitContainer"]
-margin_right = 88.0
-margin_bottom = 126.0
-size_flags_horizontal = 3
-size_flags_stretch_ratio = 0.3
-
-[node name="avatar" type="TextureRect" parent="Panel/MarginContainer/HSplitContainer/VBoxContainer"]
-margin_right = 88.0
-margin_bottom = 108.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-expand = true
-
-[node name="text" type="RichTextLabel" parent="Panel/MarginContainer/HSplitContainer"]
-margin_left = 123.0
-margin_right = 458.0
-margin_bottom = 126.0
-size_flags_horizontal = 3
-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="Panel/MarginContainer/HSplitContainer/text"]
diff --git a/addons/escoria-dialog-simple/types/floating.gd b/addons/escoria-dialog-simple/types/floating.gd
deleted file mode 100644
index 29c4472a..00000000
--- a/addons/escoria-dialog-simple/types/floating.gd
+++ /dev/null
@@ -1,268 +0,0 @@
-# A dialog UI using a label above the head of the character
-extends RichTextLabel
-
-
-# Signal emitted when text has been said
-signal say_finished
-
-# Signal emitted when text has just become fully visible
-signal say_visible
-
-
-# The text speed per character for normal display
-var _text_time_per_character: float
-
-# The text speed per character if the dialog line is skipped
-var _fast_text_time_per_character: float
-
-# The reading speed to be used in determining the length of time text remains
-# on the screen.
-var _reading_speed_in_wpm: int
-
-# Used to extract words from lines of text.
-var _word_regex: RegEx = RegEx.new()
-
-
-# Current character speaking, to keep track of reference for animation purposes
-var _current_character
-
-# Whether the current dialog is speeding up
-var _is_speeding_up: bool = false
-
-# The current line of text being displayed.
-var _current_line: String
-
-
-# Tween node for text animation
-onready var tween: Tween = $Tween
-
-# The node showing the text
-onready var text_node: RichTextLabel = self
-
-# Whether the dialog manager is paused
-onready var is_paused: bool = true
-
-
-# Enable bbcode and catch the signal when a tween completed
-func _ready():
- _text_time_per_character = ProjectSettings.get_setting(
- RTMISimpleDialogSettings.TEXT_TIME_PER_LETTER_MS
- )
-
- if _text_time_per_character < 0:
- escoria.logger.warn(
- self,
- "%s setting must be a non-negative number. Will use default value of %s." %
- [
- RTMISimpleDialogSettings.TEXT_TIME_PER_LETTER_MS,
- RTMISimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_DEFAULT_VALUE
- ]
- )
-
- _text_time_per_character = RTMISimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_DEFAULT_VALUE
-
- _fast_text_time_per_character = ProjectSettings.get_setting(
- RTMISimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST
- )
-
- if _fast_text_time_per_character < 0:
- escoria.logger.warn(
- self,
- "%s setting must be a non-negative number. Will use default value of %s." %
- [
- SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST,
- SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST_DEFAULT_VALUE
- ]
- )
-
- _fast_text_time_per_character = RTMISimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST_DEFAULT_VALUE
-
- _reading_speed_in_wpm = ProjectSettings.get_setting(
- RTMISimpleDialogSettings.READING_SPEED_IN_WPM
- )
-
- if _reading_speed_in_wpm <= 0:
- escoria.logger.warn(
- self,
- "%s setting must be a positive number. Will use default value of %s." %
- [
- RTMISimpleDialogSettings.READING_SPEED_IN_WPM,
- RTMISimpleDialogSettings.READING_SPEED_IN_WPM_DEFAULT_VALUE
- ]
- )
-
- _reading_speed_in_wpm = RTMISimpleDialogSettings.READING_SPEED_IN_WPM_DEFAULT_VALUE
-
- _word_regex.compile("\\S+")
-
- bbcode_enabled = true
- $Tween.connect("tween_completed", self, "_on_dialog_line_typed")
-
- connect("tree_exiting", self, "_on_tree_exiting")
-
- escoria.connect("paused", self, "_on_paused")
- escoria.connect("resumed", self, "_on_resumed")
-
- _current_line = ""
-
-
-func _process(delta):
- if _current_character.is_inside_tree() and \
- _current_character.has_node("dialog_position"):
- # Position the RichTextLabel on the character's dialog position, if any.
- rect_position = _current_character.get_node("dialog_position") \
- .get_global_transform_with_canvas().origin
- rect_position.x -= rect_size.x / 2
-
- _account_for_margin_x()
-
- _account_for_margin_y()
-
-
-# Make a character say something
-#
-# #### Parameters
-# - character: The global id of the character speaking
-# - line: Line to say
-func say(character: String, line: String) :
- _current_line = line
-
- show()
-
- _is_speeding_up = false
-
- # Position the RichTextLabel on the character's dialog position, if any.
- _current_character = escoria.object_manager.get_object(character).node
-
- # Set text color to color set in the actor
- var text_color = _current_character.dialog_color
- var text_color_html = text_color.to_html(false)
-
- text_node.bbcode_text = "[center][color=#" + text_color_html + "]" \
- .format([text_color_html]) + tr(line) + "[/color][center]"
-
- if _current_character.is_inside_tree() and \
- _current_character.has_node("dialog_position"):
- rect_position = _current_character.get_node(
- "dialog_position"
- ).get_global_transform_with_canvas().origin
- rect_position.x -= rect_size.x / 2
- else:
- rect_position.x = 0
- rect_size.x = ProjectSettings.get_setting("display/window/size/width")
-
- _account_for_margin_x()
-
- _account_for_margin_y()
-
- _current_character.start_talking()
-
- text_node.percent_visible = 0.0
- var time_show_full_text = _text_time_per_character / 1000 * len(_current_line)
-
- tween.interpolate_property(text_node, "percent_visible",
- 0.0, 1.0, time_show_full_text,
- Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
- tween.start()
- set_process(true)
-
-
-# Called by the dialog player when user wants to finish dialogue fast.
-func speedup():
- if not _is_speeding_up:
- _is_speeding_up = true
- var time_show_full_text = _fast_text_time_per_character / 1000 * len(_current_line)
-
- tween.remove_all()
- tween.interpolate_property(text_node, "percent_visible",
- text_node.percent_visible, 1.0, time_show_full_text,
- Tween.TRANS_LINEAR, Tween.EASE_IN_OUT)
- tween.start()
-
-
-# Called by the dialog player when user wants to finish dialogue immediately.
-func finish():
- tween.remove_all()
- tween.interpolate_property(text_node, "percent_visible",
- text_node.percent_visible, 1.0, 0.0)
- tween.start()
-
-
-# To be called if voice audio has finished.
-func voice_audio_finished():
- _stop_character_talking()
-
-
-# The dialog line was printed, start the waiting time and then finish
-# the dialog
-func _on_dialog_line_typed(object, key):
- _stop_character_talking()
- text_node.visible_characters = -1
-
- var time_to_disappear: float = _calculate_time_to_disappear()
- $Timer.start(time_to_disappear)
- $Timer.connect("timeout", self, "_on_dialog_finished")
-
- emit_signal("say_visible")
-
-
-func _calculate_time_to_disappear() -> float:
- return (_get_number_of_words() / _reading_speed_in_wpm as float) * 60
-
-
-func _get_number_of_words() -> int:
- return _word_regex.search_all(text_node.get_text()).size()
-
-
-# Ending the dialog
-func _on_dialog_finished():
- # Only trigger to clear the text if we aren't limiting the clearing trigger to a click.
- if not ESCProjectSettingsManager.get_setting(RTMISimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY):
- emit_signal("say_finished")
-
-
-# Handler managing pause notification from Escoria
-func _on_paused():
- if tween.is_active():
- is_paused = true
- tween.stop_all()
-
-
-# Handler managing resume notification from Escoria
-func _on_resumed():
- if not tween.is_active():
- is_paused = false
- tween.resume_all()
-
-
- # Handler to deal with this node being removed
-func _on_tree_exiting() -> void:
- _stop_character_talking()
-
-
-func _stop_character_talking():
- #Â Make the speaking item animation stop talking, if it is still alive
- if is_instance_valid(_current_character) and _current_character != null:
- _current_character.stop_talking()
-
-
-func _account_for_margin_x() -> void:
- if rect_position.x < 0:
- rect_position.x = 0
-
- var screen_margin_x = rect_position.x + rect_size.x - \
- ProjectSettings.get("display/window/size/width")
-
- if screen_margin_x > 0:
- rect_position.x -= screen_margin_x
-
-
-func _account_for_margin_y() -> void:
- if rect_position.y < 0:
- rect_position.y = 0
-
- var screen_margin_y = rect_position.y + rect_size.y - \
- ProjectSettings.get("display/window/size/height")
-
- if screen_margin_y > 0:
- rect_position.y -= screen_margin_y
diff --git a/addons/escoria-dialog-simple/types/floating.tscn b/addons/escoria-dialog-simple/types/floating.tscn
deleted file mode 100644
index 6dad6a51..00000000
--- a/addons/escoria-dialog-simple/types/floating.tscn
+++ /dev/null
@@ -1,19 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-dialog-simple/types/floating.gd" type="Script" id=1]
-
-[node name="dialog_label" type="RichTextLabel"]
-margin_right = 643.0
-margin_bottom = 60.0
-bbcode_enabled = true
-bbcode_text = "[center]Here be some text.[/center]"
-text = "Here be some text."
-fit_content_height = true
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="Tween" type="Tween" parent="."]
-
-[node name="Timer" type="Timer" parent="."]
diff --git a/addons/escoria-ui-9verbs/fonts/caslonantique.tres b/addons/escoria-ui-9verbs/fonts/caslonantique.tres
deleted file mode 100644
index 17dc9e83..00000000
--- a/addons/escoria-ui-9verbs/fonts/caslonantique.tres
+++ /dev/null
@@ -1,7 +0,0 @@
-[gd_resource type="DynamicFont" load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-ui-9verbs/fonts/caslonantique.ttf" type="DynamicFontData" id=1]
-
-[resource]
-size = 21
-font_data = ExtResource( 1 )
diff --git a/addons/escoria-ui-9verbs/fonts/caslonantique.ttf b/addons/escoria-ui-9verbs/fonts/caslonantique.ttf
deleted file mode 100755
index eec6f639..00000000
Binary files a/addons/escoria-ui-9verbs/fonts/caslonantique.ttf and /dev/null differ
diff --git a/addons/escoria-ui-9verbs/game.gd b/addons/escoria-ui-9verbs/game.gd
deleted file mode 100644
index 6057172b..00000000
--- a/addons/escoria-ui-9verbs/game.gd
+++ /dev/null
@@ -1,380 +0,0 @@
-extends ESCGame
-
-
-const VERB_USE = "use"
-
-
-"""
-Implement methods to react to inputs.
-
-- left_click_on_bg(position: Vector2)
-- right_click_on_bg(position: Vector2)
-- left_double_click_on_bg(position: Vector2)
-
-- element_focused(element_id: String)
-- element_unfocused()
-
-- left_click_on_item(item_global_id: String, event: InputEvent)
-- right_click_on_item(item_global_id: String, event: InputEvent)
-- left_double_click_on_item(item_global_id: String, event: InputEvent)
-
-- left_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent)
-- right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent)
-- left_double_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent)
-- inventory_item_focused(inventory_item_global_id: String)
-- inventory_item_unfocused()
-- open_inventory()
-- close_inventory()
-
-- mousewheel_action(direction: int)
-
-- hide_ui()
-- show_ui()
-
-- pause_game()
-- unpause_game()
-- show_main_menu()
-- hide_main_menu()
-
-- apply_custom_settings()
-
-- _on_event_done(event_name: String)
-"""
-
-onready var verbs_menu = $ui/Control/panel_down/VBoxContainer/HBoxContainer\
- /VerbsMargin/verbs_menu
-onready var tooltip = $ui/Control/panel_down/VBoxContainer/MarginContainer\
- /tooltip
-onready var inventory_ui = $ui/Control/panel_down/VBoxContainer/HBoxContainer\
- /InventoryMargin/inventory_ui
-var room_select
-
-func _enter_tree():
- var room_selector_parent = $ui/Control/panel_down/VBoxContainer\
- /HBoxContainer/MainMargin/VBoxContainer
-
- if ProjectSettings.get_setting(ESCProjectSettingsManager.ENABLE_ROOM_SELECTOR) and \
- room_selector_parent.get_node_or_null("room_select") == null:
- room_select = preload(
- "res://addons/escoria-core/ui_library/tools/room_select" +\
- "/room_select.tscn"
- ).instance()
- room_selector_parent.add_child(room_select)
-
-
-##Â BACKGROUND ##
-
-func left_click_on_bg(position: Vector2) -> void:
- if escoria.main.current_scene.player:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.BACKGROUND_CLICK,
- [escoria.main.current_scene.player.global_id, position],
- true
- )
- escoria.action_manager.clear_current_action()
- escoria.action_manager.clear_current_tool()
- tooltip.clear()
- verbs_menu.unselect_actions()
-
-
-func right_click_on_bg(position: Vector2) -> void:
- if escoria.main.current_scene.player:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.BACKGROUND_CLICK,
- [escoria.main.current_scene.player.global_id, position],
- true
- )
- escoria.action_manager.clear_current_action()
- escoria.action_manager.clear_current_tool()
- tooltip.clear()
- verbs_menu.unselect_actions()
-
-
-func left_double_click_on_bg(position: Vector2) -> void:
- if escoria.main.current_scene.player:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.BACKGROUND_CLICK,
- [escoria.main.current_scene.player.global_id, position, true],
- true
- )
- escoria.action_manager.clear_current_action()
- verbs_menu.unselect_actions()
-
-
-##Â ITEM FOCUS ##
-
-func element_focused(element_id: String) -> void:
- var target_obj = escoria.object_manager.get_object(element_id).node
-
- match escoria.action_manager.action_state:
- #Â Don't change the tooltip if an action input is completed
- #Â (ie verb+item(+target)) because the action is now being executed
- # and the tooltip is already set because the item was focused
- # (see element_focused() and inventory_item_focused())
- ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
- return
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM:
- tooltip.set_target(target_obj.tooltip_name)
-
- #Â Hovering an ESCItem highlights its default action
- if escoria.action_manager.current_action != VERB_USE \
- and target_obj is ESCItem:
- verbs_menu.set_by_name(target_obj.default_action)
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
- tooltip.set_target(target_obj.tooltip_name)
-
- verbs_menu.set_by_name(escoria.action_manager.current_action)
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
- tooltip.set_target2(target_obj.tooltip_name)
-
-
-func element_unfocused() -> void:
- match escoria.action_manager.action_state:
- #Â Don't change the tooltip if an action input is completed
- #Â (ie verb+item(+target)) because the action is now being executed
- # and the tooltip is already set because the item was focused
- # (see element_focused() and inventory_item_focused())
- ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
- return
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
- tooltip.set_target("")
- verbs_menu.unselect_actions()
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
- tooltip.set_target2("")
-
-
-
-## ITEMS ##
-func left_click_on_item(item_global_id: String, event: InputEvent) -> void:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
- [item_global_id, event],
- true
- )
-
- var target_obj = escoria.object_manager.get_object(
- item_global_id
- ).node
-
- match escoria.action_manager.action_state:
- #Â Don't change the tooltip if an action input is completed
- #Â (ie verb+item(+target)) because the action is now being executed
- # and the tooltip is already set because the item was focused
- # (see element_focused() and inventory_item_focused())
- ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
- return
-
- # Just clicked on the item
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
- tooltip.set_target(target_obj.tooltip_name)
-
- #Â Clicked on item and now we're awaiting a target item
- # This means we clicked the tool and we now need a target
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
- tooltip.set_target(target_obj.tooltip_name, true)
-
-
-
-func right_click_on_item(item_global_id: String, event: InputEvent) -> void:
- element_focused(item_global_id)
- var object = escoria.object_manager.get_object(item_global_id)
- if object != null:
- verbs_menu.set_by_name(object.node.default_action)
-
- if verbs_menu.selected_action == null:
- return
-
- escoria.action_manager.set_current_action(verbs_menu.selected_action)
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_RIGHT_CLICK,
- [item_global_id, event],
- true
- )
-
-
-func left_double_click_on_item(item_global_id: String, event: InputEvent) -> void:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
- [item_global_id, event],
- true
- )
-
-
-## INVENTORY ##
-func left_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
- [inventory_item_global_id, event]
- )
-
- var target_obj = escoria.object_manager.get_object(
- inventory_item_global_id
- ).node
-
- match escoria.action_manager.action_state:
- #Â Don't change the tooltip if an action input is completed
- #Â (ie verb+item(+target)) because the action is now being executed
- # and the tooltip is already set because the item was focused
- # (see element_focused() and inventory_item_focused())
- ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
- return
-
- # Just clicked on the inventory item: do nothing special
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
- return
-
- #Â Clicked on inventory item and now we're awaiting a target item
- # This means we clicked the tool and we now need a target
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
- tooltip.set_target(target_obj.tooltip_name, true)
-
-
-func right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void:
- escoria.action_manager.set_current_action(verbs_menu.selected_action)
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_RIGHT_CLICK,
- [inventory_item_global_id, event]
- )
-
-
-func left_double_click_on_inventory_item(_inventory_item_global_id: String, _event: InputEvent) -> void:
- pass
-
-
-func inventory_item_focused(inventory_item_global_id: String) -> void:
- var target_obj = escoria.object_manager.get_object(
- inventory_item_global_id
- ).node
-
- match escoria.action_manager.action_state:
- #Â Don't change the tooltip if an action input is completed
- #Â (ie verb+item(+target)) because the action is now being executed
- # and the tooltip is already set because the item was focused
- # (see element_focused() and inventory_item_focused())
- ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
- return
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
- tooltip.set_target(target_obj.tooltip_name)
-
- #Â Hovering an ESCItem highlights its default action
- if escoria.action_manager.current_action != VERB_USE and target_obj is ESCItem:
- verbs_menu.set_by_name(target_obj.default_action)
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
- tooltip.set_target2(target_obj.tooltip_name)
-
-
-func inventory_item_unfocused() -> void:
-
- match escoria.action_manager.action_state:
- ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
- #Â Don't change the tooltip if an action input is completed
- #Â (ie verb+item(+target)) because the action is now being executed
- return
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
- tooltip.set_target("")
- verbs_menu.unselect_actions()
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
- tooltip.set_target2("")
-
-
-func open_inventory():
- pass
-
-
-func close_inventory():
- pass
-
-
-func mousewheel_action(_direction: int):
- pass
-
-
-func hide_ui():
- $ui/Control.hide()
- verbs_menu.hide()
- if ESCProjectSettingsManager.get_setting(ESCProjectSettingsManager.ENABLE_ROOM_SELECTOR):
- room_select.hide()
- inventory_ui.hide()
- tooltip.hide()
-
-
-func show_ui():
- $ui/Control.show()
- verbs_menu.show()
- if ESCProjectSettingsManager.get_setting(ESCProjectSettingsManager.ENABLE_ROOM_SELECTOR):
- room_select.show()
- inventory_ui.show()
- tooltip.show()
-
-func hide_main_menu():
- if get_node(main_menu).visible:
- get_node(main_menu).hide()
- show_ui()
-
-func show_main_menu():
- if not get_node(main_menu).visible:
- hide_ui()
- get_node(main_menu).reset()
- get_node(main_menu).show()
-
-func unpause_game():
- if get_node(pause_menu).visible:
- get_node(pause_menu).hide()
- escoria.object_manager.get_object(ESCObjectManager.CAMERA).node.current = true
- escoria.object_manager.get_object(ESCObjectManager.SPEECH).node.resume()
- escoria.main.current_scene.game.show_ui()
- escoria.main.current_scene.show()
- escoria.set_game_paused(false)
-
-func pause_game():
- if not get_node(pause_menu).visible and not get_node(main_menu).visible:
- get_node(pause_menu).reset()
- get_node(pause_menu).set_save_enabled(escoria.save_manager.save_enabled)
- get_node(pause_menu).show()
- escoria.object_manager.get_object(ESCObjectManager.CAMERA).node.current = false
- escoria.object_manager.get_object(ESCObjectManager.SPEECH).node.pause()
- escoria.main.current_scene.game.hide_ui()
- escoria.main.current_scene.hide()
- escoria.set_game_paused(true)
-
-
-func _on_MenuButton_pressed() -> void:
- pause_game()
-
-
-func _on_action_finished() -> void:
- verbs_menu.unselect_actions()
-
-
-func _on_event_done(_return_code: int, _event_name: String):
- if _return_code == ESCExecution.RC_OK:
- escoria.action_manager.clear_current_action()
- verbs_menu.unselect_actions()
- tooltip.clear()
-
-
-func apply_custom_settings(custom_settings: Dictionary):
- if custom_settings.has("a_custom_setting"):
- escoria.logger.info(
- self,
- "custom setting value loaded: %s."
- % str(custom_settings["a_custom_setting"])
- )
-
-
-func get_custom_data() -> Dictionary:
- return {
- "ui_type": "9verbs"
- }
diff --git a/addons/escoria-ui-9verbs/game.tscn b/addons/escoria-ui-9verbs/game.tscn
deleted file mode 100644
index 8c5e9538..00000000
--- a/addons/escoria-ui-9verbs/game.tscn
+++ /dev/null
@@ -1,154 +0,0 @@
-[gd_scene load_steps=10 format=2]
-
-[ext_resource path="res://addons/escoria-ui-9verbs/tooltip/action_target_tooltip.tscn" type="PackedScene" id=1]
-[ext_resource path="res://addons/escoria-ui-9verbs/inventory/inventory_ui.tscn" type="PackedScene" id=2]
-[ext_resource path="res://addons/escoria-ui-9verbs/verbs_menu.tscn" type="PackedScene" id=3]
-[ext_resource path="res://addons/escoria-core/game/scenes/dialogs/esc_dialog_player.gd" type="Script" id=4]
-[ext_resource path="res://addons/escoria-ui-9verbs/game.gd" type="Script" id=5]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/main_menu/main_menu.tscn" type="PackedScene" id=7]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/pause_menu/pause_menu.tscn" type="PackedScene" id=9]
-[ext_resource path="res://addons/escoria-ui-9verbs/theme.tres" type="Theme" id=10]
-
-[sub_resource type="StyleBoxFlat" id=1]
-bg_color = Color( 0.6, 0.6, 0.6, 0.5 )
-
-[node name="game" type="Node2D"]
-script = ExtResource( 5 )
-main_menu = NodePath("ui/main_menu")
-pause_menu = NodePath("ui/pause_menu")
-ui_parent_control_node = NodePath("ui/Control")
-
-[node name="dialog_layer" type="CanvasLayer" parent="."]
-
-[node name="ESCDialogsPlayer" type="Control" parent="dialog_layer"]
-theme = ExtResource( 10 )
-script = ExtResource( 4 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="ui" type="CanvasLayer" parent="."]
-
-[node name="Control" type="Control" parent="ui"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-mouse_filter = 2
-theme = ExtResource( 10 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="panel_down" type="PanelContainer" parent="ui/Control"]
-anchor_top = 0.7
-anchor_right = 1.0
-anchor_bottom = 1.0
-size_flags_vertical = 3
-custom_styles/panel = SubResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="VBoxContainer" type="VBoxContainer" parent="ui/Control/panel_down"]
-margin_right = 1280.0
-margin_bottom = 270.0
-
-[node name="MarginContainer" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer"]
-margin_right = 1280.0
-margin_bottom = 32.0
-custom_constants/margin_top = 10
-
-[node name="tooltip" parent="ui/Control/panel_down/VBoxContainer/MarginContainer" instance=ExtResource( 1 )]
-anchor_right = 0.0
-anchor_bottom = 0.0
-margin_top = 10.0
-margin_right = 1280.0
-margin_bottom = 32.0
-bbcode_text = "[center]Test[/center]"
-text = "Test"
-fit_content_height = true
-color = Color( 1, 1, 1, 1 )
-
-[node name="HSeparator" type="HSeparator" parent="ui/Control/panel_down/VBoxContainer"]
-margin_top = 36.0
-margin_right = 1280.0
-margin_bottom = 46.0
-custom_constants/separation = 10
-
-[node name="HBoxContainer" type="HBoxContainer" parent="ui/Control/panel_down/VBoxContainer"]
-margin_top = 50.0
-margin_right = 1280.0
-margin_bottom = 270.0
-size_flags_vertical = 3
-
-[node name="VerbsMargin" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer"]
-margin_right = 424.0
-margin_bottom = 220.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/margin_right = 20
-custom_constants/margin_top = 20
-custom_constants/margin_left = 20
-custom_constants/margin_bottom = 20
-
-[node name="verbs_menu" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/VerbsMargin" instance=ExtResource( 3 )]
-margin_left = 20.0
-margin_top = 20.0
-margin_right = 404.0
-margin_bottom = 200.0
-
-[node name="MainMargin" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer"]
-margin_left = 428.0
-margin_right = 852.0
-margin_bottom = 220.0
-size_flags_horizontal = 3
-custom_constants/margin_right = 20
-custom_constants/margin_top = 20
-custom_constants/margin_left = 20
-custom_constants/margin_bottom = 20
-
-[node name="VBoxContainer" type="VBoxContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin"]
-margin_left = 20.0
-margin_top = 20.0
-margin_right = 404.0
-margin_bottom = 200.0
-
-[node name="MarginContainer" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin/VBoxContainer"]
-margin_left = 142.0
-margin_top = 70.0
-margin_right = 242.0
-margin_bottom = 110.0
-rect_min_size = Vector2( 100, 40 )
-size_flags_horizontal = 6
-size_flags_vertical = 6
-
-[node name="MenuButton" type="Button" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin/VBoxContainer/MarginContainer"]
-margin_right = 100.0
-margin_bottom = 40.0
-text = "Menu"
-
-[node name="InventoryMargin" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer"]
-margin_left = 856.0
-margin_right = 1280.0
-margin_bottom = 220.0
-size_flags_horizontal = 3
-custom_constants/margin_right = 20
-custom_constants/margin_top = 20
-custom_constants/margin_left = 20
-custom_constants/margin_bottom = 20
-
-[node name="inventory_ui" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/InventoryMargin" instance=ExtResource( 2 )]
-margin_left = 20.0
-margin_top = 20.0
-margin_right = 404.0
-margin_bottom = 200.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="main_menu" parent="ui" instance=ExtResource( 7 )]
-visible = false
-
-[node name="pause_menu" parent="ui" instance=ExtResource( 9 )]
-visible = false
-theme = ExtResource( 10 )
-
-[connection signal="pressed" from="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin/VBoxContainer/MarginContainer/MenuButton" to="." method="_on_MenuButton_pressed"]
diff --git a/addons/escoria-ui-9verbs/inventory/inventory_ui.tscn b/addons/escoria-ui-9verbs/inventory/inventory_ui.tscn
deleted file mode 100644
index 13aa09db..00000000
--- a/addons/escoria-ui-9verbs/inventory/inventory_ui.tscn
+++ /dev/null
@@ -1,31 +0,0 @@
-[gd_scene load_steps=3 format=2]
-
-[ext_resource path="res://addons/escoria-core/game/scenes/inventory/inventory_ui.gd" type="Script" id=1]
-[ext_resource path="res://addons/escoria-core/ui_library/inventory/esc_inventory_container.gd" type="Script" id=3]
-
-[node name="inventory_ui" type="PanelContainer"]
-margin_right = 600.0
-margin_bottom = 175.0
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-inventory_ui_container = NodePath("ScrollContainer/GridContainer")
-
-[node name="ScrollContainer" type="ScrollContainer" parent="."]
-margin_left = 7.0
-margin_top = 7.0
-margin_right = 593.0
-margin_bottom = 168.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="GridContainer" type="GridContainer" parent="ScrollContainer"]
-margin_right = 586.0
-margin_bottom = 161.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/vseparation = 16
-custom_constants/hseparation = 16
-columns = 4
-script = ExtResource( 3 )
diff --git a/addons/escoria-ui-9verbs/plugin.cfg b/addons/escoria-ui-9verbs/plugin.cfg
deleted file mode 100644
index 32c38747..00000000
--- a/addons/escoria-ui-9verbs/plugin.cfg
+++ /dev/null
@@ -1,7 +0,0 @@
-[plugin]
-
-name="Escoria 9 Verbs UI"
-description="Classical LucasArts style 9-verbs UI for the Escoria Framework"
-author="StraToN"
-version="1.0.0"
-script="plugin.gd"
diff --git a/addons/escoria-ui-9verbs/plugin.gd b/addons/escoria-ui-9verbs/plugin.gd
deleted file mode 100644
index b6b1de54..00000000
--- a/addons/escoria-ui-9verbs/plugin.gd
+++ /dev/null
@@ -1,24 +0,0 @@
-# Plugin script to initialize Escoria simple mouse UI
-tool
-extends EditorPlugin
-
-
-# Override function to return the plugin name.
-func get_plugin_name():
- return "escoria-ui-9verbs"
-
-
-# Deregister UI
-func disable_plugin():
- print("Disabling plugin Escoria UI 9-verbs.")
- EscoriaPlugin.deregister_ui("res://addons/escoria-ui-9verbs/game.tscn")
-
-
-# Register UI with Escoria
-func enable_plugin():
- print("Enabling plugin Escoria UI 9-verbs.")
- if not EscoriaPlugin.register_ui(self, "res://addons/escoria-ui-9verbs/game.tscn"):
- get_editor_interface().set_plugin_enabled(
- get_plugin_name(),
- false
- )
diff --git a/addons/escoria-ui-9verbs/theme.tres b/addons/escoria-ui-9verbs/theme.tres
deleted file mode 100644
index 5176258e..00000000
--- a/addons/escoria-ui-9verbs/theme.tres
+++ /dev/null
@@ -1,6 +0,0 @@
-[gd_resource type="Theme" load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-ui-9verbs/fonts/caslonantique.tres" type="DynamicFont" id=1]
-
-[resource]
-default_font = ExtResource( 1 )
diff --git a/addons/escoria-ui-9verbs/tooltip/action_target_tooltip.tscn b/addons/escoria-ui-9verbs/tooltip/action_target_tooltip.tscn
deleted file mode 100644
index 5d81dfbc..00000000
--- a/addons/escoria-ui-9verbs/tooltip/action_target_tooltip.tscn
+++ /dev/null
@@ -1,14 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-ui-9verbs/tooltip/tooltip_action_target.gd" type="Script" id=1]
-
-[node name="tooltip" type="RichTextLabel"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-bbcode_enabled = true
-bbcode_text = "[center][/center]"
-scroll_active = false
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
diff --git a/addons/escoria-ui-9verbs/tooltip/tooltip_action_target.gd b/addons/escoria-ui-9verbs/tooltip/tooltip_action_target.gd
deleted file mode 100644
index db910ef0..00000000
--- a/addons/escoria-ui-9verbs/tooltip/tooltip_action_target.gd
+++ /dev/null
@@ -1,34 +0,0 @@
-extends ESCTooltip
-
-export var prepositions = {"use": "with", "give": "to"}
-
-func update_tooltip_text():
- bbcode_text = "[center]"
- bbcode_text += "[color=#" + color.to_html(false) + "]"
- if !current_action.empty():
- bbcode_text += current_action + "\t"
- bbcode_text += current_target
-
- if waiting_for_target2 and current_target2.empty():
- current_prep = prepositions.get(current_action, current_prep)
- bbcode_text += "\t" + current_prep
-
- if !current_target2.empty():
- bbcode_text += "\t" + current_prep + "\t" + current_target2
-
- bbcode_text += "[/color]"
- bbcode_text += "[/center]"
-
-# push_align(RichTextLabel.ALIGN_CENTER)
-# if !current_action.empty():
-# add_text(current_action + "\t")
-#
-# add_text(current_target)
-#
-# if waiting_for_target2 and current_target2.empty():
-# add_text("\t" + current_prep)
-#
-# if !current_target2.empty():
-# add_text("\t" + current_prep + "\t" + current_target2)
-#
-# pop()
diff --git a/addons/escoria-ui-9verbs/verbs_menu.gd b/addons/escoria-ui-9verbs/verbs_menu.gd
deleted file mode 100644
index 9e192433..00000000
--- a/addons/escoria-ui-9verbs/verbs_menu.gd
+++ /dev/null
@@ -1,32 +0,0 @@
-extends Control
-
-"""
-This script is out of Escoria's scope. It controls the UI reaction to an
-UI event (eg right click) to change the cursor accordingly.
-"""
-
-var selected_action
-
-func _ready():
- for but in get_children():
- but.connect("pressed", self, "_on_action_selected", [but.name])
- but.toggle_mode = true
-
-func _on_action_selected(action: String):
- if escoria.inputs_manager.input_mode != escoria.inputs_manager.INPUT_ALL:
- unselect_actions()
- return
-
- escoria.action_manager.set_current_action(action)
-
- for but in get_children():
- but.set_pressed(but.get_name() == action)
-
-func unselect_actions():
- for but in get_children():
- but.set_pressed(false)
-
-func set_by_name(action_name: String):
- selected_action = action_name
- for but in get_children():
- but.set_pressed(but.get_name() == action_name)
diff --git a/addons/escoria-ui-9verbs/verbs_menu.tscn b/addons/escoria-ui-9verbs/verbs_menu.tscn
deleted file mode 100644
index f2ca3cb2..00000000
--- a/addons/escoria-ui-9verbs/verbs_menu.tscn
+++ /dev/null
@@ -1,125 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-ui-9verbs/verbs_menu.gd" type="Script" id=1]
-
-[node name="actions" type="GridContainer"]
-margin_right = 493.0
-margin_bottom = 263.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-columns = 3
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="open" type="Button" parent="."]
-margin_right = 161.0
-margin_bottom = 85.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Open"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="pickup" type="Button" parent="."]
-margin_left = 165.0
-margin_right = 326.0
-margin_bottom = 85.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Pick up"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="push" type="Button" parent="."]
-margin_left = 330.0
-margin_right = 491.0
-margin_bottom = 85.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Push"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="close" type="Button" parent="."]
-margin_top = 89.0
-margin_right = 161.0
-margin_bottom = 174.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Close"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="look" type="Button" parent="."]
-margin_left = 165.0
-margin_top = 89.0
-margin_right = 326.0
-margin_bottom = 174.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Look at"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="pull" type="Button" parent="."]
-margin_left = 330.0
-margin_top = 89.0
-margin_right = 491.0
-margin_bottom = 174.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Pull"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="give" type="Button" parent="."]
-margin_top = 178.0
-margin_right = 161.0
-margin_bottom = 263.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Give"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="use" type="Button" parent="."]
-margin_left = 165.0
-margin_top = 178.0
-margin_right = 326.0
-margin_bottom = 263.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Use"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="talk" type="Button" parent="."]
-margin_left = 330.0
-margin_top = 178.0
-margin_right = 491.0
-margin_bottom = 263.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Talk"
-__meta__ = {
-"_edit_use_anchors_": false
-}
diff --git a/addons/escoria-ui-keyboard-9verbs/fonts/caslonantique.tres b/addons/escoria-ui-keyboard-9verbs/fonts/caslonantique.tres
deleted file mode 100644
index 7f4ea46f..00000000
--- a/addons/escoria-ui-keyboard-9verbs/fonts/caslonantique.tres
+++ /dev/null
@@ -1,7 +0,0 @@
-[gd_resource type="DynamicFont" load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-ui-keyboard-9verbs/fonts/caslonantique.ttf" type="DynamicFontData" id=1]
-
-[resource]
-size = 21
-font_data = ExtResource( 1 )
diff --git a/addons/escoria-ui-keyboard-9verbs/fonts/caslonantique.ttf b/addons/escoria-ui-keyboard-9verbs/fonts/caslonantique.ttf
deleted file mode 100755
index eec6f639..00000000
Binary files a/addons/escoria-ui-keyboard-9verbs/fonts/caslonantique.ttf and /dev/null differ
diff --git a/addons/escoria-ui-keyboard-9verbs/game.gd b/addons/escoria-ui-keyboard-9verbs/game.gd
deleted file mode 100644
index 69b01861..00000000
--- a/addons/escoria-ui-keyboard-9verbs/game.gd
+++ /dev/null
@@ -1,404 +0,0 @@
-extends ESCGame
-
-
-const VERB_CLOSE = "close"
-const VERB_GIVE = "give"
-const VERB_LOOK = "look"
-const VERB_OPEN = "open"
-const VERB_PICKUP = "pickup"
-const VERB_PULL = "pull"
-const VERB_PUSH = "push"
-const VERB_TALK = "talk"
-const VERB_USE = "use"
-
-
-"""
-Implement methods to react to inputs.
-
-- left_click_on_bg(position: Vector2)
-- right_click_on_bg(position: Vector2)
-- left_double_click_on_bg(position: Vector2)
-
-- element_focused(element_id: String)
-- element_unfocused()
-
-- left_click_on_item(item_global_id: String, event: InputEvent)
-- right_click_on_item(item_global_id: String, event: InputEvent)
-- left_double_click_on_item(item_global_id: String, event: InputEvent)
-
-- left_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent)
-- right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent)
-- left_double_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent)
-- inventory_item_focused(inventory_item_global_id: String)
-- inventory_item_unfocused()
-- open_inventory()
-- close_inventory()
-
-- mousewheel_action(direction: int)
-
-- hide_ui()
-- show_ui()
-
-- pause_game()
-- unpause_game()
-- show_main_menu()
-- hide_main_menu()
-
-- apply_custom_settings()
-
-- _on_event_done(event_name: String)
-"""
-
-
-onready var verbs_menu = $ui/Control/panel_down/VBoxContainer/HBoxContainer\
- /VerbsMargin/verbs_menu
-onready var tooltip = $ui/Control/panel_down/VBoxContainer/MarginContainer\
- /tooltip
-onready var room_select = $ui/Control/panel_down/VBoxContainer/HBoxContainer\
- /MainMargin/VBoxContainer/room_select
-onready var inventory_ui = $ui/Control/panel_down/VBoxContainer/HBoxContainer\
- /InventoryMargin/inventory_ui
-const input_map = preload("res://addons/escoria-ui-keyboard-9verbs/input_map.gd")
-
-func _enter_tree():
- var room_selector_parent = $ui/Control/panel_down/VBoxContainer\
- /HBoxContainer/MainMargin/VBoxContainer
-
- if ProjectSettings.get_setting("escoria/debug/enable_room_selector") and \
- room_selector_parent.get_node_or_null("room_select") == null:
- room_selector_parent.add_child(
- preload(
- "res://addons/escoria-core/ui_library/tools/room_select" +\
- "/room_select.tscn"
- ).instance()
- )
-
- var input_handler = funcref(self, "_process_input")
- escoria.inputs_manager.register_custom_input_handler(input_handler)
- input_map.add_actions_to_input_map()
-
-
-func _exit_tree():
- escoria.inputs_manager.register_custom_input_handler(null)
- input_map.erase_actions_from_input_map()
-
-
-func _process_input(event: InputEvent, is_default_state: bool) -> bool:
- if not is_default_state:
- return false
- elif event.is_action_pressed(input_map.ACTION_SET_VERB_OPEN):
- verbs_menu.on_action_selected(VERB_OPEN)
- return true
- elif event.is_action_pressed(input_map.ACTION_SET_VERB_PICKUP):
- verbs_menu.on_action_selected(VERB_PICKUP)
- return true
- elif event.is_action_pressed(input_map.ACTION_SET_VERB_PUSH):
- verbs_menu.on_action_selected(VERB_PUSH)
- return true
- elif event.is_action_pressed(input_map.ACTION_SET_VERB_CLOSE):
- verbs_menu.on_action_selected(VERB_CLOSE)
- return true
- elif event.is_action_pressed(input_map.ACTION_SET_VERB_LOOK):
- verbs_menu.on_action_selected(VERB_LOOK)
- return true
- elif event.is_action_pressed(input_map.ACTION_SET_VERB_PULL):
- verbs_menu.on_action_selected(VERB_PULL)
- return true
- elif event.is_action_pressed(input_map.ACTION_SET_VERB_GIVE):
- verbs_menu.on_action_selected(VERB_GIVE)
- return true
- elif event.is_action_pressed(input_map.ACTION_SET_VERB_USE):
- verbs_menu.on_action_selected(VERB_USE)
- return true
- elif event.is_action_pressed(input_map.ACTION_SET_VERB_TALK):
- verbs_menu.on_action_selected(VERB_TALK)
- return true
- else:
- return false
-
-
-##Â BACKGROUND ##
-
-func left_click_on_bg(position: Vector2) -> void:
- if escoria.main.current_scene.player:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.BACKGROUND_CLICK,
- [escoria.main.current_scene.player.global_id, position],
- true
- )
- escoria.action_manager.clear_current_action()
- escoria.action_manager.clear_current_tool()
- tooltip.clear()
- verbs_menu.unselect_actions()
-
-
-func right_click_on_bg(position: Vector2) -> void:
- if escoria.main.current_scene.player:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.BACKGROUND_CLICK,
- [escoria.main.current_scene.player.global_id, position],
- true
- )
- escoria.action_manager.clear_current_action()
- escoria.action_manager.clear_current_tool()
- tooltip.clear()
- verbs_menu.unselect_actions()
-
-
-func left_double_click_on_bg(position: Vector2) -> void:
- if escoria.main.current_scene.player:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.BACKGROUND_CLICK,
- [escoria.main.current_scene.player.global_id, position, true],
- true
- )
- escoria.action_manager.clear_current_action()
- verbs_menu.unselect_actions()
-
-
-##Â ITEM FOCUS ##
-
-func element_focused(element_id: String) -> void:
- var target_obj = escoria.object_manager.get_object(element_id).node
-
- match escoria.action_manager.action_state:
- #Â Don't change the tooltip if an action input is completed
- #Â (ie verb+item(+target)) because the action is now being executed
- # and the tooltip is already set because the item was focused
- # (see element_focused() and inventory_item_focused())
- ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
- return
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
- tooltip.set_target(target_obj.tooltip_name)
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
- tooltip.set_target2(target_obj.tooltip_name)
-
-
-func element_unfocused() -> void:
- match escoria.action_manager.action_state:
- #Â Don't change the tooltip if an action input is completed
- #Â (ie verb+item(+target)) because the action is now being executed
- # and the tooltip is already set because the item was focused
- # (see element_focused() and inventory_item_focused())
- ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
- return
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
- tooltip.set_target("")
- verbs_menu.unselect_actions()
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
- tooltip.set_target2("")
-
-
-
-## ITEMS ##
-func left_click_on_item(item_global_id: String, event: InputEvent) -> void:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
- [item_global_id, event],
- true
- )
-
- var target_obj = escoria.object_manager.get_object(
- item_global_id
- ).node
-
- match escoria.action_manager.action_state:
- #Â Don't change the tooltip if an action input is completed
- #Â (ie verb+item(+target)) because the action is now being executed
- # and the tooltip is already set because the item was focused
- # (see element_focused() and inventory_item_focused())
- ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
- return
-
- # Just clicked on the item
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
- tooltip.set_target(target_obj.tooltip_name)
-
- #Â Clicked on item and now we're awaiting a target item
- # This means we clicked the tool and we now need a target
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
- tooltip.set_target(target_obj.tooltip_name, true)
-
-
-
-func right_click_on_item(item_global_id: String, event: InputEvent) -> void:
- escoria.action_manager.set_current_action(verbs_menu.selected_action)
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_RIGHT_CLICK,
- [item_global_id, event],
- true
- )
-
-
-func left_double_click_on_item(item_global_id: String, event: InputEvent) -> void:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
- [item_global_id, event],
- true
- )
-
-
-## INVENTORY ##
-func left_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
- [inventory_item_global_id, event]
- )
-
- var target_obj = escoria.object_manager.get_object(
- inventory_item_global_id
- ).node
-
- match escoria.action_manager.action_state:
- #Â Don't change the tooltip if an action input is completed
- #Â (ie verb+item(+target)) because the action is now being executed
- # and the tooltip is already set because the item was focused
- # (see element_focused() and inventory_item_focused())
- ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
- return
-
- # Just clicked on the inventory item: do nothing special
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
- return
-
- #Â Clicked on inventory item and now we're awaiting a target item
- # This means we clicked the tool and we now need a target
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
- tooltip.set_target(target_obj.tooltip_name, true)
-
-
-func right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void:
- escoria.action_manager.set_current_action(verbs_menu.selected_action)
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_RIGHT_CLICK,
- [inventory_item_global_id, event]
- )
-
-
-func left_double_click_on_inventory_item(_inventory_item_global_id: String, _event: InputEvent) -> void:
- pass
-
-
-func inventory_item_focused(inventory_item_global_id: String) -> void:
- var target_obj = escoria.object_manager.get_object(
- inventory_item_global_id
- ).node
-
- match escoria.action_manager.action_state:
- #Â Don't change the tooltip if an action input is completed
- #Â (ie verb+item(+target)) because the action is now being executed
- # and the tooltip is already set because the item was focused
- # (see element_focused() and inventory_item_focused())
- ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
- return
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
- tooltip.set_target(target_obj.tooltip_name)
-
- #Â Hovering an ESCItem highlights its default action
- if escoria.action_manager.current_action != VERB_USE and target_obj is ESCItem:
- verbs_menu.set_by_name(target_obj.default_action)
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
- tooltip.set_target2(target_obj.tooltip_name)
-
-
-func inventory_item_unfocused() -> void:
-
- match escoria.action_manager.action_state:
- ESCActionManager.ACTION_INPUT_STATE.COMPLETED:
- #Â Don't change the tooltip if an action input is completed
- #Â (ie verb+item(+target)) because the action is now being executed
- return
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM, \
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_ITEM:
- tooltip.set_target("")
- verbs_menu.unselect_actions()
-
- ESCActionManager.ACTION_INPUT_STATE.AWAITING_TARGET_ITEM:
- tooltip.set_target2("")
-
-
-func open_inventory():
- pass
-
-
-func close_inventory():
- pass
-
-
-func mousewheel_action(_direction: int):
- pass
-
-
-func hide_ui():
- $ui/Control.hide()
- verbs_menu.hide()
- if ProjectSettings.get("escoria/debug/enable_room_selector") == true:
- room_select.hide()
- inventory_ui.hide()
- tooltip.hide()
-
-
-func show_ui():
- $ui/Control.show()
- verbs_menu.show()
- if ProjectSettings.get("escoria/debug/enable_room_selector") == true:
- room_select.show()
- inventory_ui.show()
- tooltip.show()
-
-func hide_main_menu():
- if get_node(main_menu).visible:
- get_node(main_menu).hide()
- show_ui()
-
-func show_main_menu():
- if not get_node(main_menu).visible:
- hide_ui()
- get_node(main_menu).reset()
- get_node(main_menu).show()
-
-func unpause_game():
- if get_node(pause_menu).visible:
- get_node(pause_menu).hide()
- escoria.object_manager.get_object(ESCObjectManager.CAMERA).node.current = true
- escoria.object_manager.get_object(ESCObjectManager.SPEECH).node.resume()
- escoria.main.current_scene.game.show_ui()
- escoria.main.current_scene.show()
- escoria.set_game_paused(false)
-
-func pause_game():
- if not get_node(pause_menu).visible:
- get_node(pause_menu).reset()
- get_node(pause_menu).set_save_enabled(escoria.save_manager.save_enabled)
- get_node(pause_menu).show()
- escoria.object_manager.get_object(ESCObjectManager.CAMERA).node.current = false
- escoria.object_manager.get_object(ESCObjectManager.SPEECH).node.pause()
- escoria.main.current_scene.game.hide_ui()
- escoria.main.current_scene.hide()
- escoria.set_game_paused(true)
-
-
-func _on_MenuButton_pressed() -> void:
- pause_game()
-
-
-func _on_action_finished() -> void:
- verbs_menu.unselect_actions()
- tooltip.clear()
-
-func _on_event_done(_return_code: int, _event_name: String):
- if _return_code == ESCExecution.RC_OK:
- escoria.action_manager.clear_current_action()
- verbs_menu.unselect_actions()
diff --git a/addons/escoria-ui-keyboard-9verbs/game.tscn b/addons/escoria-ui-keyboard-9verbs/game.tscn
deleted file mode 100644
index 09d142a2..00000000
--- a/addons/escoria-ui-keyboard-9verbs/game.tscn
+++ /dev/null
@@ -1,166 +0,0 @@
-[gd_scene load_steps=11 format=2]
-
-[ext_resource path="res://addons/escoria-ui-keyboard-9verbs/tooltip/action_target_tooltip.tscn" type="PackedScene" id=1]
-[ext_resource path="res://addons/escoria-ui-keyboard-9verbs/inventory/inventory_ui.tscn" type="PackedScene" id=2]
-[ext_resource path="res://addons/escoria-ui-keyboard-9verbs/verbs_menu.tscn" type="PackedScene" id=3]
-[ext_resource path="res://addons/escoria-core/game/scenes/dialogs/esc_dialog_player.gd" type="Script" id=4]
-[ext_resource path="res://addons/escoria-ui-keyboard-9verbs/game.gd" type="Script" id=5]
-[ext_resource path="res://addons/escoria-core/game/scenes/camera_player/camera.tscn" type="PackedScene" id=6]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/main_menu/main_menu.tscn" type="PackedScene" id=7]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/pause_menu/pause_menu.tscn" type="PackedScene" id=9]
-[ext_resource path="res://addons/escoria-ui-keyboard-9verbs/theme.tres" type="Theme" id=10]
-
-[sub_resource type="StyleBoxFlat" id=1]
-bg_color = Color( 0.6, 0.6, 0.6, 0.5 )
-
-[node name="game" type="Node2D"]
-script = ExtResource( 5 )
-main_menu = NodePath("ui/main_menu")
-pause_menu = NodePath("ui/pause_menu")
-ui_parent_control_node = NodePath("ui/Control")
-
-[node name="dialog_layer" type="CanvasLayer" parent="."]
-
-[node name="ESCDialogsPlayer" type="Control" parent="dialog_layer"]
-theme = ExtResource( 10 )
-script = ExtResource( 4 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="ui" type="CanvasLayer" parent="."]
-
-[node name="Control" type="Control" parent="ui"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-mouse_filter = 2
-theme = ExtResource( 10 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="panel_down" type="PanelContainer" parent="ui/Control"]
-anchor_top = 0.7
-anchor_right = 1.0
-anchor_bottom = 1.0
-size_flags_vertical = 3
-custom_styles/panel = SubResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="VBoxContainer" type="VBoxContainer" parent="ui/Control/panel_down"]
-margin_right = 1280.0
-margin_bottom = 270.0
-
-[node name="MarginContainer" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer"]
-margin_right = 1280.0
-margin_bottom = 32.0
-custom_constants/margin_top = 10
-
-[node name="tooltip" parent="ui/Control/panel_down/VBoxContainer/MarginContainer" instance=ExtResource( 1 )]
-anchor_right = 0.0
-anchor_bottom = 0.0
-margin_top = 10.0
-margin_right = 1280.0
-margin_bottom = 32.0
-bbcode_text = "[center]Test[/center]"
-text = "Test"
-fit_content_height = true
-color = Color( 1, 1, 1, 1 )
-
-[node name="HSeparator" type="HSeparator" parent="ui/Control/panel_down/VBoxContainer"]
-margin_top = 36.0
-margin_right = 1280.0
-margin_bottom = 46.0
-custom_constants/separation = 10
-
-[node name="HBoxContainer" type="HBoxContainer" parent="ui/Control/panel_down/VBoxContainer"]
-margin_top = 50.0
-margin_right = 1280.0
-margin_bottom = 270.0
-size_flags_vertical = 3
-
-[node name="VerbsMargin" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer"]
-margin_right = 424.0
-margin_bottom = 220.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/margin_right = 20
-custom_constants/margin_top = 20
-custom_constants/margin_left = 20
-custom_constants/margin_bottom = 20
-
-[node name="verbs_menu" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/VerbsMargin" instance=ExtResource( 3 )]
-margin_left = 20.0
-margin_top = 20.0
-margin_right = 404.0
-margin_bottom = 200.0
-
-[node name="MainMargin" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer"]
-margin_left = 428.0
-margin_right = 852.0
-margin_bottom = 220.0
-size_flags_horizontal = 3
-custom_constants/margin_right = 20
-custom_constants/margin_top = 20
-custom_constants/margin_left = 20
-custom_constants/margin_bottom = 20
-
-[node name="VBoxContainer" type="VBoxContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin"]
-margin_left = 20.0
-margin_top = 20.0
-margin_right = 404.0
-margin_bottom = 200.0
-
-[node name="MarginContainer" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin/VBoxContainer"]
-margin_left = 142.0
-margin_top = 70.0
-margin_right = 242.0
-margin_bottom = 110.0
-rect_min_size = Vector2( 100, 40 )
-size_flags_horizontal = 6
-size_flags_vertical = 6
-
-[node name="MenuButton" type="Button" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin/VBoxContainer/MarginContainer"]
-margin_right = 100.0
-margin_bottom = 40.0
-text = "Menu"
-
-[node name="InventoryMargin" type="MarginContainer" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer"]
-margin_left = 856.0
-margin_right = 1280.0
-margin_bottom = 220.0
-size_flags_horizontal = 3
-custom_constants/margin_right = 20
-custom_constants/margin_top = 20
-custom_constants/margin_left = 20
-custom_constants/margin_bottom = 20
-
-[node name="inventory_ui" parent="ui/Control/panel_down/VBoxContainer/HBoxContainer/InventoryMargin" instance=ExtResource( 2 )]
-margin_left = 20.0
-margin_top = 20.0
-margin_right = 404.0
-margin_bottom = 200.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="hover_stack" type="Label" parent="ui"]
-margin_left = 1085.0
-margin_top = 2.81912
-margin_right = 1283.0
-margin_bottom = 107.819
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="main_menu" parent="ui" instance=ExtResource( 7 )]
-visible = false
-
-[node name="pause_menu" parent="ui" instance=ExtResource( 9 )]
-visible = false
-theme = ExtResource( 10 )
-
-[node name="camera" parent="." instance=ExtResource( 6 )]
-
-[connection signal="pressed" from="ui/Control/panel_down/VBoxContainer/HBoxContainer/MainMargin/VBoxContainer/MarginContainer/MenuButton" to="." method="_on_MenuButton_pressed"]
diff --git a/addons/escoria-ui-keyboard-9verbs/input_map.gd b/addons/escoria-ui-keyboard-9verbs/input_map.gd
deleted file mode 100644
index cabf00f5..00000000
--- a/addons/escoria-ui-keyboard-9verbs/input_map.gd
+++ /dev/null
@@ -1,60 +0,0 @@
-const ACTION_SET_VERB_OPEN = "set_action_verb_open"
-const ACTION_SET_VERB_PICKUP = "set_action_verb_pickup"
-const ACTION_SET_VERB_PUSH = "set_action_verb_push"
-const ACTION_SET_VERB_CLOSE = "set_action_verb_close"
-const ACTION_SET_VERB_LOOK = "set_action_verb_look"
-const ACTION_SET_VERB_PULL = "set_action_verb_pull"
-const ACTION_SET_VERB_GIVE = "set_action_verb_give"
-const ACTION_SET_VERB_USE = "set_action_verb_use"
-const ACTION_SET_VERB_TALK = "set_action_verb_talk"
-
-"""
-The keyboard shortcuts are chosen to match the geometric layout in the
-9verb UI (example below assumes QWERTY, but implementation should work
-for non-QWERTY, as well):
-
-```
-open | pickup | push -> Q | W | E
-close | look | pull -> A | S | D
-give | use | talk -> Z | X | C
-```
-"""
-
-
-# Implemented as an array of arrays rather than a dict because dict
-# does not have an items() method to enumerate entries together:
-# https://github.com/godotengine/godot-proposals/issues/1965
-const action_to_scancode = [
- [ACTION_SET_VERB_OPEN, KEY_Q],
- [ACTION_SET_VERB_PICKUP, KEY_W],
- [ACTION_SET_VERB_PUSH, KEY_E],
-
- [ACTION_SET_VERB_CLOSE, KEY_A],
- [ACTION_SET_VERB_LOOK, KEY_S],
- [ACTION_SET_VERB_PULL, KEY_D],
-
- [ACTION_SET_VERB_GIVE, KEY_Z],
- [ACTION_SET_VERB_USE, KEY_X],
- [ACTION_SET_VERB_TALK, KEY_C],
-]
-
-
-static func add_actions_to_input_map() -> void:
- for entry in action_to_scancode:
- var action = entry[0]
- var scancode = entry[1]
- var event = InputEventKey.new()
- # Based on https://github.com/godotengine/godot/pull/18020,
- # `physical_scancode` seems like a more appropriate property than
- # `scancode` in order to support non-QWERTY keyboard layouts while
- # preserving the geometric pattern of the shortcuts.
- event.physical_scancode = scancode
- InputMap.add_action(action)
- InputMap.action_add_event(action, event)
-
-
-static func erase_actions_from_input_map() -> void:
- for entry in action_to_scancode:
- var action = entry[0]
- InputMap.action_erase_events(action)
- InputMap.erase_action(action)
diff --git a/addons/escoria-ui-keyboard-9verbs/inventory/inventory_ui.tscn b/addons/escoria-ui-keyboard-9verbs/inventory/inventory_ui.tscn
deleted file mode 100644
index 13aa09db..00000000
--- a/addons/escoria-ui-keyboard-9verbs/inventory/inventory_ui.tscn
+++ /dev/null
@@ -1,31 +0,0 @@
-[gd_scene load_steps=3 format=2]
-
-[ext_resource path="res://addons/escoria-core/game/scenes/inventory/inventory_ui.gd" type="Script" id=1]
-[ext_resource path="res://addons/escoria-core/ui_library/inventory/esc_inventory_container.gd" type="Script" id=3]
-
-[node name="inventory_ui" type="PanelContainer"]
-margin_right = 600.0
-margin_bottom = 175.0
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-inventory_ui_container = NodePath("ScrollContainer/GridContainer")
-
-[node name="ScrollContainer" type="ScrollContainer" parent="."]
-margin_left = 7.0
-margin_top = 7.0
-margin_right = 593.0
-margin_bottom = 168.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="GridContainer" type="GridContainer" parent="ScrollContainer"]
-margin_right = 586.0
-margin_bottom = 161.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/vseparation = 16
-custom_constants/hseparation = 16
-columns = 4
-script = ExtResource( 3 )
diff --git a/addons/escoria-ui-keyboard-9verbs/plugin.cfg b/addons/escoria-ui-keyboard-9verbs/plugin.cfg
deleted file mode 100644
index 09b56195..00000000
--- a/addons/escoria-ui-keyboard-9verbs/plugin.cfg
+++ /dev/null
@@ -1,7 +0,0 @@
-[plugin]
-
-name="Escoria 9 Verbs UI + keyboard"
-description="Classical LucasArts style 9-verbs UI for the Escoria Framework with keyboard control"
-author="StraToN & bolinfest"
-version="1.0.0"
-script="plugin.gd"
diff --git a/addons/escoria-ui-keyboard-9verbs/plugin.gd b/addons/escoria-ui-keyboard-9verbs/plugin.gd
deleted file mode 100644
index a861c5b9..00000000
--- a/addons/escoria-ui-keyboard-9verbs/plugin.gd
+++ /dev/null
@@ -1,24 +0,0 @@
-# Plugin script to initialize Escoria 9-verbs with keyboard plugin
-tool
-extends EditorPlugin
-
-
-# Override function to return the plugin name.
-func get_plugin_name():
- return "escoria-ui-keyboard-9verbs"
-
-
-# Deregister UI
-func disable_plugin() -> void:
- print("Disabling plugin Escoria UI 9-verbs with keyboard.")
- EscoriaPlugin.deregister_ui("res://addons/escoria-ui-keyboard-9verbs/game.tscn")
-
-
-# Register UI with Escoria
-func enable_plugin():
- print("Enabling plugin Escoria UI 9-verbs with keyboard.")
- if not EscoriaPlugin.register_ui(self, "res://addons/escoria-ui-keyboard-9verbs/game.tscn"):
- get_editor_interface().set_plugin_enabled(
- get_plugin_name(),
- false
- )
diff --git a/addons/escoria-ui-keyboard-9verbs/theme.tres b/addons/escoria-ui-keyboard-9verbs/theme.tres
deleted file mode 100644
index b9043215..00000000
--- a/addons/escoria-ui-keyboard-9verbs/theme.tres
+++ /dev/null
@@ -1,6 +0,0 @@
-[gd_resource type="Theme" load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-ui-keyboard-9verbs/fonts/caslonantique.tres" type="DynamicFont" id=1]
-
-[resource]
-default_font = ExtResource( 1 )
diff --git a/addons/escoria-ui-keyboard-9verbs/tooltip/action_target_tooltip.tscn b/addons/escoria-ui-keyboard-9verbs/tooltip/action_target_tooltip.tscn
deleted file mode 100644
index ddead2f6..00000000
--- a/addons/escoria-ui-keyboard-9verbs/tooltip/action_target_tooltip.tscn
+++ /dev/null
@@ -1,14 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-ui-keyboard-9verbs/tooltip/tooltip_action_target.gd" type="Script" id=1]
-
-[node name="tooltip" type="RichTextLabel"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-bbcode_enabled = true
-bbcode_text = "[center][/center]"
-scroll_active = false
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
diff --git a/addons/escoria-ui-keyboard-9verbs/tooltip/tooltip_action_target.gd b/addons/escoria-ui-keyboard-9verbs/tooltip/tooltip_action_target.gd
deleted file mode 100644
index db910ef0..00000000
--- a/addons/escoria-ui-keyboard-9verbs/tooltip/tooltip_action_target.gd
+++ /dev/null
@@ -1,34 +0,0 @@
-extends ESCTooltip
-
-export var prepositions = {"use": "with", "give": "to"}
-
-func update_tooltip_text():
- bbcode_text = "[center]"
- bbcode_text += "[color=#" + color.to_html(false) + "]"
- if !current_action.empty():
- bbcode_text += current_action + "\t"
- bbcode_text += current_target
-
- if waiting_for_target2 and current_target2.empty():
- current_prep = prepositions.get(current_action, current_prep)
- bbcode_text += "\t" + current_prep
-
- if !current_target2.empty():
- bbcode_text += "\t" + current_prep + "\t" + current_target2
-
- bbcode_text += "[/color]"
- bbcode_text += "[/center]"
-
-# push_align(RichTextLabel.ALIGN_CENTER)
-# if !current_action.empty():
-# add_text(current_action + "\t")
-#
-# add_text(current_target)
-#
-# if waiting_for_target2 and current_target2.empty():
-# add_text("\t" + current_prep)
-#
-# if !current_target2.empty():
-# add_text("\t" + current_prep + "\t" + current_target2)
-#
-# pop()
diff --git a/addons/escoria-ui-keyboard-9verbs/verbs_menu.gd b/addons/escoria-ui-keyboard-9verbs/verbs_menu.gd
deleted file mode 100644
index 6db62eb5..00000000
--- a/addons/escoria-ui-keyboard-9verbs/verbs_menu.gd
+++ /dev/null
@@ -1,32 +0,0 @@
-extends Control
-
-"""
-This script is out of Escoria's scope. It controls the UI reaction to an
-UI event (eg right click) to change the cursor accordingly.
-"""
-
-var selected_action
-
-func _ready():
- for but in get_children():
- but.connect("pressed", self, "on_action_selected", [but.name])
- but.toggle_mode = true
-
-func on_action_selected(action: String):
- if escoria.inputs_manager.input_mode != escoria.inputs_manager.INPUT_ALL:
- unselect_actions()
- return
-
- escoria.action_manager.set_current_action(action)
-
- for but in get_children():
- but.set_pressed(but.get_name() == action)
-
-func unselect_actions():
- for but in get_children():
- but.set_pressed(false)
-
-func set_by_name(action_name: String):
- selected_action = action_name
- for but in get_children():
- but.set_pressed(but.get_name() == action_name)
diff --git a/addons/escoria-ui-keyboard-9verbs/verbs_menu.tscn b/addons/escoria-ui-keyboard-9verbs/verbs_menu.tscn
deleted file mode 100644
index abf7eabf..00000000
--- a/addons/escoria-ui-keyboard-9verbs/verbs_menu.tscn
+++ /dev/null
@@ -1,125 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-ui-keyboard-9verbs/verbs_menu.gd" type="Script" id=1]
-
-[node name="actions" type="GridContainer"]
-margin_right = 493.0
-margin_bottom = 263.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-columns = 3
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="open" type="Button" parent="."]
-margin_right = 161.0
-margin_bottom = 85.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Open"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="pickup" type="Button" parent="."]
-margin_left = 165.0
-margin_right = 326.0
-margin_bottom = 85.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Pick up"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="push" type="Button" parent="."]
-margin_left = 330.0
-margin_right = 491.0
-margin_bottom = 85.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Push"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="close" type="Button" parent="."]
-margin_top = 89.0
-margin_right = 161.0
-margin_bottom = 174.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Close"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="look" type="Button" parent="."]
-margin_left = 165.0
-margin_top = 89.0
-margin_right = 326.0
-margin_bottom = 174.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Look at"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="pull" type="Button" parent="."]
-margin_left = 330.0
-margin_top = 89.0
-margin_right = 491.0
-margin_bottom = 174.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Pull"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="give" type="Button" parent="."]
-margin_top = 178.0
-margin_right = 161.0
-margin_bottom = 263.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Give"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="use" type="Button" parent="."]
-margin_left = 165.0
-margin_top = 178.0
-margin_right = 326.0
-margin_bottom = 263.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Use"
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="talk" type="Button" parent="."]
-margin_left = 330.0
-margin_top = 178.0
-margin_right = 491.0
-margin_bottom = 263.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-toggle_mode = true
-text = "Talk"
-__meta__ = {
-"_edit_use_anchors_": false
-}
diff --git a/addons/escoria-ui-simplemouse/cursors/cursor_dialog.png b/addons/escoria-ui-simplemouse/cursors/cursor_dialog.png
deleted file mode 100644
index 5de7062b..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/cursor_dialog.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/cursor_examine.png b/addons/escoria-ui-simplemouse/cursors/cursor_examine.png
deleted file mode 100644
index d0ce0250..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/cursor_examine.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/cursor_foot.png b/addons/escoria-ui-simplemouse/cursors/cursor_foot.png
deleted file mode 100644
index 0f43a95b..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/cursor_foot.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/cursor_glasses.png b/addons/escoria-ui-simplemouse/cursors/cursor_glasses.png
deleted file mode 100644
index ef6ca77a..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/cursor_glasses.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/cursor_gun.png b/addons/escoria-ui-simplemouse/cursors/cursor_gun.png
deleted file mode 100644
index 906ebe15..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/cursor_gun.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/cursor_hand.png b/addons/escoria-ui-simplemouse/cursors/cursor_hand.png
deleted file mode 100644
index d8234a09..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/cursor_hand.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/cursor_heal.png b/addons/escoria-ui-simplemouse/cursors/cursor_heal.png
deleted file mode 100644
index c333906a..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/cursor_heal.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/cursor_lock.png b/addons/escoria-ui-simplemouse/cursors/cursor_lock.png
deleted file mode 100644
index 14b58895..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/cursor_lock.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/cursor_pen.png b/addons/escoria-ui-simplemouse/cursors/cursor_pen.png
deleted file mode 100644
index 36d746df..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/cursor_pen.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/cursor_punch.png b/addons/escoria-ui-simplemouse/cursors/cursor_punch.png
deleted file mode 100644
index 2a29cf7e..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/cursor_punch.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/cursor_shield.png b/addons/escoria-ui-simplemouse/cursors/cursor_shield.png
deleted file mode 100644
index 5b0094ea..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/cursor_shield.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/cursor_tool.png b/addons/escoria-ui-simplemouse/cursors/cursor_tool.png
deleted file mode 100644
index 64aa1c0b..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/cursor_tool.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/cursor_wait.png b/addons/escoria-ui-simplemouse/cursors/cursor_wait.png
deleted file mode 100644
index dfd7db71..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/cursor_wait.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/originals/cursor_examine.png b/addons/escoria-ui-simplemouse/cursors/originals/cursor_examine.png
deleted file mode 100644
index f4825082..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/originals/cursor_examine.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/originals/cursor_foot.png b/addons/escoria-ui-simplemouse/cursors/originals/cursor_foot.png
deleted file mode 100644
index 09800036..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/originals/cursor_foot.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/originals/cursor_glasses.png b/addons/escoria-ui-simplemouse/cursors/originals/cursor_glasses.png
deleted file mode 100644
index ef6ca77a..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/originals/cursor_glasses.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/originals/cursor_gun.png b/addons/escoria-ui-simplemouse/cursors/originals/cursor_gun.png
deleted file mode 100644
index 906ebe15..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/originals/cursor_gun.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/originals/cursor_hand.png b/addons/escoria-ui-simplemouse/cursors/originals/cursor_hand.png
deleted file mode 100644
index 242d4612..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/originals/cursor_hand.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/originals/cursor_heal.png b/addons/escoria-ui-simplemouse/cursors/originals/cursor_heal.png
deleted file mode 100644
index c333906a..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/originals/cursor_heal.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/originals/cursor_lock.png b/addons/escoria-ui-simplemouse/cursors/originals/cursor_lock.png
deleted file mode 100644
index 14b58895..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/originals/cursor_lock.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/originals/cursor_pen.png b/addons/escoria-ui-simplemouse/cursors/originals/cursor_pen.png
deleted file mode 100644
index aeb1e2ac..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/originals/cursor_pen.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/originals/cursor_punch.png b/addons/escoria-ui-simplemouse/cursors/originals/cursor_punch.png
deleted file mode 100644
index 2a29cf7e..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/originals/cursor_punch.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/originals/cursor_shield.png b/addons/escoria-ui-simplemouse/cursors/originals/cursor_shield.png
deleted file mode 100644
index 5b0094ea..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/originals/cursor_shield.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/originals/cursor_tool.png b/addons/escoria-ui-simplemouse/cursors/originals/cursor_tool.png
deleted file mode 100644
index f794ce26..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/originals/cursor_tool.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/originals/cursor_wait.png b/addons/escoria-ui-simplemouse/cursors/originals/cursor_wait.png
deleted file mode 100644
index 880b83e0..00000000
Binary files a/addons/escoria-ui-simplemouse/cursors/originals/cursor_wait.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/cursors/originals/pointers4.svg b/addons/escoria-ui-simplemouse/cursors/originals/pointers4.svg
deleted file mode 100644
index 62ad3205..00000000
--- a/addons/escoria-ui-simplemouse/cursors/originals/pointers4.svg
+++ /dev/null
@@ -1,1824 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- image/svg+xml
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/addons/escoria-ui-simplemouse/fonts/caslonantique.tres b/addons/escoria-ui-simplemouse/fonts/caslonantique.tres
deleted file mode 100644
index 3b560dc9..00000000
--- a/addons/escoria-ui-simplemouse/fonts/caslonantique.tres
+++ /dev/null
@@ -1,7 +0,0 @@
-[gd_resource type="DynamicFont" load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-ui-simplemouse/fonts/caslonantique.ttf" type="DynamicFontData" id=1]
-
-[resource]
-size = 21
-font_data = ExtResource( 1 )
diff --git a/addons/escoria-ui-simplemouse/fonts/caslonantique.ttf b/addons/escoria-ui-simplemouse/fonts/caslonantique.ttf
deleted file mode 100755
index eec6f639..00000000
Binary files a/addons/escoria-ui-simplemouse/fonts/caslonantique.ttf and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/game.gd b/addons/escoria-ui-simplemouse/game.gd
deleted file mode 100644
index aa68d041..00000000
--- a/addons/escoria-ui-simplemouse/game.gd
+++ /dev/null
@@ -1,408 +0,0 @@
-extends ESCGame
-
-
-const VERB_USE = "use"
-const VERB_WALK = "walk"
-
-
-"""
-Implement methods to react to inputs.
-
-- left_click_on_bg(position: Vector2)
-- right_click_on_bg(position: Vector2)
-- left_double_click_on_bg(position: Vector2)
-
-- element_focused(element_id: String)
-- element_unfocused()
-
-- left_click_on_item(item_global_id: String, event: InputEvent)
-- right_click_on_item(item_global_id: String, event: InputEvent)
-- left_double_click_on_item(item_global_id: String, event: InputEvent)
-
-- left_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent)
-- right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent)
-- left_double_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent)
-- inventory_item_focused(inventory_item_global_id: String)
-- inventory_item_unfocused()
-- open_inventory()
-- close_inventory()
-
-- mousewheel_action(direction: int)
-
-- hide_ui()
-- show_ui()
-
-- pause_game()
-- unpause_game()
-- show_main_menu()
-- hide_main_menu()
-
-- apply_custom_settings()
-
-- _on_event_done(event_name: String)
-"""
-
-# Value to use for `device` argument to various `Input.get_joy` methods.
-const JOY_DEVICE = 0
-
-# See https://docs.godotengine.org/en/stable/tutorials/inputs/controllers_gamepads_joysticks.html?#dead-zone
-const DEADZONE = 0.2
-
-# Multiplier to apply to axis when it exceeds DEADZONE.
-const AXIS_WEIGHT = 50.0
-
-# JOY_BUTTON_2 corresponds to the "X" button on an XBox controller
-# or the Square button on a Playstation controller. These appear to
-# map to the "primary action," in practice, so we treat it like a left click.
-const PRIMARY_ACTION_BUTTON = JOY_BUTTON_2
-
-# JOY_BUTTON_3 corresponds to the "Y" button on an XBox controller
-# or the Triangle button on a Playstation controller. These appear to
-# map to the "secondary action," in practice, so we treat it like a right click.
-const CHANGE_VERB_BUTTON = JOY_BUTTON_3
-
-# Input action for use by InputMap
-const ESC_UI_CHANGE_VERB_ACTION = "esc_change_verb"
-
-# true when a gamepad is connected.
-var _is_gamepad_connected = false
-
-# Tracks the mouse's current position onscreen.
-var _current_mouse_pos = Vector2.ZERO
-
-
-func _ready():
- $tooltip_layer/tooltip.connect("tooltip_size_updated", self, "update_tooltip_following_mouse_position")
-
-
-func _enter_tree():
- var room_selector_parent = $CanvasLayer/ui/HBoxContainer/VBoxContainer
-
- if ESCProjectSettingsManager.get_setting(ESCProjectSettingsManager.ENABLE_ROOM_SELECTOR) \
- and room_selector_parent.get_node_or_null("room_select") == null:
-
- room_selector_parent.add_child(
- preload(
- "res://addons/escoria-core/ui_library/tools/room_select" +\
- "/room_select.tscn"
- ).instance()
- )
-
- var input_handler = funcref(self, "_process_input")
- escoria.inputs_manager.register_custom_input_handler(input_handler)
-
- _is_gamepad_connected = Input.is_joy_known(JOY_DEVICE)
- if _is_gamepad_connected:
- _on_gamepad_connected()
-
- Input.connect("joy_connection_changed", self, "_on_joy_connection_changed")
-
-
-func _exit_tree():
- escoria.inputs_manager.register_custom_input_handler(null)
- Input.disconnect("joy_connection_changed", self, "_on_joy_connection_changed")
- if _is_gamepad_connected:
- _on_gamepad_disconnected()
-
-
-func _input(event: InputEvent) -> void:
- if escoria.get_escoria().is_ready_for_inputs():
- if event is InputEventMouseMotion:
- _current_mouse_pos = get_global_mouse_position()
- update_tooltip_following_mouse_position()
-
-
-# https://github.com/godotengine/godot-demo-projects/blob/3.4-585455e/misc/joypads/joypads.gd
-# was informative in wiring up the gamepad properly.
-
-func _on_gamepad_connected():
- set_physics_process(true)
-
- var primary_event = InputEventJoypadButton.new()
- primary_event.button_index = PRIMARY_ACTION_BUTTON
- InputMap.add_action(escoria.inputs_manager.ESC_UI_PRIMARY_ACTION)
- InputMap.action_add_event(escoria.inputs_manager.ESC_UI_PRIMARY_ACTION, primary_event)
-
- var verb_event = InputEventJoypadButton.new()
- verb_event.button_index = CHANGE_VERB_BUTTON
- InputMap.add_action(ESC_UI_CHANGE_VERB_ACTION)
- InputMap.action_add_event(ESC_UI_CHANGE_VERB_ACTION, verb_event)
-
-
-func _on_gamepad_disconnected():
- InputMap.action_erase_events(escoria.inputs_manager.ESC_UI_PRIMARY_ACTION)
- InputMap.erase_action(escoria.inputs_manager.ESC_UI_PRIMARY_ACTION)
-
- InputMap.action_erase_events(ESC_UI_CHANGE_VERB_ACTION)
- InputMap.erase_action(ESC_UI_CHANGE_VERB_ACTION)
-
- set_physics_process(false)
- _is_gamepad_connected = false
-
-
-func _on_joy_connection_changed(device: int, connected: bool) -> void:
- if device != JOY_DEVICE:
- return
- elif connected:
- _on_gamepad_connected()
- else:
- _on_gamepad_disconnected()
-
-
-func _process(_delta) -> void:
- if !_is_gamepad_connected:
- return
-
- var x = Input.get_joy_axis(JOY_DEVICE, JOY_AXIS_0)
- var y = Input.get_joy_axis(JOY_DEVICE, JOY_AXIS_1)
- var delta_x = int(x * AXIS_WEIGHT) if abs(x) > DEADZONE else 0
- var delta_y = int(y * AXIS_WEIGHT) if abs(y) > DEADZONE else 0
- if delta_x or delta_y:
- var direction: Vector2
- direction.x = delta_x
- direction.y = delta_y
- escoria.logger.trace("gamepad direction:", [direction])
- var viewport = get_viewport()
- viewport.warp_mouse(viewport.get_mouse_position() + direction)
-
-
-func _process_input(event: InputEvent, is_default_state: bool) -> bool:
- if not is_default_state:
- # ESCBackground is not guaranteed to be set, as we may be on
- # the "New Game" screen.
- return false
- elif _is_gamepad_connected and event is InputEventJoypadButton:
- escoria.logger.trace("InputEventJoypadButton:", [event.as_text()])
- if event.is_action_pressed(escoria.inputs_manager.ESC_UI_PRIMARY_ACTION):
- # Admittedly, this breaks abstraction barriers and is completely
- # inappropriate, but it's what works right now.
- escoria.inputs_manager._on_left_click_on_bg(get_global_mouse_position())
- return true
- elif event.is_action_pressed(ESC_UI_CHANGE_VERB_ACTION):
- mousewheel_action(1)
- return true
- return false
-
-
-##Â BACKGROUND ##
-
-func left_click_on_bg(position: Vector2) -> void:
- if escoria.main.current_scene.player:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.BACKGROUND_CLICK,
- [escoria.main.current_scene.player.global_id, position],
- true
- )
- $mouse_layer/verbs_menu.set_by_name(VERB_WALK)
- $mouse_layer/verbs_menu.clear_tool_texture()
-
-func right_click_on_bg(position: Vector2) -> void:
- mousewheel_action(1)
-
-func left_double_click_on_bg(position: Vector2) -> void:
- if escoria.main.current_scene.player:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.BACKGROUND_CLICK,
- [escoria.main.current_scene.player.global_id, position, true],
- true
- )
- $mouse_layer/verbs_menu.set_by_name(VERB_WALK)
- $mouse_layer/verbs_menu.clear_tool_texture()
-
-##Â ITEM/HOTSPOT FOCUS ##
-
-func element_focused(element_id: String) -> void:
- var target_obj = escoria.object_manager.get_object(element_id).node
- $tooltip_layer/tooltip.set_target(target_obj.tooltip_name)
-
- if escoria.action_manager.current_action != VERB_USE \
- and escoria.action_manager.current_tool == null \
- and target_obj is ESCItem:
-
- $mouse_layer/verbs_menu.set_by_name(
- target_obj.default_action
- )
-
-func element_unfocused() -> void:
- $tooltip_layer/tooltip.set_target("")
-
-
-## ITEMS ##
-func left_click_on_item(item_global_id: String, event: InputEvent) -> void:
- var target_obj = escoria.object_manager.get_object(item_global_id).node
-
- # current_action will be empty if an event completes between when you stop
- # moving the mouse and when you click.
- if escoria.action_manager.current_action == "":
- if target_obj is ESCItem:
- $mouse_layer/verbs_menu.set_by_name(
- target_obj.default_action
- )
-
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
- [item_global_id, event],
- true
- )
-
- $mouse_layer/verbs_menu.clear_tool_texture()
-
-func right_click_on_item(item_global_id: String, event: InputEvent) -> void:
- mousewheel_action(1)
-
-func left_double_click_on_item(item_global_id: String, event: InputEvent) -> void:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
- [item_global_id, event],
- true
- )
-
-
-## INVENTORY ##
-func left_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void:
- escoria.action_manager.do(
- escoria.action_manager.ACTION.ITEM_LEFT_CLICK,
- [inventory_item_global_id, event]
- )
-
- if escoria.action_manager.current_action == VERB_USE:
- var item = escoria.object_manager.get_object(
- inventory_item_global_id
- ).node
- if item.has_method("get_sprite") and item.get_sprite().texture:
- $mouse_layer/verbs_menu.set_tool_texture(
- item.get_sprite().texture
- )
- elif item.inventory_item.texture_normal:
- $mouse_layer/verbs_menu.set_tool_texture(
- item.inventory_item.texture_normal
- )
-
-func right_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void:
- mousewheel_action(1)
-
-
-func left_double_click_on_inventory_item(inventory_item_global_id: String, event: InputEvent) -> void:
- pass
-
-
-func inventory_item_focused(inventory_item_global_id: String) -> void:
- $tooltip_layer/tooltip.set_target(
- escoria.object_manager.get_object(
- inventory_item_global_id
- ).node.tooltip_name
- )
-
-
-func inventory_item_unfocused() -> void:
- $tooltip_layer/tooltip.set_target("")
-
-
-func open_inventory():
- $CanvasLayer/ui/HBoxContainer/inventory_ui.show_inventory()
-
-
-func close_inventory():
- $CanvasLayer/ui/HBoxContainer/inventory_ui.hide_inventory()
-
-
-func mousewheel_action(direction: int):
- $mouse_layer/verbs_menu.iterate_actions_cursor(direction)
-
-
-func hide_ui():
- $CanvasLayer/ui/HBoxContainer/inventory_ui.hide()
- $CanvasLayer/ui.hide()
-
-
-func show_ui():
- $CanvasLayer/ui/HBoxContainer/inventory_ui.show()
- $CanvasLayer/ui.show()
-
-
-func hide_main_menu():
- if get_node(main_menu).visible:
- get_node(main_menu).hide()
-
-func show_main_menu():
- if not get_node(main_menu).visible:
- get_node(main_menu).reset()
- get_node(main_menu).show()
-
-func unpause_game():
- if get_node(pause_menu).visible:
- get_node(pause_menu).hide()
- escoria.object_manager.get_object(ESCObjectManager.CAMERA).node.current = true
- escoria.object_manager.get_object(ESCObjectManager.SPEECH).node.resume()
- escoria.main.current_scene.game.show_ui()
- escoria.main.current_scene.show()
-
-func pause_game():
- if not get_node(pause_menu).visible:
- get_node(main_menu).reset()
- get_node(pause_menu).reset()
- get_node(pause_menu).set_save_enabled(
- escoria.save_manager.save_enabled
- )
- get_node(pause_menu).show()
- escoria.object_manager.get_object(ESCObjectManager.CAMERA).node.current = false
- escoria.object_manager.get_object(ESCObjectManager.SPEECH).node.pause()
- escoria.main.current_scene.game.hide_ui()
- escoria.main.current_scene.hide()
-
-
-func apply_custom_settings(custom_settings: Dictionary):
- if custom_settings.has("a_custom_setting"):
- escoria.logger.info(
- self,
- "custom setting value loaded: %s."
- % str(custom_settings["a_custom_setting"])
- )
-
-
-func get_custom_data() -> Dictionary:
- return {
- "ui_type": "simplemouse"
- }
-
-
-# Update the tooltip
-func update_tooltip_following_mouse_position():
- var corrected_position = _current_mouse_pos \
- - Vector2(
- tooltip_node.rect_size.x / 2,
- tooltip_node.rect_size.y / 2
- )
-
- # clamp TOP
- if tooltip_node.tooltip_distance_to_edge_top(_current_mouse_pos) <= mouse_tooltip_margin:
- corrected_position.y = mouse_tooltip_margin
-
- # clamp BOTTOM
- if tooltip_node.tooltip_distance_to_edge_bottom(_current_mouse_pos + tooltip_node.rect_size) <= mouse_tooltip_margin:
- corrected_position.y = escoria.game_size.y - mouse_tooltip_margin - tooltip_node.rect_size.y
-
- # clamp LEFT
- if tooltip_node.tooltip_distance_to_edge_left(_current_mouse_pos - tooltip_node.rect_size/2) <= mouse_tooltip_margin:
- corrected_position.x = mouse_tooltip_margin
-
- # clamp RIGHT
- if tooltip_node.tooltip_distance_to_edge_right(_current_mouse_pos + tooltip_node.rect_size/2) <= mouse_tooltip_margin:
- corrected_position.x = escoria.game_size.x - mouse_tooltip_margin - tooltip_node.rect_size.x
-
- tooltip_node.rect_position = corrected_position + tooltip_node.offset_from_cursor
-
-
-func _on_action_finished():
- $mouse_layer/verbs_menu.clear_tool_texture()
- $mouse_layer/verbs_menu.iterate_actions_cursor(0)
-
-
-func _on_event_done(_return_code: int, _event_name: String):
- if _return_code == ESCExecution.RC_OK:
- escoria.action_manager.clear_current_action()
- $tooltip_layer/tooltip.set_target("")
-
-
-func _on_MenuButton_pressed() -> void:
- pause_game()
diff --git a/addons/escoria-ui-simplemouse/game.tscn b/addons/escoria-ui-simplemouse/game.tscn
deleted file mode 100644
index ab0a9019..00000000
--- a/addons/escoria-ui-simplemouse/game.tscn
+++ /dev/null
@@ -1,109 +0,0 @@
-[gd_scene load_steps=10 format=2]
-
-[ext_resource path="res://addons/escoria-ui-simplemouse/inventory/inventory_ui.tscn" type="PackedScene" id=1]
-[ext_resource path="res://addons/escoria-core/game/scenes/dialogs/esc_dialog_player.gd" type="Script" id=2]
-[ext_resource path="res://addons/escoria-core/game/scenes/camera_player/camera.tscn" type="PackedScene" id=3]
-[ext_resource path="res://addons/escoria-ui-simplemouse/verbs_mouseicons.tscn" type="PackedScene" id=4]
-[ext_resource path="res://addons/escoria-ui-simplemouse/game.gd" type="Script" id=5]
-[ext_resource path="res://addons/escoria-ui-simplemouse/tooltip/target_tooltip.tscn" type="PackedScene" id=6]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/main_menu/main_menu.tscn" type="PackedScene" id=7]
-[ext_resource path="res://addons/escoria-core/ui_library/menus/pause_menu/pause_menu.tscn" type="PackedScene" id=8]
-[ext_resource path="res://addons/escoria-ui-simplemouse/theme.tres" type="Theme" id=9]
-
-[node name="game" type="Node2D"]
-script = ExtResource( 5 )
-main_menu = NodePath("CanvasLayer/main_menu")
-pause_menu = NodePath("CanvasLayer/pause_menu")
-editor_debug_mode = 1
-ui_parent_control_node = NodePath("CanvasLayer/ui")
-
-[node name="camera" parent="." instance=ExtResource( 3 )]
-
-[node name="dialog_layer" type="CanvasLayer" parent="."]
-layer = 3
-
-[node name="ESCDialogsPlayer" type="Control" parent="dialog_layer"]
-theme = ExtResource( 9 )
-script = ExtResource( 2 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="CanvasLayer" type="CanvasLayer" parent="."]
-
-[node name="ui" type="Control" parent="CanvasLayer"]
-anchor_top = 0.9
-anchor_right = 1.0
-anchor_bottom = 1.0
-mouse_filter = 2
-size_flags_horizontal = 3
-size_flags_vertical = 3
-theme = ExtResource( 9 )
-
-[node name="HBoxContainer" type="HBoxContainer" parent="CanvasLayer/ui"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-mouse_filter = 2
-size_flags_horizontal = 3
-size_flags_vertical = 3
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/ui/HBoxContainer"]
-margin_right = 58.0
-margin_bottom = 90.0
-mouse_filter = 2
-
-[node name="MenuButton" type="Button" parent="CanvasLayer/ui/HBoxContainer/VBoxContainer"]
-margin_right = 58.0
-margin_bottom = 27.0
-text = "Menu"
-
-[node name="Spacer" type="Control" parent="CanvasLayer/ui/HBoxContainer"]
-margin_left = 62.0
-margin_right = 1186.0
-margin_bottom = 90.0
-mouse_filter = 2
-size_flags_horizontal = 3
-
-[node name="inventory_ui" parent="CanvasLayer/ui/HBoxContainer" instance=ExtResource( 1 )]
-anchor_right = 0.0
-anchor_bottom = 0.0
-margin_left = 1190.0
-margin_right = 1280.0
-margin_bottom = 90.0
-rect_scale = Vector2( 1, 1 )
-
-[node name="pause_menu" parent="CanvasLayer" instance=ExtResource( 8 )]
-visible = false
-theme = ExtResource( 9 )
-
-[node name="main_menu" parent="CanvasLayer" instance=ExtResource( 7 )]
-visible = false
-
-[node name="tooltip_layer" type="CanvasLayer" parent="."]
-layer = 2
-
-[node name="tooltip" parent="tooltip_layer" instance=ExtResource( 6 )]
-mouse_filter = 2
-theme = ExtResource( 9 )
-bbcode_text = "[center][color=#000000][/color][/center]"
-fit_content_height = true
-
-[node name="mouse_layer" type="CanvasLayer" parent="."]
-layer = 2
-
-[node name="verbs_menu" parent="mouse_layer" instance=ExtResource( 4 )]
-anchor_right = 0.0
-anchor_bottom = 0.0
-margin_left = 156.0
-margin_top = 810.0
-margin_right = 156.0
-margin_bottom = 900.0
-grow_horizontal = 0
-size_flags_horizontal = 2
-size_flags_vertical = 3
-size_flags_stretch_ratio = 3.0
-
-[connection signal="pressed" from="CanvasLayer/ui/HBoxContainer/VBoxContainer/MenuButton" to="." method="_on_MenuButton_pressed"]
diff --git a/addons/escoria-ui-simplemouse/images/frame.png b/addons/escoria-ui-simplemouse/images/frame.png
deleted file mode 100755
index 2831220d..00000000
Binary files a/addons/escoria-ui-simplemouse/images/frame.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/images/inventory_bg.png b/addons/escoria-ui-simplemouse/images/inventory_bg.png
deleted file mode 100755
index 0efa8a0b..00000000
Binary files a/addons/escoria-ui-simplemouse/images/inventory_bg.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/images/inventory_icon.png b/addons/escoria-ui-simplemouse/images/inventory_icon.png
deleted file mode 100755
index 7f8f6371..00000000
Binary files a/addons/escoria-ui-simplemouse/images/inventory_icon.png and /dev/null differ
diff --git a/addons/escoria-ui-simplemouse/inventory/inventory_ui.gd b/addons/escoria-ui-simplemouse/inventory/inventory_ui.gd
deleted file mode 100644
index 2bc06be0..00000000
--- a/addons/escoria-ui-simplemouse/inventory/inventory_ui.gd
+++ /dev/null
@@ -1,55 +0,0 @@
-extends ESCInventory
-
-
-# Whether the inventory is visible currently
-var inventory_visible: bool = false
-
-
-func _ready() -> void:
- # Hide inventory by default
- $FloatingInventory/panel.rect_position.x = \
- ProjectSettings.get_setting("display/window/size/width")
-
-func _on_inventory_button_pressed():
- if $FloatingInventory/InventoryTween.is_active():
- return
- if inventory_visible:
- hide_inventory()
- else:
- show_inventory()
-
-
-func show_inventory():
- $FloatingInventory/InventoryTween.stop_all()
- $FloatingInventory/InventoryTween.remove_all()
- $FloatingInventory/InventoryTween.interpolate_property(
- $FloatingInventory/panel,
- "rect_position:x",
- $FloatingInventory/panel.rect_position.x,
- $FloatingInventory/panel.rect_position.x - \
- $FloatingInventory/panel.rect_size.x - \
- $HBoxContainer/inventory_button.rect_size.x,
- 0.6
- )
- $FloatingInventory/InventoryTween.start()
- yield($FloatingInventory/InventoryTween,"tween_all_completed")
- $FloatingInventory/InventoryTween.stop_all()
- inventory_visible = true
-
-
-func hide_inventory():
- $FloatingInventory/InventoryTween.stop_all()
- $FloatingInventory/InventoryTween.remove_all()
- $FloatingInventory/InventoryTween.interpolate_property(
- $FloatingInventory/panel,
- "rect_position:x",
- $FloatingInventory/panel.rect_position.x,
- $FloatingInventory/panel.rect_position.x + \
- $FloatingInventory/panel.rect_size.x + \
- $HBoxContainer/inventory_button.rect_size.x,
- 0.6
- )
- $FloatingInventory/InventoryTween.start()
- yield($FloatingInventory/InventoryTween,"tween_all_completed")
- $FloatingInventory/InventoryTween.stop_all()
- inventory_visible = false
diff --git a/addons/escoria-ui-simplemouse/inventory/inventory_ui.tscn b/addons/escoria-ui-simplemouse/inventory/inventory_ui.tscn
deleted file mode 100644
index 91e05f2d..00000000
--- a/addons/escoria-ui-simplemouse/inventory/inventory_ui.tscn
+++ /dev/null
@@ -1,104 +0,0 @@
-[gd_scene load_steps=6 format=2]
-
-[ext_resource path="res://addons/escoria-ui-simplemouse/inventory/inventory_ui.gd" type="Script" id=1]
-[ext_resource path="res://addons/escoria-ui-simplemouse/images/inventory_bg.png" type="Texture" id=2]
-[ext_resource path="res://addons/escoria-core/ui_library/inventory/esc_inventory_container.gd" type="Script" id=3]
-[ext_resource path="res://addons/escoria-ui-simplemouse/images/frame.png" type="Texture" id=5]
-[ext_resource path="res://addons/escoria-ui-simplemouse/images/inventory_icon.png" type="Texture" id=6]
-
-[node name="inventory_ui" type="Control"]
-anchor_right = 0.4
-anchor_bottom = 0.4
-margin_right = 768.0
-margin_bottom = 540.0
-rect_min_size = Vector2( 90, 90 )
-rect_scale = Vector2( 0.4, 0.4 )
-size_flags_horizontal = 0
-size_flags_vertical = 3
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": true
-}
-inventory_ui_container = NodePath("FloatingInventory/panel/MarginContainer/ScrollContainer/container")
-
-[node name="HBoxContainer" type="HBoxContainer" parent="."]
-anchor_right = 1.0
-anchor_bottom = 1.0
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="inventory_button" type="TextureButton" parent="HBoxContainer"]
-margin_right = 1280.0
-margin_bottom = 900.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-texture_normal = ExtResource( 6 )
-expand = true
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="frame" type="TextureRect" parent="HBoxContainer/inventory_button"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-texture = ExtResource( 5 )
-expand = true
-stretch_mode = 1
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="FloatingInventory" type="CanvasLayer" parent="."]
-
-[node name="panel" type="TextureRect" parent="FloatingInventory"]
-anchor_left = 1.0
-anchor_top = 1.0
-anchor_right = 1.0
-anchor_bottom = 1.0
-margin_left = -516.0
-margin_top = -160.0
-rect_min_size = Vector2( 0, 160 )
-mouse_filter = 2
-size_flags_horizontal = 3
-size_flags_vertical = 3
-texture = ExtResource( 2 )
-expand = true
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="MarginContainer" type="MarginContainer" parent="FloatingInventory/panel"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-mouse_filter = 2
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/margin_right = 20
-custom_constants/margin_top = 20
-custom_constants/margin_left = 20
-custom_constants/margin_bottom = 20
-
-[node name="ScrollContainer" type="ScrollContainer" parent="FloatingInventory/panel/MarginContainer"]
-margin_left = 20.0
-margin_top = 80.0
-margin_right = 496.0
-margin_bottom = 80.0
-mouse_filter = 2
-size_flags_horizontal = 3
-size_flags_vertical = 6
-scroll_vertical_enabled = false
-
-[node name="container" type="HBoxContainer" parent="FloatingInventory/panel/MarginContainer/ScrollContainer"]
-margin_right = 476.0
-mouse_filter = 2
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/separation = 20
-script = ExtResource( 3 )
-
-[node name="InventoryTween" type="Tween" parent="FloatingInventory"]
-
-[connection signal="pressed" from="HBoxContainer/inventory_button" to="." method="_on_inventory_button_pressed"]
diff --git a/addons/escoria-ui-simplemouse/plugin.cfg b/addons/escoria-ui-simplemouse/plugin.cfg
deleted file mode 100644
index 17ffeca5..00000000
--- a/addons/escoria-ui-simplemouse/plugin.cfg
+++ /dev/null
@@ -1,7 +0,0 @@
-[plugin]
-
-name="Escoria Simple Mouse UI"
-description="Simple Mouse UI for the Escoria Framework"
-author="StraToN"
-version="1.0.0"
-script="plugin.gd"
diff --git a/addons/escoria-ui-simplemouse/plugin.gd b/addons/escoria-ui-simplemouse/plugin.gd
deleted file mode 100644
index 6939397b..00000000
--- a/addons/escoria-ui-simplemouse/plugin.gd
+++ /dev/null
@@ -1,25 +0,0 @@
-# Plugin script to initialize Escoria simple mouse UI
-tool
-extends EditorPlugin
-
-
-# Override function to return the plugin name.
-func get_plugin_name():
- return "escoria-ui-simplemouse"
-
-
-# Deregister UI
-func disable_plugin():
- print("Disabling plugin Escoria UI Simple Mouse.")
- EscoriaPlugin.deregister_ui("res://addons/escoria-ui-simplemouse/game.tscn")
-
-
-# Register UI with Escoria
-func enable_plugin():
- print("Enabling plugin Escoria UI Simple Mouse.")
- if not EscoriaPlugin.register_ui(self, "res://addons/escoria-ui-simplemouse/game.tscn"):
- get_editor_interface().set_plugin_enabled(
- get_plugin_name(),
- false
- )
-
diff --git a/addons/escoria-ui-simplemouse/theme.tres b/addons/escoria-ui-simplemouse/theme.tres
deleted file mode 100644
index 7d9264bd..00000000
--- a/addons/escoria-ui-simplemouse/theme.tres
+++ /dev/null
@@ -1,6 +0,0 @@
-[gd_resource type="Theme" load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-ui-simplemouse/fonts/caslonantique.tres" type="DynamicFont" id=1]
-
-[resource]
-default_font = ExtResource( 1 )
diff --git a/addons/escoria-ui-simplemouse/tooltip/target_tooltip.tscn b/addons/escoria-ui-simplemouse/tooltip/target_tooltip.tscn
deleted file mode 100644
index 32278a95..00000000
--- a/addons/escoria-ui-simplemouse/tooltip/target_tooltip.tscn
+++ /dev/null
@@ -1,11 +0,0 @@
-[gd_scene load_steps=2 format=2]
-
-[ext_resource path="res://addons/escoria-ui-simplemouse/tooltip/tooltip_target.gd" type="Script" id=2]
-
-[node name="tooltip" type="RichTextLabel"]
-bbcode_enabled = true
-bbcode_text = "[center][color=#ffffff][/color][/center]"
-scroll_active = false
-script = ExtResource( 2 )
-color = Color( 1, 1, 1, 1 )
-offset_from_cursor = Vector2( 0, 0 )
diff --git a/addons/escoria-ui-simplemouse/tooltip/tooltip_target.gd b/addons/escoria-ui-simplemouse/tooltip/tooltip_target.gd
deleted file mode 100644
index 7874f8c6..00000000
--- a/addons/escoria-ui-simplemouse/tooltip/tooltip_target.gd
+++ /dev/null
@@ -1,28 +0,0 @@
-extends ESCTooltip
-
-
-signal tooltip_size_updated
-
-
-func update_tooltip_text():
- # Need to update size of bbcode rect before updating the text itself otherwise on the
- # first frame the text is wider than the default of 0 and ends up being really tall
- # and setting the wrong vertical margin for the tooltip
- update_size()
-
- # We signal this here since the processing in this class happens AFTER input
- # processing. We signal here to avoid "lagging" behind a frame since
- # tooltips are presently dependent on the size of the bounding box around
- # the rendered string.
- emit_signal("tooltip_size_updated")
-
- bbcode_text = "[center]"
- bbcode_text += "[color=#" + color.to_html(false) + "]"
- bbcode_text += current_target
- bbcode_text += "[/color]"
- bbcode_text += "[/center]"
-# push_align(RichTextLabel.ALIGN_CENTER)
-# push_color(color)
-# append_bbcode(current_target)
-# pop()
-# pop()
diff --git a/addons/escoria-ui-simplemouse/verbs_mouseicons.gd b/addons/escoria-ui-simplemouse/verbs_mouseicons.gd
deleted file mode 100644
index 39df5aef..00000000
--- a/addons/escoria-ui-simplemouse/verbs_mouseicons.gd
+++ /dev/null
@@ -1,53 +0,0 @@
-extends Control
-
-
-var current_cursor_id: int = 0
-onready var cursors: Array = $actions.get_children()
-
-
-"""
-This script is out of Escoria's scope. It controls the UI reaction to an
-UI event (eg right click) to change the cursor accordingly.
-"""
-enum UI_ACTIONS_DIRECTION {
- UP = 1,
- DOWN = -1
-}
-
-func _ready():
- if !Engine.is_editor_hint():
- current_cursor_id = cursors.size()
- iterate_actions_cursor(UI_ACTIONS_DIRECTION.UP)
-
-func _process(delta):
- $mouse_position.rect_global_position = get_global_mouse_position()
-
-
-func iterate_actions_cursor(direction: int):
- current_cursor_id += direction
- if current_cursor_id > cursors.size() - 1:
- current_cursor_id = 0
- elif current_cursor_id < 0:
- current_cursor_id = cursors.size() - 1
-
- Input.set_custom_mouse_cursor(cursors[current_cursor_id].texture)
- escoria.action_manager.set_current_action(cursors[current_cursor_id].name)
- if $mouse_position/tool.texture != null:
- clear_tool_texture()
-
-func set_by_name(name: String) -> void:
- for i in cursors.size():
- if cursors[i].name == name:
- current_cursor_id = i
- break
-
- Input.set_custom_mouse_cursor(cursors[current_cursor_id].texture)
- escoria.action_manager.set_current_action(cursors[current_cursor_id].name)
-
-func set_tool_texture(texture: Texture):
- set_process(true)
- $mouse_position/tool.texture = texture
-
-func clear_tool_texture():
- $mouse_position/tool.texture = null
- set_process(false)
diff --git a/addons/escoria-ui-simplemouse/verbs_mouseicons.tscn b/addons/escoria-ui-simplemouse/verbs_mouseicons.tscn
deleted file mode 100644
index 9934476f..00000000
--- a/addons/escoria-ui-simplemouse/verbs_mouseicons.tscn
+++ /dev/null
@@ -1,91 +0,0 @@
-[gd_scene load_steps=7 format=2]
-
-[ext_resource path="res://addons/escoria-ui-simplemouse/verbs_mouseicons.gd" type="Script" id=1]
-[ext_resource path="res://addons/escoria-ui-simplemouse/cursors/cursor_examine.png" type="Texture" id=2]
-[ext_resource path="res://addons/escoria-ui-simplemouse/cursors/cursor_tool.png" type="Texture" id=3]
-[ext_resource path="res://addons/escoria-ui-simplemouse/cursors/cursor_dialog.png" type="Texture" id=4]
-[ext_resource path="res://addons/escoria-ui-simplemouse/cursors/cursor_foot.png" type="Texture" id=5]
-[ext_resource path="res://addons/escoria-ui-simplemouse/cursors/cursor_hand.png" type="Texture" id=6]
-
-[node name="verbs_menu" type="Control"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-script = ExtResource( 1 )
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="actions" type="HBoxContainer" parent="."]
-visible = false
-anchor_right = 1.0
-anchor_bottom = 1.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="walk" type="TextureRect" parent="actions"]
-margin_left = 94.0
-margin_top = 418.0
-margin_right = 158.0
-margin_bottom = 482.0
-size_flags_horizontal = 6
-size_flags_vertical = 6
-texture = ExtResource( 5 )
-
-[node name="look" type="TextureRect" parent="actions"]
-margin_left = 350.0
-margin_top = 418.0
-margin_right = 414.0
-margin_bottom = 482.0
-size_flags_horizontal = 6
-size_flags_vertical = 6
-texture = ExtResource( 2 )
-
-[node name="pickup" type="TextureRect" parent="actions"]
-margin_left = 607.0
-margin_top = 418.0
-margin_right = 671.0
-margin_bottom = 482.0
-size_flags_horizontal = 6
-size_flags_vertical = 6
-texture = ExtResource( 6 )
-
-[node name="use" type="TextureRect" parent="actions"]
-margin_left = 864.0
-margin_top = 418.0
-margin_right = 928.0
-margin_bottom = 482.0
-size_flags_horizontal = 6
-size_flags_vertical = 6
-texture = ExtResource( 3 )
-
-[node name="talk" type="TextureRect" parent="actions"]
-margin_left = 1121.0
-margin_top = 418.0
-margin_right = 1185.0
-margin_bottom = 482.0
-size_flags_horizontal = 6
-size_flags_vertical = 6
-texture = ExtResource( 4 )
-
-[node name="mouse_position" type="Control" parent="."]
-margin_left = 546.519
-margin_top = 524.76
-margin_right = 546.519
-margin_bottom = 524.76
-mouse_filter = 2
-__meta__ = {
-"_edit_use_anchors_": false
-}
-
-[node name="tool" type="TextureRect" parent="mouse_position"]
-margin_left = 46.4475
-margin_top = 45.6984
-margin_right = 86.4475
-margin_bottom = 85.6984
-mouse_filter = 2
-__meta__ = {
-"_edit_use_anchors_": false
-}
diff --git a/addons/escoria-wizard/BackgroundItem.gd b/addons/escoria-wizard/BackgroundItem.gd
deleted file mode 100644
index 7e0a853b..00000000
--- a/addons/escoria-wizard/BackgroundItem.gd
+++ /dev/null
@@ -1,139 +0,0 @@
-tool
-extends MarginContainer
-
-var source_image:Image
-var image_stream_texture:StreamTexture
-var image_has_been_loaded:bool
-var image_size:Vector2
-
-# Called when the node enters the scene tree for the first time.
-func _ready() -> void:
- background_item_reset()
-
-
-func background_item_reset() -> void:
- $Content/GridContainer/ItemName.text = "replace_me"
- $Content/GridContainer/ItemGlobalID.text = ""
- $Content/GridContainer/StartsInnteractiveCheckBox.pressed = true
- if $Content/GridContainer/DefaultActionOption.get_item_count() > 0:
- $Content/GridContainer/DefaultActionOption.clear()
- for option_list in ["look", "pick up", "open", "close", "use", "push", "pull", "talk"]:
- $Content/GridContainer/DefaultActionOption.add_item(option_list)
- $Content/GridContainer/DefaultActionOption.selected = 0
- image_size = Vector2.ZERO
- image_has_been_loaded = false
-
-
-func background_on_ItemName_text_changed(new_text: String) -> void:
- $Content/GridContainer/ItemGlobalID.text = new_text
-
-
-func load_button_pressed() -> void:
- $LoadObjectGraphic/LoadObjectFileDialog.popup()
-
-
-func LoadObjectFileDialog_file_selected(path: String) -> void:
- image_stream_texture = load(path)
-
- $Content/GridContainer/Preview/Preview.texture = image_stream_texture
-
- var preview_size = $Content/GridContainer/Preview/Preview.rect_size
-
- # Calculate the scale to make the preview as big as possible in the preview window depending on
- # the height to width ratio of the frame
- image_size = image_stream_texture.get_size()
- var preview_scale = Vector2.ONE
- preview_scale.x = preview_size.x / image_size.x
- preview_scale.y = preview_size.y / image_size.y
-
- if preview_scale.y > preview_scale.x:
- $Content/GridContainer/Preview/Preview.rect_scale = Vector2(preview_scale.x, preview_scale.x)
- else:
- $Content/GridContainer/Preview/Preview.rect_scale = Vector2(preview_scale.y, preview_scale.y)
-
- $Content/GridContainer/ImageSize.text = "(%s, %s)" % [image_size.x, image_size.y]
-
- $Content/GridContainer/ImagePath.text = path
- image_has_been_loaded = true
-
-
-
-func _on_CreateButton_pressed() -> void:
- var err_window = "../InformationWindows/generic_error_window"
- if ! image_has_been_loaded:
- get_node(err_window).dialog_text = \
- "No image has been loaded."
- get_node(err_window).popup()
- return
- if $Content/GridContainer/ItemName.text == "replace_me":
- get_node(err_window).dialog_text = \
- "Please change the object name."
- get_node(err_window).popup()
- return
-
- var item = ESCItem.new()
- item.name = $Content/GridContainer/ItemName.text
- item.global_id = $Content/GridContainer/ItemGlobalID.text
- item.is_interactive = $Content/GridContainer/StartsInnteractiveCheckBox.pressed
- item.tooltip_name = $Content/GridContainer/ItemName.text
-
- var selected_index = $Content/GridContainer/DefaultActionOption.selected
- item.default_action = $Content/GridContainer/DefaultActionOption.get_item_text(selected_index)
-
- # Add sprite to the background item
- var item_sprite = Sprite.new()
- item_sprite.texture = $Content/GridContainer/Preview/Preview.texture
- item.add_child(item_sprite)
-
- # Add Dialog Position to the background item
- var interact_position = ESCLocation.new()
- interact_position.name = "interact_position"
- interact_position.position.y = image_size.y * 2
- print("A")
- item.add_child(interact_position)
-
- # Add Collision shape to the background item
- var rectangle_shape = RectangleShape2D.new()
- var collision_shape = CollisionShape2D.new()
-
- collision_shape.shape = rectangle_shape
- collision_shape.shape.extents = image_size / 2
- print("B")
- item.add_child(collision_shape)
- print("c")
- # Make it so all the nodes can be seen in the scene tree
- interact_position.set_owner(item)
- print("d")
- collision_shape.set_owner(item)
- print("e")
-
- item_sprite.set_owner(item)
-
- print("f")
-
-# get_tree().edited_scene_root.add_child(item)
-# item.set_owner(get_tree().edited_scene_root)
-
-
- var current_node = EditorPlugin.new().get_editor_interface().get_selection().get_selected_nodes()[0]
-# print("Cur = "+str(current_node))
-# print("Cur0 = "+str(current_node[0]))
- print("g")
-
- current_node.add_child(item)
- print("h")
-
-# item.set_owner(current_node)
- item.set_owner(get_tree().edited_scene_root)
- print("Created.")
- #item.queue_free()
-
-#func get_edited_root() -> Node:
-# var plugin := EditorPlugin.new()
-# var eds:EditorInterface
-# eds = plugin.get_selection()
-# var selected:EditorInterface
-# selected = eds.get_selected_nodes()[0]
-# if selected:
-# return selected.get_tree().get_edited_scene_root()
-# return null
diff --git a/addons/escoria-wizard/CharacterCreator.gd b/addons/escoria-wizard/CharacterCreator.gd
deleted file mode 100644
index 9e8cd4f7..00000000
--- a/addons/escoria-wizard/CharacterCreator.gd
+++ /dev/null
@@ -1,1733 +0,0 @@
-# Outstanding proposed features
-# v1.1 features
-# * Have the editor kick in when an ESCPlayer is selected, i.e. "load/edit"
-# * Add a settings page (if there's enough features to warrant it). This would have the path the scene gets written to, default angles for each direction so the developer can change them from the default 90s / 45s they are now, whether the ESCPlayer is click-through, errr can't think of anything else.
-# * Redo the Escoria tutorial to use the plugin.
-
-tool
-extends Control
-
-const METADATA_ANIM_NAME = "anim_name"
-const METADATA_SPRITESHEET_SOURCE_FILE = "spritesheet_source_file"
-const METADATA_SPRITESHEET_FRAMES_HORIZ = "spritesheet_frames_horiz"
-const METADATA_SPRITESHEET_FRAMES_VERT = "spritesheet_frames_vert"
-const METADATA_SPRITESHEET_FIRST_FRAME = "spritesheet_first_frame"
-const METADATA_SPRITESHEET_LAST_FRAME = "spritesheet_last_frame"
-const METADATA_SPEED = "speed"
-const METADATA_IS_MIRROR = "is_mirror"
-
-const DIR_UP = "up"
-const DIR_UP_RIGHT = "upright"
-const DIR_RIGHT = "right"
-const DIR_DOWN_RIGHT = "downright"
-const DIR_DOWN = "down"
-const DIR_DOWN_LEFT = "downleft"
-const DIR_LEFT = "left"
-const DIR_UP_LEFT = "upleft"
-
-const DIR_LIST_8 = [DIR_UP, DIR_UP_RIGHT, DIR_RIGHT, DIR_DOWN_RIGHT, DIR_DOWN, DIR_DOWN_LEFT, \
- DIR_LEFT, DIR_UP_LEFT]
-const DIR_LIST_4 = [DIR_UP, DIR_RIGHT, DIR_DOWN, DIR_LEFT]
-const DIR_LIST_2 = [DIR_RIGHT, DIR_LEFT]
-const DIR_LIST_1 = [DIR_DOWN]
-
-const TYPE_WALK = "walk"
-const TYPE_TALK = "talk"
-const TYPE_IDLE = "idle"
-
-const ANIM_IN_PROGRESS = "in_progress"
-
-const ANIMATION_SPEED_LABEL = "Animation speed"
-
-# Make the code more readable by shortening node references using constants
-const NAME_NODE = "VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"
-const DIR_COUNT_NODE = "VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer"
-const CHAR_TYPE_NODE = "VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/HBoxContainer"
-const ANIM_TYPE_NODE = "VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer"
-const MIRROR_NODE = "VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer3/mirror_checkbox"
-const ARROWS_NODE = "VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"
-const PREVIEW_NODE = "VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/preview/MarginContainer"
-const PREVIEW_BGRND_NODE = "VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/preview/anim_preview_background"
-const ANIM_CONTROLS_NODE = "VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"
-const STORE_ANIM_NODE = "VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim"
-const SCROLL_VBOX_NODE = "VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/"
-const SCROLL_CTRL_NODE = "VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control"
-const NO_SPRITESHEET_NODE = "VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control/MarginContainer/no_spritesheet_found_sprite"
-const CURRENT_SHEET_NODE = "VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_current/MarginContainer2/current_spritesheet_label"
-const ZOOM_LABEL_NODE = "VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll/zoom_label"
-const ZOOM_SCROLL_NODE = "VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll/MarginContainer/zoom_scrollbar"
-const CHARACTER_PATH_NODE = "VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer/character_path"
-const GENERIC_ERROR_NODE = "InformationWindows/generic_error_window"
-const UNSTORED_CHANGE_NODE = "InformationWindows/unstored_changes_window"
-const UNSTORED_ANIMTYPE_CHANGE_NODE = "InformationWindows/unstored_changes_window_anim_change"
-const EXPORT_PROGRESS_NODE = "InformationWindows/export_progress"
-const PROGRESS_LABEL_NODE = "InformationWindows/export_progress/progress_label"
-const EXPORT_COMPLETE_NODE = "InformationWindows/export_complete"
-const FILE_DIALOG_NODE = "ImageFileDialog"
-const CHARACTER_FILE_NODE = "CharacterPathFileDialog"
-const CONFIG_FILE = "escoria-wizard.conf"
-
-
-# Test flag - set to true to load test data.
-var test_mode: bool = false
-
-# The currently loaded spritesheet image
-var source_image: Image
-
-# The current size of each animation frame (the spritesheet is broken into squares of this size.
-var frame_size: Vector2
-
-# The current spritesheet zoom level.
-var zoom_value: float = 1
-
-# The speed of the animation being previewed in frames-per-second.
-var current_animation_speed: int = 5
-
-# The animation direction currently being edited
-var direction_selected: String
-
-# This is the animation direction that has been clicked on by the user.
-# Once it has been confirmed that there are no unstored changes to the current animation,
-# the requested direction will become the "direction_selected".
-var direction_requested: String
-
-# The animation type currently being edited
-var animation_type_selected: String
-
-# This is the animation ty[e that has been clicked on by the user.
-# Once it has been confirmed that there are no unstored changes to the current animation,
-# the requested type will become the "animation_type_selected".
-var animation_type_requested: String
-
-# This is the array that stores the data for each animation.
-var anim_metadata = []
-
-# Track the page showing in the help window
-var help_window_page = 1
-
-# Array to track frame settings so if you do an illegal action (like changing the last sprite frame
-# prior to a spritesheet being loaded) the value can be reset
-var spritesheet_settings = [1, 1, 0, 0]
-
-# To stop errors flagging when you change to a mirrored direction
-var currently_changing_direction: bool = false
-
-# Whether all changes are automatically 'saved' or need manual confirmation before storing
-var autostore: bool = false
-
-# Needed due to the yield method used for export to pass back the largest sprite used
-# for the character. This will determine the collision shape size.
-var export_largest_sprite: Vector2
-
-
-func _ready() -> void:
- load_settings()
- character_creator_reset()
- $InformationWindows/help_window.current_page = 1
-
- if test_mode:
- setup_test_data()
-
-
-func character_creator_reset() -> void:
- # Disconnect all the signals to stop program logic firing during setup
- disconnect_selector_signals()
-
- get_node(NAME_NODE).get_node("node_name").text = "replace_me"
- get_node(NAME_NODE).get_node("global_id").text = ""
- get_node(DIR_COUNT_NODE).get_node("four_directions").pressed = true
-
- # For unknown reasons the above doesn't cause the trigger to fire so manual steps required
- get_node(DIR_COUNT_NODE).get_node("eight_directions").pressed = false
- get_node(DIR_COUNT_NODE).get_node("two_directions").pressed = false
- get_node(DIR_COUNT_NODE).get_node("one_direction").pressed = false
-
- get_node(ANIM_TYPE_NODE).get_node("walk_checkbox").pressed = true
- animation_type_selected = "walk"
-
- # For unknown reasons the above doesn't cause the trigger to fire so manual steps required
- if get_node(ANIM_TYPE_NODE).get_node("talk_checkbox").pressed:
- get_node(ANIM_TYPE_NODE).get_node("talk_checkbox").pressed = false
-
- if get_node(ANIM_TYPE_NODE).get_node("idle_checkbox").pressed:
- get_node(ANIM_TYPE_NODE).get_node("idle_checkbox").pressed = false
-
- get_node(NO_SPRITESHEET_NODE).visible = true
- zoom_value = 1
- get_node(ZOOM_SCROLL_NODE).value = zoom_value
- get_node(ZOOM_LABEL_NODE).text = "Zoom: %sx" % str(zoom_value)
- get_node(ANIM_CONTROLS_NODE).get_node("original_size_label").text = "Source sprite size: (0, 0)"
- get_node(ANIM_CONTROLS_NODE).get_node("frame_size_label").text = "Frame size: (0, 0)"
- get_node(PREVIEW_NODE).get_node("anim_preview_sprite").animation = ANIM_IN_PROGRESS
-
- preview_hide()
-
- get_node(STORE_ANIM_NODE).visible = false
-
- create_empty_animations()
-
- direction_selected = DIR_UP
- activate_direction(direction_selected)
-
- reset_arrow_colours()
-
- # Reset GUI controls to initial values
- get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value = spritesheet_settings[0]
- get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").value = spritesheet_settings[1]
- get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value = spritesheet_settings[2]
- get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value = spritesheet_settings[3]
- get_node(ANIM_CONTROLS_NODE).get_node("anim_speed_scroll_bar").value = current_animation_speed
- get_node(ANIM_CONTROLS_NODE).get_node("anim_speed_label").text = "%s: 5 FPS" % ANIMATION_SPEED_LABEL
- get_node(CURRENT_SHEET_NODE).text="No spritesheet loaded."
- # Connect all the signals now the base settings are configured to stop program logic firing during setup
- reset_frame_outlines()
-
- # Make sure help window doesn't swallow mouse input
- $InformationWindows.visible = false
- autostore = $VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/HBoxContainer/AutoStoreCheckBox.pressed
- connect_selector_signals()
-
-
-func connect_selector_signals() -> void:
- get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").connect("value_changed", self, "controls_on_h_frames_spin_box_value_changed")
- get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").connect("value_changed", self, "controls_on_v_frames_spin_box_value_changed")
- get_node(ANIM_CONTROLS_NODE).get_node("start_frame").connect("value_changed", self, "controls_on_start_frame_value_changed")
- get_node(ANIM_CONTROLS_NODE).get_node("end_frame").connect("value_changed", self, "controls_on_end_frame_value_changed")
- get_node(ANIM_CONTROLS_NODE).get_node("anim_speed_scroll_bar").connect("value_changed", self, "controls_on_anim_speed_scroll_bar_value_changed")
-
-
-func disconnect_selector_signals() -> void:
- if get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").is_connected("value_changed", self, "controls_on_h_frames_spin_box_value_changed"):
- get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").disconnect("value_changed", self, "controls_on_h_frames_spin_box_value_changed")
-
- if get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").is_connected("value_changed", self, "controls_on_v_frames_spin_box_value_changed"):
- get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").disconnect("value_changed", self, "controls_on_v_frames_spin_box_value_changed")
-
- if get_node(ANIM_CONTROLS_NODE).get_node("start_frame").is_connected("value_changed", self, "controls_on_start_frame_value_changed"):
- get_node(ANIM_CONTROLS_NODE).get_node("start_frame").disconnect("value_changed", self, "controls_on_start_frame_value_changed")
-
- if get_node(ANIM_CONTROLS_NODE).get_node("end_frame").is_connected("value_changed", self, "controls_on_end_frame_value_changed"):
- get_node(ANIM_CONTROLS_NODE).get_node("end_frame").disconnect("value_changed", self, "controls_on_end_frame_value_changed")
-
- if get_node(ANIM_CONTROLS_NODE).get_node("anim_speed_scroll_bar").is_connected("value_changed", self, "controls_on_anim_speed_scroll_bar_value_changed"):
- get_node(ANIM_CONTROLS_NODE).get_node("anim_speed_scroll_bar").disconnect("value_changed", self, "controls_on_anim_speed_scroll_bar_value_changed")
-
-
-func reset_frame_outlines() -> void:
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").zoom_factor = .01
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").total_num_columns = 1
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").total_num_rows = 1
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").start_cell = 0
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").end_cell = 0
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").cell_size = Vector2(1,1)
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").update()
-
-
-func calc_sprite_size() -> void:
- var source_size = source_image.get_size()
- var horiz_size = int(source_size.x / get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value)
- var vert_size = int(source_size.y / get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").value)
-
- frame_size = Vector2(horiz_size, vert_size)
-
- get_node(ANIM_CONTROLS_NODE).get_node("original_size_label").text = "Source sprite size: %s" % source_size
- get_node(ANIM_CONTROLS_NODE).get_node("frame_size_label").text = "Frame size: %s" % frame_size
-
-
-# Load test data - primarily for testing export, but also for testing general functionality.
-# Different spritesheets, mirroring settings, frame counts, and speeds are used deliberately.
-func setup_test_data() -> void:
-# load_spritesheet("res://addons/escoria-wizard/graphics/mark-animtest.png")
-# # Up, right, down, left, up/r, down/r, down/l, up/l
-# var start_frames = [15, 10, 7, 10, 12, 14, 1, 14, 12, 3, 1, 1]
-# var end_frames = [17, 14, 9, 14, 13, 18, 3, 18, 12, 3, 1, 22]
-# var mirrored = [0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0,]
-# var sourcefile = [0, 0, 0, 0, 2, 2, 1, 2, 2, 0, 0, 0]
-# var fps = [3, 3, 1, 3, 3, 3, 1, 3, 3, 3, 1, 3]
-#
-# for loop in range(12): # 12 for a 4 direction character, 24 for an 8 direction character
-# if sourcefile[loop] == 0:
-# anim_metadata[loop * 2][METADATA_SPRITESHEET_SOURCE_FILE] = "res://addons/escoria-wizard/graphics/mark-animtest.png"
-# anim_metadata[loop * 2][METADATA_SPRITESHEET_FRAMES_HORIZ] = 8
-# anim_metadata[loop * 2][METADATA_SPRITESHEET_FRAMES_VERT] = 3
-# elif sourcefile[loop] == 1:
-# anim_metadata[loop * 2][METADATA_SPRITESHEET_SOURCE_FILE] = "res://game/characters/mark/png/mark_talk_down.png"
-# anim_metadata[loop * 2][METADATA_SPRITESHEET_FRAMES_HORIZ] = 3
-# anim_metadata[loop * 2][METADATA_SPRITESHEET_FRAMES_VERT] = 1
-# else:
-# anim_metadata[loop * 2][METADATA_SPRITESHEET_SOURCE_FILE] = "res://game/characters/mark/png/markjester_talk.png"
-# anim_metadata[loop * 2][METADATA_SPRITESHEET_FRAMES_HORIZ] = 21
-# anim_metadata[loop * 2][METADATA_SPRITESHEET_FRAMES_VERT] = 1
-#
-# anim_metadata[loop * 2][METADATA_SPRITESHEET_FIRST_FRAME] = start_frames[loop]
-# anim_metadata[loop * 2][METADATA_SPRITESHEET_LAST_FRAME] = end_frames[loop]
-# anim_metadata[loop * 2][METADATA_SPEED] = fps[loop]
-#
-# anim_metadata[loop * 2][METADATA_IS_MIRROR] = mirrored[loop] != 0
-#
-# get_node(NO_SPRITESHEET_NODE).visible = false
-#
-# reset_arrow_colours()
- # Up, right, down, left, up/r, down/r, down/l, up/l
- var spritebase:String="addons/escoria-wizard/graphics/robot"
-# load_spritesheet("" + $spritepath + "/walk_up.png")
- var start_frames = [1,1,1,1,1,1,1,1, 1,1,1,1,1,1,1,1, 5,6,4,3,1,2,4,6]
- var end_frames = [16,16,16,16,16,16,16,16, 53,53,53,53,53,53,53,53, 5,6,4,3,1,2,4,6]
- var mirrored = [0,0,0,0,0,0,1,1, 0,0,0,0,0,0,1,1, 0,1,1,0,0,0,0,0]
- var frames_h = [16,16,16,16,16,16,16,16, 14,14,14,14,14,14,14,14, 6,6,6,6,6,6,6,6]
- var frames_v = [1,1,1,1,1,1,1,1, 4,4,4,4,4,4,4,4, 1,1,1,1,1,1,1,1]
-
- anim_metadata[0][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/walk_up.png"
- anim_metadata[1][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/walk_upright.png"
- anim_metadata[2][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/walk_right.png"
- anim_metadata[3][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/walk_downright.png"
- anim_metadata[4][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/walk_down.png"
- anim_metadata[5][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/walk_downleft.png"
- anim_metadata[6][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/walk_right.png"
- anim_metadata[7][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/walk_upright.png"
-
- anim_metadata[8][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/talk_up.png"
- anim_metadata[9][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/talk_upright.png"
- anim_metadata[10][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/talk_right.png"
- anim_metadata[11][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/talk_downright.png"
- anim_metadata[12][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/talk_down.png"
- anim_metadata[13][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/talk_downleft.png"
- anim_metadata[14][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/talk_right.png"
- anim_metadata[15][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/talk_upright.png"
-
- anim_metadata[16][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/idle_all.png"
- anim_metadata[17][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/idle_all.png"
- anim_metadata[18][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/idle_all.png"
- anim_metadata[19][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/idle_all.png"
- anim_metadata[20][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/idle_all.png"
- anim_metadata[21][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/idle_all.png"
- anim_metadata[22][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/idle_all.png"
- anim_metadata[23][METADATA_SPRITESHEET_SOURCE_FILE] = spritebase + "/idle_all.png"
-
- for loop in range(24):
- anim_metadata[loop][METADATA_SPRITESHEET_FIRST_FRAME] = start_frames[loop]
- anim_metadata[loop][METADATA_SPRITESHEET_LAST_FRAME] = end_frames[loop]
- anim_metadata[loop][METADATA_SPEED] = 24
- anim_metadata[loop][METADATA_IS_MIRROR] = mirrored[loop] != 0
- anim_metadata[loop][METADATA_SPRITESHEET_FRAMES_HORIZ] = frames_h[loop]
- anim_metadata[loop][METADATA_SPRITESHEET_FRAMES_VERT] = frames_v[loop]
-
- get_node(NO_SPRITESHEET_NODE).visible = false
- get_node(DIR_COUNT_NODE).get_node("eight_directions").pressed = true
- for loop in ["four_directions", "two_directions", "one_direction"]:
- get_node(DIR_COUNT_NODE).get_node(loop).pressed = false
- reset_arrow_colours()
-
-
-# Animations are stored as metadata in an array. This creates the initial empty array.
-# The preview animation ("in_progress") is the only sprite animation created prior to the final export.
-func create_empty_animations() -> void:
- var sframes = SpriteFrames.new()
-
- var metadata_dict = {
- METADATA_ANIM_NAME: "tbc",
- METADATA_SPRITESHEET_SOURCE_FILE: "tbc",
- METADATA_SPRITESHEET_FRAMES_HORIZ: -1,
- METADATA_SPRITESHEET_FRAMES_VERT: -1,
- METADATA_SPRITESHEET_FIRST_FRAME: 0,
- METADATA_SPRITESHEET_LAST_FRAME: 0,
- METADATA_SPEED: 30,
- METADATA_IS_MIRROR: false
- }
-
- var local_dict
-
- anim_metadata.clear()
-
- for typeloop in [TYPE_WALK, TYPE_TALK, TYPE_IDLE]:
- for dirloop in DIR_LIST_8:
- local_dict = metadata_dict.duplicate()
- local_dict[METADATA_ANIM_NAME] = "%s_%s" % [typeloop, dirloop]
- anim_metadata.append(local_dict)
-
- sframes.add_animation(ANIM_IN_PROGRESS)
-
- get_node(PREVIEW_NODE).get_node("anim_preview_sprite").frames = sframes
-
-
-# Loads a spritesheet and calculates the size of each sprite frame if loading a spritesheet
-# to show a previously stored animation.
-func load_spritesheet(file_to_load, read_settings_from_metadata: bool = false, metadata_frame: int = 0) -> void:
- if source_image == null:
- source_image = Image.new()
-
- var errorval = source_image.load(file_to_load)
-
- assert(not errorval, "Error loading file %s" % str(file_to_load))
-
- var texture = ImageTexture.new()
- texture.create_from_image(source_image)
- texture.set_flags(2)
-
- get_node(SCROLL_CTRL_NODE).get_node("spritesheet_sprite").texture = texture
-
- frame_size = source_image.get_size()
-
- if read_settings_from_metadata:
- get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value = anim_metadata[metadata_frame][METADATA_SPRITESHEET_FRAMES_HORIZ]
- get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").value = anim_metadata[metadata_frame][METADATA_SPRITESHEET_FRAMES_VERT]
- else:
- get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value = 1
- get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").value = 1
- get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value = 1
- get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value = 1
-
- calc_sprite_size()
-
- get_node(CURRENT_SHEET_NODE).text = file_to_load
- draw_frame_outlines()
- set_zoom_scale_automatically(source_image.get_size())
-
- # Make scroll bars appear if necessary
- get_node(SCROLL_CTRL_NODE).get_node("spritesheet_sprite").rect_min_size = source_image.get_size() * zoom_value
-
-
-# spritesheet is loaded.
-func set_zoom_scale_automatically(spritesheet_size) -> void:
-
- var available_space = get_node(SCROLL_VBOX_NODE).get_node("spritesheet_scroll_container").rect_size
-
- # Calculate the scale to make the preview as big as possible in the preview window depending on
- # the height to width ratio of the frame
- var spritesheet_scale = Vector2.ONE
- spritesheet_scale.x = available_space.x / spritesheet_size.x
- spritesheet_scale.y = available_space.y / spritesheet_size.y
- var blah = Vector2.ONE
- blah.x = spritesheet_size.x / available_space.x
- blah.y = spritesheet_size.y / available_space.y
-
- var newscale = 0.0
- if spritesheet_scale.y > spritesheet_scale.x:
- # Round to 1 decimal place
- newscale = (int(spritesheet_scale.x * 10.0)) / 10.0
- else:
- # Round to 1 decimal place
- newscale = (int(spritesheet_scale.y * 10.0)) / 10.0
- if newscale < 0.1:
- newscale = 0.1
- if newscale > 5:
- newscale = 5
- get_node(ZOOM_SCROLL_NODE).value = newscale
-
-
-# Draws an outline on the spritesheet to show which frames are included in the current animation
-func draw_frame_outlines() -> void:
- check_frame_limits()
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").zoom_factor = zoom_value
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").total_num_columns = get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").total_num_rows = get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").value
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").start_cell = get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").end_cell = get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").cell_size = frame_size
- get_node(SCROLL_CTRL_NODE).get_node("frame_rectangles").update()
-
-
-# When given a frame number, this calculates the pixel coordinates that frame in the spritesheet
-# based on the number of horizontal/vertical frames configured for this spritesheet
-func calc_frame_coords(Frame: int) -> Vector2:
- var column = (Frame - 1) % int(get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value) * frame_size.x
- var row = int((Frame - 1) / get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value) * frame_size.y
- return Vector2(column, row)
-
-
-# Updates the animation metadata to store the changed / new settings for a particular animation
-func store_animation(animation_to_store: String) -> void:
- var texture
- var rect_location
- var frame_being_copied = Image.new()
- var frame_counter: int = 0
-
- var metadata_dict = {
- METADATA_ANIM_NAME: animation_to_store,
- METADATA_SPRITESHEET_SOURCE_FILE: get_node(CURRENT_SHEET_NODE).text,
- METADATA_SPRITESHEET_FRAMES_HORIZ: get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value,
- METADATA_SPRITESHEET_FRAMES_VERT: get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").value,
- METADATA_SPRITESHEET_FIRST_FRAME: get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value,
- METADATA_SPRITESHEET_LAST_FRAME: get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value,
- METADATA_SPEED: get_node(ANIM_CONTROLS_NODE).get_node("anim_speed_scroll_bar").value,
- METADATA_IS_MIRROR: get_node(MIRROR_NODE).pressed
- }
-
- var metadata_array_offset: int = get_metadata_array_offset()
-
- anim_metadata[metadata_array_offset] = metadata_dict
-
- if direction_selected == DIR_UP or direction_selected == DIR_DOWN:
- return
-
- # If this direction has already been mirrored, replicate the changes
- var opp_dir = find_opposite_direction(direction_selected)
- var opp_metadata_array_offset: int = get_metadata_array_offset(opp_dir)
- if anim_metadata[opp_metadata_array_offset][METADATA_IS_MIRROR]:
- mirror_animation(direction_selected, opp_dir)
-
-
-# Updates the metadata to mirror animation "source" to animation "dest"
-# The "source" animation is the animation that really exists as sprite frames
-# in the animated sprite
-func mirror_animation(source: String, dest: String) -> void:
- var texture
- var rect_location
- var frame_being_copied = Image.new()
- var frame_counter: int = 0
-#
- var metadata_source_offset = get_metadata_array_offset(source)
- var current_anim_type = return_current_animation_type()
- var dest_anim_name = "%s_%s" % [current_anim_type, dest]
-
- var metadata_dict = {
- METADATA_ANIM_NAME: dest_anim_name,
- METADATA_SPRITESHEET_SOURCE_FILE: anim_metadata[metadata_source_offset][METADATA_SPRITESHEET_SOURCE_FILE],
- METADATA_SPRITESHEET_FRAMES_HORIZ: anim_metadata[metadata_source_offset][METADATA_SPRITESHEET_FRAMES_HORIZ],
- METADATA_SPRITESHEET_FRAMES_VERT: anim_metadata[metadata_source_offset][METADATA_SPRITESHEET_FRAMES_VERT],
- METADATA_SPRITESHEET_FIRST_FRAME: anim_metadata[metadata_source_offset][METADATA_SPRITESHEET_FIRST_FRAME],
- METADATA_SPRITESHEET_LAST_FRAME: anim_metadata[metadata_source_offset][METADATA_SPRITESHEET_LAST_FRAME],
- METADATA_SPEED: anim_metadata[metadata_source_offset][METADATA_SPEED],
- METADATA_IS_MIRROR: true
- }
-
- var metadata_dest_offset = get_metadata_array_offset(dest)
- anim_metadata[metadata_dest_offset] = metadata_dict
- disconnect_selector_signals()
- reset_arrow_colours()
- connect_selector_signals()
-
-func unmirror_animation(anim_to_unmirror: String) -> void:
- var metadata_dict = {
- METADATA_ANIM_NAME: "tbc",
- METADATA_SPRITESHEET_SOURCE_FILE: "tbc",
- METADATA_SPRITESHEET_FRAMES_HORIZ: -1,
- METADATA_SPRITESHEET_FRAMES_VERT: -1,
- METADATA_SPRITESHEET_FIRST_FRAME: 0,
- METADATA_SPRITESHEET_LAST_FRAME: 0,
- METADATA_SPEED: 30,
- METADATA_IS_MIRROR: false
- }
- spritesheet_settings[2] = 0
- spritesheet_settings[3] = 0
- var metadata_dest_offset = get_metadata_array_offset(anim_to_unmirror)
- anim_metadata[metadata_dest_offset] = metadata_dict
- reset_arrow_colours()
-
-
-# Shows the preview animation. Required as the no_anim_found sprite doesn't always cover the
-# whole preview due to UI peculiarities.
-func preview_show():
- get_node(PREVIEW_NODE).get_node("no_anim_found_sprite").visible = false
- get_node(PREVIEW_NODE).get_node("anim_preview_sprite").visible = true
-
-
-# Hides the preview animation. Required when the no_anim_found sprite doesn't cover the
-# whole preview due to UI peculiarities.
-func preview_hide():
- get_node(PREVIEW_NODE).get_node("no_anim_found_sprite").visible = true
- get_node(PREVIEW_NODE).get_node("anim_preview_sprite").visible = false
-
-
-# Creates the "in_progress" animation which is shown in the UI as the animation preview based
-# on the currently selected settings.
-#
-# A mirrored animation (frames in reverse order and sprites horizontally flipped) is generated here
-# for the purpose of the preview but isn't generated in the final export as it relies on ESCPlayer's
-# is_mirrored setting.
-func preview_update() -> void:
- if get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value > 0:
- check_frame_limits()
-
- var current_anim_type = return_current_animation_type()
- var anim_name = "%s_%s" % [current_anim_type, direction_selected]
- var offset = get_metadata_array_offset()
- var generate_mirror = get_node(MIRROR_NODE).pressed
-
- var texture
- var rect_location
- var frame_being_copied = Image.new()
- var frame_counter: int = 0
-
- get_node(PREVIEW_NODE).get_node("anim_preview_sprite").frames.clear(ANIM_IN_PROGRESS)
-
- frame_being_copied.create(frame_size.x, frame_size.y, false, source_image.get_format())
-
- for loop in range(get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value - get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value + 1):
- texture = ImageTexture.new()
- rect_location = calc_frame_coords(get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value + loop)
- frame_being_copied.blit_rect(source_image, Rect2(rect_location, Vector2(frame_size.x, frame_size.y)), Vector2(0, 0))
-
- if generate_mirror:
- frame_being_copied.flip_x()
-
- texture.create_from_image(frame_being_copied)
- # Remove the image filter to make pixel correct graphics
- texture.set_flags(2)
- get_node(PREVIEW_NODE).get_node("anim_preview_sprite").frames.add_frame(ANIM_IN_PROGRESS, texture, frame_counter)
- frame_counter += 1
- preview_show()
-
- # Calculate the scale to make the preview as big as possible in the preview window depending on
- # the height to width ratio of the frame
- var preview_scale = Vector2.ONE
- preview_scale.x = get_node(PREVIEW_BGRND_NODE).rect_size.x / frame_size.x
- preview_scale.y = get_node(PREVIEW_BGRND_NODE).rect_size.y / frame_size.y
-
- if preview_scale.y > preview_scale.x:
- get_node(PREVIEW_NODE).get_node("anim_preview_sprite").scale = Vector2(preview_scale.x, preview_scale.x)
- else:
- get_node(PREVIEW_NODE).get_node("anim_preview_sprite").scale = Vector2(preview_scale.y, preview_scale.y)
- else:
- preview_hide()
-
-
-# Ensure that the spritesheet settings are valid
-func check_frame_limits():
- var max_frame = get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value * get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").value
-
- if get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value > max_frame:
- get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value = max_frame
-
- if get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value > max_frame:
- get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value = max_frame
-
- if get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value > get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value:
- get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value = get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value
-
-# If any spritesheet settings have changed, display the "store animation" button to save the changes.
-# If the values are manually reset after a change to the previously stored settings, the button will disappear.
-func check_if_controls_have_changed():
- var metadata_array_offset: int = get_metadata_array_offset()
- var metadata_entry = anim_metadata[metadata_array_offset]
-
- if autostore == true:
- return
-
- # Need to check this or it registers if you load a sprite and set the number of horizontal
- # or vertical frames and haven't set a start/end frame yet
- if get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value > 0:
- get_node(STORE_ANIM_NODE).visible = \
- get_node(ANIM_CONTROLS_NODE).get_node("anim_speed_scroll_bar").value != metadata_entry[METADATA_SPEED] \
- or get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value != metadata_entry[METADATA_SPRITESHEET_FIRST_FRAME] \
- or get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value != metadata_entry[METADATA_SPRITESHEET_LAST_FRAME] \
- or get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value != metadata_entry[METADATA_SPRITESHEET_FRAMES_HORIZ] \
- or get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").value != metadata_entry[METADATA_SPRITESHEET_FRAMES_VERT]
-
-
-# If the user tries to change settings before they've loaded a spritesheet, this will display
-# a warning window instead of letting them change settings.
-func has_spritesheet_been_loaded() -> bool:
- if source_image == null:
- get_node(GENERIC_ERROR_NODE).dialog_text = "Please load a spritesheet to begin."
- get_node(GENERIC_ERROR_NODE).popup()
- return false
- return true
-
-
-func animation_on_dir_up_pressed() -> void:
- check_activate_direction(DIR_UP)
-
-
-# Runs when the direction arrow is clicked
-func animation_on_dir_right_pressed() -> void:
- check_activate_direction(DIR_RIGHT)
-
-
-# Runs when the direction arrow is clicked
-func animation_on_dir_left_pressed() -> void:
- check_activate_direction(DIR_LEFT)
-
-
-# Runs when the direction arrow is clicked
-func animation_on_dir_down_pressed() -> void:
- check_activate_direction(DIR_DOWN)
-
-
-# Runs when the direction arrow is clicked
-func animation_on_dir_downright_pressed() -> void:
- check_activate_direction(DIR_DOWN_RIGHT)
-
-
-# Runs when the direction arrow is clicked
-func animation_on_dir_downleft_pressed() -> void:
- check_activate_direction(DIR_DOWN_LEFT)
-
-
-# Runs when the direction arrow is clicked
-func animation_on_dir_upright_pressed() -> void:
- check_activate_direction(DIR_UP_RIGHT)
-
-
-# Runs when the direction arrow is clicked
-func animation_on_dir_upleft_pressed() -> void:
- check_activate_direction(DIR_UP_LEFT)
-
-
-# If the user tries to mirror an animation, ensure they're not trying to mirror an already
-# mirrored direction, and that the direction they're trying to mirror has been created.
-func animation_on_mirror_checkbox_toggled(button_pressed: bool) -> void:
- if not has_spritesheet_been_loaded():
- get_node(GENERIC_ERROR_NODE).dialog_text = "No animation has been configured."
- get_node(GENERIC_ERROR_NODE).popup()
- get_node(MIRROR_NODE).pressed = false
- return
-
- var opp_dir = find_opposite_direction(direction_selected)
- var opp_anim_name="%s_%s" % [return_current_animation_type(), opp_dir]
- var metadata_array_offset: int = get_metadata_array_offset(opp_dir)
-
- if button_pressed:
- if anim_metadata[metadata_array_offset][METADATA_IS_MIRROR]:
- get_node(GENERIC_ERROR_NODE).dialog_text = \
- "You can't mirror a direction that is already mirrored."
- get_node(GENERIC_ERROR_NODE).popup()
- get_node(MIRROR_NODE).set_pressed_no_signal(false)
- return
-
- if anim_metadata[metadata_array_offset][METADATA_SPRITESHEET_FIRST_FRAME] == 0:
- get_node(GENERIC_ERROR_NODE).dialog_text = \
- "You can't mirror an animation that hasn't been set up."
- get_node(GENERIC_ERROR_NODE).popup()
- get_node(MIRROR_NODE).set_pressed_no_signal(false)
- return
-
- mirror_animation(opp_dir, direction_selected)
- preview_update()
- else:
- unmirror_animation(direction_selected)
-
-
-# When the animation speed has been changed, update the speed and label
-func controls_on_anim_speed_scroll_bar_value_changed(value: float) -> void:
- if not has_spritesheet_been_loaded():
- get_node(ANIM_CONTROLS_NODE).get_node("anim_speed_scroll_bar").value = current_animation_speed
- return
-
- if anim_metadata[get_metadata_array_offset()][METADATA_IS_MIRROR] and not currently_changing_direction:
- get_node(ANIM_CONTROLS_NODE).get_node("anim_speed_scroll_bar").value = current_animation_speed
- get_node(GENERIC_ERROR_NODE).dialog_text = "You cannot change a mirrored animation."
- get_node(GENERIC_ERROR_NODE).popup()
- return
-
- current_animation_speed = int(value)
-
- check_if_controls_have_changed()
-
- get_node(ANIM_CONTROLS_NODE).get_node("anim_speed_label").text = "%s: %s FPS" % [ANIMATION_SPEED_LABEL, value]
- get_node(PREVIEW_NODE).get_node("anim_preview_sprite").frames.set_animation_speed(ANIM_IN_PROGRESS, value)
-
- preview_update()
-
- if autostore == true:
- store_on_anim_store_button_pressed()
-
-
-# When the first animation frame setting is changed, update the animation preview appropriately
-func controls_on_start_frame_value_changed(value: float) -> void:
- if not has_spritesheet_been_loaded():
- get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value = spritesheet_settings[2]
- return
-
- if anim_metadata[get_metadata_array_offset()][METADATA_IS_MIRROR] and not currently_changing_direction:
- get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value = spritesheet_settings[2]
- get_node(GENERIC_ERROR_NODE).dialog_text = "You cannot change a mirrored animation."
- get_node(GENERIC_ERROR_NODE).popup()
- return
- spritesheet_settings[2] = get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value
- if get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value > 0:
- preview_show()
- check_if_controls_have_changed()
- draw_frame_outlines()
- preview_update()
-
- if autostore == true:
- store_on_anim_store_button_pressed()
-
-
-# When the last animation frame setting is changed, update the animation preview appropriately
-func controls_on_end_frame_value_changed(value: float) -> void:
- if not has_spritesheet_been_loaded():
- get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value = spritesheet_settings[3]
- return
-
- if anim_metadata[get_metadata_array_offset()][METADATA_IS_MIRROR] and not currently_changing_direction:
- get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value = spritesheet_settings[3]
- get_node(GENERIC_ERROR_NODE).dialog_text = "You cannot change a mirrored animation."
- get_node(GENERIC_ERROR_NODE).popup()
- return
-
- spritesheet_settings[3] = get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value
- if get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value > 0:
- if get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value == 0:
- get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value = 1
- spritesheet_settings[2] = 1
- preview_show()
- check_if_controls_have_changed()
-
- draw_frame_outlines()
- preview_update()
-
- if autostore == true:
- store_on_anim_store_button_pressed()
-
-
-# When the number of horizontal frames in the spritesheet setting is changed,
-# update the animation preview appropriately
-func controls_on_h_frames_spin_box_value_changed(value: float) -> void:
- if not has_spritesheet_been_loaded():
- get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value = spritesheet_settings[0]
- return
-
- if anim_metadata[get_metadata_array_offset()][METADATA_IS_MIRROR] and not currently_changing_direction:
- get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value = spritesheet_settings[0]
- get_node(GENERIC_ERROR_NODE).dialog_text = "You cannot change a mirrored animation."
- get_node(GENERIC_ERROR_NODE).popup()
- return
-
- spritesheet_settings[0] = get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value
- preview_show()
-
- check_if_controls_have_changed()
- calc_sprite_size()
- draw_frame_outlines()
- preview_update()
-
- if autostore == true:
- store_on_anim_store_button_pressed()
-
-
-# When the number of vertical frames in the spritesheet setting is changed,
-# update the animation preview appropriately
-func controls_on_v_frames_spin_box_value_changed(value: float) -> void:
- if not has_spritesheet_been_loaded():
- get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").value = spritesheet_settings[1]
- return
-
- if anim_metadata[get_metadata_array_offset()][METADATA_IS_MIRROR] and not currently_changing_direction:
- get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").value = spritesheet_settings[1]
- get_node(GENERIC_ERROR_NODE).dialog_text = "You cannot change a mirrored animation."
- get_node(GENERIC_ERROR_NODE).popup()
- return
-
- spritesheet_settings[1] = get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").value
-
- preview_show()
-
- check_if_controls_have_changed()
- calc_sprite_size()
- draw_frame_outlines()
- preview_update()
-
- if autostore == true:
- store_on_anim_store_button_pressed()
-
-
-# Load a spritesheet when selected in the file browser
-func controls_on_FileDialog_file_selected(path: String) -> void:
- get_node(NO_SPRITESHEET_NODE).visible = false
- load_spritesheet(path)
-
-
-# Check all animations have been created when the user wants to export the ESCPlayer
-func spritesheet_on_export_button_pressed() -> void:
- var missing_walk_animations: int = 0
- var missing_talk_animations: int = 0
- var missing_idle_animations: int = 0
- var anim_name: String = ""
- var dirnames = []
-
- var scene_name = "%s/%s.scn" % [get_node(CHARACTER_PATH_NODE).text, get_node(NAME_NODE).get_node("node_name").text]
-
- var dest_file = File.new()
- if dest_file.file_exists(scene_name):
- get_node(GENERIC_ERROR_NODE).dialog_text = \
- "Scene file '%s' already exists.\nPlease change Global_ID or path,\nor delete scene before continuing.\n" \
- % scene_name
- get_node(GENERIC_ERROR_NODE).popup()
- return
-
- if get_node(DIR_COUNT_NODE).get_node("four_directions").pressed:
- dirnames = DIR_LIST_4
- elif get_node(DIR_COUNT_NODE).get_node("eight_directions").pressed:
- dirnames = DIR_LIST_8
- elif get_node(DIR_COUNT_NODE).get_node("two_directions").pressed:
- dirnames = DIR_LIST_2
- else:
- dirnames = DIR_LIST_1
-
- for dirloop in dirnames:
- anim_name = "%s_%s" % [TYPE_WALK, dirloop]
-
- if anim_metadata[get_metadata_array_offset(dirloop, TYPE_WALK)][METADATA_SPRITESHEET_FIRST_FRAME] == 0:
- missing_walk_animations += 1
-
- anim_name = "%s_%s" % [TYPE_TALK, dirloop]
-
- if anim_metadata[get_metadata_array_offset(dirloop, TYPE_TALK)][METADATA_SPRITESHEET_FIRST_FRAME] == 0:
- missing_talk_animations += 1
-
- anim_name = "%s_%s" % [TYPE_IDLE, dirloop]
-
- if anim_metadata[get_metadata_array_offset(dirloop, TYPE_IDLE)][METADATA_SPRITESHEET_FIRST_FRAME] == 0:
- missing_idle_animations += 1
-
- if missing_idle_animations + missing_talk_animations + missing_walk_animations > 0:
- get_node(GENERIC_ERROR_NODE).dialog_text = \
- "One or more animations are not configured.\nPlease ensure all arrows are green for\nwalk, talk, and idle animations.\n\n"
-
- if missing_walk_animations:
- get_node(GENERIC_ERROR_NODE).dialog_text += \
- "%s walk animations not configured.\n" % missing_walk_animations
-
- if missing_talk_animations:
- get_node(GENERIC_ERROR_NODE).dialog_text += \
- "%s talk animations not configured.\n" % missing_talk_animations
-
- if missing_idle_animations:
- get_node(GENERIC_ERROR_NODE).dialog_text += \
- "%s idle animations not configured." % missing_idle_animations
-
- get_node(GENERIC_ERROR_NODE).popup()
-
- return
-
-# export_thread = Thread.new()
-# export_thread.start(self, "export_player")
- export_player(scene_name)
-
-# Update the spritesheet zoom and scrollbars
-func spritesheet_on_zoom_scrollbar_value_changed(value: float) -> void:
- if not has_spritesheet_been_loaded():
- return
-
- zoom_value = stepify(value, 0.1)
- get_node(ZOOM_LABEL_NODE).text = "Zoom: %sx" % str(zoom_value)
- if zoom_value > 1.0:
- get_node(SCROLL_CTRL_NODE).get_node("spritesheet_sprite").rect_min_size = source_image.get_size() * zoom_value
- get_node(SCROLL_CTRL_NODE).get_node("spritesheet_sprite").rect_scale = Vector2.ONE
- else:
- get_node(SCROLL_CTRL_NODE).get_node("spritesheet_sprite").rect_min_size = source_image.get_size()
- get_node(SCROLL_CTRL_NODE).get_node("spritesheet_sprite").rect_scale.x = zoom_value
- get_node(SCROLL_CTRL_NODE).get_node("spritesheet_sprite").rect_scale.y = zoom_value
- draw_frame_outlines()
-
-
-# Show the file manager when the load spritesheet button is pressed
-func spritesheet_on_load_spritesheet_button_pressed() -> void:
- get_node(FILE_DIALOG_NODE).popup()
-
-
-# Reset zoom settings when the reset button is pushed. Also called when a new
-# spritesheet is loaded.
-func spritesheet_on_zoom_reset_button_pressed() -> void:
- if not has_spritesheet_been_loaded():
- return
-
- get_node(ZOOM_SCROLL_NODE).value = 1
-
- get_node(SCROLL_VBOX_NODE).get_node("spritesheet_scroll_container").scroll_horizontal = 0
- get_node(SCROLL_VBOX_NODE).get_node("spritesheet_scroll_container").scroll_vertical = 0
-
-
-# If the node name is changed, update the global_id to match.
-# NOTE : Updating the global_id doesn't update the nodename, allowing them to be different.
-func nodename_on_node_name_text_changed(new_text: String) -> void:
- get_node(NAME_NODE).get_node("global_id").text = new_text
-
-
-# If 8 directions was already selected, don't let it be unselected.
-# If 4 directions was selected, unselect it.
-func directions_on_eight_directions_pressed() -> void:
- if not get_node(DIR_COUNT_NODE).get_node("eight_directions").pressed:
- # Don't let them untick all boxes
- get_node(DIR_COUNT_NODE).get_node("eight_directions").pressed = true
-
- for loop in ["four_directions", "two_directions", "one_direction"]:
- get_node(DIR_COUNT_NODE).get_node(loop).pressed = false
- reset_arrow_colours()
-
-
-# If 4 directions was already selected, don't let it be unselected.
-# If previously selected direction is now invalid, change it to a valid one.
-func directions_on_four_directions_pressed() -> void:
- if not get_node(DIR_COUNT_NODE).get_node("four_directions").pressed:
- # Don't let them untick all boxes
- get_node(DIR_COUNT_NODE).get_node("four_directions").pressed = true
- else:
- # Current direction is illegal
- for loop in ["eight_directions", "two_directions", "one_direction"]:
- get_node(DIR_COUNT_NODE).get_node(loop).pressed = false
- if not direction_selected in DIR_LIST_4:
- direction_selected = DIR_UP
- activate_direction(DIR_UP)
- reset_arrow_colours()
-
-
-# If 2 directions was already selected, don't let it be unselected.
-# If previously selected direction is now invalid, change it to a valid one.
-func directions_on_two_directions_pressed() -> void:
- if not get_node(DIR_COUNT_NODE).get_node("two_directions").pressed:
- # Don't let them untick all boxes
- get_node(DIR_COUNT_NODE).get_node("two_directions").pressed = true
- else:
- for loop in ["eight_directions", "four_directions", "one_direction"]:
- get_node(DIR_COUNT_NODE).get_node(loop).pressed = false
- # Current direction is illegal
- if not direction_selected in DIR_LIST_2:
- direction_selected = DIR_RIGHT
- activate_direction(DIR_RIGHT)
- reset_arrow_colours()
-
-
-# If 1 direction was already selected, don't let it be unselected.
-# If previously selected direction is now invalid, change it to a valid one.
-func directions_on_one_direction_pressed() -> void:
- if not get_node(DIR_COUNT_NODE).get_node("one_direction").pressed:
- # Don't let them untick all boxes
- get_node(DIR_COUNT_NODE).get_node("one_direction").pressed = true
- else:
- for loop in ["eight_directions", "four_directions", "two_directions"]:
- get_node(DIR_COUNT_NODE).get_node(loop).pressed = false
- # Current direction is illegal
- if not direction_selected in DIR_LIST_1:
- direction_selected = DIR_DOWN
- activate_direction(DIR_DOWN)
- reset_arrow_colours()
-
-# Returns the currently selected animation type
-func return_current_animation_type() -> String:
- var animation_type: String = ""
-
- if get_node(ANIM_TYPE_NODE).get_node("walk_checkbox").pressed:
- animation_type = TYPE_WALK
- elif get_node(ANIM_TYPE_NODE).get_node("talk_checkbox").pressed:
- animation_type = TYPE_TALK
- elif get_node(ANIM_TYPE_NODE).get_node("idle_checkbox").pressed:
- animation_type = TYPE_IDLE
-
- assert(not animation_type.empty(), "No animation type selected.")
-
- return animation_type
-
-
-# Runs whenever a direction arrow is clicked. If the store button is visible (i.e. the settings
-# for the sprite frames have changed since they were last stored) the selected direction isn't
-# changed and a confirmation window is shown instead.
-func check_activate_direction(direction) -> void:
- direction_requested = direction
-
- if get_node(STORE_ANIM_NODE).visible:
- get_node(ARROWS_NODE).get_node("Container_%s" % direction).get_node("set_dir_%s" % direction).pressed = false
- get_node(ARROWS_NODE).get_node("Container_%s" % direction).get_node("unset_dir_%s" % direction).pressed = false
- $InformationWindows/unstored_changes_window.popup()
- else:
- activate_direction(direction)
-
-
-# Change the selected direction. This clears the selected direction arrow and mirror settings.
-# If the selected direction has an animation, it will be displayed, if not, the "no animation"
-# graphic will be displayed in the preview window.
-# Spritesheet control values are set based on the direction chosen (if it had a previous animation)
-# If it used a different spritesheet, that will be loaded.
-func activate_direction(direction) -> void:
- var anim_type = return_current_animation_type()
- var arrows = get_tree().get_nodes_in_group("direction_buttons")
- var anim_name = "%s_%s" % [anim_type, direction]
-
- currently_changing_direction = true
- direction_selected = direction
-
- for arrow in arrows:
- arrow.pressed = false
-
- if direction == DIR_UP or direction == DIR_DOWN:
- get_node(MIRROR_NODE).visible = false
- else:
- get_node(MIRROR_NODE).visible = true
-
- get_node(MIRROR_NODE).set_pressed_no_signal(false)
-
- # If no animation has been created yet for this direction
- if anim_metadata[get_metadata_array_offset()][METADATA_SPRITESHEET_FIRST_FRAME] == 0:
- get_node(ARROWS_NODE).get_node("Container_%s" % direction).get_node("unset_dir_%s" % direction).pressed = true
- spritesheet_settings[2] = 0
- spritesheet_settings[3] = 0
-
- get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value = 0
- get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value = 0
- preview_hide()
- else:
- get_node(ARROWS_NODE).get_node("Container_%s" % direction).get_node("set_dir_%s" % direction).pressed = true
-
- var metadata = anim_metadata[get_metadata_array_offset()]
-
- assert(metadata[METADATA_ANIM_NAME] == anim_name, \
- "Anim %s expected in metadata array. Found %s" % [anim_name, metadata[METADATA_ANIM_NAME]])
-
- if metadata[METADATA_SPRITESHEET_SOURCE_FILE] != get_node(CURRENT_SHEET_NODE).text:
- load_spritesheet(metadata[METADATA_SPRITESHEET_SOURCE_FILE])
-
- # Disconnect the signals so if we're changing to a mirrored direction it doesn't complain
- # when all the settings update
-# disconnect_selector_signals()
- get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value = metadata[METADATA_SPRITESHEET_FRAMES_HORIZ]
- get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").value = metadata[METADATA_SPRITESHEET_FRAMES_VERT]
- get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value = metadata[METADATA_SPRITESHEET_FIRST_FRAME]
- get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value = metadata[METADATA_SPRITESHEET_LAST_FRAME]
- get_node(ANIM_CONTROLS_NODE).get_node("anim_speed_scroll_bar").value = metadata[METADATA_SPEED]
- get_node(MIRROR_NODE).set_pressed_no_signal(metadata[METADATA_IS_MIRROR])
-# connect_selector_signals()
- preview_update()
-
- # Restart animation otherwise it will first complete all the frames before changing to the new animation
- get_node(PREVIEW_NODE).get_node("anim_preview_sprite").playing = false
- get_node(PREVIEW_NODE).get_node("anim_preview_sprite").playing = true
- currently_changing_direction = false
-
-# Store the metadata for the animation changes for the current direction
-func store_on_anim_store_button_pressed() -> void:
- get_node(STORE_ANIM_NODE).visible = false
-
- var anim_type = return_current_animation_type()
- store_animation("%s_%s" % [anim_type, direction_selected])
-
- reset_arrow_colours()
-
-
-# Based on the type of animation and direction, find its array position in the metadata array.
-func get_metadata_array_offset(dir_to_retrieve = "default", anim_type = "default") -> int:
- var offset: int = 0
-
- if anim_type == "default":
- anim_type = return_current_animation_type()
-
- if anim_type == TYPE_TALK:
- offset = 8
- elif anim_type == TYPE_IDLE:
- offset = 16
-
- if dir_to_retrieve == "default":
- dir_to_retrieve = direction_selected
-
- var dir_offset: int = DIR_LIST_8.find(dir_to_retrieve)
-
- assert(dir_offset > -1, "Could not find direction in list. This should never happen.")
-
- return offset + dir_offset
-
-
-# Using both set and unset buttons (instead of changing the texture to a different colour) as
-# updating the direction arrow sprite was causing issues due to Godot storing the
-# sprite by reference rather than by value. It was easier to duplicate the sprites/buttons.
-func reset_arrow_colours() -> void:
- var arrows = get_tree().get_nodes_in_group("direction_buttons")
- for arrow in arrows:
- arrow.visible = false
-
- get_node(ARROWS_NODE).get_node("Container_up").get_node("ColorRectSpacer").visible = false
- get_node(ARROWS_NODE).get_node("Container_left").get_node("ColorRectSpacer").visible = false
- get_node(ARROWS_NODE).get_node("Container_down").get_node("ColorRectSpacer").visible = false
- var dir_list=DIR_LIST_8
- if get_node(DIR_COUNT_NODE).get_node("four_directions").pressed:
- dir_list=DIR_LIST_4
- if not direction_selected in DIR_LIST_4:
- direction_selected = DIR_UP
-# get_node(ARROWS_NODE).get_node("Container_up").get_node("ColorRectSpacer").visible = true
- if get_node(DIR_COUNT_NODE).get_node("two_directions").pressed:
- dir_list=DIR_LIST_2
- if not direction_selected in DIR_LIST_2:
- direction_selected = DIR_RIGHT
- get_node(ARROWS_NODE).get_node("Container_up").get_node("ColorRectSpacer").visible = true
- get_node(ARROWS_NODE).get_node("Container_down").get_node("ColorRectSpacer").visible = true
- if get_node(DIR_COUNT_NODE).get_node("one_direction").pressed:
- dir_list=DIR_LIST_1
- if not direction_selected in DIR_LIST_1:
- direction_selected = DIR_DOWN
- get_node(ARROWS_NODE).get_node("Container_up").get_node("ColorRectSpacer").visible = true
- get_node(ARROWS_NODE).get_node("Container_left").get_node("ColorRectSpacer").visible = true
-
-
- for dir in dir_list:
- if anim_metadata[get_metadata_array_offset(dir)][METADATA_SPRITESHEET_FIRST_FRAME] > 0:
- get_node(ARROWS_NODE).get_node("Container_%s" % dir).get_node("set_dir_%s" % dir).visible = true
- get_node(ARROWS_NODE).get_node("Container_%s" % dir).get_node("unset_dir_%s" % dir).visible = false
- else:
- get_node(ARROWS_NODE).get_node("Container_%s" % dir).get_node("set_dir_%s" % dir).visible = false
- get_node(ARROWS_NODE).get_node("Container_%s" % dir).get_node("unset_dir_%s" % dir).visible = true
-
- # This works when you change between animation types
- # eg. walk and talk - to ensure that the arrow will get changed back from selected with stored
- # animation to selected with unstored animation if needs be. It also resets the preview.
- activate_direction(direction_selected)
-
-
-# If the user tries to change direction without commiting first, a window will appear to
-# confirm what they want to do.
-# The button associated with this function chooses to save the changes, then will update
-# the interface to select the new direction.
-func unstored_warning_on_commit_button_pressed() -> void:
- get_node(UNSTORED_CHANGE_NODE).visible = false
- get_node(STORE_ANIM_NODE).visible = false
-
- var anim_type = return_current_animation_type()
- store_animation("%s_%s" % [anim_type, direction_selected])
-
- reset_arrow_colours()
-
- activate_direction(direction_requested)
-
-
-# If the user tries to change direction without commiting first, a window will appear to
-# confirm what they want to do.
-# The button associated with this function chooses to lose the changes, then will update
-# the interface to select the new direction.
-func unstored_warning_on_lose_button_pressed() -> void:
- get_node(UNSTORED_CHANGE_NODE).visible = false
- get_node(STORE_ANIM_NODE).visible = false
-
- activate_direction(direction_requested)
-
-
-# If the user tries to change direction without commiting first, a window will appear to
-# confirm what they want to do.
-# The button associated with this function chooses to cancel the request to change direction
-# and let the user continue to edit the current animation.
-func unstored_warning_on_cancel_button_pressed() -> void:
- get_node(UNSTORED_CHANGE_NODE).visible = false
-
-
-# Returns the opposite direction for mirroring animations
-func find_opposite_direction(direction:String) -> String:
- var opposite_dir: String = ""
-
- match direction:
- DIR_UP_RIGHT:
- opposite_dir = DIR_UP_LEFT
- DIR_RIGHT:
- opposite_dir = DIR_LEFT
- DIR_DOWN_RIGHT:
- opposite_dir = DIR_DOWN_LEFT
- DIR_DOWN_LEFT:
- opposite_dir = DIR_DOWN_RIGHT
- DIR_LEFT:
- opposite_dir = DIR_RIGHT
- DIR_UP_LEFT:
- opposite_dir = DIR_UP_RIGHT
-
- assert(not opposite_dir.empty(), "This should never happen : direction = %s" % direction)
- return opposite_dir
-
-
-# Creates an ESCPlayer node based on the settings configured in the wizard.
-# It will save it as a scene (named based on the name provided in the GUI text box)
-# and open it in the Godot editor - which is why this utility has to run as a plugin.
-# This will also create an ESCDialogue position, and a collision box. The collision box will
-# be sized based on the widest and tallest frames encountered during export (note that the
-# widest/tallest frame settings do not necessarily come from the same animation frame but are
-# from all the animation frames.
-func export_player(scene_name) -> void:
- var num_directions
- var start_angle_array
- var angle_size
- var dirnames
-
- var plugin_reference = get_node("..").plugin_reference
-
- disconnect_selector_signals()
- get_node(EXPORT_PROGRESS_NODE).popup()
- get_node(EXPORT_PROGRESS_NODE).get_node("progress_bar").value = 0
- get_node(EXPORT_PROGRESS_NODE).get_node("progress_bar").visible = true
- get_node(EXPORT_PROGRESS_NODE).get_node("progress_label").visible = true
-
- if get_node(DIR_COUNT_NODE).get_node("eight_directions").pressed:
- num_directions = 8
- if get_node(DIR_COUNT_NODE).get_node("four_directions").pressed:
- num_directions = 4
- if get_node(DIR_COUNT_NODE).get_node("two_directions").pressed:
- num_directions = 2
- else:
- num_directions = 1
-
- var new_character
- # NPCs can't be ESCPlayers or the player won't walk up to them when
- # you interact with them
- if get_node(CHAR_TYPE_NODE).get_node("npc").pressed:
- new_character = ESCItem.new()
- else:
- new_character = ESCPlayer.new()
- new_character.selectable = true
- new_character.name = get_node(NAME_NODE).get_node("node_name").text
-
- if get_node(NAME_NODE).get_node("global_id").text == null:
- new_character.global_id = new_character.name
-
- new_character.global_id = get_node(NAME_NODE).get_node("global_id").text
- new_character.tooltip_name = get_node(NAME_NODE).get_node("node_name").text
-
- new_character.default_action = "look"
-
- var animations_resource = ESCAnimationResource.new()
-
- # This is necessary to avoid a Godot bug when appending to one array
- # appends to all arrays in the same class (possibly for resources only).
- animations_resource.dir_angles = []
- animations_resource.directions = []
- animations_resource.idles = []
- animations_resource.speaks = []
-
- if get_node(DIR_COUNT_NODE).get_node("four_directions").pressed:
- num_directions = 4
- start_angle_array = [315, 45, 135, 225]
- angle_size = 90
- dirnames = DIR_LIST_4
- elif get_node(DIR_COUNT_NODE).get_node("eight_directions").pressed:
- num_directions = 8
- start_angle_array = [337, 22, 67, 112, 157, 202, 247, 292]
- angle_size = 45
- dirnames = DIR_LIST_8
- elif get_node(DIR_COUNT_NODE).get_node("two_directions").pressed:
- num_directions = 2
- start_angle_array = [0, 180]
- angle_size = 180
- dirnames = DIR_LIST_2
- else:
- num_directions = 1
- start_angle_array = [0]
- angle_size = 360
- dirnames = DIR_LIST_1
-
- for loop in range(num_directions):
- # Need to create new objects here each time in order to avoid having multiple references
- # to the same objects.
- var dir_angle = ESCDirectionAngle.new()
- var anim_details: ESCAnimationName
-
- dir_angle.angle_start = start_angle_array[loop]
- dir_angle.angle_size = angle_size
- animations_resource.dir_angles.append(dir_angle)
-
- anim_details = _create_esc_animation(TYPE_WALK, dirnames[loop])
- animations_resource.directions.append(anim_details)
-
- anim_details = _create_esc_animation(TYPE_TALK, dirnames[loop])
- animations_resource.speaks.append(anim_details)
-
- anim_details = _create_esc_animation(TYPE_IDLE, dirnames[loop])
- animations_resource.idles.append(anim_details)
-
-# var largest_sprite = export_generate_animations(new_character, num_directions)
- export_largest_sprite = Vector2.ONE
- # Need to yield on the child function so this function doesn't continue
- # when the child yields
- var export_state = export_generate_animations(new_character, num_directions)
- if export_state is GDScriptFunctionState:
- export_state = yield(export_state, "completed")
- # Add Collision shape to the ESCPlayer
- var rectangle_shape = RectangleShape2D.new()
- var collision_shape = CollisionShape2D.new()
- progress_bar_update("Creating collision shape")
- yield(get_tree(), "idle_frame")
-
- collision_shape.shape = rectangle_shape
- collision_shape.shape.extents = export_largest_sprite / 2
- collision_shape.position.y = -(export_largest_sprite.y / 2)
-
- new_character.add_child(collision_shape)
- progress_bar_update("Setting up dialog position")
- yield(get_tree(), "idle_frame")
-
- # Add Dialog Position to the ESCPlayer
- var dialog_position = ESCLocation.new()
- dialog_position.name = "dialog_position"
- dialog_position.position.y = -(export_largest_sprite.y * 1.2)
- new_character.add_child(dialog_position)
-
- if get_node(CHAR_TYPE_NODE).get_node("npc").pressed:
- # Add Interaction Position to an NPC
- var interaction_position = ESCLocation.new()
- interaction_position.name = "interact_position"
- interaction_position.position.y = +(export_largest_sprite.y * 1.2)
- new_character.add_child(interaction_position)
- interaction_position.set_owner(new_character)
-
- progress_bar_update("Configuring animations")
- yield(get_tree(), "idle_frame")
- # Make it so all the nodes can be seen in the scene tree
- new_character.animations = animations_resource
- progress_bar_update("Adding child to scene tree")
- yield(get_tree(), "idle_frame")
- get_tree().edited_scene_root.add_child(new_character)
- new_character.set_owner(get_tree().edited_scene_root)
-
- # Making the owner "new_character" rather than "get_tree().edited_scene_root" means that
- # when saving as a packed scene, the child nodes get saved under the parent (as the parent
- # must own the child nodes). If the owner is not the scene root though, the nodes will NOT
- # show up in the scene tree.
- collision_shape.set_owner(new_character)
- dialog_position.set_owner(new_character)
-
- # Export scene
- var packed_scene = PackedScene.new()
-
- progress_bar_update("Packing scene - this might take up to 30 seconds")
- yield(get_tree(), "idle_frame")
- packed_scene.pack(get_tree().edited_scene_root.get_node(new_character.name))
-
- progress_bar_update("Resource saving - this might take up to 30 seconds")
- yield(get_tree(), "idle_frame")
- # Flag suggestions from https://godotengine.org/qa/50437/how-to-turn-a-node-into-a-packedscene-via-gdscript
- ResourceSaver.save(scene_name, packed_scene, ResourceSaver.FLAG_CHANGE_PATH|ResourceSaver.FLAG_REPLACE_SUBRESOURCE_PATHS|ResourceSaver.FLAG_COMPRESS)
-
- progress_bar_update("Releasing resources - this might take up to 30 seconds")
- yield(get_tree(), "idle_frame")
- new_character.queue_free()
-
- get_tree().edited_scene_root.get_node(new_character.name).queue_free()
- plugin_reference.open_scene(scene_name)
- plugin_reference.make_visible(false)
- get_node(EXPORT_PROGRESS_NODE).hide()
- get_node(EXPORT_COMPLETE_NODE).popup()
-
- connect_selector_signals()
-
-
-# Updates the text in the export window so the user knows what's happening
-func progress_bar_update(message, bar_increase_amount = 1) -> void:
- get_node(PROGRESS_LABEL_NODE).text = message
- get_node(EXPORT_PROGRESS_NODE).get_node("progress_bar").value += bar_increase_amount
-
-
-# When exporting the ESCPlayer, this function loads the relevant spritesheets based on the
-# animation metadata, and copies the frames to the relevant animations within the animatedsprite
-# attached to the ESCPlayer.
-#func export_generate_animations(character_node, num_directions) -> Vector2:
-func export_generate_animations(character_node, num_directions) -> void:
- # This variable is used instead of running this function in a thread as I hit this issue
- # when I tried to thread this - https://github.com/godotengine/godot/issues/38058
- var display_refresh_timer:int = OS.get_ticks_msec()
- var direction_names
- var loaded_spritesheet: String
- var largest_frame_dimensions: Vector2 = Vector2.ZERO
- var sprite_frames = SpriteFrames.new()
- var default_anim_length = 0
- var default_anim_speed = 1
- var texture
- var frame_counter: int = 0
-
- match num_directions:
- 1: direction_names = DIR_LIST_1
- 2: direction_names = DIR_LIST_2
- 4: direction_names = DIR_LIST_4
- 8: direction_names = DIR_LIST_8
-
- for animtype in [TYPE_WALK, TYPE_TALK, TYPE_IDLE]:
- for anim_dir in direction_names:
- # Using this in place of threads due to the above mentioned issue so that the
- # UI continues to update while the export is running
- var current_ticks = OS.get_ticks_msec()
- if current_ticks - display_refresh_timer > 30:
- yield(get_tree(), "idle_frame")
-
- display_refresh_timer = current_ticks
-
- if num_directions == 4:
- progress_bar_update("Processing "+str(animtype)+" "+str(anim_dir),2)
- else:
- progress_bar_update("Processing "+str(animtype)+" "+str(anim_dir),1)
-
- var anim_name = "%s_%s" % [animtype, anim_dir]
- var metadata = anim_metadata[get_metadata_array_offset(anim_dir, animtype)]
-
- if metadata[METADATA_IS_MIRROR]:
- continue
-
- var rect_location
- var frame_being_copied = Image.new()
- sprite_frames.add_animation(anim_name)
-
- if metadata[METADATA_SPRITESHEET_SOURCE_FILE] != loaded_spritesheet:
- load_spritesheet(metadata[METADATA_SPRITESHEET_SOURCE_FILE], true, get_metadata_array_offset(anim_dir, animtype))
-
- loaded_spritesheet = metadata[METADATA_SPRITESHEET_SOURCE_FILE]
- calc_sprite_size()
- if (frame_size.x / 2) > largest_frame_dimensions.x:
- largest_frame_dimensions.x = frame_size.x
-
- if (frame_size.y / 2) > largest_frame_dimensions.y:
- largest_frame_dimensions.y = frame_size.y
- frame_being_copied.create(frame_size.x, frame_size.y, false, source_image.get_format())
-
- if animtype == TYPE_IDLE and anim_dir == "down":
- default_anim_length = metadata[METADATA_SPRITESHEET_LAST_FRAME] - metadata[METADATA_SPRITESHEET_FIRST_FRAME] + 1
- default_anim_speed = metadata[METADATA_SPEED]
-
- for loop in range(metadata[METADATA_SPRITESHEET_LAST_FRAME] - metadata[METADATA_SPRITESHEET_FIRST_FRAME] + 1):
- texture = ImageTexture.new()
- rect_location = calc_frame_coords(metadata[METADATA_SPRITESHEET_FIRST_FRAME] + loop)
- frame_being_copied.blit_rect(source_image, Rect2(rect_location, Vector2(frame_size.x, frame_size.y)), Vector2(0, 0))
- texture.create_from_image(frame_being_copied)
-
- # Remove "filter" flag so it's pixel perfect
- texture.set_flags(2)
- sprite_frames.add_frame (anim_name, texture, frame_counter )
- sprite_frames.set_animation_speed(anim_name, metadata[METADATA_SPEED])
- frame_counter += 1
-
- # Generate default animation. This is used by the object manager to set the
- # state when the object is registered. If there's no current state, the
- # default animation will be used.
- for loop in range(default_anim_length):
- texture = ImageTexture.new()
- texture = sprite_frames.get_frame("idle_down", loop)
-
- # Remove "filter" flag so it's pixel perfect
- texture.set_flags(2)
- sprite_frames.add_frame ("default", texture, loop )
- sprite_frames.set_animation_speed("default", default_anim_speed)
-
- var animated_sprite = AnimatedSprite.new()
-
- progress_bar_update("Adding sprite frames to node")
- animated_sprite.frames = sprite_frames
- if num_directions == 2:
- animated_sprite.animation = "%s_%s" % [TYPE_IDLE, DIR_RIGHT]
- else:
- animated_sprite.animation = "%s_%s" % [TYPE_IDLE, DIR_DOWN]
- animated_sprite.position.y = -(largest_frame_dimensions.y / 2) # Place feet at (0,0)
- animated_sprite.animation = "default"
- animated_sprite.playing = true
- character_node.add_child(animated_sprite)
- # Making the owner "character_node" rather than "get_tree().edited_scene_root" means that
- # when saving as a packed scene, the child nodes get saved under the parent (as the parent
- # must own the child nodes). If the owner is not the scene root though, the nodes will NOT
- # show up in the scene tree.
- animated_sprite.set_owner(character_node)
- #return largest_frame_dimensions
- export_largest_sprite = largest_frame_dimensions
-
-
-# Open the help window
-func spritesheet_on_help_button_pressed() -> void:
- $InformationWindows/help_window.popup()
- $InformationWindows/help_window.show_page()
-
-
-func spritesheet_on_reset_button_pressed() -> void:
- $InformationWindows/ConfirmationDialog.dialog_text = "WARNING!\n\n" + \
- "If you continue you will lose the current character."
- $InformationWindows/ConfirmationDialog.popup()
-
-
-func spritesheet_on_reset_confirmed() -> void:
- spritesheet_settings = [1, 1, 0, 0]
- source_image = null
- get_node(SCROLL_CTRL_NODE).get_node("spritesheet_sprite").texture = null
- create_empty_animations()
- character_creator_reset()
-
-
-func spritesheet_on_MainMenuConfirmation_confirmed() -> void:
- get_node("../Menu").visible = true
- get_node(".").visible = false
-
-
-func spritesheet_on_main_menu_button_up() -> void:
- $InformationWindows/MainMenuConfirmation.popup()
-
-
-func load_settings() -> void:
- var file_path = "res://"
- var file = File.new()
- if file.file_exists(CONFIG_FILE):
- file.open(CONFIG_FILE, File.READ)
- file_path = file.get_pascal_string()
- file.close()
- get_node(CHARACTER_PATH_NODE).text = file_path
-
-
-# Creates and returns an ESCAnimationName for use by ESCAnimationResource
-#
-# #### Parameters
-#
-# - type: One of TYPE_WALK, TYPE_TALK, TYPE_IDLE (these are consts defined at the top of this script)
-# - dir_name: One of DIR_LIST_8's or DIR_LIST_4's entries (these are consts defined at the top of this script)
-#
-# *Returns* a valid ESCAnimationName object.
-func _create_esc_animation(type: String, dir_name: String) -> ESCAnimationName:
- var anim_details = ESCAnimationName.new()
-
- anim_details.animation = "%s_%s" % [type, dir_name]
-
- if anim_metadata[get_metadata_array_offset(dir_name, type)][METADATA_IS_MIRROR]:
- anim_details.mirrored = true
- anim_details.animation = "%s_%s" % [type, find_opposite_direction(dir_name)]
- else:
- anim_details.mirrored = false
- return anim_details
-
-
-func _on_character_path_change_button_pressed() -> void:
- get_node(CHARACTER_FILE_NODE).popup_centered()
-
-
-func _on_CharacterPathFileDialog_dir_selected(dir: String) -> void:
- get_node(CHARACTER_PATH_NODE).text = dir
- var file = File.new()
- file.open(CONFIG_FILE, File.WRITE)
- file.store_pascal_string(dir)
- file.close()
-
-
-# Mouse clicks inside the spritesheet
-func _on_control_gui_input(event: InputEvent) -> void:
- var ClickedTile:Vector2
- if event.is_pressed():
- var NumHorizFrames = get_node(ANIM_CONTROLS_NODE).get_node("h_frames_spin_box").value
- var NumVertFrames = get_node(ANIM_CONTROLS_NODE).get_node("v_frames_spin_box").value
-
- ClickedTile.x = int(event.position.x / (frame_size.x * zoom_value))
- if ClickedTile.x >= NumHorizFrames:
- return
- ClickedTile.y = int(event.position.y / (frame_size.y * zoom_value))
- if ClickedTile.y >= NumVertFrames:
- return
-
- var AbsoluteFrame = ((ClickedTile.y * NumHorizFrames) + ClickedTile.x) + 1
-
- if event.button_index == BUTTON_LEFT:
- get_node(ANIM_CONTROLS_NODE).get_node("start_frame").value = AbsoluteFrame
- if event.button_index == BUTTON_RIGHT:
- get_node(ANIM_CONTROLS_NODE).get_node("end_frame").value = AbsoluteFrame
-
-
-# If the user tries to change animation type without commiting first, a window will appear to
-# confirm what they want to do.
-# The button associated with this function chooses to save the changes, then will update
-# the interface to select the new direction.
-func unstored_animchange_warning_on_commit_button_pressed() -> void:
- get_node(UNSTORED_ANIMTYPE_CHANGE_NODE).visible = false
- get_node(STORE_ANIM_NODE).visible = false
- var anim_type = return_current_animation_type()
- store_animation("%s_%s" % [anim_type, direction_selected])
- change_animation_type(animation_type_requested)
- reset_arrow_colours()
-
-# If the user tries to change animation type without commiting first, a window will appear to
-# confirm what they want to do.
-# The button associated with this function chooses to lose the changes, then will update
-# the interface to select the new direction.
-func unstored_animchange_warning_on_lose_button_pressed() -> void:
- get_node(UNSTORED_ANIMTYPE_CHANGE_NODE).visible = false
- get_node(STORE_ANIM_NODE).visible = false
- change_animation_type(animation_type_requested)
- reset_arrow_colours()
-
-
-# If the user tries to change animation type without commiting first, a window will appear to
-# confirm what they want to do.
-# The button associated with this function chooses to cancel the request to change direction
-# and let the user continue to edit the current animation.
-func unstored_animchange_warning_on_cancel_button_pressed() -> void:
- get_node(UNSTORED_ANIMTYPE_CHANGE_NODE).visible = false
-
-
-func change_animation_type(anim_type) -> void:
- if anim_type == "walk":
- get_node(ANIM_TYPE_NODE).get_node("walk_checkbox").pressed = true
- get_node(ANIM_TYPE_NODE).get_node("idle_checkbox").pressed = false
- get_node(ANIM_TYPE_NODE).get_node("talk_checkbox").pressed = false
- animation_type_selected = "walk"
- elif anim_type == "talk":
- get_node(ANIM_TYPE_NODE).get_node("talk_checkbox").pressed = true
- get_node(ANIM_TYPE_NODE).get_node("idle_checkbox").pressed = false
- get_node(ANIM_TYPE_NODE).get_node("walk_checkbox").pressed = false
- animation_type_selected = "talk"
- else: # idle
- get_node(ANIM_TYPE_NODE).get_node("idle_checkbox").pressed = true
- get_node(ANIM_TYPE_NODE).get_node("walk_checkbox").pressed = false
- get_node(ANIM_TYPE_NODE).get_node("talk_checkbox").pressed = false
- animation_type_selected = "idle"
- reset_arrow_colours()
-
-
-# If the walk button is selected, unselect the other buttons.
-# If this option was already the selected option, reselect it rather than letting the
-# user disable it (which would mean that none of walk/talk/idle were selected.
-func animation_on_walk_checkbox_pressed() -> void:
- # Don't let the checkbox be unselected if it's currently selected
- if animation_type_selected == "walk":
- get_node(ANIM_TYPE_NODE).get_node("walk_checkbox").pressed = true
- return
- if get_node(STORE_ANIM_NODE).visible:
- # Reset the buttons back to how they were
- get_node(ANIM_TYPE_NODE).get_node("walk_checkbox").pressed = false
- if animation_type_selected == "talk":
- get_node(ANIM_TYPE_NODE).get_node("talk_checkbox").pressed = true
- if animation_type_selected == "idle":
- get_node(ANIM_TYPE_NODE).get_node("idle_checkbox").pressed = true
- animation_type_requested="walk"
- get_node(UNSTORED_ANIMTYPE_CHANGE_NODE).popup()
- else:
- change_animation_type("walk")
-
-
-# If the talk button is selected, unselect the other buttons.
-# If this option was already the selected option, reselect it rather than letting the
-# user disable it (which would mean that none of walk/talk/idle were selected.
-func animation_on_talk_checkbox_pressed() -> void:
- # Don't let the checkbox be unselected if it's currently selected
- if animation_type_selected == "talk":
- get_node(ANIM_TYPE_NODE).get_node("talk_checkbox").pressed = true
- return
- if get_node(STORE_ANIM_NODE).visible:
- # Reset the buttons back to how they were
- get_node(ANIM_TYPE_NODE).get_node("talk_checkbox").pressed = false
- if animation_type_selected == "idle":
- get_node(ANIM_TYPE_NODE).get_node("idle_checkbox").pressed = true
- if animation_type_selected == "walk":
- get_node(ANIM_TYPE_NODE).get_node("walk_checkbox").pressed = true
- animation_type_requested="talk"
- get_node(UNSTORED_ANIMTYPE_CHANGE_NODE).popup()
- else:
- change_animation_type("talk")
-
-
-# If the idle button is selected, unselect the other buttons.
-# If this option was already the selected option, reselect it rather than letting the
-# user disable it (which would mean that none of walk/talk/idle were selected.
-func animation_on_idle_checkbox_pressed() -> void:
- # Don't let the checkbox be unselected if it's currently selected
- if animation_type_selected == "idle":
- get_node(ANIM_TYPE_NODE).get_node("idle_checkbox").pressed = true
- return
- if get_node(STORE_ANIM_NODE).visible:
- # Reset the buttons back to how they were
- get_node(ANIM_TYPE_NODE).get_node("idle_checkbox").pressed = false
- if animation_type_selected == "talk":
- get_node(ANIM_TYPE_NODE).get_node("talk_checkbox").pressed = true
- if animation_type_selected == "walk":
- get_node(ANIM_TYPE_NODE).get_node("walk_checkbox").pressed = true
- animation_type_requested="idle"
- get_node(UNSTORED_ANIMTYPE_CHANGE_NODE).popup()
- else:
- change_animation_type("idle")
-
-
-# When Auto storage checkbox is checked
-func _on_AutoStoreCheckBox_toggled(button_pressed: bool) -> void:
- autostore = button_pressed
-
-
-# When player checkbox selected
-func _on_player_pressed():
-# If player button was already selected, don't let it be unselected.
- get_node(CHAR_TYPE_NODE).get_node("player").pressed = true
- get_node(CHAR_TYPE_NODE).get_node("npc").pressed = false
-
-
-# When NPC checkbox selected
-func _on_npc_pressed():
-# If npc button was already selected, don't let it be unselected.
- get_node(CHAR_TYPE_NODE).get_node("npc").pressed = true
- get_node(CHAR_TYPE_NODE).get_node("player").pressed = false
diff --git a/addons/escoria-wizard/CharacterCreator.tscn b/addons/escoria-wizard/CharacterCreator.tscn
deleted file mode 100644
index db8fbb86..00000000
--- a/addons/escoria-wizard/CharacterCreator.tscn
+++ /dev/null
@@ -1,1541 +0,0 @@
-[gd_scene load_steps=40 format=2]
-
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_down.png" type="Texture" id=1]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_r.png" type="Texture" id=2]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_right.png" type="Texture" id=3]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_right.png" type="Texture" id=4]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_down.png" type="Texture" id=5]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_ul.png" type="Texture" id=6]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_dl.png" type="Texture" id=7]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_d.png" type="Texture" id=8]
-[ext_resource path="res://addons/escoria-wizard/graphics/no_animation.png" type="Texture" id=9]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_downleft.png" type="Texture" id=10]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_downleft.png" type="Texture" id=11]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_left.png" type="Texture" id=12]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_l.png" type="Texture" id=13]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_ur.png" type="Texture" id=14]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_ul.png" type="Texture" id=15]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_upright.png" type="Texture" id=16]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_ur.png" type="Texture" id=17]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_u.png" type="Texture" id=18]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_r.png" type="Texture" id=19]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_u.png" type="Texture" id=20]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_l.png" type="Texture" id=21]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_dr.png" type="Texture" id=22]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_up.png" type="Texture" id=23]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_upright.png" type="Texture" id=24]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_downright.png" type="Texture" id=25]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_left.png" type="Texture" id=26]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_upleft.png" type="Texture" id=27]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_up.png" type="Texture" id=28]
-[ext_resource path="res://addons/escoria-wizard/graphics/no_spritesheet.png" type="Texture" id=29]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_upleft.png" type="Texture" id=30]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_downright.png" type="Texture" id=31]
-[ext_resource path="res://addons/escoria-wizard/graphics/icon.png" type="Texture" id=32]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_d.png" type="Texture" id=33]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_dr.png" type="Texture" id=34]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_dl.png" type="Texture" id=35]
-[ext_resource path="res://addons/escoria-wizard/draw_frame_rects.gd" type="Script" id=36]
-[ext_resource path="res://addons/escoria-wizard/CharacterCreator.gd" type="Script" id=37]
-[ext_resource path="res://addons/escoria-wizard/help_window.tscn" type="PackedScene" id=38]
-
-[sub_resource type="SpriteFrames" id=1]
-animations = [ {
-"frames": [ ],
-"loop": true,
-"name": "default",
-"speed": 5.0
-}, {
-"frames": [ ],
-"loop": true,
-"name": "in_progress",
-"speed": 5.0
-} ]
-
-[node name="CharacterCreator" type="MarginContainer"]
-margin_right = 1290.0
-margin_bottom = 900.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/margin_right = 50
-custom_constants/margin_top = 50
-custom_constants/margin_left = 50
-custom_constants/margin_bottom = 50
-script = ExtResource( 37 )
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-margin_left = 50.0
-margin_top = 50.0
-margin_right = 1240.0
-margin_bottom = 850.0
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
-margin_right = 1190.0
-margin_bottom = 14.0
-
-[node name="node_name_colorrect2" type="ColorRect" parent="VBoxContainer/MarginContainer"]
-margin_right = 1190.0
-margin_bottom = 14.0
-rect_min_size = Vector2( 400, 0 )
-color = Color( 0.235294, 0.341176, 0.290196, 1 )
-
-[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer/MarginContainer"]
-margin_right = 1190.0
-margin_bottom = 14.0
-
-[node name="Label" type="Label" parent="VBoxContainer/MarginContainer/CenterContainer"]
-margin_left = 527.0
-margin_right = 663.0
-margin_bottom = 14.0
-custom_colors/font_color = Color( 0.921569, 1, 0, 1 )
-custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
-text = "Character Creator"
-uppercase = true
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
-margin_top = 18.0
-margin_right = 1190.0
-margin_bottom = 800.0
-rect_min_size = Vector2( 1190, 550 )
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/separation = 20
-
-[node name="configuration" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
-margin_right = 400.0
-margin_bottom = 782.0
-rect_min_size = Vector2( 400, 550 )
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="node_name_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration"]
-margin_right = 400.0
-margin_bottom = 782.0
-rect_min_size = Vector2( 400, 0 )
-color = Color( 0.235294, 0.341176, 0.290196, 1 )
-
-[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration"]
-margin_right = 400.0
-margin_bottom = 782.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="node_name" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer"]
-margin_right = 400.0
-margin_bottom = 130.0
-rect_min_size = Vector2( 400, 130 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name"]
-margin_right = 400.0
-margin_bottom = 24.0
-
-[node name="name_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-size_flags_vertical = 3
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 395.0
-margin_bottom = 19.0
-size_flags_vertical = 6
-text = "Node Details"
-
-[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name"]
-margin_top = 28.0
-margin_right = 400.0
-margin_bottom = 108.0
-custom_constants/margin_left = 5
-
-[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2"]
-margin_left = 5.0
-margin_right = 400.0
-margin_bottom = 80.0
-columns = 3
-
-[node name="node_name_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_top = 5.0
-margin_right = 91.0
-margin_bottom = 19.0
-text = "Name:"
-
-[node name="node_name" type="LineEdit" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_left = 95.0
-margin_right = 295.0
-margin_bottom = 24.0
-rect_min_size = Vector2( 200, 0 )
-hint_tooltip = "The will be the name of the node in your scene tree."
-text = "replace_me"
-caret_blink = true
-caret_blink_speed = 0.5
-
-[node name="Spacer" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_left = 299.0
-margin_right = 357.0
-margin_bottom = 24.0
-
-[node name="global_id_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_top = 33.0
-margin_right = 91.0
-margin_bottom = 47.0
-text = "Global ID:"
-
-[node name="global_id" type="LineEdit" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_left = 95.0
-margin_top = 28.0
-margin_right = 295.0
-margin_bottom = 52.0
-rect_min_size = Vector2( 200, 0 )
-hint_tooltip = "The global id for the character to be used in ESC scripts."
-caret_blink = true
-caret_blink_speed = 0.5
-
-[node name="Spacer2" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_left = 299.0
-margin_top = 28.0
-margin_right = 357.0
-margin_bottom = 52.0
-
-[node name="character_path_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_top = 61.0
-margin_right = 91.0
-margin_bottom = 75.0
-text = "Save to folder:"
-
-[node name="character_path" type="LineEdit" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_left = 95.0
-margin_top = 56.0
-margin_right = 295.0
-margin_bottom = 80.0
-rect_min_size = Vector2( 200, 0 )
-hint_tooltip = "The directory on disk where the character scene will be saved."
-text = "res://"
-editable = false
-caret_blink = true
-caret_blink_speed = 0.5
-
-[node name="character_path_change_button" type="Button" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_left = 299.0
-margin_top = 56.0
-margin_right = 357.0
-margin_bottom = 80.0
-text = "Change"
-
-[node name="charactertype" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer"]
-margin_top = 134.0
-margin_right = 400.0
-margin_bottom = 186.0
-rect_min_size = Vector2( 400, 50 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype"]
-margin_right = 400.0
-margin_bottom = 24.0
-
-[node name="directions_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="direction_number_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 395.0
-margin_bottom = 19.0
-text = "Player or NPC?"
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype"]
-margin_top = 28.0
-margin_right = 400.0
-margin_bottom = 52.0
-custom_constants/separation = 50
-alignment = 1
-
-[node name="player" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/HBoxContainer"]
-margin_left = 116.0
-margin_right = 183.0
-margin_bottom = 24.0
-hint_tooltip = "Create a user-controlled character"
-pressed = true
-text = "player"
-
-[node name="npc" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/HBoxContainer"]
-margin_left = 233.0
-margin_right = 284.0
-margin_bottom = 24.0
-hint_tooltip = "Create a non-player character"
-text = "npc"
-
-[node name="directions" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer"]
-margin_top = 190.0
-margin_right = 400.0
-margin_bottom = 242.0
-rect_min_size = Vector2( 400, 50 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions"]
-margin_right = 400.0
-margin_bottom = 24.0
-
-[node name="directions_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="direction_number_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 395.0
-margin_bottom = 19.0
-text = "Number of Directions"
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions"]
-margin_top = 28.0
-margin_right = 400.0
-margin_bottom = 52.0
-custom_constants/separation = 50
-alignment = 1
-
-[node name="one_direction" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer"]
-margin_left = 53.0
-margin_right = 89.0
-margin_bottom = 24.0
-hint_tooltip = "Create 4 directions of animation"
-text = "1"
-
-[node name="two_directions" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer"]
-margin_left = 139.0
-margin_right = 175.0
-margin_bottom = 24.0
-hint_tooltip = "Create 4 directions of animation"
-text = "2"
-
-[node name="four_directions" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer"]
-margin_left = 225.0
-margin_right = 261.0
-margin_bottom = 24.0
-hint_tooltip = "Create 4 directions of animation"
-pressed = true
-text = "4"
-
-[node name="eight_directions" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer"]
-margin_left = 311.0
-margin_right = 347.0
-margin_bottom = 24.0
-hint_tooltip = "Create 8 directions of animation"
-text = "8"
-
-[node name="animation" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer"]
-margin_top = 246.0
-margin_right = 400.0
-margin_bottom = 684.0
-rect_min_size = Vector2( 400, 200 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation"]
-margin_right = 400.0
-margin_bottom = 24.0
-
-[node name="animation_type_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="animation_type_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 395.0
-margin_bottom = 19.0
-text = "Animation"
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation"]
-margin_top = 28.0
-margin_right = 400.0
-margin_bottom = 52.0
-custom_constants/separation = 20
-alignment = 1
-
-[node name="walk_checkbox" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer"]
-margin_left = 100.0
-margin_right = 156.0
-margin_bottom = 24.0
-hint_tooltip = "Configure walk animations"
-pressed = true
-text = "walk"
-
-[node name="talk_checkbox" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer"]
-margin_left = 176.0
-margin_right = 227.0
-margin_bottom = 24.0
-hint_tooltip = "Configure talk animations"
-text = "talk"
-
-[node name="idle_checkbox" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer"]
-margin_left = 247.0
-margin_right = 299.0
-margin_bottom = 24.0
-hint_tooltip = "Configure idle animations"
-text = "idle"
-
-[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation"]
-margin_top = 56.0
-margin_right = 400.0
-margin_bottom = 106.0
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/MarginContainer2"]
-margin_right = 400.0
-margin_bottom = 50.0
-rect_min_size = Vector2( 0, 50 )
-
-[node name="HBoxContainer2" type="GridContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation"]
-margin_top = 110.0
-margin_right = 400.0
-margin_bottom = 328.0
-columns = 5
-
-[node name="Control" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_right = 50.0
-margin_bottom = 200.0
-rect_min_size = Vector2( 50, 0 )
-
-[node name="HBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 54.0
-margin_right = 164.0
-margin_bottom = 200.0
-
-[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer"]
-margin_right = 110.0
-margin_bottom = 8.0
-custom_constants/margin_left = 5
-
-[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2"]
-margin_left = 5.0
-margin_right = 110.0
-margin_bottom = 8.0
-columns = 3
-
-[node name="Container_upleft" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-
-[node name="set_dir_upleft" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upleft" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Up left animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 27 )
-texture_pressed = ExtResource( 30 )
-texture_hover = ExtResource( 30 )
-
-[node name="unset_dir_upleft" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upleft" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Up left animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 15 )
-texture_pressed = ExtResource( 6 )
-texture_hover = ExtResource( 6 )
-
-[node name="Container_up" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_left = 4.0
-margin_right = 4.0
-
-[node name="set_dir_up" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_up" groups=["direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Up animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 28 )
-texture_pressed = ExtResource( 23 )
-texture_hover = ExtResource( 23 )
-
-[node name="unset_dir_up" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_up" groups=["direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Up animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 20 )
-texture_pressed = ExtResource( 18 )
-texture_hover = ExtResource( 18 )
-
-[node name="ColorRectSpacer" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_up"]
-visible = false
-modulate = Color( 0.235294, 0.341176, 0.290196, 1 )
-margin_right = 28.0
-margin_bottom = 28.0
-rect_min_size = Vector2( 28, 28 )
-
-[node name="Container_upright" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_left = 8.0
-margin_right = 8.0
-
-[node name="unset_dir_upright" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upright" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Up right animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 14 )
-texture_pressed = ExtResource( 17 )
-texture_hover = ExtResource( 17 )
-
-[node name="set_dir_upright" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upright" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Up right animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 16 )
-texture_pressed = ExtResource( 24 )
-texture_hover = ExtResource( 24 )
-
-[node name="Container_left" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_top = 4.0
-margin_bottom = 4.0
-
-[node name="set_dir_left" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_left" groups=["direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Left animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 12 )
-texture_pressed = ExtResource( 26 )
-texture_hover = ExtResource( 26 )
-
-[node name="unset_dir_left" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_left" groups=["direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Left animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 21 )
-texture_pressed = ExtResource( 13 )
-texture_hover = ExtResource( 13 )
-
-[node name="ColorRectSpacer" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_left"]
-visible = false
-modulate = Color( 0.235294, 0.341176, 0.290196, 1 )
-margin_right = 28.0
-margin_bottom = 28.0
-rect_min_size = Vector2( 28, 28 )
-
-[node name="Container_centre" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_left = 4.0
-margin_top = 4.0
-margin_right = 4.0
-margin_bottom = 4.0
-
-[node name="Container_right" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_left = 8.0
-margin_top = 4.0
-margin_right = 8.0
-margin_bottom = 4.0
-
-[node name="set_dir_right" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_right" groups=["direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Right animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 3 )
-texture_pressed = ExtResource( 4 )
-texture_hover = ExtResource( 4 )
-
-[node name="unset_dir_right" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_right" groups=["direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Right animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 19 )
-texture_pressed = ExtResource( 2 )
-texture_hover = ExtResource( 2 )
-
-[node name="Container_downleft" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_top = 8.0
-margin_bottom = 8.0
-
-[node name="unset_dir_downleft" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downleft" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Down left animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 35 )
-texture_pressed = ExtResource( 7 )
-texture_hover = ExtResource( 7 )
-
-[node name="set_dir_downleft" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downleft" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Down left animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 11 )
-texture_pressed = ExtResource( 10 )
-texture_hover = ExtResource( 10 )
-
-[node name="Container_down" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_left = 4.0
-margin_top = 8.0
-margin_right = 4.0
-margin_bottom = 8.0
-
-[node name="set_dir_down" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_down" groups=["direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Down animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 1 )
-texture_pressed = ExtResource( 5 )
-texture_hover = ExtResource( 5 )
-
-[node name="unset_dir_down" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_down" groups=["direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Down animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 8 )
-texture_pressed = ExtResource( 33 )
-texture_hover = ExtResource( 33 )
-
-[node name="ColorRectSpacer" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_down"]
-visible = false
-modulate = Color( 0.235294, 0.341176, 0.290196, 1 )
-margin_right = 28.0
-margin_bottom = 28.0
-rect_min_size = Vector2( 28, 28 )
-
-[node name="Container_downright" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_left = 8.0
-margin_top = 8.0
-margin_right = 8.0
-margin_bottom = 8.0
-
-[node name="set_dir_downright" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downright" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Down right animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 25 )
-texture_pressed = ExtResource( 31 )
-texture_hover = ExtResource( 31 )
-
-[node name="unset_dir_downright" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downright" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Down right animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 34 )
-texture_pressed = ExtResource( 22 )
-texture_hover = ExtResource( 22 )
-
-[node name="MarginContainer3" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer"]
-margin_top = 12.0
-margin_right = 110.0
-margin_bottom = 161.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/margin_left = 15
-
-[node name="mirror_checkbox" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer3"]
-visible = false
-margin_left = 15.0
-margin_right = 110.0
-margin_bottom = 149.0
-hint_tooltip = "Mirror opposite direction's animation"
-text = "Mirror"
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer"]
-margin_top = 165.0
-margin_right = 110.0
-margin_bottom = 200.0
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer"]
-margin_right = 110.0
-margin_bottom = 35.0
-rect_min_size = Vector2( 0, 35 )
-
-[node name="Control2" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 168.0
-margin_right = 218.0
-margin_bottom = 200.0
-rect_min_size = Vector2( 50, 0 )
-
-[node name="preview" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 222.0
-margin_right = 342.0
-margin_bottom = 200.0
-rect_min_size = Vector2( 100, 200 )
-
-[node name="anim_preview_background" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/preview"]
-margin_right = 120.0
-margin_bottom = 200.0
-hint_tooltip = "Animation preview based on current animation settings"
-color = Color( 0.215686, 0.207843, 0.207843, 1 )
-
-[node name="MarginContainer" type="CenterContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/preview"]
-margin_right = 120.0
-margin_bottom = 200.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="anim_preview_sprite" type="AnimatedSprite" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/preview/MarginContainer"]
-visible = false
-scale = Vector2( 0.05, 0.05 )
-frames = SubResource( 1 )
-animation = "in_progress"
-playing = true
-centered = false
-
-[node name="no_anim_found_sprite" type="TextureRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/preview/MarginContainer"]
-margin_left = 10.0
-margin_right = 110.0
-margin_bottom = 200.0
-texture = ExtResource( 9 )
-
-[node name="Control3" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 346.0
-margin_right = 396.0
-margin_bottom = 200.0
-rect_min_size = Vector2( 50, 0 )
-
-[node name="Control4" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_top = 204.0
-margin_right = 50.0
-margin_bottom = 218.0
-rect_min_size = Vector2( 50, 0 )
-
-[node name="current_direction_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 54.0
-margin_top = 204.0
-margin_right = 164.0
-margin_bottom = 218.0
-text = "Current Direction"
-
-[node name="Control5" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 168.0
-margin_top = 204.0
-margin_right = 218.0
-margin_bottom = 218.0
-rect_min_size = Vector2( 50, 0 )
-
-[node name="anim_preview_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 222.0
-margin_top = 204.0
-margin_right = 342.0
-margin_bottom = 218.0
-text = "Animation Preview"
-
-[node name="Control6" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 346.0
-margin_top = 204.0
-margin_right = 396.0
-margin_bottom = 218.0
-rect_min_size = Vector2( 50, 0 )
-
-[node name="MarginContainer3" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation"]
-margin_top = 332.0
-margin_right = 400.0
-margin_bottom = 382.0
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/MarginContainer3"]
-margin_right = 400.0
-margin_bottom = 50.0
-rect_min_size = Vector2( 0, 50 )
-
-[node name="autosave" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation"]
-margin_top = 386.0
-margin_right = 400.0
-margin_bottom = 438.0
-rect_min_size = Vector2( 400, 50 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave"]
-margin_right = 400.0
-margin_bottom = 24.0
-
-[node name="autosave_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="Autosave_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 395.0
-margin_bottom = 19.0
-text = "Autosave changes"
-
-[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="Autosave_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/MarginContainer/MarginContainer2"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 395.0
-margin_bottom = 19.0
-text = "Autosave changes"
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave"]
-margin_top = 28.0
-margin_right = 400.0
-margin_bottom = 52.0
-custom_constants/separation = 50
-alignment = 1
-
-[node name="AutoStoreCheckBox" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/HBoxContainer"]
-margin_left = 60.0
-margin_right = 339.0
-margin_bottom = 24.0
-hint_tooltip = "All changes in this tool are automatically saved for a quicker workflow."
-text = "Auto-store all changes to this character"
-
-[node name="spritesheet" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
-margin_left = 420.0
-margin_right = 870.0
-margin_bottom = 782.0
-rect_min_size = Vector2( 440, 550 )
-mouse_filter = 1
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="spritesheet_background" type="ColorRect" parent="VBoxContainer/HBoxContainer/spritesheet"]
-margin_right = 450.0
-margin_bottom = 782.0
-mouse_filter = 1
-color = Color( 0.235294, 0.341176, 0.290196, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet"]
-margin_right = 450.0
-margin_bottom = 782.0
-rect_min_size = Vector2( 450, 550 )
-mouse_filter = 1
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 445.0
-margin_bottom = 777.0
-
-[node name="spritesheet_scroll_container" type="ScrollContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer"]
-margin_right = 440.0
-margin_bottom = 714.0
-hint_tooltip = "Loaded spritesheet"
-mouse_filter = 1
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="control" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container"]
-margin_right = 440.0
-margin_bottom = 714.0
-rect_min_size = Vector2( 192, 210 )
-mouse_filter = 1
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="spritesheet_area" type="ColorRect" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control"]
-margin_right = 440.0
-margin_bottom = 714.0
-mouse_filter = 1
-color = Color( 0.203922, 0.184314, 0.184314, 1 )
-
-[node name="spritesheet_sprite" type="TextureRect" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control"]
-margin_right = 240.0
-margin_bottom = 25.0
-rect_min_size = Vector2( 240, 25 )
-size_flags_horizontal = 0
-size_flags_vertical = 0
-expand = true
-
-[node name="frame_rectangles" type="Control" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control"]
-margin_right = 440.0
-margin_bottom = 714.0
-mouse_filter = 1
-script = ExtResource( 36 )
-total_num_rows = 1
-total_num_columns = 1
-cell_size = Vector2( 1, 1 )
-zoom_factor = 0.01
-
-[node name="MarginContainer" type="CenterContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control"]
-margin_right = 440.0
-margin_bottom = 714.0
-mouse_filter = 1
-
-[node name="no_spritesheet_found_sprite" type="TextureRect" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control/MarginContainer"]
-margin_left = 20.0
-margin_top = 157.0
-margin_right = 420.0
-margin_bottom = 557.0
-texture = ExtResource( 29 )
-
-[node name="zoom_scroll" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer"]
-margin_top = 718.0
-margin_right = 440.0
-margin_bottom = 738.0
-rect_min_size = Vector2( 440, 0 )
-
-[node name="zoom_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll"]
-margin_top = 3.0
-margin_right = 80.0
-margin_bottom = 17.0
-rect_min_size = Vector2( 80, 0 )
-text = "Zoom: 1x"
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll"]
-margin_left = 84.0
-margin_right = 388.0
-margin_bottom = 20.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="zoom_scrollbar" type="HScrollBar" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll/MarginContainer"]
-margin_right = 304.0
-margin_bottom = 20.0
-hint_tooltip = "Current spritesheet zoom level"
-size_flags_horizontal = 3
-size_flags_vertical = 3
-min_value = 0.1
-max_value = 5.0
-value = 1.0
-
-[node name="zoom_reset_button" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll"]
-margin_left = 392.0
-margin_right = 440.0
-margin_bottom = 20.0
-hint_tooltip = "Reset spritesheet zoom"
-text = "Reset"
-
-[node name="zoom_current" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer"]
-margin_top = 742.0
-margin_right = 440.0
-margin_bottom = 772.0
-rect_min_size = Vector2( 440, 30 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_current"]
-margin_right = 128.0
-margin_bottom = 30.0
-
-[node name="current_spritesheet" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_current/MarginContainer"]
-margin_top = 8.0
-margin_right = 128.0
-margin_bottom = 22.0
-text = "Current spritesheet:"
-
-[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_current"]
-margin_left = 132.0
-margin_right = 440.0
-margin_bottom = 30.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="current_spritesheet_label" type="TextEdit" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_current/MarginContainer2"]
-margin_right = 308.0
-margin_bottom = 30.0
-size_flags_horizontal = 3
-text = "No spritesheet loaded."
-readonly = true
-
-[node name="spritesheet_controls" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
-margin_left = 890.0
-margin_right = 1190.0
-margin_bottom = 782.0
-rect_min_size = Vector2( 300, 450 )
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="background_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/spritesheet_controls"]
-margin_right = 300.0
-margin_bottom = 782.0
-color = Color( 0.235294, 0.341176, 0.290196, 1 )
-
-[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls"]
-margin_right = 300.0
-margin_bottom = 782.0
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_right = 300.0
-margin_bottom = 30.0
-custom_constants/margin_bottom = 6
-
-[node name="name_colorrect3" type="ColorRect" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer"]
-margin_right = 300.0
-margin_bottom = 24.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer"]
-margin_right = 300.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 295.0
-margin_bottom = 19.0
-text = "Spritesheet Details"
-
-[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_top = 34.0
-margin_right = 300.0
-margin_bottom = 54.0
-
-[node name="load_spritesheet_button" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/CenterContainer"]
-margin_left = 90.0
-margin_right = 209.0
-margin_bottom = 20.0
-hint_tooltip = "Load a new spritesheet to create animations"
-text = "Load spritesheet"
-
-[node name="spritesheet_details_container" type="CenterContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_top = 58.0
-margin_right = 300.0
-margin_bottom = 256.0
-
-[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container"]
-margin_left = 20.0
-margin_right = 280.0
-margin_bottom = 198.0
-rect_min_size = Vector2( 260, 0 )
-custom_constants/vseparation = 10
-custom_constants/hseparation = 8
-columns = 2
-
-[node name="h_frames_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 5.0
-margin_right = 154.0
-margin_bottom = 19.0
-text = "Horizontal frames:"
-align = 2
-
-[node name="h_frames_spin_box" type="SpinBox" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_right = 236.0
-margin_bottom = 24.0
-hint_tooltip = "Divide spritesheet into this many horizontal frames"
-min_value = 1.0
-value = 1.0
-exp_edit = true
-rounded = true
-
-[node name="v_frames_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 39.0
-margin_right = 154.0
-margin_bottom = 53.0
-text = "Vertical frames:"
-align = 2
-
-[node name="v_frames_spin_box" type="SpinBox" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_top = 34.0
-margin_right = 236.0
-margin_bottom = 58.0
-hint_tooltip = "Divide spritesheet into this many vertical frames"
-min_value = 1.0
-value = 1.0
-rounded = true
-
-[node name="start_frame_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 73.0
-margin_right = 154.0
-margin_bottom = 87.0
-text = "Start frame:"
-align = 2
-
-[node name="start_frame" type="SpinBox" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_top = 68.0
-margin_right = 236.0
-margin_bottom = 92.0
-hint_tooltip = "Start frame to use for this animation"
-max_value = 1000.0
-rounded = true
-
-[node name="end_frame_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 107.0
-margin_right = 154.0
-margin_bottom = 121.0
-text = "End frame:"
-align = 2
-
-[node name="end_frame" type="SpinBox" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_top = 102.0
-margin_right = 236.0
-margin_bottom = 126.0
-hint_tooltip = "End frame to use for this animation"
-max_value = 1000.0
-rounded = true
-
-[node name="anim_speed_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 136.0
-margin_right = 154.0
-margin_bottom = 150.0
-text = "Animation speed: 5 FPS"
-align = 2
-
-[node name="anim_speed_scroll_bar" type="HScrollBar" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_top = 136.0
-margin_right = 236.0
-margin_bottom = 148.0
-hint_tooltip = "Speed of the current animation"
-min_value = 1.0
-max_value = 60.0
-step = 1.0
-value = 5.0
-rounded = true
-
-[node name="original_size_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 160.0
-margin_right = 154.0
-margin_bottom = 174.0
-text = "Source sprite size: (0, 0)"
-align = 2
-
-[node name="empty_node2" type="Control" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_top = 160.0
-margin_right = 236.0
-margin_bottom = 174.0
-
-[node name="frame_size_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 184.0
-margin_right = 154.0
-margin_bottom = 198.0
-text = "Frame size: (0, 0)"
-align = 2
-
-[node name="empty_node3" type="Control" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_top = 184.0
-margin_right = 236.0
-margin_bottom = 198.0
-
-[node name="empty_node" type="Control" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_top = 260.0
-margin_right = 300.0
-margin_bottom = 310.0
-rect_min_size = Vector2( 0, 50 )
-
-[node name="store_anim" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-visible = false
-margin_top = 314.0
-margin_right = 300.0
-margin_bottom = 414.0
-rect_min_size = Vector2( 300, 100 )
-custom_constants/separation = 10
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim"]
-margin_right = 300.0
-margin_bottom = 36.0
-
-[node name="name_colorrect2" type="ColorRect" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim/MarginContainer"]
-margin_right = 300.0
-margin_bottom = 36.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim/MarginContainer"]
-margin_right = 300.0
-margin_bottom = 36.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 295.0
-margin_bottom = 36.0
-size_flags_vertical = 6
-text = "Store Animation
-"
-valign = 1
-
-[node name="CenterContainer2" type="CenterContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim"]
-margin_top = 46.0
-margin_right = 300.0
-margin_bottom = 66.0
-
-[node name="anim_store_button" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim/CenterContainer2"]
-margin_left = 92.0
-margin_right = 207.0
-margin_bottom = 20.0
-text = "Store Animation"
-
-[node name="MarginContainer2" type="CenterContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_top = 314.0
-margin_right = 300.0
-margin_bottom = 379.0
-
-[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer2"]
-margin_left = 17.0
-margin_right = 283.0
-margin_bottom = 65.0
-
-[node name="export_button" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer2/VBoxContainer"]
-margin_right = 266.0
-margin_bottom = 61.0
-hint_tooltip = "Export all animations to a Godot scene"
-custom_colors/font_color = Color( 0, 1, 0.0392157, 1 )
-text = "Export Character to Godot Scene"
-icon = ExtResource( 32 )
-
-[node name="name_colorrect4" type="ColorRect" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer2/VBoxContainer"]
-margin_top = 65.0
-margin_right = 266.0
-margin_bottom = 65.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="empty_node2" type="Control" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_top = 383.0
-margin_right = 300.0
-margin_bottom = 663.0
-rect_min_size = Vector2( 0, 280 )
-
-[node name="MarginContainer3" type="CenterContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_top = 667.0
-margin_right = 300.0
-margin_bottom = 687.0
-
-[node name="HBoxContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3"]
-margin_left = 48.0
-margin_right = 251.0
-margin_bottom = 20.0
-custom_constants/hseparation = 15
-columns = 3
-
-[node name="help_button" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3/HBoxContainer"]
-margin_right = 42.0
-margin_bottom = 20.0
-hint_tooltip = "Export all animations to a Godot scene"
-text = "Help"
-
-[node name="reset_button" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3/HBoxContainer"]
-margin_left = 57.0
-margin_right = 105.0
-margin_bottom = 20.0
-text = "Reset"
-
-[node name="main_menu" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3/HBoxContainer"]
-margin_left = 120.0
-margin_right = 203.0
-margin_bottom = 20.0
-text = "Main Menu"
-
-[node name="ImageFileDialog" type="FileDialog" parent="."]
-margin_left = 50.0
-margin_top = 50.0
-margin_right = 1240.0
-margin_bottom = 850.0
-popup_exclusive = true
-window_title = "Open a File"
-mode = 0
-access = 2
-filters = PoolStringArray( "*.png, *.jpg, *.jpeg ; Supported Images" )
-
-[node name="CharacterPathFileDialog" type="FileDialog" parent="."]
-margin_left = 50.0
-margin_top = 50.0
-margin_right = 1240.0
-margin_bottom = 850.0
-window_title = "Open a Directory"
-mode = 2
-
-[node name="InformationWindows" type="Control" parent="."]
-visible = false
-margin_left = 50.0
-margin_top = 50.0
-margin_right = 1240.0
-margin_bottom = 850.0
-
-[node name="unstored_changes_window" type="WindowDialog" parent="InformationWindows"]
-margin_left = 295.0
-margin_top = 154.0
-margin_right = 985.0
-margin_bottom = 454.0
-popup_exclusive = true
-window_title = "WARNING : Unstored changes"
-
-[node name="Label" type="Label" parent="InformationWindows/unstored_changes_window"]
-margin_left = 86.0
-margin_top = 57.0
-margin_right = 605.0
-margin_bottom = 156.0
-text = "WARNING : You have made changes to this animation which haven't been stored.
-
-You can
-* Commit the changes, and then change to the selected direction.
-* Lose the changes, and then change to the selected direction.
-* Cancel the request to change directions and keep editing this direction."
-
-[node name="commit_button" type="Button" parent="InformationWindows/unstored_changes_window"]
-margin_left = 45.0
-margin_top = 250.0
-margin_right = 215.0
-margin_bottom = 270.0
-text = "Commit changes"
-
-[node name="lose_button" type="Button" parent="InformationWindows/unstored_changes_window"]
-margin_left = 260.0
-margin_top = 250.0
-margin_right = 430.0
-margin_bottom = 270.0
-text = "Lose changes"
-
-[node name="cancel_button" type="Button" parent="InformationWindows/unstored_changes_window"]
-margin_left = 475.0
-margin_top = 250.0
-margin_right = 645.0
-margin_bottom = 270.0
-text = "Cancel and keep editing"
-
-[node name="unstored_changes_window_anim_change" type="WindowDialog" parent="InformationWindows"]
-margin_left = 295.0
-margin_top = 154.0
-margin_right = 985.0
-margin_bottom = 454.0
-popup_exclusive = true
-window_title = "WARNING : Unstored changes"
-
-[node name="Label" type="Label" parent="InformationWindows/unstored_changes_window_anim_change"]
-margin_left = 86.0
-margin_top = 57.0
-margin_right = 605.0
-margin_bottom = 156.0
-text = "WARNING : You have made changes to this animation which haven't been stored.
-
-You can
-* Commit the changes, and then change to the selected direction.
-* Lose the changes, and then change to the selected direction.
-* Cancel the request to change directions and keep editing this direction."
-
-[node name="commit_button" type="Button" parent="InformationWindows/unstored_changes_window_anim_change"]
-margin_left = 45.0
-margin_top = 250.0
-margin_right = 215.0
-margin_bottom = 270.0
-text = "Commit changes"
-
-[node name="lose_button" type="Button" parent="InformationWindows/unstored_changes_window_anim_change"]
-margin_left = 260.0
-margin_top = 250.0
-margin_right = 430.0
-margin_bottom = 270.0
-text = "Lose changes"
-
-[node name="cancel_button" type="Button" parent="InformationWindows/unstored_changes_window_anim_change"]
-margin_left = 475.0
-margin_top = 250.0
-margin_right = 645.0
-margin_bottom = 270.0
-text = "Cancel and keep editing"
-
-[node name="generic_error_window" type="AcceptDialog" parent="InformationWindows"]
-margin_left = 343.0
-margin_top = 242.0
-margin_right = 943.0
-margin_bottom = 402.0
-input_pass_on_modal_close_click = false
-popup_exclusive = true
-dialog_text = "Please load a spritesheet to begin."
-
-[node name="export_progress" type="WindowDialog" parent="InformationWindows"]
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = -151.0
-margin_top = -87.0
-margin_right = 249.0
-margin_bottom = 113.0
-size_flags_horizontal = 3
-popup_exclusive = true
-window_title = "Export Status"
-
-[node name="progress_label" type="Label" parent="InformationWindows/export_progress"]
-anchor_left = 0.5
-anchor_right = 0.5
-margin_left = -200.0
-margin_top = 30.0
-margin_right = 200.0
-margin_bottom = 78.0
-size_flags_horizontal = 3
-size_flags_vertical = 5
-text = "Exporting animations to ESCPlayer node."
-align = 1
-
-[node name="progress_bar" type="ProgressBar" parent="InformationWindows/export_progress"]
-margin_left = 50.0
-margin_top = 100.0
-margin_right = 350.0
-margin_bottom = 130.0
-max_value = 31.0
-rounded = true
-
-[node name="export_complete" type="AcceptDialog" parent="InformationWindows"]
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = -208.0
-margin_top = -132.0
-margin_right = 309.0
-margin_bottom = 147.0
-window_title = "Export complete"
-dialog_text = "The new ESCPlayer node has now been exported.
-For your convenience, it has been automatically opened in the Godot editor.
-
-Some actions you may now want to perform:
-
-* A dialog position node has been created. This is where text will appear when
-the player talks. You will want to move this either above the character's head
-or below their feet.
-
-* The CollisionShape child node defines the bounds of the character. You may
-want to resize or change the shape assigned to this node.
-
-* You should move all child nodes down so the crosshairs are directly between
-the character's feet. This ensures that where you click lines up with where the
-character walks to.
-
-* If you want to swap a player character to an NPC, change the parent node
-from an ESCPlayer to an ESCItem. Similarly, change an NPC to a player
-character by changing the parent node to an ESCPlayer node.
-"
-
-[node name="help_window" parent="InformationWindows" instance=ExtResource( 38 )]
-
-[node name="ConfirmationDialog" type="ConfirmationDialog" parent="InformationWindows"]
-margin_left = 479.0
-margin_top = 312.0
-margin_right = 817.0
-margin_bottom = 404.0
-popup_exclusive = true
-dialog_text = "WARNING!
-
-If you continue you will lose the current character."
-
-[node name="MainMenuConfirmation" type="ConfirmationDialog" parent="InformationWindows"]
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = -122.5
-margin_top = -46.0
-margin_right = 122.5
-margin_bottom = 46.0
-dialog_text = "If you return to the main menu
-you will lose your current character.
-"
-
-[connection signal="text_changed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer/node_name" to="." method="nodename_on_node_name_text_changed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer/character_path_change_button" to="." method="_on_character_path_change_button_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/HBoxContainer/player" to="." method="_on_player_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/HBoxContainer/npc" to="." method="_on_npc_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer/one_direction" to="." method="directions_on_one_direction_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer/two_directions" to="." method="directions_on_two_directions_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer/four_directions" to="." method="directions_on_four_directions_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer/eight_directions" to="." method="directions_on_eight_directions_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer/walk_checkbox" to="." method="animation_on_walk_checkbox_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer/talk_checkbox" to="." method="animation_on_talk_checkbox_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer/idle_checkbox" to="." method="animation_on_idle_checkbox_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upleft/set_dir_upleft" to="." method="animation_on_dir_upleft_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upleft/unset_dir_upleft" to="." method="animation_on_dir_upleft_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_up/set_dir_up" to="." method="animation_on_dir_up_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_up/unset_dir_up" to="." method="animation_on_dir_up_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upright/unset_dir_upright" to="." method="animation_on_dir_upright_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upright/set_dir_upright" to="." method="animation_on_dir_upright_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_left/set_dir_left" to="." method="animation_on_dir_left_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_left/unset_dir_left" to="." method="animation_on_dir_left_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_right/set_dir_right" to="." method="animation_on_dir_right_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_right/unset_dir_right" to="." method="animation_on_dir_right_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downleft/unset_dir_downleft" to="." method="animation_on_dir_downleft_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downleft/set_dir_downleft" to="." method="animation_on_dir_downleft_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_down/set_dir_down" to="." method="animation_on_dir_down_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_down/unset_dir_down" to="." method="animation_on_dir_down_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downright/set_dir_downright" to="." method="animation_on_dir_downright_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downright/unset_dir_downright" to="." method="animation_on_dir_downright_pressed"]
-[connection signal="toggled" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer3/mirror_checkbox" to="." method="animation_on_mirror_checkbox_toggled"]
-[connection signal="toggled" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/HBoxContainer/AutoStoreCheckBox" to="." method="_on_AutoStoreCheckBox_toggled"]
-[connection signal="gui_input" from="VBoxContainer/HBoxContainer/spritesheet" to="." method="_on_spritesheet_gui_input"]
-[connection signal="gui_input" from="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control" to="." method="_on_control_gui_input"]
-[connection signal="value_changed" from="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll/MarginContainer/zoom_scrollbar" to="." method="spritesheet_on_zoom_scrollbar_value_changed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll/zoom_reset_button" to="." method="spritesheet_on_zoom_reset_button_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/CenterContainer/load_spritesheet_button" to="." method="spritesheet_on_load_spritesheet_button_pressed"]
-[connection signal="changed" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer/anim_speed_scroll_bar" to="." method="controls_on_anim_speed_scroll_bar_value_changed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim/CenterContainer2/anim_store_button" to="." method="store_on_anim_store_button_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer2/VBoxContainer/export_button" to="." method="spritesheet_on_export_button_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3/HBoxContainer/help_button" to="." method="spritesheet_on_help_button_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3/HBoxContainer/reset_button" to="." method="spritesheet_on_reset_button_pressed"]
-[connection signal="button_up" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3/HBoxContainer/main_menu" to="." method="spritesheet_on_main_menu_button_up"]
-[connection signal="file_selected" from="ImageFileDialog" to="." method="controls_on_FileDialog_file_selected"]
-[connection signal="dir_selected" from="CharacterPathFileDialog" to="." method="_on_CharacterPathFileDialog_dir_selected"]
-[connection signal="pressed" from="InformationWindows/unstored_changes_window/commit_button" to="." method="unstored_warning_on_commit_button_pressed"]
-[connection signal="pressed" from="InformationWindows/unstored_changes_window/lose_button" to="." method="unstored_warning_on_lose_button_pressed"]
-[connection signal="pressed" from="InformationWindows/unstored_changes_window/cancel_button" to="." method="unstored_warning_on_cancel_button_pressed"]
-[connection signal="pressed" from="InformationWindows/unstored_changes_window_anim_change/commit_button" to="." method="unstored_animchange_warning_on_commit_button_pressed"]
-[connection signal="pressed" from="InformationWindows/unstored_changes_window_anim_change/lose_button" to="." method="unstored_animchange_warning_on_lose_button_pressed"]
-[connection signal="pressed" from="InformationWindows/unstored_changes_window_anim_change/cancel_button" to="." method="unstored_animchange_warning_on_cancel_button_pressed"]
-[connection signal="confirmed" from="InformationWindows/ConfirmationDialog" to="." method="spritesheet_on_reset_confirmed"]
-[connection signal="confirmed" from="InformationWindows/MainMenuConfirmation" to="." method="spritesheet_on_MainMenuConfirmation_confirmed"]
diff --git a/addons/escoria-wizard/CharacterCreator.tscn.bak b/addons/escoria-wizard/CharacterCreator.tscn.bak
deleted file mode 100644
index 9b01bf2f..00000000
--- a/addons/escoria-wizard/CharacterCreator.tscn.bak
+++ /dev/null
@@ -1,1544 +0,0 @@
-[gd_scene load_steps=40 format=2]
-
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_down.png" type="Texture" id=1]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_r.png" type="Texture" id=2]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_right.png" type="Texture" id=3]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_right.png" type="Texture" id=4]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_down.png" type="Texture" id=5]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_ul.png" type="Texture" id=6]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_dl.png" type="Texture" id=7]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_d.png" type="Texture" id=8]
-[ext_resource path="res://addons/escoria-wizard/graphics/no_animation.png" type="Texture" id=9]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_downleft.png" type="Texture" id=10]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_downleft.png" type="Texture" id=11]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_left.png" type="Texture" id=12]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_l.png" type="Texture" id=13]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_ur.png" type="Texture" id=14]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_ul.png" type="Texture" id=15]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_upright.png" type="Texture" id=16]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_ur.png" type="Texture" id=17]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_u.png" type="Texture" id=18]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_r.png" type="Texture" id=19]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_u.png" type="Texture" id=20]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_l.png" type="Texture" id=21]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_dr.png" type="Texture" id=22]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_up.png" type="Texture" id=23]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_upright.png" type="Texture" id=24]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_downright.png" type="Texture" id=25]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_left.png" type="Texture" id=26]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_upleft.png" type="Texture" id=27]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreenarrow_up.png" type="Texture" id=28]
-[ext_resource path="res://addons/escoria-wizard/graphics/no_spritesheet.png" type="Texture" id=29]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_upleft.png" type="Texture" id=30]
-[ext_resource path="res://addons/escoria-wizard/graphics/greenarrow_downright.png" type="Texture" id=31]
-[ext_resource path="res://addons/escoria-wizard/graphics/icon.png" type="Texture" id=32]
-[ext_resource path="res://addons/escoria-wizard/graphics/greyarrow_d.png" type="Texture" id=33]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_dr.png" type="Texture" id=34]
-[ext_resource path="res://addons/escoria-wizard/graphics/darkgreyarrow_dl.png" type="Texture" id=35]
-[ext_resource path="res://addons/escoria-wizard/draw_frame_rects.gd" type="Script" id=36]
-[ext_resource path="res://addons/escoria-wizard/CharacterCreator.gd" type="Script" id=37]
-[ext_resource path="res://addons/escoria-wizard/help_window.tscn" type="PackedScene" id=38]
-
-[sub_resource type="SpriteFrames" id=1]
-animations = [ {
-"frames": [ ],
-"loop": true,
-"name": "default",
-"speed": 5.0
-}, {
-"frames": [ ],
-"loop": true,
-"name": "in_progress",
-"speed": 5.0
-} ]
-
-[node name="CharacterCreator" type="MarginContainer"]
-margin_right = 1290.0
-margin_bottom = 900.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/margin_right = 50
-custom_constants/margin_top = 50
-custom_constants/margin_left = 50
-custom_constants/margin_bottom = 50
-script = ExtResource( 37 )
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-margin_left = 50.0
-margin_top = 50.0
-margin_right = 1240.0
-margin_bottom = 850.0
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
-margin_right = 1190.0
-margin_bottom = 14.0
-
-[node name="node_name_colorrect2" type="ColorRect" parent="VBoxContainer/MarginContainer"]
-margin_right = 1190.0
-margin_bottom = 14.0
-rect_min_size = Vector2( 400, 0 )
-color = Color( 0.235294, 0.341176, 0.290196, 1 )
-
-[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer/MarginContainer"]
-margin_right = 1190.0
-margin_bottom = 14.0
-
-[node name="Label" type="Label" parent="VBoxContainer/MarginContainer/CenterContainer"]
-margin_left = 527.0
-margin_right = 663.0
-margin_bottom = 14.0
-custom_colors/font_color = Color( 0.921569, 1, 0, 1 )
-custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
-text = "Character Creator"
-uppercase = true
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
-margin_top = 18.0
-margin_right = 1190.0
-margin_bottom = 800.0
-rect_min_size = Vector2( 1190, 550 )
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/separation = 20
-
-[node name="configuration" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
-margin_right = 400.0
-margin_bottom = 782.0
-rect_min_size = Vector2( 400, 550 )
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="node_name_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration"]
-margin_right = 400.0
-margin_bottom = 782.0
-rect_min_size = Vector2( 400, 0 )
-color = Color( 0.235294, 0.341176, 0.290196, 1 )
-
-[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration"]
-margin_right = 400.0
-margin_bottom = 782.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="node_name" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer"]
-margin_right = 400.0
-margin_bottom = 130.0
-rect_min_size = Vector2( 400, 130 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name"]
-margin_right = 400.0
-margin_bottom = 24.0
-
-[node name="name_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-size_flags_vertical = 3
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 395.0
-margin_bottom = 19.0
-size_flags_vertical = 6
-text = "Node Details"
-
-[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name"]
-margin_top = 28.0
-margin_right = 400.0
-margin_bottom = 108.0
-custom_constants/margin_left = 5
-
-[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2"]
-margin_left = 5.0
-margin_right = 400.0
-margin_bottom = 80.0
-columns = 3
-
-[node name="node_name_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_top = 5.0
-margin_right = 91.0
-margin_bottom = 19.0
-text = "Name:"
-
-[node name="node_name" type="LineEdit" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_left = 95.0
-margin_right = 295.0
-margin_bottom = 24.0
-rect_min_size = Vector2( 200, 0 )
-hint_tooltip = "The will be the name of the node in your scene tree."
-text = "replace_me"
-caret_blink = true
-caret_blink_speed = 0.5
-
-[node name="Spacer" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_left = 299.0
-margin_right = 357.0
-margin_bottom = 24.0
-
-[node name="global_id_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_top = 33.0
-margin_right = 91.0
-margin_bottom = 47.0
-text = "Global ID:"
-
-[node name="global_id" type="LineEdit" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_left = 95.0
-margin_top = 28.0
-margin_right = 295.0
-margin_bottom = 52.0
-rect_min_size = Vector2( 200, 0 )
-hint_tooltip = "The global id for the character to be used in ESC scripts."
-caret_blink = true
-caret_blink_speed = 0.5
-
-[node name="Spacer2" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_left = 299.0
-margin_top = 28.0
-margin_right = 357.0
-margin_bottom = 52.0
-
-[node name="character_path_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_top = 61.0
-margin_right = 91.0
-margin_bottom = 75.0
-text = "Save to folder:"
-
-[node name="character_path" type="LineEdit" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_left = 95.0
-margin_top = 56.0
-margin_right = 295.0
-margin_bottom = 80.0
-rect_min_size = Vector2( 200, 0 )
-hint_tooltip = "The directory on disk where the character scene will be saved."
-text = "res://"
-editable = false
-caret_blink = true
-caret_blink_speed = 0.5
-
-[node name="character_path_change_button" type="Button" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer"]
-margin_left = 299.0
-margin_top = 56.0
-margin_right = 357.0
-margin_bottom = 80.0
-text = "Change"
-
-[node name="charactertype" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer"]
-margin_top = 134.0
-margin_right = 400.0
-margin_bottom = 186.0
-rect_min_size = Vector2( 400, 50 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype"]
-margin_right = 400.0
-margin_bottom = 24.0
-
-[node name="directions_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="direction_number_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 395.0
-margin_bottom = 19.0
-text = "Player or NPC?"
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype"]
-margin_top = 28.0
-margin_right = 400.0
-margin_bottom = 52.0
-custom_constants/separation = 50
-alignment = 1
-
-[node name="player" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/HBoxContainer"]
-margin_left = 116.0
-margin_right = 183.0
-margin_bottom = 24.0
-hint_tooltip = "Create a user-controlled character"
-pressed = true
-text = "player"
-
-[node name="npc" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/HBoxContainer"]
-margin_left = 233.0
-margin_right = 284.0
-margin_bottom = 24.0
-hint_tooltip = "Create a non-player character"
-text = "npc"
-
-[node name="directions" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer"]
-margin_top = 190.0
-margin_right = 400.0
-margin_bottom = 242.0
-rect_min_size = Vector2( 400, 50 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions"]
-margin_right = 400.0
-margin_bottom = 24.0
-
-[node name="directions_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="direction_number_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 395.0
-margin_bottom = 19.0
-text = "Number of Directions"
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions"]
-margin_top = 28.0
-margin_right = 400.0
-margin_bottom = 52.0
-custom_constants/separation = 50
-alignment = 1
-
-[node name="one_direction" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer"]
-margin_left = 53.0
-margin_right = 89.0
-margin_bottom = 24.0
-hint_tooltip = "Create 4 directions of animation"
-text = "1"
-
-[node name="two_directions" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer"]
-margin_left = 139.0
-margin_right = 175.0
-margin_bottom = 24.0
-hint_tooltip = "Create 4 directions of animation"
-text = "2"
-
-[node name="four_directions" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer"]
-margin_left = 225.0
-margin_right = 261.0
-margin_bottom = 24.0
-hint_tooltip = "Create 4 directions of animation"
-pressed = true
-text = "4"
-
-[node name="eight_directions" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer"]
-margin_left = 311.0
-margin_right = 347.0
-margin_bottom = 24.0
-hint_tooltip = "Create 8 directions of animation"
-text = "8"
-
-[node name="animation" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer"]
-margin_top = 246.0
-margin_right = 400.0
-margin_bottom = 684.0
-rect_min_size = Vector2( 400, 200 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation"]
-margin_right = 400.0
-margin_bottom = 24.0
-
-[node name="animation_type_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="animation_type_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 395.0
-margin_bottom = 19.0
-text = "Animation"
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation"]
-margin_top = 28.0
-margin_right = 400.0
-margin_bottom = 52.0
-custom_constants/separation = 20
-alignment = 1
-
-[node name="walk_checkbox" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer"]
-margin_left = 100.0
-margin_right = 156.0
-margin_bottom = 24.0
-hint_tooltip = "Configure walk animations"
-pressed = true
-text = "walk"
-
-[node name="talk_checkbox" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer"]
-margin_left = 176.0
-margin_right = 227.0
-margin_bottom = 24.0
-hint_tooltip = "Configure talk animations"
-text = "talk"
-
-[node name="idle_checkbox" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer"]
-margin_left = 247.0
-margin_right = 299.0
-margin_bottom = 24.0
-hint_tooltip = "Configure idle animations"
-text = "idle"
-
-[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation"]
-margin_top = 56.0
-margin_right = 400.0
-margin_bottom = 106.0
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/MarginContainer2"]
-margin_right = 400.0
-margin_bottom = 50.0
-rect_min_size = Vector2( 0, 50 )
-
-[node name="HBoxContainer2" type="GridContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation"]
-margin_top = 110.0
-margin_right = 400.0
-margin_bottom = 328.0
-columns = 5
-
-[node name="Control" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_right = 50.0
-margin_bottom = 200.0
-rect_min_size = Vector2( 50, 0 )
-
-[node name="HBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 54.0
-margin_right = 164.0
-margin_bottom = 200.0
-
-[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer"]
-margin_right = 110.0
-margin_bottom = 92.0
-custom_constants/margin_left = 5
-
-[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2"]
-margin_left = 5.0
-margin_right = 110.0
-margin_bottom = 92.0
-columns = 3
-
-[node name="Container_upleft" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_right = 28.0
-margin_bottom = 28.0
-
-[node name="set_dir_upleft" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upleft" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Up left animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 27 )
-texture_pressed = ExtResource( 30 )
-texture_hover = ExtResource( 30 )
-
-[node name="unset_dir_upleft" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upleft" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Up left animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 15 )
-texture_pressed = ExtResource( 6 )
-texture_hover = ExtResource( 6 )
-
-[node name="Container_up" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_left = 32.0
-margin_right = 60.0
-margin_bottom = 28.0
-
-[node name="set_dir_up" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_up" groups=["direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Up animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 28 )
-texture_pressed = ExtResource( 23 )
-texture_hover = ExtResource( 23 )
-
-[node name="unset_dir_up" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_up" groups=["direction_buttons"]]
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Up animation (unconfigured)"
-toggle_mode = true
-pressed = true
-texture_normal = ExtResource( 20 )
-texture_pressed = ExtResource( 18 )
-texture_hover = ExtResource( 18 )
-
-[node name="ColorRectSpacer" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_up"]
-visible = false
-modulate = Color( 0.235294, 0.341176, 0.290196, 1 )
-margin_right = 28.0
-margin_bottom = 28.0
-rect_min_size = Vector2( 28, 28 )
-
-[node name="Container_upright" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_left = 64.0
-margin_right = 92.0
-margin_bottom = 28.0
-
-[node name="unset_dir_upright" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upright" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Up right animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 14 )
-texture_pressed = ExtResource( 17 )
-texture_hover = ExtResource( 17 )
-
-[node name="set_dir_upright" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upright" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Up right animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 16 )
-texture_pressed = ExtResource( 24 )
-texture_hover = ExtResource( 24 )
-
-[node name="Container_left" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_top = 32.0
-margin_right = 28.0
-margin_bottom = 60.0
-
-[node name="set_dir_left" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_left" groups=["direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Left animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 12 )
-texture_pressed = ExtResource( 26 )
-texture_hover = ExtResource( 26 )
-
-[node name="unset_dir_left" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_left" groups=["direction_buttons"]]
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Left animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 21 )
-texture_pressed = ExtResource( 13 )
-texture_hover = ExtResource( 13 )
-
-[node name="ColorRectSpacer" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_left"]
-visible = false
-modulate = Color( 0.235294, 0.341176, 0.290196, 1 )
-margin_right = 28.0
-margin_bottom = 28.0
-rect_min_size = Vector2( 28, 28 )
-
-[node name="Container_centre" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_left = 32.0
-margin_top = 32.0
-margin_right = 60.0
-margin_bottom = 60.0
-
-[node name="Container_right" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_left = 64.0
-margin_top = 32.0
-margin_right = 92.0
-margin_bottom = 60.0
-
-[node name="set_dir_right" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_right" groups=["direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Right animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 3 )
-texture_pressed = ExtResource( 4 )
-texture_hover = ExtResource( 4 )
-
-[node name="unset_dir_right" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_right" groups=["direction_buttons"]]
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Right animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 19 )
-texture_pressed = ExtResource( 2 )
-texture_hover = ExtResource( 2 )
-
-[node name="Container_downleft" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_top = 64.0
-margin_right = 28.0
-margin_bottom = 92.0
-
-[node name="unset_dir_downleft" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downleft" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Down left animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 35 )
-texture_pressed = ExtResource( 7 )
-texture_hover = ExtResource( 7 )
-
-[node name="set_dir_downleft" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downleft" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Down left animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 11 )
-texture_pressed = ExtResource( 10 )
-texture_hover = ExtResource( 10 )
-
-[node name="Container_down" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_left = 32.0
-margin_top = 64.0
-margin_right = 60.0
-margin_bottom = 92.0
-
-[node name="set_dir_down" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_down" groups=["direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Down animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 1 )
-texture_pressed = ExtResource( 5 )
-texture_hover = ExtResource( 5 )
-
-[node name="unset_dir_down" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_down" groups=["direction_buttons"]]
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Down animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 8 )
-texture_pressed = ExtResource( 33 )
-texture_hover = ExtResource( 33 )
-
-[node name="ColorRectSpacer" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_down"]
-visible = false
-modulate = Color( 0.235294, 0.341176, 0.290196, 1 )
-margin_right = 28.0
-margin_bottom = 28.0
-rect_min_size = Vector2( 28, 28 )
-
-[node name="Container_downright" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer"]
-margin_left = 64.0
-margin_top = 64.0
-margin_right = 92.0
-margin_bottom = 92.0
-
-[node name="set_dir_downright" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downright" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Down right animation (configured)"
-toggle_mode = true
-texture_normal = ExtResource( 25 )
-texture_pressed = ExtResource( 31 )
-texture_hover = ExtResource( 31 )
-
-[node name="unset_dir_downright" type="TextureButton" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downright" groups=["8_direction_buttons", "direction_buttons"]]
-visible = false
-margin_right = 28.0
-margin_bottom = 28.0
-hint_tooltip = "Down right animation (unconfigured)"
-toggle_mode = true
-texture_normal = ExtResource( 34 )
-texture_pressed = ExtResource( 22 )
-texture_hover = ExtResource( 22 )
-
-[node name="MarginContainer3" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer"]
-margin_top = 96.0
-margin_right = 110.0
-margin_bottom = 161.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/margin_left = 15
-
-[node name="mirror_checkbox" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer3"]
-visible = false
-margin_left = 15.0
-margin_right = 110.0
-margin_bottom = 65.0
-hint_tooltip = "Mirror opposite direction's animation"
-text = "Mirror"
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer"]
-margin_top = 165.0
-margin_right = 110.0
-margin_bottom = 200.0
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer"]
-margin_right = 110.0
-margin_bottom = 35.0
-rect_min_size = Vector2( 0, 35 )
-
-[node name="Control2" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 168.0
-margin_right = 218.0
-margin_bottom = 200.0
-rect_min_size = Vector2( 50, 0 )
-
-[node name="preview" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 222.0
-margin_right = 342.0
-margin_bottom = 200.0
-rect_min_size = Vector2( 100, 200 )
-
-[node name="anim_preview_background" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/preview"]
-margin_right = 120.0
-margin_bottom = 200.0
-hint_tooltip = "Animation preview based on current animation settings"
-color = Color( 0.215686, 0.207843, 0.207843, 1 )
-
-[node name="MarginContainer" type="CenterContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/preview"]
-margin_right = 120.0
-margin_bottom = 200.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="anim_preview_sprite" type="AnimatedSprite" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/preview/MarginContainer"]
-visible = false
-scale = Vector2( 0.05, 0.05 )
-frames = SubResource( 1 )
-animation = "in_progress"
-playing = true
-centered = false
-
-[node name="no_anim_found_sprite" type="TextureRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/preview/MarginContainer"]
-margin_left = 10.0
-margin_right = 110.0
-margin_bottom = 200.0
-texture = ExtResource( 9 )
-
-[node name="Control3" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 346.0
-margin_right = 396.0
-margin_bottom = 200.0
-rect_min_size = Vector2( 50, 0 )
-
-[node name="Control4" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_top = 204.0
-margin_right = 50.0
-margin_bottom = 218.0
-rect_min_size = Vector2( 50, 0 )
-
-[node name="current_direction_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 54.0
-margin_top = 204.0
-margin_right = 164.0
-margin_bottom = 218.0
-text = "Current Direction"
-
-[node name="Control5" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 168.0
-margin_top = 204.0
-margin_right = 218.0
-margin_bottom = 218.0
-rect_min_size = Vector2( 50, 0 )
-
-[node name="anim_preview_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 222.0
-margin_top = 204.0
-margin_right = 342.0
-margin_bottom = 218.0
-text = "Animation Preview"
-
-[node name="Control6" type="Control" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2"]
-margin_left = 346.0
-margin_top = 204.0
-margin_right = 396.0
-margin_bottom = 218.0
-rect_min_size = Vector2( 50, 0 )
-
-[node name="MarginContainer3" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation"]
-margin_top = 332.0
-margin_right = 400.0
-margin_bottom = 382.0
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/MarginContainer3"]
-margin_right = 400.0
-margin_bottom = 50.0
-rect_min_size = Vector2( 0, 50 )
-
-[node name="autosave" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation"]
-margin_top = 386.0
-margin_right = 400.0
-margin_bottom = 438.0
-rect_min_size = Vector2( 400, 50 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave"]
-margin_right = 400.0
-margin_bottom = 24.0
-
-[node name="autosave_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="Autosave_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 395.0
-margin_bottom = 19.0
-text = "Autosave changes"
-
-[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/MarginContainer"]
-margin_right = 400.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="Autosave_label" type="Label" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/MarginContainer/MarginContainer2"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 395.0
-margin_bottom = 19.0
-text = "Autosave changes"
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave"]
-margin_top = 28.0
-margin_right = 400.0
-margin_bottom = 52.0
-custom_constants/separation = 50
-alignment = 1
-
-[node name="AutoStoreCheckBox" type="CheckBox" parent="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/HBoxContainer"]
-margin_left = 60.0
-margin_right = 339.0
-margin_bottom = 24.0
-hint_tooltip = "All changes in this tool are automatically saved for a quicker workflow."
-text = "Auto-store all changes to this character"
-
-[node name="spritesheet" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
-margin_left = 420.0
-margin_right = 870.0
-margin_bottom = 782.0
-rect_min_size = Vector2( 440, 550 )
-mouse_filter = 1
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="spritesheet_background" type="ColorRect" parent="VBoxContainer/HBoxContainer/spritesheet"]
-margin_right = 450.0
-margin_bottom = 782.0
-mouse_filter = 1
-color = Color( 0.235294, 0.341176, 0.290196, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet"]
-margin_right = 450.0
-margin_bottom = 782.0
-rect_min_size = Vector2( 450, 550 )
-mouse_filter = 1
-size_flags_horizontal = 3
-size_flags_vertical = 3
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 445.0
-margin_bottom = 777.0
-
-[node name="spritesheet_scroll_container" type="ScrollContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer"]
-margin_right = 440.0
-margin_bottom = 714.0
-hint_tooltip = "Loaded spritesheet"
-mouse_filter = 1
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="control" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container"]
-margin_right = 440.0
-margin_bottom = 714.0
-rect_min_size = Vector2( 192, 210 )
-mouse_filter = 1
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="spritesheet_area" type="ColorRect" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control"]
-margin_right = 440.0
-margin_bottom = 714.0
-mouse_filter = 1
-color = Color( 0.203922, 0.184314, 0.184314, 1 )
-
-[node name="spritesheet_sprite" type="TextureRect" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control"]
-margin_right = 240.0
-margin_bottom = 25.0
-rect_min_size = Vector2( 240, 25 )
-size_flags_horizontal = 0
-size_flags_vertical = 0
-expand = true
-
-[node name="frame_rectangles" type="Control" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control"]
-margin_right = 440.0
-margin_bottom = 714.0
-mouse_filter = 1
-script = ExtResource( 36 )
-total_num_rows = 1
-total_num_columns = 1
-cell_size = Vector2( 1, 1 )
-zoom_factor = 0.01
-
-[node name="MarginContainer" type="CenterContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control"]
-margin_right = 440.0
-margin_bottom = 714.0
-mouse_filter = 1
-
-[node name="no_spritesheet_found_sprite" type="TextureRect" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control/MarginContainer"]
-margin_left = 20.0
-margin_top = 157.0
-margin_right = 420.0
-margin_bottom = 557.0
-texture = ExtResource( 29 )
-
-[node name="zoom_scroll" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer"]
-margin_top = 718.0
-margin_right = 440.0
-margin_bottom = 738.0
-rect_min_size = Vector2( 440, 0 )
-
-[node name="zoom_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll"]
-margin_top = 3.0
-margin_right = 80.0
-margin_bottom = 17.0
-rect_min_size = Vector2( 80, 0 )
-text = "Zoom: 1x"
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll"]
-margin_left = 84.0
-margin_right = 388.0
-margin_bottom = 20.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="zoom_scrollbar" type="HScrollBar" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll/MarginContainer"]
-margin_right = 304.0
-margin_bottom = 20.0
-hint_tooltip = "Current spritesheet zoom level"
-size_flags_horizontal = 3
-size_flags_vertical = 3
-min_value = 0.1
-max_value = 5.0
-value = 1.0
-
-[node name="zoom_reset_button" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll"]
-margin_left = 392.0
-margin_right = 440.0
-margin_bottom = 20.0
-hint_tooltip = "Reset spritesheet zoom"
-text = "Reset"
-
-[node name="zoom_current" type="HBoxContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer"]
-margin_top = 742.0
-margin_right = 440.0
-margin_bottom = 772.0
-rect_min_size = Vector2( 440, 30 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_current"]
-margin_right = 128.0
-margin_bottom = 30.0
-
-[node name="current_spritesheet" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_current/MarginContainer"]
-margin_top = 8.0
-margin_right = 128.0
-margin_bottom = 22.0
-text = "Current spritesheet:"
-
-[node name="MarginContainer2" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_current"]
-margin_left = 132.0
-margin_right = 440.0
-margin_bottom = 30.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="current_spritesheet_label" type="TextEdit" parent="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_current/MarginContainer2"]
-margin_right = 308.0
-margin_bottom = 30.0
-size_flags_horizontal = 3
-text = "No spritesheet loaded."
-readonly = true
-
-[node name="spritesheet_controls" type="MarginContainer" parent="VBoxContainer/HBoxContainer"]
-margin_left = 890.0
-margin_right = 1190.0
-margin_bottom = 782.0
-rect_min_size = Vector2( 300, 450 )
-size_flags_horizontal = 3
-size_flags_vertical = 3
-
-[node name="background_colorrect" type="ColorRect" parent="VBoxContainer/HBoxContainer/spritesheet_controls"]
-margin_right = 300.0
-margin_bottom = 782.0
-color = Color( 0.235294, 0.341176, 0.290196, 1 )
-
-[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls"]
-margin_right = 300.0
-margin_bottom = 782.0
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_right = 300.0
-margin_bottom = 30.0
-custom_constants/margin_bottom = 6
-
-[node name="name_colorrect3" type="ColorRect" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer"]
-margin_right = 300.0
-margin_bottom = 24.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer"]
-margin_right = 300.0
-margin_bottom = 24.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 295.0
-margin_bottom = 19.0
-text = "Spritesheet Details"
-
-[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_top = 34.0
-margin_right = 300.0
-margin_bottom = 54.0
-
-[node name="load_spritesheet_button" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/CenterContainer"]
-margin_left = 90.0
-margin_right = 209.0
-margin_bottom = 20.0
-hint_tooltip = "Load a new spritesheet to create animations"
-text = "Load spritesheet"
-
-[node name="spritesheet_details_container" type="CenterContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_top = 58.0
-margin_right = 300.0
-margin_bottom = 256.0
-
-[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container"]
-margin_left = 20.0
-margin_right = 280.0
-margin_bottom = 198.0
-rect_min_size = Vector2( 260, 0 )
-custom_constants/vseparation = 10
-custom_constants/hseparation = 8
-columns = 2
-
-[node name="h_frames_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 5.0
-margin_right = 154.0
-margin_bottom = 19.0
-text = "Horizontal frames:"
-align = 2
-
-[node name="h_frames_spin_box" type="SpinBox" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_right = 236.0
-margin_bottom = 24.0
-hint_tooltip = "Divide spritesheet into this many horizontal frames"
-min_value = 1.0
-value = 1.0
-exp_edit = true
-rounded = true
-
-[node name="v_frames_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 39.0
-margin_right = 154.0
-margin_bottom = 53.0
-text = "Vertical frames:"
-align = 2
-
-[node name="v_frames_spin_box" type="SpinBox" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_top = 34.0
-margin_right = 236.0
-margin_bottom = 58.0
-hint_tooltip = "Divide spritesheet into this many vertical frames"
-min_value = 1.0
-value = 1.0
-rounded = true
-
-[node name="start_frame_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 73.0
-margin_right = 154.0
-margin_bottom = 87.0
-text = "Start frame:"
-align = 2
-
-[node name="start_frame" type="SpinBox" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_top = 68.0
-margin_right = 236.0
-margin_bottom = 92.0
-hint_tooltip = "Start frame to use for this animation"
-max_value = 1000.0
-rounded = true
-
-[node name="end_frame_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 107.0
-margin_right = 154.0
-margin_bottom = 121.0
-text = "End frame:"
-align = 2
-
-[node name="end_frame" type="SpinBox" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_top = 102.0
-margin_right = 236.0
-margin_bottom = 126.0
-hint_tooltip = "End frame to use for this animation"
-max_value = 1000.0
-rounded = true
-
-[node name="anim_speed_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 136.0
-margin_right = 154.0
-margin_bottom = 150.0
-text = "Animation speed: 5 FPS"
-align = 2
-
-[node name="anim_speed_scroll_bar" type="HScrollBar" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_top = 136.0
-margin_right = 236.0
-margin_bottom = 148.0
-hint_tooltip = "Speed of the current animation"
-min_value = 1.0
-max_value = 60.0
-step = 1.0
-value = 5.0
-rounded = true
-
-[node name="original_size_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 160.0
-margin_right = 154.0
-margin_bottom = 174.0
-text = "Source sprite size: (0, 0)"
-align = 2
-
-[node name="empty_node2" type="Control" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_top = 160.0
-margin_right = 236.0
-margin_bottom = 174.0
-
-[node name="frame_size_label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_top = 184.0
-margin_right = 154.0
-margin_bottom = 198.0
-text = "Frame size: (0, 0)"
-align = 2
-
-[node name="empty_node3" type="Control" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer"]
-margin_left = 162.0
-margin_top = 184.0
-margin_right = 236.0
-margin_bottom = 198.0
-
-[node name="empty_node" type="Control" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_top = 260.0
-margin_right = 300.0
-margin_bottom = 310.0
-rect_min_size = Vector2( 0, 50 )
-
-[node name="store_anim" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-visible = false
-margin_top = 314.0
-margin_right = 300.0
-margin_bottom = 414.0
-rect_min_size = Vector2( 300, 100 )
-custom_constants/separation = 10
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim"]
-margin_right = 300.0
-margin_bottom = 36.0
-
-[node name="name_colorrect2" type="ColorRect" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim/MarginContainer"]
-margin_right = 300.0
-margin_bottom = 36.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim/MarginContainer"]
-margin_right = 300.0
-margin_bottom = 36.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-
-[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim/MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 295.0
-margin_bottom = 36.0
-size_flags_vertical = 6
-text = "Store Animation
-"
-valign = 1
-
-[node name="CenterContainer2" type="CenterContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim"]
-margin_top = 46.0
-margin_right = 300.0
-margin_bottom = 66.0
-
-[node name="anim_store_button" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim/CenterContainer2"]
-margin_left = 92.0
-margin_right = 207.0
-margin_bottom = 20.0
-text = "Store Animation"
-
-[node name="MarginContainer2" type="CenterContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_top = 314.0
-margin_right = 300.0
-margin_bottom = 379.0
-
-[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer2"]
-margin_left = 17.0
-margin_right = 283.0
-margin_bottom = 65.0
-
-[node name="export_button" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer2/VBoxContainer"]
-margin_right = 266.0
-margin_bottom = 61.0
-hint_tooltip = "Export all animations to a Godot scene"
-custom_colors/font_color = Color( 0, 1, 0.0392157, 1 )
-text = "Export Character to Godot Scene"
-icon = ExtResource( 32 )
-
-[node name="name_colorrect4" type="ColorRect" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer2/VBoxContainer"]
-margin_top = 65.0
-margin_right = 266.0
-margin_bottom = 65.0
-color = Color( 0.215686, 0.478431, 0.235294, 1 )
-
-[node name="empty_node2" type="Control" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_top = 383.0
-margin_right = 300.0
-margin_bottom = 663.0
-rect_min_size = Vector2( 0, 280 )
-
-[node name="MarginContainer3" type="CenterContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer"]
-margin_top = 667.0
-margin_right = 300.0
-margin_bottom = 687.0
-
-[node name="HBoxContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3"]
-margin_left = 48.0
-margin_right = 251.0
-margin_bottom = 20.0
-custom_constants/hseparation = 15
-columns = 3
-
-[node name="help_button" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3/HBoxContainer"]
-margin_right = 42.0
-margin_bottom = 20.0
-hint_tooltip = "Export all animations to a Godot scene"
-text = "Help"
-
-[node name="reset_button" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3/HBoxContainer"]
-margin_left = 57.0
-margin_right = 105.0
-margin_bottom = 20.0
-text = "Reset"
-
-[node name="main_menu" type="Button" parent="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3/HBoxContainer"]
-margin_left = 120.0
-margin_right = 203.0
-margin_bottom = 20.0
-text = "Main Menu"
-
-[node name="ImageFileDialog" type="FileDialog" parent="."]
-margin_left = 50.0
-margin_top = 50.0
-margin_right = 1240.0
-margin_bottom = 850.0
-popup_exclusive = true
-window_title = "Open a File"
-mode = 0
-access = 2
-filters = PoolStringArray( "*.png, *.jpg, *.jpeg ; Supported Images" )
-
-[node name="CharacterPathFileDialog" type="FileDialog" parent="."]
-margin_left = 50.0
-margin_top = 50.0
-margin_right = 1240.0
-margin_bottom = 850.0
-window_title = "Open a Directory"
-mode = 2
-
-[node name="InformationWindows" type="Control" parent="."]
-visible = false
-margin_left = 50.0
-margin_top = 50.0
-margin_right = 1240.0
-margin_bottom = 850.0
-
-[node name="unstored_changes_window" type="WindowDialog" parent="InformationWindows"]
-margin_left = 295.0
-margin_top = 154.0
-margin_right = 985.0
-margin_bottom = 454.0
-popup_exclusive = true
-window_title = "WARNING : Unstored changes"
-
-[node name="Label" type="Label" parent="InformationWindows/unstored_changes_window"]
-margin_left = 86.0
-margin_top = 57.0
-margin_right = 605.0
-margin_bottom = 156.0
-text = "WARNING : You have made changes to this animation which haven't been stored.
-
-You can
-* Commit the changes, and then change to the selected direction.
-* Lose the changes, and then change to the selected direction.
-* Cancel the request to change directions and keep editing this direction."
-
-[node name="commit_button" type="Button" parent="InformationWindows/unstored_changes_window"]
-margin_left = 45.0
-margin_top = 250.0
-margin_right = 215.0
-margin_bottom = 270.0
-text = "Commit changes"
-
-[node name="lose_button" type="Button" parent="InformationWindows/unstored_changes_window"]
-margin_left = 260.0
-margin_top = 250.0
-margin_right = 430.0
-margin_bottom = 270.0
-text = "Lose changes"
-
-[node name="cancel_button" type="Button" parent="InformationWindows/unstored_changes_window"]
-margin_left = 475.0
-margin_top = 250.0
-margin_right = 645.0
-margin_bottom = 270.0
-text = "Cancel and keep editing"
-
-[node name="unstored_changes_window_anim_change" type="WindowDialog" parent="InformationWindows"]
-margin_left = 295.0
-margin_top = 154.0
-margin_right = 985.0
-margin_bottom = 454.0
-popup_exclusive = true
-window_title = "WARNING : Unstored changes"
-
-[node name="Label" type="Label" parent="InformationWindows/unstored_changes_window_anim_change"]
-margin_left = 86.0
-margin_top = 57.0
-margin_right = 605.0
-margin_bottom = 156.0
-text = "WARNING : You have made changes to this animation which haven't been stored.
-
-You can
-* Commit the changes, and then change to the selected direction.
-* Lose the changes, and then change to the selected direction.
-* Cancel the request to change directions and keep editing this direction."
-
-[node name="commit_button" type="Button" parent="InformationWindows/unstored_changes_window_anim_change"]
-margin_left = 45.0
-margin_top = 250.0
-margin_right = 215.0
-margin_bottom = 270.0
-text = "Commit changes"
-
-[node name="lose_button" type="Button" parent="InformationWindows/unstored_changes_window_anim_change"]
-margin_left = 260.0
-margin_top = 250.0
-margin_right = 430.0
-margin_bottom = 270.0
-text = "Lose changes"
-
-[node name="cancel_button" type="Button" parent="InformationWindows/unstored_changes_window_anim_change"]
-margin_left = 475.0
-margin_top = 250.0
-margin_right = 645.0
-margin_bottom = 270.0
-text = "Cancel and keep editing"
-
-[node name="generic_error_window" type="AcceptDialog" parent="InformationWindows"]
-margin_left = 343.0
-margin_top = 242.0
-margin_right = 943.0
-margin_bottom = 402.0
-input_pass_on_modal_close_click = false
-popup_exclusive = true
-dialog_text = "Please load a spritesheet to begin."
-
-[node name="export_progress" type="WindowDialog" parent="InformationWindows"]
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = -151.0
-margin_top = -87.0
-margin_right = 249.0
-margin_bottom = 113.0
-size_flags_horizontal = 3
-popup_exclusive = true
-window_title = "Export Status"
-
-[node name="progress_label" type="Label" parent="InformationWindows/export_progress"]
-anchor_left = 0.5
-anchor_right = 0.5
-margin_left = -200.0
-margin_top = 30.0
-margin_right = 200.0
-margin_bottom = 78.0
-size_flags_horizontal = 3
-size_flags_vertical = 5
-text = "Exporting animations to ESCPlayer node."
-align = 1
-
-[node name="progress_bar" type="ProgressBar" parent="InformationWindows/export_progress"]
-margin_left = 50.0
-margin_top = 100.0
-margin_right = 350.0
-margin_bottom = 130.0
-max_value = 31.0
-rounded = true
-
-[node name="export_complete" type="AcceptDialog" parent="InformationWindows"]
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = -208.0
-margin_top = -132.0
-margin_right = 309.0
-margin_bottom = 147.0
-window_title = "Export complete"
-dialog_text = "The new ESCPlayer node has now been exported.
-For your convenience, it has been automatically opened in the Godot editor.
-
-Some actions you may now want to perform:
-
-* A dialog position node has been created. This is where text will appear when
-the player talks. You will want to move this either above the character's head
-or below their feet.
-
-* The CollisionShape child node defines the bounds of the character. You may
-want to resize or change the shape assigned to this node.
-
-* You should move all child nodes down so the crosshairs are directly between
-the character's feet. This ensures that where you click lines up with where the
-character walks to.
-
-* If you want to swap a player character to an NPC, change the parent node
-from an ESCPlayer to an ESCItem. Similarly, change an NPC to a player
-character by changing the parent node to an ESCPlayer node.
-"
-
-[node name="help_window" parent="InformationWindows" instance=ExtResource( 38 )]
-
-[node name="ConfirmationDialog" type="ConfirmationDialog" parent="InformationWindows"]
-margin_left = 479.0
-margin_top = 312.0
-margin_right = 817.0
-margin_bottom = 404.0
-popup_exclusive = true
-dialog_text = "WARNING!
-
-If you continue you will lose the current character."
-
-[node name="MainMenuConfirmation" type="ConfirmationDialog" parent="InformationWindows"]
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = -122.5
-margin_top = -46.0
-margin_right = 122.5
-margin_bottom = 46.0
-dialog_text = "If you return to the main menu
-you will lose your current character.
-"
-
-[connection signal="text_changed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer/node_name" to="." method="nodename_on_node_name_text_changed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/node_name/MarginContainer2/GridContainer/character_path_change_button" to="." method="_on_character_path_change_button_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/HBoxContainer/player" to="." method="_on_player_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/charactertype/HBoxContainer/npc" to="." method="_on_npc_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer/one_direction" to="." method="directions_on_one_direction_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer/two_directions" to="." method="directions_on_two_directions_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer/four_directions" to="." method="directions_on_four_directions_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/directions/HBoxContainer/eight_directions" to="." method="directions_on_eight_directions_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer/walk_checkbox" to="." method="animation_on_walk_checkbox_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer/talk_checkbox" to="." method="animation_on_talk_checkbox_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer/idle_checkbox" to="." method="animation_on_idle_checkbox_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upleft/set_dir_upleft" to="." method="animation_on_dir_upleft_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upleft/unset_dir_upleft" to="." method="animation_on_dir_upleft_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_up/set_dir_up" to="." method="animation_on_dir_up_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_up/unset_dir_up" to="." method="animation_on_dir_up_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upright/unset_dir_upright" to="." method="animation_on_dir_upright_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_upright/set_dir_upright" to="." method="animation_on_dir_upright_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_left/set_dir_left" to="." method="animation_on_dir_left_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_left/unset_dir_left" to="." method="animation_on_dir_left_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_right/set_dir_right" to="." method="animation_on_dir_right_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_right/unset_dir_right" to="." method="animation_on_dir_right_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downleft/unset_dir_downleft" to="." method="animation_on_dir_downleft_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downleft/set_dir_downleft" to="." method="animation_on_dir_downleft_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_down/set_dir_down" to="." method="animation_on_dir_down_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_down/unset_dir_down" to="." method="animation_on_dir_down_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downright/set_dir_downright" to="." method="animation_on_dir_downright_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer2/GridContainer/Container_downright/unset_dir_downright" to="." method="animation_on_dir_downright_pressed"]
-[connection signal="toggled" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/HBoxContainer2/HBoxContainer/MarginContainer3/mirror_checkbox" to="." method="animation_on_mirror_checkbox_toggled"]
-[connection signal="toggled" from="VBoxContainer/HBoxContainer/configuration/VBoxContainer/animation/autosave/HBoxContainer/AutoStoreCheckBox" to="." method="_on_AutoStoreCheckBox_toggled"]
-[connection signal="gui_input" from="VBoxContainer/HBoxContainer/spritesheet" to="." method="_on_spritesheet_gui_input"]
-[connection signal="gui_input" from="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/spritesheet_scroll_container/control" to="." method="_on_control_gui_input"]
-[connection signal="value_changed" from="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll/MarginContainer/zoom_scrollbar" to="." method="spritesheet_on_zoom_scrollbar_value_changed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/spritesheet/MarginContainer/VBoxContainer/zoom_scroll/zoom_reset_button" to="." method="spritesheet_on_zoom_reset_button_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/CenterContainer/load_spritesheet_button" to="." method="spritesheet_on_load_spritesheet_button_pressed"]
-[connection signal="changed" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/spritesheet_details_container/GridContainer/anim_speed_scroll_bar" to="." method="controls_on_anim_speed_scroll_bar_value_changed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/store_anim/CenterContainer2/anim_store_button" to="." method="store_on_anim_store_button_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer2/VBoxContainer/export_button" to="." method="spritesheet_on_export_button_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3/HBoxContainer/help_button" to="." method="spritesheet_on_help_button_pressed"]
-[connection signal="pressed" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3/HBoxContainer/reset_button" to="." method="spritesheet_on_reset_button_pressed"]
-[connection signal="button_up" from="VBoxContainer/HBoxContainer/spritesheet_controls/VBoxContainer/MarginContainer3/HBoxContainer/main_menu" to="." method="spritesheet_on_main_menu_button_up"]
-[connection signal="file_selected" from="ImageFileDialog" to="." method="controls_on_FileDialog_file_selected"]
-[connection signal="dir_selected" from="CharacterPathFileDialog" to="." method="_on_CharacterPathFileDialog_dir_selected"]
-[connection signal="pressed" from="InformationWindows/unstored_changes_window/commit_button" to="." method="unstored_warning_on_commit_button_pressed"]
-[connection signal="pressed" from="InformationWindows/unstored_changes_window/lose_button" to="." method="unstored_warning_on_lose_button_pressed"]
-[connection signal="pressed" from="InformationWindows/unstored_changes_window/cancel_button" to="." method="unstored_warning_on_cancel_button_pressed"]
-[connection signal="pressed" from="InformationWindows/unstored_changes_window_anim_change/commit_button" to="." method="unstored_animchange_warning_on_commit_button_pressed"]
-[connection signal="pressed" from="InformationWindows/unstored_changes_window_anim_change/lose_button" to="." method="unstored_animchange_warning_on_lose_button_pressed"]
-[connection signal="pressed" from="InformationWindows/unstored_changes_window_anim_change/cancel_button" to="." method="unstored_animchange_warning_on_cancel_button_pressed"]
-[connection signal="confirmed" from="InformationWindows/ConfirmationDialog" to="." method="spritesheet_on_reset_confirmed"]
-[connection signal="confirmed" from="InformationWindows/MainMenuConfirmation" to="." method="spritesheet_on_MainMenuConfirmation_confirmed"]
diff --git a/addons/escoria-wizard/ItemCreator.tscn b/addons/escoria-wizard/ItemCreator.tscn
deleted file mode 100644
index 324aa28e..00000000
--- a/addons/escoria-wizard/ItemCreator.tscn
+++ /dev/null
@@ -1,450 +0,0 @@
-[gd_scene load_steps=4 format=2]
-
-[ext_resource path="res://addons/escoria-wizard/item_creator.gd" type="Script" id=1]
-[ext_resource path="res://addons/escoria-wizard/graphics/inventory_preview.png" type="Texture" id=2]
-[ext_resource path="res://addons/escoria-wizard/graphics/object_preview.png" type="Texture" id=3]
-
-[node name="ItemCreator" type="MarginContainer"]
-margin_left = 395.0
-margin_top = 50.0
-margin_right = 895.0
-margin_bottom = 850.0
-rect_min_size = Vector2( 500, 500 )
-mouse_filter = 1
-size_flags_horizontal = 4
-size_flags_vertical = 4
-script = ExtResource( 1 )
-
-[node name="window_background_colour" type="ColorRect" parent="."]
-margin_right = 500.0
-margin_bottom = 800.0
-rect_min_size = Vector2( 500, 800 )
-color = Color( 0.235294, 0.341176, 0.290196, 1 )
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-margin_right = 500.0
-margin_bottom = 800.0
-
-[node name="Control" type="CenterContainer" parent="VBoxContainer"]
-margin_right = 500.0
-margin_bottom = 60.0
-rect_min_size = Vector2( 0, 60 )
-
-[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer/Control"]
-margin_left = 69.0
-margin_top = 18.0
-margin_right = 430.0
-margin_bottom = 42.0
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/Control/CenterContainer"]
-margin_right = 361.0
-margin_bottom = 24.0
-
-[node name="BackgroundObjectCheckBox" type="CheckBox" parent="VBoxContainer/Control/CenterContainer/HBoxContainer"]
-margin_right = 190.0
-margin_bottom = 24.0
-pressed = true
-text = "Create background object"
-
-[node name="InventoryItemCheckBox" type="CheckBox" parent="VBoxContainer/Control/CenterContainer/HBoxContainer"]
-margin_left = 194.0
-margin_right = 361.0
-margin_bottom = 24.0
-text = "Create inventory item"
-
-[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
-margin_top = 64.0
-margin_right = 500.0
-margin_bottom = 68.0
-
-[node name="HelperHeading" type="MarginContainer" parent="VBoxContainer"]
-margin_top = 72.0
-margin_right = 500.0
-margin_bottom = 112.0
-rect_min_size = Vector2( 0, 40 )
-
-[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer/HelperHeading"]
-margin_right = 500.0
-margin_bottom = 40.0
-
-[node name="ObjectHeading" type="Label" parent="VBoxContainer/HelperHeading/CenterContainer"]
-margin_left = 196.0
-margin_top = 13.0
-margin_right = 303.0
-margin_bottom = 27.0
-custom_colors/font_color = Color( 0.592157, 0.87451, 0.533333, 1 )
-custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
-text = "Object Creator"
-uppercase = true
-
-[node name="InventoryHeading" type="Label" parent="VBoxContainer/HelperHeading/CenterContainer"]
-visible = false
-margin_left = 165.0
-margin_top = 13.0
-margin_right = 335.0
-margin_bottom = 27.0
-custom_colors/font_color = Color( 0.592157, 0.87451, 0.533333, 1 )
-custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
-text = "Inventory Item Creator"
-uppercase = true
-
-[node name="Description" type="MarginContainer" parent="VBoxContainer"]
-margin_top = 116.0
-margin_right = 500.0
-margin_bottom = 249.0
-
-[node name="ObjectDescription" type="Label" parent="VBoxContainer/Description"]
-visible = false
-margin_top = 8.0
-margin_right = 500.0
-margin_bottom = 124.0
-text = "The object creator is used to create background objects
-that the player can interact with, but that will not become
-part of their inventory.
-
-NOTE: The node will be created as a child of whichever node
-is currently selected in the scene tree.
-"
-align = 1
-
-[node name="InventoryDescription" type="Label" parent="VBoxContainer/Description"]
-margin_right = 500.0
-margin_bottom = 133.0
-text = "The inventory item creator is used to create objects
-that the player can pick up to add
-to their inventory.
-
-NOTE: The node will be created in the inventory
-folder shown below. All inventory items for your
-game must live in the same folder.
-"
-align = 1
-
-[node name="Content" type="MarginContainer" parent="VBoxContainer"]
-margin_top = 253.0
-margin_right = 500.0
-margin_bottom = 753.0
-rect_min_size = Vector2( 0, 500 )
-mouse_filter = 1
-custom_constants/margin_right = 20
-custom_constants/margin_top = 0
-custom_constants/margin_left = 20
-
-[node name="GridContainer" type="GridContainer" parent="VBoxContainer/Content"]
-margin_left = 20.0
-margin_right = 480.0
-margin_bottom = 500.0
-rect_min_size = Vector2( 460, 500 )
-columns = 3
-
-[node name="ItemNameLabel" type="Label" parent="VBoxContainer/Content/GridContainer"]
-margin_top = 5.0
-margin_right = 110.0
-margin_bottom = 19.0
-text = "Item name:"
-
-[node name="ItemName" type="LineEdit" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 114.0
-margin_right = 354.0
-margin_bottom = 24.0
-rect_min_size = Vector2( 200, 0 )
-text = "replace_me"
-
-[node name="BlankItem" type="Control" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 358.0
-margin_right = 460.0
-margin_bottom = 24.0
-
-[node name="ItemGlobalIDLabel" type="Label" parent="VBoxContainer/Content/GridContainer"]
-margin_top = 33.0
-margin_right = 110.0
-margin_bottom = 47.0
-text = "Global ID:"
-
-[node name="ItemGlobalID" type="LineEdit" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 114.0
-margin_top = 28.0
-margin_right = 354.0
-margin_bottom = 52.0
-
-[node name="BlankItem2" type="Control" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 358.0
-margin_top = 28.0
-margin_right = 460.0
-margin_bottom = 52.0
-
-[node name="StartsInteractiveLabel" type="Label" parent="VBoxContainer/Content/GridContainer"]
-margin_top = 61.0
-margin_right = 110.0
-margin_bottom = 75.0
-rect_min_size = Vector2( 110, 0 )
-text = "Is 'Interactive':"
-
-[node name="StartsInteractiveCheckBox" type="CheckBox" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 114.0
-margin_top = 56.0
-margin_right = 354.0
-margin_bottom = 80.0
-hint_tooltip = "When the room first loads, can the player interact with this?"
-pressed = true
-
-[node name="BlankItem3" type="Control" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 358.0
-margin_top = 56.0
-margin_right = 460.0
-margin_bottom = 80.0
-
-[node name="DefaultActionLabel" type="Label" parent="VBoxContainer/Content/GridContainer"]
-margin_top = 84.0
-margin_right = 110.0
-margin_bottom = 115.0
-text = "Default action:
-"
-valign = 1
-
-[node name="DefaultActionOption" type="OptionButton" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 114.0
-margin_top = 84.0
-margin_right = 354.0
-margin_bottom = 115.0
-rect_min_size = Vector2( 200, 31 )
-text = "look"
-items = [ "look", null, false, 0, null, "pick up", null, false, 1, null, "open", null, false, 2, null, "close", null, false, 3, null, "use", null, false, 4, null, "push", null, false, 5, null, "pull", null, false, 6, null, "talk", null, false, 7, null ]
-selected = 0
-
-[node name="BlankItem4" type="Control" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 358.0
-margin_top = 84.0
-margin_right = 460.0
-margin_bottom = 115.0
-
-[node name="ImagePathLabel" type="Label" parent="VBoxContainer/Content/GridContainer"]
-margin_top = 124.0
-margin_right = 110.0
-margin_bottom = 138.0
-text = "Item graphic:"
-
-[node name="ImagePath" type="LineEdit" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 114.0
-margin_top = 119.0
-margin_right = 354.0
-margin_bottom = 143.0
-editable = false
-
-[node name="ChangeImageButton" type="Button" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 358.0
-margin_top = 119.0
-margin_right = 460.0
-margin_bottom = 143.0
-text = "Change Image"
-
-[node name="PreviewLabel" type="Label" parent="VBoxContainer/Content/GridContainer"]
-margin_top = 260.0
-margin_right = 110.0
-margin_bottom = 274.0
-text = "Preview:"
-
-[node name="Preview" type="ColorRect" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 114.0
-margin_top = 147.0
-margin_right = 354.0
-margin_bottom = 387.0
-rect_min_size = Vector2( 240, 240 )
-color = Color( 0.121569, 0.196078, 0.0823529, 1 )
-
-[node name="BackgroundColour" type="ColorRect" parent="VBoxContainer/Content/GridContainer/Preview"]
-margin_left = 4.0
-margin_top = 4.0
-margin_right = 236.0
-margin_bottom = 236.0
-rect_min_size = Vector2( 232, 232 )
-color = Color( 0.254902, 0.231373, 0.231373, 1 )
-
-[node name="InventoryPreview" type="TextureRect" parent="VBoxContainer/Content/GridContainer/Preview"]
-visible = false
-margin_left = 4.0
-margin_top = 4.0
-margin_right = 236.0
-margin_bottom = 236.0
-texture = ExtResource( 2 )
-
-[node name="ObjectPreview" type="TextureRect" parent="VBoxContainer/Content/GridContainer/Preview"]
-margin_left = 4.0
-margin_top = 4.0
-margin_right = 236.0
-margin_bottom = 236.0
-texture = ExtResource( 3 )
-
-[node name="Preview" type="TextureRect" parent="VBoxContainer/Content/GridContainer/Preview"]
-margin_left = 4.0
-margin_top = 4.0
-margin_right = 236.0
-margin_bottom = 236.0
-rect_min_size = Vector2( 232, 232 )
-
-[node name="BlankItem5" type="Control" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 358.0
-margin_top = 147.0
-margin_right = 460.0
-margin_bottom = 387.0
-
-[node name="ImageSizeLabel" type="Label" parent="VBoxContainer/Content/GridContainer"]
-margin_top = 391.0
-margin_right = 110.0
-margin_bottom = 405.0
-text = "Image size:"
-
-[node name="ImageSize" type="Label" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 114.0
-margin_top = 391.0
-margin_right = 354.0
-margin_bottom = 405.0
-text = "(0, 0)"
-
-[node name="BlankItem6" type="Control" parent="VBoxContainer/Content/GridContainer"]
-margin_left = 358.0
-margin_top = 391.0
-margin_right = 460.0
-margin_bottom = 405.0
-
-[node name="InventoryPathLabel" type="Label" parent="VBoxContainer/Content/GridContainer"]
-visible = false
-margin_top = 412.0
-margin_right = 110.0
-margin_bottom = 426.0
-text = "Inventory path:"
-
-[node name="InventoryPath" type="Label" parent="VBoxContainer/Content/GridContainer"]
-visible = false
-margin_left = 114.0
-margin_top = 412.0
-margin_right = 354.0
-margin_bottom = 426.0
-text = "res://"
-
-[node name="ChangePathButton" type="Button" parent="VBoxContainer/Content/GridContainer"]
-visible = false
-margin_top = 409.0
-margin_right = 110.0
-margin_bottom = 429.0
-text = "Change Path"
-
-[node name="BlankItem7" type="Control" parent="VBoxContainer/Content/GridContainer"]
-visible = false
-margin_top = 409.0
-margin_right = 110.0
-margin_bottom = 409.0
-
-[node name="Buttons" type="MarginContainer" parent="VBoxContainer"]
-margin_top = 757.0
-margin_right = 500.0
-margin_bottom = 787.0
-mouse_filter = 2
-custom_constants/margin_bottom = 10
-
-[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer/Buttons"]
-margin_right = 500.0
-margin_bottom = 20.0
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/Buttons/CenterContainer"]
-margin_left = 98.0
-margin_right = 402.0
-margin_bottom = 20.0
-
-[node name="CreateButton" type="Button" parent="VBoxContainer/Buttons/CenterContainer/HBoxContainer"]
-margin_right = 100.0
-margin_bottom = 20.0
-text = "Create Object"
-
-[node name="Spacer" type="Control" parent="VBoxContainer/Buttons/CenterContainer/HBoxContainer"]
-margin_left = 104.0
-margin_right = 124.0
-margin_bottom = 20.0
-rect_min_size = Vector2( 20, 0 )
-
-[node name="ClearButton" type="Button" parent="VBoxContainer/Buttons/CenterContainer/HBoxContainer"]
-margin_left = 128.0
-margin_right = 193.0
-margin_bottom = 20.0
-text = "Clear All"
-
-[node name="Spacer2" type="Control" parent="VBoxContainer/Buttons/CenterContainer/HBoxContainer"]
-margin_left = 197.0
-margin_right = 217.0
-margin_bottom = 20.0
-rect_min_size = Vector2( 20, 0 )
-
-[node name="ExitButton" type="Button" parent="VBoxContainer/Buttons/CenterContainer/HBoxContainer"]
-margin_left = 221.0
-margin_right = 304.0
-margin_bottom = 20.0
-text = "Main Menu"
-
-[node name="LoadObjectGraphic" type="CenterContainer" parent="."]
-visible = false
-margin_right = 500.0
-margin_bottom = 800.0
-mouse_filter = 2
-
-[node name="LoadObjectFileDialog" type="FileDialog" parent="LoadObjectGraphic"]
-margin_left = -150.0
-margin_top = 100.0
-margin_right = 650.0
-margin_bottom = 700.0
-rect_min_size = Vector2( 800, 600 )
-popup_exclusive = true
-window_title = "Open a File"
-mode = 0
-filters = PoolStringArray( "*.png", "*.bmp", "*.jpg", "*.jpeg", "*.webp", "*.tga" )
-
-[node name="Windows" type="CenterContainer" parent="."]
-visible = false
-margin_right = 500.0
-margin_bottom = 800.0
-
-[node name="ConfirmationDialog" type="ConfirmationDialog" parent="Windows"]
-margin_left = 90.0
-margin_top = 354.0
-margin_right = 409.0
-margin_bottom = 446.0
-dialog_text = "WARNING!
-
-If you continue you will lose the current object."
-
-[node name="ErrorDialog" type="AcceptDialog" parent="Windows"]
-margin_left = 208.0
-margin_top = 371.0
-margin_right = 291.0
-margin_bottom = 429.0
-
-[node name="CreateCompleteDialog" type="AcceptDialog" parent="Windows"]
-margin_left = 208.0
-margin_top = 371.0
-margin_right = 291.0
-margin_bottom = 429.0
-
-[node name="FileDialog" type="FileDialog" parent="Windows"]
-visible = true
-margin_left = 50.0
-margin_top = 150.0
-margin_right = 450.0
-margin_bottom = 650.0
-rect_min_size = Vector2( 400, 500 )
-window_title = "Open a Directory"
-mode = 2
-
-[connection signal="toggled" from="VBoxContainer/Control/CenterContainer/HBoxContainer/BackgroundObjectCheckBox" to="." method="_on_BackgroundObjectCheckBox_toggled"]
-[connection signal="toggled" from="VBoxContainer/Control/CenterContainer/HBoxContainer/InventoryItemCheckBox" to="." method="_on_InventoryItemCheckBox_toggled"]
-[connection signal="text_changed" from="VBoxContainer/Content/GridContainer/ItemName" to="." method="background_on_ItemName_text_changed"]
-[connection signal="text_changed" from="VBoxContainer/Content/GridContainer/ItemGlobalID" to="." method="_on_ItemGlobalID_text_changed"]
-[connection signal="pressed" from="VBoxContainer/Content/GridContainer/StartsInteractiveCheckBox" to="." method="_on_StartsInteractiveCheckBox_pressed"]
-[connection signal="item_selected" from="VBoxContainer/Content/GridContainer/DefaultActionOption" to="." method="_on_DefaultActionOption_item_selected"]
-[connection signal="pressed" from="VBoxContainer/Content/GridContainer/ChangeImageButton" to="." method="load_button_pressed"]
-[connection signal="pressed" from="VBoxContainer/Content/GridContainer/ChangePathButton" to="." method="_on_ChangePathButton_pressed"]
-[connection signal="pressed" from="VBoxContainer/Buttons/CenterContainer/HBoxContainer/CreateButton" to="." method="_on_CreateButton_pressed"]
-[connection signal="pressed" from="VBoxContainer/Buttons/CenterContainer/HBoxContainer/ClearButton" to="." method="Item_on_ClearButton_pressed"]
-[connection signal="pressed" from="VBoxContainer/Buttons/CenterContainer/HBoxContainer/ExitButton" to="." method="Item_on_ExitButton_pressed"]
-[connection signal="file_selected" from="LoadObjectGraphic/LoadObjectFileDialog" to="." method="LoadObjectFileDialog_file_selected"]
-[connection signal="confirmed" from="Windows/ConfirmationDialog" to="." method="_on_ObjectConfirmationDialog_confirmed"]
-[connection signal="confirmed" from="Windows/CreateCompleteDialog" to="." method="_on_CreateCompleteDialog_confirmed"]
-[connection signal="dir_selected" from="Windows/FileDialog" to="." method="_on_FileDialog_dir_selected"]
diff --git a/addons/escoria-wizard/RoomCreator.gd b/addons/escoria-wizard/RoomCreator.gd
deleted file mode 100644
index a13bc41f..00000000
--- a/addons/escoria-wizard/RoomCreator.gd
+++ /dev/null
@@ -1,326 +0,0 @@
-tool
-extends Control
-
-const ROOM_NAME = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/RoomName"
-const GLOBAL_ID = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/GlobalID"
-const PLAYER_SCENE = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/PlayerScene"
-const SELECT_PLAYER_SCENE = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/SelectPlayerScene"
-const SELECT_PLAYER_SCENE_SPACER = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/SelectPlayerSceneSpacer"
-const USE_EMPTY_PLAYER_BUTTON = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/UseEmptyPlayerButton"
-const ESC_SCRIPT = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/ESCScript"
-const USE_EMPTY_ROOM_SCRIPT = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/UseEmptyRoomScript"
-const USE_EMPTY_ROOM_SPACER = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/UseEmptyRoomSpacer"
-const BACKGROUND_IMAGE = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/BackgroundImage"
-const USE_EMPTY_BACKGROUND = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/UseEmptyBackground"
-const SELECT_BACKGROUND = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/SelectBackground"
-const SELECT_BACKGROUNDSPACER = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/SelectBackgroundSpacer"
-const ROOM_FOLDER_PATH = "MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/RoomFolder"
-const ROOM_BACKGROUND = "MarginContainer/MarginContainer/VBoxContainer/PreviewSection/CenterContainer/RoomBackground"
-const BACKGROUND_PREVIEW = "MarginContainer/MarginContainer/VBoxContainer/PreviewSection/Control/BackgroundPreview"
-
-const SCRIPT_BLANK_TEXT = "Room will not have a script configured."
-const SCRIPT_SELECT_TEXT = "Please select script."
-const PLAYER_BLANK_TEXT = "Scene will be left blank."
-const PLAYER_SELECT_TEXT = "Please select scene."
-const BACKGROUND_BLANK_TEXT = "Image will be left blank."
-const BACKGROUND_SELECT_TEXT = "Please select image."
-
-const ROOM_PATH_SETTING = "escoria/wizard/path_to_rooms"
-
-var settings_modified: bool
-
-
-func _ready() -> void:
- $"InformationWindows/PlayerSceneFileDialog".get_cancel().connect("pressed", self, "PlayerSceneCancelled")
- $"InformationWindows/BackgroundImageFileDialog".get_cancel().connect("pressed", self, "BackgroundFileCancelled")
-
-
-func PlayerSceneCancelled() -> void:
- if get_node(PLAYER_SCENE).text == PLAYER_SELECT_TEXT:
- get_node(USE_EMPTY_PLAYER_BUTTON).pressed = true
-
-
-func BackgroundFileCancelled() -> void:
- if get_node(BACKGROUND_IMAGE).text == BACKGROUND_SELECT_TEXT:
- get_node(USE_EMPTY_BACKGROUND).pressed = true
-
-
-func room_creator_reset() -> void:
- get_node(ROOM_NAME).text = ""
- get_node(GLOBAL_ID).text = ""
- get_node(PLAYER_SCENE).text = PLAYER_BLANK_TEXT
- get_node(SELECT_PLAYER_SCENE).visible = false
- get_node(SELECT_PLAYER_SCENE_SPACER).visible = true
- get_node(USE_EMPTY_PLAYER_BUTTON).pressed = true
- get_node(ESC_SCRIPT).editable = false
- get_node(ESC_SCRIPT).text = SCRIPT_BLANK_TEXT
- get_node(USE_EMPTY_ROOM_SCRIPT).pressed = true
- get_node(BACKGROUND_IMAGE).text = BACKGROUND_BLANK_TEXT
- get_node(USE_EMPTY_ROOM_SPACER).visible = true
- get_node(USE_EMPTY_BACKGROUND).pressed = true
- get_node(SELECT_BACKGROUND).visible = false
- get_node(SELECT_BACKGROUNDSPACER).visible = true
- get_node(BACKGROUND_PREVIEW).visible = true
- get_node(ROOM_BACKGROUND).visible = true
- get_node(BACKGROUND_PREVIEW).texture = null
- get_node(ROOM_FOLDER_PATH).text = ProjectSettings.get_setting(ROOM_PATH_SETTING)
- $InformationWindows/RoomFolderDialog.current_dir = ProjectSettings.get_setting(ROOM_PATH_SETTING)
- settings_modified = false
-
-
-func _on_RoomName_text_changed(new_text: String) -> void:
- get_node(GLOBAL_ID).text = new_text
- settings_modified = true
-
-
-func _on_GlobalID_text_changed(new_text: String) -> void:
- settings_modified = true
-
-
-func _on_UseEmptyPlayerButton_toggled(button_pressed: bool) -> void:
- if button_pressed == true:
- get_node(SELECT_PLAYER_SCENE).visible = false
- get_node(SELECT_PLAYER_SCENE_SPACER).visible = true
- get_node(PLAYER_SCENE).text = PLAYER_BLANK_TEXT
- else:
- get_node(SELECT_PLAYER_SCENE).visible = true
- get_node(SELECT_PLAYER_SCENE_SPACER).visible = false
- get_node(PLAYER_SCENE).text = PLAYER_SELECT_TEXT
- $"InformationWindows/PlayerSceneFileDialog".popup_centered()
-
-
-func _on_SelectPlayerScene_pressed() -> void:
- $"InformationWindows/PlayerSceneFileDialog".visible = true
- $"InformationWindows/PlayerSceneFileDialog".invalidate()
-
-
-func _on_PlayerSceneFileDialog_file_selected(path: String) -> void:
- settings_modified = true
- get_node(PLAYER_SCENE).text = path
-
-
-func _on_UseEmptyRoomScript_toggled(button_pressed: bool) -> void:
- if button_pressed == true:
- get_node(ESC_SCRIPT).editable = false
- get_node(ESC_SCRIPT).text = SCRIPT_BLANK_TEXT
- else:
- get_node(ESC_SCRIPT).editable = true
- get_node(ESC_SCRIPT).text = "%s.esc" % get_node(GLOBAL_ID).text
-
-
-func _on_SelectRoomScript_pressed() -> void:
- $"InformationWindows/ESCScriptFileDialog".visible = true
- $"InformationWindows/ESCScriptFileDialog".invalidate()
-
-
-func _on_ESCScriptFileDialog_file_selected(path: String) -> void:
- settings_modified = true
- get_node(ESC_SCRIPT).text = path
-
-
-func _on_UseEmptyBackground_toggled(button_pressed: bool) -> void:
- if button_pressed == true:
- get_node(SELECT_BACKGROUND).visible = false
- get_node(SELECT_BACKGROUNDSPACER).visible = true
- get_node(BACKGROUND_IMAGE).text = BACKGROUND_BLANK_TEXT
- get_node(BACKGROUND_PREVIEW).texture = null
- get_node(ROOM_BACKGROUND).visible = true
- else:
- get_node(SELECT_BACKGROUND).visible = true
- get_node(SELECT_BACKGROUNDSPACER).visible = false
- get_node(BACKGROUND_IMAGE).text = BACKGROUND_SELECT_TEXT
-
- var viewport_centre: Vector2 = get_viewport_rect().size / 2
- var dialog_start: Vector2 = $"InformationWindows/BackgroundImageFileDialog".rect_size / 2
- var dialog_pos: Vector2 = viewport_centre - dialog_start
- $"InformationWindows/BackgroundImageFileDialog".rect_position = dialog_pos
-
- $"InformationWindows/BackgroundImageFileDialog".popup_centered()
-
-
-func _on_SelectBackground_pressed() -> void:
- var viewport_centre: Vector2 = get_viewport_rect().size / 2
- var dialog_start: Vector2 = $"InformationWindows/BackgroundImageFileDialog".rect_size / 2
- var dialog_pos: Vector2 = viewport_centre - dialog_start
- $"InformationWindows/BackgroundImageFileDialog".rect_position = dialog_pos
-
- $"InformationWindows/BackgroundImageFileDialog".visible = true
- $"InformationWindows/BackgroundImageFileDialog".invalidate()
-
-
-func _on_BackgroundImageFileDialog_file_selected(path: String) -> void:
- settings_modified = true
-
- get_node(BACKGROUND_IMAGE).text = path
-
- var image_stream_texture:StreamTexture
-
- image_stream_texture = load(path)
-
- get_node(BACKGROUND_PREVIEW).texture = image_stream_texture
- get_node(ROOM_BACKGROUND).visible = false
- set_preview_scale()
-
-
-func set_preview_scale() -> void:
- var preview_scale = Vector2.ONE
- # Calculate the scale to make the preview as big as possible in the preview window depending on
- # the height to width ratio of the frame
- var preview_size = get_node(ROOM_BACKGROUND).get_size()
-# get_node(BACKGROUND_PREVIEW).rect_scale = Vector2.ONE
- var image_size = get_node(BACKGROUND_PREVIEW).texture.get_size()
-
- preview_scale.x = preview_size.x / image_size.x
- preview_scale.y = preview_size.y / image_size.y
-
-# print("scale = "+str(preview_scale)+", preview size = "+str(preview_size)+", image_size = "+str(image_size))
- if preview_scale.y > preview_scale.x:
- get_node(BACKGROUND_PREVIEW).rect_scale = Vector2(preview_scale.x, preview_scale.x)
- else:
- # Image width will hit the preview boundary before the height will
- get_node(BACKGROUND_PREVIEW).rect_scale = Vector2(preview_scale.y, preview_scale.y)
-
-
-func _on_ClearButton_pressed() -> void:
- if settings_modified:
- $InformationWindows/ClearConfirmationDialog.popup_centered()
-
-
-func _on_MainMenuButton_pressed() -> void:
- if settings_modified:
- $InformationWindows/MainMenuConfirmationDialog.popup_centered()
- else:
- get_node("../Menu").visible = true
- get_node("../RoomCreator").visible = false
-
-
-func _on_ClearConfirmationDialog_confirmed() -> void:
- room_creator_reset()
-
-
-func _on_MainMenuConfirmationDialog_confirmed() -> void:
- get_node("../Menu").visible = true
- get_node("../RoomCreator").visible = false
-
-
-func _on_ChangeRoomFolderButton_pressed() -> void:
- $"InformationWindows/RoomFolderDialog".popup_centered()
-
-
-func _on_RoomFolderDialog_dir_selected(dir: String) -> void:
- ProjectSettings.set_setting(ROOM_PATH_SETTING, dir)
- var property_info = {
- "name": ROOM_PATH_SETTING,
- "type": TYPE_STRING
- }
- ProjectSettings.add_property_info(property_info)
- get_node(ROOM_FOLDER_PATH).text = dir
-
-
-func _on_CreateButton_pressed() -> void:
- var RoomName = get_node(ROOM_NAME).text
-
- if RoomName.length() < 1:
- $"InformationWindows/GenericErrorDialog".dialog_text = "Error!\n\nRoom name must be specified."
- $"InformationWindows/GenericErrorDialog".popup_centered()
- return
-
- var ScriptName = get_node(ESC_SCRIPT).text
-
- if get_node(USE_EMPTY_ROOM_SCRIPT).pressed == false:
- if ScriptName.length() < 5 or ! ScriptName.substr(ScriptName.length() - 4) == ".esc":
- $"InformationWindows/GenericErrorDialog".dialog_text = "Error!\n\n" \
- + "Room ESC script must be a filename ending in '.esc'"
- $"InformationWindows/GenericErrorDialog".popup_centered()
- return
-
- if "/" in get_node(ESC_SCRIPT).text:
- $"InformationWindows/GenericErrorDialog".dialog_text = "Error!\n\n" \
- + "Please remove any '/' characters from the name of the Room ESC script."
- $"InformationWindows/GenericErrorDialog".popup_centered()
- return
-
- var BaseDir = ProjectSettings.get_setting(ROOM_PATH_SETTING)
- var ImageSize = Vector2(1,1)
- var NewRoom = ESCRoom.new()
-
- NewRoom.name = RoomName
- NewRoom.global_id = get_node(GLOBAL_ID).text
-
- if ! get_node(ESC_SCRIPT).text == SCRIPT_SELECT_TEXT and ! get_node(ESC_SCRIPT).text == SCRIPT_BLANK_TEXT:
- NewRoom.esc_script = "%s/%s/scripts/%s" % [BaseDir, RoomName, get_node(ESC_SCRIPT).text]
-
- if ! get_node(PLAYER_SCENE).text == PLAYER_SELECT_TEXT and ! get_node(PLAYER_SCENE).text == PLAYER_BLANK_TEXT:
- var player_scene = load(get_node(PLAYER_SCENE).text)
- NewRoom.player_scene = player_scene
-
- var Background = ESCBackground.new()
- Background.name = "Background"
-
- var BackgroundSize = Vector2.ONE
-
- if ! get_node(BACKGROUND_IMAGE).text == BACKGROUND_SELECT_TEXT and ! get_node(BACKGROUND_IMAGE).text == BACKGROUND_BLANK_TEXT:
- Background.texture = get_node(BACKGROUND_PREVIEW).texture
- BackgroundSize = Background.texture.get_size()
- else:
- # Set TextureRect to have the same size as the Viewport so that the room
- # works even if no texture is set in the TextureRect
- BackgroundSize = Vector2(ProjectSettings.get_setting("display/window/size/width"), \
- ProjectSettings.get_setting("display/window/size/height"))
- Background.rect_size = BackgroundSize
-
- NewRoom.add_child(Background)
-
- var NewTerrain = ESCTerrain.new()
- NewTerrain.name = "WalkableArea"
- var NewNavigationPolygonInstance = NavigationPolygonInstance.new()
-
- var NewNavigationPolygon = NavigationPolygon.new()
- NewNavigationPolygonInstance.navpoly = NewNavigationPolygon
-
- NewRoom.add_child(NewTerrain)
-
- NewTerrain.add_child(NewNavigationPolygonInstance)
-
- var Objects = Node2D.new()
- Objects.name = "RoomObjects"
- NewRoom.add_child(Objects)
-
- var StartPos = ESCLocation.new()
- StartPos.name = "StartPos"
- StartPos.is_start_location = true
- StartPos.global_id = "%s_start_pos" % RoomName
- StartPos.position = Vector2(int(BackgroundSize.x / 2), int(BackgroundSize.y / 2))
- NewRoom.add_child(StartPos)
-
- get_tree().edited_scene_root.add_child(NewRoom)
- NewRoom.set_owner(get_tree().edited_scene_root)
- NewNavigationPolygonInstance.set_owner(NewRoom)
- NewTerrain.set_owner(NewRoom)
- Background.set_owner(NewRoom)
- Objects.set_owner(NewRoom)
- StartPos.set_owner(NewRoom)
-
- var dir = Directory.new()
- dir.make_dir_recursive("%s/%s/scripts" % [BaseDir, RoomName])
- dir.make_dir_recursive("%s/%s/objects" % [BaseDir, RoomName])
- dir.copy("res://addons/escoria-wizard/room_script_template.esc", "%s/%s/scripts/%s" % \
- [BaseDir, RoomName, get_node(ESC_SCRIPT).text])
-
- # Export scene
- var packed_scene = PackedScene.new()
- packed_scene.pack(get_tree().edited_scene_root.get_node(NewRoom.name))
-
- # Flag suggestions from https://godotengine.org/qa/50437/how-to-turn-a-node-into-a-packedscene-via-gdscript
- ResourceSaver.save("%s/%s/%s.tscn" % [BaseDir, RoomName, RoomName], \
- packed_scene, ResourceSaver.FLAG_CHANGE_PATH|ResourceSaver.FLAG_REPLACE_SUBRESOURCE_PATHS)
-
- NewRoom.queue_free()
- get_tree().edited_scene_root.get_node(NewRoom.name).queue_free()
- # Scan the filesystem so that the new folders show up in the file browser.
- # Without this you might not see the objects/scripts folders in the filetree.
- var ep = EditorPlugin.new()
- ep.get_editor_interface().get_resource_filesystem().scan()
- ep.free()
-
- $InformationWindows/CreateCompleteDialog.popup_centered()
diff --git a/addons/escoria-wizard/RoomCreator.tscn b/addons/escoria-wizard/RoomCreator.tscn
deleted file mode 100644
index 8033aaf1..00000000
--- a/addons/escoria-wizard/RoomCreator.tscn
+++ /dev/null
@@ -1,433 +0,0 @@
-[gd_scene load_steps=3 format=2]
-
-[ext_resource path="res://addons/escoria-wizard/RoomCreator.gd" type="Script" id=1]
-[ext_resource path="res://addons/escoria-wizard/graphics/background_preview.png" type="Texture" id=2]
-
-[node name="CenterContainer" type="CenterContainer"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-rect_clip_content = true
-script = ExtResource( 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="."]
-margin_left = 135.0
-margin_top = 73.0
-margin_right = 1145.0
-margin_bottom = 827.0
-
-[node name="ColorRect" type="ColorRect" parent="MarginContainer"]
-margin_right = 1010.0
-margin_bottom = 754.0
-color = Color( 0.235294, 0.341176, 0.290196, 1 )
-
-[node name="MarginContainer" type="MarginContainer" parent="MarginContainer"]
-margin_right = 1010.0
-margin_bottom = 754.0
-custom_constants/margin_right = 5
-custom_constants/margin_top = 5
-custom_constants/margin_left = 5
-custom_constants/margin_bottom = 5
-
-[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer/MarginContainer"]
-margin_left = 5.0
-margin_top = 5.0
-margin_right = 1005.0
-margin_bottom = 749.0
-
-[node name="CenterContainer" type="CenterContainer" parent="MarginContainer/MarginContainer/VBoxContainer"]
-margin_right = 1000.0
-margin_bottom = 40.0
-rect_min_size = Vector2( 0, 40 )
-
-[node name="Label" type="Label" parent="MarginContainer/MarginContainer/VBoxContainer/CenterContainer"]
-margin_left = 448.0
-margin_top = 13.0
-margin_right = 552.0
-margin_bottom = 27.0
-custom_colors/font_color = Color( 0.921569, 1, 0, 1 )
-custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
-text = "Room Creator"
-uppercase = true
-
-[node name="MarginContainer" type="MarginContainer" parent="MarginContainer/MarginContainer/VBoxContainer"]
-margin_top = 44.0
-margin_right = 1000.0
-margin_bottom = 256.0
-rect_min_size = Vector2( 460, 200 )
-
-[node name="GridContainer" type="GridContainer" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer"]
-margin_right = 1000.0
-margin_bottom = 212.0
-rect_min_size = Vector2( 300, 200 )
-custom_constants/hseparation = 10
-columns = 4
-
-[node name="RoomNameLabel" type="Label" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_top = 5.0
-margin_right = 127.0
-margin_bottom = 19.0
-text = "Room name:"
-
-[node name="RoomName" type="LineEdit" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 137.0
-margin_right = 537.0
-margin_bottom = 24.0
-rect_min_size = Vector2( 400, 0 )
-caret_blink = true
-caret_blink_speed = 0.5
-
-[node name="Spacer3" type="Control" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 547.0
-margin_right = 782.0
-margin_bottom = 24.0
-rect_min_size = Vector2( 40, 0 )
-
-[node name="Spacer6" type="Control" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 792.0
-margin_right = 992.0
-margin_bottom = 24.0
-rect_min_size = Vector2( 200, 0 )
-
-[node name="GlobalIDLabel" type="Label" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_top = 33.0
-margin_right = 127.0
-margin_bottom = 47.0
-text = "Global ID:"
-
-[node name="GlobalID" type="LineEdit" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 137.0
-margin_top = 28.0
-margin_right = 537.0
-margin_bottom = 52.0
-caret_blink = true
-caret_blink_speed = 0.5
-
-[node name="Spacer4" type="Control" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 547.0
-margin_top = 28.0
-margin_right = 782.0
-margin_bottom = 52.0
-rect_min_size = Vector2( 40, 0 )
-
-[node name="Spacer7" type="Control" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 792.0
-margin_top = 28.0
-margin_right = 992.0
-margin_bottom = 52.0
-rect_min_size = Vector2( 40, 0 )
-
-[node name="PlayerSceneLabel" type="Label" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_top = 69.0
-margin_right = 127.0
-margin_bottom = 83.0
-text = "Player scene:"
-
-[node name="PlayerScene" type="LineEdit" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 137.0
-margin_top = 56.0
-margin_right = 537.0
-margin_bottom = 96.0
-text = "Scene will be left blank."
-editable = false
-caret_blink = true
-caret_blink_speed = 0.5
-
-[node name="UseEmptyPlayerButton" type="CheckButton" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 547.0
-margin_top = 56.0
-margin_right = 782.0
-margin_bottom = 96.0
-pressed = true
-text = "Use empty player scene"
-
-[node name="SelectPlayerScene" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-visible = false
-margin_left = 578.0
-margin_top = 56.0
-margin_right = 808.0
-margin_bottom = 96.0
-text = "Select Player Scene"
-
-[node name="SelectPlayerSceneSpacer" type="Control" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 792.0
-margin_top = 56.0
-margin_right = 992.0
-margin_bottom = 96.0
-rect_min_size = Vector2( 40, 0 )
-
-[node name="ESCScriptLabel" type="Label" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_top = 113.0
-margin_right = 127.0
-margin_bottom = 127.0
-text = "Room ESC script:"
-
-[node name="ESCScript" type="LineEdit" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 137.0
-margin_top = 100.0
-margin_right = 537.0
-margin_bottom = 140.0
-hint_tooltip = "In the room's scripts folder
-an empty file will be created
-with this name."
-text = "Room will not have a script configured."
-editable = false
-caret_blink = true
-caret_blink_speed = 0.5
-
-[node name="UseEmptyRoomScript" type="CheckButton" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 547.0
-margin_top = 100.0
-margin_right = 782.0
-margin_bottom = 140.0
-pressed = true
-text = "No script"
-
-[node name="UseEmptyRoomSpacer" type="Control" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 792.0
-margin_top = 100.0
-margin_right = 992.0
-margin_bottom = 140.0
-rect_min_size = Vector2( 40, 0 )
-
-[node name="BackgroundImageLabel" type="Label" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_top = 157.0
-margin_right = 127.0
-margin_bottom = 171.0
-text = "Background image:"
-
-[node name="BackgroundImage" type="LineEdit" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 137.0
-margin_top = 144.0
-margin_right = 537.0
-margin_bottom = 184.0
-text = "Image will be left blank."
-editable = false
-caret_blink = true
-caret_blink_speed = 0.5
-
-[node name="UseEmptyBackground" type="CheckButton" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 547.0
-margin_top = 144.0
-margin_right = 782.0
-margin_bottom = 184.0
-pressed = true
-text = "Use empty background"
-
-[node name="SelectBackground" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-visible = false
-margin_left = 564.0
-margin_top = 144.0
-margin_right = 693.0
-margin_bottom = 184.0
-text = "Select Background"
-
-[node name="SelectBackgroundSpacer" type="Control" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 792.0
-margin_top = 144.0
-margin_right = 992.0
-margin_bottom = 184.0
-rect_min_size = Vector2( 40, 0 )
-
-[node name="RoomFolderLabel" type="Label" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_top = 193.0
-margin_right = 127.0
-margin_bottom = 207.0
-text = "Room folder parent:"
-
-[node name="RoomFolder" type="LineEdit" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 137.0
-margin_top = 188.0
-margin_right = 537.0
-margin_bottom = 212.0
-hint_tooltip = "A folder () for your room will be created inside this parent folder."
-text = "res://game/rooms"
-editable = false
-caret_blink = true
-caret_blink_speed = 0.5
-
-[node name="ChangeRoomFolderButton" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 547.0
-margin_top = 188.0
-margin_right = 782.0
-margin_bottom = 212.0
-text = "Change Room Folder"
-
-[node name="Spacer8" type="Control" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer"]
-margin_left = 792.0
-margin_top = 188.0
-margin_right = 992.0
-margin_bottom = 212.0
-rect_min_size = Vector2( 40, 0 )
-
-[node name="PreviewSection" type="MarginContainer" parent="MarginContainer/MarginContainer/VBoxContainer"]
-margin_top = 260.0
-margin_right = 1000.0
-margin_bottom = 660.0
-rect_min_size = Vector2( 1000, 400 )
-
-[node name="PreviewFrame" type="ColorRect" parent="MarginContainer/MarginContainer/VBoxContainer/PreviewSection"]
-margin_right = 1000.0
-margin_bottom = 400.0
-rect_min_size = Vector2( 1000, 400 )
-color = Color( 0, 0, 0, 1 )
-
-[node name="CenterContainer" type="MarginContainer" parent="MarginContainer/MarginContainer/VBoxContainer/PreviewSection"]
-margin_right = 1000.0
-margin_bottom = 400.0
-
-[node name="RoomBackground" type="TextureRect" parent="MarginContainer/MarginContainer/VBoxContainer/PreviewSection/CenterContainer"]
-margin_right = 1000.0
-margin_bottom = 400.0
-rect_min_size = Vector2( 990, 390 )
-texture = ExtResource( 2 )
-expand = true
-stretch_mode = 7
-
-[node name="Control" type="Control" parent="MarginContainer/MarginContainer/VBoxContainer/PreviewSection"]
-margin_right = 1000.0
-margin_bottom = 400.0
-
-[node name="BackgroundPreview" type="TextureRect" parent="MarginContainer/MarginContainer/VBoxContainer/PreviewSection/Control"]
-margin_right = 1000.0
-margin_bottom = 400.0
-
-[node name="MarginContainer2" type="MarginContainer" parent="MarginContainer/MarginContainer/VBoxContainer"]
-margin_top = 664.0
-margin_right = 1000.0
-margin_bottom = 744.0
-rect_min_size = Vector2( 0, 80 )
-
-[node name="CenterContainer" type="CenterContainer" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer2"]
-margin_right = 1000.0
-margin_bottom = 80.0
-rect_min_size = Vector2( 800, 80 )
-
-[node name="GridContainer" type="GridContainer" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer2/CenterContainer"]
-margin_left = 349.0
-margin_top = 20.0
-margin_right = 650.0
-margin_bottom = 60.0
-rect_min_size = Vector2( 300, 40 )
-custom_constants/hseparation = 40
-columns = 3
-
-[node name="CreateButton" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer2/CenterContainer/GridContainer"]
-margin_right = 94.0
-margin_bottom = 20.0
-text = "Create Room"
-
-[node name="ClearButton" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer2/CenterContainer/GridContainer"]
-margin_left = 134.0
-margin_right = 178.0
-margin_bottom = 20.0
-text = "Clear"
-
-[node name="MainMenuButton" type="Button" parent="MarginContainer/MarginContainer/VBoxContainer/MarginContainer2/CenterContainer/GridContainer"]
-margin_left = 218.0
-margin_right = 301.0
-margin_bottom = 20.0
-text = "Main Menu"
-
-[node name="InformationWindows" type="Control" parent="."]
-margin_left = 640.0
-margin_top = 450.0
-margin_right = 640.0
-margin_bottom = 450.0
-
-[node name="PlayerSceneFileDialog" type="FileDialog" parent="InformationWindows"]
-margin_left = 1400.0
-margin_top = 1400.0
-margin_right = 2000.0
-margin_bottom = 2000.0
-rect_min_size = Vector2( 600, 600 )
-popup_exclusive = true
-window_title = "Open a File"
-mode = 0
-filters = PoolStringArray( "*.tscn, *.scn ; Scene Files" )
-__meta__ = {
-"_editor_description_": ""
-}
-
-[node name="ESCScriptFileDialog" type="FileDialog" parent="InformationWindows"]
-margin_left = 172.0
-margin_top = -206.0
-margin_right = 772.0
-margin_bottom = 394.0
-rect_min_size = Vector2( 600, 600 )
-popup_exclusive = true
-window_title = "Open a File"
-mode = 0
-filters = PoolStringArray( "*.esc; Escoria script files" )
-__meta__ = {
-"_editor_description_": ""
-}
-
-[node name="BackgroundImageFileDialog" type="FileDialog" parent="InformationWindows"]
-margin_left = 1400.0
-margin_top = 1400.0
-margin_right = 2000.0
-margin_bottom = 2000.0
-rect_min_size = Vector2( 600, 600 )
-popup_exclusive = true
-window_title = "Open a File"
-mode = 0
-filters = PoolStringArray( "*.png, *.jpg, *.jpeg ; Supported Images" )
-
-[node name="ClearConfirmationDialog" type="ConfirmationDialog" parent="InformationWindows"]
-margin_right = 353.0
-margin_bottom = 92.0
-popup_exclusive = true
-dialog_text = "WARNING!
-
-If you continue you will lose the current room setup."
-
-[node name="MainMenuConfirmationDialog" type="ConfirmationDialog" parent="InformationWindows"]
-margin_right = 353.0
-margin_bottom = 92.0
-popup_exclusive = true
-dialog_text = "WARNING!
-
-If you continue you will lose the current room setup."
-
-[node name="GenericErrorDialog" type="AcceptDialog" parent="InformationWindows"]
-margin_right = 83.0
-margin_bottom = 58.0
-popup_exclusive = true
-dialog_text = "ERROR!
-
-Please supply a name for the room."
-
-[node name="CreateCompleteDialog" type="AcceptDialog" parent="InformationWindows"]
-margin_right = 83.0
-margin_bottom = 58.0
-popup_exclusive = true
-window_title = "Export Complete"
-dialog_text = "The room has been created."
-
-[node name="RoomFolderDialog" type="FileDialog" parent="InformationWindows"]
-margin_left = -279.0
-margin_top = -343.0
-margin_right = 321.0
-margin_bottom = 257.0
-rect_min_size = Vector2( 600, 600 )
-popup_exclusive = true
-window_title = "Open a Directory"
-mode = 2
-
-[connection signal="text_changed" from="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/RoomName" to="." method="_on_RoomName_text_changed"]
-[connection signal="text_changed" from="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/GlobalID" to="." method="_on_GlobalID_text_changed"]
-[connection signal="toggled" from="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/UseEmptyPlayerButton" to="." method="_on_UseEmptyPlayerButton_toggled"]
-[connection signal="pressed" from="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/SelectPlayerScene" to="." method="_on_SelectPlayerScene_pressed"]
-[connection signal="toggled" from="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/UseEmptyRoomScript" to="." method="_on_UseEmptyRoomScript_toggled"]
-[connection signal="toggled" from="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/UseEmptyBackground" to="." method="_on_UseEmptyBackground_toggled"]
-[connection signal="pressed" from="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/SelectBackground" to="." method="_on_SelectBackground_pressed"]
-[connection signal="pressed" from="MarginContainer/MarginContainer/VBoxContainer/MarginContainer/GridContainer/ChangeRoomFolderButton" to="." method="_on_ChangeRoomFolderButton_pressed"]
-[connection signal="pressed" from="MarginContainer/MarginContainer/VBoxContainer/MarginContainer2/CenterContainer/GridContainer/CreateButton" to="." method="_on_CreateButton_pressed"]
-[connection signal="pressed" from="MarginContainer/MarginContainer/VBoxContainer/MarginContainer2/CenterContainer/GridContainer/ClearButton" to="." method="_on_ClearButton_pressed"]
-[connection signal="pressed" from="MarginContainer/MarginContainer/VBoxContainer/MarginContainer2/CenterContainer/GridContainer/MainMenuButton" to="." method="_on_MainMenuButton_pressed"]
-[connection signal="file_selected" from="InformationWindows/PlayerSceneFileDialog" to="." method="_on_PlayerSceneFileDialog_file_selected"]
-[connection signal="file_selected" from="InformationWindows/ESCScriptFileDialog" to="." method="_on_ESCScriptFileDialog_file_selected"]
-[connection signal="file_selected" from="InformationWindows/BackgroundImageFileDialog" to="." method="_on_BackgroundImageFileDialog_file_selected"]
-[connection signal="confirmed" from="InformationWindows/ClearConfirmationDialog" to="." method="_on_ClearConfirmationDialog_confirmed"]
-[connection signal="confirmed" from="InformationWindows/MainMenuConfirmationDialog" to="." method="_on_MainMenuConfirmationDialog_confirmed"]
-[connection signal="dir_selected" from="InformationWindows/RoomFolderDialog" to="." method="_on_RoomFolderDialog_dir_selected"]
diff --git a/addons/escoria-wizard/background.pdn b/addons/escoria-wizard/background.pdn
deleted file mode 100644
index 9362b68d..00000000
Binary files a/addons/escoria-wizard/background.pdn and /dev/null differ
diff --git a/addons/escoria-wizard/draw_frame_rects.gd b/addons/escoria-wizard/draw_frame_rects.gd
deleted file mode 100644
index c35200bc..00000000
--- a/addons/escoria-wizard/draw_frame_rects.gd
+++ /dev/null
@@ -1,44 +0,0 @@
-tool
-extends Control
-
-const grid_colour = Color.brown
-const highlight_colour = Color.gold #fuchsia
-
-# Number of rows to break the spritesheet into
-export var total_num_rows:int
-# Number of columns to break the spritesheet into
-export var total_num_columns:int
-# First animation cell. Boxes will be drawn around every cell from the start_cell to end_cell.
-export var start_cell:int
-# Last animation cell. Boxes will be drawn around every cell from the start_cell to end_cell.
-export var end_cell:int
-# The size of each animation cell in pixels.
-export var cell_size:Vector2
-# Zoom factor
-export var zoom_factor:float
-
-# This function will calculate where on the spritesheet the start and end frames for an animation
-# are, and draw boxes around all used frames. The visual indicator makes frame selection easier.
-func _draw() -> void:
- if start_cell > 0:
- # Draw grid for all frames in the spritesheet
- for yloop in range(total_num_rows):
- for xloop in range(total_num_columns):
- var corner1 = Vector2(xloop * cell_size.x, yloop * cell_size.y)
- var corner2 = Vector2(corner1.x + cell_size.x, corner1.y + cell_size.y)
- draw_line(Vector2(corner1.x * zoom_factor, corner1.y * zoom_factor), Vector2(corner2.x * zoom_factor, corner1.y * zoom_factor), grid_colour, 2.0, false)
- draw_line(Vector2(corner1.x * zoom_factor, corner1.y * zoom_factor), Vector2(corner1.x * zoom_factor, corner2.y * zoom_factor), grid_colour, 2.0, false)
- draw_line(Vector2(corner1.x * zoom_factor, corner2.y * zoom_factor), Vector2(corner2.x * zoom_factor, corner2.y * zoom_factor), grid_colour, 2.0, false)
- draw_line(Vector2(corner2.x * zoom_factor, corner1.y * zoom_factor), Vector2(corner2.x * zoom_factor, corner2.y * zoom_factor), grid_colour, 2.0, false)
-
- # Highlight selected frames in the spritesheet
- for loop in range(end_cell - start_cell + 1):
- var current_cell = start_cell + loop
- var frame_row = (current_cell - 1) / total_num_columns
- var frame_column = (current_cell - 1) % total_num_columns
- var corner1 = Vector2(frame_column * cell_size.x, frame_row * cell_size.y)
- var corner2 = Vector2(corner1.x + cell_size.x, corner1.y + cell_size.y)
- draw_line(Vector2(corner1.x * zoom_factor, corner1.y * zoom_factor), Vector2(corner2.x * zoom_factor, corner1.y * zoom_factor), highlight_colour, 2.0, false)
- draw_line(Vector2(corner1.x * zoom_factor, corner1.y * zoom_factor), Vector2(corner1.x * zoom_factor, corner2.y * zoom_factor), highlight_colour, false)
- draw_line(Vector2(corner1.x * zoom_factor, corner2.y * zoom_factor), Vector2(corner2.x * zoom_factor, corner2.y * zoom_factor), highlight_colour, 2.0, false)
- draw_line(Vector2(corner2.x * zoom_factor, corner1.y * zoom_factor), Vector2(corner2.x * zoom_factor, corner2.y * zoom_factor), highlight_colour, 2.0, false)
diff --git a/addons/escoria-wizard/escoria_wizard.gd b/addons/escoria-wizard/escoria_wizard.gd
deleted file mode 100644
index 9779743d..00000000
--- a/addons/escoria-wizard/escoria_wizard.gd
+++ /dev/null
@@ -1,43 +0,0 @@
-tool
-extends Control
-
-
-const GENERIC_ERROR_NODE = "Menu/InformationWindows/generic_error_window"
-
-
-# This variable is set by plugin.gd and used to allow the plugin to interact with the Godot
-# editor (open the ESCPlayer scene in the editor once it's created)
-var plugin_reference
-
-
-func _ready() -> void:
- for section_loop in ["RoomCreator", "CharacterCreator", "ItemCreator"]:
- get_node(section_loop).visible = false
-
- $Menu.visible = true
-
-
-func NewGame_pressed() -> void:
- pass # Replace with function body.
-
-
-func NewRoom_pressed() -> void:
- $Menu.visible = false
- $RoomCreator.visible = true
- $RoomCreator.room_creator_reset()
-
-
-func CharacterCreator_pressed() -> void:
- $Menu.visible = false
- $CharacterCreator.visible = true
-
- if plugin_reference == null:
- get_node(GENERIC_ERROR_NODE).dialog_text = "Warning!\n\nExporting your character will fail when\n"
- get_node(GENERIC_ERROR_NODE).dialog_text += "running the character creator directly rather than\n"
- get_node(GENERIC_ERROR_NODE).dialog_text += "as a plugin.\n\nPlease open this as a plugin."
- get_node(GENERIC_ERROR_NODE).popup()
-
-
-func InventoryItem_pressed() -> void:
- $Menu.visible = false
- $ItemCreator.visible = true
diff --git a/addons/escoria-wizard/escoria_wizard.tscn b/addons/escoria-wizard/escoria_wizard.tscn
deleted file mode 100644
index 8cca161c..00000000
--- a/addons/escoria-wizard/escoria_wizard.tscn
+++ /dev/null
@@ -1,101 +0,0 @@
-[gd_scene load_steps=9 format=2]
-
-[ext_resource path="res://addons/escoria-wizard/graphics/background.png" type="Texture" id=1]
-[ext_resource path="res://addons/escoria-wizard/CharacterCreator.tscn" type="PackedScene" id=2]
-[ext_resource path="res://addons/escoria-wizard/ItemCreator.tscn" type="PackedScene" id=3]
-[ext_resource path="res://addons/escoria-wizard/RoomCreator.tscn" type="PackedScene" id=4]
-[ext_resource path="res://addons/escoria-wizard/escoria_wizard.gd" type="Script" id=38]
-[ext_resource path="res://addons/escoria-wizard/graphics/character.png" type="Texture" id=40]
-[ext_resource path="res://addons/escoria-wizard/graphics/room.png" type="Texture" id=42]
-[ext_resource path="res://addons/escoria-wizard/graphics/inventory.png" type="Texture" id=44]
-
-[node name="root" type="MarginContainer"]
-anchor_right = 1.0
-anchor_bottom = 1.0
-margin_right = 10.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-script = ExtResource( 38 )
-
-[node name="background" type="TextureRect" parent="."]
-margin_right = 1290.0
-margin_bottom = 900.0
-size_flags_horizontal = 3
-size_flags_vertical = 3
-texture = ExtResource( 1 )
-expand = true
-stretch_mode = 2
-
-[node name="Menu" type="MarginContainer" parent="."]
-margin_right = 1290.0
-margin_bottom = 900.0
-
-[node name="CenterContainer" type="CenterContainer" parent="Menu"]
-margin_right = 1290.0
-margin_bottom = 900.0
-
-[node name="GridContainer" type="GridContainer" parent="Menu/CenterContainer"]
-margin_left = 549.0
-margin_top = 325.0
-margin_right = 740.0
-margin_bottom = 575.0
-custom_constants/vseparation = 20
-
-[node name="NewRoom" type="Button" parent="Menu/CenterContainer/GridContainer"]
-margin_right = 191.0
-margin_bottom = 70.0
-text = "Room Creator"
-icon = ExtResource( 42 )
-
-[node name="CharacterCreator" type="Button" parent="Menu/CenterContainer/GridContainer"]
-margin_top = 90.0
-margin_right = 191.0
-margin_bottom = 160.0
-custom_constants/hseparation = 5
-text = "Character Creator"
-icon = ExtResource( 40 )
-
-[node name="InventoryItem" type="Button" parent="Menu/CenterContainer/GridContainer"]
-margin_top = 180.0
-margin_right = 191.0
-margin_bottom = 250.0
-custom_constants/hseparation = 5
-text = "Item Creator"
-icon = ExtResource( 44 )
-
-[node name="InformationWindows" type="Control" parent="Menu"]
-visible = false
-margin_right = 1290.0
-margin_bottom = 900.0
-
-[node name="generic_error_window" type="AcceptDialog" parent="Menu/InformationWindows"]
-margin_left = 519.0
-margin_top = 234.0
-margin_right = 846.0
-margin_bottom = 394.0
-input_pass_on_modal_close_click = false
-popup_exclusive = true
-dialog_text = "Warning!
-
-Exporting your character will fail when
-running the character creator directly rather than
-as a plugin.
-
-Please open this as a plugin."
-
-[node name="RoomCreator" parent="." instance=ExtResource( 4 )]
-visible = false
-anchor_right = 0.0
-anchor_bottom = 0.0
-margin_right = 1290.0
-margin_bottom = 900.0
-
-[node name="CharacterCreator" parent="." instance=ExtResource( 2 )]
-visible = false
-
-[node name="ItemCreator" parent="." instance=ExtResource( 3 )]
-visible = false
-
-[connection signal="pressed" from="Menu/CenterContainer/GridContainer/NewRoom" to="." method="NewRoom_pressed"]
-[connection signal="pressed" from="Menu/CenterContainer/GridContainer/CharacterCreator" to="." method="CharacterCreator_pressed"]
-[connection signal="pressed" from="Menu/CenterContainer/GridContainer/InventoryItem" to="." method="InventoryItem_pressed"]
diff --git a/addons/escoria-wizard/graphics/background.png b/addons/escoria-wizard/graphics/background.png
deleted file mode 100644
index 94f6f929..00000000
Binary files a/addons/escoria-wizard/graphics/background.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/background_preview.png b/addons/escoria-wizard/graphics/background_preview.png
deleted file mode 100644
index 8ba42429..00000000
Binary files a/addons/escoria-wizard/graphics/background_preview.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/character.png b/addons/escoria-wizard/graphics/character.png
deleted file mode 100644
index 11b09717..00000000
Binary files a/addons/escoria-wizard/graphics/character.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreenarrow_down.png b/addons/escoria-wizard/graphics/darkgreenarrow_down.png
deleted file mode 100644
index 7c107403..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreenarrow_down.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreenarrow_downleft.png b/addons/escoria-wizard/graphics/darkgreenarrow_downleft.png
deleted file mode 100644
index df369b68..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreenarrow_downleft.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreenarrow_downright.png b/addons/escoria-wizard/graphics/darkgreenarrow_downright.png
deleted file mode 100644
index bf24e3d9..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreenarrow_downright.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreenarrow_left.png b/addons/escoria-wizard/graphics/darkgreenarrow_left.png
deleted file mode 100644
index 8ab0141b..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreenarrow_left.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreenarrow_right.png b/addons/escoria-wizard/graphics/darkgreenarrow_right.png
deleted file mode 100644
index 7716a287..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreenarrow_right.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreenarrow_up.png b/addons/escoria-wizard/graphics/darkgreenarrow_up.png
deleted file mode 100644
index c4637e81..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreenarrow_up.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreenarrow_upleft.png b/addons/escoria-wizard/graphics/darkgreenarrow_upleft.png
deleted file mode 100644
index 072f8ee4..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreenarrow_upleft.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreenarrow_upright.png b/addons/escoria-wizard/graphics/darkgreenarrow_upright.png
deleted file mode 100644
index f36a441f..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreenarrow_upright.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreyarrow_d.png b/addons/escoria-wizard/graphics/darkgreyarrow_d.png
deleted file mode 100644
index 756fb2d0..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreyarrow_d.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreyarrow_dl.png b/addons/escoria-wizard/graphics/darkgreyarrow_dl.png
deleted file mode 100644
index 66bfea0e..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreyarrow_dl.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreyarrow_dr.png b/addons/escoria-wizard/graphics/darkgreyarrow_dr.png
deleted file mode 100644
index d8174c49..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreyarrow_dr.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreyarrow_l.png b/addons/escoria-wizard/graphics/darkgreyarrow_l.png
deleted file mode 100644
index 42e28e54..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreyarrow_l.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreyarrow_r.png b/addons/escoria-wizard/graphics/darkgreyarrow_r.png
deleted file mode 100644
index 9ef00364..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreyarrow_r.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreyarrow_u.png b/addons/escoria-wizard/graphics/darkgreyarrow_u.png
deleted file mode 100644
index e0e85fc8..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreyarrow_u.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreyarrow_ul.png b/addons/escoria-wizard/graphics/darkgreyarrow_ul.png
deleted file mode 100644
index 1331b463..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreyarrow_ul.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/darkgreyarrow_ur.png b/addons/escoria-wizard/graphics/darkgreyarrow_ur.png
deleted file mode 100644
index 0b0ef7af..00000000
Binary files a/addons/escoria-wizard/graphics/darkgreyarrow_ur.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greenarrow_down.png b/addons/escoria-wizard/graphics/greenarrow_down.png
deleted file mode 100644
index 5610a96b..00000000
Binary files a/addons/escoria-wizard/graphics/greenarrow_down.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greenarrow_downleft.png b/addons/escoria-wizard/graphics/greenarrow_downleft.png
deleted file mode 100644
index 248f29fe..00000000
Binary files a/addons/escoria-wizard/graphics/greenarrow_downleft.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greenarrow_downright.png b/addons/escoria-wizard/graphics/greenarrow_downright.png
deleted file mode 100644
index a84d0b6b..00000000
Binary files a/addons/escoria-wizard/graphics/greenarrow_downright.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greenarrow_left.png b/addons/escoria-wizard/graphics/greenarrow_left.png
deleted file mode 100644
index dfba2e9b..00000000
Binary files a/addons/escoria-wizard/graphics/greenarrow_left.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greenarrow_right.png b/addons/escoria-wizard/graphics/greenarrow_right.png
deleted file mode 100644
index 80827ac1..00000000
Binary files a/addons/escoria-wizard/graphics/greenarrow_right.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greenarrow_up.png b/addons/escoria-wizard/graphics/greenarrow_up.png
deleted file mode 100644
index 6d94311d..00000000
Binary files a/addons/escoria-wizard/graphics/greenarrow_up.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greenarrow_upleft.png b/addons/escoria-wizard/graphics/greenarrow_upleft.png
deleted file mode 100644
index 81e505fc..00000000
Binary files a/addons/escoria-wizard/graphics/greenarrow_upleft.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greenarrow_upright.png b/addons/escoria-wizard/graphics/greenarrow_upright.png
deleted file mode 100644
index d65c24b0..00000000
Binary files a/addons/escoria-wizard/graphics/greenarrow_upright.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greyarrow_d.png b/addons/escoria-wizard/graphics/greyarrow_d.png
deleted file mode 100644
index 08d46e9d..00000000
Binary files a/addons/escoria-wizard/graphics/greyarrow_d.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greyarrow_dl.png b/addons/escoria-wizard/graphics/greyarrow_dl.png
deleted file mode 100644
index 7653aef4..00000000
Binary files a/addons/escoria-wizard/graphics/greyarrow_dl.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greyarrow_dr.png b/addons/escoria-wizard/graphics/greyarrow_dr.png
deleted file mode 100644
index 0eebaa88..00000000
Binary files a/addons/escoria-wizard/graphics/greyarrow_dr.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greyarrow_l.png b/addons/escoria-wizard/graphics/greyarrow_l.png
deleted file mode 100644
index bdb58ad7..00000000
Binary files a/addons/escoria-wizard/graphics/greyarrow_l.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greyarrow_r.png b/addons/escoria-wizard/graphics/greyarrow_r.png
deleted file mode 100644
index 1e9895d1..00000000
Binary files a/addons/escoria-wizard/graphics/greyarrow_r.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greyarrow_u.png b/addons/escoria-wizard/graphics/greyarrow_u.png
deleted file mode 100644
index 06d3194f..00000000
Binary files a/addons/escoria-wizard/graphics/greyarrow_u.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greyarrow_ul.png b/addons/escoria-wizard/graphics/greyarrow_ul.png
deleted file mode 100644
index f839c4b4..00000000
Binary files a/addons/escoria-wizard/graphics/greyarrow_ul.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/greyarrow_ur.png b/addons/escoria-wizard/graphics/greyarrow_ur.png
deleted file mode 100644
index 884afafc..00000000
Binary files a/addons/escoria-wizard/graphics/greyarrow_ur.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/help_background.png b/addons/escoria-wizard/graphics/help/help_background.png
deleted file mode 100644
index b7cf95d9..00000000
Binary files a/addons/escoria-wizard/graphics/help/help_background.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/left1.png b/addons/escoria-wizard/graphics/help/left1.png
deleted file mode 100644
index 6b6ffb6e..00000000
Binary files a/addons/escoria-wizard/graphics/help/left1.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/left2.png b/addons/escoria-wizard/graphics/help/left2.png
deleted file mode 100644
index 46173cb9..00000000
Binary files a/addons/escoria-wizard/graphics/help/left2.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/left3.png b/addons/escoria-wizard/graphics/help/left3.png
deleted file mode 100644
index 7d37685b..00000000
Binary files a/addons/escoria-wizard/graphics/help/left3.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/left4.png b/addons/escoria-wizard/graphics/help/left4.png
deleted file mode 100644
index f4e8aa84..00000000
Binary files a/addons/escoria-wizard/graphics/help/left4.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/left5.png b/addons/escoria-wizard/graphics/help/left5.png
deleted file mode 100644
index bd5b50a6..00000000
Binary files a/addons/escoria-wizard/graphics/help/left5.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/leftall.png b/addons/escoria-wizard/graphics/help/leftall.png
deleted file mode 100644
index d8f2c7ed..00000000
Binary files a/addons/escoria-wizard/graphics/help/leftall.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/middle1.png b/addons/escoria-wizard/graphics/help/middle1.png
deleted file mode 100644
index c83e0beb..00000000
Binary files a/addons/escoria-wizard/graphics/help/middle1.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/middle2.png b/addons/escoria-wizard/graphics/help/middle2.png
deleted file mode 100644
index 8f5ceb5b..00000000
Binary files a/addons/escoria-wizard/graphics/help/middle2.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/middle3.png b/addons/escoria-wizard/graphics/help/middle3.png
deleted file mode 100644
index 59208271..00000000
Binary files a/addons/escoria-wizard/graphics/help/middle3.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/middleall.png b/addons/escoria-wizard/graphics/help/middleall.png
deleted file mode 100644
index fd516b63..00000000
Binary files a/addons/escoria-wizard/graphics/help/middleall.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/right1.png b/addons/escoria-wizard/graphics/help/right1.png
deleted file mode 100644
index 06252661..00000000
Binary files a/addons/escoria-wizard/graphics/help/right1.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/right2.png b/addons/escoria-wizard/graphics/help/right2.png
deleted file mode 100644
index a4f37775..00000000
Binary files a/addons/escoria-wizard/graphics/help/right2.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/right3.png b/addons/escoria-wizard/graphics/help/right3.png
deleted file mode 100644
index 65b769bb..00000000
Binary files a/addons/escoria-wizard/graphics/help/right3.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/right4.png b/addons/escoria-wizard/graphics/help/right4.png
deleted file mode 100644
index fffc948f..00000000
Binary files a/addons/escoria-wizard/graphics/help/right4.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/right5.png b/addons/escoria-wizard/graphics/help/right5.png
deleted file mode 100644
index 0888c9dd..00000000
Binary files a/addons/escoria-wizard/graphics/help/right5.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/help/rightall.png b/addons/escoria-wizard/graphics/help/rightall.png
deleted file mode 100644
index 0873e138..00000000
Binary files a/addons/escoria-wizard/graphics/help/rightall.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/icon.png b/addons/escoria-wizard/graphics/icon.png
deleted file mode 100644
index 712b0060..00000000
Binary files a/addons/escoria-wizard/graphics/icon.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/icon16x16.png b/addons/escoria-wizard/graphics/icon16x16.png
deleted file mode 100644
index 8c4191b1..00000000
Binary files a/addons/escoria-wizard/graphics/icon16x16.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/inventory.png b/addons/escoria-wizard/graphics/inventory.png
deleted file mode 100644
index 52a6475c..00000000
Binary files a/addons/escoria-wizard/graphics/inventory.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/inventory_preview.png b/addons/escoria-wizard/graphics/inventory_preview.png
deleted file mode 100644
index b22db898..00000000
Binary files a/addons/escoria-wizard/graphics/inventory_preview.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/mark-animtest.png b/addons/escoria-wizard/graphics/mark-animtest.png
deleted file mode 100644
index 1f64e034..00000000
Binary files a/addons/escoria-wizard/graphics/mark-animtest.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/no_animation.png b/addons/escoria-wizard/graphics/no_animation.png
deleted file mode 100644
index 5408dca9..00000000
Binary files a/addons/escoria-wizard/graphics/no_animation.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/no_spritesheet.png b/addons/escoria-wizard/graphics/no_spritesheet.png
deleted file mode 100644
index 4fe2c70f..00000000
Binary files a/addons/escoria-wizard/graphics/no_spritesheet.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/object_preview.png b/addons/escoria-wizard/graphics/object_preview.png
deleted file mode 100644
index 14c1e3b2..00000000
Binary files a/addons/escoria-wizard/graphics/object_preview.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/idle_all.png b/addons/escoria-wizard/graphics/robot/idle_all.png
deleted file mode 100644
index da6757a4..00000000
Binary files a/addons/escoria-wizard/graphics/robot/idle_all.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/open_all.png b/addons/escoria-wizard/graphics/robot/open_all.png
deleted file mode 100644
index 21750b46..00000000
Binary files a/addons/escoria-wizard/graphics/robot/open_all.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/talk_down.png b/addons/escoria-wizard/graphics/robot/talk_down.png
deleted file mode 100644
index 132570fa..00000000
Binary files a/addons/escoria-wizard/graphics/robot/talk_down.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/talk_downleft.png b/addons/escoria-wizard/graphics/robot/talk_downleft.png
deleted file mode 100644
index fb4c9714..00000000
Binary files a/addons/escoria-wizard/graphics/robot/talk_downleft.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/talk_downright.png b/addons/escoria-wizard/graphics/robot/talk_downright.png
deleted file mode 100644
index d09a52da..00000000
Binary files a/addons/escoria-wizard/graphics/robot/talk_downright.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/talk_right.png b/addons/escoria-wizard/graphics/robot/talk_right.png
deleted file mode 100644
index e5fa6a21..00000000
Binary files a/addons/escoria-wizard/graphics/robot/talk_right.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/talk_up.png b/addons/escoria-wizard/graphics/robot/talk_up.png
deleted file mode 100644
index 7d77d81c..00000000
Binary files a/addons/escoria-wizard/graphics/robot/talk_up.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/talk_upright.png b/addons/escoria-wizard/graphics/robot/talk_upright.png
deleted file mode 100644
index 5a3fd6ae..00000000
Binary files a/addons/escoria-wizard/graphics/robot/talk_upright.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/walk_down.png b/addons/escoria-wizard/graphics/robot/walk_down.png
deleted file mode 100644
index 432cf82a..00000000
Binary files a/addons/escoria-wizard/graphics/robot/walk_down.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/walk_downleft.png b/addons/escoria-wizard/graphics/robot/walk_downleft.png
deleted file mode 100644
index 464a4469..00000000
Binary files a/addons/escoria-wizard/graphics/robot/walk_downleft.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/walk_downright.png b/addons/escoria-wizard/graphics/robot/walk_downright.png
deleted file mode 100644
index 7eeea0f8..00000000
Binary files a/addons/escoria-wizard/graphics/robot/walk_downright.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/walk_right.png b/addons/escoria-wizard/graphics/robot/walk_right.png
deleted file mode 100644
index 91c08ddf..00000000
Binary files a/addons/escoria-wizard/graphics/robot/walk_right.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/walk_up.png b/addons/escoria-wizard/graphics/robot/walk_up.png
deleted file mode 100644
index 65dfcc06..00000000
Binary files a/addons/escoria-wizard/graphics/robot/walk_up.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/robot/walk_upright.png b/addons/escoria-wizard/graphics/robot/walk_upright.png
deleted file mode 100644
index 2a619381..00000000
Binary files a/addons/escoria-wizard/graphics/robot/walk_upright.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/room.png b/addons/escoria-wizard/graphics/room.png
deleted file mode 100644
index 42746fae..00000000
Binary files a/addons/escoria-wizard/graphics/room.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/roomitem.png b/addons/escoria-wizard/graphics/roomitem.png
deleted file mode 100644
index 7770f7c3..00000000
Binary files a/addons/escoria-wizard/graphics/roomitem.png and /dev/null differ
diff --git a/addons/escoria-wizard/graphics/wand.png b/addons/escoria-wizard/graphics/wand.png
deleted file mode 100644
index d692dc4e..00000000
Binary files a/addons/escoria-wizard/graphics/wand.png and /dev/null differ
diff --git a/addons/escoria-wizard/help_window.gd b/addons/escoria-wizard/help_window.gd
deleted file mode 100644
index 8a5e3455..00000000
--- a/addons/escoria-wizard/help_window.gd
+++ /dev/null
@@ -1,56 +0,0 @@
-tool
-extends WindowDialog
-
-
-# Declare member variables here. Examples:
-# var a: int = 2
-# var b: String = "text"
-
-const LAST_PAGE = 15
-
-export var current_page = 1
-
-
-func help_on_prev_button_pressed() -> void:
- current_page -= 1
- if current_page < 1:
- current_page = 1
- show_page()
-
-
-func help_on_next_button_pressed() -> void:
- current_page += 1
- if current_page > LAST_PAGE:
- current_page = LAST_PAGE
- show_page()
-
-
-func show_page() -> void:
- for loop in get_tree().get_nodes_in_group("masks"):
- loop.visible = false
- for loop in get_tree().get_nodes_in_group("pagetext"):
- loop.visible = false
-
- $masks/leftall.visible = true
- $masks/middleall.visible = true
- $masks/rightall.visible = true
-
- get_node("masks").get_node("page%s" % current_page).visible = true
- get_node("text").get_node("page%s" % current_page).visible = true
-
- match current_page:
- 2: $masks/leftall.visible = false
- 3: $masks/rightall.visible = false
- 4: $masks/leftall.visible = false
- 5: $masks/leftall.visible = false
- 6: $masks/leftall.visible = false
- 7: $masks/leftall.visible = false
- 8: $masks/middleall.visible = false
- 9: $masks/middleall.visible = false
- 10: $masks/middleall.visible = false
- 11: $masks/rightall.visible = false
- 12: $masks/rightall.visible = false
- 13: $masks/rightall.visible = false
- 14: $masks/rightall.visible = false
-
-
diff --git a/addons/escoria-wizard/help_window.tscn b/addons/escoria-wizard/help_window.tscn
deleted file mode 100644
index cb0709c1..00000000
--- a/addons/escoria-wizard/help_window.tscn
+++ /dev/null
@@ -1,533 +0,0 @@
-[gd_scene load_steps=19 format=2]
-
-[ext_resource path="res://addons/escoria-wizard/graphics/help/left3.png" type="Texture" id=1]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/left4.png" type="Texture" id=2]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/left5.png" type="Texture" id=3]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/middle3.png" type="Texture" id=4]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/right4.png" type="Texture" id=5]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/middleall.png" type="Texture" id=6]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/middle2.png" type="Texture" id=7]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/left2.png" type="Texture" id=8]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/rightall.png" type="Texture" id=9]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/right5.png" type="Texture" id=10]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/right2.png" type="Texture" id=11]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/right3.png" type="Texture" id=12]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/leftall.png" type="Texture" id=13]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/help_background.png" type="Texture" id=14]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/left1.png" type="Texture" id=15]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/middle1.png" type="Texture" id=16]
-[ext_resource path="res://addons/escoria-wizard/graphics/help/right1.png" type="Texture" id=17]
-[ext_resource path="res://addons/escoria-wizard/help_window.gd" type="Script" id=18]
-
-[node name="help_window" type="WindowDialog"]
-margin_left = 100.0
-margin_top = 100.0
-margin_right = 1012.0
-margin_bottom = 742.0
-popup_exclusive = true
-script = ExtResource( 18 )
-
-[node name="VBoxContainer" type="VBoxContainer" parent="."]
-margin_left = 4.0
-margin_top = 4.0
-margin_right = 908.0
-margin_bottom = 638.0
-
-[node name="Background" type="TextureRect" parent="VBoxContainer"]
-margin_right = 904.0
-margin_bottom = 610.0
-texture = ExtResource( 14 )
-
-[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer"]
-margin_top = 614.0
-margin_right = 904.0
-margin_bottom = 634.0
-
-[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/CenterContainer"]
-margin_left = 322.0
-margin_right = 581.0
-margin_bottom = 20.0
-
-[node name="prev_button" type="Button" parent="VBoxContainer/CenterContainer/HBoxContainer"]
-margin_right = 118.0
-margin_bottom = 20.0
-text = "<- Previous Page"
-
-[node name="Control" type="Control" parent="VBoxContainer/CenterContainer/HBoxContainer"]
-margin_left = 122.0
-margin_right = 162.0
-margin_bottom = 20.0
-rect_min_size = Vector2( 40, 20 )
-
-[node name="next_button" type="Button" parent="VBoxContainer/CenterContainer/HBoxContainer"]
-margin_left = 166.0
-margin_right = 259.0
-margin_bottom = 20.0
-text = "Next Page ->"
-
-[node name="masks" type="Control" parent="."]
-margin_right = 40.0
-margin_bottom = 40.0
-
-[node name="leftall" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 8.0
-margin_top = 8.0
-margin_right = 309.0
-margin_bottom = 610.0
-texture = ExtResource( 13 )
-
-[node name="middleall" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 324.0
-margin_top = 8.0
-margin_right = 663.0
-margin_bottom = 610.0
-texture = ExtResource( 6 )
-
-[node name="rightall" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 678.0
-margin_top = 8.0
-margin_right = 904.0
-margin_bottom = 610.0
-texture = ExtResource( 9 )
-
-[node name="page1" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 4.0
-margin_top = 4.0
-margin_right = 305.0
-margin_bottom = 606.0
-
-[node name="page2" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 8.0
-margin_top = 8.0
-margin_right = 309.0
-margin_bottom = 610.0
-texture = ExtResource( 15 )
-
-[node name="page3" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 678.0
-margin_top = 8.0
-margin_right = 904.0
-margin_bottom = 610.0
-texture = ExtResource( 17 )
-
-[node name="page4" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 8.0
-margin_top = 8.0
-margin_right = 309.0
-margin_bottom = 610.0
-texture = ExtResource( 8 )
-
-[node name="page5" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 8.0
-margin_top = 8.0
-margin_right = 309.0
-margin_bottom = 610.0
-texture = ExtResource( 1 )
-
-[node name="page6" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 8.0
-margin_top = 8.0
-margin_right = 309.0
-margin_bottom = 610.0
-texture = ExtResource( 2 )
-
-[node name="page7" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 8.0
-margin_top = 8.0
-margin_right = 309.0
-margin_bottom = 610.0
-texture = ExtResource( 3 )
-
-[node name="page8" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 324.0
-margin_top = 8.0
-margin_right = 663.0
-margin_bottom = 610.0
-texture = ExtResource( 16 )
-
-[node name="page9" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 324.0
-margin_top = 8.0
-margin_right = 663.0
-margin_bottom = 610.0
-texture = ExtResource( 7 )
-
-[node name="page10" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 324.0
-margin_top = 8.0
-margin_right = 663.0
-margin_bottom = 610.0
-texture = ExtResource( 4 )
-
-[node name="page11" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 678.0
-margin_top = 8.0
-margin_right = 904.0
-margin_bottom = 610.0
-texture = ExtResource( 11 )
-
-[node name="page12" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 678.0
-margin_top = 8.0
-margin_right = 904.0
-margin_bottom = 610.0
-texture = ExtResource( 12 )
-
-[node name="page13" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 678.0
-margin_top = 8.0
-margin_right = 904.0
-margin_bottom = 610.0
-texture = ExtResource( 5 )
-
-[node name="page14" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.882353 )
-margin_left = 678.0
-margin_top = 8.0
-margin_right = 904.0
-margin_bottom = 610.0
-texture = ExtResource( 10 )
-
-[node name="page15" type="TextureRect" parent="masks" groups=["masks"]]
-visible = false
-modulate = Color( 1, 1, 1, 0.784314 )
-margin_left = 678.0
-margin_top = 8.0
-margin_right = 979.0
-margin_bottom = 610.0
-
-[node name="text" type="Control" parent="."]
-margin_right = 40.0
-margin_bottom = 40.0
-
-[node name="page1" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 229.0
-margin_top = 137.0
-margin_right = 699.0
-margin_bottom = 440.0
-text = "Escoria Player Creator
-
-Game characters in Escoria are Godot scenes with an ESCPlayer node.
-The ESCPlayer requires configuration to define things like how many
-directions the character has animations defined for, and which
-movement direction in the game world corresponds to each animation.
-
-While Escoria can create characters that can move in as many
-directions as you like, most games will feature characters that can
-move in either 4 or 8 directions. For each direction, walk, talk and idle
-animations are required. This tool simplifies the process for configuring
-all these settings.
-
-These help pages will guide you through the process, but essentially you
-give your character a name, choose 4 or 8 directions, then choose frames
-from sprite sheets for walk, talk and idle animations in each direction.
-
-Click the \"Next Page\" button below to progress to the next help page."
-
-[node name="page2" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 301.0
-margin_top = 6.0
-margin_right = 657.0
-margin_bottom = 156.0
-text = "Use the name field to supply a name for your character.
-Any changes to the name will be reflected to the
-global_id field. The global_id is used to identify the
-character in scripts.
-
-Note that you can change the global_id to be different
-from the name if you choose. It's generally easiest
-to keep them the same but there's no requirement to.
-"
-
-[node name="page3" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 299.0
-margin_top = 10.0
-margin_right = 654.0
-margin_bottom = 194.0
-text = "Use the \"Load Spritesheet\" button to load a spritesheet
-graphic. The spritesheet is an image that contains one
-or more sprite frames that will be used for the walk,
-talk and/or idle animation frames for the character.
-
-The character creator remembers which spritesheet is
-used for each type and direction of animation, so you
-can use one spritesheet for all the animations, one
-spritesheet per animation, or any combination
-inbetween.
-"
-
-[node name="page4" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 298.0
-margin_top = 59.0
-margin_right = 591.0
-margin_bottom = 124.0
-text = "Use these buttons to indicate whether your
-character will have animations facing in either
-4 or 8 directions. This can be changed at any
-time while creating the character."
-
-[node name="page5" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 303.0
-margin_top = 105.0
-margin_right = 596.0
-margin_bottom = 170.0
-text = "You will use these buttons to choose whether
-you are currently creating walk, talk, or idle
-animations."
-
-[node name="page6" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 133.0
-margin_top = 126.0
-margin_right = 523.0
-margin_bottom = 378.0
-text = "Click the arrow matching the direction you wish to create
-an animation for. For example, if you select walk from the
-options above, and the right arrow, you'll be creating the
-animation for the character walking right.
-
-Once you store (save) the animation, the arrow will change
-to a green colour to show you the animation has been
-configured. It can still be edited once it has been stored.
-
-When you select an direction that isn't up or down, the
-mirror button will appear. If you click this button, the
-animation will be created automatically as a mirror of the
-opposite side's animation. e.g. If you create the right side
-animation, you can click the left arrow then the mirror
-button to quickly create the left hand animation."
-
-[node name="page7" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 63.0
-margin_top = 369.0
-margin_right = 334.0
-margin_bottom = 417.0
-text = "When you select the animation frames to
-define a particular animation, a preview
-of the animation will be shown in this box."
-
-[node name="page8" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 37.0
-margin_top = 21.0
-margin_right = 308.0
-margin_bottom = 103.0
-text = "This is the currently loaded spritesheet.
-As you select particular frames to be
-part of the current animation, a box will
-be drawn around them to help you see
-what is included in the animation."
-
-[node name="page9" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 339.0
-margin_top = 422.0
-margin_right = 610.0
-margin_bottom = 538.0
-text = "Use this slider to reset the zoom level
-on the spritesheet. The zoom is only
-used in this tool and will not affect the
-zoom level of your character in game.
-
-Use the reset button to reset the zoom
-level."
-
-[node name="page10" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 354.0
-margin_top = 511.0
-margin_right = 594.0
-margin_bottom = 559.0
-text = "This information window tells you the
-filename of the currently loaded
-spritesheet."
-
-[node name="page11" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 297.0
-margin_top = 28.0
-margin_right = 622.0
-margin_bottom = 229.0
-text = "Once you've loaded your spritesheet you need to
-tell the character creator how to divide it into
-individual frames with the horizontal/vertical
-frames selectors.
-
-The start/end frame selectors tell the tool which
-frames to use from the spritesheet to create the
-animation.
-
-The speed slider defines the speed of this
-animation in frames per second. Each animation
-can have a different speed value if desired."
-
-[node name="page12" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 374.0
-margin_top = 124.0
-margin_right = 651.0
-margin_bottom = 189.0
-text = "These lines are informational. They tell you
-how big the current spritesheet is, and how
-big each animation frame is based on the
-frame settings above."
-
-[node name="page13" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 374.0
-margin_top = 171.0
-margin_right = 648.0
-margin_bottom = 321.0
-text = "When you change the settings for the
-current animation, the \"store animation\"
-button will appear. This saves the current
-settings to the selected animation.
-
-If the settings are changed back to how
-they were, the store button will
-disappear to tell you that there is currently
-no change to save."
-
-[node name="page14" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 332.0
-margin_top = 228.0
-margin_right = 660.0
-margin_bottom = 429.0
-text = "Click this button to export the completed character
-out to a Godot scene for use by Escoria.
-Note that a walk, talk and idle animation for each of
-the specified (4 or 8) directions must have been
-set up before you can export the character.
-
-If any animations haven't been configured, it will
-tell you that animations are missing.
-
-Direction arrows that haven't turned green are a
-visual indicator of the directions still requiring
-animations."
-
-[node name="page15" type="Label" parent="text" groups=["pagetext"]]
-visible = false
-anchor_left = 0.5
-anchor_top = 0.5
-anchor_right = 0.5
-anchor_bottom = 0.5
-margin_left = 273.0
-margin_top = 143.0
-margin_right = 663.0
-margin_bottom = 412.0
-text = "Once you have exported your character they will be a saved
-ESCPlayer scene in your filesystem. The scene will be named
-based on the name you gave your character in the Name
-field.
-
-If this is a user-controllable character, this character can now
-be included in your game by :
-
-* Creating a Godot scene for your room
-* Creating an ESCRoom node
-* Selecting the created ESCPlayer scene as the Player Scene
- property in that node.
-
-If they are an NPC, add the scene to your scene tree, and
-program them in your ESC scripts using the global_id you
-have configured."
-
-[connection signal="pressed" from="VBoxContainer/CenterContainer/HBoxContainer/prev_button" to="." method="help_on_prev_button_pressed"]
-[connection signal="pressed" from="VBoxContainer/CenterContainer/HBoxContainer/next_button" to="." method="help_on_next_button_pressed"]
diff --git a/addons/escoria-wizard/item_creator.gd b/addons/escoria-wizard/item_creator.gd
deleted file mode 100644
index 51199000..00000000
--- a/addons/escoria-wizard/item_creator.gd
+++ /dev/null
@@ -1,319 +0,0 @@
-tool
-extends MarginContainer
-
-
-const ITEM_NAME_NODE = "VBoxContainer/Content/GridContainer/ItemName"
-const GLOBAL_ID_NODE = "VBoxContainer/Content/GridContainer/ItemGlobalID"
-const INTERACTIVE_NODE = "VBoxContainer/Content/GridContainer/StartsInteractiveCheckBox"
-const ACTION_NODE = "VBoxContainer/Content/GridContainer/DefaultActionOption"
-const PREVIEW_NODE = "VBoxContainer/Content/GridContainer/Preview/Preview"
-const IMAGE_SIZE_NODE = "VBoxContainer/Content/GridContainer/ImageSize"
-const IMAGE_PATH_NODE = "VBoxContainer/Content/GridContainer/ImagePath"
-const LOAD_NODE = "LoadObjectGraphic/LoadObjectFileDialog"
-const CONFIRM_NODE = "Windows/ConfirmationDialog"
-const OBJECT_HEADING_NODE = "VBoxContainer/HelperHeading/CenterContainer/ObjectHeading"
-const OBJECT_DESC_NODE = "VBoxContainer/Description/ObjectDescription"
-const INVENTORY_HEADING_NODE = "VBoxContainer/HelperHeading/CenterContainer/InventoryHeading"
-const INVENTORY_DESC_NODE = "VBoxContainer/Description/InventoryDescription"
-const INVENTORY_PATH_NODE = "VBoxContainer/Content/GridContainer/InventoryPath"
-const INVENTORY_PATH_LABEL_NODE = "VBoxContainer/Content/GridContainer/InventoryPathLabel"
-const INVENTORY_PATH_SPACER_NODE = "VBoxContainer/Content/GridContainer/BlankItem7"
-const CREATE_BUTTON_NODE = "VBoxContainer/Buttons/CenterContainer/HBoxContainer/CreateButton"
-const ERROR_WINDOW_NODE = "Windows/ErrorDialog"
-const INVENTORY_PREV_NODE = "VBoxContainer/Content/GridContainer/Preview/InventoryPreview"
-const OBJECT_PREV_NODE = "VBoxContainer/Content/GridContainer/Preview/ObjectPreview"
-const BACKGROUND_OBJ_NODE = "VBoxContainer/Control/CenterContainer/HBoxContainer/BackgroundObjectCheckBox"
-const CHANGE_PATH_NODE = "VBoxContainer/Content/GridContainer/ChangePathButton"
-
-var source_image:Image
-var image_stream_texture:StreamTexture
-var image_has_been_loaded:bool
-var image_size:Vector2
-var main_menu_requested:bool
-var inventory_mode:bool
-var settings_modified:bool
-var preview_size:Vector2
-
-
-# Called when the node enters the scene tree for the first time.
-func _ready() -> void:
- # Capture the size of the window before we update its contents so we have
- # the absolute size before it gets scaled contents applied to it
- preview_size = get_node(PREVIEW_NODE).rect_size
- inventory_mode = not get_node(BACKGROUND_OBJ_NODE).pressed
- item_creator_reset()
-
-
-func item_creator_reset() -> void:
- get_node(ITEM_NAME_NODE).text = "replace_me"
- get_node(GLOBAL_ID_NODE).text = ""
- get_node(IMAGE_PATH_NODE).text = ""
- get_node(INTERACTIVE_NODE).pressed = true
-
- if get_node(ACTION_NODE).get_item_count() > 0:
- get_node(ACTION_NODE).clear()
-
- for option_list in ["look", "pick up", "open", "close", "use", "push", "pull", "talk"]:
- get_node(ACTION_NODE).add_item(option_list)
-
- get_node(ACTION_NODE).selected = 0
- image_size = Vector2.ZERO
- image_has_been_loaded = false
- main_menu_requested = false
- settings_modified = false
- get_node(PREVIEW_NODE).texture = null
-
- if inventory_mode:
- get_node(INVENTORY_PATH_NODE).text = ProjectSettings.get_setting("escoria/ui/inventory_items_path")
- get_node(CREATE_BUTTON_NODE).text = "Create Inventory"
- get_node(INVENTORY_PREV_NODE).visible = true
- get_node(OBJECT_PREV_NODE).visible = false
-
- for loop in [INVENTORY_PATH_NODE, INVENTORY_PATH_LABEL_NODE, INVENTORY_PATH_SPACER_NODE, \
- CHANGE_PATH_NODE]:
- get_node(loop).visible = true
- else:
- get_node(CREATE_BUTTON_NODE).text = "Create Object"
- get_node(INVENTORY_PREV_NODE).visible = false
- get_node(OBJECT_PREV_NODE).visible = true
- for loop in [INVENTORY_PATH_NODE, INVENTORY_PATH_LABEL_NODE, INVENTORY_PATH_SPACER_NODE, \
- CHANGE_PATH_NODE]:
- get_node(loop).visible = false
-
- for loop in [OBJECT_HEADING_NODE, OBJECT_DESC_NODE]:
- get_node(loop).visible = not inventory_mode
-
- for loop in [INVENTORY_HEADING_NODE, INVENTORY_DESC_NODE, INVENTORY_PATH_NODE]:
- get_node(loop).visible = inventory_mode
- $Windows/FileDialog.current_dir = ProjectSettings.get_setting("escoria/ui/inventory_items_path")
-
-func resize_image() -> void:
- # Calculate the scale to make the preview as big as possible in the preview window depending on
- # the height to width ratio of the frame
- image_size = image_stream_texture.get_size()
- var preview_scale = Vector2.ONE
- preview_scale.x = preview_size.x / image_size.x
- preview_scale.y = preview_size.y / image_size.y
-
- if preview_scale.y > preview_scale.x:
- get_node(PREVIEW_NODE).rect_scale = Vector2(preview_scale.x, preview_scale.x)
- else:
- get_node(PREVIEW_NODE).rect_scale = Vector2(preview_scale.y, preview_scale.y)
-
-func background_on_ItemName_text_changed(new_text: String) -> void:
- get_node(GLOBAL_ID_NODE).text = new_text
- settings_modified = true
-
-
-func load_button_pressed() -> void:
- get_node(LOAD_NODE).popup_centered()
-
-
-func LoadObjectFileDialog_file_selected(path: String) -> void:
- image_stream_texture = load(path)
-
- get_node(PREVIEW_NODE).texture = image_stream_texture
-
- resize_image()
-
- get_node(IMAGE_SIZE_NODE).text = "(%s, %s)" % [image_size.x, image_size.y]
-
- get_node(IMAGE_PATH_NODE).text = path
- image_has_been_loaded = true
- settings_modified = true
- get_node(INVENTORY_PREV_NODE).visible = false
- get_node(OBJECT_PREV_NODE).visible = false
-
-
-func _on_CreateButton_pressed() -> void:
- var inventory_path = ProjectSettings.get_setting("escoria/ui/inventory_items_path")
- var directory_test = Directory.new();
- if not directory_test.dir_exists(inventory_path):
- get_node(ERROR_WINDOW_NODE).dialog_text = \
- "Folder %s does not exist. Please create or change the destination" % inventory_path
- get_node(ERROR_WINDOW_NODE).popup_centered()
- return
-
- if not image_has_been_loaded:
- get_node(ERROR_WINDOW_NODE).dialog_text = \
- "No image has been loaded."
- get_node(ERROR_WINDOW_NODE).popup_centered()
- return
-
- if get_node(ITEM_NAME_NODE).text == "replace_me":
- get_node(ERROR_WINDOW_NODE).dialog_text = \
- "Please change the object name."
- get_node(ERROR_WINDOW_NODE).popup_centered()
- return
-
- if inventory_mode == false:
- if not EditorPlugin.new().get_editor_interface().get_selection().get_selected_nodes():
- get_node(ERROR_WINDOW_NODE).dialog_text = \
- "Please select a node in the scene tree\nto attach the object to."
- get_node(ERROR_WINDOW_NODE).popup_centered()
- return
-
- var item = ESCItem.new()
- item.name = get_node(ITEM_NAME_NODE).text
- item.global_id = get_node(GLOBAL_ID_NODE).text
- item.is_interactive = get_node(INTERACTIVE_NODE).pressed
- item.tooltip_name = get_node(ITEM_NAME_NODE).text
-
- var selected_index = get_node(ACTION_NODE).selected
- item.default_action = get_node(ACTION_NODE).get_item_text(selected_index)
-
- # Make the item by default it's usable straight out of the inventory
- if inventory_mode == true:
- var new_pool_array: PoolStringArray = item.combine_when_selected_action_is_in
- new_pool_array.append("use")
- item.combine_when_selected_action_is_in = new_pool_array
-
- # Add Dialog Position to the background item
- var interact_position = ESCLocation.new()
- interact_position.name = "interact_position"
- interact_position.position.y = image_size.y * 2
- item.add_child(interact_position)
-
- # Add Collision shape to the background item
- var rectangle_shape = RectangleShape2D.new()
- var collision_shape = CollisionShape2D.new()
-
- collision_shape.shape = rectangle_shape
- collision_shape.shape.extents = image_size / 2
- item.add_child(collision_shape)
-
- # Add sprite to the background item
- var item_sprite = Sprite.new()
- item_sprite.texture = get_node(PREVIEW_NODE).texture
- item.add_child(item_sprite)
-
- if not inventory_mode:
- # Create in scene tree
- # Attach to currently selected node in scene tree
- var current_node = EditorPlugin.new().get_editor_interface().get_selection().get_selected_nodes()[0]
- current_node.add_child(item)
- var owning_node = get_tree().edited_scene_root
- item.set_owner(owning_node)
- # Make it so all the nodes can be seen in the scene tree
- collision_shape.set_owner(owning_node)
- interact_position.set_owner(owning_node)
- item_sprite.set_owner(owning_node)
-
- get_node("Windows/CreateCompleteDialog").dialog_text = \
- "Background object %s created.\n\n" % item + \
- "Note that you can right-click the node in the\n" + \
- "scene tree and select \"Save branch as scene\"\n" + \
- "if you'd like to reuse this item."
- print("Background object %s created." % item)
- get_node("Windows/CreateCompleteDialog").popup_centered()
- else:
- get_tree().edited_scene_root.add_child(item)
- # Make it so all the nodes can be seen in the scene tree
- collision_shape.set_owner(item)
- interact_position.set_owner(item)
- item_sprite.set_owner(item)
-
- item.set_owner(get_tree().edited_scene_root)
- # Export scene - create in inventory folder
- var packed_scene = PackedScene.new()
-
- packed_scene.pack(get_tree().edited_scene_root.get_node(item.name))
-
- # Flag suggestions from https://godotengine.org/qa/50437/how-to-turn-a-node-into-a-packedscene-via-gdscript
- var err = ResourceSaver.save("%s/%s.tscn" % [inventory_path, get_node(ITEM_NAME_NODE).text], packed_scene, \
- ResourceSaver.FLAG_CHANGE_PATH|ResourceSaver.FLAG_REPLACE_SUBRESOURCE_PATHS)
- if err:
- get_node(ERROR_WINDOW_NODE).dialog_text = \
- "Failed to save the item. Please make sure you can\n" + \
- "write to the destination folder" % inventory_path
- get_node(ERROR_WINDOW_NODE).popup_centered()
- return
- else:
- item.queue_free()
- get_tree().edited_scene_root.get_node(item.name).queue_free()
- get_node("Windows/CreateCompleteDialog").dialog_text = \
- "Inventory item %s/%s.tscn created." % [inventory_path, get_node(ITEM_NAME_NODE).text]
- print("Inventory item %s/%s.tscn created." % [inventory_path, get_node(ITEM_NAME_NODE).text])
- get_node("Windows/CreateCompleteDialog").popup_centered()
-
-
-func Item_on_ClearButton_pressed() -> void:
- if settings_modified == true:
- main_menu_requested = false
- get_node(CONFIRM_NODE).dialog_text = "WARNING!\n\n" + \
- "If you continue you will lose the current object."
- get_node(CONFIRM_NODE).popup_centered()
-
-
-func _on_ObjectConfirmationDialog_confirmed() -> void:
- if main_menu_requested == true:
- switch_to_main_menu()
- else:
- item_creator_reset()
-
-
-func Item_on_ExitButton_pressed() -> void:
- if settings_modified == true:
- main_menu_requested = true
- get_node(CONFIRM_NODE).dialog_text = "WARNING!\n\n" + \
- "If you continue you will lose the current object."
- get_node(CONFIRM_NODE).popup_centered()
- else:
- switch_to_main_menu()
-
-
-func switch_to_main_menu() -> void:
- get_node("../Menu").visible = true
- get_node("../ItemCreator").visible = false
-
-
-func _on_StartsInteractiveCheckBox_pressed() -> void:
- settings_modified = true
-
-
-func _on_ItemGlobalID_text_changed(_new_text: String) -> void:
- settings_modified = true
-
-
-func _on_DefaultActionOption_item_selected(_index: int) -> void:
- settings_modified = true
-
-
-func _on_CreateCompleteDialog_confirmed() -> void:
- item_creator_reset()
-
-
-func _on_BackgroundObjectCheckBox_toggled(button_pressed: bool) -> void:
- if button_pressed == false:
- $VBoxContainer/Control/CenterContainer/HBoxContainer/InventoryItemCheckBox.set_pressed_no_signal(true)
- inventory_mode = true
- else:
- $VBoxContainer/Control/CenterContainer/HBoxContainer/InventoryItemCheckBox.set_pressed_no_signal(false)
- inventory_mode = false
-
- item_creator_reset()
-
-
-func _on_InventoryItemCheckBox_toggled(button_pressed: bool) -> void:
- if button_pressed == false:
- $VBoxContainer/Control/CenterContainer/HBoxContainer/BackgroundObjectCheckBox.set_pressed_no_signal(true)
- inventory_mode = false
- else:
- $VBoxContainer/Control/CenterContainer/HBoxContainer/BackgroundObjectCheckBox.set_pressed_no_signal(false)
- inventory_mode = true
-
- item_creator_reset()
-
-
-func _on_ChangePathButton_pressed():
- $"Windows/FileDialog".popup_centered()
-
-
-func _on_FileDialog_dir_selected(dir: String) -> void:
- ProjectSettings.set_setting("escoria/ui/inventory_items_path", dir)
- var property_info = {
- "name": "escoria/ui/inventory_items_path",
- "type": TYPE_STRING
- }
- ProjectSettings.add_property_info(property_info)
- get_node(INVENTORY_PATH_NODE).text = dir
diff --git a/addons/escoria-wizard/plugin.cfg b/addons/escoria-wizard/plugin.cfg
deleted file mode 100644
index ad7e2a23..00000000
--- a/addons/escoria-wizard/plugin.cfg
+++ /dev/null
@@ -1,7 +0,0 @@
-[plugin]
-
-name="Escoria Wizard"
-description="This plugin is used to make the creation of Escoria resources easier for developers."
-author="BalloonPopper"
-version="1.0.0"
-script="plugin.gd"
diff --git a/addons/escoria-wizard/plugin.gd b/addons/escoria-wizard/plugin.gd
deleted file mode 100644
index 3eac6200..00000000
--- a/addons/escoria-wizard/plugin.gd
+++ /dev/null
@@ -1,60 +0,0 @@
-tool
-extends EditorPlugin
-
-const helper_ui = preload("res://addons/escoria-wizard/escoria_wizard.tscn")
-
-# This is the instance of the plugin code that is instantiated by the plugin.
-var helper_instance
-
-func _enter_tree() -> void:
- helper_instance = helper_ui.instance()
- helper_instance.plugin_reference = self
- # Add the panel to the main viewport
- get_editor_interface().get_editor_viewport().add_child(helper_instance)
- make_visible(false)
-
-
-func _exit_tree() -> void:
- if helper_instance:
- helper_instance.queue_free()
-
-
-func has_main_screen() -> bool:
- # Add the button to the Godot interface ribbon
- return true
-
-
-func make_visible(visible: bool) -> void:
- if helper_instance:
- helper_instance.visible = visible
-
-
-func get_plugin_name() -> String:
- return "Escoria Wizard"
-
-
-func get_plugin_icon() -> Texture:
- return (preload("res://addons/escoria-wizard/graphics/icon16x16.png"))
-
-
-func open_scene(path: String) -> void:
- get_editor_interface().open_scene_from_path(path)
-
-# Unregister ourselves
-func disable_plugin():
- print("Disabling Escoria Wizard plugin")
- ESCProjectSettingsManager.remove_setting(
- "escoria/wizard/path_to_rooms"
- )
-
-# Register ourselves
-func enable_plugin():
- print("Enabling Escoria Wizard plugin")
- ESCProjectSettingsManager.register_setting(
- "escoria/wizard/path_to_rooms",
- "res://rooms",
- {
- "type": TYPE_STRING
- }
- )
-
diff --git a/addons/escoria-wizard/room_script_template.esc b/addons/escoria-wizard/room_script_template.esc
deleted file mode 100644
index ed56af38..00000000
--- a/addons/escoria-wizard/room_script_template.esc
+++ /dev/null
@@ -1,41 +0,0 @@
-# Room script template
-
-# ":setup" is used to configure anything you want in place before the
-# transition-in event runs (i.e. anything you need to set up before the player
-# sees the room). Reset movable objects to their start positions here.
-
-:setup
-
-
-
-# ":ready" runs after any events configured in setup complete. It is used to
-# configure everything that happens after the transition-in (if any) completes.
-# runs. Story telling events go here (e.g. if you want the character to walk to
-# a specific location in the room before giving control to the player.)
-
-:ready
-
-
-
-# Code examples - feel free to delete this section
-#
-# 1) Run this code when the player enters this room for the first time only.
-# This assumes your room is called "room_hallway". Also resets the "window"
-# to closed by playing the animation "close_window" using 'set_state'.
-#
-# > [!room_hallway_visited]
-# set_global room_hallway_visited true
-# set_state window close_window true
-#
-#
-# 2) Change where the player starts depending on which doorway they entered
-# the room from. Assumes your character is called "cleaner"
-#
-# > [eq ESC_LAST_SCENE room2]
-# teleport cleaner r1_r_exit
-# # Set cleaner look left
-# set_angle cleaner 270
-#
-#
-
-
diff --git a/project.godot b/project.godot
index d65fc0c1..f5d66ec1 100644
--- a/project.godot
+++ b/project.godot
@@ -389,12 +389,17 @@ _global_script_classes=[ {
"language": "GDScript",
"path": "res://addons/escoria-core/game/core-scripts/esc_room.gd"
}, {
+"base": "Reference",
+"class": "ESCRoomContainer",
+"language": "GDScript",
+"path": "res://addons/escoria-core/game/core-scripts/esc/types/esc_room_container.gd"
+}, {
"base": "Resource",
"class": "ESCRoomManager",
"language": "GDScript",
"path": "res://addons/escoria-core/game/core-scripts/esc/esc_room_manager.gd"
}, {
-"base": "Reference",
+"base": "ESCRoomContainer",
"class": "ESCRoomObjects",
"language": "GDScript",
"path": "res://addons/escoria-core/game/core-scripts/esc/types/esc_room_objects.gd"
@@ -404,6 +409,11 @@ _global_script_classes=[ {
"language": "GDScript",
"path": "res://addons/escoria-core/game/core-scripts/esc/types/esc_room_objects_key.gd"
}, {
+"base": "ESCRoomContainer",
+"class": "ESCRoomTerrains",
+"language": "GDScript",
+"path": "res://addons/escoria-core/game/core-scripts/esc/types/esc_room_terrains.gd"
+}, {
"base": "Resource",
"class": "ESCSaveGame",
"language": "GDScript",
@@ -580,6 +590,16 @@ _global_script_classes=[ {
"path": "res://addons/escoria-core/game/core-scripts/esc/commands/repeat.gd"
}, {
"base": "ESCBaseCommand",
+"class": "SaveGameCommand",
+"language": "GDScript",
+"path": "res://addons/escoria-core/game/core-scripts/esc/commands/save_game.gd"
+}, {
+"base": "Reference",
+"class": "SaveGamesSorter",
+"language": "GDScript",
+"path": "res://addons/escoria-core/ui_library/menus/load_save/SaveGamesSorter.gd"
+}, {
+"base": "ESCBaseCommand",
"class": "SayCommand",
"language": "GDScript",
"path": "res://addons/escoria-core/game/core-scripts/esc/commands/say.gd"
@@ -625,6 +645,11 @@ _global_script_classes=[ {
"path": "res://addons/escoria-core/game/core-scripts/esc/commands/set_animations.gd"
}, {
"base": "ESCBaseCommand",
+"class": "SetDirectionCommand",
+"language": "GDScript",
+"path": "res://addons/escoria-core/game/core-scripts/esc/commands/set_direction.gd"
+}, {
+"base": "ESCBaseCommand",
"class": "SetGlobalCommand",
"language": "GDScript",
"path": "res://addons/escoria-core/game/core-scripts/esc/commands/set_global.gd"
@@ -826,9 +851,11 @@ _global_script_class_icons={
"ESCReturnToMonekyIslandDialogs": "",
"ESCRichTooltip": "",
"ESCRoom": "res://addons/escoria-core/design/esc_room.svg",
+"ESCRoomContainer": "",
"ESCRoomManager": "",
"ESCRoomObjects": "",
"ESCRoomObjectsKey": "",
+"ESCRoomTerrains": "",
"ESCSaveGame": "",
"ESCSaveManager": "",
"ESCSaveSettings": "",
@@ -864,6 +891,8 @@ _global_script_class_icons={
"RTMIUiSettings": "",
"RandGlobalCommand": "",
"RepeatCommand": "",
+"SaveGameCommand": "",
+"SaveGamesSorter": "",
"SayCommand": "",
"SayLastDialogOptionCommand": "",
"SayRandomCommand": "",
@@ -873,6 +902,7 @@ _global_script_class_icons={
"SetActiveIfExistsCommand": "",
"SetAngleCommand": "",
"SetAnimationsCommand": "",
+"SetDirectionCommand": "",
"SetGlobalCommand": "",
"SetGlobalsCommand": "",
"SetGuiVisibleCommand": "",