InfoWindow.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. #ifndef INFOWINDOW_H
  2. #define INFOWINDOW_H
  3. /*************************************************************************************************\
  4. InfoWindow.h : Interface for the InfoWindow component.
  5. //===========================================================================//
  6. // Copyright (C) Microsoft Corporation. All rights reserved. //
  7. //===========================================================================//
  8. \*************************************************************************************************/
  9. #include "mclib.h"
  10. #ifndef CONTROLGUI_H
  11. #include "controlGui.h"
  12. #endif
  13. class Mover;
  14. class ForceGroupIcon;
  15. #ifndef AFONT_H
  16. #include "aFont.h"
  17. #endif
  18. #define SCROLLUP 1
  19. #define SCROLLDOWN 2
  20. //*************************************************************************************************
  21. /**************************************************************************************************
  22. CLASS DESCRIPTION
  23. InfoWindow:
  24. **************************************************************************************************/
  25. class InfoWindow
  26. {
  27. public:
  28. InfoWindow();
  29. ~InfoWindow();
  30. void setUnit( Mover* pNewUnit );
  31. void update();
  32. void render();
  33. private:
  34. float scrollPos;
  35. float scrollLength;
  36. float infoLength;
  37. float lastYClick;
  38. // DATA
  39. Mover* pUnit;
  40. static ButtonData buttonData[2];
  41. static StaticInfo* skillInfos;
  42. unsigned long backgroundTexture;
  43. aFont nameFont;
  44. aFont componentFont;
  45. static ControlButton buttons[2];
  46. bool bUnitChanged;
  47. friend class ControlGui;
  48. // HELPER FUNCTIONS
  49. void drawScrollingStuff();
  50. void handleClick( int ID );
  51. void drawDivider( float yVal );
  52. void drawSkillBar( int skill, float yVal, float height );
  53. void setScrollPos( int where );
  54. void drawName( const char* name );
  55. ForceGroupIcon* icon;
  56. static long SCROLLLEFT;
  57. static long SCROLLRIGHT;
  58. static long SCROLLTOP;
  59. static long SCROLLBOTTOM;
  60. static long SCROLLMIN;
  61. static long SCROLLMAX;
  62. static long SCROLLBUTTONU;
  63. static long SCROLLBUTTONV;
  64. static long SCROLLBUTTONWIDTH;
  65. static long SCROLLBUTTONHEIGHT;
  66. static long SECTIONSKIP;
  67. static long NAMELEFT;
  68. static long NAMERIGHT;
  69. static long NAMETOP;
  70. static long NAMEBOTTOM;
  71. static long HEALTHLEFT;
  72. static long HEALTHRIGHT;
  73. static long HEALTHTOP;
  74. static long HEALTHBOTTOM;
  75. static long DIVIDERCOLOR;
  76. static long DIVIDERLEFT;
  77. static long DIVIDERRIGHT;
  78. static long PILOTLEFT;
  79. static long PILOTRIGHT;
  80. static long PILOTHEIGHT;
  81. static long MECHLEFT;
  82. static long MECHRIGHT;
  83. static long MECHHEIGHT;
  84. static long MECHBACKLEFT;
  85. static long MECHBACKRIGHT;
  86. static long MECHBACKHEIGHT;
  87. static long SKILLLEFT;
  88. static long SKILLHEIGHT;
  89. static long SKILLSKIP;
  90. static long SKILLRIGHT;
  91. static long SKILLUNITWIDTH;
  92. static long NUMBERSKILLBARS;
  93. static long INFOLEFT;
  94. static long INFOTOP;
  95. static long INFOWIDTH;
  96. static long INFOHEIGHT;
  97. static long SCROLLCOLOR;
  98. static long SCROLLBUTTONX;
  99. static long COMPONENTLEFT;
  100. static long SCROLLBOXLEFT;
  101. static long SCROLLBOXRIGHT;
  102. static long SCROLLBOXTOP;
  103. static long SCROLLBOXBOTTOM;
  104. static long PILOTNAMELEFT;
  105. static GUI_RECT NameRect;
  106. static void InfoWindow::init( FitIniFile& file );
  107. static InfoWindow* s_instance;
  108. };
  109. //*************************************************************************************************
  110. #endif // end of file ( InfoWindow.h )