- if ( o->pos.y >= map->offset.y
- && o->pos.y < map->offset.y + win->frame.size.y
- && o->pos.x >= map->offset.x
- && o->pos.x < map->offset.x + win->frame.size.x)
- {
- d = get_map_obj_def (world, o->type);
- c = d->mapchar;
- mvwaddch(win->frame.curses_win,
- o->pos.y - map->offset.y, o->pos.x - map->offset.x, c);
- }
+ kb_p = wc->kb.kbs;
+ }
+ else if (1 == wc->view)
+ {
+ kb_p = world.kb_wingeom.kbs;
+ }
+ else if (2 == wc->view)
+ {
+ kb_p = world.kb_winkeys.kbs;
+ }
+ uint16_t offset = draw_titled_keybinding_list(title, win, 0, kb_p);
+ add_line(win, " ", 0, 0);
+ struct KeyBinding * kbs_glo = world.kb_global.kbs;
+ draw_titled_keybinding_list("Global keybindings", win, offset + 1, kbs_glo);
+}
+
+
+
+extern void draw_win_keybindings_global(struct Win * win)
+{
+ win->center.y = world.kb_global.select;
+ draw_kb_view(win, &world.kb_global, 0);
+}
+
+
+
+extern void draw_win_keybindings_winconf_geometry(struct Win * win)
+{
+ win->center.y = world.kb_wingeom.select;
+ draw_kb_view(win, &world.kb_wingeom, 0);
+}
+
+
+
+extern void draw_win_keybindings_winconf_keybindings(struct Win * win)
+{
+ win->center.y = world.kb_winkeys.select;
+ draw_kb_view(win, &world.kb_winkeys, 0);
+}
+
+
+
+extern void draw_winconf_keybindings(struct Win * win)
+{
+ struct WinConf * wc = get_winconf_by_win(win);
+ char * title = "Window's keybindings:";
+ add_line(win, title, 0, 0);
+ add_line(win, " ", 0, 0);
+ draw_kb_view(win, &wc->kb, 2);
+ win->center.y = wc->kb.select + 2;
+}
+
+
+
+extern void draw_winconf_geometry(struct Win * win)
+{
+ struct WinConf * wcp = get_winconf_by_win(/*&world, */win);
+ char * title = "Window's geometry:\n";
+ char * h_d = "\nHeight to save: ";
+ char * h_pos = " (width in cells)";
+ char * h_neg = " (negative diff: cells to maximum width)";
+ char * w_d = "\n\nWidth to save: ";
+ char * w_pos = " (height in cells)";
+ char * w_neg = " (negative diff: cells to maximum height)";
+ char * h_t = h_pos;
+ char * w_t = w_pos;
+ if (1 == wcp->height_type)
+ {
+ h_t = h_neg;
+ }
+ if (1 == wcp->width_type)
+ {
+ w_t = w_neg;