diff options
author | Jacek Antonelli | 2008-09-06 18:24:57 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-09-06 18:25:07 -0500 |
commit | 798d367d54a6c6379ad355bd8345fa40e31e7fe9 (patch) | |
tree | 1921f1708cd0240648c97bc02df2c2ab5f2fc41e /linden/indra/newview/llfloatertools.cpp | |
parent | Second Life viewer sources 1.20.15 (diff) | |
download | meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.zip meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.gz meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.bz2 meta-impy-798d367d54a6c6379ad355bd8345fa40e31e7fe9.tar.xz |
Second Life viewer sources 1.21.0-RC
Diffstat (limited to 'linden/indra/newview/llfloatertools.cpp')
-rw-r--r-- | linden/indra/newview/llfloatertools.cpp | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp index 97150e3..9c00ca6 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" |
@@ -82,13 +83,13 @@ | |||
82 | LLFloaterTools *gFloaterTools = NULL; | 83 | LLFloaterTools *gFloaterTools = NULL; |
83 | 84 | ||
84 | 85 | ||
85 | const LLString PANEL_NAMES[LLFloaterTools::PANEL_COUNT] = | 86 | const std::string PANEL_NAMES[LLFloaterTools::PANEL_COUNT] = |
86 | { | 87 | { |
87 | LLString("General"), // PANEL_GENERAL, | 88 | std::string("General"), // PANEL_GENERAL, |
88 | LLString("Object"), // PANEL_OBJECT, | 89 | std::string("Object"), // PANEL_OBJECT, |
89 | LLString("Features"), // PANEL_FEATURES, | 90 | std::string("Features"), // PANEL_FEATURES, |
90 | LLString("Texture"), // PANEL_FACE, | 91 | std::string("Texture"), // PANEL_FACE, |
91 | LLString("Content"), // PANEL_CONTENTS, | 92 | std::string("Content"), // PANEL_CONTENTS, |
92 | }; | 93 | }; |
93 | 94 | ||
94 | // Local prototypes | 95 | // Local prototypes |
@@ -106,6 +107,7 @@ 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 click_popup_dozer_size(LLUICtrl *, void *user); |
110 | void commit_slider_dozer_force(LLUICtrl *, void*); | ||
109 | void click_dozer_size(LLUICtrl *, void*); | 111 | void click_dozer_size(LLUICtrl *, void*); |
110 | void click_apply_to_selection(void*); | 112 | void click_apply_to_selection(void*); |
111 | void commit_radio_zoom(LLUICtrl *, void*); | 113 | void commit_radio_zoom(LLUICtrl *, void*); |
@@ -158,7 +160,7 @@ void* LLFloaterTools::createPanelContents(void* data) | |||
158 | void* LLFloaterTools::createPanelContentsInventory(void* data) | 160 | void* LLFloaterTools::createPanelContentsInventory(void* data) |
159 | { | 161 | { |
160 | LLFloaterTools* floater = (LLFloaterTools*)data; | 162 | LLFloaterTools* floater = (LLFloaterTools*)data; |
161 | floater->mPanelContents->mPanelInventory = new LLPanelInventory("ContentsInventory", LLRect()); | 163 | floater->mPanelContents->mPanelInventory = new LLPanelInventory(std::string("ContentsInventory"), LLRect()); |
162 | return floater->mPanelContents->mPanelInventory; | 164 | return floater->mPanelContents->mPanelInventory; |
163 | } | 165 | } |
164 | 166 | ||
@@ -166,7 +168,7 @@ void* LLFloaterTools::createPanelContentsInventory(void* data) | |||
166 | void* LLFloaterTools::createPanelLandInfo(void* data) | 168 | void* LLFloaterTools::createPanelLandInfo(void* data) |
167 | { | 169 | { |
168 | LLFloaterTools* floater = (LLFloaterTools*)data; | 170 | LLFloaterTools* floater = (LLFloaterTools*)data; |
169 | floater->mPanelLandInfo = new LLPanelLandInfo("land info panel"); | 171 | floater->mPanelLandInfo = new LLPanelLandInfo(std::string("land info panel")); |
170 | return floater->mPanelLandInfo; | 172 | return floater->mPanelLandInfo; |
171 | } | 173 | } |
172 | 174 | ||
@@ -236,7 +238,7 @@ BOOL LLFloaterTools::postBuild() | |||
236 | // Create Buttons | 238 | // Create Buttons |
237 | // | 239 | // |
238 | 240 | ||
239 | static const LLString toolNames[]={ | 241 | static const std::string toolNames[]={ |
240 | "ToolCube", | 242 | "ToolCube", |
241 | "ToolPrism", | 243 | "ToolPrism", |
242 | "ToolPyramid", | 244 | "ToolPyramid", |
@@ -308,6 +310,12 @@ BOOL LLFloaterTools::postBuild() | |||
308 | childSetAction("button apply to selection",click_apply_to_selection, (void*)0); | 310 | childSetAction("button apply to selection",click_apply_to_selection, (void*)0); |
309 | mCheckShowOwners = getChild<LLCheckBoxCtrl>("checkbox show owners"); | 311 | mCheckShowOwners = getChild<LLCheckBoxCtrl>("checkbox show owners"); |
310 | childSetValue("checkbox show owners",gSavedSettings.getBOOL("ShowParcelOwners")); | 312 | childSetValue("checkbox show owners",gSavedSettings.getBOOL("ShowParcelOwners")); |
313 | |||
314 | mSliderDozerForce = getChild<LLSlider>("slider force"); | ||
315 | childSetCommitCallback("slider force",commit_slider_dozer_force, (void*)0); | ||
316 | // the setting stores the actual force multiplier, but the slider is logarithmic, so we convert here | ||
317 | childSetValue( "slider force", log10(gSavedSettings.getF32("LandBrushForce"))); | ||
318 | |||
311 | childSetAction("button more", click_show_more, this); | 319 | childSetAction("button more", click_show_more, this); |
312 | childSetAction("button less", click_show_more, this); | 320 | childSetAction("button less", click_show_more, this); |
313 | mTab = getChild<LLTabContainer>("Object Info Tabs"); | 321 | mTab = getChild<LLTabContainer>("Object Info Tabs"); |
@@ -335,7 +343,7 @@ BOOL LLFloaterTools::postBuild() | |||
335 | // Create the popupview with a dummy center. It will be moved into place | 343 | // Create the popupview with a dummy center. It will be moved into place |
336 | // during LLViewerWindow's per-frame hover processing. | 344 | // during LLViewerWindow's per-frame hover processing. |
337 | LLFloaterTools::LLFloaterTools() | 345 | LLFloaterTools::LLFloaterTools() |
338 | : LLFloater("toolbox floater"), | 346 | : LLFloater(std::string("toolbox floater")), |
339 | mBtnFocus(NULL), | 347 | mBtnFocus(NULL), |
340 | mBtnMove(NULL), | 348 | mBtnMove(NULL), |
341 | mBtnEdit(NULL), | 349 | mBtnEdit(NULL), |
@@ -741,6 +749,11 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) | |||
741 | { | 749 | { |
742 | mCheckShowOwners ->setVisible( land_visible ); | 750 | mCheckShowOwners ->setVisible( land_visible ); |
743 | } | 751 | } |
752 | if (mSliderDozerForce) | ||
753 | { | ||
754 | mSliderDozerForce ->setVisible( land_visible ); | ||
755 | childSetVisible("Strength:", land_visible); | ||
756 | } | ||
744 | 757 | ||
745 | // | 758 | // |
746 | // More panel visibility | 759 | // More panel visibility |
@@ -765,8 +778,8 @@ void LLFloaterTools::onOpen() | |||
765 | mParcelSelection = LLViewerParcelMgr::getInstance()->getFloatingParcelSelection(); | 778 | mParcelSelection = LLViewerParcelMgr::getInstance()->getFloatingParcelSelection(); |
766 | mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); | 779 | mObjectSelection = LLSelectMgr::getInstance()->getEditSelection(); |
767 | 780 | ||
768 | gMenuBarView->setItemVisible("Tools", TRUE); | 781 | // gMenuBarView->setItemVisible(std::string("Tools"), TRUE); |
769 | gMenuBarView->arrange(); | 782 | // gMenuBarView->arrange(); |
770 | } | 783 | } |
771 | 784 | ||
772 | // virtual | 785 | // virtual |
@@ -799,8 +812,8 @@ void LLFloaterTools::onClose(bool app_quitting) | |||
799 | // so manually reset tool to default (pie menu tool) | 812 | // so manually reset tool to default (pie menu tool) |
800 | LLToolMgr::getInstance()->getCurrentToolset()->selectFirstTool(); | 813 | LLToolMgr::getInstance()->getCurrentToolset()->selectFirstTool(); |
801 | 814 | ||
802 | gMenuBarView->setItemVisible("Tools", FALSE); | 815 | // gMenuBarView->setItemVisible(std::string("Tools"), FALSE); |
803 | gMenuBarView->arrange(); | 816 | // gMenuBarView->arrange(); |
804 | } | 817 | } |
805 | 818 | ||
806 | void LLFloaterTools::showMore(BOOL show_more) | 819 | void LLFloaterTools::showMore(BOOL show_more) |
@@ -939,6 +952,16 @@ void click_dozer_size(LLUICtrl *ctrl, void *user) | |||
939 | gSavedSettings.setS32("RadioLandBrushSize", size); | 952 | gSavedSettings.setS32("RadioLandBrushSize", size); |
940 | } | 953 | } |
941 | 954 | ||
955 | void commit_slider_dozer_force(LLUICtrl *ctrl, void*) | ||
956 | { | ||
957 | // the slider is logarithmic, so we exponentiate to get the actual force multiplier | ||
958 | F32 dozer_force = pow(10.f, (F32)ctrl->getValue().asReal()); | ||
959 | gSavedSettings.setF32("LandBrushForce", dozer_force); | ||
960 | } | ||
961 | |||
962 | |||
963 | |||
964 | |||
942 | void click_apply_to_selection(void* user) | 965 | void click_apply_to_selection(void* user) |
943 | { | 966 | { |
944 | LLToolBrushLand::getInstance()->modifyLandInSelectionGlobal(); | 967 | LLToolBrushLand::getInstance()->modifyLandInSelectionGlobal(); |
@@ -988,7 +1011,7 @@ void LLFloaterTools::setObjectType( void* data ) | |||
988 | LLPCode pcode = *(LLPCode*) data; | 1011 | LLPCode pcode = *(LLPCode*) data; |
989 | LLToolPlacer::setObjectType( pcode ); | 1012 | LLToolPlacer::setObjectType( pcode ); |
990 | gSavedSettings.setBOOL("CreateToolCopySelection", FALSE); | 1013 | gSavedSettings.setBOOL("CreateToolCopySelection", FALSE); |
991 | gViewerWindow->setMouseCapture(NULL); | 1014 | gFocusMgr.setMouseCapture(NULL); |
992 | } | 1015 | } |
993 | 1016 | ||
994 | // static | 1017 | // static |