summaryrefslogtreecommitdiff
path: root/main_gui.c
diff options
context:
space:
mode:
authorDarkvater <Darkvater@openttd.org>2005-02-22 14:52:20 +0000
committerDarkvater <Darkvater@openttd.org>2005-02-22 14:52:20 +0000
commit7656c683cf3daf0ccaec7034541a418c4969ca5f (patch)
treeb49fb9bb8df94481ce40ba392c0f8fb12a775bec /main_gui.c
parent5cb74cb049b0a1ecb1a1efa682380108f1072146 (diff)
downloadopenttd-7656c683cf3daf0ccaec7034541a418c4969ca5f.tar.xz
(svn r1901) - Fix: unwanted behaviour of the savegame dialog, as well as a bug with a sloppy termination of a string. When any editbox is open, scrolling is disabled. If any new types of editboxes come up, please use SET/CLRBIT of _no_scroll with its unique identifier (ttd.h)
Diffstat (limited to 'main_gui.c')
-rw-r--r--main_gui.c39
1 files changed, 0 insertions, 39 deletions
diff --git a/main_gui.c b/main_gui.c
index 869ad9bbe..d397074f5 100644
--- a/main_gui.c
+++ b/main_gui.c
@@ -2204,18 +2204,6 @@ static void StatusBarWndProc(Window *w, WindowEvent *e)
}
}
-static void ScrollMainViewport(int x, int y)
-{
- if (_game_mode != GM_MENU) {
- Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
- assert(w);
-
- WP(w,vp_d).scrollpos_x += x << w->viewport->zoom;
- WP(w,vp_d).scrollpos_y += y << w->viewport->zoom;
- }
-}
-
-
static const Widget _main_status_widgets[] = {
{ WWT_IMGBTN, RESIZE_NONE, 14, 0, 139, 0, 11, 0x0, STR_NULL},
{ WWT_PUSHIMGBTN, RESIZE_NONE, 14, 140, 499, 0, 11, 0x0, STR_02B7_SHOW_LAST_MESSAGE_OR_NEWS},
@@ -2231,33 +2219,6 @@ static WindowDesc _main_status_desc = {
StatusBarWndProc
};
-static const int8 scrollamt[16][2] = {
- { 0, 0},
- {-2, 0}, // 1:left
- { 0,-2}, // 2:up
- {-2,-1}, // 3:left + up
- { 2, 0}, // 4:right
- { 0, 0}, // 5:left + right
- { 2,-1}, // 6:right + up
- { 0,-2}, // 7:left + right + up = up
- { 0 ,2}, // 8:down
- {-2 ,1}, // 9:down+left
- { 0, 0}, // 10:impossible
- {-2, 0}, // 11:left + up + down = left
- { 2, 1}, // 12:down+right
- { 0, 2}, // 13:left + right + down = down
- { 0,-2}, // 14:left + right + up = up
- { 0, 0}, // 15:impossible
-};
-
-void HandleKeyScrolling(void)
-{
- if (_dirkeys && _iconsole_win == NULL && _editbox_win == NULL) {
- int factor = _shift_pressed ? 50 : 10;
- ScrollMainViewport(scrollamt[_dirkeys][0] * factor, scrollamt[_dirkeys][1] * factor);
- }
-}
-
extern void DebugProc(int i);
static void MainWindowWndProc(Window *w, WindowEvent *e) {