annotate option.c @ 3:5a977ccbc7a9 default tip

Empty changelog
author darius
date Sat, 06 Dec 1997 05:41:29 +0000
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1 /* $Id: option.c,v 1.1.1.1 1997/12/06 05:41:29 darius Exp $ */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
2
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
3 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
4 * option.c
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
5 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
6 #include "copyright.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
7
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
8 #include <stdio.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
9 #include <ctype.h>
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
10 #include "Wlib.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
11 #ifdef SOUND
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
12 #include "Slib.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
13 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
14 #include "defs.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
15 #include "struct.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
16 #include "data.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
17 #include "packets.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
18 #include "proto.h"
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
19
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
20 #ifdef DEBUG
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
21 #define IFDEBUG(foo) foo
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
22 #else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
23 #define IFDEBUG(foo)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
24 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
25
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
26 static int notdone; /* not done flag */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
27 static int oldzoom = -2;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
28
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
29 /* kludgy way to make options that do some action when clicked: */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
30 static int clearPhaserStats = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
31 static int reloadShipBitmaps = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
32
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
33 #ifdef ROTATERACE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
34 static int old_rotate, old_rotate_deg;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
35 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
36
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
37 static int old_ping;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
38
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
39 /* static int updateSpeed= 5;*/
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
40 static int lastUpdateSpeed = -1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
41
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
42 static char newkeys[14];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
43 static char newckeys[14];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
44 static char newbuttons[14];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
45 static char newcbuttons[14];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
46
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
47 static int remapAllShips = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
48
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
49 char *keymapmes[] = {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
50 "Key/Buttonmap only affect THIS ship type",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
51 "Key/Buttonmap affect ALL ship types",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
52 ""
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
53 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
54
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
55 #ifdef TIMER
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
56 char *timermes[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
57 {"Timer shows nothing (off)",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
58 "Timer shows time of day",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
59 "Timer shows time on server",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
60 "Timer shows time in ship",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
61 "Timer shows user-set time",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
62 ""};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
63 #endif /* TIMER */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
64
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
65 char *localmes[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
66 {"Show owner on local planets",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
67 "Show facilities on local planets",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
68 "Show nothing on local planets",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
69 "Show surface properties on local planets",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
70 "Show MOO facilities on local planets",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
71 ""};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
72
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
73 char *galacticmes[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
74 {"Show owner on galactic map",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
75 "Show facilities on galactic map",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
76 "Show nothing on galactic map",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
77 "Show surface properties on galactic map",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
78 "Show scout info age on galactic map",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
79 "Show MOO facilities on galactic map",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
80 ""};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
81
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
82 #ifdef ROTATERACE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
83 char *rotatemess[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
84 {"Don't rotate galaxy",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
85 "Rotate galaxy 90 degrees",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
86 "Rotate galaxy 180 degrees",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
87 "Rotate galaxy 270 degrees",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
88 ""
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
89 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
90 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
91
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
92 char *mapupdates[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
93 {"Don't update galactic map",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
94 "Update galactic map frequently",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
95 "Update galactic map rarely",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
96 ""};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
97
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
98 static char *lockoptions[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
99 {"Don't show lock icon",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
100 "show lock icon on galactic map only",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
101 "Show lock icon on tactical map only",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
102 "Show lock icon on both map windows", ""};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
103
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
104 static char *phaseroptions[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
105 {"Don't show phaser messages",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
106 "Phaser messages in kill window",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
107 "Phaser messages in phaser window",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
108 "Phaser messages in phaser window only",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
109 "Phaser messages in total review only",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
110 ""};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
111
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
112 static char *dashboardoptions[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
113 {"Old Dashboard",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
114 "New Dashboard",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
115 "Color Dashboard",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
116 "Rainbow Dashboard",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
117 ""};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
118
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
119 static char *autoZoomOpts[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
120 {"Don't auto-zoom map",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
121 "Auto-zoom map on Red OR Yellow Alert",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
122 "Auto-zoom map on Red Alert",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
123 ""};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
124
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
125 static char *autoUnZoomOpts[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
126 {"Don't auto-unzoom map",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
127 "Auto-unzoom map on Green alert",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
128 "Auto-unzoom map on Green OR Yellow Alert",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
129 ""};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
130
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
131 static char *autoSetWarOpts[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
132 {"Don't auto set war declarations",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
133 "Set war with non-zero player teams",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
134 "Set war with largest enemy team",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
135 ""};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
136
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
137 /* useful for options that are an int with a range */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
138 struct int_range {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
139 int min_value; /* value is >= this */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
140 int max_value; /* value is <= this */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
141 int increment; /* a click raises/lowers this amount */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
142 /* do bitwise shift by 1 if increment */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
143 /* == -1 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
144 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
145
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
146
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
147 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
148 * Only one of op_option, op_targetwin, and op_string should be defined. If
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
149 * op_string is defined, op_size should be too and op_text is used without a
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
150 * "Don't" prefix. if op_range is defined, there should be a %d in op_text
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
151 * for it, op_size will be non-useful, and the 'Don't ' prefix won't appear
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
152 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
153 struct option {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
154 char *op_text; /* text to display when on */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
155 int *op_option; /* variable to test/modify (optional) */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
156 W_Window *op_targetwin; /* target window to map/unmap (optional) */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
157 char *op_string; /* string to modify (optional) */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
158 int op_size; /* size of *op_string (optional) */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
159 char **op_array; /* array of strings to switch between */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
160 struct int_range *op_range; /* struct definint an integer range option */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
161
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
162 int op_num; /* used internally */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
163 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
164
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
165 /* for the paged options menus */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
166 struct option_menu {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
167 int page_num; /* page number of this menu */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
168 struct option_menu *Next;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
169 struct option *menu; /* pointers to arrary of options */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
170 int numopt; /* number of options in this menu page */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
171 int updated; /* 1 if options can be changed externally */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
172 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
173
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
174 /* pointer to first entry in the options menu list */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
175 static
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
176 struct option_menu *FirstMenu = NULL;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
177 static
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
178 struct option_menu *CurrentMenu = NULL; /* menu currently looked at */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
179 int MenuPage = 1; /* current menu page */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
180 int MaxOptions = 0; /* maximum number of options in all menu
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
181 pages */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
182 struct int_range MenuPages =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
183 {1, 1, 1};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
184
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
185 /* range of updates for keep-info-window-up option */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
186 struct int_range keepInfo_range =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
187 {0, 100, 1};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
188
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
189 /* updates: use of the int range thing... */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
190 struct int_range updates_range =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
191 {1, 10, 1};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
192
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
193 struct int_range redraw_delay_range =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
194 {0, 10, 1};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
195
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
196 /* range of menus. Will be updated when menu list is assembled */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
197 struct int_range Menus_Range =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
198 {1, 1, 1};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
199
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
200 #ifdef CONTINUOUS_MOUSE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
201 struct int_range clickDelay_range =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
202 {0, 20, 1};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
203 #endif /* CONTINUOUS_MOUSE */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
204
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
205 #ifdef BEEPLITE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
206 struct int_range beeplite_planet_range =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
207 {0, 50, 1};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
208 struct int_range beeplite_player_range =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
209 {0, 50, 1};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
210 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
211
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
212 struct int_range zoom_override_range =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
213 {0, 99, 1};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
214
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
215 #ifdef LOCAL_SHIPSTATS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
216 struct int_range statHeight_range =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
217 {4,100, 4};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
218 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
219
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
220 /* range for tacPlanetInfo */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
221 struct int_range tacPlanetInfo_range = {0, 31, 1};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
222
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
223 /* menus */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
224
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
225 struct option Features_Menu[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
226 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
227 {"Defaults Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
228 {"Page %d (click here to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
229 {0, &mapmode, 0, 0, 0, mapupdates, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
230 {0, &showgalactic, 0, 0, 0, galacticmes, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
231 {0, &showlocal, 0, 0, 0, localmes, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
232 #ifdef SHOW_IND
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
233 {"show IND planets", &showIND, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
234 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
235 {"send MOTD bitmaps", &sendmotdbitmaps, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
236 {"reload ship bitmaps", &reloadShipBitmaps, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
237 {"stay peaceful when reborn", &keeppeace, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
238 {0, &remapAllShips, 0, 0, 0, keymapmes, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
239 {"new keymap entries: %s_", 0, 0, newkeys, 13, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
240 {"new ckeymap entries: %s_", 0, 0, newckeys, 13, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
241 {"new buttonmap entries: %s_", 0, 0, newbuttons, 13, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
242 {"new cbuttonmap entries: %s_", 0, 0, newcbuttons, 13, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
243 {"report kill messages", &reportKills, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
244 #if 0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
245 /* need to figure out how to dispatch options */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
246 {"recv variable packets", &recv_short, 0, 0, 0, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
247 {"recv kill messages", &recv_kmesg, 0, 0, 0, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
248 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
249 {"keep info %d upds (0=forever)", &keepInfo, 0, 0, 0, 0, &keepInfo_range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
250 {"%d updates per second", &updateSpeed, 0, 0, 0, 0, &updates_range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
251 {"%d/10 sec screen refresh delay", &redrawDelay, 0, 0, 0, 0, &redraw_delay_range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
252 {"collect ping stats", &ping, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
253 {"avoid message kludge", &niftyNewMessages, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
254 #ifdef CONTINUOUS_MOUSE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
255 {"use continuous mouse", &continuousMouse, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
256 {"%d updates repeat delay", &clickDelay, 0, 0, 0, 0, &clickDelay_range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
257 #endif /* CONTINUOUS_MOUSE */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
258 #ifdef UNIX_SOUND
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
259 {"play sound effects", &playSounds, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
260 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
261 {"done", &notdone, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
262 {NULL, 0, 0, 0, 0, NULL, NULL, /**/ -1}
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
263 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
264
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
265 struct option Window_Menu[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
266 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
267 {"Window Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
268 {"Page %d (click here to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
269 {"show \"all\" message window", 0, &messWin[WALL].window, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
270 {"show \"team\" message window", 0, &messWin[WTEAM].window, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
271 {"show \"your\" message window", 0, &messWin[WINDIV].window, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
272 {"show \"kill\" message window", 0, &messWin[WKILL].window, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
273 {"show \"phaser\" message window", 0, &messWin[WPHASER].window, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
274 {"show \"joined\" message window", 0, &messWin[WREVIEW].window, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
275 {"show ship statistics window", 0, &statwin, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
276 {"show network statistics window", 0, &pStats, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
277 {"show help window", 0, &helpWin, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
278 #ifdef XTREKRC_HELP
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
279 {"show xtrekrc defaults window", 0, &defWin, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
280 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
281 #ifdef TOOLS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
282 {"show shell tools window", 0, &toolsWin, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
283 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
284 {0, &showPhaser, 0, 0, 0, phaseroptions, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
285 {"", &showLock, 0, 0, 0, lockoptions, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
286 {"show lock line", &lockLine, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
287 {"sort planets by team", &mapSort, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
288 #ifdef NOWARP
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
289 {"enable message warp", &warp, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
290 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
291 {"use info icon", &infoIcon, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
292 {"done", &notdone, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
293 {NULL, 0, 0, 0, 0, NULL, NULL, /**/ -1}
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
294 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
295
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
296 struct option Display_Menu[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
297 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
298 {"Features Display Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
299 {"Page %d (click here to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
300 #ifdef ROTATERACE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
301 {0, &rotate, 0, 0, 0, rotatemess, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
302 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
303 {"draw background stars", &blk_showStars, 0, 0, 0, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
304 {"show warp/star streaks", &warpStreaks, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
305 {"show tractor/pressor", &showTractorPressor, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
306 {"show all tractors/pressors", &showAllTractorPressor, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
307 {"show shields", &showShields, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
308 {"show shield damage", &show_shield_dam, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
309 #ifdef VARY_HULL
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
310 {"show hull damage indicators", &vary_hull, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
311 #endif /* VARY_HULL */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
312
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
313 {"show tactical planet names", &namemode, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
314
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
315 {"zoom galactic map", &blk_zoom, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
316 {0,&autoZoom, 0, 0, 0, autoZoomOpts, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
317 {0,&autoUnZoom, 0, 0, 0, autoUnZoomOpts, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
318 {"Manual zoom overrides auto-zoom %d updates",&autoZoomOverride, 0, 0, 0, NULL,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
319 &zoom_override_range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
320 {"draw galactic map grid", &drawgrid, 0, 0, 0, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
321 {"show sector numbers", &sectorNums, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
322 {"show view box", &viewBox, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
323 {0, &autoSetWar, 0, 0, 0, autoSetWarOpts, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
324 {"show planet info on tactical: %d", &tacPlanetInfo, 0, 0, 0, 0, &tacPlanetInfo_range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
325 #ifdef BEEPLITE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
326 {"use RCD highlighting", &UseLite, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
327 {"highlight/use default RCDs", &DefLite, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
328 {"No. of updates to highlight player: %d", &beep_lite_cycle_time_player,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
329 0, 0, 0, NULL, &beeplite_player_range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
330 {"No. of updates to highlight planet: %d", &beep_lite_cycle_time_planet,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
331 0, 0, 0, NULL, &beeplite_planet_range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
332 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
333 {"done", &notdone, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
334 {NULL, 0, 0, 0, 0, NULL, NULL, /**/ -1}
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
335 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
336
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
337 struct option Playerdash_Menu[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
338 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
339 {"Playerlist/Dashboard Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
340 {"Page %d (click here to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
341 {"sort playerlist", &sortPlayers, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
342 {"show dead players in playerlist", &showDead, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
343 {"show players as they log in", &showPreLogins, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
344 {"hide 0.00 kills in playerlist", &hideNoKills, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
345 {"sort outfitting to bottom", &sortOutfitting, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
346 {0, &Dashboard, 0, 0, 0, dashboardoptions, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
347 #ifdef TIMER
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
348 {0, &timerType, 0, 0, 0, timermes, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
349 #endif /* TIMER */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
350 #ifdef LOCAL_SHIPSTATS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
351 {"show ship stats on local window",&localShipStats, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
352 {"Local ship stats height: %d",&statHeight, 0, 0, 0, NULL, &statHeight_range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
353 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
354 #ifdef PACKET_LIGHTS
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
355 {"show packet lights", &packetLights, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
356 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
357 {"keep phaser statistics", &phaserStats,0,0,0,NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
358 {"clear phaser statistics", &clearPhaserStats, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
359 {"done", &notdone, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
360 {NULL, 0, 0, 0, 0, NULL, NULL, /**/ -1}
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
361 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
362
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
363 #ifdef HOCKEY
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
364 struct option Hockey_Menu[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
365 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
366 {"Hockey Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
367 {"Page %d (click here to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
368 {"show tactical hockey lines", &tacticalHockeyLines, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
369 {"show galactic hockey lines", &galacticHockeyLines, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
370 {"show planets on the galactic", &cleanHockeyGalactic, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
371 {"color hockey lines by team", &teamColorHockeyLines, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
372 {"done", &notdone, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
373 {NULL, 0, 0, 0, 0, NULL, NULL, /**/ -1}
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
374 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
375 #endif /*HOCKEY*/
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
376
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
377 #if 0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
378 struct option Network_Menu[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
379 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
380 {"Network menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
381 {"Page %d (click here to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
382
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
383 {"done", &notdone, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
384 {NULL, 0, 0, 0, 0, NULL, NULL, /**/ -1}
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
385 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
386 #endif /* 0 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
387
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
388 #if 0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
389 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
390 "show shields", &showShields, 0, 0, 0, NULL, NULL
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
391 },
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
392 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
393 "show UDP control window", 0, &udpWin, 0, 0, NULL, NULL
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
394 },
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
395 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
396 "show short packets window", 0, &spWin, 0, 0, NULL, NULL
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
397 },
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
398 struct option SillyFeatures_Menu[] =
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
399 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
400 {"Silly Features Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
401 {"Page %d (click here to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
402 {"alert on extra border(s)", &extraBorder, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
403 #ifdef BORGTEST
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
404 {"borg torp test", &bd, 0, 0, 0, NULL, NULL}, /* BORG TEST */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
405 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
406 {"done", &notdone, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
407 {NULL, 0, 0, 0, 0, NULL, NULL, /**/ -1}
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
408 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
409 #endif /* 0 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
410
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
411 #ifdef AMIGA
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
412
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
413 static char *autopointmess[] = {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
414 "AutoPoint: none",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
415 "AutoPoint: Redirect input",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
416 "AutoPoint: Activate window on input",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
417 "AutoPoint: Full (inefficient)", ""
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
418 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
419
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
420 static char *dooshSoundMess[] = {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
421 "Play doosh sound when YOU kill a carrier",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
422 "Play doosh sound when ANY carrier dies",
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
423 ""
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
424 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
425
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
426 struct int_range soundVolRange = {0, 64, 4};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
427 struct int_range speechVolRange = {0, 64, 4};
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
428
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
429 extern int speechVol;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
430 extern int S_AddPeriod;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
431 extern int monoBitmaps;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
432
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
433 struct option Amiga_Menu[] = {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
434 {"Amiga Features Menu", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
435 {"Page %d (click to change)", &MenuPage, 0, 0, 0, NULL, &Menus_Range},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
436 {0, &autoPoint, 0, 0, 0, autopointmess, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
437 {"do keyboard window depth", &W_KeyDepth, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
438 {"use AnimPointers", &animPointers, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
439 {"use one color bitmaps", &monoBitmaps, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
440 {"use Workbench screen", &useWorkbench, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
441 {"speak messages to \"all\"", &S_SpeakAll, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
442 {"speak messages to you", &S_SpeakYour, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
443 {"speak messages to team", &S_SpeakTeam, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
444 {"speak \"kill\" messages", &S_SpeakKill, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
445 {"speak messages from God", &S_SpeakGod, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
446 {"speak messages from YOU", &S_SpeakSelf, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
447 {"speak login/out messages", &S_SpeakLogins, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
448 {"ignore repeated messages", &S_IgnoreMultiple, 0, 0, 0, 0, 0},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
449 {"add a period to the end of messages", &S_AddPeriod, 0, 0, 0, 0, 0},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
450 {"Speech volume: %d", &speechVol, 0, 0, 0, NULL, &speechVolRange},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
451 #ifdef SOUND
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
452 {"play digitized sounds", &soundOn, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
453 {"Sound volume: %d", &soundVol, 0, 0, 0, NULL, &soundVolRange},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
454 {"show sounds window", 0, &soundWin, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
455 {0, &alwaysSoundDoosh, 0, 0, 0, dooshSoundMess, 0},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
456 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
457 {"done", &notdone, 0, 0, 0, NULL, NULL},
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
458 {NULL, 0, 0, 0, 0, NULL, NULL, /**/ -1}
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
459 };
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
460
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
461 #endif /* AMIGA */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
462
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
463 #define NUMOPTIONS(menu) ((sizeof((menu))/sizeof((menu)[0]))-1)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
464
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
465
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
466 /* option menu sizes and such */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
467 #define OPTIONBORDER 2
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
468 #define OPTIONLEN 40
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
469
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
470 static void RefreshOptions P((void));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
471 static void SetMenuPage P((int pagenum));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
472 static int InitOptionMenus P((void));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
473 static void AddOptMenu P((struct option NewMenu[], int updated));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
474 static int NumOptions P((struct option OpMenu[]));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
475 /*static void UpdateOptions P((void));*/
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
476 void optionrefresh P((register struct option * op));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
477
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
478
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
479 /* Set up the option menus and window. */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
480 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
481 optionwindow()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
482 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
483 /* Init not done flag */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
484 notdone = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
485
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
486 old_ping = ping;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
487 old_rotate = rotate;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
488 old_rotate_deg = rotate_deg;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
489
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
490 *newkeys = '\0';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
491 *newckeys = '\0';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
492 *newbuttons = '\0';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
493 *newcbuttons = '\0';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
494 if (FirstMenu == NULL) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
495 if (!paradise) { /* remove the extra planet settings */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
496 localmes[3] = "";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
497 galacticmes[3] = "";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
498 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
499 MaxOptions = InitOptionMenus();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
500 if (MaxOptions < 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
501 fprintf(stderr, "InitOptionMenus() error %d!\n", MaxOptions);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
502 notdone = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
503 return;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
504 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
505 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
506 /* Create window big enough to hold option windows */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
507 if (optionWin == NULL) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
508
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
509 optionWin = W_MakeMenu("option", WINSIDE + 10, -BORDER + 10, OPTIONLEN,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
510 MaxOptions, baseWin, OPTIONBORDER);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
511 CurrentMenu = FirstMenu;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
512
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
513 RefreshOptions();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
514 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
515 W_ResizeMenu(optionWin, OPTIONLEN, CurrentMenu->numopt);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
516 /* Map window */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
517 W_MapWindow(optionWin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
518 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
519
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
520 /* refresh all current options */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
521 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
522 RefreshOptions()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
523 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
524 int i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
525 struct option_menu *option;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
526
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
527 if (notdone == 0 || (option = CurrentMenu) == NULL)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
528 return;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
529
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
530 for (i = 0; i < option->numopt; i++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
531 optionrefresh(&(option->menu[i]));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
532 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
533 #ifdef nodef /* if we resize, we don't need this */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
534 if (option->numopt < MaxOptions)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
535 for (i = option->numopt; i < MaxOptions; i++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
536 OptionClear(i);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
537 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
538 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
539 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
540
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
541 #ifdef nodef
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
542 /* blank out option line 'i' */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
543 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
544 OptionClear(i)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
545 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
546 char *blanktext = " ";
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
547 if (optionWin && notdone)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
548 W_WriteText(optionWin, 0, i, textColor, blanktext, OPTIONLEN, 0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
549 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
550 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
551
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
552 /* Redraw the specified option entry */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
553 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
554 optionredrawtarget(win)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
555 W_Window win;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
556 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
557 register struct option *op;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
558
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
559 #ifdef nodef
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
560 if (notdone == 0)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
561 return;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
562 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
563
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
564 for (op = CurrentMenu->menu; op->op_text; op++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
565 if (op->op_targetwin && win == *op->op_targetwin) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
566 optionrefresh(op);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
567 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
568 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
569 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
570 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
571
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
572 /* Redraw the specified option option */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
573 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
574 optionredrawoption(ip)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
575 int *ip;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
576 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
577 register struct option *op;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
578
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
579 #ifdef nodef
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
580 if (notdone == 0)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
581 return;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
582 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
583
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
584 for (op = CurrentMenu->menu; op->op_num >= 0; op++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
585 if (ip == op->op_option) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
586 optionrefresh(op);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
587 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
588 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
589 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
590 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
591
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
592 /* Refresh the option window given by the option struct */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
593 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
594 optionrefresh(op)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
595 register struct option *op;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
596 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
597 register int on;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
598 char buf[BUFSIZ];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
599
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
600 if (op == NULL || notdone == 0)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
601 return;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
602
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
603 if (op->op_string) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
604 (void) sprintf(buf, op->op_text, op->op_string);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
605 } else if (op->op_array) { /* Array of strings */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
606 strcpy(buf, op->op_array[*op->op_option]);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
607 } else if (op->op_range) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
608 (void) sprintf(buf, op->op_text, *(op->op_option));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
609 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
610 /* Either a boolean or a window */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
611 if (op->op_option)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
612 on = *op->op_option;/* use int for status */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
613 else if (op->op_targetwin)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
614 on = W_IsMapped(*op->op_targetwin); /* use window for status */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
615 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
616 on = 1; /* shouldn't happen */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
617
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
618 if (!on)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
619 strcpy(buf, "Don't ");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
620 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
621 buf[0] = '\0';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
622 strcat(buf, op->op_text);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
623 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
624
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
625 if (islower(buf[0]))
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
626 buf[0] = toupper(buf[0]);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
627
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
628 if (op->op_num == 0) { /* title */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
629 W_WriteText(optionWin, 0, op->op_num, W_Yellow, buf, strlen(buf), 0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
630 } else if (op->op_num == 1) { /* "click" entry */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
631 W_WriteText(optionWin, 0, op->op_num, W_Green, buf, strlen(buf), 0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
632 } else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
633 W_WriteText(optionWin, 0, op->op_num, textColor, buf, strlen(buf), 0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
634 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
635
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
636 /* deal with events sent to the option window */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
637 int
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
638 optionaction(data)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
639 W_Event *data;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
640 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
641 register struct option *op;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
642 int i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
643 register char *cp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
644
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
645 if (data->y >= CurrentMenu->numopt) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
646 W_Beep();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
647 return (0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
648 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
649 if (notdone == 0)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
650 return (0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
651
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
652 op = &(CurrentMenu->menu[data->y]);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
653
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
654 /* Update string; don't claim keystrokes for non-string options */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
655 /* deal with options with string input first */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
656 if (op->op_string == 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
657 if (data->type == W_EV_KEY)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
658 return (0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
659 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
660 if (data->type == W_EV_BUTTON)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
661 return (0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
662 switch (data->key) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
663
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
664 case '\b': /* delete character */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
665 case '\177':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
666 cp = op->op_string;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
667 i = strlen(cp);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
668 if (i > 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
669 cp += i - 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
670 *cp = '\0';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
671 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
672 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
673
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
674 case '\027': /* word erase */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
675 cp = op->op_string;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
676 i = strlen(cp);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
677 /* back up over blanks */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
678 while (--i >= 0 && isspace(cp[i]));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
679 i++;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
680 /* back up over non-blanks */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
681 while (--i >= 0 && !isspace(cp[i]));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
682 i++;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
683 cp[i] = '\0';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
684 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
685
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
686 case '\025': /* kill line */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
687 case '\030':
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
688 op->op_string[0] = '\0';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
689 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
690
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
691 default: /* add character to the list */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
692 if (data->key < 32 || data->key > 127)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
693 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
694 cp = op->op_string;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
695 i = strlen(cp);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
696 if (i < (op->op_size - 1) && !iscntrl(data->key)) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
697 cp += i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
698 cp[1] = '\0';
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
699 cp[0] = data->key;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
700 } else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
701 W_Beep();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
702 break;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
703 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
704 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
705
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
706 /* Toggle int, if it exists */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
707 if (op->op_array) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
708 if (data->key == W_LBUTTON) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
709 (*op->op_option)++;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
710 if (*(op->op_array)[*op->op_option] == '\0') {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
711 *op->op_option = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
712 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
713 } else if (data->key == W_MBUTTON) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
714 /* set option number to zero on the middle key to ease shutoff */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
715 *op->op_option = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
716 } else if (data->key == W_RBUTTON) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
717 /* if right button, decrease option */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
718 (*op->op_option)--;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
719 /* if decreased too far, set to top option */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
720 if (*(op->op_option) < 0) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
721 *op->op_option = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
722 while (*(op->op_array)[*op->op_option] != '\0') {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
723 (*op->op_option)++;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
724 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
725 (*op->op_option)--;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
726 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
727 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
728 if(op->op_option == &showgalactic)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
729 redrawall=1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
730 } else if (op->op_range) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
731 if (data->key == W_RBUTTON) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
732 if (op->op_range->increment == -1) /* bitwise shifts by 1 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
733 if (*op->op_option == 0)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
734 (*op->op_option) = op->op_range->max_value;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
735 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
736 (*op->op_option) = (*op->op_option) >> 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
737 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
738 (*op->op_option) -= op->op_range->increment;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
739 } else if (data->key == W_MBUTTON) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
740 (*op->op_option) = op->op_range->min_value;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
741 } else if (data->key == W_LBUTTON) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
742 if (op->op_range->increment == -1)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
743 if (*op->op_option == 0)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
744 (*op->op_option) = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
745 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
746 (*op->op_option) = (*op->op_option) << 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
747 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
748 (*op->op_option) += op->op_range->increment;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
749 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
750 /* wrap value around within option range */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
751 if (*(op->op_option) > op->op_range->max_value)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
752 *(op->op_option) = op->op_range->min_value;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
753 if (*(op->op_option) < op->op_range->min_value)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
754 *(op->op_option) = op->op_range->max_value;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
755 } else if (op->op_option) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
756 *op->op_option = !*op->op_option;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
757 if(op->op_option == &blk_zoom) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
758 if(!paradise) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
759 blk_zoom=0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
760 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
761 redrawall=1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
762 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
763 } else if((op->op_option == &blk_showStars) && !paradise)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
764 blk_showStars = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
765 else if((op->op_option == &drawgrid) ||
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
766 (op->op_option == &sectorNums))
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
767 redrawall=1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
768 else if(op->op_option == &clearPhaserStats) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
769 phasFired=phasHits=totalDmg=0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
770 clearPhaserStats=1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
771 warning("Phaser statistics reset!");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
772 } else if(op->op_option == &reloadShipBitmaps) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
773 free_shipshapes();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
774 slurp_ship_bitmaps();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
775 reloadShipBitmaps = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
776 warning("Read ship bitmaps");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
777 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
778 #ifdef AMIGA
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
779 else if(op->op_option == &useWorkbench) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
780 switchScreen();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
781 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
782 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
783 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
784 /* Map/unmap window, if it exists */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
785 if (op->op_targetwin) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
786 if (W_IsMapped(*op->op_targetwin)) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
787 if (*op->op_targetwin == udpWin)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
788 udpdone();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
789 else if (*op->op_targetwin == spWin)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
790 spdone();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
791 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
792 W_UnmapWindow(*op->op_targetwin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
793 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
794 if (*op->op_targetwin == udpWin)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
795 udpwindow();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
796 else if (*op->op_targetwin == spWin)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
797 spwindow();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
798 #ifdef SOUND
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
799 else if (*op->op_targetwin == soundWin)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
800 S_SoundWindow();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
801 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
802 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
803 W_MapWindow(*op->op_targetwin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
804 if (*op->op_targetwin == pStats)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
805 redrawPStats();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
806 #ifdef XTREKRC_HELP
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
807 if (*op->op_targetwin == defWin)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
808 showdef();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
809 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
810 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
811 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
812 /* deal with possible menu change */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
813 if (MenuPage != CurrentMenu->page_num) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
814 SetMenuPage(MenuPage);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
815 RefreshOptions();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
816 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
817 if (!notdone) /* if done, that is */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
818 optiondone();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
819 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
820 optionrefresh(op);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
821
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
822
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
823 return (1);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
824 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
825
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
826 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
827 * find the menu in the menus linked list that matches the one in the *
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
828 * argument
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
829 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
830 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
831 SetMenuPage(pagenum)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
832 int pagenum;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
833 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
834 int i = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
835 if (FirstMenu != NULL)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
836 for (CurrentMenu = FirstMenu; CurrentMenu->Next != NULL &&
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
837 CurrentMenu->page_num != pagenum; i++, CurrentMenu = CurrentMenu->Next);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
838 W_ResizeMenu(optionWin, OPTIONLEN, CurrentMenu->numopt);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
839 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
840
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
841 void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
842 optiondone()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
843 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
844 int shpn;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
845 struct ship *shp;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
846
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
847 /* Unmap window */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
848 W_UnmapWindow(optionWin);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
849
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
850 if(remapAllShips) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
851 for(shpn=0;shpn<nshiptypes;shpn++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
852 shp=getship(shpn);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
853 keymapAdd(newkeys, shp->s_keymap);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
854 ckeymapAdd(newckeys, shp->s_keymap);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
855 buttonmapAdd(newbuttons, shp->s_buttonmap);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
856 cbuttonmapAdd(newcbuttons, shp->s_buttonmap);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
857 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
858 } else { /* only affect current ship */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
859 /* update keymap and buttonmap [Bdyess] */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
860 keymapAdd(newkeys, myship->s_keymap);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
861 ckeymapAdd(newckeys, myship->s_keymap);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
862 buttonmapAdd(newbuttons, myship->s_buttonmap);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
863 cbuttonmapAdd(newcbuttons, myship->s_buttonmap);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
864 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
865
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
866 /* optionrefresh(&(option[KEYMAP])); Not sure why this is really needed */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
867
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
868 sendOptionsPacket(); /* update server as to the client's options */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
869
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
870 if (updateSpeed != lastUpdateSpeed) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
871 sendUpdatePacket(1000000 / updateSpeed);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
872 lastUpdateSpeed = updateSpeed;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
873 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
874 if (oldzoom != blk_zoom) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
875 redrawall = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
876 oldzoom = blk_zoom;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
877 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
878 if (ping != old_ping) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
879 old_ping = ping;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
880 if (ping)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
881 startPing();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
882 else
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
883 stopPing();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
884 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
885 #ifdef BEEPLITE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
886 if (DefLite)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
887 litedefaults();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
888 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
889
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
890 #ifdef ROTATERACE
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
891 if (rotate != old_rotate) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
892
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
893 rotate_all();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
894 #if 0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
895 register i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
896 register struct planet *l;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
897 int nplan = (paradise) ? nplanets : 40;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
898
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
899 redrawall = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
900 reinitPlanets = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
901
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
902 for (i = 0, l = planets; i < nplan; i++, l++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
903 if (rotate) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
904 rotate_deg = -old_rotate_deg + rotate * 64;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
905 rotate_coord(&l->pl_x, &l->pl_y, rotate_deg,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
906 blk_gwidth / 2, blk_gwidth / 2);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
907 rotate_deg = rotate * 64;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
908 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
909 rotate_deg = -old_rotate_deg;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
910 rotate_coord(&l->pl_x, &l->pl_y, rotate_deg,
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
911 blk_gwidth / 2, blk_gwidth / 2);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
912 rotate_deg = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
913 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
914 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
915 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
916 old_rotate = rotate;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
917 old_rotate_deg = rotate_deg;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
918
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
919 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
920 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
921 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
922
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
923 /* set up menus linked list */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
924 static int
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
925 InitOptionMenus()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
926 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
927 int i = 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
928 int maxopts = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
929
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
930 IFDEBUG(printf("Adding OptionMenus\n");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
931 )
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
932 /* AddOptMenu( &OptionsMenu, 0); */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
933 AddOptMenu(Features_Menu, 0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
934 AddOptMenu(Window_Menu, 0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
935 AddOptMenu(Display_Menu, 0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
936 AddOptMenu(Playerdash_Menu, 0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
937 #ifdef HOCKEY
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
938 AddOptMenu(Hockey_Menu, 0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
939 #endif /*HOCKEY*/
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
940 #ifdef AMIGA
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
941 AddOptMenu(Amiga_Menu, 0);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
942 #endif
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
943 /* AddOptMenu(SillyFeatures_Menu, 0); */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
944 /* AddOptMenu(Network_Menu, 0); */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
945
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
946 for (i = 1, CurrentMenu = FirstMenu; CurrentMenu != NULL;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
947 i++, CurrentMenu = CurrentMenu->Next) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
948 CurrentMenu->page_num = i; /* repage the menus.. */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
949 if (CurrentMenu->numopt > maxopts)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
950 maxopts = CurrentMenu->numopt;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
951 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
952 CurrentMenu = FirstMenu;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
953 Menus_Range.max_value = i - 1;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
954 IFDEBUG(printf("OptionMenus Added! Maxopt = %d \n", i);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
955 )
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
956 return maxopts;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
957 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
958
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
959 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
960 AddOptMenu(NewMenu, updated)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
961 struct option NewMenu[];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
962 int updated;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
963 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
964 struct option_menu *menuptr;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
965 struct option_menu *newmenu;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
966 int i = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
967
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
968 IFDEBUG(printf("AddOptMenu\n");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
969 )
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
970 menuptr = FirstMenu;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
971
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
972 newmenu = (struct option_menu *) malloc(sizeof(struct option_menu));
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
973 if (newmenu == NULL) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
974 perror("Malloc Error adding a menu");
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
975 return;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
976 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
977 /* add to list */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
978 if (FirstMenu == NULL) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
979 FirstMenu = newmenu;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
980 } else {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
981 for (i = 0, menuptr = FirstMenu; menuptr->Next != NULL; menuptr = menuptr->Next)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
982 i++;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
983 menuptr->Next = newmenu;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
984 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
985 newmenu->page_num = i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
986 newmenu->Next = NULL;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
987 newmenu->numopt = NumOptions(NewMenu);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
988 newmenu->menu = NewMenu;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
989 newmenu->updated = updated;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
990 IFDEBUG(printf("Menu Added! \n", i);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
991 )
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
992 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
993
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
994 static int
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
995 NumOptions(OpMenu)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
996 struct option OpMenu[];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
997 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
998 int i = 0;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
999 struct option *ptr;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1000
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1001 ptr = &OpMenu[0];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1002 for (i = 0; ptr->op_num != -1 && ptr->op_option != &notdone; i++) {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1003 IFDEBUG(printf("Option #%d..\n", i);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1004 )
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1005 IFDEBUG(if (ptr->op_text != NULL) printf("OP_Text:%s\n", ptr->op_text);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1006 )
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1007 ptr = &OpMenu[i];
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1008 ptr->op_num = i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1009 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1010
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1011 IFDEBUG(printf("NumOptions in this menu: %d\n", i);
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1012 )
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1013 return i;
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1014 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1015
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1016 /*
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1017 * a function that could be called regularly, to deal with menus that * might
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1018 * be updated by external events. I.e. the udp menu!
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1019 */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1020 #if 0
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1021 static void
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1022 UpdateOptions()
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1023 {
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1024 if (notdone == 0)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1025 return; /* don't update if menu isn't in use */
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1026 if (CurrentMenu->updated)
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1027 RefreshOptions();
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1028 }
5a977ccbc7a9 Empty changelog
darius
parents:
diff changeset
1029 #endif /* 0 */