convert line ends
[canaan.git] / prj / cam / src / shock / shkcharg.cpp
blobef29dd228e8198aafb78fb9ab963362909823cae
1 /*
2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
4 */
6 // $Header: r:/t2repos/thief2/src/shock/shkcharg.cpp,v 1.28 2000/02/19 12:36:39 toml Exp $
8 // NOTE: This whole file is out of date, and slated for total destruction
9 #if 0
11 #include <storeapi.h>
12 #include <resapi.h>
13 #include <respaths.h>
15 #include <stdlib.h>
17 #include <loopapi.h>
18 #include <comtools.h>
19 #include <appagg.h>
20 #include <timer.h>
21 #include <mprintf.h>
23 // ui library not C++ ized properly yet
24 extern "C" {
25 #include <event.h>
26 #include <gadbox.h>
27 #include <gadblist.h>
28 #include <gadbutt.h>
31 #include <kbcook.h>
32 #include <keydefs.h>
33 #include <editor.h>
35 #include <shkcharg.h>
36 #include <shkplayr.h>
37 #include <shkmusic.h>
39 #include <appsfx.h>
40 #include <memall.h>
41 #include <dbmem.h> // must be last header!
43 #define INTERFACE_PATH "iface\\"
44 static IRes *gHndBackBmp = NULL;
46 /* ------------------------------------------------------------ */
47 // should this be service dependant or something wacky like that?
48 #define NUM_TRAINING_YEARS 3
49 #define NUM_AVAIL_JOBS 5
51 enum EJobType { KJobMission, KJobPosting};
53 typedef struct
55 EJobType jobtype; // mission or posting
56 char *shortdesc; // on-button job description
57 char *longdesc; // longer description of job when seleced
58 char *debrief; // name of debriefing portrait
59 char *results; // description of what happens on the job (for debrief teletype)
61 // stuff on how it affects your stats
62 } JobInfo;
64 JobInfo job_db[] = {
65 { KJobMission, "Mission: Raiders", "Disaffected mercenaries are raiding Earth colonies near the Opihuichi system. Naval units \
66 will engage enemy vessels and board them to quell anarchy and lawlessness.", "cgend002.pcx" },
67 { KJobMission, "Mission: Ground Invasion", "Naval shock units must be deployed to clear out a landing zone for establishing an \
68 HQ unit on Orion IV."},
69 { KJobMission, "Mission: Urban Pacification", "Economic distress has caused several colonies to threaten independence. A strong \
70 military presence is being established to maintain order.", "cgend001.pcx", \
71 "Fighting is intense as rebellion spreads among the local populace during your assignment on the colony of New Haven. On several \
72 occasions you are required to go into the streets to quell rioting and keep the peace. Your squad is pinned down by heavy \
73 resistance forces, and suffers heavy casualties.\nYou gain 3 points of heavy weapons skill, and 1 point of weapons repair. Injuries \
74 suffered during the fighting cost you 1 point of END."},
75 { KJobPosting, "Posting: Energy Weapons", "High tech energy weapons require a lengthy training period before soldiers are \
76 qualified to use them in the field.","cgend002.pcx",
77 "Although not the most exciting duty in the Navy, your weapons training proves useful. Endless hours on the practice range \
78 pay off, and your AGI increases by 2, and you gain 5 points of energy weapons skill."},
79 { KJobPosting, "Posting: Administration", "A large organization like the Navy requires a complex bureaucracy, and talented \
80 administrators to run it." },
81 // 5
82 { KJobPosting, "Posting: Psi Testing", "Naval scientists are experimenting with the development of a comprehensive course \
83 to stimulate latent psionic abilities, and need test subjects with high psionic potential.", "cgend000.pcx",
84 "After months of being poked, prodded, and probed, you blossom in psionic training! Although not all of the experimental \
85 regimen is without side effects, your budding mental abilities will serve you well during your career. Your ESP, Telepathy, \
86 and Projection skills go up by 3!"},
87 { KJobPosting, "Posting: Officer Training", "The Navy's officers are the finest in the military, and they get that way through \
88 an intensive training program." },
89 { KJobMission, "Mission: Deep Space Patrol", "A deep space tour of duty can be filled with dangerous hazards and exciting opportunities.", "cgend004.pcx",
90 "Months pass in deep space aboard the UNN Lexington, before you are called in to combat a band of spacefaring raiders! Fortunately superior \
91 technology carries the day, and you rout the raiders after a few weeks of skirmishing. You gain 3 points of energy weapons skill, \
92 2 points of PER, and 2 points of END." },
93 { KJobMission, "Mission: Infiltrate the Von Braun", "Naval High Command has a critical need for your skills to defuse a \
94 tricky situation on board the deep space craft \"Von Braun\". The ship's commander has gone renegade and you are authorized \
95 to use any and all means to eliminate Captain Kurtz. A squadron of marines will assist you in overcoming any defenses that the \
96 Captain may have established on board the ship.", "cgend003.pcx", "You set out for the most eventful mission of your career..." },
99 int job_avail[NUM_TRAINING_YEARS][NUM_AVAIL_JOBS] = {
100 { 0, 1, 3, 7, 5 }, // pick mission 7 (space patrol)
101 { 0, 1, 3, 5, 2 }, // pick mission 5 (psi training)
102 { 8, -1, -1, -1, -1 }, // forced pick of 8
105 { 0, 1, 2, 3, 5 }, // pick mission 2 (urban pacification)
106 { 0, 1, 3, 5, 6 }, // pick mission 5 (psi training)
107 //{ 0, 1, 3, 7, 6 }, // pick mission 3 (gunnery drill)
108 { 0, 1, 3, 7, 6 }, // pick mission 7 (space patrol)
109 { 8, -1, -1, -1, -1 }, // forced pick of 8
111 /* ------------------------------------------------------------ */
112 CCharGenerator::CCharGenerator(CCharacter *who)
114 m_player = who;
115 m_year = 0;
116 m_state = KGenNone;
117 m_service = KServiceBlackOps; // our default
118 m_trait = 0;
119 m_summary_focus = -1;
120 m_color = -1;
121 strcpy(m_name,"");
123 int i;
124 for (i=0; i < 2; i++)
125 m_subskills[i] = -1;
127 m_font = FALSE;
129 // build the basic interface
130 // (should this happen here in the constructor, or be a subsequent call?)
131 //BuildInterface(m_state);
133 /* ------------------------------------------------------------ */
134 CCharGenerator::~CCharGenerator()
136 ResUnlock(RES_EditorFont);
138 /* ------------------------------------------------------------ */
140 // fake hack hack hack
141 int ChooseRandom(int num)
143 return (rand() % num);
146 /* ------------------------------------------------------------ */
147 // shouldn't these be in some common utilities file?
148 // This leaves the art Locked; callers should be sure to Unlock before
149 // they release the handle.
150 IRes *LoadArt(char *artname, grs_bitmap **bmp)
152 IRes *handle;
154 // @TBD: We really ought to have a path for INTERFACE_PATH, which is
155 // long-lived, instead of using this relative path each time:
156 char buf[MAX_STOREPATH];
157 strcpy(buf, INTERFACE_PATH);
158 strcat(buf, artname);
160 AutoAppIPtr(ResMan);
161 handle = pResMan->PrepTypedResource(buf,
162 "Image",
163 gContextPath);
164 if (handle != NULL)
166 *bmp = (grs_bitmap *) handle->Lock();
168 return(handle);
171 /* ------------------------------------------------------------ */
172 void CCharGenerator::DrawBackground(char *artname)
174 grs_bitmap *bmp;
175 IRes *hnd;
176 hnd = LoadArt(artname,&bmp);
177 gr_bitmap(bmp,0,0);
178 hnd->Unlock();
179 SafeRelease(hnd);
182 /* ------------------------------------------------------------ */
184 void CCharGenerator::DrawBackground(EGenState state)
186 switch(state)
188 case KGenBirth:
189 DrawBackground("cgenbrth.pcx");
190 break;
191 case KGenSelectService:
192 DrawBackground("cgenserv.pcx");
193 break;
194 case KGenChooseMission:
195 DrawBackground("cgenchoo.pcx");
196 break;
197 case KGenDebriefing:
198 if (job_db[m_mission].debrief != NULL)
199 DrawBackground(job_db[m_mission].debrief);
200 else
201 DrawBackground("cgendebr.pcx");
202 break;
203 case KGenCharSummary:
204 case KGenGameSummary:
205 DrawBackground("cgensumm.pcx");
206 break;
207 case KGenSplash:
208 DrawBackground("splash.pcx");
209 break;
210 case KGenMain:
211 DrawBackground("splash2.pcx");
212 break;
216 /* ------------------------------------------------------------ */
218 static Rect service_rects[3] = {
219 {{13,246}, {166,479}},
220 {{117,30}, {264,251}},
221 {{194,247},{372,459}},
224 static Rect job_rects[NUM_AVAIL_JOBS] = {
225 {{410,230}, {430, 250}},
226 {{410,270}, {430, 290}},
227 {{410,310}, {430, 330}},
228 {{410,350}, {430, 370}},
229 {{410,390}, {430, 410}},
232 static Rect birth_rects[3] = {
233 {{100,300}, {150, 350}},
234 {{100,350}, {150, 400}},
235 {{100,400}, {150, 450}},
238 #define SUMMARY_X1 9
239 #define SUMMARY_X2 99
240 #define SUMMARY_X3 236
241 #define SUMMARY_X4 377
243 static Rect summary_rects[NUM_CHAR_INFO] = {
245 {{SUMMARY_X1,64},{SUMMARY_X2,83}}, // STR
246 {{SUMMARY_X1,84},{SUMMARY_X2,103}}, // DEX
247 {{SUMMARY_X1,104},{SUMMARY_X2,123}}, // CON
248 {{SUMMARY_X1,124},{SUMMARY_X2,143}}, // INT
249 {{SUMMARY_X1,144},{SUMMARY_X2,163}}, // PER
251 {{SUMMARY_X3,253},{SUMMARY_X4,268}}, // weapons
252 {{SUMMARY_X3,269},{SUMMARY_X4,284}},
253 {{SUMMARY_X3,285},{SUMMARY_X4,300}},
254 {{SUMMARY_X3,301},{SUMMARY_X4,316}},
255 {{SUMMARY_X3,317},{SUMMARY_X4,332}},
257 {{SUMMARY_X3,63},{SUMMARY_X4,78}}, // psi
258 {{SUMMARY_X3,79},{SUMMARY_X4,94}},
259 {{SUMMARY_X3,95},{SUMMARY_X4,110}},
260 {{SUMMARY_X3,111},{SUMMARY_X4,126}},
261 {{SUMMARY_X3,127},{SUMMARY_X4,142}},
262 {{SUMMARY_X3,143},{SUMMARY_X4,158}},
263 {{SUMMARY_X3,159},{SUMMARY_X4,174}},
264 {{SUMMARY_X3,175},{SUMMARY_X4,190}},
265 {{SUMMARY_X3,191},{SUMMARY_X4,205}},
267 {{SUMMARY_X3,377},{SUMMARY_X4,392}}, // tech
268 {{SUMMARY_X3,393},{SUMMARY_X4,408}},
269 {{SUMMARY_X3,409},{SUMMARY_X4,424}},
270 {{SUMMARY_X3,425},{SUMMARY_X4,440}},
274 //static Rect summary_plusminus_rects[NUM_CHAR_INFO * 2];
276 char *summary_names[] = { "","","","","", // stats have bitmap descriptors
277 "Guns", "Rifles", "Energy Weapons", "Grenades", "Heavy Weapons",
278 "Psi Dampening", "Projection", "Kinesis", "ESP", "Physic", "Psi Parasitism", "Telekinesis", "Telepathy", "Serenity",
279 "Computer Hacking", "Weapons Repair", "Weapons Modification", "Electronics Repair",
282 char *summary_descs[] = { "Strength is a measurement of physical prowess.", "Perception determines your awareness and \
283 likelihood of noticing small, important details and avoiding unseen dangers.", "Endurance measures how much punishment you \
284 can take and how long you can keep going under adverse conditions.","Intelligence determines your overall mental ability, and \
285 governs the effectiveness of Psionic powers.", "Agility is quickness and dexterity, being both fleet of foot and deft of hand.",
286 "Guns skill covers all normal slug-throwing one handed weapons.", "Rifles skill covers proper usage of heavier, two-handed \
287 projectile weapons", "The Energy Weapons skill is for the proper use of energy or plasma based weapons like the fusion welder.",
288 "Grenades skill covers safe and effective use of short-range explosives.", "Heavy Weapons skill is vital for the proper use of \
289 advanced, experimental or high-tech weaponry.",
290 "Psi Dampening is the discipline that covers neutralization of enemy psionic abilities.", "The Projection discipline is for out-of-body \
291 psionic abilities", "Kinesis is the art of altering molecular structures.", "The ESP displine allows the psionicist to extend their \
292 senses beyond the physical realm.", "Physic allows one to influence biological energies.", "Psi Parasitism allows you to drain psionic or physical \
293 energies from others.", "Telekinesis is the art of manipulating matter at a distance.", "Telepathy allows one to send and receive thoughts.",
294 "Serenity governs overall psi power usage and efficiency.",
295 "The Computer Hacking skill is used for many varieties of electronic larceny.", "Weapons Repair is a key field skill for\
296 fixing damaged or jammed weapons.", "Weapons Modification lets you jury-rig weapons for an extra punch.", "Electronics Repair is essential \
297 for fixing damaged high-tech equipment.",
300 static Rect cont_rect = {{526,425},{604,446}};
301 static Rect splash_rect = {{0,0}, {640,480}};
304 static LGadButtonList service_blist;
305 static LGadButtonListDesc service_blistdesc;
306 static LGadButtonList job_blist;
307 static LGadButtonListDesc job_blistdesc;
308 static LGadButtonList birth_blist;
309 static LGadButtonListDesc birth_blistdesc;
310 static LGadButtonList summary_blist;
311 static LGadButtonListDesc summary_blistdesc;
312 static LGadButtonList summary_plusminus_blist;
313 static LGadButtonListDesc summary_plusminus_blistdesc;
314 static LGadButton cont_button;
315 static LGadButton splash_button;
316 static DrawElement service_blist_elems[3];
317 static DrawElement job_blist_elems[NUM_AVAIL_JOBS];
318 static DrawElement birth_blist_elems[3];
319 static DrawElement summary_blist_elems[NUM_CHAR_INFO];
320 static DrawElement summary_plusminus_elems[NUM_CHAR_INFO * 2];
321 static DrawElement cont_elem;
322 static DrawElement splash_elem;
324 static grs_bitmap *service_blist_bitmaps[3][4];
325 static grs_bitmap *job_bitmaps[4];
326 static grs_bitmap *summary_stat_icons[5];
327 static grs_bitmap *cont_bitmap;
328 static grs_bitmap *summary_plusminus_icons[2];
329 static IRes *service_blist_handles[3][2];
330 static IRes *job_handles[2];
331 static IRes *cont_handle;
332 static IRes *summary_stat_handles[5];
333 static IRes *summary_plusminus_handles[2];
335 /* ------------------------------------------------------------ */
336 void CCharGenerator::LoadBitmaps(void)
338 #if 0
339 char temp[40];
340 int i,s;
342 cont_handle= LoadArt("cgencont.pcx",&cont_bitmap);
343 for (s = 0; s < 3; s++)
345 for (i = 0; i < 2; i++)
347 sprintf(temp,"cgen%ds%d.pcx",s+1,i+1);
348 service_blist_handles[s][i] = LoadArt(temp,&service_blist_bitmaps[s][i]);
350 for (i = 2; i < 4; i++)
352 service_blist_bitmaps[s][i] = service_blist_bitmaps[s][0];
355 for (i = 0; i < 2; i++)
357 sprintf(temp,"cgenj%d.pcx",i+1);
358 job_handles[i] = LoadArt(temp,&job_bitmaps[i]);
360 for (i = 2; i < 4; i++)
362 job_bitmaps[i] = job_bitmaps[0];
365 for (i=0;i < 5; i++)
367 sprintf(temp,"cgenicn%d.pcx",i+1);
368 summary_stat_handles[i] = LoadArt(temp,&summary_stat_icons[i]);
371 summary_plusminus_handles[0] = LoadArt("cgenplus.pcx",&summary_plusminus_icons[0]);
372 summary_plusminus_handles[1] = LoadArt("cgenminu.pcx",&summary_plusminus_icons[1]);
374 // set up the continue button
375 cont_elem.draw_type = DRAWTYPE_BITMAP;
376 cont_elem.draw_data = cont_bitmap;
377 #endif
380 #define UnlockAndRelease(res) { res->Unlock(); SafeRelease(res); }
382 /* ------------------------------------------------------------ */
383 void CCharGenerator::FreeBitmaps(void)
385 #if 0
386 int s,i;
388 UnlockAndRelease(cont_handle);
389 for (s = 0; s < 3; s++)
391 for (i = 0; i < 2; i++)
393 UnlockAndRelease(service_blist_handles[s][i]);
396 for (i = 0; i < 2; i++)
398 UnlockAndRelease(job_handles[i]);
400 for (i=0; i < 5; i++)
402 UnlockAndRelease(summary_stat_handles[i]);
404 for (i = 0; i < 2; i++)
406 UnlockAndRelease(summary_plusminus_handles[i]);
408 #endif
411 #pragma off(unreferenced)
413 /* ------------------------------------------------------------ */
414 bool CCharGenerator::KeyHandler(uiEvent *ev, Region *reg, void *data)
416 uiCookedKeyEvent *key = (uiCookedKeyEvent *)ev;
417 int code = key->code;
418 return(gCharGenerator->ProcessKey(code));
421 /* ------------------------------------------------------------ */
422 bool CCharGenerator::ProcessKey(int code)
424 if (m_state != KGenCharSummary) // Birth)
425 return (FALSE);
427 int n = strlen(m_name);
429 if (isalpha(code) || isspace(code))
431 m_name[n] = code;
432 m_name[n+1] = '\0';
434 else
436 switch (code)
438 case KEY_BS:
439 if (n > 0)
440 m_name[n-1] = '\0';
441 break;
444 DrawBirthName();
445 return(TRUE);
447 /* ------------------------------------------------------------ */
448 static bool cont_cb(short action, void* data, LGadBox* vb)
450 if (action == MOUSE_LUP)
452 uiDefer(CCharGenerator::ContinueFunc,NULL);
453 // do continue code
454 return(TRUE);
456 else
457 return(FALSE);
459 /* ------------------------------------------------------------ */
460 static bool service_select_cb(ushort action, int button, void* data, LGadBox* vb)
462 gCharGenerator->ChooseService(button);
464 return TRUE;
466 /* ------------------------------------------------------------ */
467 static bool job_select_cb(ushort action, int button, void* data, LGadBox* vb)
469 gCharGenerator->ChooseMission(button);
471 return TRUE;
473 /* ------------------------------------------------------------ */
474 static bool birth_select_cb(ushort action, int button, void* data, LGadBox* vb)
476 gCharGenerator->ChooseTrait(button);
478 return TRUE;
480 /* ------------------------------------------------------------ */
481 static bool summary_select_cb(ushort action, int button, void* data, LGadBox* vb)
483 gCharGenerator->ChooseSummary(button);
485 return TRUE;
487 /* ------------------------------------------------------------ */
488 static bool summary_plusminus_cb(ushort action, int button, void* data, LGadBox* vb)
490 if (action == MOUSE_LUP)
492 gCharGenerator->PlusMinus(button);
493 return(TRUE);
495 else
496 return(FALSE);
498 #pragma on(unreferenced)
499 /* ------------------------------------------------------------ */
500 // note fullwise the stupid hackery
501 char *service_texts[3] = {
502 "You won't find the OSA in any traditional military texts. This \"black ops\" group specializes in covert activities and \
503 plausible deniability. The main focus here is on subversion and psionics rather than weapons training and combat.",
504 "The Marines handle the roughest, toughest fighting in the modern military. Although subtlety is not their forte, the quality \
505 of weapons training in the Marines is the best around. A very small amount of technical and psionic training can be found, for specialty \
506 jobs.",
507 "A tour of duty in the Navy isn't just hot-dogging around in the latest fighter jets. Naval ground forces are deployed \
508 to a variety of extra-planetary targets and have to perform in a wide variety of military operations. Training in the navy \
509 is the most well-rounded of all the services, with an even mix of weapons, technical, and psionic operations.",
512 #define TEXT_SIZE 1024
513 #define SERVICE_TEXT_X 410
514 #define SERVICE_TEXT_Y 38
515 #define SERVICE_TEXT_WIDTH 200
516 #define SERVICE_TEXT_HEIGHT 280
518 void CCharGenerator::DrawServiceText(EService serv)
520 Rect r = {{ SERVICE_TEXT_X, SERVICE_TEXT_Y}, {SERVICE_TEXT_X + SERVICE_TEXT_WIDTH, SERVICE_TEXT_Y + SERVICE_TEXT_HEIGHT}};
521 DrawUnwrappedText(service_texts[serv],&r,FALSE);
523 /* ------------------------------------------------------------ */
524 #define JOB_TEXT_X 430
525 #define JOB_TEXT_Y 80
526 #define JOB_TEXT_WIDTH 200
527 #define JOB_TEXT_HEIGHT 140
529 void CCharGenerator::DrawJobShortDesc()
531 int i;
532 Rect r;
533 for (i=0; i < NUM_AVAIL_JOBS; i++)
535 r.ul.x = job_rects[i].lr.x + 10;
536 r.ul.y = job_rects[i].ul.y;
537 r.lr.x = JOB_TEXT_X + JOB_TEXT_WIDTH;
538 r.lr.y = job_rects[i].lr.y;
539 if (job_avail[m_year][i] != -1)
540 DrawUnwrappedText(job_db[job_avail[m_year][i]].shortdesc,&r, FALSE);
543 /* ------------------------------------------------------------ */
544 void CCharGenerator::DrawJobLongDesc()
546 Rect r = {{ JOB_TEXT_X, JOB_TEXT_Y}, {JOB_TEXT_X + JOB_TEXT_WIDTH, JOB_TEXT_Y + JOB_TEXT_HEIGHT}};
547 DrawUnwrappedText(job_db[m_mission].longdesc,&r, FALSE);
549 /* ------------------------------------------------------------ */
550 void CCharGenerator::DrawYearInfo()
552 char temp[255];
553 sprintf(temp,"YEAR: %d",m_year+1);
554 gr_font_string(m_font,temp, 8, 8);
556 /* ------------------------------------------------------------ */
557 char *trait_descs[] = { "You are a big, stupid lug. Duh. Need I say more?",
558 "Your metabolism is super speedy, ya drug addicted freak!",
559 "You are a creepy mutant. You'll be at home in LA, but no where else.",
561 void CCharGenerator::DrawTraitDesc()
563 Rect r = {{ JOB_TEXT_X, JOB_TEXT_Y}, {JOB_TEXT_X + JOB_TEXT_WIDTH, JOB_TEXT_Y + JOB_TEXT_HEIGHT}};
564 DrawUnwrappedText(trait_descs[m_trait],&r);
566 /* ------------------------------------------------------------ */
567 char *trait_text[] = { "Big Lug", "Fast Metabolism", "Freaky Personality" };
568 void CCharGenerator::DrawBirthTraits()
570 int i;
571 Rect r;
572 for (i=0; i < 3; i++)
574 r.ul.x = birth_rects[i].lr.x + 10;
575 r.ul.y = birth_rects[i].ul.y;
576 r.lr.x = JOB_TEXT_X - 25;
577 r.lr.y = birth_rects[i].lr.y;
578 DrawUnwrappedText(trait_text[i],&r);
581 /* ------------------------------------------------------------ */
582 void CCharGenerator::DrawBirthName()
584 char temp[255];
585 Rect r1 = {{17,12},{230,26}}; //{{177,46}, {377,96}};
586 Rect r2 = {{239,12},{296,26}};
587 Rect r3 = {{307,12},{383,26}};
588 Rect r4 = {{395,12},{450,26}};
589 Rect r5 = {{19,209},{103,223}};
590 sprintf(temp,"%s",m_name);
591 DrawUnwrappedText(temp,&r1,FALSE);
593 DrawUnwrappedText("Male",&r2,FALSE);
595 DrawUnwrappedText("Sergeant",&r3,FALSE);
597 sprintf(temp,"Age: %d",m_year + 22);
598 DrawUnwrappedText(temp,&r4,FALSE);
600 DrawUnwrappedText("Crack Shot",&r5, FALSE);
602 /* ------------------------------------------------------------ */
603 #define TELETYPE_TEXT_X 450
604 #define TELETYPE_TEXT_Y 150
605 #define TELETYPE_TEXT_WIDTH 170
606 #define TELETYPE_TEXT_HEIGHT 200
607 void CCharGenerator::DrawTeletypeText(void)
609 // Only do teletype in Debriefing
610 if (m_state != KGenDebriefing)
611 return;
613 // Are we done teletyping?
614 if (m_teletime == 0)
615 return;
617 // Don't bother if we have no results text (should never happen in structured demonstration)
618 if (job_db[m_mission].results == NULL)
619 return;
621 Rect r = {{ TELETYPE_TEXT_X, TELETYPE_TEXT_Y}, {TELETYPE_TEXT_X + TELETYPE_TEXT_WIDTH, TELETYPE_TEXT_Y + TELETYPE_TEXT_HEIGHT}};
622 int num_chars;
623 char tele_text[TEXT_SIZE];
624 char temp_text[TEXT_SIZE];
626 if (m_teletime == -1)
627 num_chars = strlen(job_db[m_mission].results) + 1;
628 else
629 // compute how many characters to draw
630 num_chars = (tm_get_millisec() - m_teletime) / (1000 / 25);
632 // copy just enough of the mission result text
633 strcpy(temp_text, job_db[m_mission].results);
634 gr_font_string_wrap(m_font, temp_text, RectWidth(&r));
635 strncpy(tele_text, temp_text, num_chars);
636 tele_text[num_chars] = '\0';
637 if (num_chars > strlen(temp_text))
638 m_teletime = 0; // stop teletyping
640 // draw it
641 DrawWrappedText(tele_text, &r, FALSE);
643 /* ------------------------------------------------------------ */
644 #define PLUSMINUS_BITMAP_SIZE 15
645 #define PLUSMINUS_X1 138
646 #define PLUSMINUS_X2 156
647 #define PLUSMINUS_X3 416
648 #define PLUSMINUS_X4 436
649 //#define SUMMARY_STATTEXT_WIDTH 139
650 #define SUMMARY_STAT_X1 104
651 #define SUMMARY_STAT_X2 383
652 #define SUMMARY_STATVAL_WIDTH 28
653 //#define SUMMARY_PLUSMINUS_WIDTH ((PLUSMINUS_BITMAP_SIZE * 2) + 4)
654 #define SUMMARY_COST_X1 187
655 #define SUMMARY_COST_X2 459
656 #define SUMMARY_COST_WIDTH 26
657 #define SUMMARY_SUBSKILL_X 489
658 #define SUMMARY_SUBSKILL_WIDTH 127
659 #define SUMMARY_POOL_X 592
660 #define SUMMARY_POOL_Y 14
662 #define NUM_SKILL_COLORS 20
663 int skill_colors[NUM_SKILL_COLORS] = {
664 21, 41, 39, 37, 35, 33, 248, 246, 244, 242,
665 240, 109, 87, 85, 83, 81, 79, 78, 253, 231,
667 void CCharGenerator::DrawSummaryStats()
670 int i;
671 Rect r;
672 char temp[255];
673 for (i=0; i < NUM_CHAR_INFO; i++)
675 if (i < WPN_1) // column 1
677 r.ul.x = SUMMARY_STAT_X1;
678 m_color = skill_colors[m_player->m_info[i] * 4];
680 else
682 r.ul.x = SUMMARY_STAT_X2;
683 m_color = skill_colors[m_player->m_info[i]];
685 r.ul.y = summary_rects[i].ul.y;
686 r.lr.x = r.ul.x + SUMMARY_STATVAL_WIDTH;
687 r.lr.y = summary_rects[i].lr.y;
688 sprintf(temp,"%d",m_player->m_info[i]); // ,m_player->StatCost(i));
689 DrawWrappedText(temp,&r);
690 m_color = -1;
692 if (i < WPN_1)
693 r.ul.x = SUMMARY_COST_X1;
694 else
695 r.ul.x = SUMMARY_COST_X2;
696 r.ul.y = summary_rects[i].ul.y;
697 r.lr.x = r.ul.x + SUMMARY_COST_WIDTH;
698 r.lr.y = summary_rects[i].lr.y;
699 sprintf(temp,"(%d)",m_player->StatCost(i));
700 DrawWrappedText(temp,&r);
703 sprintf(temp, "%d",m_player->m_pool);
704 r.ul.x = SUMMARY_POOL_X;
705 r.ul.y = SUMMARY_POOL_Y;
706 r.lr.x = r.ul.x + 50;
707 r.lr.y = r.ul.y + 10;
708 DrawWrappedText(temp,&r, FALSE);
711 /* ------------------------------------------------------------ */
712 #define SUMMARY_TEXT_X 14
713 #define SUMMARY_TEXT_Y 324
714 #define SUMMARY_TEXT_WIDTH 200
715 #define SUMMARY_TEXT_HEIGHT 123
716 void CCharGenerator::DrawSummaryDesc()
718 Rect r = {{ SUMMARY_TEXT_X, SUMMARY_TEXT_Y}, {SUMMARY_TEXT_X + SUMMARY_TEXT_WIDTH, SUMMARY_TEXT_Y + SUMMARY_TEXT_HEIGHT}};
719 if (m_summary_focus != -1)
720 DrawUnwrappedText(summary_descs[m_summary_focus],&r,FALSE);
722 /* ------------------------------------------------------------ */
724 char *summary_subskill_text[NUM_CHAR_INFO][NUM_SUBSKILLS] = {
725 { "", "", "", "" ,"" },
726 { "", "", "", "" ,"" },
727 { "", "", "", "" ,"" },
728 { "", "", "", "" ,"" },
729 { "", "", "", "" ,"" },
730 {"Viper G9", "Kord 5.9", "Muerte 800 XL", "Diablo 666", "\"Hawk\" Auto." },
731 {"Sniper Rifle","DoomBringer","Assault Rifle", "Xygar A9","SmartShooter"},
732 {"HS-1138 \"Falcon\"","Neural Agg.","Plasma Gun","EMP Pulse Rifle","AK-4700 Laser"},
733 {"Conc. Grenade","Timer Grenade","Starflare Gren.","Smoke Grenade","EMP Grenade", },
734 {"Port. Launcher","Quantum Decel.","Field Gen.","Plasma Cannon",""},
735 {"Psi Deaden", "Psi Chaff","","",""}, //0
736 {"Astral Projection", "Time Travel", "","",""}, //1
737 {"Cyber-Psi","Dampen","Energy Shield", "Shock","" },//2
738 {"Clairvoyance", "Clairaudience", "Precognition","",""},//3
739 {"Healing","Cure Poison","Cure Radiation","Sense Aura",""},//4
740 {"Psi Drain","Soma Drain","Psyche Drain", "",""},//5
741 {"Levitate","Cryokinesis","Pyrokinesis","Push","Pull",},//6
742 {"Suggestion","Confuse","Decoy","Chameleon","Mind Terror",},//7
743 {"Control","Focus","Respect","Perspective","Balance",},//8
747 void CCharGenerator::DrawSummarySubskills()
749 SubskillGuts(0);
750 SubskillGuts(1);
753 void CCharGenerator::SubskillGuts(int skill_base)
756 Rect r;
757 int i;
758 int skill_type;
759 char temp[32];
761 if (m_subskills[skill_base] == -1)
762 return;
764 if (skill_base == 0)
765 skill_type = WPN_1;
766 else
767 skill_type = PSI_1;
769 for (i=0; i < NUM_SUBSKILLS; i++)
771 char *textp = summary_subskill_text[m_subskills[skill_base]][i];
772 if ((textp == NULL) || (strlen(textp) == 0))
773 continue;
775 int lvl = m_player->GetSubskillLevel(m_subskills[skill_base],i);
776 if (lvl >= NUM_SKILL_COLORS)
777 lvl = NUM_SKILL_COLORS - 1;
778 if (lvl < 0)
779 lvl = 0;
780 m_color = skill_colors[lvl];
782 r.ul.x = SUMMARY_SUBSKILL_X;
783 r.ul.y = summary_rects[skill_type+i].ul.y + (RectHeight(&summary_rects[skill_type+i]) -
784 gr_font_string_height(m_font,textp))/2;
785 r.lr.x = r.ul.x + SUMMARY_SUBSKILL_WIDTH;
786 r.lr.y = summary_rects[skill_type+i].lr.y;
787 DrawUnwrappedText(textp,&r,FALSE);
789 r.ul.x = r.lr.x - 20;
790 sprintf(temp,"%d%%",lvl*5);
791 DrawUnwrappedText(temp,&r,FALSE);
793 m_color = -1;
796 /* ------------------------------------------------------------ */
797 void CCharGenerator::DrawUnwrappedText(char *text, Rect *r, bool center)
799 char display_text[TEXT_SIZE];
800 // load up the text
801 strcpy(display_text,text);
802 // wrap
803 gr_font_string_wrap(m_font, display_text, RectWidth(r));
804 DrawWrappedText(display_text,r,center);
806 /* ------------------------------------------------------------ */
807 void CCharGenerator::DrawWrappedText(char *text, Rect *r, bool center)
809 int s1,s2,s3,s4;
810 int w,h;
811 int dx,dy;
812 if (center)
814 w = gr_font_string_width(m_font,text);
815 h = gr_font_string_height(m_font,text);
816 dx = r->ul.x + (RectWidth(r)-w)/2;
817 dy = r->ul.y + (RectHeight(r)-h)/2;
819 else
821 w = RectWidth(r);
822 h = RectHeight(r);
823 dx = r->ul.x;
824 dy = r->ul.y;
827 // clear out area
828 gr_get_cliprect(&s1,&s2,&s3,&s4);
829 gr_set_cliprect(dx,dy,dx+w,dy+h);
830 DrawBackground();
831 gr_set_cliprect(s1,s2,s3,s4);
833 // draw it
834 if (m_color == -1)
835 gr_set_fcolor(guiStyleGetColor(NULL,StyleColorWhite));
836 else
837 gr_set_fcolor(m_color);
838 gr_font_string(m_font, text, dx, dy);
840 /* ------------------------------------------------------------ */
841 void CCharGenerator::BuildInterface(EGenState state)
843 #if 0
844 int n,i;
845 int count;
846 //char temp[255];
848 // build the relevant buttons, display the relevant art
849 // install appropriate callbacks, and so forth
850 if (m_font == NULL)
852 m_font = (grs_font *)ResLock (RES_EditorFont);
855 DrawBackground(state);
857 switch (state)
859 case KGenSplash:
860 case KGenMain:
861 splash_elem.draw_type = DRAWTYPE_NONE;
862 splash_elem.draw_flags = INTERNAL(DRAWFLAG_INT_TRANSP);
863 LGadCreateButtonArgs(&splash_button, LGadCurrentRoot(), splash_rect.ul.x, splash_rect.ul.y,
864 RectWidth(&splash_rect), RectHeight(&splash_rect), &splash_elem, cont_cb, 0);
865 break;
866 case KGenBirth:
867 for (n=0; n < 3; n++)
869 DrawElement *elem = &birth_blist_elems[n];
870 elem->draw_type = DRAWTYPE_BITMAPOFFSET;
871 elem->draw_data = job_bitmaps;
872 elem->draw_data2 = (void *)4; // should be 2 but hackery required
873 //elem->draw_flags = BORDER(DRAWFLAG_BORDER_OUTLINE);
875 birth_blistdesc.num_buttons = 3;
876 birth_blistdesc.button_rects = birth_rects;
877 birth_blistdesc.button_elems = birth_blist_elems;
878 birth_blistdesc.cb = birth_select_cb;
879 birth_blistdesc.flags = BUTTONLIST_RADIO_FLAG;
881 LGadCreateButtonListDesc(&birth_blist, LGadCurrentRoot(), &birth_blistdesc);
883 LGadCreateButtonArgs(&cont_button, LGadCurrentRoot(), cont_rect.ul.x, cont_rect.ul.y,
884 RectWidth(&cont_rect), RectHeight(&cont_rect), &cont_elem, cont_cb, 0);
886 DrawBirthTraits();
887 DrawTraitDesc();
889 break;
890 case KGenSelectService:
892 // make a button for each service, ie a button list
893 for (n=0; n < 3; n++)
895 DrawElement *elem = &service_blist_elems[n];
896 elem->draw_type = DRAWTYPE_NONE;
897 elem->draw_flags = INTERNAL(DRAWFLAG_INT_TRANSP);
899 elem->draw_type = DRAWTYPE_BITMAPOFFSET;
900 elem->draw_data = service_blist_bitmaps[n];
901 elem->draw_data2 = (void *)4; // should be 2 but hackery required
904 // and a confirm button
905 LGadCreateButtonArgs(&cont_button, LGadCurrentRoot(), cont_rect.ul.x, cont_rect.ul.y,
906 RectWidth(&cont_rect), RectHeight(&cont_rect), &cont_elem, cont_cb, 0);
908 service_blistdesc.num_buttons = 3;
909 service_blistdesc.button_rects = service_rects;
910 service_blistdesc.button_elems = service_blist_elems;
911 service_blistdesc.cb = service_select_cb;
912 service_blistdesc.flags = BUTTONLIST_RADIO_FLAG;
914 LGadCreateButtonListDesc(&service_blist, LGadCurrentRoot(), &service_blistdesc);
916 // and the text/art area
917 DrawServiceText();
919 break;
921 case KGenChooseMission:
922 // figure out what missions are available
923 // create the selection buttons
924 // the continue button is still around from the service selection, wahoo
925 // make a button for each service, ie a button list
926 count = 0;
927 for (n=0; n < NUM_AVAIL_JOBS; n++)
929 if (job_avail[m_year][n] != -1)
931 count++;
932 DrawElement *elem = &job_blist_elems[n];
933 elem->draw_type = DRAWTYPE_BITMAPOFFSET;
934 elem->draw_data = job_bitmaps;
935 elem->draw_data2 = (void *)4; // should be 2 but hackery required
936 elem->draw_flags = INTERNAL(DRAWFLAG_INT_TRANSP);
937 //elem->draw_flags = BORDER(DRAWFLAG_BORDER_OUTLINE);
940 job_blistdesc.num_buttons = count; // NUM_AVAIL_JOBS;
941 job_blistdesc.button_rects = job_rects;
942 job_blistdesc.button_elems = job_blist_elems;
943 job_blistdesc.cb = job_select_cb;
944 job_blistdesc.flags = BUTTONLIST_RADIO_FLAG;
946 LGadCreateButtonListDesc(&job_blist, LGadCurrentRoot(), &job_blistdesc);
948 LGadCreateButtonArgs(&cont_button, LGadCurrentRoot(), cont_rect.ul.x, cont_rect.ul.y,
949 RectWidth(&cont_rect), RectHeight(&cont_rect), &cont_elem, cont_cb, 0);
951 // Draw in short descs
952 DrawJobShortDesc();
954 // Draw the long desc for the default selected obj
955 m_mission = job_avail[m_year][0];
956 DrawJobLongDesc();
958 DrawYearInfo();
960 break;
962 case KGenDebriefing:
963 // the gorgeous art in the background, of course, already drawn up top
965 // a "go on" button, could say two things based on whether exit or mission select is next?
966 LGadCreateButtonArgs(&cont_button, LGadCurrentRoot(), cont_rect.ul.x, cont_rect.ul.y,
967 RectWidth(&cont_rect), RectHeight(&cont_rect), &cont_elem, cont_cb, 0);
969 // debriefing tele-type is handled on a frame by frame basis
970 m_teletime = tm_get_millisec(); //GetSimTime();
971 break;
973 case KGenCharSummary:
974 case KGenGameSummary:
975 // detailed character summary
976 // button for each line
977 for (n=0; n < NUM_CHAR_INFO; n++)
979 DrawElement *elem = &summary_blist_elems[n];
980 if (n >= WPN_BASE) // ie, not a stat
982 elem->draw_type = DRAWTYPE_TEXT;
983 elem->draw_data = summary_names[n];
984 elem->fcolor = guiStyleGetColor(NULL,StyleColorWhite);
985 elem->draw_flags = FORMAT(DRAWFLAG_FORMAT_LEFT)|INTERNAL(DRAWFLAG_INT_TRANSP);
987 else
989 elem->draw_type = DRAWTYPE_NONE; //DRAWTYPE_BITMAP;
990 elem->draw_data = summary_stat_icons[n];
991 elem->draw_flags = INTERNAL(DRAWFLAG_INT_TRANSP);
995 summary_blistdesc.num_buttons = NUM_CHAR_INFO;
996 summary_blistdesc.button_rects = summary_rects;
997 summary_blistdesc.button_elems = summary_blist_elems;
998 summary_blistdesc.cb = summary_select_cb;
999 summary_blistdesc.flags = BUTTONLIST_RADIO_FLAG;
1001 LGadCreateButtonListDesc(&summary_blist, LGadCurrentRoot(), &summary_blistdesc);
1003 // now create the GIANT HORDE of plus/minus buttons
1004 for (n=0; n < NUM_CHAR_INFO; n++)
1006 for (i=0; i< 2; i++)
1008 DrawElement *elem = &summary_plusminus_elems[(n*2)+i];
1009 Rect r;
1010 elem->draw_type = DRAWTYPE_NONE; // DRAWTYPE_BITMAP;
1011 elem->draw_data = summary_plusminus_icons[i];
1012 elem->draw_flags = INTERNAL(DRAWFLAG_INT_TRANSP);
1013 if (n < WPN_1)
1015 r.ul.x = PLUSMINUS_X1+(i*25);
1016 r.lr.x = PLUSMINUS_X2+(i*25);
1018 else
1020 r.ul.x = PLUSMINUS_X3+(i*20);
1021 r.lr.x = PLUSMINUS_X4+(i*20);
1023 r.ul.y = summary_rects[n].ul.y;
1024 r.lr.y = summary_rects[n].lr.y;
1025 summary_plusminus_rects[(n*2)+i] = r;
1029 summary_plusminus_blistdesc.num_buttons = NUM_CHAR_INFO * 2;
1030 summary_plusminus_blistdesc.button_rects = summary_plusminus_rects;
1031 summary_plusminus_blistdesc.button_elems = summary_plusminus_elems;
1032 summary_plusminus_blistdesc.cb = summary_plusminus_cb;
1034 LGadCreateButtonListDesc(&summary_plusminus_blist, LGadCurrentRoot(), &summary_plusminus_blistdesc);
1036 // the omnipresent continue button
1037 LGadCreateButtonArgs(&cont_button, LGadCurrentRoot(), cont_rect.ul.x, cont_rect.ul.y,
1038 RectWidth(&cont_rect), RectHeight(&cont_rect), &cont_elem, cont_cb, 0);
1040 DrawSummaryStats();
1041 DrawSummaryDesc();
1042 DrawSummarySubskills();
1043 DrawBirthName();
1044 break;
1046 LGadDrawBox(VB(LGadCurrentRoot()),NULL);
1047 #endif
1050 /* ------------------------------------------------------------ */
1051 void CCharGenerator::DestroyInterface(void)
1053 #if 0
1054 // eliminate all those pesky buttons we just built
1055 LGadHideBox(VB(LGadCurrentRoot()),TRUE);
1056 switch (m_state)
1058 case KGenSplash:
1059 case KGenMain:
1060 LGadDestroyBox(VB(&splash_button),FALSE);
1061 break;
1062 case KGenBirth:
1063 LGadDestroyButtonList(&birth_blist);
1064 LGadDestroyBox(VB(&cont_button),FALSE);
1065 break;
1066 case KGenSelectService:
1067 LGadDestroyButtonList(&service_blist);
1068 LGadDestroyBox(VB(&cont_button),FALSE);
1069 break;
1070 case KGenChooseMission:
1071 LGadDestroyButtonList(&job_blist);
1072 LGadDestroyBox(VB(&cont_button),FALSE);
1073 break;
1074 case KGenDebriefing:
1075 LGadDestroyBox(VB(&cont_button),FALSE);
1076 break;
1077 case KGenCharSummary:
1078 case KGenGameSummary:
1079 LGadDestroyButtonList(&summary_blist);
1080 LGadDestroyButtonList(&summary_plusminus_blist);
1081 LGadDestroyBox(VB(&cont_button),FALSE);
1082 break;
1084 LGadHideBox(VB(LGadCurrentRoot()),FALSE);
1085 #endif
1088 /* ------------------------------------------------------------ */
1089 void CCharGenerator::ChangeState(EGenState newstate)
1091 // WARNING: Don't call this function from inside an interface callback! It is likely to
1092 // destroy the very interface elements that triggered it if you do!
1094 // just take down the old
1095 DestroyInterface();
1096 m_state = newstate;
1097 // and bring in the new
1098 BuildInterface();
1101 /* ------------------------------------------------------------ */
1102 // only call this once for each mission!
1103 void CCharGenerator::ApplyMissionStats(int mission_id)
1105 // poke around in the character class and modify lots of data
1106 // based on the data in the mission database
1107 //printf("Applying mission num %d (type %d)\n",mission_id,jobs_list[m_service][mission_id].jobtype);
1108 //printf("%s\n",jobs_list[m_service][mission_id].results);
1111 /* ------------------------------------------------------------ */
1112 // Interface callbacks
1113 /* ------------------------------------------------------------ */
1114 // this is static
1115 void CCharGenerator::ContinueFunc(void *arg)
1117 gCharGenerator->ContinueGuts();
1120 /* ------------------------------------------------------------ */
1121 // note this does all sorts of interface destruction, so if we can't do that from within
1122 // a button callback we will have to trigger this indirectly via a message or somesuch,
1123 // thus the purpose of ContinueFunc, which can be uiDefered
1124 void CCharGenerator::ContinueGuts(void)
1126 #if 0
1127 SFX_Play_Raw(SFX_STATIC, NULL, "BEEP1");
1128 switch (m_state)
1130 case KGenSplash:
1131 //ChangeState(KGenBirth);
1132 ChangeState(KGenMain);
1133 break;
1135 case KGenMain:
1136 ChangeState(KGenCharSummary);
1137 break;
1139 case KGenBirth:
1140 ChangeState(KGenSelectService);
1141 break;
1143 case KGenSelectService:
1144 // move along to mission selection
1145 ChangeState(KGenChooseMission);
1146 break;
1148 case KGenChooseMission:
1150 // move along to debriefing
1151 ChangeState(KGenDebriefing); // hack
1152 break;
1154 case KGenDebriefing:
1155 // apply results
1156 #if 0
1157 switch (m_year)
1159 case 0:
1160 // +3 hvy +1 repair -1 CON
1161 gChar->m_info[WPN_5] += 3;
1162 gChar->m_info[TECH_2] += 1;
1163 gChar->m_info[STAT_3] -= 1;
1164 gChar->m_pool += 10;
1165 break;
1166 case 1:
1167 // ESP, telepath, proj +3
1168 gChar->m_info[PSI_4] += 3;
1169 gChar->m_info[PSI_2] += 3;
1170 gChar->m_info[PSI_8] += 3;
1171 gChar->m_pool += 10;
1172 break;
1173 case 2:
1174 // DEX +2, energy + 5
1175 gChar->m_info[STAT_5] += 2;
1176 gChar->m_info[WPN_3] += 3;
1177 gChar->m_pool += 10;
1178 break;
1179 case 0:
1180 // +3 energy, +2 PER, +2 CON
1181 gChar->m_info[WPN_3] += 3;
1182 gChar->m_info[STAT_2] += 2;
1183 gChar->m_info[STAT_3] += 2;
1184 gChar->m_pool += 10;
1185 break;
1187 #endif
1189 // increment our age
1190 m_year++;
1192 if (m_year == 3) //5)
1194 ILoop* looper = AppGetObj(ILoop);
1195 ILoop_EndMode(looper, 0); // This is to "pop" the loopmode
1196 SafeRelease(looper);
1197 // cd music hack
1198 CDStopPlay();
1200 else
1201 ChangeState(KGenCharSummary);
1202 break;
1204 case KGenCharSummary:
1205 // either go on to exit, or back to mission selection, based on years
1206 if (m_year >= NUM_TRAINING_YEARS)
1208 // then get on with our lives (ie send a message to go to normal game mode, or pop mode stack)
1209 ILoop* looper = AppGetObj(ILoop);
1210 ILoop_EndMode(looper, 0); // This is to "pop" the loopmode
1211 SafeRelease(looper);
1213 else
1215 // should be a character summary screen
1216 ChangeState(KGenChooseMission);
1219 break;
1220 case KGenGameSummary:
1221 ILoop* looper = AppGetObj(ILoop);
1222 ILoop_EndMode(looper, 0); // This is to "pop" the loopmode
1223 SafeRelease(looper);
1225 #endif
1227 /* ------------------------------------------------------------ */
1228 void CCharGenerator::ChooseService(int button_num)
1230 m_service = (EService)(button_num);
1232 // update art area
1233 DrawServiceText();
1235 /* ------------------------------------------------------------ */
1236 void CCharGenerator::ChooseMission(int button_num)
1238 m_mission = job_avail[m_year][button_num];
1240 // update interface
1241 DrawJobLongDesc();
1243 /* ------------------------------------------------------------ */
1244 void CCharGenerator::ChooseTrait(int button_num)
1246 m_trait = button_num;
1248 // update interface
1249 DrawTraitDesc();
1251 /* ------------------------------------------------------------ */
1252 void CCharGenerator::ChooseSummary(int button_num, bool redraw)
1254 #if 0
1255 m_summary_focus = button_num;
1256 if ((button_num >= WPN_1) && (button_num < PSI_1))
1257 m_subskills[0] = button_num;
1258 else if ((button_num >= PSI_1) && (button_num < TECH_1))
1259 m_subskills[1] = button_num;
1261 if (redraw)
1263 ChangeState(m_state);
1264 // update interface
1265 DrawSummaryDesc();
1267 // if it's a skill, also update the subskill area
1268 DrawSummarySubskills();
1270 #endif
1272 /* ------------------------------------------------------------ */
1273 void CCharGenerator::PlusMinus(int button)
1275 //m_player->SpendPool(button/2,button%2);
1276 //ChooseSummary(button/2);
1279 /* ------------------------------------------------------------ */
1280 // When the player picks the "start over" button from the exit screen.
1281 // Note that due to state changing we need to trigger this "safely" ie from within a message
1282 // NOT USED IN PROTOTYPE
1283 void CCharGenerator::Restart(void)
1286 /* ------------------------------------------------------------ */
1288 #endif