diff options
Diffstat (limited to 'linden/indra/newview/llfloatertools.cpp')
-rw-r--r-- | linden/indra/newview/llfloatertools.cpp | 61 |
1 files changed, 34 insertions, 27 deletions
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp index 97150e3..9ce5d35 100644 --- a/linden/indra/newview/llfloatertools.cpp +++ b/linden/indra/newview/llfloatertools.cpp | |||
@@ -54,6 +54,7 @@ | |||
54 | #include "llpanelvolume.h" | 54 | #include "llpanelvolume.h" |
55 | #include "llpanelpermissions.h" | 55 | #include "llpanelpermissions.h" |
56 | #include "llselectmgr.h" | 56 | #include "llselectmgr.h" |
57 | #include "llslider.h" | ||
57 | #include "llstatusbar.h" | 58 | #include "llstatusbar.h" |
58 | #include "lltabcontainer.h" | 59 | #include "lltabcontainer.h" |
59 | #include "lltextbox.h" | 60 | #include "lltextbox.h" |
@@ -105,8 +106,8 @@ void click_popup_rotate_left(void*); | |||
105 | void click_popup_rotate_reset(void*); | 106 | void click_popup_rotate_reset(void*); |
106 | void click_popup_rotate_right(void*); | 107 | void click_popup_rotate_right(void*); |
107 | void click_popup_dozer_mode(LLUICtrl *, void *user); | 108 | void click_popup_dozer_mode(LLUICtrl *, void *user); |
108 | void click_popup_dozer_size(LLUICtrl *, void *user); | 109 | void commit_slider_dozer_size(LLUICtrl *, void*); |
109 | void click_dozer_size(LLUICtrl *, void*); | 110 | void commit_slider_dozer_force(LLUICtrl *, void*); |
110 | void click_apply_to_selection(void*); | 111 | void click_apply_to_selection(void*); |
111 | void commit_radio_zoom(LLUICtrl *, void*); | 112 | void commit_radio_zoom(LLUICtrl *, void*); |
112 | void commit_radio_orbit(LLUICtrl *, void*); | 113 | void commit_radio_orbit(LLUICtrl *, void*); |
@@ -301,13 +302,18 @@ BOOL LLFloaterTools::postBuild() | |||
301 | childSetCommitCallback("radio noise",click_popup_dozer_mode, (void*)4); | 302 | childSetCommitCallback("radio noise",click_popup_dozer_mode, (void*)4); |
302 | mRadioDozerRevert = getChild<LLCheckBoxCtrl>("radio revert"); | 303 | mRadioDozerRevert = getChild<LLCheckBoxCtrl>("radio revert"); |
303 | childSetCommitCallback("radio revert",click_popup_dozer_mode, (void*)5); | 304 | childSetCommitCallback("radio revert",click_popup_dozer_mode, (void*)5); |
304 | mComboDozerSize = getChild<LLComboBox>("combobox brush size"); | ||
305 | childSetCommitCallback("combobox brush size",click_dozer_size, (void*)0); | ||
306 | if(mComboDozerSize) mComboDozerSize->setCurrentByIndex(0); | ||
307 | mBtnApplyToSelection = getChild<LLButton>("button apply to selection"); | 305 | mBtnApplyToSelection = getChild<LLButton>("button apply to selection"); |
308 | childSetAction("button apply to selection",click_apply_to_selection, (void*)0); | 306 | childSetAction("button apply to selection",click_apply_to_selection, (void*)0); |
309 | mCheckShowOwners = getChild<LLCheckBoxCtrl>("checkbox show owners"); | 307 | |
310 | childSetValue("checkbox show owners",gSavedSettings.getBOOL("ShowParcelOwners")); | 308 | mSliderDozerSize = getChild<LLSlider>("slider brush size"); |
309 | childSetCommitCallback("slider brush size", commit_slider_dozer_size, (void*)0); | ||
310 | childSetValue( "slider brush size", gSavedSettings.getS32("LandBrushSize")); | ||
311 | |||
312 | mSliderDozerForce = getChild<LLSlider>("slider force"); | ||
313 | childSetCommitCallback("slider force",commit_slider_dozer_force, (void*)0); | ||
314 | // the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here | ||
315 | childSetValue( "slider force", log10(gSavedSettings.getF32("LandBrushForce"))); | ||
316 | |||
311 | childSetAction("button more", click_show_more, this); | 317 | childSetAction("button more", click_show_more, this); |
312 | childSetAction("button less", click_show_more, this); | 318 | childSetAction("button less", click_show_more, this); |
313 | mTab = getChild<LLTabContainer>("Object Info Tabs"); | 319 | mTab = getChild<LLTabContainer>("Object Info Tabs"); |
@@ -383,10 +389,9 @@ LLFloaterTools::LLFloaterTools() | |||
383 | mRadioDozerSmooth(NULL), | 389 | mRadioDozerSmooth(NULL), |
384 | mRadioDozerNoise(NULL), | 390 | mRadioDozerNoise(NULL), |
385 | mRadioDozerRevert(NULL), | 391 | mRadioDozerRevert(NULL), |
386 | mComboDozerSize(NULL), | 392 | mSliderDozerSize(NULL), |
393 | mSliderDozerForce(NULL), | ||
387 | mBtnApplyToSelection(NULL), | 394 | mBtnApplyToSelection(NULL), |
388 | mCheckShowOwners(NULL), | ||
389 | |||
390 | 395 | ||
391 | mTab(NULL), | 396 | mTab(NULL), |
392 | mPanelPermissions(NULL), | 397 | mPanelPermissions(NULL), |
@@ -694,7 +699,6 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) | |||
694 | if (mRadioSelectLand) mRadioSelectLand->setVisible( land_visible ); | 699 | if (mRadioSelectLand) mRadioSelectLand->setVisible( land_visible ); |
695 | 700 | ||
696 | S32 dozer_mode = gSavedSettings.getS32("RadioLandBrushAction"); | 701 | S32 dozer_mode = gSavedSettings.getS32("RadioLandBrushAction"); |
697 | S32 dozer_size = gSavedSettings.getS32("RadioLandBrushSize"); | ||
698 | 702 | ||
699 | if (mRadioDozerFlatten) | 703 | if (mRadioDozerFlatten) |
700 | { | 704 | { |
@@ -726,20 +730,21 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) | |||
726 | mRadioDozerRevert ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 5); | 730 | mRadioDozerRevert ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 5); |
727 | mRadioDozerRevert ->setVisible( land_visible ); | 731 | mRadioDozerRevert ->setVisible( land_visible ); |
728 | } | 732 | } |
729 | if (mComboDozerSize) | ||
730 | { | ||
731 | mComboDozerSize ->setCurrentByIndex(dozer_size); | ||
732 | mComboDozerSize ->setVisible( land_visible ); | ||
733 | mComboDozerSize ->setEnabled( tool == LLToolBrushLand::getInstance() ); | ||
734 | } | ||
735 | if (mBtnApplyToSelection) | 733 | if (mBtnApplyToSelection) |
736 | { | 734 | { |
737 | mBtnApplyToSelection->setVisible( land_visible ); | 735 | mBtnApplyToSelection->setVisible( land_visible ); |
738 | mBtnApplyToSelection->setEnabled( land_visible && !LLViewerParcelMgr::getInstance()->selectionEmpty() && tool != LLToolSelectLand::getInstance()); | 736 | mBtnApplyToSelection->setEnabled( land_visible && !LLViewerParcelMgr::getInstance()->selectionEmpty() && tool != LLToolSelectLand::getInstance()); |
739 | } | 737 | } |
740 | if (mCheckShowOwners) | 738 | if (mSliderDozerSize) |
741 | { | 739 | { |
742 | mCheckShowOwners ->setVisible( land_visible ); | 740 | mSliderDozerSize ->setVisible( land_visible ); |
741 | childSetVisible("Brush:", land_visible); | ||
742 | childSetVisible("Brush Size:", land_visible); | ||
743 | } | ||
744 | if (mSliderDozerForce) | ||
745 | { | ||
746 | mSliderDozerForce ->setVisible( land_visible ); | ||
747 | childSetVisible("Force:", land_visible); | ||
743 | } | 748 | } |
744 | 749 | ||
745 | // | 750 | // |
@@ -920,25 +925,27 @@ void click_popup_rotate_right(void*) | |||
920 | 925 | ||
921 | void click_popup_dozer_mode(LLUICtrl *, void *user) | 926 | void click_popup_dozer_mode(LLUICtrl *, void *user) |
922 | { | 927 | { |
923 | S32 show_owners = gSavedSettings.getBOOL("ShowParcelOwners"); | ||
924 | S32 mode = (S32)(intptr_t) user; | 928 | S32 mode = (S32)(intptr_t) user; |
925 | gFloaterTools->setEditTool( LLToolBrushLand::getInstance() ); | 929 | gFloaterTools->setEditTool( LLToolBrushLand::getInstance() ); |
926 | gSavedSettings.setS32("RadioLandBrushAction", mode); | 930 | gSavedSettings.setS32("RadioLandBrushAction", mode); |
927 | gSavedSettings.setBOOL("ShowParcelOwners", show_owners); | ||
928 | } | 931 | } |
929 | 932 | ||
930 | void click_popup_dozer_size(LLUICtrl *, void *user) | 933 | void commit_slider_dozer_size(LLUICtrl *ctrl, void*) |
931 | { | 934 | { |
932 | S32 size = (S32)(intptr_t) user; | 935 | S32 size = (S32)ctrl->getValue().asInteger(); |
933 | gSavedSettings.setS32("RadioLandBrushSize", size); | 936 | gSavedSettings.setS32("LandBrushSize", size); |
934 | } | 937 | } |
935 | 938 | ||
936 | void click_dozer_size(LLUICtrl *ctrl, void *user) | 939 | void commit_slider_dozer_force(LLUICtrl *ctrl, void*) |
937 | { | 940 | { |
938 | S32 size = ((LLComboBox*) ctrl)->getCurrentIndex(); | 941 | // the slider is logarithmic, so we exponentiate to get the actual force multiplier |
939 | gSavedSettings.setS32("RadioLandBrushSize", size); | 942 | F32 dozer_force = pow(10.f, (F32)ctrl->getValue().asReal()); |
943 | gSavedSettings.setF32("LandBrushForce", dozer_force); | ||
940 | } | 944 | } |
941 | 945 | ||
946 | |||
947 | |||
948 | |||
942 | void click_apply_to_selection(void* user) | 949 | void click_apply_to_selection(void* user) |
943 | { | 950 | { |
944 | LLToolBrushLand::getInstance()->modifyLandInSelectionGlobal(); | 951 | LLToolBrushLand::getInstance()->modifyLandInSelectionGlobal(); |