summaryrefslogtreecommitdiff
path: root/src/newgrf_debug_gui.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2015-11-20 10:04:28 +0000
committeralberth <alberth@openttd.org>2015-11-20 10:04:28 +0000
commite9f12d666d6fe58563167ba8d45bc164c36802ed (patch)
tree77c445121ef2b4f5147096b9b82845984b771166 /src/newgrf_debug_gui.cpp
parent3ccfc954f3ff99af58732b69a185ea77d5c03060 (diff)
downloadopenttd-e9f12d666d6fe58563167ba8d45bc164c36802ed.tar.xz
(svn r27451) -Feature[FS#6241]: Move sprite 8 positions in sprite aligner with ctrl+click. (based on work by juzza1)
Diffstat (limited to 'src/newgrf_debug_gui.cpp')
-rw-r--r--src/newgrf_debug_gui.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp
index 0074af218..75b06967f 100644
--- a/src/newgrf_debug_gui.cpp
+++ b/src/newgrf_debug_gui.cpp
@@ -972,10 +972,11 @@ struct SpriteAlignerWindow : Window {
this->offs_start_map.Insert(this->current_sprite, XyOffs(spr->x_offs, spr->y_offs));
}
switch (widget) {
- case WID_SA_UP: spr->y_offs--; break;
- case WID_SA_DOWN: spr->y_offs++; break;
- case WID_SA_LEFT: spr->x_offs--; break;
- case WID_SA_RIGHT: spr->x_offs++; break;
+ /* Move ten 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;
}
/* Of course, we need to redraw the sprite, but where is it used?
* Everywhere is a safe bet. */