Skip to content

Commit

Permalink
Merge pull request #327 from carenalgas/develop
Browse files Browse the repository at this point in the history
v2.0.1 release
  • Loading branch information
stickgrinder authored Nov 3, 2024
2 parents 9ed65b1 + 2273f13 commit f3ad4c1
Show file tree
Hide file tree
Showing 124 changed files with 795 additions and 6,528 deletions.
21 changes: 20 additions & 1 deletion .github/workflows/deploy-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ on:
- "v*.*.*-beta*"
- "v*.*.*-rc*"

env:
PYTHON_VERSION: 3.12
GDE_TAG: godot-docs-extractor

jobs:
deploy-gh-pages:
runs-on: ubuntu-latest
Expand All @@ -18,7 +22,7 @@ jobs:
- name: Install Python environment
uses: actions/setup-python@v2
with:
python-version: 3.11
python-version: ${{ env.PYTHON_VERSION }}
- name: Install MkDocs and dependencies
run: >
pip install
Expand Down Expand Up @@ -67,10 +71,25 @@ jobs:
mkdocs-cinder
mkdocs-kpn
mkdocs-material
mkdocs-mermaid2-plugin
fontawesome-in-markdown
neoteroi-mkdocs
markdown-include
pygments
pymdown-extensions
- name: Build DocsExtractor Docker image
working-directory: ./docs
run: docker build -f Dockerfile.DocsExtractor -t ${{ env.GDE_TAG }} .
- name: Extract code reference documentation from Godot source
run: >
docker run
--rm
-v ${{ github.workspace }}:/project
-v ${{ github.workspace }}/docs/src/the-engine-handbook/scripting-reference:/output
${{ env.GDE_TAG }}
/project
-o /output
-d addons/popochiu/engine
- name: Deploy to production
working-directory: ./docs
run: mkdocs gh-deploy --force --clean --verbose
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ popochiu
popochiu/**
game
game/**
*.import

# Documentation ignores
docs/src/**/*.import
docs/src/**/scripting-reference/*.md
!docs/src/**/scripting-reference/index.md
docs/dist/*
docs/dist/**/*
!docs/dist/.gitkeep
!docs/dist/.nojekyll
Collector*.gd
ReferenceCollectorCLI*.gd
reference.json
Expand Down
4 changes: 2 additions & 2 deletions LEEME.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Esta herramienta consta de dos partes: el motor (Popochiu) y el plugin del edito
* Gestión de audio para música de fondo y efectos de sonido
* Importación de Habitaciones y Personajes, desde archivos fuente de [Aseprite](https://www.aseprite.org/), con toda su estructura

Y vendrán muchas cosas más. Popochiu está en desarrollo activo y tenemos un hoja de ruta de lanzamientos bien mantenida.
Y vendrán muchas cosas más. Popochiu está en desarrollo activo y tenemos un hoja de [ruta de lanzamientos](https://github.com/orgs/carenalgas/projects/1/views/1) bien mantenida.

## Tabla de compatibilidad

Expand All @@ -57,7 +57,7 @@ Por favor, revisa esta tabla para saber qué versión descargar dependiendo de l

| Versión requerida de Godot | Lanzamiento de Popochiu |
|---|---|
| 4.3 y superior | [Popochiu 2.0](https://github.com/carenalgas/popochiu/releases/download/v2.0/popochiu-v2.0.0.zip) |
| 4.3 y superior | [Popochiu 2.0.0](https://github.com/carenalgas/popochiu/releases/download/v2.0.0/popochiu-v2.0.0.zip) |
| 3.5 a 3.6 | [Popochiu 1.10.1](https://github.com/carenalgas/popochiu/releases/download/v1.10.1/popochiu-v1.10.1.zip) |
| 3.3 a 3.4.5 | [Popochiu 1.8.7](https://github.com/carenalgas/popochiu/releases/download/v1.8.7/popochiu-v1.8.7.zip) |

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ This tool consists of two parts: the engine (Popochiu) and the editor plugin tha
* Audio management for background music and sound effects
* Import Rooms and Character from [Aseprite](https://www.aseprite.org/) source files with full structure

And much more to come. Popochiu is in active development and we have a well maintained releases roadmap.
And much more to come. Popochiu is in active development and we have a well maintained [releases roadmap](https://github.com/orgs/carenalgas/projects/1/views/1).

## Compatibility chart

Expand All @@ -57,7 +57,7 @@ Please review this table to know which version to download, depending on the ver

| Required Godot version | Popochiu Release |
|---|---|
| 4.3 and above | [Popochiu 2.0](https://github.com/carenalgas/popochiu/releases/download/v2.0/popochiu-v2.0.0.zip) |
| 4.3 and above | [Popochiu 2.0.0](https://github.com/carenalgas/popochiu/releases/download/v2.0.0/popochiu-v2.0.0.zip) |
| 3.5 to 3.6 | [Popochiu 1.10.1](https://github.com/carenalgas/popochiu/releases/download/v1.10.1/popochiu-v1.10.1.zip) |
| 3.3 to 3.4.5 | [Popochiu 1.8.7](https://github.com/carenalgas/popochiu/releases/download/v1.8.7/popochiu-v1.8.7.zip) |

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func _ready() -> void:
# Connect to child signals
btn_baseline.pressed.connect(_toggle_baseline_visibility)
btn_walk_to_point.pressed.connect(_toggle_walk_to_point_visibility)
#btn_look_at_point.pressed.connect(_toggle_look_at_point_visibility)
btn_look_at_point.pressed.connect(_toggle_look_at_point_visibility)
btn_dialog_pos.pressed.connect(_toggle_dialog_pos_visibility)
btn_interaction_polygon.pressed.connect(_select_interaction_polygon)

Expand All @@ -43,6 +43,13 @@ func _toggle_walk_to_point_visibility() -> void:
)


func _toggle_look_at_point_visibility() -> void:
PopochiuEditorHelper.signal_bus.gizmo_visibility_changed.emit(
PopochiuGizmoClickablePlugin.LOOK_AT_POINT,
btn_look_at_point.button_pressed
)


func _toggle_baseline_visibility() -> void:
PopochiuEditorHelper.signal_bus.gizmo_visibility_changed.emit(
PopochiuGizmoClickablePlugin.BASELINE,
Expand Down Expand Up @@ -102,6 +109,11 @@ func _on_gizmo_settings_changed() -> void:


func _on_selection_changed() -> void:
# Always reset the walkable areas visibility depending on the user preferences
# Doing this immediately so, if this function exits early, the visibility is conditioned
# by the editor settings (partially fixes #325).
_set_walkable_areas_visibility()

# Make sure this function works only if the user is editing a
# supported scene
if not PopochiuEditorHelper.is_popochiu_object(
Expand All @@ -111,8 +123,7 @@ func _on_selection_changed() -> void:
return

# If we have no selection in the tree (the user clicked on an
# empty area or pressed ESC), we pop all the buttons up and
# leave the toolbar hidden.
# empty area or pressed ESC), we hide the toolbar.
if EditorInterface.get_selection().get_selected_nodes().is_empty():
if _active_popochiu_object != null:
# TODO: this is not a helper function, because we want to get
Expand All @@ -122,12 +133,23 @@ func _on_selection_changed() -> void:
for node in _active_popochiu_object.get_children():
if PopochiuEditorHelper.is_popochiu_obj_polygon(node):
node.hide()
EditorInterface.get_selection().add_node.call_deferred(_active_popochiu_object)
# This "if" solves "!p_node->is_inside_tree()" internal Godot error
# The line inside is the logic we need to make this block work
if EditorInterface.get_edited_scene_root() == _active_popochiu_object:
EditorInterface.get_selection().add_node.call_deferred(_active_popochiu_object)
# Reset the clickable reference and hide the toolbar
# (restart from a blank state)
_active_popochiu_object = null
hide()
_reset_buttons_state()
# NOTE: Here we used to pop all the buttons up, by invoking _reset_buttons_state() but
# this is undesireable, since it overrides the user's visibility choices for the session.
# Leaving this comment here for future reference.

# Reset the walkable areas visibility depending on the user preferences
# Doing here because clicking on an empty area would hide the walkable areas
# ignoring the editor settings (fixes #325)
_set_walkable_areas_visibility()

return

# We identify which PopochiuClickable we are working on in the editor.
Expand All @@ -142,10 +164,12 @@ func _on_selection_changed() -> void:
if PopochiuEditorHelper.is_popochiu_obj_polygon(selected_node):
_active_popochiu_object = selected_node.get_parent()
elif PopochiuEditorHelper.is_popochiu_room_object(selected_node):
var polygon = PopochiuEditorHelper.get_first_child_by_group(
_active_popochiu_object,
PopochiuEditorHelper.POPOCHIU_OBJECT_POLYGON_GROUP
)
var polygon = null
if is_instance_valid(_active_popochiu_object):
polygon = PopochiuEditorHelper.get_first_child_by_group(
_active_popochiu_object,
PopochiuEditorHelper.POPOCHIU_OBJECT_POLYGON_GROUP
)
if (polygon != null):
polygon.hide()
btn_interaction_polygon.set_pressed_no_signal(false)
Expand All @@ -166,8 +190,11 @@ func _on_selection_changed() -> void:
EditorInterface.get_selection().remove_node.call_deferred(node)
btn_interaction_polygon.set_pressed_no_signal(false)

# Always reset the walkable areas visibility depending on the user preferences
# Reset the walkable areas visibility depending on the user preferences
# Doing this also at the end because the state can be reset by one of the steps
# above.
_set_walkable_areas_visibility()

# Always reset the button visibility depending on the state of the internal variables
_set_buttons_visibility()

Expand Down Expand Up @@ -257,6 +284,7 @@ func _set_buttons_visibility() -> void:
hide()
btn_baseline.hide()
btn_walk_to_point.hide()
btn_look_at_point.hide()
btn_dialog_pos.hide()
btn_interaction_polygon.hide()

Expand Down Expand Up @@ -289,6 +317,7 @@ func _set_buttons_visibility() -> void:
if _active_popochiu_object is PopochiuClickable:
btn_baseline.show()
btn_walk_to_point.show()
btn_look_at_point.show()

# If we are in a Character scene, show polygon and dialogpos gizmo button
elif PopochiuEditorHelper.is_character(EditorInterface.get_edited_scene_root()):
Expand All @@ -299,5 +328,5 @@ func _set_buttons_visibility() -> void:
func _reset_buttons_state() -> void:
btn_baseline.set_pressed_no_signal(true)
btn_walk_to_point.set_pressed_no_signal(true)
#btn_look_at_point.set_pressed_no_signal(true)
btn_look_at_point.set_pressed_no_signal(true)
btn_dialog_pos.set_pressed_no_signal(true)
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ vertical_alignment = 1

[node name="BtnBaseline" type="Button" parent="."]
unique_name_in_owner = true
visible = false
layout_mode = 2
tooltip_text = "Baseline"
theme_type_variation = &"FlatButton"
Expand All @@ -29,6 +30,7 @@ icon = ExtResource("2_w3cau")

[node name="BtnWalkToPoint" type="Button" parent="."]
unique_name_in_owner = true
visible = false
layout_mode = 2
tooltip_text = "Walk-To Point"
theme_type_variation = &"FlatButton"
Expand All @@ -38,7 +40,6 @@ icon = ExtResource("3_ifql1")

[node name="BtnLookAtPoint" type="Button" parent="."]
unique_name_in_owner = true
visible = false
layout_mode = 2
tooltip_text = "Look-At Point"
theme_type_variation = &"FlatButton"
Expand All @@ -48,7 +49,6 @@ icon = ExtResource("4_bge33")

[node name="BtnDialogPos" type="Button" parent="."]
unique_name_in_owner = true
visible = false
layout_mode = 2
tooltip_text = "Dialog Position"
theme_type_variation = &"FlatButton"
Expand Down
6 changes: 6 additions & 0 deletions addons/popochiu/editor/config/config.gd
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ enum DialogStyle {
const SCALE_GUI = "popochiu/gui/experimental_scale_gui"
const FADE_COLOR = "popochiu/gui/fade_color"
const SKIP_CUTSCENE_TIME = "popochiu/gui/skip_cutscene_time"
const TL_FIRST_ROOM = "popochiu/gui/show_transition_layer_in_first_room"

# ---- Dialogs -------------------------------------------------------------------------------------
const TEXT_SPEED = "popochiu/dialogs/text_speed"
Expand Down Expand Up @@ -54,6 +55,7 @@ static var defaults := {
SCALE_GUI: false,
FADE_COLOR: Color.BLACK,
SKIP_CUTSCENE_TIME: 0.2,
TL_FIRST_ROOM: false,
TEXT_SPEED: 0.1,
AUTO_CONTINUE_TEXT: false,
USE_TRANSLATIONS: false,
Expand Down Expand Up @@ -84,6 +86,7 @@ static func initialize_project_settings():
_initialize_project_setting(SCALE_GUI, TYPE_BOOL)
_initialize_project_setting(FADE_COLOR, TYPE_COLOR)
_initialize_project_setting(SKIP_CUTSCENE_TIME, TYPE_FLOAT)
_initialize_project_setting(TL_FIRST_ROOM, TYPE_BOOL)

# ---- Dialogs ---------------------------------------------------------------------------------
_initialize_project_setting(TEXT_SPEED, TYPE_FLOAT, PROPERTY_HINT_RANGE, "0.0,0.1")
Expand Down Expand Up @@ -149,6 +152,9 @@ static func get_fade_color() -> Color:
static func get_skip_cutscene_time() -> float:
return _get_project_setting(SKIP_CUTSCENE_TIME)

static func should_show_tl_in_first_room() -> bool:
return _get_project_setting(TL_FIRST_ROOM)


# ---- Dialogs -------------------------------------------------------------------------------------
static func get_text_speed() -> float:
Expand Down
42 changes: 19 additions & 23 deletions addons/popochiu/editor/gizmos/gizmo_clickable_plugin.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extends EditorPlugin
# TODO: move these out of the plugin and into Popochiu (enums) or PopochiuClickable
enum {
WALK_TO_POINT,
#LOOK_AT_POINT, # TODO: enable this when the look_at_point logic is implemented
LOOK_AT_POINT,
BASELINE,
DIALOG_POS
}
Expand All @@ -30,8 +30,7 @@ func _enter_tree() -> void:
# Initialization of the plugin goes here.
_undo = get_undo_redo()
_gizmos.insert(WALK_TO_POINT, _init_popochiu_gizmo(WALK_TO_POINT))
# TODO: enable this when the look_at_point logic is implemented
# _gizmos.insert(LOOK_AT_POINT, _init_popochiu_gizmo(LOOK_AT_POINT))
_gizmos.insert(LOOK_AT_POINT, _init_popochiu_gizmo(LOOK_AT_POINT))
_gizmos.insert(BASELINE, _init_popochiu_gizmo(BASELINE))
_gizmos.insert(DIALOG_POS, _init_popochiu_gizmo(DIALOG_POS))

Expand All @@ -44,7 +43,7 @@ func _enter_tree() -> void:
#region Virtual ####################################################################################

func _edit(object: Object) -> void:
if object.get_class() == "EditorDebuggerRemoteObject":
if object == null or object.get_class() == "EditorDebuggerRemoteObject":
return

_target_node = object
Expand All @@ -54,8 +53,7 @@ func _edit(object: Object) -> void:
_active_gizmos.append(_gizmos[DIALOG_POS])
elif EditorInterface.get_edited_scene_root() is PopochiuRoom:
_active_gizmos.append(_gizmos[WALK_TO_POINT])
# TODO: enable this when the look_at_point logic is implemented
#_active_gizmos.append(_gizmos[LOOK_AT_POINT])
_active_gizmos.append(_gizmos[LOOK_AT_POINT])
_active_gizmos.append(_gizmos[BASELINE])

for gizmo in _active_gizmos:
Expand Down Expand Up @@ -121,14 +119,13 @@ func _on_gizmo_settings_changed() -> void:
default_font,
PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_FONT_SIZE)
)
# TODO: enable this when the look_at_point logic is implemented
# LOOK_AT_POINT:
# gizmo.set_theme(
# PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_LOOK_AT_POINT_COLOR),
# PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_HANDLER_SIZE),
# default_font,
# PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_FONT_SIZE)
# )
LOOK_AT_POINT:
gizmo.set_theme(
PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_LOOK_AT_POINT_COLOR),
PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_HANDLER_SIZE),
default_font,
PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_FONT_SIZE)
)
BASELINE:
gizmo.set_theme(
PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_BASELINE_COLOR),
Expand Down Expand Up @@ -178,15 +175,14 @@ func _init_popochiu_gizmo(gizmo_id: int) -> Gizmo2D:
default_font,
PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_FONT_SIZE)
)
# TODO: enable this when the look_at_point logic is implemented
# LOOK_AT_POINT:
# gizmo = Gizmo2D.new(_target_node, "look_at_point", "Look At Point", Gizmo2D.GIZMO_POS)
# gizmo.set_theme(
# PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_LOOK_AT_POINT_COLOR),
# PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_HANDLER_SIZE),
# default_font,
# PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_FONT_SIZE)
# )
LOOK_AT_POINT:
gizmo = Gizmo2D.new(_target_node, "look_at_point", "Look At Point", Gizmo2D.GIZMO_POS)
gizmo.set_theme(
PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_LOOK_AT_POINT_COLOR),
PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_HANDLER_SIZE),
default_font,
PopochiuEditorConfig.get_editor_setting(PopochiuEditorConfig.GIZMOS_FONT_SIZE)
)
BASELINE:
gizmo = Gizmo2D.new(_target_node, "baseline", "Baseline", Gizmo2D.GIZMO_VPOS)
gizmo.set_theme(
Expand Down
6 changes: 6 additions & 0 deletions addons/popochiu/editor/helpers/popochiu_editor_helper.gd
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ static func show_dialog(dialog: Window, min_size := Vector2i.ZERO) -> void:


# Type-checking functions
static func is_popochiu_clickable(node: Node) -> bool:
return node is PopochiuCharacter \
or node is PopochiuProp \
or node is PopochiuHotspot


static func is_popochiu_object(node: Node) -> bool:
return node is PopochiuRoom \
or is_popochiu_room_object(node)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func _parse_property(
if object and object.get_parent() is Node2D and not path in [
"baseline",
"walk_to_point",
"look_at_point",
"position",
"visible",
"modulate",
Expand Down
Loading

0 comments on commit f3ad4c1

Please sign in to comment.