mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 16:22:45 +03:00
feat(ui): set orientation in CSimpleSlider::LoadXML
This commit is contained in:
parent
d576b8058d
commit
196f90e1d5
@ -79,6 +79,23 @@ void CSimpleSlider::LoadXML(XMLNode* node, CStatus* status) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO
|
// TODO
|
||||||
|
|
||||||
|
auto orientationStr = node->GetAttributeByName("orientation");
|
||||||
|
if (orientationStr && *orientationStr) {
|
||||||
|
SLIDER_ORIENTATION orientation;
|
||||||
|
|
||||||
|
if (StringToOrientation(orientationStr, orientation)) {
|
||||||
|
this->SetOrientation(orientation);
|
||||||
|
} else {
|
||||||
|
status->Add(
|
||||||
|
STATUS_WARNING,
|
||||||
|
"Frame %s: Unknown orientation %s in element %s",
|
||||||
|
this->GetDisplayName(),
|
||||||
|
orientationStr,
|
||||||
|
node->GetName()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSimpleSlider::OnLayerUpdate(float elapsedSec) {
|
void CSimpleSlider::OnLayerUpdate(float elapsedSec) {
|
||||||
@ -151,6 +168,16 @@ void CSimpleSlider::SetMinMaxValues(float min, float max) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CSimpleSlider::SetOrientation(SLIDER_ORIENTATION orientation) {
|
||||||
|
this->m_orientation = orientation;
|
||||||
|
|
||||||
|
if (this->m_thumbTexture) {
|
||||||
|
this->m_thumbTexture->ClearAllPoints();
|
||||||
|
}
|
||||||
|
|
||||||
|
this->m_changed = 1;
|
||||||
|
}
|
||||||
|
|
||||||
void CSimpleSlider::SetThumbTexture(CSimpleTexture* texture, int32_t drawLayer) {
|
void CSimpleSlider::SetThumbTexture(CSimpleTexture* texture, int32_t drawLayer) {
|
||||||
if (this->m_thumbTexture == texture) {
|
if (this->m_thumbTexture == texture) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
@ -48,6 +48,7 @@ class CSimpleSlider : public CSimpleFrame {
|
|||||||
void RunOnMinMaxChangedScript();
|
void RunOnMinMaxChangedScript();
|
||||||
void RunOnValueChangedScript();
|
void RunOnValueChangedScript();
|
||||||
void SetMinMaxValues(float min, float max);
|
void SetMinMaxValues(float min, float max);
|
||||||
|
void SetOrientation(SLIDER_ORIENTATION orientation);
|
||||||
void SetThumbTexture(CSimpleTexture* texture, int32_t drawLayer);
|
void SetThumbTexture(CSimpleTexture* texture, int32_t drawLayer);
|
||||||
void SetValue(float value);
|
void SetValue(float value);
|
||||||
float Sub96BC10(float value);
|
float Sub96BC10(float value);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user