Skip to content

Commit ab55a40

Browse files
committed
Merge pull request godotengine#97070 from KoBeWi/snaming_ur_inputs
Use `SNAME` for `ui` actions in Viewport
2 parents 964a9ec + d805f38 commit ab55a40

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

scene/main/viewport.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2086,13 +2086,13 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
20862086
}
20872087

20882088
if (mm.is_null() && mb.is_null() && p_event->is_action_type()) {
2089-
if (gui.dragging && p_event->is_action_pressed("ui_cancel") && Input::get_singleton()->is_action_just_pressed("ui_cancel")) {
2089+
if (gui.dragging && p_event->is_action_pressed(SNAME("ui_cancel")) && Input::get_singleton()->is_action_just_pressed(SNAME("ui_cancel"))) {
20902090
_perform_drop();
20912091
set_input_as_handled();
20922092
return;
20932093
}
20942094

2095-
if (p_event->is_action_pressed("ui_cancel")) {
2095+
if (p_event->is_action_pressed(SNAME("ui_cancel"))) {
20962096
// Cancel tooltip timer or hide tooltip when pressing Escape (this is standard behavior in most applications).
20972097
_gui_cancel_tooltip();
20982098
if (gui.tooltip_popup) {
@@ -2127,51 +2127,51 @@ void Viewport::_gui_input_event(Ref<InputEvent> p_event) {
21272127
if (joypadmotion_event.is_valid()) {
21282128
Input *input = Input::get_singleton();
21292129

2130-
if (p_event->is_action_pressed("ui_focus_next") && input->is_action_just_pressed("ui_focus_next")) {
2130+
if (p_event->is_action_pressed(SNAME("ui_focus_next")) && input->is_action_just_pressed(SNAME("ui_focus_next"))) {
21312131
next = from->find_next_valid_focus();
21322132
}
21332133

2134-
if (p_event->is_action_pressed("ui_focus_prev") && input->is_action_just_pressed("ui_focus_prev")) {
2134+
if (p_event->is_action_pressed(SNAME("ui_focus_prev")) && input->is_action_just_pressed(SNAME("ui_focus_prev"))) {
21352135
next = from->find_prev_valid_focus();
21362136
}
21372137

2138-
if (p_event->is_action_pressed("ui_up") && input->is_action_just_pressed("ui_up")) {
2138+
if (p_event->is_action_pressed(SNAME("ui_up")) && input->is_action_just_pressed(SNAME("ui_up"))) {
21392139
next = from->_get_focus_neighbor(SIDE_TOP);
21402140
}
21412141

2142-
if (p_event->is_action_pressed("ui_left") && input->is_action_just_pressed("ui_left")) {
2142+
if (p_event->is_action_pressed(SNAME("ui_left")) && input->is_action_just_pressed(SNAME("ui_left"))) {
21432143
next = from->_get_focus_neighbor(SIDE_LEFT);
21442144
}
21452145

2146-
if (p_event->is_action_pressed("ui_right") && input->is_action_just_pressed("ui_right")) {
2146+
if (p_event->is_action_pressed(SNAME("ui_right")) && input->is_action_just_pressed(SNAME("ui_right"))) {
21472147
next = from->_get_focus_neighbor(SIDE_RIGHT);
21482148
}
21492149

2150-
if (p_event->is_action_pressed("ui_down") && input->is_action_just_pressed("ui_down")) {
2150+
if (p_event->is_action_pressed(SNAME("ui_down")) && input->is_action_just_pressed(SNAME("ui_down"))) {
21512151
next = from->_get_focus_neighbor(SIDE_BOTTOM);
21522152
}
21532153
} else {
2154-
if (p_event->is_action_pressed("ui_focus_next", true, true)) {
2154+
if (p_event->is_action_pressed(SNAME("ui_focus_next"), true, true)) {
21552155
next = from->find_next_valid_focus();
21562156
}
21572157

2158-
if (p_event->is_action_pressed("ui_focus_prev", true, true)) {
2158+
if (p_event->is_action_pressed(SNAME("ui_focus_prev"), true, true)) {
21592159
next = from->find_prev_valid_focus();
21602160
}
21612161

2162-
if (p_event->is_action_pressed("ui_up", true, true)) {
2162+
if (p_event->is_action_pressed(SNAME("ui_up"), true, true)) {
21632163
next = from->_get_focus_neighbor(SIDE_TOP);
21642164
}
21652165

2166-
if (p_event->is_action_pressed("ui_left", true, true)) {
2166+
if (p_event->is_action_pressed(SNAME("ui_left"), true, true)) {
21672167
next = from->_get_focus_neighbor(SIDE_LEFT);
21682168
}
21692169

2170-
if (p_event->is_action_pressed("ui_right", true, true)) {
2170+
if (p_event->is_action_pressed(SNAME("ui_right"), true, true)) {
21712171
next = from->_get_focus_neighbor(SIDE_RIGHT);
21722172
}
21732173

2174-
if (p_event->is_action_pressed("ui_down", true, true)) {
2174+
if (p_event->is_action_pressed(SNAME("ui_down"), true, true)) {
21752175
next = from->_get_focus_neighbor(SIDE_BOTTOM);
21762176
}
21772177
}

0 commit comments

Comments
 (0)