1 /* src/client/misc.c */
4 #include <stdint.h> /* uint8_t, uint16_t */
5 #include "cleanup.h" /* for set_cleanup_flag() */
6 #include "keybindings.h" /* init_keybindings(), free_keybindings(),
9 #include "wincontrol.h" /* init_winconfs(), init_wins(),
10 * sorted_wintoggle_and_activate()
12 #include "windows.h" /* suspend_win() */
13 #include "world.h" /* global world */
17 extern void save_interface_conf()
19 save_keybindings("confclient/keybindings_global", &world.kb_global);
20 save_keybindings("confclient/keybindings_wingeom", &world.kb_wingeom);
21 save_keybindings("confclient/keybindings_winkeys", &world.kb_winkeys);
27 extern void load_interface_conf()
29 init_keybindings("confclient/keybindings_global", &world.kb_global);
30 init_keybindings("confclient/keybindings_wingeom", &world.kb_wingeom);
31 init_keybindings("confclient/keybindings_winkeys", &world.kb_winkeys);
34 sorted_wintoggle_and_activate();
35 set_cleanup_flag(CLEANUP_INTERFACE);
40 extern void unload_interface_conf()
42 free_keybindings(world.kb_global.kbs);
43 free_keybindings(world.kb_wingeom.kbs);
44 free_keybindings(world.kb_winkeys.kbs);
45 while (0 != world.wmeta.active)
47 suspend_win(world.wmeta.active);
54 extern void reload_interface_conf()
56 unload_interface_conf();
57 load_interface_conf();
62 extern uint16_t center_offset(uint16_t position, uint16_t mapsize,
66 if (mapsize > framesize)
68 if (position > framesize / 2)
70 if (position < mapsize - (framesize / 2))
72 offset = position - (framesize / 2);
76 offset = mapsize - framesize;
85 extern void nav_inventory(char dir)
89 world.player_inventory_select = world.player_inventory_select
90 - (world.player_inventory_select > 0);
95 for (i = 0; '\0' != world.player_inventory[i]; i++)
97 n_elems = n_elems + ('\n' == world.player_inventory[i]);
99 world.player_inventory_select = world.player_inventory_select
100 + (world.player_inventory_select < n_elems);