From <Someone>,
Fixes:
- menu shortcuts implemented
- most windows close on space (except for menus with
PICK_ANY style)
- "hilite_pet" option is implemented
- map scrolling is improved somewhat (it now scrolls if
the char is within 5 spaces from the edge of the map -
configurable by #define CLIPAROUND_MARGIN)
- added 3 winhack-specific options:
win32_map_mode:[tiles|ascii4x6|ascii6x8|ascii8x8
|ascii16x8|ascii7x12|ascii8x12|ascii15x12
|ascii12x16|ascii10x18|fit_to_screen]=20
win32_align_status:[left|top|right|bottom]
win32_align_message:[left|top|right|bottom]
Note: aligning status window to left or right edge of the screen does
not look good.
This commit is contained in:
@@ -51,13 +51,15 @@ int APIENTRY WinMain(HINSTANCE hInstance,
|
||||
_nethack_app.hMenuWnd = NULL;
|
||||
_nethack_app.bmpTiles = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_TILES));
|
||||
if( _nethack_app.bmpTiles==NULL ) panic("cannot load tiles bitmap");
|
||||
_nethack_app.bmpPetMark = LoadBitmap(hInstance, MAKEINTRESOURCE(IDB_PETMARK));
|
||||
if( _nethack_app.bmpPetMark==NULL ) panic("cannot load pet mark bitmap");
|
||||
_nethack_app.bNoHScroll = FALSE;
|
||||
_nethack_app.bNoVScroll = FALSE;
|
||||
_nethack_app.mapDisplayMode = NHMAP_VIEW_TILES;
|
||||
_nethack_app.winStatusAlign = NHWND_ALIGN_BOTTOM;
|
||||
_nethack_app.winMessageAlign = NHWND_ALIGN_TOP;
|
||||
|
||||
// init controls
|
||||
LoadLibrary( TEXT("RICHED32.DLL") );
|
||||
|
||||
ZeroMemory(&InitCtrls, sizeof(InitCtrls));
|
||||
InitCtrls.dwSize = sizeof(InitCtrls);
|
||||
InitCtrls.dwICC = ICC_LISTVIEW_CLASSES;
|
||||
@@ -129,3 +131,63 @@ PNHWinApp GetNHApp()
|
||||
return &_nethack_app;
|
||||
}
|
||||
|
||||
/* options */
|
||||
struct t_win32_opt_int {
|
||||
const char* val;
|
||||
int opt;
|
||||
};
|
||||
static struct t_win32_opt_int _win32_map_mode[] =
|
||||
{
|
||||
{ "tiles", NHMAP_VIEW_TILES },
|
||||
{ "ascii4x6", NHMAP_VIEW_ASCII4x6 },
|
||||
{ "ascii6x8", NHMAP_VIEW_ASCII6x8 },
|
||||
{ "ascii8x8", NHMAP_VIEW_ASCII8x8 },
|
||||
{ "ascii16x8", NHMAP_VIEW_ASCII16x8 },
|
||||
{ "ascii7x12", NHMAP_VIEW_ASCII7x12 },
|
||||
{ "ascii8x12", NHMAP_VIEW_ASCII8x12 },
|
||||
{ "ascii16x12", NHMAP_VIEW_ASCII16x12 },
|
||||
{ "ascii12x16", NHMAP_VIEW_ASCII12x16 },
|
||||
{ "ascii10x18", NHMAP_VIEW_ASCII10x18 },
|
||||
{ "fit_to_screen", NHMAP_VIEW_FIT_TO_SCREEN },
|
||||
{ NULL, -1 }
|
||||
};
|
||||
|
||||
static struct t_win32_opt_int _win32_align[] =
|
||||
{
|
||||
{ "left", NHWND_ALIGN_LEFT },
|
||||
{ "right", NHWND_ALIGN_RIGHT },
|
||||
{ "top", NHWND_ALIGN_TOP },
|
||||
{ "bottom", NHWND_ALIGN_BOTTOM },
|
||||
{ NULL, -1 }
|
||||
};
|
||||
|
||||
int set_win32_option( const char * name, const char * val)
|
||||
{
|
||||
struct t_win32_opt_int* p;
|
||||
if( _stricmp(name, "win32_map_mode")==0 ) {
|
||||
for( p=_win32_map_mode; p->val; p++ ) {
|
||||
if( _stricmp(p->val, val)==0 ){
|
||||
GetNHApp()->mapDisplayMode = p->opt;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
} else if( _stricmp(name, "win32_align_status")==0 ) {
|
||||
for( p=_win32_align; p->val; p++ ) {
|
||||
if( _stricmp(p->val, val)==0 ) {
|
||||
GetNHApp()->winStatusAlign = p->opt;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
} else if( _stricmp(name, "win32_align_message")==0 ) {
|
||||
for( p=_win32_align; p->val; p++ ) {
|
||||
if( _stricmp(p->val, val)==0 ) {
|
||||
GetNHApp()->winMessageAlign = p->opt;
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user