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 25 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)
 
void hideIdText ()
 
const std::string & getIdText () 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
 
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 77 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 360 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 231 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 301 of file XHair.cpp.

◆ handleCooldownStart()

void proofps_dd::XHair::handleCooldownStart ( )

Definition at line 287 of file XHair.cpp.

◆ handleMagEmpty()

void proofps_dd::XHair::handleMagEmpty ( )

Definition at line 259 of file XHair.cpp.

◆ handleMagLoaded()

void proofps_dd::XHair::handleMagLoaded ( )

Definition at line 273 of file XHair.cpp.

◆ hide()

void proofps_dd::XHair::hide ( )

Definition at line 138 of file XHair.cpp.

◆ hideIdText()

void proofps_dd::XHair::hideIdText ( )

Definition at line 226 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 311 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 323 of file XHair.cpp.

◆ show()

void proofps_dd::XHair::show ( )

Definition at line 111 of file XHair.cpp.

◆ showIdText()

void proofps_dd::XHair::showIdText ( const std::string & sText)

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 236 of file XHair.cpp.

◆ stopBlinking()

void proofps_dd::XHair::stopBlinking ( )

Definition at line 244 of file XHair.cpp.

◆ updateHighlight()

void proofps_dd::XHair::updateHighlight ( )
private

Definition at line 434 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 331 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 94 of file XHair.h.

◆ m_bVisible

bool proofps_dd::XHair::m_bVisible = false
private

Definition at line 93 of file XHair.h.

◆ m_fBaseScaling

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

Definition at line 95 of file XHair.h.

◆ m_fRelativeScaleFactor

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

Definition at line 96 of file XHair.h.

◆ m_pge

PGE& proofps_dd::XHair::m_pge
private

Definition at line 85 of file XHair.h.

◆ m_pObjDebugCube

PureObject3D* proofps_dd::XHair::m_pObjDebugCube
private

Definition at line 89 of file XHair.h.

◆ m_pObjXHair

PureObject3D* proofps_dd::XHair::m_pObjXHair
private

Definition at line 86 of file XHair.h.

◆ m_prevXHairPos

TPURE_XY proofps_dd::XHair::m_prevXHairPos
private

Definition at line 87 of file XHair.h.

◆ m_sIdText

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

Definition at line 91 of file XHair.h.

◆ m_timeStartedBlinking

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

Definition at line 92 of file XHair.h.

◆ m_vecUnprojected

PureVector proofps_dd::XHair::m_vecUnprojected
private

Definition at line 88 of file XHair.h.

◆ m_vHLightRects

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

Definition at line 90 of file XHair.h.

◆ szCvarGuiXHairIdentifiesPlayers

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

Definition at line 29 of file XHair.h.


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