Path: blob/master/editor/settings/editor_settings_dialog.cpp
9902 views
/**************************************************************************/1/* editor_settings_dialog.cpp */2/**************************************************************************/3/* This file is part of: */4/* GODOT ENGINE */5/* https://godotengine.org */6/**************************************************************************/7/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */8/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */9/* */10/* Permission is hereby granted, free of charge, to any person obtaining */11/* a copy of this software and associated documentation files (the */12/* "Software"), to deal in the Software without restriction, including */13/* without limitation the rights to use, copy, modify, merge, publish, */14/* distribute, sublicense, and/or sell copies of the Software, and to */15/* permit persons to whom the Software is furnished to do so, subject to */16/* the following conditions: */17/* */18/* The above copyright notice and this permission notice shall be */19/* included in all copies or substantial portions of the Software. */20/* */21/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */22/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */23/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */24/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */25/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */26/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */27/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */28/**************************************************************************/2930#include "editor_settings_dialog.h"3132#include "core/config/project_settings.h"33#include "core/input/input_map.h"34#include "core/os/keyboard.h"35#include "editor/debugger/editor_debugger_node.h"36#include "editor/editor_log.h"37#include "editor/editor_node.h"38#include "editor/editor_string_names.h"39#include "editor/editor_undo_redo_manager.h"40#include "editor/inspector/editor_property_name_processor.h"41#include "editor/inspector/editor_sectioned_inspector.h"42#include "editor/scene/3d/node_3d_editor_plugin.h"43#include "editor/settings/editor_event_search_bar.h"44#include "editor/settings/editor_settings.h"45#include "editor/settings/event_listener_line_edit.h"46#include "editor/settings/input_event_configuration_dialog.h"47#include "editor/settings/project_settings_editor.h"48#include "editor/themes/editor_scale.h"49#include "editor/themes/editor_theme_manager.h"50#include "scene/gui/check_button.h"51#include "scene/gui/panel_container.h"52#include "scene/gui/tab_container.h"53#include "scene/gui/texture_rect.h"54#include "scene/gui/tree.h"5556void EditorSettingsDialog::ok_pressed() {57if (!EditorSettings::get_singleton()) {58return;59}60_settings_save();61}6263void EditorSettingsDialog::_settings_changed() {64if (is_visible()) {65timer->start();66}67}6869void EditorSettingsDialog::_settings_property_edited(const String &p_name) {70String full_name = inspector->get_full_item_path(p_name);7172// Set theme presets to Custom when controlled settings change.7374if (full_name == "interface/theme/accent_color" || full_name == "interface/theme/base_color" || full_name == "interface/theme/contrast" || full_name == "interface/theme/draw_extra_borders") {75EditorSettings::get_singleton()->set_manually("interface/theme/preset", "Custom");76} else if (full_name == "interface/theme/base_spacing" || full_name == "interface/theme/additional_spacing") {77EditorSettings::get_singleton()->set_manually("interface/theme/spacing_preset", "Custom");78} else if (full_name.begins_with("text_editor/theme/highlighting")) {79EditorSettings::get_singleton()->set_manually("text_editor/theme/color_theme", "Custom");80} else if (full_name.begins_with("editors/visual_editors/connection_colors") || full_name.begins_with("editors/visual_editors/category_colors")) {81EditorSettings::get_singleton()->set_manually("editors/visual_editors/color_theme", "Custom");82} else if (full_name == "editors/3d/navigation/orbit_mouse_button" || full_name == "editors/3d/navigation/pan_mouse_button" || full_name == "editors/3d/navigation/zoom_mouse_button" || full_name == "editors/3d/navigation/emulate_3_button_mouse") {83EditorSettings::get_singleton()->set_manually("editors/3d/navigation/navigation_scheme", (int)Node3DEditorViewport::NAVIGATION_CUSTOM);84} else if (full_name == "editors/3d/navigation/navigation_scheme") {85update_navigation_preset();86}87}8889void EditorSettingsDialog::update_navigation_preset() {90Node3DEditorViewport::NavigationScheme nav_scheme = (Node3DEditorViewport::NavigationScheme)EDITOR_GET("editors/3d/navigation/navigation_scheme").operator int();91Node3DEditorViewport::ViewportNavMouseButton set_orbit_mouse_button = Node3DEditorViewport::NAVIGATION_LEFT_MOUSE;92Node3DEditorViewport::ViewportNavMouseButton set_pan_mouse_button = Node3DEditorViewport::NAVIGATION_LEFT_MOUSE;93Node3DEditorViewport::ViewportNavMouseButton set_zoom_mouse_button = Node3DEditorViewport::NAVIGATION_LEFT_MOUSE;94bool set_3_button_mouse = false;95Ref<InputEventKey> orbit_mod_key_1;96Ref<InputEventKey> orbit_mod_key_2;97Ref<InputEventKey> pan_mod_key_1;98Ref<InputEventKey> pan_mod_key_2;99Ref<InputEventKey> zoom_mod_key_1;100Ref<InputEventKey> zoom_mod_key_2;101bool set_preset = false;102103if (nav_scheme == Node3DEditorViewport::NAVIGATION_GODOT) {104set_preset = true;105set_orbit_mouse_button = Node3DEditorViewport::NAVIGATION_MIDDLE_MOUSE;106set_pan_mouse_button = Node3DEditorViewport::NAVIGATION_MIDDLE_MOUSE;107set_zoom_mouse_button = Node3DEditorViewport::NAVIGATION_MIDDLE_MOUSE;108set_3_button_mouse = false;109orbit_mod_key_1 = InputEventKey::create_reference(Key::NONE);110orbit_mod_key_2 = InputEventKey::create_reference(Key::NONE);111pan_mod_key_1 = InputEventKey::create_reference(Key::SHIFT);112pan_mod_key_2 = InputEventKey::create_reference(Key::NONE);113zoom_mod_key_1 = InputEventKey::create_reference(Key::CTRL);114zoom_mod_key_2 = InputEventKey::create_reference(Key::NONE);115} else if (nav_scheme == Node3DEditorViewport::NAVIGATION_MAYA) {116set_preset = true;117set_orbit_mouse_button = Node3DEditorViewport::NAVIGATION_LEFT_MOUSE;118set_pan_mouse_button = Node3DEditorViewport::NAVIGATION_MIDDLE_MOUSE;119set_zoom_mouse_button = Node3DEditorViewport::NAVIGATION_RIGHT_MOUSE;120set_3_button_mouse = false;121orbit_mod_key_1 = InputEventKey::create_reference(Key::ALT);122orbit_mod_key_2 = InputEventKey::create_reference(Key::NONE);123pan_mod_key_1 = InputEventKey::create_reference(Key::NONE);124pan_mod_key_2 = InputEventKey::create_reference(Key::NONE);125zoom_mod_key_1 = InputEventKey::create_reference(Key::ALT);126zoom_mod_key_2 = InputEventKey::create_reference(Key::NONE);127} else if (nav_scheme == Node3DEditorViewport::NAVIGATION_MODO) {128set_preset = true;129set_orbit_mouse_button = Node3DEditorViewport::NAVIGATION_LEFT_MOUSE;130set_pan_mouse_button = Node3DEditorViewport::NAVIGATION_LEFT_MOUSE;131set_zoom_mouse_button = Node3DEditorViewport::NAVIGATION_LEFT_MOUSE;132set_3_button_mouse = false;133orbit_mod_key_1 = InputEventKey::create_reference(Key::ALT);134orbit_mod_key_2 = InputEventKey::create_reference(Key::NONE);135pan_mod_key_1 = InputEventKey::create_reference(Key::SHIFT);136pan_mod_key_2 = InputEventKey::create_reference(Key::ALT);137zoom_mod_key_1 = InputEventKey::create_reference(Key::ALT);138zoom_mod_key_2 = InputEventKey::create_reference(Key::CTRL);139} else if (nav_scheme == Node3DEditorViewport::NAVIGATION_TABLET) {140set_preset = true;141set_orbit_mouse_button = Node3DEditorViewport::NAVIGATION_MIDDLE_MOUSE;142set_pan_mouse_button = Node3DEditorViewport::NAVIGATION_MIDDLE_MOUSE;143set_zoom_mouse_button = Node3DEditorViewport::NAVIGATION_MIDDLE_MOUSE;144set_3_button_mouse = true;145orbit_mod_key_1 = InputEventKey::create_reference(Key::ALT);146orbit_mod_key_2 = InputEventKey::create_reference(Key::NONE);147pan_mod_key_1 = InputEventKey::create_reference(Key::SHIFT);148pan_mod_key_2 = InputEventKey::create_reference(Key::NONE);149zoom_mod_key_1 = InputEventKey::create_reference(Key::CTRL);150zoom_mod_key_2 = InputEventKey::create_reference(Key::NONE);151}152// Set settings to the desired preset values.153if (set_preset) {154EditorSettings::get_singleton()->set_manually("editors/3d/navigation/orbit_mouse_button", (int)set_orbit_mouse_button);155EditorSettings::get_singleton()->set_manually("editors/3d/navigation/pan_mouse_button", (int)set_pan_mouse_button);156EditorSettings::get_singleton()->set_manually("editors/3d/navigation/zoom_mouse_button", (int)set_zoom_mouse_button);157EditorSettings::get_singleton()->set_manually("editors/3d/navigation/emulate_3_button_mouse", set_3_button_mouse);158_set_shortcut_input("spatial_editor/viewport_orbit_modifier_1", orbit_mod_key_1);159_set_shortcut_input("spatial_editor/viewport_orbit_modifier_2", orbit_mod_key_2);160_set_shortcut_input("spatial_editor/viewport_pan_modifier_1", pan_mod_key_1);161_set_shortcut_input("spatial_editor/viewport_pan_modifier_2", pan_mod_key_2);162_set_shortcut_input("spatial_editor/viewport_zoom_modifier_1", zoom_mod_key_1);163_set_shortcut_input("spatial_editor/viewport_zoom_modifier_2", zoom_mod_key_2);164}165}166167void EditorSettingsDialog::_set_shortcut_input(const String &p_name, Ref<InputEventKey> &p_event) {168Array sc_events;169if (p_event->get_keycode() != Key::NONE) {170sc_events.push_back((Variant)p_event);171}172173Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(p_name);174sc->set_events(sc_events);175}176177void EditorSettingsDialog::_settings_save() {178if (!timer->is_stopped()) {179timer->stop();180}181EditorSettings::get_singleton()->notify_changes();182EditorSettings::get_singleton()->save();183}184185void EditorSettingsDialog::cancel_pressed() {186if (!EditorSettings::get_singleton()) {187return;188}189190EditorSettings::get_singleton()->notify_changes();191}192193void EditorSettingsDialog::popup_edit_settings() {194if (!EditorSettings::get_singleton()) {195return;196}197198EditorSettings::get_singleton()->update_text_editor_themes_list(); // Make sure we have an up to date list of themes.199200_update_dynamic_property_hints();201202inspector->edit(EditorSettings::get_singleton());203inspector->get_inspector()->update_tree();204205_update_shortcuts();206set_process_shortcut_input(true);207208// Restore valid window bounds or pop up at default size.209Rect2 saved_size = EditorSettings::get_singleton()->get_project_metadata("dialog_bounds", "editor_settings", Rect2());210if (saved_size != Rect2()) {211popup(saved_size);212} else {213popup_centered_clamped(Size2(900, 700) * EDSCALE, 0.8);214}215216_focus_current_search_box();217}218219void EditorSettingsDialog::_undo_redo_callback(void *p_self, const String &p_name) {220EditorNode::get_log()->add_message(p_name, EditorLog::MSG_TYPE_EDITOR);221}222223void EditorSettingsDialog::_notification(int p_what) {224switch (p_what) {225case NOTIFICATION_VISIBILITY_CHANGED: {226if (!is_visible()) {227EditorSettings::get_singleton()->set_project_metadata("dialog_bounds", "editor_settings", Rect2(get_position(), get_size()));228set_process_shortcut_input(false);229}230} break;231232case NOTIFICATION_READY: {233EditorSettingsPropertyWrapper::restart_request_callback = callable_mp(this, &EditorSettingsDialog::_editor_restart_request);234235EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();236undo_redo->get_or_create_history(EditorUndoRedoManager::GLOBAL_HISTORY).undo_redo->set_method_notify_callback(EditorDebuggerNode::_methods_changed, nullptr);237undo_redo->get_or_create_history(EditorUndoRedoManager::GLOBAL_HISTORY).undo_redo->set_property_notify_callback(EditorDebuggerNode::_properties_changed, nullptr);238undo_redo->get_or_create_history(EditorUndoRedoManager::GLOBAL_HISTORY).undo_redo->set_commit_notify_callback(_undo_redo_callback, this);239} break;240241case NOTIFICATION_ENTER_TREE: {242_update_icons();243} break;244245case NOTIFICATION_THEME_CHANGED: {246_update_shortcuts();247} break;248249case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {250if (EditorThemeManager::is_generated_theme_outdated()) {251_update_icons();252}253254bool update_shortcuts_tab =255EditorSettings::get_singleton()->check_changed_settings_in_group("shortcuts") ||256EditorSettings::get_singleton()->check_changed_settings_in_group("builtin_action_overrides");257if (update_shortcuts_tab) {258_update_shortcuts();259}260261if (EditorSettings::get_singleton()->check_changed_settings_in_group("editors/3d/navigation")) {262// Shortcuts may have changed, so dynamic hint values must update.263_update_dynamic_property_hints();264inspector->get_inspector()->update_tree();265}266267if (EditorSettings::get_singleton()->check_changed_settings_in_group("interface/editor/localize_settings")) {268inspector->update_category_list();269}270} break;271}272}273274void EditorSettingsDialog::shortcut_input(const Ref<InputEvent> &p_event) {275const Ref<InputEventKey> k = p_event;276if (k.is_valid() && k->is_pressed()) {277bool handled = false;278279if (ED_IS_SHORTCUT("ui_undo", p_event)) {280EditorNode::get_singleton()->undo();281handled = true;282}283284if (ED_IS_SHORTCUT("ui_redo", p_event)) {285EditorNode::get_singleton()->redo();286handled = true;287}288289if (k->is_match(InputEventKey::create_reference(KeyModifierMask::CMD_OR_CTRL | Key::F))) {290_focus_current_search_box();291handled = true;292}293294if (handled) {295set_input_as_handled();296}297}298}299300void EditorSettingsDialog::_update_icons() {301search_box->set_right_icon(get_editor_theme_icon(SNAME("Search")));302search_box->set_clear_button_enabled(true);303304restart_close_button->set_button_icon(get_editor_theme_icon(SNAME("Close")));305restart_container->add_theme_style_override(SceneStringName(panel), get_theme_stylebox(SceneStringName(panel), SNAME("Tree")));306restart_icon->set_texture(get_editor_theme_icon(SNAME("StatusWarning")));307restart_label->add_theme_color_override(SceneStringName(font_color), get_theme_color(SNAME("warning_color"), EditorStringName(Editor)));308}309310void EditorSettingsDialog::_event_config_confirmed() {311Ref<InputEventKey> k = shortcut_editor->get_event();312if (k.is_null()) {313return;314}315316if (current_event_index == -1) {317// Add new event318current_events.push_back(k);319} else {320// Edit existing event321current_events[current_event_index] = k;322}323324if (is_editing_action) {325_update_builtin_action(current_edited_identifier, current_events);326} else {327_update_shortcut_events(current_edited_identifier, current_events);328}329}330331void EditorSettingsDialog::_update_builtin_action(const String &p_name, const Array &p_events) {332Array old_input_array = EditorSettings::get_singleton()->get_builtin_action_overrides(p_name);333if (old_input_array.is_empty()) {334List<Ref<InputEvent>> defaults = InputMap::get_singleton()->get_builtins_with_feature_overrides_applied()[current_edited_identifier];335old_input_array = _event_list_to_array_helper(defaults);336}337338EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();339undo_redo->create_action(vformat(TTR("Edit Built-in Action: %s"), p_name));340undo_redo->add_do_method(EditorSettings::get_singleton(), "mark_setting_changed", "builtin_action_overrides");341undo_redo->add_undo_method(EditorSettings::get_singleton(), "mark_setting_changed", "builtin_action_overrides");342undo_redo->add_do_method(EditorSettings::get_singleton(), "set_builtin_action_override", p_name, p_events);343undo_redo->add_undo_method(EditorSettings::get_singleton(), "set_builtin_action_override", p_name, old_input_array);344undo_redo->add_do_method(this, "_update_shortcuts");345undo_redo->add_undo_method(this, "_update_shortcuts");346undo_redo->add_do_method(this, "_settings_changed");347undo_redo->add_undo_method(this, "_settings_changed");348undo_redo->commit_action();349}350351void EditorSettingsDialog::_update_shortcut_events(const String &p_path, const Array &p_events) {352Ref<Shortcut> current_sc = EditorSettings::get_singleton()->get_shortcut(p_path);353354EditorUndoRedoManager *undo_redo = EditorUndoRedoManager::get_singleton();355undo_redo->create_action(vformat(TTR("Edit Shortcut: %s"), p_path), UndoRedo::MERGE_DISABLE, EditorSettings::get_singleton());356// History must be fixed based on the EditorSettings object because current_sc would357// incorrectly make this action use the scene history.358undo_redo->force_fixed_history();359undo_redo->add_do_method(current_sc.ptr(), "set_events", p_events);360undo_redo->add_undo_method(current_sc.ptr(), "set_events", current_sc->get_events());361undo_redo->add_do_method(EditorSettings::get_singleton(), "mark_setting_changed", "shortcuts");362undo_redo->add_undo_method(EditorSettings::get_singleton(), "mark_setting_changed", "shortcuts");363undo_redo->add_do_method(this, "_update_shortcuts");364undo_redo->add_undo_method(this, "_update_shortcuts");365undo_redo->add_do_method(this, "_settings_changed");366undo_redo->add_undo_method(this, "_settings_changed");367undo_redo->commit_action();368369bool path_is_orbit_mod = p_path == "spatial_editor/viewport_orbit_modifier_1" || p_path == "spatial_editor/viewport_orbit_modifier_2";370bool path_is_pan_mod = p_path == "spatial_editor/viewport_pan_modifier_1" || p_path == "spatial_editor/viewport_pan_modifier_2";371bool path_is_zoom_mod = p_path == "spatial_editor/viewport_zoom_modifier_1" || p_path == "spatial_editor/viewport_zoom_modifier_2";372if (path_is_orbit_mod || path_is_pan_mod || path_is_zoom_mod) {373EditorSettings::get_singleton()->set_manually("editors/3d/navigation/navigation_scheme", (int)Node3DEditorViewport::NAVIGATION_CUSTOM);374}375}376377Array EditorSettingsDialog::_event_list_to_array_helper(const List<Ref<InputEvent>> &p_events) {378Array events;379380// Convert the list to an array, and only keep key events as this is for the editor.381for (const List<Ref<InputEvent>>::Element *E = p_events.front(); E; E = E->next()) {382Ref<InputEventKey> k = E->get();383if (k.is_valid()) {384events.append(E->get());385}386}387388return events;389}390391TreeItem *EditorSettingsDialog::_create_shortcut_treeitem(TreeItem *p_parent, const String &p_shortcut_identifier, const String &p_display, Array &p_events, bool p_allow_revert, bool p_is_action, bool p_is_collapsed) {392TreeItem *shortcut_item = shortcuts->create_item(p_parent);393shortcut_item->set_collapsed(p_is_collapsed);394shortcut_item->set_text(0, p_display);395396Ref<InputEvent> primary = p_events.size() > 0 ? Ref<InputEvent>(p_events[0]) : Ref<InputEvent>();397Ref<InputEvent> secondary = p_events.size() > 1 ? Ref<InputEvent>(p_events[1]) : Ref<InputEvent>();398399String sc_text = TTRC("None");400if (primary.is_valid()) {401sc_text = primary->as_text();402403if (secondary.is_valid()) {404sc_text += ", " + secondary->as_text();405406if (p_events.size() > 2) {407sc_text += " (+" + itos(p_events.size() - 2) + ")";408}409}410shortcut_item->set_auto_translate_mode(1, AUTO_TRANSLATE_MODE_DISABLED);411}412413shortcut_item->set_text(1, sc_text);414if (sc_text == "None") {415// Fade out unassigned shortcut labels for easier visual grepping.416shortcut_item->set_custom_color(1, get_theme_color(SceneStringName(font_color), SNAME("Label")) * Color(1, 1, 1, 0.5));417}418419if (p_allow_revert) {420shortcut_item->add_button(1, get_editor_theme_icon(SNAME("Reload")), SHORTCUT_REVERT);421}422423shortcut_item->add_button(1, get_editor_theme_icon(SNAME("Add")), SHORTCUT_ADD);424shortcut_item->add_button(1, get_editor_theme_icon(SNAME("Close")), SHORTCUT_ERASE, p_events.is_empty());425426shortcut_item->set_meta("is_action", p_is_action);427shortcut_item->set_meta("type", "shortcut");428shortcut_item->set_meta("shortcut_identifier", p_shortcut_identifier);429shortcut_item->set_meta("events", p_events);430431// Shortcut Input Events432for (int i = 0; i < p_events.size(); i++) {433Ref<InputEvent> ie = p_events[i];434if (ie.is_null()) {435continue;436}437438TreeItem *event_item = shortcuts->create_item(shortcut_item);439440// TRANSLATORS: This is the label for the main input event of a shortcut.441event_item->set_text(0, shortcut_item->get_child_count() == 1 ? TTRC("Primary") : "");442event_item->set_text(1, ie->as_text());443event_item->set_auto_translate_mode(1, AUTO_TRANSLATE_MODE_DISABLED);444445event_item->add_button(1, get_editor_theme_icon(SNAME("Edit")), SHORTCUT_EDIT);446event_item->add_button(1, get_editor_theme_icon(SNAME("Close")), SHORTCUT_ERASE);447448event_item->set_custom_bg_color(0, get_theme_color(SNAME("dark_color_3"), EditorStringName(Editor)));449event_item->set_custom_bg_color(1, get_theme_color(SNAME("dark_color_3"), EditorStringName(Editor)));450451event_item->set_meta("is_action", p_is_action);452event_item->set_meta("type", "event");453event_item->set_meta("event_index", i);454}455456return shortcut_item;457}458459bool EditorSettingsDialog::_should_display_shortcut(const String &p_name, const Array &p_events, bool p_match_localized_name) const {460const Ref<InputEvent> search_ev = shortcut_search_bar->get_event();461if (search_ev.is_valid()) {462bool event_match = false;463for (int i = 0; i < p_events.size(); ++i) {464const Ref<InputEvent> ev = p_events[i];465if (ev.is_valid() && ev->is_match(search_ev, true)) {466event_match = true;467break;468}469}470if (!event_match) {471return false;472}473}474475const String &search_text = shortcut_search_bar->get_name();476if (search_text.is_empty()) {477return true;478}479if (search_text.is_subsequence_ofn(p_name)) {480return true;481}482if (p_match_localized_name && search_text.is_subsequence_ofn(TTR(p_name))) {483return true;484}485486return false;487}488489void EditorSettingsDialog::_update_shortcuts() {490// Before clearing the tree, take note of which categories are collapsed so that this state can be maintained when the tree is repopulated.491HashMap<String, bool> collapsed;492493if (shortcuts->get_root() && shortcuts->get_root()->get_first_child()) {494TreeItem *ti = shortcuts->get_root()->get_first_child();495while (ti) {496// Not all items have valid or unique text in the first column - so if it has an identifier, use that, as it should be unique.497if (ti->get_first_child() && ti->has_meta("shortcut_identifier")) {498collapsed[ti->get_meta("shortcut_identifier")] = ti->is_collapsed();499} else {500collapsed[ti->get_text(0)] = ti->is_collapsed();501}502503// Try go down tree504TreeItem *ti_next = ti->get_first_child();505// Try go to the next node via in-order traversal506if (!ti_next) {507ti_next = ti;508while (ti_next && !ti_next->get_next()) {509ti_next = ti_next->get_parent();510}511if (ti_next) {512ti_next = ti_next->get_next();513}514}515516ti = ti_next;517}518}519520shortcuts->clear();521522TreeItem *root = shortcuts->create_item();523HashMap<String, TreeItem *> sections;524525// Set up section for Common/Built-in actions526TreeItem *common_section = shortcuts->create_item(root);527sections["Common"] = common_section;528common_section->set_text(0, TTRC("Common"));529common_section->set_selectable(0, false);530common_section->set_selectable(1, false);531if (collapsed.has("Common")) {532common_section->set_collapsed(collapsed["Common"]);533}534common_section->set_custom_bg_color(0, get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor)));535common_section->set_custom_bg_color(1, get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor)));536537// Get the action map for the editor, and add each item to the "Common" section.538for (const KeyValue<StringName, InputMap::Action> &E : InputMap::get_singleton()->get_action_map()) {539const String &action_name = E.key;540const InputMap::Action &action = E.value;541542// Skip non-builtin actions.543if (!InputMap::get_singleton()->get_builtins_with_feature_overrides_applied().has(action_name)) {544continue;545}546547const List<Ref<InputEvent>> &all_default_events = InputMap::get_singleton()->get_builtins_with_feature_overrides_applied().find(action_name)->value;548Array action_events = _event_list_to_array_helper(action.inputs);549if (!_should_display_shortcut(action_name, action_events, false)) {550continue;551}552553Array default_events = _event_list_to_array_helper(all_default_events);554bool same_as_defaults = Shortcut::is_event_array_equal(default_events, action_events);555bool collapse = !collapsed.has(action_name) || (collapsed.has(action_name) && collapsed[action_name]);556557TreeItem *item = _create_shortcut_treeitem(common_section, action_name, action_name, action_events, !same_as_defaults, true, collapse);558item->set_auto_translate_mode(0, AUTO_TRANSLATE_MODE_DISABLED); // `ui_*` input action names are untranslatable identifiers.559}560561// Editor Shortcuts562563List<String> slist;564EditorSettings::get_singleton()->get_shortcut_list(&slist);565slist.sort(); // Sort alphabetically.566567const EditorPropertyNameProcessor::Style name_style = EditorPropertyNameProcessor::get_settings_style();568const EditorPropertyNameProcessor::Style tooltip_style = EditorPropertyNameProcessor::get_tooltip_style(name_style);569570// Create all sections first.571for (const String &E : slist) {572Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(E);573String section_name = E.get_slicec('/', 0);574575if (sections.has(section_name)) {576continue;577}578579TreeItem *section = shortcuts->create_item(root);580581const String item_name = EditorPropertyNameProcessor::get_singleton()->process_name(section_name, name_style, E);582const String tooltip = EditorPropertyNameProcessor::get_singleton()->process_name(section_name, tooltip_style, E);583584section->set_auto_translate_mode(0, AUTO_TRANSLATE_MODE_DISABLED); // Already translated manually.585section->set_text(0, item_name);586section->set_tooltip_text(0, tooltip);587section->set_selectable(0, false);588section->set_selectable(1, false);589section->set_custom_bg_color(0, get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor)));590section->set_custom_bg_color(1, get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor)));591592if (collapsed.has(item_name)) {593section->set_collapsed(collapsed[item_name]);594}595596sections[section_name] = section;597}598599// Add shortcuts to sections.600for (const String &E : slist) {601Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(E);602if (!sc->has_meta("original")) {603continue;604}605606String section_name = E.get_slicec('/', 0);607TreeItem *section = sections[section_name];608609if (!_should_display_shortcut(sc->get_name(), sc->get_events(), true)) {610continue;611}612613Array original = sc->get_meta("original");614Array shortcuts_array = sc->get_events().duplicate(true);615bool same_as_defaults = Shortcut::is_event_array_equal(original, shortcuts_array);616bool collapse = !collapsed.has(E) || (collapsed.has(E) && collapsed[E]);617618_create_shortcut_treeitem(section, E, sc->get_name(), shortcuts_array, !same_as_defaults, false, collapse);619}620621// remove sections with no shortcuts622for (KeyValue<String, TreeItem *> &E : sections) {623TreeItem *section = E.value;624if (section->get_first_child() == nullptr) {625root->remove_child(section);626memdelete(section);627}628}629}630631void EditorSettingsDialog::_shortcut_button_pressed(Object *p_item, int p_column, int p_idx, MouseButton p_button) {632if (p_button != MouseButton::LEFT) {633return;634}635TreeItem *ti = Object::cast_to<TreeItem>(p_item);636ERR_FAIL_NULL_MSG(ti, "Object passed is not a TreeItem.");637638ShortcutButton button_idx = (ShortcutButton)p_idx;639640is_editing_action = ti->get_meta("is_action");641642String type = ti->get_meta("type");643644if (type == "event") {645current_edited_identifier = ti->get_parent()->get_meta("shortcut_identifier");646current_events = ti->get_parent()->get_meta("events");647current_event_index = ti->get_meta("event_index");648} else { // Type is "shortcut"649current_edited_identifier = ti->get_meta("shortcut_identifier");650current_events = ti->get_meta("events");651current_event_index = -1;652}653654switch (button_idx) {655case EditorSettingsDialog::SHORTCUT_ADD: {656// Only for "shortcut" types657shortcut_editor->popup_and_configure();658} break;659case EditorSettingsDialog::SHORTCUT_EDIT: {660// Only for "event" types661shortcut_editor->popup_and_configure(current_events[current_event_index]);662} break;663case EditorSettingsDialog::SHORTCUT_ERASE: {664if (type == "shortcut") {665if (is_editing_action) {666_update_builtin_action(current_edited_identifier, Array());667} else {668_update_shortcut_events(current_edited_identifier, Array());669}670} else if (type == "event") {671current_events.remove_at(current_event_index);672673if (is_editing_action) {674_update_builtin_action(current_edited_identifier, current_events);675} else {676_update_shortcut_events(current_edited_identifier, current_events);677}678}679} break;680case EditorSettingsDialog::SHORTCUT_REVERT: {681// Only for "shortcut" types682if (is_editing_action) {683List<Ref<InputEvent>> defaults = InputMap::get_singleton()->get_builtins_with_feature_overrides_applied()[current_edited_identifier];684Array events = _event_list_to_array_helper(defaults);685686_update_builtin_action(current_edited_identifier, events);687} else {688Ref<Shortcut> sc = EditorSettings::get_singleton()->get_shortcut(current_edited_identifier);689Array original = sc->get_meta("original");690_update_shortcut_events(current_edited_identifier, original);691}692} break;693default:694break;695}696}697698void EditorSettingsDialog::_shortcut_cell_double_clicked() {699// When a shortcut cell is double clicked:700// If the cell has children and is in the bindings column, and if its first child is editable,701// then uncollapse the cell, and if the first child is the only child, then edit that child.702// If the cell is in the bindings column and can be edited, then edit it.703// If the cell is in the name column, then toggle collapse.704const ShortcutButton edit_btn_id = EditorSettingsDialog::SHORTCUT_EDIT;705const int edit_btn_col = 1;706TreeItem *ti = shortcuts->get_selected();707if (ti == nullptr) {708return;709}710711String type = ti->get_meta("type");712int col = shortcuts->get_selected_column();713if (type == "shortcut" && col == 0) {714if (ti->get_first_child()) {715ti->set_collapsed(!ti->is_collapsed());716}717} else if (type == "shortcut" && col == 1) {718if (ti->get_first_child()) {719TreeItem *child_ti = ti->get_first_child();720if (child_ti->get_button_by_id(edit_btn_col, edit_btn_id) != -1) {721ti->set_collapsed(false);722if (ti->get_child_count() == 1) {723_shortcut_button_pressed(child_ti, edit_btn_col, edit_btn_id);724}725}726}727} else if (type == "event" && col == 1) {728if (ti->get_button_by_id(edit_btn_col, edit_btn_id) != -1) {729_shortcut_button_pressed(ti, edit_btn_col, edit_btn_id);730}731}732}733734Variant EditorSettingsDialog::get_drag_data_fw(const Point2 &p_point, Control *p_from) {735TreeItem *selected = shortcuts->get_selected();736737// Only allow drag for events738if (!selected || (String)selected->get_meta("type", "") != "event") {739return Variant();740}741742String label_text = vformat(TTRC("Event %d"), selected->get_meta("event_index"));743Label *label = memnew(Label(label_text));744label->set_modulate(Color(1, 1, 1, 1.0f));745shortcuts->set_drag_preview(label);746747shortcuts->set_drop_mode_flags(Tree::DROP_MODE_INBETWEEN);748749return Dictionary(); // No data required750}751752bool EditorSettingsDialog::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const {753TreeItem *selected = shortcuts->get_selected();754TreeItem *item = (p_point == Vector2(Math::INF, Math::INF)) ? shortcuts->get_selected() : shortcuts->get_item_at_position(p_point);755if (!selected || !item || item == selected || (String)item->get_meta("type", "") != "event") {756return false;757}758759// Don't allow moving an events in-between shortcuts.760if (selected->get_parent()->get_meta("shortcut_identifier") != item->get_parent()->get_meta("shortcut_identifier")) {761return false;762}763764return true;765}766767void EditorSettingsDialog::drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) {768if (!can_drop_data_fw(p_point, p_data, p_from)) {769return;770}771772TreeItem *selected = shortcuts->get_selected();773TreeItem *target = (p_point == Vector2(Math::INF, Math::INF)) ? shortcuts->get_selected() : shortcuts->get_item_at_position(p_point);774775if (!target) {776return;777}778779int target_event_index = target->get_meta("event_index");780int index_moving_from = selected->get_meta("event_index");781782Array events = selected->get_parent()->get_meta("events");783784Variant event_moved = events[index_moving_from];785events.remove_at(index_moving_from);786events.insert(target_event_index, event_moved);787788String ident = selected->get_parent()->get_meta("shortcut_identifier");789if (selected->get_meta("is_action")) {790_update_builtin_action(ident, events);791} else {792_update_shortcut_events(ident, events);793}794}795796void EditorSettingsDialog::_tabs_tab_changed(int p_tab) {797_focus_current_search_box();798799// When tab has switched, shortcuts may have changed.800_update_dynamic_property_hints();801inspector->get_inspector()->update_tree();802}803804void EditorSettingsDialog::_update_dynamic_property_hints() {805// Calling add_property_hint overrides the existing hint.806EditorSettings *settings = EditorSettings::get_singleton();807settings->add_property_hint(_create_mouse_shortcut_property_info("editors/3d/navigation/orbit_mouse_button", "spatial_editor/viewport_orbit_modifier_1", "spatial_editor/viewport_orbit_modifier_2"));808settings->add_property_hint(_create_mouse_shortcut_property_info("editors/3d/navigation/pan_mouse_button", "spatial_editor/viewport_pan_modifier_1", "spatial_editor/viewport_pan_modifier_2"));809settings->add_property_hint(_create_mouse_shortcut_property_info("editors/3d/navigation/zoom_mouse_button", "spatial_editor/viewport_zoom_modifier_1", "spatial_editor/viewport_zoom_modifier_2"));810}811812PropertyInfo EditorSettingsDialog::_create_mouse_shortcut_property_info(const String &p_property_name, const String &p_shortcut_1_name, const String &p_shortcut_2_name) {813String hint_string;814hint_string += _get_shortcut_button_string(p_shortcut_1_name) + _get_shortcut_button_string(p_shortcut_2_name);815hint_string += "Left Mouse,";816hint_string += _get_shortcut_button_string(p_shortcut_1_name) + _get_shortcut_button_string(p_shortcut_2_name);817hint_string += "Middle Mouse,";818hint_string += _get_shortcut_button_string(p_shortcut_1_name) + _get_shortcut_button_string(p_shortcut_2_name);819hint_string += "Right Mouse,";820hint_string += _get_shortcut_button_string(p_shortcut_1_name) + _get_shortcut_button_string(p_shortcut_2_name);821hint_string += "Mouse Button 4,";822hint_string += _get_shortcut_button_string(p_shortcut_1_name) + _get_shortcut_button_string(p_shortcut_2_name);823hint_string += "Mouse Button 5";824825return PropertyInfo(Variant::INT, p_property_name, PROPERTY_HINT_ENUM, hint_string);826}827828String EditorSettingsDialog::_get_shortcut_button_string(const String &p_shortcut_name) {829String button_string;830Ref<Shortcut> shortcut_ref = EditorSettings::get_singleton()->get_shortcut(p_shortcut_name);831Array events = shortcut_ref->get_events();832for (Ref<InputEvent> input_event : events) {833button_string += input_event->as_text() + " + ";834}835return button_string;836}837838void EditorSettingsDialog::_focus_current_search_box() {839Control *tab = tabs->get_current_tab_control();840LineEdit *current_search_box = nullptr;841if (tab == tab_general) {842current_search_box = search_box;843} else if (tab == tab_shortcuts) {844current_search_box = shortcut_search_bar->get_name_search_box();845}846847if (current_search_box) {848current_search_box->grab_focus();849current_search_box->select_all();850}851}852853void EditorSettingsDialog::_advanced_toggled(bool p_button_pressed) {854EditorSettings::get_singleton()->set("_editor_settings_advanced_mode", p_button_pressed);855}856857void EditorSettingsDialog::_editor_restart() {858EditorNode::get_singleton()->save_all_scenes();859EditorNode::get_singleton()->restart_editor();860}861862void EditorSettingsDialog::_editor_restart_request() {863restart_container->show();864}865866void EditorSettingsDialog::_editor_restart_close() {867restart_container->hide();868}869870void EditorSettingsDialog::_bind_methods() {871ClassDB::bind_method(D_METHOD("_update_shortcuts"), &EditorSettingsDialog::_update_shortcuts);872ClassDB::bind_method(D_METHOD("_settings_changed"), &EditorSettingsDialog::_settings_changed);873}874875EditorSettingsDialog::EditorSettingsDialog() {876set_title(TTRC("Editor Settings"));877set_clamp_to_embedder(true);878879tabs = memnew(TabContainer);880tabs->set_theme_type_variation("TabContainerOdd");881tabs->connect("tab_changed", callable_mp(this, &EditorSettingsDialog::_tabs_tab_changed));882add_child(tabs);883884// General Tab885886tab_general = memnew(VBoxContainer);887tabs->add_child(tab_general);888tab_general->set_name(TTRC("General"));889890HBoxContainer *hbc = memnew(HBoxContainer);891hbc->set_h_size_flags(Control::SIZE_EXPAND_FILL);892tab_general->add_child(hbc);893894search_box = memnew(LineEdit);895search_box->set_placeholder(TTRC("Filter Settings"));896search_box->set_accessibility_name(TTRC("Filter Settings"));897search_box->set_virtual_keyboard_show_on_focus(false);898search_box->set_h_size_flags(Control::SIZE_EXPAND_FILL);899hbc->add_child(search_box);900901advanced_switch = memnew(CheckButton(TTRC("Advanced Settings")));902hbc->add_child(advanced_switch);903904bool use_advanced = EDITOR_DEF("_editor_settings_advanced_mode", false);905advanced_switch->set_pressed(use_advanced);906advanced_switch->connect(SceneStringName(toggled), callable_mp(this, &EditorSettingsDialog::_advanced_toggled));907908inspector = memnew(SectionedInspector);909inspector->get_inspector()->set_use_filter(true);910inspector->get_inspector()->set_mark_unsaved(false);911inspector->register_search_box(search_box);912inspector->register_advanced_toggle(advanced_switch);913inspector->set_v_size_flags(Control::SIZE_EXPAND_FILL);914tab_general->add_child(inspector);915inspector->get_inspector()->connect("property_edited", callable_mp(this, &EditorSettingsDialog::_settings_property_edited));916inspector->get_inspector()->connect("restart_requested", callable_mp(this, &EditorSettingsDialog::_editor_restart_request));917918if (EDITOR_GET("interface/touchscreen/enable_touch_optimizations")) {919inspector->set_touch_dragger_enabled(true);920}921922restart_container = memnew(PanelContainer);923tab_general->add_child(restart_container);924HBoxContainer *restart_hb = memnew(HBoxContainer);925restart_container->add_child(restart_hb);926restart_icon = memnew(TextureRect);927restart_icon->set_v_size_flags(Control::SIZE_SHRINK_CENTER);928restart_hb->add_child(restart_icon);929restart_label = memnew(Label);930restart_label->set_focus_mode(Control::FOCUS_ACCESSIBILITY);931restart_label->set_text(TTRC("The editor must be restarted for changes to take effect."));932restart_hb->add_child(restart_label);933restart_hb->add_spacer();934Button *restart_button = memnew(Button);935restart_button->connect(SceneStringName(pressed), callable_mp(this, &EditorSettingsDialog::_editor_restart));936restart_hb->add_child(restart_button);937restart_button->set_text(TTRC("Save & Restart"));938restart_close_button = memnew(Button);939restart_close_button->set_accessibility_name(TTRC("Close"));940restart_close_button->set_flat(true);941restart_close_button->connect(SceneStringName(pressed), callable_mp(this, &EditorSettingsDialog::_editor_restart_close));942restart_hb->add_child(restart_close_button);943restart_container->hide();944945// Shortcuts Tab946947tab_shortcuts = memnew(VBoxContainer);948949tabs->add_child(tab_shortcuts);950tab_shortcuts->set_name(TTRC("Shortcuts"));951952shortcut_search_bar = memnew(EditorEventSearchBar);953shortcut_search_bar->connect(SceneStringName(value_changed), callable_mp(this, &EditorSettingsDialog::_update_shortcuts));954tab_shortcuts->add_child(shortcut_search_bar);955956shortcuts = memnew(Tree);957shortcuts->set_accessibility_name(TTRC("Shortcuts"));958shortcuts->set_v_size_flags(Control::SIZE_EXPAND_FILL);959shortcuts->set_columns(2);960shortcuts->set_hide_root(true);961shortcuts->set_column_titles_visible(true);962shortcuts->set_column_title(0, TTRC("Name"));963shortcuts->set_column_title(1, TTRC("Binding"));964shortcuts->connect("button_clicked", callable_mp(this, &EditorSettingsDialog::_shortcut_button_pressed));965shortcuts->connect("item_activated", callable_mp(this, &EditorSettingsDialog::_shortcut_cell_double_clicked));966tab_shortcuts->add_child(shortcuts);967968SET_DRAG_FORWARDING_GCD(shortcuts, EditorSettingsDialog);969970// Adding event dialog971shortcut_editor = memnew(InputEventConfigurationDialog);972shortcut_editor->connect(SceneStringName(confirmed), callable_mp(this, &EditorSettingsDialog::_event_config_confirmed));973shortcut_editor->set_allowed_input_types(INPUT_KEY);974add_child(shortcut_editor);975976set_hide_on_ok(true);977978timer = memnew(Timer);979timer->set_wait_time(1.5);980timer->connect("timeout", callable_mp(this, &EditorSettingsDialog::_settings_save));981timer->set_one_shot(true);982add_child(timer);983EditorSettings::get_singleton()->connect("settings_changed", callable_mp(this, &EditorSettingsDialog::_settings_changed));984set_ok_button_text(TTRC("Close"));985986Ref<EditorSettingsInspectorPlugin> plugin;987plugin.instantiate();988plugin->inspector = inspector;989EditorInspector::add_inspector_plugin(plugin);990}991992void EditorSettingsPropertyWrapper::_update_override() {993// Don't allow overriding theme properties, because it causes problems. Overriding Project Manager settings makes no sense.994// TODO: Find a better way to define exception prefixes (if the list happens to grow).995if (property.begins_with("interface/theme") || property.begins_with("project_manager")) {996can_override = false;997return;998}9991000const bool has_override = ProjectSettings::get_singleton()->has_editor_setting_override(property);1001if (has_override) {1002const Variant override_value = EDITOR_GET(property);1003override_label->set_text(vformat(TTR("Overridden in project: %s"), override_value));1004// In case the text is too long and trimmed.1005override_label->set_tooltip_text(override_value);1006}1007override_info->set_visible(has_override);1008can_override = !has_override;1009}10101011void EditorSettingsPropertyWrapper::_create_override() {1012ProjectSettings::get_singleton()->set_editor_setting_override(property, EDITOR_GET(property));1013ProjectSettings::get_singleton()->save();1014_update_override();1015}10161017void EditorSettingsPropertyWrapper::_remove_override() {1018ProjectSettings::get_singleton()->set_editor_setting_override(property, Variant());1019ProjectSettings::get_singleton()->save();1020EditorSettings::get_singleton()->mark_setting_changed(property);1021EditorNode::get_singleton()->notify_settings_overrides_changed();1022_update_override();10231024if (requires_restart) {1025restart_request_callback.call();1026}1027}10281029void EditorSettingsPropertyWrapper::_notification(int p_what) {1030if (p_what == NOTIFICATION_THEME_CHANGED) {1031goto_button->set_button_icon(get_editor_theme_icon(SNAME("MethodOverride")));1032remove_button->set_button_icon(get_editor_theme_icon(SNAME("Close")));1033}1034}10351036void EditorSettingsPropertyWrapper::update_property() {1037editor_property->update_property();1038}10391040void EditorSettingsPropertyWrapper::setup(const String &p_property, EditorProperty *p_editor_property, bool p_requires_restart) {1041requires_restart = p_requires_restart;10421043property = p_property;1044container = memnew(VBoxContainer);10451046editor_property = p_editor_property;1047editor_property->set_h_size_flags(SIZE_EXPAND_FILL);1048container->add_child(editor_property);10491050override_info = memnew(HBoxContainer);1051override_info->hide();1052container->add_child(override_info);10531054override_label = memnew(Label);1055override_label->set_text_overrun_behavior(TextServer::OVERRUN_TRIM_ELLIPSIS);1056override_label->set_auto_translate_mode(AUTO_TRANSLATE_MODE_DISABLED);1057override_label->set_mouse_filter(MOUSE_FILTER_STOP); // For tooltip.1058override_label->set_h_size_flags(SIZE_EXPAND_FILL);1059override_info->add_child(override_label);10601061goto_button = memnew(Button);1062goto_button->set_tooltip_text(TTRC("Go to the override in the Project Settings."));1063override_info->add_child(goto_button);1064goto_button->connect(SceneStringName(pressed), callable_mp(EditorNode::get_singleton(), &EditorNode::open_setting_override).bind(property), CONNECT_DEFERRED);10651066remove_button = memnew(Button);1067remove_button->set_tooltip_text(TTRC("Remove this override."));1068override_info->add_child(remove_button);1069remove_button->connect(SceneStringName(pressed), callable_mp(this, &EditorSettingsPropertyWrapper::_remove_override));10701071add_child(container);1072_update_override();10731074connect(SNAME("property_overridden"), callable_mp(this, &EditorSettingsPropertyWrapper::_create_override));1075editor_property->connect("property_changed", callable_mp((EditorProperty *)this, &EditorProperty::emit_changed));1076}10771078bool EditorSettingsInspectorPlugin::can_handle(Object *p_object) {1079return p_object && p_object->is_class("SectionedInspectorFilter") && p_object != current_object;1080}10811082bool EditorSettingsInspectorPlugin::parse_property(Object *p_object, const Variant::Type p_type, const String &p_path, const PropertyHint p_hint, const String &p_hint_text, const BitField<PropertyUsageFlags> p_usage, const bool p_wide) {1083if (!p_object->is_class("SectionedInspectorFilter")) {1084return false;1085}10861087const String property = inspector->get_full_item_path(p_path);1088if (!EditorSettings::get_singleton()->has_setting(property)) {1089return false;1090}1091current_object = p_object;10921093EditorSettingsPropertyWrapper *editor = memnew(EditorSettingsPropertyWrapper);1094EditorProperty *real_property = inspector->get_inspector()->instantiate_property_editor(p_object, p_type, p_path, p_hint, p_hint_text, p_usage, p_wide);1095real_property->set_object_and_property(p_object, p_path);1096real_property->set_name_split_ratio(0.0);1097editor->setup(property, real_property, bool(p_usage & PROPERTY_USAGE_RESTART_IF_CHANGED));10981099add_property_editor(p_path, editor);1100current_object = nullptr;1101return true;1102}110311041105