aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llfloatertools.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:42 -0500
committerJacek Antonelli2008-08-15 23:45:42 -0500
commitce28e056c20bf2723f565bbf464b87781ec248a2 (patch)
treeef7b0501c4de4b631a916305cbc2a5fdc125e52d /linden/indra/newview/llfloatertools.cpp
parentSecond Life viewer sources 1.19.1.4b (diff)
downloadmeta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.zip
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.gz
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.bz2
meta-impy-ce28e056c20bf2723f565bbf464b87781ec248a2.tar.xz
Second Life viewer sources 1.20.2
Diffstat (limited to 'linden/indra/newview/llfloatertools.cpp')
-rw-r--r--linden/indra/newview/llfloatertools.cpp203
1 files changed, 105 insertions, 98 deletions
diff --git a/linden/indra/newview/llfloatertools.cpp b/linden/indra/newview/llfloatertools.cpp
index ba4ff50..ec0d46a 100644
--- a/linden/indra/newview/llfloatertools.cpp
+++ b/linden/indra/newview/llfloatertools.cpp
@@ -69,15 +69,14 @@
69#include "lltoolpie.h" 69#include "lltoolpie.h"
70#include "lltoolpipette.h" 70#include "lltoolpipette.h"
71#include "lltoolplacer.h" 71#include "lltoolplacer.h"
72#include "lltoolselect.h"
73#include "lltoolselectland.h" 72#include "lltoolselectland.h"
74#include "llui.h" 73#include "llui.h"
75#include "llviewermenu.h" 74#include "llviewermenu.h"
76#include "llviewerparcelmgr.h" 75#include "llviewerparcelmgr.h"
77#include "llviewerwindow.h" 76#include "llviewerwindow.h"
78#include "llviewercontrol.h" 77#include "llviewercontrol.h"
79 78#include "llviewerjoystick.h"
80#include "llvieweruictrlfactory.h" 79#include "lluictrlfactory.h"
81 80
82// Globals 81// Globals
83LLFloaterTools *gFloaterTools = NULL; 82LLFloaterTools *gFloaterTools = NULL;
@@ -184,50 +183,50 @@ BOOL LLFloaterTools::postBuild()
184 getDragHandle()->setEnabled( !gSavedSettings.getBOOL("ToolboxAutoMove") ); 183 getDragHandle()->setEnabled( !gSavedSettings.getBOOL("ToolboxAutoMove") );
185 184
186 LLRect rect; 185 LLRect rect;
187 mBtnFocus = LLUICtrlFactory::getButtonByName(this,"button focus");//btn; 186 mBtnFocus = getChild<LLButton>("button focus");//btn;
188 childSetAction("button focus",LLFloaterTools::setEditTool, (void*)gToolCamera); 187 childSetAction("button focus",LLFloaterTools::setEditTool, (void*)LLToolCamera::getInstance());
189 mBtnMove = LLUICtrlFactory::getButtonByName(this,"button move"); 188 mBtnMove = getChild<LLButton>("button move");
190 childSetAction("button move",LLFloaterTools::setEditTool, (void*)gToolGrab); 189 childSetAction("button move",LLFloaterTools::setEditTool, (void*)LLToolGrab::getInstance());
191 mBtnEdit = LLUICtrlFactory::getButtonByName(this,"button edit"); 190 mBtnEdit = getChild<LLButton>("button edit");
192 childSetAction("button edit",LLFloaterTools::setEditTool, (void*)gToolTranslate); 191 childSetAction("button edit",LLFloaterTools::setEditTool, (void*)LLToolCompTranslate::getInstance());
193 mBtnCreate = LLUICtrlFactory::getButtonByName(this,"button create"); 192 mBtnCreate = getChild<LLButton>("button create");
194 childSetAction("button create",LLFloaterTools::setEditTool, (void*)gToolCreate); 193 childSetAction("button create",LLFloaterTools::setEditTool, (void*)LLToolCompCreate::getInstance());
195 mBtnLand = LLUICtrlFactory::getButtonByName(this, "button land" ); 194 mBtnLand = getChild<LLButton>("button land" );
196 childSetAction("button land",LLFloaterTools::setEditTool, (void*)gToolParcel); 195 childSetAction("button land",LLFloaterTools::setEditTool, (void*)LLToolSelectLand::getInstance());
197 mTextStatus = LLUICtrlFactory::getTextBoxByName(this,"text status"); 196 mTextStatus = getChild<LLTextBox>("text status");
198 mRadioZoom = LLUICtrlFactory::getCheckBoxByName(this,"radio zoom"); 197 mRadioZoom = getChild<LLCheckBoxCtrl>("radio zoom");
199 childSetCommitCallback("slider zoom",commit_slider_zoom,this); 198 childSetCommitCallback("slider zoom",commit_slider_zoom,this);
200 mRadioOrbit = LLUICtrlFactory::getCheckBoxByName(this,"radio orbit"); 199 mRadioOrbit = getChild<LLCheckBoxCtrl>("radio orbit");
201 childSetCommitCallback("radio orbit",commit_radio_orbit,this); 200 childSetCommitCallback("radio orbit",commit_radio_orbit,this);
202 mRadioPan = LLUICtrlFactory::getCheckBoxByName(this,"radio pan"); 201 mRadioPan = getChild<LLCheckBoxCtrl>("radio pan");
203 childSetCommitCallback("radio pan",commit_radio_pan,this); 202 childSetCommitCallback("radio pan",commit_radio_pan,this);
204 mRadioMove = LLUICtrlFactory::getCheckBoxByName(this,"radio move"); 203 mRadioMove = getChild<LLCheckBoxCtrl>("radio move");
205 childSetCommitCallback("radio move",click_popup_grab_drag,this); 204 childSetCommitCallback("radio move",click_popup_grab_drag,this);
206 mRadioLift = LLUICtrlFactory::getCheckBoxByName(this,"radio lift"); 205 mRadioLift = getChild<LLCheckBoxCtrl>("radio lift");
207 childSetCommitCallback("radio lift",click_popup_grab_lift,this); 206 childSetCommitCallback("radio lift",click_popup_grab_lift,this);
208 mRadioSpin = LLUICtrlFactory::getCheckBoxByName(this,"radio spin"); 207 mRadioSpin = getChild<LLCheckBoxCtrl>("radio spin");
209 childSetCommitCallback("radio spin",click_popup_grab_spin,NULL); 208 childSetCommitCallback("radio spin",click_popup_grab_spin,NULL);
210 mRadioPosition = LLUICtrlFactory::getCheckBoxByName(this,"radio position"); 209 mRadioPosition = getChild<LLCheckBoxCtrl>("radio position");
211 childSetCommitCallback("radio position",commit_select_tool,gToolTranslate); 210 childSetCommitCallback("radio position",commit_select_tool,LLToolCompTranslate::getInstance());
212 mRadioRotate = LLUICtrlFactory::getCheckBoxByName(this,"radio rotate"); 211 mRadioRotate = getChild<LLCheckBoxCtrl>("radio rotate");
213 childSetCommitCallback("radio rotate",commit_select_tool,gToolRotate); 212 childSetCommitCallback("radio rotate",commit_select_tool,LLToolCompRotate::getInstance());
214 mRadioStretch = LLUICtrlFactory::getCheckBoxByName(this,"radio stretch"); 213 mRadioStretch = getChild<LLCheckBoxCtrl>("radio stretch");
215 childSetCommitCallback("radio stretch",commit_select_tool,gToolStretch); 214 childSetCommitCallback("radio stretch",commit_select_tool,LLToolCompScale::getInstance());
216 mRadioSelectFace = LLUICtrlFactory::getCheckBoxByName(this,"radio select face"); 215 mRadioSelectFace = getChild<LLCheckBoxCtrl>("radio select face");
217 childSetCommitCallback("radio select face",commit_select_tool,gToolFace); 216 childSetCommitCallback("radio select face",commit_select_tool,LLToolFace::getInstance());
218 mCheckSelectIndividual = LLUICtrlFactory::getCheckBoxByName(this,"checkbox edit linked parts"); 217 mCheckSelectIndividual = getChild<LLCheckBoxCtrl>("checkbox edit linked parts");
219 childSetValue("checkbox edit linked parts",(BOOL)gSavedSettings.getBOOL("EditLinkedParts")); 218 childSetValue("checkbox edit linked parts",(BOOL)gSavedSettings.getBOOL("EditLinkedParts"));
220 childSetCommitCallback("checkbox edit linked parts",commit_select_component,this); 219 childSetCommitCallback("checkbox edit linked parts",commit_select_component,this);
221 mCheckSnapToGrid = LLUICtrlFactory::getCheckBoxByName(this,"checkbox snap to grid"); 220 mCheckSnapToGrid = getChild<LLCheckBoxCtrl>("checkbox snap to grid");
222 childSetValue("checkbox snap to grid",(BOOL)gSavedSettings.getBOOL("SnapEnabled")); 221 childSetValue("checkbox snap to grid",(BOOL)gSavedSettings.getBOOL("SnapEnabled"));
223 mBtnGridOptions = LLUICtrlFactory::getButtonByName(this,"Options..."); 222 mBtnGridOptions = getChild<LLButton>("Options...");
224 childSetAction("Options...",onClickGridOptions, this); 223 childSetAction("Options...",onClickGridOptions, this);
225 mCheckStretchUniform = LLUICtrlFactory::getCheckBoxByName(this,"checkbox uniform"); 224 mCheckStretchUniform = getChild<LLCheckBoxCtrl>("checkbox uniform");
226 childSetValue("checkbox uniform",(BOOL)gSavedSettings.getBOOL("ScaleUniform")); 225 childSetValue("checkbox uniform",(BOOL)gSavedSettings.getBOOL("ScaleUniform"));
227 mCheckStretchTexture = LLUICtrlFactory::getCheckBoxByName(this,"checkbox stretch textures"); 226 mCheckStretchTexture = getChild<LLCheckBoxCtrl>("checkbox stretch textures");
228 childSetValue("checkbox stretch textures",(BOOL)gSavedSettings.getBOOL("ScaleStretchTextures")); 227 childSetValue("checkbox stretch textures",(BOOL)gSavedSettings.getBOOL("ScaleStretchTextures"));
229 mTextGridMode = LLUICtrlFactory::getTextBoxByName(this,"text ruler mode"); 228 mTextGridMode = getChild<LLTextBox>("text ruler mode");
230 mComboGridMode = LLUICtrlFactory::getComboBoxByName(this,"combobox grid mode"); 229 mComboGridMode = getChild<LLComboBox>("combobox grid mode");
231 childSetCommitCallback("combobox grid mode",commit_grid_mode, this); 230 childSetCommitCallback("combobox grid mode",commit_grid_mode, this);
232 // 231 //
233 // Create Buttons 232 // Create Buttons
@@ -267,7 +266,7 @@ BOOL LLFloaterTools::postBuild()
267 &LLToolPlacerPanel::sGrass}; 266 &LLToolPlacerPanel::sGrass};
268 for(size_t t=0; t<sizeof(toolNames)/sizeof(toolNames[0]); ++t) 267 for(size_t t=0; t<sizeof(toolNames)/sizeof(toolNames[0]); ++t)
269 { 268 {
270 LLButton *found = LLViewerUICtrlFactory::getButtonByName(this,toolNames[t]); 269 LLButton *found = getChild<LLButton>(toolNames[t]);
271 if(found) 270 if(found)
272 { 271 {
273 found->setClickedCallback(setObjectType,toolData[t]); 272 found->setClickedCallback(setObjectType,toolData[t]);
@@ -276,38 +275,38 @@ BOOL LLFloaterTools::postBuild()
276 llwarns << "Tool button not found! DOA Pending." << llendl; 275 llwarns << "Tool button not found! DOA Pending." << llendl;
277 } 276 }
278 } 277 }
279 mCheckCopySelection = LLUICtrlFactory::getCheckBoxByName(this,"checkbox copy selection"); 278 mCheckCopySelection = getChild<LLCheckBoxCtrl>("checkbox copy selection");
280 childSetValue("checkbox copy selection",(BOOL)gSavedSettings.getBOOL("CreateToolCopySelection")); 279 childSetValue("checkbox copy selection",(BOOL)gSavedSettings.getBOOL("CreateToolCopySelection"));
281 mCheckSticky = LLUICtrlFactory::getCheckBoxByName(this,"checkbox sticky"); 280 mCheckSticky = getChild<LLCheckBoxCtrl>("checkbox sticky");
282 childSetValue("checkbox sticky",(BOOL)gSavedSettings.getBOOL("CreateToolKeepSelected")); 281 childSetValue("checkbox sticky",(BOOL)gSavedSettings.getBOOL("CreateToolKeepSelected"));
283 mCheckCopyCenters = LLUICtrlFactory::getCheckBoxByName(this,"checkbox copy centers"); 282 mCheckCopyCenters = getChild<LLCheckBoxCtrl>("checkbox copy centers");
284 childSetValue("checkbox copy centers",(BOOL)gSavedSettings.getBOOL("CreateToolCopyCenters")); 283 childSetValue("checkbox copy centers",(BOOL)gSavedSettings.getBOOL("CreateToolCopyCenters"));
285 mCheckCopyRotates = LLUICtrlFactory::getCheckBoxByName(this,"checkbox copy rotates"); 284 mCheckCopyRotates = getChild<LLCheckBoxCtrl>("checkbox copy rotates");
286 childSetValue("checkbox copy rotates",(BOOL)gSavedSettings.getBOOL("CreateToolCopyRotates")); 285 childSetValue("checkbox copy rotates",(BOOL)gSavedSettings.getBOOL("CreateToolCopyRotates"));
287 mRadioSelectLand = LLUICtrlFactory::getCheckBoxByName(this,"radio select land"); 286 mRadioSelectLand = getChild<LLCheckBoxCtrl>("radio select land");
288 childSetCommitCallback("radio select land",commit_select_tool, gToolParcel); 287 childSetCommitCallback("radio select land",commit_select_tool, LLToolSelectLand::getInstance());
289 mRadioDozerFlatten = LLUICtrlFactory::getCheckBoxByName(this,"radio flatten"); 288 mRadioDozerFlatten = getChild<LLCheckBoxCtrl>("radio flatten");
290 childSetCommitCallback("radio flatten",click_popup_dozer_mode, (void*)0); 289 childSetCommitCallback("radio flatten",click_popup_dozer_mode, (void*)0);
291 mRadioDozerRaise = LLUICtrlFactory::getCheckBoxByName(this,"radio raise"); 290 mRadioDozerRaise = getChild<LLCheckBoxCtrl>("radio raise");
292 childSetCommitCallback("radio raise",click_popup_dozer_mode, (void*)1); 291 childSetCommitCallback("radio raise",click_popup_dozer_mode, (void*)1);
293 mRadioDozerLower = LLUICtrlFactory::getCheckBoxByName(this,"radio lower"); 292 mRadioDozerLower = getChild<LLCheckBoxCtrl>("radio lower");
294 childSetCommitCallback("radio lower",click_popup_dozer_mode, (void*)2); 293 childSetCommitCallback("radio lower",click_popup_dozer_mode, (void*)2);
295 mRadioDozerSmooth = LLUICtrlFactory::getCheckBoxByName(this,"radio smooth"); 294 mRadioDozerSmooth = getChild<LLCheckBoxCtrl>("radio smooth");
296 childSetCommitCallback("radio smooth",click_popup_dozer_mode, (void*)3); 295 childSetCommitCallback("radio smooth",click_popup_dozer_mode, (void*)3);
297 mRadioDozerNoise = LLUICtrlFactory::getCheckBoxByName(this,"radio noise"); 296 mRadioDozerNoise = getChild<LLCheckBoxCtrl>("radio noise");
298 childSetCommitCallback("radio noise",click_popup_dozer_mode, (void*)4); 297 childSetCommitCallback("radio noise",click_popup_dozer_mode, (void*)4);
299 mRadioDozerRevert = LLUICtrlFactory::getCheckBoxByName(this,"radio revert"); 298 mRadioDozerRevert = getChild<LLCheckBoxCtrl>("radio revert");
300 childSetCommitCallback("radio revert",click_popup_dozer_mode, (void*)5); 299 childSetCommitCallback("radio revert",click_popup_dozer_mode, (void*)5);
301 mComboDozerSize = LLUICtrlFactory::getComboBoxByName(this,"combobox brush size"); 300 mComboDozerSize = getChild<LLComboBox>("combobox brush size");
302 childSetCommitCallback("combobox brush size",click_dozer_size, (void*)0); 301 childSetCommitCallback("combobox brush size",click_dozer_size, (void*)0);
303 if(mComboDozerSize) mComboDozerSize->setCurrentByIndex(0); 302 if(mComboDozerSize) mComboDozerSize->setCurrentByIndex(0);
304 mBtnApplyToSelection = LLUICtrlFactory::getButtonByName(this,"button apply to selection"); 303 mBtnApplyToSelection = getChild<LLButton>("button apply to selection");
305 childSetAction("button apply to selection",click_apply_to_selection, (void*)0); 304 childSetAction("button apply to selection",click_apply_to_selection, (void*)0);
306 mCheckShowOwners = LLUICtrlFactory::getCheckBoxByName(this,"checkbox show owners"); 305 mCheckShowOwners = getChild<LLCheckBoxCtrl>("checkbox show owners");
307 childSetValue("checkbox show owners",gSavedSettings.getBOOL("ShowParcelOwners")); 306 childSetValue("checkbox show owners",gSavedSettings.getBOOL("ShowParcelOwners"));
308 childSetAction("button more", click_show_more, this); 307 childSetAction("button more", click_show_more, this);
309 childSetAction("button less", click_show_more, this); 308 childSetAction("button less", click_show_more, this);
310 mTab = LLUICtrlFactory::getTabContainerByName(this,"Object Info Tabs"); 309 mTab = getChild<LLTabContainer>("Object Info Tabs");
311 if(mTab) 310 if(mTab)
312 { 311 {
313 mTab->setVisible( gSavedSettings.getBOOL("ToolboxShowMore") ); 312 mTab->setVisible( gSavedSettings.getBOOL("ToolboxShowMore") );
@@ -406,7 +405,7 @@ LLFloaterTools::LLFloaterTools()
406 factory_map["ContentsInventory"] = LLCallbackMap(createPanelContentsInventory, this);//LLPanelContents 405 factory_map["ContentsInventory"] = LLCallbackMap(createPanelContentsInventory, this);//LLPanelContents
407 factory_map["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo 406 factory_map["land info panel"] = LLCallbackMap(createPanelLandInfo, this);//LLPanelLandInfo
408 407
409 gUICtrlFactory->buildFloater(this,"floater_tools.xml",&factory_map,FALSE); 408 LLUICtrlFactory::getInstance()->buildFloater(this,"floater_tools.xml",&factory_map,FALSE);
410 409
411 mLargeHeight = getRect().getHeight(); 410 mLargeHeight = getRect().getHeight();
412 mSmallHeight = mLargeHeight; 411 mSmallHeight = mLargeHeight;
@@ -445,7 +444,7 @@ void LLFloaterTools::refresh()
445 const S32 INFO_WIDTH = getRect().getWidth(); 444 const S32 INFO_WIDTH = getRect().getWidth();
446 const S32 INFO_HEIGHT = 384; 445 const S32 INFO_HEIGHT = 384;
447 LLRect object_info_rect(0, 0, INFO_WIDTH, -INFO_HEIGHT); 446 LLRect object_info_rect(0, 0, INFO_WIDTH, -INFO_HEIGHT);
448 BOOL all_volume = gSelectMgr->selectionAllPCode( LL_PCODE_VOLUME ); 447 BOOL all_volume = LLSelectMgr::getInstance()->selectionAllPCode( LL_PCODE_VOLUME );
449 448
450 S32 idx_features = mTab->getPanelIndexByTitle(PANEL_NAMES[PANEL_FEATURES]); 449 S32 idx_features = mTab->getPanelIndexByTitle(PANEL_NAMES[PANEL_FEATURES]);
451 S32 idx_face = mTab->getPanelIndexByTitle(PANEL_NAMES[PANEL_FACE]); 450 S32 idx_face = mTab->getPanelIndexByTitle(PANEL_NAMES[PANEL_FACE]);
@@ -502,7 +501,7 @@ void LLFloaterTools::resetToolState()
502 501
503void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask) 502void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
504{ 503{
505 LLTool *tool = gToolMgr->getCurrentTool(); 504 LLTool *tool = LLToolMgr::getInstance()->getCurrentTool();
506 505
507 // HACK to allow seeing the buttons when you have the app in a window. 506 // HACK to allow seeing the buttons when you have the app in a window.
508 // Keep the visibility the same as it 507 // Keep the visibility the same as it
@@ -517,7 +516,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
517 } 516 }
518 517
519 // Focus buttons 518 // Focus buttons
520 BOOL focus_visible = ( tool == gToolCamera ); 519 BOOL focus_visible = ( tool == LLToolCamera::getInstance() );
521 520
522 mBtnFocus ->setToggleState( focus_visible ); 521 mBtnFocus ->setToggleState( focus_visible );
523 522
@@ -545,7 +544,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
545 childSetValue( "slider zoom", gAgent.getCameraZoomFraction() * 0.5f); 544 childSetValue( "slider zoom", gAgent.getCameraZoomFraction() * 0.5f);
546 545
547 // Move buttons 546 // Move buttons
548 BOOL move_visible = (tool == gToolGrab); 547 BOOL move_visible = (tool == LLToolGrab::getInstance());
549 548
550 if (mBtnMove) mBtnMove ->setToggleState( move_visible ); 549 if (mBtnMove) mBtnMove ->setToggleState( move_visible );
551 550
@@ -574,12 +573,12 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
574 } 573 }
575 574
576 // Edit buttons 575 // Edit buttons
577 BOOL edit_visible = tool == gToolTranslate || 576 BOOL edit_visible = tool == LLToolCompTranslate::getInstance() ||
578 tool == gToolRotate || 577 tool == LLToolCompRotate::getInstance() ||
579 tool == gToolStretch || 578 tool == LLToolCompScale::getInstance() ||
580 tool == gToolFace || 579 tool == LLToolFace::getInstance() ||
581 tool == gToolIndividual || 580 tool == LLToolIndividual::getInstance() ||
582 tool == gToolPipette; 581 tool == LLToolPipette::getInstance();
583 582
584 mBtnEdit ->setToggleState( edit_visible ); 583 mBtnEdit ->setToggleState( edit_visible );
585 584
@@ -589,7 +588,7 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
589 if (mRadioSelectFace) 588 if (mRadioSelectFace)
590 { 589 {
591 mRadioSelectFace->setVisible( edit_visible ); 590 mRadioSelectFace->setVisible( edit_visible );
592 mRadioSelectFace->set( tool == gToolFace ); 591 mRadioSelectFace->set( tool == LLToolFace::getInstance() );
593 } 592 }
594 593
595 if (mCheckSelectIndividual) 594 if (mCheckSelectIndividual)
@@ -598,9 +597,9 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
598 //mCheckSelectIndividual->set(gSavedSettings.getBOOL("EditLinkedParts")); 597 //mCheckSelectIndividual->set(gSavedSettings.getBOOL("EditLinkedParts"));
599 } 598 }
600 599
601 mRadioPosition ->set( tool == gToolTranslate ); 600 mRadioPosition ->set( tool == LLToolCompTranslate::getInstance() );
602 mRadioRotate ->set( tool == gToolRotate ); 601 mRadioRotate ->set( tool == LLToolCompRotate::getInstance() );
603 mRadioStretch ->set( tool == gToolStretch ); 602 mRadioStretch ->set( tool == LLToolCompScale::getInstance() );
604 603
605 if (mComboGridMode) 604 if (mComboGridMode)
606 { 605 {
@@ -632,17 +631,17 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
632 if (mTextGridMode) mTextGridMode->setVisible( edit_visible ); 631 if (mTextGridMode) mTextGridMode->setVisible( edit_visible );
633 632
634 // Snap to grid disabled for grab tool - very confusing 633 // Snap to grid disabled for grab tool - very confusing
635 if (mCheckSnapToGrid) mCheckSnapToGrid->setVisible( edit_visible /* || tool == gToolGrab */ ); 634 if (mCheckSnapToGrid) mCheckSnapToGrid->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ );
636 if (mBtnGridOptions) mBtnGridOptions->setVisible( edit_visible /* || tool == gToolGrab */ ); 635 if (mBtnGridOptions) mBtnGridOptions->setVisible( edit_visible /* || tool == LLToolGrab::getInstance() */ );
637 636
638 //mCheckSelectLinked ->setVisible( edit_visible ); 637 //mCheckSelectLinked ->setVisible( edit_visible );
639 if (mCheckStretchUniform) mCheckStretchUniform->setVisible( edit_visible ); 638 if (mCheckStretchUniform) mCheckStretchUniform->setVisible( edit_visible );
640 if (mCheckStretchTexture) mCheckStretchTexture->setVisible( edit_visible ); 639 if (mCheckStretchTexture) mCheckStretchTexture->setVisible( edit_visible );
641 640
642 // Create buttons 641 // Create buttons
643 BOOL create_visible = (tool == gToolCreate); 642 BOOL create_visible = (tool == LLToolCompCreate::getInstance());
644 643
645 mBtnCreate ->setToggleState( tool == gToolCreate ); 644 mBtnCreate ->setToggleState( tool == LLToolCompCreate::getInstance() );
646 645
647 if (mCheckCopySelection 646 if (mCheckCopySelection
648 && mCheckCopySelection->get()) 647 && mCheckCopySelection->get())
@@ -678,12 +677,12 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
678 if (mCheckCopyRotates) mCheckCopyRotates->setEnabled( mCheckCopySelection->get() ); 677 if (mCheckCopyRotates) mCheckCopyRotates->setEnabled( mCheckCopySelection->get() );
679 678
680 // Land buttons 679 // Land buttons
681 BOOL land_visible = (tool == gToolLand || tool == gToolParcel ); 680 BOOL land_visible = (tool == LLToolBrushLand::getInstance() || tool == LLToolSelectLand::getInstance() );
682 681
683 if (mBtnLand) mBtnLand ->setToggleState( land_visible ); 682 if (mBtnLand) mBtnLand ->setToggleState( land_visible );
684 683
685 // mRadioEditLand ->set( tool == gToolLand ); 684 // mRadioEditLand ->set( tool == LLToolBrushLand::getInstance() );
686 if (mRadioSelectLand) mRadioSelectLand->set( tool == gToolParcel ); 685 if (mRadioSelectLand) mRadioSelectLand->set( tool == LLToolSelectLand::getInstance() );
687 686
688 // mRadioEditLand ->setVisible( land_visible ); 687 // mRadioEditLand ->setVisible( land_visible );
689 if (mRadioSelectLand) mRadioSelectLand->setVisible( land_visible ); 688 if (mRadioSelectLand) mRadioSelectLand->setVisible( land_visible );
@@ -693,44 +692,44 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
693 692
694 if (mRadioDozerFlatten) 693 if (mRadioDozerFlatten)
695 { 694 {
696 mRadioDozerFlatten ->set( tool == gToolLand && dozer_mode == 0); 695 mRadioDozerFlatten ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 0);
697 mRadioDozerFlatten ->setVisible( land_visible ); 696 mRadioDozerFlatten ->setVisible( land_visible );
698 } 697 }
699 if (mRadioDozerRaise) 698 if (mRadioDozerRaise)
700 { 699 {
701 mRadioDozerRaise ->set( tool == gToolLand && dozer_mode == 1); 700 mRadioDozerRaise ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 1);
702 mRadioDozerRaise ->setVisible( land_visible ); 701 mRadioDozerRaise ->setVisible( land_visible );
703 } 702 }
704 if (mRadioDozerLower) 703 if (mRadioDozerLower)
705 { 704 {
706 mRadioDozerLower ->set( tool == gToolLand && dozer_mode == 2); 705 mRadioDozerLower ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 2);
707 mRadioDozerLower ->setVisible( land_visible ); 706 mRadioDozerLower ->setVisible( land_visible );
708 } 707 }
709 if (mRadioDozerSmooth) 708 if (mRadioDozerSmooth)
710 { 709 {
711 mRadioDozerSmooth ->set( tool == gToolLand && dozer_mode == 3); 710 mRadioDozerSmooth ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 3);
712 mRadioDozerSmooth ->setVisible( land_visible ); 711 mRadioDozerSmooth ->setVisible( land_visible );
713 } 712 }
714 if (mRadioDozerNoise) 713 if (mRadioDozerNoise)
715 { 714 {
716 mRadioDozerNoise ->set( tool == gToolLand && dozer_mode == 4); 715 mRadioDozerNoise ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 4);
717 mRadioDozerNoise ->setVisible( land_visible ); 716 mRadioDozerNoise ->setVisible( land_visible );
718 } 717 }
719 if (mRadioDozerRevert) 718 if (mRadioDozerRevert)
720 { 719 {
721 mRadioDozerRevert ->set( tool == gToolLand && dozer_mode == 5); 720 mRadioDozerRevert ->set( tool == LLToolBrushLand::getInstance() && dozer_mode == 5);
722 mRadioDozerRevert ->setVisible( land_visible ); 721 mRadioDozerRevert ->setVisible( land_visible );
723 } 722 }
724 if (mComboDozerSize) 723 if (mComboDozerSize)
725 { 724 {
726 mComboDozerSize ->setCurrentByIndex(dozer_size); 725 mComboDozerSize ->setCurrentByIndex(dozer_size);
727 mComboDozerSize ->setVisible( land_visible ); 726 mComboDozerSize ->setVisible( land_visible );
728 mComboDozerSize ->setEnabled( tool == gToolLand ); 727 mComboDozerSize ->setEnabled( tool == LLToolBrushLand::getInstance() );
729 } 728 }
730 if (mBtnApplyToSelection) 729 if (mBtnApplyToSelection)
731 { 730 {
732 mBtnApplyToSelection->setVisible( land_visible ); 731 mBtnApplyToSelection->setVisible( land_visible );
733 mBtnApplyToSelection->setEnabled( land_visible && !gParcelMgr->selectionEmpty() && tool != gToolParcel); 732 mBtnApplyToSelection->setEnabled( land_visible && !LLViewerParcelMgr::getInstance()->selectionEmpty() && tool != LLToolSelectLand::getInstance());
734 } 733 }
735 if (mCheckShowOwners) 734 if (mCheckShowOwners)
736 { 735 {
@@ -742,8 +741,8 @@ void LLFloaterTools::updatePopup(LLCoordGL center, MASK mask)
742 // 741 //
743 BOOL show_more = gSavedSettings.getBOOL("ToolboxShowMore"); 742 BOOL show_more = gSavedSettings.getBOOL("ToolboxShowMore");
744 743
745 mTab->setVisible(show_more && tool != gToolLand && tool != gToolParcel); 744 mTab->setVisible(show_more && tool != LLToolBrushLand::getInstance() && tool != LLToolSelectLand::getInstance());
746 mPanelLandInfo->setVisible(show_more && (tool == gToolLand || tool == gToolParcel)); 745 mPanelLandInfo->setVisible(show_more && (tool == LLToolBrushLand::getInstance() || tool == LLToolSelectLand::getInstance()));
747} 746}
748 747
749 748
@@ -757,8 +756,11 @@ BOOL LLFloaterTools::canClose()
757// virtual 756// virtual
758void LLFloaterTools::onOpen() 757void LLFloaterTools::onOpen()
759{ 758{
760 mParcelSelection = gParcelMgr->getFloatingParcelSelection(); 759 mParcelSelection = LLViewerParcelMgr::getInstance()->getFloatingParcelSelection();
761 mObjectSelection = gSelectMgr->getEditSelection(); 760 mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
761
762 gMenuBarView->setItemVisible("Tools", TRUE);
763 gMenuBarView->arrange();
762} 764}
763 765
764// virtual 766// virtual
@@ -768,12 +770,14 @@ void LLFloaterTools::onClose(bool app_quitting)
768 setVisible(FALSE); 770 setVisible(FALSE);
769 mTab->setVisible(FALSE); 771 mTab->setVisible(FALSE);
770 772
773 LLViewerJoystick::getInstance()->moveAvatar(true);
774
771 // Different from handle_reset_view in that it doesn't actually 775 // Different from handle_reset_view in that it doesn't actually
772 // move the camera if EditCameraMovement is not set. 776 // move the camera if EditCameraMovement is not set.
773 gAgent.resetView(gSavedSettings.getBOOL("EditCameraMovement")); 777 gAgent.resetView(gSavedSettings.getBOOL("EditCameraMovement"));
774 778
775 // exit component selection mode 779 // exit component selection mode
776 gSelectMgr->promoteSelectionToRoot(); 780 LLSelectMgr::getInstance()->promoteSelectionToRoot();
777 gSavedSettings.setBOOL("EditLinkedParts", FALSE); 781 gSavedSettings.setBOOL("EditLinkedParts", FALSE);
778 782
779 gViewerWindow->showCursor(); 783 gViewerWindow->showCursor();
@@ -784,10 +788,13 @@ void LLFloaterTools::onClose(bool app_quitting)
784 mObjectSelection = NULL; 788 mObjectSelection = NULL;
785 789
786 // Switch back to basic toolset 790 // Switch back to basic toolset
787 gToolMgr->setCurrentToolset(gBasicToolset); 791 LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
788 // we were already in basic toolset, using build tools 792 // we were already in basic toolset, using build tools
789 // so manually reset tool to default (pie menu tool) 793 // so manually reset tool to default (pie menu tool)
790 gToolMgr->getCurrentToolset()->selectFirstTool(); 794 LLToolMgr::getInstance()->getCurrentToolset()->selectFirstTool();
795
796 gMenuBarView->setItemVisible("Tools", FALSE);
797 gMenuBarView->arrange();
791} 798}
792 799
793void LLFloaterTools::showMore(BOOL show_more) 800void LLFloaterTools::showMore(BOOL show_more)
@@ -885,19 +892,19 @@ void commit_slider_zoom(LLUICtrl *ctrl, void*)
885 892
886void click_popup_rotate_left(void*) 893void click_popup_rotate_left(void*)
887{ 894{
888 gSelectMgr->selectionRotateAroundZ( 45.f ); 895 LLSelectMgr::getInstance()->selectionRotateAroundZ( 45.f );
889 dialog_refresh_all(); 896 dialog_refresh_all();
890} 897}
891 898
892void click_popup_rotate_reset(void*) 899void click_popup_rotate_reset(void*)
893{ 900{
894 gSelectMgr->selectionResetRotation(); 901 LLSelectMgr::getInstance()->selectionResetRotation();
895 dialog_refresh_all(); 902 dialog_refresh_all();
896} 903}
897 904
898void click_popup_rotate_right(void*) 905void click_popup_rotate_right(void*)
899{ 906{
900 gSelectMgr->selectionRotateAroundZ( -45.f ); 907 LLSelectMgr::getInstance()->selectionRotateAroundZ( -45.f );
901 dialog_refresh_all(); 908 dialog_refresh_all();
902} 909}
903 910
@@ -906,7 +913,7 @@ void click_popup_dozer_mode(LLUICtrl *, void *user)
906{ 913{
907 S32 show_owners = gSavedSettings.getBOOL("ShowParcelOwners"); 914 S32 show_owners = gSavedSettings.getBOOL("ShowParcelOwners");
908 S32 mode = (S32)(intptr_t) user; 915 S32 mode = (S32)(intptr_t) user;
909 gFloaterTools->setEditTool( gToolLand ); 916 gFloaterTools->setEditTool( LLToolBrushLand::getInstance() );
910 gSavedSettings.setS32("RadioLandBrushAction", mode); 917 gSavedSettings.setS32("RadioLandBrushAction", mode);
911 gSavedSettings.setBOOL("ShowParcelOwners", show_owners); 918 gSavedSettings.setBOOL("ShowParcelOwners", show_owners);
912} 919}
@@ -925,7 +932,7 @@ void click_dozer_size(LLUICtrl *ctrl, void *user)
925 932
926void click_apply_to_selection(void* user) 933void click_apply_to_selection(void* user)
927{ 934{
928 gToolLand->modifyLandInSelectionGlobal(); 935 LLToolBrushLand::getInstance()->modifyLandInSelectionGlobal();
929} 936}
930 937
931void commit_select_tool(LLUICtrl *ctrl, void *data) 938void commit_select_tool(LLUICtrl *ctrl, void *data)
@@ -951,11 +958,11 @@ void commit_select_component(LLUICtrl *ctrl, void *data)
951 958
952 if (select_individuals) 959 if (select_individuals)
953 { 960 {
954 gSelectMgr->demoteSelectionToIndividuals(); 961 LLSelectMgr::getInstance()->demoteSelectionToIndividuals();
955 } 962 }
956 else 963 else
957 { 964 {
958 gSelectMgr->promoteSelectionToRoot(); 965 LLSelectMgr::getInstance()->promoteSelectionToRoot();
959 } 966 }
960} 967}
961 968
@@ -963,7 +970,7 @@ void commit_grid_mode(LLUICtrl *ctrl, void *data)
963{ 970{
964 LLComboBox* combo = (LLComboBox*)ctrl; 971 LLComboBox* combo = (LLComboBox*)ctrl;
965 972
966 gSelectMgr->setGridMode((EGridMode)combo->getCurrentIndex()); 973 LLSelectMgr::getInstance()->setGridMode((EGridMode)combo->getCurrentIndex());
967} 974}
968 975
969// static 976// static
@@ -991,6 +998,6 @@ void LLFloaterTools::setEditTool(void* tool_pointer)
991 998
992void LLFloaterTools::onFocusReceived() 999void LLFloaterTools::onFocusReceived()
993{ 1000{
994 gToolMgr->setCurrentToolset(gBasicToolset); 1001 LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
995 LLFloater::onFocusReceived(); 1002 LLFloater::onFocusReceived();
996} 1003}