From ac16891d196ece159f5b5a5a12f8d5b550dffe76 Mon Sep 17 00:00:00 2001 From: CharleyLevenque Date: Wed, 25 Aug 2010 08:55:18 -0400 Subject: [PATCH] Added 'Destroy' button to the object pie, a variant of Inertia's Hard-Blink, originally by Simman Federal who according to source code comments thought the feature up while masturbating. Also fixed an Auto-Close OOC bug. --- indra/newview/llchatbar.cpp | 2 +- indra/newview/llviewermenu.cpp | 62 +++++++++++++++++++ .../default/xui/en-us/menu_pie_object.xml | 11 ++-- 3 files changed, 68 insertions(+), 7 deletions(-) diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp index 416e0bba3..ed63e359b 100644 --- a/indra/newview/llchatbar.cpp +++ b/indra/newview/llchatbar.cpp @@ -407,7 +407,7 @@ void LLChatBar::sendChat( EChatType type ) std::string utf8_revised_text; if (0 == channel) { - if (gSavedSettings.getBOOL("AscentAutoCloseOOC")) + if (gSavedSettings.getBOOL("AscentAutoCloseOOC") && (utf8text.length() > 1)) { // Chalice - OOC autoclosing patch based on code by Henri Beauchamp int needsClosingType=0; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index db0eaf79a..dfc210f0a 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -2412,6 +2412,66 @@ class LLObjectData : public view_listener_t } }; +class LLCanIHasKillEmAll : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + LLViewerObject* objpos = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(); + bool new_value = false; + if(objpos) + { + if (!objpos->permYouOwner()) + new_value = false; // Don't give guns to retarded children. + else new_value = true; + } + + gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); + return false; + } +}; + +class LLKillEmAll : public view_listener_t +{ + bool handleEvent(LLPointer event, const LLSD& userdata) + { + // Originally by SimmanFederal + // Moved here by a big fat fuckin dog. + LLViewerObject* objpos = LLSelectMgr::getInstance()->getSelection()->getFirstRootObject(); + if(objpos) + { + // Dont give guns to retarded children + if (!objpos->permYouOwner()) + { + LLChat chat; + chat.mSourceType = CHAT_SOURCE_SYSTEM; + chat.mText = llformat("Can't do that, dave."); + LLFloaterChat::addChat(chat); + return false; + } + + // Let the user know they are a rippling madman what is capable of everything + LLChat chat; + chat.mSourceType = CHAT_SOURCE_SYSTEM; + chat.mText = llformat("Irrevocably destroying object. Hope you didn't need that."); + + LLFloaterChat::addChat(chat); + /* + NOTE: Temporary objects, when thrown off world/put off world, + do not report back to the viewer, nor go to lost and found. + + So we do selectionUpdateTemporary(1) + */ + LLSelectMgr::getInstance()->selectionUpdateTemporary(1);//set temp to TRUE + LLVector3 pos = objpos->getPosition();//get the x and the y + pos.mV[VZ] = 340282346638528859811704183484516925440.0f;//create the z + objpos->setPositionParent(pos);//set the x y z + LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION);//send the data + } + + return true; + } +}; + class LLObjectMeasure : public view_listener_t { bool handleEvent(LLPointer event, const LLSD& userdata) @@ -9658,6 +9718,8 @@ void initialize_menus() addMenu(new LLObjectMeasure(), "Object.Measure"); addMenu(new LLObjectData(), "Object.Data"); addMenu(new LLScriptCount(), "Object.ScriptCount"); + addMenu(new LLKillEmAll(), "Object.Destroy"); + addMenu(new LLCanIHasKillEmAll(), "Object.EnableDestroy"); // addMenu(new LLObjectMute(), "Object.Mute"); addMenu(new LLObjectBuy(), "Object.Buy"); diff --git a/indra/newview/skins/default/xui/en-us/menu_pie_object.xml b/indra/newview/skins/default/xui/en-us/menu_pie_object.xml index 707941556..05f6e350b 100644 --- a/indra/newview/skins/default/xui/en-us/menu_pie_object.xml +++ b/indra/newview/skins/default/xui/en-us/menu_pie_object.xml @@ -44,12 +44,11 @@ - - - - - + + + +