Build floater fixes by Cale Flanagan +tinies
This commit is contained in:
@@ -2547,9 +2547,8 @@ BOOL LLLineEditor::evaluateFloat()
|
||||
else
|
||||
{
|
||||
// Replace the expression with the result
|
||||
std::ostringstream result_str;
|
||||
result_str << result;
|
||||
setText(result_str.str());
|
||||
std::string result_str = llformat("%f", result);
|
||||
setText(result_str);
|
||||
selectAll();
|
||||
}
|
||||
|
||||
|
||||
@@ -157,6 +157,34 @@ F32 clamp_precision(F32 value, S32 decimal_precision)
|
||||
}
|
||||
|
||||
|
||||
F32 get_increment(F32 inc, S32 decimal_precision) //CF: finetune increments
|
||||
{
|
||||
if(gKeyboard->getKeyDown(KEY_ALT))
|
||||
inc = inc * 10.f;
|
||||
else if(gKeyboard->getKeyDown(KEY_CONTROL)) {
|
||||
if (llround(inc * 1000.f) == 25) // 0.025 gets 0.05 here
|
||||
inc = inc * 0.2f;
|
||||
else
|
||||
inc = inc * 0.1f;
|
||||
}
|
||||
else if(gKeyboard->getKeyDown(KEY_SHIFT)) {
|
||||
if (decimal_precision == 2 && llround(inc) == 1) // for rotations, finest step is 0.05
|
||||
inc = inc * 0.05f;
|
||||
else
|
||||
inc = inc * 0.01f;
|
||||
}
|
||||
|
||||
if (decimal_precision == 1 && inc < 0.1f) // clamp inc to precision
|
||||
inc = 0.1f;
|
||||
else if (decimal_precision == 2 && inc < 0.01f)
|
||||
inc = 0.01f;
|
||||
else if (decimal_precision == 3 && inc < 0.001f)
|
||||
inc = 0.001f;
|
||||
|
||||
return inc;
|
||||
}
|
||||
|
||||
|
||||
// static
|
||||
void LLSpinCtrl::onUpBtn( void *userdata )
|
||||
{
|
||||
@@ -164,7 +192,7 @@ void LLSpinCtrl::onUpBtn( void *userdata )
|
||||
if( self->getEnabled() )
|
||||
{
|
||||
// use getValue()/setValue() to force reload from/to control
|
||||
F32 val = (F32)self->getValue().asReal() + self->mIncrement;
|
||||
F32 val = (F32)self->getValue().asReal() + get_increment(self->mIncrement, self->mPrecision);
|
||||
val = clamp_precision(val, self->mPrecision);
|
||||
val = llmin( val, self->mMaxValue );
|
||||
|
||||
@@ -191,7 +219,7 @@ void LLSpinCtrl::onDownBtn( void *userdata )
|
||||
|
||||
if( self->getEnabled() )
|
||||
{
|
||||
F32 val = (F32)self->getValue().asReal() - self->mIncrement;
|
||||
F32 val = (F32)self->getValue().asReal() - get_increment(self->mIncrement, self->mPrecision);
|
||||
val = clamp_precision(val, self->mPrecision);
|
||||
val = llmax( val, self->mMinValue );
|
||||
|
||||
|
||||
@@ -60,5 +60,6 @@ void HippoLimits::setSecondLifeLimits()
|
||||
mMaxHeight = 4096.0f;
|
||||
mMinHoleSize = 0.05f;
|
||||
mMaxHollow = 0.95f;
|
||||
mMaxPrimScale = 64.0f;
|
||||
}
|
||||
|
||||
|
||||
@@ -68,6 +68,7 @@
|
||||
#if MESH_ENABLED
|
||||
#include "llmeshrepository.h"
|
||||
#endif //MESH_ENABLED
|
||||
#include "hippolimits.h"
|
||||
|
||||
|
||||
const F32 MAX_MANIP_SELECT_DISTANCE_SQUARED = 11.f * 11.f;
|
||||
@@ -98,6 +99,9 @@ const LLManip::EManipPart MANIPULATOR_IDS[NUM_MANIPULATORS] =
|
||||
|
||||
F32 get_default_max_prim_scale(bool is_flora)
|
||||
{
|
||||
//CF: both scales are 256, so what?, I now use gridmanagersetting
|
||||
return gHippoLimits->getMaxPrimScale();
|
||||
#if 0
|
||||
// a bit of a hack, but if it's foilage, we don't want to use the
|
||||
// new larger scale which would result in giant trees and grass
|
||||
#if MESH_ENABLED
|
||||
@@ -114,6 +118,7 @@ F32 get_default_max_prim_scale(bool is_flora)
|
||||
#if !MESH_ENABLED
|
||||
return DEFAULT_MAX_PRIM_SCALE;
|
||||
#endif //!MESH_ENABLED
|
||||
#endif //0
|
||||
}
|
||||
|
||||
// static
|
||||
|
||||
@@ -80,8 +80,6 @@
|
||||
#include "hippolimits.h"
|
||||
|
||||
|
||||
|
||||
|
||||
// [RLVa:KB]
|
||||
#include "rlvhandler.h"
|
||||
// [/RLVa:KB]
|
||||
@@ -562,6 +560,9 @@ void LLPanelObject::getState( )
|
||||
mBtnCopySize->setEnabled( enable_scale );
|
||||
mBtnPasteSize->setEnabled( enable_scale );
|
||||
mBtnPasteSizeClip->setEnabled( enable_scale );
|
||||
mCtrlScaleX->setMaxValue(gHippoLimits->getMaxPrimScale());
|
||||
mCtrlScaleY->setMaxValue(gHippoLimits->getMaxPrimScale());
|
||||
mCtrlScaleZ->setMaxValue(gHippoLimits->getMaxPrimScale());
|
||||
|
||||
LLQuaternion object_rot = objectp->getRotationEdit();
|
||||
object_rot.getEulerAngles(&(mCurEulerDegrees.mV[VX]), &(mCurEulerDegrees.mV[VY]), &(mCurEulerDegrees.mV[VZ]));
|
||||
@@ -2118,9 +2119,9 @@ void LLPanelObject::sendScale(BOOL btn_down)
|
||||
|
||||
LLVector3 delta = newscale - mObject->getScale();
|
||||
//Saw this changed in some viewers to be more touchy than this, but it would likely cause more updates and higher lag for the client. -HgB
|
||||
if (delta.magVec() >= 0.0005f)
|
||||
if (delta.magVec() >= 0.0001f) //CF: just a bit more touchy
|
||||
{
|
||||
// scale changed by more than 1/2 millimeter
|
||||
// scale changed by more than 1/10 millimeter
|
||||
|
||||
// check to see if we aren't scaling the textures
|
||||
// (in which case the tex coord's need to be recomputed)
|
||||
@@ -2192,9 +2193,9 @@ void LLPanelObject::sendPosition(BOOL btn_down)
|
||||
// send only if the position is changed, that is, the delta vector is not zero
|
||||
LLVector3d old_pos_global = mObject->getPositionGlobal();
|
||||
LLVector3d delta = new_pos_global - old_pos_global;
|
||||
// moved more than 1/2 millimeter
|
||||
// moved more than 1/10 millimeter
|
||||
//Saw this changed in some viewers to be more touchy than this, but it would likely cause more updates and higher lag for the client. -HgB
|
||||
if (delta.magVec() >= 0.0005f)
|
||||
if (delta.magVec() >= 0.0001f) //CF: just a bit more touchy
|
||||
{
|
||||
if (mRootObject != mObject)
|
||||
{
|
||||
@@ -2639,8 +2640,9 @@ void LLPanelObject::onPastePos(void* user_data)
|
||||
|
||||
LLPanelObject* self = (LLPanelObject*) user_data;
|
||||
LLCalc* calcp = LLCalc::getInstance();
|
||||
mClipboardPos.mV[VX] = llclamp( mClipboardPos.mV[VX], -3.5f, 256.f);
|
||||
mClipboardPos.mV[VY] = llclamp( mClipboardPos.mV[VY], -3.5f, 256.f);
|
||||
float region_width = LLWorld::getInstance()->getRegionWidthInMeters();
|
||||
mClipboardPos.mV[VX] = llclamp( mClipboardPos.mV[VX], -3.5f, region_width);
|
||||
mClipboardPos.mV[VY] = llclamp( mClipboardPos.mV[VY], -3.5f, region_width);
|
||||
mClipboardPos.mV[VZ] = llclamp( mClipboardPos.mV[VZ], -3.5f, 4096.f);
|
||||
|
||||
self->mCtrlPosX->set( mClipboardPos.mV[VX] );
|
||||
@@ -2659,9 +2661,9 @@ void LLPanelObject::onPasteSize(void* user_data)
|
||||
|
||||
LLPanelObject* self = (LLPanelObject*) user_data;
|
||||
LLCalc* calcp = LLCalc::getInstance();
|
||||
mClipboardSize.mV[VX] = llclamp(mClipboardSize.mV[VX], 0.01f, 64.f);
|
||||
mClipboardSize.mV[VY] = llclamp(mClipboardSize.mV[VY], 0.01f, 64.f);
|
||||
mClipboardSize.mV[VZ] = llclamp(mClipboardSize.mV[VZ], 0.01f, 64.f);
|
||||
mClipboardSize.mV[VX] = llclamp(mClipboardSize.mV[VX], 0.01f, gHippoLimits->getMaxPrimScale());
|
||||
mClipboardSize.mV[VY] = llclamp(mClipboardSize.mV[VY], 0.01f, gHippoLimits->getMaxPrimScale());
|
||||
mClipboardSize.mV[VZ] = llclamp(mClipboardSize.mV[VZ], 0.01f, gHippoLimits->getMaxPrimScale());
|
||||
|
||||
self->mCtrlScaleX->set( mClipboardSize.mV[VX] );
|
||||
self->mCtrlScaleY->set( mClipboardSize.mV[VY] );
|
||||
@@ -2742,9 +2744,9 @@ void LLPanelObject::onPasteSizeClip(void* user_data)
|
||||
std::string stringVec = wstring_to_utf8str(temp_string);
|
||||
if(!getvectorfromclip(stringVec, &mClipboardSize)) return;
|
||||
|
||||
mClipboardSize.mV[VX] = llclamp(mClipboardSize.mV[VX], 0.01f, 10.f);
|
||||
mClipboardSize.mV[VY] = llclamp(mClipboardSize.mV[VY], 0.01f, 10.f);
|
||||
mClipboardSize.mV[VZ] = llclamp(mClipboardSize.mV[VZ], 0.01f, 10.f);
|
||||
mClipboardSize.mV[VX] = llclamp(mClipboardSize.mV[VX], 0.01f, gHippoLimits->getMaxPrimScale());
|
||||
mClipboardSize.mV[VY] = llclamp(mClipboardSize.mV[VY], 0.01f, gHippoLimits->getMaxPrimScale());
|
||||
mClipboardSize.mV[VZ] = llclamp(mClipboardSize.mV[VZ], 0.01f, gHippoLimits->getMaxPrimScale());
|
||||
|
||||
self->mCtrlScaleX->set( mClipboardSize.mV[VX] );
|
||||
self->mCtrlScaleY->set( mClipboardSize.mV[VY] );
|
||||
|
||||
@@ -2336,7 +2336,8 @@ void LLViewerObject::interpolateLinearMotion(const F64 & time, const F32 & dt)
|
||||
}
|
||||
|
||||
new_pos.mV[VZ] = llmax(min_height, new_pos.mV[VZ]);
|
||||
new_pos.mV[VZ] = llmin(LLWorld::getInstance()->getRegionMaxHeight(), new_pos.mV[VZ]);
|
||||
//Removing check to allow high altitude flight games -SG
|
||||
//new_pos.mV[VZ] = llmin(LLWorld::getInstance()->getRegionMaxHeight(), new_pos.mV[VZ]);
|
||||
|
||||
// Check to see if it's going off the region
|
||||
LLVector3 temp(new_pos);
|
||||
|
||||
@@ -620,15 +620,15 @@
|
||||
mouse_opaque="true" name="label position" v_pad="0" width="121">
|
||||
Position (meters)
|
||||
</text>
|
||||
<spinner bottom_delta="-22" decimal_digits="3" follows="left|top" height="16"
|
||||
<spinner bottom_delta="-22" decimal_digits="4" follows="left|top" height="16"
|
||||
increment="0.01" initial_val="0" label="X" label_width="10" left_delta="0"
|
||||
max_val="512" min_val="-256" mouse_opaque="true" name="Pos X"
|
||||
text_enabled_color="110, 15, 15, 255" width="87" />
|
||||
<spinner bottom_delta="-18" decimal_digits="3" follows="left|top" height="16"
|
||||
<spinner bottom_delta="-18" decimal_digits="4" follows="left|top" height="16"
|
||||
increment="0.01" initial_val="0" label="Y" label_width="10" left_delta="0"
|
||||
max_val="512" min_val="-256" mouse_opaque="true" name="Pos Y"
|
||||
text_enabled_color="0, 100, 40, 255" width="87" />
|
||||
<spinner bottom_delta="-18" decimal_digits="3" follows="left|top" height="16"
|
||||
<spinner bottom_delta="-18" decimal_digits="4" follows="left|top" height="16"
|
||||
increment="0.01" initial_val="0" label="Z" label_width="10" left_delta="0"
|
||||
max_val="4096" min_val="-3.5" mouse_opaque="true" name="Pos Z"
|
||||
text_enabled_color="0, 67, 132, 255" width="87" />
|
||||
@@ -678,15 +678,15 @@
|
||||
mouse_opaque="true" name="label rotation" v_pad="0" width="121">
|
||||
Rotation (degrees)
|
||||
</text>
|
||||
<spinner bottom_delta="-22" decimal_digits="5" follows="left|top" height="16"
|
||||
<spinner bottom_delta="-22" decimal_digits="2" follows="left|top" height="16"
|
||||
increment="1" initial_val="0" label="X" label_width="10" left_delta="0"
|
||||
max_val="9999" min_val="-9999" mouse_opaque="true" name="Rot X"
|
||||
text_enabled_color="1, 1, 1, 1" width="87" />
|
||||
<spinner bottom_delta="-18" decimal_digits="5" follows="left|top" height="16"
|
||||
<spinner bottom_delta="-18" decimal_digits="2" follows="left|top" height="16"
|
||||
increment="1" initial_val="0" label="Y" label_width="10" left_delta="0"
|
||||
max_val="9999" min_val="-9999" mouse_opaque="true" name="Rot Y"
|
||||
text_enabled_color="1, 1, 1, 1" width="87" />
|
||||
<spinner bottom_delta="-18" decimal_digits="5" follows="left|top" height="16"
|
||||
<spinner bottom_delta="-18" decimal_digits="2" follows="left|top" height="16"
|
||||
increment="1" initial_val="0" label="Z" label_width="10" left_delta="0"
|
||||
max_val="9999" min_val="-9999" mouse_opaque="true" name="Rot Z"
|
||||
text_enabled_color="1, 1, 1, 1" width="87" />
|
||||
@@ -887,11 +887,11 @@
|
||||
Hole Size
|
||||
</text>
|
||||
<spinner bottom_delta="-20" decimal_digits="2" follows="left|top" height="16"
|
||||
increment="0.025" initial_val="0" label="X" label_width="10" left="121"
|
||||
increment="0.05" initial_val="0" label="X" label_width="10" left="121"
|
||||
max_val="1" min_val="-1" mouse_opaque="true" name="Taper Scale X"
|
||||
width="68" />
|
||||
<spinner bottom_delta="0" decimal_digits="2" follows="left|top" height="16"
|
||||
increment="0.025" initial_val="0" label="Y" label_width="10" left_delta="73"
|
||||
increment="0.05" initial_val="0" label="Y" label_width="10" left_delta="73"
|
||||
max_val="1" min_val="-1" mouse_opaque="true" name="Taper Scale Y"
|
||||
width="68" />
|
||||
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
@@ -901,10 +901,10 @@
|
||||
Top Shear
|
||||
</text>
|
||||
<spinner bottom_delta="-20" decimal_digits="2" follows="left|top" height="16"
|
||||
increment="0.025" initial_val="0" label="X" label_width="10" left="121"
|
||||
increment="0.05" initial_val="0" label="X" label_width="10" left="121"
|
||||
max_val="0.5" min_val="-0.5" mouse_opaque="true" name="Shear X" width="68" />
|
||||
<spinner bottom_delta="0" decimal_digits="2" follows="left|top" height="16"
|
||||
increment="0.025" initial_val="0" label="Y" label_width="10" left_delta="73"
|
||||
increment="0.05" initial_val="0" label="Y" label_width="10" left_delta="73"
|
||||
max_val="0.5" min_val="-0.5" mouse_opaque="true" name="Shear Y" width="68" />
|
||||
<text bg_visible="false" border_drop_shadow_visible="false" border_visible="false"
|
||||
bottom_delta="-14" drop_shadow_visible="true" follows="left|top"
|
||||
@@ -1029,7 +1029,7 @@
|
||||
name="Flexible1D Checkbox Ctrl"
|
||||
tool_tip="Allows object to flex about the Z axis. (Client-side only)"
|
||||
width="121" />
|
||||
<spinner bottom_delta="-20" decimal_digits="5" follows="left|top" height="16"
|
||||
<spinner bottom_delta="-20" decimal_digits="0" follows="left|top" height="16"
|
||||
increment="1" initial_val="2" label="Softness" label_width="55" left="10"
|
||||
max_val="3" min_val="0" mouse_opaque="true" name="FlexNumSections"
|
||||
width="118" />
|
||||
@@ -1094,7 +1094,7 @@
|
||||
name="light texture control"
|
||||
tool_tip="Click to choose a projection image (only has effect with deferred rendering enabled)"
|
||||
width="32" />
|
||||
<spinner bottom_delta="-4" decimal_digits="5" follows="left|top" height="16"
|
||||
<spinner bottom_delta="-4" decimal_digits="3" follows="left|top" height="16"
|
||||
left="10"
|
||||
increment="0.1" initial_val="0.5" label="Intensity" label_width="45"
|
||||
max_val="1" min_val="0" mouse_opaque="true"
|
||||
@@ -1106,7 +1106,7 @@
|
||||
max_val="3" min_val="0" mouse_opaque="true"
|
||||
name="Light FOV"
|
||||
width="118" />
|
||||
<spinner bottom_delta="-20" decimal_digits="5" follows="left|top" height="16"
|
||||
<spinner bottom_delta="-20" decimal_digits="3" follows="left|top" height="16"
|
||||
left="10"
|
||||
increment="0.1" initial_val="5" label="Radius" label_width="45"
|
||||
max_val="20" min_val="0" mouse_opaque="true"
|
||||
@@ -1118,7 +1118,7 @@
|
||||
max_val="20" min_val="-20" mouse_opaque="true"
|
||||
name="Light Focus"
|
||||
width="118" />
|
||||
<spinner bottom_delta="-20" decimal_digits="5" follows="left|top" height="16"
|
||||
<spinner bottom_delta="-20" decimal_digits="3" follows="left|top" height="16"
|
||||
left="10"
|
||||
increment="0.25" initial_val="1" label="Falloff" label_width="45"
|
||||
max_val="2" min_val="0" mouse_opaque="true"
|
||||
@@ -1161,7 +1161,7 @@
|
||||
<spinner
|
||||
follows="left|top"
|
||||
height="19"
|
||||
increment="1"
|
||||
increment="0.1"
|
||||
initial_value="1"
|
||||
label="Gravity"
|
||||
label_width="55"
|
||||
@@ -1412,10 +1412,10 @@
|
||||
mouse_opaque="true" name="tex offset" v_pad="0" width="160">
|
||||
Offset
|
||||
</text>
|
||||
<spinner bottom="-308" decimal_digits="3" follows="left|top" height="16" increment="0.05"
|
||||
<spinner bottom="-308" decimal_digits="4" follows="left|top" height="16" increment="0.05"
|
||||
initial_val="0" label="Horizontal (U)" label_width="90" left="20"
|
||||
max_val="1" min_val="-1" mouse_opaque="true" name="TexOffsetU" width="160" />
|
||||
<spinner bottom_delta="-18" decimal_digits="3" follows="left|top" height="16"
|
||||
<spinner bottom_delta="-18" decimal_digits="4" follows="left|top" height="16"
|
||||
increment="0.05" initial_val="0" label="Vertical (V)" label_width="90"
|
||||
left="20" max_val="1" min_val="-1" mouse_opaque="true" name="TexOffsetV"
|
||||
width="160" />
|
||||
|
||||
Reference in New Issue
Block a user