Rev 885 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5 | Plagman | 1 | //------------------------------------------------------------------------- |
2 | /* |
||
484 | terminx | 3 | Copyright (C) 1996, 2003 - 3D Realms Entertainment |
4 | Copyright (C) 2000, 2003 - Matt Saettler (EDuke Enhancements) |
||
5 | Copyright (C) 2004, 2007 - EDuke32 developers |
||
5 | Plagman | 6 | |
7 | This file is part of EDuke32 |
||
8 | |||
9 | EDuke32 is free software; you can redistribute it and/or |
||
10 | modify it under the terms of the GNU General Public License version 2 |
||
11 | as published by the Free Software Foundation. |
||
12 | |||
13 | This program is distributed in the hope that it will be useful, |
||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
||
16 | |||
17 | See the GNU General Public License for more details. |
||
18 | |||
19 | You should have received a copy of the GNU General Public License |
||
20 | along with this program; if not, write to the Free Software |
||
21 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
||
22 | */ |
||
23 | //------------------------------------------------------------------------- |
||
24 | |||
25 | #include "duke3d.h" |
||
26 | #include "mouse.h" |
||
27 | #include "osd.h" |
||
28 | #include <sys/stat.h> |
||
29 | |||
30 | extern char inputloc; |
||
31 | extern int recfilep; |
||
32 | //extern char vgacompatible; |
||
432 | terminx | 33 | short globalskillsound=-1; |
482 | terminx | 34 | int probey=0; |
649 | terminx | 35 | static int lastsavehead=0,last_menu_pos=0,last_menu,sh,onbar,buttonstat; |
482 | terminx | 36 | static int last_zero,last_fifty,last_onehundred,last_twoohtwo,last_threehundred = 0; |
5 | Plagman | 37 | |
147 | terminx | 38 | static char menunamecnt; |
5 | Plagman | 39 | |
40 | static CACHE1D_FIND_REC *finddirs=NULL, *findfiles=NULL, *finddirshigh=NULL, *findfileshigh=NULL; |
||
41 | static int numdirs=0, numfiles=0; |
||
42 | static int currentlist=0; |
||
43 | |||
44 | static int function, whichkey; |
||
45 | static int changesmade, newvidmode, curvidmode, newfullscreen; |
||
337 | terminx | 46 | static int vidsets[16] = { -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1 }; |
47 | static int curvidset, newvidset = 0; |
||
5 | Plagman | 48 | |
478 | terminx | 49 | static char *mousebuttonnames[] = { "Left", "Right", "Middle", "Thumb", "Wheel Up", "Wheel Down" }; |
5 | Plagman | 50 | |
564 | terminx | 51 | extern int voting; |
147 | terminx | 52 | |
432 | terminx | 53 | void cmenu(int cm) |
5 | Plagman | 54 | { |
55 | current_menu = cm; |
||
56 | |||
333 | terminx | 57 | if ((cm >= 1000 && cm <= 1009)) |
5 | Plagman | 58 | return; |
59 | |||
333 | terminx | 60 | if (cm == 0) |
5 | Plagman | 61 | probey = last_zero; |
331 | terminx | 62 | else if (cm == 50) |
5 | Plagman | 63 | probey = last_fifty; |
331 | terminx | 64 | else if (cm == 100) |
5 | Plagman | 65 | probey = last_onehundred; |
331 | terminx | 66 | else if (cm == 202) |
69 | terminx | 67 | probey = last_twoohtwo; |
331 | terminx | 68 | else if (cm >= 300 && cm < 400) |
5 | Plagman | 69 | probey = last_threehundred; |
331 | terminx | 70 | else if (cm == 110) |
5 | Plagman | 71 | probey = 1; |
72 | else probey = 0; |
||
482 | terminx | 73 | lastsavehead = -1; |
5 | Plagman | 74 | } |
75 | |||
398 | terminx | 76 | #if 0 |
584 | terminx | 77 | void savetemp(char *fn,int daptr,int dasiz) |
5 | Plagman | 78 | { |
79 | FILE *fp; |
||
80 | |||
81 | if ((fp = fopen(fn,"wb")) == (FILE *)NULL) |
||
82 | return; |
||
83 | |||
84 | fwrite((char *)daptr,dasiz,1,fp); |
||
85 | |||
86 | fclose(fp); |
||
87 | } |
||
398 | terminx | 88 | #endif |
5 | Plagman | 89 | |
90 | #define LMB (buttonstat&1) |
||
91 | #define RMB (buttonstat&2) |
||
478 | terminx | 92 | #define WHEELUP (buttonstat&16) |
93 | #define WHEELDOWN (buttonstat&32) |
||
5 | Plagman | 94 | |
484 | terminx | 95 | static ControlInfo minfo; |
5 | Plagman | 96 | |
484 | terminx | 97 | static short mi, mii; |
5 | Plagman | 98 | |
99 | static int probe_(int type,int x,int y,int i,int n) |
||
100 | { |
||
101 | short centre, s; |
||
102 | |||
103 | s = 1+(CONTROL_GetMouseSensitivity()>>4); |
||
104 | |||
105 | { |
||
333 | terminx | 106 | CONTROL_GetInput(&minfo); |
484 | terminx | 107 | mi += (minfo.dpitch+minfo.dz); |
410 | terminx | 108 | mii += minfo.dyaw; |
5 | Plagman | 109 | } |
110 | |||
333 | terminx | 111 | if (x == (320>>1)) |
5 | Plagman | 112 | centre = 320>>2; |
113 | else centre = 0; |
||
114 | |||
410 | terminx | 115 | if (!buttonstat || buttonstat == 16 || buttonstat == 32) |
5 | Plagman | 116 | { |
408 | terminx | 117 | if (KB_KeyPressed(sc_UpArrow) || KB_KeyPressed(sc_PgUp) || KB_KeyPressed(sc_kpad_8) || mi < -8192 || WHEELUP) |
5 | Plagman | 118 | { |
411 | terminx | 119 | mi = mii = 0; |
333 | terminx | 120 | KB_ClearKeyDown(sc_UpArrow); |
121 | KB_ClearKeyDown(sc_kpad_8); |
||
122 | KB_ClearKeyDown(sc_PgUp); |
||
410 | terminx | 123 | MOUSE_ClearButton(WHEELUP_MOUSE); |
5 | Plagman | 124 | sound(KICK_HIT); |
125 | |||
126 | probey--; |
||
331 | terminx | 127 | if (probey < 0) probey = n-1; |
5 | Plagman | 128 | } |
411 | terminx | 129 | if (KB_KeyPressed(sc_DownArrow) || KB_KeyPressed(sc_PgDn) || KB_KeyPressed(sc_kpad_2) || mi > 8192 || WHEELDOWN) |
5 | Plagman | 130 | { |
411 | terminx | 131 | mi = mii = 0; |
333 | terminx | 132 | KB_ClearKeyDown(sc_DownArrow); |
133 | KB_ClearKeyDown(sc_kpad_2); |
||
134 | KB_ClearKeyDown(sc_PgDn); |
||
410 | terminx | 135 | MOUSE_ClearButton(WHEELDOWN_MOUSE); |
5 | Plagman | 136 | sound(KICK_HIT); |
137 | probey++; |
||
138 | } |
||
139 | } |
||
140 | |||
331 | terminx | 141 | if (probey >= n) |
5 | Plagman | 142 | probey = 0; |
143 | |||
331 | terminx | 144 | if (centre) |
5 | Plagman | 145 | { |
146 | // rotatesprite(((320>>1)+(centre)+54)<<16,(y+(probey*i)-4)<<16,65536L,0,SPINNINGNUKEICON+6-((6+(totalclock>>3))%7),sh,0,10,0,0,xdim-1,ydim-1); |
||
147 | // rotatesprite(((320>>1)-(centre)-54)<<16,(y+(probey*i)-4)<<16,65536L,0,SPINNINGNUKEICON+((totalclock>>3)%7),sh,0,10,0,0,xdim-1,ydim-1); |
||
148 | |||
149 | rotatesprite(((320>>1)+(centre>>1)+70)<<16,(y+(probey*i)-4)<<16,65536L>>type,0,SPINNINGNUKEICON+6-((6+(totalclock>>3))%7),sh,0,10,0,0,xdim-1,ydim-1); |
||
150 | rotatesprite(((320>>1)-(centre>>1)-70)<<16,(y+(probey*i)-4)<<16,65536L>>type,0,SPINNINGNUKEICON+((totalclock>>3)%7),sh,0,10,0,0,xdim-1,ydim-1); |
||
151 | } |
||
152 | else |
||
153 | rotatesprite((x<<16)-((tilesizx[BIGFNTCURSOR]-4)<<(16-type)),(y+(probey*i)-(4>>type))<<16,65536L>>type,0,SPINNINGNUKEICON+(((totalclock>>3))%7),sh,0,10,0,0,xdim-1,ydim-1); |
||
154 | |||
333 | terminx | 155 | if (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Enter) || (LMB && !onbar)) |
5 | Plagman | 156 | { |
331 | terminx | 157 | if (current_menu != 110) |
5 | Plagman | 158 | sound(PISTOL_BODYHIT); |
333 | terminx | 159 | KB_ClearKeyDown(sc_Enter); |
160 | KB_ClearKeyDown(sc_Space); |
||
161 | KB_ClearKeyDown(sc_kpad_Enter); |
||
410 | terminx | 162 | MOUSE_ClearButton(LEFT_MOUSE); |
5 | Plagman | 163 | return(probey); |
164 | } |
||
333 | terminx | 165 | else if (KB_KeyPressed(sc_Escape) || (RMB)) |
5 | Plagman | 166 | { |
167 | onbar = 0; |
||
333 | terminx | 168 | KB_ClearKeyDown(sc_Escape); |
5 | Plagman | 169 | sound(EXITMENUSOUND); |
428 | terminx | 170 | MOUSE_ClearButton(RIGHT_MOUSE); |
5 | Plagman | 171 | return(-1); |
172 | } |
||
173 | else |
||
174 | { |
||
331 | terminx | 175 | if (onbar == 0) return(-probey-2); |
424 | terminx | 176 | if (KB_KeyPressed(sc_LeftArrow) || KB_KeyPressed(sc_kpad_4) || ((buttonstat&1) && (WHEELUP || mii < -256))) |
5 | Plagman | 177 | return(probey); |
424 | terminx | 178 | else if (KB_KeyPressed(sc_RightArrow) || KB_KeyPressed(sc_kpad_6) || ((buttonstat&1) && (WHEELDOWN || mii > 256))) |
5 | Plagman | 179 | return(probey); |
419 | terminx | 180 | return(-probey-2); |
5 | Plagman | 181 | } |
182 | } |
||
398 | terminx | 183 | static inline int probe(int x,int y,int i,int n) |
335 | terminx | 184 | { |
185 | return probe_(0,x,y,i,n); |
||
186 | } |
||
398 | terminx | 187 | |
188 | static inline int probesm(int x,int y,int i,int n) |
||
335 | terminx | 189 | { |
190 | return probe_(1,x,y,i,n); |
||
191 | } |
||
5 | Plagman | 192 | |
398 | terminx | 193 | static int menutext_(int x,int y,short s,short p,char *t) |
5 | Plagman | 194 | { |
195 | short i, ac, centre; |
||
196 | |||
197 | y -= 12; |
||
198 | |||
199 | i = centre = 0; |
||
200 | |||
333 | terminx | 201 | if (x == (320>>1)) |
5 | Plagman | 202 | { |
333 | terminx | 203 | while (*(t+i)) |
5 | Plagman | 204 | { |
331 | terminx | 205 | if (*(t+i) == ' ') |
5 | Plagman | 206 | { |
207 | centre += 5; |
||
208 | i++; |
||
209 | continue; |
||
210 | } |
||
211 | ac = 0; |
||
331 | terminx | 212 | if (*(t+i) >= '0' && *(t+i) <= '9') |
5 | Plagman | 213 | ac = *(t+i) - '0' + BIGALPHANUM-10; |
331 | terminx | 214 | else if (*(t+i) >= 'a' && *(t+i) <= 'z') |
5 | Plagman | 215 | ac = toupper(*(t+i)) - 'A' + BIGALPHANUM; |
331 | terminx | 216 | else if (*(t+i) >= 'A' && *(t+i) <= 'Z') |
5 | Plagman | 217 | ac = *(t+i) - 'A' + BIGALPHANUM; |
331 | terminx | 218 | else switch (*(t+i)) |
5 | Plagman | 219 | { |
337 | terminx | 220 | case '-': |
221 | ac = BIGALPHANUM-11; |
||
222 | break; |
||
223 | case '.': |
||
224 | ac = BIGPERIOD; |
||
225 | break; |
||
226 | case '\'': |
||
227 | ac = BIGAPPOS; |
||
228 | break; |
||
229 | case ',': |
||
230 | ac = BIGCOMMA; |
||
231 | break; |
||
232 | case '!': |
||
233 | ac = BIGX; |
||
234 | break; |
||
235 | case '?': |
||
236 | ac = BIGQ; |
||
237 | break; |
||
238 | case ';': |
||
239 | ac = BIGSEMI; |
||
240 | break; |
||
241 | case ':': |
||
242 | ac = BIGSEMI; |
||
243 | break; |
||
244 | default: |
||
245 | centre += 5; |
||
246 | i++; |
||
247 | continue; |
||
335 | terminx | 248 | } |
249 | |||
250 | centre += tilesizx[ac]-1; |
||
251 | i++; |
||
252 | } |
||
253 | } |
||
254 | |||
255 | if (centre) |
||
256 | x = (320-centre-10)>>1; |
||
257 | |||
258 | while (*t) |
||
259 | { |
||
260 | if (*t == ' ') |
||
261 | { |
||
262 | x+=5; |
||
263 | t++; |
||
264 | continue; |
||
265 | } |
||
266 | ac = 0; |
||
267 | if (*t >= '0' && *t <= '9') |
||
268 | ac = *t - '0' + BIGALPHANUM-10; |
||
269 | else if (*t >= 'a' && *t <= 'z') |
||
270 | ac = toupper(*t) - 'A' + BIGALPHANUM; |
||
271 | else if (*t >= 'A' && *t <= 'Z') |
||
272 | ac = *t - 'A' + BIGALPHANUM; |
||
273 | else switch (*t) |
||
274 | { |
||
337 | terminx | 275 | case '-': |
276 | ac = BIGALPHANUM-11; |
||
277 | break; |
||
278 | case '.': |
||
279 | ac = BIGPERIOD; |
||
280 | break; |
||
281 | case ',': |
||
282 | ac = BIGCOMMA; |
||
283 | break; |
||
284 | case '!': |
||
285 | ac = BIGX; |
||
286 | break; |
||
287 | case '\'': |
||
288 | ac = BIGAPPOS; |
||
289 | break; |
||
290 | case '?': |
||
291 | ac = BIGQ; |
||
292 | break; |
||
293 | case ';': |
||
294 | ac = BIGSEMI; |
||
295 | break; |
||
296 | case ':': |
||
297 | ac = BIGCOLIN; |
||
298 | break; |
||
299 | default: |
||
300 | x += 5; |
||
301 | t++; |
||
302 | continue; |
||
5 | Plagman | 303 | } |
304 | |||
305 | rotatesprite(x<<16,y<<16,65536L,0,ac,s,p,10+16,0,0,xdim-1,ydim-1); |
||
306 | |||
307 | x += tilesizx[ac]; |
||
308 | t++; |
||
309 | } |
||
310 | return (x); |
||
311 | } |
||
312 | |||
509 | terminx | 313 | inline int menutext(int x,int y,int s,int p,const char *t) |
152 | terminx | 314 | { |
437 | terminx | 315 | return(menutext_(x,y,s,p,(char *)stripcolorcodes(t))); |
152 | terminx | 316 | } |
317 | |||
877 | terminx | 318 | static void _bar(int type, int x,int y,int *p,int dainc,int damodify,int s, int pa, int min, int max) |
5 | Plagman | 319 | { |
877 | terminx | 320 | int xloc; |
5 | Plagman | 321 | char rev; |
322 | |||
335 | terminx | 323 | if (dainc < 0) |
324 | { |
||
325 | dainc = -dainc; |
||
326 | rev = 1; |
||
327 | } |
||
5 | Plagman | 328 | else rev = 0; |
329 | y-=2; |
||
330 | |||
331 | terminx | 331 | if (damodify) |
5 | Plagman | 332 | { |
331 | terminx | 333 | if (rev == 0) |
5 | Plagman | 334 | { |
877 | terminx | 335 | if (*p > min && (KB_KeyPressed(sc_LeftArrow) || KB_KeyPressed(sc_kpad_4) || ((buttonstat&1) && (WHEELUP || mii < -256)))) // && onbar) ) |
5 | Plagman | 336 | { |
333 | terminx | 337 | KB_ClearKeyDown(sc_LeftArrow); |
338 | KB_ClearKeyDown(sc_kpad_4); |
||
424 | terminx | 339 | MOUSE_ClearButton(WHEELUP_MOUSE); |
410 | terminx | 340 | mii = 0; |
5 | Plagman | 341 | *p -= dainc; |
877 | terminx | 342 | if (*p < min) |
343 | *p = min; |
||
5 | Plagman | 344 | sound(KICK_HIT); |
345 | } |
||
877 | terminx | 346 | if (*p < max && (KB_KeyPressed(sc_RightArrow) || KB_KeyPressed(sc_kpad_6) || ((buttonstat&1) && (WHEELDOWN || mii > 256)))) //&& onbar) ) |
5 | Plagman | 347 | { |
333 | terminx | 348 | KB_ClearKeyDown(sc_RightArrow); |
349 | KB_ClearKeyDown(sc_kpad_6); |
||
424 | terminx | 350 | MOUSE_ClearButton(WHEELDOWN_MOUSE); |
428 | terminx | 351 | mii = 0; |
5 | Plagman | 352 | *p += dainc; |
877 | terminx | 353 | if (*p > max) |
354 | *p = max; |
||
5 | Plagman | 355 | sound(KICK_HIT); |
356 | } |
||
357 | } |
||
358 | else |
||
359 | { |
||
877 | terminx | 360 | if (*p > min && (KB_KeyPressed(sc_RightArrow) || KB_KeyPressed(sc_kpad_6) || ((buttonstat&1) && minfo.dyaw > 256))) //&& onbar) ) |
5 | Plagman | 361 | { |
333 | terminx | 362 | KB_ClearKeyDown(sc_RightArrow); |
363 | KB_ClearKeyDown(sc_kpad_6); |
||
5 | Plagman | 364 | |
365 | *p -= dainc; |
||
877 | terminx | 366 | if (*p < min) |
367 | *p = min; |
||
5 | Plagman | 368 | sound(KICK_HIT); |
369 | } |
||
333 | terminx | 370 | if (*p < 64 && (KB_KeyPressed(sc_LeftArrow) || KB_KeyPressed(sc_kpad_4) || ((buttonstat&1) && minfo.dyaw < -256))) // && onbar) ) |
5 | Plagman | 371 | { |
333 | terminx | 372 | KB_ClearKeyDown(sc_LeftArrow); |
373 | KB_ClearKeyDown(sc_kpad_4); |
||
5 | Plagman | 374 | |
375 | *p += dainc; |
||
877 | terminx | 376 | if (*p > max) |
377 | *p = max; |
||
5 | Plagman | 378 | sound(KICK_HIT); |
379 | } |
||
380 | } |
||
381 | } |
||
382 | |||
383 | xloc = *p; |
||
333 | terminx | 384 | rotatesprite((x<<16)+(22<<(16-type)),(y<<16)-(3<<(16-type)),65536L>>type,0,SLIDEBAR,s,pa,10,0,0,xdim-1,ydim-1); |
331 | terminx | 385 | if (rev == 0) |
877 | terminx | 386 | rotatesprite((x<<16)+((scale(64,xloc-min,max-min)+1)<<(16-type)),(y<<16)+(1<<(16-type)),65536L>>type,0,SLIDEBAR+1,s,pa,10,0,0,xdim-1,ydim-1); |
5 | Plagman | 387 | else |
877 | terminx | 388 | rotatesprite((x<<16)+((65-scale(64,xloc-min,max-min))<<(16-type)),(y<<16)+(1<<(16-type)),65536L>>type,0,SLIDEBAR+1,s,pa,10,0,0,xdim-1,ydim-1); |
5 | Plagman | 389 | } |
390 | |||
877 | terminx | 391 | #define bar(x,y,p,dainc,damodify,s,pa) _bar(0,x,y,p,dainc,damodify,s,pa,0,63); |
392 | #define barsm(x,y,p,dainc,damodify,s,pa) _bar(1,x,y,p,dainc,damodify,s,pa,0,63); |
||
5 | Plagman | 393 | |
509 | terminx | 394 | static void modval(int min, int max,int *p,int dainc,int damodify) |
5 | Plagman | 395 | { |
396 | char rev; |
||
397 | |||
335 | terminx | 398 | if (dainc < 0) |
399 | { |
||
400 | dainc = -dainc; |
||
401 | rev = 1; |
||
402 | } |
||
5 | Plagman | 403 | else rev = 0; |
404 | |||
331 | terminx | 405 | if (damodify) |
5 | Plagman | 406 | { |
331 | terminx | 407 | if (rev == 0) |
5 | Plagman | 408 | { |
333 | terminx | 409 | if (KB_KeyPressed(sc_LeftArrow) || KB_KeyPressed(sc_kpad_4) || ((buttonstat&1) && minfo.dyaw < -256)) // && onbar) ) |
5 | Plagman | 410 | { |
333 | terminx | 411 | KB_ClearKeyDown(sc_LeftArrow); |
412 | KB_ClearKeyDown(sc_kpad_4); |
||
5 | Plagman | 413 | |
414 | *p -= dainc; |
||
331 | terminx | 415 | if (*p < min) |
509 | terminx | 416 | { |
511 | terminx | 417 | *p = max; |
509 | terminx | 418 | if (damodify == 2) |
419 | *p = min; |
||
511 | terminx | 420 | } |
5 | Plagman | 421 | sound(PISTOL_BODYHIT); |
422 | } |
||
333 | terminx | 423 | if (KB_KeyPressed(sc_RightArrow) || KB_KeyPressed(sc_kpad_6) || ((buttonstat&1) && minfo.dyaw > 256)) //&& onbar) ) |
5 | Plagman | 424 | { |
333 | terminx | 425 | KB_ClearKeyDown(sc_RightArrow); |
426 | KB_ClearKeyDown(sc_kpad_6); |
||
5 | Plagman | 427 | |
428 | *p += dainc; |
||
331 | terminx | 429 | if (*p > max) |
509 | terminx | 430 | { |
511 | terminx | 431 | *p = min; |
509 | terminx | 432 | if (damodify == 2) |
433 | *p = max; |
||
511 | terminx | 434 | } |
5 | Plagman | 435 | sound(PISTOL_BODYHIT); |
436 | } |
||
437 | } |
||
438 | else |
||
439 | { |
||
333 | terminx | 440 | if (KB_KeyPressed(sc_RightArrow) || KB_KeyPressed(sc_kpad_6) || ((buttonstat&1) && minfo.dyaw > 256)) //&& onbar )) |
5 | Plagman | 441 | { |
333 | terminx | 442 | KB_ClearKeyDown(sc_RightArrow); |
443 | KB_ClearKeyDown(sc_kpad_6); |
||
5 | Plagman | 444 | |
445 | *p -= dainc; |
||
331 | terminx | 446 | if (*p < min) |
509 | terminx | 447 | { |
511 | terminx | 448 | *p = max; |
509 | terminx | 449 | if (damodify == 2) |
450 | *p = min; |
||
511 | terminx | 451 | } |
5 | Plagman | 452 | sound(PISTOL_BODYHIT); |
453 | } |
||
333 | terminx | 454 | if (KB_KeyPressed(sc_LeftArrow) || KB_KeyPressed(sc_kpad_4) || ((buttonstat&1) && minfo.dyaw < -256)) // && onbar) ) |
5 | Plagman | 455 | { |
333 | terminx | 456 | KB_ClearKeyDown(sc_LeftArrow); |
457 | KB_ClearKeyDown(sc_kpad_4); |
||
5 | Plagman | 458 | |
459 | *p += dainc; |
||
331 | terminx | 460 | if (*p > max) |
509 | terminx | 461 | { |
511 | terminx | 462 | *p = min; |
509 | terminx | 463 | if (damodify == 2) |
464 | *p = max; |
||
511 | terminx | 465 | } |
5 | Plagman | 466 | sound(PISTOL_BODYHIT); |
467 | } |
||
468 | } |
||
469 | } |
||
470 | } |
||
471 | |||
482 | terminx | 472 | #define UNSELMENUSHADE 10 |
473 | #define DISABLEDMENUSHADE 20 |
||
474 | #define MENUHIGHLIGHT(x) probey==x?-(sintable[(totalclock<<4)&2047]>>12):UNSELMENUSHADE |
||
78 | terminx | 475 | // #define MENUHIGHLIGHT(x) probey==x?-(sintable[(totalclock<<4)&2047]>>12):probey-x>=0?(probey-x)<<2:-((probey-x)<<2) |
476 | |||
5 | Plagman | 477 | #define SHX(X) 0 |
478 | // ((x==X)*(-sh)) |
||
479 | #define PHX(X) 0 |
||
480 | // ((x==X)?1:2) |
||
481 | #define MWIN(X) rotatesprite( 320<<15,200<<15,X,0,MENUSCREEN,-16,0,10+64,0,0,xdim-1,ydim-1) |
||
482 | #define MWINXY(X,OX,OY) rotatesprite( ( 320+(OX) )<<15, ( 200+(OY) )<<15,X,0,MENUSCREEN,-16,0,10+64,0,0,xdim-1,ydim-1) |
||
483 | |||
484 | extern int loadpheader(char spot,struct savehead *saveh); |
||
485 | |||
486 | static struct savehead savehead; |
||
487 | //static int32 volnum,levnum,plrskl,numplr; |
||
488 | //static char brdfn[BMAX_PATH]; |
||
432 | terminx | 489 | int lastsavedpos = -1; |
5 | Plagman | 490 | |
398 | terminx | 491 | static void dispnames(void) |
5 | Plagman | 492 | { |
432 | terminx | 493 | int x, c = 160; |
5 | Plagman | 494 | |
495 | c += 64; |
||
331 | terminx | 496 | for (x = 0;x <= 108;x += 12) |
5 | Plagman | 497 | rotatesprite((c+91-64)<<16,(x+56)<<16,65536L,0,TEXTBOX,24,0,10,0,0,xdim-1,ydim-1); |
498 | |||
499 | rotatesprite(22<<16,97<<16,65536L,0,WINDOWBORDER2,24,0,10,0,0,xdim-1,ydim-1); |
||
500 | rotatesprite(180<<16,97<<16,65536L,1024,WINDOWBORDER2,24,0,10,0,0,xdim-1,ydim-1); |
||
501 | rotatesprite(99<<16,50<<16,65536L,512,WINDOWBORDER1,24,0,10,0,0,xdim-1,ydim-1); |
||
502 | rotatesprite(103<<16,144<<16,65536L,1024+512,WINDOWBORDER1,24,0,10,0,0,xdim-1,ydim-1); |
||
503 | |||
504 | for (x=0;x<=9;x++) |
||
505 | minitext(c,48+(12*x),ud.savegame[x],2,10+16); |
||
506 | } |
||
507 | |||
428 | terminx | 508 | static void clearfilenames(void) |
5 | Plagman | 509 | { |
510 | klistfree(finddirs); |
||
511 | klistfree(findfiles); |
||
512 | finddirs = findfiles = NULL; |
||
513 | numfiles = numdirs = 0; |
||
514 | } |
||
515 | |||
438 | terminx | 516 | static int getfilenames(const char *path, char kind[]) |
5 | Plagman | 517 | { |
518 | CACHE1D_FIND_REC *r; |
||
519 | |||
520 | clearfilenames(); |
||
521 | finddirs = klistpath(path,"*",CACHE1D_FIND_DIR); |
||
522 | findfiles = klistpath(path,kind,CACHE1D_FIND_FILE); |
||
523 | for (r = finddirs; r; r=r->next) numdirs++; |
||
524 | for (r = findfiles; r; r=r->next) numfiles++; |
||
525 | |||
526 | finddirshigh = finddirs; |
||
527 | findfileshigh = findfiles; |
||
528 | currentlist = 0; |
||
529 | if (findfileshigh) currentlist = 1; |
||
530 | |||
531 | return(0); |
||
532 | } |
||
533 | |||
584 | terminx | 534 | int quittimer = 0; |
5 | Plagman | 535 | |
879 | terminx | 536 | void check_valid_color(int *color, int prev_color) |
59 | terminx | 537 | { |
538 | int i, disallowed[] = { 1, 2, 3, 4, 5, 6, 7, 8, 17, 18, 19, 20, 22 }; |
||
539 | |||
335 | terminx | 540 | for (i=0;i<(signed)(sizeof(disallowed)/sizeof(disallowed[0]));i++) |
541 | { |
||
542 | while (*color == disallowed[i]) |
||
543 | { |
||
331 | terminx | 544 | if (*color > prev_color) |
59 | terminx | 545 | (*color)++; |
546 | else (*color)--; |
||
547 | i=0; |
||
548 | } |
||
549 | } |
||
550 | } |
||
551 | |||
77 | terminx | 552 | void sendquit(void) |
553 | { |
||
333 | terminx | 554 | if (gamequit == 0 && (numplayers > 1)) |
77 | terminx | 555 | { |
564 | terminx | 556 | if (g_player[myconnectindex].ps->gm&MODE_GAME) |
77 | terminx | 557 | { |
558 | gamequit = 1; |
||
559 | quittimer = totalclock+120; |
||
560 | } |
||
561 | else |
||
562 | { |
||
438 | terminx | 563 | int i; |
471 | terminx | 564 | |
77 | terminx | 565 | tempbuf[0] = 254; |
566 | tempbuf[1] = myconnectindex; |
||
567 | |||
331 | terminx | 568 | for (i=connecthead;i >= 0;i=connectpoint2[i]) |
77 | terminx | 569 | { |
570 | if (i != myconnectindex) sendpacket(i,tempbuf,2); |
||
571 | if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master |
||
572 | } |
||
573 | gameexit(" "); |
||
574 | } |
||
575 | } |
||
333 | terminx | 576 | else if (numplayers < 2) |
77 | terminx | 577 | gameexit(" "); |
578 | |||
333 | terminx | 579 | if ((totalclock > quittimer) && (gamequit == 1)) |
77 | terminx | 580 | gameexit("Timed out."); |
581 | } |
||
582 | |||
5 | Plagman | 583 | void menus(void) |
584 | { |
||
585 | CACHE1D_FIND_REC *dir; |
||
432 | terminx | 586 | int c,x,i; |
584 | terminx | 587 | int l,m; |
5 | Plagman | 588 | char *p = NULL; |
589 | |||
590 | getpackets(); |
||
591 | |||
592 | { |
||
331 | terminx | 593 | if (buttonstat != 0 && !onbar) |
5 | Plagman | 594 | { |
595 | x = MOUSE_GetButtons()<<3; |
||
333 | terminx | 596 | if (x) buttonstat = x<<3; |
5 | Plagman | 597 | else buttonstat = 0; |
598 | } |
||
599 | else |
||
600 | buttonstat = MOUSE_GetButtons(); |
||
601 | } |
||
602 | |||
564 | terminx | 603 | if ((g_player[myconnectindex].ps->gm&MODE_MENU) == 0) |
5 | Plagman | 604 | { |
605 | walock[TILE_LOADSHOT] = 1; |
||
606 | return; |
||
607 | } |
||
763 | terminx | 608 | OnEvent(EVENT_DISPLAYMENU, g_player[screenpeek].ps->i, screenpeek, -1); |
5 | Plagman | 609 | |
564 | terminx | 610 | g_player[myconnectindex].ps->gm &= (0xff-MODE_TYPE); |
611 | g_player[myconnectindex].ps->fta = 0; |
||
5 | Plagman | 612 | |
613 | x = 0; |
||
614 | |||
615 | sh = 4-(sintable[(totalclock<<4)&2047]>>11); |
||
471 | terminx | 616 | |
331 | terminx | 617 | if (bpp > 8) |
5 | Plagman | 618 | { |
626 | terminx | 619 | int x,y=0; |
620 | for (;y<ydim;y+=tilesizy[BIGHOLE]) |
||
331 | terminx | 621 | for (x=0;x<xdim;x+=tilesizx[BIGHOLE]) |
5 | Plagman | 622 | rotatesprite(x<<16,y<<16,65536L,0,BIGHOLE,80,0,1+8+16,0,0,xdim-1,ydim-1); |
623 | } |
||
471 | terminx | 624 | |
331 | terminx | 625 | if (!(current_menu >= 1000 && current_menu <= 2999 && current_menu >= 300 && current_menu <= 369)) |
5 | Plagman | 626 | vscrn(); |
627 | |||
438 | terminx | 628 | if (KB_KeyPressed(sc_Q)) |
75 | terminx | 629 | { |
438 | terminx | 630 | switch (current_menu) |
631 | { |
||
625 | terminx | 632 | case 102: |
438 | terminx | 633 | case 210: |
634 | case 360: |
||
635 | case 361: |
||
636 | case 362: |
||
637 | case 363: |
||
638 | case 364: |
||
639 | case 365: |
||
640 | case 366: |
||
641 | case 367: |
||
642 | case 368: |
||
643 | case 369: |
||
644 | case 500: |
||
645 | case 501: |
||
646 | case 502: |
||
647 | case 603: |
||
471 | terminx | 648 | case 10001: |
438 | terminx | 649 | case 20003: |
650 | case 20005: |
||
651 | break; |
||
652 | default: |
||
653 | if (current_menu >= 0) |
||
654 | { |
||
655 | last_menu = current_menu; |
||
482 | terminx | 656 | last_menu_pos = probey; |
438 | terminx | 657 | cmenu(502); |
658 | } |
||
659 | break; |
||
660 | } |
||
75 | terminx | 661 | } |
471 | terminx | 662 | |
331 | terminx | 663 | switch (current_menu) |
5 | Plagman | 664 | { |
337 | terminx | 665 | case 25000: |
666 | gametext(160,90,"SELECT A SAVE SPOT BEFORE",0,2+8+16); |
||
667 | gametext(160,90+9,"YOU QUICK RESTORE.",0,2+8+16); |
||
5 | Plagman | 668 | |
411 | terminx | 669 | x = probe(186,124,0,1); |
337 | terminx | 670 | if (x >= -1) |
671 | { |
||
672 | if (ud.multimode < 2 && ud.recstat != 2) |
||
5 | Plagman | 673 | { |
337 | terminx | 674 | ready2send = 1; |
675 | totalclock = ototalclock; |
||
5 | Plagman | 676 | } |
564 | terminx | 677 | g_player[myconnectindex].ps->gm &= ~MODE_MENU; |
337 | terminx | 678 | } |
679 | break; |
||
5 | Plagman | 680 | |
337 | terminx | 681 | case 20000: |
411 | terminx | 682 | x = probe(326,190,0,1); |
337 | terminx | 683 | gametext(160,50-8,"YOU ARE PLAYING THE SHAREWARE",0,2+8+16); |
684 | gametext(160,59-8,"VERSION OF DUKE NUKEM 3D. WHILE",0,2+8+16); |
||
685 | gametext(160,68-8,"THIS VERSION IS REALLY COOL, YOU",0,2+8+16); |
||
686 | gametext(160,77-8,"ARE MISSING OVER 75%% OF THE TOTAL",0,2+8+16); |
||
687 | gametext(160,86-8,"GAME, ALONG WITH OTHER GREAT EXTRAS",0,2+8+16); |
||
688 | gametext(160,95-8,"AND GAMES, WHICH YOU'LL GET WHEN",0,2+8+16); |
||
689 | gametext(160,104-8,"YOU ORDER THE COMPLETE VERSION AND",0,2+8+16); |
||
690 | gametext(160,113-8,"GET THE FINAL TWO EPISODES.",0,2+8+16); |
||
5 | Plagman | 691 | |
337 | terminx | 692 | gametext(160,113+8,"PLEASE READ THE 'HOW TO ORDER' ITEM",0,2+8+16); |
693 | gametext(160,122+8,"ON THE MAIN MENU IF YOU WISH TO",0,2+8+16); |
||
694 | gametext(160,131+8,"UPGRADE TO THE FULL REGISTERED",0,2+8+16); |
||
695 | gametext(160,140+8,"VERSION OF DUKE NUKEM 3D.",0,2+8+16); |
||
696 | gametext(160,149+16,"PRESS ANY KEY...",0,2+8+16); |
||
5 | Plagman | 697 | |
337 | terminx | 698 | if (x >= -1) cmenu(100); |
699 | break; |
||
5 | Plagman | 700 | |
337 | terminx | 701 | case 20001: |
702 | rotatesprite(160<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); |
||
703 | menutext(160,24,0,0,"NETWORK GAME"); |
||
5 | Plagman | 704 | |
337 | terminx | 705 | x = probe(160,100-18,18,3); |
5 | Plagman | 706 | |
337 | terminx | 707 | if (x == -1) cmenu(0); |
708 | else if (x == 2) cmenu(20010); |
||
709 | else if (x == 1) cmenu(20020); |
||
710 | else if (x == 0) cmenu(20002); |
||
5 | Plagman | 711 | |
337 | terminx | 712 | menutext(160,100-18,MENUHIGHLIGHT(0),0,"PLAYER SETUP"); |
713 | menutext(160,100,MENUHIGHLIGHT(1),0,"JOIN GAME"); |
||
714 | menutext(160,100+18,MENUHIGHLIGHT(2),0,"HOST GAME"); |
||
715 | break; |
||
5 | Plagman | 716 | |
337 | terminx | 717 | case 20002: |
718 | case 20003: |
||
719 | rotatesprite(160<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); |
||
720 | menutext(160,24,0,0,"PLAYER SETUP"); |
||
471 | terminx | 721 | c = (320>>1)-120; |
337 | terminx | 722 | { |
471 | terminx | 723 | int io, ii, yy = 37, d=c+140, enabled; |
559 | terminx | 724 | char *opts[] = |
725 | { |
||
726 | "Name", |
||
727 | "-", |
||
728 | "Color", |
||
729 | "-", |
||
730 | "Team", |
||
731 | "-", |
||
732 | "-", |
||
733 | "Auto aim", |
||
734 | "Mouse aim", |
||
735 | "-", |
||
736 | "-", |
||
737 | "Switch weapon on pickup", |
||
738 | "Switch weapon when empty", |
||
739 | "-", |
||
740 | "-", |
||
741 | "Network packets/sec", |
||
742 | "-", |
||
743 | "-", |
||
744 | "Multiplayer macros", |
||
745 | NULL |
||
746 | }; |
||
471 | terminx | 747 | |
748 | x = ud.color; |
||
749 | |||
750 | if (probey == 2) |
||
751 | x = getteampal(ud.team); |
||
482 | terminx | 752 | |
472 | terminx | 753 | rotatesprite((260)<<16,(24+(tilesizy[APLAYER]>>1))<<16,49152L,0,1441-((((4-(totalclock>>4)))&3)*5),0,x,10,0,0,xdim-1,ydim-1); |
471 | terminx | 754 | |
755 | for (ii=io=0; opts[ii]; ii++) |
||
335 | terminx | 756 | { |
471 | terminx | 757 | if (opts[ii][0] == '-' && !opts[ii][1]) |
758 | { |
||
759 | if (io <= probey) yy += 4; |
||
760 | continue; |
||
761 | } |
||
762 | if (io < probey) yy += 8; |
||
763 | io++; |
||
268 | terminx | 764 | } |
5 | Plagman | 765 | |
482 | terminx | 766 | |
471 | terminx | 767 | if (current_menu == 20002) |
335 | terminx | 768 | { |
471 | terminx | 769 | x = probesm(c,yy+5,0,io); |
56 | terminx | 770 | |
471 | terminx | 771 | if (x == -1) |
772 | { |
||
773 | cmenu(202); |
||
774 | probey = 3; |
||
775 | break; |
||
776 | } |
||
5 | Plagman | 777 | |
471 | terminx | 778 | for (ii=io=0; opts[ii]; ii++) |
779 | { |
||
780 | if (opts[ii][0] == '-' && !opts[ii][1]) |
||
781 | continue; |
||
782 | enabled = 1; |
||
783 | switch (io) |
||
784 | { |
||
785 | case 0: |
||
786 | if (x == io) |
||
787 | { |
||
788 | strcpy(buf, myname); |
||
789 | inputloc = strlen(buf); |
||
790 | current_menu = 20003; |
||
56 | terminx | 791 | |
471 | terminx | 792 | KB_ClearKeyDown(sc_Enter); |
793 | KB_ClearKeyDown(sc_kpad_Enter); |
||
794 | KB_FlushKeyboardQueue(); |
||
795 | } |
||
796 | break; |
||
58 | terminx | 797 | |
471 | terminx | 798 | case 1: |
482 | terminx | 799 | i = ud.color; |
471 | terminx | 800 | if (x == io) |
801 | { |
||
802 | ud.color++; |
||
803 | if (ud.color > 23) |
||
804 | ud.color = 0; |
||
879 | terminx | 805 | check_valid_color((int *)&ud.color,-1); |
471 | terminx | 806 | } |
807 | modval(0,23,(int *)&ud.color,1,probey==1); |
||
879 | terminx | 808 | check_valid_color((int *)&ud.color,i); |
471 | terminx | 809 | if (ud.color != i) |
482 | terminx | 810 | updateplayer(); |
471 | terminx | 811 | break; |
268 | terminx | 812 | |
471 | terminx | 813 | case 2: |
814 | i = ud.team; |
||
815 | if (x == io) |
||
816 | { |
||
817 | ud.team++; |
||
818 | if (ud.team == 4) |
||
819 | ud.team = 0; |
||
482 | terminx | 820 | } |
471 | terminx | 821 | modval(0,3,(int *)&ud.team,1,probey==2); |
822 | if (ud.team != i) |
||
823 | updateplayer(); |
||
824 | break; |
||
53 | terminx | 825 | |
471 | terminx | 826 | case 3: |
563 | terminx | 827 | i = ud.config.AutoAim; |
471 | terminx | 828 | if (x == io) |
563 | terminx | 829 | ud.config.AutoAim = (ud.config.AutoAim == 2) ? 0 : ud.config.AutoAim+1; |
830 | modval(0,2,(int *)&ud.config.AutoAim,1,probey==3); |
||
831 | if (ud.config.AutoAim != i) |
||
471 | terminx | 832 | updateplayer(); |
833 | break; |
||
834 | |||
835 | case 4: |
||
836 | i = ud.mouseaiming; |
||
837 | if (x == io) |
||
838 | ud.mouseaiming = !ud.mouseaiming; |
||
839 | modval(0,1,(int *)&ud.mouseaiming,1,probey==4); |
||
840 | if (ud.mouseaiming != i) |
||
841 | updateplayer(); |
||
842 | break; |
||
482 | terminx | 843 | |
471 | terminx | 844 | case 5: |
845 | i = 0; |
||
846 | if (ud.weaponswitch & 1) |
||
847 | i = 1; |
||
848 | if (x == io) |
||
849 | i = 1-i; |
||
850 | modval(0,1,(int *)&i,1,probey==5); |
||
851 | if ((ud.weaponswitch & 1 && !i) || (!(ud.weaponswitch & 1) && i)) |
||
852 | { |
||
853 | ud.weaponswitch ^= 1; |
||
854 | updateplayer(); |
||
855 | } |
||
856 | break; |
||
857 | case 6: |
||
858 | i = 0; |
||
859 | if (ud.weaponswitch & 2) |
||
860 | i = 1; |
||
861 | if (x == io) |
||
862 | i = 1-i; |
||
863 | modval(0,1,(int *)&i,1,probey==6); |
||
864 | if ((ud.weaponswitch & 2 && !i) || (!(ud.weaponswitch & 2) && i)) |
||
865 | { |
||
866 | ud.weaponswitch ^= 2; |
||
867 | updateplayer(); |
||
482 | terminx | 868 | } |
471 | terminx | 869 | break; |
870 | case 7: |
||
871 | if (x == io) |
||
509 | terminx | 872 | packetrate = min(max(((packetrate/50)*50)+50,50),1000); |
873 | modval(50,1000,(int *)&packetrate,10,probey==7?2:0); |
||
874 | break; |
||
875 | case 8: |
||
876 | if (x == io) |
||
471 | terminx | 877 | { |
878 | cmenu(20004); |
||
879 | } |
||
880 | break; |
||
881 | |||
882 | default: |
||
883 | break; |
||
884 | } |
||
885 | io++; |
||
886 | } |
||
57 | terminx | 887 | } |
471 | terminx | 888 | else |
889 | { |
||
472 | terminx | 890 | x = strget(d-50,37,buf,30,0); |
337 | terminx | 891 | |
471 | terminx | 892 | while (Bstrlen(stripcolorcodes(buf)) > 10) |
893 | { |
||
894 | buf[Bstrlen(buf)-1] = '\0'; |
||
895 | inputloc--; |
||
896 | } |
||
897 | |||
898 | if (x) |
||
899 | { |
||
900 | if (x == 1) |
||
901 | { |
||
902 | if (buf[0] && Bstrcmp(myname,buf)) |
||
903 | { |
||
904 | Bstrcpy(myname,buf); |
||
905 | updateplayer(); |
||
906 | } |
||
907 | // send name update |
||
908 | } |
||
909 | KB_ClearKeyDown(sc_Enter); |
||
910 | KB_ClearKeyDown(sc_kpad_Enter); |
||
911 | KB_FlushKeyboardQueue(); |
||
912 | |||
913 | current_menu = 20002; |
||
914 | } |
||
337 | terminx | 915 | } |
151 | terminx | 916 | |
471 | terminx | 917 | yy = 37; |
337 | terminx | 918 | { |
471 | terminx | 919 | for (ii=io=0; opts[ii]; ii++) |
335 | terminx | 920 | { |
471 | terminx | 921 | if (opts[ii][0] == '-' && !opts[ii][1]) |
335 | terminx | 922 | { |
471 | terminx | 923 | yy += 4; |
924 | continue; |
||
101 | terminx | 925 | } |
471 | terminx | 926 | enabled = 1; |
927 | switch (io) |
||
928 | { |
||
929 | case 0: |
||
930 | if (current_menu == 20002) |
||
931 | { |
||
932 | gametext(d-50,yy,myname,MENUHIGHLIGHT(io),2+8+16); |
||
933 | } |
||
934 | break; |
||
335 | terminx | 935 | |
471 | terminx | 936 | case 1: |
726 | terminx | 937 | { |
938 | char *s[] = { "Auto","","","","","","","","","Blue","Red","Green","Gray","Dark gray","Dark green","Brown", |
||
939 | "Dark blue","","","","","Bright red","","Yellow","","" |
||
940 | }; |
||
941 | gametext(d-50,yy,s[ud.color],MENUHIGHLIGHT(io),2+8+16); |
||
942 | } |
||
943 | break; |
||
5 | Plagman | 944 | |
471 | terminx | 945 | case 2: |
726 | terminx | 946 | { |
947 | char *s[] = { "Blue", "Red", "Green", "Gray" }; |
||
948 | gametext(d-50,yy,s[ud.team],MENUHIGHLIGHT(io),2+8+16); |
||
949 | } |
||
950 | break; |
||
5 | Plagman | 951 | |
471 | terminx | 952 | case 3: |
726 | terminx | 953 | { |
954 | char *s[] = { "Off", "All weapons", "Hitscan only" }; |
||
955 | gametext(d-50,yy,s[ud.config.AutoAim],MENUHIGHLIGHT(io),2+8+16); |
||
956 | } |
||
957 | break; |
||
53 | terminx | 958 | |
471 | terminx | 959 | case 4: |
960 | gametext(d-50,yy,ud.mouseaiming?"Hold button":"Toggle on/off",MENUHIGHLIGHT(io),2+8+16); |
||
961 | break; |
||
54 | terminx | 962 | |
471 | terminx | 963 | case 5: |
472 | terminx | 964 | gametext(d+70,yy,ud.weaponswitch&1?"On":"Off",MENUHIGHLIGHT(io),2+8+16); |
471 | terminx | 965 | break; |
482 | terminx | 966 | |
471 | terminx | 967 | case 6: |
472 | terminx | 968 | gametext(d+70,yy,ud.weaponswitch&2?"On":"Off",MENUHIGHLIGHT(io),2+8+16); |
471 | terminx | 969 | break; |
509 | terminx | 970 | case 7: |
971 | Bsprintf(tempbuf,"%d",packetrate); |
||
972 | gametext(d+70,yy,tempbuf,MENUHIGHLIGHT(io),2+8+16); |
||
973 | break; |
||
471 | terminx | 974 | default: |
975 | break; |
||
976 | } |
||
482 | terminx | 977 | gametextpal(c,yy, opts[ii], enabled?MENUHIGHLIGHT(io):DISABLEDMENUSHADE, 10); |
471 | terminx | 978 | io++; |
979 | yy += 8; |
||
980 | } |
||
981 | } |
||
5 | Plagman | 982 | |
471 | terminx | 983 | break; |
984 | } |
||
337 | terminx | 985 | case 20004: |
986 | case 20005: |
||
987 | rotatesprite(160<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); |
||
474 | terminx | 988 | menutext(160,24,0,0,"MULTIPLAYER MACROS"); |
88 | terminx | 989 | |
337 | terminx | 990 | if (current_menu == 20004) |
991 | { |
||
992 | x = probesm(24,45,8,10); |
||
993 | if (x == -1) |
||
88 | terminx | 994 | { |
337 | terminx | 995 | cmenu(20002); |
509 | terminx | 996 | probey = 8; |
88 | terminx | 997 | } |
337 | terminx | 998 | else if (x >= 0 && x <= 9) |
88 | terminx | 999 | { |
337 | terminx | 1000 | strcpy(buf, ud.ridecule[x]); |
1001 | inputloc = strlen(buf); |
||
482 | terminx | 1002 | last_menu_pos = probey; |
337 | terminx | 1003 | current_menu = 20005; |
1004 | KB_ClearKeyDown(sc_Enter); |
||
1005 | KB_ClearKeyDown(sc_kpad_Enter); |
||
1006 | KB_FlushKeyboardQueue(); |
||
1007 | } |
||
1008 | } |
||
1009 | else |
||
1010 | { |
||
1011 | x = strget(26,40+(8*probey),buf,34,0); |
||
1012 | if (x) |
||
1013 | { |
||
1014 | if (x == 1) |
||
335 | terminx | 1015 | { |
482 | terminx | 1016 | Bstrcpy(ud.ridecule[last_menu_pos],buf); |
88 | terminx | 1017 | } |
337 | terminx | 1018 | KB_ClearKeyDown(sc_Enter); |
1019 | KB_ClearKeyDown(sc_kpad_Enter); |
||
1020 | KB_FlushKeyboardQueue(); |
||
1021 | current_menu = 20004; |
||
88 | terminx | 1022 | } |
337 | terminx | 1023 | } |
1024 | for (i=0;i<10;i++) |
||
1025 | { |
||
482 | terminx | 1026 | if (current_menu == 20005 && i == last_menu_pos) continue; |
337 | terminx | 1027 | gametextpal(26,40+(i<<3),ud.ridecule[i],MENUHIGHLIGHT(i),0); |
1028 | } |
||
91 | terminx | 1029 | |
482 | terminx | 1030 | gametext(160,144,"ACTIVATE IN-GAME WITH SHIFT-F#",0,2+8+16); |
91 | terminx | 1031 | |
337 | terminx | 1032 | break; |
88 | terminx | 1033 | |
383 | terminx | 1034 | #if 0 |
337 | terminx | 1035 | case 20010: |
1036 | rotatesprite(160<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); |
||
1037 | menutext(160,24,0,0,"HOST NETWORK GAME"); |
||
5 | Plagman | 1038 | |
337 | terminx | 1039 | x = probe(46,50,80,2); |
5 | Plagman | 1040 | |
337 | terminx | 1041 | if (x == -1) |
1042 | { |
||
1043 | cmenu(20001); |
||
1044 | probey = 2; |
||
1045 | } |
||
1046 | else if (x == 0) cmenu(20011); |
||
5 | Plagman | 1047 | |
337 | terminx | 1048 | menutext(40,50,0,0, "GAME OPTIONS"); |
1049 | minitext(90,60, "GAME TYPE" ,2,26); |
||
1050 | minitext(90,60+8, "EPISODE" ,2,26); |
||
1051 | minitext(90,60+8+8, "LEVEL" ,2,26); |
||
1052 | minitext(90,60+8+8+8, "MONSTERS" ,2,26); |
||
1053 | if (ud.m_coop == 0) |
||
1054 | minitext(90,60+8+8+8+8, "MARKERS" ,2,26); |
||
1055 | else if (ud.m_coop == 1) |
||
1056 | minitext(90,60+8+8+8+8, "FRIENDLY FIRE",2,26); |
||
1057 | minitext(90,60+8+8+8+8+8, "USER MAP" ,2,26); |
||
5 | Plagman | 1058 | |
337 | terminx | 1059 | gametext(90+60,60,gametype_names[ud.m_coop],0,26); |
5 | Plagman | 1060 | |
337 | terminx | 1061 | minitext(90+60,60+8, volume_names[ud.m_volume_number],0,26); |
381 | terminx | 1062 | minitext(90+60,60+8+8, level_names[MAXLEVELS*ud.m_volume_number+ud.m_level_number],0,26); |
337 | terminx | 1063 | if (ud.m_monsters_off == 0 || ud.m_player_skill > 0) |
1064 | minitext(90+60,60+8+8+8, skill_names[ud.m_player_skill],0,26); |
||
1065 | else minitext(90+60,60+8+8+8, "NONE",0,28); |
||
1066 | if (ud.m_coop == 0) |
||
1067 | { |
||
1068 | if (ud.m_marker) minitext(90+60,60+8+8+8+8,"ON",0,26); |
||
1069 | else minitext(90+60,60+8+8+8+8,"OFF",0,26); |
||
1070 | } |
||
1071 | else if (ud.m_coop == 1) |
||
1072 | { |
||
1073 | if (ud.m_ffire) minitext(90+60,60+8+8+8+8,"ON",0,26); |
||
1074 | else minitext(90+60,60+8+8+8+8,"OFF",0,26); |
||
1075 | } |
||
1076 | |||
1077 | menutext(40,50+80,0,0,"LAUNCH GAME"); |
||
1078 | break; |
||
1079 | |||
1080 | case 20011: |
||
1081 | c = (320>>1) - 120; |
||
1082 | rotatesprite(160<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); |
||
1083 | menutext(160,24,0,0,"NET GAME OPTIONS"); |
||
1084 | |||
1085 | x = probe(c,57-8,16,8); |
||
1086 | |||
1087 | switch (x) |
||
1088 | { |
||
1089 | case -1: |
||
1090 | cmenu(20010); |
||
1091 | break; |
||
1092 | case 0: |
||
1093 | ud.m_coop++; |
||
1094 | if (ud.m_coop == 3) ud.m_coop = 0; |
||
1095 | break; |
||
1096 | case 1: |
||
1097 | if (!VOLUMEONE) |
||
335 | terminx | 1098 | { |
337 | terminx | 1099 | ud.m_volume_number++; |
1100 | if (ud.m_volume_number == num_volumes) ud.m_volume_number = 0; |
||
1101 | if (ud.m_volume_number == 0 && ud.m_level_number > 6) |
||
1102 | ud.m_level_number = 0; |
||
1103 | if (ud.m_level_number > 10) ud.m_level_number = 0; |
||
335 | terminx | 1104 | } |
337 | terminx | 1105 | break; |
1106 | case 2: |
||
1107 | ud.m_level_number++; |
||
1108 | if (!VOLUMEONE) |
||
335 | terminx | 1109 | { |
337 | terminx | 1110 | if (ud.m_volume_number == 0 && ud.m_level_number > 6) |
1111 | ud.m_level_number = 0; |
||
335 | terminx | 1112 | } |
337 | terminx | 1113 | else |
1114 | { |
||
1115 | if (ud.m_volume_number == 0 && ud.m_level_number > 5) |
||
1116 | ud.m_level_number = 0; |
||
1117 | } |
||
1118 | if (ud.m_level_number > 10) ud.m_level_number = 0; |
||
1119 | break; |
||
1120 | case 3: |
||
1121 | if (ud.m_monsters_off == 1 && ud.m_player_skill > 0) |
||
1122 | ud.m_monsters_off = 0; |
||
5 | Plagman | 1123 | |
337 | terminx | 1124 | if (ud.m_monsters_off == 0) |
1125 | { |
||
1126 | ud.m_player_skill++; |
||
1127 | if (ud.m_player_skill > 3) |
||
1128 | { |
||
1129 | ud.m_player_skill = 0; |
||
1130 | ud.m_monsters_off = 1; |
||
1131 | } |
||
1132 | } |
||
1133 | else ud.m_monsters_off = 0; |
||
1134 | |||
335 | terminx | 1135 | break; |
5 | Plagman | 1136 | |
337 | terminx | 1137 | case 4: |
1138 | if (ud.m_coop == 0) |
||
1139 | ud.m_marker = !ud.m_marker; |
||
1140 | break; |
||
5 | Plagman | 1141 | |
337 | terminx | 1142 | case 5: |
1143 | if (ud.m_coop == 1) |
||
1144 | ud.m_ffire = !ud.m_ffire; |
||
1145 | break; |
||
5 | Plagman | 1146 | |
337 | terminx | 1147 | case 6: |
1148 | // pick the user map |
||
1149 | break; |
||
5 | Plagman | 1150 | |
337 | terminx | 1151 | case 7: |
1152 | cmenu(20010); |
||
1153 | break; |
||
1154 | } |
||
5 | Plagman | 1155 | |
337 | terminx | 1156 | c += 40; |
5 | Plagman | 1157 | |
337 | terminx | 1158 | // if(ud.m_coop==1) gametext(c+70,57-7-9,"COOPERATIVE PLAY",0,2+8+16); |
1159 | // else if(ud.m_coop==2) gametext(c+70,57-7-9,"DUKEMATCH (NO SPAWN)",0,2+8+16); |
||
1160 | // else gametext(c+70,57-7-9,"DUKEMATCH (SPAWN)",0,2+8+16); |
||
1161 | gametext(c+70,57-7-9,gametype_names[ud.m_coop],0,26); |
||
5 | Plagman | 1162 | |
337 | terminx | 1163 | gametext(c+70,57+16-7-9,volume_names[ud.m_volume_number],0,2+8+16); |
5 | Plagman | 1164 | |
381 | terminx | 1165 | gametext(c+70,57+16+16-7-9,&level_names[MAXLEVELS*ud.m_volume_number+ud.m_level_number][0],0,2+8+16); |
5 | Plagman | 1166 | |
337 | terminx | 1167 | if (ud.m_monsters_off == 0 || ud.m_player_skill > 0) |
1168 | gametext(c+70,57+16+16+16-7-9,skill_names[ud.m_player_skill],0,2+8+16); |
||
1169 | else gametext(c+70,57+16+16+16-7-9,"NONE",0,2+8+16); |
||
5 | Plagman | 1170 | |
337 | terminx | 1171 | if (ud.m_coop == 0) |
1172 | { |
||
1173 | if (ud.m_marker) |
||
1174 | gametext(c+70,57+16+16+16+16-7-9,"ON",0,2+8+16); |
||
1175 | else gametext(c+70,57+16+16+16+16-7-9,"OFF",0,2+8+16); |
||
1176 | } |
||
5 | Plagman | 1177 | |
337 | terminx | 1178 | if (ud.m_coop == 1) |
1179 | { |
||
1180 | if (ud.m_ffire) |
||
1181 | gametext(c+70,57+16+16+16+16+16-7-9,"ON",0,2+8+16); |
||
1182 | else gametext(c+70,57+16+16+16+16+16-7-9,"OFF",0,2+8+16); |
||
1183 | } |
||
5 | Plagman | 1184 | |
337 | terminx | 1185 | c -= 44; |
5 | Plagman | 1186 | |
337 | terminx | 1187 | menutext(c,57-9,MENUHIGHLIGHT(0),PHX(-2),"GAME TYPE"); |
5 | Plagman | 1188 | |
584 | terminx | 1189 | sprintf(tempbuf,"EPISODE %d",ud.m_volume_number+1); |
337 | terminx | 1190 | menutext(c,57+16-9,MENUHIGHLIGHT(1),PHX(-3),tempbuf); |
5 | Plagman | 1191 | |
584 | terminx | 1192 | sprintf(tempbuf,"LEVEL %d",ud.m_level_number+1); |
337 | terminx | 1193 | menutext(c,57+16+16-9,MENUHIGHLIGHT(2),PHX(-4),tempbuf); |
5 | Plagman | 1194 | |
337 | terminx | 1195 | menutext(c,57+16+16+16-9,MENUHIGHLIGHT(3),PHX(-5),"MONSTERS"); |
5 | Plagman | 1196 | |
337 | terminx | 1197 | if (ud.m_coop == 0) |
1198 | menutext(c,57+16+16+16+16-9,MENUHIGHLIGHT(4),PHX(-6),"MARKERS"); |
||
1199 | else |
||
1200 | menutext(c,57+16+16+16+16-9,MENUHIGHLIGHT(4),1,"MARKERS"); |
||
5 | Plagman | 1201 | |
337 | terminx | 1202 | if (ud.m_coop == 1) |
1203 | menutext(c,57+16+16+16+16+16-9,MENUHIGHLIGHT(5),PHX(-6),"FR. FIRE"); |
||
1204 | else menutext(c,57+16+16+16+16+16-9,MENUHIGHLIGHT(5),1,"FR. FIRE"); |
||
5 | Plagman | 1205 | |
337 | terminx | 1206 | if (VOLUMEALL) |
1207 | { |
||
1208 | menutext(c,57+16+16+16+16+16+16-9,MENUHIGHLIGHT(6),boardfilename[0] == 0,"USER MAP"); |
||
1209 | if (boardfilename[0] != 0) |
||
1210 | gametext(c+70+44,57+16+16+16+16+16,boardfilename,0,2+8+16); |
||
1211 | } |
||
1212 | else |
||
1213 | { |
||
1214 | menutext(c,57+16+16+16+16+16+16-9,MENUHIGHLIGHT(6),1,"USER MAP"); |
||
1215 | } |
||
5 | Plagman | 1216 | |
337 | terminx | 1217 | menutext(c,57+16+16+16+16+16+16+16-9,MENUHIGHLIGHT(7),PHX(-8),"ACCEPT"); |
1218 | break; |
||
5 | Plagman | 1219 | |
337 | terminx | 1220 | case 20020: |
1221 | case 20021: // editing server |
||
1222 | case 20022: // editing port |
||
1223 | rotatesprite(160<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); |
||
1224 | menutext(160,24,0,0,"JOIN NETWORK GAME"); |
||
5 | Plagman | 1225 | |
337 | terminx | 1226 | if (current_menu == 20020) |
1227 | { |
||
1228 | x = probe(46,50,20,3); |
||
5 | Plagman | 1229 | |
337 | terminx | 1230 | if (x == -1) |
335 | terminx | 1231 | { |
337 | terminx | 1232 | cmenu(20001); |
1233 | probey = 1; |
||
335 | terminx | 1234 | } |
337 | terminx | 1235 | else if (x == 0) |
335 | terminx | 1236 | { |
337 | terminx | 1237 | strcpy(buf, "localhost"); |
1238 | inputloc = strlen(buf); |
||
1239 | current_menu = 20021; |
||
335 | terminx | 1240 | } |
337 | terminx | 1241 | else if (x == 1) |
335 | terminx | 1242 | { |
337 | terminx | 1243 | strcpy(buf, "19014"); |
1244 | inputloc = strlen(buf); |
||
1245 | current_menu = 20022; |
||
1246 | } |
||
1247 | else if (x == 2) |
||
559 | terminx | 1248 | {} |
337 | terminx | 1249 | KB_ClearKeyDown(sc_Enter); |
1250 | KB_ClearKeyDown(sc_kpad_Enter); |
||
1251 | KB_FlushKeyboardQueue(); |
||
1252 | } |
||
1253 | else if (current_menu == 20021) |
||
1254 | { |
||
1255 | x = strget(40+100,50-9,buf,31,0); |
||
1256 | if (x) |
||
1257 | { |
||
1258 | if (x == 1) |
||
335 | terminx | 1259 | { |
337 | terminx | 1260 | //strcpy(myname,buf); |
5 | Plagman | 1261 | } |
337 | terminx | 1262 | |
5 | Plagman | 1263 | KB_ClearKeyDown(sc_Enter); |
1264 | KB_ClearKeyDown(sc_kpad_Enter); |
||
1265 | KB_FlushKeyboardQueue(); |
||
337 | terminx | 1266 | |
1267 | current_menu = 20020; |
||
335 | terminx | 1268 | } |
337 | terminx | 1269 | } |
1270 | else if (current_menu == 20022) |
||
1271 | { |
||
1272 | x = strget(40+100,50+20-9,buf,5,997); |
||
1273 | if (x) |
||
335 | terminx | 1274 | { |
337 | terminx | 1275 | if (x == 1) |
335 | terminx | 1276 | { |
337 | terminx | 1277 | //strcpy(myname,buf); |
335 | terminx | 1278 | } |
5 | Plagman | 1279 | |
337 | terminx | 1280 | KB_ClearKeyDown(sc_Enter); |
1281 | KB_ClearKeyDown(sc_kpad_Enter); |
||
1282 | KB_FlushKeyboardQueue(); |
||
5 | Plagman | 1283 | |
337 | terminx | 1284 | current_menu = 20020; |
5 | Plagman | 1285 | } |
337 | terminx | 1286 | } |
5 | Plagman | 1287 | |
337 | terminx | 1288 | menutext(40,50,0,0,"SERVER"); |
1289 | if (current_menu != 20021) gametext(40+100,50-9,"server",0,2+8+16); |
||
5 | Plagman | 1290 | |
337 | terminx | 1291 | menutext(40,50+20,0,0,"PORT"); |
1292 | if (current_menu != 20022) |
||
1293 | { |
||
1294 | sprintf(tempbuf,"%d",19014); |
||
1295 | gametext(40+100,50+20-9,tempbuf,0,2+8+16); |
||
1296 | } |
||
5 | Plagman | 1297 | |
337 | terminx | 1298 | menutext(160,50+20+20,0,0,"CONNECT"); |
5 | Plagman | 1299 | |
1300 | |||
337 | terminx | 1301 | // ADDRESS |
1302 | // PORT |
||
1303 | // CONNECT |
||
1304 | break; |
||
383 | terminx | 1305 | #endif |
337 | terminx | 1306 | case 15001: |
1307 | case 15000: |
||
5 | Plagman | 1308 | |
337 | terminx | 1309 | gametext(160,90,"LOAD last game:",0,2+8+16); |
5 | Plagman | 1310 | |
337 | terminx | 1311 | sprintf(tempbuf,"\"%s\"",ud.savegame[lastsavedpos]); |
1312 | gametext(160,99,tempbuf,0,2+8+16); |
||
5 | Plagman | 1313 | |
337 | terminx | 1314 | gametext(160,99+9,"(Y/N)",0,2+8+16); |
5 | Plagman | 1315 | |
337 | terminx | 1316 | if (KB_KeyPressed(sc_Escape) || KB_KeyPressed(sc_N) || RMB) |
1317 | { |
||
564 | terminx | 1318 | if (sprite[g_player[myconnectindex].ps->i].extra <= 0) |
5 | Plagman | 1319 | { |
337 | terminx | 1320 | if (enterlevel(MODE_GAME)) backtomenu(); |
1321 | return; |
||
1322 | } |
||
5 | Plagman | 1323 | |
337 | terminx | 1324 | KB_ClearKeyDown(sc_N); |
1325 | KB_ClearKeyDown(sc_Escape); |
||
5 | Plagman | 1326 | |
564 | terminx | 1327 | g_player[myconnectindex].ps->gm &= ~MODE_MENU; |
337 | terminx | 1328 | if (ud.multimode < 2 && ud.recstat != 2) |
1329 | { |
||
1330 | ready2send = 1; |
||
1331 | totalclock = ototalclock; |
||
5 | Plagman | 1332 | } |
337 | terminx | 1333 | } |
5 | Plagman | 1334 | |
337 | terminx | 1335 | if (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB) |
1336 | { |
||
1337 | KB_FlushKeyboardQueue(); |
||
1338 | KB_ClearKeysDown(); |
||
1339 | FX_StopAllSounds(); |
||
1340 | |||
1341 | if (ud.multimode > 1) |
||
335 | terminx | 1342 | { |
337 | terminx | 1343 | loadplayer(-1-lastsavedpos); |
564 | terminx | 1344 | g_player[myconnectindex].ps->gm = MODE_GAME; |
337 | terminx | 1345 | } |
1346 | else |
||
1347 | { |
||
1348 | c = loadplayer(lastsavedpos); |
||
1349 | if (c == 0) |
||
564 | terminx | 1350 | g_player[myconnectindex].ps->gm = MODE_GAME; |
5 | Plagman | 1351 | } |
337 | terminx | 1352 | } |
5 | Plagman | 1353 | |
337 | terminx | 1354 | probe(186,124+9,0,0); |
5 | Plagman | 1355 | |
337 | terminx | 1356 | break; |
1357 | |||
1358 | case 10000: |
||
1359 | case 10001: |
||
1360 | |||
1361 | c = 60; |
||
1362 | rotatesprite(160<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); |
||
1363 | menutext(160,24,0,0,"ADULT MODE"); |
||
1364 | |||
1365 | x = probe(60,50+16,16,2); |
||
1366 | if (x == -1) |
||
1367 | { |
||
1368 | cmenu(201); |
||
1369 | probey = 0; |
||
335 | terminx | 1370 | break; |
337 | terminx | 1371 | } |
5 | Plagman | 1372 | |
337 | terminx | 1373 | menutext(c,50+16,MENUHIGHLIGHT(0),PHX(-2),"ADULT MODE"); |
1374 | menutext(c,50+16+16,MENUHIGHLIGHT(1),PHX(-3),"ENTER PASSWORD"); |
||
5 | Plagman | 1375 | |
337 | terminx | 1376 | menutext(c+160+40,50+16,MENUHIGHLIGHT(0),0,ud.lockout?"OFF":"ON"); |
5 | Plagman | 1377 | |
337 | terminx | 1378 | if (current_menu == 10001) |
1379 | { |
||
1380 | gametext(160,50+16+16+16+16-12,"ENTER PASSWORD",0,2+8+16); |
||
1381 | x = strget((320>>1),50+16+16+16+16,buf,19, 998); |
||
1382 | |||
1383 | if (x) |
||
335 | terminx | 1384 | { |
337 | terminx | 1385 | if (ud.pwlockout[0] == 0 || ud.lockout == 0) |
1386 | strcpy(&ud.pwlockout[0],buf); |
||
1387 | else if (strcmp(buf,&ud.pwlockout[0]) == 0) |
||
1388 | { |
||
1389 | ud.lockout = 0; |
||
1390 | buf[0] = 0; |
||
5 | Plagman | 1391 | |
337 | terminx | 1392 | for (x=0;x<numanimwalls;x++) |
1393 | if (wall[animwall[x].wallnum].picnum != W_SCREENBREAK && |
||
1394 | wall[animwall[x].wallnum].picnum != W_SCREENBREAK+1 && |
||
1395 | wall[animwall[x].wallnum].picnum != W_SCREENBREAK+2) |
||
1396 | if (wall[animwall[x].wallnum].extra >= 0) |
||
1397 | wall[animwall[x].wallnum].picnum = wall[animwall[x].wallnum].extra; |
||
5 | Plagman | 1398 | |
337 | terminx | 1399 | } |
1400 | current_menu = 10000; |
||
1401 | KB_ClearKeyDown(sc_Enter); |
||
1402 | KB_ClearKeyDown(sc_kpad_Enter); |
||
1403 | KB_FlushKeyboardQueue(); |
||
1404 | } |
||
1405 | } |
||
1406 | else |
||
1407 | { |
||
1408 | if (x == 0) |
||
5 | Plagman | 1409 | { |
337 | terminx | 1410 | if (ud.lockout == 1) |
5 | Plagman | 1411 | { |
337 | terminx | 1412 | if (ud.pwlockout[0] == 0) |
5 | Plagman | 1413 | { |
1414 | ud.lockout = 0; |
||
331 | terminx | 1415 | for (x=0;x<numanimwalls;x++) |
333 | terminx | 1416 | if (wall[animwall[x].wallnum].picnum != W_SCREENBREAK && |
5 | Plagman | 1417 | wall[animwall[x].wallnum].picnum != W_SCREENBREAK+1 && |
333 | terminx | 1418 | wall[animwall[x].wallnum].picnum != W_SCREENBREAK+2) |
1419 | if (wall[animwall[x].wallnum].extra >= 0) |
||
5 | Plagman | 1420 | wall[animwall[x].wallnum].picnum = wall[animwall[x].wallnum].extra; |
1421 | } |
||
1422 | else |
||
1423 | { |
||
337 | terminx | 1424 | buf[0] = 0; |
1425 | current_menu = 10001; |
||
1426 | inputloc = 0; |
||
1427 | KB_FlushKeyboardQueue(); |
||
5 | Plagman | 1428 | } |
1429 | } |
||
337 | terminx | 1430 | else |
1431 | { |
||
1432 | ud.lockout = 1; |
||
335 | terminx | 1433 | |
337 | terminx | 1434 | for (x=0;x<numanimwalls;x++) |
1435 | switch (dynamictostatic[wall[animwall[x].wallnum].picnum]) |
||
1436 | { |
||
1437 | case FEMPIC1__STATIC: |
||
1438 | wall[animwall[x].wallnum].picnum = BLANKSCREEN; |
||
1439 | break; |
||
1440 | case FEMPIC2__STATIC: |
||
1441 | case FEMPIC3__STATIC: |
||
1442 | wall[animwall[x].wallnum].picnum = SCREENBREAK6; |
||
1443 | break; |
||
1444 | } |
||
5 | Plagman | 1445 | } |
1446 | } |
||
1447 | |||
337 | terminx | 1448 | else if (x == 1) |
1449 | { |
||
1450 | current_menu = 10001; |
||
1451 | inputloc = 0; |
||
1452 | KB_FlushKeyboardQueue(); |
||
1453 | } |
||
1454 | } |
||
5 | Plagman | 1455 | |
337 | terminx | 1456 | break; |
5 | Plagman | 1457 | |
337 | terminx | 1458 | case 1000: |
1459 | case 1001: |
||
1460 | case 1002: |
||
1461 | case 1003: |
||
1462 | case 1004: |
||
1463 | case 1005: |
||
1464 | case 1006: |
||
1465 | case 1007: |
||
1466 | case 1008: |
||
1467 | case 1009: |
||
5 | Plagman | 1468 | |
337 | terminx | 1469 | rotatesprite(160<<16,200<<15,65536L,0,MENUSCREEN,16,0,10+64,0,0,xdim-1,ydim-1); |
1470 | rotatesprite(160<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); |
||
1471 | menutext(160,24,0,0,"LOAD GAME"); |
||
1472 | rotatesprite(101<<16,97<<16,65536>>1,512,TILE_LOADSHOT,-32,0,4+10+64,0,0,xdim-1,ydim-1); |
||
5 | Plagman | 1473 | |
337 | terminx | 1474 | dispnames(); |
5 | Plagman | 1475 | |
584 | terminx | 1476 | sprintf(tempbuf,"PLAYERS: %-2d ",savehead.numplr); |
337 | terminx | 1477 | gametext(160,156,tempbuf,0,2+8+16); |
5 | Plagman | 1478 | |
584 | terminx | 1479 | sprintf(tempbuf,"EPISODE: %-2d / LEVEL: %-2d / SKILL: %-2d",1+savehead.volnum,1+savehead.levnum,savehead.plrskl); |
337 | terminx | 1480 | gametext(160,168,tempbuf,0,2+8+16); |
5 | Plagman | 1481 | |
337 | terminx | 1482 | if (savehead.volnum == 0 && savehead.levnum == 7) |
1483 | gametext(160,180,savehead.boardfn,0,2+8+16); |
||
5 | Plagman | 1484 | |
337 | terminx | 1485 | gametext(160,90,"LOAD game:",0,2+8+16); |
1486 | sprintf(tempbuf,"\"%s\"",ud.savegame[current_menu-1000]); |
||
1487 | gametext(160,99,tempbuf,0,2+8+16); |
||
1488 | gametext(160,99+9,"(Y/N)",0,2+8+16); |
||
1489 | |||
1490 | if (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB) |
||
1491 | { |
||
1492 | lastsavedpos = current_menu-1000; |
||
1493 | |||
1494 | KB_FlushKeyboardQueue(); |
||
1495 | KB_ClearKeysDown(); |
||
1496 | if (ud.multimode < 2 && ud.recstat != 2) |
||
5 | Plagman | 1497 | { |
337 | terminx | 1498 | ready2send = 1; |
1499 | totalclock = ototalclock; |
||
1500 | } |
||
5 | Plagman | 1501 | |
337 | terminx | 1502 | if (ud.multimode > 1) |
1503 | { |
||
564 | terminx | 1504 | if (g_player[myconnectindex].ps->gm&MODE_GAME) |
5 | Plagman | 1505 | { |
337 | terminx | 1506 | loadplayer(-1-lastsavedpos); |
564 | terminx | 1507 | g_player[myconnectindex].ps->gm = MODE_GAME; |
5 | Plagman | 1508 | } |
337 | terminx | 1509 | else |
5 | Plagman | 1510 | { |
337 | terminx | 1511 | tempbuf[0] = 126; |
1512 | tempbuf[1] = lastsavedpos; |
||
1513 | tempbuf[2] = myconnectindex; |
||
1514 | for (x=connecthead;x>=0;x=connectpoint2[x]) |
||
5 | Plagman | 1515 | { |
337 | terminx | 1516 | if (x != myconnectindex) sendpacket(x,tempbuf,3); |
1517 | if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master |
||
5 | Plagman | 1518 | } |
337 | terminx | 1519 | getpackets(); |
5 | Plagman | 1520 | |
337 | terminx | 1521 | loadplayer(lastsavedpos); |
5 | Plagman | 1522 | |
337 | terminx | 1523 | multiflag = 0; |
5 | Plagman | 1524 | } |
1525 | } |
||
337 | terminx | 1526 | else |
5 | Plagman | 1527 | { |
337 | terminx | 1528 | c = loadplayer(lastsavedpos); |
1529 | if (c == 0) |
||
564 | terminx | 1530 | g_player[myconnectindex].ps->gm = MODE_GAME; |
5 | Plagman | 1531 | } |
1532 | |||
1533 | break; |
||
337 | terminx | 1534 | } |
410 | terminx | 1535 | |
428 | terminx | 1536 | probe(186,124+9,0,0); |
1537 | |||
337 | terminx | 1538 | if (KB_KeyPressed(sc_N) || KB_KeyPressed(sc_Escape) || RMB) |
1539 | { |
||
1540 | KB_ClearKeyDown(sc_N); |
||
1541 | KB_ClearKeyDown(sc_Escape); |
||
1542 | sound(EXITMENUSOUND); |
||
564 | terminx | 1543 | if (g_player[myconnectindex].ps->gm&MODE_GAME) |
5 | Plagman | 1544 | { |
564 | terminx | 1545 | g_player[myconnectindex].ps->gm &= ~MODE_MENU; |
331 | terminx | 1546 | if (ud.multimode < 2 && ud.recstat != 2) |
5 | Plagman | 1547 | { |
1548 | ready2send = 1; |
||
1549 | totalclock = ototalclock; |
||
1550 | } |
||
428 | terminx | 1551 | } |
1552 | else |
||
1553 | { |
||
410 | terminx | 1554 | cmenu(300); |
1555 | probey = last_threehundred; |
||
5 | Plagman | 1556 | } |
337 | terminx | 1557 | } |
5 | Plagman | 1558 | |
337 | terminx | 1559 | break; |
1560 | |||
1561 | case 1500: |
||
1562 | |||
1563 | if (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB) |
||
1564 | { |
||
1565 | KB_FlushKeyboardQueue(); |
||
1566 | cmenu(100); |
||
1567 | } |
||
1568 | if (KB_KeyPressed(sc_N) || KB_KeyPressed(sc_Escape) || RMB) |
||
1569 | { |
||
1570 | KB_ClearKeyDown(sc_N); |
||
1571 | KB_ClearKeyDown(sc_Escape); |
||
1572 | if (ud.multimode < 2 && ud.recstat != 2) |
||
1573 | { |
||
1574 | ready2send = 1; |
||
1575 | totalclock = ototalclock; |
||
1576 | } |
||
564 | terminx | 1577 | g_player[myconnectindex].ps->gm &= ~MODE_MENU; |
337 | terminx | 1578 | sound(EXITMENUSOUND); |
335 | terminx | 1579 | break; |
337 | terminx | 1580 | } |
1581 | probe(186,124,0,0); |
||
1582 | gametext(160,90,"ABORT this game?",0,2+8+16); |
||
1583 | gametext(160,90+9,"(Y/N)",0,2+8+16); |
||
5 | Plagman | 1584 | |
337 | terminx | 1585 | break; |
5 | Plagman | 1586 | |
337 | terminx | 1587 | case 2000: |
1588 | case 2001: |
||
1589 | case 2002: |
||
1590 | case 2003: |
||
1591 | case 2004: |
||
1592 | case 2005: |
||
1593 | case 2006: |
||
1594 | case 2007: |
||
1595 | case 2008: |
||
1596 | case 2009: |
||
5 | Plagman | 1597 | |
337 | terminx | 1598 | rotatesprite(160<<16,200<<15,65536L,0,MENUSCREEN,16,0,10+64,0,0,xdim-1,ydim-1); |
1599 | rotatesprite(160<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); |
||
1600 | menutext(160,24,0,0,"SAVE GAME"); |
||
5 | Plagman | 1601 | |
337 | terminx | 1602 | rotatesprite(101<<16,97<<16,65536L>>1,512,TILE_LOADSHOT,-32,0,4+10+64,0,0,xdim-1,ydim-1); |
584 | terminx | 1603 | sprintf(tempbuf,"PLAYERS: %-2d ",ud.multimode); |
337 | terminx | 1604 | gametext(160,156,tempbuf,0,2+8+16); |
5 | Plagman | 1605 | |
584 | terminx | 1606 | sprintf(tempbuf,"EPISODE: %-2d / LEVEL: %-2d / SKILL: %-2d",1+ud.volume_number,1+ud.level_number,ud.player_skill); |
337 | terminx | 1607 | gametext(160,168,tempbuf,0,2+8+16); |
5 | Plagman | 1608 | |
337 | terminx | 1609 | if (ud.volume_number == 0 && ud.level_number == 7) |
1610 | gametext(160,180,boardfilename,0,2+8+16); |
||
5 | Plagman | 1611 | |
337 | terminx | 1612 | dispnames(); |
5 | Plagman | 1613 | |
337 | terminx | 1614 | gametext(160,90,"OVERWRITE previous SAVED game?",0,2+8+16); |
1615 | gametext(160,90+9,"(Y/N)",0,2+8+16); |
||
5 | Plagman | 1616 | |
337 | terminx | 1617 | if (KB_KeyPressed(sc_Space) || KB_KeyPressed(sc_Enter) || KB_KeyPressed(sc_kpad_Enter) || KB_KeyPressed(sc_Y) || LMB) |
1618 | { |
||
1619 | inputloc = strlen(&ud.savegame[current_menu-2000][0]); |
||
5 | Plagman | 1620 | |
337 | terminx | 1621 | cmenu(current_menu-2000+360); |
5 | Plagman | 1622 | |
337 | terminx | 1623 | KB_FlushKeyboardQueue(); |
5 | Plagman | 1624 | break; |
337 | terminx | 1625 | } |
1626 | if (KB_KeyPressed(sc_N) || KB_KeyPressed(sc_Escape) || RMB) |
||
1627 | { |
||
1628 | KB_ClearKeyDown(sc_N); |
||
1629 | KB_ClearKeyDown(sc_Escape); |
||
1630 | cmenu(351); |
||
1631 | sound(EXITMENUSOUND); |
||
1632 | } |
||
5 | Plagman | 1633 | |
337 | terminx | 1634 | probe(186,124,0,0); |
5 | Plagman | 1635 | |
337 | terminx | 1636 | break; |
5 | Plagman | 1637 | |
337 | terminx | 1638 | case 990: |
1639 | case 991: |
||
1640 | case 992: |
||
1641 | case 993: |
||
1642 | case 994: |
||
1643 | case 995: |
||
1644 | case 996: |
||
1645 | case 997: |
||
1646 | case 998: |
||
1647 | c = 160; |
||
1648 | if (!VOLUMEALL || !PLUTOPAK) |
||
1649 | { |
||
1650 | //rotatesprite(c<<16,200<<15,65536L,0,MENUSCREEN,16,0,10+64,0,0,xdim-1,ydim-1); |
||
1651 | rotatesprite(c<<16,19<<16,65536L,0,MENUBAR,16,0,10,0,0,xdim-1,ydim-1); |
||
1652 | menutext(c,24,0,0,current_menu == 998 ? "ABOUT EDUKE32" : "CREDITS"); |
||
5 | Plagman | 1653 | |
337 | terminx | 1654 | l = 8; |
1655 | } |
||
1656 | else |
||
1657 | { |
||
1658 | l = 3; |
||
1659 | } |
||
5 | Plagman | 1660 | |
337 | terminx | 1661 | if (KB_KeyPressed(sc_LeftArrow) || |
1662 | KB_KeyPressed(sc_kpad_4) || |
||
1663 | KB_KeyPressed(sc_UpArrow) || |
||
1664 | KB_KeyPressed(sc_PgUp) || |
||
411 | terminx | 1665 | KB_KeyPressed(sc_kpad_8) || |
1666 | WHEELUP) |
||
337 | terminx | 1667 | { |
1668 | KB_ClearKeyDown(sc_LeftArrow); |
||
1669 | KB_ClearKeyDown(sc_kpad_4); |
||
1670 | KB_ClearKeyDown(sc_UpArrow); |
||
1671 | KB_ClearKeyDown(sc_PgUp); |
||
1672 | KB_ClearKeyDown(sc_kpad_8); |
||
1673 | |||
1674 | sound(KICK_HIT); |
||
1675 | current_menu--; |
||
1676 | if (current_menu < 990) current_menu = 990+l; |
||
1677 | } |
||
1678 | else if ( |
||
1679 | KB_KeyPressed(sc_PgDn) || |
||
1680 | KB_KeyPressed(sc_Enter) || |
||
1681 | KB_KeyPressed(sc_Space) || |
||
1682 | KB_KeyPressed(sc_kpad_Enter) || |
||
1683 | KB_KeyPressed(sc_RightArrow) || |
||
1684 | KB_KeyPressed(sc_DownArrow) || |
||
1685 | KB_KeyPressed(sc_kpad_2) || |
||
1686 | KB_KeyPressed(sc_kpad_9) || |
||
409 | terminx | 1687 | KB_KeyPressed(sc_kpad_6) || |
411 | terminx | 1688 | LMB || WHEELDOWN) |
337 | terminx | 1689 | { |
1690 | KB_ClearKeyDown(sc_PgDn); |
||
1691 | KB_ClearKeyDown(sc_Enter); |
||
1692 | KB_ClearKeyDown(sc_RightArrow); |
||
1693 | KB_ClearKeyDown(sc_kpad_Enter); |
||
1694 | KB_ClearKeyDown(sc_kpad_6); |
||
1695 | KB_ClearKeyDown(sc_kpad_9); |
||
1696 | KB_ClearKeyDown(sc_kpad_2); |
||
1697 | KB_ClearKeyDown(sc_DownArrow); |
||
1698 | KB_ClearKeyDown(sc_Space); |
||
1699 | sound(KICK_HIT); |
||
1700 | current_menu++; |
||
1701 | if (current_menu > 990+l) current_menu = 990; |
||
1702 | } |
||
1703 | |||
482 | terminx | 1704 | x = probe(0,0,0,1); |
1705 | |||
1706 | if (x == -1) |
||
1707 | { |
||
1708 | cmenu(0); |
||
1709 | break; |
||
1710 | } |
||
1711 | |||
337 | terminx | 1712 | if (!VOLUMEALL || !PLUTOPAK) |
1713 | { |
||
1714 | switch (current_menu) |
||
335 | terminx | 1715 | { |
337 | terminx | 1716 | case 990: |
1717 | gametext(c,40, "ORIGINAL CONCEPT",0,2+8+16); |
||
1718 | gametext(c,40+9, "TODD REPLOGLE",0,2+8+16); |
||
1719 | gametext(c,40+9+9, "ALLEN H. BLUM III",0,2+8+16); |
||
5 | Plagman | 1720 | |
337 | terminx | 1721 | gametext(c,40+9+9+9+9, "PRODUCED & DIRECTED BY",0,2+8+16); |
1722 | gametext(c,40+9+9+9+9+9, "GREG MALONE",0,2+8+16); |
||
5 | Plagman | 1723 | |
337 | terminx | 1724 | gametext(c,40+9+9+9+9+9+9+9, "EXECUTIVE PRODUCER",0,2+8+16); |
1725 | gametext(c,40+9+9+9+9+9+9+9+9, "GEORGE BROUSSARD",0,2+8+16); |
||
5 | Plagman | 1726 | |
337 | terminx | 1727 | gametext(c,40+9+9+9+9+9+9+9+9+9+9, "BUILD ENGINE",0,2+8+16); |
1728 | gametext(c,40+9+9+9+9+9+9+9+9+9+9+9,"KEN SILVERMAN",0,2+8+16); |
||
1729 | break; |
||
1730 | case 991: |
||
1731 | gametext(c,40, "GAME PROGRAMMING",0,2+8+16); |
||
1732 | gametext(c,40+9, "TODD REPLOGLE",0,2+8+16); |
||
5 | Plagman | 1733 | |
337 | terminx | 1734 | gametext(c,40+9+9+9, "3D ENGINE/TOOLS/NET",0,2+8+16); |
1735 | gametext(c,40+9+9+9+9, "KEN SILVERMAN",0,2+8+16); |
||
5 | Plagman | 1736 | |
337 | terminx | 1737 | gametext(c,40+9+9+9+9+9+9, "NETWORK LAYER/SETUP PROGRAM",0,2+8+16); |
1738 | gametext(c,40+9+9+9+9+9+9+9, "MARK DOCHTERMANN",0,2+8+16); |
||
1739 | break; |
||
1740 | case 992: |
||
1741 | gametext(c,40, "MAP DESIGN",0,2+8+16); |
||
1742 | gametext(c,40+9, "ALLEN H BLUM III",0,2+8+16); |
||
1743 | gametext(c,40+9+9, "RICHARD GRAY",0,2+8+16); |
||
5 | Plagman | 1744 | |
337 | terminx | 1745 | gametext(c,40+9+9+9+9, "3D MODELING",0,2+8+16); |
1746 | gametext(c,40+9+9+9+9+9, "CHUCK JONES",0,2+8+16); |
||
1747 | gametext(c,40+9+9+9+9+9+9, "SAPPHIRE CORPORATION",0,2+8+16); |
||
5 | Plagman | 1748 | |
337 | terminx | 1749 | gametext(c,40+9+9+9+9+9+9+9+9, "ARTWORK",0,2+8+16); |
1750 | gametext(c,40+9+9+9+9+9+9+9+9+9, "DIRK JONES, STEPHEN HORNBACK",0,2+8+16); |
||
1751 | gametext(c,40+9+9+9+9+9+9+9+9+9+9, "JAMES STOREY, DAVID DEMARET",0,2+8+16); |
||
1752 | gametext(c,40+9+9+9+9+9+9+9+9+9+9+9,"DOUGLAS R WOOD",0,2+8+16); |
||
1753 | break; |
||
1754 | case 993: |
||
1755 | gametext(c,40, "SOUND ENGINE",0,2+8+16); |
||
1756 | gametext(c,40+9, "JIM DOSE",0,2+8+16); |
||
5 | Plagman | 1757 | |
337 | terminx | 1758 | gametext(c,40+9+9+9, "SOUND & MUSIC DEVELOPMENT",0,2+8+16); |
1759 | gametext(c,40+9+9+9+9, "ROBERT PRINCE",0,2+8+16); |
||
1760 | gametext(c,40+9+9+9+9+9, "LEE JACKSON",0,2+8+16); |
||
5 | Plagman | 1761 | |
337 | terminx | 1762 | gametext(c,40+9+9+9+9+9+9+9, "VOICE TALENT",0,2+8+16); |
1763 | gametext(c,40+9+9+9+9+9+9+9+9, "LANI MINELLA - VOICE PRODUCER",0,2+8+16); |
||
1764 | gametext(c,40+9+9+9+9+9+9+9+9+9, "JON ST. JOHN AS \"DUKE NUKEM\"",0,2+8+16); |
||
1765 | break; |
||
1766 | case 994: |
||
1767 | gametext(c,60, "GRAPHIC DESIGN",0,2+8+16); |
||
1768 | gametext(c,60+9, "PACKAGING, MANUAL, ADS",0,2+8+16); |
||
1769 | gametext(c,60+9+9, "ROBERT M. ATKINS",0,2+8+16); |
||
1770 | gametext(c,60+9+9+9, "MICHAEL HADWIN",0,2+8+16); |
||
5 | Plagman | 1771 | |
337 | terminx | 1772 | gametext(c,60+9+9+9+9+9, "SPECIAL THANKS TO",0,2+8+16); |
1773 | gametext(c,60+9+9+9+9+9+9, "STEVEN BLACKBURN, TOM HALL",0,2+8+16); |
||
1774 | gametext(c,60+9+9+9+9+9+9+9, "SCOTT MILLER, JOE SIEGLER",0,2+8+16); |
||
1775 | gametext(c,60+9+9+9+9+9+9+9+9, "TERRY NAGY, COLLEEN COMPTON",0,2+8+16); |
||
1776 | gametext(c,60+9+9+9+9+9+9+9+9+9, "HASH INC., FORMGEN, INC.",0,2+8+16); |
||
1777 | break; |
||
1778 | case 995: |
||
1779 | gametext(c,49, "THE 3D REALMS BETA TESTERS",0,2+8+16); |
||
5 | Plagman | 1780 | |
337 | terminx | 1781 | gametext(c,49+9+9, "NATHAN ANDERSON, WAYNE BENNER",0,2+8+16); |
1782 | gametext(c,49+9+9+9, "GLENN BRENSINGER, ROB BROWN",0,2+8+16); |
||
1783 | gametext(c,49+9+9+9+9, "ERIK HARRIS, KEN HECKBERT",0,2+8+16); |
||
1784 | gametext(c,49+9+9+9+9+9, "TERRY HERRIN, GREG HIVELY",0,2+8+16); |
||
1785 | gametext(c,49+9+9+9+9+9+9, "HANK LEUKART, ERIC BAKER",0,2+8+16); |
||
1786 | gametext(c,49+9+9+9+9+9+9+9, "JEFF RAUSCH, KELLY ROGERS",0,2+8+16); |
||
1787 | gametext(c,49+9+9+9+9+9+9+9+9, "MIKE DUNCAN, DOUG HOWELL",0,2+8+16); |
||
1788 | gametext(c,49+9+9+9+9+9+9+9+9+9, "BILL BLAIR",0,2+8+16); |
||
1789 | break; |
||
1790 | case 996: |
||
1791 | gametext(c,32, "COMPANY PRODUCT SUPPORT",0,2+8+16); |
||
5 | Plagman | 1792 | |
337 | terminx | 1793 | gametext(c,32+9+9, "THE FOLLOWING COMPANIES WERE COOL",0,2+8+16); |
1794 | gametext(c,32+9+9+9, "ENOUGH TO GIVE US LOTS OF STUFF",0,2+8+16); |
||
1795 | gametext(c,32+9+9+9+9, "DURING THE MAKING OF DUKE NUKEM 3D.",0,2+8+16); |
||
5 | Plagman | 1796 | |
337 | terminx | 1797 | gametext(c,32+9+9+9+9+9+9, "ALTEC LANSING MULTIMEDIA",0,2+8+16); |
1798 | gametext(c,32+9+9+9+9+9+9+9, "FOR TONS OF SPEAKERS AND THE",0,2+8+16); |
||
1799 | gametext(c,32+9+9+9+9+9+9+9+9, "THX-LICENSED SOUND SYSTEM",0,2+8+16); |
||
1800 | gametext(c,32+9+9+9+9+9+9+9+9+9, "FOR INFO CALL 1-800-548-0620",0,2+8+16); |
||
5 | Plagman | 1801 | |
337 | terminx | 1802 | gametext(c,32+9+9+9+9+9+9+9+9+9+9+9,"CREATIVE LABS, INC.",0,2+8+16); |
5 | Plagman | 1803 | |
337 | terminx | 1804 | gametext(c,32+9+9+9+9+9+9+9+9+9+9+9+9+9,"THANKS FOR THE HARDWARE, GUYS.",0,2+8+16); |
1805 | break; |
||
1806 | case 997: |
||
1807 | gametext(c,50, "DUKE NUKEM IS A TRADEMARK OF",0,2+8+16); |
||
1808 | gametext(c,50+9, "3D REALMS ENTERTAINMENT",0,2+8+16); |
||
5 | Plagman | 1809 | |
337 | terminx | 1810 | gametext(c,50+9+9+9, "DUKE NUKEM",0,2+8+16); |
1811 | gametext(c,50+9+9+9+9, "(C) 1996 3D REALMS ENTERTAINMENT",0,2+8+16); |
||
5 | Plagman | 1812 | |
337 | terminx | 1813 | if (VOLUMEONE) |
1814 | { |
||
1815 | gametext(c,106, "PLEASE READ LICENSE.DOC FOR SHAREWARE",0,2+8+16); |
||
1816 | gametext(c,106+9, "DISTRIBUTION GRANTS AND RESTRICTIONS",0,2+8+16); |
||
1817 | } |
||
5 | Plagman | 1818 | |
337 | terminx | 1819 | gametext(c,VOLUMEONE?134:115, "MADE IN DALLAS, TEXAS USA",0,2+8+16); |
5 | Plagman | 1820 | break; |
337 | terminx | 1821 | case 998: |
1822 | l = 10; |
||
1823 | goto cheat_for_port_credits; |
||
5 | Plagman | 1824 | } |
337 | terminx | 1825 | break; |
1826 | } |
||
5 | Plagman | 1827 | |
337 | terminx | 1828 | // Plutonium pak menus |
1829 | switch (current_menu) |
||
1830 | { |
||
1831 | case 990: |
||
1832 | case 991: |
||
1833 | case 992: |
||
1834 | rotatesprite(160<<16,200<<15,65536L,0,2504+current_menu-990,0,0,10+64,0,0,xdim-1,ydim-1); |
||
1835 | break; |
||
1836 | case 993: // JBF 20031220 |
||
1837 | rotatesprite(160<<16,200<<15,65536L,0,MENUSCREEN,0,0,10+64,0,0,xdim-1,ydim-1); |
||
1838 | rotatesprite(c<<16,19<<16,65536L,0,MENUBAR,0,0,10,0,0,xdim-1,ydim-1); |
||
1839 | menutext(160,24,0,0,"ABOUT EDUKE32"); |
||
5 | Plagman | 1840 | |
1841 | cheat_for_port_credits: |
||
561 | terminx | 1842 | if (g_ScriptVersion == 13) l = (-2); |
337 | terminx | 1843 | gametext(160,38-l,"GAME PROGRAMMING",0,2+8+16); |
1844 | p = "Richard \"TerminX\" Gobeille"; |
||
1845 | minitext(161-(Bstrlen(p)<<1), 39+10-l, p, 4, 10+16+128); |
||
1846 | minitext(160-(Bstrlen(p)<<1), 38+10-l, p, 8, 10+16+128); |
||
5 | Plagman | 1847 | |
337 | terminx | 1848 | gametext(160,57-l,"\"JFDUKE3D\" AND \"JFBUILD\" CODE",0,2+8+16); |
1849 | p = "Jonathon \"JonoF\" Fowler"; |
||
1850 | minitext(161-(Bstrlen(p)<<1), 58+10-l, p, 4, 10+16+128); |
||
1851 | minitext(160-(Bstrlen(p)<<1), 57+10-l, p, 8, 10+16+128); |
||
5 | Plagman | 1852 | |
626 | terminx | 1853 | gametext(160,76-l,"BUILD ENGINE, \"POLYMOST\" RENDERER",0,2+8+16); |
337 | terminx | 1854 | gametext(160,76+8-l,"NETWORKING, OTHER CODE",0,2+8+16); |
1855 | p = "Ken \"Awesoken\" Silverman"; |
||
1856 | minitext(161-(Bstrlen(p)<<1), 77+8+10-l, p, 4, 10+16+128); |
||
1857 | minitext(160-(Bstrlen(p)<<1), 76+8+10-l, p, 8, 10+16+128); |
||
5 | Plagman | 1858 | |
626 | terminx | 1859 | gametext(160,103-l,"ADDITIONAL RENDERING FEATURES",0,2+8+16); |
337 | terminx | 1860 | p = "Pierre-Loup \"Plagman\" Griffais"; |
1861 | minitext(161-(Bstrlen(p)<<1), 104+10-l, p, 4, 10+16+128); |
||
1862 | minitext(160-(Bstrlen(p)<<1), 103+10-l, p, 8, 10+16+128); |
||
5 | Plagman | 1863 | |
337 | terminx | 1864 | gametext(160,122-l,"LICENSE AND OTHER CONTRIBUTORS",0,2+8+16); |
5 | Plagman | 1865 | { |
337 | terminx | 1866 | const char *scroller[] = |
559 | terminx | 1867 | { |
1868 | "This program is distributed under the terms of the", |
||
1869 | "GNU General Public License version 2 as published by the", |
||
1870 | "Free Software Foundation. See GNU.TXT for details.", |
||
1871 | "", |
||
1872 | "Thanks to the following people for their contributions:", |
||
1873 | "", |
||
1874 | "Adam Fazakerley", |
||
1875 | "Charlie Honig", |
||
1876 | "Ed Coolidge", |
||
651 | terminx | 1877 | "Hunter_rus", |
559 | terminx | 1878 | "James Bentler", |
1879 | "Javier Martinez", |
||
1880 | "Jeff Hart", |
||
1881 | "Jonathan Smith", |
||
1882 | "Jose del Castillo", |
||
1883 | "Lachlan McDonald", |
||
1884 | "Matthew Palmer", |
||
749 | terminx | 1885 | "Ozkan Sezer", |
559 | terminx | 1886 | "Peter Green", |
749 | terminx | 1887 | "Peter Veenstra", |
1888 | "Philipp Kutin", |
||
559 | terminx | 1889 | "Ryan Gordon", |
749 | terminx | 1890 | "Stephen Anthony", |
559 | terminx | 1891 | "", |
1892 | "EDuke originally by Matt Saettler", |
||
1893 | "", |
||
1894 | "--x--", |
||
1895 | "", |
||
1896 | "", |
||
1897 | "", |
||
1898 | "", |
||
1899 | "", |
||
1900 | "" |
||
1901 | }; |
||
337 | terminx | 1902 | const int numlines = sizeof(scroller)/sizeof(char *); |
1903 | for (m=0,i=(totalclock/104)%numlines; m<6; m++,i++) |
||
335 | terminx | 1904 | { |
337 | terminx | 1905 | if (i==numlines) i=0; |
1906 | minitext(161-(Bstrlen(scroller[i])<<1), 101+10+10+8+4+(m*7)-l, (char*)scroller[i], 4, 10+16+128); |
||
1907 | minitext(160-(Bstrlen(scroller[i])<<1), 100+10+10+8+4+(m*7)-l, (char*)scroller[i], 8, 10+16+128); |
||
335 | terminx | 1908 | } |
1909 | } |
||
5 | Plagman | 1910 | |
337 | terminx | 1911 | p = "Visit www.eduke32.com for news and updates"; |
1912 | minitext(161-(Bstrlen(p)<<1), 136+10+10+10+10+4-l, p, 4, 10+16+128); |
||
1913 | minitext(160-(Bstrlen(p)<<1), 135+10+10+10+10+4-l, p, 8, 10+16+128); |
||
626 | terminx | 1914 | p = "See wiki.eduke32.com/stuff for new beta snapshots"; |
1915 | minitext(161-(Bstrlen(p)<<1), 143+10+10+10+10+4-l, p, 4, 10+16+128); |
||
1916 | minitext(160-(Bstrlen(p)<<1), 142+10+10+10+10+4-l, p, 8, 10+16+128); |
||
337 | terminx | 1917 | } |
1918 | break; |
||
335 | terminx | 1919 | |
337 | terminx | 1920 | case 0: |
1921 | c = (320>>1); |
||
1922 | rotatesprite(c<<16,28<<16,65536L,0,INGAMEDUKETHREEDEE,0,0,10,0,0,xdim-1,ydim-1); |
||
1923 | if (PLUTOPAK) // JBF 20030804 |
||
1924 | rotatesprite((c+100)<<16,36<<16,65536L,0,PLUTOPAKSPRITE+2,(sintable[(totalclock<<4)&2047]>>11),0,2+8,0,0,xdim-1,ydim-1); |
||
1925 | x = probe(c,67,16,6); |
||
1926 | if (x >= 0) |
||
1927 | { |
||
1928 | if (ud.multimode > 1 && x == 0 && ud.recstat != 2) |
||
5 | Plagman | 1929 | { |
337 | terminx | 1930 | if (movesperpacket == 4 && myconnectindex != connecthead) |
1931 | break; |
||
335 | terminx | 1932 | |
337 | terminx | 1933 | last_zero = 0; |
1934 | cmenu(600); |
||
335 | terminx | 1935 | } |
1936 | else |
||
1937 | { |
||
337 | terminx | 1938 | last_zero = x; |
1939 | switch (x) |
||
1940 | { |
||
5 | Plagman | 1941 | case 0: |
337 | terminx | 1942 | cmenu(100); |
5 | Plagman | 1943 | break; |
337 | terminx | 1944 | //case 1: break;//cmenu(20001);break; // JBF 20031128: I'm taking over the TEN menu option |
331 | terminx | 1945 | case 1: |
337 | terminx | 1946 | cmenu(202); |
1947 | break; // JBF 20031205: was 200 |
||
5 | Plagman | 1948 | case 2: |
331 | terminx | 1949 | if (movesperpacket == 4 && connecthead != myconnectindex) |
5 | Plagman | 1950 | break; |
1951 | cmenu(300); |
||
1952 | break; |
||
331 | terminx | 1953 | case 3: |
335 | terminx | 1954 | KB_FlushKeyboardQueue(); |
1955 | cmenu(400); |
||
1956 | break; |
||
337 | terminx | 1957 | case 4: |
1958 | cmenu(990); |
||
1959 | break; |
||
331 | terminx | 1960 | case 5: |
335 | terminx | 1961 | cmenu(500); |
1962 | break; |
||
337 | terminx | 1963 | } |
5 | Plagman | 1964 | } |
337 | terminx | 1965 | } |
5 | Plagman | 1966 | |
337 | terminx | 1967 | if (KB_KeyPressed(sc_Q)) cmenu(500); |
5 | Plagman | 1968 | |
564 | terminx | 1969 | if (x == -1 && (g_player[myconnectindex].ps->gm&MODE_GAME || ud.recstat == 2)) |
337 | terminx | 1970 | { |
564 | terminx | 1971 | g_player[myconnectindex].ps->gm &= ~MODE_MENU; |
337 | terminx | 1972 | if (ud.multimode < 2 && ud.recstat != 2) |
5 | Plagman | 1973 | { |
337 | terminx | 1974 | ready2send = 1; |
1975 | totalclock = ototalclock; |
||
5 | Plagman | 1976 | } |
337 | terminx | 1977 | } |
1978 | |||
1979 | if (movesperpacket == 4) |
||
1980 | { |
||
1981 | if (myconnectindex == connecthead) |
||
1982 | menutext(c,67,MENUHIGHLIGHT(0),PHX(-2),"NEW GAME"); |
||
5 | Plagman | 1983 | else |
337 | terminx | 1984 | menutext(c,67,MENUHIGHLIGHT(0),1,"NEW GAME"); |
1985 | } |
||
1986 |