diff options
Diffstat (limited to 'linden/indra/newview')
36 files changed, 1335 insertions, 759 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/English.lproj/InfoPlist.strings b/linden/indra/newview/English.lproj/InfoPlist.strings index 074005b..14a0102 100644 --- a/linden/indra/newview/English.lproj/InfoPlist.strings +++ b/linden/indra/newview/English.lproj/InfoPlist.strings | |||
@@ -1,5 +1,5 @@ | |||
1 | /* Localized versions of Info.plist keys */ | 1 | /* Localized versions of Info.plist keys */ |
2 | 2 | ||
3 | CFBundleName = "Imprudence"; | 3 | CFBundleName = "Imprudence"; |
4 | CFBundleShortVersionString = "Imprudence version 1.2.0 beta"; | 4 | CFBundleShortVersionString = "Imprudence version 1.2.0 beta 2"; |
5 | CFBundleGetInfoString = "Imprudence version 1.2.0 beta"; | 5 | CFBundleGetInfoString = "Imprudence version 1.2.0 beta 2"; |
diff --git a/linden/indra/newview/Info-Imprudence.plist b/linden/indra/newview/Info-Imprudence.plist index 750afd7..e44dcbe 100644 --- a/linden/indra/newview/Info-Imprudence.plist +++ b/linden/indra/newview/Info-Imprudence.plist | |||
@@ -32,7 +32,7 @@ | |||
32 | </dict> | 32 | </dict> |
33 | </array> | 33 | </array> |
34 | <key>CFBundleVersion</key> | 34 | <key>CFBundleVersion</key> |
35 | <string>1.2.0 beta</string> | 35 | <string>1.2.0 beta 2</string> |
36 | <key>CSResourcesFileMapped</key> | 36 | <key>CSResourcesFileMapped</key> |
37 | <true/> | 37 | <true/> |
38 | </dict> | 38 | </dict> |
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 84baa99..55e6131 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> |
@@ -5044,6 +5088,28 @@ | |||
5044 | <key>Value</key> | 5088 | <key>Value</key> |
5045 | <integer>1</integer> | 5089 | <integer>1</integer> |
5046 | </map> | 5090 | </map> |
5091 | <key>MiniMapNotifyChatRange</key> | ||
5092 | <map> | ||
5093 | <key>Comment</key> | ||
5094 | <string>Notify when avatars enter chat range</string> | ||
5095 | <key>Persist</key> | ||
5096 | <integer>1</integer> | ||
5097 | <key>Type</key> | ||
5098 | <string>Boolean</string> | ||
5099 | <key>Value</key> | ||
5100 | <integer>1</integer> | ||
5101 | </map> | ||
5102 | <key>MiniMapNotifySimRange</key> | ||
5103 | <map> | ||
5104 | <key>Comment</key> | ||
5105 | <string>Notify when avatars enters the current sim</string> | ||
5106 | <key>Persist</key> | ||
5107 | <integer>1</integer> | ||
5108 | <key>Type</key> | ||
5109 | <string>Boolean</string> | ||
5110 | <key>Value</key> | ||
5111 | <integer>0</integer> | ||
5112 | </map> | ||
5047 | <key>MiniMapPrimMaxRadius</key> | 5113 | <key>MiniMapPrimMaxRadius</key> |
5048 | <map> | 5114 | <map> |
5049 | <key>Comment</key> | 5115 | <key>Comment</key> |
@@ -7937,6 +8003,28 @@ | |||
7937 | <key>Value</key> | 8003 | <key>Value</key> |
7938 | <integer>0</integer> | 8004 | <integer>0</integer> |
7939 | </map> | 8005 | </map> |
8006 | <key>SpamCount</key> | ||
8007 | <map> | ||
8008 | <key>Comment</key> | ||
8009 | <string>Number of items spammed per time set in SpamTime. RECOMMENDED IS 4.000</string> | ||
8010 | <key>Persist</key> | ||
8011 | <integer>1</integer> | ||
8012 | <key>Type</key> | ||
8013 | <string>F32</string> | ||
8014 | <key>Value</key> | ||
8015 | <real>4.0</real> | ||
8016 | </map> | ||
8017 | <key>SpamTime</key> | ||
8018 | <map> | ||
8019 | <key>Comment</key> | ||
8020 | <string>Time of Evalulating spam. RECOMMENDED NUMBER IS 1.000</string> | ||
8021 | <key>Persist</key> | ||
8022 | <integer>1</integer> | ||
8023 | <key>Type</key> | ||
8024 | <string>F32</string> | ||
8025 | <key>Value</key> | ||
8026 | <real>1.0</real> | ||
8027 | </map> | ||
7940 | <key>SpeakingColor</key> | 8028 | <key>SpeakingColor</key> |
7941 | <map> | 8029 | <map> |
7942 | <key>Comment</key> | 8030 | <key>Comment</key> |
@@ -10019,6 +10107,17 @@ | |||
10019 | <key>Value</key> | 10107 | <key>Value</key> |
10020 | <integer>0</integer> | 10108 | <integer>0</integer> |
10021 | </map> | 10109 | </map> |
10110 | <key>VerticalIMTabs</key> | ||
10111 | <map> | ||
10112 | <key>Comment</key> | ||
10113 | <string>Enable vertical layout for IM tabs</string> | ||
10114 | <key>Persist</key> | ||
10115 | <integer>1</integer> | ||
10116 | <key>Type</key> | ||
10117 | <string>Boolean</string> | ||
10118 | <key>Value</key> | ||
10119 | <integer>0</integer> | ||
10120 | </map> | ||
10022 | <key>VivoxDebugLevel</key> | 10121 | <key>VivoxDebugLevel</key> |
10023 | <map> | 10122 | <map> |
10024 | <key>Comment</key> | 10123 | <key>Comment</key> |
diff --git a/linden/indra/newview/hippoGridManager.cpp b/linden/indra/newview/hippoGridManager.cpp index 7a2a3e9..71e3a95 100644 --- a/linden/indra/newview/hippoGridManager.cpp +++ b/linden/indra/newview/hippoGridManager.cpp | |||
@@ -469,14 +469,15 @@ std::string HippoGridInfo::sanitizeGridNick(std::string &gridnick) | |||
469 | // static | 469 | // static |
470 | std::string HippoGridInfo::sanitizeUri(std::string &uri) | 470 | std::string HippoGridInfo::sanitizeUri(std::string &uri) |
471 | { | 471 | { |
472 | if (uri.empty()) { | 472 | // if (uri.empty()) { |
473 | return ""; | 473 | // return ""; |
474 | } | 474 | // } |
475 | 475 | ||
476 | // If last character in uri is not "/" | 476 | // // If last character in uri is not "/" |
477 | if (uri.compare(uri.length()-1, 1, "/") != 0) { | 477 | // // NOTE: This wrongly assumes that all URIs should end with "/"! |
478 | return uri + '/'; | 478 | // if (uri.compare(uri.length()-1, 1, "/") != 0) { |
479 | } | 479 | // return uri + '/'; |
480 | // } | ||
480 | 481 | ||
481 | return uri; | 482 | return uri; |
482 | } | 483 | } |
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/llfloaterchat.cpp b/linden/indra/newview/llfloaterchat.cpp index cc86fce..79c4aa6 100644 --- a/linden/indra/newview/llfloaterchat.cpp +++ b/linden/indra/newview/llfloaterchat.cpp | |||
@@ -213,9 +213,9 @@ void add_timestamped_line(LLViewerTextEditor* edit, LLChat chat, const LLColor4& | |||
213 | } | 213 | } |
214 | 214 | ||
215 | // If the chat line has an associated url, link it up to the name. | 215 | // If the chat line has an associated url, link it up to the name. |
216 | if (!chat.mURL.empty() && | 216 | if ((!chat.mURL.empty() && line.length() > chat.mFromName.length()) && |
217 | (line.length() > chat.mFromName.length() && | 217 | (line.find(chat.mFromName,0) == 0 || (line.find(chat.mFromName,0) == 4 && |
218 | (line.find(chat.mFromName,0) == 4 || line.find(chat.mFromName,0) == 0))) | 218 | color == gSavedSettings.getColor4("ObjectIMColor")))) // hack to make sure IMs in chat history don't hightlight |
219 | { | 219 | { |
220 | std::string start_line; | 220 | std::string start_line; |
221 | if (line.find(chat.mFromName,0) == 4) // IMs are prefaced with "IM: " | 221 | if (line.find(chat.mFromName,0) == 4) // IMs are prefaced with "IM: " |
diff --git a/linden/indra/newview/llfloaterchatterbox.cpp b/linden/indra/newview/llfloaterchatterbox.cpp index 5ef5a30..e18cca0 100644 --- a/linden/indra/newview/llfloaterchatterbox.cpp +++ b/linden/indra/newview/llfloaterchatterbox.cpp | |||
@@ -97,7 +97,16 @@ LLFloaterChatterBox::LLFloaterChatterBox(const LLSD& seed) : | |||
97 | { | 97 | { |
98 | mAutoResize = FALSE; | 98 | mAutoResize = FALSE; |
99 | 99 | ||
100 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox.xml", NULL, FALSE); | 100 | // check if vertical tabs is selected |
101 | if (gSavedSettings.getBOOL("VerticalIMTabs")) | ||
102 | { | ||
103 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox_vertical.xml", NULL, FALSE); | ||
104 | } | ||
105 | else | ||
106 | { | ||
107 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_chatterbox.xml", NULL, FALSE); | ||
108 | } | ||
109 | |||
101 | if (gSavedSettings.getBOOL("ContactsTornOff")) | 110 | if (gSavedSettings.getBOOL("ContactsTornOff")) |
102 | { | 111 | { |
103 | LLFloaterMyFriends* floater_contacts = LLFloaterMyFriends::getInstance(0); | 112 | LLFloaterMyFriends* floater_contacts = LLFloaterMyFriends::getInstance(0); |
diff --git a/linden/indra/newview/llfloatermap.cpp b/linden/indra/newview/llfloatermap.cpp index c60f07f..0ee0f2b 100644 --- a/linden/indra/newview/llfloatermap.cpp +++ b/linden/indra/newview/llfloatermap.cpp | |||
@@ -43,8 +43,10 @@ | |||
43 | #include "lluictrlfactory.h" | 43 | #include "lluictrlfactory.h" |
44 | 44 | ||
45 | // radar | 45 | // radar |
46 | #include "llchat.h" | ||
46 | #include "llfirstuse.h" | 47 | #include "llfirstuse.h" |
47 | #include "llfloateravatarinfo.h" | 48 | #include "llfloateravatarinfo.h" |
49 | #include "llfloaterchat.h" | ||
48 | #include "llfloaterfriends.h" | 50 | #include "llfloaterfriends.h" |
49 | #include "llfloatergroupinvite.h" | 51 | #include "llfloatergroupinvite.h" |
50 | #include "llfloatergroups.h" | 52 | #include "llfloatergroups.h" |
@@ -69,13 +71,16 @@ LLFloaterMap::LLFloaterMap(const LLSD& key) | |||
69 | : | 71 | : |
70 | LLFloater(std::string("minimap")), | 72 | LLFloater(std::string("minimap")), |
71 | mPanelMap(NULL), | 73 | mPanelMap(NULL), |
72 | mUpdate(TRUE) | 74 | mUpdate(TRUE), |
75 | mSelectedAvatar(LLUUID::null) | ||
76 | |||
73 | { | 77 | { |
74 | LLCallbackMap::map_t factory_map; | 78 | LLCallbackMap::map_t factory_map; |
75 | factory_map["mini_mapview"] = LLCallbackMap(createPanelMiniMap, this); | 79 | factory_map["mini_mapview"] = LLCallbackMap(createPanelMiniMap, this); |
76 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_mini_map.xml", &factory_map, FALSE); | 80 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_mini_map.xml", &factory_map, FALSE); |
77 | 81 | ||
78 | mSelectedAvatar.setNull(); | 82 | mChatAvatars.clear(); |
83 | mTypingAvatars.clear(); | ||
79 | } | 84 | } |
80 | 85 | ||
81 | 86 | ||
@@ -232,78 +237,257 @@ void LLFloaterMap::populateRadar() | |||
232 | 237 | ||
233 | S32 scroll_pos = mRadarList->getScrollPos(); | 238 | S32 scroll_pos = mRadarList->getScrollPos(); |
234 | 239 | ||
235 | LLVector3d current_pos = gAgent.getPositionGlobal(); | 240 | // clear count |
241 | std::stringstream avatar_count; | ||
242 | avatar_count.str(""); | ||
236 | 243 | ||
237 | // find what avatars you can see | 244 | // find what avatars you can see |
245 | F32 range = gSavedSettings.getF32("NearMeRange"); | ||
246 | LLVector3d current_pos = gAgent.getPositionGlobal(); | ||
238 | std::vector<LLUUID> avatar_ids; | 247 | std::vector<LLUUID> avatar_ids; |
239 | std::vector<LLVector3d> positions; | 248 | std::vector<LLVector3d> positions; |
240 | LLWorld::getInstance()->getAvatars(&avatar_ids, &positions, current_pos, gSavedSettings.getF32("NearMeRange")); | 249 | LLWorld::getInstance()->getAvatars(&avatar_ids, &positions); |
241 | 250 | ||
242 | LLSD element; | 251 | LLSD element; |
243 | 252 | ||
244 | mRadarList->deleteAllItems(); | 253 | mRadarList->deleteAllItems(); |
245 | 254 | ||
246 | for (U32 i=0; i<avatar_ids.size(); i++) | 255 | if (!avatar_ids.empty()) |
247 | { | 256 | { |
248 | if (avatar_ids[i] == gAgent.getID() || | 257 | for (U32 i=0; i<avatar_ids.size(); i++) |
249 | avatar_ids[i].isNull()) | ||
250 | { | 258 | { |
251 | continue; | 259 | if (avatar_ids[i] == gAgent.getID() || |
252 | } | 260 | avatar_ids[i].isNull()) |
261 | { | ||
262 | continue; | ||
263 | } | ||
253 | 264 | ||
254 | // Add to list only if we get their name | 265 | // Add to list only if we get their name |
255 | std::string fullname = getSelectedName(avatar_ids[i]); | 266 | std::string fullname = getSelectedName(avatar_ids[i]); |
256 | if (!fullname.empty()) | 267 | if (!fullname.empty()) |
257 | { | ||
258 | // [RLVa:KB] - Alternate: Imprudence-1.2.0 | ||
259 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
260 | { | 268 | { |
261 | fullname = gRlvHandler.getAnonym(fullname); | 269 | bool notify_chat = gSavedSettings.getBOOL("MiniMapNotifyChatRange"); |
270 | bool notify_sim = gSavedSettings.getBOOL("MiniMapNotifySimRange"); | ||
271 | // [RLVa:KB] - Alternate: Imprudence-1.2.0 | ||
272 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWNAMES)) | ||
273 | { | ||
274 | fullname = gRlvHandler.getAnonym(fullname); | ||
275 | notify_chat = false; | ||
276 | notify_sim = false; | ||
277 | } | ||
278 | // [/RLVa:KB] | ||
279 | |||
280 | // check if they're in certain ranges and notify user if we've enabled that | ||
281 | LLVector3d temp = positions[i] - current_pos; | ||
282 | F32 distance = llround((F32)temp.magVec(), 0.1f); | ||
283 | /*char dist[32]; | ||
284 | sprintf(dist, "%.1f", distance); | ||
285 | std::string dist_string = dist;*/ | ||
286 | std::string dist_string = llformat("%.1f", distance); | ||
287 | |||
288 | if (notify_chat) | ||
289 | { | ||
290 | if (distance < 20.0f) | ||
291 | { | ||
292 | if (!getInChatList(avatar_ids[i])) | ||
293 | { | ||
294 | addToChatList(avatar_ids[i], dist_string); | ||
295 | } | ||
296 | } | ||
297 | else | ||
298 | { | ||
299 | if (getInChatList(avatar_ids[i])) | ||
300 | { | ||
301 | removeFromChatList(avatar_ids[i]); | ||
302 | } | ||
303 | } | ||
304 | updateChatList(avatar_ids); | ||
305 | } | ||
306 | else if (!mChatAvatars.empty()) | ||
307 | { | ||
308 | mChatAvatars.clear(); | ||
309 | } | ||
310 | |||
311 | if (notify_sim) | ||
312 | { | ||
313 | if (!getInChatList(avatar_ids[i]) && !getInSimAvList(avatar_ids[i])) | ||
314 | { | ||
315 | LLViewerObject *av_obj = gObjectList.findObject(avatar_ids[i]); | ||
316 | if (av_obj != NULL && av_obj->isAvatar()) | ||
317 | { | ||
318 | LLVOAvatar* avatarp = (LLVOAvatar*)av_obj; | ||
319 | if (avatarp != NULL) | ||
320 | { | ||
321 | if (avatarp->getRegion() == gAgent.getRegion()) | ||
322 | { | ||
323 | addToSimAvList(avatar_ids[i], dist_string); | ||
324 | } | ||
325 | } | ||
326 | } | ||
327 | } | ||
328 | updateSimAvList(avatar_ids); | ||
329 | } | ||
330 | else if (!mSimAvatars.empty()) | ||
331 | { | ||
332 | mSimAvatars.clear(); | ||
333 | } | ||
334 | |||
335 | // only display avatars in range | ||
336 | if (distance <= range) | ||
337 | { | ||
338 | // append typing string | ||
339 | std::string typing = ""; | ||
340 | if (getIsTyping(avatar_ids[i])) | ||
341 | { | ||
342 | typing = getString("is_typing")+ " "; | ||
343 | } | ||
344 | |||
345 | std::string mute_text = LLMuteList::getInstance()->isMuted(avatar_ids[i]) ? getString("is_muted") : ""; | ||
346 | element["id"] = avatar_ids[i]; | ||
347 | element["columns"][0]["column"] = "avatar_name"; | ||
348 | element["columns"][0]["type"] = "text"; | ||
349 | element["columns"][0]["value"] = typing + fullname + " " + mute_text; | ||
350 | element["columns"][1]["column"] = "avatar_distance"; | ||
351 | element["columns"][1]["type"] = "text"; | ||
352 | element["columns"][1]["value"] = dist_string+"m"; | ||
353 | |||
354 | mRadarList->addElement(element, ADD_BOTTOM); | ||
355 | } | ||
262 | } | 356 | } |
263 | // [/RLVa:KB] | 357 | } |
264 | 358 | ||
265 | std::string mute_text = LLMuteList::getInstance()->isMuted(avatar_ids[i]) ? getString("muted") : ""; | 359 | mRadarList->sortItems(); |
266 | element["id"] = avatar_ids[i]; | 360 | mRadarList->setScrollPos(scroll_pos); |
267 | element["columns"][0]["column"] = "avatar_name"; | 361 | if (mSelectedAvatar.notNull()) |
268 | element["columns"][0]["type"] = "text"; | 362 | { |
269 | element["columns"][0]["value"] = fullname + " " + mute_text; | 363 | mRadarList->selectByID(mSelectedAvatar); |
270 | element["columns"][1]["column"] = "avatar_distance"; | ||
271 | element["columns"][1]["type"] = "text"; | ||
272 | |||
273 | LLVector3d temp = positions[i] - current_pos; | ||
274 | F32 distance = (F32)temp.magVec(); | ||
275 | char dist[32]; | ||
276 | snprintf(dist, sizeof(dist), "%.1f", distance); | ||
277 | element["columns"][1]["value"] = strcat(dist,"m"); | ||
278 | |||
279 | mRadarList->addElement(element, ADD_BOTTOM); | ||
280 | } | 364 | } |
365 | avatar_count << (int)avatar_ids.size(); | ||
281 | } | 366 | } |
367 | else | ||
368 | { | ||
369 | mTypingAvatars.clear(); | ||
370 | mRadarList->addCommentText(getString("no_one_near"), ADD_TOP); | ||
371 | avatar_count << "0"; | ||
372 | } | ||
373 | |||
374 | childSetText("lblAvatarCount", avatar_count.str()); | ||
282 | 375 | ||
283 | mRadarList->sortItems(); | 376 | toggleButtons(); |
284 | mRadarList->setScrollPos(scroll_pos); | 377 | |
285 | if (mSelectedAvatar.notNull()) | 378 | //llinfos << "mSelectedAvatar: " << mSelectedAvatar.asString() << llendl; |
379 | } | ||
380 | |||
381 | void LLFloaterMap::updateChatList(std::vector<LLUUID> agent_ids) | ||
382 | { | ||
383 | std::set<LLUUID>::iterator it; | ||
384 | std::vector<LLUUID>::iterator result; | ||
385 | for (it = mChatAvatars.begin(); it != mChatAvatars.end(); ) | ||
286 | { | 386 | { |
287 | mRadarList->selectByID(mSelectedAvatar); | 387 | result = find(agent_ids.begin(), agent_ids.end(), *it); |
388 | if (result == agent_ids.end()) | ||
389 | { | ||
390 | mChatAvatars.erase(it++); | ||
391 | } | ||
392 | else | ||
393 | { | ||
394 | it++; | ||
395 | } | ||
288 | } | 396 | } |
397 | } | ||
289 | 398 | ||
290 | // set count | 399 | bool LLFloaterMap::getInChatList(LLUUID agent_id) |
291 | std::stringstream avatar_count; | 400 | { |
292 | avatar_count.str(""); | 401 | if (mChatAvatars.count(agent_id) > 0) |
293 | if (avatar_ids.empty()) | ||
294 | { | 402 | { |
295 | mRadarList->addCommentText(getString("no_one_near"), ADD_TOP); | 403 | return true; |
296 | avatar_count << "0"; | 404 | } |
405 | return false; | ||
406 | } | ||
407 | |||
408 | void LLFloaterMap::addToChatList(LLUUID agent_id, std::string distance) | ||
409 | { | ||
410 | mChatAvatars.insert(agent_id); | ||
411 | LLChat chat; | ||
412 | |||
413 | LLUIString notify = getString("entering_chat_range"); | ||
414 | notify.setArg("[NAME]", getSelectedName(agent_id)); | ||
415 | notify.setArg("[DISTANCE]", distance); | ||
416 | |||
417 | chat.mText = notify; | ||
418 | chat.mSourceType = CHAT_SOURCE_SYSTEM; | ||
419 | LLFloaterChat::addChat(chat, FALSE, FALSE); | ||
420 | } | ||
421 | |||
422 | void LLFloaterMap::removeFromChatList(LLUUID agent_id) | ||
423 | { | ||
424 | // Do we want to add a notice? | ||
425 | mChatAvatars.erase(agent_id); | ||
426 | } | ||
427 | |||
428 | bool LLFloaterMap::getIsTyping(LLUUID agent_id) | ||
429 | { | ||
430 | if (mTypingAvatars.count(agent_id) > 0) | ||
431 | { | ||
432 | return true; | ||
433 | } | ||
434 | return false; | ||
435 | } | ||
436 | |||
437 | void LLFloaterMap::updateTypingList(LLUUID agent_id, bool remove) | ||
438 | { | ||
439 | if (remove) | ||
440 | { | ||
441 | if (getIsTyping(agent_id)) | ||
442 | { | ||
443 | mTypingAvatars.erase(agent_id); | ||
444 | } | ||
297 | } | 445 | } |
298 | else | 446 | else |
299 | { | 447 | { |
300 | avatar_count << (int)avatar_ids.size(); | 448 | mTypingAvatars.insert(agent_id); |
301 | } | 449 | } |
302 | childSetText("lblAvatarCount", avatar_count.str()); | 450 | } |
303 | 451 | ||
304 | toggleButtons(); | 452 | void LLFloaterMap::updateSimAvList(std::vector<LLUUID> agent_ids) |
453 | { | ||
454 | std::set<LLUUID>::iterator it; | ||
455 | std::vector<LLUUID>::iterator result; | ||
456 | for (it = mSimAvatars.begin(); it != mSimAvatars.end(); ) | ||
457 | { | ||
458 | result = find(agent_ids.begin(), agent_ids.end(), *it); | ||
459 | if (result == agent_ids.end()) | ||
460 | { | ||
461 | mSimAvatars.erase(it++); | ||
462 | } | ||
463 | else | ||
464 | { | ||
465 | it++; | ||
466 | } | ||
467 | } | ||
468 | } | ||
305 | 469 | ||
306 | //llinfos << "mSelectedAvatar: " << mSelectedAvatar.asString() << llendl; | 470 | void LLFloaterMap::addToSimAvList(LLUUID agent_id, std::string distance) |
471 | { | ||
472 | mSimAvatars.insert(agent_id); | ||
473 | LLChat chat; | ||
474 | |||
475 | LLUIString notify = getString("entering_sim_range"); | ||
476 | notify.setArg("[NAME]", getSelectedName(agent_id)); | ||
477 | notify.setArg("[DISTANCE]", distance); | ||
478 | |||
479 | chat.mText = notify; | ||
480 | chat.mSourceType = CHAT_SOURCE_SYSTEM; | ||
481 | LLFloaterChat::addChat(chat, FALSE, FALSE); | ||
482 | } | ||
483 | |||
484 | bool LLFloaterMap::getInSimAvList(LLUUID agent_id) | ||
485 | { | ||
486 | if (mSimAvatars.count(agent_id) > 0) | ||
487 | { | ||
488 | return true; | ||
489 | } | ||
490 | return false; | ||
307 | } | 491 | } |
308 | 492 | ||
309 | void LLFloaterMap::toggleButtons() | 493 | void LLFloaterMap::toggleButtons() |
diff --git a/linden/indra/newview/llfloatermap.h b/linden/indra/newview/llfloatermap.h index 349b0e6..af4d1cc 100644 --- a/linden/indra/newview/llfloatermap.h +++ b/linden/indra/newview/llfloatermap.h | |||
@@ -52,6 +52,9 @@ public: | |||
52 | // returns true if agent_id belongs to a developer listed in llfloatermap.cpp | 52 | // returns true if agent_id belongs to a developer listed in llfloatermap.cpp |
53 | static bool isImpDev(LLUUID agent_id); | 53 | static bool isImpDev(LLUUID agent_id); |
54 | 54 | ||
55 | bool getIsTyping(LLUUID agent_id); | ||
56 | void updateTypingList(LLUUID agent_id, bool remove); | ||
57 | |||
55 | BOOL postBuild(); | 58 | BOOL postBuild(); |
56 | 59 | ||
57 | /*virtual*/ void draw(); | 60 | /*virtual*/ void draw(); |
@@ -64,12 +67,20 @@ public: | |||
64 | 67 | ||
65 | 68 | ||
66 | private: | 69 | private: |
70 | |||
67 | LLFloaterMap(const LLSD& key = LLSD()); | 71 | LLFloaterMap(const LLSD& key = LLSD()); |
68 | 72 | ||
69 | LLNetMap* mPanelMap; | 73 | LLNetMap* mPanelMap; |
70 | LLScrollListCtrl* mRadarList; | 74 | LLScrollListCtrl* mRadarList; |
71 | LLUUID mSelectedAvatar; | 75 | LLUUID mSelectedAvatar; |
72 | bool mUpdate; | 76 | |
77 | // TODO: move all this info into its own object. It's stupid | ||
78 | // and bug-prone to keep it all in separate containers, but | ||
79 | // I want to get this out for 1.2 -- McCabe | ||
80 | std::set<LLUUID> mChatAvatars; | ||
81 | std::set<LLUUID> mTypingAvatars; | ||
82 | std::set<LLUUID> mSimAvatars; | ||
83 | bool mUpdate; | ||
73 | 84 | ||
74 | static void onList(LLUICtrl* ctrl, void* user_data); | 85 | static void onList(LLUICtrl* ctrl, void* user_data); |
75 | static void onRangeChange(LLFocusableElement* focus, void* user_data); | 86 | static void onRangeChange(LLFocusableElement* focus, void* user_data); |
@@ -78,6 +89,15 @@ private: | |||
78 | void toggleButtons(); | 89 | void toggleButtons(); |
79 | void populateRadar(); | 90 | void populateRadar(); |
80 | 91 | ||
92 | void updateChatList(std::vector<LLUUID> agent_ids); | ||
93 | bool getInChatList(LLUUID agent_id); | ||
94 | void addToChatList(LLUUID agent_id, std::string distance); | ||
95 | void removeFromChatList(LLUUID agent_id); | ||
96 | |||
97 | bool getInSimAvList(LLUUID agent_id); | ||
98 | void addToSimAvList(LLUUID agent_id, std::string distance); | ||
99 | void updateSimAvList(std::vector<LLUUID> agent_ids); | ||
100 | |||
81 | static void onClickProfile(void* user_data); | 101 | static void onClickProfile(void* user_data); |
82 | static void onClickIM(void* user_data); | 102 | static void onClickIM(void* user_data); |
83 | static void onClickAddFriend(void* user_data); | 103 | static void onClickAddFriend(void* user_data); |
diff --git a/linden/indra/newview/llinventorybridge.cpp b/linden/indra/newview/llinventorybridge.cpp index 618c4f9..0d5625c 100644 --- a/linden/indra/newview/llinventorybridge.cpp +++ b/linden/indra/newview/llinventorybridge.cpp | |||
@@ -3505,7 +3505,7 @@ void LLObjectBridge::buildContextMenu(LLMenuGL& menu, U32 flags) | |||
3505 | if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getEnableWear()) && (gRlvHandler.hasLockedAttachment()) ) | 3505 | if ( (rlv_handler_t::isEnabled()) && (!RlvSettings::getEnableWear()) && (gRlvHandler.hasLockedAttachment()) ) |
3506 | { | 3506 | { |
3507 | LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(item, true); | 3507 | LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(item, true); |
3508 | if ( (!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt->getObject())) ) | 3508 | if ( (!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt)) ) |
3509 | disabled_items.push_back(std::string("Object Wear")); | 3509 | disabled_items.push_back(std::string("Object Wear")); |
3510 | } | 3510 | } |
3511 | // [/RLVa:KB] | 3511 | // [/RLVa:KB] |
@@ -4057,7 +4057,7 @@ void wear_inventory_category_on_avatar_step2( BOOL proceed, void* userdata ) | |||
4057 | for (S32 idxObj = obj_item_array.count() - 1; idxObj >= 0; idxObj--) | 4057 | for (S32 idxObj = obj_item_array.count() - 1; idxObj >= 0; idxObj--) |
4058 | { | 4058 | { |
4059 | LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(obj_item_array.get(idxObj).get(), true); | 4059 | LLViewerJointAttachment* pAttachPt = gRlvHandler.getAttachPoint(obj_item_array.get(idxObj).get(), true); |
4060 | if ( ((!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt->getObject()))) ) | 4060 | if ( ((!pAttachPt) || (!gRlvHandler.isDetachable(pAttachPt))) ) |
4061 | obj_item_array.remove(idxObj); | 4061 | obj_item_array.remove(idxObj); |
4062 | } | 4062 | } |
4063 | obj_count = obj_item_array.count(); | 4063 | obj_count = obj_item_array.count(); |
@@ -4245,7 +4245,7 @@ void wear_attachments_on_avatar(const std::set<LLUUID>& item_ids, BOOL remove) | |||
4245 | // [RLVa:KB] - Checked: 2009-09-11 (RLVa-1.0.2c) | Modified: RLVa-1.0.2c | 4245 | // [RLVa:KB] - Checked: 2009-09-11 (RLVa-1.0.2c) | Modified: RLVa-1.0.2c |
4246 | LLViewerJointAttachment* pAttachPt = NULL; | 4246 | LLViewerJointAttachment* pAttachPt = NULL; |
4247 | if ( (!rlv_handler_t::isEnabled()) || (RlvSettings::getEnableWear()) || (!gRlvHandler.hasLockedAttachment()) || | 4247 | if ( (!rlv_handler_t::isEnabled()) || (RlvSettings::getEnableWear()) || (!gRlvHandler.hasLockedAttachment()) || |
4248 | (((pAttachPt = gRlvHandler.getAttachPoint(item, true)) != NULL) && (gRlvHandler.isDetachable(pAttachPt->getObject()))) ) | 4248 | (((pAttachPt = gRlvHandler.getAttachPoint(item, true)) != NULL) && (gRlvHandler.isDetachable(pAttachPt))) ) |
4249 | { | 4249 | { |
4250 | items.put(item); | 4250 | items.put(item); |
4251 | } | 4251 | } |
diff --git a/linden/indra/newview/llpanelgeneral.cpp b/linden/indra/newview/llpanelgeneral.cpp index e416401..04b7afe 100644 --- a/linden/indra/newview/llpanelgeneral.cpp +++ b/linden/indra/newview/llpanelgeneral.cpp | |||
@@ -60,6 +60,8 @@ BOOL LLPanelGeneral::postBuild() | |||
60 | childSetValue("small_avatar_names_checkbox", gSavedSettings.getBOOL("SmallAvatarNames")); | 60 | childSetValue("small_avatar_names_checkbox", gSavedSettings.getBOOL("SmallAvatarNames")); |
61 | childSetValue("show_my_title_checkbox", gSavedSettings.getBOOL("RenderHideGroupTitle")); | 61 | childSetValue("show_my_title_checkbox", gSavedSettings.getBOOL("RenderHideGroupTitle")); |
62 | childSetValue("afk_timeout_spinner", gSavedSettings.getF32("AFKTimeout")); | 62 | childSetValue("afk_timeout_spinner", gSavedSettings.getF32("AFKTimeout")); |
63 | childSetValue("mini_map_notify_chat", gSavedSettings.getBOOL("MiniMapNotifyChatRange")); | ||
64 | childSetValue("mini_map_notify_sim", gSavedSettings.getBOOL("MiniMapNotifySimRange")); | ||
63 | childSetValue("notify_money_change_checkbox", gSavedSettings.getBOOL("NotifyMoneyChange")); | 65 | childSetValue("notify_money_change_checkbox", gSavedSettings.getBOOL("NotifyMoneyChange")); |
64 | childSetValue("use_system_color_picker_checkbox", gSavedSettings.getBOOL("UseDefaultColorPicker")); | 66 | childSetValue("use_system_color_picker_checkbox", gSavedSettings.getBOOL("UseDefaultColorPicker")); |
65 | childSetValue("show_search_panel", gSavedSettings.getBOOL("ShowSearchBar")); | 67 | childSetValue("show_search_panel", gSavedSettings.getBOOL("ShowSearchBar")); |
@@ -97,6 +99,8 @@ void LLPanelGeneral::apply() | |||
97 | gSavedSettings.setBOOL("SmallAvatarNames", childGetValue("small_avatar_names_checkbox")); | 99 | gSavedSettings.setBOOL("SmallAvatarNames", childGetValue("small_avatar_names_checkbox")); |
98 | gSavedSettings.setBOOL("RenderHideGroupTitle", childGetValue("show_my_title_checkbox")); | 100 | gSavedSettings.setBOOL("RenderHideGroupTitle", childGetValue("show_my_title_checkbox")); |
99 | gSavedSettings.setF32("AFKTimeout", childGetValue("afk_timeout_spinner").asReal()); | 101 | gSavedSettings.setF32("AFKTimeout", childGetValue("afk_timeout_spinner").asReal()); |
102 | gSavedSettings.setBOOL("MiniMapNotifyChatRange", childGetValue("mini_map_notify_chat")); | ||
103 | gSavedSettings.setBOOL("MiniMapNotifySimRange", childGetValue("mini_map_notify_sim")); | ||
100 | gSavedSettings.setBOOL("NotifyMoneyChange", childGetValue("notify_money_change_checkbox")); | 104 | gSavedSettings.setBOOL("NotifyMoneyChange", childGetValue("notify_money_change_checkbox")); |
101 | gSavedSettings.setBOOL("UseDefaultColorPicker", childGetValue("use_system_color_picker_checkbox")); | 105 | gSavedSettings.setBOOL("UseDefaultColorPicker", childGetValue("use_system_color_picker_checkbox")); |
102 | gSavedSettings.setBOOL("ShowSearchBar", childGetValue("show_search_panel")); | 106 | gSavedSettings.setBOOL("ShowSearchBar", childGetValue("show_search_panel")); |
diff --git a/linden/indra/newview/llprefsim.cpp b/linden/indra/newview/llprefsim.cpp index 3d71202..b6fbc88 100644 --- a/linden/indra/newview/llprefsim.cpp +++ b/linden/indra/newview/llprefsim.cpp | |||
@@ -121,6 +121,7 @@ BOOL LLPrefsIMImpl::postBuild() | |||
121 | childSetValue("include_im_in_chat_history", gSavedSettings.getBOOL("IMInChatHistory")); | 121 | childSetValue("include_im_in_chat_history", gSavedSettings.getBOOL("IMInChatHistory")); |
122 | childSetValue("show_timestamps_check", gSavedSettings.getBOOL("IMShowTimestamps")); | 122 | childSetValue("show_timestamps_check", gSavedSettings.getBOOL("IMShowTimestamps")); |
123 | childSetValue("friends_online_notify_checkbox", gSavedSettings.getBOOL("ChatOnlineNotification")); | 123 | childSetValue("friends_online_notify_checkbox", gSavedSettings.getBOOL("ChatOnlineNotification")); |
124 | childSetValue("vertical-imtabs-toggle", gSavedSettings.getBOOL("VerticalIMTabs")); | ||
124 | 125 | ||
125 | childSetText("log_path_string", gSavedPerAccountSettings.getString("InstantMessageLogPath")); | 126 | childSetText("log_path_string", gSavedPerAccountSettings.getString("InstantMessageLogPath")); |
126 | childSetValue("log_instant_messages", gSavedPerAccountSettings.getBOOL("LogInstantMessages")); | 127 | childSetValue("log_instant_messages", gSavedPerAccountSettings.getBOOL("LogInstantMessages")); |
@@ -216,6 +217,7 @@ void LLPrefsIMImpl::apply() | |||
216 | gAgent.sendReliableMessage(); | 217 | gAgent.sendReliableMessage(); |
217 | } | 218 | } |
218 | } | 219 | } |
220 | gSavedSettings.setBOOL("VerticalIMTabs", childGetValue("vertical-imtabs-toggle").asBoolean()); | ||
219 | } | 221 | } |
220 | 222 | ||
221 | void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) | 223 | void LLPrefsIMImpl::setPersonalInfo(const std::string& visibility, bool im_via_email, const std::string& email) |
diff --git a/linden/indra/newview/lltooldraganddrop.cpp b/linden/indra/newview/lltooldraganddrop.cpp index c99ccbf..178bde6 100644 --- a/linden/indra/newview/lltooldraganddrop.cpp +++ b/linden/indra/newview/lltooldraganddrop.cpp | |||
@@ -2014,10 +2014,10 @@ EAcceptance LLToolDragAndDrop::dad3dRezAttachmentFromInv( | |||
2014 | return ACCEPT_NO; | 2014 | return ACCEPT_NO; |
2015 | } | 2015 | } |
2016 | 2016 | ||
2017 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | Modified: RLVa-1.0.0c | 2017 | // [RLVa:KB] - Checked: 2009-09-08 (RLVa-1.0.2c) | Modified: RLVa-1.0.2c |
2018 | LLViewerJointAttachment* pAttachPt = NULL; | 2018 | LLViewerJointAttachment* pAttachPt = NULL; |
2019 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) && (!RlvSettings::getEnableWear()) && | 2019 | if ( (rlv_handler_t::isEnabled()) && (gRlvHandler.hasLockedAttachment()) && (!RlvSettings::getEnableWear()) && |
2020 | ( ((pAttachPt = gRlvHandler.getAttachPoint(item, true)) == NULL) || (!gRlvHandler.isDetachable(pAttachPt->getObject())) ) ) | 2020 | ( ((pAttachPt = gRlvHandler.getAttachPoint(item, true)) == NULL) || (!gRlvHandler.isDetachable(pAttachPt)) ) ) |
2021 | { | 2021 | { |
2022 | return ACCEPT_NO_LOCKED; | 2022 | return ACCEPT_NO_LOCKED; |
2023 | } | 2023 | } |
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index d11bc02..ceb5d5f 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)); |
@@ -6045,9 +6045,9 @@ private: | |||
6045 | 6045 | ||
6046 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) | 6046 | // [RLVa:KB] - Checked: 2009-07-06 (RLVa-1.0.0c) |
6047 | if ( (rlv_handler_t::isEnabled()) && | 6047 | if ( (rlv_handler_t::isEnabled()) && |
6048 | ( ((index == 0) && (gRlvHandler.hasLockedAttachment())) || // Can't wear on default attach point | 6048 | ( ((index == 0) && (gRlvHandler.hasLockedAttachment())) || // Can't wear on default attach point |
6049 | ((index > 0) && (!gRlvHandler.isDetachable(attachment_point->getObject()))) || // Can't replace locked attachment | 6049 | ((index > 0) && (!gRlvHandler.isDetachable(attachment_point))) || // Can't replace locked attachment |
6050 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take" | 6050 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) ) // Attach on rezzed object == "Take" |
6051 | { | 6051 | { |
6052 | setObjectSelection(NULL); // Clear the selection or it'll get stuck | 6052 | setObjectSelection(NULL); // Clear the selection or it'll get stuck |
6053 | return true; | 6053 | return true; |
@@ -6334,6 +6334,8 @@ class LLAttachmentEnableDrop : public view_listener_t | |||
6334 | { | 6334 | { |
6335 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 6335 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
6336 | { | 6336 | { |
6337 | if (gDisconnected) | ||
6338 | return true; | ||
6337 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); | 6339 | LLParcel* parcel = LLViewerParcelMgr::getInstance()->getAgentParcel(); |
6338 | BOOL can_build = gAgent.isGodlike() || (parcel && parcel->getAllowModify()); | 6340 | BOOL can_build = gAgent.isGodlike() || (parcel && parcel->getAllowModify()); |
6339 | 6341 | ||
@@ -6384,7 +6386,6 @@ class LLAttachmentEnableDrop : public view_listener_t | |||
6384 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) | 6386 | // [RLVa:KB] - Checked: 2009-07-05 (RLVa-1.0.0b) |
6385 | bool new_value = enable_detach(NULL) && can_build && item && (!gRlvHandler.hasBehaviour(RLV_BHVR_REZ)); | 6387 | bool new_value = enable_detach(NULL) && can_build && item && (!gRlvHandler.hasBehaviour(RLV_BHVR_REZ)); |
6386 | // [/RLVa:KB] | 6388 | // [/RLVa:KB] |
6387 | |||
6388 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); | 6389 | gMenuHolder->findControl(userdata["control"].asString())->setValue(new_value); |
6389 | return true; | 6390 | return true; |
6390 | } | 6391 | } |
@@ -6449,9 +6450,9 @@ BOOL object_selected_and_point_valid(void *user_data) | |||
6449 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / right-click / "Attach >" [user_data == pAttachPt] | 6450 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / right-click / "Attach >" [user_data == pAttachPt] |
6450 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / Edit menu / "Attach Object" [user_data == pAttachPt] | 6451 | // - enabler set up in LLVOAvatar::buildCharacter() => Rezzed prim / Edit menu / "Attach Object" [user_data == pAttachPt] |
6451 | LLViewerJointAttachment* pAttachPt = (LLViewerJointAttachment*)user_data; | 6452 | LLViewerJointAttachment* pAttachPt = (LLViewerJointAttachment*)user_data; |
6452 | if ( ((!pAttachPt) && (gRlvHandler.hasLockedAttachment())) || // Don't allow attach to default attach point | 6453 | if ( ((!pAttachPt) && (gRlvHandler.hasLockedAttachment())) || // Don't allow attach to default attach point |
6453 | ((pAttachPt) && (!gRlvHandler.isDetachable(pAttachPt->getObject()))) || // Don't allow replacing of locked attachment | 6454 | ((pAttachPt) && (!gRlvHandler.isDetachable(pAttachPt))) || // Don't allow replacing of locked attachment |
6454 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attaching a rezzed object == "Take" | 6455 | (gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) ) // Attaching a rezzed object == "Take" |
6455 | { | 6456 | { |
6456 | return FALSE; | 6457 | return FALSE; |
6457 | } | 6458 | } |
@@ -10376,7 +10377,7 @@ class RLVaMainToggle : public view_listener_t | |||
10376 | { | 10377 | { |
10377 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 10378 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
10378 | { | 10379 | { |
10379 | rlvDbgToggleEnabled(NULL); | 10380 | rlvToggleEnabled(NULL); |
10380 | return true; | 10381 | return true; |
10381 | } | 10382 | } |
10382 | }; | 10383 | }; |
@@ -10385,7 +10386,7 @@ class RLVaMainCheck : public view_listener_t | |||
10385 | { | 10386 | { |
10386 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 10387 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
10387 | { | 10388 | { |
10388 | bool new_value = rlvDbgGetEnabled(NULL); | 10389 | bool new_value = rlvGetEnabled(NULL); |
10389 | std::string control_name = userdata["control"].asString(); | 10390 | std::string control_name = userdata["control"].asString(); |
10390 | gMenuHolder->findControl(control_name)->setValue(new_value); | 10391 | gMenuHolder->findControl(control_name)->setValue(new_value); |
10391 | return true; | 10392 | return true; |
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index cecef95..d784f52 100644 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp | |||
@@ -78,6 +78,7 @@ | |||
78 | #include "llfloatergroupinfo.h" | 78 | #include "llfloatergroupinfo.h" |
79 | #include "llfloaterimagepreview.h" | 79 | #include "llfloaterimagepreview.h" |
80 | #include "llfloaterland.h" | 80 | #include "llfloaterland.h" |
81 | #include "llfloatermap.h" | ||
81 | #include "llfloaterregioninfo.h" | 82 | #include "llfloaterregioninfo.h" |
82 | #include "llfloaterlandholdings.h" | 83 | #include "llfloaterlandholdings.h" |
83 | #include "llurldispatcher.h" | 84 | #include "llurldispatcher.h" |
@@ -145,6 +146,12 @@ | |||
145 | extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only defined in llfloateravatarinfo.cpp | 146 | extern LLMap< const LLUUID, LLFloaterAvatarInfo* > gAvatarInfoInstances; // Only defined in llfloateravatarinfo.cpp |
146 | // [/RLVa:KB] | 147 | // [/RLVa:KB] |
147 | 148 | ||
149 | //silly spam define D: | ||
150 | bool dialogSpamOn; | ||
151 | static LLFrameTimer d_spam; | ||
152 | std::map< std::string , S32 > lastd_names; | ||
153 | LLDynamicArray< std::string > blacklisted_names; | ||
154 | |||
148 | // | 155 | // |
149 | // Constants | 156 | // Constants |
150 | // | 157 | // |
@@ -1821,6 +1828,14 @@ void process_improved_im(LLMessageSystem *msg, void **user_data) | |||
1821 | } | 1828 | } |
1822 | else | 1829 | else |
1823 | { | 1830 | { |
1831 | // [RLVa:KB] - Version: 1.22.11 | Checked: 2009-09-10 (RLVa-1.0.3a) | ||
1832 | if ( (rlv_handler_t::isEnabled()) && (dialog == IM_TASK_INVENTORY_OFFERED) && | ||
1833 | (info->mDesc.find(RLV_PUTINV_PREFIX) == 1) && (gRlvHandler.getSharedRoot()) ) | ||
1834 | { | ||
1835 | LLFirstUse::warnRlvGiveToRLV(); | ||
1836 | } | ||
1837 | // [/RLVa:KB] | ||
1838 | |||
1824 | inventory_offer_handler(info, dialog == IM_TASK_INVENTORY_OFFERED); | 1839 | inventory_offer_handler(info, dialog == IM_TASK_INVENTORY_OFFERED); |
1825 | } | 1840 | } |
1826 | } | 1841 | } |
@@ -2539,6 +2554,12 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) | |||
2539 | { | 2554 | { |
2540 | ((LLVOAvatar*)chatter)->startTyping(); | 2555 | ((LLVOAvatar*)chatter)->startTyping(); |
2541 | } | 2556 | } |
2557 | |||
2558 | if (LLFloaterMap::getInstance()) | ||
2559 | { | ||
2560 | LLFloaterMap::getInstance()->updateTypingList(from_id, false); | ||
2561 | } | ||
2562 | |||
2542 | return; | 2563 | return; |
2543 | } | 2564 | } |
2544 | else if (CHAT_TYPE_STOP == chat.mChatType) | 2565 | else if (CHAT_TYPE_STOP == chat.mChatType) |
@@ -2550,6 +2571,15 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) | |||
2550 | { | 2571 | { |
2551 | ((LLVOAvatar*)chatter)->stopTyping(); | 2572 | ((LLVOAvatar*)chatter)->stopTyping(); |
2552 | } | 2573 | } |
2574 | |||
2575 | if (LLFloaterMap::getInstance()) | ||
2576 | { | ||
2577 | if (LLFloaterMap::getInstance()->getIsTyping(from_id)) | ||
2578 | { | ||
2579 | LLFloaterMap::getInstance()->updateTypingList(from_id, true); | ||
2580 | } | ||
2581 | } | ||
2582 | |||
2553 | return; | 2583 | return; |
2554 | } | 2584 | } |
2555 | 2585 | ||
@@ -2579,18 +2609,16 @@ void process_chat_from_simulator(LLMessageSystem *msg, void **user_data) | |||
2579 | verb = " " + LLTrans::getString("whisper") + " "; | 2609 | verb = " " + LLTrans::getString("whisper") + " "; |
2580 | break; | 2610 | break; |
2581 | case CHAT_TYPE_OWNER: | 2611 | case CHAT_TYPE_OWNER: |
2582 | // [RLVa:KB] - Checked: 2009-08-05 (RLVa-1.0.1e) | Modified: RLVa-1.0.1e | 2612 | // [RLVa:KB] - Checked: 2009-08-28 (RLVa-1.0.2a) | Modified: RLVa-1.0.2a |
2583 | if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) ) | 2613 | if ( (rlv_handler_t::isEnabled()) && (mesg.length() > 3) && (RLV_CMD_PREFIX == mesg[0]) && (CHAT_TYPE_OWNER == chat.mChatType) ) |
2584 | { | 2614 | { |
2585 | mesg.erase(0, 1); | 2615 | mesg.erase(0, 1); |
2586 | LLStringUtil::toLower(mesg); | 2616 | LLStringUtil::toLower(mesg); |
2587 | 2617 | ||
2588 | std::string strExecuted, strFailed, strRetained, *pstr; | 2618 | std::string strExecuted, strFailed, strRetained, *pstr; |
2589 | 2619 | ||
2590 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; | 2620 | boost_tokenizer tokens(mesg, boost::char_separator<char>(",", "", boost::drop_empty_tokens)); |
2591 | boost::char_separator<char> sep(",", "", boost::drop_empty_tokens); | 2621 | for (boost_tokenizer::const_iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) |
2592 | tokenizer tokens(mesg, sep); | ||
2593 | for (tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) | ||
2594 | { | 2622 | { |
2595 | if (LLStartUp::getStartupState() == STATE_STARTED) | 2623 | if (LLStartUp::getStartupState() == STATE_STARTED) |
2596 | { | 2624 | { |
@@ -4397,7 +4425,7 @@ void process_money_balance_reply( LLMessageSystem* msg, void** ) | |||
4397 | LLUUID tid; | 4425 | LLUUID tid; |
4398 | msg->getUUID("MoneyData", "TransactionID", tid); | 4426 | msg->getUUID("MoneyData", "TransactionID", tid); |
4399 | static std::deque<LLUUID> recent; | 4427 | static std::deque<LLUUID> recent; |
4400 | if(!desc.empty() && gSavedSettings.getBOOL("NotifyMoneyChange") | 4428 | if(!desc.empty() && gSavedSettings.getBOOL("NotifyMoneyChange") && !gDisconnected |
4401 | && (std::find(recent.rbegin(), recent.rend(), tid) == recent.rend())) | 4429 | && (std::find(recent.rbegin(), recent.rend(), tid) == recent.rend())) |
4402 | { | 4430 | { |
4403 | // Make the user confirm the transaction, since they might | 4431 | // Make the user confirm the transaction, since they might |
@@ -5448,6 +5476,21 @@ void process_script_dialog(LLMessageSystem* msg, void**) | |||
5448 | msg->getString("Data", "Message", message); | 5476 | msg->getString("Data", "Message", message); |
5449 | msg->getS32("Data", "ChatChannel", info->mChatChannel); | 5477 | msg->getS32("Data", "ChatChannel", info->mChatChannel); |
5450 | 5478 | ||
5479 | // Don't show lldialog boxes from muted avs -- McCabe | ||
5480 | std::string agent_name = first_name + " " + last_name; | ||
5481 | if (!first_name.empty()) | ||
5482 | { | ||
5483 | std::vector<LLMute> mutes = LLMuteList::getInstance()->getMutes(); | ||
5484 | for (U32 i = 0; i < mutes.size(); i++) | ||
5485 | { | ||
5486 | if (mutes[i].mName == agent_name) | ||
5487 | { | ||
5488 | delete info; | ||
5489 | return; | ||
5490 | } | ||
5491 | } | ||
5492 | } | ||
5493 | |||
5451 | // unused for now | 5494 | // unused for now |
5452 | LLUUID image_id; | 5495 | LLUUID image_id; |
5453 | msg->getUUID("Data", "ImageID", image_id); | 5496 | msg->getUUID("Data", "ImageID", image_id); |
@@ -5470,6 +5513,45 @@ void process_script_dialog(LLMessageSystem* msg, void**) | |||
5470 | args["[MESSAGE]"] = message; | 5513 | args["[MESSAGE]"] = message; |
5471 | if (!first_name.empty()) | 5514 | if (!first_name.empty()) |
5472 | { | 5515 | { |
5516 | // Dialog Spam Prevention by Cryogenic | ||
5517 | if(dialogSpamOn) | ||
5518 | { | ||
5519 | if(!d_spam.getStarted()) | ||
5520 | { | ||
5521 | d_spam.start(); | ||
5522 | } | ||
5523 | if(blacklisted_names.find(agent_name) != -1) | ||
5524 | { | ||
5525 | return; | ||
5526 | } | ||
5527 | std::map< std::string , S32 >::iterator itr = lastd_names.find(agent_name); | ||
5528 | if(itr != lastd_names.end()) | ||
5529 | { | ||
5530 | if(d_spam.getElapsedTimeF32() <= gSavedSettings.getF32("SpamTime")) | ||
5531 | { | ||
5532 | if((*itr).second > gSavedSettings.getF32("SpamCount")) | ||
5533 | { | ||
5534 | blacklisted_names.put(agent_name); | ||
5535 | LL_INFOS("process_script_dialog") << "blocked " << info->mObjectID.asString() << " owned by " << agent_name << LL_ENDL;//" (" << key.asString() << ")" <<LL_ENDL; | ||
5536 | return; | ||
5537 | } | ||
5538 | else | ||
5539 | { | ||
5540 | (*itr).second++; | ||
5541 | } | ||
5542 | } | ||
5543 | else | ||
5544 | { | ||
5545 | lastd_names.erase(lastd_names.begin(),lastd_names.end()); | ||
5546 | d_spam.reset(); | ||
5547 | } | ||
5548 | } | ||
5549 | else | ||
5550 | { | ||
5551 | //llinfos << "Added " << fullname << " to list" << llendl; | ||
5552 | lastd_names[agent_name] = 0; | ||
5553 | } | ||
5554 | } | ||
5473 | args["[FIRST]"] = first_name; | 5555 | args["[FIRST]"] = first_name; |
5474 | args["[LAST]"] = last_name; | 5556 | args["[LAST]"] = last_name; |
5475 | LLNotifyBox::showXml("ScriptDialog", args, | 5557 | LLNotifyBox::showXml("ScriptDialog", args, |
diff --git a/linden/indra/newview/llviewerregion.cpp b/linden/indra/newview/llviewerregion.cpp index 0ba0879..2179c0b 100644 --- a/linden/indra/newview/llviewerregion.cpp +++ b/linden/indra/newview/llviewerregion.cpp | |||
@@ -917,10 +917,12 @@ bool LLViewerRegion::isAlive() | |||
917 | 917 | ||
918 | BOOL LLViewerRegion::isOwnedSelf(const LLVector3& pos) | 918 | BOOL LLViewerRegion::isOwnedSelf(const LLVector3& pos) |
919 | { | 919 | { |
920 | if (mParcelOverlay) | 920 | if (mParcelOverlay && !gDisconnected) |
921 | { | 921 | { |
922 | return mParcelOverlay->isOwnedSelf(pos); | 922 | return mParcelOverlay->isOwnedSelf(pos); |
923 | } else { | 923 | } |
924 | else | ||
925 | { | ||
924 | return FALSE; | 926 | return FALSE; |
925 | } | 927 | } |
926 | } | 928 | } |
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index 99bbb2a..df10b4f 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp | |||
@@ -596,7 +596,14 @@ BOOL LLViewerWindow::handleAnyMouseClick(LLWindow *window, LLCoordGL pos, MASK | |||
596 | } | 596 | } |
597 | 597 | ||
598 | // Make sure we get a coresponding mouseup event, even if the mouse leaves the window | 598 | // Make sure we get a coresponding mouseup event, even if the mouse leaves the window |
599 | mWindow->captureMouse(); | 599 | if (down) |
600 | { | ||
601 | mWindow->captureMouse(); | ||
602 | } | ||
603 | else | ||
604 | { | ||
605 | mWindow->releaseMouse(); | ||
606 | } | ||
600 | 607 | ||
601 | // Indicate mouse was active | 608 | // Indicate mouse was active |
602 | gMouseIdleTimer.reset(); | 609 | gMouseIdleTimer.reset(); |
diff --git a/linden/indra/newview/res/viewerRes.rc b/linden/indra/newview/res/viewerRes.rc index e9307d4..7577685 100644 --- a/linden/indra/newview/res/viewerRes.rc +++ b/linden/indra/newview/res/viewerRes.rc | |||
@@ -231,8 +231,8 @@ TOOLMEDIAOPEN CURSOR "toolmediaopen.cur" | |||
231 | // | 231 | // |
232 | 232 | ||
233 | VS_VERSION_INFO VERSIONINFO | 233 | VS_VERSION_INFO VERSIONINFO |
234 | FILEVERSION 1,20,15,97417 | 234 | FILEVERSION 1,2,0 |
235 | PRODUCTVERSION 1,20,15,97417 | 235 | PRODUCTVERSION 1,2,0 |
236 | FILEFLAGSMASK 0x3fL | 236 | FILEFLAGSMASK 0x3fL |
237 | #ifdef _DEBUG | 237 | #ifdef _DEBUG |
238 | FILEFLAGS 0x1L | 238 | FILEFLAGS 0x1L |
@@ -249,11 +249,11 @@ BEGIN | |||
249 | BEGIN | 249 | BEGIN |
250 | VALUE "CompanyName", "Imprudence Viewer Project" | 250 | VALUE "CompanyName", "Imprudence Viewer Project" |
251 | VALUE "FileDescription", "Imprudence" | 251 | VALUE "FileDescription", "Imprudence" |
252 | VALUE "FileVersion", "1.2.0 beta" | 252 | VALUE "FileVersion", "1.2.0 beta 2" |
253 | VALUE "InternalName", "Imprudence" | 253 | VALUE "InternalName", "Imprudence" |
254 | VALUE "OriginalFilename", "Imprudence.exe" | 254 | VALUE "OriginalFilename", "Imprudence.exe" |
255 | VALUE "ProductName", "Imprudence" | 255 | VALUE "ProductName", "Imprudence" |
256 | VALUE "ProductVersion", "1.2.0 beta" | 256 | VALUE "ProductVersion", "1.2.0 beta 2" |
257 | END | 257 | END |
258 | END | 258 | END |
259 | BLOCK "VarFileInfo" | 259 | BLOCK "VarFileInfo" |
diff --git a/linden/indra/newview/rlvdefines.h b/linden/indra/newview/rlvdefines.h new file mode 100644 index 0000000..4e6a4d4 --- /dev/null +++ b/linden/indra/newview/rlvdefines.h | |||
@@ -0,0 +1,201 @@ | |||
1 | #ifndef RLV_DEFINES_H | ||
2 | #define RLV_DEFINES_H | ||
3 | |||
4 | // ============================================================================ | ||
5 | // Extensions | ||
6 | // | ||
7 | |||
8 | // Comment out if you don't want the Advanced / RLVa menu (may prevent enabling some extensions or experimental features - see below) | ||
9 | #define RLV_ADVANCED_MENU | ||
10 | // Comment out if you provide your own way to enable/disable RLVa | ||
11 | #define RLV_ADVANCED_TOGGLE_RLVA | ||
12 | |||
13 | // Provides access to "advanced" feature through the RLVa debug menu | ||
14 | #define RLV_EXTENSION_ENABLE_WEAR // "Enable Wear" | ||
15 | #define RLV_EXTENSION_FLOATER_RESTRICTIONS // Enables the Advanced / RLVa / Restrictions... floater | ||
16 | #define RLV_EXTENSION_HIDELOCKED // "Hide locked layers", "Hide locked attachments" and "Hide locked inventory" | ||
17 | |||
18 | // Extensions | ||
19 | #define RLV_EXTENSION_CMD_GETSETDEBUG_EX // Extends the debug variables accessible through @getdebug_xxx/@setdebug_xxx | ||
20 | #define RLV_EXTENSION_CMD_FINDFOLDERS // @findfolders:<option>=<channel> - @findfolder with multiple results | ||
21 | #define RLV_EXTENSION_FLAG_NOSTRIP // Layers and attachments marked as "nostrip" are exempt from @detach/@remoutfit | ||
22 | #define RLV_EXTENSION_STARTLOCATION // Reenables "Start Location" at login if not @tploc=n or @unsit=n restricted at last logoff | ||
23 | #define RLV_EXPERIMENTAL // Enables/disables experimental features en masse | ||
24 | |||
25 | // Experimental features | ||
26 | #ifdef RLV_EXPERIMENTAL | ||
27 | // Stable (will mature to RLV_EXTENSION_XXX in next release if no bugs are found) | ||
28 | #define RLV_EXPERIMENTAL_FARTOUCH_FEEDBACK // Enables "cleaner" UI responses when fartouch blocks something | ||
29 | |||
30 | // Under testing (stable, but requires further testing - safe for public release but may be quirky) | ||
31 | #define RLV_EXPERIMENTAL_FIRSTUSE // Enables a number of "first use" popups | ||
32 | |||
33 | // Under development (don't include in public release) | ||
34 | #if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG | ||
35 | #endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG | ||
36 | #endif // RLV_EXPERIMENTAL | ||
37 | |||
38 | // ============================================================================ | ||
39 | // Defines | ||
40 | // | ||
41 | |||
42 | // Version of the specifcation we support | ||
43 | const S32 RLV_VERSION_MAJOR = 1; | ||
44 | const S32 RLV_VERSION_MINOR = 20; | ||
45 | const S32 RLV_VERSION_PATCH = 2; | ||
46 | |||
47 | // Implementation version | ||
48 | const S32 RLVa_VERSION_MAJOR = 1; | ||
49 | const S32 RLVa_VERSION_MINOR = 0; | ||
50 | const S32 RLVa_VERSION_PATCH = 3; | ||
51 | const S32 RLVa_VERSION_BUILD = 4; | ||
52 | |||
53 | // The official viewer version we're patching against | ||
54 | #define RLV_MAKE_TARGET(x, y, z) ((x << 16) | (y << 8) | z) | ||
55 | #define RLV_TARGET RLV_MAKE_TARGET(1, 22, 11) | ||
56 | |||
57 | // Defining these makes it easier if we ever need to change our tag | ||
58 | #define RLV_WARNS LL_WARNS("RLV") | ||
59 | #define RLV_INFOS LL_INFOS("RLV") | ||
60 | #define RLV_DEBUGS LL_DEBUGS("RLV") | ||
61 | |||
62 | #if LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG | ||
63 | // Turn on extended debugging information | ||
64 | #define RLV_DEBUG | ||
65 | // Make sure we halt execution on errors | ||
66 | #define RLV_ERRS LL_ERRS("RLV") | ||
67 | // Uncomment to enable the Advanced / RLVa / Unit Tests menu (non-public) | ||
68 | //#define RLV_DEBUG_TESTS | ||
69 | #else | ||
70 | // Uncomment if you want extended debugging information on release builds | ||
71 | //#define RLV_DEBUG | ||
72 | // Don't halt execution on errors in release | ||
73 | #define RLV_ERRS LL_WARNS("RLV") | ||
74 | #endif // LL_RELEASE_WITH_DEBUG_INFO || LL_DEBUG | ||
75 | |||
76 | #define RLV_ROOT_FOLDER "#RLV" | ||
77 | #define RLV_CMD_PREFIX '@' | ||
78 | #define RLV_PUTINV_PREFIX "#RLV/~" | ||
79 | #define RLV_SETROT_OFFSET F_PI_BY_TWO // @setrot is off by 90° with the rest of SL | ||
80 | |||
81 | #define RLV_FOLDER_FLAG_NOSTRIP "nostrip" | ||
82 | #define RLV_FOLDER_PREFIX_HIDDEN '.' | ||
83 | #define RLV_FOLDER_PREFIX_PUTINV '~' | ||
84 | |||
85 | // ============================================================================ | ||
86 | // Enumeration declarations | ||
87 | // | ||
88 | |||
89 | // NOTE: any changes to this enumeration should be reflected in initLookupTable() | ||
90 | enum ERlvBehaviour { | ||
91 | RLV_BHVR_VERSION = 0, // "version" | ||
92 | RLV_BHVR_DETACH, // "detach" | ||
93 | RLV_BHVR_SENDCHAT, // "sendchat" | ||
94 | RLV_BHVR_EMOTE, // "emote" | ||
95 | RLV_BHVR_CHATSHOUT, // "chatshout" | ||
96 | RLV_BHVR_CHATNORMAL, // "chatnormal" | ||
97 | RLV_BHVR_CHATWHISPER, // "chatwhisper" | ||
98 | RLV_BHVR_REDIRCHAT, // "redirchat" | ||
99 | RLV_BHVR_REDIREMOTE, // "rediremote" | ||
100 | RLV_BHVR_SENDIM, // "sendim" | ||
101 | RLV_BHVR_RECVCHAT, // "recvchat" | ||
102 | RLV_BHVR_RECVEMOTE, // "recvemote" | ||
103 | RLV_BHVR_RECVIM, // "recvim" | ||
104 | RLV_BHVR_TPLM, // "tplm" | ||
105 | RLV_BHVR_TPLOC, // "tploc" | ||
106 | RLV_BHVR_TPLURE, // "tplure" | ||
107 | RLV_BHVR_SITTP, // "sittp" | ||
108 | RLV_BHVR_EDIT, // "edit" | ||
109 | RLV_BHVR_REZ, // "rez" | ||
110 | RLV_BHVR_ADDOUTFIT, // "addoutfit" | ||
111 | RLV_BHVR_REMOUTFIT, // "remoutfit" | ||
112 | RLV_BHVR_GETOUTFIT, // "getoutfit" | ||
113 | RLV_BHVR_GETATTACH, // "getattach" | ||
114 | RLV_BHVR_SHOWINV, // "showinv" | ||
115 | RLV_BHVR_VIEWNOTE, // "viewnote" | ||
116 | RLV_BHVR_UNSIT, // "unsit" | ||
117 | RLV_BHVR_SIT, // "sit" | ||
118 | RLV_BHVR_SENDCHANNEL, // "sendchannel" | ||
119 | RLV_BHVR_GETSTATUS, // "getstatus" | ||
120 | RLV_BHVR_GETSTATUSALL, // "getstatusall" | ||
121 | RLV_BHVR_GETINV, // "getinv" | ||
122 | RLV_BHVR_GETINVWORN, // "getinvworn" | ||
123 | RLV_BHVR_FINDFOLDER, // "findfolder" | ||
124 | RLV_BHVR_FINDFOLDERS, // "findfolders" | ||
125 | RLV_BHVR_ATTACH, // "attach" | ||
126 | RLV_BHVR_ATTACHALL, // "attachall" | ||
127 | RLV_BHVR_DETACHALL, // "detachall" | ||
128 | RLV_BHVR_GETPATH, // "getpath" | ||
129 | RLV_BHVR_ATTACHTHIS, // "attachthis" | ||
130 | RLV_BHVR_ATTACHALLTHIS, // "attachallthis" | ||
131 | RLV_BHVR_DETACHTHIS, // "detachthis" | ||
132 | RLV_BHVR_DETACHALLTHIS, // "detachallthis" | ||
133 | RLV_BHVR_FARTOUCH, // "fartouch" | ||
134 | RLV_BHVR_SHOWWORLDMAP, // "showworldmap" | ||
135 | RLV_BHVR_SHOWMINIMAP, // "showminimap" | ||
136 | RLV_BHVR_SHOWLOC, // "showloc" | ||
137 | RLV_BHVR_TPTO, // "tpto" | ||
138 | RLV_BHVR_ACCEPTTP, // "accepttp" | ||
139 | RLV_BHVR_SHOWNAMES, // "shownames" | ||
140 | RLV_BHVR_FLY, // "fly" | ||
141 | RLV_BHVR_GETSITID, // "getsitid" | ||
142 | RLV_BHVR_SETDEBUG, // "setdebug" | ||
143 | RLV_BHVR_SETENV, // "setenv" | ||
144 | RLV_BHVR_DETACHME, // "detachme" | ||
145 | RLV_BHVR_SHOWHOVERTEXTALL, // "showhovertextall" | ||
146 | RLV_BHVR_SHOWHOVERTEXTWORLD, // "showhovertextworld" | ||
147 | RLV_BHVR_SHOWHOVERTEXTHUD, // "showhovertexthud" | ||
148 | RLV_BHVR_SHOWHOVERTEXT, // "showhovertext" | ||
149 | RLV_BHVR_NOTIFY, // "notify" | ||
150 | |||
151 | RLV_BHVR_COUNT, | ||
152 | RLV_BHVR_UNKNOWN | ||
153 | }; | ||
154 | |||
155 | enum ERlvParamType { | ||
156 | RLV_TYPE_UNKNOWN, | ||
157 | RLV_TYPE_ADD, // <param> == "n"|"add" | ||
158 | RLV_TYPE_REMOVE, // <param> == "y"|"rem" | ||
159 | RLV_TYPE_FORCE, // <param> == "force" | ||
160 | RLV_TYPE_REPLY, // <param> == <number> | ||
161 | RLV_TYPE_CLEAR | ||
162 | }; | ||
163 | |||
164 | enum ERlvCmdRet { | ||
165 | RLV_RET_NOERROR, // Command executed succesfully | ||
166 | RLV_RET_RETAINED, // Command was retained | ||
167 | RLV_RET_DISABLED, // Command is disabled (by user) | ||
168 | RLV_RET_FAILED, // Command failed (general failure) | ||
169 | RLV_RET_FAILED_SYNTAX, // Command failed (syntax error) | ||
170 | RLV_RET_FAILED_UNSET, // Command failed (unset restriction) | ||
171 | RLV_RET_FAILED_DUPLICATE, // Command failed (duplicate) | ||
172 | RLV_RET_FAILED_OPTION, // Command failed (invalid option) | ||
173 | RLV_RET_FAILED_PARAM, // Command failed (invalid param) | ||
174 | RLV_RET_UNKNOWN // Command unkown | ||
175 | }; | ||
176 | |||
177 | // ============================================================================ | ||
178 | // Settings | ||
179 | |||
180 | #define RLV_SETTING_MAIN "RestrainedLife" | ||
181 | #define RLV_SETTING_DEBUG "RestrainedLifeDebug" | ||
182 | #define RLV_SETTING_NOSETENV "RestrainedLifeNoSetEnv" | ||
183 | #define RLV_SETTING_FORBIDGIVETORLV "RestrainedLifeForbidGiveToRLV" | ||
184 | |||
185 | #define RLV_SETTING_ENABLEWEAR "RLVaEnableWear" | ||
186 | #define RLV_SETTING_ENABLELEGACYNAMING "RLVaEnableLegacyNaming" | ||
187 | #define RLV_SETTING_HIDELOCKEDLAYER "RLVaHideLockedLayers" | ||
188 | #define RLV_SETTING_HIDELOCKEDATTACH "RLVaHideLockedAttachments" | ||
189 | #define RLV_SETTING_HIDELOCKEDINVENTORY "RLVaHideLockedInventory" | ||
190 | #define RLV_SETTING_LOGINLASTLOCATION "RLVaLoginLastLocation" | ||
191 | #define RLV_SETTING_SHOWNAMETAGS "RLVaShowNameTags" | ||
192 | |||
193 | #define RLV_SETTING_FIRSTUSE_PREFIX "FirstRLV" | ||
194 | #define RLV_SETTING_FIRSTUSE_DETACH RLV_SETTING_FIRSTUSE_PREFIX"Detach" | ||
195 | #define RLV_SETTING_FIRSTUSE_ENABLEWEAR RLV_SETTING_FIRSTUSE_PREFIX"EnableWear" | ||
196 | #define RLV_SETTING_FIRSTUSE_FARTOUCH RLV_SETTING_FIRSTUSE_PREFIX"Fartouch" | ||
197 | #define RLV_SETTING_FIRSTUSE_GIVETORLV RLV_SETTING_FIRSTUSE_PREFIX"GiveToRLV" | ||
198 | |||
199 | // ============================================================================ | ||
200 | |||
201 | #endif // RLV_DEFINES_H | ||
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 2915002..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" |
@@ -93,10 +94,10 @@ inline bool rlvIsWearingItem(const LLInventoryItem* pItem) | |||
93 | static bool rlvParseNotifyOption(const std::string& strOption, S32& nChannel, std::string& strFilter) | 94 | static bool rlvParseNotifyOption(const std::string& strOption, S32& nChannel, std::string& strFilter) |
94 | { | 95 | { |
95 | boost_tokenizer tokens(strOption, boost::char_separator<char>(";", "", boost::keep_empty_tokens)); | 96 | boost_tokenizer tokens(strOption, boost::char_separator<char>(";", "", boost::keep_empty_tokens)); |
96 | boost_tokenizer::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 |
@@ -274,7 +275,7 @@ bool RlvHandler::isDetachableExcept(S32 idxAttachPt, LLViewerObject *pObj) const | |||
274 | return true; | 275 | return true; |
275 | } | 276 | } |
276 | 277 | ||
277 | // Checked: 2009-05-31 (RLVa-0.2.0e) | Modified: RLVa-0.2.0e | 278 | // Checked: 2009-09-06 (RLVa-1.0.2b) | Modified: RLVa-1.0.2b |
278 | bool RlvHandler::setDetachable(S32 idxAttachPt, const LLUUID& idRlvObj, bool fDetachable) | 279 | bool RlvHandler::setDetachable(S32 idxAttachPt, const LLUUID& idRlvObj, bool fDetachable) |
279 | { | 280 | { |
280 | // Sanity check - make sure it's an object we know about | 281 | // Sanity check - make sure it's an object we know about |
@@ -284,20 +285,16 @@ bool RlvHandler::setDetachable(S32 idxAttachPt, const LLUUID& idRlvObj, bool fDe | |||
284 | 285 | ||
285 | if (!fDetachable) | 286 | if (!fDetachable) |
286 | { | 287 | { |
287 | // Sanity check - make sure it's not already marked undetachable by this object (NOTE: m_Attachments is a *multimap*, not a map) | 288 | #ifdef RLV_EXPERIMENTAL_FIRSTUSE |
288 | for (rlv_detach_map_t::const_iterator itAttach = m_Attachments.lower_bound(idxAttachPt), | 289 | LLFirstUse::useRlvDetach(); |
289 | endAttach = m_Attachments.upper_bound(idxAttachPt); itAttach != endAttach; ++itAttach) | 290 | #endif // RLV_EXPERIMENTAL_FIRSTUSE |
290 | { | ||
291 | if (itObj->second.m_UUID == itAttach->second) | ||
292 | return false; | ||
293 | } | ||
294 | 291 | ||
292 | // NOTE: m_Attachments can contain duplicate <idxAttachPt, idRlvObj> pairs (ie @detach:spine=n,detach=n from an attachment on spine) | ||
295 | 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)); |
296 | return true; | 294 | return true; |
297 | } | 295 | } |
298 | else | 296 | else |
299 | { | 297 | { |
300 | // NOTE: m_Attachments is a *multimap*, not a map | ||
301 | for (rlv_detach_map_t::iterator itAttach = m_Attachments.lower_bound(idxAttachPt), | 298 | for (rlv_detach_map_t::iterator itAttach = m_Attachments.lower_bound(idxAttachPt), |
302 | endAttach = m_Attachments.upper_bound(idxAttachPt); itAttach != endAttach; ++itAttach) | 299 | endAttach = m_Attachments.upper_bound(idxAttachPt); itAttach != endAttach; ++itAttach) |
303 | { | 300 | { |
@@ -325,11 +322,11 @@ bool RlvHandler::setDetachable(S32 idxAttachPt, const LLUUID& idRlvObj, bool fDe | |||
325 | LLViewerInventoryItem* pItem = gInventory.getItem(idItem); | 322 | LLViewerInventoryItem* pItem = gInventory.getItem(idItem); |
326 | if (pItem) | 323 | if (pItem) |
327 | { | 324 | { |
328 | if (-1 != pItem->getName().find(RLV_FOLDER_FLAG_NOSTRIP)) | 325 | if (std::string::npos != pItem->getName().find(RLV_FOLDER_FLAG_NOSTRIP)) |
329 | return false; | 326 | return false; |
330 | 327 | ||
331 | LLViewerInventoryCategory* pFolder = gInventory.getCategory(pItem->getParentUUID()); | 328 | LLViewerInventoryCategory* pFolder = gInventory.getCategory(pItem->getParentUUID()); |
332 | if ( (pFolder) && (-1 != pFolder->getName().find(RLV_FOLDER_FLAG_NOSTRIP)) ) | 329 | if ( (pFolder) && (std::string::npos != pFolder->getName().find(RLV_FOLDER_FLAG_NOSTRIP)) ) |
333 | return false; | 330 | return false; |
334 | } | 331 | } |
335 | } | 332 | } |
@@ -477,6 +474,10 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b | |||
477 | } | 474 | } |
478 | } | 475 | } |
479 | break; | 476 | break; |
477 | case RLV_TYPE_CLEAR: | ||
478 | fRet = processClearCommand(uuid, rlvCmd); | ||
479 | notifyBehaviourObservers(rlvCmd, !fFromObj); | ||
480 | break; | ||
480 | case RLV_TYPE_FORCE: // Checked: | 481 | case RLV_TYPE_FORCE: // Checked: |
481 | fRet = processForceCommand(uuid, rlvCmd); | 482 | fRet = processForceCommand(uuid, rlvCmd); |
482 | break; | 483 | break; |
@@ -484,32 +485,6 @@ BOOL RlvHandler::processCommand(const LLUUID& uuid, const std::string& strCmd, b | |||
484 | fRet = processReplyCommand(uuid, rlvCmd); | 485 | fRet = processReplyCommand(uuid, rlvCmd); |
485 | break; | 486 | break; |
486 | case RLV_TYPE_UNKNOWN: // Checked: | 487 | case RLV_TYPE_UNKNOWN: // Checked: |
487 | { | ||
488 | if ("clear" == rlvCmd.getBehaviour()) | ||
489 | { | ||
490 | const std::string& strFilter = rlvCmd.getParam(); std::string strCmdRem; | ||
491 | |||
492 | rlv_object_map_t::const_iterator itObj = m_Objects.find(uuid); | ||
493 | if (itObj != m_Objects.end()) // No sense in @clear'ing if we don't have any commands for this object | ||
494 | { | ||
495 | const RlvObject& rlvObj = itObj->second; bool fContinue = true; | ||
496 | for (rlv_command_list_t::const_iterator itCmd = rlvObj.m_Commands.begin(), itCurCmd; | ||
497 | ((fContinue) && (itCmd != rlvObj.m_Commands.end())); ) | ||
498 | { | ||
499 | itCurCmd = itCmd++; // Point itCmd ahead so it won't get invalidated if/when we erase a command | ||
500 | |||
501 | const RlvCommand& rlvCmdRem = *itCurCmd; | ||
502 | if ( (strFilter.empty()) || (-1 != rlvCmdRem.asString().find(strFilter)) ) | ||
503 | { | ||
504 | fContinue = (rlvObj.m_Commands.size() > 1); // rlvObj will become invalid once we remove the last command | ||
505 | strCmdRem = rlvCmdRem.getBehaviour() + ":" + rlvCmdRem.getOption() + "=y"; | ||
506 | processCommand(uuid, strCmdRem, false); | ||
507 | } | ||
508 | } | ||
509 | fRet = TRUE; | ||
510 | } | ||
511 | } | ||
512 | } | ||
513 | break; | 488 | break; |
514 | #ifdef LL_GNUC | 489 | #ifdef LL_GNUC |
515 | default: | 490 | default: |
@@ -671,6 +646,13 @@ BOOL RlvHandler::processAddCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) | |||
671 | LLFloaterChat::getInstance()->childSetVisible("active_speakers_panel", false); | 646 | LLFloaterChat::getInstance()->childSetVisible("active_speakers_panel", false); |
672 | } | 647 | } |
673 | 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; | ||
674 | 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) |
675 | { | 657 | { |
676 | // If currently flying, simulate clicking the Fly button [see LLToolBar::onClickFly()] | 658 | // If currently flying, simulate clicking the Fly button [see LLToolBar::onClickFly()] |
@@ -780,22 +762,15 @@ BOOL RlvHandler::processRemoveCommand(const LLUUID& uuid, const RlvCommand& rlvC | |||
780 | { | 762 | { |
781 | case RLV_BHVR_DETACH: // @detach[:<option>]=y - Checked: 2009-08-04 (RLVa-1.0.1d) | Modified: RLVa-1.0.1d | 763 | case RLV_BHVR_DETACH: // @detach[:<option>]=y - Checked: 2009-08-04 (RLVa-1.0.1d) | Modified: RLVa-1.0.1d |
782 | { | 764 | { |
783 | S32 idxAttachPt; | 765 | S32 idxAttachPt = 0; |
784 | if (strOption.empty()) // @detach=y | 766 | if (strOption.empty()) // @detach=y |
785 | { | 767 | { |
786 | // The object may or may not (if it got detached) still exist so clean up the hard way | 768 | // The object may or may not (if it got detached) still exist |
787 | if (m_Objects.find(uuid) != m_Objects.end()) | 769 | rlv_object_map_t::const_iterator itObj = m_Objects.find(uuid); |
788 | { | 770 | if (itObj != m_Objects.end()) |
789 | for (rlv_detach_map_t::const_iterator itAttach = m_Attachments.begin(), endAttach = m_Attachments.end(); | 771 | idxAttachPt = itObj->second.m_idxAttachPt; |
790 | itAttach != endAttach; ++itAttach) | 772 | if (idxAttachPt) |
791 | { | 773 | setDetachable(idxAttachPt, uuid, true); |
792 | if (itAttach->second == uuid) | ||
793 | { | ||
794 | setDetachable(itAttach->first, uuid, true); // <- invalidates our iterators on return | ||
795 | break; | ||
796 | } | ||
797 | } | ||
798 | } | ||
799 | } | 774 | } |
800 | else if ((idxAttachPt = getAttachPointIndex(strOption, true))) // @detach:<attachpt>=y | 775 | else if ((idxAttachPt = getAttachPointIndex(strOption, true))) // @detach:<attachpt>=y |
801 | { | 776 | { |
@@ -915,6 +890,35 @@ BOOL RlvHandler::processRemoveCommand(const LLUUID& uuid, const RlvCommand& rlvC | |||
915 | 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 |
916 | } | 891 | } |
917 | 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 | |||
918 | BOOL RlvHandler::processForceCommand(const LLUUID& idObj, const RlvCommand& rlvCmd) const | 922 | BOOL RlvHandler::processForceCommand(const LLUUID& idObj, const RlvCommand& rlvCmd) const |
919 | { | 923 | { |
920 | const std::string& strOption = rlvCmd.getOption(); | 924 | const std::string& strOption = rlvCmd.getOption(); |
@@ -946,10 +950,8 @@ BOOL RlvHandler::processForceCommand(const LLUUID& idObj, const RlvCommand& rlvC | |||
946 | { | 950 | { |
947 | LLVector3d posGlobal; | 951 | LLVector3d posGlobal; |
948 | 952 | ||
949 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; | 953 | boost_tokenizer tokens(strOption, boost::char_separator<char>("/", "", boost::keep_empty_tokens)); int idx = 0; |
950 | boost::char_separator<char> sep("/", "", boost::keep_empty_tokens); | 954 | for (boost_tokenizer::const_iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) |
951 | tokenizer tokens(strOption, sep); int idx = 0; | ||
952 | for (tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) | ||
953 | { | 955 | { |
954 | if (idx < 3) | 956 | if (idx < 3) |
955 | LLStringUtil::convertToF64(*itToken, posGlobal[idx++]); | 957 | LLStringUtil::convertToF64(*itToken, posGlobal[idx++]); |
@@ -1165,7 +1167,7 @@ BOOL RlvHandler::processReplyCommand(const LLUUID& uuid, const RlvCommand& rlvCm | |||
1165 | case RLV_BHVR_GETINVWORN: // @getinvworn[:path]=<channel> - Checked: | 1167 | case RLV_BHVR_GETINVWORN: // @getinvworn[:path]=<channel> - Checked: |
1166 | onGetInvWorn(rlvCmd.getOption(), strReply); | 1168 | onGetInvWorn(rlvCmd.getOption(), strReply); |
1167 | break; | 1169 | break; |
1168 | case RLV_BHVR_FINDFOLDER: // @findfolder:<criteria>=<channel> - Checked: 2009-07-12 (RLVa-1.0.0h) | 1170 | case RLV_BHVR_FINDFOLDER: // @findfolder:<criteria>=<channel> - Checked: 2009-08-26 (RLVa-1.0.2a) | Modified: RLVa-1.0.2a |
1169 | { | 1171 | { |
1170 | // COMPAT-RLV: RLV 1.16.1 returns the first random folder it finds (probably tries to match "" to a folder name?) | 1172 | // COMPAT-RLV: RLV 1.16.1 returns the first random folder it finds (probably tries to match "" to a folder name?) |
1171 | // (just going to stick with what's there for now... no option => no folder) | 1173 | // (just going to stick with what's there for now... no option => no folder) |
@@ -1173,7 +1175,8 @@ BOOL RlvHandler::processReplyCommand(const LLUUID& uuid, const RlvCommand& rlvCm | |||
1173 | if ( (!strOption.empty()) && (findSharedFolders(strOption, folders)) ) | 1175 | if ( (!strOption.empty()) && (findSharedFolders(strOption, folders)) ) |
1174 | { | 1176 | { |
1175 | // We need to return an "in depth" result so whoever has the most '/' is our lucky winner | 1177 | // We need to return an "in depth" result so whoever has the most '/' is our lucky winner |
1176 | int maxSlashes = 0, curSlashes; std::string strFolderName; | 1178 | // (maxSlashes needs to be initialized to -1 since children of the #RLV folder won't have '/' in their shared path) |
1179 | int maxSlashes = -1, curSlashes; std::string strFolderName; | ||
1177 | for (S32 idxFolder = 0, cntFolder = folders.count(); idxFolder < cntFolder; idxFolder++) | 1180 | for (S32 idxFolder = 0, cntFolder = folders.count(); idxFolder < cntFolder; idxFolder++) |
1178 | { | 1181 | { |
1179 | strFolderName = getSharedPath(folders.get(idxFolder)); | 1182 | strFolderName = getSharedPath(folders.get(idxFolder)); |
@@ -1307,6 +1310,9 @@ void RlvHandler::onAttach(LLViewerJointAttachment* pAttachPt, bool fFullyLoaded) | |||
1307 | rlv_object_map_t::iterator itObj = m_Objects.find(pObj->getID()); | 1310 | rlv_object_map_t::iterator itObj = m_Objects.find(pObj->getID()); |
1308 | if (itObj != m_Objects.end()) | 1311 | if (itObj != m_Objects.end()) |
1309 | { | 1312 | { |
1313 | // Save the attachment point index | ||
1314 | itObj->second.m_idxAttachPt = idxAttachPt; | ||
1315 | |||
1310 | // If it's an attachment we processed commands for but that only just rezzed in we need to mark it as existing in gObjectList | 1316 | // If it's an attachment we processed commands for but that only just rezzed in we need to mark it as existing in gObjectList |
1311 | if (!itObj->second.m_fLookup) | 1317 | if (!itObj->second.m_fLookup) |
1312 | itObj->second.m_fLookup = true; | 1318 | itObj->second.m_fLookup = true; |
@@ -1315,7 +1321,7 @@ void RlvHandler::onAttach(LLViewerJointAttachment* pAttachPt, bool fFullyLoaded) | |||
1315 | if (itObj->second.hasBehaviour(RLV_BHVR_DETACH)) | 1321 | if (itObj->second.hasBehaviour(RLV_BHVR_DETACH)) |
1316 | { | 1322 | { |
1317 | // (Copy/paste from processAddCommand) | 1323 | // (Copy/paste from processAddCommand) |
1318 | setDetachable(pObj, pObj->getID(), false); | 1324 | setDetachable(idxAttachPt, pObj->getID(), false); |
1319 | 1325 | ||
1320 | if (pObj->isHUDAttachment()) | 1326 | if (pObj->isHUDAttachment()) |
1321 | LLPipeline::sShowHUDAttachments = TRUE; // Prevents hiding of locked HUD attachments | 1327 | LLPipeline::sShowHUDAttachments = TRUE; // Prevents hiding of locked HUD attachments |
@@ -1365,29 +1371,15 @@ void RlvHandler::onAttach(LLViewerJointAttachment* pAttachPt, bool fFullyLoaded) | |||
1365 | (!getAttachPoint(pFolder, true)) ) | 1371 | (!getAttachPoint(pFolder, true)) ) |
1366 | { | 1372 | { |
1367 | // It's no mod and its parent folder doesn't contain an attach point | 1373 | // It's no mod and its parent folder doesn't contain an attach point |
1368 | LLInventoryModel::cat_array_t* pFolders; | 1374 | if ( (1 == rlvGetDirectDescendentsCount(pFolder, LLAssetType::AT_OBJECT)) && (NEW_CATEGORY_NAME == pFolder->getName()) ) |
1369 | LLInventoryModel::item_array_t* pItems; | ||
1370 | gInventory.getDirectDescendentsOf(pFolder->getUUID(), pFolders, pItems); | ||
1371 | |||
1372 | if (pItems) | ||
1373 | { | 1375 | { |
1374 | int cntObjects = 0; | ||
1375 | for (S32 idxItem = 0, cntItem = pItems->size(); idxItem < cntItem; idxItem++) | ||
1376 | { | ||
1377 | if (LLAssetType::AT_OBJECT == pItems->get(idxItem)->getType()) | ||
1378 | cntObjects++; | ||
1379 | } | ||
1380 | |||
1381 | // Only rename if there's exactly 1 object/attachment inside of it [see LLFolderBridge::renameItem()] | 1376 | // Only rename if there's exactly 1 object/attachment inside of it [see LLFolderBridge::renameItem()] |
1382 | if ( (1 == cntObjects) && (NEW_CATEGORY_NAME == pFolder->getName()) ) | 1377 | std::string strName = ".(" + strAttachPt + ")"; |
1383 | { | ||
1384 | std::string strName = ".(" + strAttachPt + ")"; | ||
1385 | 1378 | ||
1386 | pFolder->rename(strName); | 1379 | pFolder->rename(strName); |
1387 | pFolder->updateServer(FALSE); | 1380 | pFolder->updateServer(FALSE); |
1388 | gInventory.updateCategory(pFolder); | 1381 | gInventory.updateCategory(pFolder); |
1389 | //gInventory.notifyObservers(); <- done further down in LLVOAvatar::attachObject() | 1382 | //gInventory.notifyObservers(); <- done further down in LLVOAvatar::attachObject() |
1390 | } | ||
1391 | } | 1383 | } |
1392 | } | 1384 | } |
1393 | } | 1385 | } |
@@ -1864,10 +1856,8 @@ LLViewerInventoryCategory* RlvHandler::getSharedFolder(const std::string& strPat | |||
1864 | return NULL; | 1856 | return NULL; |
1865 | 1857 | ||
1866 | // Walk the path (starting at the root) | 1858 | // Walk the path (starting at the root) |
1867 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; | 1859 | boost_tokenizer tokens(strPath, boost::char_separator<char>("/", "", boost::drop_empty_tokens)); |
1868 | boost::char_separator<char> sep("/", "", boost::drop_empty_tokens); | 1860 | for (boost_tokenizer::const_iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) |
1869 | tokenizer tokens(strPath, sep); | ||
1870 | for (tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) | ||
1871 | { | 1861 | { |
1872 | pFolder = getSharedFolder(pFolder->getUUID(), *itToken); | 1862 | pFolder = getSharedFolder(pFolder->getUUID(), *itToken); |
1873 | if (!pFolder) | 1863 | if (!pFolder) |
@@ -2102,15 +2092,10 @@ void RlvHandler::onForceRemOutfit(const LLUUID& idObj, const std::string& strOpt | |||
2102 | for (int idxType = 0; idxType < WT_COUNT; idxType++) | 2092 | for (int idxType = 0; idxType < WT_COUNT; idxType++) |
2103 | { | 2093 | { |
2104 | type = (EWearableType)idxType; | 2094 | type = (EWearableType)idxType; |
2095 | if (LLAssetType::AT_CLOTHING != LLWearable::typeToAssetType(type)) | ||
2096 | continue; // Only strip clothing, not bodyparts | ||
2105 | 2097 | ||
2106 | // Only strip clothing (that's currently worn and not marked "nostrip") | 2098 | if ( ((typeOption == type) || (strOption.empty())) && (gAgent.getWearable(type)) && (isStrippable(gAgent.getWearableItem(type))) ) |
2107 | if ( (LLAssetType::AT_CLOTHING != LLWearable::typeToAssetType(type)) || | ||
2108 | (!gAgent.getWearable(type)) || (!isStrippable(gAgent.getWearableItem(type))) ) | ||
2109 | { | ||
2110 | continue; | ||
2111 | } | ||
2112 | |||
2113 | if ( (typeOption == type) || (strOption.empty()) ) | ||
2114 | { | 2099 | { |
2115 | #ifdef RLV_EXPERIMENTAL_COMPOSITES | 2100 | #ifdef RLV_EXPERIMENTAL_COMPOSITES |
2116 | // If we're stripping something that's part of a composite folder then we should @detachthis instead | 2101 | // If we're stripping something that's part of a composite folder then we should @detachthis instead |
@@ -2238,7 +2223,7 @@ void RlvHandler::onForceWear(const std::string& strPath, bool fAttach, bool fMat | |||
2238 | // Simulate wearing an object to a specific attachment point (copy/paste to suppress replacement dialog) | 2223 | // Simulate wearing an object to a specific attachment point (copy/paste to suppress replacement dialog) |
2239 | // LLAttachObject::handleEvent() => rez_attachment() | 2224 | // LLAttachObject::handleEvent() => rez_attachment() |
2240 | LLViewerJointAttachment* pAttachPt = getAttachPoint(pItem, true); | 2225 | LLViewerJointAttachment* pAttachPt = getAttachPoint(pItem, true); |
2241 | if ( (pAttachPt) && (isDetachable(pAttachPt->getObject())) ) | 2226 | if ( (pAttachPt) && (isDetachable(pAttachPt)) ) |
2242 | { | 2227 | { |
2243 | #if RLV_TARGET < RLV_MAKE_TARGET(1, 23, 0) // Version: 1.22.11 | 2228 | #if RLV_TARGET < RLV_MAKE_TARGET(1, 23, 0) // Version: 1.22.11 |
2244 | LLAttachmentRezAction* rez_action = new LLAttachmentRezAction; | 2229 | LLAttachmentRezAction* rez_action = new LLAttachmentRezAction; |
@@ -2498,7 +2483,7 @@ BOOL RlvHandler::setEnabled(BOOL fEnable) | |||
2498 | 2483 | ||
2499 | BOOL RlvHandler::canDisable() | 2484 | BOOL RlvHandler::canDisable() |
2500 | { | 2485 | { |
2501 | return TRUE; | 2486 | return FALSE; |
2502 | } | 2487 | } |
2503 | 2488 | ||
2504 | void RlvHandler::clearState() | 2489 | void RlvHandler::clearState() |
diff --git a/linden/indra/newview/rlvhandler.h b/linden/indra/newview/rlvhandler.h index df3ff9b..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 | { |
@@ -73,6 +67,7 @@ public: | |||
73 | // Returns TRUE if the specified attachment point is detachable | 67 | // Returns TRUE if the specified attachment point is detachable |
74 | bool isDetachable(S32 idxAttachPt) const { return (idxAttachPt) && (m_Attachments.find(idxAttachPt) == m_Attachments.end()); } | 68 | bool isDetachable(S32 idxAttachPt) const { return (idxAttachPt) && (m_Attachments.find(idxAttachPt) == m_Attachments.end()); } |
75 | bool isDetachable(const LLInventoryItem* pItem) const; | 69 | bool isDetachable(const LLInventoryItem* pItem) const; |
70 | bool isDetachable(LLViewerJointAttachment* pAttachPt) const; | ||
76 | bool isDetachable(LLViewerObject* pObj) const; | 71 | bool isDetachable(LLViewerObject* pObj) const; |
77 | // Returns TRUE if the specified attachment point is set undetachable by anything other than pObj (or one of its children) | 72 | // Returns TRUE if the specified attachment point is set undetachable by anything other than pObj (or one of its children) |
78 | bool isDetachableExcept(S32 idxAttachPt, LLViewerObject* pObj) const; | 73 | bool isDetachableExcept(S32 idxAttachPt, LLViewerObject* pObj) const; |
@@ -194,6 +189,7 @@ public: | |||
194 | protected: | 189 | protected: |
195 | BOOL processAddCommand(const LLUUID& uuid, const RlvCommand& rlvCmd); | 190 | BOOL processAddCommand(const LLUUID& uuid, const RlvCommand& rlvCmd); |
196 | 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); | ||
197 | BOOL processReplyCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) const; | 193 | BOOL processReplyCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) const; |
198 | BOOL processForceCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) const; | 194 | BOOL processForceCommand(const LLUUID& uuid, const RlvCommand& rlvCmd) const; |
199 | 195 | ||
@@ -234,7 +230,6 @@ protected: | |||
234 | rlv_retained_list_t m_Retained; | 230 | rlv_retained_list_t m_Retained; |
235 | rlv_reattach_map_t m_AttachPending; | 231 | rlv_reattach_map_t m_AttachPending; |
236 | rlv_reattach_map_t m_DetachPending; | 232 | rlv_reattach_map_t m_DetachPending; |
237 | rlv_redir_map_t m_Redirections; | ||
238 | RlvGCTimer* m_pGCTimer; | 233 | RlvGCTimer* m_pGCTimer; |
239 | RlvWLSnapshot* m_pWLSnapshot; | 234 | RlvWLSnapshot* m_pWLSnapshot; |
240 | 235 | ||
@@ -370,6 +365,14 @@ inline bool RlvHandler::hasBehaviourExcept(ERlvBehaviour eBehaviour, const LLUUI | |||
370 | } | 365 | } |
371 | #endif // RLV_EXPERIMENTAL_COMPOSITES | 366 | #endif // RLV_EXPERIMENTAL_COMPOSITES |
372 | 367 | ||
368 | // Checked: 2009-09-08 (RLVa-1.0.2c) | Added: RLVa-1.0.2c | ||
369 | inline bool RlvHandler::isDetachable(LLViewerJointAttachment *pAttachPt) const | ||
370 | { | ||
371 | // If there's an attached object it's faster to just use that; otherwise look up the attachment index because it might be locked empty | ||
372 | return (pAttachPt == NULL) || | ||
373 | ( (pAttachPt->getObject() != NULL) && isDetachable(pAttachPt->getObject()) ) || (isDetachable(getAttachPointIndex(pAttachPt))); | ||
374 | } | ||
375 | |||
373 | // Checked: 2009-05-23 (RLVa-0.2.0d) | Modified: RLVa-0.2.0d | 376 | // Checked: 2009-05-23 (RLVa-0.2.0d) | Modified: RLVa-0.2.0d |
374 | inline bool RlvHandler::isDetachable(LLViewerObject* pObj) const | 377 | inline bool RlvHandler::isDetachable(LLViewerObject* pObj) const |
375 | { | 378 | { |
diff --git a/linden/indra/newview/rlvhelper.cpp b/linden/indra/newview/rlvhelper.cpp index 6b2a1a0..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,57 +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-07-05 (RLVa-1.0.0c) | 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 | LLViewerJointAttachment* pAttachment = (LLViewerJointAttachment*)pParam; | 362 | BOOL RlvSettings::fShowNameTags = FALSE; |
417 | return (!pAttachment) || (gRlvHandler.isDetachable(pAttachment->getObject())); | 363 | |
418 | } | 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 | // | ||
419 | 385 | ||
420 | BOOL RlvGCTimer::tick() | 386 | BOOL RlvGCTimer::tick() |
421 | { | 387 | { |
@@ -454,63 +420,84 @@ void RlvCurrentlyWorn::fetchWorn() | |||
454 | f.fetchItems(idItems); | 420 | f.fetchItems(idItems); |
455 | } | 421 | } |
456 | 422 | ||
457 | // ========================================================================= | 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 | } | ||
458 | 428 | ||
459 | // 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 |
460 | void RlvWLSnapshot::restoreSnapshot(const RlvWLSnapshot* pWLSnapshot) | 430 | bool RlvSelectIsOwnedByOrGroupOwned::apply(LLSelectNode* pNode) |
461 | { | 431 | { |
462 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); | 432 | return (pNode->mPermissions->isGroupOwned()) || (pNode->mPermissions->getOwner() == m_idAgent); |
463 | if ( (pWLSnapshot) && (pWLParams) ) | ||
464 | { | ||
465 | pWLParams->mAnimator.mIsRunning = pWLSnapshot->fIsRunning; | ||
466 | pWLParams->mAnimator.mUseLindenTime = pWLSnapshot->fUseLindenTime; | ||
467 | pWLParams->mCurParams = pWLSnapshot->WLParams; | ||
468 | pWLParams->propagateParameters(); | ||
469 | } | ||
470 | } | 433 | } |
471 | 434 | ||
472 | // 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 |
473 | RlvWLSnapshot* RlvWLSnapshot::takeSnapshot() | 436 | bool RlvSelectIsSittingOn::apply(LLSelectNode* pNode) |
474 | { | 437 | { |
475 | RlvWLSnapshot* pWLSnapshot = NULL; | 438 | return (pNode->getObject()) && (pNode->getObject()->getRootEdit() == m_pObject); |
476 | LLWLParamManager* pWLParams = LLWLParamManager::instance(); | 439 | } |
477 | 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)) | ||
478 | { | 458 | { |
479 | pWLSnapshot = new RlvWLSnapshot(); | 459 | // We'll allow if none of the prims are owned by the avie or group owned |
480 | pWLSnapshot->fIsRunning = pWLParams->mAnimator.mIsRunning; | 460 | LLObjectSelectionHandle handleSel = LLSelectMgr::getInstance()->getSelection(); |
481 | pWLSnapshot->fUseLindenTime = pWLParams->mAnimator.mUseLindenTime; | 461 | RlvSelectIsOwnedByOrGroupOwned func(gAgent.getID()); |
482 | pWLSnapshot->WLParams = pWLParams->mCurParams; | 462 | if ( (handleSel.notNull()) && ((0 == handleSel->getRootObjectCount()) || (NULL != handleSel->getFirstRootNode(&func, FALSE))) ) |
463 | fIsAllowed = false; | ||
483 | } | 464 | } |
484 | return pWLSnapshot; | ||
485 | } | ||
486 | 465 | ||
487 | // ========================================================================= | 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 | } | ||
488 | 474 | ||
489 | BOOL RlvSettings::fShowNameTags = FALSE; | 475 | return fIsAllowed; |
476 | } | ||
490 | 477 | ||
491 | #ifdef RLV_EXTENSION_STARTLOCATION | 478 | // Checked: 2009-05-26 (RLVa-0.2.0d) | Modified: RLVa-0.2.0d |
492 | // Checked: 2009-07-08 (RLVa-1.0.0e) | Modified: RLVa-0.2.1d | 479 | S32 rlvGetDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType type) |
493 | void RlvSettings::updateLoginLastLocation() | 480 | { |
481 | S32 cntType = 0; | ||
482 | if (pFolder) | ||
494 | { | 483 | { |
495 | 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) | ||
496 | { | 489 | { |
497 | BOOL fValue = (gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)) || | 490 | for (S32 idxItem = 0, cntItem = pItems->count(); idxItem < cntItem; idxItem++) |
498 | ( (gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && | 491 | if (pItems->get(idxItem)->getType() == type) |
499 | (gAgent.getAvatarObject()) && (!gAgent.getAvatarObject()->mIsSitting) ); | 492 | cntType++; |
500 | if (gSavedPerAccountSettings.getBOOL(RLV_SETTING_LOGINLASTLOCATION) != fValue) | ||
501 | { | ||
502 | gSavedPerAccountSettings.setBOOL(RLV_SETTING_LOGINLASTLOCATION, fValue); | ||
503 | gSavedPerAccountSettings.saveToFile(gSavedSettings.getString("PerAccountSettingsFile"), TRUE); | ||
504 | } | ||
505 | } | 493 | } |
506 | } | 494 | } |
507 | #endif // RLV_EXTENSION_STARTLOCATION | 495 | return cntType; |
508 | 496 | } | |
509 | // ========================================================================= | ||
510 | 497 | ||
511 | #ifdef RLV_ADVANCED_TOGGLE_RLVA | 498 | #ifdef RLV_ADVANCED_TOGGLE_RLVA |
512 | // 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 |
513 | void rlvDbgToggleEnabled(void*) | 500 | void rlvToggleEnabled(void*) |
514 | { | 501 | { |
515 | gSavedSettings.setBOOL(RLV_SETTING_MAIN, !rlv_handler_t::isEnabled()); | 502 | gSavedSettings.setBOOL(RLV_SETTING_MAIN, !rlv_handler_t::isEnabled()); |
516 | 503 | ||
@@ -527,7 +514,7 @@ BOOL RlvSettings::fShowNameTags = FALSE; | |||
527 | #endif | 514 | #endif |
528 | } | 515 | } |
529 | // Checked: 2009-07-08 (RLVa-1.0.0e) | 516 | // Checked: 2009-07-08 (RLVa-1.0.0e) |
530 | BOOL rlvDbgGetEnabled(void*) | 517 | BOOL rlvGetEnabled(void*) |
531 | { | 518 | { |
532 | return rlv_handler_t::isEnabled(); | 519 | return rlv_handler_t::isEnabled(); |
533 | } | 520 | } |
@@ -569,7 +556,7 @@ void rlvSendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLU | |||
569 | // 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 |
570 | bool rlvSendChatReply(S32 nChannel, const std::string& strReply) | 557 | bool rlvSendChatReply(S32 nChannel, const std::string& strReply) |
571 | { | 558 | { |
572 | if (!rlvIsValidChannel(nChannel)) | 559 | if (!rlvIsValidReplyChannel(nChannel)) |
573 | return false; | 560 | return false; |
574 | 561 | ||
575 | // Copy/paste from send_chat_from_viewer() | 562 | // Copy/paste from send_chat_from_viewer() |
@@ -672,3 +659,7 @@ std::string rlvGetLastParenthesisedText(const std::string& strText, std::string: | |||
672 | } | 659 | } |
673 | 660 | ||
674 | // ========================================================================= | 661 | // ========================================================================= |
662 | // Debug helper functions | ||
663 | // | ||
664 | |||
665 | // ========================================================================= | ||
diff --git a/linden/indra/newview/rlvhelper.h b/linden/indra/newview/rlvhelper.h index a0e040e..f36989b 100644 --- a/linden/indra/newview/rlvhelper.h +++ b/linden/indra/newview/rlvhelper.h | |||
@@ -7,263 +7,90 @@ | |||
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 | 11 | ||
13 | // ============================================================================ | 12 | // ============================================================================ |
14 | // Extensions | 13 | // RlvCommand |
15 | // | 14 | // |
16 | 15 | ||
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 = 1; | ||
59 | const S32 RLVa_VERSION_BUILD = 7; | ||
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 | |||
93 | // ============================================================================ | ||
94 | // Enumeration declarations | ||
95 | // | ||
96 | |||
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) { m_fLookup = (NULL != gObjectList.findObject(uuid)); } | 71 | RlvObject(const LLUUID& idObj); |
253 | 72 | ||
254 | BOOL addCommand(const RlvCommand& rlvCmd); | 73 | /* |
255 | BOOL removeCommand(const RlvCommand& rlvCmd); | 74 | * Member functions |
256 | 75 | */ | |
257 | BOOL hasBehaviour(ERlvBehaviour eBehaviour) const; | 76 | public: |
258 | BOOL hasBehaviour(const std::string& strBehaviour) const; | 77 | bool addCommand(const RlvCommand& rlvCmd); |
259 | BOOL hasBehaviour(ERlvBehaviour eBehaviour, const std::string& strOption) const; | 78 | bool removeCommand(const RlvCommand& rlvCmd); |
260 | BOOL hasBehaviour(const std::string& strBehaviour, const std::string& strOption) const; | ||
261 | 79 | ||
262 | 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; | ||
263 | 85 | ||
264 | 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 | */ | ||
265 | protected: | 91 | protected: |
266 | LLUUID m_UUID; // The object's UUID | 92 | LLUUID m_UUID; // The object's UUID |
93 | S32 m_idxAttachPt; // The object's attachment point (or 0 if it's not an attachment) | ||
267 | bool m_fLookup; // TRUE if the object existed in gObjectList at one point in time | 94 | bool m_fLookup; // TRUE if the object existed in gObjectList at one point in time |
268 | S16 m_nLookupMisses; // Count of unsuccessful lookups in gObjectList by the GC | 95 | S16 m_nLookupMisses; // Count of unsuccessful lookups in gObjectList by the GC |
269 | rlv_command_list_t m_Commands; // List of behaviours held by this object (in the order they were received) | 96 | rlv_command_list_t m_Commands; // List of behaviours held by this object (in the order they were received) |
@@ -272,23 +99,24 @@ protected: | |||
272 | }; | 99 | }; |
273 | 100 | ||
274 | // ============================================================================ | 101 | // ============================================================================ |
275 | /* | 102 | // RlvCriteriaCategoryCollector - Criteria based folder matching filter used by @findfolder and @findfolders |
276 | * RlvCriteriaCategoryCollector | 103 | // |
277 | * ============================ | ||
278 | * Criteria based folder matching filter used by @findfolder and @findfolders | ||
279 | * | ||
280 | */ | ||
281 | 104 | ||
282 | class RlvCriteriaCategoryCollector : public LLInventoryCollectFunctor | 105 | class RlvCriteriaCategoryCollector : public LLInventoryCollectFunctor |
283 | { | 106 | { |
284 | public: | 107 | public: |
285 | RlvCriteriaCategoryCollector(const std::string& strCriteria) | 108 | RlvCriteriaCategoryCollector(const std::string& strCriteria) |
286 | { | 109 | { |
287 | typedef boost::tokenizer<boost::char_separator<char> > tokenizer; | 110 | std::string::size_type idxIt, idxLast = 0; |
288 | boost::char_separator<char> sep("&&", "", boost::drop_empty_tokens); | 111 | while (idxLast < strCriteria.length()) |
289 | tokenizer tokens(strCriteria, sep); | 112 | { |
290 | for (tokenizer::iterator itToken = tokens.begin(); itToken != tokens.end(); ++itToken) | 113 | idxIt = strCriteria.find("&&", idxLast); |
291 | m_Criteria.push_back(*itToken); | 114 | if (std::string::npos == idxIt) |
115 | idxIt = strCriteria.length(); | ||
116 | if (idxIt != idxLast) | ||
117 | m_Criteria.push_back(strCriteria.substr(idxLast, idxIt - idxLast)); | ||
118 | idxLast = idxIt + 2; | ||
119 | } | ||
292 | } | 120 | } |
293 | virtual ~RlvCriteriaCategoryCollector() {} | 121 | virtual ~RlvCriteriaCategoryCollector() {} |
294 | 122 | ||
@@ -304,7 +132,7 @@ public: | |||
304 | return false; | 132 | return false; |
305 | 133 | ||
306 | for (std::list<std::string>::const_iterator itCrit = m_Criteria.begin(); itCrit != m_Criteria.end(); ++itCrit) | 134 | for (std::list<std::string>::const_iterator itCrit = m_Criteria.begin(); itCrit != m_Criteria.end(); ++itCrit) |
307 | if (-1 == strFolderName.find(*itCrit)) // Return false on the first mismatch | 135 | if (std::string::npos == strFolderName.find(*itCrit)) // Return false on the first mismatch |
308 | return false; | 136 | return false; |
309 | return true; | 137 | return true; |
310 | } | 138 | } |
@@ -314,12 +142,8 @@ protected: | |||
314 | }; | 142 | }; |
315 | 143 | ||
316 | // ============================================================================ | 144 | // ============================================================================ |
317 | /* | 145 | // RlvWearableItemCollector - Inventory item filter used by attach/detach/attachall/detachall/getinvworn |
318 | * RlvWearableItemCollector | 146 | // |
319 | * ======================== | ||
320 | * Inventory item filter used by attach/detach/attachall/detachall/getinvworn (also used by "Add/Replace Outfit" and "Take Off Items") | ||
321 | * | ||
322 | */ | ||
323 | 147 | ||
324 | class RlvWearableItemCollector : public LLInventoryCollectFunctor | 148 | class RlvWearableItemCollector : public LLInventoryCollectFunctor |
325 | { | 149 | { |
@@ -349,11 +173,8 @@ protected: | |||
349 | }; | 173 | }; |
350 | 174 | ||
351 | // ============================================================================ | 175 | // ============================================================================ |
352 | /* | 176 | // RlvRetainedCommand |
353 | * RlvRetainedCommand | 177 | // |
354 | * ================== | ||
355 | * | ||
356 | */ | ||
357 | 178 | ||
358 | struct RlvRetainedCommand | 179 | struct RlvRetainedCommand |
359 | { | 180 | { |
@@ -369,11 +190,8 @@ private: | |||
369 | typedef std::list<RlvRetainedCommand> rlv_retained_list_t; | 190 | typedef std::list<RlvRetainedCommand> rlv_retained_list_t; |
370 | 191 | ||
371 | // ============================================================================ | 192 | // ============================================================================ |
372 | /* | 193 | // RlvWLSnapshot |
373 | * RlvWLSnapshot | 194 | // |
374 | * ============= | ||
375 | * | ||
376 | */ | ||
377 | 195 | ||
378 | struct RlvWLSnapshot | 196 | struct RlvWLSnapshot |
379 | { | 197 | { |
@@ -389,24 +207,8 @@ private: | |||
389 | }; | 207 | }; |
390 | 208 | ||
391 | // ============================================================================ | 209 | // ============================================================================ |
392 | /* | 210 | // RlvSettings |
393 | * RlvSettings | 211 | // |
394 | * =========== | ||
395 | * | ||
396 | */ | ||
397 | |||
398 | #define RLV_SETTING_MAIN "RestrainedLife" | ||
399 | #define RLV_SETTING_DEBUG "RestrainedLifeDebug" | ||
400 | #define RLV_SETTING_NOSETENV "RestrainedLifeNoSetEnv" | ||
401 | #define RLV_SETTING_FORBIDGIVETORLV "RestrainedLifeForbidGiveToRLV" | ||
402 | |||
403 | #define RLV_SETTING_ENABLEWEAR "RLVaEnableWear" | ||
404 | #define RLV_SETTING_ENABLELEGACYNAMING "RLVaEnableLegacyNaming" | ||
405 | #define RLV_SETTING_HIDELOCKEDLAYER "RLVaHideLockedLayers" | ||
406 | #define RLV_SETTING_HIDELOCKEDATTACH "RLVaHideLockedAttachments" | ||
407 | #define RLV_SETTING_HIDELOCKEDINVENTORY "RLVaHideLockedInventory" | ||
408 | #define RLV_SETTING_LOGINLASTLOCATION "RLVaLoginLastLocation" | ||
409 | #define RLV_SETTING_SHOWNAMETAGS "RLVaShowNameTags" | ||
410 | 212 | ||
411 | inline BOOL rlvGetSettingBOOL(const std::string& strSetting, BOOL fDefault) | 213 | inline BOOL rlvGetSettingBOOL(const std::string& strSetting, BOOL fDefault) |
412 | { | 214 | { |
@@ -427,6 +229,7 @@ public: | |||
427 | static BOOL getHideLockedLayers() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDLAYER, FALSE); } | 229 | static BOOL getHideLockedLayers() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDLAYER, FALSE); } |
428 | static BOOL getHideLockedAttach() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDATTACH, FALSE); } | 230 | static BOOL getHideLockedAttach() { return rlvGetSettingBOOL(RLV_SETTING_HIDELOCKEDATTACH, FALSE); } |
429 | 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; } | ||
430 | 233 | ||
431 | #ifdef RLV_EXTENSION_STARTLOCATION | 234 | #ifdef RLV_EXTENSION_STARTLOCATION |
432 | static BOOL getLoginLastLocation() { return rlvGetPerUserSettingsBOOL(RLV_SETTING_LOGINLASTLOCATION, TRUE); } | 235 | static BOOL getLoginLastLocation() { return rlvGetPerUserSettingsBOOL(RLV_SETTING_LOGINLASTLOCATION, TRUE); } |
@@ -437,34 +240,12 @@ public: | |||
437 | }; | 240 | }; |
438 | 241 | ||
439 | // ============================================================================ | 242 | // ============================================================================ |
440 | /* | 243 | // State keeping classes/structure |
441 | * State keeping classes/structure | 244 | // |
442 | * | ||
443 | */ | ||
444 | |||
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 | 245 | ||
463 | // ============================================================================ | 246 | // ============================================================================ |
464 | /* | 247 | // Various helper classes/timers/functors |
465 | * Various helper classes/timers/functors | 248 | // |
466 | * | ||
467 | */ | ||
468 | 249 | ||
469 | class RlvGCTimer : public LLEventTimer | 250 | class RlvGCTimer : public LLEventTimer |
470 | { | 251 | { |
@@ -504,16 +285,14 @@ struct RlvSelectIsSittingOn : public LLSelectedNodeFunctor | |||
504 | }; | 285 | }; |
505 | 286 | ||
506 | // ============================================================================ | 287 | // ============================================================================ |
507 | /* | 288 | // Various helper functions |
508 | * Various helper functions | 289 | // |
509 | * | ||
510 | */ | ||
511 | 290 | ||
512 | BOOL rlvAttachToEnabler(void* pParam); | 291 | BOOL rlvAttachToEnabler(void* pParam); |
513 | bool rlvCanDeleteOrReturn(); | 292 | bool rlvCanDeleteOrReturn(); |
514 | S32 rlvGetDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType type); | 293 | S32 rlvGetDirectDescendentsCount(const LLInventoryCategory* pFolder, LLAssetType::EType type); |
515 | bool rlvIsEmote(const std::string& strUTF8Text); | 294 | bool rlvIsEmote(const std::string& strUTF8Text); |
516 | bool rlvIsValidChannel(S32 nChannel); | 295 | bool rlvIsValidReplyChannel(S32 nChannel); |
517 | bool rlvIsWearingItem(const LLInventoryItem* pItem); | 296 | bool rlvIsWearingItem(const LLInventoryItem* pItem); |
518 | 297 | ||
519 | void rlvForceDetach(LLViewerJointAttachment* pAttachPt); | 298 | void rlvForceDetach(LLViewerJointAttachment* pAttachPt); |
@@ -521,20 +300,33 @@ void rlvSendBusyMessage(const LLUUID& idTo, const std::string& strMsg, const LLU | |||
521 | bool rlvSendChatReply(const std::string& strChannel, const std::string& strReply); | 300 | bool rlvSendChatReply(const std::string& strChannel, const std::string& strReply); |
522 | bool rlvSendChatReply(S32 nChannel, const std::string& strReply); | 301 | bool rlvSendChatReply(S32 nChannel, const std::string& strReply); |
523 | 302 | ||
524 | void rlvStringReplace(std::string& strText, std::string strFrom, const std::string& strTo); | ||
525 | 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); |
526 | 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); |
305 | void rlvStringReplace(std::string& strText, std::string strFrom, const std::string& strTo); | ||
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" |
@@ -561,10 +353,10 @@ inline bool rlvIsEmote(const std::string& strUTF8Text) | |||
561 | return (strUTF8Text.length() > 4) && ( (strUTF8Text.compare(0, 4, "/me ") == 0) || (strUTF8Text.compare(0, 4, "/me'") == 0) ); | 353 | return (strUTF8Text.length() > 4) && ( (strUTF8Text.compare(0, 4, "/me ") == 0) || (strUTF8Text.compare(0, 4, "/me'") == 0) ); |
562 | } | 354 | } |
563 | 355 | ||
564 | // Checked: 2009-08-05 (RLVa-1.0.1e) | Added: RLVa-1.0.0e | 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 | } |
569 | 361 | ||
570 | // Checked: 2009-08-05 (RLVa-1.0.1e) | Added: RLVa-1.0.0e | 362 | // Checked: 2009-08-05 (RLVa-1.0.1e) | Added: RLVa-1.0.0e |
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/floater_chatterbox_vertical.xml b/linden/indra/newview/skins/default/xui/en-us/floater_chatterbox_vertical.xml new file mode 100644 index 0000000..8b1f41b --- /dev/null +++ b/linden/indra/newview/skins/default/xui/en-us/floater_chatterbox_vertical.xml | |||
@@ -0,0 +1,14 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> | ||
2 | <multi_floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="true" | ||
3 | height="390" name="floater_chatterbox" | ||
4 | rect_control="ChatterboxRect" title="Communicate" width="392"> | ||
5 | <tab_container bottom="2" follows="left|right|top|bottom" height="370" left="0" | ||
6 | name="chatterbox_tabs" tab_position="left" tab_width="126" width="395" /> | ||
7 | <string name="unread_count_string_singular"> | ||
8 | Unread IM | ||
9 | </string> | ||
10 | <string name="unread_count_string_plural"> | ||
11 | Unread IMs | ||
12 | </string> | ||
13 | </multi_floater> | ||
14 | |||
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_directory.xml b/linden/indra/newview/skins/default/xui/en-us/floater_directory.xml index fe04ad3..8591c1f 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_directory.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_directory.xml | |||
@@ -70,7 +70,7 @@ | |||
70 | <panel border="true" bottom="-569" follows="left|top|right|bottom" height="553" | 70 | <panel border="true" bottom="-569" follows="left|top|right|bottom" height="553" |
71 | label="Classifieds" left="1" left_delta="68" mouse_opaque="false" | 71 | label="Classifieds" left="1" left_delta="68" mouse_opaque="false" |
72 | name="classified_panel" width="778"> | 72 | name="classified_panel" width="778"> |
73 | <button bottom="-533" follows="left|bottom" font="SansSerif" halign="center" | 73 | <button bottom="-553" follows="left|bottom" font="SansSerif" halign="center" |
74 | height="20" label="Next >" label_selected="Next >" | 74 | height="20" label="Next >" label_selected="Next >" |
75 | mouse_opaque="true" name="Next >" right="344" width="80" /> | 75 | mouse_opaque="true" name="Next >" right="344" width="80" /> |
76 | <string name="searching_text"> | 76 | <string name="searching_text"> |
@@ -265,7 +265,7 @@ | |||
265 | bottom_delta="-20" drop_shadow_visible="true" follows="left|bottom" | 265 | bottom_delta="-20" drop_shadow_visible="true" follows="left|bottom" |
266 | font="SansSerifSmall" h_pad="0" halign="left" height="16" left="4" | 266 | font="SansSerifSmall" h_pad="0" halign="left" height="16" left="4" |
267 | mouse_opaque="true" name="result_text" v_pad="0" width="328" /> | 267 | mouse_opaque="true" name="result_text" v_pad="0" width="328" /> |
268 | <button bottom="-533" follows="left|bottom" font="SansSerif" halign="center" | 268 | <button bottom="-553" follows="left|bottom" font="SansSerif" halign="center" |
269 | height="20" label="Next >" label_selected="Next >" | 269 | height="20" label="Next >" label_selected="Next >" |
270 | mouse_opaque="true" name="Next >" right="344" width="80" /> | 270 | mouse_opaque="true" name="Next >" right="344" width="80" /> |
271 | <button bottom_delta="0" follows="left|bottom" font="SansSerif" halign="center" | 271 | <button bottom_delta="0" follows="left|bottom" font="SansSerif" halign="center" |
@@ -313,7 +313,7 @@ | |||
313 | <string name="not_found_text"> | 313 | <string name="not_found_text"> |
314 | None Found. | 314 | None Found. |
315 | </string> | 315 | </string> |
316 | <button bottom="-533" follows="left|bottom" font="SansSerif" halign="center" | 316 | <button bottom="-553" follows="left|bottom" font="SansSerif" halign="center" |
317 | height="20" label="Next >" label_selected="Next >" | 317 | height="20" label="Next >" label_selected="Next >" |
318 | mouse_opaque="true" name="Next >" right="390" width="80" /> | 318 | mouse_opaque="true" name="Next >" right="390" width="80" /> |
319 | <button bottom_delta="0" follows="left|bottom" font="SansSerif" halign="center" | 319 | <button bottom_delta="0" follows="left|bottom" font="SansSerif" halign="center" |
@@ -394,7 +394,7 @@ To buy direct, visit the land and click on the place name in the title bar. | |||
394 | <string name="not_found_text"> | 394 | <string name="not_found_text"> |
395 | None Found. | 395 | None Found. |
396 | </string> | 396 | </string> |
397 | <button bottom="-533" follows="left|bottom" font="SansSerif" halign="center" | 397 | <button bottom="-553" follows="left|bottom" font="SansSerif" halign="center" |
398 | height="20" label="Next >" label_selected="Next >" | 398 | height="20" label="Next >" label_selected="Next >" |
399 | mouse_opaque="true" name="Next >" right="344" width="80" /> | 399 | mouse_opaque="true" name="Next >" right="344" width="80" /> |
400 | <button bottom_delta="0" follows="left|bottom" font="SansSerif" halign="center" | 400 | <button bottom_delta="0" follows="left|bottom" font="SansSerif" halign="center" |
@@ -482,7 +482,7 @@ To buy direct, visit the land and click on the place name in the title bar. | |||
482 | <string name="not_found_text"> | 482 | <string name="not_found_text"> |
483 | None Found. | 483 | None Found. |
484 | </string> | 484 | </string> |
485 | <button bottom="-533" follows="left|bottom" font="SansSerif" halign="center" | 485 | <button bottom="-553" follows="left|bottom" font="SansSerif" halign="center" |
486 | height="20" label="Next >" label_selected="Next >" | 486 | height="20" label="Next >" label_selected="Next >" |
487 | mouse_opaque="true" name="Next >" right="330" width="80" /> | 487 | mouse_opaque="true" name="Next >" right="330" width="80" /> |
488 | <button bottom_delta="0" follows="left|bottom" font="SansSerif" halign="center" | 488 | <button bottom_delta="0" follows="left|bottom" font="SansSerif" halign="center" |
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml b/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml index 3ae02e7..3c860e9 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_mini_map.xml | |||
@@ -1,7 +1,7 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> | 1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> |
2 | <floater can_close="true" can_drag_on_left="false" can_minimize="false" can_resize="true" | 2 | <floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="true" |
3 | can_tear_off="false" follows="top|right" height="455" min_height="400" min_width="240" | 3 | can_tear_off="false" follows="top|right" height="455" min_height="400" min_width="240" |
4 | name="minimap" rect_control="FloaterMiniMapRect" width="200"> | 4 | name="minimap" rect_control="FloaterMiniMapRect" width="200" short_title="Mini-Map"> |
5 | 5 | ||
6 | <panel label="Mini Map" name="mini_mapview" | 6 | <panel label="Mini Map" name="mini_mapview" |
7 | top="-2" left="2" bottom="196" right="196" | 7 | top="-2" left="2" bottom="196" right="196" |
@@ -92,7 +92,16 @@ | |||
92 | <string name="no_one_near"> | 92 | <string name="no_one_near"> |
93 | No avatars within range | 93 | No avatars within range |
94 | </string> | 94 | </string> |
95 | <string name="muted"> | 95 | <string name="is_muted"> |
96 | (muted) | 96 | (muted) |
97 | </string> | 97 | </string> |
98 | <string name="is_typing"> | ||
99 | (typing) | ||
100 | </string> | ||
101 | <string name="entering_chat_range"> | ||
102 | [NAME] has entered chat range ([DISTANCE]m) | ||
103 | </string> | ||
104 | <string name="entering_sim_range"> | ||
105 | [NAME] has entered the sim ([DISTANCE]m) | ||
106 | </string> | ||
98 | </floater> | 107 | </floater> |
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_pie_object.xml b/linden/indra/newview/skins/default/xui/en-us/menu_pie_object.xml index b1d16a2..e962a8a 100644 --- a/linden/indra/newview/skins/default/xui/en-us/menu_pie_object.xml +++ b/linden/indra/newview/skins/default/xui/en-us/menu_pie_object.xml | |||
@@ -29,21 +29,22 @@ | |||
29 | <on_click function="Object.Delete" /> | 29 | <on_click function="Object.Delete" /> |
30 | <on_enable function="Object.EnableDelete" /> | 30 | <on_enable function="Object.EnableDelete" /> |
31 | </menu_item_call> | 31 | </menu_item_call> |
32 | <menu_item_call enabled="false" label="Wear" mouse_opaque="true" name="Wear"> | 32 | <menu_item_call enabled="false" label="Build" mouse_opaque="true" name="Create"> |
33 | <on_click function="Object.AttachToAvatar" /> | 33 | <on_click function="Object.Build" /> |
34 | <on_enable function="Object.EnableWear" /> | 34 | <on_enable function="EnableEdit" /> |
35 | </menu_item_call> | 35 | </menu_item_call> |
36 | <menu_item_call enabled="false" label="Take Copy" mouse_opaque="true" name="Take Copy"> | 36 | |
37 | <on_click function="Tools.TakeCopy" /> | 37 | <menu_item_call enabled="false" label="Take Copy" mouse_opaque="true" name="Take Copy"> |
38 | <on_enable function="Tools.EnableTakeCopy" /> | 38 | <on_click function="Tools.TakeCopy" /> |
39 | </menu_item_call> | 39 | <on_enable function="Tools.EnableTakeCopy" /> |
40 | <pie_menu label="Attach HUD >" name="Object Attach HUD" /> | 40 | </menu_item_call> |
41 | <pie_menu label="Attach >" name="Object Attach" /> | 41 | <pie_menu label="Attach HUD >" name="Object Attach HUD" /> |
42 | <menu_item_call enabled="false" label="Return..." mouse_opaque="true" name="Return..."> | 42 | <pie_menu label="Attach >" name="Object Attach" /> |
43 | <on_click function="Object.Return" /> | 43 | <menu_item_call enabled="false" label="Wear" mouse_opaque="true" name="Wear"> |
44 | <on_enable function="Object.EnableReturn" /> | 44 | <on_click function="Object.AttachToAvatar" /> |
45 | </menu_item_call> | 45 | <on_enable function="Object.EnableWear" /> |
46 | <pie_menu label="More >" name="Rate Menu"> | 46 | </menu_item_call> |
47 | <pie_menu label="More >" name="Rate Menu"> | ||
47 | <menu_item_call label="Export" enabled="false" hidden="false" | 48 | <menu_item_call label="Export" enabled="false" hidden="false" |
48 | mouse_opaqu="true" name="Export"> | 49 | mouse_opaqu="true" name="Export"> |
49 | <on_click function="Object.Export" /> | 50 | <on_click function="Object.Export" /> |
@@ -74,10 +75,10 @@ | |||
74 | <on_click function="Tools.Unlink" userdata="" /> | 75 | <on_click function="Tools.Unlink" userdata="" /> |
75 | <on_enable function="Tools.EnableUnlink" /> | 76 | <on_enable function="Tools.EnableUnlink" /> |
76 | </menu_item_call> | 77 | </menu_item_call> |
77 | </pie_menu> | 78 | </pie_menu> |
78 | <menu_item_call enabled="false" label="Create" mouse_opaque="true" name="Create"> | 79 | <menu_item_call enabled="false" label="Return..." mouse_opaque="true" name="Return..."> |
79 | <on_click function="Object.Build" /> | 80 | <on_click function="Object.Return" /> |
80 | <on_enable function="EnableEdit" /> | 81 | <on_enable function="Object.EnableReturn" /> |
81 | </menu_item_call> | 82 | </menu_item_call> |
82 | </pie_menu> | 83 | </pie_menu> |
83 | <menu_item_call enabled="false" label="Edit..." mouse_opaque="true" name="Edit..."> | 84 | <menu_item_call enabled="false" label="Edit..." mouse_opaque="true" name="Edit..."> |
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. |
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml index bb1c5ee..0c18a62 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_general.xml | |||
@@ -77,6 +77,22 @@ | |||
77 | follows="left|top" height="16" increment="1" initial_val="300" | 77 | follows="left|top" height="16" increment="1" initial_val="300" |
78 | label="Away Timeout:" label_width="141" left="10" max_val="600" | 78 | label="Away Timeout:" label_width="141" left="10" max_val="600" |
79 | min_val="30" mouse_opaque="true" name="afk_timeout_spinner" width="202" /> | 79 | min_val="30" mouse_opaque="true" name="afk_timeout_spinner" width="202" /> |
80 | <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | ||
81 | bottom_delta="-25" drop_shadow_visible="true" enabled="true" follows="left|top" | ||
82 | font="SansSerifSmall" h_pad="0" halign="left" height="12" left="10" | ||
83 | mouse_opaque="true" name="UI Size:" v_pad="0" width="128"> | ||
84 | Mini-map notify: | ||
85 | </text> | ||
86 | <check_box bottom_delta="0" enabled="true" | ||
87 | follows="left|top" font="SansSerifSmall" height="16" initial_value="false" | ||
88 | label="Entering chat range" left="151" | ||
89 | mouse_opaque="true" name="mini_map_notify_chat" radio_style="false" | ||
90 | width="256" /> | ||
91 | <check_box bottom_delta="0" enabled="true" | ||
92 | follows="left|top" font="SansSerifSmall" height="16" initial_value="false" | ||
93 | label="Entering sim" left="330" | ||
94 | mouse_opaque="true" name="mini_map_notify_sim" radio_style="false" | ||
95 | width="256" /> | ||
80 | <check_box bottom="-304" enabled="true" | 96 | <check_box bottom="-304" enabled="true" |
81 | follows="left|top" font="SansSerifSmall" height="16" initial_value="false" | 97 | follows="left|top" font="SansSerifSmall" height="16" initial_value="false" |
82 | label="Notify when Linden dollars (L$) spent or received" left="151" | 98 | label="Notify when Linden dollars (L$) spent or received" left="151" |
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml index ee00455..9b18e11 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_im.xml | |||
@@ -49,55 +49,59 @@ | |||
49 | initial_value="false" label="Show online Friend notifications" left="148" | 49 | initial_value="false" label="Show online Friend notifications" left="148" |
50 | mouse_opaque="true" name="friends_online_notify_checkbox" | 50 | mouse_opaque="true" name="friends_online_notify_checkbox" |
51 | radio_style="false" width="256" /> | 51 | radio_style="false" width="256" /> |
52 | <check_box bottom_delta="-20" enabled="true" | ||
53 | follows="left|top" font="SansSerifSmall" height="16" initial_value="false" | ||
54 | label="Vertical IM tabs (requires restart)" left_delta="0" mouse_opaque="true" | ||
55 | name="vertical-imtabs-toggle" radio_style="false" width="270" /> | ||
52 | <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | 56 | <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
53 | bottom="-125" drop_shadow_visible="true" enabled="true" follows="left|top" | 57 | bottom_delta="-20" drop_shadow_visible="true" enabled="true" follows="left|top" |
54 | font="SansSerifSmall" h_pad="0" halign="left" height="10" left="12" | 58 | font="SansSerifSmall" h_pad="0" halign="left" height="10" left="12" |
55 | mouse_opaque="false" name="text_box3" v_pad="0" width="128"> | 59 | mouse_opaque="false" name="text_box3" v_pad="0" width="128"> |
56 | Busy Mode Response: | 60 | Busy Mode Response: |
57 | </text> | 61 | </text> |
58 | <text_editor type="string" length="1" bottom="-185" embedded_items="false" enabled="true" follows="left|top" | 62 | <text_editor type="string" length="1" bottom_delta="-60" embedded_items="false" enabled="true" follows="left|top" |
59 | font="SansSerifSmall" height="70" left="148" max_length="255" | 63 | font="SansSerifSmall" height="70" left="148" max_length="255" |
60 | mouse_opaque="true" name="busy_response" width="330" word_wrap="true" /> | 64 | mouse_opaque="true" name="busy_response" width="330" word_wrap="true" /> |
61 | <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | 65 | <text type="string" length="1" bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
62 | bottom="-218" drop_shadow_visible="true" enabled="true" follows="left|top" | 66 | bottom_delta="-33" drop_shadow_visible="true" enabled="true" follows="left|top" |
63 | font="SansSerifSmall" h_pad="0" halign="left" height="10" left="12" | 67 | font="SansSerifSmall" h_pad="0" halign="left" height="10" left="12" |
64 | mouse_opaque="false" name="text_box4" v_pad="0" width="128"> | 68 | mouse_opaque="false" name="text_box4" v_pad="0" width="128"> |
65 | Logging Options: | 69 | Logging Options: |
66 | </text> | 70 | </text> |
67 | <check_box bottom="-225" enabled="true" | 71 | <check_box bottom_delta="-7" enabled="true" |
68 | follows="left|top" font="SansSerifSmall" height="16" | 72 | follows="left|top" font="SansSerifSmall" height="16" |
69 | initial_value="false" label="Save a log of IM on my computer" left="148" | 73 | initial_value="false" label="Save a log of IM on my computer" left="148" |
70 | mouse_opaque="true" name="log_instant_messages" radio_style="false" | 74 | mouse_opaque="true" name="log_instant_messages" radio_style="false" |
71 | width="237" /> | 75 | width="237" /> |
72 | <check_box bottom="-245" enabled="true" | 76 | <check_box bottom_delta="-20" enabled="true" |
73 | follows="left|top" font="SansSerifSmall" height="16" | 77 | follows="left|top" font="SansSerifSmall" height="16" |
74 | initial_value="false" label="Show timestamps in IM log" left="168" | 78 | initial_value="false" label="Show timestamps in IM log" left="168" |
75 | mouse_opaque="true" name="log_instant_messages_timestamp" radio_style="false" | 79 | mouse_opaque="true" name="log_instant_messages_timestamp" radio_style="false" |
76 | width="217" /> | 80 | width="217" /> |
77 | <check_box bottom="-265" enabled="true" follows="left|top" | 81 | <check_box bottom_delta="-20" enabled="true" follows="left|top" |
78 | font="SansSerifSmall" height="16" initial_value="false" | 82 | font="SansSerifSmall" height="16" initial_value="false" |
79 | label="Show the end of last IM conversation" left="168" mouse_opaque="true" | 83 | label="Show the end of last IM conversation" left="168" mouse_opaque="true" |
80 | name="log_show_history" radio_style="false" width="217" /> | 84 | name="log_show_history" radio_style="false" width="217" /> |
81 | <check_box bottom="-285" enabled="true" follows="left|top" | 85 | <check_box bottom_delta="-20" enabled="true" follows="left|top" |
82 | font="SansSerifSmall" height="16" initial_value="false" label="Save a log of Local Chat on my computer" | 86 | font="SansSerifSmall" height="16" initial_value="false" label="Save a log of Local Chat on my computer" |
83 | left="148" mouse_opaque="true" name="log_chat" radio_style="false" | 87 | left="148" mouse_opaque="true" name="log_chat" radio_style="false" |
84 | width="237" /> | 88 | width="237" /> |
85 | <check_box bottom="-305" enabled="true" follows="left|top" | 89 | <check_box bottom_delta="-20" enabled="true" follows="left|top" |
86 | font="SansSerifSmall" height="16" initial_value="false" | 90 | font="SansSerifSmall" height="16" initial_value="false" |
87 | label="Show timestamps in Local Chat log" left="168" mouse_opaque="true" | 91 | label="Show timestamps in Local Chat log" left="168" mouse_opaque="true" |
88 | name="log_chat_timestamp" radio_style="false" width="217" /> | 92 | name="log_chat_timestamp" radio_style="false" width="217" /> |
89 | <check_box bottom="-325" enabled="true" follows="left|top" | 93 | <check_box bottom_delta="-20" enabled="true" follows="left|top" |
90 | font="SansSerifSmall" height="16" initial_value="false" | 94 | font="SansSerifSmall" height="16" initial_value="false" |
91 | label="Show incoming IM in Local Chat log" left="168" mouse_opaque="true" | 95 | label="Show incoming IM in Local Chat log" left="168" mouse_opaque="true" |
92 | name="log_chat_IM" radio_style="false" width="217" /> | 96 | name="log_chat_IM" radio_style="false" width="217" /> |
93 | <check_box bottom="-345" enabled="true" follows="left|top" | 97 | <check_box bottom_delta="-20" enabled="true" follows="left|top" |
94 | font="SansSerifSmall" height="16" initial_value="false" | 98 | font="SansSerifSmall" height="16" initial_value="false" |
95 | label="Include date with timestamps" left="148" mouse_opaque="true" | 99 | label="Include date with timestamps" left="148" mouse_opaque="true" |
96 | name="log_date_timestamp" radio_style="false" width="237" /> | 100 | name="log_date_timestamp" radio_style="false" width="237" /> |
97 | <button bottom="-367" follows="right|bottom" font="SansSerif" halign="center" | 101 | <button bottom_delta="-22" follows="right|bottom" font="SansSerif" halign="center" |
98 | height="20" label="Change Path" label_selected="Change Path" left="170" | 102 | height="20" label="Change Path" label_selected="Change Path" left="170" |
99 | mouse_opaque="true" name="log_path_button" width="90" /> | 103 | mouse_opaque="true" name="log_path_button" width="90" /> |
100 | <line_editor border_drop_shadow_visible="false" border_visible="false" bottom="-366" | 104 | <line_editor border_drop_shadow_visible="false" border_visible="false" bottom_delta="1" |
101 | drop_shadow_visible="true" enabled="false" follows="top|left|right" | 105 | drop_shadow_visible="true" enabled="false" follows="top|left|right" |
102 | font="SansSerifSmall" halign="right" height="19" left="248" | 106 | font="SansSerifSmall" halign="right" height="19" left="248" |
103 | max_length="254" mouse_opaque="false" name="log_path_string" right="-20" /> | 107 | max_length="254" mouse_opaque="false" name="log_path_string" right="-20" /> |