From bbe49803b67fe660702e638208b2b4c9a79036a3 Mon Sep 17 00:00:00 2001 From: Gigs Taggart Date: Fri, 19 Sep 2008 20:59:32 -0500 Subject: VWR-2331: Terraform tool variable "strength". Contributing authors: Gigs Taggart, Aimee Trescothick, Which Linden. --- linden/doc/contributions.txt | 1 + linden/indra/newview/app_settings/settings.xml | 11 +++++++++++ linden/indra/newview/llfloatertools.cpp | 23 ++++++++++++++++++++++ linden/indra/newview/llfloatertools.h | 2 ++ linden/indra/newview/lltoolbrush.cpp | 12 ++++++----- .../skins/default/xui/en-us/floater_tools.xml | 11 ++++++++++- 6 files changed, 54 insertions(+), 6 deletions(-) (limited to 'linden') diff --git a/linden/doc/contributions.txt b/linden/doc/contributions.txt index da98604..9efcd03 100644 --- a/linden/doc/contributions.txt +++ b/linden/doc/contributions.txt @@ -142,6 +142,7 @@ Gigs Taggart VWR-1987 VWR-2065 VWR-2502 + VWR-2331 Ginko Bayliss VWR-4 Grazer Kline diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index e31c149..fa0d21e 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -4164,6 +4164,17 @@ Value 0 + LandBrushForce + + Comment + Multiplier for land modification brush force. + Persist + 1 + Type + F32 + Value + 1.0 + Language Comment diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp index 97150e3..8d4d6e2 100644 --- a/linden/indra/newview/llfloatertools.cpp +++ b/linden/indra/newview/llfloatertools.cpp @@ -54,6 +54,7 @@ #include "llpanelvolume.h" #include "llpanelpermissions.h" #include "llselectmgr.h" +#include "llslider.h" #include "llstatusbar.h" #include "lltabcontainer.h" #include "lltextbox.h" @@ -106,6 +107,7 @@ void click_popup_rotate_reset(void*); void click_popup_rotate_right(void*); void click_popup_dozer_mode(LLUICtrl *, void *user); void click_popup_dozer_size(LLUICtrl *, void *user); +void commit_slider_dozer_force(LLUICtrl *, void*); void click_dozer_size(LLUICtrl *, void*); void click_apply_to_selection(void*); void commit_radio_zoom(LLUICtrl *, void*); @@ -308,6 +310,12 @@ BOOL LLFloaterTools::postBuild() childSetAction("button apply to selection",click_apply_to_selection, (void*)0); mCheckShowOwners = getChild("checkbox show owners"); childSetValue("checkbox show owners",gSavedSettings.getBOOL("ShowParcelOwners")); + + mSliderDozerForce = getChild("slider force"); + childSetCommitCallback("slider force",commit_slider_dozer_force, (void*)0); + // the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here + childSetValue( "slider force", log10(gSavedSettings.getF32("LandBrushForce"))); + childSetAction("button more", click_show_more, this); childSetAction("button less", click_show_more, this); mTab = getChild("Object Info Tabs"); @@ -741,6 +749,11 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) { mCheckShowOwners ->setVisible( land_visible ); } + if (mSliderDozerForce) + { + mSliderDozerForce ->setVisible( land_visible ); + childSetVisible("Force:", land_visible); + } // // More panel visibility @@ -939,6 +952,16 @@ void click_dozer_size(LLUICtrl *ctrl, void *user) gSavedSettings.setS32("RadioLandBrushSize", size); } +void commit_slider_dozer_force(LLUICtrl *ctrl, void*) +{ + // the slider is logarithmic, so we exponentiate to get the actual force multiplier + F32 dozer_force = pow(10.f, (F32)ctrl->getValue().asReal()); + gSavedSettings.setF32("LandBrushForce", dozer_force); +} + + + + void click_apply_to_selection(void* user) { LLToolBrushLand::getInstance()->modifyLandInSelectionGlobal(); diff --git a/linden/indra/newview/llfloatertools.h b/linden/indra/newview/llfloatertools.h index b0a804b..a75aa87 100644 --- a/linden/indra/newview/llfloatertools.h +++ b/linden/indra/newview/llfloatertools.h @@ -48,6 +48,7 @@ class LLPanelContents; class LLPanelFace; class LLPanelLandInfo; class LLComboBox; +class LLSlider; class LLParcelSelection; class LLObjectSelection; @@ -167,6 +168,7 @@ public: LLCheckBoxCtrl *mRadioDozerSmooth; LLCheckBoxCtrl *mRadioDozerNoise; LLCheckBoxCtrl *mRadioDozerRevert; + LLSlider *mSliderDozerForce; LLComboBox *mComboDozerSize; LLButton *mBtnApplyToSelection; diff --git a/linden/indra/newview/lltoolbrush.cpp b/linden/indra/newview/lltoolbrush.cpp index 89cb0b6..fdd7b66 100644 --- a/linden/indra/newview/lltoolbrush.cpp +++ b/linden/indra/newview/lltoolbrush.cpp @@ -154,7 +154,7 @@ void LLToolBrushLand::modifyLandAtPointGlobal(const LLVector3d &pos_global, regionp->forceUpdate(); // tell the simulator what we've done - F32 seconds = 1.0f / gFPSClamped; + F32 seconds = (1.0f / gFPSClamped) * gSavedSettings.getF32("LandBrushForce"); F32 x_pos = (F32)pos_region.mV[VX]; F32 y_pos = (F32)pos_region.mV[VY]; U8 brush_size = (U8)mBrushIndex; @@ -242,7 +242,7 @@ void LLToolBrushLand::modifyLandInSelectionGlobal() min_region.clamp(0.f, regionp->getWidth()); max_region.clamp(0.f, regionp->getWidth()); - F32 seconds = 1.0f; + F32 seconds = gSavedSettings.getF32("LandBrushForce"); LLSurface &land = regionp->getLand(); char action = E_LAND_LEVEL; @@ -251,21 +251,23 @@ void LLToolBrushLand::modifyLandInSelectionGlobal() case 0: // // average toward mStartingZ action = E_LAND_LEVEL; - seconds = 1.f; + seconds *= 0.25f; break; case 1: action = E_LAND_RAISE; + seconds *= 0.25f; break; case 2: action = E_LAND_LOWER; + seconds *= 0.25f; break; case 3: action = E_LAND_SMOOTH; - seconds = 10.f; + seconds *= 5.0f; break; case 4: action = E_LAND_NOISE; - seconds = 0.5f; + seconds *= 0.5f; break; case 5: action = E_LAND_REVERT; diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml index db176b3..3ae37ea 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_tools.xml @@ -278,7 +278,16 @@ Large -