Make modifier key functions configurable

This commit is contained in:
dP
2020-07-13 01:35:07 +03:00
parent 4af1a255df
commit 7441767ed8
55 changed files with 366 additions and 146 deletions

View File

@@ -42,6 +42,8 @@
#include "table/strings.h"
#include "citymania/cm_hotkeys.hpp"
#include "safeguards.h"
/** The sprite picker. */
@@ -972,10 +974,10 @@ struct SpriteAlignerWindow : Window {
}
switch (widget) {
/* Move eight units at a time if ctrl is pressed. */
case WID_SA_UP: spr->y_offs -= _ctrl_pressed ? 8 : 1; break;
case WID_SA_DOWN: spr->y_offs += _ctrl_pressed ? 8 : 1; break;
case WID_SA_LEFT: spr->x_offs -= _ctrl_pressed ? 8 : 1; break;
case WID_SA_RIGHT: spr->x_offs += _ctrl_pressed ? 8 : 1; break;
case WID_SA_UP: spr->y_offs -= citymania::_fn_mod ? 8 : 1; break;
case WID_SA_DOWN: spr->y_offs += citymania::_fn_mod ? 8 : 1; break;
case WID_SA_LEFT: spr->x_offs -= citymania::_fn_mod ? 8 : 1; break;
case WID_SA_RIGHT: spr->x_offs += citymania::_fn_mod ? 8 : 1; break;
}
/* Of course, we need to redraw the sprite, but where is it used?
* Everywhere is a safe bet. */