From d8b08f5548ca0b63becd4b303575d20502bd832a Mon Sep 17 00:00:00 2001 From: Jacek Antonelli Date: Mon, 2 Nov 2009 21:36:23 -0600 Subject: Added "DoubleClickAction" and "GoAction" settings. Together they replace "DoubleClickAutopilot" and "DoubleClickTeleport". --- linden/indra/newview/app_settings/settings.xml | 30 +++++++++++----------- linden/indra/newview/lltoolpie.cpp | 35 ++++++++------------------ linden/indra/newview/llviewermenu.cpp | 19 +++++++++++--- 3 files changed, 41 insertions(+), 43 deletions(-) (limited to 'linden/indra/newview') diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index e1a6f1f..95dd186 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml @@ -2399,27 +2399,16 @@ Value 1.0 - DoubleClickAutoPilot + DoubleClickAction Comment - Enable double-click auto pilot + What to do when you double-click. Either "None" or "Go". Persist 1 Type - Boolean - Value - 0 - - DoubleClickTeleport - - Comment - Enable double-click teleport - Persist - 1 - Type - Boolean + String Value - 1 + None DragAndDropToolTipDelay @@ -3913,6 +3902,17 @@ Value 1024 + GoAction + + Comment + How to move for "Go Here" or double-click move. Either "Autopilot" or "Teleport". + Persist + 1 + Type + String + Value + Autopilot + GridCrossSections Comment diff --git a/linden/indra/newview/lltoolpie.cpp b/linden/indra/newview/lltoolpie.cpp index cda76d9..8b57011 100644 --- a/linden/indra/newview/lltoolpie.cpp +++ b/linden/indra/newview/lltoolpie.cpp @@ -676,7 +676,14 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) llinfos << "LLToolPie handleDoubleClick (becoming mouseDown)" << llendl; } - if (gSavedSettings.getBOOL("DoubleClickAutoPilot") || gSavedSettings.getBOOL("DoubleClickTeleport")) + std::string action = gSavedSettings.getString("DoubleClickAction"); + LLStringUtil::toLower(action); + + if (action == "none") + { + return FALSE; + } + else if (action == "go") { if (mPick.mPickType == LLPickInfo::PICK_LAND && !mPick.mPosGlobal.isExactlyZero()) @@ -695,32 +702,12 @@ BOOL LLToolPie::handleDoubleClick(S32 x, S32 y, MASK mask) return TRUE; } } - - return FALSE; - - /* JC - don't do go-there, because then double-clicking on physical - objects gets you into trouble. - - // If double-click on object or land, go there. - LLViewerObject *object = gViewerWindow->getLastPick().getObject(); - if (object) - { - if (object->isAvatar()) - { - LLFloaterAvatarInfo::showFromAvatar(object->getID()); - } - else - { - handle_go_to(NULL); - } - } - else if (!gLastHitPosGlobal.isExactlyZero()) + else { - handle_go_to(NULL); + llwarns << "Unhandled DoubleClickAction setting: " << action << llendl; } - return TRUE; - */ + return FALSE; } diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index bd8b6ab..4732046 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp @@ -2393,11 +2393,14 @@ bool handle_go_to_confirm() } // [/RLVa:KB] - if (gSavedSettings.getBOOL("DoubleClickTeleport")) + std::string action = gSavedSettings.getString("GoAction"); + LLStringUtil::toLower(action); + + if (action == "teleport") { gViewerWindow->alertXml("ConfirmDoubleClickTP", handle_go_to_callback, (void*)LLToolPie::getInstance()); } - else if (gSavedSettings.getBOOL("DoubleClickAutoPilot")) + else if (action == "autopilot") { gViewerWindow->alertXml("ConfirmAutoPilot", handle_go_to_callback, (void*)LLToolPie::getInstance()); } @@ -2431,13 +2434,17 @@ void handle_go_to_callback(S32 option, void *userdata) std::vector strings; std::string val; LLVector3d pos = pie->getPick().mPosGlobal; - if (gSavedSettings.getBOOL("DoubleClickTeleport")) + + std::string action = gSavedSettings.getString("GoAction"); + LLStringUtil::toLower(action); + + if (action == "teleport") { LLVector3d hips_offset(0.0f, 0.0f, 1.2f); gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); gAgent.teleportViaLocation(pos + hips_offset); } - else + else if (action == "autopilot") { // JAMESDEBUG try simulator autopilot std::vector strings; @@ -2465,6 +2472,10 @@ void handle_go_to_callback(S32 option, void *userdata) // Could be first use LLFirstUse::useGoTo(); } + else + { + llwarns << "Unhandled GoAction setting: " << action << llendl; + } } } -- cgit v1.1