LogisticsDialog.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. #ifndef LOGISTICSDIALOG_H
  2. #define LOGISTICSDIALOG_H
  3. /*************************************************************************************************\
  4. LogisticsDialog.h : Interface for the LogisticsDialog component.
  5. //---------------------------------------------------------------------------//
  6. // Copyright (C) Microsoft Corporation. All rights reserved. //
  7. //===========================================================================//
  8. \*************************************************************************************************/
  9. #ifndef LOGISTICSSCREEN_H
  10. #include "LogisticsScreen.h"
  11. #endif
  12. #ifndef AANIM_H
  13. #include "AAnim.h"
  14. #endif
  15. #ifndef ALISTBOX_H
  16. #include "aListBox.h"
  17. #endif
  18. //*************************************************************************************************
  19. /**************************************************************************************************
  20. CLASS DESCRIPTION
  21. LogisticsDialog:
  22. **************************************************************************************************/
  23. class LogisticsDialog: public LogisticsScreen
  24. {
  25. public:
  26. virtual void render();
  27. virtual void update();
  28. void begin();
  29. void end();
  30. bool isDone() { return bDone; }
  31. void setFont( int newFontResID );
  32. LogisticsDialog();
  33. protected:
  34. aAnimation enterAnim;
  35. aAnimation exitAnim;
  36. bool bDone;
  37. int oldFont;
  38. };
  39. class LogisticsOKDialog : public LogisticsDialog
  40. {
  41. public:
  42. static LogisticsOKDialog* instance(){ return s_instance; }
  43. LogisticsOKDialog();
  44. virtual int handleMessage( unsigned long, unsigned long );
  45. static int init( FitIniFile& file );
  46. void setText( int textID, int CancelButton, int OKButton );
  47. void setText( const char* mainText );
  48. private:
  49. LogisticsOKDialog( const LogisticsOKDialog& src );
  50. virtual ~LogisticsOKDialog();
  51. LogisticsOKDialog& operator=( const LogisticsOKDialog& ogisticsDialog );
  52. static LogisticsOKDialog* s_instance;
  53. friend void endDialogs();
  54. };
  55. class LogisticsOneButtonDialog : public LogisticsDialog
  56. {
  57. public:
  58. static LogisticsOneButtonDialog* instance(){ return s_instance; }
  59. LogisticsOneButtonDialog();
  60. virtual int handleMessage( unsigned long, unsigned long );
  61. static int init( FitIniFile& file );
  62. void setText( int textID, int CancelButton, int OKButton );
  63. void setText( const char* mainText );
  64. protected:
  65. LogisticsOneButtonDialog( const LogisticsOneButtonDialog& src );
  66. virtual ~LogisticsOneButtonDialog();
  67. LogisticsOneButtonDialog& operator=( const LogisticsOneButtonDialog& ogisticsDialog );
  68. static LogisticsOneButtonDialog* s_instance;
  69. friend void endDialogs();
  70. };
  71. class LogisticsLegalDialog : public LogisticsOneButtonDialog
  72. {
  73. public:
  74. static LogisticsLegalDialog* instance(){ return s_instance; }
  75. static int init( FitIniFile& file );
  76. LogisticsLegalDialog(){}
  77. private:
  78. LogisticsLegalDialog( const LogisticsLegalDialog& src );
  79. virtual ~LogisticsLegalDialog(){}
  80. LogisticsLegalDialog& operator=( const LogisticsLegalDialog& ogisticsDialog );
  81. static LogisticsLegalDialog* s_instance;
  82. friend void endDialogs();
  83. };
  84. class LogisticsSaveDialog : public LogisticsDialog
  85. {
  86. public:
  87. static LogisticsSaveDialog* instance(){ return s_instance; }
  88. LogisticsSaveDialog();
  89. virtual void begin();
  90. virtual void beginLoad();
  91. void beginCampaign();
  92. virtual void end();
  93. virtual void update();
  94. virtual void render();
  95. static int init( FitIniFile& file );
  96. virtual int handleMessage( unsigned long, unsigned long );
  97. const EString& getFileName( ){ return selectedName; }
  98. private:
  99. LogisticsSaveDialog( const LogisticsSaveDialog& src );
  100. virtual ~LogisticsSaveDialog();
  101. LogisticsSaveDialog& operator=( const LogisticsSaveDialog& ogisticsDialog );
  102. static LogisticsSaveDialog* s_instance;
  103. aListBox gameListBox;
  104. EString selectedName;
  105. void initDialog(const char* path, bool bCampaign);
  106. void updateCampaignMissionInfo();
  107. void setMission( const char* path );
  108. void readCampaignNameFromFile( char* fileName, char* resultName, long len );
  109. bool isCorrectVersionSaveGame( char *fileName );
  110. bool bPromptOverwrite;
  111. bool bDeletePrompt;
  112. bool bLoad;
  113. bool bCampaign;
  114. void updateMissionInfo();
  115. aLocalizedListItem templateItem;
  116. friend void endDialogs();
  117. };
  118. class LogisticsVariantDialog : public LogisticsDialog
  119. {
  120. public:
  121. LogisticsVariantDialog();
  122. ~LogisticsVariantDialog();
  123. static LogisticsVariantDialog* instance(){ return s_instance; }
  124. virtual void begin();
  125. void beginTranscript();
  126. virtual void end();
  127. virtual void update();
  128. virtual void render();
  129. int init( FitIniFile& file );
  130. virtual int handleMessage( unsigned long, unsigned long );
  131. const EString& getFileName( ){ return selectedName; }
  132. protected:
  133. static LogisticsVariantDialog* s_instance;
  134. aListBox gameListBox;
  135. EString selectedName;
  136. bool bPromptOverwrite;
  137. bool bDeletePrompt;
  138. bool bTranscript;
  139. void initVariantList();
  140. void initTranscript();
  141. aAnimTextListItem templateItem;
  142. friend void endDialogs();
  143. };
  144. class LogisticsAcceptVariantDialog : public LogisticsVariantDialog
  145. {
  146. public:
  147. LogisticsAcceptVariantDialog();
  148. ~LogisticsAcceptVariantDialog();
  149. virtual void begin();
  150. virtual void end();
  151. virtual void update();
  152. virtual void render();
  153. int init( FitIniFile& file );
  154. virtual int handleMessage( unsigned long, unsigned long );
  155. private:
  156. EString selectedName;
  157. bool bNameUsedPrompt;
  158. };
  159. class LogisticsMapInfoDialog : public LogisticsDialog
  160. {
  161. public:
  162. LogisticsMapInfoDialog();
  163. ~LogisticsMapInfoDialog();
  164. virtual void end();
  165. void setMap( const char* pFileName );
  166. int init( );
  167. virtual int handleMessage( unsigned long, unsigned long );
  168. private:
  169. };
  170. //*************************************************************************************************
  171. #endif // end of file ( LogisticsDialog.h )