DDraceNetwork Docs
CSkins Class Reference

#include <skins.h>

Inheritance diagram for CSkins:
[legend]
Collaboration diagram for CSkins:
[legend]

Classes

class  CLoadingSkin
 
class  CSkinDownloadJob
 

Public Types

typedef std::function< void()> TSkinLoadedCallback
 

Public Member Functions

 CSkins ()
 
int Sizeof () const override
 
void OnInit () override
 
void OnShutdown () override
 
void Refresh (TSkinLoadedCallback &&SkinLoadedCallback)
 
std::chrono::nanoseconds LastRefreshTime () const
 
const std::unordered_map< std::string_view, std::unique_ptr< CSkin > > & GetSkinsUnsafe () const
 
const CSkinFindOrNullptr (const char *pName, bool IgnorePrefix=false)
 
const CSkinFind (const char *pName)
 
void RandomizeSkin (int Dummy)
 
- Public Member Functions inherited from CComponent
virtual ~CComponent ()
 
virtual int Sizeof () const =0
 
class CGameClientGameClient () const
 
class IClientClient () const
 
virtual void OnStateChange (int NewState, int OldState)
 
virtual void OnConsoleInit ()
 
virtual void OnInit ()
 
virtual void OnShutdown ()
 
virtual void OnReset ()
 
virtual void OnWindowResize ()
 
virtual void OnRefreshSkins ()
 
virtual void OnRender ()
 
virtual void OnNewSnapshot ()
 
virtual void OnRelease ()
 
virtual void OnMapLoad ()
 
virtual void OnMessage (int Msg, void *pRawMsg)
 
virtual bool OnCursorMove (float x, float y, IInput::ECursorType CursorType)
 
virtual bool OnInput (const IInput::CEvent &Event)
 

Static Public Member Functions

static bool IsVanillaSkin (const char *pName)
 

Static Public Attributes

static constexpr const char * VANILLA_SKINS []
 

Private Member Functions

const CSkinLoadSkin (const char *pName, const char *pPath, int DirType)
 
const CSkinLoadSkin (const char *pName, CImageInfo &Info)
 
const CSkinFindImpl (const char *pName)
 

Static Private Member Functions

static int SkinScan (const char *pName, int IsDir, int DirType, void *pUser)
 

Private Attributes

std::unordered_map< std::string_view, std::unique_ptr< CSkin > > m_Skins
 
std::unordered_map< std::string_view, std::unique_ptr< CLoadingSkin > > m_LoadingSkins
 
std::chrono::nanoseconds m_LastRefreshTime
 
CSkin m_PlaceholderSkin
 
char m_aEventSkinPrefix [MAX_SKIN_LENGTH]
 

Additional Inherited Members

- Protected Member Functions inherited from CComponent
class IKernelKernel () const
 
class IEngineEngine () const
 
class IGraphicsGraphics () const
 
class ITextRenderTextRender () const
 
class IInputInput () const
 
class IStorageStorage () const
 
class CUiUi () const
 
class ISoundSound () const
 
class CRenderToolsRenderTools () const
 
class IConfigManagerConfigManager () const
 
class CConfigConfig () const
 
class IConsoleConsole () const
 
class IDemoPlayerDemoPlayer () const
 
class IDemoRecorderDemoRecorder (int Recorder) const
 
class IFavoritesFavorites () const
 
class IServerBrowserServerBrowser () const
 
class CLayersLayers () const
 
class CCollisionCollision () const
 
int64_t time () const
 
float LocalTime () const
 
class IHttpHttp () const
 
- Protected Attributes inherited from CComponent
CGameClientm_pClient
 

Member Typedef Documentation

◆ TSkinLoadedCallback

typedef std::function<void()> CSkins::TSkinLoadedCallback

Constructor & Destructor Documentation

◆ CSkins()

CSkins::CSkins ( )

Member Function Documentation

◆ Find()

const CSkin * CSkins::Find ( const char *  pName)

◆ FindImpl()

const CSkin * CSkins::FindImpl ( const char *  pName)
private

◆ FindOrNullptr()

const CSkin * CSkins::FindOrNullptr ( const char *  pName,
bool  IgnorePrefix = false 
)

◆ GetSkinsUnsafe()

const std::unordered_map< std::string_view, std::unique_ptr< CSkin > > & CSkins::GetSkinsUnsafe ( ) const
inline

◆ IsVanillaSkin()

bool CSkins::IsVanillaSkin ( const char *  pName)
static

◆ LastRefreshTime()

std::chrono::nanoseconds CSkins::LastRefreshTime ( ) const
inline

◆ LoadSkin() [1/2]

const CSkin * CSkins::LoadSkin ( const char *  pName,
CImageInfo Info 
)
private

◆ LoadSkin() [2/2]

const CSkin * CSkins::LoadSkin ( const char *  pName,
const char *  pPath,
int  DirType 
)
private

◆ OnInit()

void CSkins::OnInit ( )
overridevirtual

Called to let the components run initialization code.

Reimplemented from CComponent.

◆ OnShutdown()

void CSkins::OnShutdown ( )
overridevirtual

Called to cleanup the component. This method is called when the client is closed.

Reimplemented from CComponent.

◆ RandomizeSkin()

void CSkins::RandomizeSkin ( int  Dummy)

◆ Refresh()

void CSkins::Refresh ( TSkinLoadedCallback &&  SkinLoadedCallback)

◆ Sizeof()

int CSkins::Sizeof ( ) const
inlineoverridevirtual

Gets the size of the non-abstract component.

Implements CComponent.

◆ SkinScan()

int CSkins::SkinScan ( const char *  pName,
int  IsDir,
int  DirType,
void *  pUser 
)
staticprivate

Member Data Documentation

◆ m_aEventSkinPrefix

char CSkins::m_aEventSkinPrefix[MAX_SKIN_LENGTH]
private

◆ m_LastRefreshTime

std::chrono::nanoseconds CSkins::m_LastRefreshTime
private

◆ m_LoadingSkins

std::unordered_map<std::string_view, std::unique_ptr<CLoadingSkin> > CSkins::m_LoadingSkins
private

◆ m_PlaceholderSkin

CSkin CSkins::m_PlaceholderSkin
private

◆ m_Skins

std::unordered_map<std::string_view, std::unique_ptr<CSkin> > CSkins::m_Skins
private

◆ VANILLA_SKINS

constexpr const char* CSkins::VANILLA_SKINS[]
staticconstexpr
Initial value:
= {"bluekitty", "bluestripe", "brownbear",
"cammo", "cammostripes", "coala", "default", "limekitty",
"pinky", "redbopp", "redstripe", "saddo", "toptri",
"twinbop", "twintri", "warpaint", "x_ninja", "x_spec"}

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