MPConnectionType.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180
  1. #ifndef MPCONNECTIONTYPE_H
  2. #define MPCONNECTIONTYPE_H
  3. /*************************************************************************************************\
  4. MPConnectionType.h : Interface for the MPConnectionType 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 "aButton.h"
  15. #include "aListBox.h"
  16. #ifndef AANIM_H
  17. #include "aAnim.h"
  18. #endif
  19. #ifndef MPHOSTGAME_H
  20. #include "MPHostGame.h"
  21. #endif
  22. #include "assert.h"
  23. static const int ZONE_PANEL_FIRST_BUTTON_ID = 1000100;
  24. class aZonePanel : public aObject
  25. {
  26. public:
  27. void init(FitIniFile* pFile, LogisticsScreen* pParent);
  28. virtual int handleMessage( unsigned long, unsigned long );
  29. virtual void update();
  30. virtual void render();
  31. private:
  32. LogisticsScreen *pParentScreen;
  33. aAnimButton button;
  34. aText text;
  35. bool bShowWarning;
  36. };
  37. static const int LAN_PANEL_FIRST_BUTTON_ID = 1000200;
  38. class aLanPanel : public aObject
  39. {
  40. public:
  41. aLanPanel(LogisticsScreen &refParentScreenParam)
  42. {
  43. pParentScreen = &refParentScreenParam;
  44. }
  45. void init(FitIniFile* pFile);
  46. virtual int handleMessage( unsigned long, unsigned long );
  47. virtual void update();
  48. private:
  49. LogisticsScreen *pParentScreen;
  50. aAnimButton button0;
  51. aAnimButton button1;
  52. aText text;
  53. };
  54. static const int TCPIP_PANEL_FIRST_BUTTON_ID = 1000300;
  55. class aTcpipPanel : public aObject
  56. {
  57. public:
  58. aTcpipPanel(LogisticsScreen &refParentScreenParam)
  59. {
  60. pParentScreen = &refParentScreenParam;
  61. connectingTime = 0.f;
  62. }
  63. void init(FitIniFile* pFile);
  64. virtual void destroy();
  65. virtual int handleMessage( unsigned long, unsigned long );
  66. virtual void update();
  67. virtual void render();
  68. virtual void begin();
  69. private:
  70. long getNum( char* pStr, long index1, long index2 );
  71. LogisticsScreen *pParentScreen;
  72. aAnimButton button0;
  73. aAnimButton button1;
  74. aText text0;
  75. aText text1;
  76. aRect helpRect;
  77. aComboBox comboBox;
  78. bool bConnectingDlg;
  79. float connectingTime;
  80. bool bErrorDlg;
  81. bool bExpanded;
  82. bool bFoundConnection;
  83. };
  84. class MPConnectionType : public LogisticsScreen
  85. {
  86. public:
  87. MPConnectionType();
  88. virtual ~MPConnectionType();
  89. void init(FitIniFile* file);
  90. bool isDone();
  91. virtual void begin();
  92. virtual void end();
  93. virtual void render( int xOffset, int yOffset );
  94. virtual void render();
  95. virtual void update();
  96. virtual int handleMessage( unsigned long, unsigned long );
  97. bool bDone;
  98. void **ppConnectionScreen;
  99. void *pLocalBrowserScreen;
  100. void *pDirectTcpipScreen;
  101. void *pMPPlaceHolderScreen;
  102. void *pMPHostGame;
  103. private:
  104. int indexOfButtonWithID(int id);
  105. aZonePanel zonePanel;
  106. aLanPanel lanPanel;
  107. aTcpipPanel tcpipPanel;
  108. aObject *pPanel;
  109. MPHostGame hostDlg;
  110. bool bHosting;
  111. };
  112. class MPPlaceHolderScreen : public LogisticsScreen
  113. {
  114. public:
  115. //MPPlaceHolderScreen();
  116. //virtual ~MPPlaceHolderScreen();
  117. virtual void begin() { status = RUNNING; }
  118. //virtual void end();
  119. virtual void render( int xOffset, int yOffset ) {
  120. static int lastXOffset = 0;
  121. static int lastYOffset = 0;
  122. if ((0 == xOffset) && (0 == yOffset)) {
  123. if (xOffset < lastXOffset) {
  124. status = NEXT;
  125. } else if (xOffset > lastXOffset) {
  126. status = PREVIOUS;
  127. } else if (yOffset > lastYOffset) {
  128. status = UP;
  129. } else if (yOffset < lastYOffset) {
  130. status = DOWN;
  131. } else {
  132. assert(false);
  133. status = NEXT;
  134. }
  135. }
  136. lastXOffset = xOffset;
  137. lastYOffset = yOffset;
  138. }
  139. virtual void render() { render(0, 0); }
  140. //virtual void update();
  141. private:
  142. };
  143. //*************************************************************************************************
  144. #endif // end of file ( MPConnectionType.h )