Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce a signal bus singleton for the plugin interface #67

Closed
stickgrinder opened this issue Jul 2, 2023 · 3 comments
Closed

Introduce a signal bus singleton for the plugin interface #67

stickgrinder opened this issue Jul 2, 2023 · 3 comments
Labels
improvement New feature or request proposal An idea that still needs to be fleshed-out

Comments

@stickgrinder
Copy link
Collaborator

At the time of writing, the plugin UI elements (docks, popups, inspectors) present a strong coupling between them and the underlying logic.

An example is that the Popochiu entities (characters, items, rooms, props, etc) logic is held by the related popup classes.
Working on #37 forced me to refactor this logic into helper classes which highlighted the need to pass the main dock reference as well as the room tab reference over between scripts so that encapsulated logic (ex. the one to add a newly created props to the props list in the room tab) can be called where things happen.

This doesn't scale well.

Proposal

My proposal is to introduce a singleton that acts like a signals bus, which is a pretty common design pattern in these cases.
I was researching the topic to understand if Godot provided this at the engine level but it doesn't seem so (the only implemented pattern is the Observer), while I stumbled onto those two very good articles by GDScript:

I'm not sure we can use singletons even at the plugin level but I hope so.
We can discuss this proposal in the meantime. Does this make sense? Is it worth in the team's opinion?

@stickgrinder stickgrinder added improvement New feature or request help wanted Extra attention is needed proposal An idea that still needs to be fleshed-out and removed help wanted Extra attention is needed labels Jul 2, 2023
stickgrinder added a commit that referenced this issue Jul 2, 2023
stickgrinder added a commit that referenced this issue Jul 2, 2023
stickgrinder added a commit that referenced this issue Jul 2, 2023
@stickgrinder
Copy link
Collaborator Author

stickgrinder commented Jul 3, 2023

Comment to self, relative to "using singletons in plugins".

As I imagined, it doesn't seem to work that way (not with the autoload feature, at least), but there is a workaround: godotengine/godot#4236 (comment)

An alternative is to actually implement the singleton pattern in a class or have a static/factory method to retrieve the singleton instance.

@stickgrinder
Copy link
Collaborator Author

This is also relevant to what I wrote about implementing a proper singleton at plugin level: https://www.reddit.com/r/godot/comments/134lk0p/comment/jiggacp/?utm_source=share&utm_medium=web2x&context=3

stickgrinder added a commit that referenced this issue Aug 28, 2023
stickgrinder added a commit that referenced this issue Dec 27, 2023
refs #37: Preparation for refactoring of importer code.

refs #37: The plugin is now ready for the implementation of the Room importing logic.

refs #37: WIP refactoring the prop creation logic. It works but needs heavy polishing.

refs #37: Open #67 about the heavy polishing, in the meantime this reduce the passing-over of UI elements.

refs #37: Changed commit language.

refs #37: Refactored the region creation following the new template. Added a base class to limit code-duplication.

refs #37: Refactored the walkable areas too.

refs #37: Refactored the hotspots creation too.

refs #37: Project file updated to Godot 4.1

refs #37: Rooms creation have been refactored.

refs #37: Characters creation have been refactored.

refs #37: Inventory items creation have been refactored.

refs #37: Dialog creation have been refactored.

refs #37: some code dedup on type helpers.

refs #37: code dedup in helpers should be over. Also addressed annoying Godot 4.1 bug.

refs #37: all creation helpers have been renamed to factories.

refs #37: factories init methods changed to real constructors.

refs #37: renamed and added internal factories variables for better readability.

refs #37: Fixed inconsistency in inventory items file naming.

refs #37: Renamed local variables in factory classes.

refs #37: Switch to a success state return strategy to bubble feedback up to the popup.

refs #37: Fixed wrong ownership for room objects children bug.

refs #37: Cleaned up useless and hard-to-maintain references to the obj types in comments. Addresses PR comments by @carenalga.

refs #37: Renamed factories private members to reduce unnecessary verbosity.

refs #37: Solved error message about invalid ownership when creating room objects.

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: A lot of code rewriting to make the base feature work. It works :)

refs #37: More work to get rid of strange execution errors.

refs #37: moving stuff in a desperate attempt to make this working in a predictable way.

refs #37: changed the importing flow strategy to circumvent a nasty error on linux with filesystem signals availability.

refs #37: off-by-one error fixed in animation frames range.

refs #37: fixed an error I probably inherited from another branch.

TEST1: messing with importer.

refs #37: worked around the console error when packing a scene with not-owned children (please see Godot GH-81982 for details).

refs #37: visibility toggle in the importer interface is now working as intended.

refs #37: all props now have an attached script, even the non-clickable ones; the importer is now able to update visibility and clickability status of already imported props.

refs #37: InteractionPolygons for props and hotspots have been moved in the scene and an edit button has been exposed in the toolbar to edit them.

Fix missing images when importing room from Aseprite (#110)

Store polygon for interaction in @export var

This will allow to keep the data of the polygon in the .tscn file of the
room so the InteractionPolygon.polygon data of each prop is overwritten
by the room both in runtime and while editing the room.

NOTE: The polygon of the InteractionPolygon in each prop is not saved in
the prop's scene file yet.

Add comments and broke some long lines

refs #37: InteractionPolygons icon is now more readable.

Fixes for post-import error message (#126)

* Fix Output error after importing room

* Fix error message after closing room import popup

The problem was caused because the popup was being added to the Room
tree. Now it is added to Popochiu's main dock.

* Temporary fix for bad row naming after import

* Imported prop image is placed in the prop's folder

Fix Aseprite importer section not showing in Inspector for room

refs #37: Added a feature flag to Editor Settings, to disable Aseprite Importer for those who does not use Aseprite.

refs #37: Fixed a warning related to EditorInterface being a singleton in 4.2.
stickgrinder added a commit that referenced this issue Dec 28, 2023
refs #37: Preparation for refactoring of importer code.

refs #37: The plugin is now ready for the implementation of the Room importing logic.

refs #37: WIP refactoring the prop creation logic. It works but needs heavy polishing.

refs #37: Open #67 about the heavy polishing, in the meantime this reduce the passing-over of UI elements.

refs #37: Changed commit language.

refs #37: Refactored the region creation following the new template. Added a base class to limit code-duplication.

refs #37: Refactored the walkable areas too.

refs #37: Refactored the hotspots creation too.

refs #37: Project file updated to Godot 4.1

refs #37: Rooms creation have been refactored.

refs #37: Characters creation have been refactored.

refs #37: Inventory items creation have been refactored.

refs #37: Dialog creation have been refactored.

refs #37: some code dedup on type helpers.

refs #37: code dedup in helpers should be over. Also addressed annoying Godot 4.1 bug.

refs #37: all creation helpers have been renamed to factories.

refs #37: factories init methods changed to real constructors.

refs #37: renamed and added internal factories variables for better readability.

refs #37: Fixed inconsistency in inventory items file naming.

refs #37: Renamed local variables in factory classes.

refs #37: Switch to a success state return strategy to bubble feedback up to the popup.

refs #37: Fixed wrong ownership for room objects children bug.

refs #37: Cleaned up useless and hard-to-maintain references to the obj types in comments. Addresses PR comments by @carenalga.

refs #37: Renamed factories private members to reduce unnecessary verbosity.

refs #37: Solved error message about invalid ownership when creating room objects.

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: A lot of code rewriting to make the base feature work. It works :)

refs #37: More work to get rid of strange execution errors.

refs #37: moving stuff in a desperate attempt to make this working in a predictable way.

refs #37: changed the importing flow strategy to circumvent a nasty error on linux with filesystem signals availability.

refs #37: off-by-one error fixed in animation frames range.

refs #37: fixed an error I probably inherited from another branch.

TEST1: messing with importer.

refs #37: worked around the console error when packing a scene with not-owned children (please see Godot GH-81982 for details).

refs #37: visibility toggle in the importer interface is now working as intended.

refs #37: all props now have an attached script, even the non-clickable ones; the importer is now able to update visibility and clickability status of already imported props.

refs #37: InteractionPolygons for props and hotspots have been moved in the scene and an edit button has been exposed in the toolbar to edit them.

Fix missing images when importing room from Aseprite (#110)

Store polygon for interaction in @export var

This will allow to keep the data of the polygon in the .tscn file of the
room so the InteractionPolygon.polygon data of each prop is overwritten
by the room both in runtime and while editing the room.

NOTE: The polygon of the InteractionPolygon in each prop is not saved in
the prop's scene file yet.

Add comments and broke some long lines

refs #37: InteractionPolygons icon is now more readable.

Fixes for post-import error message (#126)

* Fix Output error after importing room

* Fix error message after closing room import popup

The problem was caused because the popup was being added to the Room
tree. Now it is added to Popochiu's main dock.

* Temporary fix for bad row naming after import

* Imported prop image is placed in the prop's folder

Fix Aseprite importer section not showing in Inspector for room

refs #37: Added a feature flag to Editor Settings, to disable Aseprite Importer for those who does not use Aseprite.

refs #37: Fixed a warning related to EditorInterface being a singleton in 4.2.
mapedorr added a commit that referenced this issue Dec 28, 2023
…s creation refactoring (#64)

* refs #37: Squashed Room Importer and Objects creation refactoring.

refs #37: Preparation for refactoring of importer code.

refs #37: The plugin is now ready for the implementation of the Room importing logic.

refs #37: WIP refactoring the prop creation logic. It works but needs heavy polishing.

refs #37: Open #67 about the heavy polishing, in the meantime this reduce the passing-over of UI elements.

refs #37: Changed commit language.

refs #37: Refactored the region creation following the new template. Added a base class to limit code-duplication.

refs #37: Refactored the walkable areas too.

refs #37: Refactored the hotspots creation too.

refs #37: Project file updated to Godot 4.1

refs #37: Rooms creation have been refactored.

refs #37: Characters creation have been refactored.

refs #37: Inventory items creation have been refactored.

refs #37: Dialog creation have been refactored.

refs #37: some code dedup on type helpers.

refs #37: code dedup in helpers should be over. Also addressed annoying Godot 4.1 bug.

refs #37: all creation helpers have been renamed to factories.

refs #37: factories init methods changed to real constructors.

refs #37: renamed and added internal factories variables for better readability.

refs #37: Fixed inconsistency in inventory items file naming.

refs #37: Renamed local variables in factory classes.

refs #37: Switch to a success state return strategy to bubble feedback up to the popup.

refs #37: Fixed wrong ownership for room objects children bug.

refs #37: Cleaned up useless and hard-to-maintain references to the obj types in comments. Addresses PR comments by @carenalga.

refs #37: Renamed factories private members to reduce unnecessary verbosity.

refs #37: Solved error message about invalid ownership when creating room objects.

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: A lot of code rewriting to make the base feature work. It works :)

refs #37: More work to get rid of strange execution errors.

refs #37: moving stuff in a desperate attempt to make this working in a predictable way.

refs #37: changed the importing flow strategy to circumvent a nasty error on linux with filesystem signals availability.

refs #37: off-by-one error fixed in animation frames range.

refs #37: fixed an error I probably inherited from another branch.

TEST1: messing with importer.

refs #37: worked around the console error when packing a scene with not-owned children (please see Godot GH-81982 for details).

refs #37: visibility toggle in the importer interface is now working as intended.

refs #37: all props now have an attached script, even the non-clickable ones; the importer is now able to update visibility and clickability status of already imported props.

refs #37: InteractionPolygons for props and hotspots have been moved in the scene and an edit button has been exposed in the toolbar to edit them.

Fix missing images when importing room from Aseprite (#110)

Store polygon for interaction in @export var

This will allow to keep the data of the polygon in the .tscn file of the
room so the InteractionPolygon.polygon data of each prop is overwritten
by the room both in runtime and while editing the room.

NOTE: The polygon of the InteractionPolygon in each prop is not saved in
the prop's scene file yet.

Add comments and broke some long lines

refs #37: InteractionPolygons icon is now more readable.

Fixes for post-import error message (#126)

* Fix Output error after importing room

* Fix error message after closing room import popup

The problem was caused because the popup was being added to the Room
tree. Now it is added to Popochiu's main dock.

* Temporary fix for bad row naming after import

* Imported prop image is placed in the prop's folder

Fix Aseprite importer section not showing in Inspector for room

refs #37: Added a feature flag to Editor Settings, to disable Aseprite Importer for those who does not use Aseprite.

refs #37: Fixed a warning related to EditorInterface being a singleton in 4.2.

* refs #37: Removed leftovers after squashing and rebasing over 2.0

* Fix post-rebase issues about main_dock

---------

Co-authored-by: carenalga <[email protected]>
mapedorr added a commit that referenced this issue Feb 18, 2024
…s creation refactoring (#64)

* refs #37: Squashed Room Importer and Objects creation refactoring.

refs #37: Preparation for refactoring of importer code.

refs #37: The plugin is now ready for the implementation of the Room importing logic.

refs #37: WIP refactoring the prop creation logic. It works but needs heavy polishing.

refs #37: Open #67 about the heavy polishing, in the meantime this reduce the passing-over of UI elements.

refs #37: Changed commit language.

refs #37: Refactored the region creation following the new template. Added a base class to limit code-duplication.

refs #37: Refactored the walkable areas too.

refs #37: Refactored the hotspots creation too.

refs #37: Project file updated to Godot 4.1

refs #37: Rooms creation have been refactored.

refs #37: Characters creation have been refactored.

refs #37: Inventory items creation have been refactored.

refs #37: Dialog creation have been refactored.

refs #37: some code dedup on type helpers.

refs #37: code dedup in helpers should be over. Also addressed annoying Godot 4.1 bug.

refs #37: all creation helpers have been renamed to factories.

refs #37: factories init methods changed to real constructors.

refs #37: renamed and added internal factories variables for better readability.

refs #37: Fixed inconsistency in inventory items file naming.

refs #37: Renamed local variables in factory classes.

refs #37: Switch to a success state return strategy to bubble feedback up to the popup.

refs #37: Fixed wrong ownership for room objects children bug.

refs #37: Cleaned up useless and hard-to-maintain references to the obj types in comments. Addresses PR comments by @carenalga.

refs #37: Renamed factories private members to reduce unnecessary verbosity.

refs #37: Solved error message about invalid ownership when creating room objects.

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: A lot of code rewriting to make the base feature work. It works :)

refs #37: More work to get rid of strange execution errors.

refs #37: moving stuff in a desperate attempt to make this working in a predictable way.

refs #37: changed the importing flow strategy to circumvent a nasty error on linux with filesystem signals availability.

refs #37: off-by-one error fixed in animation frames range.

refs #37: fixed an error I probably inherited from another branch.

TEST1: messing with importer.

refs #37: worked around the console error when packing a scene with not-owned children (please see Godot GH-81982 for details).

refs #37: visibility toggle in the importer interface is now working as intended.

refs #37: all props now have an attached script, even the non-clickable ones; the importer is now able to update visibility and clickability status of already imported props.

refs #37: InteractionPolygons for props and hotspots have been moved in the scene and an edit button has been exposed in the toolbar to edit them.

Fix missing images when importing room from Aseprite (#110)

Store polygon for interaction in @export var

This will allow to keep the data of the polygon in the .tscn file of the
room so the InteractionPolygon.polygon data of each prop is overwritten
by the room both in runtime and while editing the room.

NOTE: The polygon of the InteractionPolygon in each prop is not saved in
the prop's scene file yet.

Add comments and broke some long lines

refs #37: InteractionPolygons icon is now more readable.

Fixes for post-import error message (#126)

* Fix Output error after importing room

* Fix error message after closing room import popup

The problem was caused because the popup was being added to the Room
tree. Now it is added to Popochiu's main dock.

* Temporary fix for bad row naming after import

* Imported prop image is placed in the prop's folder

Fix Aseprite importer section not showing in Inspector for room

refs #37: Added a feature flag to Editor Settings, to disable Aseprite Importer for those who does not use Aseprite.

refs #37: Fixed a warning related to EditorInterface being a singleton in 4.2.

* refs #37: Removed leftovers after squashing and rebasing over 2.0

* Fix post-rebase issues about main_dock

---------

Co-authored-by: carenalga <[email protected]>
stickgrinder added a commit that referenced this issue Feb 25, 2024
…s creation refactoring (#64)

* refs #37: Squashed Room Importer and Objects creation refactoring.

refs #37: Preparation for refactoring of importer code.

refs #37: The plugin is now ready for the implementation of the Room importing logic.

refs #37: WIP refactoring the prop creation logic. It works but needs heavy polishing.

refs #37: Open #67 about the heavy polishing, in the meantime this reduce the passing-over of UI elements.

refs #37: Changed commit language.

refs #37: Refactored the region creation following the new template. Added a base class to limit code-duplication.

refs #37: Refactored the walkable areas too.

refs #37: Refactored the hotspots creation too.

refs #37: Project file updated to Godot 4.1

refs #37: Rooms creation have been refactored.

refs #37: Characters creation have been refactored.

refs #37: Inventory items creation have been refactored.

refs #37: Dialog creation have been refactored.

refs #37: some code dedup on type helpers.

refs #37: code dedup in helpers should be over. Also addressed annoying Godot 4.1 bug.

refs #37: all creation helpers have been renamed to factories.

refs #37: factories init methods changed to real constructors.

refs #37: renamed and added internal factories variables for better readability.

refs #37: Fixed inconsistency in inventory items file naming.

refs #37: Renamed local variables in factory classes.

refs #37: Switch to a success state return strategy to bubble feedback up to the popup.

refs #37: Fixed wrong ownership for room objects children bug.

refs #37: Cleaned up useless and hard-to-maintain references to the obj types in comments. Addresses PR comments by @carenalga.

refs #37: Renamed factories private members to reduce unnecessary verbosity.

refs #37: Solved error message about invalid ownership when creating room objects.

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: A lot of code rewriting to make the base feature work. It works :)

refs #37: More work to get rid of strange execution errors.

refs #37: moving stuff in a desperate attempt to make this working in a predictable way.

refs #37: changed the importing flow strategy to circumvent a nasty error on linux with filesystem signals availability.

refs #37: off-by-one error fixed in animation frames range.

refs #37: fixed an error I probably inherited from another branch.

TEST1: messing with importer.

refs #37: worked around the console error when packing a scene with not-owned children (please see Godot GH-81982 for details).

refs #37: visibility toggle in the importer interface is now working as intended.

refs #37: all props now have an attached script, even the non-clickable ones; the importer is now able to update visibility and clickability status of already imported props.

refs #37: InteractionPolygons for props and hotspots have been moved in the scene and an edit button has been exposed in the toolbar to edit them.

Fix missing images when importing room from Aseprite (#110)

Store polygon for interaction in @export var

This will allow to keep the data of the polygon in the .tscn file of the
room so the InteractionPolygon.polygon data of each prop is overwritten
by the room both in runtime and while editing the room.

NOTE: The polygon of the InteractionPolygon in each prop is not saved in
the prop's scene file yet.

Add comments and broke some long lines

refs #37: InteractionPolygons icon is now more readable.

Fixes for post-import error message (#126)

* Fix Output error after importing room

* Fix error message after closing room import popup

The problem was caused because the popup was being added to the Room
tree. Now it is added to Popochiu's main dock.

* Temporary fix for bad row naming after import

* Imported prop image is placed in the prop's folder

Fix Aseprite importer section not showing in Inspector for room

refs #37: Added a feature flag to Editor Settings, to disable Aseprite Importer for those who does not use Aseprite.

refs #37: Fixed a warning related to EditorInterface being a singleton in 4.2.

* refs #37: Removed leftovers after squashing and rebasing over 2.0

* Fix post-rebase issues about main_dock

---------

Co-authored-by: carenalga <[email protected]>
mapedorr added a commit that referenced this issue Feb 25, 2024
* refs #37: Rooms Aseprite importer preparatory code and PopochiuObjects creation refactoring (#64)

* refs #37: Squashed Room Importer and Objects creation refactoring.

refs #37: Preparation for refactoring of importer code.

refs #37: The plugin is now ready for the implementation of the Room importing logic.

refs #37: WIP refactoring the prop creation logic. It works but needs heavy polishing.

refs #37: Open #67 about the heavy polishing, in the meantime this reduce the passing-over of UI elements.

refs #37: Changed commit language.

refs #37: Refactored the region creation following the new template. Added a base class to limit code-duplication.

refs #37: Refactored the walkable areas too.

refs #37: Refactored the hotspots creation too.

refs #37: Project file updated to Godot 4.1

refs #37: Rooms creation have been refactored.

refs #37: Characters creation have been refactored.

refs #37: Inventory items creation have been refactored.

refs #37: Dialog creation have been refactored.

refs #37: some code dedup on type helpers.

refs #37: code dedup in helpers should be over. Also addressed annoying Godot 4.1 bug.

refs #37: all creation helpers have been renamed to factories.

refs #37: factories init methods changed to real constructors.

refs #37: renamed and added internal factories variables for better readability.

refs #37: Fixed inconsistency in inventory items file naming.

refs #37: Renamed local variables in factory classes.

refs #37: Switch to a success state return strategy to bubble feedback up to the popup.

refs #37: Fixed wrong ownership for room objects children bug.

refs #37: Cleaned up useless and hard-to-maintain references to the obj types in comments. Addresses PR comments by @carenalga.

refs #37: Renamed factories private members to reduce unnecessary verbosity.

refs #37: Solved error message about invalid ownership when creating room objects.

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: A lot of code rewriting to make the base feature work. It works :)

refs #37: More work to get rid of strange execution errors.

refs #37: moving stuff in a desperate attempt to make this working in a predictable way.

refs #37: changed the importing flow strategy to circumvent a nasty error on linux with filesystem signals availability.

refs #37: off-by-one error fixed in animation frames range.

refs #37: fixed an error I probably inherited from another branch.

TEST1: messing with importer.

refs #37: worked around the console error when packing a scene with not-owned children (please see Godot GH-81982 for details).

refs #37: visibility toggle in the importer interface is now working as intended.

refs #37: all props now have an attached script, even the non-clickable ones; the importer is now able to update visibility and clickability status of already imported props.

refs #37: InteractionPolygons for props and hotspots have been moved in the scene and an edit button has been exposed in the toolbar to edit them.

Fix missing images when importing room from Aseprite (#110)

Store polygon for interaction in @export var

This will allow to keep the data of the polygon in the .tscn file of the
room so the InteractionPolygon.polygon data of each prop is overwritten
by the room both in runtime and while editing the room.

NOTE: The polygon of the InteractionPolygon in each prop is not saved in
the prop's scene file yet.

Add comments and broke some long lines

refs #37: InteractionPolygons icon is now more readable.

Fixes for post-import error message (#126)

* Fix Output error after importing room

* Fix error message after closing room import popup

The problem was caused because the popup was being added to the Room
tree. Now it is added to Popochiu's main dock.

* Temporary fix for bad row naming after import

* Imported prop image is placed in the prop's folder

Fix Aseprite importer section not showing in Inspector for room

refs #37: Added a feature flag to Editor Settings, to disable Aseprite Importer for those who does not use Aseprite.

refs #37: Fixed a warning related to EditorInterface being a singleton in 4.2.

* refs #37: Removed leftovers after squashing and rebasing over 2.0

* Fix post-rebase issues about main_dock

---------

Co-authored-by: carenalga <[email protected]>

* refs #40: New GUIs subsystem

* GUI templates and game commands

Progress on refactoring the GI

Progress on working with 9 verbs

First draft of the Sierra GUI implementation

Created the `g.gd` script to test an approach for accessing the commands
defined for the graphic interface.
Moved the Toolbar folder to the popochiu template folder since that
component will be part of that GUI only.
Added a function to "replace" the default cursor. This still needs
improvements or a complete refactor.

GUI template selection in Setup popup

Refactorization of GUI template commands

This fixes a dependency generated when having the commands of the current GUI in the g.gd singleton. Now each GUI has its own commands Resource class.
Selecting the GUI template in the Setup popup is now working without bugs.

Changed Popochiu GUI template name to BASS

Usability improvements in 9 verb interface

Sound settings script moved to BASS' toolbar folder

History popup working again in BASS template

upd: Lines in History to RichTextLabel so one can uses colors to
highlight characters, commands and props.
fea: Improved the way BASS handles mouse positioning to open/close the
inventory and the settings.
upd: Renamed scene and script filenames from Toolbar to SettingsBar.

PopochiuPopup are now used by History, Save and Load and Sound settings.

upd: Updated the Settings popup for the 9 verb interface. Now it allows to
Save, Load, open the History, and update sound volumes.
upd: New appearance for Sound volumes sliders.
upd: Created Sound volumes component, so devs can use the sliders
without having to use a popup.
fea: Created Settings icon for settings button in 9 verb interface.
upd: Created cursor for UI elements in 9 verb interface.
fix: Opening the SaveAndLoad popup when saving no longer requires to
pass a String as a parameter.

upd: new style for 9 verb interface

Now it get closer to the style used in Thimbleweed Park.
fea: created icons for GUI templates in the Setup window.
fea: added option to 9 verb settings popup to choose between classic and
modern sentences.
fea: created sprites and style for CheckButton.

Sierra theme styles updated

This is for PanelContainers and Buttons.
Created inventory popup for Sierra GUI.
Created USE cursor for Sierra GUI.
Created top bar (hover text + score) panel for Sierra GUI.
Fixed some bugs in the Sierra GUI.
Working on making the inventory popup to work properly in Sierra GUI.

SystemText working again.

fix: showing the SystemText blocks interactions until players click
anywhere to close the panel.
upd: `G.display` changed to `G.show_system_text`.
fea: basic inventory functionality working in Sierra GUI. Players can
inspect items and select them for use. Once used, the item disappears
from the inventory grid.

First approach on having varios dialog text types

Devs can choose between Above character, Portrait and Caption.
The implementation is still hardcoded in various parts. Improvements
will come soon.

Fix: cursor behavior in Sierra inventory popup.

fix: the error related to set_name.call_deferred is now solved.
Working on fix for C singleton.

Fallback for commands improved

Code refactor and improvements for DialogText.

upd: Now the now supports the three display modes (Above character, Portrait
and Caption) by itself.
fix: #79 .
fix: Recognizing emotions in dialog lines for `E.queue` was not working.
upd: Added support for avatars with emotions in PopochiuCharacter.
upd: Portrait mode displays the avatar of the talking character (with
its corresponding emotion).

Improved CAPTION text style rendering.

Fixes and minor improvements in DialogText rendering.
Updated properties in scaling and layout for PopochiuInventoryItem.

9 verb inventory scroll working

It takes into account the size of each slot, the size of the gaps
between rows and the number of rows.
This inventory panel adds items to the i_inventory based on what the
scene tree has.
NEXT >> Make this as a component that can work in a popup (i.e. in the
Sierra inventory popup).

Progress on 9 verb inventory functionality

Can trigger commands on inventory items.
Can use inventory items with popochiu clickable and other inventory
items.

fea: Make suggested command to work

This applies for PopochiuClickable and PopochiuInventoryItem (which
suggested verb will be always LOOK AT).
fea: Try calling the left click version of a command before triggering
its fallback (this applies to PopochiuClickable and
PopochiuInventoryItem).

NEXT >> [9 verb] Make inventory container to re-arrange after removing an
inventory item.

fea: can remove items in 9 verb inventory

Removing the item also removes the slot it belongs to, which ensures the
container will re-arrange correctly. A new slot is created after
removing the item.

NEXT >> Allow to replace an item (useful for combining items).

fea: Adds method to replace an inventory item

The new inventory item replaces the one that calls the `replace` method
in the 9 verb interface.
fea: Cursor doesn't leave the screen when the mouse exits the game
window.

upd: Adjust styles and layout of 9 verb interface

upd: Inventory container component for Sierra GPI

Uses the component created for the 9 verb interface in the Inventory
popup of the Sierra template.

upd: Create scroll buttons for Sierra inventory.

upd: Work in Sierra inventory popup

Now players can select an inventory item (with the INTERACT command
active), close the popup, and use such item with clickables.

Create Settings popup for Sierra template.

Can change dialog style in Text options popup in Sierra template.
Can change dialog text speed with a slider in Text options popup in
Sierra template.
Create Sound options popup.

Create Sierra settings option to toggle auto-continue

Update style of text continue icon for Sierra template.
Create texture for QUIT button in Sierra template.
Sierra template now has buttons to quit the game.
Improvements in dialog_text component behavior and anchors setup.

Add function to E for registering commands

The 9 verb and Sierra commands' scripts now register their commands
using the created method.
PopochiuClickable and PopochiuInventoryItem now store the mouse button
index used in the last click.
Started to prepare everything to freeze the development of the 9 verb and Sierra templates.

NEXT >> Cursor refactor or Verb coin template creation.

Dialog menu working in 9 verb and Sierra templates

Change G.freed to G.unblocked.
DialogText no longer affects the Cursor. Now it triggers a signal so the
graphic interface decides what to do while a dialog line is played.
Create signal in D to know when a dialog starts.

Refactors Dialog menu

Now it works in 9 verb and Sierra templates.
It is a bit easier to modify the appearance of the Dialog menu.
Added more signals to PopochiuGraphicInterface in order to allow devs to
customize how to handle more interactions.

Remove G.continue_clicked

Connect to G.dialog_line_finished in PopochiuCharacter.say()
Create signal for listening when the system text is hidden.
Behavior improvements in 9 verb GUI.

Update in BASS GUI for setting the cursor

Set "popochiu_gui_component" group to GI components in order to start
building the UI tab in the dock.

Rename methods

Create InventoryGrid component

This is the type of inventory used by 9 verbs and Sierra templates.
upd: change `Cursor.set_cursor(int)` by `Cursor.show_cursor(String)`.

Create inventory grid component for 9 Verb template

Ready to start freezing development for PR creation.

Updated command handling

Both in PopochiuClickable and PopochiuInventoryItem. They will call
`_on_click` if not custom method is present in the object. Method
fallback should be manually called with `E.command_fallback()`.
Added script_name property to PopochiuCommands class. This can be used
to know which set of commands is the current one.

BASS template working with new commands approach

Fix various issues in the BASS template regarding cursor animations and
behavior with PopochiuClickable and PopochiuInventoryItem.
The reference to the current commands class is now in E.
Updated InventoryBar so it can react to the I.item_replaced signal.

Restore cursor property

Both in PopochiuClickable and PopochiuInventory Item.
Now variations for voices are defined by an array of AudioCueSound.

Fix and update in Setup popup

Now it shows a description of the selected template so devs can know a
bit more about each one.
If the selected template is the same that is currently active after
closing the Setup popup, no action is performed.
Add Popsy as a character to test a bug reported related to z-index.
Add GUI cursor to BASS cursors.

Improve GUI template change with confirmation popup

Created templates for GUI commands types.

Create script copies when selecting GUI template

A copy of the template scripts for the graphic interface and the
commands linked to it is created and placed in
res://popochiu/graphic_interface.
This makes sure devs can play with those scripts instead of modifying
those in the addons folder.

fea: Create a commands template script for the Empty template.

First draft of UI tab working.

It allows to add GUI components to the graphic interface scene.
Buttons in the UI panel show enable when the component they represent is
deleted from the graphic interface scene.

Change to Godot 4.1.2 and removed game scenes

Add buttons to open graphic interface script and commands script

upd: use PopochiuGroup for base components and popups in UI tab.

Change BASS template to SimpleClick template

Fix "Start with it" for inventory items.

fix: Devs can select items to start with in the Main tab.
fix: Setting an inventory item as active with `add_as_active` makes the
cursor take the appearance of the item.
fix: Text color changes when character talks in the Caption dialog
style.
fix: PopochiuInventoryItem.add was not showing InventoryBar.
fea: Added `is_pixel_art_game` property to ProjectSettings.
upd: When selecting Pixel in Game type (setup popup) the default texture
filter is set to TEXTURE_FILTER_NEAREST for props, characters and
inventory items.

Progress on improving code before merge

Better positioning of avatars in Portrait dialog style

Adressed all comments and sugestions made by @stickgrinder

Fix scene validation on Editor2D.

Created House, Goddiu, Popsy and Key for testing.

Sierra template fixes

Improve on copying the selected GUI template.

Fix on opening Sierra popups.

Warning for GUI template change when graphic_interface.tscn is open

DialogText is no longer an editable children in 9_verb_gi.tscn and
sierra_gi.tscn.
Add method to print normal messages in PopochiuUtils.

Add customization properties to InventoryGrid

Devs can define the number of columns, the visible rows, the scene to
use for slots, the horizontal and vertical gap sizes, if the UP and DOWN
buttons should be visible, if the component will scroll with the mouse
wheel.
Update Sierra and 9 verb inventory grids so they use the new
customization properties.
upd: refactor in Setup popup script for better code reading.

Post Alpha 5 rebase

Add button to create popochiu popups

This allows the creation of the scene and script for devs to make their
own popups. The created popup is added to the Popups node in the
graphic_interface scene.
upd: Change name of Empty template to Custom.
upd: Set groups for missing popochiu components and popups scenes.

Add ignored files

Create script to handle gui template operations

Copy dependencies to res://game/graphic_interface based on GUI template selection (#139)

* Progress on copying components when choosing GUI template

* Separate GUI copy operations into methods

Now the game is placed in `res://game` instead of `res://popochiu`.
=== Ready to work on moving components based on source scene dependencies ===

* Graphic interface dependencies point to game folder

Scene dependencies in `res://game/graphic_interface/graphic_interface.tscn` now point to the corresponding scene of the component in the `res://game/graphic_interface/components` folder.
When changing the GUI template, previous components are removed from the FileSystem.

* GUI components determined by group instead of scene path

Assign corresponding groups to all the components in the Sierra template.
Add .png files as part of copying components from the addon to the graphic interface folder in the game.
The .png files will need an extra validation to work properly. Same will apply to .theme files.

* GUI template change copies everything

Components and their scripts and dependencies are correclty moved to res://game/graphic_interface/
=== Ready to test updating the dependencies in each .tscn file ===

* Change dependency source check

Now dependencies are searched in the already copied files of res://game/graphic_interface instead of relying on the source files in res://addons/popochiu...

* Fix untracked files

* Copy components working

Ready to make more tests.

* Add progress window to GUI template change

The copy process ignores resources that were already copied.
Update reference to cursor PNG in SimpleClick template.

* Fix on shared resources when copying components

Fix double call on Setup close in Linux/MacOS

Update minimum size of Setup popup.
[fix] Use EditorInterface scale to update minimum and maximum size of Setup popup.

Copy component when adding it from UI tab

Now the dependencies of the selected component are copied to the graphic
interface folder in order to make customization easier.
UI tab now access EditorInterface directly instead of using the
_main_dock variable.

Improve scene instantiation for UI components

Adding the component no longer includes adding dependencies to its script or other resources.
The same applies for props created inside rooms using the importer. Should apply for other types, and also things created without the importer.
[upd] Translate to English the Spanish comments in PopochiuObjectRow.
[upd] Use EditorInterface singleton in PopochiuObjectRow.
[fix] Removing a whole room from the Popochiu panel works again.

Move CanvasEditorMenu for PopochiuClickable to its own scene

A script is also created to remove extra logic from popochiu_plugin.gd.

Use EditorInterface singleton instead of main_dock.ei

Same for EditorFileSystem (main_dock.fs)

Fix with progress animation when choosing Custom template

[fix] Multiply issue about Setup popup min and max size based on editor scale.
[fix] Double creation of progress panel.

Improve GUI template selection

Added a button to change the template inside the Setup popup instead of relying on closing it.
Update behavior of Popochiu editor popups so they render better.

Texture track no longer added when importing animations from Aseprite

Update flow of fallback interaction for PopochiuInventoryItem.on_click()
Sierra GI now selects the clicked inventory item by default when using
the Interact command.
SimpleClick GI selects an inventory item by default when clicked (same
as the Sierra GI).

Inventory item selected by default when clicked in 9 Verb template

Fix on deselecting invisible nodes

This was hapenning while editing the InteractionPolygon of PopochiuClickable objects.
[upd] When a character is added to a room, now its instance is properly created passing the correct instance flag.
[fix] Create room popup was not correctly updating the size of the RichTextLabel that shows the info about the files to create.
[fea] Editing the InteractionPolygon of a PopochiuClickable also stores its position so the edited data is stored in the room.

Change chain of interaction calls

This applies to PopochiuClickable and PopochiuInventoryItem. Now the function called by the mouse input interaction is the public method (i.e. on_click()), and this calls the virtual version of the method (i.e. _on_click()).
Command functions now should have the signature on_command_name() instead of _on_command_name().
[upd] Add regions to various scripts.

Create SierraBar and SierraMenu

SierraMenu was previously SierraTopMenu. SierraBar can be used to show the score of the game.
[upd] Improve feedback of SierraInventory when a command is selected.
[fea] Create public function in PopochiuGraphicInterface so one can get
a component by its name.
[upd] Assign class_names to each GUI template script.

Improve behavior of Sierra inventory

SierraMenu hides after opening the inventory or the settings popup.
[upd] Hide QUIT button in SierraMenu.
[upd] Blocking/Unblocking the graphic interface now also takes into account if is there a popup opened.
[fea] **G** singleton now has a `gui` variable to store a reference to
the graphic interface node.
[fea] PopochiuRoom scenes can now be played from their row in the main
tab.

Better feedback for Sierra inventory slots

[fea] Add "unselected" signal to PopochiuInventoryItem.
[upd] Minor improvements in GUI components copy process popup.

GUI components' theme now point to the _theme.tres file in the game

All the components that have a theme are overriden so the theme used
when copied to the graphic interface folder is the one in there.
[upd] All components in Sierra GUI scene use the sierra_theme.tres.
[upd] All components in 9 Verb GUI scene use the 9_verb_theme.tres.

Create GUI template buttons in Setup from directories

Now the buttons are not created in the SceneTree, but loaded based on
the folders in
res://addons/popochiu/engine/objects/graphic_interface/tempaltes
[fea] Create resource to define the title, description and icon of each
GUI template.

Fix button selection for current template in Setup popup

* Input field in CreationPopups allow pasting from clipboard

[upd] Moved code that changes the font used in some nodes of
CreationPopups and Setup popup to the signal "about_to_popup" instead of
doing it in "_ready()" so the .tscn files do not store font data.
[fea] PopochiuCharacter nodes in PopochiuRooms now also allow to
edit/store the following Visibility properties: visible, modulate,
self_modulate and light_mask.

* Add character childs to PopochiuCharacter instance

Nodes added to characters in room tree are also added to PopochiuCharacter instance
[fix] Creating hotspot, walkable area and region was not assigned the
created script to the node.

* Documentation for Engine classes (#150)

* First documentation annotations for Popochiu class

Base description, signals, constants and public members documented.
[upd] Documentation annotations of other classes in order to make them available to access from the Popochiu docs page.

* Progress on documenting E public methods

* Finish first pass of E documentation

Comments added to all public methods and members.

* Finish documentation for PopochiuSettings

Progress on documenting PopochiuClickable.

* Finish documentation for PopochiuClickable

Restored class_name definition and extends to their previous code format because the one line approach was causing problems with showing the classes in the documentation.

* Finish documentation for PopochiuInventoryItem

Minor updates to Popochiu and PopochiuClickable docs.

* Finish documentation for PopochiuRoom

* Finish documentation for PopochiuProp, PopochiuHotspot and PopochiuWalkableArea

* Finish documentation for PopochiuRegion

[upd] Minor text order update for virtual methods.

* Progress on documenting PopochiuCharacter

* Progress in PopochiuCharacter documentation

Update a typo when refering to Popochiu.queue outside popochiu.gd documentation comments.

* Finish documentation for PopochiuCharacter

* Finish documentation of PopochiuDialog

* Finish documentation for PopochiuDialogOption.

* Finish documentation for Data classes.

PopochiuCharacterData, PopochiuInventoryItemData and PopochiuRoomData.

* refs #147: File positions restructured to make the docs site deployable on GH Pages.

* refs #147: Fixed problem with gh-pages unable to read assets from a path starting with underscore.

* refs #147: Fixed mistaken docs assets position.

* refs #147: Removed unwanted files after a rebase.

* refs #147: Fixed wrong diffs after rebase.

* refs #147: Fixed wrong paths after rebase.

---------

Co-authored-by: carenalga <[email protected]>
stickgrinder added a commit that referenced this issue Mar 4, 2024
…s creation refactoring (#64)

* refs #37: Squashed Room Importer and Objects creation refactoring.

refs #37: Preparation for refactoring of importer code.

refs #37: The plugin is now ready for the implementation of the Room importing logic.

refs #37: WIP refactoring the prop creation logic. It works but needs heavy polishing.

refs #37: Open #67 about the heavy polishing, in the meantime this reduce the passing-over of UI elements.

refs #37: Changed commit language.

refs #37: Refactored the region creation following the new template. Added a base class to limit code-duplication.

refs #37: Refactored the walkable areas too.

refs #37: Refactored the hotspots creation too.

refs #37: Project file updated to Godot 4.1

refs #37: Rooms creation have been refactored.

refs #37: Characters creation have been refactored.

refs #37: Inventory items creation have been refactored.

refs #37: Dialog creation have been refactored.

refs #37: some code dedup on type helpers.

refs #37: code dedup in helpers should be over. Also addressed annoying Godot 4.1 bug.

refs #37: all creation helpers have been renamed to factories.

refs #37: factories init methods changed to real constructors.

refs #37: renamed and added internal factories variables for better readability.

refs #37: Fixed inconsistency in inventory items file naming.

refs #37: Renamed local variables in factory classes.

refs #37: Switch to a success state return strategy to bubble feedback up to the popup.

refs #37: Fixed wrong ownership for room objects children bug.

refs #37: Cleaned up useless and hard-to-maintain references to the obj types in comments. Addresses PR comments by @carenalga.

refs #37: Renamed factories private members to reduce unnecessary verbosity.

refs #37: Solved error message about invalid ownership when creating room objects.

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: A lot of code rewriting to make the base feature work. It works :)

refs #37: More work to get rid of strange execution errors.

refs #37: moving stuff in a desperate attempt to make this working in a predictable way.

refs #37: changed the importing flow strategy to circumvent a nasty error on linux with filesystem signals availability.

refs #37: off-by-one error fixed in animation frames range.

refs #37: fixed an error I probably inherited from another branch.

TEST1: messing with importer.

refs #37: worked around the console error when packing a scene with not-owned children (please see Godot GH-81982 for details).

refs #37: visibility toggle in the importer interface is now working as intended.

refs #37: all props now have an attached script, even the non-clickable ones; the importer is now able to update visibility and clickability status of already imported props.

refs #37: InteractionPolygons for props and hotspots have been moved in the scene and an edit button has been exposed in the toolbar to edit them.

Fix missing images when importing room from Aseprite (#110)

Store polygon for interaction in @export var

This will allow to keep the data of the polygon in the .tscn file of the
room so the InteractionPolygon.polygon data of each prop is overwritten
by the room both in runtime and while editing the room.

NOTE: The polygon of the InteractionPolygon in each prop is not saved in
the prop's scene file yet.

Add comments and broke some long lines

refs #37: InteractionPolygons icon is now more readable.

Fixes for post-import error message (#126)

* Fix Output error after importing room

* Fix error message after closing room import popup

The problem was caused because the popup was being added to the Room
tree. Now it is added to Popochiu's main dock.

* Temporary fix for bad row naming after import

* Imported prop image is placed in the prop's folder

Fix Aseprite importer section not showing in Inspector for room

refs #37: Added a feature flag to Editor Settings, to disable Aseprite Importer for those who does not use Aseprite.

refs #37: Fixed a warning related to EditorInterface being a singleton in 4.2.

* refs #37: Removed leftovers after squashing and rebasing over 2.0

* Fix post-rebase issues about main_dock

---------

Co-authored-by: carenalga <[email protected]>
stickgrinder added a commit that referenced this issue Mar 4, 2024
* refs #37: Rooms Aseprite importer preparatory code and PopochiuObjects creation refactoring (#64)

* refs #37: Squashed Room Importer and Objects creation refactoring.

refs #37: Preparation for refactoring of importer code.

refs #37: The plugin is now ready for the implementation of the Room importing logic.

refs #37: WIP refactoring the prop creation logic. It works but needs heavy polishing.

refs #37: Open #67 about the heavy polishing, in the meantime this reduce the passing-over of UI elements.

refs #37: Changed commit language.

refs #37: Refactored the region creation following the new template. Added a base class to limit code-duplication.

refs #37: Refactored the walkable areas too.

refs #37: Refactored the hotspots creation too.

refs #37: Project file updated to Godot 4.1

refs #37: Rooms creation have been refactored.

refs #37: Characters creation have been refactored.

refs #37: Inventory items creation have been refactored.

refs #37: Dialog creation have been refactored.

refs #37: some code dedup on type helpers.

refs #37: code dedup in helpers should be over. Also addressed annoying Godot 4.1 bug.

refs #37: all creation helpers have been renamed to factories.

refs #37: factories init methods changed to real constructors.

refs #37: renamed and added internal factories variables for better readability.

refs #37: Fixed inconsistency in inventory items file naming.

refs #37: Renamed local variables in factory classes.

refs #37: Switch to a success state return strategy to bubble feedback up to the popup.

refs #37: Fixed wrong ownership for room objects children bug.

refs #37: Cleaned up useless and hard-to-maintain references to the obj types in comments. Addresses PR comments by @carenalga.

refs #37: Renamed factories private members to reduce unnecessary verbosity.

refs #37: Solved error message about invalid ownership when creating room objects.

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: WIP for rooms importer. This code is broken!

refs #37: A lot of code rewriting to make the base feature work. It works :)

refs #37: More work to get rid of strange execution errors.

refs #37: moving stuff in a desperate attempt to make this working in a predictable way.

refs #37: changed the importing flow strategy to circumvent a nasty error on linux with filesystem signals availability.

refs #37: off-by-one error fixed in animation frames range.

refs #37: fixed an error I probably inherited from another branch.

TEST1: messing with importer.

refs #37: worked around the console error when packing a scene with not-owned children (please see Godot GH-81982 for details).

refs #37: visibility toggle in the importer interface is now working as intended.

refs #37: all props now have an attached script, even the non-clickable ones; the importer is now able to update visibility and clickability status of already imported props.

refs #37: InteractionPolygons for props and hotspots have been moved in the scene and an edit button has been exposed in the toolbar to edit them.

Fix missing images when importing room from Aseprite (#110)

Store polygon for interaction in @export var

This will allow to keep the data of the polygon in the .tscn file of the
room so the InteractionPolygon.polygon data of each prop is overwritten
by the room both in runtime and while editing the room.

NOTE: The polygon of the InteractionPolygon in each prop is not saved in
the prop's scene file yet.

Add comments and broke some long lines

refs #37: InteractionPolygons icon is now more readable.

Fixes for post-import error message (#126)

* Fix Output error after importing room

* Fix error message after closing room import popup

The problem was caused because the popup was being added to the Room
tree. Now it is added to Popochiu's main dock.

* Temporary fix for bad row naming after import

* Imported prop image is placed in the prop's folder

Fix Aseprite importer section not showing in Inspector for room

refs #37: Added a feature flag to Editor Settings, to disable Aseprite Importer for those who does not use Aseprite.

refs #37: Fixed a warning related to EditorInterface being a singleton in 4.2.

* refs #37: Removed leftovers after squashing and rebasing over 2.0

* Fix post-rebase issues about main_dock

---------

Co-authored-by: carenalga <[email protected]>

* refs #40: New GUIs subsystem

* GUI templates and game commands

Progress on refactoring the GI

Progress on working with 9 verbs

First draft of the Sierra GUI implementation

Created the `g.gd` script to test an approach for accessing the commands
defined for the graphic interface.
Moved the Toolbar folder to the popochiu template folder since that
component will be part of that GUI only.
Added a function to "replace" the default cursor. This still needs
improvements or a complete refactor.

GUI template selection in Setup popup

Refactorization of GUI template commands

This fixes a dependency generated when having the commands of the current GUI in the g.gd singleton. Now each GUI has its own commands Resource class.
Selecting the GUI template in the Setup popup is now working without bugs.

Changed Popochiu GUI template name to BASS

Usability improvements in 9 verb interface

Sound settings script moved to BASS' toolbar folder

History popup working again in BASS template

upd: Lines in History to RichTextLabel so one can uses colors to
highlight characters, commands and props.
fea: Improved the way BASS handles mouse positioning to open/close the
inventory and the settings.
upd: Renamed scene and script filenames from Toolbar to SettingsBar.

PopochiuPopup are now used by History, Save and Load and Sound settings.

upd: Updated the Settings popup for the 9 verb interface. Now it allows to
Save, Load, open the History, and update sound volumes.
upd: New appearance for Sound volumes sliders.
upd: Created Sound volumes component, so devs can use the sliders
without having to use a popup.
fea: Created Settings icon for settings button in 9 verb interface.
upd: Created cursor for UI elements in 9 verb interface.
fix: Opening the SaveAndLoad popup when saving no longer requires to
pass a String as a parameter.

upd: new style for 9 verb interface

Now it get closer to the style used in Thimbleweed Park.
fea: created icons for GUI templates in the Setup window.
fea: added option to 9 verb settings popup to choose between classic and
modern sentences.
fea: created sprites and style for CheckButton.

Sierra theme styles updated

This is for PanelContainers and Buttons.
Created inventory popup for Sierra GUI.
Created USE cursor for Sierra GUI.
Created top bar (hover text + score) panel for Sierra GUI.
Fixed some bugs in the Sierra GUI.
Working on making the inventory popup to work properly in Sierra GUI.

SystemText working again.

fix: showing the SystemText blocks interactions until players click
anywhere to close the panel.
upd: `G.display` changed to `G.show_system_text`.
fea: basic inventory functionality working in Sierra GUI. Players can
inspect items and select them for use. Once used, the item disappears
from the inventory grid.

First approach on having varios dialog text types

Devs can choose between Above character, Portrait and Caption.
The implementation is still hardcoded in various parts. Improvements
will come soon.

Fix: cursor behavior in Sierra inventory popup.

fix: the error related to set_name.call_deferred is now solved.
Working on fix for C singleton.

Fallback for commands improved

Code refactor and improvements for DialogText.

upd: Now the now supports the three display modes (Above character, Portrait
and Caption) by itself.
fix: #79 .
fix: Recognizing emotions in dialog lines for `E.queue` was not working.
upd: Added support for avatars with emotions in PopochiuCharacter.
upd: Portrait mode displays the avatar of the talking character (with
its corresponding emotion).

Improved CAPTION text style rendering.

Fixes and minor improvements in DialogText rendering.
Updated properties in scaling and layout for PopochiuInventoryItem.

9 verb inventory scroll working

It takes into account the size of each slot, the size of the gaps
between rows and the number of rows.
This inventory panel adds items to the i_inventory based on what the
scene tree has.
NEXT >> Make this as a component that can work in a popup (i.e. in the
Sierra inventory popup).

Progress on 9 verb inventory functionality

Can trigger commands on inventory items.
Can use inventory items with popochiu clickable and other inventory
items.

fea: Make suggested command to work

This applies for PopochiuClickable and PopochiuInventoryItem (which
suggested verb will be always LOOK AT).
fea: Try calling the left click version of a command before triggering
its fallback (this applies to PopochiuClickable and
PopochiuInventoryItem).

NEXT >> [9 verb] Make inventory container to re-arrange after removing an
inventory item.

fea: can remove items in 9 verb inventory

Removing the item also removes the slot it belongs to, which ensures the
container will re-arrange correctly. A new slot is created after
removing the item.

NEXT >> Allow to replace an item (useful for combining items).

fea: Adds method to replace an inventory item

The new inventory item replaces the one that calls the `replace` method
in the 9 verb interface.
fea: Cursor doesn't leave the screen when the mouse exits the game
window.

upd: Adjust styles and layout of 9 verb interface

upd: Inventory container component for Sierra GPI

Uses the component created for the 9 verb interface in the Inventory
popup of the Sierra template.

upd: Create scroll buttons for Sierra inventory.

upd: Work in Sierra inventory popup

Now players can select an inventory item (with the INTERACT command
active), close the popup, and use such item with clickables.

Create Settings popup for Sierra template.

Can change dialog style in Text options popup in Sierra template.
Can change dialog text speed with a slider in Text options popup in
Sierra template.
Create Sound options popup.

Create Sierra settings option to toggle auto-continue

Update style of text continue icon for Sierra template.
Create texture for QUIT button in Sierra template.
Sierra template now has buttons to quit the game.
Improvements in dialog_text component behavior and anchors setup.

Add function to E for registering commands

The 9 verb and Sierra commands' scripts now register their commands
using the created method.
PopochiuClickable and PopochiuInventoryItem now store the mouse button
index used in the last click.
Started to prepare everything to freeze the development of the 9 verb and Sierra templates.

NEXT >> Cursor refactor or Verb coin template creation.

Dialog menu working in 9 verb and Sierra templates

Change G.freed to G.unblocked.
DialogText no longer affects the Cursor. Now it triggers a signal so the
graphic interface decides what to do while a dialog line is played.
Create signal in D to know when a dialog starts.

Refactors Dialog menu

Now it works in 9 verb and Sierra templates.
It is a bit easier to modify the appearance of the Dialog menu.
Added more signals to PopochiuGraphicInterface in order to allow devs to
customize how to handle more interactions.

Remove G.continue_clicked

Connect to G.dialog_line_finished in PopochiuCharacter.say()
Create signal for listening when the system text is hidden.
Behavior improvements in 9 verb GUI.

Update in BASS GUI for setting the cursor

Set "popochiu_gui_component" group to GI components in order to start
building the UI tab in the dock.

Rename methods

Create InventoryGrid component

This is the type of inventory used by 9 verbs and Sierra templates.
upd: change `Cursor.set_cursor(int)` by `Cursor.show_cursor(String)`.

Create inventory grid component for 9 Verb template

Ready to start freezing development for PR creation.

Updated command handling

Both in PopochiuClickable and PopochiuInventoryItem. They will call
`_on_click` if not custom method is present in the object. Method
fallback should be manually called with `E.command_fallback()`.
Added script_name property to PopochiuCommands class. This can be used
to know which set of commands is the current one.

BASS template working with new commands approach

Fix various issues in the BASS template regarding cursor animations and
behavior with PopochiuClickable and PopochiuInventoryItem.
The reference to the current commands class is now in E.
Updated InventoryBar so it can react to the I.item_replaced signal.

Restore cursor property

Both in PopochiuClickable and PopochiuInventory Item.
Now variations for voices are defined by an array of AudioCueSound.

Fix and update in Setup popup

Now it shows a description of the selected template so devs can know a
bit more about each one.
If the selected template is the same that is currently active after
closing the Setup popup, no action is performed.
Add Popsy as a character to test a bug reported related to z-index.
Add GUI cursor to BASS cursors.

Improve GUI template change with confirmation popup

Created templates for GUI commands types.

Create script copies when selecting GUI template

A copy of the template scripts for the graphic interface and the
commands linked to it is created and placed in
res://popochiu/graphic_interface.
This makes sure devs can play with those scripts instead of modifying
those in the addons folder.

fea: Create a commands template script for the Empty template.

First draft of UI tab working.

It allows to add GUI components to the graphic interface scene.
Buttons in the UI panel show enable when the component they represent is
deleted from the graphic interface scene.

Change to Godot 4.1.2 and removed game scenes

Add buttons to open graphic interface script and commands script

upd: use PopochiuGroup for base components and popups in UI tab.

Change BASS template to SimpleClick template

Fix "Start with it" for inventory items.

fix: Devs can select items to start with in the Main tab.
fix: Setting an inventory item as active with `add_as_active` makes the
cursor take the appearance of the item.
fix: Text color changes when character talks in the Caption dialog
style.
fix: PopochiuInventoryItem.add was not showing InventoryBar.
fea: Added `is_pixel_art_game` property to ProjectSettings.
upd: When selecting Pixel in Game type (setup popup) the default texture
filter is set to TEXTURE_FILTER_NEAREST for props, characters and
inventory items.

Progress on improving code before merge

Better positioning of avatars in Portrait dialog style

Adressed all comments and sugestions made by @stickgrinder

Fix scene validation on Editor2D.

Created House, Goddiu, Popsy and Key for testing.

Sierra template fixes

Improve on copying the selected GUI template.

Fix on opening Sierra popups.

Warning for GUI template change when graphic_interface.tscn is open

DialogText is no longer an editable children in 9_verb_gi.tscn and
sierra_gi.tscn.
Add method to print normal messages in PopochiuUtils.

Add customization properties to InventoryGrid

Devs can define the number of columns, the visible rows, the scene to
use for slots, the horizontal and vertical gap sizes, if the UP and DOWN
buttons should be visible, if the component will scroll with the mouse
wheel.
Update Sierra and 9 verb inventory grids so they use the new
customization properties.
upd: refactor in Setup popup script for better code reading.

Post Alpha 5 rebase

Add button to create popochiu popups

This allows the creation of the scene and script for devs to make their
own popups. The created popup is added to the Popups node in the
graphic_interface scene.
upd: Change name of Empty template to Custom.
upd: Set groups for missing popochiu components and popups scenes.

Add ignored files

Create script to handle gui template operations

Copy dependencies to res://game/graphic_interface based on GUI template selection (#139)

* Progress on copying components when choosing GUI template

* Separate GUI copy operations into methods

Now the game is placed in `res://game` instead of `res://popochiu`.
=== Ready to work on moving components based on source scene dependencies ===

* Graphic interface dependencies point to game folder

Scene dependencies in `res://game/graphic_interface/graphic_interface.tscn` now point to the corresponding scene of the component in the `res://game/graphic_interface/components` folder.
When changing the GUI template, previous components are removed from the FileSystem.

* GUI components determined by group instead of scene path

Assign corresponding groups to all the components in the Sierra template.
Add .png files as part of copying components from the addon to the graphic interface folder in the game.
The .png files will need an extra validation to work properly. Same will apply to .theme files.

* GUI template change copies everything

Components and their scripts and dependencies are correclty moved to res://game/graphic_interface/
=== Ready to test updating the dependencies in each .tscn file ===

* Change dependency source check

Now dependencies are searched in the already copied files of res://game/graphic_interface instead of relying on the source files in res://addons/popochiu...

* Fix untracked files

* Copy components working

Ready to make more tests.

* Add progress window to GUI template change

The copy process ignores resources that were already copied.
Update reference to cursor PNG in SimpleClick template.

* Fix on shared resources when copying components

Fix double call on Setup close in Linux/MacOS

Update minimum size of Setup popup.
[fix] Use EditorInterface scale to update minimum and maximum size of Setup popup.

Copy component when adding it from UI tab

Now the dependencies of the selected component are copied to the graphic
interface folder in order to make customization easier.
UI tab now access EditorInterface directly instead of using the
_main_dock variable.

Improve scene instantiation for UI components

Adding the component no longer includes adding dependencies to its script or other resources.
The same applies for props created inside rooms using the importer. Should apply for other types, and also things created without the importer.
[upd] Translate to English the Spanish comments in PopochiuObjectRow.
[upd] Use EditorInterface singleton in PopochiuObjectRow.
[fix] Removing a whole room from the Popochiu panel works again.

Move CanvasEditorMenu for PopochiuClickable to its own scene

A script is also created to remove extra logic from popochiu_plugin.gd.

Use EditorInterface singleton instead of main_dock.ei

Same for EditorFileSystem (main_dock.fs)

Fix with progress animation when choosing Custom template

[fix] Multiply issue about Setup popup min and max size based on editor scale.
[fix] Double creation of progress panel.

Improve GUI template selection

Added a button to change the template inside the Setup popup instead of relying on closing it.
Update behavior of Popochiu editor popups so they render better.

Texture track no longer added when importing animations from Aseprite

Update flow of fallback interaction for PopochiuInventoryItem.on_click()
Sierra GI now selects the clicked inventory item by default when using
the Interact command.
SimpleClick GI selects an inventory item by default when clicked (same
as the Sierra GI).

Inventory item selected by default when clicked in 9 Verb template

Fix on deselecting invisible nodes

This was hapenning while editing the InteractionPolygon of PopochiuClickable objects.
[upd] When a character is added to a room, now its instance is properly created passing the correct instance flag.
[fix] Create room popup was not correctly updating the size of the RichTextLabel that shows the info about the files to create.
[fea] Editing the InteractionPolygon of a PopochiuClickable also stores its position so the edited data is stored in the room.

Change chain of interaction calls

This applies to PopochiuClickable and PopochiuInventoryItem. Now the function called by the mouse input interaction is the public method (i.e. on_click()), and this calls the virtual version of the method (i.e. _on_click()).
Command functions now should have the signature on_command_name() instead of _on_command_name().
[upd] Add regions to various scripts.

Create SierraBar and SierraMenu

SierraMenu was previously SierraTopMenu. SierraBar can be used to show the score of the game.
[upd] Improve feedback of SierraInventory when a command is selected.
[fea] Create public function in PopochiuGraphicInterface so one can get
a component by its name.
[upd] Assign class_names to each GUI template script.

Improve behavior of Sierra inventory

SierraMenu hides after opening the inventory or the settings popup.
[upd] Hide QUIT button in SierraMenu.
[upd] Blocking/Unblocking the graphic interface now also takes into account if is there a popup opened.
[fea] **G** singleton now has a `gui` variable to store a reference to
the graphic interface node.
[fea] PopochiuRoom scenes can now be played from their row in the main
tab.

Better feedback for Sierra inventory slots

[fea] Add "unselected" signal to PopochiuInventoryItem.
[upd] Minor improvements in GUI components copy process popup.

GUI components' theme now point to the _theme.tres file in the game

All the components that have a theme are overriden so the theme used
when copied to the graphic interface folder is the one in there.
[upd] All components in Sierra GUI scene use the sierra_theme.tres.
[upd] All components in 9 Verb GUI scene use the 9_verb_theme.tres.

Create GUI template buttons in Setup from directories

Now the buttons are not created in the SceneTree, but loaded based on
the folders in
res://addons/popochiu/engine/objects/graphic_interface/tempaltes
[fea] Create resource to define the title, description and icon of each
GUI template.

Fix button selection for current template in Setup popup

* Input field in CreationPopups allow pasting from clipboard

[upd] Moved code that changes the font used in some nodes of
CreationPopups and Setup popup to the signal "about_to_popup" instead of
doing it in "_ready()" so the .tscn files do not store font data.
[fea] PopochiuCharacter nodes in PopochiuRooms now also allow to
edit/store the following Visibility properties: visible, modulate,
self_modulate and light_mask.

* Add character childs to PopochiuCharacter instance

Nodes added to characters in room tree are also added to PopochiuCharacter instance
[fix] Creating hotspot, walkable area and region was not assigned the
created script to the node.

* Documentation for Engine classes (#150)

* First documentation annotations for Popochiu class

Base description, signals, constants and public members documented.
[upd] Documentation annotations of other classes in order to make them available to access from the Popochiu docs page.

* Progress on documenting E public methods

* Finish first pass of E documentation

Comments added to all public methods and members.

* Finish documentation for PopochiuSettings

Progress on documenting PopochiuClickable.

* Finish documentation for PopochiuClickable

Restored class_name definition and extends to their previous code format because the one line approach was causing problems with showing the classes in the documentation.

* Finish documentation for PopochiuInventoryItem

Minor updates to Popochiu and PopochiuClickable docs.

* Finish documentation for PopochiuRoom

* Finish documentation for PopochiuProp, PopochiuHotspot and PopochiuWalkableArea

* Finish documentation for PopochiuRegion

[upd] Minor text order update for virtual methods.

* Progress on documenting PopochiuCharacter

* Progress in PopochiuCharacter documentation

Update a typo when refering to Popochiu.queue outside popochiu.gd documentation comments.

* Finish documentation for PopochiuCharacter

* Finish documentation of PopochiuDialog

* Finish documentation for PopochiuDialogOption.

* Finish documentation for Data classes.

PopochiuCharacterData, PopochiuInventoryItemData and PopochiuRoomData.

* refs #147: File positions restructured to make the docs site deployable on GH Pages.

* refs #147: Fixed problem with gh-pages unable to read assets from a path starting with underscore.

* refs #147: Fixed mistaken docs assets position.

* refs #147: Removed unwanted files after a rebase.

* refs #147: Fixed wrong diffs after rebase.

* refs #147: Fixed wrong paths after rebase.

---------

Co-authored-by: carenalga <[email protected]>
@stickgrinder
Copy link
Collaborator Author

This has been closed by @mapedorr during a heavy refactoring of the Editor Plugin.

We have no singletons but an instance of a signalbus in a static helper class. This works well enough, so far.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement New feature or request proposal An idea that still needs to be fleshed-out
Projects
None yet
Development

No branches or pull requests

1 participant