diff options
Diffstat (limited to 'linden/indra/newview')
-rw-r--r-- | linden/indra/newview/CMakeLists.txt | 1 | ||||
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 44 | ||||
-rw-r--r-- | linden/indra/newview/llfirstuse.cpp | 37 | ||||
-rw-r--r-- | linden/indra/newview/llfirstuse.h | 17 | ||||
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 38 | ||||
-rw-r--r-- | linden/indra/newview/llviewermessage.cpp | 8 | ||||
-rw-r--r-- | linden/indra/newview/rlvevent.h | 19 | ||||
-rw-r--r-- | linden/indra/newview/rlvextensions.cpp | 31 | ||||
-rw-r--r-- | linden/indra/newview/rlvhandler.cpp | 73 | ||||
-rw-r--r-- | linden/indra/newview/rlvhandler.h | 8 | ||||
-rw-r--r-- | linden/indra/newview/rlvhelper.cpp | 374 | ||||
-rw-r--r-- | linden/indra/newview/rlvhelper.h | 338 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/alerts.xml | 17 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | 40 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/notify.xml | 19 |
15 files changed, 529 insertions, 535 deletions
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index e993564..3db96c4 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt | |||
@@ -856,6 +856,7 @@ set(viewer_HEADER_FILES | |||
856 | randgauss.h | 856 | randgauss.h |
857 | VertexCache.h | 857 | VertexCache.h |
858 | VorbisFramework.h | 858 | VorbisFramework.h |
859 | rlvdefines.h | ||
859 | rlvevent.h | 860 | rlvevent.h |
860 | rlvhandler.h | 861 | rlvhandler.h |
861 | rlvhelper.h | 862 | rlvhelper.h |
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 8a13b85..8ffcb19 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -100,6 +100,50 @@ | |||
100 | <key>Value</key> | 100 | <key>Value</key> |
101 | <integer>0</integer> | 101 | <integer>0</integer> |
102 | </map> | 102 | </map> |
103 | <key>WarnFirstRLVDetach</key> | ||
104 | <map> | ||
105 | <key>Comment</key> | ||
106 | <string>Enables FirstRLVDetach warning dialog</string> | ||
107 | <key>Persist</key> | ||
108 | <integer>1</integer> | ||
109 | <key>Type</key> | ||
110 | <string>Boolean</string> | ||
111 | <key>Value</key> | ||
112 | <integer>1</integer> | ||
113 | </map> | ||
114 | <key>WarnFirstRLVEnableWear</key> | ||
115 | <map> | ||
116 | <key>Comment</key> | ||
117 | <string>Enables RLVEnableWear warning dialog</string> | ||
118 | <key>Persist</key> | ||
119 | <integer>1</integer> | ||
120 | <key>Type</key> | ||
121 | <string>Boolean</string> | ||
122 | <key>Value</key> | ||
123 | <integer>1</integer> | ||
124 | </map> | ||
125 | <key>WarnFirstRLVFartouch</key> | ||
126 | <map> | ||
127 | <key>Comment</key> | ||
128 | <string>Enables FirstRLVFartouch warning dialog</string> | ||
129 | <key>Persist</key> | ||
130 | <integer>1</integer> | ||
131 | <key>Type</key> | ||
132 | <string>Boolean</string> | ||
133 | <key>Value</key> | ||
134 | <integer>1</integer> | ||
135 | </map> | ||
136 | <key>WarnFirstRLVGiveToRLV</key> | ||
137 | <map> | ||
138 | <key>Comment</key> | ||
139 | <string>Enables FirstRLVGiveToRLV warning dialog</string> | ||
140 | <key>Persist</key> | ||
141 | <integer>1</integer> | ||
142 | <key>Type</key> | ||
143 | <string>Boolean</string> | ||
144 | <key>Value</key> | ||
145 | <integer>1</integer> | ||
146 | </map> | ||
103 | <key>AFKTimeout</key> | 147 | <key>AFKTimeout</key> |
104 | <map> | 148 | <map> |
105 | <key>Comment</key> | 149 | <key>Comment</key> |
diff --git a/linden/indra/newview/llfirstuse.cpp b/linden/indra/newview/llfirstuse.cpp index b807b17..7c611a3 100644 --- a/linden/indra/newview/llfirstuse.cpp +++ b/linden/indra/newview/llfirstuse.cpp | |||
@@ -44,6 +44,10 @@ | |||
44 | #include "llappviewer.h" | 44 | #include "llappviewer.h" |
45 | #include "lltracker.h" | 45 | #include "lltracker.h" |
46 | 46 | ||
47 | // [RLVa:KB] - Version: 1.22.11 | ||
48 | #include "llviewerwindow.h" | ||
49 | // [/RLVa:KB] | ||
50 | |||
47 | // static | 51 | // static |
48 | std::set<std::string> LLFirstUse::sConfigVariables; | 52 | std::set<std::string> LLFirstUse::sConfigVariables; |
49 | 53 | ||
@@ -287,3 +291,36 @@ void LLFirstUse::useMedia() | |||
287 | LLNotifyBox::showXml("FirstMedia"); | 291 | LLNotifyBox::showXml("FirstMedia"); |
288 | } | 292 | } |
289 | } | 293 | } |
294 | |||
295 | // [RLVa:KB] - Version: 1.22.11 | Checked: RLVa-1.0.3a (2009-09-10) | Added: RLVa-1.0.3a | ||
296 | |||
297 | // SL-1.22.11 doesn't seem to have a way to check which notifications are currently open :( | ||
298 | bool rlvHasVisibleFirstUseNotification() | ||
299 | { | ||
300 | return false; | ||
301 | } | ||
302 | |||
303 | void LLFirstUse::showRlvFirstUseNotification(const std::string& strName) | ||
304 | { | ||
305 | if ( (gSavedSettings.getWarning(strName)) && (!rlvHasVisibleFirstUseNotification()) ) | ||
306 | { | ||
307 | gSavedSettings.setWarning(strName, FALSE); | ||
308 | LLNotifyBox::showXml(strName); | ||
309 | } | ||
310 | } | ||
311 | |||
312 | void LLFirstUse::warnRlvGiveToRLV() | ||
313 | { | ||
314 | if ( (gSavedSettings.getWarning(RLV_SETTING_FIRSTUSE_GIVETORLV)) && (RlvSettings::getForbidGiveToRLV()) ) | ||
315 | gViewerWindow->alertXml(RLV_SETTING_FIRSTUSE_GIVETORLV, LLStringUtil::format_map_t(), &LLFirstUse::onRlvGiveToRLVConfirmation, NULL); | ||
316 | } | ||
317 | |||
318 | void LLFirstUse::onRlvGiveToRLVConfirmation(S32 idxOption, void* /*pUserParam*/) | ||
319 | { | ||
320 | gSavedSettings.setWarning(RLV_SETTING_FIRSTUSE_GIVETORLV, FALSE); | ||
321 | |||
322 | if ( (0 == idxOption) || (1 == idxOption) ) | ||
323 | gSavedSettings.setBOOL(RLV_SETTING_FORBIDGIVETORLV, (idxOption == 1)); | ||
324 | } | ||
325 | |||
326 | // [/RLVa:KB] | ||
diff --git a/linden/indra/newview/llfirstuse.h b/linden/indra/newview/llfirstuse.h index cbb31ab..7460067 100644 --- a/linden/indra/newview/llfirstuse.h +++ b/linden/indra/newview/llfirstuse.h | |||
@@ -35,6 +35,10 @@ | |||
35 | #include <vector> | 35 | #include <vector> |
36 | #include "llstring.h" | 36 | #include "llstring.h" |
37 | 37 | ||
38 | // [RLVa:KB] | ||
39 | #include "rlvdefines.h" | ||
40 | // [/RLVa:KB] | ||
41 | |||
38 | /* | 42 | /* |
39 | 1. On first use of 'sit here', explain how to get up and rotate view. | 43 | 1. On first use of 'sit here', explain how to get up and rotate view. |
40 | 44 | ||
@@ -109,6 +113,19 @@ public: | |||
109 | 113 | ||
110 | protected: | 114 | protected: |
111 | static std::set<std::string> sConfigVariables; | 115 | static std::set<std::string> sConfigVariables; |
116 | |||
117 | // [RLVa:KB] - Checked: RLVa-1.0.3a (2009-09-10) | Added: RLVa-1.0.3a | ||
118 | public: | ||
119 | static void showRlvFirstUseNotification(const std::string& strName); | ||
120 | |||
121 | static void useRlvDetach() { showRlvFirstUseNotification(RLV_SETTING_FIRSTUSE_DETACH); } | ||
122 | static void useRlvEnableWear() { showRlvFirstUseNotification(RLV_SETTING_FIRSTUSE_ENABLEWEAR); } | ||
123 | static void useRlvFartouch() { showRlvFirstUseNotification(RLV_SETTING_FIRSTUSE_FARTOUCH); } | ||
124 | |||
125 | static void warnRlvGiveToRLV(); | ||
126 | protected: | ||
127 | static void onRlvGiveToRLVConfirmation(S32 idxOption, void* pUserParam); | ||
128 | // [/RLVa:KB] | ||
112 | }; | 129 | }; |
113 | 130 | ||
114 | #endif | 131 | #endif |
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 98dd0ea..55cc2a6 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -953,7 +953,7 @@ void init_client_menu(LLMenuGL* menu) | |||
953 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0e | 953 | // [RLVa:KB] - Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-1.0.0e |
954 | #ifdef RLV_ADVANCED_TOGGLE_RLVA | 954 | #ifdef RLV_ADVANCED_TOGGLE_RLVA |
955 | if (gSavedSettings.controlExists(RLV_SETTING_MAIN)) | 955 | if (gSavedSettings.controlExists(RLV_SETTING_MAIN)) |
956 | menu->append(new LLMenuItemCheckGL("Restrained Life API", &rlvDbgToggleEnabled, NULL, &rlvDbgGetEnabled, NULL)); | 956 | menu->append(new LLMenuItemCheckGL("Restrained Life API", &rlvToggleEnabled, NULL, &rlvGetEnabled, NULL)); |
957 | #endif // RLV_ADVANCED_TOGGLE_RLVA | 957 | #endif // RLV_ADVANCED_TOGGLE_RLVA |
958 | // [/RLVa:KB] | 958 | // [/RLVa:KB] |
959 | 959 | ||
@@ -1407,30 +1407,24 @@ void init_debug_baked_texture_menu(LLMenuGL* menu) | |||
1407 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g | 1407 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-1.0.0g |
1408 | void init_debug_rlva_menu(LLMenuGL* menu) | 1408 | void init_debug_rlva_menu(LLMenuGL* menu) |
1409 | { | 1409 | { |
1410 | // Experimental feature toggles | 1410 | // Debug options |
1411 | { | 1411 | { |
1412 | /* | 1412 | LLMenuGL* pDbgMenu = new LLMenuGL("Debug"); |
1413 | #ifdef RLV_EXPERIMENTAL | ||
1414 | LLMenuGL* sub_menu = new LLMenuGL("Experimental"); | ||
1415 | 1413 | ||
1416 | menu->appendMenu(sub_menu); | 1414 | if (gSavedSettings.controlExists(RLV_SETTING_DEBUG)) |
1417 | #endif // RLV_EXPERIMENTAL | 1415 | pDbgMenu->append(new LLMenuItemCheckGL("Show Debug Messages", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_DEBUG)); |
1418 | */ | 1416 | pDbgMenu->appendSeparator(); |
1419 | } | 1417 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) |
1418 | pDbgMenu->append(new LLMenuItemCheckGL("Enable Legacy Naming", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLELEGACYNAMING)); | ||
1420 | 1419 | ||
1421 | // Unit tests | 1420 | menu->appendMenu(pDbgMenu); |
1422 | { | 1421 | menu->appendSeparator(); |
1423 | #ifdef RLV_DEBUG_TESTS | ||
1424 | init_debug_rlva_tests_menu(menu); | ||
1425 | #endif // RLV_DEBUG_TESTS | ||
1426 | } | 1422 | } |
1427 | 1423 | ||
1428 | #ifdef RLV_EXTENSION_ENABLE_WEAR | 1424 | #ifdef RLV_EXTENSION_ENABLE_WEAR |
1429 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLEWEAR)) | 1425 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLEWEAR)) |
1430 | { | ||
1431 | menu->append(new LLMenuItemCheckGL("Enable Wear", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLEWEAR)); | 1426 | menu->append(new LLMenuItemCheckGL("Enable Wear", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_ENABLEWEAR)); |
1432 | menu->appendSeparator(); | 1427 | menu->appendSeparator(); |
1433 | } | ||
1434 | #endif // RLV_EXTENSION_ENABLE_WEAR | 1428 | #endif // RLV_EXTENSION_ENABLE_WEAR |
1435 | 1429 | ||
1436 | #ifdef RLV_EXTENSION_HIDELOCKED | 1430 | #ifdef RLV_EXTENSION_HIDELOCKED |
@@ -1444,6 +1438,12 @@ void init_debug_rlva_menu(LLMenuGL* menu) | |||
1444 | } | 1438 | } |
1445 | #endif // RLV_EXTENSION_HIDELOCKED | 1439 | #endif // RLV_EXTENSION_HIDELOCKED |
1446 | 1440 | ||
1441 | if (gSavedSettings.controlExists(RLV_SETTING_FORBIDGIVETORLV)) | ||
1442 | menu->append(new LLMenuItemCheckGL("Forbid Give to #RLV", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_FORBIDGIVETORLV)); | ||
1443 | if (gSavedSettings.controlExists(RLV_SETTING_ENABLELEGACYNAMING)) | ||
1444 | menu->append(new LLMenuItemCheckGL("Show Name Tags", menu_toggle_control, NULL, menu_check_control, (void*)RLV_SETTING_SHOWNAMETAGS)); | ||
1445 | menu->appendSeparator(); | ||
1446 | |||
1447 | #ifdef RLV_EXTENSION_FLOATER_RESTRICTIONS | 1447 | #ifdef RLV_EXTENSION_FLOATER_RESTRICTIONS |
1448 | // TODO-RLVa: figure out a way to tell if floater_rlv_behaviour.xml exists | 1448 | // TODO-RLVa: figure out a way to tell if floater_rlv_behaviour.xml exists |
1449 | menu->append(new LLMenuItemCallGL("Restrictions...", RlvFloaterBehaviour::show, NULL, NULL)); | 1449 | menu->append(new LLMenuItemCallGL("Restrictions...", RlvFloaterBehaviour::show, NULL, NULL)); |
@@ -10376,7 +10376,7 @@ class RLVaMainToggle : public view_listener_t | |||
10376 | { | 10376 | { |
10377 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 10377 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
10378 | { | 10378 | { |
10379 | rlvDbgToggleEnabled(NULL); | 10379 | rlvToggleEnabled(NULL); |
10380 | return true; | 10380 | return true; |
10381 | } | 10381 | } |
10382 | }; | 10382 | }; |
@@ -10385,7 +10385,7 @@ class RLVaMainCheck : public view_listener_t | |||
10385 | { | 10385 | { |
10386 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 10386 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
10387 | { | 10387 | { |
10388 | bool new_value = rlvDbgGetEnabled(NULL); | 10388 | bool new_value = rlvGetEnabled(NULL); |
10389 | std::string control_name = userdata["control"].asString(); | 10389 | std::string control_name = userdata["control"].asString(); |
10390 | gMenuHolder->findControl(control_name)->setValue(new_value); | 10390 | gMenuHolder->findControl(control_name)->setValue(new_value); |
10391 | return true; | 10391 | return true; |
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 33d3d51..464d687 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp | |||
@@ -1821,6 +1821,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) | |||
1821 | } | 1821 | } |
1822 | else | 1822 | else |
1823 | { | 1823 | { |
1824 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-09-10 (RLVa-1.0.3a) | ||
1825 | if ( (rlv_handler_t::isEnabled()) && (dialog == IM_TASK_INVENTORY_OFFERED) && | ||
1826 | (info->mDesc.find(RLV_PUTINV_PREFIX) == 1) && (gRlvHandler.getSharedRoot()) ) | ||
1827 | { | ||
1828 | LLFirstUse::warnRlvGiveToRLV(); | ||
1829 | } | ||
1830 | // [/RLVa:KB] | ||
1831 | |||
1824 | inventory_offer_handler(info, dialog == IM_TASK_INVENTORY_OFFERED); | 1832 | inventory_offer_handler(info, dialog == IM_TASK_INVENTORY_OFFERED); |
1825 | } | 1833 | } |
1826 | } | 1834 | } |
diff --git a/linden/indra/newview/rlvevent.h b/linden/indra/newview/rlvevent.h index c3d9c45..a98996f 100644 --- a/linden/indra/newview/rlvevent.h +++ b/linden/indra/newview/rlvevent.h | |||
@@ -10,11 +10,8 @@ | |||
10 | #include "rlvhelper.h" | 10 | #include "rlvhelper.h" |
11 | 11 | ||
12 | // ============================================================================ | 12 | // ============================================================================ |
13 | /* | 13 | // RlvEvent - Passed to observer event handlers (contains the same paramaters as RlvHandler::processXXXCommand) |
14 | * RlvEvent | 14 | // |
15 | * ======== | ||
16 | * Passed to observer event handlers (contains the same paramaters as RlvHandler::processXXXCommand) | ||
17 | */ | ||
18 | 15 | ||
19 | class RlvEvent | 16 | class RlvEvent |
20 | { | 17 | { |
@@ -63,6 +60,7 @@ public: | |||
63 | 60 | ||
64 | virtual BOOL onAddCommand(const EventType& rlvEvent) { return FALSE; } | 61 | virtual BOOL onAddCommand(const EventType& rlvEvent) { return FALSE; } |
65 | virtual BOOL onRemoveCommand(const EventType& rlvEvent) { return FALSE; } | 62 | virtual BOOL onRemoveCommand(const EventType& rlvEvent) { return FALSE; } |
63 | virtual BOOL onClearCommand(const EventType& rlvEvent) { return FALSE; } | ||
66 | virtual BOOL onReplyCommand(const EventType& rlvEvent) { return FALSE; } | 64 | virtual BOOL onReplyCommand(const EventType& rlvEvent) { return FALSE; } |
67 | virtual BOOL onForceCommand(const EventType& rlvEvent) { return FALSE; } | 65 | virtual BOOL onForceCommand(const EventType& rlvEvent) { return FALSE; } |
68 | }; | 66 | }; |
@@ -168,11 +166,16 @@ public: | |||
168 | 166 | ||
169 | void changed(const RlvCommand& rlvCmd, bool fInternal) | 167 | void changed(const RlvCommand& rlvCmd, bool fInternal) |
170 | { | 168 | { |
171 | if ( (fInternal) || ((RLV_TYPE_ADD != rlvCmd.getParamType()) && (RLV_TYPE_REMOVE != rlvCmd.getParamType())) ) | 169 | if (fInternal) |
172 | return; | 170 | return; |
173 | 171 | ||
174 | std::string strCmd = rlvCmd.asString(); | 172 | std::string strCmd = rlvCmd.asString(), strNotify; ERlvParamType eCmdType = rlvCmd.getParamType(); |
175 | std::string strNotify = llformat("/%s=%c", strCmd.c_str(), (RLV_TYPE_ADD == rlvCmd.getParamType()) ? 'n' : 'y'); | 173 | if ( (RLV_TYPE_ADD == eCmdType) || (RLV_TYPE_REMOVE == eCmdType) ) |
174 | strNotify = llformat("/%s=%s", strCmd.c_str(), rlvCmd.getParam().c_str()); | ||
175 | else if (RLV_TYPE_CLEAR == eCmdType) | ||
176 | strNotify = llformat("/%s", strCmd.c_str()); | ||
177 | else | ||
178 | return; | ||
176 | 179 | ||
177 | for (std::multimap<LLUUID, notifyData>::const_iterator itNotify = m_Notifications.begin(); | 180 | for (std::multimap<LLUUID, notifyData>::const_iterator itNotify = m_Notifications.begin(); |
178 | itNotify != m_Notifications.end(); ++itNotify) | 181 | itNotify != m_Notifications.end(); ++itNotify) |
diff --git a/linden/indra/newview/rlvextensions.cpp b/linden/indra/newview/rlvextensions.cpp index 6f79636..10d1c46 100644 --- a/linden/indra/newview/rlvextensions.cpp +++ b/linden/indra/newview/rlvextensions.cpp | |||
@@ -1,5 +1,6 @@ | |||
1 | #include "llviewerprecompiledheaders.h" | 1 | #include "llviewerprecompiledheaders.h" |
2 | #include "llagent.h" | 2 | #include "llagent.h" |
3 | #include "llfloaterwindlight.h" | ||
3 | #include "llviewercontrol.h" | 4 | #include "llviewercontrol.h" |
4 | #include "llviewerwindow.h" | 5 | #include "llviewerwindow.h" |
5 | #include "llvoavatar.h" | 6 | #include "llvoavatar.h" |
@@ -221,8 +222,18 @@ void RlvExtGetSet::onSetDebug(std::string strSetting, const std::string& strValu | |||
221 | } | 222 | } |
222 | } | 223 | } |
223 | 224 | ||
225 | // Checked: 2009-09-16 (RLVa-1.0.3c) | Modified: RLVa-1.0.3c | ||
224 | std::string RlvExtGetSet::onGetEnv(std::string strSetting) | 226 | std::string RlvExtGetSet::onGetEnv(std::string strSetting) |
225 | { | 227 | { |
228 | // HACK: - create a LLFloaterWindLight instance if there isn't one already | ||
229 | // - isOpen() is actually instanceExists() | ||
230 | // - creating an instance results in showing the floater which is why we need to ->close() it | ||
231 | if (!LLFloaterWindLight::isOpen()) | ||
232 | { | ||
233 | LLFloaterWindLight::instance()->close(); | ||
234 | LLFloaterWindLight::instance()->syncMenu(); | ||
235 | } | ||
236 | |||
226 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); | 237 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); |
227 | 238 | ||
228 | F32 nValue = 0.0f; | 239 | F32 nValue = 0.0f; |
@@ -238,7 +249,7 @@ std::string RlvExtGetSet::onGetEnv(std::string strSetting) | |||
238 | else if ("cloudscale" == strSetting) nValue = pWLParams->mCloudScale; | 249 | else if ("cloudscale" == strSetting) nValue = pWLParams->mCloudScale; |
239 | else if ("cloudscrollx" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollX() - 10.0f; | 250 | else if ("cloudscrollx" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollX() - 10.0f; |
240 | else if ("cloudscrolly" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollY() - 10.0f; | 251 | else if ("cloudscrolly" == strSetting) nValue = pWLParams->mCurParams.getCloudScrollY() - 10.0f; |
241 | else if ("densitymultiplier" == strSetting) nValue = pWLParams->mDensityMult * 1000; | 252 | else if ("densitymultiplier" == strSetting) nValue = pWLParams->mDensityMult.x * pWLParams->mDensityMult.mult; |
242 | else if ("distancemultiplier" == strSetting) nValue = pWLParams->mDistanceMult; | 253 | else if ("distancemultiplier" == strSetting) nValue = pWLParams->mDistanceMult; |
243 | else if ("eastangle" == strSetting) nValue = pWLParams->mCurParams.getEastAngle() / F_TWO_PI; | 254 | else if ("eastangle" == strSetting) nValue = pWLParams->mCurParams.getEastAngle() / F_TWO_PI; |
244 | else if ("hazedensity" == strSetting) nValue = pWLParams->mHazeDensity.r; | 255 | else if ("hazedensity" == strSetting) nValue = pWLParams->mHazeDensity.r; |
@@ -260,7 +271,7 @@ std::string RlvExtGetSet::onGetEnv(std::string strSetting) | |||
260 | if ( ('r' == ch) || ('g' == ch) || ('b' == ch) || ('i' == ch) ) | 271 | if ( ('r' == ch) || ('g' == ch) || ('b' == ch) || ('i' == ch) ) |
261 | { | 272 | { |
262 | WLColorControl* pColour = NULL; | 273 | WLColorControl* pColour = NULL; |
263 | strSetting.erase(strSetting.length() - 2, 1); | 274 | strSetting.erase(strSetting.length() - 1, 1); |
264 | 275 | ||
265 | if ("ambient" == strSetting) pColour = &pWLParams->mAmbient; | 276 | if ("ambient" == strSetting) pColour = &pWLParams->mAmbient; |
266 | else if ("bluedensity" == strSetting) pColour = &pWLParams->mBlueDensity; | 277 | else if ("bluedensity" == strSetting) pColour = &pWLParams->mBlueDensity; |
@@ -272,10 +283,10 @@ std::string RlvExtGetSet::onGetEnv(std::string strSetting) | |||
272 | 283 | ||
273 | if (pColour) | 284 | if (pColour) |
274 | { | 285 | { |
275 | if ('r' == ch) nValue = pColour->b; | 286 | if ('r' == ch) nValue = pColour->r; |
276 | else if ('g' == ch) nValue = pColour->b; | 287 | else if ('g' == ch) nValue = pColour->g; |
277 | else if ('b' == ch) nValue = pColour->b; | 288 | else if ('b' == ch) nValue = pColour->b; |
278 | else if (('i' == ch) && (pColour->hasSliderName)) nValue = pColour->i; | 289 | else if (('i' == ch) && (pColour->hasSliderName)) nValue = llmax(pColour->r, pColour->g, pColour->b); |
279 | 290 | ||
280 | if (pColour->isBlueHorizonOrDensity) nValue /= 2.0f; | 291 | if (pColour->isBlueHorizonOrDensity) nValue /= 2.0f; |
281 | else if (pColour->isSunOrAmbientColor) nValue /= 3.0f; | 292 | else if (pColour->isSunOrAmbientColor) nValue /= 3.0f; |
@@ -286,8 +297,16 @@ std::string RlvExtGetSet::onGetEnv(std::string strSetting) | |||
286 | return llformat("%f", nValue); | 297 | return llformat("%f", nValue); |
287 | } | 298 | } |
288 | 299 | ||
300 | // Checked: 2009-09-16 (RLVa-1.0.3c) | Modified: RLVa-1.0.3c | ||
289 | void RlvExtGetSet::onSetEnv(std::string strSetting, const std::string& strValue) | 301 | void RlvExtGetSet::onSetEnv(std::string strSetting, const std::string& strValue) |
290 | { | 302 | { |
303 | // HACK: see RlvExtGetSet::onGetEnv | ||
304 | if (!LLFloaterWindLight::isOpen()) | ||
305 | { | ||
306 | LLFloaterWindLight::instance()->close(); | ||
307 | LLFloaterWindLight::instance()->syncMenu(); | ||
308 | } | ||
309 | |||
291 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); | 310 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); |
292 | WLFloatControl* pFloat = NULL; | 311 | WLFloatControl* pFloat = NULL; |
293 | WLColorControl* pColour = NULL; | 312 | WLColorControl* pColour = NULL; |
@@ -405,7 +424,7 @@ void RlvExtGetSet::onSetEnv(std::string strSetting, const std::string& strValue) | |||
405 | 424 | ||
406 | if ( ('r' == ch) || ('g' == ch) || ('b' == ch) || ('i' == ch) ) | 425 | if ( ('r' == ch) || ('g' == ch) || ('b' == ch) || ('i' == ch) ) |
407 | { | 426 | { |
408 | strSetting.erase(strSetting.length() - 2, 1); | 427 | strSetting.erase(strSetting.length() - 1, 1); |
409 | 428 | ||
410 | if ("ambient" == strSetting) pColour = &pWLParams->mAmbient; | 429 | if ("ambient" == strSetting) pColour = &pWLParams->mAmbient; |
411 | else if ("bluedensity" == strSetting) pColour = &pWLParams->mBlueDensity; | 430 | else if ("bluedensity" == strSetting) pColour = &pWLParams->mBlueDensity; |
diff --git a/linden/indra/newview/rlvhandler.cpp b/linden/indra/newview/rlvhandler.cpp index 987c62a..6044aa9 100644 --- a/linden/indra/newview/rlvhandler.cpp +++ b/linden/indra/newview/rlvhandler.cpp | |||
@@ -1,6 +1,7 @@ | |||
1 | #include "llviewerprecompiledheaders.h" | 1 | #include "llviewerprecompiledheaders.h" |
2 | #include "llagent.h" | 2 | #include "llagent.h" |
3 | #include "lldrawpoolalpha.h" | 3 | #include "lldrawpoolalpha.h" |
4 | #include "llfirstuse.h" | ||
4 | #include "llfloaterbeacons.h" | 5 | #include "llfloaterbeacons.h" |
5 | #include "llfloaterchat.h" | 6 | #include "llfloaterchat.h" |
6 | #include "llfloaterdaycycle.h" | 7 | #include "llfloaterdaycycle.h" |
@@ -96,7 +97,7 @@ static bool rlvParseNotifyOption(const std::string& strOption, S32& nChannel, st | |||
96 | boost_tokenizer::const_iterator itTok = tokens.begin(); | 97 | boost_tokenizer::const_iterator itTok = tokens.begin(); |
97 | 98 | ||
98 | // Extract and sanity check the first token (required) which is the channel | 99 | // Extract and sanity check the first token (required) which is the channel |
99 | if ( (itTok == tokens.end()) || (!LLStringUtil::convertToS32(*itTok, nChannel)) || (!rlvIsValidChannel(nChannel)) ) | 100 | if ( (itTok == tokens.end()) || (!LLStringUtil::convertToS32(*itTok, nChannel)) || (!rlvIsValidReplyChannel(nChannel)) ) |
100 | return false; | 101 | return false; |
101 | 102 | ||
102 | // Second token (optional) is the filter | 103 | // Second token (optional) is the filter |
@@ -284,6 +285,10 @@ bool RlvHandler::setDetachable(S32 idxAttachPt, const LLUUID& idRlvObj, bool fDe | |||
284 | 285 | ||
285 | if (!fDetachable) | 286 | if (!fDetachable) |
286 | { | 287 | { |
288 | #ifdef RLV_EXPERIMENTAL_FIRSTUSE | ||
289 | LLFirstUse::useRlvDetach(); | ||
290 | #endif // RLV_EXPERIMENTAL_FIRSTUSE | ||
291 | |||
287 | // NOTE: m_Attachments can contain duplicate <idxAttachPt, idRlvObj> pairs (ie @detach:spine=n,detach=n from an attachment on spine) | 292 | // NOTE: m_Attachments can contain duplicate <idxAttachPt, idRlvObj> pairs (ie @detach:spine=n,detach=n from an attachment on spine) |
288 | m_Attachments.insert(std::pair<S32, LLUUID>(idxAttachPt, itObj->second.m_UUID)); | 293 | m_Attachments.insert(std::pair<S32, LLUUID>(idxAttachPt, itObj->second.m_UUID)); |
289 | return true; | 294 | return true; |
@@ -469,6 +474,10 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b | |||
469 | } | 474 | } |
470 | } | 475 | } |
471 | break; | 476 | break; |
477 | case RLV_TYPE_CLEAR: | ||
478 | fRet = processClearCommand(uuid, rlvCmd); | ||
479 | notifyBehaviourObservers(rlvCmd, !fFromObj); | ||
480 | break; | ||
472 | case RLV_TYPE_FORCE: // Checked: | 481 | case RLV_TYPE_FORCE: // Checked: |
473 | fRet = processForceCommand(uuid, rlvCmd); | 482 | fRet = processForceCommand(uuid, rlvCmd); |
474 | break; | 483 | break; |
@@ -476,32 +485,6 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b | |||
476 | fRet = processReplyCommand(uuid, rlvCmd); | 485 | fRet = processReplyCommand(uuid, rlvCmd); |
477 | break; | 486 | break; |
478 | case RLV_TYPE_UNKNOWN: // Checked: | 487 | case RLV_TYPE_UNKNOWN: // Checked: |
479 | { | ||
480 | if ("clear" == rlvCmd.getBehaviour()) | ||
481 | { | ||
482 | const std::string& strFilter = rlvCmd.getParam(); std::string strCmdRem; | ||
483 | |||
484 | rlv_object_map_t::const_iterator itObj = m_Objects.find(uuid); | ||
485 | if (itObj != m_Objects.end()) // No sense in @clear'ing if we don't have any commands for this object | ||
486 | { | ||
487 | const RlvObject& rlvObj = itObj->second; bool fContinue = true; | ||
488 | for (rlv_command_list_t::const_iterator itCmd = rlvObj.m_Commands.begin(), itCurCmd; | ||
489 | ((fContinue) && (itCmd != rlvObj.m_Commands.end())); ) | ||
490 | { | ||
491 | itCurCmd = itCmd++; // Point itCmd ahead so it won't get invalidated if/when we erase a command | ||
492 | |||
493 | const RlvCommand& rlvCmdRem = *itCurCmd; | ||
494 | if ( (strFilter.empty()) || (std::string::npos != rlvCmdRem.asString().find(strFilter)) ) | ||
495 | { | ||
496 | fContinue = (rlvObj.m_Commands.size() > 1); // rlvObj will become invalid once we remove the last command | ||
497 | strCmdRem = rlvCmdRem.getBehaviour() + ":" + rlvCmdRem.getOption() + "=y"; | ||
498 | processCommand(uuid, strCmdRem, false); | ||
499 | } | ||
500 | } | ||
501 | fRet = TRUE; | ||
502 | } | ||
503 | } | ||
504 | } | ||
505 | break; | 488 | break; |
506 | #ifdef LL_GNUC | 489 | #ifdef LL_GNUC |
507 | default: | 490 | default: |
@@ -663,6 +646,13 @@ BOOL RlvHandler::processAddCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) | |||
663 | LLFloaterChat::getInstance()->childSetVisible("active_speakers_panel", false); | 646 | LLFloaterChat::getInstance()->childSetVisible("active_speakers_panel", false); |
664 | } | 647 | } |
665 | break; | 648 | break; |
649 | case RLV_BHVR_FARTOUCH: | ||
650 | { | ||
651 | #ifdef RLV_EXPERIMENTAL_FIRSTUSE | ||
652 | LLFirstUse::useRlvFartouch(); | ||
653 | #endif // RLV_EXPERIMENTAL_FIRSTUSE | ||
654 | } | ||
655 | break; | ||
666 | case RLV_BHVR_FLY: // @fly=n - Checked: 2009-07-05 (RLVa-1.0.0c) | 656 | case RLV_BHVR_FLY: // @fly=n - Checked: 2009-07-05 (RLVa-1.0.0c) |
667 | { | 657 | { |
668 | // If currently flying, simulate clicking the Fly button [see LLToolBar::onClickFly()] | 658 | // If currently flying, simulate clicking the Fly button [see LLToolBar::onClickFly()] |
@@ -900,6 +890,35 @@ BOOL RlvHandler::processRemoveCommand(const LLUUID& uuid, const RlvCommand& rlvC | |||
900 | return TRUE; // Remove commands don't fail, doesn't matter what we return here | 890 | return TRUE; // Remove commands don't fail, doesn't matter what we return here |
901 | } | 891 | } |
902 | 892 | ||
893 | BOOL RlvHandler::processClearCommand(const LLUUID& idObj, const RlvCommand& rlvCmd) | ||
894 | { | ||
895 | const std::string& strFilter = rlvCmd.getParam(); std::string strCmdRem; | ||
896 | |||
897 | rlv_object_map_t::const_iterator itObj = m_Objects.find(idObj); | ||
898 | if (itObj != m_Objects.end()) // No sense in clearing if we don't have any commands for this object | ||
899 | { | ||
900 | const RlvObject& rlvObj = itObj->second; bool fContinue = true; | ||
901 | for (rlv_command_list_t::const_iterator itCmd = rlvObj.m_Commands.begin(), itCurCmd; | ||
902 | ((fContinue) && (itCmd != rlvObj.m_Commands.end())); ) | ||
903 | { | ||
904 | itCurCmd = itCmd++; // Point itCmd ahead so it won't get invalidated if/when we erase a command | ||
905 | |||
906 | const RlvCommand& rlvCmdRem = *itCurCmd; strCmdRem = rlvCmdRem.asString(); | ||
907 | if ( (strFilter.empty()) || (std::string::npos != strCmdRem.find(strFilter)) ) | ||
908 | { | ||
909 | fContinue = (rlvObj.m_Commands.size() > 1); // rlvObj will become invalid once we remove the last command | ||
910 | processCommand(idObj, strCmdRem.append("=y"), false); | ||
911 | } | ||
912 | } | ||
913 | } | ||
914 | |||
915 | // Let our observers know about clear commands | ||
916 | RlvEvent rlvEvent(idObj, rlvCmd); | ||
917 | m_Emitter.update(&RlvObserver::onClearCommand, rlvEvent); | ||
918 | |||
919 | return TRUE; // Don't fail clear commands even if the object didn't exist since it confuses people | ||
920 | } | ||
921 | |||
903 | BOOL RlvHandler::processForceCommand(const LLUUID& idObj, const RlvCommand& rlvCmd) const | 922 | BOOL RlvHandler::processForceCommand(const LLUUID& idObj, const RlvCommand& rlvCmd) const |
904 | { | 923 | { |
905 | const std::string& strOption = rlvCmd.getOption(); | 924 | const std::string& strOption = rlvCmd.getOption(); |
diff --git a/linden/indra/newview/rlvhandler.h b/linden/indra/newview/rlvhandler.h index 505bfd5..4470632 100644 --- a/linden/indra/newview/rlvhandler.h +++ b/linden/indra/newview/rlvhandler.h | |||
@@ -14,17 +14,11 @@ | |||
14 | #include "rlvmultistringsearch.h" | 14 | #include "rlvmultistringsearch.h" |
15 | 15 | ||
16 | // ============================================================================ | 16 | // ============================================================================ |
17 | /* | ||
18 | * RlvHandler | ||
19 | * ========== | ||
20 | * | ||
21 | */ | ||
22 | 17 | ||
23 | typedef std::map<LLUUID, RlvObject> rlv_object_map_t; | 18 | typedef std::map<LLUUID, RlvObject> rlv_object_map_t; |
24 | typedef std::multimap<S32, LLUUID> rlv_detach_map_t; | 19 | typedef std::multimap<S32, LLUUID> rlv_detach_map_t; |
25 | typedef std::map<S32, LLUUID> rlv_reattach_map_t; | 20 | typedef std::map<S32, LLUUID> rlv_reattach_map_t; |
26 | typedef std::multimap<LLUUID, ERlvBehaviour> rlv_exception_map_t; | 21 | typedef std::multimap<LLUUID, ERlvBehaviour> rlv_exception_map_t; |
27 | typedef std::map<S32, RlvRedirInfo> rlv_redir_map_t; | ||
28 | 22 | ||
29 | class RlvHandler | 23 | class RlvHandler |
30 | { | 24 | { |
@@ -195,6 +189,7 @@ public: | |||
195 | protected: | 189 | protected: |
196 | BOOL processAddCommand(const LLUUID& uuid, const RlvCommand& rlvCmd); | 190 | BOOL processAddCommand(const LLUUID& uuid, const RlvCommand& rlvCmd); |
197 | BOOL processRemoveCommand(const LLUUID& uuid, const RlvCommand& rlvCmd); | 191 | BOOL processRemoveCommand(const LLUUID& uuid, const RlvCommand& rlvCmd); |
192 | BOOL processClearCommand(const LLUUID& idObj, const RlvCommand& rlvCmd); | ||
198 | BOOL processReplyCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) const; | 193 | BOOL processReplyCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) const; |
199 | BOOL processForceCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) const; | 194 | BOOL processForceCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) const; |
200 | 195 | ||
@@ -235,7 +230,6 @@ protected: | |||
235 | rlv_retained_list_t m_Retained; | 230 | rlv_retained_list_t m_Retained; |
236 | rlv_reattach_map_t m_AttachPending; | 231 | rlv_reattach_map_t m_AttachPending; |
237 | rlv_reattach_map_t m_DetachPending; | 232 | rlv_reattach_map_t m_DetachPending; |
238 | rlv_redir_map_t m_Redirections; | ||
239 | RlvGCTimer* m_pGCTimer; | 233 | RlvGCTimer* m_pGCTimer; |
240 | RlvWLSnapshot* m_pWLSnapshot; | 234 | RlvWLSnapshot* m_pWLSnapshot; |
241 | 235 | ||
diff --git a/linden/indra/newview/rlvhelper.cpp b/linden/indra/newview/rlvhelper.cpp index 429a527..f495384 100644 --- a/linden/indra/newview/rlvhelper.cpp +++ b/linden/indra/newview/rlvhelper.cpp | |||
@@ -1,5 +1,6 @@ | |||
1 | #include "llviewerprecompiledheaders.h" | 1 | #include "llviewerprecompiledheaders.h" |
2 | #include "llagent.h" | 2 | #include "llagent.h" |
3 | #include "llfloaterwindlight.h" | ||
3 | #include "llviewerobject.h" | 4 | #include "llviewerobject.h" |
4 | #include "llviewerstats.h" | 5 | #include "llviewerstats.h" |
5 | #include "llviewerwindow.h" | 6 | #include "llviewerwindow.h" |
@@ -14,31 +15,33 @@ | |||
14 | // Static variable initialization | 15 | // Static variable initialization |
15 | // | 16 | // |
16 | 17 | ||
17 | RlvMultiStringSearch RlvCommand::m_BhvrLookup; | 18 | RlvCommand::RlvBhvrTable RlvCommand::m_BhvrMap; |
18 | 19 | ||
19 | // ============================================================================ | 20 | // ============================================================================ |
21 | // RlvCommmand | ||
22 | // | ||
20 | 23 | ||
21 | // Checked: | 24 | // Checked: 2009-09-10 (RLVa-1.0.3a) | Modified: RLVa-1.0.3a |
22 | RlvCommand::RlvCommand(const std::string& strCommand) | 25 | RlvCommand::RlvCommand(const std::string& strCommand) |
23 | : m_eBehaviour(RLV_BHVR_UNKNOWN), m_eParamType(RLV_TYPE_UNKNOWN) | 26 | : m_eBehaviour(RLV_BHVR_UNKNOWN), m_eParamType(RLV_TYPE_UNKNOWN) |
24 | { | 27 | { |
25 | if ((m_fValid = parseCommand(strCommand, m_strBehaviour, m_strOption, m_strParam))) | 28 | if ((m_fValid = parseCommand(strCommand, m_strBehaviour, m_strOption, m_strParam))) |
26 | { | 29 | { |
30 | S32 nTemp = 0; | ||
27 | if ( ("n" == m_strParam) || ("add" == m_strParam) ) | 31 | if ( ("n" == m_strParam) || ("add" == m_strParam) ) |
28 | m_eParamType = RLV_TYPE_ADD; | 32 | m_eParamType = RLV_TYPE_ADD; |
29 | else if ( ("y" == m_strParam) || ("rem" == m_strParam) ) | 33 | else if ( ("y" == m_strParam) || ("rem" == m_strParam) ) |
30 | m_eParamType = RLV_TYPE_REMOVE; | 34 | m_eParamType = RLV_TYPE_REMOVE; |
31 | else if ("force" == m_strParam) | 35 | else if ("force" == m_strParam) |
32 | m_eParamType = RLV_TYPE_FORCE; | 36 | m_eParamType = RLV_TYPE_FORCE; |
37 | else if (LLStringUtil::convertToS32(m_strParam, nTemp)) // Assume it's a reply command if we can convert <param> to an S32 | ||
38 | m_eParamType = RLV_TYPE_REPLY; | ||
39 | else if (m_strBehaviour == "clear") // clear is the odd one out so just make it its own type | ||
40 | m_eParamType = RLV_TYPE_CLEAR; | ||
33 | else | 41 | else |
34 | { | 42 | { |
35 | m_eParamType = RLV_TYPE_REPLY; // Assume it's a reply command until we encounter a non-digit | 43 | m_eParamType = RLV_TYPE_UNKNOWN; |
36 | 44 | m_fValid = false; | |
37 | if ( (m_strParam.empty()) || (-1 != m_strParam.find_first_not_of("0123456789")) ) | ||
38 | { | ||
39 | m_eParamType = RLV_TYPE_UNKNOWN; | ||
40 | m_fValid = ("clear" == m_strBehaviour); | ||
41 | } | ||
42 | } | 45 | } |
43 | } | 46 | } |
44 | 47 | ||
@@ -48,50 +51,16 @@ RlvCommand::RlvCommand(const std::string& strCommand) | |||
48 | return; | 51 | return; |
49 | } | 52 | } |
50 | 53 | ||
51 | U16 nBehaviour; | 54 | RlvBhvrTable::const_iterator itBhvr = m_BhvrMap.find(m_strBehaviour); |
52 | if (m_BhvrLookup.getExactMatchParam(m_strBehaviour, nBehaviour)) | 55 | if (itBhvr != m_BhvrMap.end()) |
53 | { | 56 | m_eBehaviour = itBhvr->second; |
54 | m_eBehaviour = (ERlvBehaviour)nBehaviour; | ||
55 | } | ||
56 | } | 57 | } |
57 | 58 | ||
58 | RlvCommand::RlvCommand(const RlvCommand& rlvCmd) | ||
59 | : m_fValid(rlvCmd.m_fValid), | ||
60 | m_strBehaviour(rlvCmd.m_strBehaviour), m_eBehaviour(rlvCmd.m_eBehaviour), | ||
61 | m_strOption(rlvCmd.m_strOption), | ||
62 | m_strParam(rlvCmd.m_strParam), m_eParamType(rlvCmd.m_eParamType) | ||
63 | { | ||
64 | } | ||
65 | 59 | ||
66 | // ============================================================================ | 60 | bool RlvCommand::parseCommand(const std::string& strCommand, std::string& strBehaviour, std::string& strOption, std::string& strParam) |
67 | |||
68 | /* | ||
69 | * ------------------------------ | ||
70 | * Command | RLV | RLVa | ||
71 | * ------------------------------ | ||
72 | * : | F | F (missing behaviour) | ||
73 | * :option | F | F (missing behaviour) | ||
74 | * := | T | F (missing behaviour) | ||
75 | * :option= | T | F (missing behaviour) | ||
76 | * :option=param | T | F (missing behaviour) | ||
77 | * = | T | F (missing behaviour) | ||
78 | * =param | T | F (missing behaviour) | ||
79 | * cmd | F | F (missing param) [T if <behaviour> == "clear"] | ||
80 | * cmd: | F | F (missing param) | ||
81 | * cmd:option | F | F (missing param) | ||
82 | * cmd:= | T | F (missing param) [1] | ||
83 | * cmd:option= | T | F (missing param) [1] | ||
84 | * cmd= | T | F (missing param) [1] | ||
85 | * cmd:option=param | T | T | ||
86 | * cmd=param | T | T | ||
87 | * cmd:=param | T | T | ||
88 | * | ||
89 | * [1] 'clear:=', 'clear:option=' and 'clear=' are "valid" variations of 'clear' | ||
90 | */ | ||
91 | |||
92 | BOOL RlvCommand::parseCommand(/*[in]*/ const std::string& strCommand, | ||
93 | /*[out]*/ std::string& strBehaviour, /*[out]*/ std::string& strOption, /*[out]*/ std::string& strParam) | ||
94 | { | 61 | { |
62 | // (See behaviour notes for the command parsing truth table) | ||
63 | |||
95 | // Format: <behaviour>[:<option>]=<param> | 64 | // Format: <behaviour>[:<option>]=<param> |
96 | int idxParam = strCommand.find('='); | 65 | int idxParam = strCommand.find('='); |
97 | int idxOption = (idxParam > 0) ? strCommand.find(':') : -1; | 66 | int idxOption = (idxParam > 0) ? strCommand.find(':') : -1; |
@@ -100,7 +69,7 @@ BOOL RlvCommand::parseCommand(/*[in]*/ const std::string& strCommand, | |||
100 | 69 | ||
101 | // If <behaviour> is missing it's always an improperly formatted command | 70 | // If <behaviour> is missing it's always an improperly formatted command |
102 | if ( (0 == idxOption) || (0 == idxParam) ) | 71 | if ( (0 == idxOption) || (0 == idxParam) ) |
103 | return FALSE; | 72 | return false; |
104 | 73 | ||
105 | strBehaviour = strCommand.substr(0, (-1 != idxOption) ? idxOption : idxParam); | 74 | strBehaviour = strCommand.substr(0, (-1 != idxOption) ? idxOption : idxParam); |
106 | strOption = strParam = ""; | 75 | strOption = strParam = ""; |
@@ -111,15 +80,15 @@ BOOL RlvCommand::parseCommand(/*[in]*/ const std::string& strCommand, | |||
111 | // Unless "<behaviour> == "clear" AND (idxOption == 0)" | 80 | // Unless "<behaviour> == "clear" AND (idxOption == 0)" |
112 | // OR <behaviour> == "clear" AND (idxParam != 0) [see table above] | 81 | // OR <behaviour> == "clear" AND (idxParam != 0) [see table above] |
113 | if ( ("clear" == strBehaviour) && ( (!idxOption) || (idxParam) ) ) | 82 | if ( ("clear" == strBehaviour) && ( (!idxOption) || (idxParam) ) ) |
114 | return TRUE; | 83 | return true; |
115 | return FALSE; | 84 | return false; |
116 | } | 85 | } |
117 | 86 | ||
118 | if ( (-1 != idxOption) && (idxOption + 1 != idxParam) ) | 87 | if ( (-1 != idxOption) && (idxOption + 1 != idxParam) ) |
119 | strOption = strCommand.substr(idxOption + 1, idxParam - idxOption - 1); | 88 | strOption = strCommand.substr(idxOption + 1, idxParam - idxOption - 1); |
120 | strParam = strCommand.substr(idxParam + 1); | 89 | strParam = strCommand.substr(idxParam + 1); |
121 | 90 | ||
122 | return TRUE; | 91 | return true; |
123 | } | 92 | } |
124 | 93 | ||
125 | void RlvCommand::initLookupTable() | 94 | void RlvCommand::initLookupTable() |
@@ -127,57 +96,61 @@ void RlvCommand::initLookupTable() | |||
127 | static bool fInitialized = false; | 96 | static bool fInitialized = false; |
128 | if (!fInitialized) | 97 | if (!fInitialized) |
129 | { | 98 | { |
130 | // NOTE: keep this match with the enumeration at all times | 99 | // NOTE: keep this matched with the enumeration at all times |
131 | std::string arBehaviours[RLV_BHVR_COUNT] = | 100 | std::string arBehaviours[RLV_BHVR_COUNT] = |
132 | { | 101 | { |
133 | "version", "detach", "redirchat", "rediremote", "sendim", "recvchat", "recvemote", "recvim", "tploc", "tplure", | 102 | "version", "detach", "sendchat", "emote", "chatshout", "chatnormal", "chatwhisper", "redirchat", "rediremote", |
134 | "sittp", "edit", "rez", "addoutfit", "remoutfit", "getoutfit", "getattach", "showinv", "unsit", "sit", | 103 | "sendim", "recvchat", "recvemote", "recvim", "tplm", "tploc", "tplure", "sittp", "edit", "rez", "addoutfit", |
135 | "getstatus", "getstatusall", "getinv", "getinvworn", "findfolder", "findfolders", "attach", "attachall", "detachall", | 104 | "remoutfit", "getoutfit", "getattach", "showinv", "viewnote", "unsit", "sit", "sendchannel", "getstatus", "getstatusall", |
136 | "getpath", "attachthis", "attachallthis", "detachthis", "detachallthis", "fartouch", "showworldmap", "showminimap", | 105 | "getinv", "getinvworn", "findfolder", "findfolders", "attach", "attachall", "detachall", "getpath", "attachthis", |
137 | "showloc", "tpto", "accepttp", "shownames", "fly", "getsitid", "setdebug", "setenv", "detachme", | 106 | "attachallthis", "detachthis", "detachallthis", "fartouch", "showworldmap", "showminimap", "showloc", "tpto", "accepttp", |
138 | "showhovertextall", "showhovertextworld", "showhovertexthud", "showhovertext", "notify" | 107 | "shownames", "fly", "getsitid", "setdebug", "setenv", "detachme", "showhovertextall", "showhovertextworld", |
108 | "showhovertexthud", "showhovertext", "notify" | ||
139 | }; | 109 | }; |
140 | 110 | ||
141 | for (int idxBvhr = 0; idxBvhr < RLV_BHVR_COUNT; idxBvhr++) | 111 | for (int idxBvhr = 0; idxBvhr < RLV_BHVR_COUNT; idxBvhr++) |
142 | m_BhvrLookup.addKeyword(arBehaviours[idxBvhr], idxBvhr); | 112 | m_BhvrMap.insert(std::pair<std::string, ERlvBehaviour>(arBehaviours[idxBvhr], (ERlvBehaviour)idxBvhr)); |
143 | 113 | ||
144 | fInitialized = true; | 114 | fInitialized = true; |
145 | } | 115 | } |
146 | } | 116 | } |
147 | 117 | ||
148 | // Checked: 2009-06-07 (RLVa-0.2.1c) | 118 | // ========================================================================= |
149 | std::string RlvCommand::asString() const | 119 | // RlvObject |
120 | // | ||
121 | |||
122 | RlvObject::RlvObject(const LLUUID& idObj) : m_UUID(idObj), m_nLookupMisses(0) | ||
150 | { | 123 | { |
151 | return (!m_strOption.empty()) ? (std::string(m_strBehaviour)).append(":").append(m_strOption) : (std::string(m_strBehaviour)); | 124 | LLViewerObject* pObj = gObjectList.findObject(idObj); |
125 | m_fLookup = (NULL != pObj); | ||
126 | m_idxAttachPt = (pObj) ? ATTACHMENT_ID_FROM_STATE(pObj->getState()) : 0; | ||
152 | } | 127 | } |
153 | 128 | ||
154 | // ========================================================================= | 129 | bool RlvObject::addCommand(const RlvCommand& rlvCmd) |
155 | |||
156 | BOOL RlvObject::addCommand(const RlvCommand& rlvCmd) | ||
157 | { | 130 | { |
158 | // Sanity checking | 131 | // Sanity checking |
159 | if (RLV_TYPE_ADD != rlvCmd.getParamType()) | 132 | if (RLV_TYPE_ADD != rlvCmd.getParamType()) |
160 | return FALSE; | 133 | return false; |
161 | 134 | ||
162 | // Don't add duplicate commands for this object (ie @detach=n followed by another @detach=n later on) | 135 | // Don't add duplicate commands for this object (ie @detach=n followed by another @detach=n later on) |
163 | BOOL fDuplicate = | 136 | bool fDuplicate = |
164 | (RLV_BHVR_UNKNOWN != rlvCmd.getBehaviourType()) | 137 | (RLV_BHVR_UNKNOWN != rlvCmd.getBehaviourType()) |
165 | ? hasBehaviour(rlvCmd.getBehaviourType(), rlvCmd.getOption()) | 138 | ? hasBehaviour(rlvCmd.getBehaviourType(), rlvCmd.getOption()) |
166 | : hasBehaviour(rlvCmd.getBehaviour(), rlvCmd.getOption()); | 139 | : hasBehaviour(rlvCmd.getBehaviour(), rlvCmd.getOption()); |
167 | if (fDuplicate) | 140 | if (fDuplicate) |
168 | return FALSE; | 141 | return false; |
169 | 142 | ||
170 | // Now that we know it's not a duplicate, add it to the end of the list | 143 | // Now that we know it's not a duplicate, add it to the end of the list |
171 | m_Commands.push_back(rlvCmd); | 144 | m_Commands.push_back(rlvCmd); |
172 | 145 | ||
173 | return TRUE; | 146 | return true; |
174 | } | 147 | } |
175 | 148 | ||
176 | BOOL RlvObject::removeCommand(const RlvCommand& rlvCmd) | 149 | bool RlvObject::removeCommand(const RlvCommand& rlvCmd) |
177 | { | 150 | { |
178 | // Sanity checking | 151 | // Sanity checking |
179 | if (RLV_TYPE_REMOVE != rlvCmd.getParamType()) | 152 | if (RLV_TYPE_REMOVE != rlvCmd.getParamType()) |
180 | return FALSE; | 153 | return false; |
181 | 154 | ||
182 | for (rlv_command_list_t::iterator itCmd = m_Commands.begin(); itCmd != m_Commands.end(); ++itCmd) | 155 | for (rlv_command_list_t::iterator itCmd = m_Commands.begin(); itCmd != m_Commands.end(); ++itCmd) |
183 | { | 156 | { |
@@ -185,42 +158,42 @@ BOOL RlvObject::removeCommand(const RlvCommand& rlvCmd) | |||
185 | if ( (itCmd->getBehaviour() == rlvCmd.getBehaviour()) && (itCmd->getOption() == rlvCmd.getOption()) ) | 158 | if ( (itCmd->getBehaviour() == rlvCmd.getBehaviour()) && (itCmd->getOption() == rlvCmd.getOption()) ) |
186 | { | 159 | { |
187 | m_Commands.erase(itCmd); | 160 | m_Commands.erase(itCmd); |
188 | return TRUE; | 161 | return true; |
189 | } | 162 | } |
190 | } | 163 | } |
191 | return FALSE; // Command was never added so nothing to remove now | 164 | return false; // Command was never added so nothing to remove now |
192 | } | 165 | } |
193 | 166 | ||
194 | BOOL RlvObject::hasBehaviour(ERlvBehaviour eBehaviour) const | 167 | bool RlvObject::hasBehaviour(ERlvBehaviour eBehaviour) const |
195 | { | 168 | { |
196 | for (rlv_command_list_t::const_iterator itCmd = m_Commands.begin(); itCmd != m_Commands.end(); ++itCmd) | 169 | for (rlv_command_list_t::const_iterator itCmd = m_Commands.begin(); itCmd != m_Commands.end(); ++itCmd) |
197 | if ( (itCmd->getBehaviourType() == eBehaviour) && (itCmd->getOption().empty()) ) | 170 | if ( (itCmd->getBehaviourType() == eBehaviour) && (itCmd->getOption().empty()) ) |
198 | return TRUE; | 171 | return true; |
199 | return FALSE; | 172 | return false; |
200 | } | 173 | } |
201 | 174 | ||
202 | BOOL RlvObject::hasBehaviour(const std::string& strBehaviour) const | 175 | bool RlvObject::hasBehaviour(const std::string& strBehaviour) const |
203 | { | 176 | { |
204 | for (rlv_command_list_t::const_iterator itCmd = m_Commands.begin(); itCmd != m_Commands.end(); ++itCmd) | 177 | for (rlv_command_list_t::const_iterator itCmd = m_Commands.begin(); itCmd != m_Commands.end(); ++itCmd) |
205 | if ( (itCmd->getBehaviour() == strBehaviour) && (itCmd->getOption().empty()) ) | 178 | if ( (itCmd->getBehaviour() == strBehaviour) && (itCmd->getOption().empty()) ) |
206 | return TRUE; | 179 | return true; |
207 | return FALSE; | 180 | return false; |
208 | } | 181 | } |
209 | 182 | ||
210 | BOOL RlvObject::hasBehaviour(ERlvBehaviour eBehaviour, const std::string& strOption) const | 183 | bool RlvObject::hasBehaviour(ERlvBehaviour eBehaviour, const std::string& strOption) const |
211 | { | 184 | { |
212 | for (rlv_command_list_t::const_iterator itCmd = m_Commands.begin(); itCmd != m_Commands.end(); ++itCmd) | 185 | for (rlv_command_list_t::const_iterator itCmd = m_Commands.begin(); itCmd != m_Commands.end(); ++itCmd) |
213 | if ( (itCmd->getBehaviourType() == eBehaviour) && (itCmd->getOption() == strOption) ) | 186 | if ( (itCmd->getBehaviourType() == eBehaviour) && (itCmd->getOption() == strOption) ) |
214 | return TRUE; | 187 | return true; |
215 | return FALSE; | 188 | return false; |
216 | } | 189 | } |
217 | 190 | ||
218 | BOOL RlvObject::hasBehaviour(const std::string& strBehaviour, const std::string& strOption) const | 191 | bool RlvObject::hasBehaviour(const std::string& strBehaviour, const std::string& strOption) const |
219 | { | 192 | { |
220 | for (rlv_command_list_t::const_iterator itCmd = m_Commands.begin(); itCmd != m_Commands.end(); ++itCmd) | 193 | for (rlv_command_list_t::const_iterator itCmd = m_Commands.begin(); itCmd != m_Commands.end(); ++itCmd) |
221 | if ( (itCmd->getBehaviour() == strBehaviour) && (itCmd->getOption() == strOption) ) | 194 | if ( (itCmd->getBehaviour() == strBehaviour) && (itCmd->getOption() == strOption) ) |
222 | return TRUE; | 195 | return true; |
223 | return FALSE; | 196 | return false; |
224 | } | 197 | } |
225 | 198 | ||
226 | // Checked: 2009-06-07 (RLVa-0.2.1c) | 199 | // Checked: 2009-06-07 (RLVa-0.2.1c) |
@@ -242,31 +215,9 @@ std::string RlvObject::getStatusString(const std::string& strMatch) const | |||
242 | return strStatus; | 215 | return strStatus; |
243 | } | 216 | } |
244 | 217 | ||
245 | // ========================================================================= | 218 | // ============================================================================ |
246 | /* | 219 | // RlvWearableItemCollector |
247 | * Various helper classes/timers/functors | 220 | // |
248 | * | ||
249 | */ | ||
250 | |||
251 | // Checked: 2009-05-26 (RLVa-0.2.0d) | Modified: RLVa-0.2.0d | ||
252 | S32 rlvGetDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType type) | ||
253 | { | ||
254 | S32 cntType = 0; | ||
255 | if (pFolder) | ||
256 | { | ||
257 | LLInventoryModel::cat_array_t* pFolders; | ||
258 | LLInventoryModel::item_array_t* pItems; | ||
259 | gInventory.getDirectDescendentsOf(pFolder->getUUID(), pFolders, pItems); | ||
260 | |||
261 | if (pItems) | ||
262 | { | ||
263 | for (S32 idxItem = 0, cntItem = pItems->count(); idxItem < cntItem; idxItem++) | ||
264 | if (pItems->get(idxItem)->getType() == type) | ||
265 | cntType++; | ||
266 | } | ||
267 | } | ||
268 | return cntType; | ||
269 | } | ||
270 | 221 | ||
271 | // Checked: 2009-05-30 (RLVa-0.2.0e) | Added: RLVa-0.2.0e | 222 | // Checked: 2009-05-30 (RLVa-0.2.0e) | Added: RLVa-0.2.0e |
272 | const LLUUID& RlvWearableItemCollector::getFoldedParent(const LLUUID& idFolder) const | 223 | const LLUUID& RlvWearableItemCollector::getFoldedParent(const LLUUID& idFolder) const |
@@ -365,56 +316,72 @@ bool RlvWearableItemCollector::operator()(LLInventoryCategory* pFolder, LLInvent | |||
365 | return (pFolder) ? onCollectFolder(pFolder) : ( (pItem) ? onCollectItem(pItem) : false ); | 316 | return (pFolder) ? onCollectFolder(pFolder) : ( (pItem) ? onCollectItem(pItem) : false ); |
366 | } | 317 | } |
367 | 318 | ||
368 | // Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0f | 319 | // ============================================================================ |
369 | bool RlvSelectHasLockedAttach::apply(LLSelectNode* pNode) | 320 | // RlvWLSnapshot |
370 | { | 321 | // |
371 | return (pNode->getObject()) ? !gRlvHandler.isDetachable(pNode->getObject()) : false; | ||
372 | } | ||
373 | |||
374 | // Checked: 2009-07-05 (RLVa-1.0.0b) | Modified: RLVa-0.2.0f | ||
375 | bool RlvSelectIsOwnedByOrGroupOwned::apply(LLSelectNode* pNode) | ||
376 | { | ||
377 | return (pNode->mPermissions->isGroupOwned()) || (pNode->mPermissions->getOwner() == m_idAgent); | ||
378 | } | ||
379 | 322 | ||
380 | // Checked: 2009-05-31 (RLVa-0.2.0f) | Modified: RLVa-0.2.0f | 323 | // Checked: 2009-06-03 (RLVa-0.2.0h) | Added: RLVa-0.2.0h |
381 | bool RlvSelectIsSittingOn::apply(LLSelectNode* pNode) | 324 | void RlvWLSnapshot::restoreSnapshot(const RlvWLSnapshot* pWLSnapshot) |
382 | { | 325 | { |
383 | return (pNode->getObject()) && (pNode->getObject()->getRootEdit() == m_pObject); | 326 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); |
327 | if ( (pWLSnapshot) && (pWLParams) ) | ||
328 | { | ||
329 | pWLParams->mAnimator.mIsRunning = pWLSnapshot->fIsRunning; | ||
330 | pWLParams->mAnimator.mUseLindenTime = pWLSnapshot->fUseLindenTime; | ||
331 | pWLParams->mCurParams = pWLSnapshot->WLParams; | ||
332 | pWLParams->propagateParameters(); | ||
333 | } | ||
384 | } | 334 | } |
385 | 335 | ||
386 | // Checked: 2009-07-05 (RLVa-1.0.0b) | Modified: RLVa-0.2.0g | 336 | // Checked: 2009-09-16 (RLVa-1.0.3c) | Modified: RLVa-1.0.3c |
387 | bool rlvCanDeleteOrReturn() | 337 | RlvWLSnapshot* RlvWLSnapshot::takeSnapshot() |
388 | { | 338 | { |
389 | bool fIsAllowed = true; | 339 | // HACK: see RlvExtGetSet::onGetEnv |
390 | 340 | if (!LLFloaterWindLight::isOpen()) | |
391 | if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) | ||
392 | { | 341 | { |
393 | // We'll allow if none of the prims are owned by the avie or group owned | 342 | LLFloaterWindLight::instance()->close(); |
394 | LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); | 343 | LLFloaterWindLight::instance()->syncMenu(); |
395 | RlvSelectIsOwnedByOrGroupOwned func(gAgent.getID()); | ||
396 | if ( (handleSel.notNull()) && ((0 == handleSel->getRootObjectCount()) || (NULL != handleSel->getFirstRootNode(&func, FALSE))) ) | ||
397 | fIsAllowed = false; | ||
398 | } | 344 | } |
399 | 345 | ||
400 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) ) | 346 | RlvWLSnapshot* pWLSnapshot = NULL; |
347 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); | ||
348 | if (pWLParams) | ||
401 | { | 349 | { |
402 | // We'll allow if the avie isn't sitting on any of the selected objects | 350 | pWLSnapshot = new RlvWLSnapshot(); |
403 | LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); | 351 | pWLSnapshot->fIsRunning = pWLParams->mAnimator.mIsRunning; |
404 | RlvSelectIsSittingOn func(gAgent.getAvatarObject()->getRoot()); | 352 | pWLSnapshot->fUseLindenTime = pWLParams->mAnimator.mUseLindenTime; |
405 | if ( (handleSel.notNull()) && (handleSel->getFirstRootNode(&func, TRUE)) ) | 353 | pWLSnapshot->WLParams = pWLParams->mCurParams; |
406 | fIsAllowed = false; | ||
407 | } | 354 | } |
408 | 355 | return pWLSnapshot; | |
409 | return fIsAllowed; | ||
410 | } | 356 | } |
411 | 357 | ||
412 | // Checked: 2009-09-08 (RLVa-1.0.2c) | Modified: RLVa-1.0.2c | 358 | // ========================================================================= |
413 | BOOL rlvAttachToEnabler(void* pParam) | 359 | // RlvSettings |
414 | { | 360 | // |
415 | // Enables/disables an option on the "Attach to (HUD)" submenu depending on whether it is (un)detachable | 361 | |
416 | return gRlvHandler.isDetachable((LLViewerJointAttachment*)pParam); | 362 | BOOL RlvSettings::fShowNameTags = FALSE; |
417 | } | 363 | |
364 | #ifdef RLV_EXTENSION_STARTLOCATION | ||
365 | // Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.1d | ||
366 | void RlvSettings::updateLoginLastLocation() | ||
367 | { | ||
368 | if (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) | ||
369 | { | ||
370 | BOOL fValue = (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) || | ||
371 | ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && | ||
372 | (gAgent.getAvatarObject()) && (!gAgent.getAvatarObject()->mIsSitting) ); | ||
373 | if (gSavedPerAccountSettings.getBOOL(RLV_SETTING_LOGINLASTLOCATION) != fValue) | ||
374 | { | ||
375 | gSavedPerAccountSettings.setBOOL(RLV_SETTING_LOGINLASTLOCATION, fValue); | ||
376 | gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); | ||
377 | } | ||
378 | } | ||
379 | } | ||
380 | #endif // RLV_EXTENSION_STARTLOCATION | ||
381 | |||
382 | // ========================================================================= | ||
383 | // Various helper classes/timers/functors | ||
384 | // | ||
418 | 385 | ||
419 | BOOL RlvGCTimer::tick() | 386 | BOOL RlvGCTimer::tick() |
420 | { | 387 | { |
@@ -453,63 +420,84 @@ void RlvCurrentlyWorn::fetchWorn() | |||
453 | f.fetchItems(idItems); | 420 | f.fetchItems(idItems); |
454 | } | 421 | } |
455 | 422 | ||
456 | // ========================================================================= | 423 | // Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-0.2.0f |
424 | bool RlvSelectHasLockedAttach::apply(LLSelectNode* pNode) | ||
425 | { | ||
426 | return (pNode->getObject()) ? !gRlvHandler.isDetachable(pNode->getObject()) : false; | ||
427 | } | ||
457 | 428 | ||
458 | // Checked: 2009-06-03 (RLVa-0.2.0h) | Added: RLVa-0.2.0h | 429 | // Checked: 2009-07-05 (RLVa-1.0.0b) | Modified: RLVa-0.2.0f |
459 | void RlvWLSnapshot::restoreSnapshot(const RlvWLSnapshot* pWLSnapshot) | 430 | bool RlvSelectIsOwnedByOrGroupOwned::apply(LLSelectNode* pNode) |
460 | { | 431 | { |
461 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); | 432 | return (pNode->mPermissions->isGroupOwned()) || (pNode->mPermissions->getOwner() == m_idAgent); |
462 | if ( (pWLSnapshot) && (pWLParams) ) | ||
463 | { | ||
464 | pWLParams->mAnimator.mIsRunning = pWLSnapshot->fIsRunning; | ||
465 | pWLParams->mAnimator.mUseLindenTime = pWLSnapshot->fUseLindenTime; | ||
466 | pWLParams->mCurParams = pWLSnapshot->WLParams; | ||
467 | pWLParams->propagateParameters(); | ||
468 | } | ||
469 | } | 433 | } |
470 | 434 | ||
471 | // Checked: 2009-06-03 (RLVa-0.2.0h) | Added: RLVa-0.2.0h | 435 | // Checked: 2009-05-31 (RLVa-0.2.0f) | Modified: RLVa-0.2.0f |
472 | RlvWLSnapshot* RlvWLSnapshot::takeSnapshot() | 436 | bool RlvSelectIsSittingOn::apply(LLSelectNode* pNode) |
473 | { | 437 | { |
474 | RlvWLSnapshot* pWLSnapshot = NULL; | 438 | return (pNode->getObject()) && (pNode->getObject()->getRootEdit() == m_pObject); |
475 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); | 439 | } |
476 | if (pWLParams) | 440 | |
441 | // ============================================================================ | ||
442 | // Various helper functions | ||
443 | // | ||
444 | |||
445 | // Checked: 2009-09-08 (RLVa-1.0.2c) | Modified: RLVa-1.0.2c | ||
446 | BOOL rlvAttachToEnabler(void* pParam) | ||
447 | { | ||
448 | // Enables/disables an option on the "Attach to (HUD)" submenu depending on whether it is (un)detachable | ||
449 | return gRlvHandler.isDetachable((LLViewerJointAttachment*)pParam); | ||
450 | } | ||
451 | |||
452 | // Checked: 2009-07-05 (RLVa-1.0.0b) | Modified: RLVa-0.2.0g | ||
453 | bool rlvCanDeleteOrReturn() | ||
454 | { | ||
455 | bool fIsAllowed = true; | ||
456 | |||
457 | if (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) | ||
477 | { | 458 | { |
478 | pWLSnapshot = new RlvWLSnapshot(); | 459 | // We'll allow if none of the prims are owned by the avie or group owned |
479 | pWLSnapshot->fIsRunning = pWLParams->mAnimator.mIsRunning; | 460 | LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); |
480 | pWLSnapshot->fUseLindenTime = pWLParams->mAnimator.mUseLindenTime; | 461 | RlvSelectIsOwnedByOrGroupOwned func(gAgent.getID()); |
481 | pWLSnapshot->WLParams = pWLParams->mCurParams; | 462 | if ( (handleSel.notNull()) && ((0 == handleSel->getRootObjectCount()) || (NULL != handleSel->getFirstRootNode(&func, FALSE))) ) |
463 | fIsAllowed = false; | ||
482 | } | 464 | } |
483 | return pWLSnapshot; | ||
484 | } | ||
485 | 465 | ||
486 | // ========================================================================= | 466 | if ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (gAgent.getAvatarObject()) ) |
467 | { | ||
468 | // We'll allow if the avie isn't sitting on any of the selected objects | ||
469 | LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); | ||
470 | RlvSelectIsSittingOn func(gAgent.getAvatarObject()->getRoot()); | ||
471 | if ( (handleSel.notNull()) && (handleSel->getFirstRootNode(&func, TRUE)) ) | ||
472 | fIsAllowed = false; | ||
473 | } | ||
487 | 474 | ||
488 | BOOL RlvSettings::fShowNameTags = FALSE; | 475 | return fIsAllowed; |
476 | } | ||
489 | 477 | ||
490 | #ifdef RLV_EXTENSION_STARTLOCATION | 478 | // Checked: 2009-05-26 (RLVa-0.2.0d) | Modified: RLVa-0.2.0d |
491 | // Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.1d | 479 | S32 rlvGetDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType type) |
492 | void RlvSettings::updateLoginLastLocation() | 480 | { |
481 | S32 cntType = 0; | ||
482 | if (pFolder) | ||
493 | { | 483 | { |
494 | if (gSavedPerAccountSettings.controlExists(RLV_SETTING_LOGINLASTLOCATION)) | 484 | LLInventoryModel::cat_array_t* pFolders; |
485 | LLInventoryModel::item_array_t* pItems; | ||
486 | gInventory.getDirectDescendentsOf(pFolder->getUUID(), pFolders, pItems); | ||
487 | |||
488 | if (pItems) | ||
495 | { | 489 | { |
496 | BOOL fValue = (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) || | 490 | for (S32 idxItem = 0, cntItem = pItems->count(); idxItem < cntItem; idxItem++) |
497 | ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && | 491 | if (pItems->get(idxItem)->getType() == type) |
498 | (gAgent.getAvatarObject()) && (!gAgent.getAvatarObject()->mIsSitting) ); | 492 | cntType++; |
499 | if (gSavedPerAccountSettings.getBOOL(RLV_SETTING_LOGINLASTLOCATION) != fValue) | ||
500 | { | ||
501 | gSavedPerAccountSettings.setBOOL(RLV_SETTING_LOGINLASTLOCATION, fValue); | ||
502 | gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); | ||
503 | } | ||
504 | } | 493 | } |
505 | } | 494 | } |
506 | #endif // RLV_EXTENSION_STARTLOCATION | 495 | return cntType; |
507 | 496 | } | |
508 | // ========================================================================= | ||
509 | 497 | ||
510 | #ifdef RLV_ADVANCED_TOGGLE_RLVA | 498 | #ifdef RLV_ADVANCED_TOGGLE_RLVA |
511 | // Checked: 2009-07-12 (RLVa-1.0.0h) | Modified: RLVa-1.0.0h | 499 | // Checked: 2009-07-12 (RLVa-1.0.0h) | Modified: RLVa-1.0.0h |
512 | void rlvDbgToggleEnabled(void*) | 500 | void rlvToggleEnabled(void*) |
513 | { | 501 | { |
514 | gSavedSettings.setBOOL(RLV_SETTING_MAIN, !rlv_handler_t::isEnabled()); | 502 | gSavedSettings.setBOOL(RLV_SETTING_MAIN, !rlv_handler_t::isEnabled()); |
515 | 503 | ||
@@ -526,7 +514,7 @@ BOOL RlvSettings::fShowNameTags = FALSE; | |||
526 | #endif | 514 | #endif |
527 | } | 515 | } |
528 | // Checked: 2009-07-08 (RLVa-1.0.0e) | 516 | // Checked: 2009-07-08 (RLVa-1.0.0e) |
529 | BOOL rlvDbgGetEnabled(void*) | 517 | BOOL rlvGetEnabled(void*) |
530 | { | 518 | { |
531 | return rlv_handler_t::isEnabled(); | 519 | return rlv_handler_t::isEnabled(); |
532 | } | 520 | } |
@@ -568,7 +556,7 @@ void rlvSendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLU | |||
568 | // Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e | 556 | // Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e |
569 | bool rlvSendChatReply(S32 nChannel, const std::string& strReply) | 557 | bool rlvSendChatReply(S32 nChannel, const std::string& strReply) |
570 | { | 558 | { |
571 | if (!rlvIsValidChannel(nChannel)) | 559 | if (!rlvIsValidReplyChannel(nChannel)) |
572 | return false; | 560 | return false; |
573 | 561 | ||
574 | // Copy/paste from send_chat_from_viewer() | 562 | // Copy/paste from send_chat_from_viewer() |
diff --git a/linden/indra/newview/rlvhelper.h b/linden/indra/newview/rlvhelper.h index 9ceb799..f36989b 100644 --- a/linden/indra/newview/rlvhelper.h +++ b/linden/indra/newview/rlvhelper.h | |||
@@ -7,266 +7,87 @@ | |||
7 | #include "llviewercontrol.h" | 7 | #include "llviewercontrol.h" |
8 | #include "llviewerobjectlist.h" | 8 | #include "llviewerobjectlist.h" |
9 | #include "llwlparamset.h" | 9 | #include "llwlparamset.h" |
10 | 10 | #include "rlvdefines.h" | |
11 | #include "rlvmultistringsearch.h" | ||
12 | |||
13 | // ============================================================================ | ||
14 | // Extensions | ||
15 | // | ||
16 | |||
17 | // Comment out if you don't want the Advanced / RLVa menu (may prevent enabling some extensions or experimental features - see below) | ||
18 | #define RLV_ADVANCED_MENU | ||
19 | // Comment out if you provide your own way to enable/disable RLVa | ||
20 | #define RLV_ADVANCED_TOGGLE_RLVA | ||
21 | |||
22 | // Provides access to "advanced" feature through the RLVa debug menu | ||
23 | #define RLV_EXTENSION_ENABLE_WEAR // "Enable Wear" | ||
24 | #define RLV_EXTENSION_HIDELOCKED // "Hide locked layers", "Hide locked attachments" and "Hide locked inventory" | ||
25 | #define RLV_EXTENSION_FLOATER_RESTRICTIONS // Enables the Advanced / RLVa / Restrictions... floater | ||
26 | |||
27 | // Extensions | ||
28 | #define RLV_EXTENSION_CMD_GETSETDEBUG_EX // Extends the debug variables accessible through @getdebug_xxx/@setdebug_xxx | ||
29 | #define RLV_EXTENSION_CMD_FINDFOLDERS // @findfolders:<option>=<channel> - @findfolder with multiple results | ||
30 | #define RLV_EXTENSION_FLAG_NOSTRIP // Layers and attachments marked as "nostrip" are exempt from @detach/@remoutfit | ||
31 | #define RLV_EXTENSION_STARTLOCATION // Reenables "Start Location" at login if not @tploc=n or @unsit=n restricted at last logoff | ||
32 | #define RLV_EXPERIMENTAL // Enables/disables experimental features en masse | ||
33 | |||
34 | // Experimental features | ||
35 | #ifdef RLV_EXPERIMENTAL | ||
36 | // Stable (will mature to RLV_EXTENSION_XXX in next release if no bugs are found) | ||
37 | #define RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK // Enables "cleaner" UI responses when fartouch blocks something | ||
38 | |||
39 | // Under testing (stable, but requires further testing - safe for public release but may be quirky) | ||
40 | |||
41 | // Under development (don't include in public release) | ||
42 | #if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG | ||
43 | #endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG | ||
44 | #endif // RLV_EXPERIMENTAL | ||
45 | |||
46 | // ============================================================================ | ||
47 | // Defines | ||
48 | // | ||
49 | |||
50 | // Version of the specifcation we support | ||
51 | const S32 RLV_VERSION_MAJOR = 1; | ||
52 | const S32 RLV_VERSION_MINOR = 20; | ||
53 | const S32 RLV_VERSION_PATCH = 0; | ||
54 | |||
55 | // Implementation version | ||
56 | const S32 RLVa_VERSION_MAJOR = 1; | ||
57 | const S32 RLVa_VERSION_MINOR = 0; | ||
58 | const S32 RLVa_VERSION_PATCH = 2; | ||
59 | const S32 RLVa_VERSION_BUILD = 2; | ||
60 | |||
61 | // The official viewer version we're patching against | ||
62 | #define RLV_MAKE_TARGET(x, y, z) ((x << 16) | (y << 8) | z) | ||
63 | #define RLV_TARGET RLV_MAKE_TARGET(1, 22, 11) | ||
64 | |||
65 | // Defining these makes it easier if we ever need to change our tag | ||
66 | #define RLV_WARNS LL_WARNS("RLV") | ||
67 | #define RLV_INFOS LL_INFOS("RLV") | ||
68 | #define RLV_DEBUGS LL_DEBUGS("RLV") | ||
69 | |||
70 | #if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG | ||
71 | // Turn on extended debugging information | ||
72 | #define RLV_DEBUG | ||
73 | // Make sure we halt execution on errors | ||
74 | #define RLV_ERRS LL_ERRS("RLV") | ||
75 | // Uncomment to enable the Advanced / RLVa / Unit Tests menu (non-public) | ||
76 | //#define RLV_DEBUG_TESTS | ||
77 | #else | ||
78 | // Uncomment if you want extended debugging information on release builds | ||
79 | //#define RLV_DEBUG | ||
80 | // Don't halt execution on errors in release | ||
81 | #define RLV_ERRS LL_WARNS("RLV") | ||
82 | #endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG | ||
83 | |||
84 | #define RLV_ROOT_FOLDER "#RLV" | ||
85 | #define RLV_CMD_PREFIX '@' | ||
86 | #define RLV_PUTINV_PREFIX "#RLV/~" | ||
87 | #define RLV_SETROT_OFFSET F_PI_BY_TWO // @setrot is off by 90° with the rest of SL | ||
88 | |||
89 | #define RLV_FOLDER_FLAG_NOSTRIP "nostrip" | ||
90 | #define RLV_FOLDER_PREFIX_HIDDEN '.' | ||
91 | #define RLV_FOLDER_PREFIX_PUTINV '~' | ||
92 | 11 | ||
93 | // ============================================================================ | 12 | // ============================================================================ |
94 | // Enumeration declarations | 13 | // RlvCommand |
95 | // | 14 | // |
96 | 15 | ||
97 | // NOTE: * any changes to this enumeration should be reflected in initLookupTable() | ||
98 | // * only uncomment the ones we actually use in a switch() to keep the size of the lookup table down | ||
99 | enum ERlvBehaviour { | ||
100 | RLV_BHVR_VERSION = 0, // "version" | ||
101 | RLV_BHVR_DETACH, // "detach" | ||
102 | // RLV_BHVR_SENDCHAT, // "sendchat" | ||
103 | // RLV_BHVR_EMOTE, // "emote" | ||
104 | // RLV_BHVR_CHATSHOUT, // "chatshout" | ||
105 | // RLV_BHVR_CHATNORMAL, // "chatnormal" | ||
106 | // RLV_BHVR_CHATWHISPER, // "chatwhisper" | ||
107 | RLV_BHVR_REDIRCHAT, // "redirchat" | ||
108 | RLV_BHVR_REDIREMOTE, // "rediremote" | ||
109 | RLV_BHVR_SENDIM, // "sendim" | ||
110 | RLV_BHVR_RECVCHAT, // "recvchat" | ||
111 | RLV_BHVR_RECVEMOTE, // "recvemote" | ||
112 | RLV_BHVR_RECVIM, // "recvim" | ||
113 | // RLV_BHVR_TPLM, // "tplm" | ||
114 | RLV_BHVR_TPLOC, // "tploc" | ||
115 | RLV_BHVR_TPLURE, // "tplure" | ||
116 | RLV_BHVR_SITTP, // "sittp" | ||
117 | // RLV_BHVR_CLEAR, // "clear" | ||
118 | RLV_BHVR_EDIT, // "edit" | ||
119 | RLV_BHVR_REZ, // "rez" | ||
120 | RLV_BHVR_ADDOUTFIT, // "addoutfit" | ||
121 | RLV_BHVR_REMOUTFIT, // "remoutfit" | ||
122 | RLV_BHVR_GETOUTFIT, // "getoutfit" | ||
123 | RLV_BHVR_GETATTACH, // "getattach" | ||
124 | RLV_BHVR_SHOWINV, // "showinv" | ||
125 | // RLV_BHVR_VIEWNOTE, // "viewnote" | ||
126 | RLV_BHVR_UNSIT, // "unsit" | ||
127 | RLV_BHVR_SIT, // "sit" | ||
128 | // RLV_BHVR_SENDCHANNEL, // "sendchannel" | ||
129 | RLV_BHVR_GETSTATUS, // "getstatus" | ||
130 | RLV_BHVR_GETSTATUSALL, // "getstatusall" | ||
131 | RLV_BHVR_GETINV, // "getinv" | ||
132 | RLV_BHVR_GETINVWORN, // "getinvworn" | ||
133 | RLV_BHVR_FINDFOLDER, // "findfolder" | ||
134 | RLV_BHVR_FINDFOLDERS, // "findfolders" | ||
135 | RLV_BHVR_ATTACH, // "attach" | ||
136 | RLV_BHVR_ATTACHALL, // "attachall" | ||
137 | RLV_BHVR_DETACHALL, // "detachall" | ||
138 | RLV_BHVR_GETPATH, // "getpath" | ||
139 | RLV_BHVR_ATTACHTHIS, // "attachthis" | ||
140 | RLV_BHVR_ATTACHALLTHIS, // "attachallthis" | ||
141 | RLV_BHVR_DETACHTHIS, // "detachthis" | ||
142 | RLV_BHVR_DETACHALLTHIS, // "detachallthis" | ||
143 | RLV_BHVR_FARTOUCH, // "fartouch" | ||
144 | RLV_BHVR_SHOWWORLDMAP, // "showworldmap" | ||
145 | RLV_BHVR_SHOWMINIMAP, // "showminimap" | ||
146 | RLV_BHVR_SHOWLOC, // "showloc" | ||
147 | RLV_BHVR_TPTO, // "tpto" | ||
148 | RLV_BHVR_ACCEPTTP, // "accepttp" | ||
149 | RLV_BHVR_SHOWNAMES, // "shownames" | ||
150 | RLV_BHVR_FLY, // "fly" | ||
151 | RLV_BHVR_GETSITID, // "getsitid" | ||
152 | RLV_BHVR_SETDEBUG, // "setdebug" | ||
153 | RLV_BHVR_SETENV, // "setenv" | ||
154 | RLV_BHVR_DETACHME, // "detachme" | ||
155 | RLV_BHVR_SHOWHOVERTEXTALL, // "showhovertextall" | ||
156 | RLV_BHVR_SHOWHOVERTEXTWORLD, // "showhovertextworld" | ||
157 | RLV_BHVR_SHOWHOVERTEXTHUD, // "showhovertexthud" | ||
158 | RLV_BHVR_SHOWHOVERTEXT, // "showhovertext" | ||
159 | RLV_BHVR_NOTIFY, // "notify" | ||
160 | |||
161 | RLV_BHVR_COUNT, | ||
162 | RLV_BHVR_UNKNOWN | ||
163 | }; | ||
164 | |||
165 | enum ERlvParamType { | ||
166 | RLV_TYPE_UNKNOWN, | ||
167 | RLV_TYPE_ADD, // <param> == "n"|"add" | ||
168 | RLV_TYPE_REMOVE, // <param> == "y"|"rem" | ||
169 | RLV_TYPE_FORCE, // <param> == "force" | ||
170 | RLV_TYPE_REPLY // <param> == <number> | ||
171 | }; | ||
172 | |||
173 | enum ERlvCmdRet { | ||
174 | RLV_RET_NOERROR, // Command executed succesfully | ||
175 | RLV_RET_RETAINED, // Command was retained | ||
176 | RLV_RET_FAILED, // Command failed (general failure) | ||
177 | RLV_RET_FAILED_SYNTAX, // Command failed (syntax error) | ||
178 | RLV_RET_FAILED_UNSET, // Command failed (unset restriction) | ||
179 | RLV_RET_FAILED_DUPLICATE, // Command failed (duplicate) | ||
180 | RLV_RET_FAILED_OPTION, // Command failed (invalid option) | ||
181 | RLV_RET_UNKNOWN // Command unkown | ||
182 | }; | ||
183 | |||
184 | // ============================================================================ | ||
185 | /* | ||
186 | * RlvCommand | ||
187 | * ========== | ||
188 | * Encapsulates an "RLV command" (duh :p) | ||
189 | * | ||
190 | */ | ||
191 | |||
192 | class RlvCommand | 16 | class RlvCommand |
193 | { | 17 | { |
194 | public: | 18 | public: |
195 | /* | ||
196 | * Constructors | ||
197 | */ | ||
198 | explicit RlvCommand(const std::string& strCommand); | 19 | explicit RlvCommand(const std::string& strCommand); |
199 | RlvCommand(const RlvCommand& rlvCmd); | ||
200 | 20 | ||
201 | /* | 21 | /* |
202 | * Accessors | 22 | * Member functions |
203 | */ | 23 | */ |
204 | BOOL isValid() const { return m_fValid; } | 24 | public: |
25 | std::string asString() const; | ||
26 | const std::string& getBehaviour() const { return m_strBehaviour; } | ||
27 | ERlvBehaviour getBehaviourType() const { return m_eBehaviour; } | ||
28 | const std::string& getOption() const { return m_strOption; } | ||
29 | const std::string& getParam() const { return m_strParam; } | ||
30 | ERlvParamType getParamType() const { return m_eParamType; } | ||
31 | bool isValid() const { return m_fValid; } | ||
205 | 32 | ||
206 | const std::string& getBehaviour() const { return m_strBehaviour; } | 33 | static ERlvBehaviour getBehaviourFromString(const std::string& strBhvr); |
207 | ERlvBehaviour getBehaviourType() const { return m_eBehaviour; } | 34 | static const std::string& getStringFromBehaviour(ERlvBehaviour eBhvr); |
208 | const std::string& getOption() const { return m_strOption; } | ||
209 | const std::string& getParam() const { return m_strParam; } | ||
210 | ERlvParamType getParamType() const { return m_eParamType; } | ||
211 | 35 | ||
212 | std::string asString() const; | 36 | static void initLookupTable(); |
37 | protected: | ||
38 | static bool parseCommand(const std::string& strCommand, std::string& strBehaviour, std::string& strOption, std::string& strParam); | ||
213 | 39 | ||
214 | /* | 40 | /* |
215 | * Operators | 41 | * Operators |
216 | */ | 42 | */ |
43 | public: | ||
217 | bool operator ==(const RlvCommand&) const; | 44 | bool operator ==(const RlvCommand&) const; |
218 | 45 | ||
219 | // Parses an RLV command into its "tokens" | ||
220 | static BOOL parseCommand(/*[in]*/ const std::string& strCommand, | ||
221 | /*[out]*/ std::string& strBehaviour, /*[out]*/ std::string& strOption, /*[out]*/ std::string& strParam); | ||
222 | static void initLookupTable(); | ||
223 | |||
224 | /* | 46 | /* |
225 | * Member variables | 47 | * Member variables |
226 | */ | 48 | */ |
227 | protected: | 49 | protected: |
228 | BOOL m_fValid; | 50 | bool m_fValid; |
229 | std::string m_strBehaviour; | 51 | std::string m_strBehaviour; |
230 | ERlvBehaviour m_eBehaviour; | 52 | ERlvBehaviour m_eBehaviour; |
231 | std::string m_strOption; | 53 | std::string m_strOption; |
232 | std::string m_strParam; | 54 | std::string m_strParam; |
233 | ERlvParamType m_eParamType; | 55 | ERlvParamType m_eParamType; |
234 | 56 | ||
235 | static RlvMultiStringSearch m_BhvrLookup; | 57 | typedef std::map<std::string, ERlvBehaviour> RlvBhvrTable; |
58 | static RlvBhvrTable m_BhvrMap; | ||
59 | |||
236 | friend class RlvHandler; | 60 | friend class RlvHandler; |
237 | }; | 61 | }; |
62 | typedef std::list<RlvCommand> rlv_command_list_t; | ||
238 | 63 | ||
239 | // ============================================================================ | 64 | // ============================================================================ |
240 | /* | 65 | // RlvObject |
241 | * RlvObject | 66 | // |
242 | * ========= | ||
243 | * Encapsulates an "RLV Object" (= an object that has issued an RLV command) | ||
244 | * | ||
245 | */ | ||
246 | |||
247 | typedef std::list<RlvCommand> rlv_command_list_t; | ||
248 | 67 | ||
249 | class RlvObject | 68 | class RlvObject |
250 | { | 69 | { |
251 | public: | 70 | public: |
252 | RlvObject(const LLUUID& uuid) : m_UUID(uuid), m_nLookupMisses(0) | 71 | RlvObject(const LLUUID& idObj); |
253 | { | ||
254 | LLViewerObject* pObj = gObjectList.findObject(uuid); | ||
255 | m_fLookup = (NULL != pObj); | ||
256 | m_idxAttachPt = (pObj) ? ATTACHMENT_ID_FROM_STATE(pObj->getState()) : 0; | ||
257 | } | ||
258 | |||
259 | BOOL addCommand(const RlvCommand& rlvCmd); | ||
260 | BOOL removeCommand(const RlvCommand& rlvCmd); | ||
261 | 72 | ||
262 | BOOL hasBehaviour(ERlvBehaviour eBehaviour) const; | 73 | /* |
263 | BOOL hasBehaviour(const std::string& strBehaviour) const; | 74 | * Member functions |
264 | BOOL hasBehaviour(ERlvBehaviour eBehaviour, const std::string& strOption) const; | 75 | */ |
265 | BOOL hasBehaviour(const std::string& strBehaviour, const std::string& strOption) const; | 76 | public: |
77 | bool addCommand(const RlvCommand& rlvCmd); | ||
78 | bool removeCommand(const RlvCommand& rlvCmd); | ||
266 | 79 | ||
267 | std::string getStatusString(const std::string& strMatch) const; | 80 | std::string getStatusString(const std::string& strMatch) const; |
81 | bool hasBehaviour(ERlvBehaviour eBehaviour) const; | ||
82 | bool hasBehaviour(const std::string& strBehaviour) const; | ||
83 | bool hasBehaviour(ERlvBehaviour eBehaviour, const std::string& strOption) const; | ||
84 | bool hasBehaviour(const std::string& strBehaviour, const std::string& strOption) const; | ||
268 | 85 | ||
269 | const rlv_command_list_t* getCommandList() const { return &m_Commands; } | 86 | const rlv_command_list_t* getCommandList() const { return &m_Commands; } |
87 | |||
88 | /* | ||
89 | * Member variables | ||
90 | */ | ||
270 | protected: | 91 | protected: |
271 | LLUUID m_UUID; // The object's UUID | 92 | LLUUID m_UUID; // The object's UUID |
272 | S32 m_idxAttachPt; // The object's attachment point (or 0 if it's not an attachment) | 93 | S32 m_idxAttachPt; // The object's attachment point (or 0 if it's not an attachment) |
@@ -278,12 +99,8 @@ protected: | |||
278 | }; | 99 | }; |
279 | 100 | ||
280 | // ============================================================================ | 101 | // ============================================================================ |
281 | /* | 102 | // RlvCriteriaCategoryCollector - Criteria based folder matching filter used by @findfolder and @findfolders |
282 | * RlvCriteriaCategoryCollector | 103 | // |
283 | * ============================ | ||
284 | * Criteria based folder matching filter used by @findfolder and @findfolders | ||
285 | * | ||
286 | */ | ||
287 | 104 | ||
288 | class RlvCriteriaCategoryCollector : public LLInventoryCollectFunctor | 105 | class RlvCriteriaCategoryCollector : public LLInventoryCollectFunctor |
289 | { | 106 | { |
@@ -325,12 +142,8 @@ protected: | |||
325 | }; | 142 | }; |
326 | 143 | ||
327 | // ============================================================================ | 144 | // ============================================================================ |
328 | /* | 145 | // RlvWearableItemCollector - Inventory item filter used by attach/detach/attachall/detachall/getinvworn |
329 | * RlvWearableItemCollector | 146 | // |
330 | * ======================== | ||
331 | * Inventory item filter used by attach/detach/attachall/detachall/getinvworn | ||
332 | * | ||
333 | */ | ||
334 | 147 | ||
335 | class RlvWearableItemCollector : public LLInventoryCollectFunctor | 148 | class RlvWearableItemCollector : public LLInventoryCollectFunctor |
336 | { | 149 | { |
@@ -397,19 +210,6 @@ private: | |||
397 | // RlvSettings | 210 | // RlvSettings |
398 | // | 211 | // |
399 | 212 | ||
400 | #define RLV_SETTING_MAIN "RestrainedLife" | ||
401 | #define RLV_SETTING_DEBUG "RestrainedLifeDebug" | ||
402 | #define RLV_SETTING_NOSETENV "RestrainedLifeNoSetEnv" | ||
403 | #define RLV_SETTING_FORBIDGIVETORLV "RestrainedLifeForbidGiveToRLV" | ||
404 | |||
405 | #define RLV_SETTING_ENABLEWEAR "RLVaEnableWear" | ||
406 | #define RLV_SETTING_ENABLELEGACYNAMING "RLVaEnableLegacyNaming" | ||
407 | #define RLV_SETTING_HIDELOCKEDLAYER "RLVaHideLockedLayers" | ||
408 | #define RLV_SETTING_HIDELOCKEDATTACH "RLVaHideLockedAttachments" | ||
409 | #define RLV_SETTING_HIDELOCKEDINVENTORY "RLVaHideLockedInventory" | ||
410 | #define RLV_SETTING_LOGINLASTLOCATION "RLVaLoginLastLocation" | ||
411 | #define RLV_SETTING_SHOWNAMETAGS "RLVaShowNameTags" | ||
412 | |||
413 | inline BOOL rlvGetSettingBOOL(const std::string& strSetting, BOOL fDefault) | 213 | inline BOOL rlvGetSettingBOOL(const std::string& strSetting, BOOL fDefault) |
414 | { | 214 | { |
415 | return (gSavedSettings.controlExists(strSetting)) ? gSavedSettings.getBOOL(strSetting) : fDefault; | 215 | return (gSavedSettings.controlExists(strSetting)) ? gSavedSettings.getBOOL(strSetting) : fDefault; |
@@ -429,6 +229,7 @@ public: | |||
429 | static BOOL getHideLockedLayers() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDLAYER, FALSE); } | 229 | static BOOL getHideLockedLayers() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDLAYER, FALSE); } |
430 | static BOOL getHideLockedAttach() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDATTACH, FALSE); } | 230 | static BOOL getHideLockedAttach() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDATTACH, FALSE); } |
431 | static BOOL getHideLockedInventory() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDINVENTORY, FALSE); } | 231 | static BOOL getHideLockedInventory() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDINVENTORY, FALSE); } |
232 | static BOOL getShowNameTags() { return fShowNameTags; } | ||
432 | 233 | ||
433 | #ifdef RLV_EXTENSION_STARTLOCATION | 234 | #ifdef RLV_EXTENSION_STARTLOCATION |
434 | static BOOL getLoginLastLocation() { return rlvGetPerUserSettingsBOOL(RLV_SETTING_LOGINLASTLOCATION, TRUE); } | 235 | static BOOL getLoginLastLocation() { return rlvGetPerUserSettingsBOOL(RLV_SETTING_LOGINLASTLOCATION, TRUE); } |
@@ -442,24 +243,6 @@ public: | |||
442 | // State keeping classes/structure | 243 | // State keeping classes/structure |
443 | // | 244 | // |
444 | 245 | ||
445 | struct RlvRedirInfo | ||
446 | { | ||
447 | S16 nRedirChat; | ||
448 | S16 nRedirEmote; | ||
449 | |||
450 | RlvRedirInfo() : nRedirChat(0), nRedirEmote(0) {} | ||
451 | bool isActive() { return (nRedirChat + nRedirEmote) != 0; } | ||
452 | }; | ||
453 | |||
454 | struct RlvReattachInfo | ||
455 | { | ||
456 | LLUUID idItem; | ||
457 | bool fInInventory; | ||
458 | bool fAssetSaved; | ||
459 | |||
460 | RlvReattachInfo() : idItem(), fInInventory(false), fAssetSaved(false) {} | ||
461 | }; | ||
462 | |||
463 | // ============================================================================ | 246 | // ============================================================================ |
464 | // Various helper classes/timers/functors | 247 | // Various helper classes/timers/functors |
465 | // | 248 | // |
@@ -509,7 +292,7 @@ BOOL rlvAttachToEnabler(void* pParam); | |||
509 | bool rlvCanDeleteOrReturn(); | 292 | bool rlvCanDeleteOrReturn(); |
510 | S32 rlvGetDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType type); | 293 | S32 rlvGetDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType type); |
511 | bool rlvIsEmote(const std::string& strUTF8Text); | 294 | bool rlvIsEmote(const std::string& strUTF8Text); |
512 | bool rlvIsValidChannel(S32 nChannel); | 295 | bool rlvIsValidReplyChannel(S32 nChannel); |
513 | bool rlvIsWearingItem(const LLInventoryItem* pItem); | 296 | bool rlvIsWearingItem(const LLInventoryItem* pItem); |
514 | 297 | ||
515 | void rlvForceDetach(LLViewerJointAttachment* pAttachPt); | 298 | void rlvForceDetach(LLViewerJointAttachment* pAttachPt); |
@@ -517,24 +300,33 @@ void rlvSendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLU | |||
517 | bool rlvSendChatReply(const std::string& strChannel, const std::string& strReply); | 300 | bool rlvSendChatReply(const std::string& strChannel, const std::string& strReply); |
518 | bool rlvSendChatReply(S32 nChannel, const std::string& strReply); | 301 | bool rlvSendChatReply(S32 nChannel, const std::string& strReply); |
519 | 302 | ||
520 | void rlvStringReplace(std::string& strText, std::string strFrom, const std::string& strTo); | ||
521 | std::string rlvGetFirstParenthesisedText(const std::string& strText, std::string::size_type* pidxMatch = NULL); | 303 | std::string rlvGetFirstParenthesisedText(const std::string& strText, std::string::size_type* pidxMatch = NULL); |
522 | std::string rlvGetLastParenthesisedText(const std::string& strText, std::string::size_type* pidxStart = NULL); | 304 | std::string rlvGetLastParenthesisedText(const std::string& strText, std::string::size_type* pidxStart = NULL); |
523 | 305 | void rlvStringReplace(std::string& strText, std::string strFrom, const std::string& strTo); | |
524 | // ============================================================================ | ||
525 | // Debug helper functions | ||
526 | // | ||
527 | 306 | ||
528 | #ifdef RLV_ADVANCED_TOGGLE_RLVA | 307 | #ifdef RLV_ADVANCED_TOGGLE_RLVA |
529 | // "Advanced / RLVa / Enable RLV" menu option | 308 | // "Advanced / RLVa / Enable RLV" menu option |
530 | void rlvDbgToggleEnabled(void*); | 309 | void rlvToggleEnabled(void*); |
531 | BOOL rlvDbgGetEnabled(void*); | 310 | BOOL rlvGetEnabled(void*); |
532 | #endif // RLV_ADVANCED_TOGGLE_RLVA | 311 | #endif // RLV_ADVANCED_TOGGLE_RLVA |
533 | 312 | ||
534 | // ============================================================================ | 313 | // ============================================================================ |
314 | // Debug helper functions | ||
315 | // | ||
316 | |||
317 | // ============================================================================ | ||
535 | // Inlined class member functions | 318 | // Inlined class member functions |
536 | // | 319 | // |
537 | 320 | ||
321 | // Checked: 2009-09-19 (RLVa-1.0.3d) | ||
322 | inline std::string RlvCommand::asString() const | ||
323 | { | ||
324 | // NOTE: @clear=<param> should be represented as clear:<param> | ||
325 | return (m_eParamType != RLV_TYPE_CLEAR) | ||
326 | ? (!m_strOption.empty()) ? (std::string(m_strBehaviour)).append(":").append(m_strOption) : (std::string(m_strBehaviour)) | ||
327 | : (!m_strParam.empty()) ? (std::string(m_strBehaviour)).append(":").append(m_strParam) : (std::string(m_strBehaviour)); | ||
328 | } | ||
329 | |||
538 | inline bool RlvCommand::operator ==(const RlvCommand& rhs) const | 330 | inline bool RlvCommand::operator ==(const RlvCommand& rhs) const |
539 | { | 331 | { |
540 | // The specification notes that "@detach=n" is semantically identical to "@detach=add" (same for "y" and "rem" | 332 | // The specification notes that "@detach=n" is semantically identical to "@detach=add" (same for "y" and "rem" |
@@ -562,7 +354,7 @@ inline bool rlvIsEmote(const std::string& strUTF8Text) | |||
562 | } | 354 | } |
563 | 355 | ||
564 | // Checked: 2009-09-05 (RLVa-1.0.2a) | Added: RLVa-1.0.2a | 356 | // Checked: 2009-09-05 (RLVa-1.0.2a) | Added: RLVa-1.0.2a |
565 | inline bool rlvIsValidChannel(S32 nChannel) | 357 | inline bool rlvIsValidReplyChannel(S32 nChannel) |
566 | { | 358 | { |
567 | return (nChannel > 0) && (CHAT_CHANNEL_DEBUG != nChannel); | 359 | return (nChannel > 0) && (CHAT_CHANNEL_DEBUG != nChannel); |
568 | } | 360 | } |
diff --git a/linden/indra/newview/skins/default/xui/en-us/alerts.xml b/linden/indra/newview/skins/default/xui/en-us/alerts.xml index d0ac192..edfe62c 100644 --- a/linden/indra/newview/skins/default/xui/en-us/alerts.xml +++ b/linden/indra/newview/skins/default/xui/en-us/alerts.xml | |||
@@ -5222,5 +5222,22 @@ WARNING: Don't restore if you aren't sure where the object will go! | |||
5222 | </option> | 5222 | </option> |
5223 | </alert> | 5223 | </alert> |
5224 | 5224 | ||
5225 | <!-- [RLVa:KB] --> | ||
5226 | <alert modal="true" name="FirstRLVGiveToRLV"> | ||
5227 | <message name="message"> | ||
5228 | Folders starting with '#RLV/~' can automatically be placed under your #RLV shared folder after you accept the inventory offer. | ||
5229 | |||
5230 | Please note that - if enabled - the accepted inventory items will instantly be available to scripts and will have full use of the RLV API which may cause unexpected or undesirable situations. | ||
5231 | |||
5232 | Do you want to enable this feature? | ||
5233 | </message> | ||
5234 | <option name="Yes"> | ||
5235 | Yes | ||
5236 | </option> | ||
5237 | <option name="No"> | ||
5238 | No | ||
5239 | </option> | ||
5240 | </alert> | ||
5241 | <!-- [/RLVa:KB] --> | ||
5225 | </alerts> | 5242 | </alerts> |
5226 | 5243 | ||
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml index 9da0ec5..8d55a3b 100644 --- a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml +++ b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | |||
@@ -1402,11 +1402,33 @@ | |||
1402 | 1402 | ||
1403 | <menu name="RLVa" drop_shadow="true" opaque="true" tear_off="true"> | 1403 | <menu name="RLVa" drop_shadow="true" opaque="true" tear_off="true"> |
1404 | 1404 | ||
1405 | <menu name="Debug" drop_shadow="true" opaque="true" tear_off="true"> | ||
1406 | |||
1407 | <menu_item_check name="Show Debug Messages" | ||
1408 | label="Show Debug Messages"> | ||
1409 | <on_click function="ToggleControl" userdata="RestrainedLifeDebug" /> | ||
1410 | <on_check control="RestrainedLifeDebug" /> | ||
1411 | </menu_item_check> | ||
1412 | |||
1413 | <menu_item_separator /> | ||
1414 | |||
1415 | <menu_item_check name="Enable Legacy Naming" | ||
1416 | label="Enable Legacy Naming"> | ||
1417 | <on_click function="ToggleControl" userdata="RLVaEnableLegacyNaming" /> | ||
1418 | <on_check control="RLVaEnableLegacyNaming" /> | ||
1419 | </menu_item_check> | ||
1420 | |||
1421 | </menu> | ||
1422 | |||
1423 | <menu_item_separator /> | ||
1424 | |||
1405 | <menu_item_check name="Enable Wear" label="Enable Wear"> | 1425 | <menu_item_check name="Enable Wear" label="Enable Wear"> |
1406 | <on_click function="ToggleControl" userdata="RLVaEnableWear" /> | 1426 | <on_click function="ToggleControl" userdata="RLVaEnableWear" /> |
1407 | <on_check control="RLVaEnableWear" /> | 1427 | <on_check control="RLVaEnableWear" /> |
1408 | </menu_item_check> | 1428 | </menu_item_check> |
1409 | 1429 | ||
1430 | <menu_item_separator /> | ||
1431 | |||
1410 | <menu_item_check name="Hide locked layers" label="Hide locked layers"> | 1432 | <menu_item_check name="Hide locked layers" label="Hide locked layers"> |
1411 | <on_click function="ToggleControl" userdata="RLVaHideLockedLayers" /> | 1433 | <on_click function="ToggleControl" userdata="RLVaHideLockedLayers" /> |
1412 | <on_check control="RLVaHideLockedLayers" /> | 1434 | <on_check control="RLVaHideLockedLayers" /> |
@@ -1428,6 +1450,22 @@ | |||
1428 | </menu_item_check> | 1450 | </menu_item_check> |
1429 | --> | 1451 | --> |
1430 | 1452 | ||
1453 | <menu_item_separator /> | ||
1454 | |||
1455 | <menu_item_check name="Forbid Give to #RLV" label="Forbid Give to #RLV"> | ||
1456 | <on_click function="ToggleControl" | ||
1457 | userdata="RestrainedLifeForbidGiveToRLV" /> | ||
1458 | <on_check control="RestrainedLifeForbidGiveToRLV" /> | ||
1459 | </menu_item_check> | ||
1460 | |||
1461 | <menu_item_check name="Show Name Tags" label="Show Name Tags"> | ||
1462 | <on_click function="ToggleControl" | ||
1463 | userdata="RLVaShowNameTags" /> | ||
1464 | <on_check control="RLVaShowNameTags" /> | ||
1465 | </menu_item_check> | ||
1466 | |||
1467 | <menu_item_separator /> | ||
1468 | |||
1431 | <menu_item_call name="Restrictions..." label="Restrictions..."> | 1469 | <menu_item_call name="Restrictions..." label="Restrictions..."> |
1432 | <on_click function="RLVa.Behaviors.Show" userdata="" /> | 1470 | <on_click function="RLVa.Behaviors.Show" userdata="" /> |
1433 | </menu_item_call> | 1471 | </menu_item_call> |
diff --git a/linden/indra/newview/skins/default/xui/en-us/notify.xml b/linden/indra/newview/skins/default/xui/en-us/notify.xml index 01e2546..2716f25 100644 --- a/linden/indra/newview/skins/default/xui/en-us/notify.xml +++ b/linden/indra/newview/skins/default/xui/en-us/notify.xml | |||
@@ -923,7 +923,24 @@ You can find example sculpted textures in the inventory library. | |||
923 | You have begun playing media. Media can set to play automatically in the preferences window under Audio / Video. Note that this can be a security risk for media sites you do not trust. | 923 | You have begun playing media. Media can set to play automatically in the preferences window under Audio / Video. Note that this can be a security risk for media sites you do not trust. |
924 | </message> | 924 | </message> |
925 | </notify> | 925 | </notify> |
926 | <notify name="MaxListSelectMessage" tip="true"> | 926 | <!-- [RLVa:KB] --> |
927 | <notify name="FirstRLVDetach" tip="false"> | ||
928 | <message name="message"> | ||
929 | One of your attachments was made nondetachable using Restrained Life. | ||
930 | Please note that this also disables the 'Wear' option on all prim attachments in your inventory unless they are properly named. | ||
931 | |||
932 | For more information search for 'Restrained Life' on the SL wiki. | ||
933 | </message> | ||
934 | </notify> | ||
935 | <notify name="FirstRLVFartouch" tip="false"> | ||
936 | <message name="message"> | ||
937 | You have been fartouch restricted: you will be unable to touch objects farther than 1.5m from your avatar until the restriction is lifted. | ||
938 | |||
939 | Tip: if an object is out of range the mouse cursor will not change as you hover over it and you'll hear an error sound if you try to right-click it. | ||
940 | </message> | ||
941 | </notify> | ||
942 | <!-- [/RLVa:KB] --> | ||
943 | <notify name="MaxListSelectMessage" tip="true"> | ||
927 | <message name="message"> | 944 | <message name="message"> |
928 | You may only select up to [MAX_SELECT] items | 945 | You may only select up to [MAX_SELECT] items |
929 | from this list. | 946 | from this list. |