- added counting to the menu window. I changed the way it works in the TTY
port though ("you hear the rumble of distant thunder..." :) The count
applies to the currently selected item instead of being aplied to the item
to be selected (in other words a12 instead of 12a). It works better this
way in the graphical port since there is a notion of current menu item.
I also notes that the count is ignored for PICK_ONE menu - is this by
design?
- somebode mention that text is not scrollable by default - this is fixed.
- fixed player selection dialog to use initXXXX options
-----------------------
B1028 [reported] win32: popup window is too short
The text in the popup window's top line "What do you want to
call the ..." is cut off. Could the window be bigger, so you
can read the entire line?
Fixed.
---------------------
B1027 [reported] win32: select via traditional class char
In a shop (and perhaps elsewhere), I can autoselect a class of
items to drop: a for all types, b for coins, c for weapons, ...,
A for every item, B for blessed items, ... I like the new
possibilities, but I would like to be able to use the old way of
using ! for potions, ) for weapons, etc., as well.
Fixed.
---------------------
B1026 [reported] win32: setting multiple options
I want to set packorder and pickup_types. The first comes up
first, and I type in the order. Then comes the second, without
any hint what is asked of me. A little explanation here would
be appropriate, like "pick up what things automatically?" or
somesuch. When more than one option is set where extra input
is required, some explanation is useful.
Looking into. Apparently something end_menu() call is ignored by nethackw.
---------------------
B1025 [reported] win32: menu navigation
I press O. Now, when I press "a" to turn on "autodig", not only
is the mark set at "a", but there also appears a dotted
rectangle around option "A" (capitalized). Shouldn't this
rectangle also appear at "a"? Pressing "a" repeatedly toggles
the checkmark, but the rectangle switches between "A" and "a".
My CAPS LOCK is not set. The same goes for B, C, D, ... N,
by the way. Pressing "A" works the other way around: the first
press checks "A" and "rectangles" "a", the next unchecks "A"
and rectangles "A" as well.
Fixed.
---------------------
B1024 [reported] win32: no text in final window
After I clicked away the last screen with information
(challenges, I believe it was), I got an empty text screen, as
big as my screen, without any content. It looked like the text
screens that appear on the right, only it was larger and had
only a large OK button over the full width of the window, and
no cancel button. Why this window?
Fixed. The program did not set window text for RIP window.
---------------------
B1010 [known issue] win32: cosmetic
When I get my list of spells, the columns aren't properly
aligned: if the spell name is longer, the rest of the line
shifts right.
Fixed. Fixed-pitch font is used for menu window.
---------------------
B1004 [reported] win32: numeric keyboard Del/.-key
The Del/.-key on my numeric keyboard doesn't make me rest a turn
Fixed. Added rest on Del.
---------------------
B1003 [reported] win32: focus
When the window has the focus, the window bar isn't highlighted.
This is by design. Menu and text widnows are popup and the main
window is disabled when they are up.
147 lines
4.4 KiB
C
147 lines
4.4 KiB
C
/* Copyright (C) 2001 by Alex Kompel <shurikk@pacbell.net> */
|
|
/* NetHack may be freely redistributed. See license for details. */
|
|
|
|
#ifndef WINMS_H
|
|
#define WINMS_H
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
#include <windows.h>
|
|
#include <commctrl.h>
|
|
#include <tchar.h>
|
|
#include "hack.h"
|
|
|
|
/* Create an array to keep track of the various windows */
|
|
|
|
#ifndef MAXWINDOWS
|
|
#define MAXWINDOWS 15
|
|
#endif
|
|
|
|
#define NHW_RIP 32
|
|
|
|
#ifndef TILE_X
|
|
#define TILE_X 16
|
|
#endif
|
|
#define TILE_Y 16
|
|
|
|
#define TILES_PER_LINE 40
|
|
|
|
/* tile background color */
|
|
#define TILE_BK_COLOR RGB(71, 108, 108)
|
|
|
|
typedef struct mswin_nhwindow_data {
|
|
HWND win;
|
|
int type;
|
|
int dead;
|
|
} MSNHWinData, *PMSNHWinData;
|
|
|
|
typedef struct mswin_nhwindow_app {
|
|
HINSTANCE hApp;
|
|
HWND hMainWnd;
|
|
HACCEL hAccelTable;
|
|
HWND hPopupWnd; /* current popup window */
|
|
|
|
MSNHWinData windowlist[MAXWINDOWS];
|
|
|
|
HBITMAP bmpTiles;
|
|
HBITMAP bmpPetMark;
|
|
|
|
boolean bNoHScroll; /* disable cliparound for horizontal grid (map) */
|
|
boolean bNoVScroll; /* disable cliparound for vertical grid (map) */
|
|
|
|
int mapDisplayMode; /* regular map display mode */
|
|
int mapDisplayModeSave; /* saved map display mode */
|
|
|
|
int winStatusAlign; /* alignment of the status window */
|
|
int winMessageAlign; /* alignment of the status window */
|
|
} NHWinApp, *PNHWinApp;
|
|
extern PNHWinApp GetNHApp();
|
|
|
|
#define E extern
|
|
|
|
E struct window_procs mswin_procs;
|
|
|
|
#undef E
|
|
|
|
/* Some prototypes */
|
|
void mswin_init_nhwindows(int* argc, char** argv);
|
|
void mswin_player_selection(void);
|
|
void mswin_askname(void);
|
|
void mswin_get_nh_event(void);
|
|
void mswin_exit_nhwindows(const char *);
|
|
void mswin_suspend_nhwindows(const char *);
|
|
void mswin_resume_nhwindows(void);
|
|
winid mswin_create_nhwindow(int type);
|
|
void mswin_clear_nhwindow(winid wid);
|
|
void mswin_display_nhwindow(winid wid, BOOLEAN_P block);
|
|
void mswin_destroy_nhwindow(winid wid);
|
|
void mswin_curs(winid wid, int x, int y);
|
|
void mswin_putstr(winid wid, int attr, const char *text);
|
|
void mswin_display_file(const char *filename,BOOLEAN_P must_exist);
|
|
void mswin_start_menu(winid wid);
|
|
void mswin_add_menu(winid wid, int glyph, const ANY_P * identifier,
|
|
CHAR_P accelerator, CHAR_P group_accel, int attr,
|
|
const char *str, BOOLEAN_P presel);
|
|
void mswin_end_menu(winid wid, const char *prompt);
|
|
int mswin_select_menu(winid wid, int how, MENU_ITEM_P **selected);
|
|
void mswin_update_inventory(void);
|
|
void mswin_mark_synch(void);
|
|
void mswin_wait_synch(void);
|
|
void mswin_cliparound(int x, int y);
|
|
void mswin_print_glyph(winid wid,XCHAR_P x,XCHAR_P y,int glyph);
|
|
void mswin_raw_print(const char *str);
|
|
void mswin_raw_print_bold(const char *str);
|
|
int mswin_nhgetch(void);
|
|
int mswin_nh_poskey(int *x, int *y, int *mod);
|
|
void mswin_nhbell(void);
|
|
int mswin_doprev_message(void);
|
|
char mswin_yn_function(const char *question, const char *choices,
|
|
CHAR_P def);
|
|
void mswin_getlin(const char *question, char *input);
|
|
int mswin_get_ext_cmd(void);
|
|
void mswin_number_pad(int state);
|
|
void mswin_delay_output(void);
|
|
void mswin_change_color(void);
|
|
char *mswin_get_color_string(void);
|
|
void mswin_start_screen(void);
|
|
void mswin_end_screen(void);
|
|
void mswin_outrip(winid wid, int how);
|
|
|
|
/* helper function */
|
|
HWND mswin_hwnd_from_winid(winid wid);
|
|
winid mswin_winid_from_type(int type);
|
|
winid mswin_winid_from_handle(HWND hWnd);
|
|
void mswin_window_mark_dead(winid wid);
|
|
void bail(const char *mesg);
|
|
void nhapply_image_transparent(
|
|
HDC hDC, int x, int y, int width, int height,
|
|
HDC sourceDC, int s_x, int s_y, int s_width, int s_height,
|
|
COLORREF cTransparent
|
|
);
|
|
|
|
/* unicode stuff */
|
|
#ifdef UNICODE
|
|
#define NH_W2A(w, a, cb) ( WideCharToMultiByte( \
|
|
CP_ACP, \
|
|
0, \
|
|
(w), \
|
|
-1, \
|
|
(a), \
|
|
(cb), \
|
|
NULL, \
|
|
NULL), (a) )
|
|
|
|
#define NH_A2W(a, w, cb) ( MultiByteToWideChar( \
|
|
CP_ACP, \
|
|
0, \
|
|
(a), \
|
|
-1, \
|
|
(w), \
|
|
(cb)), (w) )
|
|
#else
|
|
#define NH_W2A(w, a, cb) (strncpy((a), (w), (cb)))
|
|
|
|
#define NH_A2W(a, w, cb) (strncpy((w), (a), (cb)))
|
|
#endif
|
|
|
|
#endif /* WINmswin_H */
|