diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index c5dcff371..aec79f949 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -90,6 +90,7 @@ set(viewer_SOURCE_FILES floaterao.cpp floaterlocalassetbrowse.cpp floatervoicelicense.cpp + generichandlers.cpp hbfloatergrouptitles.cpp hippofloaterxml.cpp hippogridmanager.cpp @@ -591,6 +592,7 @@ set(viewer_HEADER_FILES floaterao.h floaterlocalassetbrowse.h floatervoicelicense.h + generichandlers.h hbfloatergrouptitles.h hippofloaterxml.h hippogridmanager.h diff --git a/indra/newview/generichandlers.cpp b/indra/newview/generichandlers.cpp new file mode 100644 index 000000000..af22b0cf0 --- /dev/null +++ b/indra/newview/generichandlers.cpp @@ -0,0 +1,62 @@ +/* + * Copyright (c) The Singularity dev Team and Melanie Thielker + * Refer to the singularity project for a full lst of copyright holders + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Neither the name of the Singularity Viewwer Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "llviewerprecompiledheaders.h" +#include "generichandlers.h" +#include "llviewergenericmessage.h" +#include "llviewerinventory.h" +#include "llappearancemgr.h" + +GenericHandlers *gGenericHandlers = NULL; + +class DispatchReplaceOutfit : public LLDispatchHandler +{ +public: + virtual bool operator()( + const LLDispatcher* dispatcher, + const std::string& key, + const LLUUID& invoice, + const sparam_t& strings) + { + if (strings.size() != 2) return false; + LLUUID folder_id(strings[0]); + + bool success = false; + LLViewerInventoryCategory *cat = gInventory.getCategory(folder_id); + if (cat != NULL) + { + LLAppearanceMgr::instance().wearInventoryCategory(cat, FALSE, FALSE); + success = true; + } + return true; + } +}; + +static DispatchReplaceOutfit sDispatchReplaceOutfit; + +GenericHandlers::GenericHandlers() +{ + gGenericDispatcher.addHandler("replaceoutfit", &sDispatchReplaceOutfit); +} + diff --git a/indra/newview/generichandlers.h b/indra/newview/generichandlers.h new file mode 100644 index 000000000..2a1210b57 --- /dev/null +++ b/indra/newview/generichandlers.h @@ -0,0 +1,31 @@ +/* + * Copyright (c) The Singularity dev Team and Melanie Thielker + * Refer to the singularity project for a full lst of copyright holders + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Neither the name of the Singularity Viewwer Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +class GenericHandlers +{ +public: + GenericHandlers(); +}; + +extern GenericHandlers *gGenericHandlers; diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 3ecc2aa4d..25bde6efa 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -212,6 +212,7 @@ #include "llinventorybridge.h" #include "llappearancemgr.h" #include "jcfloaterareasearch.h" +#include "generichandlers.h" // #include "llpanellogin.h" @@ -843,6 +844,8 @@ bool idle_startup() // *NOTE: This is where gMuteList used to get allocated before becoming LLMuteList::getInstance(). + gGenericHandlers = new GenericHandlers(); + // Initialize UI if (!gNoRender) {