Fix documentation related crash
This commit is contained in:
parent
d1030b877c
commit
b07fb71359
|
@ -24,10 +24,14 @@ void EDIT_SCRIPT(const String &p_path) {
|
||||||
#ifdef LIMBOAI_GDEXTENSION
|
#ifdef LIMBOAI_GDEXTENSION
|
||||||
|
|
||||||
#include "godot_cpp/classes/editor_interface.hpp"
|
#include "godot_cpp/classes/editor_interface.hpp"
|
||||||
|
#include "godot_cpp/core/error_macros.hpp"
|
||||||
|
#include "godot_cpp/variant/typed_array.hpp"
|
||||||
#include <godot_cpp/classes/editor_settings.hpp>
|
#include <godot_cpp/classes/editor_settings.hpp>
|
||||||
#include <godot_cpp/classes/project_settings.hpp>
|
#include <godot_cpp/classes/project_settings.hpp>
|
||||||
#include <godot_cpp/classes/resource_loader.hpp>
|
#include <godot_cpp/classes/resource_loader.hpp>
|
||||||
#include <godot_cpp/classes/script.hpp>
|
#include <godot_cpp/classes/script.hpp>
|
||||||
|
#include <godot_cpp/classes/script_editor.hpp>
|
||||||
|
#include <godot_cpp/classes/script_editor_base.hpp>
|
||||||
#include <godot_cpp/classes/translation_server.hpp>
|
#include <godot_cpp/classes/translation_server.hpp>
|
||||||
|
|
||||||
using namespace godot;
|
using namespace godot;
|
||||||
|
@ -83,4 +87,17 @@ Variant _GLOBAL_DEF(const PropertyInfo &p_info, const Variant &p_default, bool p
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // LIMBOAI_GDEXTENSION
|
void SHOW_DOC(const String &p_topic) {
|
||||||
|
#ifdef LIMBOAI_MODULE
|
||||||
|
ScriptEditor::get_singleton()->goto_help(m_doc);
|
||||||
|
EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT);
|
||||||
|
#else // 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.");
|
||||||
|
ScriptEditorBase *seb = Object::cast_to<ScriptEditorBase>(open_editors.front());
|
||||||
|
ERR_FAIL_NULL(seb);
|
||||||
|
seb->emit_signal("go_to_help", p_topic);
|
||||||
|
#endif // ! LIMBOAI_MODULE
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // ! LIMBOAI_GDEXTENSION
|
||||||
|
|
|
@ -51,10 +51,6 @@
|
||||||
#define FILE_EXISTS(m_path) FileAccess::exists(m_path)
|
#define FILE_EXISTS(m_path) FileAccess::exists(m_path)
|
||||||
#define DIR_ACCESS_CREATE() DirAccess::create(DirAccess::ACCESS_RESOURCES)
|
#define DIR_ACCESS_CREATE() DirAccess::create(DirAccess::ACCESS_RESOURCES)
|
||||||
|
|
||||||
#define SHOW_DOC(m_doc) ( \
|
|
||||||
ScriptEditor::get_singleton()->goto_help(m_doc); \
|
|
||||||
EditorNode::get_singleton()->set_visible_editor(EditorNode::EDITOR_SCRIPT);)
|
|
||||||
|
|
||||||
#define VARIANT_EVALUATE(m_op, m_lvalue, m_rvalue, r_ret) r_ret = Variant::evaluate(m_op, m_lvalue, m_rvalue)
|
#define VARIANT_EVALUATE(m_op, m_lvalue, m_rvalue, r_ret) r_ret = Variant::evaluate(m_op, m_lvalue, m_rvalue)
|
||||||
|
|
||||||
// * Enum
|
// * Enum
|
||||||
|
@ -104,8 +100,6 @@ void EDIT_SCRIPT(const String &p_path); // TODO: need a module version!
|
||||||
#define FILE_EXISTS(m_path) FileAccess::file_exists(m_path)
|
#define FILE_EXISTS(m_path) FileAccess::file_exists(m_path)
|
||||||
#define DIR_ACCESS_CREATE() DirAccess::open("res://")
|
#define DIR_ACCESS_CREATE() DirAccess::open("res://")
|
||||||
|
|
||||||
#define SHOW_DOC(m_doc) EditorInterface::get_singleton()->get_script_editor()->get_current_editor()->emit_signal("go_to_help", m_doc)
|
|
||||||
|
|
||||||
#define VARIANT_EVALUATE(m_op, m_lvalue, m_rvalue, r_ret) \
|
#define VARIANT_EVALUATE(m_op, m_lvalue, m_rvalue, r_ret) \
|
||||||
{ \
|
{ \
|
||||||
bool r_valid; \
|
bool r_valid; \
|
||||||
|
@ -151,4 +145,6 @@ inline void VARIANT_DELETE_IF_OBJECT(Variant m_variant) {
|
||||||
|
|
||||||
#define PROJECT_CONFIG_FILE() GET_PROJECT_SETTINGS_DIR().path_join("limbo_ai.cfg")
|
#define PROJECT_CONFIG_FILE() GET_PROJECT_SETTINGS_DIR().path_join("limbo_ai.cfg")
|
||||||
|
|
||||||
|
void SHOW_DOC(const String &p_topic);
|
||||||
|
|
||||||
#endif // LIMBO_COMPAT_H
|
#endif // LIMBO_COMPAT_H
|
||||||
|
|
Loading…
Reference in New Issue