Skip to content

Commit

Permalink
FFQuantityPanel: Update member accessibility
Browse files Browse the repository at this point in the history
  • Loading branch information
AdamWillden committed Oct 28, 2020
1 parent 3aecdf4 commit 0196f2e
Showing 1 changed file with 63 additions and 61 deletions.
124 changes: 63 additions & 61 deletions cl_dll/ff/vgui/ff_quantitypanel.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ namespace vgui
{
DECLARE_CLASS_SIMPLE( FFQuantityPanel, Panel );
public:

FFQuantityPanel( Panel *parent, const char *panelName );

enum ColorMode {
Expand Down Expand Up @@ -59,57 +60,13 @@ namespace vgui
ALIGN_BOTTOM
};

void AddBooleanOption(KeyValues* kvMessage, const char *pszName, const char *pszText, const bool defaultValue = false);
void AddComboOption(KeyValues* kvMessage, const char *pszName, const char *pszText, KeyValues* kvOptions, const int defaultValueId = -1);
virtual KeyValues* AddPanelSpecificOptions(KeyValues *kvPanelSpecificOptions);
virtual KeyValues* AddItemStyleList(KeyValues *kvItemStyleList);

virtual void Paint( void );
virtual void OnTick( void );

virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual KeyValues* GetDefaultStyleData();

void SetHeaderText( wchar_t *newHeaderText, bool bRecalculatePaintOffset = true );
void SetHeaderIconChar( char *newHeaderIconChar, bool bRecalculatePaintOffset = true );
void SetText( wchar_t *newText, bool bRecalculatePaintOffset = true );

void SetHeaderTextShadow( bool bHasShadow);
void SetHeaderIconShadow( bool bHasShadow);
void SetTextShadow( bool bHasShadow);

void SetHeaderTextSize( int iSize, bool bRecalculatePaintOffset = true );
void SetHeaderIconSize( int iSize, bool bRecalculatePaintOffset = true );
void SetTextSize( int iSize, bool bRecalculatePaintOffset = true );

void SetHeaderTextVisible( bool bIsVisible, bool bRecalculatePaintOffset = true );
void SetHeaderIconVisible( bool bIsVisible, bool bRecalculatePaintOffset = true );
void SetTextVisible( bool bIsVisible, bool bRecalculatePaintOffset = true );

void SetUseToggleText( bool bUseToggletext );
void SetToggleTextVisible( bool bIsVisible );

void SetHeaderTextAnchorPosition( int iAnchorPositionHeaderText, bool bRecalculatePaintOffset = true );
void SetHeaderIconAnchorPosition( int iAnchorPositionHeaderIcon, bool bRecalculatePaintOffset = true );
void SetTextAnchorPosition( int iAnchorPositionText, bool bRecalculatePaintOffset = true );

void SetHeaderTextAlignment( int iAlignHHeaderText, int iAlignVHeaderText, bool bRecalculatePaintOffset = true );
void SetHeaderIconAlignment( int iAlignHHeaderIcon, int iAlignVHeaderIcon, bool bRecalculatePaintOffset = true );
void SetTextAlignment( int iAlignHText, int iAlignVText, bool bRecalculatePaintOffset = true );

void SetHeaderTextPositionOffset( int iOffsetXHeaderText, int iOffsetYHeaderText, bool bRecalculatePaintOffset = true );
void SetHeaderIconPositionOffset( int iOffsetXHeaderIcon, int iOffsetYHeaderIcon, bool bRecalculatePaintOffset = true );
void SetTextPositionOffset( int iOffsetXText, int iOffsetYText, bool bRecalculatePaintOffset = true );

void SetHeaderTextColor( Color newHeaderTextColor );
void SetHeaderIconColor( Color newHeaderIconColor );
void SetTextColor( Color newTextColor );

void SetTeamColor( Color teamColor );
Color GetTeamColor();

void ApplyStyleData( KeyValues *kvStyleData, bool useDefaults = true );

FFQuantityItem* AddItem( const char *pElementName );
void HideItem( FFQuantityItem* qBar );
void ShowItem( FFQuantityItem* qBar );
Expand All @@ -119,33 +76,33 @@ namespace vgui
void SetPreviewMode(bool bInPreview);
//TODO void FlashColor(Color colorFlash);

private:
MESSAGE_FUNC_PARAMS( OnItemDimentionsChanged, "ItemDimentionsChanged", data );
MESSAGE_FUNC_PARAMS( OnDefaultStyleDataRequested, "GetStyleData", data);

protected:
void CalculateTextAnchorPosition( int &outX, int &outY, int iAnchorPosition );
void CalculateTextAlignmentOffset( int &outX, int &outY, int &iWide, int &iTall, int iAlignHoriz, int iAlignVert, HFont hfFont, wchar_t* wszString );

void RecalculateItemPositions();
void RecalculateHeaderIconPosition( bool bRecalculatePaintOffset = true );
void RecalculateHeaderTextPosition( bool bRecalculatePaintOffset = true );
void RecalculateTextPosition( bool bRecalculatePaintOffset = true );
void RecalculatePaintOffset( void );

//bool m_bVidInit;
bool m_bPreviewMode;
void AddPanelToHudOptions( const char* szSelfName, const char* szSelfText, const char* szParentName, const char* szParentText );
void AddBooleanOption(KeyValues* kvMessage, const char *pszName, const char *pszText, const bool defaultValue = false);
void AddComboOption(KeyValues* kvMessage, const char *pszName, const char *pszText, KeyValues* kvOptions, const int defaultValueId = -1);
virtual KeyValues* AddPanelSpecificOptions(KeyValues *kvPanelSpecificOptions);
virtual KeyValues* AddItemStyleList(KeyValues *kvItemStyleList);

virtual void Paint( void );
virtual void OnTick( void );

virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual KeyValues* GetDefaultStyleData();

virtual MESSAGE_FUNC_PARAMS( OnStyleDataRecieved, "SetStyleData", kvStyleData );
virtual MESSAGE_FUNC_PARAMS( OnPresetPreviewDataRecieved, "SetPresetPreviewData", kvPresetPreviewData );
void AddPanelToHudOptions( const char* szSelfName, const char* szSelfText, const char* szParentName, const char* szParentText );


private:

char m_szSelfName[128];
char m_szSelfText[128];
char m_szParentName[128];
char m_szParentText[128];
bool m_bAddToHud;
bool m_bAddToHudSent;

bool m_bPreviewMode;

float m_flScale;
float m_flScaleX;
Expand Down Expand Up @@ -266,7 +223,52 @@ namespace vgui
int m_iHeaderIconPositionX;
int m_iHeaderIconPositionY;
int m_iTextPositionX;
int m_iTextPositionY;
int m_iTextPositionY;

void SetHeaderTextShadow( bool bHasShadow);
void SetHeaderIconShadow( bool bHasShadow);
void SetTextShadow( bool bHasShadow);

void SetHeaderTextSize( int iSize, bool bRecalculatePaintOffset = true );
void SetHeaderIconSize( int iSize, bool bRecalculatePaintOffset = true );
void SetTextSize( int iSize, bool bRecalculatePaintOffset = true );

void SetHeaderTextVisible( bool bIsVisible, bool bRecalculatePaintOffset = true );
void SetHeaderIconVisible( bool bIsVisible, bool bRecalculatePaintOffset = true );
void SetTextVisible( bool bIsVisible, bool bRecalculatePaintOffset = true );

void SetHeaderTextAnchorPosition( int iAnchorPositionHeaderText, bool bRecalculatePaintOffset = true );
void SetHeaderIconAnchorPosition( int iAnchorPositionHeaderIcon, bool bRecalculatePaintOffset = true );
void SetTextAnchorPosition( int iAnchorPositionText, bool bRecalculatePaintOffset = true );

void SetHeaderTextAlignment( int iAlignHHeaderText, int iAlignVHeaderText, bool bRecalculatePaintOffset = true );
void SetHeaderIconAlignment( int iAlignHHeaderIcon, int iAlignVHeaderIcon, bool bRecalculatePaintOffset = true );
void SetTextAlignment( int iAlignHText, int iAlignVText, bool bRecalculatePaintOffset = true );

void SetHeaderTextPositionOffset( int iOffsetXHeaderText, int iOffsetYHeaderText, bool bRecalculatePaintOffset = true );
void SetHeaderIconPositionOffset( int iOffsetXHeaderIcon, int iOffsetYHeaderIcon, bool bRecalculatePaintOffset = true );
void SetTextPositionOffset( int iOffsetXText, int iOffsetYText, bool bRecalculatePaintOffset = true );

void SetHeaderTextColor( Color newHeaderTextColor );
void SetHeaderIconColor( Color newHeaderIconColor );
void SetTextColor( Color newTextColor );

void SetTeamColor( Color teamColor );
Color GetTeamColor();

void ApplyStyleData( KeyValues *kvStyleData, bool useDefaults = true );

void CalculateTextAnchorPosition( int &outX, int &outY, int iAnchorPosition );
void CalculateTextAlignmentOffset( int &outX, int &outY, int &iWide, int &iTall, int iAlignHoriz, int iAlignVert, HFont hfFont, wchar_t* wszString );

void RecalculateItemPositions();
void RecalculateHeaderIconPosition( bool bRecalculatePaintOffset = true );
void RecalculateHeaderTextPosition( bool bRecalculatePaintOffset = true );
void RecalculateTextPosition( bool bRecalculatePaintOffset = true );
void RecalculatePaintOffset( void );

MESSAGE_FUNC_PARAMS( OnItemDimentionsChanged, "ItemDimentionsChanged", data );
MESSAGE_FUNC_PARAMS( OnDefaultStyleDataRequested, "GetStyleData", data);
};
}

Expand Down

0 comments on commit 0196f2e

Please sign in to comment.