1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-07 12:30:27 +00:00

Use "enum class" for input enums

This commit is contained in:
Aaron Franke
2021-08-13 16:31:57 -05:00
parent 4f85cad013
commit 3c0fdcc8ac
154 changed files with 3482 additions and 3392 deletions

View File

@@ -183,7 +183,7 @@ void CollisionShape2DEditor::set_handle(int idx, Point2 &p_point) {
size.y = p_point.y * RECT_HANDLES[idx].y * 2;
}
if (Input::get_singleton()->is_key_pressed(KEY_ALT)) {
if (Input::get_singleton()->is_key_pressed(Key::ALT)) {
rect->set_size(size.abs());
node->set_global_position(original_transform.get_origin());
} else {
@@ -333,7 +333,7 @@ bool CollisionShape2DEditor::forward_canvas_gui_input(const Ref<InputEvent> &p_e
if (mb.is_valid()) {
Vector2 gpoint = mb->get_position();
if (mb->get_button_index() == MOUSE_BUTTON_LEFT) {
if (mb->get_button_index() == MouseButton::LEFT) {
if (mb->is_pressed()) {
for (int i = 0; i < handles.size(); i++) {
if (xform.xform(handles[i]).distance_to(gpoint) < 8) {
@@ -394,7 +394,7 @@ bool CollisionShape2DEditor::forward_canvas_gui_input(const Ref<InputEvent> &p_e
return false;
}
if (shape_type == RECTANGLE_SHAPE && k->get_keycode() == KEY_ALT) {
if (shape_type == RECTANGLE_SHAPE && k->get_keycode() == Key::ALT) {
set_handle(edit_handle, last_point); // Update handle when Alt key is toggled.
}
}