use ctrl_nhwindow() for menu prompt style

This implements the mechanics to use the ctrl_nhwindow() interface
capability to pass down a setting change from the core to the active
window port, without resorting to accessing a core global variable
from within the window port, and without altering the interface..

The passed setting is honored in the tty and curses window ports.

X11 and mswin receive and store the values, but no implementation
to change the menu prompt style is there yet.

Qt does not store the values or have an implementation.

The setting change is done in allmain.c immediately after
creating the WIN_INVEN window.
This commit is contained in:
nhmall
2023-11-16 00:10:06 -05:00
parent 657d0f6105
commit 86067dcffd
13 changed files with 112 additions and 25 deletions

View File

@@ -3437,6 +3437,7 @@ extern void genl_putmixed(winid, int, const char *);
extern void genl_display_file(const char *, boolean);
extern boolean menuitem_invert_test(int, unsigned, boolean);
extern const char *mixed_to_glyphinfo(const char *str, glyph_info *gip);
extern void adjust_menu_promptstyle(winid, color_attr *);
extern void add_menu(winid, const glyph_info *, const ANY_P *,
char, char, int, int, const char *, unsigned int);
extern void add_menu_heading(winid, const char *);

View File

@@ -186,10 +186,6 @@ struct debug_flags {
#endif
};
typedef struct color_and_attr {
int color, attr;
} color_attr;
/*
* Stuff that really isn't option or platform related and does not
* get saved and restored. They are set and cleared during the game

View File

@@ -445,6 +445,10 @@ extern struct nomakedefs_s nomakedefs;
#define MAXMONNO 120 /* extinct monst after this number created */
#define MHPMAX 500 /* maximum monster hp */
typedef struct color_and_attr {
int color, attr;
} color_attr;
/*
* Version 3.7.x has aspirations of portable file formats. We
* make a distinction between MAIL functionality and MAIL_STRUCTURES

View File

@@ -204,8 +204,9 @@ enum to_core_flags {
};
enum from_core_requests {
set_mode = 1,
request_settings = 2,
set_mode = 1,
request_settings = 2,
set_menu_promptstyle = 3
};
struct to_core {
@@ -220,6 +221,7 @@ struct to_core {
struct from_core {
enum from_core_requests core_request;
enum inv_modes invmode;
color_attr menu_promptstyle;
};
struct win_request_info_t {
@@ -228,6 +230,7 @@ struct win_request_info_t {
};
typedef struct win_request_info_t win_request_info;
extern win_request_info zerowri; /* windows.c */
/* #define CORE_INVENT */