From: Christian Heller Date: Sun, 25 Aug 2013 02:16:27 +0000 (+0200) Subject: Corrected lack of some specific error messages. X-Git-Tag: tce~1056 X-Git-Url: https://plomlompom.com/repos/%7B%7Bprefix%7D%7D/%7B%7B%20web_path%20%7D%7D/static/balance?a=commitdiff_plain;h=cb6e8f9f28c96974735c5cd5a45ac8e8f1e01422;p=plomrogue Corrected lack of some specific error messages. --- diff --git a/src/draw_wins.c b/src/draw_wins.c index 02b569c..ad5ad12 100644 --- a/src/draw_wins.c +++ b/src/draw_wins.c @@ -223,13 +223,14 @@ extern void draw_keys_win(struct Win * win) win->frame.size.y - 1); uint8_t keydescwidth = 9 + 1; /* max length assured by get_keyname() + \0 */ char * keydesc = malloc(keydescwidth), * keyname; + char * err_hint = "Trouble drawing scroll hint in Keybindings Window."; attr_t attri; for (y = 0; y <= world->keyswindata->max && y < win->frame.size.y; y++) { if (0 == y && offset > 0) { exit_err(draw_scroll_hint(&win->frame, y, offset + 1, '^'), - world, NULL); + world, err_hint); continue; } else if (win->frame.size.y == y + 1 @@ -239,7 +240,7 @@ extern void draw_keys_win(struct Win * win) exit_err(draw_scroll_hint(&win->frame, y, world->keyswindata->max - (offset + win->frame.size.y) + 2, 'v'), - world, NULL); + world, err_hint); continue; } attri = 0; diff --git a/src/misc.c b/src/misc.c index 7256885..875e119 100644 --- a/src/misc.c +++ b/src/misc.c @@ -259,6 +259,9 @@ extern uint8_t meta_keys(int key, struct World * world, struct Win * win_map, struct Win * win_info, struct Win * win_log) { + char * err_toggle = "Trouble toggling window."; + char * err_shift = "Trouble shifting window."; + char * err_resize = "Trouble resizing window."; if (key == get_action_key(world->keybindings, "quit")) { return 1; @@ -273,19 +276,19 @@ extern uint8_t meta_keys(int key, struct World * world, } else if (key == get_action_key(world->keybindings, "toggle keys window")) { - exit_err(toggle_window(win_meta, win_keys), world, NULL); + exit_err(toggle_window(win_meta, win_keys), world, err_toggle); } else if (key == get_action_key(world->keybindings, "toggle map window")) { - exit_err(toggle_window(win_meta, win_map), world, NULL); + exit_err(toggle_window(win_meta, win_map), world, err_toggle); } else if (key == get_action_key(world->keybindings, "toggle info window")) { - exit_err(toggle_window(win_meta, win_info), world, NULL); + exit_err(toggle_window(win_meta, win_info), world, err_toggle); } else if (key == get_action_key(world->keybindings, "toggle log window")) { - exit_err(toggle_window(win_meta, win_log), world, NULL); + exit_err(toggle_window(win_meta, win_log), world, err_toggle); } else if (key == get_action_key(world->keybindings, "cycle forwards")) { @@ -297,27 +300,27 @@ extern uint8_t meta_keys(int key, struct World * world, } else if (key == get_action_key(world->keybindings, "shift forwards")) { - exit_err(shift_active_win(win_meta, 'f'), world, NULL); + exit_err(shift_active_win(win_meta, 'f'), world, err_shift); } else if (key == get_action_key(world->keybindings, "shift backwards")) { - exit_err(shift_active_win(win_meta, 'b'), world, NULL); + exit_err(shift_active_win(win_meta, 'b'), world, err_shift); } else if (key == get_action_key(world->keybindings, "grow horizontally")) { - exit_err(growshrink_active_window(win_meta, '*'), world, NULL); + exit_err(growshrink_active_window(win_meta, '*'), world, err_resize); } else if (key == get_action_key(world->keybindings, "shrink horizontally")) { - exit_err(growshrink_active_window(win_meta, '_'), world, NULL); + exit_err(growshrink_active_window(win_meta, '_'), world, err_resize); } else if (key == get_action_key(world->keybindings, "grow vertically")) { - exit_err(growshrink_active_window(win_meta, '+'), world, NULL); + exit_err(growshrink_active_window(win_meta, '+'), world, err_resize); } else if (key == get_action_key(world->keybindings, "shrink vertically")) { - exit_err(growshrink_active_window(win_meta, '-'), world, NULL); + exit_err(growshrink_active_window(win_meta, '-'), world, err_resize); } else if (key == get_action_key(world->keybindings, "save keys")) {