diff --git a/core/globals.cpp b/core/globals.cpp index 0a6a1876b34..fd0f2dbe14e 100644 --- a/core/globals.cpp +++ b/core/globals.cpp @@ -1414,6 +1414,7 @@ Globals::Globals() { joyb.joy_button.button_index=JOY_BUTTON_0; va.push_back(joyb); set("input/ui_accept",va); + input_presets.push_back("input/ui_accept"); va=Array(); key.key.scancode=KEY_SPACE; @@ -1421,6 +1422,7 @@ Globals::Globals() { joyb.joy_button.button_index=JOY_BUTTON_3; va.push_back(joyb); set("input/ui_select",va); + input_presets.push_back("input/ui_select"); va=Array(); key.key.scancode=KEY_ESCAPE; @@ -1428,17 +1430,20 @@ Globals::Globals() { joyb.joy_button.button_index=JOY_BUTTON_1; va.push_back(joyb); set("input/ui_cancel",va); + input_presets.push_back("input/ui_cancel"); va=Array(); key.key.scancode=KEY_TAB; va.push_back(key); set("input/ui_focus_next",va); + input_presets.push_back("input/ui_focus_next"); va=Array(); key.key.scancode=KEY_TAB; key.key.mod.shift=true; va.push_back(key); set("input/ui_focus_prev",va); + input_presets.push_back("input/ui_focus_prev"); key.key.mod.shift=false; va=Array(); @@ -1447,6 +1452,7 @@ Globals::Globals() { joyb.joy_button.button_index=JOY_DPAD_LEFT; va.push_back(joyb); set("input/ui_left",va); + input_presets.push_back("input/ui_left"); va=Array(); key.key.scancode=KEY_RIGHT; @@ -1454,6 +1460,7 @@ Globals::Globals() { joyb.joy_button.button_index=JOY_DPAD_RIGHT; va.push_back(joyb); set("input/ui_right",va); + input_presets.push_back("input/ui_right"); va=Array(); key.key.scancode=KEY_UP; @@ -1461,6 +1468,7 @@ Globals::Globals() { joyb.joy_button.button_index=JOY_DPAD_UP; va.push_back(joyb); set("input/ui_up",va); + input_presets.push_back("input/ui_up"); va=Array(); key.key.scancode=KEY_DOWN; @@ -1468,17 +1476,20 @@ Globals::Globals() { joyb.joy_button.button_index=JOY_DPAD_DOWN; va.push_back(joyb); set("input/ui_down",va); + input_presets.push_back("input/ui_down"); va=Array(); key.key.scancode=KEY_PAGEUP; va.push_back(key); set("input/ui_page_up",va); + input_presets.push_back("input/ui_page_up"); va=Array(); key.key.scancode=KEY_PAGEDOWN; va.push_back(key); set("input/ui_page_down",va); + input_presets.push_back("input/ui_page_down"); // set("display/orientation", "landscape"); diff --git a/core/globals.h b/core/globals.h index 2ec56966f63..25c7f96be2d 100644 --- a/core/globals.h +++ b/core/globals.h @@ -70,6 +70,7 @@ protected: Map custom_prop_info; bool disable_platform_override; bool using_datapack; + List input_presets; bool _set(const StringName& p_name, const Variant& p_value); @@ -124,6 +125,8 @@ public: Vector get_optimizer_presets() const; + List get_input_presets() const { return input_presets; } + void set_disable_platform_override(bool p_disable); Object* get_singleton_object(const String& p_name) const; diff --git a/tools/editor/project_settings.cpp b/tools/editor/project_settings.cpp index 68fb4116fe4..2ca15449aa8 100644 --- a/tools/editor/project_settings.cpp +++ b/tools/editor/project_settings.cpp @@ -427,7 +427,8 @@ void ProjectSettings::_update_actions() { item->set_cell_mode(0,TreeItem::CELL_MODE_CHECK); item->set_text(0,name); item->add_button(0,get_icon("Add","EditorIcons"),1); - item->add_button(0,get_icon("Rename","EditorIcons"),2); + if (!Globals::get_singleton()->get_input_presets().find(pi.name)) + item->add_button(0,get_icon("Rename","EditorIcons"),2); item->add_button(0,get_icon("Remove","EditorIcons"),3); item->set_custom_bg_color(0,get_color("prop_subsection","Editor")); item->set_editable(0,true);