mirror of
https://github.com/unknownworlds/NS.git
synced 2024-11-15 09:11:55 +00:00
49 lines
1.4 KiB
C++
49 lines
1.4 KiB
C++
|
#include "mod/AvHLogoutComponent.h"
|
||
|
#include "ui/UITags.h"
|
||
|
|
||
|
////////////////////////////////////
|
||
|
// AvHLogoutComponent -> StaticLabel //
|
||
|
////////////////////////////////////
|
||
|
void AvHUILogoutComponent::AllocateComponent(const TRDescription& inDesc)
|
||
|
{
|
||
|
// Width and height (normalized screen coords)
|
||
|
float theWidth = UIDefaultWidth;
|
||
|
float theHeight = UIDefaultHeight;
|
||
|
inDesc.GetTagValue(UITagWidth, theWidth);
|
||
|
inDesc.GetTagValue(UITagHeight, theHeight);
|
||
|
|
||
|
this->mLogoutComponent = new AvHLogoutComponent(theWidth*ScreenWidth(), theHeight*ScreenHeight());
|
||
|
}
|
||
|
|
||
|
Panel* AvHUILogoutComponent::GetComponentPointer(void)
|
||
|
{
|
||
|
return this->mLogoutComponent;
|
||
|
}
|
||
|
|
||
|
bool AvHUILogoutComponent::SetClassProperties(const TRDescription& inDesc, Panel* inPanel, CSchemeManager* inSchemeManager)
|
||
|
{
|
||
|
AvHLogoutComponent* theLogoutComponent = (AvHLogoutComponent*)inPanel;
|
||
|
|
||
|
bool theSuccess = UIStaticLabel::SetClassProperties(inDesc, inPanel, inSchemeManager);
|
||
|
|
||
|
if(theSuccess)
|
||
|
{
|
||
|
// Get font to use
|
||
|
std::string theSchemeName;
|
||
|
if(inDesc.GetTagValue(UITagScheme, theSchemeName))
|
||
|
{
|
||
|
const char* theSchemeCString = theSchemeName.c_str();
|
||
|
SchemeHandle_t theSchemeHandle = inSchemeManager->getSchemeHandle(theSchemeCString);
|
||
|
Font* theFont = inSchemeManager->getFont(theSchemeHandle);
|
||
|
if(theFont)
|
||
|
{
|
||
|
theLogoutComponent->setFont(theFont);
|
||
|
}
|
||
|
}
|
||
|
theSuccess = true;
|
||
|
}
|
||
|
|
||
|
return theSuccess;
|
||
|
}
|
||
|
|