Rename to editor_layout

This commit is contained in:
Serhii Snitsaruk 2024-07-05 17:02:29 +02:00
parent b305041f28
commit 7baa395d3f
No known key found for this signature in database
GPG Key ID: A965EF8799FFEC2D
2 changed files with 9 additions and 8 deletions

View File

@ -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);

View File

@ -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<Ref<BehaviorTree>> history;
int idx_history;
bool updating_tabs = false;