rework TTY_PERM_INVENT; update window port interface
Change the inner workings of the experimental TTY_PERM_INVENT. Switch to delivering the content to tty for the experimental perm_invent via the existing window port interface (start_menu(), add_menu(), end_menu). This also adds a new window port interface call ctrl_nhwindow() for delivering information to the window port, and/or obtaining specific information from the window port. The information and requests can be extended as required. To be documented later once the changes settle down. Due to the intrusive nature of these changes and the possibility of some bugs in the new code, I'm going to leave TTY_PERM_INVENT commented out in the repository for a day or two. Anyone wishing to test it out can do so by uncommenting TTY_PERM_INVENT in config.h.
This commit is contained in:
+8
-14
@@ -169,6 +169,9 @@ typedef struct gi {
|
||||
*/
|
||||
|
||||
#define MENU_BEHAVE_STANDARD 0x0000000U
|
||||
#define MENU_BEHAVE_PERMINV 0x0000001U
|
||||
|
||||
enum perm_invent_toggles {toggling_off = -1, toggling_not = 0, toggling_on = 1 };
|
||||
|
||||
/* inventory modes */
|
||||
enum inv_modes { InvNormal = 0, InvShowGold = 1, InvSparse = 2, InvInUse = 4 };
|
||||
@@ -180,9 +183,8 @@ enum to_core_flags {
|
||||
};
|
||||
|
||||
enum from_core_requests {
|
||||
request_settings = 1,
|
||||
update_slot = 2,
|
||||
render = 3
|
||||
set_mode = 1,
|
||||
request_settings = 2,
|
||||
};
|
||||
|
||||
struct to_core {
|
||||
@@ -197,24 +199,16 @@ struct to_core {
|
||||
struct from_core {
|
||||
enum from_core_requests core_request;
|
||||
enum inv_modes invmode;
|
||||
boolean force_redraw;
|
||||
int slot; /* which inventory slot + 1; 0 indicates request */
|
||||
int invlet;
|
||||
char text[BUFSZ];
|
||||
int32_t clr; /* adjusted color 0 = ignore
|
||||
* 1-16 = NetHack color + 1
|
||||
* 17..16,777,233 = 24-bit color + 17
|
||||
*/
|
||||
};
|
||||
|
||||
struct perminvent_info_t {
|
||||
struct win_request_info_t {
|
||||
struct to_core tocore;
|
||||
struct from_core fromcore;
|
||||
};
|
||||
|
||||
typedef struct perminvent_info_t perminvent_info;
|
||||
typedef struct win_request_info_t win_request_info;
|
||||
|
||||
#define CORE_INVENT
|
||||
/* #define CORE_INVENT */
|
||||
|
||||
/* clang-format on */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user