aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewermenu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/llviewermenu.cpp')
-rw-r--r--linden/indra/newview/llviewermenu.cpp684
1 files changed, 357 insertions, 327 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index b35abe6..6ee80a6 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -67,7 +67,6 @@
67#include "llagentpilot.h" 67#include "llagentpilot.h"
68#include "llbox.h" 68#include "llbox.h"
69#include "llcallingcard.h" 69#include "llcallingcard.h"
70#include "llcameraview.h"
71#include "llclipboard.h" 70#include "llclipboard.h"
72#include "llcompilequeue.h" 71#include "llcompilequeue.h"
73#include "llconsole.h" 72#include "llconsole.h"
@@ -92,6 +91,7 @@
92#include "llfloaterbuycontents.h" 91#include "llfloaterbuycontents.h"
93#include "llfloaterbuycurrency.h" 92#include "llfloaterbuycurrency.h"
94#include "llfloaterbuyland.h" 93#include "llfloaterbuyland.h"
94#include "llfloatercamera.h"
95#include "llfloaterchat.h" 95#include "llfloaterchat.h"
96#include "llfloatercustomize.h" 96#include "llfloatercustomize.h"
97#include "llfloaterdaycycle.h" 97#include "llfloaterdaycycle.h"
@@ -106,6 +106,7 @@
106#include "llfloatergroups.h" 106#include "llfloatergroups.h"
107#include "llfloaterhtml.h" 107#include "llfloaterhtml.h"
108#include "llfloaterhtmlhelp.h" 108#include "llfloaterhtmlhelp.h"
109#include "llfloaterhud.h"
109#include "llfloaterinspect.h" 110#include "llfloaterinspect.h"
110#include "llfloaterlagmeter.h" 111#include "llfloaterlagmeter.h"
111#include "llfloaterland.h" 112#include "llfloaterland.h"
@@ -119,7 +120,9 @@
119#include "llfloaterregioninfo.h" 120#include "llfloaterregioninfo.h"
120#include "llfloaterreporter.h" 121#include "llfloaterreporter.h"
121#include "llfloaterscriptdebug.h" 122#include "llfloaterscriptdebug.h"
123#include "llfloatersettingsdebug.h"
122#include "llfloaterenvsettings.h" 124#include "llfloaterenvsettings.h"
125#include "llfloaterstats.h"
123#include "llfloatertest.h" 126#include "llfloatertest.h"
124#include "llfloatertools.h" 127#include "llfloatertools.h"
125#include "llfloaterwater.h" 128#include "llfloaterwater.h"
@@ -170,7 +173,7 @@
170#include "lltoolpie.h" 173#include "lltoolpie.h"
171#include "lltoolplacer.h" 174#include "lltoolplacer.h"
172#include "lltoolselectland.h" 175#include "lltoolselectland.h"
173#include "llvieweruictrlfactory.h" 176#include "lluictrlfactory.h"
174#include "lluploaddialog.h" 177#include "lluploaddialog.h"
175#include "lluserauth.h" 178#include "lluserauth.h"
176#include "lluuid.h" 179#include "lluuid.h"
@@ -374,6 +377,11 @@ void toggle_cull_small(void *);
374void toggle_show_xui_names(void *); 377void toggle_show_xui_names(void *);
375BOOL check_show_xui_names(void *); 378BOOL check_show_xui_names(void *);
376 379
380void run_vectorize_perf_test(void *)
381{
382 gSavedSettings.setBOOL("VectorizePerfTest", TRUE);
383}
384
377// Debug UI 385// Debug UI
378void handle_web_search_demo(void*); 386void handle_web_search_demo(void*);
379void handle_slurl_test(void*); 387void handle_slurl_test(void*);
@@ -457,8 +465,6 @@ void handle_dump_image_list(void*);
457 465
458void handle_crash(void*); 466void handle_crash(void*);
459void handle_dump_followcam(void*); 467void handle_dump_followcam(void*);
460void handle_toggle_flycam(void*);
461BOOL check_flycam(void*);
462void handle_viewer_enable_message_log(void*); 468void handle_viewer_enable_message_log(void*);
463void handle_viewer_disable_message_log(void*); 469void handle_viewer_disable_message_log(void*);
464void handle_send_postcard(void*); 470void handle_send_postcard(void*);
@@ -563,12 +569,12 @@ static LLLandmarkObserver* gLandmarkObserver = NULL;
563 569
564LLMenuParcelObserver::LLMenuParcelObserver() 570LLMenuParcelObserver::LLMenuParcelObserver()
565{ 571{
566 gParcelMgr->addObserver(this); 572 LLViewerParcelMgr::getInstance()->addObserver(this);
567} 573}
568 574
569LLMenuParcelObserver::~LLMenuParcelObserver() 575LLMenuParcelObserver::~LLMenuParcelObserver()
570{ 576{
571 gParcelMgr->removeObserver(this); 577 LLViewerParcelMgr::getInstance()->removeObserver(this);
572} 578}
573 579
574void LLMenuParcelObserver::changed() 580void LLMenuParcelObserver::changed()
@@ -660,23 +666,23 @@ void init_menus()
660 /// 666 ///
661 /// Pie menus 667 /// Pie menus
662 /// 668 ///
663 gPieSelf = gUICtrlFactory->buildPieMenu("menu_pie_self.xml", gMenuHolder); 669 gPieSelf = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_self.xml", gMenuHolder);
664 670
665 // TomY TODO: what shall we do about these? 671 // TomY TODO: what shall we do about these?
666 gDetachScreenPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Detach HUD", true); 672 gDetachScreenPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Detach HUD", true);
667 gDetachPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Detach", true); 673 gDetachPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Detach", true);
668 674
669 gPieAvatar = gUICtrlFactory->buildPieMenu("menu_pie_avatar.xml", gMenuHolder); 675 gPieAvatar = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_avatar.xml", gMenuHolder);
670 676
671 gPieObject = gUICtrlFactory->buildPieMenu("menu_pie_object.xml", gMenuHolder); 677 gPieObject = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_object.xml", gMenuHolder);
672 678
673 gAttachScreenPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Attach HUD"); 679 gAttachScreenPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Attach HUD");
674 gAttachPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Attach"); 680 gAttachPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Attach");
675 gPieRate = gMenuHolder->getChild<LLPieMenu>("Rate Menu"); 681 gPieRate = gMenuHolder->getChild<LLPieMenu>("Rate Menu");
676 682
677 gPieAttachment = gUICtrlFactory->buildPieMenu("menu_pie_attachment.xml", gMenuHolder); 683 gPieAttachment = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_attachment.xml", gMenuHolder);
678 684
679 gPieLand = gUICtrlFactory->buildPieMenu("menu_pie_land.xml", gMenuHolder); 685 gPieLand = LLUICtrlFactory::getInstance()->buildPieMenu("menu_pie_land.xml", gMenuHolder);
680 686
681 /// 687 ///
682 /// set up the colors 688 /// set up the colors
@@ -702,10 +708,13 @@ void init_menus()
702 { 708 {
703 color = gColors.getColor( "MenuNonProductionBgColor" ); 709 color = gColors.getColor( "MenuNonProductionBgColor" );
704 } 710 }
705 gMenuBarView = (LLMenuBarGL*)gUICtrlFactory->buildMenu("menu_viewer.xml", gMenuHolder); 711 gMenuBarView = (LLMenuBarGL*)LLUICtrlFactory::getInstance()->buildMenu("menu_viewer.xml", gMenuHolder);
706 gMenuBarView->setRect(LLRect(0, top, 0, top - MENU_BAR_HEIGHT)); 712 gMenuBarView->setRect(LLRect(0, top, 0, top - MENU_BAR_HEIGHT));
707 gMenuBarView->setBackgroundColor( color ); 713 gMenuBarView->setBackgroundColor( color );
708 714
715 gMenuBarView->setItemVisible("Tools", FALSE);
716 gMenuBarView->arrange();
717
709 gMenuHolder->addChild(gMenuBarView); 718 gMenuHolder->addChild(gMenuBarView);
710 719
711 // menu holder appears on top of menu bar so you can see the menu title 720 // menu holder appears on top of menu bar so you can see the menu title
@@ -764,7 +773,7 @@ void init_menus()
764 // 773 //
765 show_debug_menus(); 774 show_debug_menus();
766 775
767 gLoginMenuBarView = (LLMenuBarGL*)gUICtrlFactory->buildMenu("menu_login.xml", gMenuHolder); 776 gLoginMenuBarView = (LLMenuBarGL*)LLUICtrlFactory::getInstance()->buildMenu("menu_login.xml", gMenuHolder);
768 LLRect menuBarRect = gLoginMenuBarView->getRect(); 777 LLRect menuBarRect = gLoginMenuBarView->getRect();
769 gLoginMenuBarView->setRect(LLRect(menuBarRect.mLeft, menuBarRect.mTop, gViewerWindow->getRootView()->getRect().getWidth() - menuBarRect.mLeft, menuBarRect.mBottom)); 778 gLoginMenuBarView->setRect(LLRect(menuBarRect.mLeft, menuBarRect.mTop, gViewerWindow->getRootView()->getRect().getWidth() - menuBarRect.mLeft, menuBarRect.mBottom));
770 779
@@ -821,14 +830,12 @@ void clear_landmark_menu(LLMenuGL* menu)
821 for ( ; it != child_list->end(); ++it) 830 for ( ; it != child_list->end(); ++it)
822 { 831 {
823 LLView* view = *it; 832 LLView* view = *it;
824 if (view->getWidgetType() == WIDGET_TYPE_MENU_ITEM_CALL) 833 LLMenuItemCallGL* menu_item = dynamic_cast<LLMenuItemCallGL*>(view);
834
835 if (menu_item && menu_item->getMenuCallback() == landmark_menu_action)
825 { 836 {
826 LLMenuItemCallGL* menu_item = (LLMenuItemCallGL*)view; 837 void* user_data = menu_item->getUserData();
827 if (menu_item->getMenuCallback() == landmark_menu_action) 838 delete (LLUUID*)user_data;
828 {
829 void* user_data = menu_item->getUserData();
830 delete (LLUUID*)user_data;
831 }
832 } 839 }
833 } 840 }
834 841
@@ -1072,9 +1079,6 @@ void init_client_menu(LLMenuGL* menu)
1072 &menu_check_control, 1079 &menu_check_control,
1073 (void*)"DisableCameraConstraints")); 1080 (void*)"DisableCameraConstraints"));
1074 1081
1075 menu->append(new LLMenuItemCheckGL("Joystick Flycam",
1076 &handle_toggle_flycam,NULL,&check_flycam,NULL));
1077
1078 menu->append(new LLMenuItemCheckGL("Mouse Smoothing", 1082 menu->append(new LLMenuItemCheckGL("Mouse Smoothing",
1079 &menu_toggle_control, 1083 &menu_toggle_control,
1080 NULL, 1084 NULL,
@@ -1088,7 +1092,7 @@ void init_client_menu(LLMenuGL* menu)
1088 &menu_check_control, 1092 &menu_check_control,
1089 (void*)"ShowConsoleWindow")); 1093 (void*)"ShowConsoleWindow"));
1090 1094
1091 if(gQAMode) 1095 if(gSavedSettings.getBOOL("QAMode"))
1092 { 1096 {
1093 LLMenuGL* sub = NULL; 1097 LLMenuGL* sub = NULL;
1094 sub = new LLMenuGL("Debugging"); 1098 sub = new LLMenuGL("Debugging");
@@ -1174,7 +1178,6 @@ extern BOOL gDebugClicks;
1174extern BOOL gDebugWindowProc; 1178extern BOOL gDebugWindowProc;
1175extern BOOL gDebugTextEditorTips; 1179extern BOOL gDebugTextEditorTips;
1176extern BOOL gDebugSelectMgr; 1180extern BOOL gDebugSelectMgr;
1177extern BOOL gVectorizePerfTest;
1178 1181
1179void init_debug_ui_menu(LLMenuGL* menu) 1182void init_debug_ui_menu(LLMenuGL* menu)
1180{ 1183{
@@ -1184,7 +1187,6 @@ void init_debug_ui_menu(LLMenuGL* menu)
1184 menu->append(new LLMenuItemCallGL( "Dump SelectMgr", &dump_select_mgr)); 1187 menu->append(new LLMenuItemCallGL( "Dump SelectMgr", &dump_select_mgr));
1185 menu->append(new LLMenuItemCallGL( "Dump Inventory", &dump_inventory)); 1188 menu->append(new LLMenuItemCallGL( "Dump Inventory", &dump_inventory));
1186 menu->append(new LLMenuItemCallGL( "Dump Focus Holder", &handle_dump_focus, NULL, NULL, 'F', MASK_ALT | MASK_CONTROL)); 1189 menu->append(new LLMenuItemCallGL( "Dump Focus Holder", &handle_dump_focus, NULL, NULL, 'F', MASK_ALT | MASK_CONTROL));
1187 menu->append(new LLMenuItemCallGL( "Dump VolumeMgr", &dump_volume_mgr, NULL, NULL));
1188 menu->append(new LLMenuItemCallGL( "Print Selected Object Info", &print_object_info, NULL, NULL, 'P', MASK_CONTROL|MASK_SHIFT )); 1190 menu->append(new LLMenuItemCallGL( "Print Selected Object Info", &print_object_info, NULL, NULL, 'P', MASK_CONTROL|MASK_SHIFT ));
1189 menu->append(new LLMenuItemCallGL( "Print Agent Info", &print_agent_nvpairs, NULL, NULL, 'P', MASK_SHIFT )); 1191 menu->append(new LLMenuItemCallGL( "Print Agent Info", &print_agent_nvpairs, NULL, NULL, 'P', MASK_SHIFT ));
1190 menu->append(new LLMenuItemCallGL( "Texture Memory Stats", &output_statistics, NULL, NULL, 'M', MASK_SHIFT | MASK_ALT | MASK_CONTROL)); 1192 menu->append(new LLMenuItemCallGL( "Texture Memory Stats", &output_statistics, NULL, NULL, 'M', MASK_SHIFT | MASK_ALT | MASK_CONTROL));
@@ -1357,6 +1359,9 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1357 sub_menu->append(new LLMenuItemCheckGL("Texture Priority", &LLPipeline::toggleRenderDebug, NULL, 1359 sub_menu->append(new LLMenuItemCheckGL("Texture Priority", &LLPipeline::toggleRenderDebug, NULL,
1358 &LLPipeline::toggleRenderDebugControl, 1360 &LLPipeline::toggleRenderDebugControl,
1359 (void*)LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY)); 1361 (void*)LLPipeline::RENDER_DEBUG_TEXTURE_PRIORITY));
1362 sub_menu->append(new LLMenuItemCheckGL("Avatar Rendering Cost", &LLPipeline::toggleRenderDebug, NULL,
1363 &LLPipeline::toggleRenderDebugControl,
1364 (void*)LLPipeline::RENDER_DEBUG_SHAME));
1360 sub_menu->append(new LLMenuItemCheckGL("Texture Area (sqrt(A))",&LLPipeline::toggleRenderDebug, NULL, 1365 sub_menu->append(new LLMenuItemCheckGL("Texture Area (sqrt(A))",&LLPipeline::toggleRenderDebug, NULL,
1361 &LLPipeline::toggleRenderDebugControl, 1366 &LLPipeline::toggleRenderDebugControl,
1362 (void*)LLPipeline::RENDER_DEBUG_TEXTURE_AREA)); 1367 (void*)LLPipeline::RENDER_DEBUG_TEXTURE_AREA));
@@ -1386,7 +1391,7 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1386 (void*)"ShowDepthBuffer")); 1391 (void*)"ShowDepthBuffer"));
1387 sub_menu->append(new LLMenuItemToggleGL("Show Select Buffer", &gDebugSelect)); 1392 sub_menu->append(new LLMenuItemToggleGL("Show Select Buffer", &gDebugSelect));
1388 1393
1389 sub_menu->append(new LLMenuItemToggleGL("Vectorize Perf Test", &gVectorizePerfTest)); 1394 sub_menu->append(new LLMenuItemCallGL("Vectorize Perf Test", &run_vectorize_perf_test));
1390 1395
1391 sub_menu = new LLMenuGL("Render Tests"); 1396 sub_menu = new LLMenuGL("Render Tests");
1392 1397
@@ -1422,7 +1427,7 @@ void init_debug_rendering_menu(LLMenuGL* menu)
1422 1427
1423 LLMenuItemCheckGL* item; 1428 LLMenuItemCheckGL* item;
1424 item = new LLMenuItemCheckGL("Object-Object Occlusion", menu_toggle_control, NULL, menu_check_control, (void*)"UseOcclusion", 'O', MASK_CONTROL|MASK_SHIFT); 1429 item = new LLMenuItemCheckGL("Object-Object Occlusion", menu_toggle_control, NULL, menu_check_control, (void*)"UseOcclusion", 'O', MASK_CONTROL|MASK_SHIFT);
1425 item->setEnabled(gGLManager.mHasOcclusionQuery && gFeatureManagerp->isFeatureAvailable("UseOcclusion")); 1430 item->setEnabled(gGLManager.mHasOcclusionQuery && LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion"));
1426 menu->append(item); 1431 menu->append(item);
1427 1432
1428 item = new LLMenuItemCheckGL("Fast Alpha", menu_toggle_control, NULL, menu_check_control, (void*)"RenderFastAlpha"); 1433 item = new LLMenuItemCheckGL("Fast Alpha", menu_toggle_control, NULL, menu_check_control, (void*)"RenderFastAlpha");
@@ -1485,6 +1490,7 @@ void init_debug_avatar_menu(LLMenuGL* menu)
1485 1490
1486 menu->appendMenu(sub_menu); 1491 menu->appendMenu(sub_menu);
1487 1492
1493 menu->append(new LLMenuItemToggleGL("Tap-Tap-Hold To Run", &gAllowTapTapHoldRun));
1488 menu->append(new LLMenuItemCallGL("Force Params to Default", &LLAgent::clearVisualParams, NULL)); 1494 menu->append(new LLMenuItemCallGL("Force Params to Default", &LLAgent::clearVisualParams, NULL));
1489 menu->append(new LLMenuItemCallGL("Reload Vertex Shader", &reload_vertex_shader, NULL)); 1495 menu->append(new LLMenuItemCallGL("Reload Vertex Shader", &reload_vertex_shader, NULL));
1490 menu->append(new LLMenuItemToggleGL("Animation Info", &LLVOAvatar::sShowAnimationDebug)); 1496 menu->append(new LLMenuItemToggleGL("Animation Info", &LLVOAvatar::sShowAnimationDebug));
@@ -1734,7 +1740,7 @@ class LLObjectEnableTouch : public view_listener_t
1734 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 1740 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
1735 1741
1736 // Update label based on the node touch name if available. 1742 // Update label based on the node touch name if available.
1737 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); 1743 LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
1738 if (node && node->mValid && !node->mTouchName.empty()) 1744 if (node && node->mValid && !node->mTouchName.empty())
1739 { 1745 {
1740 gMenuHolder->childSetText("Object Touch", node->mTouchName); 1746 gMenuHolder->childSetText("Object Touch", node->mTouchName);
@@ -1750,7 +1756,7 @@ class LLObjectEnableTouch : public view_listener_t
1750 1756
1751void label_touch(LLString& label, void*) 1757void label_touch(LLString& label, void*)
1752{ 1758{
1753 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); 1759 LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
1754 if (node && node->mValid && !node->mTouchName.empty()) 1760 if (node && node->mValid && !node->mTouchName.empty())
1755 { 1761 {
1756 label.assign(node->mTouchName); 1762 label.assign(node->mTouchName);
@@ -1802,7 +1808,7 @@ class LLViewCheckBuildMode : public view_listener_t
1802{ 1808{
1803 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 1809 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
1804 { 1810 {
1805 bool new_value = gToolMgr->inEdit(); 1811 bool new_value = LLToolMgr::getInstance()->inEdit();
1806 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 1812 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
1807 return true; 1813 return true;
1808 } 1814 }
@@ -1810,13 +1816,21 @@ class LLViewCheckBuildMode : public view_listener_t
1810 1816
1811bool toggle_build_mode() 1817bool toggle_build_mode()
1812{ 1818{
1813 if (gToolMgr->inEdit()) 1819 if (LLToolMgr::getInstance()->inEdit())
1814 { 1820 {
1815 // just reset the view, will pull us out of edit mode 1821 // just reset the view, will pull us out of edit mode
1816 handle_reset_view(); 1822 handle_reset_view();
1823
1824 // avoid spurious avatar movements pulling out of edit mode
1825 LLViewerJoystick::getInstance()->moveAvatar(true);
1817 } 1826 }
1818 else 1827 else
1819 { 1828 {
1829 if (LLViewerJoystick::getInstance()->getOverrideCamera())
1830 {
1831 handle_toggle_flycam();
1832 }
1833
1820 if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") ) 1834 if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") )
1821 { 1835 {
1822 // zoom in if we're looking at the avatar 1836 // zoom in if we're looking at the avatar
@@ -1826,8 +1840,8 @@ bool toggle_build_mode()
1826 gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); 1840 gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD );
1827 } 1841 }
1828 1842
1829 gToolMgr->setCurrentToolset(gBasicToolset); 1843 LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
1830 gToolMgr->getCurrentToolset()->selectTool( gToolCreate ); 1844 LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() );
1831 1845
1832 // Could be first use 1846 // Could be first use
1833 LLFirstUse::useBuild(); 1847 LLFirstUse::useBuild();
@@ -1844,11 +1858,35 @@ class LLViewBuildMode : public view_listener_t
1844}; 1858};
1845 1859
1846 1860
1861class LLViewJoystickFlycam : public view_listener_t
1862{
1863 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
1864 {
1865 handle_toggle_flycam();
1866 return true;
1867 }
1868};
1869
1870class LLViewCheckJoystickFlycam : public view_listener_t
1871{
1872 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
1873 {
1874 bool new_val = LLViewerJoystick::getInstance()->getOverrideCamera();
1875 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_val);
1876 return true;
1877 }
1878};
1879
1880void handle_toggle_flycam()
1881{
1882 LLViewerJoystick::getInstance()->toggleFlycam();
1883}
1884
1847class LLObjectBuild : public view_listener_t 1885class LLObjectBuild : public view_listener_t
1848{ 1886{
1849 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 1887 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
1850 { 1888 {
1851 if (gAgent.getFocusOnAvatar() && !gToolMgr->inEdit() && gSavedSettings.getBOOL("EditCameraMovement") ) 1889 if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit() && gSavedSettings.getBOOL("EditCameraMovement") )
1852 { 1890 {
1853 // zoom in if we're looking at the avatar 1891 // zoom in if we're looking at the avatar
1854 gAgent.setFocusOnAvatar(FALSE, ANIMATE); 1892 gAgent.setFocusOnAvatar(FALSE, ANIMATE);
@@ -1863,8 +1901,8 @@ class LLObjectBuild : public view_listener_t
1863 gViewerWindow->moveCursorToCenter(); 1901 gViewerWindow->moveCursorToCenter();
1864 } 1902 }
1865 1903
1866 gToolMgr->setCurrentToolset(gBasicToolset); 1904 LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
1867 gToolMgr->getCurrentToolset()->selectTool( gToolCreate ); 1905 LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() );
1868 1906
1869 // Could be first use 1907 // Could be first use
1870 LLFirstUse::useBuild(); 1908 LLFirstUse::useBuild();
@@ -1876,11 +1914,11 @@ class LLObjectEdit : public view_listener_t
1876{ 1914{
1877 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 1915 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
1878 { 1916 {
1879 gParcelMgr->deselectLand(); 1917 LLViewerParcelMgr::getInstance()->deselectLand();
1880 1918
1881 if (gAgent.getFocusOnAvatar() && !gToolMgr->inEdit()) 1919 if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit())
1882 { 1920 {
1883 LLObjectSelectionHandle selection = gSelectMgr->getSelection(); 1921 LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
1884 1922
1885 if (selection->getSelectType() == SELECT_TYPE_HUD || !gSavedSettings.getBOOL("EditCameraMovement")) 1923 if (selection->getSelectType() == SELECT_TYPE_HUD || !gSavedSettings.getBOOL("EditCameraMovement"))
1886 { 1924 {
@@ -1902,8 +1940,11 @@ class LLObjectEdit : public view_listener_t
1902 1940
1903 gFloaterTools->open(); /* Flawfinder: ignore */ 1941 gFloaterTools->open(); /* Flawfinder: ignore */
1904 1942
1905 gToolMgr->setCurrentToolset(gBasicToolset); 1943 LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
1906 gFloaterTools->setEditTool( gToolTranslate ); 1944 gFloaterTools->setEditTool( LLToolCompTranslate::getInstance() );
1945
1946 LLViewerJoystick::getInstance()->moveObjects(true);
1947 LLViewerJoystick::getInstance()->setNeedsReset(true);
1907 1948
1908 // Could be first use 1949 // Could be first use
1909 LLFirstUse::useBuild(); 1950 LLFirstUse::useBuild();
@@ -1928,9 +1969,9 @@ class LLLandBuild : public view_listener_t
1928{ 1969{
1929 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 1970 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
1930 { 1971 {
1931 gParcelMgr->deselectLand(); 1972 LLViewerParcelMgr::getInstance()->deselectLand();
1932 1973
1933 if (gAgent.getFocusOnAvatar() && !gToolMgr->inEdit() && gSavedSettings.getBOOL("EditCameraMovement") ) 1974 if (gAgent.getFocusOnAvatar() && !LLToolMgr::getInstance()->inEdit() && gSavedSettings.getBOOL("EditCameraMovement") )
1934 { 1975 {
1935 // zoom in if we're looking at the avatar 1976 // zoom in if we're looking at the avatar
1936 gAgent.setFocusOnAvatar(FALSE, ANIMATE); 1977 gAgent.setFocusOnAvatar(FALSE, ANIMATE);
@@ -1947,8 +1988,8 @@ class LLLandBuild : public view_listener_t
1947 } 1988 }
1948 1989
1949 1990
1950 gToolMgr->setCurrentToolset(gBasicToolset); 1991 LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
1951 gToolMgr->getCurrentToolset()->selectTool( gToolCreate ); 1992 LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() );
1952 1993
1953 // Could be first use 1994 // Could be first use
1954 LLFirstUse::useBuild(); 1995 LLFirstUse::useBuild();
@@ -1982,7 +2023,7 @@ BOOL enable_land_build(void*)
1982 if (gAgent.inPrelude()) return FALSE; 2023 if (gAgent.inPrelude()) return FALSE;
1983 2024
1984 BOOL can_build = FALSE; 2025 BOOL can_build = FALSE;
1985 LLParcel* agent_parcel = gParcelMgr->getAgentParcel(); 2026 LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
1986 if (agent_parcel) 2027 if (agent_parcel)
1987 { 2028 {
1988 can_build = agent_parcel->getAllowModify(); 2029 can_build = agent_parcel->getAllowModify();
@@ -1997,7 +2038,7 @@ BOOL enable_object_build(void*)
1997 if (gAgent.inPrelude()) return FALSE; 2038 if (gAgent.inPrelude()) return FALSE;
1998 2039
1999 BOOL can_build = FALSE; 2040 BOOL can_build = FALSE;
2000 LLParcel* agent_parcel = gParcelMgr->getAgentParcel(); 2041 LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
2001 if (agent_parcel) 2042 if (agent_parcel)
2002 { 2043 {
2003 can_build = agent_parcel->getAllowModify(); 2044 can_build = agent_parcel->getAllowModify();
@@ -2118,7 +2159,7 @@ class LLObjectMute : public view_listener_t
2118 // it's an object 2159 // it's an object
2119 id = object->getID(); 2160 id = object->getID();
2120 2161
2121 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); 2162 LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
2122 if (node) 2163 if (node)
2123 { 2164 {
2124 name = node->mName; 2165 name = node->mName;
@@ -2128,13 +2169,13 @@ class LLObjectMute : public view_listener_t
2128 } 2169 }
2129 2170
2130 LLMute mute(id, name, type); 2171 LLMute mute(id, name, type);
2131 if (gMuteListp->isMuted(mute.mID, mute.mName)) 2172 if (LLMuteList::getInstance()->isMuted(mute.mID, mute.mName))
2132 { 2173 {
2133 gMuteListp->remove(mute); 2174 LLMuteList::getInstance()->remove(mute);
2134 } 2175 }
2135 else 2176 else
2136 { 2177 {
2137 gMuteListp->add(mute); 2178 LLMuteList::getInstance()->add(mute);
2138 LLFloaterMute::showInstance(); 2179 LLFloaterMute::showInstance();
2139 } 2180 }
2140 2181
@@ -2155,7 +2196,7 @@ bool handle_go_to()
2155 strings.push_back(val); 2196 strings.push_back(val);
2156 send_generic_message("autopilot", strings); 2197 send_generic_message("autopilot", strings);
2157 2198
2158 gParcelMgr->deselectLand(); 2199 LLViewerParcelMgr::getInstance()->deselectLand();
2159 2200
2160 if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera")) 2201 if (gAgent.getAvatarObject() && !gSavedSettings.getBOOL("AutoPilotLocksCamera"))
2161 { 2202 {
@@ -2224,10 +2265,23 @@ class LLAvatarFreeze : public view_listener_t
2224 if( avatar ) 2265 if( avatar )
2225 { 2266 {
2226 LLUUID* avatar_id = new LLUUID( avatar->getID() ); 2267 LLUUID* avatar_id = new LLUUID( avatar->getID() );
2268 LLString fullname = avatar->getFullname();
2227 2269
2228 gViewerWindow->alertXml("FreezeAvatar", 2270 if (!fullname.empty())
2229 callback_freeze, (void*)avatar_id); 2271 {
2230 2272 LLString::format_map_t args;
2273 args["[AVATAR_NAME]"] = fullname;
2274 gViewerWindow->alertXml("FreezeAvatarFullname",
2275 args,
2276 callback_freeze,
2277 (void*)avatar_id);
2278 }
2279 else
2280 {
2281 gViewerWindow->alertXml("FreezeAvatar",
2282 callback_freeze,
2283 (void*)avatar_id);
2284 }
2231 } 2285 }
2232 return true; 2286 return true;
2233 } 2287 }
@@ -2313,9 +2367,23 @@ class LLAvatarEject : public view_listener_t
2313 if( avatar ) 2367 if( avatar )
2314 { 2368 {
2315 LLUUID* avatar_id = new LLUUID( avatar->getID() ); 2369 LLUUID* avatar_id = new LLUUID( avatar->getID() );
2316 gViewerWindow->alertXml("EjectAvatar", 2370 LLString fullname = avatar->getFullname();
2317 callback_eject, (void*)avatar_id); 2371
2318 2372 if (!fullname.empty())
2373 {
2374 LLString::format_map_t args;
2375 args["[AVATAR_NAME]"] = fullname;
2376 gViewerWindow->alertXml("EjectAvatarFullname",
2377 args,
2378 callback_eject,
2379 (void*)avatar_id);
2380 }
2381 else
2382 {
2383 gViewerWindow->alertXml("EjectAvatar",
2384 callback_eject,
2385 (void*)avatar_id);
2386 }
2319 } 2387 }
2320 return true; 2388 return true;
2321 } 2389 }
@@ -2484,9 +2552,9 @@ BOOL enable_buy(void*)
2484{ 2552{
2485 // In order to buy, there must only be 1 purchaseable object in 2553 // In order to buy, there must only be 1 purchaseable object in
2486 // the selection manger. 2554 // the selection manger.
2487 if(gSelectMgr->getSelection()->getRootObjectCount() != 1) return FALSE; 2555 if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 1) return FALSE;
2488 LLViewerObject* obj = NULL; 2556 LLViewerObject* obj = NULL;
2489 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); 2557 LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
2490 if(node) 2558 if(node)
2491 { 2559 {
2492 obj = node->getObject(); 2560 obj = node->getObject();
@@ -2515,7 +2583,7 @@ class LLObjectEnableBuy : public view_listener_t
2515// received by the viewer and cached in the selection manager. 2583// received by the viewer and cached in the selection manager.
2516void handle_buy_object(LLSaleInfo sale_info) 2584void handle_buy_object(LLSaleInfo sale_info)
2517{ 2585{
2518 if(!gSelectMgr->selectGetAllRootsValid()) 2586 if(!LLSelectMgr::getInstance()->selectGetAllRootsValid())
2519 { 2587 {
2520 LLNotifyBox::showXml("UnableToBuyWhileDownloading"); 2588 LLNotifyBox::showXml("UnableToBuyWhileDownloading");
2521 return; 2589 return;
@@ -2523,7 +2591,7 @@ void handle_buy_object(LLSaleInfo sale_info)
2523 2591
2524 LLUUID owner_id; 2592 LLUUID owner_id;
2525 LLString owner_name; 2593 LLString owner_name;
2526 BOOL owners_identical = gSelectMgr->selectGetOwner(owner_id, owner_name); 2594 BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name);
2527 if (!owners_identical) 2595 if (!owners_identical)
2528 { 2596 {
2529 LLNotifyBox::showXml("CannotBuyObjectsFromDifferentOwners"); 2597 LLNotifyBox::showXml("CannotBuyObjectsFromDifferentOwners");
@@ -2531,9 +2599,9 @@ void handle_buy_object(LLSaleInfo sale_info)
2531 } 2599 }
2532 2600
2533 LLPermissions perm; 2601 LLPermissions perm;
2534 BOOL valid = gSelectMgr->selectGetPermissions(perm); 2602 BOOL valid = LLSelectMgr::getInstance()->selectGetPermissions(perm);
2535 LLAggregatePermissions ag_perm; 2603 LLAggregatePermissions ag_perm;
2536 valid &= gSelectMgr->selectGetAggregatePermissions(ag_perm); 2604 valid &= LLSelectMgr::getInstance()->selectGetAggregatePermissions(ag_perm);
2537 if(!valid || !sale_info.isForSale() || !perm.allowTransferTo(gAgent.getID())) 2605 if(!valid || !sale_info.isForSale() || !perm.allowTransferTo(gAgent.getID()))
2538 { 2606 {
2539 LLNotifyBox::showXml("ObjectNotForSale"); 2607 LLNotifyBox::showXml("ObjectNotForSale");
@@ -2670,14 +2738,14 @@ void set_god_level(U8 god_level)
2670 U8 old_god_level = gAgent.getGodLevel(); 2738 U8 old_god_level = gAgent.getGodLevel();
2671 gAgent.setGodLevel( god_level ); 2739 gAgent.setGodLevel( god_level );
2672 gIMMgr->refresh(); 2740 gIMMgr->refresh();
2673 gParcelMgr->notifyObservers(); 2741 LLViewerParcelMgr::getInstance()->notifyObservers();
2674 2742
2675 // Some classifieds change visibility on god mode 2743 // Some classifieds change visibility on god mode
2676 LLFloaterDirectory::requestClassifieds(); 2744 LLFloaterDirectory::requestClassifieds();
2677 2745
2678 // God mode changes sim visibility 2746 // God mode changes sim visibility
2679 gWorldMap->reset(); 2747 LLWorldMap::getInstance()->reset();
2680 gWorldMap->setCurrentLayer(0); 2748 LLWorldMap::getInstance()->setCurrentLayer(0);
2681 2749
2682 // inventory in items may change in god mode 2750 // inventory in items may change in god mode
2683 gObjectList.dirtyAllObjectInventory(); 2751 gObjectList.dirtyAllObjectInventory();
@@ -2943,7 +3011,7 @@ class LLLandSit : public view_listener_t
2943 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 3011 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
2944 { 3012 {
2945 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); 3013 gAgent.setControlFlags(AGENT_CONTROL_STAND_UP);
2946 gParcelMgr->deselectLand(); 3014 LLViewerParcelMgr::getInstance()->deselectLand();
2947 3015
2948 LLVector3d posGlobal = gLastHitPosGlobal; 3016 LLVector3d posGlobal = gLastHitPosGlobal;
2949 3017
@@ -3043,7 +3111,7 @@ void create_new_landmark(void*)
3043 llwarns << "No agent region" << llendl; 3111 llwarns << "No agent region" << llendl;
3044 return; 3112 return;
3045 } 3113 }
3046 LLParcel* agent_parcel = gParcelMgr->getAgentParcel(); 3114 LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
3047 if (!agent_parcel) 3115 if (!agent_parcel)
3048 { 3116 {
3049 llwarns << "No agent parcel" << llendl; 3117 llwarns << "No agent parcel" << llendl;
@@ -3083,7 +3151,7 @@ void landmark_menu_action(void* userdata)
3083 3151
3084void reload_ui(void *) 3152void reload_ui(void *)
3085{ 3153{
3086 gUICtrlFactory->rebuild(); 3154 LLUICtrlFactory::getInstance()->rebuild();
3087} 3155}
3088 3156
3089class LLWorldFly : public view_listener_t 3157class LLWorldFly : public view_listener_t
@@ -3106,7 +3174,7 @@ void handle_agent_stop_moving(void*)
3106 3174
3107void print_packets_lost(void*) 3175void print_packets_lost(void*)
3108{ 3176{
3109 gWorldPointer->printPacketsLost(); 3177 LLWorld::getInstance()->printPacketsLost();
3110} 3178}
3111 3179
3112 3180
@@ -3155,7 +3223,7 @@ void velocity_interpolate( void* data )
3155 3223
3156void update_fov(S32 increments) 3224void update_fov(S32 increments)
3157{ 3225{
3158 F32 old_fov = gCamera->getDefaultFOV(); 3226 F32 old_fov = LLViewerCamera::getInstance()->getDefaultFOV();
3159 // for each increment, FoV is 20% bigger 3227 // for each increment, FoV is 20% bigger
3160 F32 new_fov = old_fov * pow(1.2f, increments); 3228 F32 new_fov = old_fov * pow(1.2f, increments);
3161 3229
@@ -3178,8 +3246,8 @@ void update_fov(S32 increments)
3178 gAgent.sendReliableMessage(); 3246 gAgent.sendReliableMessage();
3179 3247
3180 // force agent to update dirty patches 3248 // force agent to update dirty patches
3181 gCamera->setDefaultFOV(new_fov); 3249 LLViewerCamera::getInstance()->setDefaultFOV(new_fov);
3182 gCamera->setView(new_fov); 3250 LLViewerCamera::getInstance()->setView(new_fov);
3183 } 3251 }
3184} 3252}
3185 3253
@@ -3205,7 +3273,7 @@ class LLViewZoomDefault : public view_listener_t
3205{ 3273{
3206 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 3274 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
3207 { 3275 {
3208 F32 old_fov = gCamera->getView(); 3276 F32 old_fov = LLViewerCamera::getInstance()->getView();
3209 // for each increment, FoV is 20% bigger 3277 // for each increment, FoV is 20% bigger
3210 F32 new_fov = DEFAULT_FIELD_OF_VIEW; 3278 F32 new_fov = DEFAULT_FIELD_OF_VIEW;
3211 3279
@@ -3224,8 +3292,8 @@ class LLViewZoomDefault : public view_listener_t
3224 gAgent.sendReliableMessage(); 3292 gAgent.sendReliableMessage();
3225 3293
3226 // force agent to update dirty patches 3294 // force agent to update dirty patches
3227 gCamera->setDefaultFOV(new_fov); 3295 LLViewerCamera::getInstance()->setDefaultFOV(new_fov);
3228 gCamera->setView(new_fov); 3296 LLViewerCamera::getInstance()->setView(new_fov);
3229 } 3297 }
3230 return true; 3298 return true;
3231 } 3299 }
@@ -3262,17 +3330,6 @@ void handle_show_newest_map(void*)
3262// Help menu functions 3330// Help menu functions
3263//------------------------------------------------------------------- 3331//-------------------------------------------------------------------
3264 3332
3265class LLHelpMOTD : public view_listener_t
3266{
3267 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
3268 {
3269 LLString::format_map_t args;
3270 args["[MOTD]"] = gAgent.mMOTD;
3271 gViewerWindow->alertXml("MOTD", args, NULL, NULL);
3272 return true;
3273 }
3274};
3275
3276// 3333//
3277// Major mode switching 3334// Major mode switching
3278// 3335//
@@ -3310,9 +3367,15 @@ void reset_view_final( BOOL proceed, void* )
3310 3367
3311 gAgent.changeCameraToDefault(); 3368 gAgent.changeCameraToDefault();
3312 3369
3313 if (LLViewerJoystick::sOverrideCamera) 3370 if (LLViewerJoystick::getInstance()->getOverrideCamera())
3314 { 3371 {
3315 handle_toggle_flycam(NULL); 3372 handle_toggle_flycam();
3373 }
3374
3375 // reset avatar mode from eventual residual motion
3376 if (LLToolMgr::getInstance()->inBuildMode())
3377 {
3378 LLViewerJoystick::getInstance()->moveAvatar(true);
3316 } 3379 }
3317 3380
3318 gAgent.resetView(!gFloaterTools->getVisible()); 3381 gAgent.resetView(!gFloaterTools->getVisible());
@@ -3321,7 +3384,7 @@ void reset_view_final( BOOL proceed, void* )
3321 gViewerWindow->showCursor(); 3384 gViewerWindow->showCursor();
3322 3385
3323 // Switch back to basic toolset 3386 // Switch back to basic toolset
3324 gToolMgr->setCurrentToolset(gBasicToolset); 3387 LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
3325} 3388}
3326 3389
3327class LLViewLookAtLastChatter : public view_listener_t 3390class LLViewLookAtLastChatter : public view_listener_t
@@ -3394,7 +3457,7 @@ class LLEditEnableDuplicate : public view_listener_t
3394 3457
3395void disabled_duplicate(void*) 3458void disabled_duplicate(void*)
3396{ 3459{
3397 if (gSelectMgr->getSelection()->getFirstObject()) 3460 if (LLSelectMgr::getInstance()->getSelection()->getFirstObject())
3398 { 3461 {
3399 LLNotifyBox::showXml("CopyFailed"); 3462 LLNotifyBox::showXml("CopyFailed");
3400 } 3463 }
@@ -3405,32 +3468,32 @@ void handle_duplicate_in_place(void*)
3405 llinfos << "handle_duplicate_in_place" << llendl; 3468 llinfos << "handle_duplicate_in_place" << llendl;
3406 3469
3407 LLVector3 offset(0.f, 0.f, 0.f); 3470 LLVector3 offset(0.f, 0.f, 0.f);
3408 gSelectMgr->selectDuplicate(offset, TRUE); 3471 LLSelectMgr::getInstance()->selectDuplicate(offset, TRUE);
3409} 3472}
3410 3473
3411void handle_repeat_duplicate(void*) 3474void handle_repeat_duplicate(void*)
3412{ 3475{
3413 gSelectMgr->repeatDuplicate(); 3476 LLSelectMgr::getInstance()->repeatDuplicate();
3414} 3477}
3415 3478
3416void handle_deed_object_to_group(void*) 3479void handle_deed_object_to_group(void*)
3417{ 3480{
3418 LLUUID group_id; 3481 LLUUID group_id;
3419 3482
3420 gSelectMgr->selectGetGroup(group_id); 3483 LLSelectMgr::getInstance()->selectGetGroup(group_id);
3421 gSelectMgr->sendOwner(LLUUID::null, group_id, FALSE); 3484 LLSelectMgr::getInstance()->sendOwner(LLUUID::null, group_id, FALSE);
3422 gViewerStats->incStat(LLViewerStats::ST_RELEASE_COUNT); 3485 LLViewerStats::getInstance()->incStat(LLViewerStats::ST_RELEASE_COUNT);
3423} 3486}
3424 3487
3425BOOL enable_deed_object_to_group(void*) 3488BOOL enable_deed_object_to_group(void*)
3426{ 3489{
3427 if(gSelectMgr->getSelection()->isEmpty()) return FALSE; 3490 if(LLSelectMgr::getInstance()->getSelection()->isEmpty()) return FALSE;
3428 LLPermissions perm; 3491 LLPermissions perm;
3429 LLUUID group_id; 3492 LLUUID group_id;
3430 3493
3431 if (gSelectMgr->selectGetGroup(group_id) && 3494 if (LLSelectMgr::getInstance()->selectGetGroup(group_id) &&
3432 gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) && 3495 gAgent.hasPowerInGroup(group_id, GP_OBJECT_DEED) &&
3433 gSelectMgr->selectGetPermissions(perm) && 3496 LLSelectMgr::getInstance()->selectGetPermissions(perm) &&
3434 perm.deedToGroup(gAgent.getID(), group_id)) 3497 perm.deedToGroup(gAgent.getID(), group_id))
3435 { 3498 {
3436 return TRUE; 3499 return TRUE;
@@ -3483,8 +3546,8 @@ void handle_object_owner_permissive(void*)
3483 if(gAgent.isGodlike()) 3546 if(gAgent.isGodlike())
3484 { 3547 {
3485 // do the objects. 3548 // do the objects.
3486 gSelectMgr->selectionSetObjectPermissions(PERM_BASE, TRUE, PERM_ALL, TRUE); 3549 LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_BASE, TRUE, PERM_ALL, TRUE);
3487 gSelectMgr->selectionSetObjectPermissions(PERM_OWNER, TRUE, PERM_ALL, TRUE); 3550 LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_OWNER, TRUE, PERM_ALL, TRUE);
3488 } 3551 }
3489} 3552}
3490 3553
@@ -3493,14 +3556,14 @@ void handle_object_owner_self(void*)
3493 // only send this if they're a god. 3556 // only send this if they're a god.
3494 if(gAgent.isGodlike()) 3557 if(gAgent.isGodlike())
3495 { 3558 {
3496 gSelectMgr->sendOwner(gAgent.getID(), gAgent.getGroupID(), TRUE); 3559 LLSelectMgr::getInstance()->sendOwner(gAgent.getID(), gAgent.getGroupID(), TRUE);
3497 } 3560 }
3498} 3561}
3499 3562
3500// Shortcut to set owner permissions to not editable. 3563// Shortcut to set owner permissions to not editable.
3501void handle_object_lock(void*) 3564void handle_object_lock(void*)
3502{ 3565{
3503 gSelectMgr->selectionSetObjectPermissions(PERM_OWNER, FALSE, PERM_MODIFY); 3566 LLSelectMgr::getInstance()->selectionSetObjectPermissions(PERM_OWNER, FALSE, PERM_MODIFY);
3504} 3567}
3505 3568
3506void handle_object_asset_ids(void*) 3569void handle_object_asset_ids(void*)
@@ -3508,23 +3571,23 @@ void handle_object_asset_ids(void*)
3508 // only send this if they're a god. 3571 // only send this if they're a god.
3509 if (gAgent.isGodlike()) 3572 if (gAgent.isGodlike())
3510 { 3573 {
3511 gSelectMgr->sendGodlikeRequest("objectinfo", "assetids"); 3574 LLSelectMgr::getInstance()->sendGodlikeRequest("objectinfo", "assetids");
3512 } 3575 }
3513} 3576}
3514 3577
3515void handle_force_parcel_owner_to_me(void*) 3578void handle_force_parcel_owner_to_me(void*)
3516{ 3579{
3517 gParcelMgr->sendParcelGodForceOwner( gAgent.getID() ); 3580 LLViewerParcelMgr::getInstance()->sendParcelGodForceOwner( gAgent.getID() );
3518} 3581}
3519 3582
3520void handle_force_parcel_to_content(void*) 3583void handle_force_parcel_to_content(void*)
3521{ 3584{
3522 gParcelMgr->sendParcelGodForceToContent(); 3585 LLViewerParcelMgr::getInstance()->sendParcelGodForceToContent();
3523} 3586}
3524 3587
3525void handle_claim_public_land(void*) 3588void handle_claim_public_land(void*)
3526{ 3589{
3527 if (gParcelMgr->getSelectionRegion() != gAgent.getRegion()) 3590 if (LLViewerParcelMgr::getInstance()->getSelectionRegion() != gAgent.getRegion())
3528 { 3591 {
3529 LLNotifyBox::showXml("ClaimPublicLand"); 3592 LLNotifyBox::showXml("ClaimPublicLand");
3530 return; 3593 return;
@@ -3532,7 +3595,7 @@ void handle_claim_public_land(void*)
3532 3595
3533 LLVector3d west_south_global; 3596 LLVector3d west_south_global;
3534 LLVector3d east_north_global; 3597 LLVector3d east_north_global;
3535 gParcelMgr->getSelection(west_south_global, east_north_global); 3598 LLViewerParcelMgr::getInstance()->getSelection(west_south_global, east_north_global);
3536 LLVector3 west_south = gAgent.getPosAgentFromGlobal(west_south_global); 3599 LLVector3 west_south = gAgent.getPosAgentFromGlobal(west_south_global);
3537 LLVector3 east_north = gAgent.getPosAgentFromGlobal(east_north_global); 3600 LLVector3 east_north = gAgent.getPosAgentFromGlobal(east_north_global);
3538 3601
@@ -3565,7 +3628,7 @@ void handle_god_request_havok(void *)
3565{ 3628{
3566 if (gAgent.isGodlike()) 3629 if (gAgent.isGodlike())
3567 { 3630 {
3568 gSelectMgr->sendGodlikeRequest("havok", "infoverbose"); 3631 LLSelectMgr::getInstance()->sendGodlikeRequest("havok", "infoverbose");
3569 } 3632 }
3570} 3633}
3571 3634
@@ -3573,7 +3636,7 @@ void handle_god_request_havok(void *)
3573//{ 3636//{
3574// if (gAgent.isGodlike()) 3637// if (gAgent.isGodlike())
3575// { 3638// {
3576// gSelectMgr->sendGodlikeRequest(GOD_WANTS_FOO); 3639// LLSelectMgr::getInstance()->sendGodlikeRequest(GOD_WANTS_FOO);
3577// } 3640// }
3578//} 3641//}
3579 3642
@@ -3581,7 +3644,7 @@ void handle_god_request_havok(void *)
3581//{ 3644//{
3582// if (gAgent.isGodlike()) 3645// if (gAgent.isGodlike())
3583// { 3646// {
3584// gSelectMgr->sendGodlikeRequest("terrain", "save"); 3647// LLSelectMgr::getInstance()->sendGodlikeRequest("terrain", "save");
3585// } 3648// }
3586//} 3649//}
3587 3650
@@ -3589,7 +3652,7 @@ void handle_god_request_havok(void *)
3589//{ 3652//{
3590// if (gAgent.isGodlike()) 3653// if (gAgent.isGodlike())
3591// { 3654// {
3592// gSelectMgr->sendGodlikeRequest("terrain", "load"); 3655// LLSelectMgr::getInstance()->sendGodlikeRequest("terrain", "load");
3593// } 3656// }
3594//} 3657//}
3595 3658
@@ -3599,7 +3662,7 @@ void handle_god_request_avatar_geometry(void *)
3599{ 3662{
3600 if (gAgent.isGodlike()) 3663 if (gAgent.isGodlike())
3601 { 3664 {
3602 gSelectMgr->sendGodlikeRequest("avatar toggle", NULL); 3665 LLSelectMgr::getInstance()->sendGodlikeRequest("avatar toggle", NULL);
3603 } 3666 }
3604} 3667}
3605 3668
@@ -3624,8 +3687,8 @@ void derez_objects(EDeRezDestination dest, const LLUUID& dest_id)
3624 // Check conditions that we can't deal with, building a list of 3687 // Check conditions that we can't deal with, building a list of
3625 // everything that we'll actually be derezzing. 3688 // everything that we'll actually be derezzing.
3626 LLViewerRegion* first_region = NULL; 3689 LLViewerRegion* first_region = NULL;
3627 for (LLObjectSelection::valid_root_iterator iter = gSelectMgr->getSelection()->valid_root_begin(); 3690 for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin();
3628 iter != gSelectMgr->getSelection()->valid_root_end(); iter++) 3691 iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++)
3629 { 3692 {
3630 LLSelectNode* node = *iter; 3693 LLSelectNode* node = *iter;
3631 LLViewerObject* object = node->getObject(); 3694 LLViewerObject* object = node->getObject();
@@ -3742,7 +3805,7 @@ void derez_objects(EDeRezDestination dest, const LLUUID& dest_id)
3742 msg->nextBlockFast(_PREHASH_ObjectData); 3805 msg->nextBlockFast(_PREHASH_ObjectData);
3743 msg->addU32Fast(_PREHASH_ObjectLocalID, object->getLocalID()); 3806 msg->addU32Fast(_PREHASH_ObjectLocalID, object->getLocalID());
3744 // VEFFECT: DerezObject 3807 // VEFFECT: DerezObject
3745 LLHUDEffectSpiral* effectp = (LLHUDEffectSpiral*)gHUDManager->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE); 3808 LLHUDEffectSpiral* effectp = (LLHUDEffectSpiral*)LLHUDManager::getInstance()->createViewerEffect(LLHUDObject::LL_HUD_EFFECT_POINT, TRUE);
3746 effectp->setPositionGlobal(object->getPositionGlobal()); 3809 effectp->setPositionGlobal(object->getPositionGlobal());
3747 effectp->setColor(LLColor4U(gAgent.getEffectColor())); 3810 effectp->setColor(LLColor4U(gAgent.getEffectColor()));
3748 } 3811 }
@@ -3767,7 +3830,7 @@ class LLToolsTakeCopy : public view_listener_t
3767{ 3830{
3768 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 3831 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
3769 { 3832 {
3770 if (gSelectMgr->getSelection()->isEmpty()) return true; 3833 if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true;
3771 3834
3772 const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); 3835 const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT);
3773 derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id); 3836 derez_objects(DRD_ACQUIRE_TO_AGENT_INVENTORY, category_id);
@@ -3782,9 +3845,9 @@ class LLObjectReturn : public view_listener_t
3782{ 3845{
3783 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 3846 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
3784 { 3847 {
3785 if (gSelectMgr->getSelection()->isEmpty()) return true; 3848 if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return true;
3786 3849
3787 mObjectSelection = gSelectMgr->getEditSelection(); 3850 mObjectSelection = LLSelectMgr::getInstance()->getEditSelection();
3788 3851
3789 gViewerWindow->alertXml("ReturnToOwner", 3852 gViewerWindow->alertXml("ReturnToOwner",
3790 onReturnToOwner, 3853 onReturnToOwner,
@@ -3847,7 +3910,7 @@ class LLObjectEnableReturn : public view_listener_t
3847 } 3910 }
3848 } func; 3911 } func;
3849 const bool firstonly = true; 3912 const bool firstonly = true;
3850 new_value = gSelectMgr->getSelection()->applyToRootObjects(&func, firstonly); 3913 new_value = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly);
3851 } 3914 }
3852 } 3915 }
3853 } 3916 }
@@ -3859,7 +3922,7 @@ class LLObjectEnableReturn : public view_listener_t
3859 3922
3860void force_take_copy(void*) 3923void force_take_copy(void*)
3861{ 3924{
3862 if (gSelectMgr->getSelection()->isEmpty()) return; 3925 if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return;
3863 const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT); 3926 const LLUUID& category_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_OBJECT);
3864 derez_objects(DRD_FORCE_TO_GOD_INVENTORY, category_id); 3927 derez_objects(DRD_FORCE_TO_GOD_INVENTORY, category_id);
3865} 3928}
@@ -3868,7 +3931,7 @@ void handle_take()
3868{ 3931{
3869 // we want to use the folder this was derezzed from if it's 3932 // we want to use the folder this was derezzed from if it's
3870 // available. Otherwise, derez to the normal place. 3933 // available. Otherwise, derez to the normal place.
3871 if(gSelectMgr->getSelection()->isEmpty()) 3934 if(LLSelectMgr::getInstance()->getSelection()->isEmpty())
3872 { 3935 {
3873 return; 3936 return;
3874 } 3937 }
@@ -3877,8 +3940,8 @@ void handle_take()
3877 BOOL locked_but_takeable_object = FALSE; 3940 BOOL locked_but_takeable_object = FALSE;
3878 LLUUID category_id; 3941 LLUUID category_id;
3879 3942
3880 for (LLObjectSelection::root_iterator iter = gSelectMgr->getSelection()->root_begin(); 3943 for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
3881 iter != gSelectMgr->getSelection()->root_end(); iter++) 3944 iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++)
3882 { 3945 {
3883 LLSelectNode* node = *iter; 3946 LLSelectNode* node = *iter;
3884 LLViewerObject* object = node->getObject(); 3947 LLViewerObject* object = node->getObject();
@@ -3994,8 +4057,8 @@ BOOL enable_take()
3994 return FALSE; 4057 return FALSE;
3995 } 4058 }
3996 4059
3997 for (LLObjectSelection::valid_root_iterator iter = gSelectMgr->getSelection()->valid_root_begin(); 4060 for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin();
3998 iter != gSelectMgr->getSelection()->valid_root_end(); iter++) 4061 iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++)
3999 { 4062 {
4000 LLSelectNode* node = *iter; 4063 LLSelectNode* node = *iter;
4001 LLViewerObject* object = node->getObject(); 4064 LLViewerObject* object = node->getObject();
@@ -4030,7 +4093,7 @@ class LLToolsBuyOrTake : public view_listener_t
4030{ 4093{
4031 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4094 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4032 { 4095 {
4033 if (gSelectMgr->getSelection()->isEmpty()) 4096 if (LLSelectMgr::getInstance()->getSelection()->isEmpty())
4034 { 4097 {
4035 return true; 4098 return true;
4036 } 4099 }
@@ -4109,8 +4172,8 @@ class LLToolsEnableBuyOrTake : public view_listener_t
4109// FALSE if selection is a 'take' 4172// FALSE if selection is a 'take'
4110BOOL is_selection_buy_not_take() 4173BOOL is_selection_buy_not_take()
4111{ 4174{
4112 for (LLObjectSelection::root_iterator iter = gSelectMgr->getSelection()->root_begin(); 4175 for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
4113 iter != gSelectMgr->getSelection()->root_end(); iter++) 4176 iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++)
4114 { 4177 {
4115 LLSelectNode* node = *iter; 4178 LLSelectNode* node = *iter;
4116 LLViewerObject* obj = node->getObject(); 4179 LLViewerObject* obj = node->getObject();
@@ -4127,8 +4190,8 @@ BOOL is_selection_buy_not_take()
4127S32 selection_price() 4190S32 selection_price()
4128{ 4191{
4129 S32 total_price = 0; 4192 S32 total_price = 0;
4130 for (LLObjectSelection::root_iterator iter = gSelectMgr->getSelection()->root_begin(); 4193 for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
4131 iter != gSelectMgr->getSelection()->root_end(); iter++) 4194 iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++)
4132 { 4195 {
4133 LLSelectNode* node = *iter; 4196 LLSelectNode* node = *iter;
4134 LLViewerObject* obj = node->getObject(); 4197 LLViewerObject* obj = node->getObject();
@@ -4181,10 +4244,10 @@ void handle_buy_currency(void*)
4181 4244
4182void handle_buy(void*) 4245void handle_buy(void*)
4183{ 4246{
4184 if (gSelectMgr->getSelection()->isEmpty()) return; 4247 if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) return;
4185 4248
4186 LLSaleInfo sale_info; 4249 LLSaleInfo sale_info;
4187 BOOL valid = gSelectMgr->selectGetSaleInfo(sale_info); 4250 BOOL valid = LLSelectMgr::getInstance()->selectGetSaleInfo(sale_info);
4188 if (!valid) return; 4251 if (!valid) return;
4189 4252
4190 if (sale_info.getSaleType() == LLSaleInfo::FS_CONTENTS) 4253 if (sale_info.getSaleType() == LLSaleInfo::FS_CONTENTS)
@@ -4208,7 +4271,7 @@ class LLObjectBuy : public view_listener_t
4208 4271
4209BOOL sitting_on_selection() 4272BOOL sitting_on_selection()
4210{ 4273{
4211 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); 4274 LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
4212 if (!node) 4275 if (!node)
4213 { 4276 {
4214 return FALSE; 4277 return FALSE;
@@ -4251,14 +4314,11 @@ class LLToolsSaveToObjectInventory : public view_listener_t
4251{ 4314{
4252 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4315 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4253 { 4316 {
4254 if(gSelectMgr) 4317 LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
4318 if(node && (node->mValid) && (!node->mFromTaskID.isNull()))
4255 { 4319 {
4256 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); 4320 // *TODO: check to see if the fromtaskid object exists.
4257 if(node && (node->mValid) && (!node->mFromTaskID.isNull())) 4321 derez_objects(DRD_SAVE_INTO_TASK_INVENTORY, node->mFromTaskID);
4258 {
4259 // *TODO: check to see if the fromtaskid object exists.
4260 derez_objects(DRD_SAVE_INTO_TASK_INVENTORY, node->mFromTaskID);
4261 }
4262 } 4322 }
4263 return true; 4323 return true;
4264 } 4324 }
@@ -4271,8 +4331,8 @@ class LLToolsSnapObjectXY : public view_listener_t
4271 { 4331 {
4272 F64 snap_size = (F64)gSavedSettings.getF32("GridResolution"); 4332 F64 snap_size = (F64)gSavedSettings.getF32("GridResolution");
4273 4333
4274 for (LLObjectSelection::root_iterator iter = gSelectMgr->getSelection()->root_begin(); 4334 for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
4275 iter != gSelectMgr->getSelection()->root_end(); iter++) 4335 iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++)
4276 { 4336 {
4277 LLSelectNode* node = *iter; 4337 LLSelectNode* node = *iter;
4278 LLViewerObject* obj = node->getObject(); 4338 LLViewerObject* obj = node->getObject();
@@ -4306,7 +4366,7 @@ class LLToolsSnapObjectXY : public view_listener_t
4306 obj->setPositionGlobal(pos_global, FALSE); 4366 obj->setPositionGlobal(pos_global, FALSE);
4307 } 4367 }
4308 } 4368 }
4309 gSelectMgr->sendMultipleUpdate(UPD_POSITION); 4369 LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION);
4310 return true; 4370 return true;
4311 } 4371 }
4312}; 4372};
@@ -4330,7 +4390,7 @@ class LLToolsEnableLink : public view_listener_t
4330 // in component mode, can't link 4390 // in component mode, can't link
4331 if (!gSavedSettings.getBOOL("EditLinkedParts")) 4391 if (!gSavedSettings.getBOOL("EditLinkedParts"))
4332 { 4392 {
4333 if(gSelectMgr->selectGetAllRootsValid() && gSelectMgr->getSelection()->getRootObjectCount() >= 2) 4393 if(LLSelectMgr::getInstance()->selectGetAllRootsValid() && LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() >= 2)
4334 { 4394 {
4335 struct f : public LLSelectedObjectFunctor 4395 struct f : public LLSelectedObjectFunctor
4336 { 4396 {
@@ -4340,7 +4400,7 @@ class LLToolsEnableLink : public view_listener_t
4340 } 4400 }
4341 } func; 4401 } func;
4342 const bool firstonly = true; 4402 const bool firstonly = true;
4343 new_value = gSelectMgr->getSelection()->applyToRootObjects(&func, firstonly); 4403 new_value = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly);
4344 } 4404 }
4345 } 4405 }
4346 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 4406 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
@@ -4352,13 +4412,13 @@ class LLToolsLink : public view_listener_t
4352{ 4412{
4353 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4413 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4354 { 4414 {
4355 if(!gSelectMgr->selectGetAllRootsValid()) 4415 if(!LLSelectMgr::getInstance()->selectGetAllRootsValid())
4356 { 4416 {
4357 LLNotifyBox::showXml("UnableToLinkWhileDownloading"); 4417 LLNotifyBox::showXml("UnableToLinkWhileDownloading");
4358 return true; 4418 return true;
4359 } 4419 }
4360 4420
4361 S32 object_count = gSelectMgr->getSelection()->getObjectCount(); 4421 S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount();
4362 if (object_count > MAX_CHILDREN_PER_TASK + 1) 4422 if (object_count > MAX_CHILDREN_PER_TASK + 1)
4363 { 4423 {
4364 LLStringBase<char>::format_map_t args; 4424 LLStringBase<char>::format_map_t args;
@@ -4369,19 +4429,19 @@ class LLToolsLink : public view_listener_t
4369 return true; 4429 return true;
4370 } 4430 }
4371 4431
4372 if(gSelectMgr->getSelection()->getRootObjectCount() < 2) 4432 if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() < 2)
4373 { 4433 {
4374 gViewerWindow->alertXml("CannotLinkIncompleteSet"); 4434 gViewerWindow->alertXml("CannotLinkIncompleteSet");
4375 return true; 4435 return true;
4376 } 4436 }
4377 if(!gSelectMgr->selectGetRootsModify()) 4437 if(!LLSelectMgr::getInstance()->selectGetRootsModify())
4378 { 4438 {
4379 gViewerWindow->alertXml("CannotLinkModify"); 4439 gViewerWindow->alertXml("CannotLinkModify");
4380 return true; 4440 return true;
4381 } 4441 }
4382 LLUUID owner_id; 4442 LLUUID owner_id;
4383 LLString owner_name; 4443 LLString owner_name;
4384 if(!gSelectMgr->selectGetOwner(owner_id, owner_name)) 4444 if(!LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name))
4385 { 4445 {
4386 // we don't actually care if you're the owner, but novices are 4446 // we don't actually care if you're the owner, but novices are
4387 // the most likely to be stumped by this one, so offer the 4447 // the most likely to be stumped by this one, so offer the
@@ -4389,7 +4449,7 @@ class LLToolsLink : public view_listener_t
4389 gViewerWindow->alertXml("CannotLinkDifferentOwners"); 4449 gViewerWindow->alertXml("CannotLinkDifferentOwners");
4390 return true; 4450 return true;
4391 } 4451 }
4392 gSelectMgr->sendLink(); 4452 LLSelectMgr::getInstance()->sendLink();
4393 return true; 4453 return true;
4394 } 4454 }
4395}; 4455};
@@ -4398,9 +4458,9 @@ class LLToolsEnableUnlink : public view_listener_t
4398{ 4458{
4399 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4459 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4400 { 4460 {
4401 bool new_value = gSelectMgr->selectGetAllRootsValid() && 4461 bool new_value = LLSelectMgr::getInstance()->selectGetAllRootsValid() &&
4402 gSelectMgr->getSelection()->getFirstEditableObject() && 4462 LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() &&
4403 !gSelectMgr->getSelection()->getFirstEditableObject()->isAttachment(); 4463 !LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject()->isAttachment();
4404 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 4464 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
4405 return true; 4465 return true;
4406 } 4466 }
@@ -4410,7 +4470,7 @@ class LLToolsUnlink : public view_listener_t
4410{ 4470{
4411 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4471 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4412 { 4472 {
4413 gSelectMgr->sendDelink(); 4473 LLSelectMgr::getInstance()->sendDelink();
4414 return true; 4474 return true;
4415 } 4475 }
4416}; 4476};
@@ -4433,32 +4493,32 @@ class LLToolsStopAllAnimations : public view_listener_t
4433 4493
4434//void handle_hinge(void*) 4494//void handle_hinge(void*)
4435//{ 4495//{
4436// gSelectMgr->sendHinge(1); 4496// LLSelectMgr::getInstance()->sendHinge(1);
4437//} 4497//}
4438 4498
4439//void handle_ptop(void*) 4499//void handle_ptop(void*)
4440//{ 4500//{
4441// gSelectMgr->sendHinge(2); 4501// LLSelectMgr::getInstance()->sendHinge(2);
4442//} 4502//}
4443 4503
4444//void handle_lptop(void*) 4504//void handle_lptop(void*)
4445//{ 4505//{
4446// gSelectMgr->sendHinge(3); 4506// LLSelectMgr::getInstance()->sendHinge(3);
4447//} 4507//}
4448 4508
4449//void handle_wheel(void*) 4509//void handle_wheel(void*)
4450//{ 4510//{
4451// gSelectMgr->sendHinge(4); 4511// LLSelectMgr::getInstance()->sendHinge(4);
4452//} 4512//}
4453 4513
4454//void handle_dehinge(void*) 4514//void handle_dehinge(void*)
4455//{ 4515//{
4456// gSelectMgr->sendDehinge(); 4516// LLSelectMgr::getInstance()->sendDehinge();
4457//} 4517//}
4458 4518
4459//BOOL enable_dehinge(void*) 4519//BOOL enable_dehinge(void*)
4460//{ 4520//{
4461// LLViewerObject* obj = gSelectMgr->getSelection()->getFirstEditableObject(); 4521// LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject();
4462// return obj && !obj->isAttachment(); 4522// return obj && !obj->isAttachment();
4463//} 4523//}
4464 4524
@@ -4572,7 +4632,7 @@ class LLObjectEnableDelete : public view_listener_t
4572 (!LLAppViewer::instance()->isInProductionGrid() 4632 (!LLAppViewer::instance()->isInProductionGrid()
4573 && gAgent.isGodlike()) || 4633 && gAgent.isGodlike()) ||
4574# endif 4634# endif
4575 (gSelectMgr && gSelectMgr->canDoDelete()); 4635 LLSelectMgr::getInstance()->canDoDelete();
4576#endif 4636#endif
4577 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 4637 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
4578 return true; 4638 return true;
@@ -4592,9 +4652,9 @@ class LLObjectDelete : public view_listener_t
4592{ 4652{
4593 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4653 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4594 { 4654 {
4595 if (gSelectMgr) 4655 if (LLSelectMgr::getInstance())
4596 { 4656 {
4597 gSelectMgr->doDelete(); 4657 LLSelectMgr::getInstance()->doDelete();
4598 } 4658 }
4599 4659
4600 // and close any pie/context menus when done 4660 // and close any pie/context menus when done
@@ -4609,7 +4669,7 @@ class LLObjectDelete : public view_listener_t
4609 4669
4610void handle_force_delete(void*) 4670void handle_force_delete(void*)
4611{ 4671{
4612 gSelectMgr->selectForceDelete(); 4672 LLSelectMgr::getInstance()->selectForceDelete();
4613} 4673}
4614 4674
4615class LLViewEnableLastChatter : public view_listener_t 4675class LLViewEnableLastChatter : public view_listener_t
@@ -4717,7 +4777,7 @@ class LLEditRedo : public view_listener_t
4717 4777
4718void print_object_info(void*) 4778void print_object_info(void*)
4719{ 4779{
4720 gSelectMgr->selectionDump(); 4780 LLSelectMgr::getInstance()->selectionDump();
4721} 4781}
4722 4782
4723void print_agent_nvpairs(void*) 4783void print_agent_nvpairs(void*)
@@ -4761,6 +4821,8 @@ void show_debug_menus()
4761 4821
4762 //gMenuBarView->setItemVisible(LLString("DebugOptions"), visible); 4822 //gMenuBarView->setItemVisible(LLString("DebugOptions"), visible);
4763 //gMenuBarView->setItemVisible(LLString(AVI_TOOLS), visible); 4823 //gMenuBarView->setItemVisible(LLString(AVI_TOOLS), visible);
4824
4825 gMenuBarView->arrange(); // clean-up positioning
4764 }; 4826 };
4765} 4827}
4766 4828
@@ -4795,7 +4857,7 @@ LLUploadDialog *gExportDialog = NULL;
4795 4857
4796void handle_export_selected( void * ) 4858void handle_export_selected( void * )
4797{ 4859{
4798 LLObjectSelectionHandle selection = gSelectMgr->getSelection(); 4860 LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
4799 if (selection->isEmpty()) 4861 if (selection->isEmpty())
4800 { 4862 {
4801 return; 4863 return;
@@ -4829,13 +4891,13 @@ void handle_export_selected( void * )
4829BOOL menu_check_build_tool( void* user_data ) 4891BOOL menu_check_build_tool( void* user_data )
4830{ 4892{
4831 S32 index = (intptr_t) user_data; 4893 S32 index = (intptr_t) user_data;
4832 return gToolMgr->getCurrentToolset()->isToolSelected( index ); 4894 return LLToolMgr::getInstance()->getCurrentToolset()->isToolSelected( index );
4833} 4895}
4834 4896
4835void handle_reload_settings(void*) 4897void handle_reload_settings(void*)
4836{ 4898{
4837 gSavedSettings.resetToDefaults(); 4899 gSavedSettings.resetToDefaults();
4838 gSavedSettings.loadFromFile(gSettingsFileName, TRUE); 4900 gSavedSettings.loadFromFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
4839 4901
4840 llinfos << "Loading colors from colors.xml" << llendl; 4902 llinfos << "Loading colors from colors.xml" << llendl;
4841 std::string color_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"colors.xml"); 4903 std::string color_file = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS,"colors.xml");
@@ -4868,23 +4930,22 @@ class LLWorldAlwaysRun : public view_listener_t
4868{ 4930{
4869 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 4931 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
4870 { 4932 {
4933 // as well as altering the default walk-vs-run state,
4934 // we also change the *current* walk-vs-run state.
4871 if (gAgent.getAlwaysRun()) 4935 if (gAgent.getAlwaysRun())
4872 { 4936 {
4873 gAgent.clearAlwaysRun(); 4937 gAgent.clearAlwaysRun();
4938 gAgent.clearRunning();
4874 } 4939 }
4875 else 4940 else
4876 { 4941 {
4877 gAgent.setAlwaysRun(); 4942 gAgent.setAlwaysRun();
4943 gAgent.setRunning();
4878 } 4944 }
4879 LLMessageSystem *msg = gMessageSystem;
4880 4945
4946 // tell the simulator.
4947 gAgent.sendWalkRun(gAgent.getAlwaysRun());
4881 4948
4882 msg->newMessageFast(_PREHASH_SetAlwaysRun);
4883 msg->nextBlockFast(_PREHASH_AgentData);
4884 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
4885 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
4886 msg->addBOOLFast(_PREHASH_AlwaysRun, gAgent.getAlwaysRun() );
4887 gAgent.sendReliableMessage();
4888 return true; 4949 return true;
4889 } 4950 }
4890}; 4951};
@@ -4943,7 +5004,7 @@ class LLWorldCreateLandmark : public view_listener_t
4943 llwarns << "No agent region" << llendl; 5004 llwarns << "No agent region" << llendl;
4944 return true; 5005 return true;
4945 } 5006 }
4946 LLParcel* agent_parcel = gParcelMgr->getAgentParcel(); 5007 LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
4947 if (!agent_parcel) 5008 if (!agent_parcel)
4948 { 5009 {
4949 llwarns << "No agent parcel" << llendl; 5010 llwarns << "No agent parcel" << llendl;
@@ -4978,24 +5039,24 @@ class LLToolsLookAtSelection : public view_listener_t
4978 { 5039 {
4979 const F32 PADDING_FACTOR = 2.f; 5040 const F32 PADDING_FACTOR = 2.f;
4980 BOOL zoom = (userdata.asString() == "zoom"); 5041 BOOL zoom = (userdata.asString() == "zoom");
4981 if (!gSelectMgr->getSelection()->isEmpty()) 5042 if (!LLSelectMgr::getInstance()->getSelection()->isEmpty())
4982 { 5043 {
4983 gAgent.setFocusOnAvatar(FALSE, ANIMATE); 5044 gAgent.setFocusOnAvatar(FALSE, ANIMATE);
4984 5045
4985 LLBBox selection_bbox = gSelectMgr->getBBoxOfSelection(); 5046 LLBBox selection_bbox = LLSelectMgr::getInstance()->getBBoxOfSelection();
4986 F32 angle_of_view = llmax(0.1f, gCamera->getAspect() > 1.f ? gCamera->getView() * gCamera->getAspect() : gCamera->getView()); 5047 F32 angle_of_view = llmax(0.1f, LLViewerCamera::getInstance()->getAspect() > 1.f ? LLViewerCamera::getInstance()->getView() * LLViewerCamera::getInstance()->getAspect() : LLViewerCamera::getInstance()->getView());
4987 F32 distance = selection_bbox.getExtentLocal().magVec() * PADDING_FACTOR / atan(angle_of_view); 5048 F32 distance = selection_bbox.getExtentLocal().magVec() * PADDING_FACTOR / atan(angle_of_view);
4988 5049
4989 LLVector3 obj_to_cam = gCamera->getOrigin() - selection_bbox.getCenterAgent(); 5050 LLVector3 obj_to_cam = LLViewerCamera::getInstance()->getOrigin() - selection_bbox.getCenterAgent();
4990 obj_to_cam.normVec(); 5051 obj_to_cam.normVec();
4991 5052
4992 if (zoom) 5053 if (zoom)
4993 { 5054 {
4994 gAgent.setCameraPosAndFocusGlobal(gSelectMgr->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), gSelectMgr->getSelectionCenterGlobal(), gSelectMgr->getSelection()->getFirstObject()->mID ); 5055 gAgent.setCameraPosAndFocusGlobal(LLSelectMgr::getInstance()->getSelectionCenterGlobal() + LLVector3d(obj_to_cam * distance), LLSelectMgr::getInstance()->getSelectionCenterGlobal(), LLSelectMgr::getInstance()->getSelection()->getFirstObject()->mID );
4995 } 5056 }
4996 else 5057 else
4997 { 5058 {
4998 gAgent.setFocusGlobal( gSelectMgr->getSelectionCenterGlobal(), gSelectMgr->getSelection()->getFirstObject()->mID ); 5059 gAgent.setFocusGlobal( LLSelectMgr::getInstance()->getSelectionCenterGlobal(), LLSelectMgr::getInstance()->getSelection()->getFirstObject()->mID );
4999 } 5060 }
5000 } 5061 }
5001 return true; 5062 return true;
@@ -5091,7 +5152,7 @@ void complete_give_money(S32 option, void* user_data)
5091 5152
5092bool handle_give_money_dialog() 5153bool handle_give_money_dialog()
5093{ 5154{
5094 LLObjectSelectionHandle* handlep = new LLObjectSelectionHandle(gSelectMgr->getSelection()); 5155 LLObjectSelectionHandle* handlep = new LLObjectSelectionHandle(LLSelectMgr::getInstance()->getSelection());
5095 if (gAgent.getBusy()) 5156 if (gAgent.getBusy())
5096 { 5157 {
5097 // warn users of being in busy mode during a transaction 5158 // warn users of being in busy mode during a transaction
@@ -5167,7 +5228,7 @@ class LLObjectEnableSitOrStand : public view_listener_t
5167 } 5228 }
5168 else 5229 else
5169 { 5230 {
5170 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); 5231 LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
5171 if (node && node->mValid && !node->mSitName.empty()) 5232 if (node && node->mValid && !node->mSitName.empty())
5172 { 5233 {
5173 label.assign(node->mSitName); 5234 label.assign(node->mSitName);
@@ -5190,12 +5251,7 @@ void edit_ui(void*)
5190 5251
5191void dump_select_mgr(void*) 5252void dump_select_mgr(void*)
5192{ 5253{
5193 gSelectMgr->dump(); 5254 LLSelectMgr::getInstance()->dump();
5194}
5195
5196void dump_volume_mgr(void*)
5197{
5198 gVolumeMgr->dump();
5199} 5255}
5200 5256
5201void dump_inventory(void*) 5257void dump_inventory(void*)
@@ -5207,7 +5263,7 @@ void dump_inventory(void*)
5207void handle_force_unlock(void*) 5263void handle_force_unlock(void*)
5208{ 5264{
5209 // First, make it public. 5265 // First, make it public.
5210 gSelectMgr->sendOwner(LLUUID::null, LLUUID::null, TRUE); 5266 LLSelectMgr::getInstance()->sendOwner(LLUUID::null, LLUUID::null, TRUE);
5211 5267
5212 // Second, lie to the viewer and mark it editable and unowned 5268 // Second, lie to the viewer and mark it editable and unowned
5213 5269
@@ -5224,7 +5280,7 @@ void handle_force_unlock(void*)
5224 return true; 5280 return true;
5225 } 5281 }
5226 } func; 5282 } func;
5227 gSelectMgr->getSelection()->applyToObjects(&func); 5283 LLSelectMgr::getInstance()->getSelection()->applyToObjects(&func);
5228} 5284}
5229 5285
5230void handle_dump_followcam(void*) 5286void handle_dump_followcam(void*)
@@ -5232,21 +5288,6 @@ void handle_dump_followcam(void*)
5232 LLFollowCamMgr::dump(); 5288 LLFollowCamMgr::dump();
5233} 5289}
5234 5290
5235BOOL check_flycam(void*)
5236{
5237 return LLViewerJoystick::sOverrideCamera;
5238}
5239
5240void handle_toggle_flycam(void*)
5241{
5242 LLViewerJoystick::sOverrideCamera = !LLViewerJoystick::sOverrideCamera;
5243 if (LLViewerJoystick::sOverrideCamera)
5244 {
5245 LLViewerJoystick::updateCamera(TRUE);
5246 LLFloaterJoystick::show(NULL);
5247 }
5248}
5249
5250void handle_viewer_enable_message_log(void*) 5291void handle_viewer_enable_message_log(void*)
5251{ 5292{
5252 gMessageSystem->startLogging(); 5293 gMessageSystem->startLogging();
@@ -5304,11 +5345,11 @@ class LLShowFloater : public view_listener_t
5304 } 5345 }
5305 else if (floater_name == "camera controls") 5346 else if (floater_name == "camera controls")
5306 { 5347 {
5307 LLFloaterCamera::toggle(NULL); 5348 LLFloaterCamera::toggleInstance();
5308 } 5349 }
5309 else if (floater_name == "movement controls") 5350 else if (floater_name == "movement controls")
5310 { 5351 {
5311 LLFloaterMove::show(NULL); 5352 LLFloaterMove::toggleInstance();
5312 } 5353 }
5313 else if (floater_name == "world map") 5354 else if (floater_name == "world map")
5314 { 5355 {
@@ -5320,7 +5361,7 @@ class LLShowFloater : public view_listener_t
5320 } 5361 }
5321 else if (floater_name == "stat bar") 5362 else if (floater_name == "stat bar")
5322 { 5363 {
5323 gDebugView->mStatViewp->setVisible(!gDebugView->mStatViewp->getVisible()); 5364 gDebugView->mFloaterStatsp->setVisible(!gDebugView->mFloaterStatsp->getVisible());
5324 } 5365 }
5325 else if (floater_name == "my land") 5366 else if (floater_name == "my land")
5326 { 5367 {
@@ -5328,21 +5369,21 @@ class LLShowFloater : public view_listener_t
5328 } 5369 }
5329 else if (floater_name == "about land") 5370 else if (floater_name == "about land")
5330 { 5371 {
5331 if (gParcelMgr->selectionEmpty()) 5372 if (LLViewerParcelMgr::getInstance()->selectionEmpty())
5332 { 5373 {
5333 gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); 5374 LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal());
5334 } 5375 }
5335 5376
5336 LLFloaterLand::showInstance(); 5377 LLFloaterLand::showInstance();
5337 } 5378 }
5338 else if (floater_name == "buy land") 5379 else if (floater_name == "buy land")
5339 { 5380 {
5340 if (gParcelMgr->selectionEmpty()) 5381 if (LLViewerParcelMgr::getInstance()->selectionEmpty())
5341 { 5382 {
5342 gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); 5383 LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal());
5343 } 5384 }
5344 5385
5345 gParcelMgr->startBuyLand(); 5386 LLViewerParcelMgr::getInstance()->startBuyLand();
5346 } 5387 }
5347 else if (floater_name == "about region") 5388 else if (floater_name == "about region")
5348 { 5389 {
@@ -5360,6 +5401,10 @@ class LLShowFloater : public view_listener_t
5360 { 5401 {
5361 gViewerHtmlHelp.show(); 5402 gViewerHtmlHelp.show();
5362 } 5403 }
5404 else if (floater_name == "help tutorial")
5405 {
5406 LLFloaterHUD::show();
5407 }
5363 else if (floater_name == "complaint reporter") 5408 else if (floater_name == "complaint reporter")
5364 { 5409 {
5365 // Prevent menu from appearing in screen shot. 5410 // Prevent menu from appearing in screen shot.
@@ -5375,7 +5420,7 @@ class LLShowFloater : public view_listener_t
5375 } 5420 }
5376 else if (floater_name == "lag meter") 5421 else if (floater_name == "lag meter")
5377 { 5422 {
5378 LLFloaterLagMeter::show(NULL); 5423 LLFloaterLagMeter::showInstance();
5379 } 5424 }
5380 else if (floater_name == "bug reporter") 5425 else if (floater_name == "bug reporter")
5381 { 5426 {
@@ -5428,15 +5473,15 @@ class LLFloaterVisible : public view_listener_t
5428 } 5473 }
5429 else if (floater_name == "camera controls") 5474 else if (floater_name == "camera controls")
5430 { 5475 {
5431 new_value = LLFloaterCamera::visible(NULL); 5476 new_value = LLFloaterCamera::instanceVisible();
5432 } 5477 }
5433 else if (floater_name == "movement controls") 5478 else if (floater_name == "movement controls")
5434 { 5479 {
5435 new_value = LLFloaterMove::visible(NULL); 5480 new_value = LLFloaterMove::instanceVisible();
5436 } 5481 }
5437 else if (floater_name == "stat bar") 5482 else if (floater_name == "stat bar")
5438 { 5483 {
5439 new_value = gDebugView->mStatViewp->getVisible(); 5484 new_value = gDebugView->mFloaterStatsp->getVisible();
5440 } 5485 }
5441 else if (floater_name == "active speakers") 5486 else if (floater_name == "active speakers")
5442 { 5487 {
@@ -5585,8 +5630,8 @@ void handle_focus(void *)
5585 gViewerWindow->moveCursorToCenter(); 5630 gViewerWindow->moveCursorToCenter();
5586 5631
5587 // Switch to camera toolset 5632 // Switch to camera toolset
5588// gToolMgr->setCurrentToolset(gCameraToolset); 5633// LLToolMgr::getInstance()->setCurrentToolset(gCameraToolset);
5589 gToolMgr->getCurrentToolset()->selectTool( gToolCamera ); 5634 LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCamera::getInstance() );
5590} 5635}
5591 5636
5592class LLLandEdit : public view_listener_t 5637class LLLandEdit : public view_listener_t
@@ -5609,13 +5654,13 @@ class LLLandEdit : public view_listener_t
5609 } 5654 }
5610 5655
5611 5656
5612 gParcelMgr->selectParcelAt( gLastHitPosGlobal ); 5657 LLViewerParcelMgr::getInstance()->selectParcelAt( gLastHitPosGlobal );
5613 5658
5614 gFloaterTools->showMore(TRUE); 5659 gFloaterTools->showMore(TRUE);
5615 gFloaterView->bringToFront( gFloaterTools ); 5660 gFloaterView->bringToFront( gFloaterTools );
5616 5661
5617 // Switch to land edit toolset 5662 // Switch to land edit toolset
5618 gToolMgr->getCurrentToolset()->selectTool( gToolParcel ); 5663 LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolSelectLand::getInstance() );
5619 return true; 5664 return true;
5620 } 5665 }
5621}; 5666};
@@ -5624,10 +5669,10 @@ class LLWorldEnableBuyLand : public view_listener_t
5624{ 5669{
5625 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5670 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
5626 { 5671 {
5627 bool new_value = gParcelMgr->canAgentBuyParcel( 5672 bool new_value = LLViewerParcelMgr::getInstance()->canAgentBuyParcel(
5628 gParcelMgr->selectionEmpty() 5673 LLViewerParcelMgr::getInstance()->selectionEmpty()
5629 ? gParcelMgr->getAgentParcel() 5674 ? LLViewerParcelMgr::getInstance()->getAgentParcel()
5630 : gParcelMgr->getParcelSelection()->getParcel(), 5675 : LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(),
5631 false); 5676 false);
5632 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 5677 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
5633 return true; 5678 return true;
@@ -5636,8 +5681,8 @@ class LLWorldEnableBuyLand : public view_listener_t
5636 5681
5637BOOL enable_buy_land(void*) 5682BOOL enable_buy_land(void*)
5638{ 5683{
5639 return gParcelMgr->canAgentBuyParcel( 5684 return LLViewerParcelMgr::getInstance()->canAgentBuyParcel(
5640 gParcelMgr->getParcelSelection()->getParcel(), false); 5685 LLViewerParcelMgr::getInstance()->getParcelSelection()->getParcel(), false);
5641} 5686}
5642 5687
5643 5688
@@ -5658,8 +5703,8 @@ void handle_move(void*)
5658 5703
5659 gViewerWindow->moveCursorToCenter(); 5704 gViewerWindow->moveCursorToCenter();
5660 5705
5661 gToolMgr->setCurrentToolset(gBasicToolset); 5706 LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset);
5662 gToolMgr->getCurrentToolset()->selectTool( gToolGrab ); 5707 LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolGrab::getInstance() );
5663} 5708}
5664 5709
5665class LLObjectAttachToAvatar : public view_listener_t 5710class LLObjectAttachToAvatar : public view_listener_t
@@ -5670,7 +5715,7 @@ public:
5670private: 5715private:
5671 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5716 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
5672 { 5717 {
5673 setObjectSelection(gSelectMgr->getSelection()); 5718 setObjectSelection(LLSelectMgr::getInstance()->getSelection());
5674 LLViewerObject* selectedObject = sObjectSelection->getFirstRootObject(); 5719 LLViewerObject* selectedObject = sObjectSelection->getFirstRootObject();
5675 if (selectedObject) 5720 if (selectedObject)
5676 { 5721 {
@@ -5713,7 +5758,7 @@ void near_attach_object(BOOL success, void *user_data)
5713 // interpret 0 as "default location" 5758 // interpret 0 as "default location"
5714 attachment_id = 0; 5759 attachment_id = 0;
5715 } 5760 }
5716 gSelectMgr->sendAttach(attachment_id); 5761 LLSelectMgr::getInstance()->sendAttach(attachment_id);
5717 } 5762 }
5718 LLObjectAttachToAvatar::setObjectSelection(NULL); 5763 LLObjectAttachToAvatar::setObjectSelection(NULL);
5719} 5764}
@@ -5722,7 +5767,7 @@ void confirm_replace_attachment(S32 option, void* user_data)
5722{ 5767{
5723 if (option == 0/*YES*/) 5768 if (option == 0/*YES*/)
5724 { 5769 {
5725 LLViewerObject* selectedObject = gSelectMgr->getSelection()->getFirstRootObject(); 5770 LLViewerObject* selectedObject = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject();
5726 if (selectedObject) 5771 if (selectedObject)
5727 { 5772 {
5728 const F32 MIN_STOP_DISTANCE = 1.f; // meters 5773 const F32 MIN_STOP_DISTANCE = 1.f; // meters
@@ -5789,7 +5834,7 @@ class LLAttachmentDrop : public view_listener_t
5789 // objects. Thus we need to clear the list, make sure it only 5834 // objects. Thus we need to clear the list, make sure it only
5790 // contains the object the user clicked, send the message, 5835 // contains the object the user clicked, send the message,
5791 // then clear the list. 5836 // then clear the list.
5792 gSelectMgr->sendDropAttachment(); 5837 LLSelectMgr::getInstance()->sendDropAttachment();
5793 return true; 5838 return true;
5794 } 5839 }
5795}; 5840};
@@ -5892,9 +5937,9 @@ class LLAttachmentDetach : public view_listener_t
5892 // We use deselectAll to update the simulator's notion of what's 5937 // We use deselectAll to update the simulator's notion of what's
5893 // selected, and removeAll just to change things locally. 5938 // selected, and removeAll just to change things locally.
5894 //RN: I thought it was more useful to detach everything that was selected 5939 //RN: I thought it was more useful to detach everything that was selected
5895 if (gSelectMgr->getSelection()->isAttachment()) 5940 if (LLSelectMgr::getInstance()->getSelection()->isAttachment())
5896 { 5941 {
5897 gSelectMgr->sendDetach(); 5942 LLSelectMgr::getInstance()->sendDetach();
5898 } 5943 }
5899 return true; 5944 return true;
5900 } 5945 }
@@ -5922,7 +5967,7 @@ class LLAttachmentEnableDrop : public view_listener_t
5922{ 5967{
5923 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 5968 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
5924 { 5969 {
5925 LLParcel* parcel = gParcelMgr->getAgentParcel(); 5970 LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel();
5926 BOOL can_build = gAgent.isGodlike() || (parcel && parcel->getAllowModify()); 5971 BOOL can_build = gAgent.isGodlike() || (parcel && parcel->getAllowModify());
5927 5972
5928 //Add an inventory observer to only allow dropping the newly attached item 5973 //Add an inventory observer to only allow dropping the newly attached item
@@ -6011,11 +6056,7 @@ class LLAttachmentEnableDetach : public view_listener_t
6011BOOL object_selected_and_point_valid(void *user_data) 6056BOOL object_selected_and_point_valid(void *user_data)
6012{ 6057{
6013 //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; 6058 //LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data;
6014 if (gSelectMgr == NULL) 6059 LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
6015 {
6016 return FALSE;
6017 }
6018 LLObjectSelectionHandle selection = gSelectMgr->getSelection();
6019 for (LLObjectSelection::root_iterator iter = selection->root_begin(); 6060 for (LLObjectSelection::root_iterator iter = selection->root_begin();
6020 iter != selection->root_end(); iter++) 6061 iter != selection->root_end(); iter++)
6021 { 6062 {
@@ -6048,9 +6089,9 @@ BOOL object_is_wearable()
6048 { 6089 {
6049 return FALSE; 6090 return FALSE;
6050 } 6091 }
6051 LLObjectSelectionHandle selection = gSelectMgr->getSelection(); 6092 LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
6052 for (LLObjectSelection::valid_root_iterator iter = gSelectMgr->getSelection()->valid_root_begin(); 6093 for (LLObjectSelection::valid_root_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_root_begin();
6053 iter != gSelectMgr->getSelection()->valid_root_end(); iter++) 6094 iter != LLSelectMgr::getInstance()->getSelection()->valid_root_end(); iter++)
6054 { 6095 {
6055 LLSelectNode* node = *iter; 6096 LLSelectNode* node = *iter;
6056 if (node->mPermissions->getOwner() == gAgent.getID()) 6097 if (node->mPermissions->getOwner() == gAgent.getID())
@@ -6150,7 +6191,7 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& noscriptmsg, cons
6150 // Apply until an object fails 6191 // Apply until an object fails
6151 QueueObjects func(q); 6192 QueueObjects func(q);
6152 const bool firstonly = true; 6193 const bool firstonly = true;
6153 bool fail = gSelectMgr->getSelection()->applyToObjects(&func, firstonly); 6194 bool fail = LLSelectMgr::getInstance()->getSelection()->applyToObjects(&func, firstonly);
6154 if(fail) 6195 if(fail)
6155 { 6196 {
6156 if ( !func.scripted ) 6197 if ( !func.scripted )
@@ -6228,8 +6269,8 @@ void handle_set_not_run_selection(void*)
6228 6269
6229void handle_selected_texture_info(void*) 6270void handle_selected_texture_info(void*)
6230{ 6271{
6231 for (LLObjectSelection::valid_iterator iter = gSelectMgr->getSelection()->valid_begin(); 6272 for (LLObjectSelection::valid_iterator iter = LLSelectMgr::getInstance()->getSelection()->valid_begin();
6232 iter != gSelectMgr->getSelection()->valid_end(); iter++) 6273 iter != LLSelectMgr::getInstance()->getSelection()->valid_end(); iter++)
6233 { 6274 {
6234 LLSelectNode* node = *iter; 6275 LLSelectNode* node = *iter;
6235 6276
@@ -6397,14 +6438,14 @@ BOOL menu_check_variable( void* user_data)
6397 6438
6398BOOL enable_land_selected( void* ) 6439BOOL enable_land_selected( void* )
6399{ 6440{
6400 return gParcelMgr && !(gParcelMgr->selectionEmpty()); 6441 return !(LLViewerParcelMgr::getInstance()->selectionEmpty());
6401} 6442}
6402 6443
6403class LLSomethingSelected : public view_listener_t 6444class LLSomethingSelected : public view_listener_t
6404{ 6445{
6405 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 6446 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
6406 { 6447 {
6407 bool new_value = !(gSelectMgr->getSelection()->isEmpty()); 6448 bool new_value = !(LLSelectMgr::getInstance()->getSelection()->isEmpty());
6408 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 6449 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
6409 return true; 6450 return true;
6410 } 6451 }
@@ -6414,7 +6455,7 @@ class LLSomethingSelectedNoHUD : public view_listener_t
6414{ 6455{
6415 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 6456 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
6416 { 6457 {
6417 LLObjectSelectionHandle selection = gSelectMgr->getSelection(); 6458 LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection();
6418 bool new_value = !(selection->isEmpty()) && !(selection->getSelectType() == SELECT_TYPE_HUD); 6459 bool new_value = !(selection->isEmpty()) && !(selection->getSelectType() == SELECT_TYPE_HUD);
6419 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 6460 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
6420 return true; 6461 return true;
@@ -6423,14 +6464,14 @@ class LLSomethingSelectedNoHUD : public view_listener_t
6423 6464
6424BOOL enable_more_than_one_selected(void* ) 6465BOOL enable_more_than_one_selected(void* )
6425{ 6466{
6426 return (gSelectMgr->getSelection()->getObjectCount() > 1); 6467 return (LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1);
6427} 6468}
6428 6469
6429class LLEditableSelected : public view_listener_t 6470class LLEditableSelected : public view_listener_t
6430{ 6471{
6431 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 6472 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
6432 { 6473 {
6433 bool new_value = (gSelectMgr->getSelection()->getFirstEditableObject() != NULL); 6474 bool new_value = (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL);
6434 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 6475 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
6435 return true; 6476 return true;
6436 } 6477 }
@@ -6441,7 +6482,7 @@ class LLToolsEnableTakeCopy : public view_listener_t
6441 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 6482 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
6442 { 6483 {
6443 bool all_valid = false; 6484 bool all_valid = false;
6444 if (gSelectMgr) 6485 if (LLSelectMgr::getInstance())
6445 { 6486 {
6446 all_valid = true; 6487 all_valid = true;
6447#ifndef HACKED_GODLIKE_VIEWER 6488#ifndef HACKED_GODLIKE_VIEWER
@@ -6458,7 +6499,7 @@ class LLToolsEnableTakeCopy : public view_listener_t
6458 } 6499 }
6459 } func; 6500 } func;
6460 const bool firstonly = true; 6501 const bool firstonly = true;
6461 bool any_invalid = gSelectMgr->getSelection()->applyToRootObjects(&func, firstonly); 6502 bool any_invalid = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly);
6462 all_valid = !any_invalid; 6503 all_valid = !any_invalid;
6463 } 6504 }
6464#endif // HACKED_GODLIKE_VIEWER 6505#endif // HACKED_GODLIKE_VIEWER
@@ -6471,7 +6512,7 @@ class LLToolsEnableTakeCopy : public view_listener_t
6471 6512
6472BOOL enable_selection_you_own_all(void*) 6513BOOL enable_selection_you_own_all(void*)
6473{ 6514{
6474 if (gSelectMgr) 6515 if (LLSelectMgr::getInstance())
6475 { 6516 {
6476 struct f : public LLSelectedObjectFunctor 6517 struct f : public LLSelectedObjectFunctor
6477 { 6518 {
@@ -6481,7 +6522,7 @@ BOOL enable_selection_you_own_all(void*)
6481 } 6522 }
6482 } func; 6523 } func;
6483 const bool firstonly = true; 6524 const bool firstonly = true;
6484 bool no_perms = gSelectMgr->getSelection()->applyToRootObjects(&func, firstonly); 6525 bool no_perms = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly);
6485 if (no_perms) 6526 if (no_perms)
6486 { 6527 {
6487 return FALSE; 6528 return FALSE;
@@ -6492,7 +6533,7 @@ BOOL enable_selection_you_own_all(void*)
6492 6533
6493BOOL enable_selection_you_own_one(void*) 6534BOOL enable_selection_you_own_one(void*)
6494{ 6535{
6495 if (gSelectMgr) 6536 if (LLSelectMgr::getInstance())
6496 { 6537 {
6497 struct f : public LLSelectedObjectFunctor 6538 struct f : public LLSelectedObjectFunctor
6498 { 6539 {
@@ -6502,7 +6543,7 @@ BOOL enable_selection_you_own_one(void*)
6502 } 6543 }
6503 } func; 6544 } func;
6504 const bool firstonly = true; 6545 const bool firstonly = true;
6505 bool any_perms = gSelectMgr->getSelection()->applyToRootObjects(&func, firstonly); 6546 bool any_perms = LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, firstonly);
6506 if (!any_perms) 6547 if (!any_perms)
6507 { 6548 {
6508 return FALSE; 6549 return FALSE;
@@ -6537,40 +6578,37 @@ bool LLHasAsset::operator()(LLInventoryCategory* cat,
6537 6578
6538BOOL enable_save_into_inventory(void*) 6579BOOL enable_save_into_inventory(void*)
6539{ 6580{
6540 if(gSelectMgr) 6581 // *TODO: clean this up
6582 // find the last root
6583 LLSelectNode* last_node = NULL;
6584 for (LLObjectSelection::root_iterator iter = LLSelectMgr::getInstance()->getSelection()->root_begin();
6585 iter != LLSelectMgr::getInstance()->getSelection()->root_end(); iter++)
6541 { 6586 {
6542 // *TODO: clean this up 6587 last_node = *iter;
6543 // find the last root 6588 }
6544 LLSelectNode* last_node = NULL;
6545 for (LLObjectSelection::root_iterator iter = gSelectMgr->getSelection()->root_begin();
6546 iter != gSelectMgr->getSelection()->root_end(); iter++)
6547 {
6548 last_node = *iter;
6549 }
6550 6589
6551#ifdef HACKED_GODLIKE_VIEWER 6590#ifdef HACKED_GODLIKE_VIEWER
6552 return TRUE; 6591 return TRUE;
6553#else 6592#else
6554# ifdef TOGGLE_HACKED_GODLIKE_VIEWER 6593# ifdef TOGGLE_HACKED_GODLIKE_VIEWER
6555 if (!LLAppViewer::instance()->isInProductionGrid() 6594 if (!LLAppViewer::instance()->isInProductionGrid()
6556 && gAgent.isGodlike()) 6595 && gAgent.isGodlike())
6557 { 6596 {
6558 return TRUE; 6597 return TRUE;
6559 } 6598 }
6560# endif 6599# endif
6561 // check all pre-req's for save into inventory. 6600 // check all pre-req's for save into inventory.
6562 if(last_node && last_node->mValid && !last_node->mItemID.isNull() 6601 if(last_node && last_node->mValid && !last_node->mItemID.isNull()
6563 && (last_node->mPermissions->getOwner() == gAgent.getID()) 6602 && (last_node->mPermissions->getOwner() == gAgent.getID())
6564 && (gInventory.getItem(last_node->mItemID) != NULL)) 6603 && (gInventory.getItem(last_node->mItemID) != NULL))
6604 {
6605 LLViewerObject* obj = last_node->getObject();
6606 if( obj && !obj->isAttachment() )
6565 { 6607 {
6566 LLViewerObject* obj = last_node->getObject(); 6608 return TRUE;
6567 if( obj && !obj->isAttachment() )
6568 {
6569 return TRUE;
6570 }
6571 } 6609 }
6572#endif
6573 } 6610 }
6611#endif
6574 return FALSE; 6612 return FALSE;
6575} 6613}
6576 6614
@@ -6586,17 +6624,14 @@ class LLToolsEnableSaveToInventory : public view_listener_t
6586 6624
6587BOOL enable_save_into_task_inventory(void*) 6625BOOL enable_save_into_task_inventory(void*)
6588{ 6626{
6589 if(gSelectMgr) 6627 LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode();
6628 if(node && (node->mValid) && (!node->mFromTaskID.isNull()))
6590 { 6629 {
6591 LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); 6630 // *TODO: check to see if the fromtaskid object exists.
6592 if(node && (node->mValid) && (!node->mFromTaskID.isNull())) 6631 LLViewerObject* obj = node->getObject();
6632 if( obj && !obj->isAttachment() )
6593 { 6633 {
6594 // *TODO: check to see if the fromtaskid object exists. 6634 return TRUE;
6595 LLViewerObject* obj = node->getObject();
6596 if( obj && !obj->isAttachment() )
6597 {
6598 return TRUE;
6599 }
6600 } 6635 }
6601 } 6636 }
6602 return FALSE; 6637 return FALSE;
@@ -6620,7 +6655,7 @@ BOOL enable_not_thirdperson(void*)
6620 6655
6621BOOL enable_export_selected(void *) 6656BOOL enable_export_selected(void *)
6622{ 6657{
6623 if (gSelectMgr->getSelection()->isEmpty()) 6658 if (LLSelectMgr::getInstance()->getSelection()->isEmpty())
6624 { 6659 {
6625 return FALSE; 6660 return FALSE;
6626 } 6661 }
@@ -6651,7 +6686,7 @@ class LLToolsEnableToolNotPie : public view_listener_t
6651{ 6686{
6652 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 6687 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
6653 { 6688 {
6654 bool new_value = ( gToolMgr->getBaseTool() != gToolPie ); 6689 bool new_value = ( LLToolMgr::getInstance()->getBaseTool() != LLToolPie::getInstance() );
6655 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); 6690 gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value);
6656 return true; 6691 return true;
6657 } 6692 }
@@ -6819,11 +6854,11 @@ class LLToolsEditLinkedParts : public view_listener_t
6819 BOOL select_individuals = gSavedSettings.getBOOL("EditLinkedParts"); 6854 BOOL select_individuals = gSavedSettings.getBOOL("EditLinkedParts");
6820 if (select_individuals) 6855 if (select_individuals)
6821 { 6856 {
6822 gSelectMgr->demoteSelectionToIndividuals(); 6857 LLSelectMgr::getInstance()->demoteSelectionToIndividuals();
6823 } 6858 }
6824 else 6859 else
6825 { 6860 {
6826 gSelectMgr->promoteSelectionToRoot(); 6861 LLSelectMgr::getInstance()->promoteSelectionToRoot();
6827 } 6862 }
6828 return true; 6863 return true;
6829 } 6864 }
@@ -7043,17 +7078,17 @@ class LLToolsUseSelectionForGrid : public view_listener_t
7043{ 7078{
7044 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 7079 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7045 { 7080 {
7046 gSelectMgr->clearGridObjects(); 7081 LLSelectMgr::getInstance()->clearGridObjects();
7047 struct f : public LLSelectedObjectFunctor 7082 struct f : public LLSelectedObjectFunctor
7048 { 7083 {
7049 virtual bool apply(LLViewerObject* objectp) 7084 virtual bool apply(LLViewerObject* objectp)
7050 { 7085 {
7051 gSelectMgr->addGridObject(objectp); 7086 LLSelectMgr::getInstance()->addGridObject(objectp);
7052 return true; 7087 return true;
7053 } 7088 }
7054 } func; 7089 } func;
7055 gSelectMgr->getSelection()->applyToRootObjects(&func); 7090 LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func);
7056 gSelectMgr->setGridMode(GRID_MODE_REF_OBJECT); 7091 LLSelectMgr::getInstance()->setGridMode(GRID_MODE_REF_OBJECT);
7057 if (gFloaterTools) 7092 if (gFloaterTools)
7058 { 7093 {
7059 gFloaterTools->mComboGridMode->setCurrentByIndex((S32)GRID_MODE_REF_OBJECT); 7094 gFloaterTools->mComboGridMode->setCurrentByIndex((S32)GRID_MODE_REF_OBJECT);
@@ -7131,7 +7166,7 @@ void handle_save_to_xml(void*)
7131 if (picker.getSaveFile(LLFilePicker::FFSAVE_XML, default_name.c_str())) 7166 if (picker.getSaveFile(LLFilePicker::FFSAVE_XML, default_name.c_str()))
7132 { 7167 {
7133 LLString filename = picker.getFirstFile(); 7168 LLString filename = picker.getFirstFile();
7134 gUICtrlFactory->saveToXML(frontmost, filename); 7169 LLUICtrlFactory::getInstance()->saveToXML(frontmost, filename);
7135 } 7170 }
7136} 7171}
7137 7172
@@ -7142,15 +7177,19 @@ void handle_load_from_xml(void*)
7142 { 7177 {
7143 LLString filename = picker.getFirstFile(); 7178 LLString filename = picker.getFirstFile();
7144 LLFloater* floater = new LLFloater("sample_floater"); 7179 LLFloater* floater = new LLFloater("sample_floater");
7145 gUICtrlFactory->buildFloater(floater, filename); 7180 LLUICtrlFactory::getInstance()->buildFloater(floater, filename);
7146 } 7181 }
7147} 7182}
7148 7183
7149void handle_slurl_test(void*) 7184void handle_slurl_test(void*)
7150{ 7185{
7151 bool open_app_slurls = true; 7186 const bool open_links_externally = false;
7152 bool open_links_externally = false; 7187 const bool open_app_slurls = true;
7153 LLFloaterHtml::getInstance()->show("http://secondlife.com/app/search/slurls.html", "SLURL Test", open_app_slurls, open_links_externally); 7188 LLFloaterHtml::getInstance()->show(
7189 "http://secondlife.com/app/search/slurls.html",
7190 "SLURL Test",
7191 open_links_externally,
7192 open_app_slurls);
7154} 7193}
7155 7194
7156void handle_rebake_textures(void*) 7195void handle_rebake_textures(void*)
@@ -7510,15 +7549,6 @@ class LLWorldChat : public view_listener_t
7510 } 7549 }
7511}; 7550};
7512 7551
7513class LLWorldStartGesture : public view_listener_t
7514{
7515 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
7516 {
7517 handle_slash_key(NULL);
7518 return true;
7519 }
7520};
7521
7522class LLToolsSelectTool : public view_listener_t 7552class LLToolsSelectTool : public view_listener_t
7523{ 7553{
7524 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) 7554 bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata)
@@ -7526,23 +7556,23 @@ class LLToolsSelectTool : public view_listener_t
7526 LLString tool_name = userdata.asString(); 7556 LLString tool_name = userdata.asString();
7527 if (tool_name == "focus") 7557 if (tool_name == "focus")
7528 { 7558 {
7529 gToolMgr->getCurrentToolset()->selectToolByIndex(1); 7559 LLToolMgr::getInstance()->getCurrentToolset()->selectToolByIndex(1);
7530 } 7560 }
7531 else if (tool_name == "move") 7561 else if (tool_name == "move")
7532 { 7562 {
7533 gToolMgr->getCurrentToolset()->selectToolByIndex(2); 7563 LLToolMgr::getInstance()->getCurrentToolset()->selectToolByIndex(2);
7534 } 7564 }
7535 else if (tool_name == "edit") 7565 else if (tool_name == "edit")
7536 { 7566 {
7537 gToolMgr->getCurrentToolset()->selectToolByIndex(3); 7567 LLToolMgr::getInstance()->getCurrentToolset()->selectToolByIndex(3);
7538 } 7568 }
7539 else if (tool_name == "create") 7569 else if (tool_name == "create")
7540 { 7570 {
7541 gToolMgr->getCurrentToolset()->selectToolByIndex(4); 7571 LLToolMgr::getInstance()->getCurrentToolset()->selectToolByIndex(4);
7542 } 7572 }
7543 else if (tool_name == "land") 7573 else if (tool_name == "land")
7544 { 7574 {
7545 gToolMgr->getCurrentToolset()->selectToolByIndex(5); 7575 LLToolMgr::getInstance()->getCurrentToolset()->selectToolByIndex(5);
7546 } 7576 }
7547 return true; 7577 return true;
7548 } 7578 }
@@ -7706,6 +7736,7 @@ void initialize_menus()
7706 // View menu 7736 // View menu
7707 addMenu(new LLViewMouselook(), "View.Mouselook"); 7737 addMenu(new LLViewMouselook(), "View.Mouselook");
7708 addMenu(new LLViewBuildMode(), "View.BuildMode"); 7738 addMenu(new LLViewBuildMode(), "View.BuildMode");
7739 addMenu(new LLViewJoystickFlycam(), "View.JoystickFlycam");
7709 addMenu(new LLViewResetView(), "View.ResetView"); 7740 addMenu(new LLViewResetView(), "View.ResetView");
7710 addMenu(new LLViewLookAtLastChatter(), "View.LookAtLastChatter"); 7741 addMenu(new LLViewLookAtLastChatter(), "View.LookAtLastChatter");
7711 addMenu(new LLViewShowHoverTips(), "View.ShowHoverTips"); 7742 addMenu(new LLViewShowHoverTips(), "View.ShowHoverTips");
@@ -7724,6 +7755,7 @@ void initialize_menus()
7724 addMenu(new LLViewEnableLastChatter(), "View.EnableLastChatter"); 7755 addMenu(new LLViewEnableLastChatter(), "View.EnableLastChatter");
7725 7756
7726 addMenu(new LLViewCheckBuildMode(), "View.CheckBuildMode"); 7757 addMenu(new LLViewCheckBuildMode(), "View.CheckBuildMode");
7758 addMenu(new LLViewCheckJoystickFlycam(), "View.CheckJoystickFlycam");
7727 addMenu(new LLViewCheckShowHoverTips(), "View.CheckShowHoverTips"); 7759 addMenu(new LLViewCheckShowHoverTips(), "View.CheckShowHoverTips");
7728 addMenu(new LLViewCheckHighlightTransparent(), "View.CheckHighlightTransparent"); 7760 addMenu(new LLViewCheckHighlightTransparent(), "View.CheckHighlightTransparent");
7729 addMenu(new LLViewCheckBeaconEnabled(), "View.CheckBeaconEnabled"); 7761 addMenu(new LLViewCheckBeaconEnabled(), "View.CheckBeaconEnabled");
@@ -7732,7 +7764,6 @@ void initialize_menus()
7732 7764
7733 // World menu 7765 // World menu
7734 addMenu(new LLWorldChat(), "World.Chat"); 7766 addMenu(new LLWorldChat(), "World.Chat");
7735 addMenu(new LLWorldStartGesture(), "World.StartGesture");
7736 addMenu(new LLWorldAlwaysRun(), "World.AlwaysRun"); 7767 addMenu(new LLWorldAlwaysRun(), "World.AlwaysRun");
7737 addMenu(new LLWorldFly(), "World.Fly"); 7768 addMenu(new LLWorldFly(), "World.Fly");
7738 addMenu(new LLWorldCreateLandmark(), "World.CreateLandmark"); 7769 addMenu(new LLWorldCreateLandmark(), "World.CreateLandmark");
@@ -7785,7 +7816,6 @@ void initialize_menus()
7785 addMenu(new LLToolsVisibleTakeObject(), "Tools.VisibleTakeObject");*/ 7816 addMenu(new LLToolsVisibleTakeObject(), "Tools.VisibleTakeObject");*/
7786 7817
7787 // Help menu 7818 // Help menu
7788 addMenu(new LLHelpMOTD(), "Help.MOTD");
7789 // most items use the ShowFloater method 7819 // most items use the ShowFloater method
7790 7820
7791 // Self pie menu 7821 // Self pie menu