Refactor: Allow slider to be set

WARNING: REQUIRES ARC TO BE EDITED TO FUNCTION, PUSHED THIS TASK TO georgev22
This commit is contained in:
SevenToaster509 2026-04-13 15:30:40 +01:00
parent c0c677b6ed
commit 0606ce717d
2 changed files with 12 additions and 0 deletions

View file

@ -17,6 +17,7 @@ bool UIControl_Slider::setupControl(UIScene *scene, IggyValuePath *parent, const
//Slider specific initialisers
m_funcSetRelativeSliderPos = registerFastName(L"SetRelativeSliderPos");
m_funcSetSliderValue = registerFastName(L"MoveSlider");
m_funcGetRealWidth = registerFastName(L"GetRealWidth");
return success;
@ -112,6 +113,15 @@ void UIControl_Slider::handleSliderMove(int newValue)
}
}
void UIControl_Slider::SetSliderValue(int valueA)
{
IggyDataValue result;
IggyDataValue value[1];
value[0].type = IGGY_DATATYPE_number;
value[0].number = valueA;
IggyResult out = IggyPlayerCallMethodRS(m_parentScene->getMovie(), &result, getIggyValuePath(), m_funcSetSliderValue, 1, value);
}
void UIControl_Slider::SetSliderTouchPos(float fTouchPos)
{
IggyDataValue result;

View file

@ -14,6 +14,7 @@ private:
// 4J-TomK - function for setting slider position on touch
IggyName m_funcSetRelativeSliderPos;
IggyName m_funcSetSliderValue;
IggyName m_funcGetRealWidth;
public:
@ -25,6 +26,7 @@ public:
void handleSliderMove(int newValue);
void SetSliderTouchPos(float fTouchPos);
void SetSliderValue(int value);
virtual void setAllPossibleLabels(int labelCount, wchar_t labels[][256]);
S32 GetRealWidth();