summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-03-25 14:01:17 +0100
committerGitHub <noreply@github.com>2022-03-25 14:01:17 +0100
commit6d28ff6e23a0e598037af056ad6532c00c49ef56 (patch)
treed0e5934c47c6484ccedc1f9e2af6beee26c59a21 /editor
parent283246a9fe8c974d134981e8d90144a34b18bd1f (diff)
parent5efa3aeed5e49a3d0afabbb63003a3999e2f7aba (diff)
Merge pull request #53734 from jmb462/fix-missing-action-icons
Diffstat (limited to 'editor')
-rw-r--r--editor/action_map_editor.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp
index ea51e1f399..c48b622670 100644
--- a/editor/action_map_editor.cpp
+++ b/editor/action_map_editor.cpp
@@ -1100,6 +1100,31 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info
event_item->set_meta("__event", event);
event_item->set_meta("__index", evnt_idx);
+ // First Column - Icon
+ Ref<InputEventKey> k = event;
+ if (k.is_valid()) {
+ if (k->get_physical_keycode() == 0) {
+ event_item->set_icon(0, action_tree->get_theme_icon(SNAME("Keyboard"), SNAME("EditorIcons")));
+ } else {
+ event_item->set_icon(0, action_tree->get_theme_icon(SNAME("KeyboardPhysical"), SNAME("EditorIcons")));
+ }
+ }
+
+ Ref<InputEventMouseButton> mb = event;
+ if (mb.is_valid()) {
+ event_item->set_icon(0, action_tree->get_theme_icon(SNAME("Mouse"), SNAME("EditorIcons")));
+ }
+
+ Ref<InputEventJoypadButton> jb = event;
+ if (jb.is_valid()) {
+ event_item->set_icon(0, action_tree->get_theme_icon(SNAME("JoyButton"), SNAME("EditorIcons")));
+ }
+
+ Ref<InputEventJoypadMotion> jm = event;
+ if (jm.is_valid()) {
+ event_item->set_icon(0, action_tree->get_theme_icon(SNAME("JoyAxis"), SNAME("EditorIcons")));
+ }
+
// Third Column - Buttons
event_item->add_button(2, action_tree->get_theme_icon(SNAME("Edit"), SNAME("EditorIcons")), BUTTON_EDIT_EVENT, false, TTR("Edit Event"));
event_item->add_button(2, action_tree->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_EVENT, false, TTR("Remove Event"));