diff options
author | Yuri Sizov <yuris@humnom.net> | 2023-09-06 14:49:02 +0200 |
---|---|---|
committer | Yuri Sizov <yuris@humnom.net> | 2023-09-06 14:49:02 +0200 |
commit | 3c63dce3cd19f1cc7540418f9a45e4c38e78994e (patch) | |
tree | 72c2b81bc63bd4d254fbceb99fffd03a5eabedee /editor/action_map_editor.cpp | |
parent | bceac8c34f2cd6f9f156b3b1b9cbd012bc45d928 (diff) | |
parent | 6de34fde27f650f738a1e46992f1b783f2cf9e76 (diff) | |
download | redot-engine-3c63dce3cd19f1cc7540418f9a45e4c38e78994e.tar.gz |
Merge pull request #80573 from KoBeWi/2k_lines_of_changes_created_at_2AM
Add EditorStringNames singleton
Diffstat (limited to 'editor/action_map_editor.cpp')
-rw-r--r-- | editor/action_map_editor.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/editor/action_map_editor.cpp b/editor/action_map_editor.cpp index 36b19198e6..d47b315c40 100644 --- a/editor/action_map_editor.cpp +++ b/editor/action_map_editor.cpp @@ -32,6 +32,7 @@ #include "editor/editor_scale.h" #include "editor/editor_settings.h" +#include "editor/editor_string_names.h" #include "editor/event_listener_line_edit.h" #include "editor/input_event_configuration_dialog.h" #include "scene/gui/check_button.h" @@ -355,7 +356,7 @@ void ActionMapEditor::_notification(int p_what) { switch (p_what) { case NOTIFICATION_ENTER_TREE: case NOTIFICATION_THEME_CHANGED: { - action_list_search->set_right_icon(get_theme_icon(SNAME("Search"), SNAME("EditorIcons"))); + action_list_search->set_right_icon(get_editor_theme_icon(SNAME("Search"))); if (!actions_cache.is_empty()) { update_action_list(); } @@ -442,13 +443,13 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info bool events_eq = Shortcut::is_event_array_equal(action_info.action_initial["events"], action_info.action["events"]); bool action_eq = deadzone_eq && events_eq; action_item->set_meta("__action_initial", action_info.action_initial); - action_item->add_button(2, action_tree->get_theme_icon(SNAME("ReloadSmall"), SNAME("EditorIcons")), BUTTON_REVERT_ACTION, action_eq, action_eq ? TTR("Cannot Revert - Action is same as initial") : TTR("Revert Action")); + action_item->add_button(2, action_tree->get_editor_theme_icon(SNAME("ReloadSmall")), BUTTON_REVERT_ACTION, action_eq, action_eq ? TTR("Cannot Revert - Action is same as initial") : TTR("Revert Action")); } - action_item->add_button(2, action_tree->get_theme_icon(SNAME("Add"), SNAME("EditorIcons")), BUTTON_ADD_EVENT, false, TTR("Add Event")); - action_item->add_button(2, action_tree->get_theme_icon(SNAME("Remove"), SNAME("EditorIcons")), BUTTON_REMOVE_ACTION, !action_info.editable, action_info.editable ? TTR("Remove Action") : TTR("Cannot Remove Action")); + action_item->add_button(2, action_tree->get_editor_theme_icon(SNAME("Add")), BUTTON_ADD_EVENT, false, TTR("Add Event")); + action_item->add_button(2, action_tree->get_editor_theme_icon(SNAME("Remove")), BUTTON_REMOVE_ACTION, !action_info.editable, action_info.editable ? TTR("Remove Action") : TTR("Cannot Remove Action")); - action_item->set_custom_bg_color(0, action_tree->get_theme_color(SNAME("prop_subsection"), SNAME("Editor"))); - action_item->set_custom_bg_color(1, action_tree->get_theme_color(SNAME("prop_subsection"), SNAME("Editor"))); + action_item->set_custom_bg_color(0, action_tree->get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor))); + action_item->set_custom_bg_color(1, action_tree->get_theme_color(SNAME("prop_subsection"), EditorStringName(Editor))); for (int evnt_idx = 0; evnt_idx < events.size(); evnt_idx++) { Ref<InputEvent> event = events[evnt_idx]; @@ -467,34 +468,34 @@ void ActionMapEditor::update_action_list(const Vector<ActionInfo> &p_action_info Ref<InputEventKey> k = event; if (k.is_valid()) { if (k->get_physical_keycode() == Key::NONE && k->get_keycode() == Key::NONE && k->get_key_label() != Key::NONE) { - event_item->set_icon(0, action_tree->get_theme_icon(SNAME("KeyboardLabel"), SNAME("EditorIcons"))); + event_item->set_icon(0, action_tree->get_editor_theme_icon(SNAME("KeyboardLabel"))); } else if (k->get_keycode() != Key::NONE) { - event_item->set_icon(0, action_tree->get_theme_icon(SNAME("Keyboard"), SNAME("EditorIcons"))); + event_item->set_icon(0, action_tree->get_editor_theme_icon(SNAME("Keyboard"))); } else if (k->get_physical_keycode() != Key::NONE) { - event_item->set_icon(0, action_tree->get_theme_icon(SNAME("KeyboardPhysical"), SNAME("EditorIcons"))); + event_item->set_icon(0, action_tree->get_editor_theme_icon(SNAME("KeyboardPhysical"))); } else { - event_item->set_icon(0, action_tree->get_theme_icon(SNAME("KeyboardError"), SNAME("EditorIcons"))); + event_item->set_icon(0, action_tree->get_editor_theme_icon(SNAME("KeyboardError"))); } } Ref<InputEventMouseButton> mb = event; if (mb.is_valid()) { - event_item->set_icon(0, action_tree->get_theme_icon(SNAME("Mouse"), SNAME("EditorIcons"))); + event_item->set_icon(0, action_tree->get_editor_theme_icon(SNAME("Mouse"))); } Ref<InputEventJoypadButton> jb = event; if (jb.is_valid()) { - event_item->set_icon(0, action_tree->get_theme_icon(SNAME("JoyButton"), SNAME("EditorIcons"))); + event_item->set_icon(0, action_tree->get_editor_theme_icon(SNAME("JoyButton"))); } Ref<InputEventJoypadMotion> jm = event; if (jm.is_valid()) { - event_item->set_icon(0, action_tree->get_theme_icon(SNAME("JoyAxis"), SNAME("EditorIcons"))); + event_item->set_icon(0, action_tree->get_editor_theme_icon(SNAME("JoyAxis"))); } // 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")); + event_item->add_button(2, action_tree->get_editor_theme_icon(SNAME("Edit")), BUTTON_EDIT_EVENT, false, TTR("Edit Event")); + event_item->add_button(2, action_tree->get_editor_theme_icon(SNAME("Remove")), BUTTON_REMOVE_EVENT, false, TTR("Remove Event")); event_item->set_button_color(2, 0, Color(1, 1, 1, 0.75)); event_item->set_button_color(2, 1, Color(1, 1, 1, 0.75)); } |