AttributeMeter.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #ifndef ATTRIBUTEMETER_H
  2. #define ATTRIBUTEMETER_H
  3. //===========================================================================//
  4. //AttributeMeter.h : Implementation of the AttributeMeter component. //
  5. //---------------------------------------------------------------------------//
  6. // Copyright (C) Microsoft Corporation. All rights reserved. //
  7. //===========================================================================//
  8. #include "utilities.h"
  9. //*************************************************************************************************
  10. class FifIniFile;
  11. #define MAX_ARMOR_RANGE 432.f
  12. #define MAX_SPEED_RANGE 35.f
  13. #define MAX_JUMP_RANGE 125.f
  14. /**************************************************************************************************
  15. CLASS DESCRIPTION
  16. AttributeMeter:
  17. **************************************************************************************************/
  18. class AttributeMeter
  19. {
  20. public:
  21. AttributeMeter();
  22. void update();
  23. void render();
  24. void render( long xOffset, long yOffset );
  25. void init( FitIniFile* file, const char* headerName );
  26. void setValue( float val ){ percent = val < 0 ? 0 : val; }
  27. void setAddedValue( float val ){ addedPercent = val < 0 ? 0 : val; }
  28. void setColorMin( long newColor ) { colorMin = newColor; }
  29. void setColorMax( long newColor ){ colorMax = newColor; }
  30. void setAddedColorMin( long newColor ){ addedColorMin = newColor; }
  31. void setAddedColorMax( long newColor ){ addedColorMax = newColor; }
  32. void showGUIWindow( bool show ){ bShow = show; }
  33. bool pointInside(long mouseX, long mouseY) const;
  34. private:
  35. GUI_RECT outsideRect;
  36. long unitHeight;
  37. long unitWidth;
  38. long unitCount;
  39. long skipWidth;
  40. long rectColor;
  41. long colorMin;
  42. long colorMax;
  43. long addedColorMin;
  44. long addedColorMax;
  45. float percent;
  46. float addedPercent;
  47. long numBars;
  48. bool bShow;
  49. long helpID;
  50. };
  51. //*************************************************************************************************
  52. #endif // end of file ( AttributeMeter.h )