mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Minor cleanups to guiGameListMenuCtrl
This commit is contained in:
parent
3b47d41da2
commit
a561d590ca
1 changed files with 2 additions and 7 deletions
|
|
@ -1230,16 +1230,11 @@ void GuiGameListMenuCtrl::clickSlider(Row* row, S32 xPos)
|
||||||
|
|
||||||
if (xPos >= barStart && xPos <= barEnd)
|
if (xPos >= barStart && xPos <= barEnd)
|
||||||
{
|
{
|
||||||
//Yep, we clicked in it
|
|
||||||
Con::printf("CLICKED A SLIDERBAR");
|
|
||||||
|
|
||||||
//find the position
|
//find the position
|
||||||
F32 newValue = (((xPos - barStart) * (row->mRange.y - row->mRange.x)) / (barEnd - barStart)) + row->mRange.x;
|
F32 newValue = (((xPos - barStart) * (row->mRange.y - row->mRange.x)) / (barEnd - barStart)) + row->mRange.x;
|
||||||
|
|
||||||
newValue = mRound(newValue / row->mStepSize) * row->mStepSize;
|
newValue = mRound(newValue / row->mStepSize) * row->mStepSize;
|
||||||
|
|
||||||
Con::printf("New value is %f", newValue);
|
|
||||||
|
|
||||||
row->mValue = newValue;
|
row->mValue = newValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1537,12 +1532,12 @@ DefineEngineMethod(GuiGameListMenuCtrl, setOptions, void, (S32 row, const char*
|
||||||
object->setOptions(row, optionsList);
|
object->setOptions(row, optionsList);
|
||||||
}
|
}
|
||||||
|
|
||||||
DefineEngineMethod(GuiGameListMenuCtrl, getValue, void, (S32 row), ,
|
DefineEngineMethod(GuiGameListMenuCtrl, getValue, F32, (S32 row), ,
|
||||||
"Sets the list of options on the given row.\n\n"
|
"Sets the list of options on the given row.\n\n"
|
||||||
"@param row Index of the row to set options on."
|
"@param row Index of the row to set options on."
|
||||||
"@param optionsList A tab separated list of options for the control.")
|
"@param optionsList A tab separated list of options for the control.")
|
||||||
{
|
{
|
||||||
object->getValue(row);
|
return object->getValue(row);
|
||||||
}
|
}
|
||||||
|
|
||||||
DefineEngineMethod(GuiGameListMenuCtrl, setValue, void, (S32 row, F32 value), ,
|
DefineEngineMethod(GuiGameListMenuCtrl, setValue, void, (S32 row, F32 value), ,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue