From f63de0d0cca61c737b096e247ca4e863ad1be710 Mon Sep 17 00:00:00 2001 From: Inusaito Sayori Date: Thu, 5 Jun 2014 23:54:15 -0400 Subject: [PATCH] Feature Request: Make Inspect button a toggler~ --- indra/newview/llfloaterinspect.cpp | 8 +------- indra/newview/llfloaterinspect.h | 7 +++---- indra/newview/llmenucommands.cpp | 3 ++- indra/newview/llselectmgr.cpp | 4 ++-- indra/newview/llspatialpartition.cpp | 2 +- indra/newview/llvovolume.cpp | 4 ++-- .../skins/default/xui/en-us/menu_pie_attachment.xml | 2 +- indra/newview/skins/default/xui/en-us/menu_pie_avatar.xml | 2 +- indra/newview/skins/default/xui/en-us/menu_pie_object.xml | 2 +- indra/newview/skins/default/xui/en-us/menu_viewer.xml | 2 +- 10 files changed, 15 insertions(+), 21 deletions(-) diff --git a/indra/newview/llfloaterinspect.cpp b/indra/newview/llfloaterinspect.cpp index ba9233d65..5bf957992 100644 --- a/indra/newview/llfloaterinspect.cpp +++ b/indra/newview/llfloaterinspect.cpp @@ -52,7 +52,7 @@ //LLFloaterInspect* LLFloaterInspect::sInstance = NULL; -LLFloaterInspect::LLFloaterInspect() +LLFloaterInspect::LLFloaterInspect(const LLSD&) : LLFloater(std::string("Inspect Object")), mDirty(FALSE) { @@ -91,12 +91,6 @@ LLFloaterInspect::~LLFloaterInspect(void) } } -// static -void LLFloaterInspect::showInstance() -{ - getInstance()->open(); -} - void LLFloaterInspect::onOpen() { BOOL forcesel = LLSelectMgr::getInstance()->setForceSelection(TRUE); diff --git a/indra/newview/llfloaterinspect.h b/indra/newview/llfloaterinspect.h index f977f5403..5e19d8df3 100644 --- a/indra/newview/llfloaterinspect.h +++ b/indra/newview/llfloaterinspect.h @@ -44,12 +44,11 @@ class LLObjectSelection; class LLScrollListCtrl; class LLUICtrl; -class LLFloaterInspect : public LLFloater, public LLSingleton, public LLVOInventoryListener +class LLFloaterInspect : public LLFloater, public LLFloaterSingleton, public LLVOInventoryListener { - friend class LLSingleton; + friend class LLUISingleton >; public: - static void showInstance(); // static void show(void* ignored = NULL); void onOpen(); virtual BOOL postBuild(); @@ -73,7 +72,7 @@ protected: // private: - LLFloaterInspect(); + LLFloaterInspect(const LLSD&); virtual ~LLFloaterInspect(void); LLSafeHandle mObjectSelection; diff --git a/indra/newview/llmenucommands.cpp b/indra/newview/llmenucommands.cpp index 8dbaa756d..666ced2af 100644 --- a/indra/newview/llmenucommands.cpp +++ b/indra/newview/llmenucommands.cpp @@ -190,7 +190,6 @@ struct MenuFloaterDict : public LLSingleton //Singu TODO: Re-implement f1 help. //registerFloater("help f1", boost::bind(/*gViewerHtmlHelp.show*/)); registerFloater("help tutorial", boost::bind(LLFloaterHUD::showHUD)); - registerFloater("inspect", boost::bind(LLFloaterInspect::showInstance)); registerFloater("inventory", boost::bind(LLInventoryView::toggleVisibility, (void*)NULL), boost::bind(is_visible_view, static_cast >(LLInventoryView::getActiveInventory))); registerFloater("local assets", boost::bind(FloaterLocalAssetBrowser::show, (void*)0)); registerFloater("mean events", boost::bind(LLFloaterBump::show, (void*)NULL)); @@ -205,6 +204,7 @@ struct MenuFloaterDict : public LLSingleton registerFloater("RegionDebugConsole", boost::bind(handle_singleton_toggle, (void*)NULL), boost::bind(LLFloaterRegionDebugConsole::instanceExists)); registerFloater("script errors", boost::bind(LLFloaterScriptDebug::show, LLUUID::null)); registerFloater("search", boost::bind(toggle_search_floater)); + registerFloater("show inspect", boost::bind(LLFloaterInspect::showInstance, LLSD())); registerFloater("sit", boost::bind(toggle_sit)); registerFloater("snapshot", boost::bind(LLFloaterSnapshot::show, (void*)NULL)); registerFloater("sound_explorer", boost::bind(LLFloaterExploreSounds::toggle), boost::bind(LLFloaterExploreSounds::visible)); @@ -227,6 +227,7 @@ struct MenuFloaterDict : public LLSingleton registerFloater ("gestures"); registerFloater ("groups", 1); registerFloater ("im"); + registerFloater ("inspect"); registerFloater ("lag meter"); registerFloater ("media filter"); registerFloater ("mini map"); diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 976397931..1195fb834 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -5709,7 +5709,7 @@ void LLSelectMgr::renderSilhouettes(BOOL for_hud) if (mSelectedObjects->getNumNodes()) { LLUUID inspect_item_id= LLUUID::null; - LLFloaterInspect* inspect_instance = LLFloaterInspect::instanceExists() ? LLFloaterInspect::getInstance() : NULL; + LLFloaterInspect* inspect_instance = LLFloaterInspect::findInstance(); if(inspect_instance && inspect_instance->getVisible()) { inspect_item_id = inspect_instance->getSelectedUUID(); @@ -6447,7 +6447,7 @@ void dialog_refresh_all() LLFloaterProperties::dirtyAll(); - LLFloaterInspect* inspect_instance = LLFloaterInspect::instanceExists() ? LLFloaterInspect::getInstance() : NULL; + LLFloaterInspect* inspect_instance = LLFloaterInspect::findInstance(); if(inspect_instance) { inspect_instance->dirty(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index 41890cdaa..1eef9a463 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -4376,7 +4376,7 @@ public: if (vobj->isAvatar()) { LLVOAvatar* avatar = (LLVOAvatar*) vobj; - if (gFloaterTools->getVisible() || LLFloaterInspect::instanceExists()) + if (gFloaterTools->getVisible() || LLFloaterInspect::findInstance()) { LLViewerObject* hit = avatar->lineSegmentIntersectRiggedAttachments(mStart, mEnd, -1, mPickTransparent, mFaceHit, &intersection, mTexCoord, mNormal, mTangent); if (hit) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 99ac95e22..8277cb08a 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3651,7 +3651,7 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& if (mDrawable->isState(LLDrawable::RIGGED)) { static const LLCachedControl allow_mesh_picking("SGAllowRiggedMeshSelection"); - if (allow_mesh_picking && (gFloaterTools->getVisible() || LLFloaterInspect::instanceExists())) + if (allow_mesh_picking && (gFloaterTools->getVisible() || LLFloaterInspect::findInstance())) { updateRiggedVolume(); //genBBoxes(FALSE); @@ -3833,7 +3833,7 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& bool LLVOVolume::treatAsRigged() { - return (gFloaterTools->getVisible() || LLFloaterInspect::instanceExists()) && + return (gFloaterTools->getVisible() || LLFloaterInspect::findInstance()) && isAttachment() && mDrawable.notNull() && mDrawable->isState(LLDrawable::RIGGED); diff --git a/indra/newview/skins/default/xui/en-us/menu_pie_attachment.xml b/indra/newview/skins/default/xui/en-us/menu_pie_attachment.xml index 00aa3f8ad..5c4b9487e 100644 --- a/indra/newview/skins/default/xui/en-us/menu_pie_attachment.xml +++ b/indra/newview/skins/default/xui/en-us/menu_pie_attachment.xml @@ -55,7 +55,7 @@ - + diff --git a/indra/newview/skins/default/xui/en-us/menu_pie_avatar.xml b/indra/newview/skins/default/xui/en-us/menu_pie_avatar.xml index cdeef8c83..78e8fca38 100644 --- a/indra/newview/skins/default/xui/en-us/menu_pie_avatar.xml +++ b/indra/newview/skins/default/xui/en-us/menu_pie_avatar.xml @@ -56,7 +56,7 @@ - + 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 b6e8bb5b0..69d888562 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 @@ -85,7 +85,7 @@ - + diff --git a/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/indra/newview/skins/default/xui/en-us/menu_viewer.xml index ae5277ba4..6ed62ea1c 100644 --- a/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en-us/menu_viewer.xml @@ -279,7 +279,7 @@