diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index 0d55199..a15df40 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -44,27 +44,28 @@ #endif // ! LIMBOAI_MODULE #ifdef LIMBOAI_GDEXTENSION -#include "godot_cpp/classes/editor_interface.hpp" -#include "godot_cpp/classes/editor_paths.hpp" -#include "godot_cpp/classes/ref_counted.hpp" #include #include #include #include #include #include +#include +#include #include #include #include #include #include #include +#include #include #include #include #include #include #include +#include #endif // ! LIMBOAI_GDEXTENSION //**** LimboAIEditor @@ -178,7 +179,7 @@ void LimboAIEditor::_update_header() const { void LimboAIEditor::_update_history_buttons() { history_back->set_disabled(idx_history == 0); - history_forward->set_disabled(idx_history == (history.size() - 1)); + history_forward->set_disabled(idx_history >= (history.size() - 1)); } void LimboAIEditor::_new_bt() { @@ -691,11 +692,13 @@ void LimboAIEditor::_on_save_pressed() { } void LimboAIEditor::_on_history_back() { + ERR_FAIL_COND(history.size() == 0); idx_history = MAX(idx_history - 1, 0); EDIT_RESOURCE(history[idx_history]); } void LimboAIEditor::_on_history_forward() { + ERR_FAIL_COND(history.size() == 0); idx_history = MIN(idx_history + 1, history.size() - 1); EDIT_RESOURCE(history[idx_history]); } @@ -1039,6 +1042,9 @@ void LimboAIEditor::_notification(int p_what) { EDITOR_FILE_SYSTEM()->connect("resources_reload", callable_mp(this, &LimboAIEditor::_on_resources_reload)); + _update_history_buttons(); + _update_header(); + } break; case NOTIFICATION_THEME_CHANGED: { _do_update_theme_item_cache(); diff --git a/util/limbo_string_names.cpp b/util/limbo_string_names.cpp index d48f948..4c2e7a6 100644 --- a/util/limbo_string_names.cpp +++ b/util/limbo_string_names.cpp @@ -72,7 +72,7 @@ LimboStringNames::LimboStringNames() { font = SN("font"); font_color = SN("font_color"); font_size = SN("font_size"); - Forward = SN("Tools"); + Forward = SN("Forward"); gui_input = SN("gui_input"); GuiTreeArrowDown = SN("GuiTreeArrowDown"); GuiTreeArrowRight = SN("GuiTreeArrowRight");