Updated escoria-demo-game
4
.github/workflows/apidoc.yml
vendored
@@ -15,14 +15,14 @@ jobs:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.DEPLOYMENT_TOKEN }}
|
||||
token: ${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}
|
||||
repository: godot-escoria/escoria-demo-game
|
||||
ref: "develop"
|
||||
path: game
|
||||
- name: "Checkout docs repo"
|
||||
uses: actions/checkout@v2
|
||||
with:
|
||||
token: ${{ secrets.DEPLOYMENT_TOKEN }}
|
||||
token: ${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}
|
||||
repository: godot-escoria/escoria-docs
|
||||
ref: "devel"
|
||||
fetch-depth: 0
|
||||
|
||||
8
.github/workflows/fanout.yml
vendored
@@ -38,12 +38,12 @@ jobs:
|
||||
sudo apt-get install git -y
|
||||
fi
|
||||
- name: "Checkout"
|
||||
uses: "actions/checkout@v2"
|
||||
uses: "actions/checkout@v3"
|
||||
with:
|
||||
repository: "godot-escoria/escoria-demo-game"
|
||||
ref: "develop"
|
||||
path: "demo-game"
|
||||
token: "${{ secrets.DEPLOYMENT_TOKEN }}"
|
||||
token: "${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}"
|
||||
fetch-depth: 0
|
||||
- name: "Filtering out ${{ env.DIR }}"
|
||||
run: |
|
||||
@@ -55,12 +55,12 @@ jobs:
|
||||
git clean -fd
|
||||
git status
|
||||
- name: "Checkout"
|
||||
uses: "actions/checkout@v2"
|
||||
uses: "actions/checkout@v3"
|
||||
with:
|
||||
repository: "${{ env.REPO }}"
|
||||
ref: "develop"
|
||||
path: "target"
|
||||
token: "${{ secrets.DEPLOYMENT_TOKEN }}"
|
||||
token: "${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}"
|
||||
fetch-depth: 0
|
||||
- name: "Apply changes"
|
||||
run: |
|
||||
|
||||
10
.github/workflows/prerelease.yml
vendored
@@ -14,7 +14,7 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.DEPLOYMENT_TOKEN }}
|
||||
token: ${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}
|
||||
- name: Remove trailing whitespace
|
||||
run: |
|
||||
OUTPUT=$(find . -name "*.gd" -type f | xargs sed -i 's/[[:space:]]$//')
|
||||
@@ -29,7 +29,7 @@ jobs:
|
||||
id: calculate_version
|
||||
uses: mathieudutour/github-tag-action@v5.6
|
||||
with:
|
||||
github_token: ${{ secrets.DEPLOYMENT_TOKEN }}
|
||||
github_token: ${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}
|
||||
dry_run: true
|
||||
pre_release_branches: "develop"
|
||||
append_to_pre_release_tag: "alpha"
|
||||
@@ -58,12 +58,12 @@ jobs:
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
token: ${{ secrets.DEPLOYMENT_TOKEN }}
|
||||
token: ${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}
|
||||
- name: Create version
|
||||
id: create_version
|
||||
uses: mathieudutour/github-tag-action@v5.6
|
||||
with:
|
||||
github_token: ${{ secrets.DEPLOYMENT_TOKEN }}
|
||||
github_token: ${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}
|
||||
dry_run: true
|
||||
pre_release_branches: "develop"
|
||||
append_to_pre_release_tag: "alpha"
|
||||
@@ -72,7 +72,7 @@ jobs:
|
||||
- name: Create a GitHub release
|
||||
uses: actions/create-release@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.DEPLOYMENT_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.ESCORIA_DEPLOYMENT_TOKEN }}
|
||||
with:
|
||||
tag_name: ${{ steps.create_version.outputs.new_tag }}
|
||||
release_name: ${{ steps.create_version.outputs.new_tag }}
|
||||
|
||||
97
CHANGELOG.md
@@ -1,3 +1,100 @@
|
||||
## [4.0.0-alpha.248](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.248) (2023-05-31)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* corrects the interrupt signal call arguments ([3077907](https://github.com/godot-escoria/escoria-demo-game/commit/30779078443f1eb2ba7dd9f133fd22d804b5502b))
|
||||
* forces all show_menu and hide_menu commands to use auto transitions since the pause menu pauses the game, blocking further ESC script commands from running; updates room 14 for now ([6dd0a2c](https://github.com/godot-escoria/escoria-demo-game/commit/6dd0a2cd1958d7dbd7542aa85b09596e4fd14255))
|
||||
|
||||
|
||||
|
||||
## [4.0.0-alpha.247](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.247) (2023-05-29)
|
||||
|
||||
|
||||
|
||||
## [4.0.0-alpha.246](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.246) (2023-05-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* accounts for text going past vertical limits of screen ([2294d83](https://github.com/godot-escoria/escoria-demo-game/commit/2294d83ff17e1dfc50523f51dc7439c6b2869e4d))
|
||||
|
||||
|
||||
|
||||
## [4.0.0-alpha.245](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.245) (2023-05-24)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fixes incorrect handler signature; also checks for null since it appears that sometimes the tween parameter is null when the handler is called ([0e47989](https://github.com/godot-escoria/escoria-demo-game/commit/0e47989fd1c9fb7cabfdd3b27fc73590d0e01222))
|
||||
|
||||
|
||||
|
||||
## [4.0.0-alpha.244](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.244) (2023-05-23)
|
||||
|
||||
|
||||
|
||||
## [4.0.0-alpha.243](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.243) (2023-05-23)
|
||||
|
||||
|
||||
|
||||
## [4.0.0-alpha.242](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.242) (2023-05-14)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* adds 'block_say' command/structure to allow for the reuse of dialog players, which can produce a better visual experience for characters that have speech spanning more than one dialog box ([04121b0](https://github.com/godot-escoria/escoria-demo-game/commit/04121b087bd1a7a3bd56d4679dbe9833c4b62fc5))
|
||||
|
||||
|
||||
|
||||
## [4.0.0-alpha.241](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.241) (2023-05-04)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add fullscren option in options menu ([19c7685](https://github.com/godot-escoria/escoria-demo-game/commit/19c7685a68fc820fb0532a46978f9e12411ae7c7))
|
||||
* updates checkout action version and allows for testing on this branch ([dd00869](https://github.com/godot-escoria/escoria-demo-game/commit/dd008690a3a71a8cca192e6dba3e6fc5ff65de9e))
|
||||
* validates for multiple start locations set in an ESCRoom and updates scene tree with configuration warnings next to the offending ESCLocation nodes ([1f16421](https://github.com/godot-escoria/escoria-demo-game/commit/1f16421d65407c72f78d8e30e41f5299eb8db166))
|
||||
* Wizard - set up combine when selected for inventory items ([dc4b6c2](https://github.com/godot-escoria/escoria-demo-game/commit/dc4b6c24fec49190bda594d8dfca83007d1fcb41))
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* adds code to manually show the popup since, according to Godot docs, using show() in the parent CanvasLayer won't show Popup-derived nodes ([fd05bc9](https://github.com/godot-escoria/escoria-demo-game/commit/fd05bc9f744abf604000925e2c8618a745f02cae))
|
||||
* allows for string joining that's compatible with pre-3.5 Godot ([3727f82](https://github.com/godot-escoria/escoria-demo-game/commit/3727f82fbfeedd8bd433aae24b62509351673eb7))
|
||||
* Attempted method call on a deleted object. ([#677](https://github.com/godot-escoria/escoria-demo-game/issues/677)) ([39165e4](https://github.com/godot-escoria/escoria-demo-game/commit/39165e4f20ea08329305616df46d78a8dd0249ce))
|
||||
* avoids removing and re-adding dialog managers unnecessarily ([fdba154](https://github.com/godot-escoria/escoria-demo-game/commit/fdba1541c05f11128b1ca53cf08ff893559e9196))
|
||||
* changes pause mode to block children from processing during pause by default ([648747c](https://github.com/godot-escoria/escoria-demo-game/commit/648747cf62a58becfb7b9ca3583a05bcd82d1722))
|
||||
* Character creator - add tooltip, fix 8 dir angles, and make character selectable by default ([b47e653](https://github.com/godot-escoria/escoria-demo-game/commit/b47e65345f1dd453541cd5953063b54db5a7660e))
|
||||
* clears tooltip when event is finished ([b827092](https://github.com/godot-escoria/escoria-demo-game/commit/b8270921760b333e2058845df4e1aad7b7d353eb))
|
||||
* Correct error message for missing animation player ([82ebdc2](https://github.com/godot-escoria/escoria-demo-game/commit/82ebdc2d6e8e8d122bcb8bb65e97e79c7a9a9eb7))
|
||||
* Corrected error message for angle in esc_movable ([5f78c02](https://github.com/godot-escoria/escoria-demo-game/commit/5f78c026dac1511adebac931c1a9d537cc7f4103))
|
||||
* Debug message for when an item has no ESCLocation ([1709a25](https://github.com/godot-escoria/escoria-demo-game/commit/1709a25452ed3a1fc0359f2ffa836c68b7811d28))
|
||||
* debugging; possible expired token so switching for new one created by me ([1d69c30](https://github.com/godot-escoria/escoria-demo-game/commit/1d69c30eda26ced393bea24b547a0a9eab267df0))
|
||||
* Enabled playing of animated sprite by default ([cc0a067](https://github.com/godot-escoria/escoria-demo-game/commit/cc0a067b189e94b9b2ee503526c4f78b1d413682))
|
||||
* ensure tidiness ([95f849e](https://github.com/godot-escoria/escoria-demo-game/commit/95f849ed5238b1977f0c9843fa5d8bf6039d5086))
|
||||
* ensures proper number of interpolation placeholders ([68220ce](https://github.com/godot-escoria/escoria-demo-game/commit/68220ced91281e15b081283d2a11689a2153774d))
|
||||
* Fix bug where inventory is invisible by default ([c597414](https://github.com/godot-escoria/escoria-demo-game/commit/c597414659f4fadb72e4e8cde2fde0acb7d41c29))
|
||||
* Fix p_child is null exit on quit ([4604e00](https://github.com/godot-escoria/escoria-demo-game/commit/4604e006485f0f68c44ff056ab2aa785af6fc726))
|
||||
* forces current_state updates as options don't always yield ([0ba6c37](https://github.com/godot-escoria/escoria-demo-game/commit/0ba6c3782a06dea0fffc17e6fcb6e272fd54d5da))
|
||||
* Issue 336 - unclickable area with simplemouse ([cbb7984](https://github.com/godot-escoria/escoria-demo-game/commit/cbb79842d8b170a15153beb323bbd3b3a5505b3c))
|
||||
* Issue-333 Error when room has no Global ID set ([a5195ef](https://github.com/godot-escoria/escoria-demo-game/commit/a5195ef2fc9c362cdd1c90fdb3f01def7b0ff7f5))
|
||||
* makes 9verbs the default UI plugin ([14e5625](https://github.com/godot-escoria/escoria-demo-game/commit/14e5625bb572eff2fcdb0f410d77936ccd9f11b6))
|
||||
* missing this check to see if the item needs to be combined with something or not ([7f1add6](https://github.com/godot-escoria/escoria-demo-game/commit/7f1add6505189bb355a306a6b953e39952edc6d2))
|
||||
* Movable commands on non-movable items will be handled gracefully. ([0ea7b28](https://github.com/godot-escoria/escoria-demo-game/commit/0ea7b285b7e2d3831862910d9a84b3150d46dab9))
|
||||
* moves resource caching into _process method and out of a separate thread to avoid odd resource/RID loading issues, as noted here: https://github.com/godotengine/godot/issues/63493 ([cfbc3a5](https://github.com/godot-escoria/escoria-demo-game/commit/cfbc3a5c3137afb98a5ab12dddf8b2af7721b5a5))
|
||||
* necessary in order to prevent error message from printing out ([6842ed4](https://github.com/godot-escoria/escoria-demo-game/commit/6842ed48eaf13c21cc1bcce267848bda35723d27))
|
||||
* Populate default animation as the object manager expects it ([0610449](https://github.com/godot-escoria/escoria-demo-game/commit/0610449dbf4681e14e2ac07e02174e3e1b77e1e7))
|
||||
* Remove call to stop dialog to correct player mirroring ([6692953](https://github.com/godot-escoria/escoria-demo-game/commit/6692953385e1a96082b4dad676715de6f8a0d2c5))
|
||||
* removes type as ESCResourceCache checks the type of 'res' and can expect a non-Resource-derived value, e.g. ResourceInteractiveLoader ([16fd3d6](https://github.com/godot-escoria/escoria-demo-game/commit/16fd3d63011e9a18b9abb86a728b7b75bb6644f6))
|
||||
* updates various references to use new dialog manager code ([ffb6271](https://github.com/godot-escoria/escoria-demo-game/commit/ffb6271d0eccbe95c5be4377576d0288828f9f09))
|
||||
* uses proper casting and updates validation checks ([327b72f](https://github.com/godot-escoria/escoria-demo-game/commit/327b72f67b2a2358977c326d5a2f4516690cb911))
|
||||
* uses updated, non-expiring PAT although it's 'personal' and mine; the fix for the fanout issues involved resetting the repos that used 'core' as there was a divergence between the repos ([bf30156](https://github.com/godot-escoria/escoria-demo-game/commit/bf301565eb51409002fcdfaae2ef0890594b87b7))
|
||||
* Wizard - NPCs have to be ESCItems instead of ESCPlayers ([b0c0c5d](https://github.com/godot-escoria/escoria-demo-game/commit/b0c0c5d61b70bd0f24d62388deb1425333ac913f))
|
||||
* wrong argument passed in turn_to error message ([4e146ae](https://github.com/godot-escoria/escoria-demo-game/commit/4e146ae78ca137f3056668db55bd52e82af23ab7))
|
||||
|
||||
|
||||
|
||||
## [4.0.0-alpha.240](https://github.com/godot-escoria/escoria-demo-game/compare/v0.0.0...v4.0.0-alpha.240) (2022-12-15)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
# `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()
|
||||
)
|
||||
@@ -0,0 +1,47 @@
|
||||
# `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()
|
||||
)
|
||||
@@ -1,18 +1,11 @@
|
||||
# `hide_menu menu_type [enable_automatic_transition]`
|
||||
# `hide_menu menu_type`
|
||||
#
|
||||
# Hides either the main menu or the pause menu. The enable_automatic_transition
|
||||
# parameter can be used to specify if Escoria manages the graphical transition
|
||||
# for you or not.
|
||||
# Setting `enable_automatic_transition` to false allows you to manage the
|
||||
# transition effect for your room as it transitions in and out. Place a
|
||||
# `transition` command in the room's `setup` event to manage the look of the
|
||||
# transition in, and in the room's `exit_scene` event to manage the look of the
|
||||
# transition out.
|
||||
# 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`)
|
||||
# - *enable_automatic_transition*: Whether to automatically transition from the menu (default: `false`)
|
||||
#
|
||||
# @ESC
|
||||
extends ESCBaseCommand
|
||||
@@ -23,8 +16,8 @@ class_name HideMenuCommand
|
||||
func configure() -> ESCCommandArgumentDescriptor:
|
||||
return ESCCommandArgumentDescriptor.new(
|
||||
0,
|
||||
[TYPE_STRING, TYPE_BOOL],
|
||||
["main", false]
|
||||
[TYPE_STRING],
|
||||
["main"]
|
||||
)
|
||||
|
||||
|
||||
@@ -45,26 +38,26 @@ func validate(arguments: Array):
|
||||
# Run the command
|
||||
func run(command_params: Array) -> int:
|
||||
var transition_id: int
|
||||
if command_params[1]:
|
||||
# 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
|
||||
# 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 command_params[1] and escoria.main.current_scene != null:
|
||||
if escoria.main.current_scene != null:
|
||||
transition_id = escoria.main.scene_transition.transition()
|
||||
|
||||
if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
|
||||
|
||||
@@ -1,18 +1,11 @@
|
||||
# `show_menu menu_type [enable_automatic_transition]`
|
||||
# `show_menu menu_type`
|
||||
#
|
||||
# Shows either the main menu or the pause menu. The enable_automatic_transition
|
||||
# parameter can be used to specify if Escoria manages the graphical transition to
|
||||
# the menu or not.
|
||||
# Setting `enable_automatic_transition` to false allows you to manage the
|
||||
# transition effect for your menu as it transitions in and out. Place a
|
||||
# `transition` command in the menu's `setup` event to manage the look of the
|
||||
# transition in, and in the menu's `exit_scene` event to manage the look of the
|
||||
# transition out.
|
||||
# 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`)
|
||||
# - *enable_automatic_transition*: Whether to automatically transition to the menu (default: `false`)
|
||||
#
|
||||
# @ESC
|
||||
extends ESCBaseCommand
|
||||
@@ -23,8 +16,8 @@ class_name ShowMenuCommand
|
||||
func configure() -> ESCCommandArgumentDescriptor:
|
||||
return ESCCommandArgumentDescriptor.new(
|
||||
0,
|
||||
[TYPE_STRING, TYPE_BOOL],
|
||||
["main", false]
|
||||
[TYPE_STRING],
|
||||
["main"]
|
||||
)
|
||||
|
||||
|
||||
@@ -47,39 +40,33 @@ func run(command_params: Array) -> int:
|
||||
if not escoria.game_scene.is_inside_tree():
|
||||
escoria.add_child(escoria.game_scene)
|
||||
|
||||
if command_params[1]:
|
||||
# Transition out from current scene
|
||||
var transition_id = escoria.main.scene_transition.transition(
|
||||
"",
|
||||
ESCTransitionPlayer.TRANSITION_MODE.OUT
|
||||
)
|
||||
# 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 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()
|
||||
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()
|
||||
# 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
|
||||
else:
|
||||
if command_params[0] == "main":
|
||||
escoria.game_scene.show_main_menu()
|
||||
elif command_params[0] == "pause":
|
||||
escoria.game_scene.pause_game()
|
||||
if transition_id != ESCTransitionPlayer.TRANSITION_ID_INSTANT:
|
||||
while yield(
|
||||
escoria.main.scene_transition,
|
||||
"transition_done"
|
||||
) != transition_id:
|
||||
pass
|
||||
|
||||
return ESCExecution.RC_OK
|
||||
|
||||
|
||||
@@ -117,5 +117,6 @@ func interrupt():
|
||||
tween.stop_all()
|
||||
|
||||
|
||||
func _on_tween_completed(tween: Tween):
|
||||
tween.queue_free()
|
||||
func _on_tween_completed(tween: Tween, _key: NodePath):
|
||||
if tween:
|
||||
tween.queue_free()
|
||||
|
||||
@@ -75,11 +75,6 @@ var action_state = ACTION_INPUT_STATE.AWAITING_VERB_OR_ITEM \
|
||||
#
|
||||
# - 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:
|
||||
|
||||
@@ -121,6 +121,12 @@ func register_object(object: ESCObject, room: ESCRoom = null, force: bool = fals
|
||||
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
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ func change_scene(room_path: String, enable_automatic_transitions: bool) -> void
|
||||
if escoria.dialog_player:
|
||||
escoria.dialog_player.interrupt()
|
||||
|
||||
escoria.inputs_manager.hover_stack_clear()
|
||||
escoria.inputs_manager.hover_stack.clear()
|
||||
|
||||
# Check if game scene was loaded
|
||||
if not escoria.game_scene:
|
||||
|
||||
@@ -39,7 +39,7 @@ func run() -> int:
|
||||
if _is_interrupted:
|
||||
final_rc = ESCExecution.RC_INTERRUPTED
|
||||
statement.interrupt()
|
||||
emit_signal("interrupted", self, final_rc)
|
||||
emit_signal("interrupted", self, statement, final_rc)
|
||||
return final_rc
|
||||
|
||||
if statement.is_valid():
|
||||
|
||||
@@ -74,6 +74,10 @@ func _enter_tree():
|
||||
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)
|
||||
|
||||
|
||||
@@ -46,6 +46,9 @@ var tooltip_node: Object
|
||||
# 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():
|
||||
@@ -59,13 +62,21 @@ func _enter_tree():
|
||||
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():
|
||||
|
||||
@@ -300,7 +300,7 @@ func _ready():
|
||||
# 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.hover_stack.erase_item(self)
|
||||
escoria.inputs_manager.unset_hovered_node(self)
|
||||
|
||||
|
||||
@@ -321,7 +321,7 @@ class HoverStackSorter:
|
||||
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: 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") \
|
||||
@@ -331,8 +331,8 @@ func _on_input_event(_viewport: Object, event: InputEvent, _shape_idx: int):
|
||||
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.hover_stack.clear()
|
||||
escoria.inputs_manager.hover_stack.add_items(colliding_nodes)
|
||||
escoria.inputs_manager.set_hovered_node(colliding_nodes.back())
|
||||
|
||||
|
||||
@@ -587,7 +587,7 @@ func teleport_to(target: Vector2) -> void:
|
||||
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
|
||||
@@ -603,7 +603,7 @@ func walk_to(pos: Vector2, p_walk_context: ESCWalkContext = null) -> void:
|
||||
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,
|
||||
@@ -667,7 +667,7 @@ func set_angle(deg: int, wait: float = 0.0):
|
||||
escoria.logger.warn(
|
||||
self,
|
||||
"Node %s cannot use \"set_angle\". Its \"is_movable\" parameter is false." % self
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
# Turn to face another object
|
||||
@@ -718,13 +718,13 @@ func check_talk_possible():
|
||||
)
|
||||
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():
|
||||
@@ -744,7 +744,7 @@ func start_talking():
|
||||
func stop_talking():
|
||||
if not check_talk_possible():
|
||||
return
|
||||
|
||||
|
||||
var animation_player = get_animation_player()
|
||||
|
||||
if animation_player.is_playing():
|
||||
|
||||
@@ -3,15 +3,23 @@
|
||||
# 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
|
||||
export(bool) var is_start_location = false setget set_is_start_location
|
||||
|
||||
# If true, player orients towards 'interaction_direction' as
|
||||
# player character arrives.
|
||||
@@ -22,6 +30,9 @@ export(bool) var player_orients_on_arrival = true
|
||||
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.
|
||||
#
|
||||
@@ -34,10 +45,36 @@ func is_class(p_classname: String) -> bool:
|
||||
|
||||
# Ready function
|
||||
func _ready():
|
||||
if not self.global_id.empty():
|
||||
escoria.object_manager.register_object(
|
||||
ESCObject.new(
|
||||
self.global_id,
|
||||
self
|
||||
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")
|
||||
|
||||
@@ -1,47 +1,24 @@
|
||||
# A cache for resources
|
||||
extends Reference
|
||||
extends Node
|
||||
class_name ESCResourceCache
|
||||
|
||||
var thread: Thread
|
||||
var mutex: Mutex
|
||||
var sem: Semaphore
|
||||
|
||||
var queue: Array = []
|
||||
var pending: Dictionary = {}
|
||||
|
||||
signal resource_loading_progress(path, progress)
|
||||
signal resource_loading_done(path)
|
||||
signal resource_queue_progress(queue_size)
|
||||
|
||||
|
||||
#warning-ignore:unused_argument
|
||||
func _lock(caller):
|
||||
mutex.lock()
|
||||
|
||||
#warning-ignore:unused_argument
|
||||
func _unlock(caller):
|
||||
mutex.unlock()
|
||||
|
||||
#warning-ignore:unused_argument
|
||||
func _post(caller):
|
||||
sem.post()
|
||||
|
||||
#warning-ignore:unused_argument
|
||||
func _wait(caller):
|
||||
sem.wait()
|
||||
var queue: Array = []
|
||||
var pending: Dictionary = {}
|
||||
|
||||
|
||||
func queue_resource(path: String, p_in_front: bool = false, p_permanent: bool = false):
|
||||
_lock("queue_resource")
|
||||
if path in pending:
|
||||
_unlock("queue_resource")
|
||||
return
|
||||
|
||||
elif ResourceLoader.has(path):
|
||||
var res = ResourceLoader.load(path)
|
||||
pending[path] = ESCResourceDescriptor.new(res, p_permanent)
|
||||
_unlock("queue_resource")
|
||||
return
|
||||
else:
|
||||
var res = ResourceLoader.load_interactive(path)
|
||||
res.set_meta("path", path)
|
||||
@@ -50,21 +27,16 @@ func queue_resource(path: String, p_in_front: bool = false, p_permanent: bool =
|
||||
else:
|
||||
queue.push_back(res)
|
||||
pending[path] = ESCResourceDescriptor.new(res, p_permanent)
|
||||
_post("queue_resource")
|
||||
_unlock("queue_resource")
|
||||
return
|
||||
|
||||
|
||||
func cancel_resource(path):
|
||||
_lock("cancel_resource")
|
||||
if path in pending:
|
||||
if pending[path].res is ResourceInteractiveLoader:
|
||||
queue.erase(pending[path].res)
|
||||
pending.erase(path)
|
||||
_unlock("cancel_resource")
|
||||
|
||||
|
||||
func clear():
|
||||
_lock("clear")
|
||||
|
||||
for p in pending.keys():
|
||||
if pending[p].permanent:
|
||||
continue
|
||||
@@ -72,11 +44,8 @@ func clear():
|
||||
#queue = []
|
||||
#pending = {}
|
||||
|
||||
_unlock("clear")
|
||||
|
||||
|
||||
func get_progress(path):
|
||||
_lock("get_progress")
|
||||
var ret = -1
|
||||
if path in pending:
|
||||
if pending[path].res is ResourceInteractiveLoader:
|
||||
@@ -85,36 +54,32 @@ func get_progress(path):
|
||||
ret = 1.0
|
||||
emit_signal("resource_loading_done", path)
|
||||
emit_signal("resource_loading_progress", path, ret)
|
||||
_unlock("get_progress")
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
func is_ready(path):
|
||||
var ret
|
||||
_lock("is_ready")
|
||||
|
||||
if path in pending:
|
||||
ret = !(pending[path].res is ResourceInteractiveLoader)
|
||||
else:
|
||||
ret = false
|
||||
|
||||
_unlock("is_ready")
|
||||
|
||||
return ret
|
||||
|
||||
|
||||
func _wait_for_resource(res, path):
|
||||
_unlock("wait_for_resource")
|
||||
while true:
|
||||
#VisualServer.call("sync") # workaround because sync is a keyword
|
||||
VisualServer.force_sync()
|
||||
OS.delay_usec(16000) # wait 1 frame
|
||||
_lock("wait_for_resource")
|
||||
|
||||
if queue.size() == 0 || queue[0] != res:
|
||||
return pending[path].res
|
||||
_unlock("wait_for_resource")
|
||||
|
||||
|
||||
func get_resource(path):
|
||||
_lock("get_resource")
|
||||
if path in pending:
|
||||
if pending[path].res is ResourceInteractiveLoader:
|
||||
var res = pending[path].res
|
||||
@@ -127,17 +92,16 @@ func get_resource(path):
|
||||
|
||||
if !pending[path].permanent:
|
||||
pending.erase(path)
|
||||
_unlock("return")
|
||||
|
||||
return res
|
||||
|
||||
else:
|
||||
var res = pending[path].res
|
||||
if !pending[path].permanent:
|
||||
pending.erase(path)
|
||||
_unlock("return")
|
||||
|
||||
return res
|
||||
else:
|
||||
_unlock("return")
|
||||
# We can't use ESCProjectSettingsManager here since this method
|
||||
# can be called from escoria._init()
|
||||
if not ProjectSettings.get_setting("escoria/platform/skip_cache"):
|
||||
@@ -146,17 +110,32 @@ func get_resource(path):
|
||||
return res
|
||||
return ResourceLoader.load(path)
|
||||
|
||||
func thread_process():
|
||||
_wait("thread_process")
|
||||
|
||||
_lock("process")
|
||||
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]
|
||||
|
||||
_unlock("process_poll")
|
||||
var ret = res.poll()
|
||||
_lock("process_check_queue")
|
||||
|
||||
var path = res.get_meta("path")
|
||||
if ret == ERR_FILE_EOF || ret != OK:
|
||||
@@ -166,33 +145,3 @@ func thread_process():
|
||||
|
||||
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())
|
||||
|
||||
get_progress(path)
|
||||
|
||||
_unlock("process")
|
||||
|
||||
#warning-ignore:unused_argument
|
||||
func thread_func(u):
|
||||
while true:
|
||||
thread_process()
|
||||
|
||||
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():
|
||||
mutex = Mutex.new()
|
||||
sem = Semaphore.new()
|
||||
thread = Thread.new()
|
||||
thread.start(self, "thread_func", 0)
|
||||
|
||||
|
||||
## 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")
|
||||
|
||||
@@ -12,6 +12,8 @@ enum EditorRoomDebugDisplay {
|
||||
CAMERA_LIMITS
|
||||
}
|
||||
|
||||
const ESC_BACKGROUND_NAME = "escbackground"
|
||||
|
||||
|
||||
# The global id of this room
|
||||
export(String) var global_id = ""
|
||||
@@ -66,8 +68,26 @@ func _ready():
|
||||
) != self.filename:
|
||||
is_run_directly = true
|
||||
|
||||
if not Engine.is_editor_hint():
|
||||
escoria.room_manager.init_room(self)
|
||||
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
|
||||
@@ -97,6 +117,56 @@ func _draw():
|
||||
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
|
||||
|
||||
@@ -4,12 +4,12 @@ class_name ESCResourceDescriptor
|
||||
|
||||
|
||||
# The resource being described
|
||||
var res: Resource
|
||||
var res
|
||||
|
||||
# Whether the resource is permanent
|
||||
var permanent: bool
|
||||
|
||||
|
||||
func _init(res_in: Resource, permanent_in: bool) -> void:
|
||||
func _init(res_in, permanent_in: bool) -> void:
|
||||
res = res_in
|
||||
permanent = permanent_in
|
||||
|
||||
@@ -30,7 +30,7 @@ const ESC_UI_PRIMARY_ACTION = "esc_ui_primary_action"
|
||||
var input_mode = INPUT_ALL
|
||||
|
||||
# A LIFO stack of hovered items
|
||||
var hover_stack: Array = []
|
||||
var hover_stack: HoverStack
|
||||
|
||||
# The global id of the topmost item from the hover_stack
|
||||
var hotspot_focused: String = ""
|
||||
@@ -55,6 +55,8 @@ 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
|
||||
@@ -175,22 +177,12 @@ func try_custom_input_handler(event: InputEvent, is_default_state: bool) -> bool
|
||||
return false
|
||||
|
||||
|
||||
|
||||
# Unsets the hovered node.
|
||||
#
|
||||
# **Parameters**
|
||||
#
|
||||
# - item: the item that was unfocused (mouse_exited)
|
||||
func unset_hovered_node(item: ESCItem):
|
||||
if _hovered_element == item:
|
||||
_hovered_element.mouse_exited()
|
||||
_hovered_element = null
|
||||
if hover_stack:
|
||||
set_hovered_node(hover_stack.pop_back())
|
||||
else:
|
||||
hotspot_focused = ""
|
||||
|
||||
|
||||
# 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
|
||||
@@ -203,6 +195,12 @@ func unset_hovered_node(item: ESCItem):
|
||||
# **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 \
|
||||
@@ -211,7 +209,7 @@ func set_hovered_node(item: ESCItem) -> bool:
|
||||
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.back() != item:
|
||||
if not is_instance_valid(_hovered_element) or hover_stack.get_top_item() != item:
|
||||
_hovered_element = item
|
||||
_hovered_element.mouse_entered()
|
||||
return true
|
||||
@@ -220,6 +218,20 @@ func set_hovered_node(item: ESCItem) -> bool:
|
||||
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
|
||||
@@ -366,7 +378,7 @@ func _on_mouse_entered_item(item: ESCItem) -> void:
|
||||
hotspot_focused = ""
|
||||
escoria.main.current_scene.game.element_unfocused()
|
||||
else:
|
||||
hotspot_focused = hover_stack.back().global_id
|
||||
hotspot_focused = hover_stack.get_top_item().global_id
|
||||
escoria.main.current_scene.game.element_focused(hotspot_focused)
|
||||
return
|
||||
|
||||
@@ -394,7 +406,7 @@ func _on_mouse_entered_item(item: ESCItem) -> void:
|
||||
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)
|
||||
hover_stack.erase_item(item)
|
||||
escoria.main.current_scene.game.element_unfocused()
|
||||
return
|
||||
|
||||
@@ -413,7 +425,7 @@ func _on_mouse_exited_item(item: ESCItem) -> void:
|
||||
hotspot_focused = ""
|
||||
escoria.main.current_scene.game.element_unfocused()
|
||||
else:
|
||||
hotspot_focused = hover_stack.back().global_id
|
||||
hotspot_focused = hover_stack.get_top_item().global_id
|
||||
escoria.main.current_scene.game.element_focused(hotspot_focused)
|
||||
|
||||
|
||||
@@ -426,13 +438,13 @@ func _on_mouse_exited_item(item: ESCItem) -> void:
|
||||
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)
|
||||
hover_stack.erase_item(item)
|
||||
escoria.main.current_scene.game.element_unfocused()
|
||||
hover_stack.sort_custom(HoverStackSorter, "sort_ascending_z_index")
|
||||
|
||||
if hover_stack.empty():
|
||||
return
|
||||
else:
|
||||
var new_item = hover_stack.back()
|
||||
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()
|
||||
|
||||
@@ -454,7 +466,7 @@ func _on_mouse_left_clicked_item(item: ESCItem, event: InputEvent) -> void:
|
||||
|
||||
# Get next object in hover stack and forward event to it
|
||||
if not hover_stack.empty():
|
||||
var next_item = hover_stack.pop_back()
|
||||
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 = ""
|
||||
@@ -498,7 +510,7 @@ func _on_mouse_left_double_clicked_item(
|
||||
|
||||
# Get next object in hover stack and forward event to it
|
||||
if not hover_stack.empty():
|
||||
var next_item = hover_stack.pop_back()
|
||||
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 = ""
|
||||
@@ -536,7 +548,7 @@ func _on_mouse_right_clicked_item(item: ESCItem, event: InputEvent) -> void:
|
||||
)
|
||||
|
||||
if not hover_stack.empty():
|
||||
var next_item = hover_stack.pop_back()
|
||||
var next_item = hover_stack.pop_top_item()
|
||||
_on_mouse_right_clicked_item(next_item, event)
|
||||
return
|
||||
|
||||
@@ -553,7 +565,7 @@ func _on_mouse_right_clicked_item(item: ESCItem, event: InputEvent) -> void:
|
||||
# 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.back()
|
||||
actual_item = hover_stack.get_top_item()
|
||||
else:
|
||||
actual_item = item
|
||||
|
||||
@@ -594,51 +606,121 @@ func _on_pause_menu_requested():
|
||||
escoria.main.current_scene.game.pause_game()
|
||||
|
||||
|
||||
# Add the given item to the stack if not already in it.
|
||||
#
|
||||
# #### Parameters
|
||||
# - item: the item to add to the hover stack
|
||||
func hover_stack_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)
|
||||
# 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")
|
||||
|
||||
|
||||
# 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 hover_stack_add_items(items: Array):
|
||||
for item in items:
|
||||
if escoria.action_manager.is_object_actionable(item.global_id):
|
||||
hover_stack_add_item(item)
|
||||
# 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)
|
||||
|
||||
|
||||
# Clean the hover stack
|
||||
func _clean_hover_stack():
|
||||
for e in hover_stack:
|
||||
if e == null or !is_instance_valid(e):
|
||||
hover_stack.erase(e)
|
||||
# Returns the hover stack array
|
||||
#
|
||||
# **Returns**
|
||||
# The hover stack array
|
||||
func get_all() -> Array:
|
||||
return hover_stack
|
||||
|
||||
|
||||
# Remove the given item from the stack
|
||||
#
|
||||
# #### Parameters
|
||||
# - item: the item to remove from the hover stack
|
||||
func hover_stack_erase_item(item):
|
||||
hover_stack.erase(item)
|
||||
hover_stack.sort_custom(HoverStackSorter, "sort_ascending_z_index")
|
||||
|
||||
|
||||
# Clear the stack of hovered items
|
||||
func hover_stack_clear():
|
||||
hover_stack = []
|
||||
|
||||
|
||||
class HoverStackSorter:
|
||||
static func sort_ascending_z_index(a, b):
|
||||
if a.z_index < b.z_index:
|
||||
return true
|
||||
return false
|
||||
# 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
|
||||
|
||||
@@ -37,12 +37,15 @@ 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"
|
||||
|
||||
@@ -25,7 +25,6 @@ func _init():
|
||||
escoria.object_manager = ESCObjectManager.new()
|
||||
escoria.command_registry = ESCCommandRegistry.new()
|
||||
escoria.resource_cache = ESCResourceCache.new()
|
||||
escoria.resource_cache.start()
|
||||
escoria.save_manager = ESCSaveManager.new()
|
||||
escoria.inputs_manager = ESCInputsManager.new()
|
||||
escoria.settings_manager = ESCSettingsManager.new()
|
||||
@@ -45,6 +44,8 @@ func _init():
|
||||
|
||||
# Load settings
|
||||
func _ready():
|
||||
add_child(escoria.resource_cache)
|
||||
|
||||
_handle_direct_scene_run()
|
||||
|
||||
escoria.settings_manager.load_settings()
|
||||
|
||||
@@ -4,7 +4,6 @@
|
||||
[ext_resource path="res://addons/escoria-core/game/escoria.gd" type="Script" id=3]
|
||||
|
||||
[node name="escoria_scene" type="Node"]
|
||||
pause_mode = 2
|
||||
script = ExtResource( 3 )
|
||||
|
||||
[node name="main" parent="." instance=ExtResource( 2 )]
|
||||
|
||||
@@ -46,13 +46,35 @@ 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
|
||||
func choose(dialog_player: Node, dialog: ESCDialog):
|
||||
# - type: The dialog chooser type to use
|
||||
func choose(dialog_player: Node, dialog: ESCDialog, type: String):
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
# Escoria dialog player
|
||||
extends StateMachine
|
||||
extends Node
|
||||
class_name ESCDialogPlayer
|
||||
|
||||
|
||||
@@ -14,8 +14,20 @@ signal option_chosen(option)
|
||||
signal say_finished
|
||||
|
||||
|
||||
# Reference to the currently playing dialog manager
|
||||
var _dialog_manager: ESCDialogManager = null
|
||||
# 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
|
||||
@@ -25,38 +37,27 @@ func _ready():
|
||||
|
||||
escoria.dialog_player = self
|
||||
|
||||
_create_states()
|
||||
_add_states_to_machine()
|
||||
|
||||
states_map["say"].connect("dialog_manager_set", self, "_on_dialog_manager_set")
|
||||
|
||||
current_state_name = "idle"
|
||||
START_STATE = states_map[current_state_name]
|
||||
|
||||
initialize(START_STATE)
|
||||
# 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
|
||||
|
||||
|
||||
# Creates the states for this state machine.
|
||||
func _create_states() -> void:
|
||||
states_map = {
|
||||
"idle": DialogIdle.new(),
|
||||
"say": DialogSay.new(),
|
||||
"say_fast": DialogSayFast.new(),
|
||||
"say_finish": DialogSayFinish.new(),
|
||||
"visible": DialogVisible.new(),
|
||||
"finish": DialogFinish.new(),
|
||||
"interrupt": DialogInterrupt.new(),
|
||||
"choices": DialogChoices.new(),
|
||||
}
|
||||
|
||||
# This state needs a reference to this class.
|
||||
states_map["finish"].initialize(self)
|
||||
|
||||
|
||||
# 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])
|
||||
# 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
|
||||
@@ -67,18 +68,19 @@ func _add_states_to_machine() -> void:
|
||||
# - type: UI to use for the dialog
|
||||
# - text: Text to say
|
||||
func say(character: String, type: String, text: String) -> void:
|
||||
states_map["say"].initialize(character, type, text)
|
||||
_change_state("say")
|
||||
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)
|
||||
|
||||
# Called when a dialogue line is to be sped up.
|
||||
func speedup() -> void:
|
||||
_change_state("say_fast")
|
||||
if _block_say_enabled:
|
||||
_say_dialog_manager.enable_preserve_dialog_box()
|
||||
|
||||
|
||||
# Called when a dialogue line is to be finished immediately.
|
||||
func finish() -> void:
|
||||
_change_state("say_finish")
|
||||
_say_dialog_manager.say(self, character, text, type)
|
||||
|
||||
|
||||
# Display a list of choices
|
||||
@@ -86,22 +88,111 @@ func finish() -> void:
|
||||
# #### Parameters
|
||||
#
|
||||
# - dialog: The dialog to start
|
||||
# - type: The dialog chooser type to use (default: "simple")
|
||||
func start_dialog_choices(dialog: ESCDialog, type: String = "simple"):
|
||||
states_map["choices"].initialize(self, dialog, type)
|
||||
_change_state("choices")
|
||||
# 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:
|
||||
_change_state("interrupt")
|
||||
if is_instance_valid(_say_dialog_manager):
|
||||
_say_dialog_manager.interrupt()
|
||||
|
||||
|
||||
# Since the dialog manager is determined when a `say` command is performed and
|
||||
# other states need to know which one was picked, we notify the necessary states
|
||||
# via this method.
|
||||
func _on_dialog_manager_set(dialog_manager: ESCDialogManager) -> void:
|
||||
_dialog_manager = dialog_manager
|
||||
states_map["say_fast"].initialize(dialog_manager)
|
||||
states_map["say_finish"].initialize(dialog_manager)
|
||||
states_map["visible"].initialize(dialog_manager)
|
||||
states_map["interrupt"].initialize(dialog_manager)
|
||||
# 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
|
||||
|
||||
@@ -302,6 +302,14 @@ func set_escoria_debug_settings():
|
||||
}
|
||||
)
|
||||
|
||||
register_setting(
|
||||
ESCProjectSettingsManager.ENABLE_HOVER_STACK_VIEWER,
|
||||
false,
|
||||
{
|
||||
"type": TYPE_BOOL
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
# Prepare the settings in the Escoria sound settings
|
||||
func set_escoria_sound_settings():
|
||||
|
||||
@@ -81,6 +81,13 @@ func _on_inventory_item_gui_input(event: InputEvent):
|
||||
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:
|
||||
|
||||
@@ -7,6 +7,9 @@
|
||||
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="."]
|
||||
@@ -29,7 +32,7 @@ __meta__ = {
|
||||
|
||||
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
|
||||
margin_right = 623.0
|
||||
margin_bottom = 276.0
|
||||
margin_bottom = 336.0
|
||||
size_flags_vertical = 3
|
||||
scroll_horizontal_enabled = false
|
||||
__meta__ = {
|
||||
@@ -38,7 +41,7 @@ __meta__ = {
|
||||
|
||||
[node name="slots" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"]
|
||||
margin_right = 623.0
|
||||
margin_bottom = 276.0
|
||||
margin_bottom = 336.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
__meta__ = {
|
||||
@@ -46,9 +49,9 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="back" type="Button" parent="VBoxContainer"]
|
||||
margin_top = 280.0
|
||||
margin_top = 340.0
|
||||
margin_right = 623.0
|
||||
margin_bottom = 300.0
|
||||
margin_bottom = 360.0
|
||||
text = "OPTIONS_BACK"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
|
||||
@@ -14,7 +14,7 @@ func _on_load_game_pressed():
|
||||
$load_game.show()
|
||||
|
||||
|
||||
# Show the optiset_gui_visible trueons panel
|
||||
# Show the options panel
|
||||
func _on_options_pressed():
|
||||
$main.hide()
|
||||
$options.show()
|
||||
|
||||
@@ -9,6 +9,9 @@
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="load_game" parent="." instance=ExtResource( 5 )]
|
||||
visible = false
|
||||
@@ -41,18 +44,18 @@ __meta__ = {
|
||||
}
|
||||
|
||||
[node name="TextureRect" type="TextureRect" parent="main/main"]
|
||||
margin_top = 92.0
|
||||
margin_top = 162.0
|
||||
margin_right = 616.0
|
||||
margin_bottom = 318.0
|
||||
margin_bottom = 398.0
|
||||
texture = ExtResource( 3 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="buttons" type="VBoxContainer" parent="main/main"]
|
||||
margin_top = 418.0
|
||||
margin_top = 498.0
|
||||
margin_right = 616.0
|
||||
margin_bottom = 658.0
|
||||
margin_bottom = 738.0
|
||||
custom_constants/separation = 10
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
|
||||
@@ -25,9 +25,9 @@ __meta__ = {
|
||||
|
||||
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer"]
|
||||
margin_left = 391.0
|
||||
margin_top = 265.0
|
||||
margin_top = 340.0
|
||||
margin_right = 888.0
|
||||
margin_bottom = 460.0
|
||||
margin_bottom = 535.0
|
||||
size_flags_horizontal = 6
|
||||
custom_constants/margin_right = 20
|
||||
custom_constants/margin_top = 20
|
||||
@@ -144,9 +144,9 @@ margin_right = 457.0
|
||||
margin_bottom = 155.0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
|
||||
margin_top = 464.0
|
||||
margin_top = 539.0
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 404.0
|
||||
margin_bottom = 500
|
||||
custom_constants/separation = 20
|
||||
alignment = 1
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
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)
|
||||
@@ -0,0 +1,27 @@
|
||||
[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
|
||||
@@ -1,14 +1,28 @@
|
||||
# A simple dialog manager for Escoria
|
||||
extends ESCDialogManager
|
||||
class_name ESCDialogSimple
|
||||
|
||||
|
||||
# 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
|
||||
@@ -30,6 +44,31 @@ 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.
|
||||
#
|
||||
@@ -42,6 +81,40 @@ func has_chooser_type(type: String) -> bool:
|
||||
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"\
|
||||
@@ -51,21 +124,26 @@ func say(dialog_player: Node, global_id: String, text: String, type: String):
|
||||
"res://addons/escoria-dialog-simple/types/avatar.tscn"\
|
||||
).instance()
|
||||
|
||||
_type_player.connect("say_finished", self, "_on_say_finished", [], CONNECT_ONESHOT)
|
||||
_type_player.connect("say_visible", self, "_on_say_visible", [], CONNECT_ONESHOT)
|
||||
_type_player.connect("say_finished", self, "_on_say_finished")
|
||||
_type_player.connect("say_visible", self, "_on_say_visible")
|
||||
|
||||
_dialog_player.add_child(_type_player)
|
||||
_type_player.say(global_id, text)
|
||||
# yield(_type_player, "say_finished")
|
||||
# if _dialog_player.get_children().has(_type_player):
|
||||
# _dialog_player.remove_child(_type_player)
|
||||
# emit_signal("say_finished")
|
||||
|
||||
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 _dialog_player.get_children().has(_type_player):
|
||||
if not _should_preserve_dialog_box and _dialog_player.get_children().has(_type_player):
|
||||
_dialog_player.remove_child(_type_player)
|
||||
emit_signal("say_finished")
|
||||
|
||||
_is_saying = false
|
||||
|
||||
emit_signal("say_finished")
|
||||
|
||||
|
||||
func _on_say_visible():
|
||||
@@ -78,13 +156,26 @@ func _on_say_visible():
|
||||
# #### Parameters
|
||||
# - dialog_player: Node of the dialog player in the UI
|
||||
# - dialog: Information about the dialog to display
|
||||
func choose(dialog_player: Node, dialog: ESCDialog):
|
||||
var chooser = preload(\
|
||||
"res://addons/escoria-dialog-simple/chooser/simple.tscn"\
|
||||
).instance()
|
||||
# - 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)
|
||||
@@ -92,13 +183,13 @@ func choose(dialog_player: Node, dialog: ESCDialog):
|
||||
|
||||
# Trigger running the dialogue faster
|
||||
func speedup():
|
||||
if _type_player != null:
|
||||
if is_instance_valid(_type_player):
|
||||
_type_player.speedup()
|
||||
|
||||
|
||||
# Trigger an instant finish of the current dialog
|
||||
func finish():
|
||||
if _type_player != null:
|
||||
if is_instance_valid(_type_player):
|
||||
_type_player.finish()
|
||||
|
||||
|
||||
@@ -110,11 +201,13 @@ func interrupt():
|
||||
as ESCSpeechPlayer
|
||||
).set_state("off")
|
||||
|
||||
_dialog_player.remove_child(_type_player)
|
||||
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 _type_player != null:
|
||||
if is_instance_valid(_type_player):
|
||||
_type_player.voice_audio_finished()
|
||||
|
||||
20
addons/escoria-dialog-simple/esc_dialog_simple_settings.gd
Normal file
@@ -0,0 +1,20 @@
|
||||
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"
|
||||
@@ -0,0 +1,31 @@
|
||||
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])
|
||||
31
addons/escoria-dialog-simple/patterns/state_machine/state.gd
Normal file
@@ -0,0 +1,31 @@
|
||||
"""
|
||||
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
|
||||
@@ -0,0 +1,92 @@
|
||||
"""
|
||||
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
|
||||
@@ -1,26 +1,8 @@
|
||||
# A simple dialog manager for Escoria
|
||||
tool
|
||||
extends EditorPlugin
|
||||
class_name SimpleDialogPlugin
|
||||
|
||||
|
||||
const MANAGER_CLASS="res://addons/escoria-dialog-simple/esc_dialog_simple.gd"
|
||||
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"
|
||||
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
|
||||
@@ -28,14 +10,14 @@ const TEXT_TIME_PER_LETTER_MS_FAST_DEFAULT_VALUE = 25
|
||||
|
||||
|
||||
var left_click_actions: PoolStringArray = [
|
||||
LEFT_CLICK_ACTION_SPEED_UP,
|
||||
LEFT_CLICK_ACTION_INSTANT_FINISH,
|
||||
LEFT_CLICK_ACTION_NOTHING
|
||||
SimpleDialogSettings.LEFT_CLICK_ACTION_SPEED_UP,
|
||||
SimpleDialogSettings.LEFT_CLICK_ACTION_INSTANT_FINISH,
|
||||
SimpleDialogSettings.LEFT_CLICK_ACTION_NOTHING
|
||||
]
|
||||
|
||||
var stop_talking_animation_on_options: PoolStringArray = [
|
||||
STOP_TALKING_ANIMATION_ON_END_OF_TEXT,
|
||||
STOP_TALKING_ANIMATION_ON_END_OF_AUDIO
|
||||
SimpleDialogSettings.STOP_TALKING_ANIMATION_ON_END_OF_TEXT,
|
||||
SimpleDialogSettings.STOP_TALKING_ANIMATION_ON_END_OF_AUDIO
|
||||
]
|
||||
|
||||
|
||||
@@ -52,31 +34,31 @@ func disable_plugin():
|
||||
)
|
||||
|
||||
ESCProjectSettingsManager.remove_setting(
|
||||
AVATARS_PATH
|
||||
SimpleDialogSettings.AVATARS_PATH
|
||||
)
|
||||
|
||||
ESCProjectSettingsManager.remove_setting(
|
||||
TEXT_TIME_PER_LETTER_MS
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS
|
||||
)
|
||||
|
||||
ESCProjectSettingsManager.remove_setting(
|
||||
TEXT_TIME_PER_LETTER_MS_FAST
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST
|
||||
)
|
||||
|
||||
ESCProjectSettingsManager.remove_setting(
|
||||
CLEAR_TEXT_BY_CLICK_ONLY
|
||||
SimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY
|
||||
)
|
||||
|
||||
ESCProjectSettingsManager.remove_setting(
|
||||
READING_SPEED_IN_WPM
|
||||
SimpleDialogSettings.READING_SPEED_IN_WPM
|
||||
)
|
||||
|
||||
ESCProjectSettingsManager.remove_setting(
|
||||
LEFT_CLICK_ACTION
|
||||
SimpleDialogSettings.LEFT_CLICK_ACTION
|
||||
)
|
||||
|
||||
ESCProjectSettingsManager.remove_setting(
|
||||
STOP_TALKING_ANIMATION_ON
|
||||
SimpleDialogSettings.STOP_TALKING_ANIMATION_ON
|
||||
)
|
||||
|
||||
EscoriaPlugin.deregister_dialog_manager(MANAGER_CLASS)
|
||||
@@ -96,7 +78,7 @@ func enable_plugin():
|
||||
)
|
||||
|
||||
ESCProjectSettingsManager.register_setting(
|
||||
AVATARS_PATH,
|
||||
SimpleDialogSettings.AVATARS_PATH,
|
||||
"res://game/dialog_avatars",
|
||||
{
|
||||
"type": TYPE_STRING,
|
||||
@@ -105,7 +87,7 @@ func enable_plugin():
|
||||
)
|
||||
|
||||
ESCProjectSettingsManager.register_setting(
|
||||
TEXT_TIME_PER_LETTER_MS,
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS,
|
||||
TEXT_TIME_PER_LETTER_MS_DEFAULT_VALUE,
|
||||
{
|
||||
"type": TYPE_REAL
|
||||
@@ -113,7 +95,7 @@ func enable_plugin():
|
||||
)
|
||||
|
||||
ESCProjectSettingsManager.register_setting(
|
||||
TEXT_TIME_PER_LETTER_MS_FAST,
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST,
|
||||
TEXT_TIME_PER_LETTER_MS_FAST_DEFAULT_VALUE,
|
||||
{
|
||||
"type": TYPE_REAL
|
||||
@@ -121,7 +103,7 @@ func enable_plugin():
|
||||
)
|
||||
|
||||
ESCProjectSettingsManager.register_setting(
|
||||
CLEAR_TEXT_BY_CLICK_ONLY,
|
||||
SimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY,
|
||||
false,
|
||||
{
|
||||
"type": TYPE_BOOL
|
||||
@@ -129,7 +111,7 @@ func enable_plugin():
|
||||
)
|
||||
|
||||
ESCProjectSettingsManager.register_setting(
|
||||
READING_SPEED_IN_WPM,
|
||||
SimpleDialogSettings.READING_SPEED_IN_WPM,
|
||||
READING_SPEED_IN_WPM_DEFAULT_VALUE,
|
||||
{
|
||||
"type": TYPE_INT
|
||||
@@ -139,8 +121,8 @@ func enable_plugin():
|
||||
var left_click_actions_string: String = left_click_actions.join(",")
|
||||
|
||||
ESCProjectSettingsManager.register_setting(
|
||||
LEFT_CLICK_ACTION,
|
||||
LEFT_CLICK_ACTION_SPEED_UP,
|
||||
SimpleDialogSettings.LEFT_CLICK_ACTION,
|
||||
SimpleDialogSettings.LEFT_CLICK_ACTION_SPEED_UP,
|
||||
{
|
||||
"type": TYPE_STRING,
|
||||
"hint": PROPERTY_HINT_ENUM,
|
||||
@@ -151,8 +133,8 @@ func enable_plugin():
|
||||
var stop_talking_animation_on_options_string: String = stop_talking_animation_on_options.join(",")
|
||||
|
||||
ESCProjectSettingsManager.register_setting(
|
||||
STOP_TALKING_ANIMATION_ON,
|
||||
STOP_TALKING_ANIMATION_ON_END_OF_AUDIO,
|
||||
SimpleDialogSettings.STOP_TALKING_ANIMATION_ON,
|
||||
SimpleDialogSettings.STOP_TALKING_ANIMATION_ON_END_OF_AUDIO,
|
||||
{
|
||||
"type": TYPE_STRING,
|
||||
"hint": PROPERTY_HINT_ENUM,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
extends State
|
||||
class_name DialogChoices
|
||||
extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
|
||||
|
||||
|
||||
# The owning dialog player.
|
||||
@@ -14,8 +13,9 @@ var _dialog_chooser_ui: ESCDialogManager = null
|
||||
var _ready_to_choose: bool
|
||||
|
||||
|
||||
func initialize(dialog_player, dialog: ESCDialog, type: String) -> void:
|
||||
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
|
||||
|
||||
@@ -29,27 +29,13 @@ func enter():
|
||||
"Received dialog options array was empty."
|
||||
)
|
||||
|
||||
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_chooser_ui = _manager
|
||||
|
||||
if _dialog_chooser_ui == null:
|
||||
escoria.logger.error(
|
||||
self,
|
||||
"No dialog manager supports the chooser type %s." % _type
|
||||
)
|
||||
|
||||
_ready_to_choose = true
|
||||
|
||||
|
||||
func update(_delta):
|
||||
if _ready_to_choose:
|
||||
_ready_to_choose = false
|
||||
_dialog_chooser_ui.choose(self, _dialog)
|
||||
_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'")
|
||||
@@ -1,5 +1,4 @@
|
||||
extends State
|
||||
class_name DialogFinish
|
||||
extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
|
||||
|
||||
|
||||
# Owning dialog player
|
||||
@@ -1,5 +1,4 @@
|
||||
extends State
|
||||
class_name DialogIdle
|
||||
extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
|
||||
|
||||
|
||||
func enter():
|
||||
@@ -1,5 +1,4 @@
|
||||
extends State
|
||||
class_name DialogInterrupt
|
||||
extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
|
||||
|
||||
|
||||
# Reference to the currently playing dialog manager
|
||||
@@ -15,7 +14,7 @@ func enter():
|
||||
|
||||
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", [], CONNECT_ONESHOT)
|
||||
_dialog_manager.connect("say_finished", self, "_on_say_finished")
|
||||
|
||||
_dialog_manager.interrupt()
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
extends State
|
||||
class_name DialogSay
|
||||
|
||||
|
||||
signal dialog_manager_set(dialog_manager)
|
||||
extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
|
||||
|
||||
|
||||
# A regular expression that separates the translation key from the text
|
||||
@@ -34,12 +30,13 @@ func _init() -> void:
|
||||
_keytext_regex.compile(KEYTEXT_REGEX)
|
||||
|
||||
|
||||
func initialize(character: String, type: String, text: String) -> void:
|
||||
func initialize(dialog_manager: ESCDialogManager, character: String, text: String, type: String) -> void:
|
||||
_dialog_manager = dialog_manager
|
||||
_character = character
|
||||
_type = type
|
||||
_text = text
|
||||
_type = type
|
||||
_stop_talking_animation_on_option = \
|
||||
ESCProjectSettingsManager.get_setting(SimpleDialogPlugin.STOP_TALKING_ANIMATION_ON)
|
||||
ESCProjectSettingsManager.get_setting(SimpleDialogSettings.STOP_TALKING_ANIMATION_ON)
|
||||
|
||||
|
||||
func handle_input(_event):
|
||||
@@ -48,20 +45,20 @@ func handle_input(_event):
|
||||
escoria.inputs_manager.INPUT_NONE and \
|
||||
_dialog_manager != null:
|
||||
|
||||
var left_click_action = ESCProjectSettingsManager.get_setting(SimpleDialogPlugin.LEFT_CLICK_ACTION)
|
||||
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:
|
||||
SimpleDialogPlugin.LEFT_CLICK_ACTION_SPEED_UP:
|
||||
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")
|
||||
SimpleDialogPlugin.LEFT_CLICK_ACTION_INSTANT_FINISH:
|
||||
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")
|
||||
|
||||
@@ -74,34 +71,8 @@ func _handle_left_click_action(left_click_action: String) -> void:
|
||||
func enter():
|
||||
escoria.logger.trace(self, "Dialog State Machine: Entered 'say'.")
|
||||
|
||||
if _type == "":
|
||||
_type = ESCProjectSettingsManager.get_setting(
|
||||
ESCProjectSettingsManager.DEFAULT_DIALOG_TYPE
|
||||
)
|
||||
|
||||
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 dialog_manager == null:
|
||||
escoria.logger.error(
|
||||
self,
|
||||
"No dialog manager called '%s' configured." % _type
|
||||
)
|
||||
|
||||
_dialog_manager = dialog_manager
|
||||
emit_signal("dialog_manager_set", dialog_manager)
|
||||
|
||||
if not _dialog_manager.is_connected("say_visible", self, "_on_say_visible"):
|
||||
_dialog_manager.connect("say_visible", self, "_on_say_visible", [], CONNECT_ONESHOT)
|
||||
_dialog_manager.connect("say_visible", self, "_on_say_visible")
|
||||
|
||||
var matches = _keytext_regex.search(_text)
|
||||
|
||||
@@ -129,11 +100,16 @@ func enter():
|
||||
as ESCSpeechPlayer
|
||||
).set_state(_speech_resource)
|
||||
|
||||
if _stop_talking_animation_on_option == SimpleDialogPlugin.STOP_TALKING_ANIMATION_ON_END_OF_AUDIO:
|
||||
(
|
||||
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.connect("finished", self, "_on_audio_finished", [], CONNECT_ONESHOT)
|
||||
).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"))
|
||||
|
||||
@@ -155,7 +131,7 @@ func enter():
|
||||
|
||||
func update(_delta):
|
||||
if _ready_to_say:
|
||||
_dialog_manager.say(self, _character, _text, _type)
|
||||
_dialog_manager.do_say(_character, _text)
|
||||
_ready_to_say = false
|
||||
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
extends State
|
||||
class_name DialogSayFast
|
||||
extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
|
||||
|
||||
|
||||
# Reference to the currently playing dialog manager
|
||||
@@ -18,7 +17,7 @@ func enter():
|
||||
_dialog_manager != null:
|
||||
|
||||
if not _dialog_manager.is_connected("say_visible", self, "_on_say_visible"):
|
||||
_dialog_manager.connect("say_visible", self, "_on_say_visible", [], CONNECT_ONESHOT)
|
||||
_dialog_manager.connect("say_visible", self, "_on_say_visible")
|
||||
|
||||
_dialog_manager.speedup()
|
||||
else:
|
||||
@@ -1,5 +1,4 @@
|
||||
extends State
|
||||
class_name DialogSayFinish
|
||||
extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
|
||||
|
||||
|
||||
# Reference to the currently playing dialog manager
|
||||
@@ -18,7 +17,7 @@ func enter():
|
||||
_dialog_manager != null:
|
||||
|
||||
if not _dialog_manager.is_connected("say_visible", self, "_on_say_visible"):
|
||||
_dialog_manager.connect("say_visible", self, "_on_say_visible", [], CONNECT_ONESHOT)
|
||||
_dialog_manager.connect("say_visible", self, "_on_say_visible")
|
||||
|
||||
_dialog_manager.finish()
|
||||
else:
|
||||
@@ -1,5 +1,4 @@
|
||||
extends State
|
||||
class_name DialogVisible
|
||||
extends "res://addons/escoria-dialog-simple/patterns/state_machine/state.gd"
|
||||
|
||||
|
||||
# Reference to the currently playing dialog manager
|
||||
@@ -14,7 +13,7 @@ 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", [], CONNECT_ONESHOT)
|
||||
_dialog_manager.connect("say_finished", self, "_on_say_finished")
|
||||
|
||||
|
||||
func handle_input(_event):
|
||||
@@ -47,7 +47,7 @@ onready var is_paused: bool = true
|
||||
# Build up the UI
|
||||
func _ready():
|
||||
_text_time_per_character = ProjectSettings.get_setting(
|
||||
SimpleDialogPlugin.TEXT_TIME_PER_LETTER_MS
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS
|
||||
)
|
||||
|
||||
if _text_time_per_character < 0:
|
||||
@@ -55,15 +55,15 @@ func _ready():
|
||||
self,
|
||||
"%s setting must be a non-negative number. Will use default value of %s." %
|
||||
[
|
||||
SimpleDialogPlugin.TEXT_TIME_PER_LETTER_MS,
|
||||
SimpleDialogPlugin.TEXT_TIME_PER_LETTER_MS_DEFAULT_VALUE
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS,
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_DEFAULT_VALUE
|
||||
]
|
||||
)
|
||||
|
||||
_text_time_per_character = SimpleDialogPlugin.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(
|
||||
SimpleDialogPlugin.TEXT_TIME_PER_LETTER_MS_FAST
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST
|
||||
)
|
||||
|
||||
if _fast_text_time_per_character < 0:
|
||||
@@ -71,15 +71,15 @@ func _ready():
|
||||
self,
|
||||
"%s setting must be a non-negative number. Will use default value of %s." %
|
||||
[
|
||||
SimpleDialogPlugin.TEXT_TIME_PER_LETTER_MS_FAST,
|
||||
SimpleDialogPlugin.TEXT_TIME_PER_LETTER_MS_FAST_DEFAULT_VALUE
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST,
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST_DEFAULT_VALUE
|
||||
]
|
||||
)
|
||||
|
||||
_fast_text_time_per_character = SimpleDialogPlugin.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(
|
||||
SimpleDialogPlugin.READING_SPEED_IN_WPM
|
||||
SimpleDialogSettings.READING_SPEED_IN_WPM
|
||||
)
|
||||
|
||||
if _reading_speed_in_wpm <= 0:
|
||||
@@ -87,12 +87,12 @@ func _ready():
|
||||
self,
|
||||
"%s setting must be a positive number. Will use default value of %s." %
|
||||
[
|
||||
SimpleDialogPlugin.READING_SPEED_IN_WPM,
|
||||
SimpleDialogPlugin.READING_SPEED_IN_WPM_DEFAULT_VALUE
|
||||
SimpleDialogSettings.READING_SPEED_IN_WPM,
|
||||
SimpleDialogSettings.READING_SPEED_IN_WPM_DEFAULT_VALUE
|
||||
]
|
||||
)
|
||||
|
||||
_reading_speed_in_wpm = SimpleDialogPlugin.READING_SPEED_IN_WPM_DEFAULT_VALUE
|
||||
_reading_speed_in_wpm = SimpleDialogSettings.READING_SPEED_IN_WPM_DEFAULT_VALUE
|
||||
|
||||
_word_regex.compile("\\S+")
|
||||
|
||||
@@ -106,6 +106,8 @@ func _ready():
|
||||
escoria.connect("paused", self, "_on_paused")
|
||||
escoria.connect("resumed", self, "_on_resumed")
|
||||
|
||||
connect("tree_exited", self, "_on_tree_exited")
|
||||
|
||||
|
||||
# Switch the current character
|
||||
#
|
||||
@@ -191,8 +193,11 @@ func _on_dialog_line_typed(object, key):
|
||||
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)
|
||||
$Timer.connect("timeout", self, "_on_dialog_finished")
|
||||
|
||||
emit_signal("say_visible")
|
||||
|
||||
@@ -207,10 +212,11 @@ func _get_number_of_words() -> int:
|
||||
|
||||
# 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(SimpleDialogPlugin.CLEAR_TEXT_BY_CLICK_ONLY):
|
||||
if not ESCProjectSettingsManager.get_setting(SimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY):
|
||||
emit_signal("say_finished")
|
||||
queue_free()
|
||||
|
||||
|
||||
# Handler managing pause notification from Escoria
|
||||
@@ -223,7 +229,14 @@ func _on_paused():
|
||||
# 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()
|
||||
|
||||
@@ -46,7 +46,7 @@ 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(
|
||||
SimpleDialogPlugin.TEXT_TIME_PER_LETTER_MS
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS
|
||||
)
|
||||
|
||||
if _text_time_per_character < 0:
|
||||
@@ -54,15 +54,15 @@ func _ready():
|
||||
self,
|
||||
"%s setting must be a non-negative number. Will use default value of %s." %
|
||||
[
|
||||
SimpleDialogPlugin.TEXT_TIME_PER_LETTER_MS,
|
||||
SimpleDialogPlugin.TEXT_TIME_PER_LETTER_MS_DEFAULT_VALUE
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS,
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_DEFAULT_VALUE
|
||||
]
|
||||
)
|
||||
|
||||
_text_time_per_character = SimpleDialogPlugin.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(
|
||||
SimpleDialogPlugin.TEXT_TIME_PER_LETTER_MS_FAST
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST
|
||||
)
|
||||
|
||||
if _fast_text_time_per_character < 0:
|
||||
@@ -70,15 +70,15 @@ func _ready():
|
||||
self,
|
||||
"%s setting must be a non-negative number. Will use default value of %s." %
|
||||
[
|
||||
SimpleDialogPlugin.TEXT_TIME_PER_LETTER_MS_FAST,
|
||||
SimpleDialogPlugin.TEXT_TIME_PER_LETTER_MS_FAST_DEFAULT_VALUE
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST,
|
||||
SimpleDialogSettings.TEXT_TIME_PER_LETTER_MS_FAST_DEFAULT_VALUE
|
||||
]
|
||||
)
|
||||
|
||||
_fast_text_time_per_character = SimpleDialogPlugin.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(
|
||||
SimpleDialogPlugin.READING_SPEED_IN_WPM
|
||||
SimpleDialogSettings.READING_SPEED_IN_WPM
|
||||
)
|
||||
|
||||
if _reading_speed_in_wpm <= 0:
|
||||
@@ -86,12 +86,12 @@ func _ready():
|
||||
self,
|
||||
"%s setting must be a positive number. Will use default value of %s." %
|
||||
[
|
||||
SimpleDialogPlugin.READING_SPEED_IN_WPM,
|
||||
SimpleDialogPlugin.READING_SPEED_IN_WPM_DEFAULT_VALUE
|
||||
SimpleDialogSettings.READING_SPEED_IN_WPM,
|
||||
SimpleDialogSettings.READING_SPEED_IN_WPM_DEFAULT_VALUE
|
||||
]
|
||||
)
|
||||
|
||||
_reading_speed_in_wpm = SimpleDialogPlugin.READING_SPEED_IN_WPM_DEFAULT_VALUE
|
||||
_reading_speed_in_wpm = SimpleDialogSettings.READING_SPEED_IN_WPM_DEFAULT_VALUE
|
||||
|
||||
_word_regex.compile("\\S+")
|
||||
|
||||
@@ -114,14 +114,9 @@ func _process(delta):
|
||||
.get_global_transform_with_canvas().origin
|
||||
rect_position.x -= rect_size.x / 2
|
||||
|
||||
if rect_position.x < 0:
|
||||
rect_position.x = 0
|
||||
_account_for_margin_x()
|
||||
|
||||
var screen_margin = rect_position.x + rect_size.x - \
|
||||
ProjectSettings.get("display/window/size/width")
|
||||
|
||||
if screen_margin > 0:
|
||||
rect_position.x -= screen_margin
|
||||
_account_for_margin_y()
|
||||
|
||||
|
||||
# Make a character say something
|
||||
@@ -156,14 +151,9 @@ func say(character: String, line: String) :
|
||||
rect_position.x = 0
|
||||
rect_size.x = ProjectSettings.get_setting("display/window/size/width")
|
||||
|
||||
if rect_position.x < 0:
|
||||
rect_position.x = 0
|
||||
_account_for_margin_x()
|
||||
|
||||
var screen_margin = rect_position.x + rect_size.x - \
|
||||
ProjectSettings.get("display/window/size/width")
|
||||
|
||||
if screen_margin > 0:
|
||||
rect_position.x -= screen_margin
|
||||
_account_for_margin_y()
|
||||
|
||||
_current_character.start_talking()
|
||||
|
||||
@@ -227,7 +217,7 @@ func _get_number_of_words() -> int:
|
||||
# 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(SimpleDialogPlugin.CLEAR_TEXT_BY_CLICK_ONLY):
|
||||
if not ESCProjectSettingsManager.get_setting(SimpleDialogSettings.CLEAR_TEXT_BY_CLICK_ONLY):
|
||||
emit_signal("say_finished")
|
||||
|
||||
|
||||
@@ -254,3 +244,25 @@ 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
|
||||
|
||||
@@ -53,7 +53,7 @@ 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 \
|
||||
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" +\
|
||||
@@ -121,7 +121,6 @@ func element_focused(element_id: String) -> void:
|
||||
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)
|
||||
|
||||
|
||||
@@ -244,6 +244,9 @@ func left_click_on_item(item_global_id: String, event: InputEvent) -> void:
|
||||
[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)
|
||||
|
||||
@@ -398,7 +401,6 @@ func _on_action_finished():
|
||||
func _on_event_done(_return_code: int, _event_name: String):
|
||||
if _return_code == ESCExecution.RC_OK:
|
||||
escoria.action_manager.clear_current_action()
|
||||
$mouse_layer/verbs_menu.clear_tool_texture()
|
||||
$tooltip_layer/tooltip.set_target("")
|
||||
|
||||
|
||||
|
||||
@@ -35,16 +35,15 @@ __meta__ = {
|
||||
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 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[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__ = {
|
||||
@@ -54,6 +53,7 @@ __meta__ = {
|
||||
[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
|
||||
@@ -64,6 +64,7 @@ text = "Menu"
|
||||
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 )]
|
||||
|
||||
@@ -61,6 +61,7 @@ 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 )
|
||||
@@ -72,27 +73,27 @@ __meta__ = {
|
||||
[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
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[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
|
||||
|
||||
@@ -1264,7 +1264,7 @@ func export_player(scene_name) -> void:
|
||||
|
||||
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()
|
||||
|
||||
@@ -158,7 +158,7 @@ func _on_CreateButton_pressed() -> void:
|
||||
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)
|
||||
|
||||
@@ -167,7 +167,7 @@ func _on_CreateButton_pressed() -> void:
|
||||
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"
|
||||
|
||||
@@ -1,16 +1,11 @@
|
||||
[gd_scene load_steps=17 format=2]
|
||||
[gd_scene load_steps=15 format=2]
|
||||
|
||||
[ext_resource path="res://game/rooms/intro/escoria-logo-comet-anim.png" type="Texture" id=1]
|
||||
[ext_resource path="res://game/rooms/intro/intro_background_space.png" type="Texture" id=2]
|
||||
[ext_resource path="res://game/rooms/intro/escoria-logo-comet.png" type="Texture" id=3]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=4]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=5]
|
||||
[ext_resource path="res://game/rooms/intro/escoria_background.png" type="Texture" id=6]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=7]
|
||||
|
||||
[sub_resource type="StreamTexture" id=10]
|
||||
flags = 4
|
||||
load_path = "res://.import/intro_background_space.png-03815c403298b393ba1bea2b29eafeac.stex"
|
||||
|
||||
[sub_resource type="AtlasTexture" id=1]
|
||||
flags = 4
|
||||
atlas = ExtResource( 1 )
|
||||
@@ -88,7 +83,7 @@ tracks/2/keys = {
|
||||
"values": [ false ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("ESCBackground:visible")
|
||||
tracks/3/path = NodePath("asteroid:position")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
@@ -96,11 +91,11 @@ tracks/3/enabled = true
|
||||
tracks/3/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 1,
|
||||
"values": [ true ]
|
||||
"update": 0,
|
||||
"values": [ Vector2( 620, 450 ) ]
|
||||
}
|
||||
tracks/4/type = "value"
|
||||
tracks/4/path = NodePath("asteroid:position")
|
||||
tracks/4/path = NodePath("Polygon2D:visible")
|
||||
tracks/4/interp = 1
|
||||
tracks/4/loop_wrap = true
|
||||
tracks/4/imported = false
|
||||
@@ -109,18 +104,6 @@ tracks/4/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ Vector2( 620, 450 ) ]
|
||||
}
|
||||
tracks/5/type = "value"
|
||||
tracks/5/path = NodePath("Polygon2D:visible")
|
||||
tracks/5/interp = 1
|
||||
tracks/5/loop_wrap = true
|
||||
tracks/5/imported = false
|
||||
tracks/5/enabled = true
|
||||
tracks/5/keys = {
|
||||
"times": PoolRealArray( 0 ),
|
||||
"transitions": PoolRealArray( 1 ),
|
||||
"update": 0,
|
||||
"values": [ true ]
|
||||
}
|
||||
|
||||
@@ -265,18 +248,9 @@ global_id = "intro_cutscene"
|
||||
esc_script = "res://game/rooms/intro/esc/intro.esc"
|
||||
camera_limits = [ Rect2( 0, 0, 1920, 1080 ) ]
|
||||
|
||||
[node name="ESCBackground" type="TextureRect" parent="."]
|
||||
margin_right = 1279.0
|
||||
margin_bottom = 900.0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource( 6 )
|
||||
expand = true
|
||||
stretch_mode = 1
|
||||
script = ExtResource( 4 )
|
||||
|
||||
[node name="initial_background" type="Sprite" parent="."]
|
||||
position = Vector2( 640, 450 )
|
||||
texture = SubResource( 10 )
|
||||
texture = ExtResource( 2 )
|
||||
|
||||
[node name="animated_asteroid" type="AnimatedSprite" parent="."]
|
||||
visible = false
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
set_global dialog_popup_advance 2
|
||||
stop
|
||||
> [eq dialog_popup_advance 2]
|
||||
block_say
|
||||
say player ROOM1_look_wall_item_3:"No, SERIOUSLY, I have no idea what that is!" avatar
|
||||
say player ROOM1_look_wall_item_4:"Please stop asking me that!" avatar
|
||||
end_block_say
|
||||
stop
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=12 format=2]
|
||||
[gd_scene load_steps=11 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2]
|
||||
[ext_resource path="res://game/fonts/caslonantique.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=5]
|
||||
@@ -16,7 +15,7 @@ vertices = PoolVector2Array( 125, 357, 1170, 355, 1277, 417, 1279, 550, -1, 548,
|
||||
polygons = [ PoolIntArray( 0, 1, 2, 3, 4, 5 ) ]
|
||||
outlines = [ PoolVector2Array( 125, 357, 1170, 355, 1277, 417, 1279, 550, -1, 548, 0, 449 ) ]
|
||||
|
||||
[node name="room2" type="Node2D"]
|
||||
[node name="room1" type="Node2D"]
|
||||
script = ExtResource( 6 )
|
||||
__meta__ = {
|
||||
"_edit_vertical_guides_": [ ]
|
||||
@@ -27,17 +26,14 @@ player_scene = ExtResource( 4 )
|
||||
camera_limits = [ Rect2( 0, 0, 1280, 550 ) ]
|
||||
editor_debug_mode = 1
|
||||
|
||||
[node name="ESCBackground" type="TextureRect" parent="."]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
mouse_filter = 2
|
||||
[node name="Room1Background" type="Sprite" parent="."]
|
||||
texture = ExtResource( 8 )
|
||||
script = ExtResource( 2 )
|
||||
centered = false
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="advice2" type="Label" parent="ESCBackground"]
|
||||
[node name="advice2" type="Label" parent="Room1Background"]
|
||||
anchor_right = 0.023274
|
||||
anchor_bottom = 0.018018
|
||||
margin_left = 90.2752
|
||||
@@ -47,11 +43,8 @@ margin_bottom = 215.824
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Move : left click
|
||||
Fast move : double left click"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="room_label" type="Label" parent="ESCBackground"]
|
||||
[node name="room_label" type="Label" parent="Room1Background"]
|
||||
margin_left = 7.0
|
||||
margin_top = 3.0
|
||||
margin_right = 89.0
|
||||
@@ -62,7 +55,7 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="advice" type="Label" parent="ESCBackground"]
|
||||
[node name="advice" type="Label" parent="Room1Background"]
|
||||
anchor_right = 0.023274
|
||||
anchor_bottom = 0.018018
|
||||
margin_left = 90.0
|
||||
|
||||
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.9 KiB |
@@ -1,11 +1,10 @@
|
||||
[gd_scene load_steps=21 format=2]
|
||||
[gd_scene load_steps=20 format=2]
|
||||
|
||||
[ext_resource path="res://game/fonts/caslonantique.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=6]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=7]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=8]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=9]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=10]
|
||||
[ext_resource path="res://game/rooms/room02/room2background.png" type="Texture" id=11]
|
||||
[ext_resource path="res://game/rooms/room02/floor3.png" type="Texture" id=12]
|
||||
@@ -32,7 +31,7 @@ extents = Vector2( 39, 39.5 )
|
||||
[sub_resource type="Animation" id=5]
|
||||
length = 0.001
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("ESCBackground/Floor1:position")
|
||||
tracks/0/path = NodePath("Room2Background/Floor1:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
@@ -44,7 +43,7 @@ tracks/0/keys = {
|
||||
"values": [ Vector2( 495, 650 ) ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("ESCBackground/Floor2:position")
|
||||
tracks/1/path = NodePath("Room2Background/Floor2:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
@@ -56,7 +55,7 @@ tracks/1/keys = {
|
||||
"values": [ Vector2( 585, 650 ) ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("ESCBackground/Floor3:position")
|
||||
tracks/2/path = NodePath("Room2Background/Floor3:position")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
@@ -68,7 +67,7 @@ tracks/2/keys = {
|
||||
"values": [ Vector2( 696, 650 ) ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("ESCBackground/Floor4:position")
|
||||
tracks/3/path = NodePath("Room2Background/Floor4:position")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
@@ -83,7 +82,7 @@ tracks/3/keys = {
|
||||
[sub_resource type="Animation" id=6]
|
||||
length = 1.6
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("ESCBackground/Floor1:position")
|
||||
tracks/0/path = NodePath("Room2Background/Floor1:position")
|
||||
tracks/0/interp = 1
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
@@ -95,7 +94,7 @@ tracks/0/keys = {
|
||||
"values": [ Vector2( 495, 650 ), Vector2( 495, 450 ) ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("ESCBackground/Floor2:position")
|
||||
tracks/1/path = NodePath("Room2Background/Floor2:position")
|
||||
tracks/1/interp = 1
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
@@ -107,7 +106,7 @@ tracks/1/keys = {
|
||||
"values": [ Vector2( 585, 650 ), Vector2( 585, 650 ), Vector2( 585, 450 ) ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("ESCBackground/Floor4:position")
|
||||
tracks/2/path = NodePath("Room2Background/Floor4:position")
|
||||
tracks/2/interp = 1
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
@@ -119,7 +118,7 @@ tracks/2/keys = {
|
||||
"values": [ Vector2( 786, 650 ), Vector2( 786, 650 ), Vector2( 786, 450 ) ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("ESCBackground/Floor3:position")
|
||||
tracks/3/path = NodePath("Room2Background/Floor3:position")
|
||||
tracks/3/interp = 1
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
@@ -134,7 +133,7 @@ tracks/3/keys = {
|
||||
[sub_resource type="Animation" id=7]
|
||||
length = 1.6
|
||||
tracks/0/type = "value"
|
||||
tracks/0/path = NodePath("ESCBackground/Floor1:position")
|
||||
tracks/0/path = NodePath("Room2Background/Floor1:position")
|
||||
tracks/0/interp = 2
|
||||
tracks/0/loop_wrap = true
|
||||
tracks/0/imported = false
|
||||
@@ -146,7 +145,7 @@ tracks/0/keys = {
|
||||
"values": [ Vector2( 495, 450 ), Vector2( 495, 450 ), Vector2( 495, 650 ) ]
|
||||
}
|
||||
tracks/1/type = "value"
|
||||
tracks/1/path = NodePath("ESCBackground/Floor2:position")
|
||||
tracks/1/path = NodePath("Room2Background/Floor2:position")
|
||||
tracks/1/interp = 2
|
||||
tracks/1/loop_wrap = true
|
||||
tracks/1/imported = false
|
||||
@@ -158,7 +157,7 @@ tracks/1/keys = {
|
||||
"values": [ Vector2( 585, 450 ), Vector2( 585, 450 ), Vector2( 585, 650 ) ]
|
||||
}
|
||||
tracks/2/type = "value"
|
||||
tracks/2/path = NodePath("ESCBackground/Floor3:position")
|
||||
tracks/2/path = NodePath("Room2Background/Floor3:position")
|
||||
tracks/2/interp = 2
|
||||
tracks/2/loop_wrap = true
|
||||
tracks/2/imported = false
|
||||
@@ -170,7 +169,7 @@ tracks/2/keys = {
|
||||
"values": [ Vector2( 696, 450 ), Vector2( 696, 450 ), Vector2( 696, 650 ) ]
|
||||
}
|
||||
tracks/3/type = "value"
|
||||
tracks/3/path = NodePath("ESCBackground/Floor4:position")
|
||||
tracks/3/path = NodePath("Room2Background/Floor4:position")
|
||||
tracks/3/interp = 2
|
||||
tracks/3/loop_wrap = true
|
||||
tracks/3/imported = false
|
||||
@@ -192,6 +191,52 @@ player_scene = ExtResource( 4 )
|
||||
camera_limits = [ Rect2( 0, 0, 1280, 555 ) ]
|
||||
editor_debug_mode = 1
|
||||
|
||||
[node name="Room2Background" type="Sprite" parent="."]
|
||||
texture = ExtResource( 11 )
|
||||
centered = false
|
||||
|
||||
[node name="room_label" type="Label" parent="Room2Background"]
|
||||
margin_left = 18.0
|
||||
margin_top = 12.0
|
||||
margin_right = 100.0
|
||||
margin_bottom = 33.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "ROOM 2"
|
||||
|
||||
[node name="Floor1" type="Sprite" parent="Room2Background"]
|
||||
position = Vector2( 495, 650 )
|
||||
texture = ExtResource( 13 )
|
||||
|
||||
[node name="Floor2" type="Sprite" parent="Room2Background"]
|
||||
position = Vector2( 585, 650 )
|
||||
texture = ExtResource( 15 )
|
||||
|
||||
[node name="Floor4" type="Sprite" parent="Room2Background"]
|
||||
position = Vector2( 786, 650 )
|
||||
texture = ExtResource( 14 )
|
||||
|
||||
[node name="Floor3" type="Sprite" parent="Room2Background"]
|
||||
position = Vector2( 696, 650 )
|
||||
scale = Vector2( 1.01351, 1 )
|
||||
texture = ExtResource( 12 )
|
||||
|
||||
[node name="Polygon2D" type="Polygon2D" parent="Room2Background"]
|
||||
color = Color( 0, 0, 0, 1 )
|
||||
polygon = PoolVector2Array( 0, 550, 1280, 550, 1280, 800, 0, 800 )
|
||||
|
||||
[node name="room_label2" type="Label" parent="Room2Background"]
|
||||
margin_left = 17.0
|
||||
margin_top = 558.0
|
||||
margin_right = 1126.0
|
||||
margin_bottom = 627.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Room 2 demonstrates modifying the walkable area of a room. Performing \"use\" on the button will cause the original navmesh (which has a gap
|
||||
in the middle) with one that covers the whole room (platforms + bridge) - allowing the player to walk from one side to the other.
|
||||
Setting the state of the r2_bridge variable to \"bridge_open\" or \"bridge_closed\" (see button.esc) automatically runs the animation with the same name."
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="r_platform" type="Area2D" parent="."]
|
||||
pause_mode = 1
|
||||
script = ExtResource( 7 )
|
||||
@@ -200,6 +245,7 @@ esc_script = "res://game/rooms/room02/esc/right_platform.esc"
|
||||
interaction_direction = 3
|
||||
tooltip_name = "Right platform"
|
||||
default_action = "look"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -218,6 +264,7 @@ esc_script = "res://game/rooms/room02/esc/right_exit.esc"
|
||||
is_exit = true
|
||||
tooltip_name = "Right exit"
|
||||
default_action = "walk"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -236,6 +283,7 @@ esc_script = "res://game/rooms/room02/esc/left_exit.esc"
|
||||
is_exit = true
|
||||
tooltip_name = "Left exit"
|
||||
default_action = "walk"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -252,61 +300,6 @@ script = ExtResource( 8 )
|
||||
global_id = "r2_player_start"
|
||||
is_start_location = true
|
||||
|
||||
[node name="ESCBackground" type="TextureRect" parent="."]
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 550.0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource( 11 )
|
||||
script = ExtResource( 9 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="room_label" type="Label" parent="ESCBackground"]
|
||||
margin_left = 18.0
|
||||
margin_top = 12.0
|
||||
margin_right = 100.0
|
||||
margin_bottom = 33.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "ROOM 2"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Floor1" type="Sprite" parent="ESCBackground"]
|
||||
position = Vector2( 495, 650 )
|
||||
texture = ExtResource( 13 )
|
||||
|
||||
[node name="Floor2" type="Sprite" parent="ESCBackground"]
|
||||
position = Vector2( 585, 650 )
|
||||
texture = ExtResource( 15 )
|
||||
|
||||
[node name="Floor4" type="Sprite" parent="ESCBackground"]
|
||||
position = Vector2( 786, 650 )
|
||||
texture = ExtResource( 14 )
|
||||
|
||||
[node name="Floor3" type="Sprite" parent="ESCBackground"]
|
||||
position = Vector2( 696, 650 )
|
||||
scale = Vector2( 1.01351, 1 )
|
||||
texture = ExtResource( 12 )
|
||||
|
||||
[node name="Polygon2D" type="Polygon2D" parent="ESCBackground"]
|
||||
color = Color( 0, 0, 0, 1 )
|
||||
polygon = PoolVector2Array( 0, 550, 1280, 550, 1280, 800, 0, 800 )
|
||||
|
||||
[node name="room_label2" type="Label" parent="ESCBackground"]
|
||||
margin_left = 17.0
|
||||
margin_top = 558.0
|
||||
margin_right = 99.0
|
||||
margin_bottom = 579.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Room 2 demonstrates modifying the walkable area of a room. Performing \"use\" on the button will cause the original navmesh (which has a gap
|
||||
in the middle) with one that covers the whole room (platforms + bridge) - allowing the player to walk from one side to the other.
|
||||
Setting the state of the r2_bridge variable to \"bridge_open\" or \"bridge_closed\" (see button.esc) automatically runs the animation with the same name."
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="walkable_area" type="Navigation2D" parent="."]
|
||||
script = ExtResource( 10 )
|
||||
debug_mode = 1
|
||||
@@ -327,6 +320,7 @@ global_id = "r2_button"
|
||||
esc_script = "res://game/rooms/room02/esc/button.esc"
|
||||
tooltip_name = "button"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 0.196078, 1, 0, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -347,6 +341,7 @@ global_id = "r2_button_right"
|
||||
esc_script = "res://game/rooms/room02/esc/button.esc"
|
||||
tooltip_name = "button"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 0.196078, 1, 0, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -364,6 +359,7 @@ script = ExtResource( 8 )
|
||||
pause_mode = 1
|
||||
script = ExtResource( 7 )
|
||||
global_id = "r2_bridge"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 15 KiB |
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=25 format=2]
|
||||
[gd_scene load_steps=24 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://game/fonts/caslonantique.tres" type="DynamicFont" id=3]
|
||||
@@ -6,7 +6,6 @@
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=5]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=6]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=8]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=9]
|
||||
[ext_resource path="res://game/rooms/room03/room3chasm.png" type="Texture" id=10]
|
||||
[ext_resource path="res://game/rooms/room03/room3bridge.png" type="Texture" id=11]
|
||||
[ext_resource path="res://game/rooms/room03/room3background.png" type="Texture" id=12]
|
||||
@@ -159,6 +158,7 @@ __meta__ = {
|
||||
}
|
||||
global_id = "r3_right_platform"
|
||||
esc_script = "res://game/rooms/room03/esc/right_platform.esc"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -187,6 +187,7 @@ esc_script = "res://game/rooms/room03/esc/right_exit.esc"
|
||||
is_exit = true
|
||||
is_interactive = false
|
||||
tooltip_name = "Exit"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -211,6 +212,7 @@ global_id = "r3_l_exit"
|
||||
esc_script = "res://game/rooms/room03/esc/left_exit.esc"
|
||||
is_exit = true
|
||||
tooltip_name = "Exit"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -232,6 +234,7 @@ pause_mode = 1
|
||||
script = ExtResource( 5 )
|
||||
global_id = "r3_bridge"
|
||||
esc_script = "res://game/rooms/room03/esc/room03_bridge.esc"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
inventory_texture = ExtResource( 10 )
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
@@ -257,21 +260,15 @@ polygon = PoolVector2Array( 501, 349, 780, 351, 859, 548, 419, 551 )
|
||||
position = Vector2( 434, 441 )
|
||||
script = ExtResource( 8 )
|
||||
|
||||
[node name="ESCBackground" type="TextureRect" parent="."]
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 550.0
|
||||
mouse_filter = 2
|
||||
[node name="Room3Background" type="Sprite" parent="."]
|
||||
texture = ExtResource( 12 )
|
||||
script = ExtResource( 9 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
centered = false
|
||||
|
||||
[node name="Polygon2D" type="Polygon2D" parent="ESCBackground"]
|
||||
[node name="Polygon2D" type="Polygon2D" parent="Room3Background"]
|
||||
color = Color( 0, 0, 0, 1 )
|
||||
polygon = PoolVector2Array( 0, 550, 1280, 550, 1280, 800, 0, 800 )
|
||||
|
||||
[node name="room_label2" type="Label" parent="ESCBackground"]
|
||||
[node name="room_label2" type="Label" parent="Room3Background"]
|
||||
margin_left = 17.0
|
||||
margin_top = 558.0
|
||||
margin_right = 1224.0
|
||||
@@ -280,18 +277,12 @@ custom_fonts/font = ExtResource( 3 )
|
||||
text = "Room 3 demonstrates a chain of steps to complete a game task. It demonstrates different talk responses based on the state of the button (which sets the
|
||||
\"broken_button\" variable to true or false respectively). Setting the \"button_repaired\" state automatically plays the button_repaired animation, which turns off
|
||||
the particle emitter for the button. The custom command shows how to execute functions written in gdscript."
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="room_label" type="Label" parent="ESCBackground"]
|
||||
[node name="room_label" type="Label" parent="Room3Background"]
|
||||
margin_right = 82.0
|
||||
margin_bottom = 21.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "ROOM 3"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="r3_button" type="Area2D" parent="."]
|
||||
pause_mode = 1
|
||||
@@ -300,6 +291,7 @@ global_id = "r3_button"
|
||||
esc_script = "res://game/rooms/room03/esc/button.esc"
|
||||
tooltip_name = "Button"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 7.5 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 1.2 MiB After Width: | Height: | Size: 1.2 MiB |
@@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=13 format=2]
|
||||
[gd_scene load_steps=12 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2]
|
||||
[ext_resource path="res://game/fonts/caslonantique.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=5]
|
||||
@@ -25,20 +24,20 @@ player_scene = ExtResource( 4 )
|
||||
camera_limits = [ Rect2( 0, 0, 2390, 1200 ) ]
|
||||
editor_debug_mode = 1
|
||||
|
||||
[node name="ESCBackground" type="TextureRect" parent="."]
|
||||
margin_right = 2390.0
|
||||
margin_bottom = 1200.0
|
||||
mouse_filter = 2
|
||||
[node name="Forrest" type="Sprite" parent="."]
|
||||
texture = ExtResource( 7 )
|
||||
script = ExtResource( 2 )
|
||||
centered = false
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="room_label" type="Label" parent="ESCBackground"]
|
||||
[node name="room_label" type="Label" parent="Forrest"]
|
||||
margin_right = 82.0
|
||||
margin_bottom = 21.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "ROOM 4"
|
||||
|
||||
[node name="Label" type="Label" parent="ESCBackground"]
|
||||
[node name="Label" type="Label" parent="Forrest"]
|
||||
modulate = Color( 0, 0, 0, 1 )
|
||||
margin_left = 782.0
|
||||
margin_top = 159.0
|
||||
@@ -58,7 +57,7 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label2" type="Label" parent="ESCBackground"]
|
||||
[node name="Label2" type="Label" parent="Forrest"]
|
||||
modulate = Color( 0, 0, 0, 1 )
|
||||
margin_left = 1246.0
|
||||
margin_top = 506.0
|
||||
@@ -76,7 +75,7 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Label3" type="Label" parent="ESCBackground"]
|
||||
[node name="Label3" type="Label" parent="Forrest"]
|
||||
modulate = Color( 0, 0, 0, 1 )
|
||||
margin_left = 1285.0
|
||||
margin_top = 211.0
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=1]
|
||||
|
||||
[node name="background" type="TextureRect"]
|
||||
margin_right = 1289.0
|
||||
margin_bottom = 555.0
|
||||
mouse_filter = 2
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="l_platform" type="Line2D" parent="."]
|
||||
position = Vector2( 2, -266 )
|
||||
points = PoolVector2Array( -2.96298, 712.01, 129.973, 614.429, 1167.5, 612.894, 1274.59, 669.705, 1273.25, 812.694, 2.36697, 811.043, 2.36697, 713.389 )
|
||||
|
||||
[node name="l_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -266 )
|
||||
points = PoolVector2Array( 6.61201, 704.409, 6.61203, 389.558, 87.755, 339.775, 87.5463, 649.784 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="r_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -267.828 )
|
||||
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1271.64, 671.735, 1188.64, 624.843 )
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=18 format=2]
|
||||
[gd_scene load_steps=17 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://game/items/inventory/r5_empty_sheet.tscn" type="PackedScene" id=2]
|
||||
@@ -11,7 +11,6 @@
|
||||
[ext_resource path="res://game/rooms/room05/water_droplet.png" type="Texture" id=9]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=11]
|
||||
[ext_resource path="res://game/rooms/room05/room5background.png" type="Texture" id=13]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=15]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=1]
|
||||
vertices = PoolVector2Array( 1187, 387, 1188, 352, 1269.59, 398, 1267, 538, 15, 401, 93, 350, 96, 375, 12, 539, 129.634, 362, 1155, 361 )
|
||||
@@ -70,24 +69,21 @@ esc_script = "res://game/rooms/room05/esc/room05.esc"
|
||||
player_scene = ExtResource( 4 )
|
||||
camera_limits = [ Rect2( 0, 0, 1280, 555 ) ]
|
||||
|
||||
[node name="ESCBackground" type="TextureRect" parent="."]
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 550.0
|
||||
mouse_filter = 2
|
||||
[node name="Room5Background" type="Sprite" parent="."]
|
||||
texture = ExtResource( 13 )
|
||||
script = ExtResource( 15 )
|
||||
centered = false
|
||||
|
||||
[node name="room_label" type="Label" parent="ESCBackground"]
|
||||
[node name="room_label" type="Label" parent="Room5Background"]
|
||||
margin_right = 82.0
|
||||
margin_bottom = 21.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "ROOM 5"
|
||||
|
||||
[node name="background_for_text" type="Polygon2D" parent="ESCBackground"]
|
||||
[node name="background_for_text" type="Polygon2D" parent="Room5Background"]
|
||||
color = Color( 0.364706, 0.109804, 0.447059, 1 )
|
||||
polygon = PoolVector2Array( 128, 4, 555, 4, 555, 315, 128, 315 )
|
||||
|
||||
[node name="room_details1" type="Label" parent="ESCBackground/background_for_text"]
|
||||
[node name="room_details1" type="Label" parent="Room5Background/background_for_text"]
|
||||
margin_left = 141.0
|
||||
margin_top = 7.0
|
||||
margin_right = 427.0
|
||||
@@ -99,7 +95,7 @@ Combine the pen and paper in your
|
||||
inventory to create a new object which
|
||||
will be used in the next room."
|
||||
|
||||
[node name="room_details2" type="Label" parent="ESCBackground/background_for_text"]
|
||||
[node name="room_details2" type="Label" parent="Room5Background/background_for_text"]
|
||||
margin_left = 138.0
|
||||
margin_top = 136.0
|
||||
margin_right = 580.0
|
||||
|
||||
|
Before Width: | Height: | Size: 136 KiB After Width: | Height: | Size: 139 KiB |
@@ -1,27 +0,0 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=1]
|
||||
|
||||
[node name="background" type="TextureRect"]
|
||||
margin_right = 1289.0
|
||||
margin_bottom = 555.0
|
||||
mouse_filter = 2
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="l_platform" type="Line2D" parent="."]
|
||||
position = Vector2( 2, -266 )
|
||||
points = PoolVector2Array( -2.96298, 712.01, 129.973, 614.429, 1167.5, 612.894, 1274.59, 669.705, 1273.25, 812.694, 2.36697, 811.043, 2.36697, 713.389 )
|
||||
|
||||
[node name="l_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -266 )
|
||||
points = PoolVector2Array( 6.61201, 704.409, 6.61203, 389.558, 87.755, 339.775, 87.5463, 649.784 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="r_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -267.828 )
|
||||
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1271.64, 671.735, 1188.64, 624.843 )
|
||||
@@ -83,4 +83,26 @@ set_active worker false
|
||||
set_gui_visible true
|
||||
accept_input ALL
|
||||
|
||||
# use has to be supported as simplemouse has no "give" icon
|
||||
:use r5_filled_sheet
|
||||
set_gui_visible false
|
||||
accept_input SKIP
|
||||
|
||||
inventory_remove r5_filled_sheet
|
||||
say worker "I've unlocked the door, in you go!"
|
||||
walk worker r6_r_exit
|
||||
|
||||
# Open the door
|
||||
set_global r6_r_exit_locked false
|
||||
# Hide the closed door graphic
|
||||
set_state r6_r_exit open_door
|
||||
# Make the open exit visible
|
||||
set_active r6_r_exit true
|
||||
|
||||
# Disappear!
|
||||
say worker "I will see you again... MUAHAHAHAHA!"
|
||||
wait 1
|
||||
set_active worker false
|
||||
|
||||
set_gui_visible true
|
||||
accept_input ALL
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=19 format=2]
|
||||
[gd_scene load_steps=18 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_exit.gd" type="Script" id=3]
|
||||
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://game/rooms/room06/wave.png" type="Texture" id=5]
|
||||
@@ -63,12 +62,9 @@ esc_script = "res://game/rooms/room06/esc/room06.esc"
|
||||
player_scene = ExtResource( 4 )
|
||||
camera_limits = [ Rect2( 0, 0, 1280, 555 ) ]
|
||||
|
||||
[node name="ESCBackground" type="TextureRect" parent="."]
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 550.0
|
||||
mouse_filter = 2
|
||||
[node name="Room6Background" type="Sprite" parent="."]
|
||||
texture = ExtResource( 12 )
|
||||
script = ExtResource( 2 )
|
||||
centered = false
|
||||
|
||||
[node name="walkable_area" type="Navigation2D" parent="."]
|
||||
script = ExtResource( 1 )
|
||||
|
||||
|
Before Width: | Height: | Size: 31 KiB After Width: | Height: | Size: 33 KiB |
@@ -1,39 +0,0 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=1]
|
||||
|
||||
[node name="background" type="TextureRect"]
|
||||
margin_right = 2092.0
|
||||
margin_bottom = 1970.0
|
||||
mouse_filter = 2
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="low_platform" type="Line2D" parent="."]
|
||||
position = Vector2( 2, 1139.32 )
|
||||
points = PoolVector2Array( -2.96298, 712.01, 129.973, 614.429, 1983.92, 613.668, 2076.67, 670.75, 2079.05, 812.694, 2.36697, 811.043, 2.36697, 713.389 )
|
||||
|
||||
[node name="low_stairs" type="Line2D" parent="low_platform"]
|
||||
position = Vector2( -2, 266 )
|
||||
points = PoolVector2Array( 1049.73, 346.599, 1051.16, 24.8604, 832.783, 25.3764, 829.419, 346.599, 829.364, 347.648, 828.734, 314.26, 1044.72, 313.433, 1045.16, 292.5, 862.657, 293, 836.294, 309.85, 864.157, 290, 864.657, 264, 1043.66, 263.5, 1043.16, 245.5, 889.657, 244.5, 864.157, 262.5, 890.657, 242, 890.657, 219, 1046.16, 218.36, 1046.16, 196.86, 916.157, 197.36, 889.157, 216.36, 918.657, 193.86, 919.157, 172.36, 1045.66, 171.36, 1048.29, 148.878, 969.081, 147.031, 916.657, 169.36 )
|
||||
|
||||
[node name="l_door" type="Line2D" parent="low_platform"]
|
||||
position = Vector2( -2, 0 )
|
||||
points = PoolVector2Array( 6.61201, 704.409, 6.61203, 389.558, 87.755, 339.775, 87.5463, 649.784 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="r_door" type="Line2D" parent="low_platform"]
|
||||
position = Vector2( 806.661, -1.828 )
|
||||
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1271.64, 671.735, 1188.64, 624.843 )
|
||||
|
||||
[node name="upper_platform" type="Line2D" parent="."]
|
||||
position = Vector2( 3.56348, 1405.32 )
|
||||
points = PoolVector2Array( 2079.3, -389.423, 15.1762, -952.628, 13.387, -1281.56, 310.131, -1283.61, 2112.1, -1390.9, 310.131, -1283.61, 311.013, -960.022, 19.414, -956.866, 309.824, -958.833, 2080.98, -643.198, 2082.47, -392.598 )
|
||||
|
||||
[node name="upper_stairs" type="Line2D" parent="upper_platform"]
|
||||
position = Vector2( 401.921, -1166.13 )
|
||||
points = PoolVector2Array( 1054.04, 411.089, 1051.16, 24.8604, 818.179, 7.1228, 818.571, 365.834, 867.079, 342.133, 1049.09, 372.198 )
|
||||
@@ -9,10 +9,10 @@ set_state r7_lift lift_floor_2_to_1_no_player true
|
||||
camera_set_target 0 player
|
||||
|
||||
# camera_set_limits is how you change the active camera limits.
|
||||
# If you change the below command to "camera_set_limits 0" you'll notice
|
||||
# If you change the below command to "camera_set_limits 1" you'll notice
|
||||
# some of the camera commands start having issues as the camera no longer
|
||||
# has access to the requested coordinates
|
||||
camera_set_limits 1
|
||||
camera_set_limits 0
|
||||
|
||||
> [eq ESC_LAST_SCENE room6]
|
||||
teleport player r7_l_exit
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=26 format=2]
|
||||
[gd_scene load_steps=25 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2]
|
||||
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://game/fonts/caslonantique.tres" type="DynamicFont" id=5]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=6]
|
||||
@@ -672,7 +671,7 @@ __meta__ = {
|
||||
global_id = "room7"
|
||||
esc_script = "res://game/rooms/room07/esc/room07.esc"
|
||||
player_scene = ExtResource( 4 )
|
||||
camera_limits = [ Rect2( 0, 0, 1300, 2000 ), Rect2( 0, 0, 2260, 2000 ) ]
|
||||
camera_limits = [ Rect2( 0, 0, 2260, 2000 ), Rect2( 0, 0, 1300, 2000 ) ]
|
||||
editor_debug_mode = 1
|
||||
|
||||
[node name="lift_shaft" type="Polygon2D" parent="."]
|
||||
@@ -739,29 +738,23 @@ position = Vector2( 1430, 960 )
|
||||
scale = Vector2( -1, 1 )
|
||||
texture = ExtResource( 12 )
|
||||
|
||||
[node name="ESCBackground" type="TextureRect" parent="."]
|
||||
margin_right = 2260.0
|
||||
margin_bottom = 1600.0
|
||||
mouse_filter = 2
|
||||
[node name="Room7Background" type="Sprite" parent="."]
|
||||
texture = ExtResource( 9 )
|
||||
script = ExtResource( 2 )
|
||||
centered = false
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
"_edit_lock_": true
|
||||
}
|
||||
|
||||
[node name="room_label" type="Label" parent="ESCBackground"]
|
||||
[node name="room_label" type="Label" parent="Room7Background"]
|
||||
margin_left = 7.0
|
||||
margin_top = 3.0
|
||||
margin_right = 89.0
|
||||
margin_right = 179.0
|
||||
margin_bottom = 24.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
custom_fonts/font = ExtResource( 5 )
|
||||
text = "ROOM 7 upper floor"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="room_label2" type="Label" parent="ESCBackground"]
|
||||
[node name="room_label2" type="Label" parent="Room7Background"]
|
||||
margin_left = 10.0
|
||||
margin_top = 628.0
|
||||
margin_right = 182.0
|
||||
@@ -773,7 +766,7 @@ __meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="room_label3" type="Label" parent="ESCBackground"]
|
||||
[node name="room_label3" type="Label" parent="Room7Background"]
|
||||
margin_left = 275.0
|
||||
margin_top = 681.0
|
||||
margin_right = 989.0
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=18 format=2]
|
||||
[gd_scene load_steps=17 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2]
|
||||
[ext_resource path="res://game/fonts/caslonantique.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=5]
|
||||
@@ -226,28 +225,21 @@ script = ExtResource( 7 )
|
||||
global_id = "r8_player_start"
|
||||
is_start_location = true
|
||||
|
||||
[node name="background" type="TextureRect" parent="."]
|
||||
margin_right = 1289.0
|
||||
margin_bottom = 555.0
|
||||
mouse_filter = 2
|
||||
[node name="Room8Background" type="Sprite" parent="."]
|
||||
texture = ExtResource( 8 )
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true,
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
centered = false
|
||||
|
||||
[node name="Label" type="Label" parent="background"]
|
||||
margin_right = 48.0
|
||||
margin_bottom = 16.0
|
||||
[node name="Label" type="Label" parent="Room8Background"]
|
||||
margin_right = 62.0
|
||||
margin_bottom = 21.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Room 8"
|
||||
|
||||
[node name="Label2" type="Label" parent="background"]
|
||||
[node name="Label2" type="Label" parent="Room8Background"]
|
||||
margin_left = 835.0
|
||||
margin_top = 12.0
|
||||
margin_right = 1133.0
|
||||
margin_bottom = 201.0
|
||||
margin_bottom = 249.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "This room demonstrates mixing Escoria
|
||||
with an external GDScript puzzle.
|
||||
@@ -275,6 +267,7 @@ global_id = "r8_l_exit"
|
||||
esc_script = "res://game/rooms/room08/esc/left_exit.esc"
|
||||
is_exit = true
|
||||
tooltip_name = "Exit"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -296,6 +289,7 @@ global_id = "r8_m_door"
|
||||
esc_script = "res://game/rooms/room08/esc/middle_exit.esc"
|
||||
is_exit = true
|
||||
tooltip_name = "Exit"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
inventory_texture = ExtResource( 10 )
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
@@ -344,6 +338,7 @@ polygon = PoolVector2Array( 635, 55, 810, 56, 810, 350, 634, 350 )
|
||||
pause_mode = 1
|
||||
script = ExtResource( 5 )
|
||||
global_id = "r8_mini_puzzle_unlocked"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
inventory_texture = ExtResource( 11 )
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
@@ -359,6 +354,7 @@ global_id = "r8_mini_puzzle_button"
|
||||
esc_script = "res://game/rooms/room08/esc/button_puzzle.esc"
|
||||
tooltip_name = "Button"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
inventory_texture = ExtResource( 9 )
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
@@ -391,6 +387,7 @@ global_id = "r8_button_reset_puzzle"
|
||||
esc_script = "res://game/rooms/room08/esc/button_reset_puzzle.esc"
|
||||
tooltip_name = "Button"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 146 KiB |
@@ -1,23 +0,0 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=1]
|
||||
|
||||
[node name="background" type="TextureRect"]
|
||||
margin_right = 1289.0
|
||||
margin_bottom = 555.0
|
||||
mouse_filter = 2
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="l_platform" type="Line2D" parent="."]
|
||||
position = Vector2( 2, -266 )
|
||||
points = PoolVector2Array( -2.96298, 712.01, 129.973, 614.429, 1167.5, 612.894, 1274.59, 669.705, 1273.25, 812.694, 2.36697, 811.043, 2.36697, 713.389 )
|
||||
|
||||
[node name="l_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -266 )
|
||||
points = PoolVector2Array( 6.61201, 704.409, 6.61203, 389.558, 87.755, 339.775, 87.5463, 649.784 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=32 format=2]
|
||||
[gd_scene load_steps=31 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2]
|
||||
[ext_resource path="res://game/fonts/caslonantique.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://game/rooms/room09/button.png" type="Texture" id=5]
|
||||
@@ -417,24 +416,21 @@ __meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="ESCBackground" type="TextureRect" parent="."]
|
||||
margin_right = 1280.0
|
||||
margin_bottom = 550.0
|
||||
mouse_filter = 2
|
||||
[node name="Room9Background" type="Sprite" parent="."]
|
||||
texture = ExtResource( 9 )
|
||||
script = ExtResource( 2 )
|
||||
centered = false
|
||||
|
||||
[node name="room_label" type="Label" parent="ESCBackground"]
|
||||
[node name="room_label" type="Label" parent="Room9Background"]
|
||||
margin_right = 82.0
|
||||
margin_bottom = 21.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "ROOM 9"
|
||||
|
||||
[node name="Label" type="Label" parent="ESCBackground"]
|
||||
[node name="Label" type="Label" parent="Room9Background"]
|
||||
margin_left = 841.0
|
||||
margin_top = 7.0
|
||||
margin_right = 909.0
|
||||
margin_bottom = 21.0
|
||||
margin_right = 1158.0
|
||||
margin_bottom = 225.0
|
||||
custom_colors/font_color = Color( 0, 0, 0, 1 )
|
||||
text = "This room demonstrates a puzzle that changes
|
||||
depending on what the player does. The bottle
|
||||
@@ -495,6 +491,7 @@ script = ExtResource( 13 )
|
||||
global_id = "r9_l_exit"
|
||||
esc_script = "res://game/rooms/room09/esc/left_exit.esc"
|
||||
is_exit = true
|
||||
tooltip_name = "Left exit"
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/door_l"]
|
||||
polygon = PoolVector2Array( 0, 108, 105, 62, 108, 355, 1, 422 )
|
||||
@@ -508,6 +505,7 @@ script = ExtResource( 13 )
|
||||
global_id = "r9_r_exit"
|
||||
esc_script = "res://game/rooms/room09/esc/right_exit.esc"
|
||||
is_exit = true
|
||||
tooltip_name = "Right exit"
|
||||
|
||||
[node name="CollisionPolygon2D" type="CollisionPolygon2D" parent="Hotspots/door_r"]
|
||||
polygon = PoolVector2Array( 1174, 61, 1280, 107, 1280, 423, 1172, 353 )
|
||||
|
||||
|
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 11 KiB |
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=11 format=2]
|
||||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_exit.gd" type="Script" id=2]
|
||||
@@ -8,7 +8,6 @@
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_room.gd" type="Script" id=6]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_item.gd" type="Script" id=7]
|
||||
[ext_resource path="res://game/rooms/room10/room10background.png" type="Texture" id=10]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=11]
|
||||
|
||||
[sub_resource type="NavigationPolygon" id=1]
|
||||
vertices = PoolVector2Array( 1185.27, 712.779, 1187.27, 663.779, 1259.27, 705.779, 1260.27, 800.779, 13.2684, 699.779, 83.2684, 666.779, 85.2684, 704.779, 11.2684, 799.779, 112.268, 685.779, 1153.27, 688.779 )
|
||||
@@ -61,6 +60,7 @@ esc_script = "res://game/rooms/room10/esc/left_exit.esc"
|
||||
is_exit = true
|
||||
tooltip_name = "Left exit"
|
||||
default_action = "walk"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -80,6 +80,7 @@ global_id = "r10_btn_stop_bg_music"
|
||||
esc_script = "res://game/rooms/room10/esc/button_stop_bg_music.esc"
|
||||
tooltip_name = "stop music"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -115,6 +116,7 @@ global_id = "r10_btn_play_bg_music"
|
||||
esc_script = "res://game/rooms/room10/esc/button_play_bg_music.esc"
|
||||
tooltip_name = "play music"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -148,6 +150,7 @@ global_id = "test_accept_input"
|
||||
esc_script = "res://game/rooms/room10/esc/button_accept_input_test.esc"
|
||||
tooltip_name = "accept input"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -180,6 +183,7 @@ global_id = "button_slide"
|
||||
esc_script = "res://game/rooms/room10/esc/button_slide.esc"
|
||||
tooltip_name = "test slide"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -215,6 +219,7 @@ global_id = "button_turn_to"
|
||||
esc_script = "res://game/rooms/room10/esc/button_turn_to.esc"
|
||||
tooltip_name = "Test turn_to"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -246,6 +251,7 @@ global_id = "r10_btn_play_snd"
|
||||
esc_script = "res://game/rooms/room10/esc/button_play_snd.esc"
|
||||
tooltip_name = "play sound"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -290,24 +296,15 @@ position = Vector2( 938, 509 )
|
||||
script = ExtResource( 5 )
|
||||
global_id = "accept_input_location"
|
||||
|
||||
[node name="ESCBackground" type="TextureRect" parent="."]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
mouse_filter = 2
|
||||
texture = ExtResource( 10 )
|
||||
script = ExtResource( 11 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="room_label" type="Label" parent="ESCBackground"]
|
||||
[node name="room_label" type="Label" parent="."]
|
||||
margin_right = 92.0
|
||||
margin_bottom = 21.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "ROOM 10"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Room10Background" type="Sprite" parent="."]
|
||||
texture = ExtResource( 10 )
|
||||
centered = false
|
||||
|
||||
[node name="Room_overview" type="Node2D" parent="."]
|
||||
|
||||
@@ -336,6 +333,3 @@ boundaries. Turn_to rotates the player
|
||||
Accept_input stops the player from
|
||||
interracting with the game while an
|
||||
ESCscript is in progress."
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 480 KiB After Width: | Height: | Size: 484 KiB |
@@ -1,30 +0,0 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=1]
|
||||
|
||||
[node name="background" type="TextureRect"]
|
||||
margin_right = 1289.0
|
||||
margin_bottom = 555.0
|
||||
mouse_filter = 2
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="l_platform" type="Line2D" parent="."]
|
||||
position = Vector2( 2, -266 )
|
||||
points = PoolVector2Array( -2.96298, 712.01, 129.973, 614.429, 1167.5, 612.894, 1274.59, 669.705, 1273.25, 812.694, 2.36697, 811.043, 2.36697, 713.389 )
|
||||
|
||||
[node name="l_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -266 )
|
||||
points = PoolVector2Array( 6.61201, 704.409, 6.61203, 389.558, 87.755, 339.775, 87.5463, 649.784 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="r_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -267.828 )
|
||||
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1278.31, 672.412, 1188.64, 624.843 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=11 format=2]
|
||||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://game/rooms/room11/background.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://game/fonts/caslonantique.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=5]
|
||||
@@ -27,16 +26,29 @@ esc_script = "res://game/rooms/room11/esc/room11.esc"
|
||||
player_scene = ExtResource( 4 )
|
||||
camera_limits = [ Rect2( 0, 0, 1280, 555 ) ]
|
||||
|
||||
[node name="background" parent="." instance=ExtResource( 2 )]
|
||||
[node name="l_platform" type="Line2D" parent="."]
|
||||
position = Vector2( 2, -266 )
|
||||
points = PoolVector2Array( -2.96298, 712.01, 129.973, 614.429, 1167.5, 612.894, 1274.59, 669.705, 1273.25, 812.694, 2.36697, 811.043, 2.36697, 713.389 )
|
||||
|
||||
[node name="room_label" type="Label" parent="background"]
|
||||
[node name="l_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -266 )
|
||||
points = PoolVector2Array( 6.61201, 704.409, 6.61203, 389.558, 87.755, 339.775, 87.5463, 649.784 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="r_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -267.828 )
|
||||
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1278.31, 672.412, 1188.64, 624.843 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="room_label" type="Label" parent="."]
|
||||
margin_right = 92.0
|
||||
margin_bottom = 21.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "ROOM 11"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="walkable_area" type="Navigation2D" parent="."]
|
||||
script = ExtResource( 1 )
|
||||
@@ -58,6 +70,7 @@ esc_script = "res://game/rooms/room11/esc/left_exit.esc"
|
||||
is_exit = true
|
||||
tooltip_name = "Left exit"
|
||||
default_action = "walk"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -71,6 +84,7 @@ script = ExtResource( 5 )
|
||||
[node name="r_door" parent="Hotspots" instance=ExtResource( 8 )]
|
||||
global_id = "r11_r_exit"
|
||||
esc_script = "res://game/rooms/room11/esc/right_exit.esc"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
|
||||
[node name="ESCLocation" type="Position2D" parent="Hotspots/r_door"]
|
||||
position = Vector2( 1236.02, 366.281 )
|
||||
@@ -84,6 +98,7 @@ global_id = "r11_circle_tk"
|
||||
esc_script = "res://game/rooms/room11/esc/mysterious_circle_tk.esc"
|
||||
tooltip_name = "Mysterious circle"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -117,6 +132,7 @@ global_id = "r11_circle_nott"
|
||||
esc_script = "res://game/rooms/room11/esc/mysterious_circle_nott.esc"
|
||||
tooltip_name = "Mysterious circle"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -150,6 +166,7 @@ global_id = "r11_circle_nohud"
|
||||
esc_script = "res://game/rooms/room11/esc/mysterious_circle_nohud.esc"
|
||||
tooltip_name = "Mysterious circle"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -183,6 +200,7 @@ global_id = "r11_circle_nosave"
|
||||
esc_script = "res://game/rooms/room11/esc/mysterious_circle_nosave.esc"
|
||||
tooltip_name = "Mysterious circle"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -216,6 +234,7 @@ global_id = "r11_circle_fadein"
|
||||
esc_script = "res://game/rooms/room11/esc/mysterious_circle_fadein.esc"
|
||||
tooltip_name = "Mysterious circle"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
|
||||
@@ -4,4 +4,4 @@ say player "Blackout"
|
||||
transition fade_black out 0.0
|
||||
wait 1
|
||||
transition fade_black in 0.0
|
||||
accept_input ALL
|
||||
accept_input ALL
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=12 format=2]
|
||||
[gd_scene load_steps=11 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2]
|
||||
[ext_resource path="res://game/fonts/caslonantique.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=5]
|
||||
@@ -48,6 +47,7 @@ esc_script = "res://game/rooms/room12/esc/left_exit.esc"
|
||||
is_exit = true
|
||||
tooltip_name = "Left exit"
|
||||
default_action = "walk"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -81,6 +81,7 @@ global_id = "r12_transition_default"
|
||||
esc_script = "res://game/rooms/room12/esc/transition_default.esc"
|
||||
tooltip_name = "transition_default"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -108,6 +109,7 @@ global_id = "r12_transition_black"
|
||||
esc_script = "res://game/rooms/room12/esc/transition_black.esc"
|
||||
tooltip_name = "transition_black"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -135,6 +137,7 @@ global_id = "r12_transition_white"
|
||||
esc_script = "res://game/rooms/room12/esc/transition_white.esc"
|
||||
tooltip_name = "transition_white"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -162,6 +165,7 @@ global_id = "r12_transition_shards"
|
||||
esc_script = "res://game/rooms/room12/esc/transition_shards.esc"
|
||||
tooltip_name = "transition_shards"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -189,6 +193,7 @@ global_id = "r12_transition_centre"
|
||||
esc_script = "res://game/rooms/room12/esc/transition_centre.esc"
|
||||
tooltip_name = "transition_centre"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -216,6 +221,7 @@ global_id = "r12_transition_blackout"
|
||||
esc_script = "res://game/rooms/room12/esc/transition_blackout.esc"
|
||||
tooltip_name = "transition_blackout"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -241,26 +247,23 @@ script = ExtResource( 5 )
|
||||
global_id = "player_start"
|
||||
is_start_location = true
|
||||
|
||||
[node name="ESCBackground" type="TextureRect" parent="."]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
mouse_filter = 2
|
||||
[node name="Room12Background" type="Sprite" parent="."]
|
||||
texture = ExtResource( 9 )
|
||||
script = ExtResource( 2 )
|
||||
centered = false
|
||||
|
||||
[node name="room_label" type="Label" parent="ESCBackground"]
|
||||
[node name="room_label" type="Label" parent="Room12Background"]
|
||||
margin_right = 92.0
|
||||
margin_bottom = 45.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "ROOM 12
|
||||
"
|
||||
|
||||
[node name="room_label2" type="Label" parent="ESCBackground"]
|
||||
[node name="room_label2" type="Label" parent="Room12Background"]
|
||||
modulate = Color( 0.0352941, 0.0705882, 0.239216, 1 )
|
||||
margin_left = 121.0
|
||||
margin_top = 62.0
|
||||
margin_right = 213.0
|
||||
margin_bottom = 107.0
|
||||
margin_right = 361.0
|
||||
margin_bottom = 299.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "This room demonstrates the
|
||||
transitions you can use for room
|
||||
|
||||
|
Before Width: | Height: | Size: 386 KiB After Width: | Height: | Size: 390 KiB |
@@ -1,30 +0,0 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=1]
|
||||
|
||||
[node name="background" type="TextureRect"]
|
||||
margin_right = 1289.0
|
||||
margin_bottom = 555.0
|
||||
mouse_filter = 2
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="l_platform" type="Line2D" parent="."]
|
||||
position = Vector2( 2, -266 )
|
||||
points = PoolVector2Array( -2.96298, 712.01, 129.973, 614.429, 1167.5, 612.894, 1274.59, 669.705, 1273.25, 812.694, 2.36697, 811.043, 2.36697, 713.389 )
|
||||
|
||||
[node name="l_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -266 )
|
||||
points = PoolVector2Array( 6.61201, 704.409, 6.61203, 389.558, 87.755, 339.775, 87.5463, 649.784 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="r_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -267.828 )
|
||||
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1278.31, 672.412, 1188.64, 624.843 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=11 format=2]
|
||||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://game/rooms/room13/background.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://game/fonts/caslonantique.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_exit.gd" type="Script" id=4]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=5]
|
||||
@@ -26,16 +25,29 @@ global_id = "room13"
|
||||
esc_script = "res://game/rooms/room13/esc/room13.esc"
|
||||
camera_limits = [ Rect2( 0, 0, 1280, 555 ) ]
|
||||
|
||||
[node name="background" parent="." instance=ExtResource( 2 )]
|
||||
[node name="l_platform" type="Line2D" parent="."]
|
||||
position = Vector2( 2, -266 )
|
||||
points = PoolVector2Array( -2.96298, 712.01, 129.973, 614.429, 1167.5, 612.894, 1274.59, 669.705, 1273.25, 812.694, 2.36697, 811.043, 2.36697, 713.389 )
|
||||
|
||||
[node name="room_label" type="Label" parent="background"]
|
||||
[node name="l_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -266 )
|
||||
points = PoolVector2Array( 6.61201, 704.409, 6.61203, 389.558, 87.755, 339.775, 87.5463, 649.784 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="r_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -267.828 )
|
||||
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1278.31, 672.412, 1188.64, 624.843 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="room_label" type="Label" parent="."]
|
||||
margin_right = 92.0
|
||||
margin_bottom = 21.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "ROOM 13"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="walkable_area" type="Navigation2D" parent="."]
|
||||
script = ExtResource( 1 )
|
||||
@@ -57,6 +69,7 @@ esc_script = "res://game/rooms/room13/esc/left_exit.esc"
|
||||
is_exit = true
|
||||
tooltip_name = "Left exit"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -75,6 +88,7 @@ global_id = "r13_hint"
|
||||
esc_script = "res://game/rooms/room13/esc/hint.esc"
|
||||
tooltip_name = "A hint"
|
||||
default_action = "look"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -110,15 +124,18 @@ position = Vector2( -172.899, -45.2554 )
|
||||
global_id = "play_wav"
|
||||
esc_script = "res://game/rooms/room13/esc/play_wav.esc"
|
||||
tooltip_name = "Play WAV"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
|
||||
[node name="play_wav_loop" parent="Hotspots" instance=ExtResource( 8 )]
|
||||
position = Vector2( -173.479, 43.5148 )
|
||||
global_id = "play_wav_loop"
|
||||
esc_script = "res://game/rooms/room13/esc/play_wav_loop.esc"
|
||||
tooltip_name = "Play WAV Loop"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
|
||||
[node name="stop_loop" parent="Hotspots" instance=ExtResource( 8 )]
|
||||
position = Vector2( -173.479, 132.865 )
|
||||
global_id = "stop_loop"
|
||||
esc_script = "res://game/rooms/room13/esc/stop_loop.esc"
|
||||
tooltip_name = "Stop Looping"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=1]
|
||||
|
||||
[node name="background" type="TextureRect"]
|
||||
margin_right = 1289.0
|
||||
margin_bottom = 555.0
|
||||
mouse_filter = 2
|
||||
script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="l_platform" type="Line2D" parent="."]
|
||||
position = Vector2( 2, -266 )
|
||||
points = PoolVector2Array( -2.96298, 712.01, 129.973, 614.429, 1167.5, 612.894, 1274.59, 669.705, 1273.25, 812.694, 2.36697, 811.043, 2.36697, 713.389 )
|
||||
|
||||
[node name="l_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -266 )
|
||||
points = PoolVector2Array( 6.61201, 704.409, 6.61203, 389.558, 87.755, 339.775, 87.5463, 649.784 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="r_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -267.828 )
|
||||
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1278.31, 672.412, 1188.64, 624.843 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
@@ -1,15 +1,14 @@
|
||||
|
||||
:use
|
||||
|
||||
|
||||
# Show main menu, automatic transitions ENABLED
|
||||
show_menu main true
|
||||
show_menu main
|
||||
|
||||
# wait 2 seconds
|
||||
wait 2
|
||||
|
||||
# Hide main menu, automatic transitions ENABLED
|
||||
hide_menu main true
|
||||
hide_menu main
|
||||
|
||||
:look
|
||||
say player "button main menu"
|
||||
say player "button main menu"
|
||||
|
||||
@@ -1,41 +0,0 @@
|
||||
|
||||
:use
|
||||
|
||||
# This event demonstrates the following:
|
||||
#- fade out to black
|
||||
#- show the pause menu (automatic transition disabled to manage those manually)
|
||||
#- wait 2 seconds
|
||||
#- change scene (automatic transition disabled to manage those manually) to reload this same room
|
||||
|
||||
set_global transition_manual true
|
||||
|
||||
# Fade out to black
|
||||
transition fade_black out
|
||||
wait 2
|
||||
|
||||
# Show main menu, automatic transition DISABLED
|
||||
show_menu pause
|
||||
|
||||
# Showing menu
|
||||
transition shards in
|
||||
|
||||
# Wait 2 seconds on menu
|
||||
wait 2
|
||||
|
||||
# Transition out before hiding menu
|
||||
transition fade_black out
|
||||
|
||||
# Hide the menu
|
||||
hide_menu pause
|
||||
wait 1
|
||||
|
||||
# Do NOT transition IN as this transition will be managed by the room's :setup event!
|
||||
# If you transition IN here instead of room's :setup event, you will show the previous room
|
||||
|
||||
# Change scene to same scene, disabled automatic transition
|
||||
change_scene res://game/rooms/room14/room14.tscn false
|
||||
|
||||
# Do not transition here either, as change_scene ends the execution of this script
|
||||
|
||||
:look
|
||||
say player "Button change scene"
|
||||
@@ -1,30 +0,0 @@
|
||||
|
||||
:use
|
||||
|
||||
# This event demonstrates the following:
|
||||
#- fade out to black
|
||||
#- show the pause menu (automatic transition disabled to manage those manually)
|
||||
#- wait 2 seconds
|
||||
#- change scene (automatic transition enabled) to reload this same room
|
||||
|
||||
set_global transition_manual false
|
||||
|
||||
# Fade out to black
|
||||
transition fade_black out
|
||||
wait 2
|
||||
|
||||
# Show main menu, automatic transition DISABLED
|
||||
show_menu pause
|
||||
|
||||
# Showing menu
|
||||
transition shards in
|
||||
|
||||
# Wait 2 seconds on menu
|
||||
wait 2
|
||||
|
||||
# Change scene to same scene, enabled automatic transition
|
||||
change_scene res://game/rooms/room14/room14.tscn
|
||||
|
||||
|
||||
:look
|
||||
say player "Button change scene auto"
|
||||
@@ -1,16 +1,12 @@
|
||||
|
||||
:use
|
||||
|
||||
# Show pause menu, automatic transition are disabled by default
|
||||
# So we can manage them manually using `transition` ESC command
|
||||
# Show pause menu
|
||||
show_menu pause
|
||||
|
||||
# wait 2 seconds
|
||||
# Wait 2 seconds (this will run AFTER the pause menu is closed since the pause
|
||||
# menu also pauses the game)
|
||||
wait 2
|
||||
|
||||
# Hide pause menu, automatic transition are disabled by default
|
||||
# So we can manage them manually using `transition` ESC command
|
||||
hide_menu pause
|
||||
|
||||
:look
|
||||
say player "Button pause menu"
|
||||
say player "Button pause menu"
|
||||
|
||||
@@ -44,4 +44,4 @@
|
||||
queue_event worker moveworker _queuedemo true
|
||||
queue_event worker2 moveworker2 _queuedemo
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=12 format=2]
|
||||
[gd_scene load_steps=11 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://game/rooms/room14/background.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://game/fonts/caslonantique.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=5]
|
||||
@@ -26,9 +25,25 @@ esc_script = "res://game/rooms/room14/esc/room14.esc"
|
||||
player_scene = ExtResource( 4 )
|
||||
camera_limits = [ Rect2( 0, 0, 1280, 555 ) ]
|
||||
|
||||
[node name="background" parent="." instance=ExtResource( 2 )]
|
||||
[node name="l_platform" type="Line2D" parent="."]
|
||||
position = Vector2( 2, -266 )
|
||||
points = PoolVector2Array( -2.96298, 712.01, 129.973, 614.429, 1167.5, 612.894, 1274.59, 669.705, 1273.25, 812.694, 2.36697, 811.043, 2.36697, 713.389 )
|
||||
|
||||
[node name="room_label" type="Label" parent="background"]
|
||||
[node name="l_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -266 )
|
||||
points = PoolVector2Array( 6.61201, 704.409, 6.61203, 389.558, 87.755, 339.775, 87.5463, 649.784 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="r_door" type="Line2D" parent="."]
|
||||
position = Vector2( 0, -267.828 )
|
||||
points = PoolVector2Array( 1175.07, 620.086, 1171.24, 311.267, 1274.8, 356.87, 1278.31, 672.412, 1188.64, 624.843 )
|
||||
__meta__ = {
|
||||
"_editor_description_": ""
|
||||
}
|
||||
|
||||
[node name="room_label" type="Label" parent="."]
|
||||
margin_right = 92.0
|
||||
margin_bottom = 21.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
@@ -100,13 +115,8 @@ margin_top = 194.216
|
||||
margin_right = 408.569
|
||||
margin_bottom = 259.216
|
||||
text = "Show main menu
|
||||
with automatic
|
||||
transitions enabled
|
||||
"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="show_pause_menu" parent="." instance=ExtResource( 9 )]
|
||||
position = Vector2( 233.415, 0 )
|
||||
@@ -123,59 +133,9 @@ margin_left = 273.915
|
||||
margin_top = 194.216
|
||||
margin_right = 413.915
|
||||
margin_bottom = 242.216
|
||||
text = "Show pause menu
|
||||
with NO transition
|
||||
(manual or automatic)"
|
||||
text = "Show pause menu"
|
||||
align = 1
|
||||
|
||||
[node name="show_pause_change_scene_manual" parent="." instance=ExtResource( 9 )]
|
||||
position = Vector2( 463.318, 0 )
|
||||
global_id = "button_main_change_scene"
|
||||
esc_script = "res://game/rooms/room14/esc/button_main_menu_change_scene.esc"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
|
||||
[node name="ESCLocation" type="Position2D" parent="show_pause_change_scene_manual"]
|
||||
position = Vector2( 343.887, 381.305 )
|
||||
script = ExtResource( 5 )
|
||||
|
||||
[node name="Label" type="Label" parent="show_pause_change_scene_manual"]
|
||||
margin_left = 277.027
|
||||
margin_top = 194.0
|
||||
margin_right = 428.027
|
||||
margin_bottom = 259.0
|
||||
text = "Show pause menu with
|
||||
manual transition
|
||||
and change_scene with
|
||||
manual transition"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="show_pause_change_scene_auto" parent="." instance=ExtResource( 9 )]
|
||||
position = Vector2( 676.318, 0 )
|
||||
global_id = "button_pause_change_scene_auto"
|
||||
esc_script = "res://game/rooms/room14/esc/button_main_menu_change_scene_auto.esc"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
|
||||
[node name="ESCLocation" type="Position2D" parent="show_pause_change_scene_auto"]
|
||||
position = Vector2( 343.887, 381.305 )
|
||||
script = ExtResource( 5 )
|
||||
|
||||
[node name="Label" type="Label" parent="show_pause_change_scene_auto"]
|
||||
margin_left = 277.027
|
||||
margin_top = 194.0
|
||||
margin_right = 428.027
|
||||
margin_bottom = 259.0
|
||||
text = "Show pause menu with
|
||||
manual transition
|
||||
and change_scene with
|
||||
automatic transition"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="worker" parent="." instance=ExtResource( 10 )]
|
||||
position = Vector2( 204.268, 376.233 )
|
||||
esc_script = "res://game/rooms/room14/esc/worker.esc"
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
[gd_scene load_steps=2 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=1]
|
||||
|
||||
[node name="background" type="TextureRect"]
|
||||
margin_right = 1289.0
|
||||
margin_bottom = 555.0
|
||||
mouse_filter = 2
|
||||
script = ExtResource( 1 )
|
||||
|
Before Width: | Height: | Size: 204 KiB After Width: | Height: | Size: 206 KiB |
@@ -1,7 +1,6 @@
|
||||
[gd_scene load_steps=11 format=2]
|
||||
[gd_scene load_steps=10 format=2]
|
||||
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_terrain.gd" type="Script" id=1]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_background.gd" type="Script" id=2]
|
||||
[ext_resource path="res://game/fonts/caslonantique.tres" type="DynamicFont" id=3]
|
||||
[ext_resource path="res://game/characters/mark/mark.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://addons/escoria-core/game/core-scripts/esc_location.gd" type="Script" id=5]
|
||||
@@ -25,19 +24,16 @@ esc_script = "res://game/rooms/room15/esc/room15.esc"
|
||||
player_scene = ExtResource( 4 )
|
||||
camera_limits = [ Rect2( 0, 0, 1280, 555 ) ]
|
||||
|
||||
[node name="ESCBackground" type="TextureRect" parent="."]
|
||||
margin_right = 40.0
|
||||
margin_bottom = 40.0
|
||||
mouse_filter = 2
|
||||
[node name="Room15" type="Sprite" parent="."]
|
||||
texture = ExtResource( 8 )
|
||||
script = ExtResource( 2 )
|
||||
centered = false
|
||||
|
||||
[node name="ColorRect" type="ColorRect" parent="ESCBackground"]
|
||||
[node name="ColorRect" type="ColorRect" parent="Room15"]
|
||||
margin_right = 387.0
|
||||
margin_bottom = 207.0
|
||||
color = Color( 0, 0, 0, 0.501961 )
|
||||
|
||||
[node name="description" type="Label" parent="ESCBackground/ColorRect"]
|
||||
[node name="description" type="Label" parent="Room15/ColorRect"]
|
||||
margin_left = 9.0
|
||||
margin_top = 32.0
|
||||
margin_right = 615.0
|
||||
@@ -49,20 +45,20 @@ player will spawn at starting location if there is one.
|
||||
If there is none, the player will spawn at origin
|
||||
(0,0), top-left corner of the screen. "
|
||||
|
||||
[node name="room_label" type="Label" parent="ESCBackground/ColorRect"]
|
||||
[node name="room_label" type="Label" parent="Room15/ColorRect"]
|
||||
margin_right = 92.0
|
||||
margin_bottom = 21.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "ROOM 15"
|
||||
|
||||
[node name="ColorRect2" type="ColorRect" parent="ESCBackground"]
|
||||
[node name="ColorRect2" type="ColorRect" parent="Room15"]
|
||||
margin_left = 461.0
|
||||
margin_top = 393.0
|
||||
margin_right = 847.0
|
||||
margin_bottom = 433.0
|
||||
color = Color( 0, 0, 0, 0.501961 )
|
||||
|
||||
[node name="description" type="Label" parent="ESCBackground/ColorRect2"]
|
||||
[node name="description" type="Label" parent="Room15/ColorRect2"]
|
||||
margin_left = 9.0
|
||||
margin_top = 9.0
|
||||
margin_right = 615.0
|
||||
@@ -70,14 +66,14 @@ margin_bottom = 195.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Use the second door to change between costumes"
|
||||
|
||||
[node name="ColorRect3" type="ColorRect" parent="ESCBackground"]
|
||||
[node name="ColorRect3" type="ColorRect" parent="Room15"]
|
||||
margin_left = 22.0
|
||||
margin_top = 505.0
|
||||
margin_right = 322.0
|
||||
margin_bottom = 545.0
|
||||
color = Color( 0, 0, 0, 0.501961 )
|
||||
|
||||
[node name="description" type="Label" parent="ESCBackground/ColorRect3"]
|
||||
[node name="description" type="Label" parent="Room15/ColorRect3"]
|
||||
margin_left = 9.0
|
||||
margin_top = 9.0
|
||||
margin_right = 615.0
|
||||
@@ -85,14 +81,14 @@ margin_bottom = 195.0
|
||||
custom_fonts/font = ExtResource( 3 )
|
||||
text = "Use the left column for say long left"
|
||||
|
||||
[node name="ColorRect4" type="ColorRect" parent="ESCBackground"]
|
||||
[node name="ColorRect4" type="ColorRect" parent="Room15"]
|
||||
margin_left = 952.0
|
||||
margin_top = 502.0
|
||||
margin_right = 1262.0
|
||||
margin_bottom = 542.0
|
||||
color = Color( 0, 0, 0, 0.501961 )
|
||||
|
||||
[node name="description" type="Label" parent="ESCBackground/ColorRect4"]
|
||||
[node name="description" type="Label" parent="Room15/ColorRect4"]
|
||||
margin_left = 9.0
|
||||
margin_top = 9.0
|
||||
margin_right = 615.0
|
||||
@@ -123,6 +119,7 @@ esc_script = "res://game/rooms/room15/esc/left_exit.esc"
|
||||
is_exit = true
|
||||
tooltip_name = "Left exit"
|
||||
default_action = "walk"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -143,6 +140,7 @@ esc_script = "res://game/rooms/room15/esc/right_exit.esc"
|
||||
is_exit = true
|
||||
tooltip_name = "Right exit"
|
||||
default_action = "walk"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -171,6 +169,7 @@ global_id = "say_long_left"
|
||||
esc_script = "res://game/rooms/room15/esc/say_long.esc"
|
||||
tooltip_name = "Say long test left"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -188,6 +187,7 @@ global_id = "say_long_right"
|
||||
esc_script = "res://game/rooms/room15/esc/say_long.esc"
|
||||
tooltip_name = "Say long test right"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
@@ -205,6 +205,7 @@ global_id = "switch_animation"
|
||||
esc_script = "res://game/rooms/room15/esc/switch_animation.esc"
|
||||
tooltip_name = "Switch animation"
|
||||
default_action = "use"
|
||||
combine_when_selected_action_is_in = [ ]
|
||||
dialog_color = Color( 1, 1, 1, 1 )
|
||||
animations = null
|
||||
|
||||
|
||||