B08021 scroll_amount wincap option

> - I'd like to see another option added: scroll_amount. In
>   combination with scroll_margin, this would control the amount
>   of squares the screen is scrolled when the scroll_margin is
>   reached (currently, this amount is 1, but if I recall
>   correctly, it used to be more). For example, if both were 5,
>   when you came within 5 spaces of the left screen border, the
>   screen would shift 5 spaces to the right).
This commit is contained in:
nethack.allison
2002-08-23 01:03:59 +00:00
parent 36978c60fd
commit 2ce6152d63
10 changed files with 48 additions and 15 deletions

View File

@@ -420,6 +420,7 @@ void onMSNHCommand(HWND hWnd, WPARAM wParam, LPARAM lParam)
( msg_data->y<(data->yPos+mcam) ||
msg_data->y>(data->yPos+data->yPageSize-mcam) );
mcam += iflags.wc_scroll_amount;
/* get page size and center horizontally on x-position */
if( scroll_x ) {
if( data->xPageSize<=2*mcam ) {

View File

@@ -16,5 +16,6 @@ int mswin_map_mode(HWND hWnd, int mode);
#define ROGUE_LEVEL_MAP_MODE MAP_MODE_ASCII12x16
#define DEF_CLIPAROUND_MARGIN 5
#define DEF_CLIPAROUND_AMOUNT 1
#endif /* MSWINMapWindow_h */

View File

@@ -65,7 +65,7 @@ COLORREF message_fg_color = RGB(0xFF, 0xFF, 0xFF);
struct window_procs mswin_procs = {
"MSWIN",
WC_COLOR|WC_HILITE_PET|WC_ALIGN_MESSAGE|WC_ALIGN_STATUS|
WC_INVERSE|WC_SCROLL_MARGIN|WC_MAP_MODE|
WC_INVERSE|WC_SCROLL_AMOUNT|WC_SCROLL_MARGIN|WC_MAP_MODE|
WC_FONT_MESSAGE|WC_FONT_STATUS|WC_FONT_MENU|WC_FONT_TEXT|
WC_FONTSIZ_MESSAGE|WC_FONTSIZ_STATUS|WC_FONTSIZ_MENU|WC_FONTSIZ_TEXT|
WC_TILE_WIDTH|WC_TILE_HEIGHT|WC_TILE_FILE|WC_VARY_MSGCOUNT|
@@ -187,6 +187,7 @@ void mswin_init_nhwindows(int* argc, char** argv)
if( iflags.wc_align_message==0 ) iflags.wc_align_message = ALIGN_TOP;
if( iflags.wc_align_status==0 ) iflags.wc_align_status = ALIGN_BOTTOM;
if( iflags.wc_scroll_margin==0 ) iflags.wc_scroll_margin = DEF_CLIPAROUND_MARGIN;
if( iflags.wc_scroll_amount==0 ) iflags.wc_scroll_amount = DEF_CLIPAROUND_AMOUNT;
if( iflags.wc_tile_width==0 ) iflags.wc_tile_width = TILE_X;
if( iflags.wc_tile_height==0 ) iflags.wc_tile_height = TILE_Y;
@@ -216,7 +217,8 @@ void mswin_init_nhwindows(int* argc, char** argv)
WC_HILITE_PET |
WC_ALIGN_MESSAGE |
WC_ALIGN_STATUS |
WC_SCROLL_MARGIN |
WC_SCROLL_AMOUNT |
WC_SCROLL_MARGIN |
WC_MAP_MODE |
WC_FONT_MESSAGE |
WC_FONT_STATUS |
@@ -1828,6 +1830,11 @@ void mswin_preference_update(const char *pref)
return;
}
if( stricmp( pref, "scroll_amount")==0 ) {
mswin_cliparound(u.ux, u.uy);
return;
}
if( stricmp( pref, "scroll_margin")==0 ) {
mswin_cliparound(u.ux, u.uy);
return;