2 @Copyright Looking Glass Studios, Inc.
3 1996,1997,1998,1999,2000 Unpublished Work.
6 // $Header: r:/t2repos/thief2/src/dark/drkdebrf.cpp,v 1.22 2000/03/23 21:33:06 adurant Exp $
67 // Include these last!
74 kFictionGoals
= 1 << 1,
78 class cObjectivesBase
: public cDarkPanel
81 cObjectivesBase(const sDarkPanelDesc
*desc
, ulong flags
)
82 : cDarkPanel(desc
), mFlags(flags
)
86 ~cObjectivesBase() {};
90 BOOL
DisplayFits(const Rect
& r
, grs_font
* font
);
96 memset(&mTextStyle
,0,sizeof(mTextStyle
));
97 // default to current style colors
98 AssertMsg(GetCurrentStyle(),"No current style for diff defaults");
99 memcpy(mTextStyle
.colors
,GetCurrentStyle()->colors
,sizeof(mTextStyle
.colors
));
100 uiGameLoadStyle("goal_text_",&mTextStyle
,mResPath
);
102 memset(&mGreyStyle
,0,sizeof(mGreyStyle
));
103 // default to current style colors
104 AssertMsg(GetCurrentStyle(),"No current style for diff defaults");
105 memcpy(mGreyStyle
.colors
,GetCurrentStyle()->colors
,sizeof(mGreyStyle
.colors
));
106 uiGameLoadStyle("grey_",&mGreyStyle
,mResPath
);
111 uiGameUnloadStyle(&mTextStyle
);
112 uiGameUnloadStyle(&mGreyStyle
);
113 cDarkPanel::TermUI();
123 kLeftGoalTextMargin
= 16,
124 kStatsVertSeparator
= 16,
133 static int compute_yspace(grs_font
* font
)
135 int retval
= gr_font_string_height(font
,"X")/4;
136 if (retval
> kMinYSpace
)
149 static eDrawGoalResult
should_draw_goal(IQuestData
* pQuest
, int i
)
151 cStr var
= GoalStateVarName(i
);
152 // If there's no goal state, then we've passed the last goal
153 if (!pQuest
->Exists(var
))
156 cStr visvar
= GoalVisibleVarName(i
);
157 // Check to see if the goal is visible
158 if (!pQuest
->Get(visvar
))
161 int state
= pQuest
->Get(var
);
163 int diff
= pQuest
->Get(DIFF_QVAR
);
165 // check against min difficulty
166 cStr minvar
= GoalMinDiffVarName(i
);
167 if (pQuest
->Exists(minvar
)
168 && diff
< pQuest
->Get(minvar
))
172 // check against max difficulty
173 cStr maxvar
= GoalMaxDiffVarName(i
);
174 if (pQuest
->Exists(maxvar
)
175 && diff
> pQuest
->Get(maxvar
))
181 void cObjectivesBase::RedrawDisplay()
184 Rect
& area
= mRects
[num_butts
];
186 int compose_flags
= ComposeFlagRead
|ComposeFlagClear
;
187 GUIsetup(&c
,&area
,(GUIcomposeFlags
)compose_flags
,GUI_CANV_ANY
);
189 int max
= RectHeight(&area
);
190 int width
= RectWidth(&area
);
196 guiStyleSetupFont(&mTextStyle
,StyleFontNormal
);
197 IRes
* altfont
= NULL
;
200 // If the display doesn't fit, use the smaller font
202 BOOL show_stats
= mFlags
& kShowStats
;
204 if (!show_stats
&& !DisplayFits(area
,gr_get_font()))
207 static const char* alt_fonts
[] = { "textfont", "smalfont" };
208 int nfonts
= (sizeof(alt_fonts
)/sizeof(alt_fonts
[0]));
210 guiStyleCleanupFont(&mTextStyle
,StyleFontNormal
);
213 for (int i
= 0; i
< nfonts
; i
++)
216 sprintf(var
,"%s_alt_font_%d",panel_name
,i
);
217 const char* fontname
= alt_fonts
[i
];
220 if (config_get_raw(var
,buf
,sizeof(buf
)))
222 // Grab the tiny font and go
226 SafeRelease(altfont
);
227 altfont
= pResMan
->Bind(fontname
,RESTYPE_FONT
,NULL
,mResPath
);
229 grs_font
* font
= (grs_font
*)altfont
->Lock();
231 if (DisplayFits(area
,font
))
242 Warning(("No objectives font could fit, using smallest\n"));
243 gr_set_font((grs_font
*)altfont
->Lock());
247 int yspace
= compute_yspace(gr_get_font());
258 sprintf(buf
,"title_%d",GetMissionData()->num
);
259 cStr title_str
= FetchUIString("titles",buf
,"strings");
260 char* title
= (char*)(const char*)title_str
;
261 int x
= (width
- gr_string_width(title
))/2;
262 gr_set_fcolor(guiStyleGetColor(&mTextStyle
,StyleColorText
));
264 gr_string(title
,x
,y
);
265 y
+= gr_string_height(title
) + yspace
;
269 AutoAppIPtr_(QuestData
,pQuest
);
270 int diff
= pQuest
->Get(DIFF_QVAR
);
278 cStr diff_str
= FetchUIString("newgame","difficulty") ;
279 sprintf(buf
,"diff_%d",diff
);
281 diff_str
+= FetchUIString("newgame",buf
);
282 char* diffstr
= (char*)(const char*)diff_str
;
284 gr_set_fcolor(guiStyleGetColor(&mTextStyle
,StyleColorText
));
286 gr_string(diffstr
,0,y
);
287 y
+= gr_string_height(diffstr
);
299 for (int i
= 0; !done
; i
++)
301 int draw
= should_draw_goal(pQuest
,i
);
305 if (draw
== kSkipGoal
)
308 y
+= between
; // first time through this is zero
311 cStr text
= (mFlags
& kFictionGoals
) ? GoalFiction(i
) : GoalDescription(i
);
313 // Perilous, we mutate a cstr in place
314 char* s
= (char*)(const char*)text
;
316 int x
= kLeftGoalTextMargin
;
317 gr_font_string_wrap(gr_get_font(), s
, width
- x
);
319 int h
= gr_string_height(s
);
321 // We already did this in should_draw_goal. Oh well.
322 int state
= pQuest
->Get(GoalStateVarName(i
));
327 // setup font, move "cursor" to just after icon
328 gr_set_fcolor(guiStyleGetColor(&mTextStyle
,StyleColorText
));
332 gr_set_fcolor(guiStyleGetColor(&mGreyStyle
,StyleColorText
));
339 IImageSource
* icon
= GoalStatus(state
);
340 grs_bitmap
* bm
= (grs_bitmap
*)icon
->Lock();
341 int icon_h
= bm
->h
+ kTextIconAlign
;
342 gr_bitmap(bm
,0,y
+(gr_string_height("X") - icon_h
)/2);
358 int x
= 0, draw_line
=TRUE
;
359 // y += kStatsVertSeparator;
360 for (int i
= 0, done
= FALSE
; !done
; i
++)
366 sprintf(buf
,"stat_%d",i
);
367 cStr var
= FetchUIString(panel_name
,buf
);
372 // if (!pQuest->Exists(var)) continue;
374 if (pQuest
->Exists(var
))
375 val
= pQuest
->Get(var
);
377 sprintf(buf
,"text_%d",i
);
378 cStr text
= FetchUIString(panel_name
,buf
);
380 sprintf(buf
,"format_%d",i
);
381 cStr format
= FetchUIString(panel_name
,buf
);
383 // this is the fancy formatter from hell...
384 if (format
== "" || format
== "*missing string*")
387 BOOL have_cr
=TRUE
, no_sprint
=FALSE
, skip
=FALSE
, maybe_abort
=FALSE
, abort
=FALSE
;
388 char *use_str
=(char *)(const char *)format
, sep
[8]={0};
391 while (*use_str
=='@')
392 { // do we go to next line?? - strings ending in | do not
393 // do magic @ sign stuff
400 y
+=gr_string_height("X");
404 miss_val
=((use_str
[2]-'0')*10)+(use_str
[3]-'0');
406 if (GetMissionData()->num
<miss_val
)
407 if (maybe_abort
) abort
=TRUE
;
411 miss_val
=((use_str
[2]-'0')*10)+(use_str
[3]-'0');
413 if (GetMissionData()->num
>miss_val
)
414 if (maybe_abort
) abort
=TRUE
;
418 miss_val
=((use_str
[2]-'0')*10)+(use_str
[3]-'0');
420 if (GetMissionData()->num
==miss_val
)
421 if (maybe_abort
) abort
=TRUE
;
425 miss_val
=((use_str
[2]-'0')*10)+(use_str
[3]-'0');
427 if (GetMissionData()->num
!=miss_val
)
428 if (maybe_abort
) abort
=TRUE
;
431 case 'c': have_cr
=FALSE
; break;
433 sprintf(buf
,"%s",FetchUIString(panel_name
,val
?"true":"false"));
437 sprintf(buf
,"%s",FetchUIString(panel_name
,val
?"some":"none"));
447 sprintf(buf
+strlen(buf
),"%d %s ",h
,FetchUIString(panel_name
,h
!=1?"hours":"hour"));
449 sprintf(buf
+strlen(buf
),"%d %s ",m
%60,FetchUIString(panel_name
,m
!=1?"minutes":"minute"));
451 sprintf(buf
+strlen(buf
),"%d %s",s
%60,FetchUIString(panel_name
,s
!=1?"seconds":"second"));
455 case '+': skip
=(val
==0); break;
456 case 's': draw_line
=(val
!=0); have_cr
=FALSE
; break;
457 case ':': strcpy(sep
,": "); break;
458 case '/': strcpy(sep
,"/"); break;
467 if (have_cr
) // if we arent drawing this line
468 draw_line
=TRUE
; // but have a carriage return
469 continue; // then we should draw the next
475 y
+=gr_string_height("X");
483 sprintf(buf
,use_str
,val
);
484 sprintf(outbuf
,"%s%s%s",(const char*)text
,sep
,buf
);
486 gr_font_string_wrap(gr_get_font(), outbuf
, width
- x
);
487 gr_set_fcolor(guiStyleGetColor(&mTextStyle
,StyleColorText
));
488 gr_string(outbuf
,x
,y
);
492 y
+= gr_string_height(outbuf
);
497 x
+= gr_string_width(outbuf
);
506 guiStyleCleanupFont(&mTextStyle
,StyleFontNormal
);
517 // Figure out if the display is going to fit
518 // @TODO: Factor this code!
521 BOOL
cObjectivesBase::DisplayFits(const Rect
& area
, grs_font
* font
)
524 int max
= RectHeight(&area
);
525 int width
= RectWidth(&area
);
531 int yspace
= compute_yspace(font
);
533 // Title and difficulty space
534 // @HACK: These had better be 1 line each
535 y
+= gr_font_string_height(font
,"X")*2 + yspace
;
537 AutoAppIPtr_(QuestData
,pQuest
);
545 for (int i
= 0; !done
; i
++)
547 int draw
= should_draw_goal(pQuest
,i
);
551 if (draw
== kSkipGoal
)
557 // setup font, move "cursor" to just after icon
558 int x
= kLeftGoalTextMargin
;
560 cStr text
= (mFlags
& kFictionGoals
) ? GoalFiction(i
) : GoalDescription(i
);
562 // Perilous, we mutate a cstr in place
563 char* s
= (char*)(const char*)text
;
565 gr_font_string_wrap(font
, s
, width
- x
);
566 y
+= gr_font_string_height(font
,s
);
568 if (y
>= max
) return FALSE
;
576 //------------------------------------------------------------
580 class cDebrief
: public cObjectivesBase
582 static sDarkPanelDesc vars
;
587 : cObjectivesBase(&vars
,0)
605 void OnButtonList(ushort action
, int button
);
609 cObjectivesBase::InitUI();
610 AutoAppIPtr(QuestData
);
611 if (!pQuestData
->Get(MISSION_COMPLETE_VAR
))
614 mStrings
[i
] = FetchUIString(panel_name
,"restart",mResPath
);
615 mElems
[i
].draw_data
= (void*)(const char*)mStrings
[i
];
618 mFlags
&= ~kShowStats
;
624 SwitchToSimMenuMode(TRUE
);
632 static const char* debrief_button_names
[] =
639 sDarkPanelDesc
cDebrief::vars
=
645 debrief_button_names
,
648 void cDebrief::OnButtonList(ushort action
, int button
)
650 if (action
& BUTTONGADG_LCLICK
)
656 IPanelMode
* pMode
= GetPanelMode();
662 SwitchToSimMenuMode(TRUE
);
668 // switch the button text
670 mFlags
^= kShowStats
;
671 const char* button_name
= (mFlags
& kShowStats
) ? "goals" : "stats";
672 mStrings
[i
] = FetchUIString(panel_name
,button_name
,mResPath
);
673 mElems
[i
].draw_data
= (void*)(const char*)mStrings
[i
];
688 static cDebrief
* gpDebrief
= NULL
;
690 void SwitchToDebriefMode(BOOL push
)
693 gpDebrief
= new cDebrief
;
695 IPanelMode
* panel
= gpDebrief
->GetPanelMode();
697 panel
->Switch((push
) ? kLoopModePush
: kLoopModeSwitch
);
701 const sLoopInstantiator
* DescribeDebriefMode(void)
704 gpDebrief
= new cDebrief
;
708 cAutoIPtr
<IPanelMode
> panel
= gpDebrief
->GetPanelMode();
710 return panel
->Instantiator();
716 //------------------------------------------------------------
717 // SUBCLASS: cObjectives
720 class cObjectives
: public cObjectivesBase
722 static sDarkPanelDesc vars
;
727 : cObjectivesBase(&vars
,0)
744 void OnButtonList(ushort action
, int button
);
752 static const char* objectives_button_names
[] =
759 sDarkPanelDesc
cObjectives::vars
=
762 cObjectives::kNumButts
,
763 cObjectives::kNumRects
,
764 cObjectives::kNumButts
,
765 objectives_button_names
,
768 void cObjectives::OnButtonList(ushort action
, int button
)
770 if (action
& BUTTONGADG_LCLICK
)
775 SwitchToDarkAutomapMode(FALSE
);
786 static cObjectives
* gpObjectives
= NULL
;
788 void SwitchToObjectivesMode(BOOL push
)
791 gpObjectives
= new cObjectives
;
792 IPanelMode
* panel
= gpObjectives
->GetPanelMode();
794 panel
->Switch((push
) ? kLoopModePush
: kLoopModeSwitch
);
799 const sLoopInstantiator
* DescribeObjectivesMode(void)
802 gpObjectives
= new cObjectives
;
804 cAutoIPtr
<IPanelMode
> panel
= gpObjectives
->GetPanelMode();
806 return panel
->Instantiator();
809 //------------------------------------------------------------
810 // SUBCLASS: cLoading
814 static cLoading
* gpLoading
= NULL
;
816 class cLoading
: public cObjectivesBase
818 static sDarkPanelDesc vars
;
823 : cObjectivesBase(&vars
,kFictionGoals
),
825 mState(kWaitForLoad
),
842 kFirstDial
= kCoarseDial
,
850 kFineDialRate
= 16384, // bytes per frame
851 kFineDialFrames
= 18,
865 // Add a file's size to our totals
866 void AddFile(ITagFile
* file
)
868 cAutoIPtr
<ITagFileIter
> iter
= file
->Iterate();
869 for (iter
->Start(); !iter
->Done(); iter
->Next())
870 mFileTotal
+= file
->BlockSize(iter
->Tag());
873 void SetFile(ITagFile
* file
)
875 SafeRelease(mpMissionFile
);
877 mpMissionFile
= file
;
889 void SetState(int state
)
893 static const char* button_names
[] = { "continue", "loading", "loading", "continue", "continue" };
896 mStrings
[i
] = FetchUIString(panel_name
,button_names
[mState
],mResPath
);
897 mElems
[i
].draw_data
= (void*)(const char*)mStrings
[i
];
898 region_expose(LGadBoxRegion(LGadCurrentRoot()),&mRects
[i
]);
901 void UpdateDials(int bytes
)
906 //ConfigSpew("dial_spew",("bytes = %d delta = %d\n",mFileCur,bytes));
910 int frame
= mFileCur
/mDialRate
;
911 int oldframe
= old
/mDialRate
;
912 if (frame
!= oldframe
)
914 frame
%= kNumDialImages
;
915 DrawDialImage(kFineDial
,frame
);
920 // update coarse dial
922 int frame
= mFileCur
*kFineDialFrames
/mFileTotal
;
923 int oldframe
= old
*kFineDialFrames
/mFileTotal
;
924 if (frame
!= oldframe
)
926 DrawDialImage(kCoarseDial
,frame
);
931 pGameShell
->PumpEvents(kPumpAll
);
936 // File proxy that snoops reads and updates dials
939 class cLoadingFile
: public cTagFileProxy
943 cLoadingFile(ITagFile
* file
, cLoading
* us
)
944 : cTagFileProxy(file
), mpUs(us
)
949 STDMETHOD_(long,Read
)(char* buf
, int buflen
)
951 mpUs
->UpdateDials(buflen
);
952 return cTagFileProxy::Read(buf
,buflen
);
955 STDMETHOD_(long,Move
)(char* buf
, int buflen
)
957 mpUs
->UpdateDials(buflen
);
958 return cTagFileProxy::Move(buf
,buflen
);
966 // DB file factory that generates cLoadingFile objects wrapped
967 // around regular disk tag files.
970 class cLoadingFileFactory
: public cDBFileFactory
974 cLoadingFileFactory(cLoading
* us
)
979 ITagFile
* Open(const char* filename
, TagFileOpenMode mode
)
982 ConfigSpew("loading_open_spew",("Opening %s\n",filename
));
983 // The factory is required to find the file
984 dbFind(filename
,buf
);
985 cAutoIPtr
<ITagFile
> file
= BufTagFileOpen(buf
,mode
);
986 return new cLoadingFile(file
,mpUs
);
992 ITagFile
* mpMissionFile
;
993 IDataSource
* mpDialImages
[kNumDials
][kNumDialImages
];
999 BOOL mStateLocked
; //sigh. If TRUE, kGoOn cannot use NextState.
1000 //set false on every frame. Prevents kGoOn button
1001 //from changing state while frame locked.
1005 cObjectivesBase::InitUI();
1007 for (int i
= 0; i
< kNumDials
; i
++)
1008 for(int j
= 0; j
< kNumDialImages
; j
++)
1011 sprintf(buf
,"load%c_%d",'A'+i
,j
+1);
1012 ConfigSpew("dial_spew",("Binding %s\n",buf
));
1013 mpDialImages
[i
][j
] = FetchUIImage(buf
,mResPath
+"\\Dials");
1015 if (mFileTotal
<= 0)
1016 mFileTotal
= 1; // make sure this is not zero
1018 mDialRate
= kFineDialRate
;
1019 config_get_int("progress_dial_rate",&mDialRate
);
1024 for (int i
= 0; i
< 2; i
++)
1025 for(int j
= 0; j
< kNumDialImages
; j
++)
1027 SafeRelease(mpDialImages
[i
][j
]);
1030 cObjectivesBase::TermUI();
1033 void DrawDialImage(int dial
, int image
)
1037 if (image
>= kNumDialImages
)
1038 image
= kNumDialImages
- 1;
1039 Rect
& area
= mRects
[dial
];
1040 IDataSource
* img
= mpDialImages
[dial
-kFirstDial
][image
];
1042 // ConfigSpew("dial_spew",("[%d %d] ",dial-kFirstDial,image));
1045 int compose_flags
= ComposeFlagRead
;
1046 GUIsetup(&c
,&area
,(GUIcomposeFlags
)compose_flags
,GUI_CANV_ANY
);
1048 grs_bitmap
* bm
= (grs_bitmap
*)img
->Lock();
1054 ScrnForceUpdateRect(&area
);
1057 void OnButtonList(ushort action
, int button
)
1059 if (action
& BUTTONGADG_LCLICK
)
1066 AutoAppIPtr(QuestData
);
1067 int diff
= pQuestData
->Get(DIFF_QVAR
);
1069 if (diff
>= kNumDiffLevels
)
1071 pQuestData
->Set(DIFF_QVAR
,diff
);
1090 static long move_func(void* buf
, size_t sz
, size_t n
)
1092 return gpLoading
->mpMissionFile
->Read((char*)buf
,sz
*n
);
1095 void ReadMission(void)
1097 // load the objectives
1098 AutoAppIPtr(QuestData
);
1099 pQuestData
->DeleteAllType(kQuestDataMission
);
1101 QuestDataLoadTagFile(kQuestDataMission
,mpMissionFile
);
1103 // load mission data
1104 LoadMissionData(mpMissionFile
);
1105 LoadMapSourceInfo(mpMissionFile
);
1109 virtual void DoFileLoad(ITagFile
* file
)
1111 dbLoadTagFile(file
,kFiletypeAll
);
1116 virtual void SetInitialFile(void)
1118 ITagFile
* file
= OpenMissionFile(GetNextMission());
1123 void OnLoopMsg(eLoopMessage msg
, tLoopMessageData data
)
1129 mState
= kWaitForLoad
;
1136 case kMsgNormalFrame
:
1137 case kMsgPauseFrame
:
1139 mStateLocked
= FALSE
;
1146 // Load the mission, then go to next state
1147 mFileCur
= 1; // reset dial state
1148 mFileTotal
= 1; // no dividing by zero
1150 // Set up the file factory
1151 cLoadingFileFactory
fact(this);
1152 dbSetFileFactory(&fact
);
1155 cLoadingFile
* file
= new cLoadingFile(mpMissionFile
,this);
1157 DrawDialImage(kCoarseDial
,kNumDialImages
-1);
1160 dbSetFileFactory(NULL
);
1166 MissionLoopReset(kMissLoopMainMenu
);
1169 UnwindToMissionLoop();
1178 SafeRelease(mpMissionFile
);
1182 cObjectivesBase::OnLoopMsg(msg
,data
);
1188 SwitchToSimMenuMode(TRUE
);
1198 static const char* loading_button_names
[] =
1204 sDarkPanelDesc
cLoading::vars
=
1207 cLoading::kNumButts
,
1208 cLoading::kNumRects
,
1209 cLoading::kNumButts
,
1210 loading_button_names
,
1214 void SwitchToLoadingMode(BOOL push
)
1217 gpLoading
= new cLoading
;
1220 IPanelMode
* panel
= gpLoading
->GetPanelMode();
1222 panel
->Switch((push
) ? kLoopModePush
: kLoopModeSwitch
);
1230 const sLoopInstantiator
* DescribeLoadingMode(void)
1233 gpLoading
= new cLoading
;
1236 cAutoIPtr
<IPanelMode
> panel
= gpLoading
->GetPanelMode();
1238 return panel
->Instantiator();
1244 class cLoadingSaveGame
: public cLoading
1247 void DoFileLoad(ITagFile
* file
)
1249 HRESULT retval
= DarkLoadGame(file
);
1252 // Replace the objectives with the "load failed" string
1254 // Set up the canvas & font
1255 Rect
& area
= mRects
[num_butts
];
1257 int compose_flags
= ComposeFlagRead
|ComposeFlagClear
;
1258 GUIsetup(&c
,&area
,(GUIcomposeFlags
)compose_flags
,GUI_CANV_ANY
);
1259 guiStyleSetupFont(&mTextStyle
,StyleFontNormal
);
1262 cStr failed_str
= FetchUIString("gamelod","failed",mResPath
);
1263 char* failed
= (char*)(const char*)failed_str
;
1268 gr_string_size(failed
,&w
,&h
);
1269 gr_set_fcolor(guiStyleGetColor(&mTextStyle
,StyleColorText
));
1270 gr_string(failed
,(RectWidth(&area
) - w
)/2,(RectHeight(&area
)-h
)/2);
1272 guiStyleCleanupFont(&mTextStyle
,StyleFontNormal
);
1275 // wait for acknowledgement
1276 SetState(kWaitForQuit
);
1282 void SetInitialFile()
1284 // we already have a file, we promise.
1285 Assert_(mpMissionFile
);
1287 // Load the campaign vars out of it.
1288 // All we really need is difficulty. Oh well.
1289 AutoAppIPtr(QuestData
);
1290 pQuestData
->DeleteAllType(kQuestDataCampaign
);
1292 QuestDataLoadTagFile(kQuestDataCampaign
,mpMissionFile
);
1297 void OnLoopMsg(eLoopMessage msg
, tLoopMessageData data
)
1299 cLoading::OnLoopMsg(msg
,data
);
1304 NextState(); // start in loading state
1313 // erase diff button
1314 mElems
[(int)kDifficulty
].draw_data
= "";
1315 // Do all goals have fiction strings?
1316 mFlags
&= ~kFictionGoals
;
1321 static cLoadingSaveGame
* gpLoadingSaveGame
= NULL
;
1323 void PushToSaveGameLoadingMode(ITagFile
* file
)
1325 if (!gpLoadingSaveGame
)
1326 gpLoadingSaveGame
= new cLoadingSaveGame
;
1328 gpLoadingSaveGame
->SetFile(file
);
1329 IPanelMode
* panel
= gpLoadingSaveGame
->GetPanelMode();
1330 panel
->Switch(kLoopModePush
);
1336 //------------------------------------------------------------------
1341 void init_commands();
1350 delete gpObjectives
;
1353 delete gpLoadingSaveGame
;
1357 //----------------------------------------
1361 static void do_debrief()
1363 SwitchToDebriefMode(TRUE
);
1366 static void do_objectives()
1368 SwitchToObjectivesMode(TRUE
);
1372 static Command commands
[] =
1374 { "debrief", FUNC_VOID
, do_debrief
, "Go to debrief UI.", HK_ALL
},
1375 { "objectives", FUNC_VOID
, do_objectives
, "Go to objectives UI.", HK_ALL
},
1379 static void init_commands()
1381 COMMANDS(commands
,HK_ALL
);