diff options
Diffstat (limited to 'linden/indra/newview/llviewermenu.cpp')
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 1056 |
1 files changed, 457 insertions, 599 deletions
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index a97ec18..9687e11 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -129,6 +129,7 @@ | |||
129 | #include "llfloaterwater.h" | 129 | #include "llfloaterwater.h" |
130 | #include "llfloaterwindlight.h" | 130 | #include "llfloaterwindlight.h" |
131 | #include "llfloaterworldmap.h" | 131 | #include "llfloaterworldmap.h" |
132 | #include "llfloatermemleak.h" | ||
132 | #include "llframestats.h" | 133 | #include "llframestats.h" |
133 | #include "llframestatview.h" | 134 | #include "llframestatview.h" |
134 | #include "llfasttimerview.h" | 135 | #include "llfasttimerview.h" |
@@ -146,7 +147,6 @@ | |||
146 | #include "llinventoryview.h" | 147 | #include "llinventoryview.h" |
147 | #include "llkeyboard.h" | 148 | #include "llkeyboard.h" |
148 | #include "llpanellogin.h" | 149 | #include "llpanellogin.h" |
149 | #include "llfloaterlandmark.h" | ||
150 | #include "llmenucommands.h" | 150 | #include "llmenucommands.h" |
151 | #include "llmenugl.h" | 151 | #include "llmenugl.h" |
152 | #include "llmorphview.h" | 152 | #include "llmorphview.h" |
@@ -208,9 +208,6 @@ | |||
208 | 208 | ||
209 | #include "lltexlayer.h" | 209 | #include "lltexlayer.h" |
210 | 210 | ||
211 | void init_landmark_menu(LLMenuGL* menu); | ||
212 | void clear_landmark_menu(LLMenuGL* menu); | ||
213 | |||
214 | void init_client_menu(LLMenuGL* menu); | 211 | void init_client_menu(LLMenuGL* menu); |
215 | void init_server_menu(LLMenuGL* menu); | 212 | void init_server_menu(LLMenuGL* menu); |
216 | 213 | ||
@@ -256,24 +253,11 @@ LLPieMenu *gPieAttachment = NULL; | |||
256 | LLPieMenu *gPieLand = NULL; | 253 | LLPieMenu *gPieLand = NULL; |
257 | 254 | ||
258 | // local constants | 255 | // local constants |
259 | const LLString LANDMARK_MENU_NAME("Landmarks"); | 256 | const std::string CLIENT_MENU_NAME("Advanced"); |
260 | const LLString CLIENT_MENU_NAME("Advanced"); | 257 | const std::string SERVER_MENU_NAME("Admin"); |
261 | const LLString SERVER_MENU_NAME("Admin"); | ||
262 | |||
263 | const LLString SAVE_INTO_INVENTORY("Save Object Back to My Inventory"); | ||
264 | const LLString SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents"); | ||
265 | 258 | ||
266 | #if LL_WINDOWS | 259 | const std::string SAVE_INTO_INVENTORY("Save Object Back to My Inventory"); |
267 | static const char* SOUND_EXTENSIONS = ".wav"; | 260 | const std::string SAVE_INTO_TASK_INVENTORY("Save Object Back to Object Contents"); |
268 | static const char* IMAGE_EXTENSIONS = ".tga .bmp .jpg .jpeg .png"; | ||
269 | static const char* ANIM_EXTENSIONS = ".bvh"; | ||
270 | #ifdef _CORY_TESTING | ||
271 | static const char* GEOMETRY_EXTENSIONS = ".slg"; | ||
272 | #endif | ||
273 | static const char* XML_EXTENSIONS = ".xml"; | ||
274 | static const char* SLOBJECT_EXTENSIONS = ".slobject"; | ||
275 | #endif | ||
276 | static const char* ALL_FILE_EXTENSIONS = "*.*"; | ||
277 | 261 | ||
278 | LLMenuGL* gAttachSubMenu = NULL; | 262 | LLMenuGL* gAttachSubMenu = NULL; |
279 | LLMenuGL* gDetachSubMenu = NULL; | 263 | LLMenuGL* gDetachSubMenu = NULL; |
@@ -286,7 +270,6 @@ LLPieMenu* gDetachPieMenu = NULL; | |||
286 | LLPieMenu* gDetachScreenPieMenu = NULL; | 270 | LLPieMenu* gDetachScreenPieMenu = NULL; |
287 | LLPieMenu* gDetachBodyPartPieMenus[8]; | 271 | LLPieMenu* gDetachBodyPartPieMenus[8]; |
288 | 272 | ||
289 | LLMenuGL* gLandmarkMenu = NULL; | ||
290 | LLMenuItemCallGL* gAFKMenu = NULL; | 273 | LLMenuItemCallGL* gAFKMenu = NULL; |
291 | LLMenuItemCallGL* gBusyMenu = NULL; | 274 | LLMenuItemCallGL* gBusyMenu = NULL; |
292 | 275 | ||
@@ -317,7 +300,7 @@ void handle_region_clear_temp_asset_data(void*); | |||
317 | BOOL sitting_on_selection(); | 300 | BOOL sitting_on_selection(); |
318 | 301 | ||
319 | void near_sit_object(); | 302 | void near_sit_object(); |
320 | void label_sit_or_stand(LLString& label, void*); | 303 | void label_sit_or_stand(std::string& label, void*); |
321 | // buy and take alias into the same UI positions, so these | 304 | // buy and take alias into the same UI positions, so these |
322 | // declarations handle this mess. | 305 | // declarations handle this mess. |
323 | BOOL is_selection_buy_not_take(); | 306 | BOOL is_selection_buy_not_take(); |
@@ -329,7 +312,7 @@ BOOL enable_buy(void*); | |||
329 | void handle_buy(void *); | 312 | void handle_buy(void *); |
330 | void handle_buy_object(LLSaleInfo sale_info); | 313 | void handle_buy_object(LLSaleInfo sale_info); |
331 | void handle_buy_contents(LLSaleInfo sale_info); | 314 | void handle_buy_contents(LLSaleInfo sale_info); |
332 | void label_touch(LLString& label, void*); | 315 | void label_touch(std::string& label, void*); |
333 | 316 | ||
334 | // Land pie menu | 317 | // Land pie menu |
335 | void near_sit_down_point(BOOL success, void *); | 318 | void near_sit_down_point(BOOL success, void *); |
@@ -340,7 +323,6 @@ void handle_talk_to(void *userdata); | |||
340 | 323 | ||
341 | // Debug menu | 324 | // Debug menu |
342 | void show_permissions_control(void*); | 325 | void show_permissions_control(void*); |
343 | void load_url_local_file(const char* file_name); | ||
344 | void toggle_build_options(void* user_data); | 326 | void toggle_build_options(void* user_data); |
345 | #if 0 // Unused | 327 | #if 0 // Unused |
346 | void handle_audio_status_1(void*); | 328 | void handle_audio_status_1(void*); |
@@ -349,8 +331,6 @@ void handle_audio_status_3(void*); | |||
349 | void handle_audio_status_4(void*); | 331 | void handle_audio_status_4(void*); |
350 | #endif | 332 | #endif |
351 | void manage_landmarks(void*); | 333 | void manage_landmarks(void*); |
352 | void create_new_landmark(void*); | ||
353 | void landmark_menu_action(void*); | ||
354 | void reload_ui(void*); | 334 | void reload_ui(void*); |
355 | void handle_agent_stop_moving(void*); | 335 | void handle_agent_stop_moving(void*); |
356 | void print_packets_lost(void*); | 336 | void print_packets_lost(void*); |
@@ -503,59 +483,12 @@ BOOL enable_selection_you_own_one(void*); | |||
503 | BOOL enable_save_into_inventory(void*); | 483 | BOOL enable_save_into_inventory(void*); |
504 | BOOL enable_save_into_task_inventory(void*); | 484 | BOOL enable_save_into_task_inventory(void*); |
505 | BOOL enable_not_thirdperson(void*); | 485 | BOOL enable_not_thirdperson(void*); |
506 | BOOL enable_export_selected(void *); | 486 | // BOOL enable_export_selected(void *); |
507 | BOOL enable_have_card(void*); | 487 | BOOL enable_have_card(void*); |
508 | BOOL enable_detach(void*); | 488 | BOOL enable_detach(void*); |
509 | BOOL enable_region_owner(void*); | 489 | BOOL enable_region_owner(void*); |
510 | 490 | void menu_toggle_attached_lights(void* user_data); | |
511 | class LLLandmarkObserver : public LLInventoryObserver | 491 | void menu_toggle_attached_particles(void* user_data); |
512 | { | ||
513 | public: | ||
514 | LLLandmarkObserver(); | ||
515 | virtual ~LLLandmarkObserver(); | ||
516 | |||
517 | virtual void changed(U32 mask) | ||
518 | { | ||
519 | // JC - Disabled for now - slows down client or causes crashes | ||
520 | // in inventory code. | ||
521 | // | ||
522 | // Also, this may not be faster than just rebuilding the menu each time. | ||
523 | // I believe gInventory.getObject() is not fast. | ||
524 | // | ||
525 | //const std::set<LLUUID>& changed_ids = gInventory.getChangedIDs(); | ||
526 | //std::set<LLUUID>::const_iterator id_it; | ||
527 | //BOOL need_to_rebuild_menu = FALSE; | ||
528 | //for(id_it = changed_ids.begin(); id_it != changed_ids.end(); ++id_it) | ||
529 | //{ | ||
530 | // LLInventoryObject* objectp = gInventory.getObject(*id_it); | ||
531 | // if (objectp && (objectp->getType() == LLAssetType::AT_LANDMARK || objectp->getType() == LLAssetType::AT_CATEGORY)) | ||
532 | // { | ||
533 | // need_to_rebuild_menu = TRUE; | ||
534 | // } | ||
535 | //} | ||
536 | //if (need_to_rebuild_menu) | ||
537 | //{ | ||
538 | // init_landmark_menu(gLandmarkMenu); | ||
539 | //} | ||
540 | } | ||
541 | }; | ||
542 | |||
543 | // For debugging only, I think the inventory observer doesn't get | ||
544 | // called if the inventory is loaded from cache. | ||
545 | void build_landmark_menu(void*) | ||
546 | { | ||
547 | init_landmark_menu(gLandmarkMenu); | ||
548 | } | ||
549 | |||
550 | LLLandmarkObserver::LLLandmarkObserver() | ||
551 | { | ||
552 | gInventory.addObserver(this); | ||
553 | } | ||
554 | |||
555 | LLLandmarkObserver::~LLLandmarkObserver() | ||
556 | { | ||
557 | gInventory.removeObserver(this); | ||
558 | } | ||
559 | 492 | ||
560 | class LLMenuParcelObserver : public LLParcelObserver | 493 | class LLMenuParcelObserver : public LLParcelObserver |
561 | { | 494 | { |
@@ -566,7 +499,6 @@ public: | |||
566 | }; | 499 | }; |
567 | 500 | ||
568 | static LLMenuParcelObserver* gMenuParcelObserver = NULL; | 501 | static LLMenuParcelObserver* gMenuParcelObserver = NULL; |
569 | static LLLandmarkObserver* gLandmarkObserver = NULL; | ||
570 | 502 | ||
571 | LLMenuParcelObserver::LLMenuParcelObserver() | 503 | LLMenuParcelObserver::LLMenuParcelObserver() |
572 | { | 504 | { |
@@ -713,7 +645,7 @@ void init_menus() | |||
713 | gMenuBarView->setRect(LLRect(0, top, 0, top - MENU_BAR_HEIGHT)); | 645 | gMenuBarView->setRect(LLRect(0, top, 0, top - MENU_BAR_HEIGHT)); |
714 | gMenuBarView->setBackgroundColor( color ); | 646 | gMenuBarView->setBackgroundColor( color ); |
715 | 647 | ||
716 | gMenuBarView->setItemVisible("Tools", FALSE); | 648 | // gMenuBarView->setItemVisible("Tools", FALSE); |
717 | gMenuBarView->arrange(); | 649 | gMenuBarView->arrange(); |
718 | 650 | ||
719 | gMenuHolder->addChild(gMenuBarView); | 651 | gMenuHolder->addChild(gMenuBarView); |
@@ -726,7 +658,7 @@ void init_menus() | |||
726 | LLViewerLogin::getInstance()->isInProductionGrid()); | 658 | LLViewerLogin::getInstance()->isInProductionGrid()); |
727 | 659 | ||
728 | // *TODO:Get the cost info from the server | 660 | // *TODO:Get the cost info from the server |
729 | const LLString upload_cost("10"); | 661 | const std::string upload_cost("10"); |
730 | gMenuHolder->childSetLabelArg("Upload Image", "[COST]", upload_cost); | 662 | gMenuHolder->childSetLabelArg("Upload Image", "[COST]", upload_cost); |
731 | gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", upload_cost); | 663 | gMenuHolder->childSetLabelArg("Upload Sound", "[COST]", upload_cost); |
732 | gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", upload_cost); | 664 | gMenuHolder->childSetLabelArg("Upload Animation", "[COST]", upload_cost); |
@@ -740,17 +672,6 @@ void init_menus() | |||
740 | // TomY TODO convert these two | 672 | // TomY TODO convert these two |
741 | LLMenuGL*menu; | 673 | LLMenuGL*menu; |
742 | 674 | ||
743 | // JC - Maybe we don't want a global landmark menu | ||
744 | /* | ||
745 | menu = new LLMenuGL(LANDMARK_MENU_NAME); | ||
746 | // Defer init_landmark_menu() until inventory observer reports that we actually | ||
747 | // have inventory. Otherwise findCategoryByUUID() will create an empty | ||
748 | // Landmarks folder in inventory. JC | ||
749 | gMenuBarView->appendMenu( menu ); | ||
750 | menu->updateParent(LLMenuGL::sMenuContainer); | ||
751 | gLandmarkMenu = menu; | ||
752 | */ | ||
753 | |||
754 | // Advanced (Client) menu is XUI now! \o/ | 675 | // Advanced (Client) menu is XUI now! \o/ |
755 | /* | 676 | /* |
756 | menu = new LLMenuGL(CLIENT_MENU_NAME); | 677 | menu = new LLMenuGL(CLIENT_MENU_NAME); |
@@ -769,9 +690,6 @@ void init_menus() | |||
769 | // Let land based option enable when parcel changes | 690 | // Let land based option enable when parcel changes |
770 | gMenuParcelObserver = new LLMenuParcelObserver(); | 691 | gMenuParcelObserver = new LLMenuParcelObserver(); |
771 | 692 | ||
772 | // Let landmarks menu update when landmarks are added/removed | ||
773 | gLandmarkObserver = new LLLandmarkObserver(); | ||
774 | |||
775 | // | 693 | // |
776 | // Debug menu visiblity | 694 | // Debug menu visiblity |
777 | // | 695 | // |
@@ -789,71 +707,15 @@ void init_menus() | |||
789 | 707 | ||
790 | 708 | ||
791 | 709 | ||
792 | void init_landmark_menu(LLMenuGL* menu) | ||
793 | { | ||
794 | if (!menu) return; | ||
795 | |||
796 | // clear existing menu, as we might be rebuilding as result of inventory update | ||
797 | clear_landmark_menu(menu); | ||
798 | |||
799 | menu->append(new LLMenuItemCallGL("Organize Landmarks", | ||
800 | &manage_landmarks, NULL)); | ||
801 | menu->append(new LLMenuItemCallGL("New Landmark...", | ||
802 | &create_new_landmark, NULL)); | ||
803 | menu->appendSeparator(); | ||
804 | |||
805 | // now collect all landmarks in inventory and build menu... | ||
806 | LLInventoryModel::cat_array_t* cats; | ||
807 | LLInventoryModel::item_array_t* items; | ||
808 | gInventory.getDirectDescendentsOf(gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK), cats, items); | ||
809 | if(items) | ||
810 | { | ||
811 | S32 count = items->count(); | ||
812 | for(S32 i = 0; i < count; ++i) | ||
813 | { | ||
814 | LLInventoryItem* item = items->get(i); | ||
815 | LLString landmark_name = item->getName(); | ||
816 | LLUUID* landmark_id_ptr = new LLUUID( item->getUUID() ); | ||
817 | LLMenuItemCallGL* menu_item = | ||
818 | new LLMenuItemCallGL(landmark_name, landmark_menu_action, | ||
819 | NULL, NULL, landmark_id_ptr); | ||
820 | menu->append(menu_item); | ||
821 | } | ||
822 | } | ||
823 | } | ||
824 | |||
825 | void clear_landmark_menu(LLMenuGL* menu) | ||
826 | { | ||
827 | if (!menu) return; | ||
828 | |||
829 | // We store the UUIDs of the landmark inventory items in the userdata | ||
830 | // field of the menus. Therefore when we clean up the menu we need to | ||
831 | // delete that data. | ||
832 | const LLView::child_list_t* child_list = menu->getChildList(); | ||
833 | LLView::child_list_const_iter_t it = child_list->begin(); | ||
834 | for ( ; it != child_list->end(); ++it) | ||
835 | { | ||
836 | LLView* view = *it; | ||
837 | LLMenuItemCallGL* menu_item = dynamic_cast<LLMenuItemCallGL*>(view); | ||
838 | |||
839 | if (menu_item && menu_item->getMenuCallback() == landmark_menu_action) | ||
840 | { | ||
841 | void* user_data = menu_item->getUserData(); | ||
842 | delete (LLUUID*)user_data; | ||
843 | } | ||
844 | } | ||
845 | |||
846 | menu->empty(); | ||
847 | } | ||
848 | |||
849 | void init_client_menu(LLMenuGL* menu) | 710 | void init_client_menu(LLMenuGL* menu) |
850 | { | 711 | { |
851 | LLMenuGL* sub_menu = NULL; | 712 | LLMenuGL* sub_menu = NULL; |
852 | 713 | ||
853 | //menu->append(new LLMenuItemCallGL("Permissions Control", &show_permissions_control)); | 714 | //menu->append(new LLMenuItemCallGL("Permissions Control", &show_permissions_control)); |
854 | 715 | // this is now in the view menu so we don't need it here! | |
855 | // this is now in the view menu so we don't need it here! | 716 | |
856 | { | 717 | { |
718 | // *TODO: Translate | ||
857 | LLMenuGL* sub = new LLMenuGL("Consoles"); | 719 | LLMenuGL* sub = new LLMenuGL("Consoles"); |
858 | menu->appendMenu(sub); | 720 | menu->appendMenu(sub); |
859 | sub->append(new LLMenuItemCheckGL("Frame Console", | 721 | sub->append(new LLMenuItemCheckGL("Frame Console", |
@@ -875,22 +737,7 @@ void init_client_menu(LLMenuGL* menu) | |||
875 | &get_visibility, | 737 | &get_visibility, |
876 | debugview, | 738 | debugview, |
877 | '4', MASK_CONTROL|MASK_SHIFT ) ); | 739 | '4', MASK_CONTROL|MASK_SHIFT ) ); |
878 | #if 0 // Unused | ||
879 | { | ||
880 | LLMenuGL* sub = new LLMenuGL("Audio"); | ||
881 | menu->appendMenu(sub); | ||
882 | 740 | ||
883 | sub->append(new LLMenuItemCallGL("Global Pos", | ||
884 | &handle_audio_status_1, NULL, NULL ,'5', MASK_CONTROL|MASK_SHIFT) ); | ||
885 | sub->append(new LLMenuItemCallGL("Cone", | ||
886 | &handle_audio_status_2, NULL, NULL ,'6', MASK_CONTROL|MASK_SHIFT) ); | ||
887 | sub->append(new LLMenuItemCallGL("Local Pos", | ||
888 | &handle_audio_status_3, NULL, NULL ,'7', MASK_CONTROL|MASK_SHIFT) ); | ||
889 | sub->append(new LLMenuItemCallGL("Duration", | ||
890 | &handle_audio_status_4, NULL, NULL ,'8', MASK_CONTROL|MASK_SHIFT) ); | ||
891 | sub->createJumpKeys(); | ||
892 | } | ||
893 | #endif | ||
894 | sub->append(new LLMenuItemCheckGL("Fast Timers", | 741 | sub->append(new LLMenuItemCheckGL("Fast Timers", |
895 | &toggle_visibility, | 742 | &toggle_visibility, |
896 | NULL, | 743 | NULL, |
@@ -1063,8 +910,7 @@ void init_client_menu(LLMenuGL* menu) | |||
1063 | menu->appendSeparator(); | 910 | menu->appendSeparator(); |
1064 | 911 | ||
1065 | menu->append(new LLMenuItemToggleGL("Show Updates", | 912 | menu->append(new LLMenuItemToggleGL("Show Updates", |
1066 | &gShowObjectUpdates, | 913 | &gShowObjectUpdates)); |
1067 | 'U', MASK_ALT | MASK_SHIFT | MASK_CONTROL)); | ||
1068 | 914 | ||
1069 | menu->appendSeparator(); | 915 | menu->appendSeparator(); |
1070 | 916 | ||
@@ -1172,7 +1018,7 @@ void handle_export_menus_to_xml(void*) | |||
1172 | llwarns << "No file" << llendl; | 1018 | llwarns << "No file" << llendl; |
1173 | return; | 1019 | return; |
1174 | } | 1020 | } |
1175 | const char* filename = picker.getFirstFile(); | 1021 | std::string filename = picker.getFirstFile(); |
1176 | 1022 | ||
1177 | llofstream out(filename); | 1023 | llofstream out(filename); |
1178 | LLXMLNodePtr node = gMenuBarView->getXML(); | 1024 | LLXMLNodePtr node = gMenuBarView->getXML(); |
@@ -1389,12 +1235,13 @@ void init_debug_rendering_menu(LLMenuGL* menu) | |||
1389 | sub_menu->append(new LLMenuItemCheckGL("Glow",&LLPipeline::toggleRenderDebug, NULL, | 1235 | sub_menu->append(new LLMenuItemCheckGL("Glow",&LLPipeline::toggleRenderDebug, NULL, |
1390 | &LLPipeline::toggleRenderDebugControl, | 1236 | &LLPipeline::toggleRenderDebugControl, |
1391 | (void*)LLPipeline::RENDER_DEBUG_GLOW)); | 1237 | (void*)LLPipeline::RENDER_DEBUG_GLOW)); |
1238 | sub_menu->append(new LLMenuItemCheckGL("Raycasting", &LLPipeline::toggleRenderDebug, NULL, | ||
1239 | &LLPipeline::toggleRenderDebugControl, | ||
1240 | (void*)LLPipeline::RENDER_DEBUG_RAYCAST)); | ||
1241 | sub_menu->append(new LLMenuItemCheckGL("Sculpt", &LLPipeline::toggleRenderDebug, NULL, | ||
1242 | &LLPipeline::toggleRenderDebugControl, | ||
1243 | (void*)LLPipeline::RENDER_DEBUG_SCULPTED)); | ||
1392 | 1244 | ||
1393 | sub_menu->append(new LLMenuItemCheckGL("Show Depth Buffer", | ||
1394 | &menu_toggle_control, | ||
1395 | NULL, | ||
1396 | &menu_check_control, | ||
1397 | (void*)"ShowDepthBuffer")); | ||
1398 | sub_menu->append(new LLMenuItemToggleGL("Show Select Buffer", &gDebugSelect)); | 1245 | sub_menu->append(new LLMenuItemToggleGL("Show Select Buffer", &gDebugSelect)); |
1399 | 1246 | ||
1400 | sub_menu->append(new LLMenuItemCallGL("Vectorize Perf Test", &run_vectorize_perf_test)); | 1247 | sub_menu->append(new LLMenuItemCallGL("Vectorize Perf Test", &run_vectorize_perf_test)); |
@@ -1461,6 +1308,23 @@ void init_debug_rendering_menu(LLMenuGL* menu) | |||
1461 | 1308 | ||
1462 | item = new LLMenuItemCheckGL("Cheesy Beacon", menu_toggle_control, NULL, menu_check_control, (void*)"CheesyBeacon"); | 1309 | item = new LLMenuItemCheckGL("Cheesy Beacon", menu_toggle_control, NULL, menu_check_control, (void*)"CheesyBeacon"); |
1463 | menu->append(item); | 1310 | menu->append(item); |
1311 | |||
1312 | item = new LLMenuItemCheckGL("Attached Lights", menu_toggle_attached_lights, NULL, menu_check_control, (void*)"RenderAttachedLights"); | ||
1313 | menu->append(item); | ||
1314 | |||
1315 | item = new LLMenuItemCheckGL("Attached Particles", menu_toggle_attached_particles, NULL, menu_check_control, (void*)"RenderAttachedParticles"); | ||
1316 | menu->append(item); | ||
1317 | |||
1318 | #ifndef LL_RELEASE_FOR_DOWNLOAD | ||
1319 | menu->appendSeparator(); | ||
1320 | menu->append(new LLMenuItemCallGL("Memory Leaking Simulation", LLFloaterMemLeak::show, NULL, NULL)); | ||
1321 | #else | ||
1322 | if(gSavedSettings.getBOOL("QAMode")) | ||
1323 | { | ||
1324 | menu->appendSeparator(); | ||
1325 | menu->append(new LLMenuItemCallGL("Memory Leaking Simulation", LLFloaterMemLeak::show, NULL, NULL)); | ||
1326 | } | ||
1327 | #endif | ||
1464 | 1328 | ||
1465 | menu->createJumpKeys(); | 1329 | menu->createJumpKeys(); |
1466 | } | 1330 | } |
@@ -1535,37 +1399,6 @@ void init_debug_baked_texture_menu(LLMenuGL* menu) | |||
1535 | 1399 | ||
1536 | void init_server_menu(LLMenuGL* menu) | 1400 | void init_server_menu(LLMenuGL* menu) |
1537 | { | 1401 | { |
1538 | /* | ||
1539 | { | ||
1540 | // These messages are now trusted. We can write scripts to do | ||
1541 | // this, and the message is unchecked for source. | ||
1542 | LLMenuGL* sub_menu = NULL; | ||
1543 | sub_menu = new LLMenuGL("Sim Logging"); | ||
1544 | |||
1545 | sub_menu->append(new LLMenuItemCallGL("Turn off llinfos Log", | ||
1546 | &handle_reduce_llinfo_log, &enable_god_customer_service)); | ||
1547 | |||
1548 | sub_menu->append(new LLMenuItemCallGL("Normal Logging", | ||
1549 | &handle_normal_llinfo_log, &enable_god_customer_service)); | ||
1550 | |||
1551 | sub_menu->appendSeparator(); | ||
1552 | sub_menu->append(new LLMenuItemCallGL("Enable Message Log", | ||
1553 | &handle_sim_enable_message_log, &enable_god_customer_service)); | ||
1554 | sub_menu->append(new LLMenuItemCallGL("Disable Message Log", | ||
1555 | &handle_sim_disable_message_log, &enable_god_customer_service)); | ||
1556 | |||
1557 | sub_menu->appendSeparator(); | ||
1558 | |||
1559 | sub_menu->append(new LLMenuItemCallGL("Fetch Message Log", | ||
1560 | &handle_sim_fetch_message_log, &enable_god_customer_service)); | ||
1561 | |||
1562 | sub_menu->append(new LLMenuItemCallGL("Fetch Log", | ||
1563 | &handle_sim_fetch_log, &enable_god_customer_service)); | ||
1564 | |||
1565 | menu->appendMenu( sub_menu ); | ||
1566 | } | ||
1567 | */ | ||
1568 | |||
1569 | { | 1402 | { |
1570 | LLMenuGL* sub = new LLMenuGL("Object"); | 1403 | LLMenuGL* sub = new LLMenuGL("Object"); |
1571 | menu->appendMenu(sub); | 1404 | menu->appendMenu(sub); |
@@ -1646,14 +1479,9 @@ static std::vector<LLPointer<view_listener_t> > sMenus; | |||
1646 | //----------------------------------------------------------------------------- | 1479 | //----------------------------------------------------------------------------- |
1647 | void cleanup_menus() | 1480 | void cleanup_menus() |
1648 | { | 1481 | { |
1649 | clear_landmark_menu(gLandmarkMenu); | ||
1650 | |||
1651 | delete gMenuParcelObserver; | 1482 | delete gMenuParcelObserver; |
1652 | gMenuParcelObserver = NULL; | 1483 | gMenuParcelObserver = NULL; |
1653 | 1484 | ||
1654 | delete gLandmarkObserver; | ||
1655 | gLandmarkObserver = NULL; | ||
1656 | |||
1657 | delete gPieSelf; | 1485 | delete gPieSelf; |
1658 | gPieSelf = NULL; | 1486 | gPieSelf = NULL; |
1659 | 1487 | ||
@@ -1689,7 +1517,11 @@ class LLObjectReportAbuse : public view_listener_t | |||
1689 | { | 1517 | { |
1690 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 1518 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
1691 | { | 1519 | { |
1692 | LLFloaterReporter::showFromObject(gLastHitObjectID); | 1520 | LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
1521 | if (objectp) | ||
1522 | { | ||
1523 | LLFloaterReporter::showFromObject(objectp->getID()); | ||
1524 | } | ||
1693 | return true; | 1525 | return true; |
1694 | } | 1526 | } |
1695 | }; | 1527 | }; |
@@ -1699,7 +1531,7 @@ class LLObjectEnableReportAbuse : public view_listener_t | |||
1699 | { | 1531 | { |
1700 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 1532 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
1701 | { | 1533 | { |
1702 | bool new_value = !gLastHitObjectID.isNull(); | 1534 | bool new_value = LLSelectMgr::getInstance()->getSelection()->getObjectCount() != 0; |
1703 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 1535 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
1704 | return true; | 1536 | return true; |
1705 | } | 1537 | } |
@@ -1709,9 +1541,11 @@ class LLObjectTouch : public view_listener_t | |||
1709 | { | 1541 | { |
1710 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 1542 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
1711 | { | 1543 | { |
1712 | LLViewerObject* object = gObjectList.findObject(gLastHitObjectID); | 1544 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
1713 | if (!object) return true; | 1545 | if (!object) return true; |
1714 | 1546 | ||
1547 | LLPickInfo pick = LLToolPie::getInstance()->getPick(); | ||
1548 | |||
1715 | LLMessageSystem *msg = gMessageSystem; | 1549 | LLMessageSystem *msg = gMessageSystem; |
1716 | 1550 | ||
1717 | msg->newMessageFast(_PREHASH_ObjectGrab); | 1551 | msg->newMessageFast(_PREHASH_ObjectGrab); |
@@ -1721,6 +1555,13 @@ class LLObjectTouch : public view_listener_t | |||
1721 | msg->nextBlockFast( _PREHASH_ObjectData); | 1555 | msg->nextBlockFast( _PREHASH_ObjectData); |
1722 | msg->addU32Fast( _PREHASH_LocalID, object->mLocalID); | 1556 | msg->addU32Fast( _PREHASH_LocalID, object->mLocalID); |
1723 | msg->addVector3Fast(_PREHASH_GrabOffset, LLVector3::zero ); | 1557 | msg->addVector3Fast(_PREHASH_GrabOffset, LLVector3::zero ); |
1558 | msg->nextBlock("SurfaceInfo"); | ||
1559 | msg->addVector3("UVCoord", LLVector3(pick.mUVCoords)); | ||
1560 | msg->addVector3("STCoord", LLVector3(pick.mSTCoords)); | ||
1561 | msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace); | ||
1562 | msg->addVector3("Position", pick.mIntersection); | ||
1563 | msg->addVector3("Normal", pick.mNormal); | ||
1564 | msg->addVector3("Binormal", pick.mBinormal); | ||
1724 | msg->sendMessage( object->getRegion()->getHost()); | 1565 | msg->sendMessage( object->getRegion()->getHost()); |
1725 | 1566 | ||
1726 | // *NOTE: Hope the packets arrive safely and in order or else | 1567 | // *NOTE: Hope the packets arrive safely and in order or else |
@@ -1732,6 +1573,13 @@ class LLObjectTouch : public view_listener_t | |||
1732 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | 1573 | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); |
1733 | msg->nextBlockFast(_PREHASH_ObjectData); | 1574 | msg->nextBlockFast(_PREHASH_ObjectData); |
1734 | msg->addU32Fast(_PREHASH_LocalID, object->mLocalID); | 1575 | msg->addU32Fast(_PREHASH_LocalID, object->mLocalID); |
1576 | msg->nextBlock("SurfaceInfo"); | ||
1577 | msg->addVector3("UVCoord", LLVector3(pick.mUVCoords)); | ||
1578 | msg->addVector3("STCoord", LLVector3(pick.mSTCoords)); | ||
1579 | msg->addS32Fast(_PREHASH_FaceIndex, pick.mObjectFace); | ||
1580 | msg->addVector3("Position", pick.mIntersection); | ||
1581 | msg->addVector3("Normal", pick.mNormal); | ||
1582 | msg->addVector3("Binormal", pick.mBinormal); | ||
1735 | msg->sendMessage(object->getRegion()->getHost()); | 1583 | msg->sendMessage(object->getRegion()->getHost()); |
1736 | 1584 | ||
1737 | return true; | 1585 | return true; |
@@ -1744,7 +1592,7 @@ class LLObjectEnableTouch : public view_listener_t | |||
1744 | { | 1592 | { |
1745 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 1593 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
1746 | { | 1594 | { |
1747 | LLViewerObject* obj = gObjectList.findObject(gLastHitObjectID); | 1595 | LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
1748 | bool new_value = obj && obj->flagHandleTouch(); | 1596 | bool new_value = obj && obj->flagHandleTouch(); |
1749 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 1597 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
1750 | 1598 | ||
@@ -1763,7 +1611,7 @@ class LLObjectEnableTouch : public view_listener_t | |||
1763 | } | 1611 | } |
1764 | }; | 1612 | }; |
1765 | 1613 | ||
1766 | void label_touch(LLString& label, void*) | 1614 | void label_touch(std::string& label, void*) |
1767 | { | 1615 | { |
1768 | LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); | 1616 | LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->getFirstRootNode(); |
1769 | if (node && node->mValid && !node->mTouchName.empty()) | 1617 | if (node && node->mValid && !node->mTouchName.empty()) |
@@ -1778,7 +1626,7 @@ void label_touch(LLString& label, void*) | |||
1778 | 1626 | ||
1779 | bool handle_object_open() | 1627 | bool handle_object_open() |
1780 | { | 1628 | { |
1781 | LLViewerObject* obj = gObjectList.findObject(gLastHitObjectID); | 1629 | LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
1782 | if(!obj) return true; | 1630 | if(!obj) return true; |
1783 | 1631 | ||
1784 | LLFloaterOpenObject::show(); | 1632 | LLFloaterOpenObject::show(); |
@@ -1799,7 +1647,7 @@ class LLObjectEnableOpen : public view_listener_t | |||
1799 | { | 1647 | { |
1800 | // Look for contents in root object, which is all the LLFloaterOpenObject | 1648 | // Look for contents in root object, which is all the LLFloaterOpenObject |
1801 | // understands. | 1649 | // understands. |
1802 | LLViewerObject* obj = gObjectList.findObject(gLastHitObjectID); | 1650 | LLViewerObject* obj = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
1803 | bool new_value = (obj != NULL); | 1651 | bool new_value = (obj != NULL); |
1804 | if (new_value) | 1652 | if (new_value) |
1805 | { | 1653 | { |
@@ -1825,35 +1673,62 @@ class LLViewCheckBuildMode : public view_listener_t | |||
1825 | 1673 | ||
1826 | bool toggle_build_mode() | 1674 | bool toggle_build_mode() |
1827 | { | 1675 | { |
1828 | if (LLToolMgr::getInstance()->inEdit()) | 1676 | if (LLToolMgr::getInstance()->inBuildMode()) |
1829 | { | 1677 | { |
1830 | // just reset the view, will pull us out of edit mode | 1678 | if (gSavedSettings.getBOOL("EditCameraMovement")) |
1831 | handle_reset_view(); | 1679 | { |
1832 | 1680 | // just reset the view, will pull us out of edit mode | |
1681 | handle_reset_view(); | ||
1682 | } | ||
1683 | else | ||
1684 | { | ||
1685 | // manually disable edit mode, but do not affect the camera | ||
1686 | gAgent.resetView(false); | ||
1687 | gFloaterTools->close(); | ||
1688 | gViewerWindow->showCursor(); | ||
1689 | } | ||
1833 | // avoid spurious avatar movements pulling out of edit mode | 1690 | // avoid spurious avatar movements pulling out of edit mode |
1834 | LLViewerJoystick::getInstance()->moveAvatar(true); | 1691 | LLViewerJoystick::getInstance()->moveAvatar(true); |
1835 | } | 1692 | } |
1836 | else | 1693 | else |
1837 | { | 1694 | { |
1838 | if (LLViewerJoystick::getInstance()->getOverrideCamera()) | 1695 | ECameraMode camMode = gAgent.getCameraMode(); |
1696 | if (CAMERA_MODE_MOUSELOOK == camMode || CAMERA_MODE_CUSTOMIZE_AVATAR == camMode) | ||
1839 | { | 1697 | { |
1840 | handle_toggle_flycam(); | 1698 | // pull the user out of mouselook or appearance mode when entering build mode |
1699 | handle_reset_view(); | ||
1841 | } | 1700 | } |
1842 | 1701 | ||
1843 | if (gAgent.getFocusOnAvatar() && gSavedSettings.getBOOL("EditCameraMovement") ) | 1702 | if (gSavedSettings.getBOOL("EditCameraMovement")) |
1844 | { | 1703 | { |
1845 | // zoom in if we're looking at the avatar | 1704 | // camera should be set |
1846 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); | 1705 | if (LLViewerJoystick::getInstance()->getOverrideCamera()) |
1847 | gAgent.setFocusGlobal(gAgent.getPositionGlobal() + 2.0 * LLVector3d(gAgent.getAtAxis())); | 1706 | { |
1848 | gAgent.cameraZoomIn(0.666f); | 1707 | handle_toggle_flycam(); |
1849 | gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); | 1708 | } |
1709 | |||
1710 | if (gAgent.getFocusOnAvatar()) | ||
1711 | { | ||
1712 | // zoom in if we're looking at the avatar | ||
1713 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); | ||
1714 | gAgent.setFocusGlobal(gAgent.getPositionGlobal() + 2.0 * LLVector3d(gAgent.getAtAxis())); | ||
1715 | gAgent.cameraZoomIn(0.666f); | ||
1716 | gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); | ||
1717 | } | ||
1850 | } | 1718 | } |
1851 | 1719 | ||
1720 | |||
1852 | LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); | 1721 | LLToolMgr::getInstance()->setCurrentToolset(gBasicToolset); |
1853 | LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); | 1722 | LLToolMgr::getInstance()->getCurrentToolset()->selectTool( LLToolCompCreate::getInstance() ); |
1854 | 1723 | ||
1855 | // Could be first use | 1724 | // Could be first use |
1856 | LLFirstUse::useBuild(); | 1725 | LLFirstUse::useBuild(); |
1726 | |||
1727 | gAgent.resetView(false); | ||
1728 | |||
1729 | // avoid spurious avatar movements | ||
1730 | LLViewerJoystick::getInstance()->moveAvatar(true); | ||
1731 | |||
1857 | } | 1732 | } |
1858 | return true; | 1733 | return true; |
1859 | } | 1734 | } |
@@ -1899,14 +1774,14 @@ class LLObjectBuild : public view_listener_t | |||
1899 | { | 1774 | { |
1900 | // zoom in if we're looking at the avatar | 1775 | // zoom in if we're looking at the avatar |
1901 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); | 1776 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); |
1902 | gAgent.setFocusGlobal(gLastHitPosGlobal + gLastHitObjectOffset, gLastHitObjectID); | 1777 | gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); |
1903 | gAgent.cameraZoomIn(0.666f); | 1778 | gAgent.cameraZoomIn(0.666f); |
1904 | gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); | 1779 | gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); |
1905 | gViewerWindow->moveCursorToCenter(); | 1780 | gViewerWindow->moveCursorToCenter(); |
1906 | } | 1781 | } |
1907 | else if ( gSavedSettings.getBOOL("EditCameraMovement") ) | 1782 | else if ( gSavedSettings.getBOOL("EditCameraMovement") ) |
1908 | { | 1783 | { |
1909 | gAgent.setFocusGlobal(gLastHitPosGlobal + gLastHitObjectOffset, gLastHitObjectID); | 1784 | gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); |
1910 | gViewerWindow->moveCursorToCenter(); | 1785 | gViewerWindow->moveCursorToCenter(); |
1911 | } | 1786 | } |
1912 | 1787 | ||
@@ -1939,13 +1814,17 @@ class LLObjectEdit : public view_listener_t | |||
1939 | else | 1814 | else |
1940 | { | 1815 | { |
1941 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); | 1816 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); |
1817 | LLViewerObject* selected_objectp = selection->getFirstRootObject(); | ||
1818 | if (selected_objectp) | ||
1819 | { | ||
1942 | // zoom in on object center instead of where we clicked, as we need to see the manipulator handles | 1820 | // zoom in on object center instead of where we clicked, as we need to see the manipulator handles |
1943 | gAgent.setFocusGlobal(gLastHitPosGlobal /*+ gLastHitObjectOffset*/, gLastHitObjectID); | 1821 | gAgent.setFocusGlobal(selected_objectp->getPositionGlobal(), selected_objectp->getID()); |
1944 | gAgent.cameraZoomIn(0.666f); | 1822 | gAgent.cameraZoomIn(0.666f); |
1945 | gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); | 1823 | gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); |
1946 | gViewerWindow->moveCursorToCenter(); | 1824 | gViewerWindow->moveCursorToCenter(); |
1947 | } | 1825 | } |
1948 | } | 1826 | } |
1827 | } | ||
1949 | 1828 | ||
1950 | gFloaterTools->open(); /* Flawfinder: ignore */ | 1829 | gFloaterTools->open(); /* Flawfinder: ignore */ |
1951 | 1830 | ||
@@ -1984,7 +1863,7 @@ class LLLandBuild : public view_listener_t | |||
1984 | { | 1863 | { |
1985 | // zoom in if we're looking at the avatar | 1864 | // zoom in if we're looking at the avatar |
1986 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); | 1865 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); |
1987 | gAgent.setFocusGlobal(gLastHitPosGlobal + gLastHitObjectOffset, gLastHitObjectID); | 1866 | gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); |
1988 | gAgent.cameraZoomIn(0.666f); | 1867 | gAgent.cameraZoomIn(0.666f); |
1989 | gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); | 1868 | gAgent.cameraOrbitOver( 30.f * DEG_TO_RAD ); |
1990 | gViewerWindow->moveCursorToCenter(); | 1869 | gViewerWindow->moveCursorToCenter(); |
@@ -1992,7 +1871,7 @@ class LLLandBuild : public view_listener_t | |||
1992 | else if ( gSavedSettings.getBOOL("EditCameraMovement") ) | 1871 | else if ( gSavedSettings.getBOOL("EditCameraMovement") ) |
1993 | { | 1872 | { |
1994 | // otherwise just move focus | 1873 | // otherwise just move focus |
1995 | gAgent.setFocusGlobal(gLastHitPosGlobal + gLastHitObjectOffset, gLastHitObjectID); | 1874 | gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); |
1996 | gViewerWindow->moveCursorToCenter(); | 1875 | gViewerWindow->moveCursorToCenter(); |
1997 | } | 1876 | } |
1998 | 1877 | ||
@@ -2059,8 +1938,18 @@ class LLEnableEdit : public view_listener_t | |||
2059 | { | 1938 | { |
2060 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 1939 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2061 | { | 1940 | { |
2062 | bool new_value = gAgent.isGodlike() || !gAgent.inPrelude(); | 1941 | // *HACK: The new "prelude" Help Islands have a build sandbox area, |
2063 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 1942 | // so users need the Edit and Create pie menu options when they are |
1943 | // there. Eventually this needs to be replaced with code that only | ||
1944 | // lets you edit objects if you have permission to do so (edit perms, | ||
1945 | // group edit, god). See also lltoolbar.cpp. JC | ||
1946 | bool enable = true; | ||
1947 | if (gAgent.inPrelude()) | ||
1948 | { | ||
1949 | enable = LLViewerParcelMgr::getInstance()->agentCanBuild() | ||
1950 | || LLSelectMgr::getInstance()->getSelection()->isAttachment(); | ||
1951 | } | ||
1952 | gMenuHolder->findControl(userdata["control"].asString())->setValue(enable); | ||
2064 | return true; | 1953 | return true; |
2065 | } | 1954 | } |
2066 | }; | 1955 | }; |
@@ -2110,15 +1999,19 @@ BOOL enable_has_attachments(void*) | |||
2110 | //--------------------------------------------------------------------------- | 1999 | //--------------------------------------------------------------------------- |
2111 | void handle_follow(void *userdata) | 2000 | void handle_follow(void *userdata) |
2112 | { | 2001 | { |
2113 | // follow a given avatar, ID in gLastHitObjectID | 2002 | // follow a given avatar by ID |
2114 | gAgent.startFollowPilot(gLastHitObjectID); | 2003 | LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
2004 | if (objectp) | ||
2005 | { | ||
2006 | gAgent.startFollowPilot(objectp->getID()); | ||
2007 | } | ||
2115 | } | 2008 | } |
2116 | 2009 | ||
2117 | class LLObjectEnableMute : public view_listener_t | 2010 | class LLObjectEnableMute : public view_listener_t |
2118 | { | 2011 | { |
2119 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2012 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2120 | { | 2013 | { |
2121 | LLViewerObject* object = gViewerWindow->lastObjectHit(); | 2014 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
2122 | bool new_value = (object != NULL); | 2015 | bool new_value = (object != NULL); |
2123 | if (new_value) | 2016 | if (new_value) |
2124 | { | 2017 | { |
@@ -2127,7 +2020,7 @@ class LLObjectEnableMute : public view_listener_t | |||
2127 | { | 2020 | { |
2128 | // It's an avatar | 2021 | // It's an avatar |
2129 | LLNameValue *lastname = avatar->getNVPair("LastName"); | 2022 | LLNameValue *lastname = avatar->getNVPair("LastName"); |
2130 | BOOL is_linden = lastname && !LLString::compareStrings(lastname->getString(), "Linden"); | 2023 | BOOL is_linden = lastname && !LLStringUtil::compareStrings(lastname->getString(), "Linden"); |
2131 | BOOL is_self = avatar->isSelf(); | 2024 | BOOL is_self = avatar->isSelf(); |
2132 | new_value = !is_linden && !is_self; | 2025 | new_value = !is_linden && !is_self; |
2133 | } | 2026 | } |
@@ -2141,11 +2034,11 @@ class LLObjectMute : public view_listener_t | |||
2141 | { | 2034 | { |
2142 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2035 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2143 | { | 2036 | { |
2144 | LLViewerObject* object = gViewerWindow->lastObjectHit(); | 2037 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
2145 | if (!object) return true; | 2038 | if (!object) return true; |
2146 | 2039 | ||
2147 | LLUUID id; | 2040 | LLUUID id; |
2148 | LLString name; | 2041 | std::string name; |
2149 | LLMute::EType type; | 2042 | LLMute::EType type; |
2150 | LLVOAvatar* avatar = find_avatar_from_object(object); | 2043 | LLVOAvatar* avatar = find_avatar_from_object(object); |
2151 | if (avatar) | 2044 | if (avatar) |
@@ -2197,11 +2090,12 @@ bool handle_go_to() | |||
2197 | // JAMESDEBUG try simulator autopilot | 2090 | // JAMESDEBUG try simulator autopilot |
2198 | std::vector<std::string> strings; | 2091 | std::vector<std::string> strings; |
2199 | std::string val; | 2092 | std::string val; |
2200 | val = llformat("%g", gLastHitPosGlobal.mdV[VX]); | 2093 | LLVector3d pos = LLToolPie::getInstance()->getPick().mPosGlobal; |
2094 | val = llformat("%g", pos.mdV[VX]); | ||
2201 | strings.push_back(val); | 2095 | strings.push_back(val); |
2202 | val = llformat("%g", gLastHitPosGlobal.mdV[VY]); | 2096 | val = llformat("%g", pos.mdV[VY]); |
2203 | strings.push_back(val); | 2097 | strings.push_back(val); |
2204 | val = llformat("%g", gLastHitPosGlobal.mdV[VZ]); | 2098 | val = llformat("%g", pos.mdV[VZ]); |
2205 | strings.push_back(val); | 2099 | strings.push_back(val); |
2206 | send_generic_message("autopilot", strings); | 2100 | send_generic_message("autopilot", strings); |
2207 | 2101 | ||
@@ -2270,15 +2164,15 @@ class LLAvatarFreeze : public view_listener_t | |||
2270 | { | 2164 | { |
2271 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2165 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2272 | { | 2166 | { |
2273 | LLVOAvatar* avatar = find_avatar_from_object( gViewerWindow->lastObjectHit() ); | 2167 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getFirstObject() ); |
2274 | if( avatar ) | 2168 | if( avatar ) |
2275 | { | 2169 | { |
2276 | LLUUID* avatar_id = new LLUUID( avatar->getID() ); | 2170 | LLUUID* avatar_id = new LLUUID( avatar->getID() ); |
2277 | LLString fullname = avatar->getFullname(); | 2171 | std::string fullname = avatar->getFullname(); |
2278 | 2172 | ||
2279 | if (!fullname.empty()) | 2173 | if (!fullname.empty()) |
2280 | { | 2174 | { |
2281 | LLString::format_map_t args; | 2175 | LLStringUtil::format_map_t args; |
2282 | args["[AVATAR_NAME]"] = fullname; | 2176 | args["[AVATAR_NAME]"] = fullname; |
2283 | gViewerWindow->alertXml("FreezeAvatarFullname", | 2177 | gViewerWindow->alertXml("FreezeAvatarFullname", |
2284 | args, | 2178 | args, |
@@ -2320,7 +2214,7 @@ class LLAvatarDebug : public view_listener_t | |||
2320 | { | 2214 | { |
2321 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2215 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2322 | { | 2216 | { |
2323 | LLVOAvatar* avatar = find_avatar_from_object( gViewerWindow->lastObjectHit() ); | 2217 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getFirstObject() ); |
2324 | if( avatar ) | 2218 | if( avatar ) |
2325 | { | 2219 | { |
2326 | avatar->dumpLocalTextures(); | 2220 | avatar->dumpLocalTextures(); |
@@ -2372,15 +2266,15 @@ class LLAvatarEject : public view_listener_t | |||
2372 | { | 2266 | { |
2373 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2267 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2374 | { | 2268 | { |
2375 | LLVOAvatar* avatar = find_avatar_from_object( gViewerWindow->lastObjectHit() ); | 2269 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getFirstObject() ); |
2376 | if( avatar ) | 2270 | if( avatar ) |
2377 | { | 2271 | { |
2378 | LLUUID* avatar_id = new LLUUID( avatar->getID() ); | 2272 | LLUUID* avatar_id = new LLUUID( avatar->getID() ); |
2379 | LLString fullname = avatar->getFullname(); | 2273 | std::string fullname = avatar->getFullname(); |
2380 | 2274 | ||
2381 | if (!fullname.empty()) | 2275 | if (!fullname.empty()) |
2382 | { | 2276 | { |
2383 | LLString::format_map_t args; | 2277 | LLStringUtil::format_map_t args; |
2384 | args["[AVATAR_NAME]"] = fullname; | 2278 | args["[AVATAR_NAME]"] = fullname; |
2385 | gViewerWindow->alertXml("EjectAvatarFullname", | 2279 | gViewerWindow->alertXml("EjectAvatarFullname", |
2386 | args, | 2280 | args, |
@@ -2402,7 +2296,7 @@ class LLAvatarEnableFreezeEject : public view_listener_t | |||
2402 | { | 2296 | { |
2403 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2297 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2404 | { | 2298 | { |
2405 | LLVOAvatar* avatar = find_avatar_from_object( gViewerWindow->lastObjectHit() ); | 2299 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getFirstObject() ); |
2406 | bool new_value = (avatar != NULL); | 2300 | bool new_value = (avatar != NULL); |
2407 | 2301 | ||
2408 | if (new_value) | 2302 | if (new_value) |
@@ -2427,11 +2321,11 @@ class LLAvatarGiveCard : public view_listener_t | |||
2427 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2321 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2428 | { | 2322 | { |
2429 | llinfos << "handle_give_card()" << llendl; | 2323 | llinfos << "handle_give_card()" << llendl; |
2430 | LLViewerObject* dest = gViewerWindow->lastObjectHit(); | 2324 | LLViewerObject* dest = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
2431 | if(dest && dest->isAvatar()) | 2325 | if(dest && dest->isAvatar()) |
2432 | { | 2326 | { |
2433 | bool found_name = false; | 2327 | bool found_name = false; |
2434 | LLString::format_map_t args; | 2328 | LLStringUtil::format_map_t args; |
2435 | LLNameValue* nvfirst = dest->getNVPair("FirstName"); | 2329 | LLNameValue* nvfirst = dest->getNVPair("FirstName"); |
2436 | LLNameValue* nvlast = dest->getNVPair("LastName"); | 2330 | LLNameValue* nvlast = dest->getNVPair("LastName"); |
2437 | if(nvfirst && nvlast) | 2331 | if(nvfirst && nvlast) |
@@ -2500,63 +2394,34 @@ void handle_leave_group(void *) | |||
2500 | { | 2394 | { |
2501 | if (gAgent.getGroupID() != LLUUID::null) | 2395 | if (gAgent.getGroupID() != LLUUID::null) |
2502 | { | 2396 | { |
2503 | LLString::format_map_t args; | 2397 | LLStringUtil::format_map_t args; |
2504 | args["[GROUP]"] = gAgent.mGroupName; | 2398 | args["[GROUP]"] = gAgent.mGroupName; |
2505 | gViewerWindow->alertXml("GroupLeaveConfirmMember", args, callback_leave_group); | 2399 | gViewerWindow->alertXml("GroupLeaveConfirmMember", args, callback_leave_group); |
2506 | } | 2400 | } |
2507 | } | 2401 | } |
2508 | 2402 | ||
2509 | void append_aggregate(LLString& string, const LLAggregatePermissions& ag_perm, PermissionBit bit, const char* txt) | 2403 | void append_aggregate(std::string& string, const LLAggregatePermissions& ag_perm, PermissionBit bit, const char* txt) |
2510 | { | 2404 | { |
2511 | LLAggregatePermissions::EValue val = ag_perm.getValue(bit); | 2405 | LLAggregatePermissions::EValue val = ag_perm.getValue(bit); |
2512 | char buffer[MAX_STRING]; /* Flawfinder: ignore */ | 2406 | std::string buffer; |
2513 | buffer[0] = '\0'; | ||
2514 | switch(val) | 2407 | switch(val) |
2515 | { | 2408 | { |
2516 | case LLAggregatePermissions::AP_NONE: | 2409 | case LLAggregatePermissions::AP_NONE: |
2517 | snprintf(buffer, MAX_STRING, "* %s None\n", txt); /* Flawfinder: ignore */ | 2410 | buffer = llformat( "* %s None\n", txt); |
2518 | break; | 2411 | break; |
2519 | case LLAggregatePermissions::AP_SOME: | 2412 | case LLAggregatePermissions::AP_SOME: |
2520 | snprintf(buffer, MAX_STRING, "* %s Some\n", txt); /* Flawfinder: ignore */ | 2413 | buffer = llformat( "* %s Some\n", txt); |
2521 | break; | 2414 | break; |
2522 | case LLAggregatePermissions::AP_ALL: | 2415 | case LLAggregatePermissions::AP_ALL: |
2523 | snprintf(buffer, MAX_STRING, "* %s All\n", txt); /* Flawfinder: ignore */ | 2416 | buffer = llformat( "* %s All\n", txt); |
2524 | break; | 2417 | break; |
2525 | case LLAggregatePermissions::AP_EMPTY: | 2418 | case LLAggregatePermissions::AP_EMPTY: |
2526 | default: | 2419 | default: |
2527 | break; | 2420 | break; |
2528 | } | 2421 | } |
2529 | string.append(buffer); | 2422 | string.append(buffer); |
2530 | } | 2423 | } |
2531 | 2424 | ||
2532 | const char* build_extensions_string(LLFilePicker::ELoadFilter filter) | ||
2533 | { | ||
2534 | switch(filter) | ||
2535 | { | ||
2536 | #if LL_WINDOWS | ||
2537 | case LLFilePicker::FFLOAD_IMAGE: | ||
2538 | return IMAGE_EXTENSIONS; | ||
2539 | case LLFilePicker::FFLOAD_WAV: | ||
2540 | return SOUND_EXTENSIONS; | ||
2541 | case LLFilePicker::FFLOAD_ANIM: | ||
2542 | return ANIM_EXTENSIONS; | ||
2543 | case LLFilePicker::FFLOAD_SLOBJECT: | ||
2544 | return SLOBJECT_EXTENSIONS; | ||
2545 | #ifdef _CORY_TESTING | ||
2546 | case LLFilePicker::FFLOAD_GEOMETRY: | ||
2547 | return GEOMETRY_EXTENSIONS; | ||
2548 | #endif | ||
2549 | case LLFilePicker::FFLOAD_XML: | ||
2550 | return XML_EXTENSIONS; | ||
2551 | case LLFilePicker::FFLOAD_ALL: | ||
2552 | return ALL_FILE_EXTENSIONS; | ||
2553 | #endif | ||
2554 | default: | ||
2555 | return ALL_FILE_EXTENSIONS; | ||
2556 | } | ||
2557 | } | ||
2558 | |||
2559 | |||
2560 | BOOL enable_buy(void*) | 2425 | BOOL enable_buy(void*) |
2561 | { | 2426 | { |
2562 | // In order to buy, there must only be 1 purchaseable object in | 2427 | // In order to buy, there must only be 1 purchaseable object in |
@@ -2599,7 +2464,7 @@ void handle_buy_object(LLSaleInfo sale_info) | |||
2599 | } | 2464 | } |
2600 | 2465 | ||
2601 | LLUUID owner_id; | 2466 | LLUUID owner_id; |
2602 | LLString owner_name; | 2467 | std::string owner_name; |
2603 | BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); | 2468 | BOOL owners_identical = LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name); |
2604 | if (!owners_identical) | 2469 | if (!owners_identical) |
2605 | { | 2470 | { |
@@ -2695,9 +2560,9 @@ void handle_dump_region_object_cache(void*) | |||
2695 | 2560 | ||
2696 | void handle_dump_focus(void *) | 2561 | void handle_dump_focus(void *) |
2697 | { | 2562 | { |
2698 | LLView *view = gFocusMgr.getKeyboardFocus(); | 2563 | LLUICtrl *ctrl = dynamic_cast<LLUICtrl*>(gFocusMgr.getKeyboardFocus()); |
2699 | 2564 | ||
2700 | llinfos << "Keyboard focus " << (view ? view->getName() : "(none)") << llendl; | 2565 | llinfos << "Keyboard focus " << (ctrl ? ctrl->getName() : "(none)") << llendl; |
2701 | } | 2566 | } |
2702 | 2567 | ||
2703 | class LLSelfStandUp : public view_listener_t | 2568 | class LLSelfStandUp : public view_listener_t |
@@ -2765,7 +2630,7 @@ void set_god_level(U8 god_level) | |||
2765 | LLViewerLogin::getInstance()->isInProductionGrid()); | 2630 | LLViewerLogin::getInstance()->isInProductionGrid()); |
2766 | } | 2631 | } |
2767 | 2632 | ||
2768 | LLString::format_map_t args; | 2633 | LLStringUtil::format_map_t args; |
2769 | if(god_level > GOD_NOT) | 2634 | if(god_level > GOD_NOT) |
2770 | { | 2635 | { |
2771 | args["[LEVEL]"] = llformat("%d",(S32)god_level); | 2636 | args["[LEVEL]"] = llformat("%d",(S32)god_level); |
@@ -2813,7 +2678,7 @@ void process_grant_godlike_powers(LLMessageSystem* msg, void**) | |||
2813 | } | 2678 | } |
2814 | } | 2679 | } |
2815 | 2680 | ||
2816 | void load_url_local_file(const char* file_name) | 2681 | void load_url_local_file(const std::string& file_name) |
2817 | { | 2682 | { |
2818 | if( gAgent.cameraMouselook() ) | 2683 | if( gAgent.cameraMouselook() ) |
2819 | { | 2684 | { |
@@ -2837,7 +2702,7 @@ void load_url_local_file(const char* file_name) | |||
2837 | full_path.append(gDirUtilp->getDirDelimiter()); | 2702 | full_path.append(gDirUtilp->getDirDelimiter()); |
2838 | full_path.append(file_name); | 2703 | full_path.append(file_name); |
2839 | 2704 | ||
2840 | LLWeb::loadURL(full_path.c_str()); | 2705 | LLWeb::loadURL(full_path); |
2841 | } | 2706 | } |
2842 | 2707 | ||
2843 | /* | 2708 | /* |
@@ -2913,7 +2778,7 @@ class LLAvatarEnableAddFriend : public view_listener_t | |||
2913 | { | 2778 | { |
2914 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2779 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2915 | { | 2780 | { |
2916 | LLVOAvatar* avatar = find_avatar_from_object(gViewerWindow->lastObjectHit()); | 2781 | LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getFirstObject()); |
2917 | bool new_value = avatar && !is_agent_friend(avatar->getID()); | 2782 | bool new_value = avatar && !is_agent_friend(avatar->getID()); |
2918 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 2783 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
2919 | return true; | 2784 | return true; |
@@ -2925,8 +2790,8 @@ void request_friendship(const LLUUID& dest_id) | |||
2925 | LLViewerObject* dest = gObjectList.findObject(dest_id); | 2790 | LLViewerObject* dest = gObjectList.findObject(dest_id); |
2926 | if(dest && dest->isAvatar()) | 2791 | if(dest && dest->isAvatar()) |
2927 | { | 2792 | { |
2928 | LLString fullname; | 2793 | std::string fullname; |
2929 | LLString::format_map_t args; | 2794 | LLStringUtil::format_map_t args; |
2930 | LLNameValue* nvfirst = dest->getNVPair("FirstName"); | 2795 | LLNameValue* nvfirst = dest->getNVPair("FirstName"); |
2931 | LLNameValue* nvlast = dest->getNVPair("LastName"); | 2796 | LLNameValue* nvlast = dest->getNVPair("LastName"); |
2932 | if(nvfirst && nvlast) | 2797 | if(nvfirst && nvlast) |
@@ -2939,8 +2804,7 @@ void request_friendship(const LLUUID& dest_id) | |||
2939 | } | 2804 | } |
2940 | if (!fullname.empty()) | 2805 | if (!fullname.empty()) |
2941 | { | 2806 | { |
2942 | LLPanelFriends::requestFriendship(dest_id, fullname); | 2807 | LLPanelFriends::requestFriendshipDialog(dest_id, fullname); |
2943 | LLNotifyBox::showXml("OfferedFriendship", args); | ||
2944 | } | 2808 | } |
2945 | else | 2809 | else |
2946 | { | 2810 | { |
@@ -2954,16 +2818,22 @@ class LLEditEnableCustomizeAvatar : public view_listener_t | |||
2954 | { | 2818 | { |
2955 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2819 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2956 | { | 2820 | { |
2957 | bool new_value = gAgent.getWearablesLoaded(); | 2821 | LLVOAvatar* avatar = gAgent.getAvatarObject(); |
2958 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 2822 | |
2823 | bool enabled = ((avatar && avatar->isFullyLoaded()) && | ||
2824 | (gAgent.getWearablesLoaded())); | ||
2825 | |||
2826 | gMenuHolder->findControl(userdata["control"].asString())->setValue(enabled); | ||
2959 | return true; | 2827 | return true; |
2960 | } | 2828 | } |
2961 | }; | 2829 | }; |
2962 | 2830 | ||
2831 | // only works on pie menu | ||
2963 | bool handle_sit_or_stand() | 2832 | bool handle_sit_or_stand() |
2964 | { | 2833 | { |
2965 | LLViewerObject *object = gObjectList.findObject(gLastHitNonFloraObjectID); | 2834 | LLPickInfo pick = LLToolPie::getInstance()->getPick(); |
2966 | if (!object) | 2835 | LLViewerObject *object = pick.getObject();; |
2836 | if (!object || pick.mPickType == LLPickInfo::PICK_FLORA) | ||
2967 | { | 2837 | { |
2968 | return true; | 2838 | return true; |
2969 | } | 2839 | } |
@@ -2978,17 +2848,13 @@ bool handle_sit_or_stand() | |||
2978 | 2848 | ||
2979 | if (object && object->getPCode() == LL_PCODE_VOLUME) | 2849 | if (object && object->getPCode() == LL_PCODE_VOLUME) |
2980 | { | 2850 | { |
2981 | LLVector3d offset_double = gViewerWindow->lastNonFloraObjectHitOffset(); | ||
2982 | LLVector3 offset_single; | ||
2983 | offset_single.setVec(offset_double); | ||
2984 | |||
2985 | gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); | 2851 | gMessageSystem->newMessageFast(_PREHASH_AgentRequestSit); |
2986 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); | 2852 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); |
2987 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | 2853 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); |
2988 | gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | 2854 | gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); |
2989 | gMessageSystem->nextBlockFast(_PREHASH_TargetObject); | 2855 | gMessageSystem->nextBlockFast(_PREHASH_TargetObject); |
2990 | gMessageSystem->addUUIDFast(_PREHASH_TargetID, object->mID); | 2856 | gMessageSystem->addUUIDFast(_PREHASH_TargetID, object->mID); |
2991 | gMessageSystem->addVector3Fast(_PREHASH_Offset, offset_single); | 2857 | gMessageSystem->addVector3Fast(_PREHASH_Offset, pick.mObjectOffset); |
2992 | 2858 | ||
2993 | object->getRegion()->sendReliableMessage(); | 2859 | object->getRegion()->sendReliableMessage(); |
2994 | } | 2860 | } |
@@ -3022,7 +2888,7 @@ class LLLandSit : public view_listener_t | |||
3022 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); | 2888 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); |
3023 | LLViewerParcelMgr::getInstance()->deselectLand(); | 2889 | LLViewerParcelMgr::getInstance()->deselectLand(); |
3024 | 2890 | ||
3025 | LLVector3d posGlobal = gLastHitPosGlobal; | 2891 | LLVector3d posGlobal = LLToolPie::getInstance()->getPick().mPosGlobal; |
3026 | 2892 | ||
3027 | LLQuaternion target_rot; | 2893 | LLQuaternion target_rot; |
3028 | if (gAgent.getAvatarObject()) | 2894 | if (gAgent.getAvatarObject()) |
@@ -3104,60 +2970,6 @@ void handle_audio_status_4(void*) | |||
3104 | } | 2970 | } |
3105 | #endif | 2971 | #endif |
3106 | 2972 | ||
3107 | void manage_landmarks(void*) | ||
3108 | { | ||
3109 | LLFloaterLandmark::showInstance(1); | ||
3110 | } | ||
3111 | |||
3112 | void create_new_landmark(void*) | ||
3113 | { | ||
3114 | // Note this is temporary cut and paste of legacy functionality. | ||
3115 | // TODO: Make this spawn a floater allowing user customize before creating the inventory object | ||
3116 | |||
3117 | LLViewerRegion* agent_region = gAgent.getRegion(); | ||
3118 | if(!agent_region) | ||
3119 | { | ||
3120 | llwarns << "No agent region" << llendl; | ||
3121 | return; | ||
3122 | } | ||
3123 | LLParcel* agent_parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); | ||
3124 | if (!agent_parcel) | ||
3125 | { | ||
3126 | llwarns << "No agent parcel" << llendl; | ||
3127 | return; | ||
3128 | } | ||
3129 | if (!agent_parcel->getAllowLandmark() | ||
3130 | && !LLViewerParcelMgr::isParcelOwnedByAgent(agent_parcel, GP_LAND_ALLOW_LANDMARK)) | ||
3131 | { | ||
3132 | gViewerWindow->alertXml("CannotCreateLandmarkNotOwner"); | ||
3133 | return; | ||
3134 | } | ||
3135 | |||
3136 | LLUUID folder_id; | ||
3137 | folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK); | ||
3138 | std::string pos_string; | ||
3139 | gAgent.buildLocationString(pos_string); | ||
3140 | |||
3141 | create_inventory_item(gAgent.getID(), gAgent.getSessionID(), | ||
3142 | folder_id, LLTransactionID::tnull, | ||
3143 | pos_string, pos_string, // name, desc | ||
3144 | LLAssetType::AT_LANDMARK, | ||
3145 | LLInventoryType::IT_LANDMARK, | ||
3146 | NOT_WEARABLE, PERM_ALL, | ||
3147 | NULL); | ||
3148 | } | ||
3149 | |||
3150 | void landmark_menu_action(void* userdata) | ||
3151 | { | ||
3152 | LLUUID item_id = *(LLUUID*)userdata; | ||
3153 | |||
3154 | LLViewerInventoryItem* itemp = gInventory.getItem(item_id); | ||
3155 | if (itemp) | ||
3156 | { | ||
3157 | open_landmark(itemp, itemp->getName(), FALSE); | ||
3158 | } | ||
3159 | } | ||
3160 | |||
3161 | void reload_ui(void *) | 2973 | void reload_ui(void *) |
3162 | { | 2974 | { |
3163 | LLUICtrlFactory::getInstance()->rebuild(); | 2975 | LLUICtrlFactory::getInstance()->rebuild(); |
@@ -3635,17 +3447,17 @@ void handle_claim_public_land(void*) | |||
3635 | msg->nextBlock("MethodData"); | 3447 | msg->nextBlock("MethodData"); |
3636 | msg->addString("Method", "claimpublicland"); | 3448 | msg->addString("Method", "claimpublicland"); |
3637 | msg->addUUID("Invoice", LLUUID::null); | 3449 | msg->addUUID("Invoice", LLUUID::null); |
3638 | char buffer[32]; /* Flawfinder: ignore */ | 3450 | std::string buffer; |
3639 | snprintf(buffer, sizeof(buffer), "%f", west_south.mV[VX]); /* Flawfinder: ignore */ | 3451 | buffer = llformat( "%f", west_south.mV[VX]); |
3640 | msg->nextBlock("ParamList"); | 3452 | msg->nextBlock("ParamList"); |
3641 | msg->addString("Parameter", buffer); | 3453 | msg->addString("Parameter", buffer); |
3642 | snprintf(buffer, sizeof(buffer), "%f", west_south.mV[VY]); /* Flawfinder: ignore */ | 3454 | buffer = llformat( "%f", west_south.mV[VY]); |
3643 | msg->nextBlock("ParamList"); | 3455 | msg->nextBlock("ParamList"); |
3644 | msg->addString("Parameter", buffer); | 3456 | msg->addString("Parameter", buffer); |
3645 | snprintf(buffer, sizeof(buffer), "%f", east_north.mV[VX]); /* Flawfinder: ignore */ | 3457 | buffer = llformat( "%f", east_north.mV[VX]); |
3646 | msg->nextBlock("ParamList"); | 3458 | msg->nextBlock("ParamList"); |
3647 | msg->addString("Parameter", buffer); | 3459 | msg->addString("Parameter", buffer); |
3648 | snprintf(buffer, sizeof(buffer), "%f", east_north.mV[VY]); /* Flawfinder: ignore */ | 3460 | buffer = llformat( "%f", east_north.mV[VY]); |
3649 | msg->nextBlock("ParamList"); | 3461 | msg->nextBlock("ParamList"); |
3650 | msg->addString("Parameter", buffer); | 3462 | msg->addString("Parameter", buffer); |
3651 | gAgent.sendReliableMessage(); | 3463 | gAgent.sendReliableMessage(); |
@@ -4156,11 +3968,11 @@ class LLToolsEnableBuyOrTake : public view_listener_t | |||
4156 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 3968 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
4157 | 3969 | ||
4158 | // Update label | 3970 | // Update label |
4159 | LLString label; | 3971 | std::string label; |
4160 | LLString buy_text; | 3972 | std::string buy_text; |
4161 | LLString take_text; | 3973 | std::string take_text; |
4162 | LLString param = userdata["data"].asString(); | 3974 | std::string param = userdata["data"].asString(); |
4163 | LLString::size_type offset = param.find(","); | 3975 | std::string::size_type offset = param.find(","); |
4164 | if (offset != param.npos) | 3976 | if (offset != param.npos) |
4165 | { | 3977 | { |
4166 | buy_text = param.substr(0, offset); | 3978 | buy_text = param.substr(0, offset); |
@@ -4254,7 +4066,7 @@ void show_buy_currency(const char* extra) | |||
4254 | } | 4066 | } |
4255 | mesg << "Go to " << BUY_CURRENCY_URL << "\nfor information on purchasing currency?"; | 4067 | mesg << "Go to " << BUY_CURRENCY_URL << "\nfor information on purchasing currency?"; |
4256 | 4068 | ||
4257 | LLString::format_map_t args; | 4069 | LLStringUtil::format_map_t args; |
4258 | if (extra != NULL) | 4070 | if (extra != NULL) |
4259 | { | 4071 | { |
4260 | args["[EXTRA]"] = extra; | 4072 | args["[EXTRA]"] = extra; |
@@ -4448,7 +4260,7 @@ class LLToolsLink : public view_listener_t | |||
4448 | S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); | 4260 | S32 object_count = LLSelectMgr::getInstance()->getSelection()->getObjectCount(); |
4449 | if (object_count > MAX_CHILDREN_PER_TASK + 1) | 4261 | if (object_count > MAX_CHILDREN_PER_TASK + 1) |
4450 | { | 4262 | { |
4451 | LLStringBase<char>::format_map_t args; | 4263 | LLStringUtil::format_map_t args; |
4452 | args["[COUNT]"] = llformat("%d", object_count); | 4264 | args["[COUNT]"] = llformat("%d", object_count); |
4453 | int max = MAX_CHILDREN_PER_TASK+1; | 4265 | int max = MAX_CHILDREN_PER_TASK+1; |
4454 | args["[MAX]"] = llformat("%d", max); | 4266 | args["[MAX]"] = llformat("%d", max); |
@@ -4467,7 +4279,7 @@ class LLToolsLink : public view_listener_t | |||
4467 | return true; | 4279 | return true; |
4468 | } | 4280 | } |
4469 | LLUUID owner_id; | 4281 | LLUUID owner_id; |
4470 | LLString owner_name; | 4282 | std::string owner_name; |
4471 | if(!LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name)) | 4283 | if(!LLSelectMgr::getInstance()->selectGetOwner(owner_id, owner_name)) |
4472 | { | 4284 | { |
4473 | // we don't actually care if you're the owner, but novices are | 4285 | // we don't actually care if you're the owner, but novices are |
@@ -4507,13 +4319,31 @@ class LLToolsStopAllAnimations : public view_listener_t | |||
4507 | { | 4319 | { |
4508 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4320 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
4509 | { | 4321 | { |
4510 | LLVOAvatar* avatarp = gAgent.getAvatarObject(); | 4322 | LLVOAvatar* avatarp = gAgent.getAvatarObject(); |
4511 | 4323 | if (avatarp) | |
4512 | if (!avatarp) return true; | 4324 | { |
4513 | 4325 | avatarp->deactivateAllMotions(); | |
4514 | avatarp->deactivateAllMotions(); | 4326 | avatarp->startDefaultMotions(); |
4515 | 4327 | } | |
4516 | avatarp->processAnimationStateChanges(); | 4328 | return true; |
4329 | } | ||
4330 | }; | ||
4331 | |||
4332 | class LLToolsReleaseKeys : public view_listener_t | ||
4333 | { | ||
4334 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
4335 | { | ||
4336 | gAgent.forceReleaseControls(); | ||
4337 | |||
4338 | return true; | ||
4339 | } | ||
4340 | }; | ||
4341 | |||
4342 | class LLToolsEnableReleaseKeys : public view_listener_t | ||
4343 | { | ||
4344 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
4345 | { | ||
4346 | gMenuHolder->findControl(userdata["control"].asString())->setValue( gAgent.anyControlGrabbed() ); | ||
4517 | return true; | 4347 | return true; |
4518 | } | 4348 | } |
4519 | }; | 4349 | }; |
@@ -4846,8 +4676,8 @@ void show_debug_menus() | |||
4846 | gMenuBarView->setItemVisible(SERVER_MENU_NAME, show_server_menu); | 4676 | gMenuBarView->setItemVisible(SERVER_MENU_NAME, show_server_menu); |
4847 | gMenuBarView->setItemEnabled(SERVER_MENU_NAME, show_server_menu); | 4677 | gMenuBarView->setItemEnabled(SERVER_MENU_NAME, show_server_menu); |
4848 | 4678 | ||
4849 | //gMenuBarView->setItemVisible(LLString("DebugOptions"), visible); | 4679 | //gMenuBarView->setItemVisible("DebugOptions", visible); |
4850 | //gMenuBarView->setItemVisible(LLString(AVI_TOOLS), visible); | 4680 | //gMenuBarView->setItemVisible(std::string(AVI_TOOLS), visible); |
4851 | 4681 | ||
4852 | gMenuBarView->arrange(); // clean-up positioning | 4682 | gMenuBarView->arrange(); // clean-up positioning |
4853 | }; | 4683 | }; |
@@ -4877,43 +4707,43 @@ void toggle_map( void* user_data ) | |||
4877 | } | 4707 | } |
4878 | 4708 | ||
4879 | 4709 | ||
4880 | LLUUID gExporterRequestID; | 4710 | // LLUUID gExporterRequestID; |
4881 | LLString gExportDirectory; | 4711 | // std::string gExportDirectory; |
4882 | 4712 | ||
4883 | LLUploadDialog *gExportDialog = NULL; | 4713 | // LLUploadDialog *gExportDialog = NULL; |
4884 | 4714 | ||
4885 | void handle_export_selected( void * ) | 4715 | // void handle_export_selected( void * ) |
4886 | { | 4716 | // { |
4887 | LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); | 4717 | // LLObjectSelectionHandle selection = LLSelectMgr::getInstance()->getSelection(); |
4888 | if (selection->isEmpty()) | 4718 | // if (selection->isEmpty()) |
4889 | { | 4719 | // { |
4890 | return; | 4720 | // return; |
4891 | } | 4721 | // } |
4892 | llinfos << "Exporting selected objects:" << llendl; | 4722 | // llinfos << "Exporting selected objects:" << llendl; |
4893 | 4723 | ||
4894 | gExporterRequestID.generate(); | 4724 | // gExporterRequestID.generate(); |
4895 | gExportDirectory = ""; | 4725 | // gExportDirectory = ""; |
4896 | 4726 | ||
4897 | LLMessageSystem* msg = gMessageSystem; | 4727 | // LLMessageSystem* msg = gMessageSystem; |
4898 | msg->newMessageFast(_PREHASH_ObjectExportSelected); | 4728 | // msg->newMessageFast(_PREHASH_ObjectExportSelected); |
4899 | msg->nextBlockFast(_PREHASH_AgentData); | 4729 | // msg->nextBlockFast(_PREHASH_AgentData); |
4900 | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | 4730 | // msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); |
4901 | msg->addUUIDFast(_PREHASH_RequestID, gExporterRequestID); | 4731 | // msg->addUUIDFast(_PREHASH_RequestID, gExporterRequestID); |
4902 | msg->addS16Fast(_PREHASH_VolumeDetail, 4); | 4732 | // msg->addS16Fast(_PREHASH_VolumeDetail, 4); |
4903 | 4733 | ||
4904 | for (LLObjectSelection::root_iterator iter = selection->root_begin(); | 4734 | // for (LLObjectSelection::root_iterator iter = selection->root_begin(); |
4905 | iter != selection->root_end(); iter++) | 4735 | // iter != selection->root_end(); iter++) |
4906 | { | 4736 | // { |
4907 | LLSelectNode* node = *iter; | 4737 | // LLSelectNode* node = *iter; |
4908 | LLViewerObject* object = node->getObject(); | 4738 | // LLViewerObject* object = node->getObject(); |
4909 | msg->nextBlockFast(_PREHASH_ObjectData); | 4739 | // msg->nextBlockFast(_PREHASH_ObjectData); |
4910 | msg->addUUIDFast(_PREHASH_ObjectID, object->getID()); | 4740 | // msg->addUUIDFast(_PREHASH_ObjectID, object->getID()); |
4911 | llinfos << "Object: " << object->getID() << llendl; | 4741 | // llinfos << "Object: " << object->getID() << llendl; |
4912 | } | 4742 | // } |
4913 | msg->sendReliable(gAgent.getRegion()->getHost()); | 4743 | // msg->sendReliable(gAgent.getRegion()->getHost()); |
4914 | 4744 | ||
4915 | gExportDialog = LLUploadDialog::modalUploadDialog("Exporting selected objects..."); | 4745 | // gExportDialog = LLUploadDialog::modalUploadDialog("Exporting selected objects..."); |
4916 | } | 4746 | // } |
4917 | 4747 | ||
4918 | BOOL menu_check_build_tool( void* user_data ) | 4748 | BOOL menu_check_build_tool( void* user_data ) |
4919 | { | 4749 | { |
@@ -5118,7 +4948,7 @@ class LLAvatarInviteToGroup : public view_listener_t | |||
5118 | { | 4948 | { |
5119 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4949 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5120 | { | 4950 | { |
5121 | LLVOAvatar* avatar = find_avatar_from_object( gViewerWindow->lastObjectHit() ); | 4951 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getFirstObject() ); |
5122 | if(avatar) | 4952 | if(avatar) |
5123 | { | 4953 | { |
5124 | invite_to_group(avatar->getID()); | 4954 | invite_to_group(avatar->getID()); |
@@ -5131,7 +4961,7 @@ class LLAvatarAddFriend : public view_listener_t | |||
5131 | { | 4961 | { |
5132 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 4962 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5133 | { | 4963 | { |
5134 | LLVOAvatar* avatar = find_avatar_from_object( gViewerWindow->lastObjectHit() ); | 4964 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getFirstObject() ); |
5135 | if(avatar && !is_agent_friend(avatar->getID())) | 4965 | if(avatar && !is_agent_friend(avatar->getID())) |
5136 | { | 4966 | { |
5137 | request_friendship(avatar->getID()); | 4967 | request_friendship(avatar->getID()); |
@@ -5204,11 +5034,11 @@ class LLEnablePayObject : public view_listener_t | |||
5204 | { | 5034 | { |
5205 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5035 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5206 | { | 5036 | { |
5207 | LLVOAvatar* avatar = find_avatar_from_object(gViewerWindow->lastObjectHit()); | 5037 | LLVOAvatar* avatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getFirstObject()); |
5208 | bool new_value = (avatar != NULL); | 5038 | bool new_value = (avatar != NULL); |
5209 | if (!new_value) | 5039 | if (!new_value) |
5210 | { | 5040 | { |
5211 | LLViewerObject* object = gViewerWindow->lastObjectHit(); | 5041 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
5212 | if( object ) | 5042 | if( object ) |
5213 | { | 5043 | { |
5214 | LLViewerObject *parent = (LLViewerObject *)object->getParent(); | 5044 | LLViewerObject *parent = (LLViewerObject *)object->getParent(); |
@@ -5228,8 +5058,9 @@ class LLObjectEnableSitOrStand : public view_listener_t | |||
5228 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5058 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5229 | { | 5059 | { |
5230 | bool new_value = false; | 5060 | bool new_value = false; |
5231 | LLViewerObject* dest_object = NULL; | 5061 | LLViewerObject* dest_object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
5232 | if((dest_object = gObjectList.findObject(gLastHitObjectID))) | 5062 | |
5063 | if(dest_object) | ||
5233 | { | 5064 | { |
5234 | if(dest_object->getPCode() == LL_PCODE_VOLUME) | 5065 | if(dest_object->getPCode() == LL_PCODE_VOLUME) |
5235 | { | 5066 | { |
@@ -5239,11 +5070,11 @@ class LLObjectEnableSitOrStand : public view_listener_t | |||
5239 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 5070 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
5240 | 5071 | ||
5241 | // Update label | 5072 | // Update label |
5242 | LLString label; | 5073 | std::string label; |
5243 | LLString sit_text; | 5074 | std::string sit_text; |
5244 | LLString stand_text; | 5075 | std::string stand_text; |
5245 | LLString param = userdata["data"].asString(); | 5076 | std::string param = userdata["data"].asString(); |
5246 | LLString::size_type offset = param.find(","); | 5077 | std::string::size_type offset = param.find(","); |
5247 | if (offset != param.npos) | 5078 | if (offset != param.npos) |
5248 | { | 5079 | { |
5249 | sit_text = param.substr(0, offset); | 5080 | sit_text = param.substr(0, offset); |
@@ -5330,7 +5161,7 @@ class LLShowFloater : public view_listener_t | |||
5330 | { | 5161 | { |
5331 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5162 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5332 | { | 5163 | { |
5333 | LLString floater_name = userdata.asString(); | 5164 | std::string floater_name = userdata.asString(); |
5334 | if (floater_name == "gestures") | 5165 | if (floater_name == "gestures") |
5335 | { | 5166 | { |
5336 | LLFloaterGesture::toggleVisibility(); | 5167 | LLFloaterGesture::toggleVisibility(); |
@@ -5430,7 +5261,7 @@ class LLShowFloater : public view_listener_t | |||
5430 | } | 5261 | } |
5431 | else if (floater_name == "help tutorial") | 5262 | else if (floater_name == "help tutorial") |
5432 | { | 5263 | { |
5433 | LLFloaterHUD::show(); | 5264 | LLFloaterHUD::showHUD(); |
5434 | } | 5265 | } |
5435 | else if (floater_name == "complaint reporter") | 5266 | else if (floater_name == "complaint reporter") |
5436 | { | 5267 | { |
@@ -5475,8 +5306,8 @@ class LLFloaterVisible : public view_listener_t | |||
5475 | { | 5306 | { |
5476 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5307 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5477 | { | 5308 | { |
5478 | LLString control_name = userdata["control"].asString(); | 5309 | std::string control_name = userdata["control"].asString(); |
5479 | LLString floater_name = userdata["data"].asString(); | 5310 | std::string floater_name = userdata["data"].asString(); |
5480 | bool new_value = false; | 5311 | bool new_value = false; |
5481 | if (floater_name == "friends") | 5312 | if (floater_name == "friends") |
5482 | { | 5313 | { |
@@ -5519,12 +5350,12 @@ class LLFloaterVisible : public view_listener_t | |||
5519 | } | 5350 | } |
5520 | }; | 5351 | }; |
5521 | 5352 | ||
5522 | void callback_show_url(S32 option, void* url) | 5353 | void callback_show_url(S32 option, void* data) |
5523 | { | 5354 | { |
5524 | const char* urlp = (const char*)url; | 5355 | std::string* urlp = (std::string*)data; |
5525 | if (0 == option) | 5356 | if (0 == option) |
5526 | { | 5357 | { |
5527 | LLWeb::loadURL(urlp); | 5358 | LLWeb::loadURL(*urlp); |
5528 | } | 5359 | } |
5529 | delete urlp; | 5360 | delete urlp; |
5530 | } | 5361 | } |
@@ -5533,22 +5364,13 @@ class LLPromptShowURL : public view_listener_t | |||
5533 | { | 5364 | { |
5534 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5365 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5535 | { | 5366 | { |
5536 | LLString param = userdata.asString(); | 5367 | std::string param = userdata.asString(); |
5537 | LLString::size_type offset = param.find(","); | 5368 | std::string::size_type offset = param.find(","); |
5538 | if (offset != param.npos) | 5369 | if (offset != param.npos) |
5539 | { | 5370 | { |
5540 | LLString alert = param.substr(0, offset); | 5371 | std::string alert = param.substr(0, offset); |
5541 | LLString url = param.substr(offset+1); | 5372 | std::string url = param.substr(offset+1); |
5542 | char *url_copy = new char[url.size()+1]; | 5373 | std::string* url_copy = new std::string(url); |
5543 | if (url_copy != NULL) | ||
5544 | { | ||
5545 | strcpy(url_copy, url.c_str()); /* Flawfinder: ignore */ | ||
5546 | } | ||
5547 | else | ||
5548 | { | ||
5549 | llerrs << "Memory Allocation Failed" << llendl; | ||
5550 | return false; | ||
5551 | } | ||
5552 | gViewerWindow->alertXml(alert, callback_show_url, url_copy); | 5374 | gViewerWindow->alertXml(alert, callback_show_url, url_copy); |
5553 | } | 5375 | } |
5554 | else | 5376 | else |
@@ -5559,12 +5381,12 @@ class LLPromptShowURL : public view_listener_t | |||
5559 | } | 5381 | } |
5560 | }; | 5382 | }; |
5561 | 5383 | ||
5562 | void callback_show_file(S32 option, void* filename) | 5384 | void callback_show_file(S32 option, void* data) |
5563 | { | 5385 | { |
5564 | const char* filenamep = (const char*)filename; | 5386 | std::string* filenamep = (std::string*)data; |
5565 | if (0 == option) | 5387 | if (0 == option) |
5566 | { | 5388 | { |
5567 | load_url_local_file(filenamep); | 5389 | load_url_local_file(*filenamep); |
5568 | } | 5390 | } |
5569 | delete filenamep; | 5391 | delete filenamep; |
5570 | } | 5392 | } |
@@ -5573,22 +5395,13 @@ class LLPromptShowFile : public view_listener_t | |||
5573 | { | 5395 | { |
5574 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5396 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
5575 | { | 5397 | { |
5576 | LLString param = userdata.asString(); | 5398 | std::string param = userdata.asString(); |
5577 | LLString::size_type offset = param.find(","); | 5399 | std::string::size_type offset = param.find(","); |
5578 | if (offset != param.npos) | 5400 | if (offset != param.npos) |
5579 | { | 5401 | { |
5580 | LLString alert = param.substr(0, offset); | 5402 | std::string alert = param.substr(0, offset); |
5581 | LLString file = param.substr(offset+1); | 5403 | std::string file = param.substr(offset+1); |
5582 | char *file_copy = new char[file.size()+1]; | 5404 | std::string* file_copy = new std::string(file); |
5583 | if (file_copy != NULL) | ||
5584 | { | ||
5585 | strcpy(file_copy, file.c_str()); /* Flawfinder: ignore */ | ||
5586 | } | ||
5587 | else | ||
5588 | { | ||
5589 | llerrs << "Memory Allocation Failed" << llendl; | ||
5590 | return false; | ||
5591 | } | ||
5592 | gViewerWindow->alertXml(alert, callback_show_file, file_copy); | 5405 | gViewerWindow->alertXml(alert, callback_show_file, file_copy); |
5593 | } | 5406 | } |
5594 | else | 5407 | else |
@@ -5610,7 +5423,11 @@ class LLShowAgentProfile : public view_listener_t | |||
5610 | } | 5423 | } |
5611 | else if (userdata.asString() == "hit object") | 5424 | else if (userdata.asString() == "hit object") |
5612 | { | 5425 | { |
5613 | agent_id = gLastHitObjectID; | 5426 | LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
5427 | if (objectp) | ||
5428 | { | ||
5429 | agent_id = objectp->getID(); | ||
5430 | } | ||
5614 | } | 5431 | } |
5615 | else | 5432 | else |
5616 | { | 5433 | { |
@@ -5646,12 +5463,12 @@ void handle_focus(void *) | |||
5646 | { | 5463 | { |
5647 | // zoom in if we're looking at the avatar | 5464 | // zoom in if we're looking at the avatar |
5648 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); | 5465 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); |
5649 | gAgent.setFocusGlobal(gLastHitPosGlobal + gLastHitObjectOffset, gLastHitObjectID); | 5466 | gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); |
5650 | gAgent.cameraZoomIn(0.666f); | 5467 | gAgent.cameraZoomIn(0.666f); |
5651 | } | 5468 | } |
5652 | else | 5469 | else |
5653 | { | 5470 | { |
5654 | gAgent.setFocusGlobal(gLastHitPosGlobal + gLastHitObjectOffset, gLastHitObjectID); | 5471 | gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); |
5655 | } | 5472 | } |
5656 | 5473 | ||
5657 | gViewerWindow->moveCursorToCenter(); | 5474 | gViewerWindow->moveCursorToCenter(); |
@@ -5669,19 +5486,19 @@ class LLLandEdit : public view_listener_t | |||
5669 | { | 5486 | { |
5670 | // zoom in if we're looking at the avatar | 5487 | // zoom in if we're looking at the avatar |
5671 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); | 5488 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); |
5672 | gAgent.setFocusGlobal(gLastHitPosGlobal + gLastHitObjectOffset, gLastHitObjectID); | 5489 | gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); |
5673 | 5490 | ||
5674 | gAgent.cameraOrbitOver( F_PI * 0.25f ); | 5491 | gAgent.cameraOrbitOver( F_PI * 0.25f ); |
5675 | gViewerWindow->moveCursorToCenter(); | 5492 | gViewerWindow->moveCursorToCenter(); |
5676 | } | 5493 | } |
5677 | else if ( gSavedSettings.getBOOL("EditCameraMovement") ) | 5494 | else if ( gSavedSettings.getBOOL("EditCameraMovement") ) |
5678 | { | 5495 | { |
5679 | gAgent.setFocusGlobal(gLastHitPosGlobal + gLastHitObjectOffset, gLastHitObjectID); | 5496 | gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); |
5680 | gViewerWindow->moveCursorToCenter(); | 5497 | gViewerWindow->moveCursorToCenter(); |
5681 | } | 5498 | } |
5682 | 5499 | ||
5683 | 5500 | ||
5684 | LLViewerParcelMgr::getInstance()->selectParcelAt( gLastHitPosGlobal ); | 5501 | LLViewerParcelMgr::getInstance()->selectParcelAt( LLToolPie::getInstance()->getPick().mPosGlobal ); |
5685 | 5502 | ||
5686 | gFloaterTools->showMore(TRUE); | 5503 | gFloaterTools->showMore(TRUE); |
5687 | gFloaterView->bringToFront( gFloaterTools ); | 5504 | gFloaterView->bringToFront( gFloaterTools ); |
@@ -5719,13 +5536,13 @@ void handle_move(void*) | |||
5719 | { | 5536 | { |
5720 | // zoom in if we're looking at the avatar | 5537 | // zoom in if we're looking at the avatar |
5721 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); | 5538 | gAgent.setFocusOnAvatar(FALSE, ANIMATE); |
5722 | gAgent.setFocusGlobal(gLastHitPosGlobal + gLastHitObjectOffset, gLastHitObjectID); | 5539 | gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); |
5723 | 5540 | ||
5724 | gAgent.cameraZoomIn(0.666f); | 5541 | gAgent.cameraZoomIn(0.666f); |
5725 | } | 5542 | } |
5726 | else | 5543 | else |
5727 | { | 5544 | { |
5728 | gAgent.setFocusGlobal(gLastHitPosGlobal + gLastHitObjectOffset, gLastHitObjectID); | 5545 | gAgent.setFocusGlobal(LLToolPie::getInstance()->getPick()); |
5729 | } | 5546 | } |
5730 | 5547 | ||
5731 | gViewerWindow->moveCursorToCenter(); | 5548 | gViewerWindow->moveCursorToCenter(); |
@@ -5827,7 +5644,7 @@ class LLAttachmentDrop : public view_listener_t | |||
5827 | { | 5644 | { |
5828 | // Called when the user clicked on an object attached to them | 5645 | // Called when the user clicked on an object attached to them |
5829 | // and selected "Drop". | 5646 | // and selected "Drop". |
5830 | LLViewerObject *object = gViewerWindow->lastObjectHit(); | 5647 | LLViewerObject *object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
5831 | if (!object) | 5648 | if (!object) |
5832 | { | 5649 | { |
5833 | llwarns << "handle_drop_attachment() - no object to drop" << llendl; | 5650 | llwarns << "handle_drop_attachment() - no object to drop" << llendl; |
@@ -5886,7 +5703,7 @@ void handle_detach_from_avatar(void* user_data) | |||
5886 | } | 5703 | } |
5887 | } | 5704 | } |
5888 | 5705 | ||
5889 | void attach_label(LLString& label, void* user_data) | 5706 | void attach_label(std::string& label, void* user_data) |
5890 | { | 5707 | { |
5891 | LLViewerJointAttachment* attachmentp = (LLViewerJointAttachment*)user_data; | 5708 | LLViewerJointAttachment* attachmentp = (LLViewerJointAttachment*)user_data; |
5892 | if (attachmentp) | 5709 | if (attachmentp) |
@@ -5897,13 +5714,13 @@ void attach_label(LLString& label, void* user_data) | |||
5897 | LLViewerInventoryItem* itemp = gInventory.getItem(attachmentp->getItemID()); | 5714 | LLViewerInventoryItem* itemp = gInventory.getItem(attachmentp->getItemID()); |
5898 | if (itemp) | 5715 | if (itemp) |
5899 | { | 5716 | { |
5900 | label += LLString(" (") + itemp->getName() + LLString(")"); | 5717 | label += std::string(" (") + itemp->getName() + std::string(")"); |
5901 | } | 5718 | } |
5902 | } | 5719 | } |
5903 | } | 5720 | } |
5904 | } | 5721 | } |
5905 | 5722 | ||
5906 | void detach_label(LLString& label, void* user_data) | 5723 | void detach_label(std::string& label, void* user_data) |
5907 | { | 5724 | { |
5908 | LLViewerJointAttachment* attachmentp = (LLViewerJointAttachment*)user_data; | 5725 | LLViewerJointAttachment* attachmentp = (LLViewerJointAttachment*)user_data; |
5909 | if (attachmentp) | 5726 | if (attachmentp) |
@@ -5914,7 +5731,7 @@ void detach_label(LLString& label, void* user_data) | |||
5914 | LLViewerInventoryItem* itemp = gInventory.getItem(attachmentp->getItemID()); | 5731 | LLViewerInventoryItem* itemp = gInventory.getItem(attachmentp->getItemID()); |
5915 | if (itemp) | 5732 | if (itemp) |
5916 | { | 5733 | { |
5917 | label += LLString(" (") + itemp->getName() + LLString(")"); | 5734 | label += std::string(" (") + itemp->getName() + std::string(")"); |
5918 | } | 5735 | } |
5919 | } | 5736 | } |
5920 | } | 5737 | } |
@@ -5927,7 +5744,7 @@ class LLAttachmentDetach : public view_listener_t | |||
5927 | { | 5744 | { |
5928 | // Called when the user clicked on an object attached to them | 5745 | // Called when the user clicked on an object attached to them |
5929 | // and selected "Detach". | 5746 | // and selected "Detach". |
5930 | LLViewerObject *object = gViewerWindow->lastObjectHit(); | 5747 | LLViewerObject *object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
5931 | if (!object) | 5748 | if (!object) |
5932 | { | 5749 | { |
5933 | llwarns << "handle_detach() - no object to detach" << llendl; | 5750 | llwarns << "handle_detach() - no object to detach" << llendl; |
@@ -6007,7 +5824,7 @@ class LLAttachmentEnableDrop : public view_listener_t | |||
6007 | // in your inventory. Therefore, we disable the drop option until the | 5824 | // in your inventory. Therefore, we disable the drop option until the |
6008 | // item is in your inventory | 5825 | // item is in your inventory |
6009 | 5826 | ||
6010 | LLViewerObject* object = gViewerWindow->lastObjectHit(); | 5827 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
6011 | LLViewerJointAttachment* attachment_pt = NULL; | 5828 | LLViewerJointAttachment* attachment_pt = NULL; |
6012 | LLInventoryItem* item = NULL; | 5829 | LLInventoryItem* item = NULL; |
6013 | 5830 | ||
@@ -6049,7 +5866,7 @@ class LLAttachmentEnableDrop : public view_listener_t | |||
6049 | 5866 | ||
6050 | BOOL enable_detach(void*) | 5867 | BOOL enable_detach(void*) |
6051 | { | 5868 | { |
6052 | LLViewerObject* object = gViewerWindow->lastObjectHit(); | 5869 | LLViewerObject* object = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
6053 | if (!object) return FALSE; | 5870 | if (!object) return FALSE; |
6054 | if (!object->isAttachment()) return FALSE; | 5871 | if (!object->isAttachment()) return FALSE; |
6055 | 5872 | ||
@@ -6089,9 +5906,12 @@ BOOL object_selected_and_point_valid(void *user_data) | |||
6089 | { | 5906 | { |
6090 | LLSelectNode* node = *iter; | 5907 | LLSelectNode* node = *iter; |
6091 | LLViewerObject* object = node->getObject(); | 5908 | LLViewerObject* object = node->getObject(); |
6092 | for (U32 child_num = 0; child_num < object->mChildList.size(); child_num++ ) | 5909 | LLViewerObject::const_child_list_t& child_list = object->getChildren(); |
5910 | for (LLViewerObject::child_list_t::const_iterator iter = child_list.begin(); | ||
5911 | iter != child_list.end(); iter++) | ||
6093 | { | 5912 | { |
6094 | if (object->mChildList[child_num]->isAvatar()) | 5913 | LLViewerObject* child = *iter; |
5914 | if (child->isAvatar()) | ||
6095 | { | 5915 | { |
6096 | return FALSE; | 5916 | return FALSE; |
6097 | } | 5917 | } |
@@ -6153,10 +5973,10 @@ class LLAvatarSendIM : public view_listener_t | |||
6153 | { | 5973 | { |
6154 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 5974 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
6155 | { | 5975 | { |
6156 | LLVOAvatar* avatar = find_avatar_from_object( gViewerWindow->lastObjectHit() ); | 5976 | LLVOAvatar* avatar = find_avatar_from_object( LLSelectMgr::getInstance()->getSelection()->getFirstObject() ); |
6157 | if(avatar) | 5977 | if(avatar) |
6158 | { | 5978 | { |
6159 | LLString name("IM"); | 5979 | std::string name("IM"); |
6160 | LLNameValue *first = avatar->getNVPair("FirstName"); | 5980 | LLNameValue *first = avatar->getNVPair("FirstName"); |
6161 | LLNameValue *last = avatar->getNVPair("LastName"); | 5981 | LLNameValue *last = avatar->getNVPair("LastName"); |
6162 | if (first && last) | 5982 | if (first && last) |
@@ -6259,11 +6079,15 @@ class LLToolsSelectedScriptAction : public view_listener_t | |||
6259 | { | 6079 | { |
6260 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 6080 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
6261 | { | 6081 | { |
6262 | LLString action = userdata.asString(); | 6082 | std::string action = userdata.asString(); |
6263 | LLFloaterScriptQueue* queue = NULL; | 6083 | LLFloaterScriptQueue* queue = NULL; |
6264 | if (action == "compile") | 6084 | if (action == "compile mono") |
6085 | { | ||
6086 | queue = LLFloaterCompileQueue::create(TRUE); | ||
6087 | } | ||
6088 | if (action == "compile lsl") | ||
6265 | { | 6089 | { |
6266 | queue = LLFloaterCompileQueue::create(); | 6090 | queue = LLFloaterCompileQueue::create(FALSE); |
6267 | } | 6091 | } |
6268 | else if (action == "reset") | 6092 | else if (action == "reset") |
6269 | { | 6093 | { |
@@ -6424,7 +6248,7 @@ BOOL menu_ui_enabled(void *user_data) | |||
6424 | void menu_toggle_control( void* user_data ) | 6248 | void menu_toggle_control( void* user_data ) |
6425 | { | 6249 | { |
6426 | BOOL checked = gSavedSettings.getBOOL( static_cast<char*>(user_data) ); | 6250 | BOOL checked = gSavedSettings.getBOOL( static_cast<char*>(user_data) ); |
6427 | if (LLString(static_cast<char*>(user_data)) == "HighResSnapshot" && !checked) | 6251 | if (std::string(static_cast<char*>(user_data)) == "HighResSnapshot" && !checked) |
6428 | { | 6252 | { |
6429 | // High Res Snapshot active, must uncheck RenderUIInSnapshot | 6253 | // High Res Snapshot active, must uncheck RenderUIInSnapshot |
6430 | gSavedSettings.setBOOL( "RenderUIInSnapshot", FALSE ); | 6254 | gSavedSettings.setBOOL( "RenderUIInSnapshot", FALSE ); |
@@ -6438,7 +6262,7 @@ class LLToggleControl : public view_listener_t | |||
6438 | { | 6262 | { |
6439 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 6263 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
6440 | { | 6264 | { |
6441 | LLString control_name = userdata.asString(); | 6265 | std::string control_name = userdata.asString(); |
6442 | BOOL checked = gSavedSettings.getBOOL( control_name ); | 6266 | BOOL checked = gSavedSettings.getBOOL( control_name ); |
6443 | if (control_name == "HighResSnapshot" && !checked) | 6267 | if (control_name == "HighResSnapshot" && !checked) |
6444 | { | 6268 | { |
@@ -6480,6 +6304,18 @@ BOOL enable_land_selected( void* ) | |||
6480 | return !(LLViewerParcelMgr::getInstance()->selectionEmpty()); | 6304 | return !(LLViewerParcelMgr::getInstance()->selectionEmpty()); |
6481 | } | 6305 | } |
6482 | 6306 | ||
6307 | void menu_toggle_attached_lights(void* user_data) | ||
6308 | { | ||
6309 | menu_toggle_control(user_data); | ||
6310 | LLPipeline::sRenderAttachedLights = gSavedSettings.getBOOL("RenderAttachedLights"); | ||
6311 | } | ||
6312 | |||
6313 | void menu_toggle_attached_particles(void* user_data) | ||
6314 | { | ||
6315 | menu_toggle_control(user_data); | ||
6316 | LLPipeline::sRenderAttachedParticles = gSavedSettings.getBOOL("RenderAttachedParticles"); | ||
6317 | } | ||
6318 | |||
6483 | class LLSomethingSelected : public view_listener_t | 6319 | class LLSomethingSelected : public view_listener_t |
6484 | { | 6320 | { |
6485 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 6321 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
@@ -6506,16 +6342,36 @@ BOOL enable_more_than_one_selected(void* ) | |||
6506 | return (LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1); | 6342 | return (LLSelectMgr::getInstance()->getSelection()->getObjectCount() > 1); |
6507 | } | 6343 | } |
6508 | 6344 | ||
6345 | static bool is_editable_selected() | ||
6346 | { | ||
6347 | return (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); | ||
6348 | } | ||
6349 | |||
6509 | class LLEditableSelected : public view_listener_t | 6350 | class LLEditableSelected : public view_listener_t |
6510 | { | 6351 | { |
6511 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 6352 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
6512 | { | 6353 | { |
6513 | bool new_value = (LLSelectMgr::getInstance()->getSelection()->getFirstEditableObject() != NULL); | 6354 | gMenuHolder->findControl(userdata["control"].asString())->setValue(is_editable_selected()); |
6514 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | ||
6515 | return true; | 6355 | return true; |
6516 | } | 6356 | } |
6517 | }; | 6357 | }; |
6518 | 6358 | ||
6359 | class LLEditableSelectedMono : public view_listener_t | ||
6360 | { | ||
6361 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
6362 | { | ||
6363 | LLViewerRegion* region = gAgent.getRegion(); | ||
6364 | if(region && gMenuHolder && gMenuHolder->findControl(userdata["control"].asString())) | ||
6365 | { | ||
6366 | bool have_cap = (! region->getCapability("UpdateScriptTask").empty()); | ||
6367 | bool selected = is_editable_selected() && have_cap; | ||
6368 | gMenuHolder->findControl(userdata["control"].asString())->setValue(selected); | ||
6369 | return true; | ||
6370 | } | ||
6371 | return false; | ||
6372 | } | ||
6373 | }; | ||
6374 | |||
6519 | class LLToolsEnableTakeCopy : public view_listener_t | 6375 | class LLToolsEnableTakeCopy : public view_listener_t |
6520 | { | 6376 | { |
6521 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 6377 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
@@ -6692,22 +6548,22 @@ BOOL enable_not_thirdperson(void*) | |||
6692 | } | 6548 | } |
6693 | 6549 | ||
6694 | 6550 | ||
6695 | BOOL enable_export_selected(void *) | 6551 | // BOOL enable_export_selected(void *) |
6696 | { | 6552 | // { |
6697 | if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) | 6553 | // if (LLSelectMgr::getInstance()->getSelection()->isEmpty()) |
6698 | { | 6554 | // { |
6699 | return FALSE; | 6555 | // return FALSE; |
6700 | } | 6556 | // } |
6701 | if (!gExporterRequestID.isNull()) | 6557 | // if (!gExporterRequestID.isNull()) |
6702 | { | 6558 | // { |
6703 | return FALSE; | 6559 | // return FALSE; |
6704 | } | 6560 | // } |
6705 | if (!LLUploadDialog::modalUploadIsFinished()) | 6561 | // if (!LLUploadDialog::modalUploadIsFinished()) |
6706 | { | 6562 | // { |
6707 | return FALSE; | 6563 | // return FALSE; |
6708 | } | 6564 | // } |
6709 | return TRUE; | 6565 | // return TRUE; |
6710 | } | 6566 | // } |
6711 | 6567 | ||
6712 | class LLViewEnableMouselook : public view_listener_t | 6568 | class LLViewEnableMouselook : public view_listener_t |
6713 | { | 6569 | { |
@@ -6941,7 +6797,11 @@ void handle_dump_avatar_local_textures(void*) | |||
6941 | 6797 | ||
6942 | void handle_debug_avatar_textures(void*) | 6798 | void handle_debug_avatar_textures(void*) |
6943 | { | 6799 | { |
6944 | LLFloaterAvatarTextures::show(gLastHitObjectID); | 6800 | LLViewerObject* objectp = LLSelectMgr::getInstance()->getSelection()->getFirstObject(); |
6801 | if (objectp) | ||
6802 | { | ||
6803 | LLFloaterAvatarTextures::show(objectp->getID()); | ||
6804 | } | ||
6945 | } | 6805 | } |
6946 | 6806 | ||
6947 | void handle_grab_texture(void* data) | 6807 | void handle_grab_texture(void* data) |
@@ -6957,7 +6817,7 @@ void handle_grab_texture(void* data) | |||
6957 | LLUUID folder_id(gInventory.findCategoryUUIDForType(asset_type)); | 6817 | LLUUID folder_id(gInventory.findCategoryUUIDForType(asset_type)); |
6958 | if(folder_id.notNull()) | 6818 | if(folder_id.notNull()) |
6959 | { | 6819 | { |
6960 | LLString name = "Baked "; | 6820 | std::string name = "Baked "; |
6961 | switch (index) | 6821 | switch (index) |
6962 | { | 6822 | { |
6963 | case LLVOAvatar::TEX_EYES_BAKED: | 6823 | case LLVOAvatar::TEX_EYES_BAKED: |
@@ -6994,7 +6854,7 @@ void handle_grab_texture(void* data) | |||
6994 | PERM_NONE, | 6854 | PERM_NONE, |
6995 | PERM_NONE, | 6855 | PERM_NONE, |
6996 | next_owner_perm); | 6856 | next_owner_perm); |
6997 | S32 creation_date_now = time_corrected(); | 6857 | time_t creation_date_now = time_corrected(); |
6998 | LLPointer<LLViewerInventoryItem> item | 6858 | LLPointer<LLViewerInventoryItem> item |
6999 | = new LLViewerInventoryItem(item_id, | 6859 | = new LLViewerInventoryItem(item_id, |
7000 | folder_id, | 6860 | folder_id, |
@@ -7003,7 +6863,7 @@ void handle_grab_texture(void* data) | |||
7003 | asset_type, | 6863 | asset_type, |
7004 | inv_type, | 6864 | inv_type, |
7005 | name, | 6865 | name, |
7006 | "", | 6866 | LLStringUtil::null, |
7007 | LLSaleInfo::DEFAULT, | 6867 | LLSaleInfo::DEFAULT, |
7008 | LLInventoryItem::II_FLAGS_NONE, | 6868 | LLInventoryItem::II_FLAGS_NONE, |
7009 | creation_date_now); | 6869 | creation_date_now); |
@@ -7080,12 +6940,7 @@ LLVOAvatar* find_avatar_from_object( const LLUUID& object_id ) | |||
7080 | 6940 | ||
7081 | void handle_disconnect_viewer(void *) | 6941 | void handle_disconnect_viewer(void *) |
7082 | { | 6942 | { |
7083 | char message[2048]; /* Flawfinder: ignore */ | 6943 | LLAppViewer::instance()->forceDisconnect("Testing viewer disconnect"); |
7084 | message[0] = '\0'; | ||
7085 | |||
7086 | snprintf(message, sizeof(message), "Testing viewer disconnect"); /* Flawfinder: ignore */ | ||
7087 | |||
7088 | LLAppViewer::instance()->forceDisconnect(message); | ||
7089 | } | 6944 | } |
7090 | 6945 | ||
7091 | void force_error_breakpoint(void *) | 6946 | void force_error_breakpoint(void *) |
@@ -7191,20 +7046,20 @@ void handle_save_to_xml(void*) | |||
7191 | return; | 7046 | return; |
7192 | } | 7047 | } |
7193 | 7048 | ||
7194 | LLString default_name = "floater_"; | 7049 | std::string default_name = "floater_"; |
7195 | default_name += frontmost->getTitle(); | 7050 | default_name += frontmost->getTitle(); |
7196 | default_name += ".xml"; | 7051 | default_name += ".xml"; |
7197 | 7052 | ||
7198 | LLString::toLower(default_name); | 7053 | LLStringUtil::toLower(default_name); |
7199 | LLString::replaceChar(default_name, ' ', '_'); | 7054 | LLStringUtil::replaceChar(default_name, ' ', '_'); |
7200 | LLString::replaceChar(default_name, '/', '_'); | 7055 | LLStringUtil::replaceChar(default_name, '/', '_'); |
7201 | LLString::replaceChar(default_name, ':', '_'); | 7056 | LLStringUtil::replaceChar(default_name, ':', '_'); |
7202 | LLString::replaceChar(default_name, '"', '_'); | 7057 | LLStringUtil::replaceChar(default_name, '"', '_'); |
7203 | 7058 | ||
7204 | LLFilePicker& picker = LLFilePicker::instance(); | 7059 | LLFilePicker& picker = LLFilePicker::instance(); |
7205 | if (picker.getSaveFile(LLFilePicker::FFSAVE_XML, default_name.c_str())) | 7060 | if (picker.getSaveFile(LLFilePicker::FFSAVE_XML, default_name)) |
7206 | { | 7061 | { |
7207 | LLString filename = picker.getFirstFile(); | 7062 | std::string filename = picker.getFirstFile(); |
7208 | LLUICtrlFactory::getInstance()->saveToXML(frontmost, filename); | 7063 | LLUICtrlFactory::getInstance()->saveToXML(frontmost, filename); |
7209 | } | 7064 | } |
7210 | } | 7065 | } |
@@ -7214,7 +7069,7 @@ void handle_load_from_xml(void*) | |||
7214 | LLFilePicker& picker = LLFilePicker::instance(); | 7069 | LLFilePicker& picker = LLFilePicker::instance(); |
7215 | if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) | 7070 | if (picker.getOpenFile(LLFilePicker::FFLOAD_XML)) |
7216 | { | 7071 | { |
7217 | LLString filename = picker.getFirstFile(); | 7072 | std::string filename = picker.getFirstFile(); |
7218 | LLFloater* floater = new LLFloater("sample_floater"); | 7073 | LLFloater* floater = new LLFloater("sample_floater"); |
7219 | LLUICtrlFactory::getInstance()->buildFloater(floater, filename); | 7074 | LLUICtrlFactory::getInstance()->buildFloater(floater, filename); |
7220 | } | 7075 | } |
@@ -7297,7 +7152,7 @@ class LLViewBeaconWidth : public view_listener_t | |||
7297 | { | 7152 | { |
7298 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7153 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7299 | { | 7154 | { |
7300 | LLString width = userdata.asString(); | 7155 | std::string width = userdata.asString(); |
7301 | if(width == "1") | 7156 | if(width == "1") |
7302 | { | 7157 | { |
7303 | gSavedSettings.setS32("DebugBeaconLineWidth", 1); | 7158 | gSavedSettings.setS32("DebugBeaconLineWidth", 1); |
@@ -7324,7 +7179,7 @@ class LLViewToggleBeacon : public view_listener_t | |||
7324 | { | 7179 | { |
7325 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7180 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7326 | { | 7181 | { |
7327 | LLString beacon = userdata.asString(); | 7182 | std::string beacon = userdata.asString(); |
7328 | if (beacon == "scriptsbeacon") | 7183 | if (beacon == "scriptsbeacon") |
7329 | { | 7184 | { |
7330 | LLPipeline::toggleRenderScriptedBeacons(NULL); | 7185 | LLPipeline::toggleRenderScriptedBeacons(NULL); |
@@ -7393,7 +7248,7 @@ class LLViewCheckBeaconEnabled : public view_listener_t | |||
7393 | { | 7248 | { |
7394 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7249 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7395 | { | 7250 | { |
7396 | LLString beacon = userdata["data"].asString(); | 7251 | std::string beacon = userdata["data"].asString(); |
7397 | bool new_value = false; | 7252 | bool new_value = false; |
7398 | if (beacon == "scriptsbeacon") | 7253 | if (beacon == "scriptsbeacon") |
7399 | { | 7254 | { |
@@ -7439,7 +7294,7 @@ class LLViewToggleRenderType : public view_listener_t | |||
7439 | { | 7294 | { |
7440 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7295 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7441 | { | 7296 | { |
7442 | LLString type = userdata.asString(); | 7297 | std::string type = userdata.asString(); |
7443 | if (type == "hideparticles") | 7298 | if (type == "hideparticles") |
7444 | { | 7299 | { |
7445 | LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_PARTICLES); | 7300 | LLPipeline::toggleRenderType(LLPipeline::RENDER_TYPE_PARTICLES); |
@@ -7452,7 +7307,7 @@ class LLViewCheckRenderType : public view_listener_t | |||
7452 | { | 7307 | { |
7453 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7308 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7454 | { | 7309 | { |
7455 | LLString type = userdata["data"].asString(); | 7310 | std::string type = userdata["data"].asString(); |
7456 | bool new_value = false; | 7311 | bool new_value = false; |
7457 | if (type == "hideparticles") | 7312 | if (type == "hideparticles") |
7458 | { | 7313 | { |
@@ -7486,8 +7341,8 @@ class LLEditEnableTakeOff : public view_listener_t | |||
7486 | { | 7341 | { |
7487 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7342 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7488 | { | 7343 | { |
7489 | LLString control_name = userdata["control"].asString(); | 7344 | std::string control_name = userdata["control"].asString(); |
7490 | LLString clothing = userdata["data"].asString(); | 7345 | std::string clothing = userdata["data"].asString(); |
7491 | bool new_value = false; | 7346 | bool new_value = false; |
7492 | if (clothing == "shirt") | 7347 | if (clothing == "shirt") |
7493 | { | 7348 | { |
@@ -7534,7 +7389,7 @@ class LLEditTakeOff : public view_listener_t | |||
7534 | { | 7389 | { |
7535 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7390 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7536 | { | 7391 | { |
7537 | LLString clothing = userdata.asString(); | 7392 | std::string clothing = userdata.asString(); |
7538 | if (clothing == "shirt") | 7393 | if (clothing == "shirt") |
7539 | { | 7394 | { |
7540 | LLAgent::userRemoveWearable((void*)WT_SHIRT); | 7395 | LLAgent::userRemoveWearable((void*)WT_SHIRT); |
@@ -7592,7 +7447,7 @@ class LLToolsSelectTool : public view_listener_t | |||
7592 | { | 7447 | { |
7593 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7448 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7594 | { | 7449 | { |
7595 | LLString tool_name = userdata.asString(); | 7450 | std::string tool_name = userdata.asString(); |
7596 | if (tool_name == "focus") | 7451 | if (tool_name == "focus") |
7597 | { | 7452 | { |
7598 | LLToolMgr::getInstance()->getCurrentToolset()->selectToolByIndex(1); | 7453 | LLToolMgr::getInstance()->getCurrentToolset()->selectToolByIndex(1); |
@@ -7622,7 +7477,7 @@ class LLWorldEnvSettings : public view_listener_t | |||
7622 | { | 7477 | { |
7623 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7478 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7624 | { | 7479 | { |
7625 | LLString tod = userdata.asString(); | 7480 | std::string tod = userdata.asString(); |
7626 | LLVector3 sun_direction; | 7481 | LLVector3 sun_direction; |
7627 | 7482 | ||
7628 | if (tod == "editor") | 7483 | if (tod == "editor") |
@@ -7736,7 +7591,6 @@ class LLWorldDayCycle : public view_listener_t | |||
7736 | 7591 | ||
7737 | 7592 | ||
7738 | 7593 | ||
7739 | |||
7740 | //------------------------------------------------------------------- | 7594 | //------------------------------------------------------------------- |
7741 | // Advanced menu | 7595 | // Advanced menu |
7742 | //------------------------------------------------------------------- | 7596 | //------------------------------------------------------------------- |
@@ -7751,7 +7605,7 @@ class LLAdvancedToggleConsole : public view_listener_t | |||
7751 | { | 7605 | { |
7752 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7606 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7753 | { | 7607 | { |
7754 | LLString console_type = userdata.asString(); | 7608 | std::string console_type = userdata.asString(); |
7755 | if ("frame" == console_type) | 7609 | if ("frame" == console_type) |
7756 | { | 7610 | { |
7757 | toggle_visibility( (void*)gDebugView->mFrameStatView ); | 7611 | toggle_visibility( (void*)gDebugView->mFrameStatView ); |
@@ -7781,7 +7635,7 @@ class LLAdvancedCheckConsole : public view_listener_t | |||
7781 | { | 7635 | { |
7782 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7636 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7783 | { | 7637 | { |
7784 | LLString console_type = userdata["data"].asString(); | 7638 | std::string console_type = userdata["data"].asString(); |
7785 | bool new_value = false; | 7639 | bool new_value = false; |
7786 | if ("frame" == console_type) | 7640 | if ("frame" == console_type) |
7787 | { | 7641 | { |
@@ -7804,7 +7658,7 @@ class LLAdvancedCheckConsole : public view_listener_t | |||
7804 | new_value = get_visibility( (void*)gDebugView->mMemoryView ); | 7658 | new_value = get_visibility( (void*)gDebugView->mMemoryView ); |
7805 | } | 7659 | } |
7806 | 7660 | ||
7807 | LLString control_name = userdata["control"].asString(); | 7661 | std::string control_name = userdata["control"].asString(); |
7808 | gMenuHolder->findControl(control_name)->setValue(new_value); | 7662 | gMenuHolder->findControl(control_name)->setValue(new_value); |
7809 | return true; | 7663 | return true; |
7810 | } | 7664 | } |
@@ -7812,6 +7666,7 @@ class LLAdvancedCheckConsole : public view_listener_t | |||
7812 | 7666 | ||
7813 | 7667 | ||
7814 | 7668 | ||
7669 | |||
7815 | ////////////////////////// | 7670 | ////////////////////////// |
7816 | // DUMP INFO TO CONSOLE // | 7671 | // DUMP INFO TO CONSOLE // |
7817 | ////////////////////////// | 7672 | ////////////////////////// |
@@ -7821,7 +7676,7 @@ class LLAdvancedDumpInfoToConsole : public view_listener_t | |||
7821 | { | 7676 | { |
7822 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7677 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7823 | { | 7678 | { |
7824 | LLString info_type = userdata.asString(); | 7679 | std::string info_type = userdata.asString(); |
7825 | if ("region" == info_type) | 7680 | if ("region" == info_type) |
7826 | { | 7681 | { |
7827 | handle_region_dump_settings(NULL); | 7682 | handle_region_dump_settings(NULL); |
@@ -7865,7 +7720,7 @@ class LLAdvancedToggleHUDInfo : public view_listener_t | |||
7865 | { | 7720 | { |
7866 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7721 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7867 | { | 7722 | { |
7868 | LLString info_type = userdata.asString(); | 7723 | std::string info_type = userdata.asString(); |
7869 | if ("velocity" == info_type) | 7724 | if ("velocity" == info_type) |
7870 | { | 7725 | { |
7871 | toggle_visibility( (void*)gVelocityBar ); | 7726 | toggle_visibility( (void*)gVelocityBar ); |
@@ -7890,7 +7745,7 @@ class LLAdvancedCheckHUDInfo : public view_listener_t | |||
7890 | { | 7745 | { |
7891 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 7746 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
7892 | { | 7747 | { |
7893 | LLString info_type = userdata["data"].asString(); | 7748 | std::string info_type = userdata["data"].asString(); |
7894 | bool new_value = false; | 7749 | bool new_value = false; |
7895 | if ("velocity" == info_type) | 7750 | if ("velocity" == info_type) |
7896 | { | 7751 | { |
@@ -7909,7 +7764,7 @@ class LLAdvancedCheckHUDInfo : public view_listener_t | |||
7909 | new_value = gDisplayFOV; | 7764 | new_value = gDisplayFOV; |
7910 | } | 7765 | } |
7911 | 7766 | ||
7912 | LLString control_name = userdata["control"].asString(); | 7767 | std::string control_name = userdata["control"].asString(); |
7913 | gMenuHolder->findControl(control_name)->setValue(new_value); | 7768 | gMenuHolder->findControl(control_name)->setValue(new_value); |
7914 | 7769 | ||
7915 | return true; | 7770 | return true; |
@@ -7940,7 +7795,7 @@ class LLAdvancedClearGroupCache : public view_listener_t | |||
7940 | ///////////////// | 7795 | ///////////////// |
7941 | 7796 | ||
7942 | 7797 | ||
7943 | U32 render_type_from_string(LLString render_type) | 7798 | U32 render_type_from_string(std::string render_type) |
7944 | { | 7799 | { |
7945 | if ("simple" == render_type) | 7800 | if ("simple" == render_type) |
7946 | { | 7801 | { |
@@ -8027,7 +7882,7 @@ class LLAdvancedCheckRenderType : public view_listener_t | |||
8027 | new_value = LLPipeline::hasRenderTypeControl( (void*)render_type ); | 7882 | new_value = LLPipeline::hasRenderTypeControl( (void*)render_type ); |
8028 | } | 7883 | } |
8029 | 7884 | ||
8030 | LLString control_name = userdata["control"].asString(); | 7885 | std::string control_name = userdata["control"].asString(); |
8031 | gMenuHolder->findControl(control_name)->setValue(new_value); | 7886 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8032 | return true; | 7887 | return true; |
8033 | } | 7888 | } |
@@ -8040,7 +7895,7 @@ class LLAdvancedCheckRenderType : public view_listener_t | |||
8040 | ///////////// | 7895 | ///////////// |
8041 | 7896 | ||
8042 | 7897 | ||
8043 | U32 feature_from_string(LLString feature) | 7898 | U32 feature_from_string(std::string feature) |
8044 | { | 7899 | { |
8045 | if ("ui" == feature) | 7900 | if ("ui" == feature) |
8046 | { | 7901 | { |
@@ -8113,7 +7968,7 @@ class LLAdvancedCheckFeature : public view_listener_t | |||
8113 | new_value = LLPipeline::toggleRenderDebugFeatureControl( (void*)feature ); | 7968 | new_value = LLPipeline::toggleRenderDebugFeatureControl( (void*)feature ); |
8114 | } | 7969 | } |
8115 | 7970 | ||
8116 | LLString control_name = userdata["control"].asString(); | 7971 | std::string control_name = userdata["control"].asString(); |
8117 | gMenuHolder->findControl(control_name)->setValue(new_value); | 7972 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8118 | return true; | 7973 | return true; |
8119 | } | 7974 | } |
@@ -8126,7 +7981,7 @@ class LLAdvancedCheckFeature : public view_listener_t | |||
8126 | ////////////////// | 7981 | ////////////////// |
8127 | 7982 | ||
8128 | 7983 | ||
8129 | U32 info_display_from_string(LLString info_display) | 7984 | U32 info_display_from_string(std::string info_display) |
8130 | { | 7985 | { |
8131 | if ("verify" == info_display) | 7986 | if ("verify" == info_display) |
8132 | { | 7987 | { |
@@ -8227,7 +8082,7 @@ class LLAdvancedCheckInfoDisplay : public view_listener_t | |||
8227 | new_value = LLPipeline::toggleRenderDebugControl( (void*)info_display ); | 8082 | new_value = LLPipeline::toggleRenderDebugControl( (void*)info_display ); |
8228 | } | 8083 | } |
8229 | 8084 | ||
8230 | LLString control_name = userdata["control"].asString(); | 8085 | std::string control_name = userdata["control"].asString(); |
8231 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8086 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8232 | return true; | 8087 | return true; |
8233 | } | 8088 | } |
@@ -8254,7 +8109,7 @@ class LLAdvancedCheckSelectBuffer : public view_listener_t | |||
8254 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8109 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8255 | { | 8110 | { |
8256 | bool new_value = gDebugSelect; | 8111 | bool new_value = gDebugSelect; |
8257 | LLString control_name = userdata["control"].asString(); | 8112 | std::string control_name = userdata["control"].asString(); |
8258 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8113 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8259 | return true; | 8114 | return true; |
8260 | } | 8115 | } |
@@ -8281,7 +8136,7 @@ class LLAdvancedCheckRandomizeFramerate : public view_listener_t | |||
8281 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8136 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8282 | { | 8137 | { |
8283 | bool new_value = gRandomizeFramerate; | 8138 | bool new_value = gRandomizeFramerate; |
8284 | LLString control_name = userdata["control"].asString(); | 8139 | std::string control_name = userdata["control"].asString(); |
8285 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8140 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8286 | return true; | 8141 | return true; |
8287 | } | 8142 | } |
@@ -8308,7 +8163,7 @@ class LLAdvancedCheckPeriodicSlowFrame : public view_listener_t | |||
8308 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8163 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8309 | { | 8164 | { |
8310 | bool new_value = gPeriodicSlowFrame; | 8165 | bool new_value = gPeriodicSlowFrame; |
8311 | LLString control_name = userdata["control"].asString(); | 8166 | std::string control_name = userdata["control"].asString(); |
8312 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8167 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8313 | return true; | 8168 | return true; |
8314 | } | 8169 | } |
@@ -8335,7 +8190,7 @@ class LLAdvancedCheckFrameTest : public view_listener_t | |||
8335 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8190 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8336 | { | 8191 | { |
8337 | bool new_value = LLPipeline::sRenderFrameTest; | 8192 | bool new_value = LLPipeline::sRenderFrameTest; |
8338 | LLString control_name = userdata["control"].asString(); | 8193 | std::string control_name = userdata["control"].asString(); |
8339 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8194 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8340 | return true; | 8195 | return true; |
8341 | } | 8196 | } |
@@ -8362,7 +8217,7 @@ class LLAdvancedCheckHideSelectedObjects : public view_listener_t | |||
8362 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8217 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8363 | { | 8218 | { |
8364 | bool new_value = gHideSelectedObjects; | 8219 | bool new_value = gHideSelectedObjects; |
8365 | LLString control_name = userdata["control"].asString(); | 8220 | std::string control_name = userdata["control"].asString(); |
8366 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8221 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8367 | return true; | 8222 | return true; |
8368 | } | 8223 | } |
@@ -8405,7 +8260,7 @@ class LLAdvancedCheckWireframe : public view_listener_t | |||
8405 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8260 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8406 | { | 8261 | { |
8407 | bool new_value = gUseWireframe; | 8262 | bool new_value = gUseWireframe; |
8408 | LLString control_name = userdata["control"].asString(); | 8263 | std::string control_name = userdata["control"].asString(); |
8409 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8264 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8410 | return true; | 8265 | return true; |
8411 | } | 8266 | } |
@@ -8432,7 +8287,7 @@ class LLAdvancedCheckDisableTextures : public view_listener_t | |||
8432 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8287 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8433 | { | 8288 | { |
8434 | bool new_value = menu_check_variable((void*)&LLViewerImage::sDontLoadVolumeTextures); | 8289 | bool new_value = menu_check_variable((void*)&LLViewerImage::sDontLoadVolumeTextures); |
8435 | LLString control_name = userdata["control"].asString(); | 8290 | std::string control_name = userdata["control"].asString(); |
8436 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8291 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8437 | return true; | 8292 | return true; |
8438 | } | 8293 | } |
@@ -8527,7 +8382,7 @@ class LLAdvancedCheckAsyncKeystrokes : public view_listener_t | |||
8527 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8382 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8528 | { | 8383 | { |
8529 | bool new_value = gHandleKeysAsync; | 8384 | bool new_value = gHandleKeysAsync; |
8530 | LLString control_name = userdata["control"].asString(); | 8385 | std::string control_name = userdata["control"].asString(); |
8531 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8386 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8532 | return true; | 8387 | return true; |
8533 | } | 8388 | } |
@@ -8650,7 +8505,7 @@ class LLAdvancedCheckDebugSelectMgr : public view_listener_t | |||
8650 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8505 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8651 | { | 8506 | { |
8652 | bool new_value = gDebugSelectMgr; | 8507 | bool new_value = gDebugSelectMgr; |
8653 | LLString control_name = userdata["control"].asString(); | 8508 | std::string control_name = userdata["control"].asString(); |
8654 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8509 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8655 | return true; | 8510 | return true; |
8656 | } | 8511 | } |
@@ -8677,7 +8532,7 @@ class LLAdvancedCheckDebugClicks : public view_listener_t | |||
8677 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8532 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8678 | { | 8533 | { |
8679 | bool new_value = gDebugClicks; | 8534 | bool new_value = gDebugClicks; |
8680 | LLString control_name = userdata["control"].asString(); | 8535 | std::string control_name = userdata["control"].asString(); |
8681 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8536 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8682 | return true; | 8537 | return true; |
8683 | } | 8538 | } |
@@ -8704,7 +8559,7 @@ class LLAdvancedCheckDebugViews : public view_listener_t | |||
8704 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8559 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8705 | { | 8560 | { |
8706 | bool new_value = LLView::sDebugRects; | 8561 | bool new_value = LLView::sDebugRects; |
8707 | LLString control_name = userdata["control"].asString(); | 8562 | std::string control_name = userdata["control"].asString(); |
8708 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8563 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8709 | return true; | 8564 | return true; |
8710 | } | 8565 | } |
@@ -8731,7 +8586,7 @@ class LLAdvancedCheckXUINameTooltips : public view_listener_t | |||
8731 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8586 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8732 | { | 8587 | { |
8733 | bool new_value = check_show_xui_names(NULL); | 8588 | bool new_value = check_show_xui_names(NULL); |
8734 | LLString control_name = userdata["control"].asString(); | 8589 | std::string control_name = userdata["control"].asString(); |
8735 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8590 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8736 | return true; | 8591 | return true; |
8737 | } | 8592 | } |
@@ -8758,7 +8613,7 @@ class LLAdvancedCheckDebugMouseEvents : public view_listener_t | |||
8758 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8613 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8759 | { | 8614 | { |
8760 | bool new_value = LLView::sDebugMouseHandling; | 8615 | bool new_value = LLView::sDebugMouseHandling; |
8761 | LLString control_name = userdata["control"].asString(); | 8616 | std::string control_name = userdata["control"].asString(); |
8762 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8617 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8763 | return true; | 8618 | return true; |
8764 | } | 8619 | } |
@@ -8785,7 +8640,7 @@ class LLAdvancedCheckDebugKeys : public view_listener_t | |||
8785 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8640 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8786 | { | 8641 | { |
8787 | bool new_value = LLView::sDebugKeys; | 8642 | bool new_value = LLView::sDebugKeys; |
8788 | LLString control_name = userdata["control"].asString(); | 8643 | std::string control_name = userdata["control"].asString(); |
8789 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8644 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8790 | return true; | 8645 | return true; |
8791 | } | 8646 | } |
@@ -8812,7 +8667,7 @@ class LLAdvancedCheckDebugWindowProc : public view_listener_t | |||
8812 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8667 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8813 | { | 8668 | { |
8814 | bool new_value = gDebugWindowProc; | 8669 | bool new_value = gDebugWindowProc; |
8815 | LLString control_name = userdata["control"].asString(); | 8670 | std::string control_name = userdata["control"].asString(); |
8816 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8671 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8817 | return true; | 8672 | return true; |
8818 | } | 8673 | } |
@@ -8839,7 +8694,7 @@ class LLAdvancedCheckDebugTextEditorTips : public view_listener_t | |||
8839 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8694 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8840 | { | 8695 | { |
8841 | bool new_value = gDebugTextEditorTips; | 8696 | bool new_value = gDebugTextEditorTips; |
8842 | LLString control_name = userdata["control"].asString(); | 8697 | std::string control_name = userdata["control"].asString(); |
8843 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8698 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8844 | return true; | 8699 | return true; |
8845 | } | 8700 | } |
@@ -8946,7 +8801,7 @@ class LLAdvancedCheckXUINames : public view_listener_t | |||
8946 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8801 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8947 | { | 8802 | { |
8948 | bool new_value = check_show_xui_names(NULL); | 8803 | bool new_value = check_show_xui_names(NULL); |
8949 | LLString control_name = userdata["control"].asString(); | 8804 | std::string control_name = userdata["control"].asString(); |
8950 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8805 | gMenuHolder->findControl(control_name)->setValue(new_value); |
8951 | return true; | 8806 | return true; |
8952 | } | 8807 | } |
@@ -8963,7 +8818,7 @@ class LLAdvancedGrabBakedTexture : public view_listener_t | |||
8963 | { | 8818 | { |
8964 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8819 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8965 | { | 8820 | { |
8966 | LLString texture_type = userdata.asString(); | 8821 | std::string texture_type = userdata.asString(); |
8967 | if ("eyes" == texture_type) | 8822 | if ("eyes" == texture_type) |
8968 | { | 8823 | { |
8969 | handle_grab_texture( (void*)LLVOAvatar::TEX_EYES_BAKED ); | 8824 | handle_grab_texture( (void*)LLVOAvatar::TEX_EYES_BAKED ); |
@@ -8993,7 +8848,7 @@ class LLAdvancedEnableGrabBakedTexture : public view_listener_t | |||
8993 | { | 8848 | { |
8994 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8849 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8995 | { | 8850 | { |
8996 | LLString texture_type = userdata["data"].asString(); | 8851 | std::string texture_type = userdata["data"].asString(); |
8997 | bool new_value = false; | 8852 | bool new_value = false; |
8998 | 8853 | ||
8999 | if ("iris" == texture_type) | 8854 | if ("iris" == texture_type) |
@@ -9017,7 +8872,7 @@ class LLAdvancedEnableGrabBakedTexture : public view_listener_t | |||
9017 | new_value = enable_grab_texture( (void*)LLVOAvatar::TEX_SKIRT_BAKED ); | 8872 | new_value = enable_grab_texture( (void*)LLVOAvatar::TEX_SKIRT_BAKED ); |
9018 | } | 8873 | } |
9019 | 8874 | ||
9020 | LLString control_name = userdata["control"].asString(); | 8875 | std::string control_name = userdata["control"].asString(); |
9021 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8876 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9022 | return true; | 8877 | return true; |
9023 | } | 8878 | } |
@@ -9044,7 +8899,7 @@ class LLAdvancedCheckAllowIdleAFK : public view_listener_t | |||
9044 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8899 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9045 | { | 8900 | { |
9046 | bool new_value = gAllowIdleAFK; | 8901 | bool new_value = gAllowIdleAFK; |
9047 | LLString control_name = userdata["control"].asString(); | 8902 | std::string control_name = userdata["control"].asString(); |
9048 | gMenuHolder->findControl(control_name)->setValue(new_value); | 8903 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9049 | return true; | 8904 | return true; |
9050 | } | 8905 | } |
@@ -9154,7 +9009,7 @@ class LLAdvancedCheckAllowSelectAvatar : public view_listener_t | |||
9154 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9009 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9155 | { | 9010 | { |
9156 | bool new_value = gAllowSelectAvatar; | 9011 | bool new_value = gAllowSelectAvatar; |
9157 | LLString control_name = userdata["control"].asString(); | 9012 | std::string control_name = userdata["control"].asString(); |
9158 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9013 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9159 | return true; | 9014 | return true; |
9160 | } | 9015 | } |
@@ -9181,7 +9036,7 @@ class LLAdvancedCheckAllowTapTapHoldRun : public view_listener_t | |||
9181 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9036 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9182 | { | 9037 | { |
9183 | bool new_value = gAllowTapTapHoldRun; | 9038 | bool new_value = gAllowTapTapHoldRun; |
9184 | LLString control_name = userdata["control"].asString(); | 9039 | std::string control_name = userdata["control"].asString(); |
9185 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9040 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9186 | return true; | 9041 | return true; |
9187 | } | 9042 | } |
@@ -9240,7 +9095,7 @@ class LLAdvancedCheckAnimationInfo : public view_listener_t | |||
9240 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9095 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9241 | { | 9096 | { |
9242 | bool new_value = LLVOAvatar::sShowAnimationDebug; | 9097 | bool new_value = LLVOAvatar::sShowAnimationDebug; |
9243 | LLString control_name = userdata["control"].asString(); | 9098 | std::string control_name = userdata["control"].asString(); |
9244 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9099 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9245 | return true; | 9100 | return true; |
9246 | } | 9101 | } |
@@ -9287,7 +9142,7 @@ class LLAdvancedCheckShowLookAt : public view_listener_t | |||
9287 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9142 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9288 | { | 9143 | { |
9289 | bool new_value = LLHUDEffectLookAt::sDebugLookAt; | 9144 | bool new_value = LLHUDEffectLookAt::sDebugLookAt; |
9290 | LLString control_name = userdata["control"].asString(); | 9145 | std::string control_name = userdata["control"].asString(); |
9291 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9146 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9292 | return true; | 9147 | return true; |
9293 | } | 9148 | } |
@@ -9314,7 +9169,7 @@ class LLAdvancedCheckShowPointAt : public view_listener_t | |||
9314 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9169 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9315 | { | 9170 | { |
9316 | bool new_value = LLHUDEffectPointAt::sDebugPointAt; | 9171 | bool new_value = LLHUDEffectPointAt::sDebugPointAt; |
9317 | LLString control_name = userdata["control"].asString(); | 9172 | std::string control_name = userdata["control"].asString(); |
9318 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9173 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9319 | return true; | 9174 | return true; |
9320 | } | 9175 | } |
@@ -9341,7 +9196,7 @@ class LLAdvancedCheckDebugJointUpdates : public view_listener_t | |||
9341 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9196 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9342 | { | 9197 | { |
9343 | bool new_value = LLVOAvatar::sJointDebug; | 9198 | bool new_value = LLVOAvatar::sJointDebug; |
9344 | LLString control_name = userdata["control"].asString(); | 9199 | std::string control_name = userdata["control"].asString(); |
9345 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9200 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9346 | return true; | 9201 | return true; |
9347 | } | 9202 | } |
@@ -9368,7 +9223,7 @@ class LLAdvancedCheckDisableLOD : public view_listener_t | |||
9368 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9223 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9369 | { | 9224 | { |
9370 | bool new_value = LLViewerJoint::sDisableLOD; | 9225 | bool new_value = LLViewerJoint::sDisableLOD; |
9371 | LLString control_name = userdata["control"].asString(); | 9226 | std::string control_name = userdata["control"].asString(); |
9372 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9227 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9373 | return true; | 9228 | return true; |
9374 | } | 9229 | } |
@@ -9395,7 +9250,7 @@ class LLAdvancedCheckDebugCharacterVis : public view_listener_t | |||
9395 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9250 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9396 | { | 9251 | { |
9397 | bool new_value = LLVOAvatar::sDebugInvisible; | 9252 | bool new_value = LLVOAvatar::sDebugInvisible; |
9398 | LLString control_name = userdata["control"].asString(); | 9253 | std::string control_name = userdata["control"].asString(); |
9399 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9254 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9400 | return true; | 9255 | return true; |
9401 | } | 9256 | } |
@@ -9427,7 +9282,7 @@ class LLAdvancedCheckShowCollisionPlane : public view_listener_t | |||
9427 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9282 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9428 | { | 9283 | { |
9429 | bool new_value = LLVOAvatar::sShowFootPlane; | 9284 | bool new_value = LLVOAvatar::sShowFootPlane; |
9430 | LLString control_name = userdata["control"].asString(); | 9285 | std::string control_name = userdata["control"].asString(); |
9431 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9286 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9432 | return true; | 9287 | return true; |
9433 | } | 9288 | } |
@@ -9455,7 +9310,7 @@ class LLAdvancedCheckShowCollisionSkeleton : public view_listener_t | |||
9455 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9310 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9456 | { | 9311 | { |
9457 | bool new_value = LLVOAvatar::sShowCollisionVolumes; | 9312 | bool new_value = LLVOAvatar::sShowCollisionVolumes; |
9458 | LLString control_name = userdata["control"].asString(); | 9313 | std::string control_name = userdata["control"].asString(); |
9459 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9314 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9460 | return true; | 9315 | return true; |
9461 | } | 9316 | } |
@@ -9482,7 +9337,7 @@ class LLAdvancedCheckDisplayAgentTarget : public view_listener_t | |||
9482 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9337 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9483 | { | 9338 | { |
9484 | bool new_value = LLAgent::sDebugDisplayTarget; | 9339 | bool new_value = LLAgent::sDebugDisplayTarget; |
9485 | LLString control_name = userdata["control"].asString(); | 9340 | std::string control_name = userdata["control"].asString(); |
9486 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9341 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9487 | return true; | 9342 | return true; |
9488 | } | 9343 | } |
@@ -9509,7 +9364,7 @@ class LLAdvancedCheckDebugAvatarRotation : public view_listener_t | |||
9509 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9364 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9510 | { | 9365 | { |
9511 | bool new_value = gDebugAvatarRotation; | 9366 | bool new_value = gDebugAvatarRotation; |
9512 | LLString control_name = userdata["control"].asString(); | 9367 | std::string control_name = userdata["control"].asString(); |
9513 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9368 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9514 | return true; | 9369 | return true; |
9515 | } | 9370 | } |
@@ -9631,7 +9486,7 @@ class LLAdvancedFrameStatsLogging : public view_listener_t | |||
9631 | { | 9486 | { |
9632 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9487 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9633 | { | 9488 | { |
9634 | LLString command = userdata.asString(); | 9489 | std::string command = userdata.asString(); |
9635 | if ("start logging" == command) | 9490 | if ("start logging" == command) |
9636 | { | 9491 | { |
9637 | LLFrameStats::startLogging(NULL); | 9492 | LLFrameStats::startLogging(NULL); |
@@ -9668,7 +9523,7 @@ class LLAdvancedAgentPilot : public view_listener_t | |||
9668 | { | 9523 | { |
9669 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9524 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9670 | { | 9525 | { |
9671 | LLString command = userdata.asString(); | 9526 | std::string command = userdata.asString(); |
9672 | if ("start playback" == command) | 9527 | if ("start playback" == command) |
9673 | { | 9528 | { |
9674 | LLAgentPilot::startPlayback(NULL); | 9529 | LLAgentPilot::startPlayback(NULL); |
@@ -9711,7 +9566,7 @@ class LLAdvancedCheckAgentPilotLoop : public view_listener_t | |||
9711 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9566 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9712 | { | 9567 | { |
9713 | bool new_value = LLAgentPilot::sLoop; | 9568 | bool new_value = LLAgentPilot::sLoop; |
9714 | LLString control_name = userdata["control"].asString(); | 9569 | std::string control_name = userdata["control"].asString(); |
9715 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9570 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9716 | return true; | 9571 | return true; |
9717 | } | 9572 | } |
@@ -9738,7 +9593,7 @@ class LLAdvancedCheckShowObjectUpdates : public view_listener_t | |||
9738 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9593 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9739 | { | 9594 | { |
9740 | bool new_value = gShowObjectUpdates; | 9595 | bool new_value = gShowObjectUpdates; |
9741 | LLString control_name = userdata["control"].asString(); | 9596 | std::string control_name = userdata["control"].asString(); |
9742 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9597 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9743 | return true; | 9598 | return true; |
9744 | } | 9599 | } |
@@ -9815,7 +9670,7 @@ class LLAdvancedCheckViewAdminOptions : public view_listener_t | |||
9815 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 9670 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
9816 | { | 9671 | { |
9817 | bool new_value = check_admin_override(NULL); | 9672 | bool new_value = check_admin_override(NULL); |
9818 | LLString control_name = userdata["control"].asString(); | 9673 | std::string control_name = userdata["control"].asString(); |
9819 | gMenuHolder->findControl(control_name)->setValue(new_value); | 9674 | gMenuHolder->findControl(control_name)->setValue(new_value); |
9820 | return true; | 9675 | return true; |
9821 | } | 9676 | } |
@@ -9949,6 +9804,8 @@ void initialize_menus() | |||
9949 | addMenu(new LLToolsLink(), "Tools.Link"); | 9804 | addMenu(new LLToolsLink(), "Tools.Link"); |
9950 | addMenu(new LLToolsUnlink(), "Tools.Unlink"); | 9805 | addMenu(new LLToolsUnlink(), "Tools.Unlink"); |
9951 | addMenu(new LLToolsStopAllAnimations(), "Tools.StopAllAnimations"); | 9806 | addMenu(new LLToolsStopAllAnimations(), "Tools.StopAllAnimations"); |
9807 | addMenu(new LLToolsReleaseKeys(), "Tools.ReleaseKeys"); | ||
9808 | addMenu(new LLToolsEnableReleaseKeys(), "Tools.EnableReleaseKeys"); | ||
9952 | addMenu(new LLToolsLookAtSelection(), "Tools.LookAtSelection"); | 9809 | addMenu(new LLToolsLookAtSelection(), "Tools.LookAtSelection"); |
9953 | addMenu(new LLToolsBuyOrTake(), "Tools.BuyOrTake"); | 9810 | addMenu(new LLToolsBuyOrTake(), "Tools.BuyOrTake"); |
9954 | addMenu(new LLToolsTakeCopy(), "Tools.TakeCopy"); | 9811 | addMenu(new LLToolsTakeCopy(), "Tools.TakeCopy"); |
@@ -10057,6 +9914,7 @@ void initialize_menus() | |||
10057 | addMenu(new LLSomethingSelected(), "SomethingSelected"); | 9914 | addMenu(new LLSomethingSelected(), "SomethingSelected"); |
10058 | addMenu(new LLSomethingSelectedNoHUD(), "SomethingSelectedNoHUD"); | 9915 | addMenu(new LLSomethingSelectedNoHUD(), "SomethingSelectedNoHUD"); |
10059 | addMenu(new LLEditableSelected(), "EditableSelected"); | 9916 | addMenu(new LLEditableSelected(), "EditableSelected"); |
9917 | addMenu(new LLEditableSelectedMono(), "EditableSelectedMono"); | ||
10060 | 9918 | ||
10061 | 9919 | ||
10062 | // Advanced (top level menu) | 9920 | // Advanced (top level menu) |