Compare commits
5 Commits
a9692ffa4f
...
37c042a58d
Author | SHA1 | Date |
---|---|---|
Wilson E. Alvarez | 37c042a58d | |
Serhii Snitsaruk | 60a767032e | |
Serhii Snitsaruk | 60142b191d | |
Wilson E. Alvarez | b217c803e3 | |
Wilson E. Alvarez | abe4d03656 |
|
@ -25,6 +25,7 @@
|
|||
#include "core/object/class_db.h"
|
||||
#include "core/object/object.h"
|
||||
#include "core/templates/hash_set.h"
|
||||
#include "editor/editor_main_screen.h"
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/editor_undo_redo_manager.h"
|
||||
#include "editor/gui/editor_spin_slider.h"
|
||||
|
@ -41,6 +42,7 @@
|
|||
#include "scene/gui/popup.h"
|
||||
#include "scene/gui/popup_menu.h"
|
||||
#include "scene/gui/split_container.h"
|
||||
#include "scene/gui/tab_bar.h"
|
||||
#include "scene/gui/tree.h"
|
||||
#include "scene/resources/texture.h"
|
||||
#endif // LIMBOAI_MODULE
|
||||
|
|
|
@ -263,6 +263,21 @@ void LimboHSM::_validate_property(PropertyInfo &p_property) const {
|
|||
void LimboHSM::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_POST_ENTER_TREE: {
|
||||
if (was_active && is_root()) {
|
||||
// Re-activate the root HSM if it was previously active.
|
||||
// Typically, this happens when the node is re-entered scene repeatedly (e.g., re-parenting, pooling).
|
||||
set_active(true);
|
||||
}
|
||||
} break;
|
||||
case NOTIFICATION_EXIT_TREE: {
|
||||
if (is_root()) {
|
||||
// Remember active status for re-parenting and exit state machine
|
||||
// to release resources and signal connections if active.
|
||||
was_active = active;
|
||||
if (is_active()) {
|
||||
_exit();
|
||||
}
|
||||
}
|
||||
} break;
|
||||
case NOTIFICATION_PROCESS: {
|
||||
_update(get_process_delta_time());
|
||||
|
|
|
@ -55,6 +55,7 @@ private:
|
|||
LimboState *previous_active;
|
||||
LimboState *next_active;
|
||||
bool updating = false;
|
||||
bool was_active = false;
|
||||
|
||||
HashMap<TransitionKey, Transition, TransitionKeyHasher> transitions;
|
||||
|
||||
|
|
|
@ -190,11 +190,6 @@ void LimboState::_notification(int p_what) {
|
|||
_update_blackboard_plan();
|
||||
}
|
||||
} break;
|
||||
case NOTIFICATION_PREDELETE: {
|
||||
if (is_active()) {
|
||||
_exit();
|
||||
}
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
#ifdef TOOLS_ENABLED
|
||||
#include "core/io/resource.h"
|
||||
#include "core/variant/variant.h"
|
||||
#include "editor/editor_main_screen.h"
|
||||
#include "editor/editor_node.h"
|
||||
#include "editor/plugins/script_editor_plugin.h"
|
||||
#endif // TOOLS_ENABLED
|
||||
|
@ -213,7 +214,7 @@ Variant VARIANT_DEFAULT(Variant::Type p_type) {
|
|||
void SHOW_BUILTIN_DOC(const String &p_topic) {
|
||||
#ifdef LIMBOAI_MODULE
|
||||
ScriptEditor::get_singleton()->goto_help(p_topic);
|
||||
EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT);
|
||||
EditorNode::get_singleton()->get_editor_main_screen()->select(EditorMainScreen::EDITOR_SCRIPT);
|
||||
#elif LIMBOAI_GDEXTENSION
|
||||
TypedArray<ScriptEditorBase> open_editors = EditorInterface::get_singleton()->get_script_editor()->get_open_script_editors();
|
||||
ERR_FAIL_COND_MSG(open_editors.size() == 0, "Can't open help page. Need at least one script open in the script editor.");
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#define EDITOR_FILE_SYSTEM() (EditorFileSystem::get_singleton())
|
||||
#define EDITOR_SETTINGS() (EditorSettings::get_singleton())
|
||||
#define BASE_CONTROL() (EditorNode::get_singleton()->get_gui_base())
|
||||
#define MAIN_SCREEN_CONTROL() (EditorNode::get_singleton()->get_main_screen_control())
|
||||
#define MAIN_SCREEN_CONTROL() (EditorNode::get_singleton()->get_editor_main_screen())
|
||||
#define SCENE_TREE() (SceneTree::get_singleton())
|
||||
#define IS_DEBUGGER_ACTIVE() (EngineDebugger::is_active())
|
||||
#define FS_DOCK_SELECT_FILE(m_path) FileSystemDock::get_singleton()->select_file(m_path)
|
||||
|
@ -47,7 +47,7 @@
|
|||
#define GET_PROJECT_SETTINGS_DIR() EditorPaths::get_singleton()->get_project_settings_dir()
|
||||
#define EDIT_RESOURCE(m_res) EditorNode::get_singleton()->edit_resource(m_res)
|
||||
#define INSPECTOR_GET_EDITED_OBJECT() (InspectorDock::get_inspector_singleton()->get_edited_object())
|
||||
#define SET_MAIN_SCREEN_EDITOR(m_name) (EditorNode::get_singleton()->select_editor_by_name(m_name))
|
||||
#define SET_MAIN_SCREEN_EDITOR(m_name) (EditorNode::get_singleton()->get_editor_main_screen()->select_by_name(m_name))
|
||||
#define FILE_EXISTS(m_path) FileAccess::exists(m_path)
|
||||
#define DIR_ACCESS_CREATE() DirAccess::create(DirAccess::ACCESS_RESOURCES)
|
||||
#define PERFORMANCE_ADD_CUSTOM_MONITOR(m_id, m_callable) (Performance::get_singleton()->add_custom_monitor(m_id, m_callable, Variant()))
|
||||
|
|
|
@ -395,6 +395,9 @@ String LimboUtility::get_property_hint_text(PropertyHint p_hint) const {
|
|||
case PROPERTY_HINT_ARRAY_TYPE: {
|
||||
return "ARRAY_TYPE";
|
||||
}
|
||||
case PROPERTY_HINT_DICTIONARY_TYPE: {
|
||||
return "DICTIONARY_TYPE";
|
||||
}
|
||||
case PROPERTY_HINT_LOCALE_ID: {
|
||||
return "LOCALE_ID";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue