Skip to content

armgit / godot

Public Imported from GitHub
0

Godot Engine – Multi-platform 2D and 3D game engine

Simplify some CMD/CTRL strings

kobewid7d3160c0d44
diff --git a/editor/gui/editor_spin_slider.cpp b/editor/gui/editor_spin_slider.cpp
index 60efb524807..9fe20801495 100644
--- a/editor/gui/editor_spin_slider.cpp
+++ b/editor/gui/editor_spin_slider.cpp
@@ -36,7 +36,6 @@
#include "core/object/callable_mp.h"
#include "core/object/class_db.h"
#include "core/os/keyboard.h"
-#include "core/os/os.h"
#include "core/string/translation_server.h"
#include "editor/editor_string_names.h"
#include "editor/settings/editor_settings.h"
@@ -53,9 +52,8 @@ String EditorSpinSlider::get_tooltip(const Point2 &p_pos) const {
tooltip += "\n" + TTR(base_tooltip);
}
- Key key = OS::prefer_meta_over_ctrl() ? Key::META : Key::CTRL;
if (!editing_integer) {
- tooltip += "\n\n" + vformat(TTR("Hold %s to round to integers."), find_keycode_name(key));
+ tooltip += "\n\n" + vformat(TTR("Hold %s to round to integers."), keycode_get_string(Key::CMD_OR_CTRL));
}
return tooltip + "\n" + TTR("Hold Shift for more precise changes.");
}
diff --git a/editor/scene/2d/polygon_2d_editor_plugin.cpp b/editor/scene/2d/polygon_2d_editor_plugin.cpp
index 3a1cae7c1bf..562482da1ae 100644
--- a/editor/scene/2d/polygon_2d_editor_plugin.cpp
+++ b/editor/scene/2d/polygon_2d_editor_plugin.cpp
@@ -34,7 +34,6 @@
#include "core/math/geometry_2d.h"
#include "core/object/callable_mp.h"
#include "core/object/class_db.h"
-#include "core/os/os.h"
#include "editor/docks/editor_dock.h"
#include "editor/docks/editor_dock_manager.h"
#include "editor/editor_node.h"
@@ -1390,9 +1389,8 @@ Polygon2DEditor::Polygon2DEditor() {
action_buttons[ACTION_CREATE]->set_tooltip_text(TTR("Create Polygon"));
action_buttons[ACTION_CREATE_INTERNAL]->set_tooltip_text(TTR("Create Internal Vertex"));
action_buttons[ACTION_REMOVE_INTERNAL]->set_tooltip_text(TTR("Remove Internal Vertex"));
- Key key = OS::prefer_meta_over_ctrl() ? Key::META : Key::CTRL;
// TRANSLATORS: %s is Control or Command key name.
- action_buttons[ACTION_EDIT_POINT]->set_tooltip_text(TTR("Move Points") + "\n" + vformat(TTR("%s: Rotate"), find_keycode_name(key)) + "\n" + TTR("Shift: Move All") + "\n" + vformat(TTR("%s + Shift: Scale"), find_keycode_name(key)));
+ action_buttons[ACTION_EDIT_POINT]->set_tooltip_text(TTR("Move Points") + "\n" + vformat(TTR("%s: Rotate"), keycode_get_string(Key::CMD_OR_CTRL)) + "\n" + TTR("Shift: Move All") + "\n" + vformat(TTR("%s + Shift: Scale"), keycode_get_string(Key::CMD_OR_CTRL)));
action_buttons[ACTION_MOVE]->set_tooltip_text(TTR("Move Polygon"));
action_buttons[ACTION_ROTATE]->set_tooltip_text(TTR("Rotate Polygon"));
action_buttons[ACTION_SCALE]->set_tooltip_text(TTR("Scale Polygon"));
diff --git a/editor/scene/2d/tiles/tile_map_layer_editor.cpp b/editor/scene/2d/tiles/tile_map_layer_editor.cpp
index 6e3af0abcac..a267277a961 100644
--- a/editor/scene/2d/tiles/tile_map_layer_editor.cpp
+++ b/editor/scene/2d/tiles/tile_map_layer_editor.cpp
@@ -36,7 +36,6 @@
#include "core/object/callable_mp.h"
#include "core/object/class_db.h"
#include "core/os/keyboard.h"
-#include "core/os/os.h"
#include "editor/editor_node.h"
#include "editor/editor_undo_redo_manager.h"
#include "editor/inspector/editor_resource_preview.h"
@@ -2268,8 +2267,7 @@ TileMapLayerEditorTilesPlugin::TileMapLayerEditorTilesPlugin() {
picker_button->set_theme_type_variation(SceneStringName(FlatButton));
picker_button->set_toggle_mode(true);
picker_button->set_shortcut(ED_GET_SHORTCUT("tiles_editor/picker"));
- Key key = OS::prefer_meta_over_ctrl() ? Key::META : Key::CTRL;
- picker_button->set_tooltip_text(vformat(TTRC("Alternatively hold %s with other tools to pick tile."), find_keycode_name(key)));
+ picker_button->set_tooltip_text(vformat(TTRC("Alternatively hold %s with other tools to pick tile."), keycode_get_string(Key::CMD_OR_CTRL)));
picker_button->connect(SceneStringName(pressed), callable_mp(CanvasItemEditor::get_singleton(), &CanvasItemEditor::update_viewport));
picker_button->set_accessibility_name(TTRC("Pick"));
tools_settings->add_child(picker_button);