mirror of
https://git.zap.org.au/git/trader.git
synced 2025-02-02 15:08:13 -05:00
Fix a couple of display bugs
Firstly, Ncurses addchstr() and family do not work, it seems, with multibyte strings, so use addch() instead. Secondly, PRINTABLE_MAP_VAL returns a wchar_t wide character, not a byte-sized char.
This commit is contained in:
parent
7fba9f8844
commit
74aa3e84df
@ -152,9 +152,8 @@ void exchange_stock (void)
|
|||||||
|
|
||||||
for (line = 6, i = 0; i < MAX_COMPANIES; i++) {
|
for (line = 6, i = 0; i < MAX_COMPANIES; i++) {
|
||||||
if (company[i].on_map) {
|
if (company[i].on_map) {
|
||||||
mvwaddch(curwin, line, 2, PRINTABLE_MAP_VAL(COMPANY_TO_MAP(i))
|
left(curwin, line, 2, attr_choice, 0, 0, 1, "%lc",
|
||||||
| attr_choice);
|
(wint_t) PRINTABLE_MAP_VAL(COMPANY_TO_MAP(i)));
|
||||||
|
|
||||||
left(curwin, line, 4, attr_normal, 0, 0, 1, "%ls",
|
left(curwin, line, 4, attr_normal, 0, 0, 1, "%ls",
|
||||||
company[i].name);
|
company[i].name);
|
||||||
|
|
||||||
|
@ -219,8 +219,12 @@ selection_t get_move (void)
|
|||||||
|
|
||||||
// Display current move choices on the galaxy map
|
// Display current move choices on the galaxy map
|
||||||
for (int i = 0; i < NUMBER_MOVES; i++) {
|
for (int i = 0; i < NUMBER_MOVES; i++) {
|
||||||
mvwaddchstr(curwin, game_move[i].y + 3, game_move[i].x * 2 + 2,
|
chtype *movestr = CHTYPE_GAME_MOVE(i);
|
||||||
CHTYPE_GAME_MOVE(i));
|
|
||||||
|
wmove(curwin, game_move[i].y + 3, game_move[i].x * 2 + 2);
|
||||||
|
while (*movestr != 0) {
|
||||||
|
waddch(curwin, *movestr++);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
wrefresh(curwin);
|
wrefresh(curwin);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user