Skip to content

Commit 1ec000d

Browse files
committed
Finish removing magic numbers in gump input handling
1 parent e09c129 commit 1ec000d

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

drag.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Dragging_info::Dragging_info(
8888
if (!button->is_draggable()) {
8989
return;
9090
}
91-
button->push(1);
91+
button->push(Gump::MouseButton::Left);
9292
// Pushed button, so make noise.
9393
if (!button->is_checkmark()) {
9494
Audio::get_ptr()->play_sound_effect(Audio::game_sfx(73));
@@ -271,10 +271,10 @@ bool Dragging_info::drop(
271271
bool handled = moved;
272272
Mouse::mouse->set_shape(mouse_shape);
273273
if (button) {
274-
button->unpush(1);
274+
button->unpush(Gump::MouseButton::Left);
275275
if (button->on_button(x, y)) {
276276
// Clicked on button.
277-
button->activate(1);
277+
button->activate(Gump::MouseButton::Left);
278278
}
279279
handled = true;
280280
} else if (!obj) { // Only dragging a gump?

mouse.h

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,13 @@ class Mouse {
162162
return onscreen;
163163
}
164164

165-
inline int get_mousex() const { return mousex; }
166-
inline int get_mousey() const { return mousey; }
165+
inline int get_mousex() const {
166+
return mousex;
167+
}
168+
169+
inline int get_mousey() const {
170+
return mousey;
171+
}
167172

168173
// Sets hand or speed cursors
169174
void set_speed_cursor();

0 commit comments

Comments
 (0)