MPParameterScreen.h 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194
  1. #ifndef MPPARAMETERSCREEN_H
  2. #define MPPARAMETERSCREEN_H
  3. /*************************************************************************************************\
  4. MPParameterScreen.h : Interface for the MPParameterScreen component.
  5. //---------------------------------------------------------------------------//
  6. // Copyright (C) Microsoft Corporation. All rights reserved. //
  7. //===========================================================================//
  8. \*************************************************************************************************/
  9. //*************************************************************************************************
  10. #ifndef LOGISTICSSCREEN_H
  11. #include "LogisticsScreen.h"
  12. #endif
  13. #include "aSystem.h"
  14. #include "aListBox.h"
  15. #include "AttributeMeter.h"
  16. #include "SimpleCamera.h"
  17. #include "EList.h"
  18. #include "Multplyr.h"
  19. #include "MPLoadMap.h"
  20. #ifndef AANIM_H
  21. #include "aAnim.h"
  22. #endif
  23. struct _MC2Player;
  24. class aStyle2TextListItem : public aTextListItem
  25. {
  26. public:
  27. aStyle2TextListItem() { hasAnimation = false; normalColor = 0xff808080; }
  28. virtual long init( FitIniFile* file, const char* blockName );
  29. virtual void render();
  30. protected:
  31. bool hasAnimation;
  32. aAnimGroup animGroup;
  33. int normalColor;
  34. };
  35. class aPlayerParams : public aObject
  36. {
  37. public:
  38. aPlayerParams();
  39. ~aPlayerParams();
  40. aPlayerParams& operator=( const aPlayerParams& src );
  41. virtual long init(long xPos, long yPos, long w, long h);
  42. void init( FitIniFile* file, const char* blockName );
  43. virtual void destroy();
  44. virtual void render();
  45. virtual void update();
  46. virtual int handleMessage( unsigned long message, unsigned long who );
  47. virtual void move( float offsetX, float offsetY );
  48. void setData(const _MC2Player* data);
  49. bool hasFocus( );
  50. bool isSelected() { return bHasFocus; }
  51. int getCommanderID( ) const { return commanderID; }
  52. void disableReadyButton();
  53. protected:
  54. aAnimButton CBillsSpinnerUpButton;
  55. aAnimButton CBillsSpinnerDownButton;
  56. aAnimButton ReadyButton;
  57. aObject* statics;
  58. aRect* rects;
  59. long rectCount;
  60. long staticCount;
  61. aText* textObjects;
  62. long textCount;
  63. aDropList teamNumberDropList;
  64. aDropList factionDropList;
  65. aStyle2TextListItem templateItem;
  66. EString insigniaName;
  67. aEdit edit;
  68. bool bHasFocus;
  69. long commanderID;
  70. friend class MPParameterScreen;
  71. };
  72. class CListOfDropListPointers : public EList<aDropList *, aDropList *> {};
  73. class CFocusManager
  74. {
  75. public:
  76. enum control_species_data_type
  77. {
  78. CS_NONE,
  79. CS_DROPLIST
  80. };
  81. CFocusManager();
  82. void clear();
  83. void *registerDropList(aDropList &DropList);
  84. void unregisterDropList(aDropList &DropList);
  85. void update();
  86. bool somebodyHasTheFocus(); /*this is distinct from the keyboard input focus*/
  87. aObject *pControlThatHasTheFocus();
  88. private:
  89. control_species_data_type speciesOfTheControlWhichHasTheFocus;
  90. aDropList *pDropListThatHasTheFocus;
  91. CListOfDropListPointers listOfDropListPointers;
  92. };
  93. class MPParameterScreen : public LogisticsScreen
  94. {
  95. public:
  96. MPParameterScreen();
  97. virtual ~MPParameterScreen();
  98. void init(FitIniFile* file);
  99. virtual void begin();
  100. virtual void end();
  101. virtual void render( int xOffset, int yOffset );
  102. virtual void render();
  103. virtual void update();
  104. virtual int handleMessage( unsigned long, unsigned long );
  105. static void resetCheckBoxes();
  106. void setHostLeftDlg( const char* playerName);
  107. static GUID getGUIDFromFile( const char* fileName );
  108. static void initializeMap( const char* fileName );
  109. static MPParameterScreen* s_instance;
  110. private:
  111. int indexOfButtonWithID(int id);
  112. int chatToSend;
  113. void setMission( const char* fileName, bool resetData = 1 );
  114. void setMissionClientOnly( const char* pNewMapName );
  115. void checkVersionClientOnly( const char* pNewMapName );
  116. aPlayerParams playerParameters[MAX_MC_PLAYERS];
  117. long playerCount;
  118. MPLoadMap mpLoadMap;
  119. LogisticsMapInfoDialog mapInfoDlg;
  120. bool bLoading;
  121. bool bShowNoMapDlg;
  122. bool bErrorDlg;
  123. bool bBootDlg;
  124. bool bDisconnectDlg;
  125. EString mapName;
  126. long bootPlayerID;
  127. bool bMapInfoDlg;
  128. float delayTime;
  129. bool bHostLeftDlg;
  130. bool bWaitingToStart;
  131. };
  132. //*************************************************************************************************
  133. #endif // end of file ( MPParameterScreen.h )