TrainingSlideshow.cpp 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #include "pch.h"
  2. #include "slideshow.h"
  3. #include "training.h"
  4. //////////////////////////////////////////////////////////////////////////////
  5. //
  6. // Training Screen
  7. //
  8. //////////////////////////////////////////////////////////////////////////////
  9. class TrainingSlideshow :
  10. public Slideshow,
  11. public EventTargetContainer<TrainingSlideshow>
  12. {
  13. private:
  14. int m_iMission;
  15. public:
  16. TrainingSlideshow (Modeler* pModeler, const ZString& strNamespace, int iMission) :
  17. Slideshow (pModeler, strNamespace),
  18. m_iMission (iMission)
  19. {
  20. }
  21. ~TrainingSlideshow (void)
  22. {
  23. }
  24. void Dismiss (void)
  25. {
  26. Slideshow::Dismiss ();
  27. // pop up the Connecting... dialog.
  28. GetWindow()->SetWaitCursor();
  29. // open up a dialog to let the player know the world hasn't ended
  30. TRef<IMessageBox> pMsgBox = CreateMessageBox ("Training simulation initiated...", NULL, false);
  31. GetWindow ()->GetPopupContainer ()->OpenPopup (pMsgBox, false);
  32. // pause to let the "starting..." box draw itself
  33. AddEventTarget (OnSwitchOut, GetWindow(), 0.1f);
  34. }
  35. bool OnSwitchOut (void)
  36. {
  37. GetWindow ()->StartTraining (m_iMission);
  38. return false;
  39. }
  40. };
  41. //////////////////////////////////////////////////////////////////////////////
  42. //
  43. // Constructor
  44. //
  45. //////////////////////////////////////////////////////////////////////////////
  46. TRef<Screen> CreateTrainingSlideshow (Modeler* pModeler, const ZString& strNamespace, int iMissionIndex)
  47. {
  48. return new TrainingSlideshow (pModeler, strNamespace, iMissionIndex);
  49. }