PilotReviewArea.h 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299
  1. #ifndef PILOTREVIEWAREA_H
  2. #define PILOTREVIEWAREA_H
  3. /*************************************************************************************************\
  4. PilotReviewARea.h : Interface for the PilotReviewARea component.
  5. //---------------------------------------------------------------------------//
  6. // Copyright (C) Microsoft Corporation. All rights reserved. //
  7. //===========================================================================//
  8. \*************************************************************************************************/
  9. //*************************************************************************************************
  10. #include "LogisticsScreen.h"
  11. #include "aListBox.h"
  12. #include "AttributeMeter.h"
  13. #include "aAnim.h"
  14. #include "LogisticsPilot.h"
  15. class aButton;
  16. class PilotIcon;
  17. class PilotPromotionArea;
  18. /**************************************************************************************************
  19. CLASS DESCRIPTION
  20. PilotReviewARea:
  21. **************************************************************************************************/
  22. // holds the dead and active pilots
  23. class PilotListBox : public aListBox
  24. {
  25. public:
  26. PilotListBox();
  27. virtual long AddItem( aListItem* item );
  28. virtual void update();
  29. bool isDone( ){ return bDone; }
  30. private:
  31. float timeSinceStart;
  32. int curItem;
  33. long oldScroll;
  34. long newScroll;
  35. float scrollTime;
  36. bool bDone;
  37. };
  38. // this screen shows up after the salvage screen
  39. class PilotReviewScreen : public LogisticsScreen
  40. {
  41. public:
  42. PilotReviewScreen();
  43. virtual ~PilotReviewScreen();
  44. void init(FitIniFile* file);
  45. bool isDone();
  46. virtual void render();
  47. virtual void update();
  48. virtual int handleMessage( unsigned long, unsigned long );
  49. void updatePilots(); // put into inventory, save??
  50. bool bDone;
  51. static PilotPromotionArea* s_curPromotion;
  52. static PilotReviewScreen* instance;
  53. private:
  54. PilotListBox pilotListBox;
  55. aAnimation entryAnim;
  56. aAnimation exitAnim;
  57. };
  58. // base class for dead, and active pilot list box items
  59. class PilotListItem : public aListItem
  60. {
  61. public:
  62. PilotListItem()
  63. {
  64. currentTime = -1.f;
  65. bDone = 0;
  66. }
  67. virtual void begin(); // for animation purposes...
  68. virtual bool isDone() = 0; // implement this yourself
  69. virtual void update();
  70. protected:
  71. float currentTime;
  72. bool bDone;
  73. };
  74. // list box item for dead pilots
  75. class DeadPilotListItem : public PilotListItem
  76. {
  77. public:
  78. virtual void render();
  79. virtual void update();
  80. virtual bool isDone();
  81. virtual ~DeadPilotListItem();
  82. static void init( FitIniFile* file );
  83. LogisticsPilot* getPilot(){ return pPilot; }
  84. DeadPilotListItem( LogisticsPilot* pUnit );
  85. private:
  86. friend class PilotReviewScreen;
  87. LogisticsPilot* pPilot;
  88. static aText* s_nameText;
  89. static aText* s_rankText;
  90. static aText* s_missionText;
  91. static aText* s_killsText;
  92. static aRect* s_area;
  93. static aRect* s_liveIconRect;
  94. static aRect* s_deadIconRect;
  95. static long s_itemCount;
  96. aText nameText;
  97. aText rankText;
  98. aText missionText;
  99. aText killsText;
  100. PilotIcon* liveIcon;
  101. PilotIcon* deadIcon;
  102. };
  103. // pilots that weren't killed
  104. class ActivePilotListItem : public PilotListItem
  105. {
  106. public:
  107. virtual void render();
  108. virtual void update();
  109. virtual bool isDone();
  110. virtual ~ActivePilotListItem();
  111. static void init( FitIniFile* file );
  112. ActivePilotListItem( LogisticsPilot* pUnit );
  113. static long s_totalWidth;
  114. float flashTime();
  115. protected:
  116. AttributeMeter attributeMeters[2];
  117. static AttributeMeter* s_attributeMeters[2];
  118. static aObject* s_icons[8];
  119. static aText* s_nameText;
  120. static aText* s_missionText;
  121. static aText* s_killsText;
  122. static long s_itemCount;
  123. static aRect* s_outline[5];
  124. static aText* s_rankText;
  125. static aText* s_gunneryText;
  126. static aText* s_pilotingText;
  127. static aRect* s_area;
  128. static aRect* s_iconRect;
  129. static aRect* s_killIconRect;
  130. static PilotPromotionArea* s_pilotPromotionArea;
  131. static aObject* s_medals[MAX_MEDAL];
  132. static aText* s_promotionText;
  133. static aText* s_medalText;
  134. static aText* s_medalAwardedText;
  135. static aAnimation* s_skillAnim;
  136. static aAnimation* s_medalAwardedAnim;
  137. static aAnimation* s_pilotPromotedAnim;
  138. aObject icons[4];
  139. aText nameText;
  140. aText missionText;
  141. aText killsText;
  142. long itemCount;
  143. aText rankText;
  144. aText gunneryText;
  145. aText pilotingText;
  146. aRect area;
  147. aObject* medalIcons[MAX_MEDAL];
  148. aText* medalTexts[MAX_MEDAL];
  149. aText promotionText;
  150. aText medalAwardedText;
  151. PilotIcon* pilotIcon;
  152. LogisticsPilot* pilot;
  153. bool showingPromotion;
  154. bool promotionShown;
  155. long medalCount;
  156. };
  157. class PilotPromotionArea : public LogisticsScreen
  158. {
  159. public:
  160. bool isDone();
  161. void init( FitIniFile& file );
  162. virtual void render();
  163. virtual void update();
  164. void setPilot(LogisticsPilot* pPilot, PilotIcon* pIcon);
  165. virtual int handleMessage( unsigned long, unsigned long );
  166. virtual ~PilotPromotionArea();
  167. aListBox* getSkillListBox() { return &skillListBox; }
  168. private:
  169. AttributeMeter attributeMeters[2];
  170. LogisticsScreen areaLeft;
  171. LogisticsScreen areaRight;
  172. LogisticsPilot* pilot;
  173. aAnimation leftInfo;
  174. aAnimation rightInfo;
  175. aAnimation leftExitInfo;
  176. aAnimation rightExitInfo;
  177. bool bDone;
  178. aListBox skillListBox;
  179. PilotIcon* pilotIcon;
  180. aAnimation selSkillAnim;
  181. long lastCheck;
  182. };
  183. // specialty skills each show up in here
  184. class SpecialtyListItem : public aListItem
  185. {
  186. public:
  187. virtual void render();
  188. virtual void update();
  189. virtual ~SpecialtyListItem();
  190. static void init( FitIniFile* file );
  191. virtual int handleMessage( unsigned long message, unsigned long who );
  192. virtual bool isChecked();
  193. virtual void setCheck( bool );
  194. int getID();
  195. SpecialtyListItem( int ID );
  196. private:
  197. static aButton* s_radioButton;
  198. static aObject* s_skillIcons[4];
  199. static aAnimation* s_highlightAnim;
  200. static aAnimation* s_normalAnim;
  201. static aAnimation* s_pressedAnim;
  202. static aText* s_description;
  203. static aRect* s_area;
  204. static aRect* s_outline;
  205. static long s_itemCount;
  206. static void deleteStatics();
  207. aAnimation pressedAnim;
  208. aAnimation highlightAnim;
  209. aAnimation normalAnim;
  210. aObject icon;
  211. aText description;
  212. aButton radioButton;
  213. aRect outline;
  214. int ID;
  215. friend class PilotPromotionArea;
  216. };
  217. //*************************************************************************************************
  218. #endif // end of file ( PilotReview.h )