PRooFPS-dd Dev Doc 1.0
PRooFPS-dd Developer Documentation
Loading...
Searching...
No Matches
proofps_dd::XHair Class Reference

Finally a dedicated class for crosshair was needed, because from PRooFPS-dd v0.2.5, the crosshair becomes smarter and smarter, and for the related functionalities we should keep some logic separate. More...

Detailed Description

Finally a dedicated class for crosshair was needed, because from PRooFPS-dd v0.2.5, the crosshair becomes smarter and smarter, and for the related functionalities we should keep some logic separate.

Definition at line 29 of file XHair.h.

#include <XHair.h>

Public Member Functions

CConsole & getConsole () const
 
 XHair (PGE &pge)
 
 ~XHair ()
 
PureObject3D & getObject3D ()
 
void show ()
 
void showInCenter ()
 
void hide ()
 
bool visible () const
 
void updateUnprojectedCoords (PureCamera &cam)
 
const PureVector & getUnprojectedCoords () const
 
void showIdText (const std::string &sText, const ImVec4 &color={1.f, 1.f, 1.f, 1.f})
 
void hideIdText ()
 
const std::string & getIdText () const
 
void showAboveText (const std::string &sText, const ImVec4 &color={ 1.f, 1.f, 1.f, 1.f })
 
void hideAboveText ()
 
const std::string & getAboveText () const
 
const ImVec4 & getIdTextColor () const
 
const ImVec4 & getAboveTextColor () const
 
void startBlinking ()
 
void stopBlinking ()
 
void handleMagEmpty ()
 
void handleMagLoaded ()
 
void handleCooldownStart ()
 
void handleCooldownEnd ()
 
void setBaseScaling (float scaleFactor)
 Sets the base/initial scaling for the crosshair.
 
void setRelativeScaling (float relativeScaleFactor)
 Sets the relative scaling for the crosshair.
 
void updateVisuals ()
 

Static Public Member Functions

static const char * getLoggerModuleName ()
 

Static Public Attributes

static constexpr char * szCvarGuiXHairIdentifiesPlayers = "gui_xhair_identifies_players"
 

Protected Member Functions

 XHair (const XHair &)=delete
 
XHairoperator= (const XHair &)=delete
 
 XHair (XHair &&)=delete
 
XHair && operator= (XHair &&)=delete
 

Private Types

enum class  HighlightRect { Upper = 0 , Lower , Left , Right }
 

Private Member Functions

void adjustHighlightSize (const bool &bCanShowHighlightPerXHairMovement)
 
void updateHighlight ()
 

Private Attributes

PGE & m_pge
 
PureObject3D * m_pObjXHair
 
TPURE_XY m_prevXHairPos
 
PureVector m_vecUnprojected
 
PureObject3D * m_pObjDebugCube
 
PureObject3D * m_vHLightRects [4] = {}
 
std::string m_sIdText
 
ImVec4 m_clrIdText
 
std::string m_sAboveText
 
ImVec4 m_clrAboveText { 1.f, 1.f, 1.f, 1.f }
 
std::chrono::time_point< std::chrono::steady_clock > m_timeStartedBlinking
 
bool m_bVisible = false
 
bool m_bBlinking = false
 
float m_fBaseScaling = 1.f
 
float m_fRelativeScaleFactor = 1.f
 

Member Enumeration Documentation

◆ HighlightRect

enum class proofps_dd::XHair::HighlightRect
strongprivate
Enumerator
Upper 
Lower 
Left 
Right 

Definition at line 92 of file XHair.h.

Constructor & Destructor Documentation

◆ XHair() [1/3]

proofps_dd::XHair::XHair ( PGE & pge)

Definition at line 33 of file XHair.cpp.

◆ ~XHair()

proofps_dd::XHair::~XHair ( )

Definition at line 87 of file XHair.cpp.

◆ XHair() [2/3]

proofps_dd::XHair::XHair ( const XHair & )
protecteddelete

◆ XHair() [3/3]

proofps_dd::XHair::XHair ( XHair && )
protecteddelete

Member Function Documentation

◆ adjustHighlightSize()

void proofps_dd::XHair::adjustHighlightSize ( const bool & bCanShowHighlightPerXHairMovement)
private

Definition at line 392 of file XHair.cpp.

◆ getAboveText()

const std::string & proofps_dd::XHair::getAboveText ( ) const

Definition at line 248 of file XHair.cpp.

◆ getAboveTextColor()

const ImVec4 & proofps_dd::XHair::getAboveTextColor ( ) const

Definition at line 258 of file XHair.cpp.

◆ getConsole()

CConsole & proofps_dd::XHair::getConsole ( ) const

Definition at line 28 of file XHair.cpp.

◆ getIdText()

const std::string & proofps_dd::XHair::getIdText ( ) const

Definition at line 232 of file XHair.cpp.

◆ getIdTextColor()

const ImVec4 & proofps_dd::XHair::getIdTextColor ( ) const

Definition at line 253 of file XHair.cpp.

◆ getLoggerModuleName()

const char * proofps_dd::XHair::getLoggerModuleName ( )
static

Definition at line 23 of file XHair.cpp.

◆ getObject3D()

PureObject3D & proofps_dd::XHair::getObject3D ( )

Definition at line 105 of file XHair.cpp.

◆ getUnprojectedCoords()

const PureVector & proofps_dd::XHair::getUnprojectedCoords ( ) const

Definition at line 216 of file XHair.cpp.

◆ handleCooldownEnd()

void proofps_dd::XHair::handleCooldownEnd ( )

Definition at line 328 of file XHair.cpp.

◆ handleCooldownStart()

void proofps_dd::XHair::handleCooldownStart ( )

Definition at line 314 of file XHair.cpp.

◆ handleMagEmpty()

void proofps_dd::XHair::handleMagEmpty ( )

Definition at line 286 of file XHair.cpp.

◆ handleMagLoaded()

void proofps_dd::XHair::handleMagLoaded ( )

Definition at line 300 of file XHair.cpp.

◆ hide()

void proofps_dd::XHair::hide ( )

Definition at line 138 of file XHair.cpp.

◆ hideAboveText()

void proofps_dd::XHair::hideAboveText ( )

Definition at line 243 of file XHair.cpp.

◆ hideIdText()

void proofps_dd::XHair::hideIdText ( )

Definition at line 227 of file XHair.cpp.

◆ operator=() [1/2]

XHair & proofps_dd::XHair::operator= ( const XHair & )
protecteddelete

◆ operator=() [2/2]

XHair && proofps_dd::XHair::operator= ( XHair && )
protecteddelete

◆ setBaseScaling()

void proofps_dd::XHair::setBaseScaling ( float scaleFactor)

Sets the base/initial scaling for the crosshair.

This base scaling is basically the minimum scaling for the crosshair during the entire gameplay. This to be called at GUI initialization, once the GUI knows the display resolution dependent scaling factor for GUI elements.

Definition at line 338 of file XHair.cpp.

◆ setRelativeScaling()

void proofps_dd::XHair::setRelativeScaling ( float relativeScaleFactor)

Sets the relative scaling for the crosshair.

This relative scaling basically represents the current weapon's momentary accuracy, you can directly pass it. Value of 1.f represents the base scaling which represents the weapon's base accuracy i.e. when the player is standing still and recoil factor is not considered. Passing negative value is considered as programming error.

Definition at line 350 of file XHair.cpp.

◆ show()

void proofps_dd::XHair::show ( )

Definition at line 111 of file XHair.cpp.

◆ showAboveText()

void proofps_dd::XHair::showAboveText ( const std::string & sText,
const ImVec4 & color = { 1.f, 1.f, 1.f, 1.f } )

Definition at line 237 of file XHair.cpp.

◆ showIdText()

void proofps_dd::XHair::showIdText ( const std::string & sText,
const ImVec4 & color = {1.f, 1.f, 1.f, 1.f} )

Definition at line 221 of file XHair.cpp.

◆ showInCenter()

void proofps_dd::XHair::showInCenter ( )

Definition at line 118 of file XHair.cpp.

◆ startBlinking()

void proofps_dd::XHair::startBlinking ( )

Definition at line 263 of file XHair.cpp.

◆ stopBlinking()

void proofps_dd::XHair::stopBlinking ( )

Definition at line 271 of file XHair.cpp.

◆ updateHighlight()

void proofps_dd::XHair::updateHighlight ( )
private

Definition at line 466 of file XHair.cpp.

◆ updateUnprojectedCoords()

void proofps_dd::XHair::updateUnprojectedCoords ( PureCamera & cam)

Definition at line 157 of file XHair.cpp.

◆ updateVisuals()

void proofps_dd::XHair::updateVisuals ( )

Definition at line 363 of file XHair.cpp.

◆ visible()

bool proofps_dd::XHair::visible ( ) const

Definition at line 152 of file XHair.cpp.

Member Data Documentation

◆ m_bBlinking

bool proofps_dd::XHair::m_bBlinking = false
private

Definition at line 112 of file XHair.h.

◆ m_bVisible

bool proofps_dd::XHair::m_bVisible = false
private

Definition at line 111 of file XHair.h.

◆ m_clrAboveText

ImVec4 proofps_dd::XHair::m_clrAboveText { 1.f, 1.f, 1.f, 1.f }
private

Definition at line 109 of file XHair.h.

◆ m_clrIdText

ImVec4 proofps_dd::XHair::m_clrIdText
private

Definition at line 107 of file XHair.h.

◆ m_fBaseScaling

float proofps_dd::XHair::m_fBaseScaling = 1.f
private

Definition at line 113 of file XHair.h.

◆ m_fRelativeScaleFactor

float proofps_dd::XHair::m_fRelativeScaleFactor = 1.f
private

Definition at line 114 of file XHair.h.

◆ m_pge

PGE& proofps_dd::XHair::m_pge
private

Definition at line 100 of file XHair.h.

◆ m_pObjDebugCube

PureObject3D* proofps_dd::XHair::m_pObjDebugCube
private

Definition at line 104 of file XHair.h.

◆ m_pObjXHair

PureObject3D* proofps_dd::XHair::m_pObjXHair
private

Definition at line 101 of file XHair.h.

◆ m_prevXHairPos

TPURE_XY proofps_dd::XHair::m_prevXHairPos
private

Definition at line 102 of file XHair.h.

◆ m_sAboveText

std::string proofps_dd::XHair::m_sAboveText
private

Definition at line 108 of file XHair.h.

◆ m_sIdText

std::string proofps_dd::XHair::m_sIdText
private

Definition at line 106 of file XHair.h.

◆ m_timeStartedBlinking

std::chrono::time_point<std::chrono::steady_clock> proofps_dd::XHair::m_timeStartedBlinking
private

Definition at line 110 of file XHair.h.

◆ m_vecUnprojected

PureVector proofps_dd::XHair::m_vecUnprojected
private

Definition at line 103 of file XHair.h.

◆ m_vHLightRects

PureObject3D* proofps_dd::XHair::m_vHLightRects[4] = {}
private

Definition at line 105 of file XHair.h.

◆ szCvarGuiXHairIdentifiesPlayers

char* proofps_dd::XHair::szCvarGuiXHairIdentifiesPlayers = "gui_xhair_identifies_players"
staticconstexpr

Definition at line 33 of file XHair.h.


The documentation for this class was generated from the following files: