From 7baa395d3f295ed016d51ba912c3d033aea14f8d Mon Sep 17 00:00:00 2001 From: Serhii Snitsaruk Date: Fri, 5 Jul 2024 17:02:29 +0200 Subject: [PATCH] Rename to editor_layout --- editor/limbo_ai_editor_plugin.cpp | 10 +++++----- editor/limbo_ai_editor_plugin.h | 7 ++++--- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/editor/limbo_ai_editor_plugin.cpp b/editor/limbo_ai_editor_plugin.cpp index 9e93b61..d59ecd0 100644 --- a/editor/limbo_ai_editor_plugin.cpp +++ b/editor/limbo_ai_editor_plugin.cpp @@ -1377,6 +1377,9 @@ LimboAIEditor::LimboAIEditor() { plugin = nullptr; idx_history = 0; + EDITOR_DEF("limbo_ai/editor/layout", 0); + EditorSettings::get_singleton()->add_property_hint(PropertyInfo(Variant::INT, "limbo_ai/editor/layout", PROPERTY_HINT_ENUM, "Classic:0,Widescreen Optimized:1")); + LW_SHORTCUT("limbo_ai/rename_task", TTR("Rename"), LW_KEY(F2)); // Todo: Add override support for shortcuts. // LW_SHORTCUT_OVERRIDE("limbo_ai/rename_task", "macos", Key::ENTER); @@ -1546,8 +1549,8 @@ LimboAIEditor::LimboAIEditor() { task_palette = memnew(TaskPalette()); task_palette->hide(); hsc->add_child(task_palette); - TaskPalettePlacement palette_placement = (TaskPalettePlacement)(int)EDITOR_GET("limbo_ai/editor/task_palette_placement"); - if (palette_placement == TaskPalettePlacement::LEFT_SIDE) { + editor_layout = (EditorLayout)(int)EDITOR_GET("limbo_ai/editor/layout"); + if (editor_layout == EditorLayout::WIDESCREEN_OPTIMIZED) { VBoxContainer *editor_vbox = memnew(VBoxContainer); hsc->add_child(editor_vbox); toolbar->reparent(editor_vbox); @@ -1665,9 +1668,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_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"); save_dialog->set_current_dir(bt_default_dir); load_dialog->set_current_dir(bt_default_dir); diff --git a/editor/limbo_ai_editor_plugin.h b/editor/limbo_ai_editor_plugin.h index 3475200..bda549c 100644 --- a/editor/limbo_ai_editor_plugin.h +++ b/editor/limbo_ai_editor_plugin.h @@ -111,9 +111,9 @@ private: TAB_CLOSE_ALL, }; - enum TaskPalettePlacement { - RIGHT_SIDE, - LEFT_SIDE, + enum EditorLayout { + CLASSIC, + WIDESCREEN_OPTIMIZED, }; struct ThemeCache { @@ -137,6 +137,7 @@ private: } theme_cache; EditorPlugin *plugin; + EditorLayout editor_layout; Vector> history; int idx_history; bool updating_tabs = false;