diff options
author | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:45:34 -0500 |
commit | cd17687f01420952712a500107e0f93e7ab8d5f8 (patch) | |
tree | ce48c2b706f2c1176290e39fb555fbdf6648ce01 /linden/indra/newview/llviewermenu.cpp | |
parent | Second Life viewer sources 1.19.0.5 (diff) | |
download | meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.zip meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.gz meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.bz2 meta-impy-cd17687f01420952712a500107e0f93e7ab8d5f8.tar.xz |
Second Life viewer sources 1.19.1.0
Diffstat (limited to 'linden/indra/newview/llviewermenu.cpp')
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 412 |
1 files changed, 270 insertions, 142 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 18bdaad..0f48d7d 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -94,6 +94,7 @@ | |||
94 | #include "llfloaterbuyland.h" | 94 | #include "llfloaterbuyland.h" |
95 | #include "llfloaterchat.h" | 95 | #include "llfloaterchat.h" |
96 | #include "llfloatercustomize.h" | 96 | #include "llfloatercustomize.h" |
97 | #include "llfloaterdaycycle.h" | ||
97 | #include "llfloaterdirectory.h" | 98 | #include "llfloaterdirectory.h" |
98 | #include "llfloatereditui.h" | 99 | #include "llfloatereditui.h" |
99 | #include "llfloaterchatterbox.h" | 100 | #include "llfloaterchatterbox.h" |
@@ -104,6 +105,7 @@ | |||
104 | #include "llfloatergroupinvite.h" | 105 | #include "llfloatergroupinvite.h" |
105 | #include "llfloatergroups.h" | 106 | #include "llfloatergroups.h" |
106 | #include "llfloaterhtml.h" | 107 | #include "llfloaterhtml.h" |
108 | #include "llfloaterhtmlhelp.h" | ||
107 | #include "llfloaterinspect.h" | 109 | #include "llfloaterinspect.h" |
108 | #include "llfloaterlagmeter.h" | 110 | #include "llfloaterlagmeter.h" |
109 | #include "llfloaterland.h" | 111 | #include "llfloaterland.h" |
@@ -112,12 +114,16 @@ | |||
112 | #include "llfloatermute.h" | 114 | #include "llfloatermute.h" |
113 | #include "llfloateropenobject.h" | 115 | #include "llfloateropenobject.h" |
114 | #include "llfloaterpermissionsmgr.h" | 116 | #include "llfloaterpermissionsmgr.h" |
117 | #include "llfloaterpostprocess.h" | ||
115 | #include "llfloaterpreference.h" | 118 | #include "llfloaterpreference.h" |
116 | #include "llfloaterregioninfo.h" | 119 | #include "llfloaterregioninfo.h" |
117 | #include "llfloaterreporter.h" | 120 | #include "llfloaterreporter.h" |
118 | #include "llfloaterscriptdebug.h" | 121 | #include "llfloaterscriptdebug.h" |
122 | #include "llfloaterenvsettings.h" | ||
119 | #include "llfloatertest.h" | 123 | #include "llfloatertest.h" |
120 | #include "llfloatertools.h" | 124 | #include "llfloatertools.h" |
125 | #include "llfloaterwater.h" | ||
126 | #include "llfloaterwindlight.h" | ||
121 | #include "llfloaterworldmap.h" | 127 | #include "llfloaterworldmap.h" |
122 | #include "llframestats.h" | 128 | #include "llframestats.h" |
123 | #include "llframestatview.h" | 129 | #include "llframestatview.h" |
@@ -192,6 +198,9 @@ | |||
192 | #include "llappviewer.h" | 198 | #include "llappviewer.h" |
193 | #include "roles_constants.h" | 199 | #include "roles_constants.h" |
194 | #include "llviewerjoystick.h" | 200 | #include "llviewerjoystick.h" |
201 | #include "llwlanimator.h" | ||
202 | #include "llwlparammanager.h" | ||
203 | #include "llwaterparammanager.h" | ||
195 | 204 | ||
196 | #include "lltexlayer.h" | 205 | #include "lltexlayer.h" |
197 | 206 | ||
@@ -244,8 +253,8 @@ LLPieMenu *gPieLand = NULL; | |||
244 | 253 | ||
245 | // local constants | 254 | // local constants |
246 | const LLString LANDMARK_MENU_NAME("Landmarks"); | 255 | const LLString LANDMARK_MENU_NAME("Landmarks"); |
247 | const LLString CLIENT_MENU_NAME("Client"); | 256 | const LLString CLIENT_MENU_NAME("Advanced"); |
248 | const LLString SERVER_MENU_NAME("Server"); | 257 | const LLString SERVER_MENU_NAME("Admin"); |
249 | 258 | ||
250 | const LLString SAVE_INTO_INVENTORY("Save Object Back to My Inventory"); | 259 | const LLString SAVE_INTO_INVENTORY("Save Object Back to My Inventory"); |
251 | const LLString SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents"); | 260 | const LLString SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents"); |
@@ -423,7 +432,6 @@ BOOL enable_dehinge(void*); | |||
423 | void handle_force_delete(void*); | 432 | void handle_force_delete(void*); |
424 | void print_object_info(void*); | 433 | void print_object_info(void*); |
425 | void print_agent_nvpairs(void*); | 434 | void print_agent_nvpairs(void*); |
426 | void show_debug_menus(); | ||
427 | void toggle_debug_menus(void*); | 435 | void toggle_debug_menus(void*); |
428 | void toggle_map( void* user_data ); | 436 | void toggle_map( void* user_data ); |
429 | void export_info_callback(LLAssetInfo *info, void **user_data, S32 result); | 437 | void export_info_callback(LLAssetInfo *info, void **user_data, S32 result); |
@@ -612,13 +620,13 @@ void set_underclothes_menu_options() | |||
612 | { | 620 | { |
613 | if (gMenuHolder && gAgent.isTeen()) | 621 | if (gMenuHolder && gAgent.isTeen()) |
614 | { | 622 | { |
615 | gMenuHolder->getChildByName("Self Underpants", TRUE)->setVisible(FALSE); | 623 | gMenuHolder->getChild<LLView>("Self Underpants", TRUE)->setVisible(FALSE); |
616 | gMenuHolder->getChildByName("Self Undershirt", TRUE)->setVisible(FALSE); | 624 | gMenuHolder->getChild<LLView>("Self Undershirt", TRUE)->setVisible(FALSE); |
617 | } | 625 | } |
618 | if (gMenuBarView && gAgent.isTeen()) | 626 | if (gMenuBarView && gAgent.isTeen()) |
619 | { | 627 | { |
620 | gMenuBarView->getChildByName("Menu Underpants", TRUE)->setVisible(FALSE); | 628 | gMenuBarView->getChild<LLView>("Menu Underpants", TRUE)->setVisible(FALSE); |
621 | gMenuBarView->getChildByName("Menu Undershirt", TRUE)->setVisible(FALSE); | 629 | gMenuBarView->getChild<LLView>("Menu Undershirt", TRUE)->setVisible(FALSE); |
622 | } | 630 | } |
623 | } | 631 | } |
624 | 632 | ||
@@ -655,16 +663,16 @@ void init_menus() | |||
655 | gPieSelf = gUICtrlFactory->buildPieMenu("menu_pie_self.xml", gMenuHolder); | 663 | gPieSelf = gUICtrlFactory->buildPieMenu("menu_pie_self.xml", gMenuHolder); |
656 | 664 | ||
657 | // TomY TODO: what shall we do about these? | 665 | // TomY TODO: what shall we do about these? |
658 | gDetachScreenPieMenu = (LLPieMenu*)gMenuHolder->getChildByName("Object Detach HUD", true); | 666 | gDetachScreenPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Detach HUD", true); |
659 | gDetachPieMenu = (LLPieMenu*)gMenuHolder->getChildByName("Object Detach", true); | 667 | gDetachPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Detach", true); |
660 | 668 | ||
661 | gPieAvatar = gUICtrlFactory->buildPieMenu("menu_pie_avatar.xml", gMenuHolder); | 669 | gPieAvatar = gUICtrlFactory->buildPieMenu("menu_pie_avatar.xml", gMenuHolder); |
662 | 670 | ||
663 | gPieObject = gUICtrlFactory->buildPieMenu("menu_pie_object.xml", gMenuHolder); | 671 | gPieObject = gUICtrlFactory->buildPieMenu("menu_pie_object.xml", gMenuHolder); |
664 | 672 | ||
665 | gAttachScreenPieMenu = (LLPieMenu*)gMenuHolder->getChildByName("Object Attach HUD", true); | 673 | gAttachScreenPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Attach HUD"); |
666 | gAttachPieMenu = (LLPieMenu*)gMenuHolder->getChildByName("Object Attach", true); | 674 | gAttachPieMenu = gMenuHolder->getChild<LLPieMenu>("Object Attach"); |
667 | gPieRate = (LLPieMenu*)gMenuHolder->getChildByName("Rate Menu", true); | 675 | gPieRate = gMenuHolder->getChild<LLPieMenu>("Rate Menu"); |
668 | 676 | ||
669 | gPieAttachment = gUICtrlFactory->buildPieMenu("menu_pie_attachment.xml", gMenuHolder); | 677 | gPieAttachment = gUICtrlFactory->buildPieMenu("menu_pie_attachment.xml", gMenuHolder); |
670 | 678 | ||
@@ -714,8 +722,8 @@ void init_menus() | |||
714 | gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", upload_cost); | 722 | gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", upload_cost); |
715 | gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", upload_cost); | 723 | gMenuHolder->childSetLabelArg("Bulk Upload", "[COST]", upload_cost); |
716 | 724 | ||
717 | gAFKMenu = (LLMenuItemCallGL*)gMenuBarView->getChildByName("Set Away", TRUE); | 725 | gAFKMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Away", TRUE); |
718 | gBusyMenu = (LLMenuItemCallGL*)gMenuBarView->getChildByName("Set Busy", TRUE); | 726 | gBusyMenu = gMenuBarView->getChild<LLMenuItemCallGL>("Set Busy", TRUE); |
719 | gAttachSubMenu = gMenuBarView->getChildMenuByName("Attach Object", TRUE); | 727 | gAttachSubMenu = gMenuBarView->getChildMenuByName("Attach Object", TRUE); |
720 | gDetachSubMenu = gMenuBarView->getChildMenuByName("Detach Object", TRUE); | 728 | gDetachSubMenu = gMenuBarView->getChildMenuByName("Detach Object", TRUE); |
721 | 729 | ||
@@ -1100,17 +1108,26 @@ void init_client_menu(LLMenuGL* menu) | |||
1100 | 1108 | ||
1101 | menu->append(new LLMenuItemCallGL("Debug Settings", LLFloaterSettingsDebug::show, NULL, NULL)); | 1109 | menu->append(new LLMenuItemCallGL("Debug Settings", LLFloaterSettingsDebug::show, NULL, NULL)); |
1102 | menu->append(new LLMenuItemCheckGL("View Admin Options", &handle_admin_override_toggle, NULL, &check_admin_override, NULL, 'V', MASK_CONTROL | MASK_ALT)); | 1110 | menu->append(new LLMenuItemCheckGL("View Admin Options", &handle_admin_override_toggle, NULL, &check_admin_override, NULL, 'V', MASK_CONTROL | MASK_ALT)); |
1111 | |||
1112 | menu->append(new LLMenuItemCallGL("Request Admin Status", | ||
1113 | &handle_god_mode, NULL, NULL, 'G', MASK_ALT | MASK_CONTROL)); | ||
1114 | |||
1115 | menu->append(new LLMenuItemCallGL("Leave Admin Status", | ||
1116 | &handle_leave_god_mode, NULL, NULL, 'G', MASK_ALT | MASK_SHIFT | MASK_CONTROL)); | ||
1117 | |||
1103 | menu->createJumpKeys(); | 1118 | menu->createJumpKeys(); |
1104 | } | 1119 | } |
1105 | 1120 | ||
1106 | void init_debug_world_menu(LLMenuGL* menu) | 1121 | void init_debug_world_menu(LLMenuGL* menu) |
1107 | { | 1122 | { |
1123 | /* REMOVE mouse move sun from menu options | ||
1108 | menu->append(new LLMenuItemCheckGL("Mouse Moves Sun", | 1124 | menu->append(new LLMenuItemCheckGL("Mouse Moves Sun", |
1109 | &menu_toggle_control, | 1125 | &menu_toggle_control, |
1110 | NULL, | 1126 | NULL, |
1111 | &menu_check_control, | 1127 | &menu_check_control, |
1112 | (void*)"MouseSun", | 1128 | (void*)"MouseSun", |
1113 | 'M', MASK_CONTROL|MASK_ALT)); | 1129 | 'M', MASK_CONTROL|MASK_ALT)); |
1130 | */ | ||
1114 | menu->append(new LLMenuItemCheckGL("Sim Sun Override", | 1131 | menu->append(new LLMenuItemCheckGL("Sim Sun Override", |
1115 | &menu_toggle_control, | 1132 | &menu_toggle_control, |
1116 | NULL, | 1133 | NULL, |
@@ -1179,6 +1196,7 @@ void init_debug_ui_menu(LLMenuGL* menu) | |||
1179 | menu->appendSeparator(); | 1196 | menu->appendSeparator(); |
1180 | menu->append(new LLMenuItemCheckGL("Show Time", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowTime")); | 1197 | menu->append(new LLMenuItemCheckGL("Show Time", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowTime")); |
1181 | menu->append(new LLMenuItemCheckGL("Show Render Info", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderInfo")); | 1198 | menu->append(new LLMenuItemCheckGL("Show Render Info", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderInfo")); |
1199 | menu->append(new LLMenuItemCheckGL("Show Color Under Cursor", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowColor")); | ||
1182 | 1200 | ||
1183 | menu->createJumpKeys(); | 1201 | menu->createJumpKeys(); |
1184 | } | 1202 | } |
@@ -1322,6 +1340,9 @@ void init_debug_rendering_menu(LLMenuGL* menu) | |||
1322 | sub_menu->append(new LLMenuItemCheckGL("Occlusion", &LLPipeline::toggleRenderDebug, NULL, | 1340 | sub_menu->append(new LLMenuItemCheckGL("Occlusion", &LLPipeline::toggleRenderDebug, NULL, |
1323 | &LLPipeline::toggleRenderDebugControl, | 1341 | &LLPipeline::toggleRenderDebugControl, |
1324 | (void*)LLPipeline::RENDER_DEBUG_OCCLUSION)); | 1342 | (void*)LLPipeline::RENDER_DEBUG_OCCLUSION)); |
1343 | sub_menu->append(new LLMenuItemCheckGL("Render Batches", &LLPipeline::toggleRenderDebug, NULL, | ||
1344 | &LLPipeline::toggleRenderDebugControl, | ||
1345 | (void*)LLPipeline::RENDER_DEBUG_BATCH_SIZE)); | ||
1325 | sub_menu->append(new LLMenuItemCheckGL("Animated Textures", &LLPipeline::toggleRenderDebug, NULL, | 1346 | sub_menu->append(new LLMenuItemCheckGL("Animated Textures", &LLPipeline::toggleRenderDebug, NULL, |
1326 | &LLPipeline::toggleRenderDebugControl, | 1347 | &LLPipeline::toggleRenderDebugControl, |
1327 | (void*)LLPipeline::RENDER_DEBUG_TEXTURE_ANIM)); | 1348 | (void*)LLPipeline::RENDER_DEBUG_TEXTURE_ANIM)); |
@@ -1337,18 +1358,15 @@ void init_debug_rendering_menu(LLMenuGL* menu) | |||
1337 | sub_menu->append(new LLMenuItemCheckGL("Pick Render", &LLPipeline::toggleRenderDebug, NULL, | 1358 | sub_menu->append(new LLMenuItemCheckGL("Pick Render", &LLPipeline::toggleRenderDebug, NULL, |
1338 | &LLPipeline::toggleRenderDebugControl, | 1359 | &LLPipeline::toggleRenderDebugControl, |
1339 | (void*)LLPipeline::RENDER_DEBUG_PICKING)); | 1360 | (void*)LLPipeline::RENDER_DEBUG_PICKING)); |
1361 | sub_menu->append(new LLMenuItemCheckGL("Lights", &LLPipeline::toggleRenderDebug, NULL, | ||
1362 | &LLPipeline::toggleRenderDebugControl, | ||
1363 | (void*)LLPipeline::RENDER_DEBUG_LIGHTS)); | ||
1340 | sub_menu->append(new LLMenuItemCheckGL("Particles", &LLPipeline::toggleRenderDebug, NULL, | 1364 | sub_menu->append(new LLMenuItemCheckGL("Particles", &LLPipeline::toggleRenderDebug, NULL, |
1341 | &LLPipeline::toggleRenderDebugControl, | 1365 | &LLPipeline::toggleRenderDebugControl, |
1342 | (void*)LLPipeline::RENDER_DEBUG_PARTICLES)); | 1366 | (void*)LLPipeline::RENDER_DEBUG_PARTICLES)); |
1343 | sub_menu->append(new LLMenuItemCheckGL("Composition", &LLPipeline::toggleRenderDebug, NULL, | 1367 | sub_menu->append(new LLMenuItemCheckGL("Composition", &LLPipeline::toggleRenderDebug, NULL, |
1344 | &LLPipeline::toggleRenderDebugControl, | 1368 | &LLPipeline::toggleRenderDebugControl, |
1345 | (void*)LLPipeline::RENDER_DEBUG_COMPOSITION)); | 1369 | (void*)LLPipeline::RENDER_DEBUG_COMPOSITION)); |
1346 | sub_menu->append(new LLMenuItemCheckGL("ShadowMap", &LLPipeline::toggleRenderDebug, NULL, | ||
1347 | &LLPipeline::toggleRenderDebugControl, | ||
1348 | (void*)LLPipeline::RENDER_DEBUG_SHADOW_MAP)); | ||
1349 | sub_menu->append(new LLMenuItemCheckGL("LightTrace",&LLPipeline::toggleRenderDebug, NULL, | ||
1350 | &LLPipeline::toggleRenderDebugControl, | ||
1351 | (void*)LLPipeline::RENDER_DEBUG_LIGHT_TRACE)); | ||
1352 | sub_menu->append(new LLMenuItemCheckGL("Glow",&LLPipeline::toggleRenderDebug, NULL, | 1370 | sub_menu->append(new LLMenuItemCheckGL("Glow",&LLPipeline::toggleRenderDebug, NULL, |
1353 | &LLPipeline::toggleRenderDebugControl, | 1371 | &LLPipeline::toggleRenderDebugControl, |
1354 | (void*)LLPipeline::RENDER_DEBUG_GLOW)); | 1372 | (void*)LLPipeline::RENDER_DEBUG_GLOW)); |
@@ -1373,6 +1391,9 @@ void init_debug_rendering_menu(LLMenuGL* menu) | |||
1373 | sub_menu->append(new LLMenuItemToggleGL("Randomize Framerate", &gRandomizeFramerate)); | 1391 | sub_menu->append(new LLMenuItemToggleGL("Randomize Framerate", &gRandomizeFramerate)); |
1374 | 1392 | ||
1375 | sub_menu->append(new LLMenuItemToggleGL("Periodic Slow Frame", &gPeriodicSlowFrame)); | 1393 | sub_menu->append(new LLMenuItemToggleGL("Periodic Slow Frame", &gPeriodicSlowFrame)); |
1394 | |||
1395 | sub_menu->append(new LLMenuItemToggleGL("Frame Test", &LLPipeline::sRenderFrameTest)); | ||
1396 | |||
1376 | sub_menu->createJumpKeys(); | 1397 | sub_menu->createJumpKeys(); |
1377 | 1398 | ||
1378 | menu->appendMenu( sub_menu ); | 1399 | menu->appendMenu( sub_menu ); |
@@ -1396,6 +1417,8 @@ void init_debug_rendering_menu(LLMenuGL* menu) | |||
1396 | item->setEnabled(gGLManager.mHasOcclusionQuery && gFeatureManagerp->isFeatureAvailable("UseOcclusion")); | 1417 | item->setEnabled(gGLManager.mHasOcclusionQuery && gFeatureManagerp->isFeatureAvailable("UseOcclusion")); |
1397 | menu->append(item); | 1418 | menu->append(item); |
1398 | 1419 | ||
1420 | item = new LLMenuItemCheckGL("Fast Alpha", menu_toggle_control, NULL, menu_check_control, (void*)"RenderFastAlpha"); | ||
1421 | menu->append(item); | ||
1399 | 1422 | ||
1400 | item = new LLMenuItemCheckGL("Animate Textures", menu_toggle_control, NULL, menu_check_control, (void*)"AnimateTextures"); | 1423 | item = new LLMenuItemCheckGL("Animate Textures", menu_toggle_control, NULL, menu_check_control, (void*)"AnimateTextures"); |
1401 | menu->append(item); | 1424 | menu->append(item); |
@@ -1585,19 +1608,11 @@ void init_server_menu(LLMenuGL* menu) | |||
1585 | &LLPanelRegionTools::onSaveState, &enable_god_customer_service, NULL)); | 1608 | &LLPanelRegionTools::onSaveState, &enable_god_customer_service, NULL)); |
1586 | 1609 | ||
1587 | // menu->append(new LLMenuItemCallGL("Force Join Group", handle_force_join_group)); | 1610 | // menu->append(new LLMenuItemCallGL("Force Join Group", handle_force_join_group)); |
1588 | 1611 | // | |
1589 | 1612 | // menu->appendSeparator(); | |
1590 | |||
1591 | menu->appendSeparator(); | ||
1592 | // | 1613 | // |
1593 | // menu->append(new LLMenuItemCallGL( "OverlayTitle", | 1614 | // menu->append(new LLMenuItemCallGL( "OverlayTitle", |
1594 | // &handle_show_overlay_title, &enable_god_customer_service, NULL)); | 1615 | // &handle_show_overlay_title, &enable_god_customer_service, NULL)); |
1595 | |||
1596 | menu->append(new LLMenuItemCallGL("Request Admin Status", | ||
1597 | &handle_god_mode, NULL, NULL, 'G', MASK_ALT | MASK_CONTROL)); | ||
1598 | |||
1599 | menu->append(new LLMenuItemCallGL("Leave Admin Status", | ||
1600 | &handle_leave_god_mode, NULL, NULL, 'G', MASK_ALT | MASK_SHIFT | MASK_CONTROL)); | ||
1601 | menu->createJumpKeys(); | 1616 | menu->createJumpKeys(); |
1602 | } | 1617 | } |
1603 | 1618 | ||
@@ -2009,11 +2024,12 @@ class LLSelfEnableRemoveAllAttachments : public view_listener_t | |||
2009 | if (gAgent.getAvatarObject()) | 2024 | if (gAgent.getAvatarObject()) |
2010 | { | 2025 | { |
2011 | LLVOAvatar* avatarp = gAgent.getAvatarObject(); | 2026 | LLVOAvatar* avatarp = gAgent.getAvatarObject(); |
2012 | for (LLViewerJointAttachment* attachmentp = avatarp->mAttachmentPoints.getFirstData(); | 2027 | for (LLVOAvatar::attachment_map_t::iterator iter = avatarp->mAttachmentPoints.begin(); |
2013 | attachmentp; | 2028 | iter != avatarp->mAttachmentPoints.end(); ) |
2014 | attachmentp = avatarp->mAttachmentPoints.getNextData()) | ||
2015 | { | 2029 | { |
2016 | if (attachmentp->getObject()) | 2030 | LLVOAvatar::attachment_map_t::iterator curiter = iter++; |
2031 | LLViewerJointAttachment* attachment = curiter->second; | ||
2032 | if (attachment->getObject()) | ||
2017 | { | 2033 | { |
2018 | new_value = true; | 2034 | new_value = true; |
2019 | break; | 2035 | break; |
@@ -2625,12 +2641,10 @@ BOOL check_admin_override(void*) | |||
2625 | 2641 | ||
2626 | void handle_admin_override_toggle(void*) | 2642 | void handle_admin_override_toggle(void*) |
2627 | { | 2643 | { |
2628 | if(!gAgent.getAdminOverride()) | 2644 | gAgent.setAdminOverride(!gAgent.getAdminOverride()); |
2629 | { | 2645 | |
2630 | gAgent.setAdminOverride(TRUE); | 2646 | // The above may have affected which debug menus are visible |
2631 | show_debug_menus(); | 2647 | show_debug_menus(); |
2632 | } | ||
2633 | else gAgent.setAdminOverride(FALSE); | ||
2634 | } | 2648 | } |
2635 | 2649 | ||
2636 | void handle_god_mode(void*) | 2650 | void handle_god_mode(void*) |
@@ -2647,7 +2661,6 @@ void set_god_level(U8 god_level) | |||
2647 | { | 2661 | { |
2648 | U8 old_god_level = gAgent.getGodLevel(); | 2662 | U8 old_god_level = gAgent.getGodLevel(); |
2649 | gAgent.setGodLevel( god_level ); | 2663 | gAgent.setGodLevel( god_level ); |
2650 | show_debug_menus(); | ||
2651 | gIMMgr->refresh(); | 2664 | gIMMgr->refresh(); |
2652 | gParcelMgr->notifyObservers(); | 2665 | gParcelMgr->notifyObservers(); |
2653 | 2666 | ||
@@ -2679,6 +2692,9 @@ void set_god_level(U8 god_level) | |||
2679 | LLNotifyBox::showXml("LeavingGodMode", args); | 2692 | LLNotifyBox::showXml("LeavingGodMode", args); |
2680 | } | 2693 | } |
2681 | 2694 | ||
2695 | |||
2696 | // changing god-level can affect which menus we see | ||
2697 | show_debug_menus(); | ||
2682 | } | 2698 | } |
2683 | 2699 | ||
2684 | #ifdef TOGGLE_HACKED_GODLIKE_VIEWER | 2700 | #ifdef TOGGLE_HACKED_GODLIKE_VIEWER |
@@ -3349,9 +3365,9 @@ class LLEditDuplicate : public view_listener_t | |||
3349 | { | 3365 | { |
3350 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 3366 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
3351 | { | 3367 | { |
3352 | if(gEditMenuHandler) | 3368 | if(LLEditMenuHandler::gEditMenuHandler) |
3353 | { | 3369 | { |
3354 | gEditMenuHandler->duplicate(); | 3370 | LLEditMenuHandler::gEditMenuHandler->duplicate(); |
3355 | } | 3371 | } |
3356 | return true; | 3372 | return true; |
3357 | } | 3373 | } |
@@ -3361,7 +3377,7 @@ class LLEditEnableDuplicate : public view_listener_t | |||
3361 | { | 3377 | { |
3362 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 3378 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
3363 | { | 3379 | { |
3364 | bool new_value = gEditMenuHandler && gEditMenuHandler->canDuplicate(); | 3380 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDuplicate(); |
3365 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 3381 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
3366 | return true; | 3382 | return true; |
3367 | } | 3383 | } |
@@ -4443,7 +4459,7 @@ class LLEditEnableCut : public view_listener_t | |||
4443 | { | 4459 | { |
4444 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4460 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4445 | { | 4461 | { |
4446 | bool new_value = gEditMenuHandler && gEditMenuHandler->canCut(); | 4462 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canCut(); |
4447 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4463 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4448 | return true; | 4464 | return true; |
4449 | } | 4465 | } |
@@ -4453,9 +4469,9 @@ class LLEditCut : public view_listener_t | |||
4453 | { | 4469 | { |
4454 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4470 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4455 | { | 4471 | { |
4456 | if( gEditMenuHandler ) | 4472 | if( LLEditMenuHandler::gEditMenuHandler ) |
4457 | { | 4473 | { |
4458 | gEditMenuHandler->cut(); | 4474 | LLEditMenuHandler::gEditMenuHandler->cut(); |
4459 | } | 4475 | } |
4460 | return true; | 4476 | return true; |
4461 | } | 4477 | } |
@@ -4465,7 +4481,7 @@ class LLEditEnableCopy : public view_listener_t | |||
4465 | { | 4481 | { |
4466 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4482 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4467 | { | 4483 | { |
4468 | bool new_value = gEditMenuHandler && gEditMenuHandler->canCopy(); | 4484 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canCopy(); |
4469 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4485 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4470 | return true; | 4486 | return true; |
4471 | } | 4487 | } |
@@ -4475,9 +4491,9 @@ class LLEditCopy : public view_listener_t | |||
4475 | { | 4491 | { |
4476 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4492 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4477 | { | 4493 | { |
4478 | if( gEditMenuHandler ) | 4494 | if( LLEditMenuHandler::gEditMenuHandler ) |
4479 | { | 4495 | { |
4480 | gEditMenuHandler->copy(); | 4496 | LLEditMenuHandler::gEditMenuHandler->copy(); |
4481 | } | 4497 | } |
4482 | return true; | 4498 | return true; |
4483 | } | 4499 | } |
@@ -4487,7 +4503,7 @@ class LLEditEnablePaste : public view_listener_t | |||
4487 | { | 4503 | { |
4488 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4504 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4489 | { | 4505 | { |
4490 | bool new_value = gEditMenuHandler && gEditMenuHandler->canPaste(); | 4506 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canPaste(); |
4491 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4507 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4492 | return true; | 4508 | return true; |
4493 | } | 4509 | } |
@@ -4497,9 +4513,9 @@ class LLEditPaste : public view_listener_t | |||
4497 | { | 4513 | { |
4498 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4514 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4499 | { | 4515 | { |
4500 | if( gEditMenuHandler ) | 4516 | if( LLEditMenuHandler::gEditMenuHandler ) |
4501 | { | 4517 | { |
4502 | gEditMenuHandler->paste(); | 4518 | LLEditMenuHandler::gEditMenuHandler->paste(); |
4503 | } | 4519 | } |
4504 | return true; | 4520 | return true; |
4505 | } | 4521 | } |
@@ -4509,7 +4525,7 @@ class LLEditEnableDelete : public view_listener_t | |||
4509 | { | 4525 | { |
4510 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4526 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4511 | { | 4527 | { |
4512 | bool new_value = gEditMenuHandler && gEditMenuHandler->canDoDelete(); | 4528 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete(); |
4513 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4529 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4514 | return true; | 4530 | return true; |
4515 | } | 4531 | } |
@@ -4521,9 +4537,9 @@ class LLEditDelete : public view_listener_t | |||
4521 | { | 4537 | { |
4522 | // If a text field can do a deletion, it gets precedence over deleting | 4538 | // If a text field can do a deletion, it gets precedence over deleting |
4523 | // an object in the world. | 4539 | // an object in the world. |
4524 | if( gEditMenuHandler && gEditMenuHandler->canDoDelete()) | 4540 | if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDoDelete()) |
4525 | { | 4541 | { |
4526 | gEditMenuHandler->doDelete(); | 4542 | LLEditMenuHandler::gEditMenuHandler->doDelete(); |
4527 | } | 4543 | } |
4528 | 4544 | ||
4529 | // and close any pie/context menus when done | 4545 | // and close any pie/context menus when done |
@@ -4603,7 +4619,7 @@ class LLEditEnableDeselect : public view_listener_t | |||
4603 | { | 4619 | { |
4604 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4620 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4605 | { | 4621 | { |
4606 | bool new_value = gEditMenuHandler && gEditMenuHandler->canDeselect(); | 4622 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canDeselect(); |
4607 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4623 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4608 | return true; | 4624 | return true; |
4609 | } | 4625 | } |
@@ -4613,9 +4629,9 @@ class LLEditDeselect : public view_listener_t | |||
4613 | { | 4629 | { |
4614 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4630 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4615 | { | 4631 | { |
4616 | if( gEditMenuHandler ) | 4632 | if( LLEditMenuHandler::gEditMenuHandler ) |
4617 | { | 4633 | { |
4618 | gEditMenuHandler->deselect(); | 4634 | LLEditMenuHandler::gEditMenuHandler->deselect(); |
4619 | } | 4635 | } |
4620 | return true; | 4636 | return true; |
4621 | } | 4637 | } |
@@ -4625,7 +4641,7 @@ class LLEditEnableSelectAll : public view_listener_t | |||
4625 | { | 4641 | { |
4626 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4642 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4627 | { | 4643 | { |
4628 | bool new_value = gEditMenuHandler && gEditMenuHandler->canSelectAll(); | 4644 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canSelectAll(); |
4629 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4645 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4630 | return true; | 4646 | return true; |
4631 | } | 4647 | } |
@@ -4636,9 +4652,9 @@ class LLEditSelectAll : public view_listener_t | |||
4636 | { | 4652 | { |
4637 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4653 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4638 | { | 4654 | { |
4639 | if( gEditMenuHandler ) | 4655 | if( LLEditMenuHandler::gEditMenuHandler ) |
4640 | { | 4656 | { |
4641 | gEditMenuHandler->selectAll(); | 4657 | LLEditMenuHandler::gEditMenuHandler->selectAll(); |
4642 | } | 4658 | } |
4643 | return true; | 4659 | return true; |
4644 | } | 4660 | } |
@@ -4649,7 +4665,7 @@ class LLEditEnableUndo : public view_listener_t | |||
4649 | { | 4665 | { |
4650 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4666 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4651 | { | 4667 | { |
4652 | bool new_value = gEditMenuHandler && gEditMenuHandler->canUndo(); | 4668 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canUndo(); |
4653 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4669 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4654 | return true; | 4670 | return true; |
4655 | } | 4671 | } |
@@ -4659,9 +4675,9 @@ class LLEditUndo : public view_listener_t | |||
4659 | { | 4675 | { |
4660 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4676 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4661 | { | 4677 | { |
4662 | if( gEditMenuHandler && gEditMenuHandler->canUndo() ) | 4678 | if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canUndo() ) |
4663 | { | 4679 | { |
4664 | gEditMenuHandler->undo(); | 4680 | LLEditMenuHandler::gEditMenuHandler->undo(); |
4665 | } | 4681 | } |
4666 | return true; | 4682 | return true; |
4667 | } | 4683 | } |
@@ -4671,7 +4687,7 @@ class LLEditEnableRedo : public view_listener_t | |||
4671 | { | 4687 | { |
4672 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4688 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4673 | { | 4689 | { |
4674 | bool new_value = gEditMenuHandler && gEditMenuHandler->canRedo(); | 4690 | bool new_value = LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canRedo(); |
4675 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 4691 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4676 | return true; | 4692 | return true; |
4677 | } | 4693 | } |
@@ -4681,9 +4697,9 @@ class LLEditRedo : public view_listener_t | |||
4681 | { | 4697 | { |
4682 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4698 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4683 | { | 4699 | { |
4684 | if( gEditMenuHandler && gEditMenuHandler->canRedo() ) | 4700 | if( LLEditMenuHandler::gEditMenuHandler && LLEditMenuHandler::gEditMenuHandler->canRedo() ) |
4685 | { | 4701 | { |
4686 | gEditMenuHandler->redo(); | 4702 | LLEditMenuHandler::gEditMenuHandler->redo(); |
4687 | } | 4703 | } |
4688 | return true; | 4704 | return true; |
4689 | } | 4705 | } |
@@ -4729,8 +4745,12 @@ void show_debug_menus() | |||
4729 | 4745 | ||
4730 | gMenuBarView->setItemVisible(CLIENT_MENU_NAME, debug); | 4746 | gMenuBarView->setItemVisible(CLIENT_MENU_NAME, debug); |
4731 | gMenuBarView->setItemEnabled(CLIENT_MENU_NAME, debug); | 4747 | gMenuBarView->setItemEnabled(CLIENT_MENU_NAME, debug); |
4732 | gMenuBarView->setItemVisible(SERVER_MENU_NAME, debug); | 4748 | |
4733 | gMenuBarView->setItemEnabled(SERVER_MENU_NAME, debug); | 4749 | // Server ('Admin') menu hidden when not in godmode. |
4750 | const bool show_server_menu = debug && (gAgent.getGodLevel() > GOD_NOT); | ||
4751 | gMenuBarView->setItemVisible(SERVER_MENU_NAME, show_server_menu); | ||
4752 | gMenuBarView->setItemEnabled(SERVER_MENU_NAME, show_server_menu); | ||
4753 | |||
4734 | //gMenuBarView->setItemVisible(LLString("DebugOptions"), visible); | 4754 | //gMenuBarView->setItemVisible(LLString("DebugOptions"), visible); |
4735 | //gMenuBarView->setItemVisible(LLString(AVI_TOOLS), visible); | 4755 | //gMenuBarView->setItemVisible(LLString(AVI_TOOLS), visible); |
4736 | }; | 4756 | }; |
@@ -5199,40 +5219,6 @@ void handle_force_unlock(void*) | |||
5199 | gSelectMgr->getSelection()->applyToObjects(&func); | 5219 | gSelectMgr->getSelection()->applyToObjects(&func); |
5200 | } | 5220 | } |
5201 | 5221 | ||
5202 | class LLWorldForceSun : public view_listener_t | ||
5203 | { | ||
5204 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
5205 | { | ||
5206 | LLString tod = userdata.asString(); | ||
5207 | LLVector3 sun_direction; | ||
5208 | if (tod == "sunrise") | ||
5209 | { | ||
5210 | sun_direction.setVec(1.0f, 0.f, 0.2f); | ||
5211 | } | ||
5212 | else if (tod == "noon") | ||
5213 | { | ||
5214 | sun_direction.setVec(0.0f, 0.3f, 1.0f); | ||
5215 | } | ||
5216 | else if (tod == "sunset") | ||
5217 | { | ||
5218 | sun_direction.setVec(-1.0f, 0.f, 0.2f); | ||
5219 | } | ||
5220 | else if (tod == "midnight") | ||
5221 | { | ||
5222 | sun_direction.setVec(0.0f, 0.3f, -1.0f); | ||
5223 | } | ||
5224 | else | ||
5225 | { | ||
5226 | gSky.setOverrideSun(FALSE); | ||
5227 | return true; | ||
5228 | } | ||
5229 | sun_direction.normVec(); | ||
5230 | gSky.setOverrideSun(TRUE); | ||
5231 | gSky.setSunDirection( sun_direction, LLVector3(0.f, 0.f, 0.f)); | ||
5232 | return true; | ||
5233 | } | ||
5234 | }; | ||
5235 | |||
5236 | void handle_dump_followcam(void*) | 5222 | void handle_dump_followcam(void*) |
5237 | { | 5223 | { |
5238 | LLFollowCamMgr::dump(); | 5224 | LLFollowCamMgr::dump(); |
@@ -5339,7 +5325,7 @@ class LLShowFloater : public view_listener_t | |||
5339 | gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); | 5325 | gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); |
5340 | } | 5326 | } |
5341 | 5327 | ||
5342 | LLFloaterLand::show(); | 5328 | LLFloaterLand::showInstance(); |
5343 | } | 5329 | } |
5344 | else if (floater_name == "buy land") | 5330 | else if (floater_name == "buy land") |
5345 | { | 5331 | { |
@@ -5364,25 +5350,7 @@ class LLShowFloater : public view_listener_t | |||
5364 | } | 5350 | } |
5365 | else if (floater_name == "help f1") | 5351 | else if (floater_name == "help f1") |
5366 | { | 5352 | { |
5367 | #if LL_LIBXUL_ENABLED | 5353 | gViewerHtmlHelp.show(); |
5368 | gViewerHtmlHelp.show( gSavedSettings.getString("HelpHomeURL") ); | ||
5369 | #endif | ||
5370 | } | ||
5371 | else if (floater_name == "help in-world") | ||
5372 | { | ||
5373 | #if LL_LIBXUL_ENABLED | ||
5374 | const bool open_app_slurls = true; | ||
5375 | LLFloaterHtml::getInstance()->show( | ||
5376 | "in-world_help", open_app_slurls ); | ||
5377 | #endif | ||
5378 | } | ||
5379 | else if (floater_name == "help additional") | ||
5380 | { | ||
5381 | #if LL_LIBXUL_ENABLED | ||
5382 | const bool open_app_slurls = true; | ||
5383 | LLFloaterHtml::getInstance()->show( | ||
5384 | "additional_help", open_app_slurls ); | ||
5385 | #endif | ||
5386 | } | 5354 | } |
5387 | else if (floater_name == "complaint reporter") | 5355 | else if (floater_name == "complaint reporter") |
5388 | { | 5356 | { |
@@ -5440,7 +5408,7 @@ class LLFloaterVisible : public view_listener_t | |||
5440 | } | 5408 | } |
5441 | else if (floater_name == "chat history") | 5409 | else if (floater_name == "chat history") |
5442 | { | 5410 | { |
5443 | new_value = LLFloaterChat::visible(NULL); | 5411 | new_value = LLFloaterChat::instanceVisible(); |
5444 | } | 5412 | } |
5445 | else if (floater_name == "im") | 5413 | else if (floater_name == "im") |
5446 | { | 5414 | { |
@@ -5699,9 +5667,9 @@ private: | |||
5699 | if (selectedObject) | 5667 | if (selectedObject) |
5700 | { | 5668 | { |
5701 | S32 index = userdata.asInteger(); | 5669 | S32 index = userdata.asInteger(); |
5702 | LLViewerJointAttachment* attachment_point = index > 0 ? | 5670 | LLViewerJointAttachment* attachment_point = NULL; |
5703 | gAgent.getAvatarObject()->mAttachmentPoints[index] : | 5671 | if (index > 0) |
5704 | NULL; | 5672 | attachment_point = get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, index, (LLViewerJointAttachment*)NULL); |
5705 | confirm_replace_attachment(0, attachment_point); | 5673 | confirm_replace_attachment(0, attachment_point); |
5706 | } | 5674 | } |
5707 | return true; | 5675 | return true; |
@@ -5719,10 +5687,18 @@ void near_attach_object(BOOL success, void *user_data) | |||
5719 | { | 5687 | { |
5720 | LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; | 5688 | LLViewerJointAttachment *attachment = (LLViewerJointAttachment *)user_data; |
5721 | 5689 | ||
5722 | U8 attachment_id; | 5690 | U8 attachment_id = 0; |
5723 | if (attachment) | 5691 | if (attachment) |
5724 | { | 5692 | { |
5725 | attachment_id = gAgent.getAvatarObject()->mAttachmentPoints.reverseLookup(attachment); | 5693 | for (LLVOAvatar::attachment_map_t::iterator iter = gAgent.getAvatarObject()->mAttachmentPoints.begin(); |
5694 | iter != gAgent.getAvatarObject()->mAttachmentPoints.end(); ++iter) | ||
5695 | { | ||
5696 | if (iter->second == attachment) | ||
5697 | { | ||
5698 | attachment_id = iter->first; | ||
5699 | break; | ||
5700 | } | ||
5701 | } | ||
5726 | } | 5702 | } |
5727 | else | 5703 | else |
5728 | { | 5704 | { |
@@ -5958,7 +5934,7 @@ class LLAttachmentEnableDrop : public view_listener_t | |||
5958 | if ( object ) | 5934 | if ( object ) |
5959 | { | 5935 | { |
5960 | S32 attachmentID = ATTACHMENT_ID_FROM_STATE(object->getState()); | 5936 | S32 attachmentID = ATTACHMENT_ID_FROM_STATE(object->getState()); |
5961 | attachment_pt = gAgent.getAvatarObject()->mAttachmentPoints.getIfThere(attachmentID); | 5937 | attachment_pt = get_if_there(gAgent.getAvatarObject()->mAttachmentPoints, attachmentID, (LLViewerJointAttachment*)NULL); |
5962 | 5938 | ||
5963 | if ( attachment_pt ) | 5939 | if ( attachment_pt ) |
5964 | { | 5940 | { |
@@ -6326,11 +6302,12 @@ void handle_dump_attachments(void*) | |||
6326 | return; | 6302 | return; |
6327 | } | 6303 | } |
6328 | 6304 | ||
6329 | for( LLViewerJointAttachment* attachment = avatar->mAttachmentPoints.getFirstData(); | 6305 | for (LLVOAvatar::attachment_map_t::iterator iter = avatar->mAttachmentPoints.begin(); |
6330 | attachment; | 6306 | iter != avatar->mAttachmentPoints.end(); ) |
6331 | attachment = avatar->mAttachmentPoints.getNextData() ) | ||
6332 | { | 6307 | { |
6333 | S32 key = avatar->mAttachmentPoints.getCurrentKeyWithoutIncrement(); | 6308 | LLVOAvatar::attachment_map_t::iterator curiter = iter++; |
6309 | LLViewerJointAttachment* attachment = curiter->second; | ||
6310 | S32 key = curiter->first; | ||
6334 | BOOL visible = (attachment->getObject() != NULL && | 6311 | BOOL visible = (attachment->getObject() != NULL && |
6335 | attachment->getObject()->mDrawable.notNull() && | 6312 | attachment->getObject()->mDrawable.notNull() && |
6336 | !attachment->getObject()->mDrawable->isRenderType(0)); | 6313 | !attachment->getObject()->mDrawable->isRenderType(0)); |
@@ -7107,12 +7084,12 @@ BOOL LLViewerMenuHolderGL::hideMenus() | |||
7107 | return handled; | 7084 | return handled; |
7108 | } | 7085 | } |
7109 | 7086 | ||
7110 | void LLViewerMenuHolderGL::setParcelSelection(LLHandle<LLParcelSelection> selection) | 7087 | void LLViewerMenuHolderGL::setParcelSelection(LLSafeHandle<LLParcelSelection> selection) |
7111 | { | 7088 | { |
7112 | mParcelSelection = selection; | 7089 | mParcelSelection = selection; |
7113 | } | 7090 | } |
7114 | 7091 | ||
7115 | void LLViewerMenuHolderGL::setObjectSelection(LLHandle<LLObjectSelection> selection) | 7092 | void LLViewerMenuHolderGL::setObjectSelection(LLSafeHandle<LLObjectSelection> selection) |
7116 | { | 7093 | { |
7117 | mObjectSelection = selection; | 7094 | mObjectSelection = selection; |
7118 | } | 7095 | } |
@@ -7120,7 +7097,7 @@ void LLViewerMenuHolderGL::setObjectSelection(LLHandle<LLObjectSelection> select | |||
7120 | 7097 | ||
7121 | const LLRect LLViewerMenuHolderGL::getMenuRect() const | 7098 | const LLRect LLViewerMenuHolderGL::getMenuRect() const |
7122 | { | 7099 | { |
7123 | return LLRect(0, mRect.getHeight() - MENU_BAR_HEIGHT, mRect.getWidth(), STATUS_BAR_HEIGHT); | 7100 | return LLRect(0, getRect().getHeight() - MENU_BAR_HEIGHT, getRect().getWidth(), STATUS_BAR_HEIGHT); |
7124 | } | 7101 | } |
7125 | 7102 | ||
7126 | void handle_save_to_xml(void*) | 7103 | void handle_save_to_xml(void*) |
@@ -7163,8 +7140,9 @@ void handle_load_from_xml(void*) | |||
7163 | 7140 | ||
7164 | void handle_slurl_test(void*) | 7141 | void handle_slurl_test(void*) |
7165 | { | 7142 | { |
7166 | LLFloaterHtml::getInstance()->show( | 7143 | bool open_app_slurls = true; |
7167 | "http://secondlife.com/app/search/slurls.html", "SLURL Test", true); | 7144 | bool open_links_externally = false; |
7145 | LLFloaterHtml::getInstance()->show("http://secondlife.com/app/search/slurls.html", "SLURL Test", open_app_slurls, open_links_externally); | ||
7168 | } | 7146 | } |
7169 | 7147 | ||
7170 | void handle_rebake_textures(void*) | 7148 | void handle_rebake_textures(void*) |
@@ -7229,6 +7207,33 @@ class LLViewCheckHighlightTransparent : public view_listener_t | |||
7229 | } | 7207 | } |
7230 | }; | 7208 | }; |
7231 | 7209 | ||
7210 | class LLViewBeaconWidth : public view_listener_t | ||
7211 | { | ||
7212 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
7213 | { | ||
7214 | LLString width = userdata.asString(); | ||
7215 | if(width == "1") | ||
7216 | { | ||
7217 | gSavedSettings.setS32("DebugBeaconLineWidth", 1); | ||
7218 | } | ||
7219 | else if(width == "4") | ||
7220 | { | ||
7221 | gSavedSettings.setS32("DebugBeaconLineWidth", 4); | ||
7222 | } | ||
7223 | else if(width == "16") | ||
7224 | { | ||
7225 | gSavedSettings.setS32("DebugBeaconLineWidth", 16); | ||
7226 | } | ||
7227 | else if(width == "32") | ||
7228 | { | ||
7229 | gSavedSettings.setS32("DebugBeaconLineWidth", 32); | ||
7230 | } | ||
7231 | |||
7232 | return true; | ||
7233 | } | ||
7234 | }; | ||
7235 | |||
7236 | |||
7232 | class LLViewToggleBeacon : public view_listener_t | 7237 | class LLViewToggleBeacon : public view_listener_t |
7233 | { | 7238 | { |
7234 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7239 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
@@ -7535,6 +7540,125 @@ class LLToolsSelectTool : public view_listener_t | |||
7535 | } | 7540 | } |
7536 | }; | 7541 | }; |
7537 | 7542 | ||
7543 | /// WINDLIGHT callbacks | ||
7544 | class LLWorldEnvSettings : public view_listener_t | ||
7545 | { | ||
7546 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
7547 | { | ||
7548 | LLString tod = userdata.asString(); | ||
7549 | LLVector3 sun_direction; | ||
7550 | |||
7551 | if (tod == "editor") | ||
7552 | { | ||
7553 | // if not there or is hidden, show it | ||
7554 | if( !LLFloaterEnvSettings::isOpen() || | ||
7555 | !LLFloaterEnvSettings::instance()->getVisible()) { | ||
7556 | LLFloaterEnvSettings::show(); | ||
7557 | |||
7558 | // otherwise, close it button acts like a toggle | ||
7559 | } | ||
7560 | else | ||
7561 | { | ||
7562 | LLFloaterEnvSettings::instance()->close(); | ||
7563 | } | ||
7564 | return true; | ||
7565 | } | ||
7566 | |||
7567 | if (tod == "sunrise") | ||
7568 | { | ||
7569 | // set the value, turn off animation | ||
7570 | LLWLParamManager::instance()->mAnimator.setDayTime(0.25); | ||
7571 | LLWLParamManager::instance()->mAnimator.mIsRunning = false; | ||
7572 | LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; | ||
7573 | |||
7574 | // then call update once | ||
7575 | LLWLParamManager::instance()->mAnimator.update( | ||
7576 | LLWLParamManager::instance()->mCurParams); | ||
7577 | } | ||
7578 | else if (tod == "noon") | ||
7579 | { | ||
7580 | // set the value, turn off animation | ||
7581 | LLWLParamManager::instance()->mAnimator.setDayTime(0.567); | ||
7582 | LLWLParamManager::instance()->mAnimator.mIsRunning = false; | ||
7583 | LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; | ||
7584 | |||
7585 | // then call update once | ||
7586 | LLWLParamManager::instance()->mAnimator.update( | ||
7587 | LLWLParamManager::instance()->mCurParams); | ||
7588 | } | ||
7589 | else if (tod == "sunset") | ||
7590 | { | ||
7591 | // set the value, turn off animation | ||
7592 | LLWLParamManager::instance()->mAnimator.setDayTime(0.75); | ||
7593 | LLWLParamManager::instance()->mAnimator.mIsRunning = false; | ||
7594 | LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; | ||
7595 | |||
7596 | // then call update once | ||
7597 | LLWLParamManager::instance()->mAnimator.update( | ||
7598 | LLWLParamManager::instance()->mCurParams); | ||
7599 | } | ||
7600 | else if (tod == "midnight") | ||
7601 | { | ||
7602 | // set the value, turn off animation | ||
7603 | LLWLParamManager::instance()->mAnimator.setDayTime(0.0); | ||
7604 | LLWLParamManager::instance()->mAnimator.mIsRunning = false; | ||
7605 | LLWLParamManager::instance()->mAnimator.mUseLindenTime = false; | ||
7606 | |||
7607 | // then call update once | ||
7608 | LLWLParamManager::instance()->mAnimator.update( | ||
7609 | LLWLParamManager::instance()->mCurParams); | ||
7610 | } | ||
7611 | else | ||
7612 | { | ||
7613 | LLWLParamManager::instance()->mAnimator.mIsRunning = true; | ||
7614 | LLWLParamManager::instance()->mAnimator.mUseLindenTime = true; | ||
7615 | } | ||
7616 | return true; | ||
7617 | } | ||
7618 | }; | ||
7619 | |||
7620 | /// Water Menu callbacks | ||
7621 | class LLWorldWaterSettings : public view_listener_t | ||
7622 | { | ||
7623 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
7624 | { | ||
7625 | // if not there or is hidden, show it | ||
7626 | if( !LLFloaterWater::isOpen() || | ||
7627 | !LLFloaterWater::instance()->getVisible()) { | ||
7628 | LLFloaterWater::show(); | ||
7629 | |||
7630 | // otherwise, close it button acts like a toggle | ||
7631 | } | ||
7632 | else | ||
7633 | { | ||
7634 | LLFloaterWater::instance()->close(); | ||
7635 | } | ||
7636 | return true; | ||
7637 | } | ||
7638 | }; | ||
7639 | |||
7640 | /// Post-Process callbacks | ||
7641 | class LLWorldPostProcess : public view_listener_t | ||
7642 | { | ||
7643 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
7644 | { | ||
7645 | LLFloaterPostProcess::show(); | ||
7646 | return true; | ||
7647 | } | ||
7648 | }; | ||
7649 | |||
7650 | /// Day Cycle callbacks | ||
7651 | class LLWorldDayCycle : public view_listener_t | ||
7652 | { | ||
7653 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
7654 | { | ||
7655 | LLFloaterDayCycle::show(); | ||
7656 | return true; | ||
7657 | } | ||
7658 | }; | ||
7659 | |||
7660 | |||
7661 | |||
7538 | static void addMenu(view_listener_t *menu, const char *name) | 7662 | static void addMenu(view_listener_t *menu, const char *name) |
7539 | { | 7663 | { |
7540 | sMenus.push_back(menu); | 7664 | sMenus.push_back(menu); |
@@ -7579,6 +7703,7 @@ void initialize_menus() | |||
7579 | addMenu(new LLViewShowHoverTips(), "View.ShowHoverTips"); | 7703 | addMenu(new LLViewShowHoverTips(), "View.ShowHoverTips"); |
7580 | addMenu(new LLViewHighlightTransparent(), "View.HighlightTransparent"); | 7704 | addMenu(new LLViewHighlightTransparent(), "View.HighlightTransparent"); |
7581 | addMenu(new LLViewToggleBeacon(), "View.ToggleBeacon"); | 7705 | addMenu(new LLViewToggleBeacon(), "View.ToggleBeacon"); |
7706 | addMenu(new LLViewBeaconWidth(), "View.BeaconWidth"); | ||
7582 | addMenu(new LLViewToggleRenderType(), "View.ToggleRenderType"); | 7707 | addMenu(new LLViewToggleRenderType(), "View.ToggleRenderType"); |
7583 | addMenu(new LLViewShowHUDAttachments(), "View.ShowHUDAttachments"); | 7708 | addMenu(new LLViewShowHUDAttachments(), "View.ShowHUDAttachments"); |
7584 | addMenu(new LLViewZoomOut(), "View.ZoomOut"); | 7709 | addMenu(new LLViewZoomOut(), "View.ZoomOut"); |
@@ -7614,8 +7739,11 @@ void initialize_menus() | |||
7614 | addMenu(new LLWorldEnableBuyLand(), "World.EnableBuyLand"); | 7739 | addMenu(new LLWorldEnableBuyLand(), "World.EnableBuyLand"); |
7615 | 7740 | ||
7616 | addMenu(new LLWorldCheckAlwaysRun(), "World.CheckAlwaysRun"); | 7741 | addMenu(new LLWorldCheckAlwaysRun(), "World.CheckAlwaysRun"); |
7617 | 7742 | ||
7618 | addMenu(new LLWorldForceSun(), "World.ForceSun"); | 7743 | (new LLWorldEnvSettings())->registerListener(gMenuHolder, "World.EnvSettings"); |
7744 | (new LLWorldWaterSettings())->registerListener(gMenuHolder, "World.WaterSettings"); | ||
7745 | (new LLWorldPostProcess())->registerListener(gMenuHolder, "World.PostProcess"); | ||
7746 | (new LLWorldDayCycle())->registerListener(gMenuHolder, "World.DayCycle"); | ||
7619 | 7747 | ||
7620 | // Tools menu | 7748 | // Tools menu |
7621 | addMenu(new LLToolsSelectTool(), "Tools.SelectTool"); | 7749 | addMenu(new LLToolsSelectTool(), "Tools.SelectTool"); |