|
|
@ -1294,7 +1294,12 @@ void LimboAIEditor::_notification(int p_what) {
|
|
|
|
cf.instantiate();
|
|
|
|
cf.instantiate();
|
|
|
|
String conf_path = PROJECT_CONFIG_FILE();
|
|
|
|
String conf_path = PROJECT_CONFIG_FILE();
|
|
|
|
cf->load(conf_path);
|
|
|
|
cf->load(conf_path);
|
|
|
|
cf->set_value("bt_editor", "bteditor_hsplit", hsc->get_split_offset());
|
|
|
|
int split_offset = hsc->get_split_offset();
|
|
|
|
|
|
|
|
if (editor_layout != (int)EDITOR_GET("limbo_ai/editor/layout")) {
|
|
|
|
|
|
|
|
// Editor layout settings changed - flip split offset.
|
|
|
|
|
|
|
|
split_offset *= -1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
cf->set_value("bt_editor", "bteditor_hsplit", split_offset);
|
|
|
|
cf->save(conf_path);
|
|
|
|
cf->save(conf_path);
|
|
|
|
|
|
|
|
|
|
|
|
if (task_tree->get_bt().is_valid() &&
|
|
|
|
if (task_tree->get_bt().is_valid() &&
|
|
|
@ -1377,6 +1382,20 @@ LimboAIEditor::LimboAIEditor() {
|
|
|
|
plugin = nullptr;
|
|
|
|
plugin = nullptr;
|
|
|
|
idx_history = 0;
|
|
|
|
idx_history = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef LIMBOAI_MODULE
|
|
|
|
|
|
|
|
EDITOR_DEF("limbo_ai/editor/layout", 0);
|
|
|
|
|
|
|
|
EDITOR_SETTINGS()->add_property_hint(PropertyInfo(Variant::INT, "limbo_ai/editor/layout", PROPERTY_HINT_ENUM, "Classic:0,Widescreen Optimized:1"));
|
|
|
|
|
|
|
|
EDITOR_SETTINGS()->set_restart_if_changed("limbo_ai/editor/layout", true);
|
|
|
|
|
|
|
|
#elif LIMBOAI_GDEXTENSION
|
|
|
|
|
|
|
|
EDITOR_SETTINGS()->set_initial_value("limbo_ai/editor/layout", 0, false);
|
|
|
|
|
|
|
|
Dictionary pinfo;
|
|
|
|
|
|
|
|
pinfo["name"] = "limbo_ai/editor/layout";
|
|
|
|
|
|
|
|
pinfo["type"] = Variant::INT;
|
|
|
|
|
|
|
|
pinfo["hint"] = PROPERTY_HINT_ENUM;
|
|
|
|
|
|
|
|
pinfo["hint_string"] = "Classic:0,Widescreen Optimized:1";
|
|
|
|
|
|
|
|
EDITOR_SETTINGS()->add_property_info(pinfo);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
LW_SHORTCUT("limbo_ai/rename_task", TTR("Rename"), LW_KEY(F2));
|
|
|
|
LW_SHORTCUT("limbo_ai/rename_task", TTR("Rename"), LW_KEY(F2));
|
|
|
|
// Todo: Add override support for shortcuts.
|
|
|
|
// Todo: Add override support for shortcuts.
|
|
|
|
// LW_SHORTCUT_OVERRIDE("limbo_ai/rename_task", "macos", Key::ENTER);
|
|
|
|
// LW_SHORTCUT_OVERRIDE("limbo_ai/rename_task", "macos", Key::ENTER);
|
|
|
@ -1506,7 +1525,7 @@ LimboAIEditor::LimboAIEditor() {
|
|
|
|
tab_bar->set_select_with_rmb(true);
|
|
|
|
tab_bar->set_select_with_rmb(true);
|
|
|
|
tab_bar->set_drag_to_rearrange_enabled(true);
|
|
|
|
tab_bar->set_drag_to_rearrange_enabled(true);
|
|
|
|
tab_bar->set_max_tab_width(int(EDITOR_GET("interface/scene_tabs/maximum_width")) * EDSCALE);
|
|
|
|
tab_bar->set_max_tab_width(int(EDITOR_GET("interface/scene_tabs/maximum_width")) * EDSCALE);
|
|
|
|
tab_bar->set_auto_translate(false);
|
|
|
|
tab_bar->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);
|
|
|
|
tab_bar->set_tab_close_display_policy(TabBar::CLOSE_BUTTON_SHOW_ACTIVE_ONLY);
|
|
|
|
tab_bar->set_tab_close_display_policy(TabBar::CLOSE_BUTTON_SHOW_ACTIVE_ONLY);
|
|
|
|
tab_bar->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
|
|
|
tab_bar->set_h_size_flags(Control::SIZE_EXPAND_FILL);
|
|
|
|
tab_bar->set_focus_mode(FocusMode::FOCUS_NONE);
|
|
|
|
tab_bar->set_focus_mode(FocusMode::FOCUS_NONE);
|
|
|
@ -1546,8 +1565,8 @@ LimboAIEditor::LimboAIEditor() {
|
|
|
|
task_palette = memnew(TaskPalette());
|
|
|
|
task_palette = memnew(TaskPalette());
|
|
|
|
task_palette->hide();
|
|
|
|
task_palette->hide();
|
|
|
|
hsc->add_child(task_palette);
|
|
|
|
hsc->add_child(task_palette);
|
|
|
|
TaskPalettePlacement palette_placement = (TaskPalettePlacement)(int)EDITOR_GET("limbo_ai/editor/task_palette_placement");
|
|
|
|
editor_layout = (EditorLayout)(int)EDITOR_GET("limbo_ai/editor/layout");
|
|
|
|
if (palette_placement == TaskPalettePlacement::LEFT_SIDE) {
|
|
|
|
if (editor_layout == EditorLayout::WIDESCREEN_OPTIMIZED) {
|
|
|
|
VBoxContainer *editor_vbox = memnew(VBoxContainer);
|
|
|
|
VBoxContainer *editor_vbox = memnew(VBoxContainer);
|
|
|
|
hsc->add_child(editor_vbox);
|
|
|
|
hsc->add_child(editor_vbox);
|
|
|
|
toolbar->reparent(editor_vbox);
|
|
|
|
toolbar->reparent(editor_vbox);
|
|
|
@ -1665,9 +1684,6 @@ LimboAIEditor::LimboAIEditor() {
|
|
|
|
GLOBAL_DEF(PropertyInfo(Variant::STRING, "limbo_ai/behavior_tree/user_task_dir_2", PROPERTY_HINT_DIR), "");
|
|
|
|
GLOBAL_DEF(PropertyInfo(Variant::STRING, "limbo_ai/behavior_tree/user_task_dir_2", PROPERTY_HINT_DIR), "");
|
|
|
|
GLOBAL_DEF(PropertyInfo(Variant::STRING, "limbo_ai/behavior_tree/user_task_dir_3", PROPERTY_HINT_DIR), "");
|
|
|
|
GLOBAL_DEF(PropertyInfo(Variant::STRING, "limbo_ai/behavior_tree/user_task_dir_3", PROPERTY_HINT_DIR), "");
|
|
|
|
|
|
|
|
|
|
|
|
EDITOR_DEF("limbo_ai/editor/task_palette_placement", 0);
|
|
|
|
|
|
|
|
EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "limbo_ai/editor/task_palette_placement", PROPERTY_HINT_ENUM, "Right Side:0,Left Side:1"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
String bt_default_dir = GLOBAL_GET("limbo_ai/behavior_tree/behavior_tree_default_dir");
|
|
|
|
String bt_default_dir = GLOBAL_GET("limbo_ai/behavior_tree/behavior_tree_default_dir");
|
|
|
|
save_dialog->set_current_dir(bt_default_dir);
|
|
|
|
save_dialog->set_current_dir(bt_default_dir);
|
|
|
|
load_dialog->set_current_dir(bt_default_dir);
|
|
|
|
load_dialog->set_current_dir(bt_default_dir);
|
|
|
|