From 5efa3aeed5e49a3d0afabbb63003a3999e2f7aba Mon Sep 17 00:00:00 2001 From: jmb462 Date: Tue, 12 Oct 2021 18:49:13 +0200 Subject: [PATCH] Fix missing action icons in action map editor --- editor/action_map_editor.cpp | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index 363d542fd5a..604f8bc9cf3 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -1074,6 +1074,31 @@ void ActionMapEditor::update_action_list(const Vector &p_action_info event_item->set_meta("__event", event); event_item->set_meta("__index", evnt_idx); + // First Column - Icon + Ref 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 mb = event; + if (mb.is_valid()) { + event_item->set_icon(0, action_tree->get_theme_icon(SNAME("Mouse"), SNAME("EditorIcons"))); + } + + Ref jb = event; + if (jb.is_valid()) { + event_item->set_icon(0, action_tree->get_theme_icon(SNAME("JoyButton"), SNAME("EditorIcons"))); + } + + Ref 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"));