MPGameBrowser.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #ifndef MPGAMEBROWSER_H
  2. #define MPGAMEBROWSER_H
  3. /*************************************************************************************************\
  4. MPGameBrowser.h : Interface for the MPGameBrowser 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 "multplyr.h"
  18. #ifndef AANIM_H
  19. #include "aAnim.h"
  20. #endif
  21. #ifndef MPHOSTGAME_H
  22. #include "MpHostGame.h"
  23. #endif
  24. class aButton;
  25. //struct _MC2Session;
  26. class aStyle3TextListItem : public aTextListItem
  27. {
  28. public:
  29. aStyle3TextListItem() { hasAnimation = false; normalColor = 0xff808080; }
  30. virtual long init( FitIniFile* file, const char* blockName );
  31. virtual void render();
  32. protected:
  33. bool hasAnimation;
  34. aAnimGroup animGroup;
  35. int normalColor;
  36. };
  37. class aGameListItem : public aListItem
  38. {
  39. public:
  40. aGameListItem();
  41. virtual long init( FitIniFile* file, const char* blockName );
  42. virtual void update();
  43. void setSessionInfo( _MC2Session* pSessions );
  44. const char* getSessionName();
  45. const char* getText( int which );
  46. const MC2Session* getSession (void) { return(&session); }
  47. aGameListItem& operator=( const aGameListItem& );
  48. protected:
  49. MC2Session session;
  50. aObject allTechGraphic;
  51. aStyle3TextListItem gameName;
  52. aStyle3TextListItem numPlayers;
  53. aStyle3TextListItem mapName;
  54. aTextListItem latency;
  55. aRect allTechRect;
  56. aRect gameNameRect;
  57. aRect numPlayersRect;
  58. aRect mapNameRect;
  59. aRect latencyRect;
  60. aObject pingIcon;
  61. };
  62. class MPGameBrowser : public LogisticsScreen
  63. {
  64. public:
  65. MPGameBrowser();
  66. virtual ~MPGameBrowser();
  67. void init(FitIniFile* file);
  68. bool isDone();
  69. virtual void begin();
  70. virtual void end();
  71. virtual void render( int xOffset, int yOffset );
  72. virtual void render();
  73. virtual void update();
  74. virtual int handleMessage( unsigned long, unsigned long );
  75. private:
  76. int indexOfButtonWithID(int id);
  77. aListBox gameList;
  78. aGameListItem items[256];
  79. aGameListItem templateItem;
  80. MPHostGame hostDlg;
  81. bool bHosting;
  82. bool bShowErrorDlg;
  83. int sortOrder;
  84. int bSortUpward;
  85. long oldScrollPos;
  86. };
  87. //*************************************************************************************************
  88. #endif // end of file ( MPGameBrowser.h )