diff --git a/indra/newview/rlvfloaters.cpp b/indra/newview/rlvfloaters.cpp index 128da7499d000deae1db3cb1047539549c3d1289..f33fcc7220a66bfd99f92b48f5fa44dcbaa7b5ea 100644 --- a/indra/newview/rlvfloaters.cpp +++ b/indra/newview/rlvfloaters.cpp @@ -283,15 +283,16 @@ BOOL RlvFloaterBehaviours::postBuild() return TRUE; } -// Checked: 2011-05-23 (RLVa-1.3.1c) | Modified: RLVa-1.3.1c void RlvFloaterBehaviours::refreshAll() { LLCtrlListInterface* pBhvrList = childGetListInterface("behaviour_list"); LLCtrlListInterface* pExceptList = childGetListInterface("exception_list"); - if ( (!pBhvrList) || (!pExceptList) ) + LLCtrlListInterface* pModifierList = childGetListInterface("modifier_list"); + if ( (!pBhvrList) || (!pExceptList) || (!pModifierList) ) return; pBhvrList->operateOnAll(LLCtrlListInterface::OP_DELETE); pExceptList->operateOnAll(LLCtrlListInterface::OP_DELETE); + pModifierList->operateOnAll(LLCtrlListInterface::OP_DELETE); if (!isAgentAvatarValid()) return; @@ -308,6 +309,11 @@ void RlvFloaterBehaviours::refreshAll() sdExceptColumns[1] = LLSD().with("column", "option").with("type", "text"); sdExceptColumns[2] = LLSD().with("column", "issuer").with("type", "text"); + LLSD sdModifierRow; LLSD& sdModifierColumns = sdModifierRow["columns"]; + sdModifierColumns[0] = LLSD().with("column", "modifier").with("type", "text"); + sdModifierColumns[1] = LLSD().with("column", "value").with("type", "text"); + sdModifierColumns[2] = LLSD().with("column", "primary").with("type", "text"); + // // List behaviours // @@ -361,6 +367,35 @@ void RlvFloaterBehaviours::refreshAll() } } } + + // + // List modifiers + // + for (int idxModifier = 0; idxModifier < RLV_MODIFIER_COUNT; idxModifier++) + { + const RlvBehaviourModifier* pBhvrModifier = RlvBehaviourDictionary::instance().m_BehaviourModifiers[idxModifier]; + if (pBhvrModifier) + { + sdModifierRow["enabled"] = (pBhvrModifier->hasValue()); + sdModifierColumns[0]["value"] = pBhvrModifier->getName(); + + if (pBhvrModifier->hasValue()) + { + const RlvBehaviourModifierValue& modValue = pBhvrModifier->getValue(); + if (typeid(float) == modValue.type()) + sdModifierColumns[1]["value"] = llformat("%f", boost::get<float>(modValue)); + else if (typeid(int) == modValue.type()) + sdModifierColumns[1]["value"] = llformat("%d", boost::get<int>(modValue)); + } + else + { + sdModifierColumns[1]["value"] = "(default)"; + } + + sdModifierColumns[2]["value"] = (pBhvrModifier->getPrimaryObject().notNull()) ? rlvGetItemNameFromObjID(pBhvrModifier->getPrimaryObject()) : LLStringUtil::null; + pModifierList->addElement(sdModifierRow, ADD_BOTTOM); + } + } } // ============================================================================ diff --git a/indra/newview/rlvhelper.cpp b/indra/newview/rlvhelper.cpp index f2a8e98c373bca2bbc7168a6e10d4c75dcee357f..e884fed1f2f91a802bc3b743a1bc7a06d371332c 100644 --- a/indra/newview/rlvhelper.cpp +++ b/indra/newview/rlvhelper.cpp @@ -103,7 +103,7 @@ RlvBehaviourDictionary::RlvBehaviourDictionary() addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_EXCEPTION>("editobj", RLV_BHVR_EDITOBJ)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("emote", RLV_BHVR_EMOTE)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_MODIFIER>("fartouch", RLV_BHVR_FARTOUCH)); - addModifier(RLV_BHVR_FARTOUCH, RLV_MODIFIER_FARTOUCHDIST, new RlvBehaviourModifier(RLV_MODIFIER_FARTOUCH_DEFAULT, true, &s_RlvBehaviourModifier_CompMin)); + addModifier(RLV_BHVR_FARTOUCH, RLV_MODIFIER_FARTOUCHDIST, new RlvBehaviourModifier("Fartouch Distance", RLV_MODIFIER_FARTOUCH_DEFAULT, true, &s_RlvBehaviourModifier_CompMin)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("fly", RLV_BHVR_FLY)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("interact", RLV_BHVR_INTERACT, RlvBehaviourInfo::BHVR_EXTENDED)); addEntry(new RlvBehaviourInfo("notify", RLV_BHVR_NOTIFY, RLV_TYPE_ADDREM)); @@ -144,7 +144,7 @@ RlvBehaviourDictionary::RlvBehaviourDictionary() addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("showworldmap", RLV_BHVR_SHOWWORLDMAP)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("sit", RLV_BHVR_SIT)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_MODIFIER>("sittp", RLV_BHVR_SITTP)); - addModifier(RLV_BHVR_SITTP, RLV_MODIFIER_SITTPDIST, new RlvBehaviourModifier(RLV_MODIFIER_SITTP_DEFAULT, true, &s_RlvBehaviourModifier_CompMin)); + addModifier(RLV_BHVR_SITTP, RLV_MODIFIER_SITTPDIST, new RlvBehaviourModifier("SitTp Distance", RLV_MODIFIER_SITTP_DEFAULT, true, &s_RlvBehaviourModifier_CompMin)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("standtp", RLV_BHVR_STANDTP)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("startim", RLV_BHVR_STARTIM, RlvBehaviourInfo::BHVR_STRICT)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_EXCEPTION>("startimto", RLV_BHVR_STARTIMTO, RlvBehaviourInfo::BHVR_STRICT)); @@ -153,7 +153,7 @@ RlvBehaviourDictionary::RlvBehaviourDictionary() addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("touchattach", RLV_BHVR_TOUCHATTACH)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("touchattachother", RLV_BHVR_TOUCHATTACHOTHER)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("touchattachself", RLV_BHVR_TOUCHATTACHSELF)); - addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("touchfar", RLV_BHVR_FARTOUCH, RlvBehaviourInfo::BHVR_SYNONYM)); + addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_MODIFIER>("touchfar", RLV_BHVR_FARTOUCH, RlvBehaviourInfo::BHVR_SYNONYM)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("touchhud", RLV_BHVR_TOUCHHUD, RlvBehaviourInfo::BHVR_EXTENDED)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("touchme", RLV_BHVR_TOUCHME)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_EXCEPTION>("touchthis", RLV_BHVR_TOUCHTHIS)); @@ -161,7 +161,7 @@ RlvBehaviourDictionary::RlvBehaviourDictionary() addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("tplm", RLV_BHVR_TPLM)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE>("tploc", RLV_BHVR_TPLOC)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_MODIFIER>("tplocal", RLV_BHVR_TPLOCAL)); - addModifier(RLV_BHVR_TPLOCAL, RLV_MODIFIER_TPLOCALDIST, new RlvBehaviourModifier(RLV_MODIFIER_TPLOCAL_DEFAULT, true, &s_RlvBehaviourModifier_CompMin)); + addModifier(RLV_BHVR_TPLOCAL, RLV_MODIFIER_TPLOCALDIST, new RlvBehaviourModifier("Local Teleport Distance", RLV_MODIFIER_TPLOCAL_DEFAULT, true, &s_RlvBehaviourModifier_CompMin)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("tplure", RLV_BHVR_TPLURE, RlvBehaviourInfo::BHVR_STRICT)); addEntry(new RlvBehaviourGenericProcessor<RLV_OPTION_NONE_OR_EXCEPTION>("tprequest", RLV_BHVR_TPREQUEST, RlvBehaviourInfo::BHVR_STRICT | RlvBehaviourInfo::BHVR_EXTENDED)); addEntry(new RlvBehaviourInfo("unsharedunwear", RLV_BHVR_UNSHAREDUNWEAR, RLV_TYPE_ADDREM)); @@ -373,8 +373,8 @@ void RlvBehaviourDictionary::toggleBehaviourFlag(const std::string& strBhvr, ERl // RlvBehaviourModifier // -RlvBehaviourModifier::RlvBehaviourModifier(const RlvBehaviourModifierValue& defaultValue, bool fAddDefaultOnEmpty, RlvBehaviourModifier_Comp* pValueComparator) - : m_DefaultValue(defaultValue), m_fAddDefaultOnEmpty(fAddDefaultOnEmpty), m_pValueComparator(pValueComparator) +RlvBehaviourModifier::RlvBehaviourModifier(std::string strName, const RlvBehaviourModifierValue& defaultValue, bool fAddDefaultOnEmpty, RlvBehaviourModifier_Comp* pValueComparator) + : m_strName(strName), m_DefaultValue(defaultValue), m_fAddDefaultOnEmpty(fAddDefaultOnEmpty), m_pValueComparator(pValueComparator) { } diff --git a/indra/newview/rlvhelper.h b/indra/newview/rlvhelper.h index 19ffa33fac1e28db5e95a43bf932a6f447a42c79..7f11f8047bf6c0408961cf68f4c7b405d8cdc99a 100644 --- a/indra/newview/rlvhelper.h +++ b/indra/newview/rlvhelper.h @@ -200,7 +200,7 @@ struct RlvBehaviourModifier_CompMax : public RlvBehaviourModifier_Comp class RlvBehaviourModifier { public: - RlvBehaviourModifier(const RlvBehaviourModifierValue& defaultValue, bool fAddDefaultOnEmpty, RlvBehaviourModifier_Comp* pValueComparator); + RlvBehaviourModifier(const std::string strName, const RlvBehaviourModifierValue& defaultValue, bool fAddDefaultOnEmpty, RlvBehaviourModifier_Comp* pValueComparator); virtual ~RlvBehaviourModifier() {} /* @@ -225,6 +225,7 @@ public: * Member variables */ protected: + std::string m_strName; RlvBehaviourModifierValue m_DefaultValue; bool m_fAddDefaultOnEmpty; std::list<RlvBehaviourModifierValueTuple> m_Values; @@ -312,6 +313,7 @@ protected: class RlvBehaviourDictionary : public LLSingleton<RlvBehaviourDictionary> { friend class LLSingleton<RlvBehaviourDictionary>; + friend class RlvFloaterBehaviours; protected: RlvBehaviourDictionary(); ~RlvBehaviourDictionary(); diff --git a/indra/newview/skins/default/xui/en/floater_rlv_behaviours.xml b/indra/newview/skins/default/xui/en/floater_rlv_behaviours.xml index 861f8028485e4e627fc48625b629c4a3bde3b645..965b9172592aeb58b280d01b154e8370b6b0efd4 100644 --- a/indra/newview/skins/default/xui/en/floater_rlv_behaviours.xml +++ b/indra/newview/skins/default/xui/en/floater_rlv_behaviours.xml @@ -6,20 +6,20 @@ can_resize="true" height="300" min_height="300" - min_width="300" + min_width="450" name="rlv_behaviours" save_rect="true" save_visibility="false" single_instance="true" title="ACTIVE RLV RESTRICTIONS" - width="300"> + width="450"> <tab_container follows="all" layout="topleft" - left="8" + left="8" name="behaviour_tab" height="266" - right="-8" + right="-8" tab_height="23" tab_min_width="120" tab_position="top" @@ -31,16 +31,16 @@ name="behaviour_panel" top="0"> <scroll_list - draw_border="false" - draw_heading="true" - draw_stripes="true" - follows="all" - height="266" - layout="topleft" - multi_select="false" - name="behaviour_list" - tool_tip="List of current RLVa restrictions." - top_pad="0" > + draw_border="false" + draw_heading="true" + draw_stripes="true" + follows="all" + height="266" + layout="topleft" + multi_select="false" + name="behaviour_list" + tool_tip="List of current RLVa restrictions." + top_pad="0" > <scroll_list.columns label="Restriction" name="behaviour" width="70" /> <scroll_list.columns label="Object Name" name="issuer" /> </scroll_list> @@ -52,21 +52,43 @@ name="exception_panel" top="0"> <scroll_list - draw_border="false" - draw_heading="true" - draw_stripes="true" - follows="all" - height="266" - layout="topleft" - multi_select="false" - name="exception_list" - tool_tip="List of current RLVa exceptions." - top_pad="0" > + draw_border="false" + draw_heading="true" + draw_stripes="true" + follows="all" + height="266" + layout="topleft" + multi_select="false" + name="exception_list" + tool_tip="List of current RLVa exceptions." + top_pad="0" > <scroll_list.columns label="Exception" name="behaviour" width="70" /> <scroll_list.columns label="Source" name="option" width="105" /> <scroll_list.columns label="Object Name" name="issuer" /> </scroll_list> </panel> + <panel + follows="all" height="265" + label="MODIFIERS" + layout="topleft" + name="modifier_panel" + top="0"> + <scroll_list + draw_border="false" + draw_heading="true" + draw_stripes="true" + follows="all" + height="266" + layout="topleft" + multi_select="false" + name="modifier_list" + tool_tip="List of current RLVa modifiers." + top_pad="0" > + <scroll_list.columns label="Modifier" name="modifier" width="105" /> + <scroll_list.columns label="Value" name="value" width="105" /> + <scroll_list.columns label="Primary Object" name="primary" /> + </scroll_list> + </panel> </tab_container> <panel background_visible="false"