home · contact · privacy
Client: Repair wrong messages in window geometry configuration dialogue.
[plomrogue] / src / client / draw_wins.c
index 1dbd8a820774c17bc292de8650a267008817d205..f99f2c77204a9add681a8f5ab8690d6b4e94122a 100644 (file)
@@ -63,10 +63,6 @@ static char * get_kb_line(struct KeyBinding * kb);
 static void draw_keybinding_config(struct Win * win, struct KeyBindingDB * kbdb,
                                    uint16_t offset);
 
-/* Draw into window "w" list of all the keybindings that start at "kbdb". */
-static void draw_titled_keybinding_list(struct Win * win,
-                                        struct KeyBindingDB * kbdb);
-
 
 
 static void try_resize_winmap(struct Win * win, int new_size_y, int new_size_x)
@@ -300,26 +296,6 @@ static void draw_keybinding_config(struct Win * win, struct KeyBindingDB * kbdb,
 
 
 
-static void draw_titled_keybinding_list(struct Win * win,
-                                        struct KeyBindingDB * kbdb)
-{
-    uint16_t offset = 0;
-    if (0 == kbdb->n_of_kbs)
-    {
-        add_line(win, "(none)", 0, &offset, 0);
-        return;
-    }
-    uint8_t kb_n;
-    for (kb_n = 0; kb_n < kbdb->n_of_kbs; kb_n++)
-    {
-        char * kb_line = get_kb_line(&kbdb->kbs[kb_n]);
-        add_line(win, kb_line, 0, &offset, (0 == kb_n + 1));
-        free(kb_line);
-    }
-}
-
-
-
 extern void draw_win_log(struct Win * win)
 {
     if (!world.log)
@@ -418,13 +394,6 @@ extern void draw_win_inventory(struct Win * win)
 
 
 
-extern void draw_win_global_keys(struct Win * win)
-{
-    draw_titled_keybinding_list(win, &world.kb_global);
-}
-
-
-
 extern void draw_win_active_windows_keys(struct Win * win)
 {
     struct Win * win_active = get_win_by_id(world.winDB.active);
@@ -437,7 +406,20 @@ extern void draw_win_active_windows_keys(struct Win * win)
     {
         kbdb = &world.kb_winkeys;
     }
-    draw_titled_keybinding_list(win, kbdb);
+    uint16_t offset = 0;
+    if (0 == kbdb->n_of_kbs)
+    {
+        add_line(win, "(none)", 0, &offset, 0);
+        return;
+    }
+    uint8_t kb_n;
+    for (kb_n = 0; kb_n < kbdb->n_of_kbs; kb_n++)
+    {
+        char * kb_line = get_kb_line(&kbdb->kbs[kb_n]);
+        add_line(win, kb_line, 0, &offset, (0 == kb_n + 1));
+        free(kb_line);
+    }
+
 }
 
 
@@ -484,15 +466,15 @@ extern void draw_winconf_geometry(struct Win * win)
     char h_value[6 + 1];                       /* 6: int16_t value max strlen */
     int test = sprintf(h_value, "%d", win->target_height);
     exit_trouble(test < 0, __func__, "sprintf");
-    char * h_plus = " (width in cells)\n\n";
-    char * h_minus = " (negative diff: cells to screen width)\n\n";
+    char * h_plus = " (height in cells)\n\n";
+    char * h_minus = " (non-positive diff: cells to screen height)\n\n";
     char * h_type = (1 == win->target_height_type) ? h_minus : h_plus;
     char * w_title = "Width to save: ";
     char w_value[6 + 1];
     test = sprintf(w_value, "%d", win->target_width);
     exit_trouble(test < 0, __func__, "sprintf");
-    char * w_plus = " (height in cells)\n\n";
-    char * w_minus = " (negative diff: cells to screen height)\n\n";
+    char * w_plus = " (width in cells)\n\n";
+    char * w_minus = " (non-positive diff: cells to screen width)\n\n";
     char * w_type = (1 == win->target_width_type)  ? w_minus : w_plus;
     char * breaks_title = "Linebreak type: ";
     char * breaks_type = (1 == win->linebreak) ? "wide" : "long";