mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-21 08:01:30 -07:00
Slant: actually check ui->swap_buttons.
Apparently I wrote the new-look code that sets up the prefs field in the UI, but didn't remember to rewrite the code in interpret_move that ought to read it.
This commit is contained in:
16
slant.c
16
slant.c
@ -1716,26 +1716,12 @@ static char *interpret_move(const game_state *state, game_ui *ui,
|
|||||||
enum { CLOCKWISE, ANTICLOCKWISE, NONE } action = NONE;
|
enum { CLOCKWISE, ANTICLOCKWISE, NONE } action = NONE;
|
||||||
|
|
||||||
if (button == LEFT_BUTTON || button == RIGHT_BUTTON) {
|
if (button == LEFT_BUTTON || button == RIGHT_BUTTON) {
|
||||||
/*
|
if (ui->swap_buttons) {
|
||||||
* This is an utterly awful hack which I should really sort out
|
|
||||||
* by means of a proper configuration mechanism. One Slant
|
|
||||||
* player has observed that they prefer the mouse buttons to
|
|
||||||
* function exactly the opposite way round, so here's a
|
|
||||||
* mechanism for environment-based configuration. I cache the
|
|
||||||
* result in a global variable - yuck! - to avoid repeated
|
|
||||||
* lookups.
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
static int swap_buttons = -1;
|
|
||||||
if (swap_buttons < 0)
|
|
||||||
swap_buttons = getenv_bool("SLANT_SWAP_BUTTONS", false);
|
|
||||||
if (swap_buttons) {
|
|
||||||
if (button == LEFT_BUTTON)
|
if (button == LEFT_BUTTON)
|
||||||
button = RIGHT_BUTTON;
|
button = RIGHT_BUTTON;
|
||||||
else
|
else
|
||||||
button = LEFT_BUTTON;
|
button = LEFT_BUTTON;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
action = (button == LEFT_BUTTON) ? CLOCKWISE : ANTICLOCKWISE;
|
action = (button == LEFT_BUTTON) ? CLOCKWISE : ANTICLOCKWISE;
|
||||||
|
|
||||||
x = FROMCOORD(x);
|
x = FROMCOORD(x);
|
||||||
|
Reference in New Issue
Block a user