diff --git a/cl_dll/ff/vgui/ff_quantityitem.h b/cl_dll/ff/vgui/ff_quantityitem.h index ad9d42761..d62233d98 100644 --- a/cl_dll/ff/vgui/ff_quantityitem.h +++ b/cl_dll/ff/vgui/ff_quantityitem.h @@ -33,150 +33,6 @@ namespace vgui { private: DECLARE_CLASS_SIMPLE( FFQuantityItem, Panel ); - public: - FFQuantityItem( Panel *parent, const char *pElementName ); - - enum ColorMode { - ITEM_COLOR_MODE_CUSTOM=0, - ITEM_COLOR_MODE_STEPPED, - ITEM_COLOR_MODE_FADED, - ITEM_COLOR_MODE_TEAMCOLORED - }; - - enum Position { - ANCHORPOS_TOPLEFT=0, - ANCHORPOS_TOPCENTER, - ANCHORPOS_TOPRIGHT, - ANCHORPOS_MIDDLELEFT, - ANCHORPOS_MIDDLECENTER, - ANCHORPOS_MIDDLERIGHT, - ANCHORPOS_BOTTOMLEFT, - ANCHORPOS_BOTTOMCENTER, - ANCHORPOS_BOTTOMRIGHT - }; - - enum AlignmentHorizontal { - ALIGN_LEFT=0, - ALIGN_CENTER, - ALIGN_RIGHT - }; - - enum AlignmentVertical { - ALIGN_TOP=0, - ALIGN_MIDDLE, - ALIGN_BOTTOM - }; - - enum Orientation { - ORIENTATION_HORIZONTAL=0, - ORIENTATION_VERTICAL, - ORIENTATION_HORIZONTAL_INVERTED, - ORIENTATION_VERTICAL_INVERTED - }; - - bool GetItemDimentionsChanged(); - void SetItemDimentionsChanged( bool bItemDimentionsChanged ); - - void GetPanelPositioningData( int& iWidth, int& iHeight, int& iBarOffsetX, int& iBarOffsetY ); - virtual void SetPos( int iLeft, int iTop ); - void SetPosOffset( int iLeft, int iTop ); - void SetPaintOffset( int iLeft, int iTop ); - void SetStyle(KeyValues *kvStyleData, KeyValues *kvDefaultStyleData ); - - void SetAmount( int iAmount ); - void SetAmountMax( int iAmountMax, bool bRecalculatePaintOffset = true ); - - void SetIconChar(char *newIconChar, bool bRecalculatePaintOffset = true ); - void SetLabelText(char *newLabelText, bool bRecalculatePaintOffset = true ); - - void SetAmountSize( int newAmountSize, bool bRecalculatePaintOffset = true ); - void SetIconSize( int newIconSize, bool bRecalculatePaintOffset = true ); - void SetLabelSize( int newLabelSize, bool bRecalculatePaintOffset = true ); - - void SetAmountFontShadow( bool bHasShadow ); - void SetIconFontShadow( bool bHasShadow ); - void SetLabelFontShadow( bool bHasShadow ); - - void SetIconFontGlyph( bool bIconIsGlyph, bool bRecalculatePaintOffset = true ); - - void SetAmountFontTahoma( bool bAmountFontTahoma, bool bRecalculatePaintOffset = true ); - void SetLabelFontTahoma( bool bLabelFontTahoma, bool bRecalculatePaintOffset = true ); - - void SetBarWidth( int iBarWidth, bool bRecalculatePaintOffset = true ); - void SetBarHeight( int iBarHeight, bool bRecalculatePaintOffset = true ); - void SetBarBorderWidth( int iBarBorderWidth, bool bRecalculatePaintOffset = true ); - void SetBarOrientation( int iBarOrientation ); - - void SetAmountAnchorPosition( int iAmountAnchorPosition, bool bRecalculatePaintOffset = true ); - void SetIconAnchorPosition( int iIconAnchorPosition, bool bRecalculatePaintOffset = true ); - void SetLabelAnchorPosition( int iLabelAnchorPosition, bool bRecalculatePaintOffset = true ); - - void SetAmountAlignmentHorizontal( int iAmountAlignHoriz, bool bRecalculatePaintOffset = true ); - void SetIconAlignmentHorizontal( int iIconAlignHoriz, bool bRecalculatePaintOffset = true ); - void SetLabelAlignmentHorizontal( int iLabelAlignHoriz, bool bRecalculatePaintOffset = true ); - - void SetAmountAlignmentVertical( int iAmountAlignVert, bool bRecalculatePaintOffset = true ); - void SetIconAlignmentVertical( int iIconAlignVert, bool bRecalculatePaintOffset = true ); - void SetLabelAlignmentVertical( int iLabelAlignVert, bool bRecalculatePaintOffset = true ); - - void SetAmountPositionOffsetX( int iAmountPositionOffsetX, bool bRecalculatePaintOffset = true ); - void SetAmountPositionOffsetY( int iAmountPositionOffsetY, bool bRecalculatePaintOffset = true ); - void SetIconPositionOffsetX( int iIconPositionOffsetX, bool bRecalculatePaintOffset = true ); - void SetIconPositionOffsetY( int iIconPositionOffsetY, bool bRecalculatePaintOffset = true ); - void SetLabelPositionOffsetX( int iLabelPositionOffsetX, bool bRecalculatePaintOffset = true ); - void SetLabelPositionOffsetY( int iLabelPositionOffsetY, bool bRecalculatePaintOffset = true ); - - void ShowBar( bool bShowBar, bool bRecalculatePaintOffset = true ); - void ShowBarBorder( bool bShowBarBorder, bool bRecalculatePaintOffset = true ); - void ShowBarBackground( bool bShowBarBackground, bool bRecalculatePaintOffset = true ); - void ShowAmount( bool bShowAmount, bool bRecalculatePaintOffset = true ); - void ShowAmountMax( bool bShowAmountMax, bool bRecalculatePaintOffset = true ); - void ShowIcon( bool bShowIcon, bool bRecalculatePaintOffset = true ); - void ShowLabel( bool bShowLabel, bool bRecalculatePaintOffset = true ); - - void SetBarColor( Color newBarColor ); - void SetBarBorderColor( Color newBarBorderColor ); - void SetBarBackgroundColor( Color newBarBorderColor ); - void SetAmountColor( Color newAmountColor ); - void SetIconColor( Color newIconColor ); - void SetLabelColor( Color newLabelColor ); - void SetTeamColor( Color newTeamColor ); - - void SetBarColorMode( int iBarColorMode ); - void SetBarBorderColorMode( int iBarBorderColorMode ); - void SetBarBackgroundColorMode( int iBarBorderColorMode ); - void SetAmountColorMode( int iAmountColorMode ); - void SetIconColorMode( int iIconColorMode ); - void SetLabelColorMode( int iLabelColoModer ); - - void SetIntensityControl( int iRed, int iOrange,int iYellow, int iGreen, bool bInvertScale = false ); - void SetIntensityAmountScaled( bool bAmountScaled ); - void SetIntensityValuesFixed( bool bIntensityValuesFixed ); - bool IsIntensityValuesFixed( ); - - int GetAmount( ); - int GetMaxAmount( ); - - virtual void Paint( ); - virtual void OnTick( ); - - void SetDisabled(bool bState); - bool IsDisabled( ); - - protected: - void CalculateTextPositionOffset( int &outX, int &outY, int iPos ); - void CalculateTextAlignmentOffset( int &outX, int &outY, int &iWide, int &iTall, int iAlignHoriz, int iAlignVert, HFont hfFont, wchar_t* wszString ); - void RecalculateQuantity( ); - void RecalculateIconPosition( bool bRecalculatePaintOffset = true ); - void RecalculateLabelPosition( bool bRecalculatePaintOffset = true ); - void RecalculateAmountPosition( ); - void RecalculateAmountMaxPosition( bool bRecalculatePaintOffset = true ); - void RecalculatePaintOffset( ); - void RecalculateColor( int colorMode, Color &color, Color &colorCustom ); - - bool m_bItemDimentionsChanged; - - virtual void ApplySchemeSettings( IScheme *pScheme ); HFont m_hfQuantityItemText[QUANTITYITEMTEXTSIZES * 3]; HFont m_hfQuantityItemTahomaText[QUANTITYITEMTEXTSIZES * 3]; @@ -343,6 +199,150 @@ namespace vgui Color m_ColorTeam; Color m_ColorIntensityFaded; Color m_ColorIntensityStepped; + + void SetIconFontGlyph( bool bIconIsGlyph, bool bRecalculatePaintOffset = true ); + void SetAmountFontTahoma( bool bAmountFontTahoma, bool bRecalculatePaintOffset = true ); + void SetLabelFontTahoma( bool bLabelFontTahoma, bool bRecalculatePaintOffset = true ); + + void SetAmountFontShadow( bool bHasShadow ); + void SetIconFontShadow( bool bHasShadow ); + void SetLabelFontShadow( bool bHasShadow ); + + void SetAmountSize( int newAmountSize, bool bRecalculatePaintOffset = true ); + void SetIconSize( int newIconSize, bool bRecalculatePaintOffset = true ); + void SetLabelSize( int newLabelSize, bool bRecalculatePaintOffset = true ); + + void SetBarWidth( int iBarWidth, bool bRecalculatePaintOffset = true ); + void SetBarHeight( int iBarHeight, bool bRecalculatePaintOffset = true ); + void SetBarBorderWidth( int iBarBorderWidth, bool bRecalculatePaintOffset = true ); + void SetBarOrientation( int iBarOrientation ); + + void SetAmountAnchorPosition( int iAmountAnchorPosition, bool bRecalculatePaintOffset = true ); + void SetIconAnchorPosition( int iIconAnchorPosition, bool bRecalculatePaintOffset = true ); + void SetLabelAnchorPosition( int iLabelAnchorPosition, bool bRecalculatePaintOffset = true ); + + void SetAmountAlignmentHorizontal( int iAmountAlignHoriz, bool bRecalculatePaintOffset = true ); + void SetIconAlignmentHorizontal( int iIconAlignHoriz, bool bRecalculatePaintOffset = true ); + void SetLabelAlignmentHorizontal( int iLabelAlignHoriz, bool bRecalculatePaintOffset = true ); + + void SetAmountAlignmentVertical( int iAmountAlignVert, bool bRecalculatePaintOffset = true ); + void SetIconAlignmentVertical( int iIconAlignVert, bool bRecalculatePaintOffset = true ); + void SetLabelAlignmentVertical( int iLabelAlignVert, bool bRecalculatePaintOffset = true ); + + void SetAmountPositionOffsetX( int iAmountPositionOffsetX, bool bRecalculatePaintOffset = true ); + void SetAmountPositionOffsetY( int iAmountPositionOffsetY, bool bRecalculatePaintOffset = true ); + void SetIconPositionOffsetX( int iIconPositionOffsetX, bool bRecalculatePaintOffset = true ); + void SetIconPositionOffsetY( int iIconPositionOffsetY, bool bRecalculatePaintOffset = true ); + void SetLabelPositionOffsetX( int iLabelPositionOffsetX, bool bRecalculatePaintOffset = true ); + void SetLabelPositionOffsetY( int iLabelPositionOffsetY, bool bRecalculatePaintOffset = true ); + + void ShowBar( bool bShowBar, bool bRecalculatePaintOffset = true ); + void ShowBarBorder( bool bShowBarBorder, bool bRecalculatePaintOffset = true ); + void ShowBarBackground( bool bShowBarBackground, bool bRecalculatePaintOffset = true ); + void ShowAmount( bool bShowAmount, bool bRecalculatePaintOffset = true ); + void ShowAmountMax( bool bShowAmountMax, bool bRecalculatePaintOffset = true ); + void ShowIcon( bool bShowIcon, bool bRecalculatePaintOffset = true ); + void ShowLabel( bool bShowLabel, bool bRecalculatePaintOffset = true ); + + void SetBarColor( Color newBarColor ); + void SetBarBorderColor( Color newBarBorderColor ); + void SetBarBackgroundColor( Color newBarBorderColor ); + void SetAmountColor( Color newAmountColor ); + void SetIconColor( Color newIconColor ); + void SetLabelColor( Color newLabelColor ); + void SetTeamColor( Color newTeamColor ); + + void SetBarColorMode( int iBarColorMode ); + void SetBarBorderColorMode( int iBarBorderColorMode ); + void SetBarBackgroundColorMode( int iBarBorderColorMode ); + void SetAmountColorMode( int iAmountColorMode ); + void SetIconColorMode( int iIconColorMode ); + void SetLabelColorMode( int iLabelColoModer ); + + void CalculateTextPositionOffset( int &outX, int &outY, int iPos ); + void CalculateTextAlignmentOffset( int &outX, int &outY, int &iWide, int &iTall, int iAlignHoriz, int iAlignVert, HFont hfFont, wchar_t* wszString ); + void RecalculateQuantity( ); + void RecalculateIconPosition( bool bRecalculatePaintOffset = true ); + void RecalculateLabelPosition( bool bRecalculatePaintOffset = true ); + void RecalculateAmountPosition( ); + void RecalculateAmountMaxPosition( bool bRecalculatePaintOffset = true ); + void RecalculatePaintOffset( ); + void RecalculateColor( int colorMode, Color &color, Color &colorCustom ); + + bool m_bItemDimentionsChanged; + + public: + FFQuantityItem( Panel *parent, const char *pElementName ); + + enum ColorMode { + ITEM_COLOR_MODE_CUSTOM=0, + ITEM_COLOR_MODE_STEPPED, + ITEM_COLOR_MODE_FADED, + ITEM_COLOR_MODE_TEAMCOLORED + }; + + enum Position { + ANCHORPOS_TOPLEFT=0, + ANCHORPOS_TOPCENTER, + ANCHORPOS_TOPRIGHT, + ANCHORPOS_MIDDLELEFT, + ANCHORPOS_MIDDLECENTER, + ANCHORPOS_MIDDLERIGHT, + ANCHORPOS_BOTTOMLEFT, + ANCHORPOS_BOTTOMCENTER, + ANCHORPOS_BOTTOMRIGHT + }; + + enum AlignmentHorizontal { + ALIGN_LEFT=0, + ALIGN_CENTER, + ALIGN_RIGHT + }; + + enum AlignmentVertical { + ALIGN_TOP=0, + ALIGN_MIDDLE, + ALIGN_BOTTOM + }; + + enum Orientation { + ORIENTATION_HORIZONTAL=0, + ORIENTATION_VERTICAL, + ORIENTATION_HORIZONTAL_INVERTED, + ORIENTATION_VERTICAL_INVERTED + }; + + bool GetItemDimentionsChanged(); + void SetItemDimentionsChanged( bool bItemDimentionsChanged ); + + void GetPanelPositioningData( int& iWidth, int& iHeight, int& iBarOffsetX, int& iBarOffsetY ); + virtual void SetPos( int iLeft, int iTop ); + void SetPosOffset( int iLeft, int iTop ); + void SetPaintOffset( int iLeft, int iTop ); + void SetStyle(KeyValues *kvStyleData, KeyValues *kvDefaultStyleData ); + + void SetAmount( int iAmount ); + void SetAmountMax( int iAmountMax, bool bRecalculatePaintOffset = true ); + + void SetIconChar(char *newIconChar, bool bRecalculatePaintOffset = true ); + void SetLabelText(char *newLabelText, bool bRecalculatePaintOffset = true ); + + void SetIntensityControl( int iRed, int iOrange,int iYellow, int iGreen, bool bInvertScale = false ); + void SetIntensityAmountScaled( bool bAmountScaled ); + void SetIntensityValuesFixed( bool bIntensityValuesFixed ); + bool IsIntensityValuesFixed( ); + + int GetAmount( ); + int GetMaxAmount( ); + + virtual void Paint( ); + virtual void OnTick( ); + + void SetDisabled(bool bState); + bool IsDisabled( ); + + protected: + virtual void ApplySchemeSettings( IScheme *pScheme ); }; } #endif \ No newline at end of file