X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=src%2Fclient%2Fdraw_wins.c;h=e409d8747a63281a0f91c4958ac3e52062d18f27;hb=9c346f2749d1e9f63be1421d7d1fe51162bc64e3;hp=ec2917347903b5ae6b44f4907fe7b291127c26c3;hpb=eda9c448812827e36b71fa1c3eb76d0fb906b57d;p=plomrogue diff --git a/src/client/draw_wins.c b/src/client/draw_wins.c index ec29173..e409d87 100644 --- a/src/client/draw_wins.c +++ b/src/client/draw_wins.c @@ -361,7 +361,7 @@ extern void draw_win_log(struct Win * win) if (x > win->frame_size.x || '\n' == world.log[i]) { n_postbreak_lines++; - x = 0; + x = 1; } } if (n_postbreak_lines > win->frame_size.y) @@ -369,6 +369,7 @@ extern void draw_win_log(struct Win * win) uint32_t size = n_postbreak_lines * (win->frame_size.x + 1); win->winmap = try_malloc(sizeof(chtype) * size, __func__); for (i = 0; i < size; win->winmap[i] = ' ', i++); + /* TODO: This should only be done with "long" line break style. */ do_realloc_winmap = 0; draw_text_from_bottom(win, world.log); do_realloc_winmap = 1; @@ -426,10 +427,13 @@ extern void draw_win_info(struct Win * win) { char * dsc_turn = "Turn: "; char * dsc_hitpoints = "\nHitpoints: "; - uint16_t maxl = strlen(dsc_turn) + 5 + strlen(dsc_hitpoints) + 3; + char * dsc_satiation = "\nSatiation: "; + uint16_t maxl = strlen(dsc_turn) + 5 + strlen(dsc_hitpoints) + + strlen(dsc_satiation) + 6 + 3; char * text = try_malloc(maxl + 1, __func__); - int test = sprintf(text, "%s%d%s%d", dsc_turn, world.turn, dsc_hitpoints, - world.player_lifepoints); + int test = sprintf(text, "%s%d%s%d%s%d", dsc_turn, world.turn, dsc_hitpoints, + world.player_lifepoints, dsc_satiation, + world.player_satiation); exit_trouble(test < 0, __func__, "sprintf"); add_text_with_linebreaks(win, text); free(text);