From b2afb8800bb033a04bb3ecdf0363068d56648ef1 Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Fri, 15 Aug 2008 23:44:54 -0500 Subject: Second Life viewer sources 1.15.0.2 --- linden/indra/newview/llviewermenu.cpp | 219 +++++++++------------------------- 1 file changed, 55 insertions(+), 164 deletions(-) (limited to 'linden/indra/newview/llviewermenu.cpp') diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 217fb80..64f1af8 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -4,6 +4,7 @@ * * Copyright (c) 2002-2007, Linden Research, Inc. * + * Second Life Viewer Source Code * The source code in this file ("Source Code") is provided by Linden Lab * to you under the terms of the GNU General Public License, version 2.0 * ("GPL"), unless you have obtained a separate licensing agreement @@ -100,6 +101,7 @@ #include "llfloatergodtools.h" #include "llfloatergroupinfo.h" #include "llfloatergroups.h" +#include "llfloaterhtml.h" #include "llfloaterhtmlhelp.h" #include "llfloaterhtmlfind.h" #include "llfloaterimport.h" @@ -113,7 +115,6 @@ #include "llfloateropenobject.h" #include "llfloaterpermissionsmgr.h" #include "llfloaterpreference.h" -#include "llfloaterrate.h" #include "llfloaterregioninfo.h" #include "llfloaterreporter.h" #include "llfloaterscriptdebug.h" @@ -173,6 +174,7 @@ #include "lluuid.h" #include "llvelocitybar.h" #include "llviewercamera.h" +#include "llviewergenericmessage.h" #include "llviewergesture.h" #include "llviewerimagelist.h" #include "llviewerinventory.h" @@ -193,6 +195,7 @@ #include "pipeline.h" #include "viewer.h" #include "roles_constants.h" +#include "llviewerjoystick.h" #include "lltexlayer.h" @@ -394,8 +397,6 @@ void handle_force_parcel_owner_to_me(void*); void handle_force_parcel_to_content(void*); void handle_claim_public_land(void*); -void handle_god_expunge_user(void*); - void handle_god_request_havok(void *); void handle_god_request_avatar_geometry(void *); // Hack for easy testing of new avatar geometry void reload_personal_settings_overrides(void *); @@ -441,6 +442,8 @@ void handle_dump_image_list(void*); void handle_fullscreen_debug(void*); void handle_crash(void*); void handle_dump_followcam(void*); +void handle_toggle_flycam(void*); +BOOL check_flycam(void*); void handle_viewer_enable_message_log(void*); void handle_viewer_disable_message_log(void*); void handle_send_postcard(void*); @@ -903,6 +906,9 @@ void init_client_menu(LLMenuGL* menu) menu->append(new LLMenuItemToggleGL("Disable Camera Constraints", &LLViewerCamera::sDisableCameraConstraints)); + menu->append(new LLMenuItemCheckGL("Joystick Flycam", + &handle_toggle_flycam,NULL,&check_flycam,NULL)); + menu->append(new LLMenuItemCheckGL("Mouse Smoothing", &menu_toggle_control, NULL, @@ -1008,6 +1014,10 @@ void init_debug_ui_menu(LLMenuGL* menu) menu->append(new LLMenuItemToggleGL("Debug Keys", &LLView::sDebugKeys)); menu->append(new LLMenuItemToggleGL("Debug WindowProc", &gDebugWindowProc)); menu->append(new LLMenuItemToggleGL("Debug Text Editor Tips", &gDebugTextEditorTips)); + menu->appendSeparator(); + menu->append(new LLMenuItemCheckGL("Show Time", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowTime")); + menu->append(new LLMenuItemCheckGL("Show Render Info", menu_toggle_control, NULL, menu_check_control, (void*)"DebugShowRenderInfo")); + menu->createJumpKeys(); } @@ -1177,6 +1187,9 @@ void init_debug_rendering_menu(LLMenuGL* menu) sub_menu->append(new LLMenuItemCheckGL("LightTrace",&LLPipeline::toggleRenderDebug, NULL, &LLPipeline::toggleRenderDebugControl, (void*)LLPipeline::RENDER_DEBUG_LIGHT_TRACE)); + sub_menu->append(new LLMenuItemCheckGL("Glow",&LLPipeline::toggleRenderDebug, NULL, + &LLPipeline::toggleRenderDebugControl, + (void*)LLPipeline::RENDER_DEBUG_GLOW)); sub_menu->append(new LLMenuItemCheckGL("Show Depth Buffer", &menu_toggle_control, @@ -1242,11 +1255,6 @@ void init_debug_rendering_menu(LLMenuGL* menu) item = new LLMenuItemCheckGL("Cheesy Beacon", menu_toggle_control, NULL, menu_check_control, (void*)"CheesyBeacon"); menu->append(item); -#if 0 // 1.9.2 - item = new LLMenuItemCheckGL("Vertex Shaders", toggle_vertex_shaders, NULL, check_vertex_shaders, (void*)"VertexShaderEnable", 'V', MASK_CONTROL|MASK_ALT); - item->setEnabled(gGLManager.mHasVertexShader); - menu->append(item); -#endif menu->createJumpKeys(); } @@ -1391,8 +1399,6 @@ void init_server_menu(LLMenuGL* menu) &handle_force_parcel_to_content, &enable_god_customer_service, NULL, 'C', MASK_SHIFT | MASK_ALT | MASK_CONTROL)); - //sub->append(new LLMenuItemCallGL("Toggle First Land bit", - // &handle_toggle_parcel_newbie)); sub->appendSeparator(); sub->append(new LLMenuItemCallGL("Claim Public Land", &handle_claim_public_land, &enable_god_customer_service)); @@ -1445,33 +1451,6 @@ void cleanup_menus() // Object pie menu //----------------------------------------------------------------------------- -class LLObjectRateCreator : public view_listener_t -{ - bool handleEvent(LLPointer event, const LLSD& userdata) - { - LLFloaterRate::show(LLFloaterRate::RS_CREATOR); - return true; - } -}; - -class LLObjectRateOwner : public view_listener_t -{ - bool handleEvent(LLPointer event, const LLSD& userdata) - { - // Don't allow rating of group owned objects. - LLSelectNode* node = gSelectMgr->getSelection()->getFirstRootNode(); - if (!node) return true; - if (node->mPermissions->isGroupOwned()) - { - gViewerWindow->alertXml("CantRateOwnedByGroup"); - return true; - } - - LLFloaterRate::show(LLFloaterRate::RS_OWNER); - return true; - } -}; - class LLObjectReportAbuse : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) @@ -1481,59 +1460,6 @@ class LLObjectReportAbuse : public view_listener_t } }; -// Enable only when you didn't create it, and the creator -// is not the owner. -class LLObjectEnableRateCreator : public view_listener_t -{ - bool handleEvent(LLPointer event, const LLSD& userdata) - { - LLUUID creator_id; - LLUUID owner_id; - LLString dummy; - BOOL identical_creator = gSelectMgr->selectGetCreator(creator_id, dummy); - - BOOL new_value; - if (!identical_creator) - { - new_value = FALSE; - } - else - { - new_value = (creator_id != gAgent.getID()); - } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; - } -}; - -// Enabled if object owner isn't the agent. -class LLObjectEnableRateOwner : public view_listener_t -{ - bool handleEvent(LLPointer event, const LLSD& userdata) - { - LLUUID owner_id; - LLString dummy; - BOOL identical_owner = gSelectMgr->selectGetOwner(owner_id, dummy); - - BOOL new_value; - if (!identical_owner) - { - new_value = FALSE; - } - else if (owner_id.isNull()) - { - new_value = FALSE; - } - else - { - new_value = (owner_id != gAgent.getID()); - } - gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); - return true; - } -}; - - // Enabled it you clicked an object class LLObjectEnableReportAbuse : public view_listener_t { @@ -2257,20 +2183,6 @@ void login_done(S32 which, void *user) } - -class LLAvatarRate : public view_listener_t -{ - bool handleEvent(LLPointer event, const LLSD& userdata) - { - LLVOAvatar* avatar = find_avatar_from_object( gViewerWindow->lastObjectHit() ); - if( avatar ) - { - LLFloaterRate::show( avatar->getID() ); - } - return true; - } -}; - void callback_leave_group(S32 option, void *userdata) { if (option == 0) @@ -3156,6 +3068,11 @@ void reset_view_final( BOOL proceed, void* ) gAgent.changeCameraToDefault(); + if (LLViewerJoystick::sOverrideCamera) + { + handle_toggle_flycam(NULL); + } + gAgent.resetView(!gFloaterTools->getVisible()); gFloaterTools->close(); @@ -3402,40 +3319,6 @@ void handle_claim_public_land(void*) gAgent.sendReliableMessage(); } -//void handle_toggle_parcel_newbie(void*) -//{ -// gParcelMgr->toggleParcelGodReserveForNewbie(); -//} - -void on_expunge_user(S32 option, const LLString& text, void*) -{ - if(option == -1) return; - llinfos << "on_expunge_user(" << option << "," << text << ")" << llendl; - LLMessageSystem* msg = gMessageSystem; - LLUUID user_id; - if(user_id.set(text)) - { - msg->newMessage("GodExpungeUser"); - msg->nextBlock("AgentData"); - msg->addUUID("AgentID", gAgent.getID()); - msg->addUUID("SessionID", gAgent.getSessionID()); - msg->nextBlock("ExpungeData"); - msg->addUUID("AgentID", user_id); - msg->sendReliable(gUserServer); - } - else - { - gViewerWindow->alertXml("InvalidUUID"); - } -} - -void handle_god_expunge_user(void*) -{ - gViewerWindow->alertXmlEditText("ExpungeUser", LLString::format_map_t(), - NULL, NULL, - on_expunge_user, NULL); -} - void handle_god_request_havok(void *) { if (gAgent.isGodlike()) @@ -5402,7 +5285,7 @@ void upload_new_resource(const LLString& src_filename, std::string name, LLString short_name = filename.substr(offset); // No extension - snprintf(error_message, /* Flawfinder: ignore */ + snprintf(error_message, /* Flawfinder: ignore */ MAX_STRING, "No file extension for the file: '%s'\nPlease make sure the file has a correct file extension", short_name.c_str()); @@ -5551,7 +5434,7 @@ void upload_new_resource(const LLString& src_filename, std::string name, else { fclose(in); - snprintf(error_message, MAX_STRING, "unknown linden resource file version in file: %s", src_filename.c_str()); /* Flawfinder: ignore */ + snprintf(error_message, MAX_STRING, "unknown linden resource file version in file: %s", src_filename.c_str()); /* Flawfinder: ignore */ args["[FILE]"] = src_filename; upload_error(error_message, "UnknownResourceFileVersion", filename, args); return; @@ -5587,7 +5470,7 @@ void upload_new_resource(const LLString& src_filename, std::string name, else { fclose(in); - snprintf(error_message, MAX_STRING, "Unable to create output file: %s", filename.c_str()); /* Flawfinder: ignore */ + snprintf(error_message, MAX_STRING, "Unable to create output file: %s", filename.c_str()); /* Flawfinder: ignore */ args["[FILE]"] = filename; upload_error(error_message, "UnableToCreateOutputFile", filename, args); return; @@ -6340,6 +6223,21 @@ void handle_dump_followcam(void*) LLFollowCamMgr::dump(); } +BOOL check_flycam(void*) +{ + return LLViewerJoystick::sOverrideCamera; +} + +void handle_toggle_flycam(void*) +{ + LLViewerJoystick::sOverrideCamera = !LLViewerJoystick::sOverrideCamera; + if (LLViewerJoystick::sOverrideCamera) + { + LLViewerJoystick::updateCamera(TRUE); + LLFloaterJoystick::show(NULL); + } +} + void handle_viewer_enable_message_log(void*) { gMessageSystem->startLogging(); @@ -6423,14 +6321,7 @@ class LLShowFloater : public view_listener_t { if (gParcelMgr->selectionEmpty()) { - if (gLastHitPosGlobal.isExactlyZero()) - { - gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); - } - else - { - gParcelMgr->selectParcelAt( gLastHitPosGlobal ); - } + gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); } LLFloaterLand::show(); @@ -6439,14 +6330,7 @@ class LLShowFloater : public view_listener_t { if (gParcelMgr->selectionEmpty()) { - if (gLastHitPosGlobal.isExactlyZero()) - { - gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); - } - else - { - gParcelMgr->selectParcelAt( gLastHitPosGlobal ); - } + gParcelMgr->selectParcelAt(gAgent.getPositionGlobal()); } gParcelMgr->startBuyLand(); @@ -6463,10 +6347,22 @@ class LLShowFloater : public view_listener_t { LLFloaterScriptDebug::show(LLUUID::null); } - else if (floater_name == "help") + else if (floater_name == "help f1") + { +#if LL_LIBXUL_ENABLED + gViewerHtmlHelp.show(); +#endif + } + else if (floater_name == "help in-world") + { +#if LL_LIBXUL_ENABLED + LLFloaterHtml::getInstance()->show( "in-world_help" ); +#endif + } + else if (floater_name == "help additional") { #if LL_LIBXUL_ENABLED - LLHtmlHelp::show(NULL); + LLFloaterHtml::getInstance()->show( "additional_help" ); #endif } else if (floater_name == "complaint reporter") @@ -8687,7 +8583,6 @@ void initialize_menu_actions() // Avatar pie menu (new LLObjectMute())->registerListener(gMenuHolder, "Avatar.Mute"); - (new LLAvatarRate())->registerListener(gMenuHolder, "Avatar.Rate"); (new LLAvatarAddFriend())->registerListener(gMenuHolder, "Avatar.AddFriend"); (new LLAvatarFreeze())->registerListener(gMenuHolder, "Avatar.Freeze"); (new LLAvatarDebug())->registerListener(gMenuHolder, "Avatar.Debug"); @@ -8709,9 +8604,7 @@ void initialize_menu_actions() (new LLObjectDelete())->registerListener(gMenuHolder, "Object.Delete"); (new LLObjectAttachToAvatar())->registerListener(gMenuHolder, "Object.AttachToAvatar"); (new LLObjectReturn())->registerListener(gMenuHolder, "Object.Return"); - (new LLObjectRateOwner())->registerListener(gMenuHolder, "Object.RateOwner"); (new LLObjectReportAbuse())->registerListener(gMenuHolder, "Object.ReportAbuse"); - (new LLObjectRateCreator())->registerListener(gMenuHolder, "Object.RateCreator"); (new LLObjectMute())->registerListener(gMenuHolder, "Object.Mute"); (new LLObjectBuy())->registerListener(gMenuHolder, "Object.Buy"); (new LLObjectEdit())->registerListener(gMenuHolder, "Object.Edit"); @@ -8723,9 +8616,7 @@ void initialize_menu_actions() (new LLObjectEnableDelete())->registerListener(gMenuHolder, "Object.EnableDelete"); (new LLObjectEnableWear())->registerListener(gMenuHolder, "Object.EnableWear"); (new LLObjectEnableReturn())->registerListener(gMenuHolder, "Object.EnableReturn"); - (new LLObjectEnableRateOwner())->registerListener(gMenuHolder, "Object.EnableRateOwner"); (new LLObjectEnableReportAbuse())->registerListener(gMenuHolder, "Object.EnableReportAbuse"); - (new LLObjectEnableRateCreator())->registerListener(gMenuHolder, "Object.EnableRateCreator"); (new LLObjectEnableMute())->registerListener(gMenuHolder, "Object.EnableMute"); (new LLObjectEnableBuy())->registerListener(gMenuHolder, "Object.EnableBuy"); -- cgit v1.1