Fixes setter issue for image/shape/material custom inspector fields where it was not correctly passing through the changed value from the Asset Browser select

Swapped the water's disableTrueReflections variable to be enableTrueReflections for simplicity and consistency(also fixed a persistent typo)
Swapped disableVerticalSync to be enableVerticalSync for simplicity and consistency
Swapped disableParallaxMapping to be enableParallaxMapping for simplicity and consistency
Fix click detection on slider mode entries for guiGameSettingsCtrl so the click position correctly matches the percentage
Fixed problem where postFX initialization would always exec default.postfxpreset.tscript, even if a level's got it's own preset, which can cause problems
Fixed range field type behavior so that editing the values applies in real time, and also consistently applies between slider and text field
This commit is contained in:
Areloch 2022-08-30 01:29:39 -05:00
parent 280fca2fbe
commit cd82186231
20 changed files with 91 additions and 102 deletions

View file

@ -776,55 +776,38 @@ IMPLEMENT_CONOBJECT(GuiGameSettingsCtrl);
void GuiGameSettingsCtrl::clickSlider(S32 xPos)
{
F32 xScale = (float)getWidth();
RectI sliderRect;
S32 leftArrowX1 = mColumnSplit;
S32 leftArrowX2 = leftArrowX1 + mArrowSize;
S32 sliderOffset = 5;
S32 height = getHeight();
S32 rightArrowX2 = getWidth() - mRightPad;
S32 rightArrowX1 = rightArrowX2 - mArrowSize;
RectI optionRect;
S32 sliderWidth = rightArrowX1 - leftArrowX2;
sliderWidth *= 0.6; //remove the number text spacing
sliderRect.point.x = mColumnSplit + mArrowSize;
sliderRect.point.y = sliderOffset;
/*if ((leftArrowX1 <= xPos) && (xPos <= leftArrowX2))
sliderRect.extent.x = (getWidth() - mRightPad - mArrowSize) - sliderRect.point.x;
sliderRect.extent.y = height - sliderOffset * 2;
optionRect = sliderRect;
S32 textWidth = sliderRect.extent.x * 0.3;
sliderRect.extent.x -= textWidth;
//Now adjust the bar to match-to our value
S32 barStart = sliderRect.point.x;
S32 barEnd = sliderRect.point.x + sliderRect.extent.x;
if (xPos >= barStart && xPos <= barEnd)
{
mValue -= mStepSize;
//find the position
F32 newValue = (((xPos - barStart) * (mRange.y - mRange.x)) / (barEnd - barStart)) + mRange.x;
mValue = mRound(mValue / mStepSize) * mStepSize;
if (mValue < mRange.x)
mValue = mRange.x;
newValue = mRound(newValue / mStepSize) * mStepSize;
mValue = newValue;
}
else if ((rightArrowX1 <= xPos) && (xPos <= rightArrowX2))
{
//F32 snap = mValue % mStepSize;
//mValue.y -= snap;
mValue += mStepSize;
mValue = mRound(mValue / mStepSize) * mStepSize;
if (mValue > mRange.y)
mValue = mRange.y;
}
else
{*/
//see if we clicked on the sliderbar itself
S32 barStart = leftArrowX2;
S32 barEnd = barStart + sliderWidth;
if (xPos >= barStart && xPos <= barEnd)
{
//find the position
F32 newValue = (((xPos - barStart) * (mRange.y - mRange.x)) / (barEnd - barStart)) + mRange.x;
newValue = mRound(newValue / mStepSize) * mStepSize;
mValue = newValue;
}
//}
onChange_callback();
}