diff options
Diffstat (limited to 'linden/indra/newview')
44 files changed, 2019 insertions, 1219 deletions
diff --git a/linden/indra/newview/aoremotectrl.cpp b/linden/indra/newview/aoremotectrl.cpp index 781f1b3..6595835 100644 --- a/linden/indra/newview/aoremotectrl.cpp +++ b/linden/indra/newview/aoremotectrl.cpp | |||
@@ -88,15 +88,22 @@ BOOL AORemoteCtrl::postBuild() | |||
88 | childSetAction("ao_show_btn", onClickShowAO, this); | 88 | childSetAction("ao_show_btn", onClickShowAO, this); |
89 | childSetAction("popup_btn", onClickPopupBtn, this); | 89 | childSetAction("popup_btn", onClickPopupBtn, this); |
90 | 90 | ||
91 | childSetEnabled("ao_sit_btn", gSavedSettings.getBOOL("AOEnabled")); | ||
92 | |||
91 | return TRUE; | 93 | return TRUE; |
92 | } | 94 | } |
93 | 95 | ||
94 | // static | 96 | // static |
95 | void AORemoteCtrl::onClickToggleAO(void* data) | 97 | void AORemoteCtrl::onClickToggleAO(void* data) |
96 | { | 98 | { |
97 | BOOL ao_enable = gSavedSettings.getBOOL("AOEnabled"); | 99 | AORemoteCtrl* self = (AORemoteCtrl*)data; |
98 | gSavedSettings.setBOOL("AOEnabled", !ao_enable); | 100 | if (self) |
99 | LLFloaterAO::run(); | 101 | { |
102 | BOOL ao_enable = gSavedSettings.getBOOL("AOEnabled"); | ||
103 | gSavedSettings.setBOOL("AOEnabled", !ao_enable); | ||
104 | self->childSetEnabled("ao_sit_btn", !ao_enable); | ||
105 | LLFloaterAO::run(); | ||
106 | } | ||
100 | } | 107 | } |
101 | 108 | ||
102 | //static | 109 | //static |
diff --git a/linden/indra/newview/app_settings/default_grids.xml b/linden/indra/newview/app_settings/default_grids.xml index c45010b..ddbd921 100644 --- a/linden/indra/newview/app_settings/default_grids.xml +++ b/linden/indra/newview/app_settings/default_grids.xml | |||
@@ -1,7 +1,7 @@ | |||
1 | <llsd> | 1 | <llsd> |
2 | <array> | 2 | <array> |
3 | <map> | 3 | <map> |
4 | <key>default_grids_version</key><string>33</string> | 4 | <key>default_grids_version</key><string>37</string> |
5 | </map> | 5 | </map> |
6 | 6 | ||
7 | <!-- Local Host --> | 7 | <!-- Local Host --> |
@@ -153,12 +153,13 @@ | |||
153 | <key>gridname</key><string>Role Play Worlds</string> | 153 | <key>gridname</key><string>Role Play Worlds</string> |
154 | <key>platform</key><string>OpenSim</string> | 154 | <key>platform</key><string>OpenSim</string> |
155 | <key>loginuri</key><string>http://grid.roleplayworlds.net:8002/</string> | 155 | <key>loginuri</key><string>http://grid.roleplayworlds.net:8002/</string> |
156 | <key>loginpage</key><string>http://grid.roleplayworlds.net/loginscreen.php</string> | 156 | <key>loginpage</key><string>http://roleplayworlds.net/loginscreen</string> |
157 | <key>helperuri</key><string>http://grid.roleplayworlds.net/</string> | 157 | <key>helperuri</key><string>http://grid.roleplayworlds.net/</string> |
158 | <key>website</key><string>http://roleplayworlds.net/</string> | 158 | <key>website</key><string>http://roleplayworlds.net/</string> |
159 | <key>register</key><string>http://grid.roleplayworlds.net/index.php?page=create</string> | 159 | <key>support</key><string>http://roleplayworlds.net/help</string> |
160 | <key>password</key><string>http://grid.roleplayworlds.net/index.php?page=change</string> | 160 | <key>register</key><string>http://roleplayworlds.net/register</string> |
161 | <key>version</key><string>0</string> | 161 | <key>password</key><string>http://roleplayworlds.net/password</string> |
162 | <key>version</key><string>1</string> | ||
162 | </map> | 163 | </map> |
163 | 164 | ||
164 | <!-- The New World Grid --> | 165 | <!-- The New World Grid --> |
@@ -166,14 +167,14 @@ | |||
166 | <key>gridnick</key><string>thenewworldgrid</string> | 167 | <key>gridnick</key><string>thenewworldgrid</string> |
167 | <key>gridname</key><string>The New World Grid</string> | 168 | <key>gridname</key><string>The New World Grid</string> |
168 | <key>platform</key><string>OpenSim</string> | 169 | <key>platform</key><string>OpenSim</string> |
169 | <key>loginuri</key><string>http://grid.newworldgrid.com:8002/</string> | 170 | <key>loginuri</key><string>http://giantgrid.no-ip.biz:8002/</string> |
170 | <key>loginpage</key><string>http://account.newworldgrid.com/loginscreen.php</string> | 171 | <key>loginpage</key><string>http://www.giantgrid.nl</string> |
171 | <key>helperuri</key><string>http://account.newworldgrid.com/</string> | 172 | <key>helperuri</key><string>http://giantgrid.no-ip.biz/XoopCube/html/modules/xoopensim/helper/</string> |
172 | <key>website</key><string>http://www.newworldgrid.com/</string> | 173 | <key>website</key><string>http://www.giantgrid.nl</string> |
173 | <key>support</key><string>http://www.newworldgrid.com/</string> | 174 | <key>register</key><string>http://giantgrid.no-ip.biz:8002/wifi/user/account/</string> |
174 | <key>register</key><string>http://www.newworldgrid.com/register</string> | 175 | <key>password</key><string>http://giantgrid.no-ip.biz:8002/wifi/forgotpassword</string> |
175 | <key>password</key><string>http://account.newworldgrid.com/</string> | 176 | <key>support</key><string>http://gianttest.no-ip.biz/ticket/</string> |
176 | <key>version</key><string>0</string> | 177 | <key>version</key><string>1</string> |
177 | </map> | 178 | </map> |
178 | 179 | ||
179 | <!-- 3rd Rock Grid --> | 180 | <!-- 3rd Rock Grid --> |
diff --git a/linden/indra/newview/app_settings/logcontrol.xml b/linden/indra/newview/app_settings/logcontrol.xml index a94bc1b..cb40d7e 100644 --- a/linden/indra/newview/app_settings/logcontrol.xml +++ b/linden/indra/newview/app_settings/logcontrol.xml | |||
@@ -53,8 +53,8 @@ | |||
53 | <!--<string>AudioEngine</string>--> | 53 | <!--<string>AudioEngine</string>--> |
54 | <!--<string>BodyPhysics</string>--> | 54 | <!--<string>BodyPhysics</string>--> |
55 | <!--<string>InitInfo</string>--> | 55 | <!--<string>InitInfo</string>--> |
56 | <string>Inventory</string> | ||
56 | <!--<string>isOwnedSelf</string>--> | 57 | <!--<string>isOwnedSelf</string>--> |
57 | <!--<string>Inventory</string>--> | ||
58 | <!--<string>HUDEffect</string>--> | 58 | <!--<string>HUDEffect</string>--> |
59 | <!--<string>MarkerFile</string>--> | 59 | <!--<string>MarkerFile</string>--> |
60 | <!--<string>Media</string>--> | 60 | <!--<string>Media</string>--> |
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 0ffc5e0..2ab49df 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -552,7 +552,7 @@ | |||
552 | <key>Value</key> | 552 | <key>Value</key> |
553 | <integer>1</integer> | 553 | <integer>1</integer> |
554 | </map> | 554 | </map> |
555 | <key>FetchInventoryOnLogin</key> | 555 | <key>FetchInventoryOnLogin2</key> |
556 | <map> | 556 | <map> |
557 | <key>Comment</key> | 557 | <key>Comment</key> |
558 | <string>Automatically fetch the inventory in the background after login (has issues)</string> | 558 | <string>Automatically fetch the inventory in the background after login (has issues)</string> |
@@ -561,7 +561,7 @@ | |||
561 | <key>Type</key> | 561 | <key>Type</key> |
562 | <string>Boolean</string> | 562 | <string>Boolean</string> |
563 | <key>Value</key> | 563 | <key>Value</key> |
564 | <integer>0</integer> | 564 | <integer>1</integer> |
565 | </map> | 565 | </map> |
566 | <key>FloaterAnimationListRect</key> | 566 | <key>FloaterAnimationListRect</key> |
567 | <map> | 567 | <map> |
@@ -1031,7 +1031,7 @@ | |||
1031 | <key>Type</key> | 1031 | <key>Type</key> |
1032 | <string>Boolean</string> | 1032 | <string>Boolean</string> |
1033 | <key>Value</key> | 1033 | <key>Value</key> |
1034 | <integer>0</integer> | 1034 | <integer>1</integer> |
1035 | </map> | 1035 | </map> |
1036 | <key>ShowLookAtNames</key> | 1036 | <key>ShowLookAtNames</key> |
1037 | <map> | 1037 | <map> |
@@ -8240,17 +8240,6 @@ | |||
8240 | <key>Value</key> | 8240 | <key>Value</key> |
8241 | <real>48.0</real> | 8241 | <real>48.0</real> |
8242 | </map> | 8242 | </map> |
8243 | <key>MaxSelectDistance</key> | ||
8244 | <map> | ||
8245 | <key>Comment</key> | ||
8246 | <string>Maximum allowed selection distance (meters from avatar)</string> | ||
8247 | <key>Persist</key> | ||
8248 | <integer>1</integer> | ||
8249 | <key>Type</key> | ||
8250 | <string>F32</string> | ||
8251 | <key>Value</key> | ||
8252 | <real>64.0</real> | ||
8253 | </map> | ||
8254 | <key>MeanCollisionBump</key> | 8243 | <key>MeanCollisionBump</key> |
8255 | <map> | 8244 | <map> |
8256 | <key>Comment</key> | 8245 | <key>Comment</key> |
diff --git a/linden/indra/newview/floaterao.cpp b/linden/indra/newview/floaterao.cpp index df88d6f..843cb3a 100644 --- a/linden/indra/newview/floaterao.cpp +++ b/linden/indra/newview/floaterao.cpp | |||
@@ -34,6 +34,8 @@ | |||
34 | #include "llboost.h" | 34 | #include "llboost.h" |
35 | #include <boost/regex.hpp> | 35 | #include <boost/regex.hpp> |
36 | 36 | ||
37 | static LLFrameTimer sInitTimer; | ||
38 | |||
37 | void cmdline_printchat(std::string message); | 39 | void cmdline_printchat(std::string message); |
38 | 40 | ||
39 | AOInvTimer* gAOInvTimer = NULL; | 41 | AOInvTimer* gAOInvTimer = NULL; |
@@ -72,6 +74,11 @@ public: | |||
72 | text->insertText(line); | 74 | text->insertText(line); |
73 | } | 75 | } |
74 | file.close(); | 76 | file.close(); |
77 | |||
78 | if (line.empty()) | ||
79 | { | ||
80 | llwarns << "Can't open ao_template.ini at << " << mFileName << llendl; | ||
81 | } | ||
75 | 82 | ||
76 | nc->saveIfNeeded(); | 83 | nc->saveIfNeeded(); |
77 | } | 84 | } |
@@ -113,37 +120,71 @@ BOOL AOStandTimer::tick() | |||
113 | 120 | ||
114 | // ------------------------------------------------------- | 121 | // ------------------------------------------------------- |
115 | 122 | ||
123 | BOOL AOInvTimer::sInitialized = FALSE; | ||
124 | |||
116 | AOInvTimer::AOInvTimer() : LLEventTimer( (F32)1.0 ) | 125 | AOInvTimer::AOInvTimer() : LLEventTimer( (F32)1.0 ) |
117 | { | 126 | { |
127 | // if we can't find the item we need, start the init timer | ||
128 | // background inventory fetching has already begun in llstartup -- MC | ||
129 | if (LLStartUp::getStartupState() == STATE_STARTED) | ||
130 | { | ||
131 | LLUUID ao_notecard = (LLUUID)gSavedPerAccountSettings.getString("AOConfigNotecardID"); | ||
132 | if (ao_notecard.notNull()) | ||
133 | { | ||
134 | const LLInventoryItem* item = gInventory.getItem(ao_notecard); | ||
135 | if (!item) | ||
136 | { | ||
137 | sInitTimer.start(); | ||
138 | sInitTimer.setTimerExpirySec(10.0f); | ||
139 | } | ||
140 | else | ||
141 | { | ||
142 | sInitialized = LLFloaterAO::init(); | ||
143 | if (!sInitialized) // should never happen, but just in case -- MC | ||
144 | { | ||
145 | sInitTimer.start(); | ||
146 | sInitTimer.setTimerExpirySec(10.0f); | ||
147 | } | ||
148 | } | ||
149 | } | ||
150 | } | ||
118 | } | 151 | } |
152 | |||
119 | AOInvTimer::~AOInvTimer() | 153 | AOInvTimer::~AOInvTimer() |
120 | { | 154 | { |
121 | } | 155 | } |
122 | 156 | ||
123 | BOOL AOInvTimer::fullfetch = FALSE; | ||
124 | |||
125 | BOOL AOInvTimer::tick() | 157 | BOOL AOInvTimer::tick() |
126 | { | 158 | { |
127 | if (!(gSavedSettings.getBOOL("AOEnabled"))) return TRUE; | 159 | /*if (!(gSavedSettings.getBOOL("AOEnabled"))) |
128 | if(LLStartUp::getStartupState() >= STATE_INVENTORY_SEND) | 160 | { |
161 | return TRUE; | ||
162 | }*/ | ||
163 | |||
164 | if (gInventory.isEverythingFetched()) | ||
129 | { | 165 | { |
130 | if(gInventory.isEverythingFetched()) | 166 | if (!sInitialized) |
131 | { | 167 | { |
132 | // cmdline_printchat("Inventory fetched, loading AO."); | ||
133 | LLFloaterAO::init(); | 168 | LLFloaterAO::init(); |
134 | return TRUE; | 169 | sInitialized = TRUE; // this can happen even if we can't initialize the AO -- MC |
135 | }else | 170 | } |
171 | |||
172 | if (sInitTimer.getStarted()) | ||
136 | { | 173 | { |
137 | //static BOOL startedfetch = FALSE; | 174 | sInitTimer.stop(); |
138 | if(fullfetch == FALSE) | ||
139 | { | ||
140 | fullfetch = TRUE; | ||
141 | //no choice, can't move the AO till we find it, should only have to happen once | ||
142 | gInventory.startBackgroundFetch(); | ||
143 | } | ||
144 | } | 175 | } |
145 | } | 176 | } |
146 | return FALSE; | 177 | |
178 | if (!sInitialized && LLStartUp::getStartupState() == STATE_STARTED) | ||
179 | { | ||
180 | if (sInitTimer.hasExpired()) | ||
181 | { | ||
182 | sInitTimer.start(); | ||
183 | sInitTimer.setTimerExpirySec(10.0f); | ||
184 | sInitialized = LLFloaterAO::init(); | ||
185 | } | ||
186 | } | ||
187 | return sInitialized; | ||
147 | } | 188 | } |
148 | // NC DROP ------------------------------------------------------- | 189 | // NC DROP ------------------------------------------------------- |
149 | 190 | ||
@@ -210,40 +251,40 @@ BOOL AONoteCardDropTarget::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, | |||
210 | return handled; | 251 | return handled; |
211 | } | 252 | } |
212 | 253 | ||
213 | AONoteCardDropTarget * LLFloaterAO::mAOItemDropTarget; | 254 | AONoteCardDropTarget * LLFloaterAO::sAOItemDropTarget; |
214 | 255 | ||
215 | 256 | ||
216 | // STUFF ------------------------------------------------------- | 257 | // STUFF ------------------------------------------------------- |
217 | 258 | ||
218 | int LLFloaterAO::mAnimationState = 0; | 259 | S32 LLFloaterAO::sAnimationState = 0; |
219 | int LLFloaterAO::stand_iterator = 0; | 260 | S32 LLFloaterAO::stand_iterator = 0; |
220 | 261 | ||
221 | LLUUID LLFloaterAO::invfolderid = LLUUID::null; | 262 | LLUUID LLFloaterAO::invfolderid = LLUUID::null; |
222 | LLUUID LLFloaterAO::mCurrentStandId = LLUUID::null; | 263 | LLUUID LLFloaterAO::sCurrentStandId = LLUUID::null; |
223 | 264 | ||
224 | LLComboBox* mcomboBox_stands; | 265 | LLComboBox* mComboBox_stands; |
225 | LLComboBox* mcomboBox_walks; | 266 | LLComboBox* mComboBox_walks; |
226 | LLComboBox* mcomboBox_runs; | 267 | LLComboBox* mComboBox_runs; |
227 | LLComboBox* mcomboBox_jumps; | 268 | LLComboBox* mComboBox_jumps; |
228 | LLComboBox* mcomboBox_sits; | 269 | LLComboBox* mComboBox_sits; |
229 | LLComboBox* mcomboBox_gsits; | 270 | LLComboBox* mComboBox_gsits; |
230 | LLComboBox* mcomboBox_crouchs; | 271 | LLComboBox* mComboBox_crouchs; |
231 | LLComboBox* mcomboBox_cwalks; | 272 | LLComboBox* mComboBox_cwalks; |
232 | LLComboBox* mcomboBox_falls; | 273 | LLComboBox* mComboBox_falls; |
233 | LLComboBox* mcomboBox_hovers; | 274 | LLComboBox* mComboBox_hovers; |
234 | LLComboBox* mcomboBox_flys; | 275 | LLComboBox* mComboBox_flys; |
235 | LLComboBox* mcomboBox_flyslows; | 276 | LLComboBox* mComboBox_flyslows; |
236 | LLComboBox* mcomboBox_flyups; | 277 | LLComboBox* mComboBox_flyups; |
237 | LLComboBox* mcomboBox_flydowns; | 278 | LLComboBox* mComboBox_flydowns; |
238 | LLComboBox* mcomboBox_lands; | 279 | LLComboBox* mComboBox_lands; |
239 | LLComboBox* mcomboBox_standups; | 280 | LLComboBox* mComboBox_standups; |
240 | LLComboBox* mcomboBox_prejumps; | 281 | LLComboBox* mComboBox_prejumps; |
241 | 282 | ||
242 | struct struct_overrides | 283 | struct struct_overrides |
243 | { | 284 | { |
244 | LLUUID orig_id; | 285 | LLUUID orig_id; |
245 | LLUUID ao_id; | 286 | LLUUID ao_id; |
246 | int state; | 287 | S32 state; |
247 | }; | 288 | }; |
248 | std::vector<struct_overrides> mAOOverrides; | 289 | std::vector<struct_overrides> mAOOverrides; |
249 | 290 | ||
@@ -257,14 +298,16 @@ std::vector<struct_stands> mAOStands; | |||
257 | struct struct_tokens | 298 | struct struct_tokens |
258 | { | 299 | { |
259 | std::string token; | 300 | std::string token; |
260 | int state; | 301 | S32 state; |
261 | }; | 302 | }; |
262 | std::vector<struct_tokens> mAOTokens; | 303 | std::vector<struct_tokens> mAOTokens; |
263 | 304 | ||
264 | LLFloaterAO* LLFloaterAO::sInstance = NULL; | 305 | LLFloaterAO* LLFloaterAO::sInstance = NULL; |
265 | 306 | ||
266 | LLFloaterAO::LLFloaterAO() | 307 | LLFloaterAO::LLFloaterAO() |
267 | :LLFloater(std::string("floater_ao")) | 308 | : |
309 | LLFloater(std::string("floater_ao")), | ||
310 | mDirty(FALSE) | ||
268 | { | 311 | { |
269 | // init(); | 312 | // init(); |
270 | llassert_always(sInstance == NULL); | 313 | llassert_always(sInstance == NULL); |
@@ -275,80 +318,55 @@ LLFloaterAO::LLFloaterAO() | |||
275 | LLFloaterAO::~LLFloaterAO() | 318 | LLFloaterAO::~LLFloaterAO() |
276 | { | 319 | { |
277 | sInstance=NULL; | 320 | sInstance=NULL; |
278 | mcomboBox_stands = 0; | 321 | mComboBox_stands = 0; |
279 | mcomboBox_walks = 0; | 322 | mComboBox_walks = 0; |
280 | mcomboBox_runs = 0; | 323 | mComboBox_runs = 0; |
281 | mcomboBox_jumps = 0; | 324 | mComboBox_jumps = 0; |
282 | mcomboBox_sits = 0; | 325 | mComboBox_sits = 0; |
283 | mcomboBox_gsits = 0; | 326 | mComboBox_gsits = 0; |
284 | mcomboBox_crouchs = 0; | 327 | mComboBox_crouchs = 0; |
285 | mcomboBox_cwalks = 0; | 328 | mComboBox_cwalks = 0; |
286 | mcomboBox_falls = 0; | 329 | mComboBox_falls = 0; |
287 | mcomboBox_hovers = 0; | 330 | mComboBox_hovers = 0; |
288 | mcomboBox_flys = 0; | 331 | mComboBox_flys = 0; |
289 | mcomboBox_flyslows = 0; | 332 | mComboBox_flyslows = 0; |
290 | mcomboBox_flyups = 0; | 333 | mComboBox_flyups = 0; |
291 | mcomboBox_flydowns = 0; | 334 | mComboBox_flydowns = 0; |
292 | mcomboBox_lands = 0; | 335 | mComboBox_lands = 0; |
293 | mcomboBox_standups = 0; | 336 | mComboBox_standups = 0; |
294 | mcomboBox_prejumps = 0; | 337 | mComboBox_prejumps = 0; |
295 | delete mAOItemDropTarget; | 338 | delete sAOItemDropTarget; |
296 | mAOItemDropTarget = NULL; | 339 | sAOItemDropTarget = NULL; |
297 | // llinfos << "floater destroyed" << llendl; | 340 | // llinfos << "floater destroyed" << llendl; |
298 | } | 341 | } |
299 | 342 | ||
300 | void LLFloaterAO::show(void*) | ||
301 | { | ||
302 | if (!sInstance) | ||
303 | { | ||
304 | sInstance = new LLFloaterAO(); | ||
305 | updateLayout(sInstance); | ||
306 | init(); | ||
307 | |||
308 | sInstance->open(); | ||
309 | } | ||
310 | else | ||
311 | { | ||
312 | sInstance->close(); | ||
313 | } | ||
314 | LLFirstUse::useAO(); | ||
315 | } | ||
316 | |||
317 | bool LLFloaterAO::getInstance() | ||
318 | { | ||
319 | if (sInstance) | ||
320 | return true; | ||
321 | else | ||
322 | return false; | ||
323 | } | ||
324 | |||
325 | BOOL LLFloaterAO::postBuild() | 343 | BOOL LLFloaterAO::postBuild() |
326 | { | 344 | { |
327 | LLView *target_view = getChild<LLView>("ao_notecard"); | 345 | LLView *target_view = getChild<LLView>("ao_notecard"); |
328 | if(target_view) | 346 | if (target_view) |
329 | { | 347 | { |
330 | if (mAOItemDropTarget) | 348 | if (sAOItemDropTarget) |
331 | { | 349 | { |
332 | delete mAOItemDropTarget; | 350 | delete sAOItemDropTarget; |
333 | } | 351 | } |
334 | mAOItemDropTarget = new AONoteCardDropTarget("drop target", target_view->getRect(), AOItemDrop);//, mAvatarID); | 352 | sAOItemDropTarget = new AONoteCardDropTarget("drop target", target_view->getRect(), AOItemDrop);//, mAvatarID); |
335 | addChild(mAOItemDropTarget); | 353 | addChild(sAOItemDropTarget); |
336 | } | 354 | } |
337 | if(LLStartUp::getStartupState() == STATE_STARTED) | 355 | if (LLStartUp::getStartupState() == STATE_STARTED) |
338 | { | 356 | { |
339 | LLUUID itemidimport = (LLUUID)gSavedPerAccountSettings.getString("AOConfigNotecardID"); | 357 | LLUUID itemidimport = (LLUUID)gSavedPerAccountSettings.getString("AOConfigNotecardID"); |
340 | LLViewerInventoryItem* itemimport = gInventory.getItem(itemidimport); | 358 | LLViewerInventoryItem* itemimport = gInventory.getItem(itemidimport); |
341 | if(itemimport) | 359 | if (itemimport) |
342 | { | 360 | { |
343 | childSetValue("ao_nc_text","Currently set to: "+itemimport->getName()); | 361 | childSetValue("ao_nc_text","Currently set to: "+itemimport->getName()); |
344 | } | 362 | } |
345 | else if(itemidimport.isNull()) | 363 | else if (itemidimport.isNull()) |
346 | { | 364 | { |
347 | childSetValue("ao_nc_text","Currently not set"); | 365 | childSetValue("ao_nc_text","Currently not set"); |
348 | } | 366 | } |
349 | else | 367 | else |
350 | { | 368 | { |
351 | childSetValue("ao_nc_text","Currently set to a item not on this account"); | 369 | childSetValue("ao_nc_text","Currently not loaded"); |
352 | } | 370 | } |
353 | } | 371 | } |
354 | else | 372 | else |
@@ -366,23 +384,23 @@ BOOL LLFloaterAO::postBuild() | |||
366 | childSetCommitCallback("AOEnabled",onClickToggleAO); | 384 | childSetCommitCallback("AOEnabled",onClickToggleAO); |
367 | childSetCommitCallback("AOSitsEnabled",onClickToggleSits); | 385 | childSetCommitCallback("AOSitsEnabled",onClickToggleSits); |
368 | childSetCommitCallback("standtime",onSpinnerCommit); | 386 | childSetCommitCallback("standtime",onSpinnerCommit); |
369 | mcomboBox_stands = getChild<LLComboBox>("stands"); | 387 | mComboBox_stands = getChild<LLComboBox>("stands"); |
370 | mcomboBox_walks = getChild<LLComboBox>("walks"); | 388 | mComboBox_walks = getChild<LLComboBox>("walks"); |
371 | mcomboBox_runs = getChild<LLComboBox>("runs"); | 389 | mComboBox_runs = getChild<LLComboBox>("runs"); |
372 | mcomboBox_jumps = getChild<LLComboBox>("jumps"); | 390 | mComboBox_jumps = getChild<LLComboBox>("jumps"); |
373 | mcomboBox_sits = getChild<LLComboBox>("sits"); | 391 | mComboBox_sits = getChild<LLComboBox>("sits"); |
374 | mcomboBox_gsits = getChild<LLComboBox>("gsits"); | 392 | mComboBox_gsits = getChild<LLComboBox>("gsits"); |
375 | mcomboBox_crouchs = getChild<LLComboBox>("crouchs"); | 393 | mComboBox_crouchs = getChild<LLComboBox>("crouchs"); |
376 | mcomboBox_cwalks = getChild<LLComboBox>("cwalks"); | 394 | mComboBox_cwalks = getChild<LLComboBox>("cwalks"); |
377 | mcomboBox_falls = getChild<LLComboBox>("falls"); | 395 | mComboBox_falls = getChild<LLComboBox>("falls"); |
378 | mcomboBox_hovers = getChild<LLComboBox>("hovers"); | 396 | mComboBox_hovers = getChild<LLComboBox>("hovers"); |
379 | mcomboBox_flys = getChild<LLComboBox>("flys"); | 397 | mComboBox_flys = getChild<LLComboBox>("flys"); |
380 | mcomboBox_flyslows = getChild<LLComboBox>("flyslows"); | 398 | mComboBox_flyslows = getChild<LLComboBox>("flyslows"); |
381 | mcomboBox_flyups = getChild<LLComboBox>("flyups"); | 399 | mComboBox_flyups = getChild<LLComboBox>("flyups"); |
382 | mcomboBox_flydowns = getChild<LLComboBox>("flydowns"); | 400 | mComboBox_flydowns = getChild<LLComboBox>("flydowns"); |
383 | mcomboBox_lands = getChild<LLComboBox>("lands"); | 401 | mComboBox_lands = getChild<LLComboBox>("lands"); |
384 | mcomboBox_standups = getChild<LLComboBox>("standups"); | 402 | mComboBox_standups = getChild<LLComboBox>("standups"); |
385 | mcomboBox_prejumps = getChild<LLComboBox>("prejumps"); | 403 | mComboBox_prejumps = getChild<LLComboBox>("prejumps"); |
386 | getChild<LLComboBox>("stands")->setCommitCallback(onComboBoxCommit); | 404 | getChild<LLComboBox>("stands")->setCommitCallback(onComboBoxCommit); |
387 | getChild<LLComboBox>("walks")->setCommitCallback(onComboBoxCommit); | 405 | getChild<LLComboBox>("walks")->setCommitCallback(onComboBoxCommit); |
388 | getChild<LLComboBox>("runs")->setCommitCallback(onComboBoxCommit); | 406 | getChild<LLComboBox>("runs")->setCommitCallback(onComboBoxCommit); |
@@ -404,10 +422,49 @@ BOOL LLFloaterAO::postBuild() | |||
404 | return TRUE; | 422 | return TRUE; |
405 | } | 423 | } |
406 | 424 | ||
425 | // static | ||
426 | void LLFloaterAO::show(void*) | ||
427 | { | ||
428 | if (!sInstance) | ||
429 | { | ||
430 | sInstance = new LLFloaterAO(); | ||
431 | updateLayout(sInstance); | ||
432 | init(); | ||
433 | |||
434 | sInstance->open(); | ||
435 | } | ||
436 | else | ||
437 | { | ||
438 | sInstance->close(); | ||
439 | } | ||
440 | LLFirstUse::useAO(); | ||
441 | } | ||
442 | |||
443 | // static | ||
444 | LLFloaterAO* LLFloaterAO::getInstance() | ||
445 | { | ||
446 | if (!sInstance) | ||
447 | { | ||
448 | sInstance = new LLFloaterAO(); | ||
449 | } | ||
450 | return sInstance; | ||
451 | } | ||
452 | |||
453 | // static | ||
454 | bool LLFloaterAO::getVisible() | ||
455 | { | ||
456 | if (sInstance) | ||
457 | { | ||
458 | return true; | ||
459 | } | ||
460 | return false; | ||
461 | } | ||
462 | |||
463 | // static | ||
407 | void LLFloaterAO::onSpinnerCommit(LLUICtrl* ctrl, void* userdata) | 464 | void LLFloaterAO::onSpinnerCommit(LLUICtrl* ctrl, void* userdata) |
408 | { | 465 | { |
409 | LLSpinCtrl* spin = (LLSpinCtrl*) ctrl; | 466 | LLSpinCtrl* spin = (LLSpinCtrl*)ctrl; |
410 | if(spin) | 467 | if (spin) |
411 | { | 468 | { |
412 | if (spin->getName() == "standtime") | 469 | if (spin->getName() == "standtime") |
413 | { | 470 | { |
@@ -416,10 +473,11 @@ void LLFloaterAO::onSpinnerCommit(LLUICtrl* ctrl, void* userdata) | |||
416 | } | 473 | } |
417 | } | 474 | } |
418 | 475 | ||
476 | // static | ||
419 | void LLFloaterAO::onComboBoxCommit(LLUICtrl* ctrl, void* userdata) | 477 | void LLFloaterAO::onComboBoxCommit(LLUICtrl* ctrl, void* userdata) |
420 | { | 478 | { |
421 | LLComboBox* box = (LLComboBox*)ctrl; | 479 | LLComboBox* box = (LLComboBox*)ctrl; |
422 | if(box) | 480 | if (box) |
423 | { | 481 | { |
424 | if (box->getName() == "stands") | 482 | if (box->getName() == "stands") |
425 | { | 483 | { |
@@ -429,7 +487,7 @@ void LLFloaterAO::onComboBoxCommit(LLUICtrl* ctrl, void* userdata) | |||
429 | } | 487 | } |
430 | else | 488 | else |
431 | { | 489 | { |
432 | int state = STATE_AGENT_IDLE; | 490 | S32 state = STATE_AGENT_IDLE; |
433 | std::string stranim = box->getValue().asString(); | 491 | std::string stranim = box->getValue().asString(); |
434 | // llinfos << "state " << (gAgent.getAvatarObject()->mIsSitting) << " - " << getAnimationState() << llendl; | 492 | // llinfos << "state " << (gAgent.getAvatarObject()->mIsSitting) << " - " << getAnimationState() << llendl; |
435 | if (box->getName() == "walks") | 493 | if (box->getName() == "walks") |
@@ -556,6 +614,7 @@ void LLFloaterAO::onComboBoxCommit(LLUICtrl* ctrl, void* userdata) | |||
556 | } | 614 | } |
557 | } | 615 | } |
558 | 616 | ||
617 | // static | ||
559 | void LLFloaterAO::updateLayout(LLFloaterAO* floater) | 618 | void LLFloaterAO::updateLayout(LLFloaterAO* floater) |
560 | { | 619 | { |
561 | if (floater) | 620 | if (floater) |
@@ -613,8 +672,10 @@ void LLFloaterAO::updateLayout(LLFloaterAO* floater) | |||
613 | } | 672 | } |
614 | } | 673 | } |
615 | 674 | ||
616 | void LLFloaterAO::init() | 675 | // static |
676 | bool LLFloaterAO::init() | ||
617 | { | 677 | { |
678 | //cmdline_printchat("init() called"); | ||
618 | mAOStands.clear(); | 679 | mAOStands.clear(); |
619 | mAOTokens.clear(); | 680 | mAOTokens.clear(); |
620 | mAOOverrides.clear(); | 681 | mAOOverrides.clear(); |
@@ -673,82 +734,87 @@ void LLFloaterAO::init() | |||
673 | overrideloader.orig_id = ANIM_AGENT_FLY; overrideloader.ao_id = LLUUID::null; overrideloader.state = STATE_AGENT_FLY; mAOOverrides.push_back(overrideloader); | 734 | overrideloader.orig_id = ANIM_AGENT_FLY; overrideloader.ao_id = LLUUID::null; overrideloader.state = STATE_AGENT_FLY; mAOOverrides.push_back(overrideloader); |
674 | overrideloader.orig_id = ANIM_AGENT_FLYSLOW; overrideloader.ao_id = LLUUID::null; overrideloader.state = STATE_AGENT_FLYSLOW; mAOOverrides.push_back(overrideloader); | 735 | overrideloader.orig_id = ANIM_AGENT_FLYSLOW; overrideloader.ao_id = LLUUID::null; overrideloader.state = STATE_AGENT_FLYSLOW; mAOOverrides.push_back(overrideloader); |
675 | 736 | ||
676 | BOOL success = TRUE; | 737 | BOOL success = FALSE; |
677 | 738 | ||
678 | if(LLStartUp::getStartupState() >= STATE_INVENTORY_SEND) | 739 | if (LLStartUp::getStartupState() >= STATE_INVENTORY_SEND) |
679 | { | 740 | { |
680 | if(gInventory.isEverythingFetched()) | 741 | LLUUID configncitem = (LLUUID)gSavedPerAccountSettings.getString("AOConfigNotecardID"); |
742 | if (configncitem.notNull()) | ||
681 | { | 743 | { |
682 | LLUUID configncitem = (LLUUID)gSavedPerAccountSettings.getString("AOConfigNotecardID"); | 744 | const LLInventoryItem* item = gInventory.getItem(configncitem); |
683 | if (configncitem.notNull()) | 745 | if (item) |
684 | { | 746 | { |
685 | success = FALSE; | 747 | if (gAgent.allowOperation(PERM_COPY, item->getPermissions(),GP_OBJECT_MANIPULATE) || gAgent.isGodlike()) |
686 | const LLInventoryItem* item = gInventory.getItem(configncitem); | ||
687 | if(item) | ||
688 | { | 748 | { |
689 | if (gAgent.allowOperation(PERM_COPY, item->getPermissions(),GP_OBJECT_MANIPULATE) || gAgent.isGodlike()) | 749 | if (!item->getAssetUUID().isNull()) |
690 | { | 750 | { |
691 | if(!item->getAssetUUID().isNull()) | 751 | LLUUID* new_uuid = new LLUUID(configncitem); |
692 | { | 752 | LLHost source_sim = LLHost::invalid; |
693 | LLUUID* new_uuid = new LLUUID(configncitem); | 753 | invfolderid = item->getParentUUID(); |
694 | LLHost source_sim = LLHost::invalid; | 754 | gAssetStorage->getInvItemAsset(source_sim, |
695 | invfolderid = item->getParentUUID(); | 755 | gAgent.getID(), |
696 | gAssetStorage->getInvItemAsset(source_sim, | 756 | gAgent.getSessionID(), |
697 | gAgent.getID(), | 757 | item->getPermissions().getOwner(), |
698 | gAgent.getSessionID(), | 758 | LLUUID::null, |
699 | item->getPermissions().getOwner(), | 759 | item->getUUID(), |
700 | LLUUID::null, | 760 | item->getAssetUUID(), |
701 | item->getUUID(), | 761 | item->getType(), |
702 | item->getAssetUUID(), | 762 | &onNotecardLoadComplete, |
703 | item->getType(), | 763 | (void*)new_uuid, |
704 | &onNotecardLoadComplete, | 764 | TRUE); |
705 | (void*)new_uuid, | 765 | success = TRUE; |
706 | TRUE); | ||
707 | success = TRUE; | ||
708 | } | ||
709 | } | 766 | } |
710 | } | 767 | } |
711 | } | 768 | } |
769 | else // item | ||
770 | { | ||
771 | //cmdline_printchat("no item (notecard)"); | ||
772 | } | ||
712 | } | 773 | } |
713 | } | 774 | } |
714 | 775 | else // notecard null | |
715 | if (!success) | ||
716 | { | 776 | { |
717 | cmdline_printchat("Could not read the specified Config Notecard"); | 777 | //cmdline_printchat("Config Notecard set to a null UUID!"); |
718 | } | 778 | } |
719 | 779 | ||
720 | // mAnimationState = 0; | 780 | // sAnimationState = 0; |
721 | // mCurrentStandId = LLUUID::null; | 781 | // sCurrentStandId = LLUUID::null; |
722 | // setAnimationState(STATE_AGENT_IDLE); | 782 | // setAnimationState(STATE_AGENT_IDLE); |
723 | 783 | ||
784 | return success; | ||
724 | } | 785 | } |
725 | 786 | ||
787 | // static | ||
726 | void LLFloaterAO::onClickMore(void* data) | 788 | void LLFloaterAO::onClickMore(void* data) |
727 | { | 789 | { |
728 | gSavedSettings.setBOOL( "AOAdvanced", TRUE ); | 790 | gSavedSettings.setBOOL( "AOAdvanced", TRUE ); |
729 | updateLayout(sInstance); | 791 | updateLayout(sInstance); |
730 | } | 792 | } |
793 | |||
794 | // static | ||
731 | void LLFloaterAO::onClickLess(void* data) | 795 | void LLFloaterAO::onClickLess(void* data) |
732 | { | 796 | { |
733 | gSavedSettings.setBOOL( "AOAdvanced", FALSE ); | 797 | gSavedSettings.setBOOL( "AOAdvanced", FALSE ); |
734 | updateLayout(sInstance); | 798 | updateLayout(sInstance); |
735 | } | 799 | } |
736 | 800 | ||
801 | // static | ||
737 | void LLFloaterAO::onClickToggleAO(LLUICtrl *, void*) | 802 | void LLFloaterAO::onClickToggleAO(LLUICtrl *, void*) |
738 | { | 803 | { |
739 | run(); | 804 | run(); |
740 | } | 805 | } |
741 | 806 | ||
807 | // static | ||
742 | void LLFloaterAO::onClickToggleSits(LLUICtrl *, void*) | 808 | void LLFloaterAO::onClickToggleSits(LLUICtrl *, void*) |
743 | { | 809 | { |
744 | run(); | 810 | run(); |
745 | } | 811 | } |
746 | 812 | ||
747 | 813 | // static | |
748 | void LLFloaterAO::run() | 814 | void LLFloaterAO::run() |
749 | { | 815 | { |
750 | setAnimationState(STATE_AGENT_IDLE); // reset state | 816 | setAnimationState(STATE_AGENT_IDLE); // reset state |
751 | int state = getAnimationState(); // check if sitting or hovering | 817 | S32 state = getAnimationState(); // check if sitting or hovering |
752 | if ((state == STATE_AGENT_IDLE) || (state == STATE_AGENT_STAND)) | 818 | if ((state == STATE_AGENT_IDLE) || (state == STATE_AGENT_STAND)) |
753 | { | 819 | { |
754 | if (gSavedSettings.getBOOL("AOEnabled")) | 820 | if (gSavedSettings.getBOOL("AOEnabled")) |
@@ -771,98 +837,158 @@ void LLFloaterAO::run() | |||
771 | } | 837 | } |
772 | else | 838 | else |
773 | { | 839 | { |
774 | if (state == STATE_AGENT_SIT) gAgent.sendAnimationRequest(GetAnimIDFromState(state), (gSavedSettings.getBOOL("AOEnabled") && gSavedSettings.getBOOL("AOSitsEnabled")) ? ANIM_REQUEST_START : ANIM_REQUEST_STOP); | 840 | if (state == STATE_AGENT_SIT) |
775 | else gAgent.sendAnimationRequest(GetAnimIDFromState(state), gSavedSettings.getBOOL("AOEnabled") ? ANIM_REQUEST_START : ANIM_REQUEST_STOP); | 841 | { |
842 | gAgent.sendAnimationRequest(GetAnimIDFromState(state), (gSavedSettings.getBOOL("AOEnabled") && gSavedSettings.getBOOL("AOSitsEnabled")) ? ANIM_REQUEST_START : ANIM_REQUEST_STOP); | ||
843 | } | ||
844 | else | ||
845 | { | ||
846 | gAgent.sendAnimationRequest(GetAnimIDFromState(state), gSavedSettings.getBOOL("AOEnabled") ? ANIM_REQUEST_START : ANIM_REQUEST_STOP); | ||
847 | } | ||
776 | } | 848 | } |
777 | } | 849 | } |
778 | 850 | ||
779 | int LLFloaterAO::getAnimationState() | 851 | // static |
852 | S32 LLFloaterAO::getAnimationState() | ||
780 | { | 853 | { |
781 | if (gAgent.getAvatarObject()) | 854 | if (gAgent.getAvatarObject()) |
782 | { | 855 | { |
783 | if (gAgent.getAvatarObject()->mIsSitting) setAnimationState(STATE_AGENT_SIT); | 856 | if (gAgent.getAvatarObject()->mIsSitting) |
784 | else if (gAgent.getFlying()) setAnimationState(STATE_AGENT_HOVER); | 857 | { |
858 | setAnimationState(STATE_AGENT_SIT); | ||
859 | } | ||
860 | else if (gAgent.getFlying()) | ||
861 | { | ||
862 | setAnimationState(STATE_AGENT_HOVER); | ||
863 | } | ||
785 | } | 864 | } |
786 | return mAnimationState; | 865 | return sAnimationState; |
787 | } | 866 | } |
788 | 867 | ||
789 | void LLFloaterAO::setAnimationState(const int state) | 868 | // static |
869 | void LLFloaterAO::setAnimationState(const S32 state) | ||
790 | { | 870 | { |
791 | mAnimationState = state; | 871 | sAnimationState = state; |
792 | } | 872 | } |
793 | 873 | ||
874 | // static | ||
794 | LLUUID LLFloaterAO::getCurrentStandId() | 875 | LLUUID LLFloaterAO::getCurrentStandId() |
795 | { | 876 | { |
796 | return mCurrentStandId; | 877 | return sCurrentStandId; |
797 | } | 878 | } |
798 | 879 | ||
880 | // static | ||
799 | void LLFloaterAO::setCurrentStandId(const LLUUID& id) | 881 | void LLFloaterAO::setCurrentStandId(const LLUUID& id) |
800 | { | 882 | { |
801 | mCurrentStandId = id; | 883 | sCurrentStandId = id; |
802 | } | 884 | } |
803 | 885 | ||
886 | // static | ||
804 | void LLFloaterAO::AOItemDrop(LLViewerInventoryItem* item) | 887 | void LLFloaterAO::AOItemDrop(LLViewerInventoryItem* item) |
805 | { | 888 | { |
806 | gSavedPerAccountSettings.setString("AOConfigNotecardID", item->getUUID().asString()); | 889 | gSavedPerAccountSettings.setString("AOConfigNotecardID", item->getUUID().asString()); |
807 | sInstance->childSetValue("ao_nc_text","Currently set to: "+item->getName()); | 890 | sInstance->childSetValue("ao_nc_text","Currently set to: "+item->getName()); |
808 | } | 891 | } |
809 | 892 | ||
893 | // static | ||
810 | LLUUID LLFloaterAO::GetAnimID(const LLUUID& id) | 894 | LLUUID LLFloaterAO::GetAnimID(const LLUUID& id) |
811 | { | 895 | { |
812 | for (std::vector<struct_overrides>::iterator iter = mAOOverrides.begin(); iter != mAOOverrides.end(); ++iter) | 896 | for (std::vector<struct_overrides>::iterator iter = mAOOverrides.begin(); iter != mAOOverrides.end(); ++iter) |
813 | { | 897 | { |
814 | if (iter->orig_id == id) return iter->ao_id; | 898 | if (iter->orig_id == id) |
899 | { | ||
900 | return iter->ao_id; | ||
901 | } | ||
815 | } | 902 | } |
816 | return LLUUID::null; | 903 | return LLUUID::null; |
817 | } | 904 | } |
818 | 905 | ||
819 | int LLFloaterAO::GetStateFromAnimID(const LLUUID& id) | 906 | // static |
907 | S32 LLFloaterAO::GetStateFromAnimID(const LLUUID& id) | ||
820 | { | 908 | { |
821 | for (std::vector<struct_overrides>::iterator iter = mAOOverrides.begin(); iter != mAOOverrides.end(); ++iter) | 909 | for (std::vector<struct_overrides>::iterator iter = mAOOverrides.begin(); iter != mAOOverrides.end(); ++iter) |
822 | { | 910 | { |
823 | if (iter->orig_id == id) return iter->state; | 911 | if (iter->orig_id == id) |
912 | { | ||
913 | return iter->state; | ||
914 | } | ||
824 | } | 915 | } |
825 | return STATE_AGENT_IDLE; | 916 | return STATE_AGENT_IDLE; |
826 | } | 917 | } |
827 | 918 | ||
828 | LLUUID LLFloaterAO::GetAnimIDFromState(const int state) | 919 | // static |
920 | LLUUID LLFloaterAO::GetAnimIDFromState(const S32 state) | ||
829 | { | 921 | { |
830 | for (std::vector<struct_overrides>::iterator iter = mAOOverrides.begin(); iter != mAOOverrides.end(); ++iter) | 922 | for (std::vector<struct_overrides>::iterator iter = mAOOverrides.begin(); iter != mAOOverrides.end(); ++iter) |
831 | { | 923 | { |
832 | if (iter->state == state) return iter->ao_id; | 924 | if (iter->state == state) |
925 | { | ||
926 | return iter->ao_id; | ||
927 | } | ||
833 | } | 928 | } |
834 | return LLUUID::null; | 929 | return LLUUID::null; |
835 | } | 930 | } |
836 | 931 | ||
837 | int LLFloaterAO::GetStateFromToken(std::string strtoken) | 932 | // static |
933 | S32 LLFloaterAO::GetStateFromToken(std::string strtoken) | ||
838 | { | 934 | { |
839 | for (std::vector<struct_tokens>::iterator iter = mAOTokens.begin(); iter != mAOTokens.end(); ++iter) | 935 | for (std::vector<struct_tokens>::iterator iter = mAOTokens.begin(); iter != mAOTokens.end(); ++iter) |
840 | { | 936 | { |
841 | if (iter->token == strtoken) return iter->state; | 937 | if (iter->token == strtoken) |
938 | { | ||
939 | return iter->state; | ||
940 | } | ||
842 | } | 941 | } |
843 | return STATE_AGENT_IDLE; | 942 | return STATE_AGENT_IDLE; |
844 | } | 943 | } |
845 | 944 | ||
945 | // static | ||
846 | void LLFloaterAO::onClickPrevStand(void* user_data) | 946 | void LLFloaterAO::onClickPrevStand(void* user_data) |
847 | { | 947 | { |
848 | if (!(mAOStands.size() > 0)) return; | 948 | if (!(mAOStands.size() > 0)) |
849 | stand_iterator=stand_iterator-1; | 949 | { |
850 | if (stand_iterator < 0) stand_iterator = int( mAOStands.size()-stand_iterator); | 950 | return; |
851 | if (stand_iterator > int( mAOStands.size()-1)) stand_iterator = 0; | 951 | } |
952 | |||
953 | stand_iterator = stand_iterator-1; | ||
954 | |||
955 | if (stand_iterator < 0) | ||
956 | { | ||
957 | stand_iterator = S32( mAOStands.size()-stand_iterator); | ||
958 | } | ||
959 | if (stand_iterator > S32( mAOStands.size()-1)) | ||
960 | { | ||
961 | stand_iterator = 0; | ||
962 | } | ||
963 | |||
852 | cmdline_printchat(llformat("Changing stand to %s.",mAOStands[stand_iterator].anim_name.c_str())); | 964 | cmdline_printchat(llformat("Changing stand to %s.",mAOStands[stand_iterator].anim_name.c_str())); |
853 | ChangeStand(); | 965 | ChangeStand(); |
854 | } | 966 | } |
855 | 967 | ||
968 | // static | ||
856 | void LLFloaterAO::onClickNextStand(void* user_data) | 969 | void LLFloaterAO::onClickNextStand(void* user_data) |
857 | { | 970 | { |
858 | if (!(mAOStands.size() > 0)) return; | 971 | if (!(mAOStands.size() > 0)) |
859 | stand_iterator=stand_iterator+1; | 972 | { |
860 | if (stand_iterator < 0) stand_iterator = int( mAOStands.size()-stand_iterator); | 973 | return; |
861 | if (stand_iterator > int( mAOStands.size()-1)) stand_iterator = 0; | 974 | } |
975 | |||
976 | stand_iterator = stand_iterator+1; | ||
977 | |||
978 | if (stand_iterator < 0) | ||
979 | { | ||
980 | stand_iterator = S32( mAOStands.size()-stand_iterator); | ||
981 | } | ||
982 | if (stand_iterator > S32( mAOStands.size()-1)) | ||
983 | { | ||
984 | stand_iterator = 0; | ||
985 | } | ||
986 | |||
862 | cmdline_printchat(llformat("Changing stand to %s.",mAOStands[stand_iterator].anim_name.c_str())); | 987 | cmdline_printchat(llformat("Changing stand to %s.",mAOStands[stand_iterator].anim_name.c_str())); |
863 | ChangeStand(); | 988 | ChangeStand(); |
864 | } | 989 | } |
865 | 990 | ||
991 | // static | ||
866 | BOOL LLFloaterAO::ChangeStand() | 992 | BOOL LLFloaterAO::ChangeStand() |
867 | { | 993 | { |
868 | if (gSavedSettings.getBOOL("AOEnabled")) | 994 | if (gSavedSettings.getBOOL("AOEnabled")) |
@@ -881,17 +1007,32 @@ BOOL LLFloaterAO::ChangeStand() | |||
881 | } | 1007 | } |
882 | if ((getAnimationState() == STATE_AGENT_IDLE) || (getAnimationState() == STATE_AGENT_STAND))// stands have lowest priority | 1008 | if ((getAnimationState() == STATE_AGENT_IDLE) || (getAnimationState() == STATE_AGENT_STAND))// stands have lowest priority |
883 | { | 1009 | { |
884 | if (!(mAOStands.size() > 0)) return TRUE; | 1010 | if (!(mAOStands.size() > 0)) |
1011 | { | ||
1012 | return TRUE; | ||
1013 | } | ||
1014 | |||
885 | if (gSavedSettings.getBOOL("AOStandRandomize")) | 1015 | if (gSavedSettings.getBOOL("AOStandRandomize")) |
886 | { | 1016 | { |
887 | stand_iterator = ll_rand(mAOStands.size()-1); | 1017 | stand_iterator = ll_rand(mAOStands.size()-1); |
888 | } | 1018 | } |
889 | if (stand_iterator < 0) stand_iterator = int( mAOStands.size()-stand_iterator); | ||
890 | if (stand_iterator > int( mAOStands.size()-1)) stand_iterator = 0; | ||
891 | 1019 | ||
892 | int stand_iterator_previous = stand_iterator -1; | 1020 | if (stand_iterator < 0) |
1021 | { | ||
1022 | stand_iterator = S32( mAOStands.size()-stand_iterator); | ||
1023 | } | ||
1024 | |||
1025 | if (stand_iterator > S32( mAOStands.size()-1)) | ||
1026 | { | ||
1027 | stand_iterator = 0; | ||
1028 | } | ||
1029 | |||
1030 | S32 stand_iterator_previous = stand_iterator -1; | ||
893 | 1031 | ||
894 | if (stand_iterator_previous < 0) stand_iterator_previous = int( mAOStands.size()-1); | 1032 | if (stand_iterator_previous < 0) |
1033 | { | ||
1034 | stand_iterator_previous = S32( mAOStands.size()-1); | ||
1035 | } | ||
895 | 1036 | ||
896 | if (mAOStands[stand_iterator].ao_id.notNull()) | 1037 | if (mAOStands[stand_iterator].ao_id.notNull()) |
897 | { | 1038 | { |
@@ -900,7 +1041,10 @@ BOOL LLFloaterAO::ChangeStand() | |||
900 | 1041 | ||
901 | setAnimationState(STATE_AGENT_STAND); | 1042 | setAnimationState(STATE_AGENT_STAND); |
902 | setCurrentStandId(mAOStands[stand_iterator].ao_id); | 1043 | setCurrentStandId(mAOStands[stand_iterator].ao_id); |
903 | if ((sInstance)&&(mcomboBox_stands)) mcomboBox_stands->selectNthItem(stand_iterator); | 1044 | if (sInstance && mComboBox_stands) |
1045 | { | ||
1046 | mComboBox_stands->selectNthItem(stand_iterator); | ||
1047 | } | ||
904 | // llinfos << "changing stand to " << mAOStands[stand_iterator].anim_name << llendl; | 1048 | // llinfos << "changing stand to " << mAOStands[stand_iterator].anim_name << llendl; |
905 | return FALSE; | 1049 | return FALSE; |
906 | } | 1050 | } |
@@ -926,7 +1070,10 @@ BOOL LLFloaterAO::startMotion(const LLUUID& id, F32 time_offset, BOOL stand) | |||
926 | { | 1070 | { |
927 | sitting = gAgent.getAvatarObject()->mIsSitting; | 1071 | sitting = gAgent.getAvatarObject()->mIsSitting; |
928 | } | 1072 | } |
929 | if (sitting) return FALSE; | 1073 | if (sitting) |
1074 | { | ||
1075 | return FALSE; | ||
1076 | } | ||
930 | gAgent.sendAnimationRequest(id, ANIM_REQUEST_START); | 1077 | gAgent.sendAnimationRequest(id, ANIM_REQUEST_START); |
931 | return TRUE; | 1078 | return TRUE; |
932 | } | 1079 | } |
@@ -939,7 +1086,10 @@ BOOL LLFloaterAO::startMotion(const LLUUID& id, F32 time_offset, BOOL stand) | |||
939 | setAnimationState(GetStateFromAnimID(id)); | 1086 | setAnimationState(GetStateFromAnimID(id)); |
940 | 1087 | ||
941 | // llinfos << " state " << getAnimationState() << " start anim " << id << " overriding with " << GetAnimID(id) << llendl; | 1088 | // llinfos << " state " << getAnimationState() << " start anim " << id << " overriding with " << GetAnimID(id) << llendl; |
942 | if ((GetStateFromAnimID(id) == STATE_AGENT_SIT) && !(gSavedSettings.getBOOL("AOSitsEnabled"))) return TRUE; | 1089 | if ((GetStateFromAnimID(id) == STATE_AGENT_SIT) && !(gSavedSettings.getBOOL("AOSitsEnabled"))) |
1090 | { | ||
1091 | return TRUE; | ||
1092 | } | ||
943 | gAgent.sendAnimationRequest(GetAnimID(id), ANIM_REQUEST_START); | 1093 | gAgent.sendAnimationRequest(GetAnimID(id), ANIM_REQUEST_START); |
944 | return TRUE; | 1094 | return TRUE; |
945 | } | 1095 | } |
@@ -972,35 +1122,36 @@ BOOL LLFloaterAO::stopMotion(const LLUUID& id, BOOL stop_immediate, BOOL stand) | |||
972 | return FALSE; | 1122 | return FALSE; |
973 | } | 1123 | } |
974 | 1124 | ||
1125 | // static | ||
975 | void LLFloaterAO::onClickReloadCard(void* user_data) | 1126 | void LLFloaterAO::onClickReloadCard(void* user_data) |
976 | { | 1127 | { |
977 | if(gInventory.isEverythingFetched()) | 1128 | LLFloaterAO::init(); |
978 | { | ||
979 | LLFloaterAO::init(); | ||
980 | } | ||
981 | } | 1129 | } |
982 | 1130 | ||
1131 | // static | ||
983 | void LLFloaterAO::onClickOpenCard(void* user_data) | 1132 | void LLFloaterAO::onClickOpenCard(void* user_data) |
984 | { | 1133 | { |
985 | if(gInventory.isEverythingFetched()) | 1134 | LLUUID configncitem = (LLUUID)gSavedPerAccountSettings.getString("AOConfigNotecardID"); |
1135 | if (configncitem.notNull()) | ||
986 | { | 1136 | { |
987 | LLUUID configncitem = (LLUUID)gSavedPerAccountSettings.getString("AOConfigNotecardID"); | 1137 | const LLInventoryItem* item = gInventory.getItem(configncitem); |
988 | if (configncitem.notNull()) | 1138 | if (item) |
989 | { | 1139 | { |
990 | const LLInventoryItem* item = gInventory.getItem(configncitem); | 1140 | if (gAgent.allowOperation(PERM_COPY, item->getPermissions(),GP_OBJECT_MANIPULATE) || gAgent.isGodlike()) |
991 | if(item) | ||
992 | { | 1141 | { |
993 | if (gAgent.allowOperation(PERM_COPY, item->getPermissions(),GP_OBJECT_MANIPULATE) || gAgent.isGodlike()) | 1142 | if(!item->getAssetUUID().isNull()) |
994 | { | 1143 | open_notecard((LLViewerInventoryItem*)item, std::string("Note: ") + item->getName(), LLUUID::null, FALSE); |
995 | if(!item->getAssetUUID().isNull()) | 1144 | // open_notecard((LLViewerInventoryItem*)item, std::string("Note: ") + item->getName(), LLUUID::null, FALSE, LLUUID::null, FALSE); |
996 | open_notecard((LLViewerInventoryItem*)item, std::string("Note: ") + item->getName(), LLUUID::null, FALSE); | ||
997 | // open_notecard((LLViewerInventoryItem*)item, std::string("Note: ") + item->getName(), LLUUID::null, FALSE, LLUUID::null, FALSE); | ||
998 | } | ||
999 | } | 1145 | } |
1000 | } | 1146 | } |
1147 | else | ||
1148 | { | ||
1149 | cmdline_printchat("Could not find notecard UUID " + configncitem.asString() + " in your inventory. Make sure your inventory is fully loaded and try again."); | ||
1150 | } | ||
1001 | } | 1151 | } |
1002 | } | 1152 | } |
1003 | 1153 | ||
1154 | // static | ||
1004 | void LLFloaterAO::onClickNewCard(void* user_data) | 1155 | void LLFloaterAO::onClickNewCard(void* user_data) |
1005 | { | 1156 | { |
1006 | // load the template file from app_settings/ao_template.ini then | 1157 | // load the template file from app_settings/ao_template.ini then |
@@ -1026,15 +1177,16 @@ struct AOAssetInfo | |||
1026 | std::string name; | 1177 | std::string name; |
1027 | }; | 1178 | }; |
1028 | 1179 | ||
1180 | // static | ||
1029 | void LLFloaterAO::onNotecardLoadComplete(LLVFS *vfs,const LLUUID& asset_uuid,LLAssetType::EType type,void* user_data, S32 status, LLExtStat ext_status) | 1181 | void LLFloaterAO::onNotecardLoadComplete(LLVFS *vfs,const LLUUID& asset_uuid,LLAssetType::EType type,void* user_data, S32 status, LLExtStat ext_status) |
1030 | { | 1182 | { |
1031 | if(status == LL_ERR_NOERR) | 1183 | if (status == LL_ERR_NOERR) |
1032 | { | 1184 | { |
1033 | S32 size = vfs->getSize(asset_uuid, type); | 1185 | S32 size = vfs->getSize(asset_uuid, type); |
1034 | U8* buffer = new U8[size]; | 1186 | U8* buffer = new U8[size]; |
1035 | vfs->getData(asset_uuid, type, buffer, 0, size); | 1187 | vfs->getData(asset_uuid, type, buffer, 0, size); |
1036 | 1188 | ||
1037 | if(type == LLAssetType::AT_NOTECARD) | 1189 | if (type == LLAssetType::AT_NOTECARD) |
1038 | { | 1190 | { |
1039 | LLViewerTextEditor* edit = new LLViewerTextEditor("",LLRect(0,0,0,0),S32_MAX,""); | 1191 | LLViewerTextEditor* edit = new LLViewerTextEditor("",LLRect(0,0,0,0),S32_MAX,""); |
1040 | if(edit->importBuffer((char*)buffer, (S32)size)) | 1192 | if(edit->importBuffer((char*)buffer, (S32)size)) |
@@ -1043,27 +1195,43 @@ void LLFloaterAO::onNotecardLoadComplete(LLVFS *vfs,const LLUUID& asset_uuid,LLA | |||
1043 | std::string card = edit->getText(); | 1195 | std::string card = edit->getText(); |
1044 | edit->die(); | 1196 | edit->die(); |
1045 | 1197 | ||
1046 | if (mcomboBox_stands) | 1198 | if (sInstance && mComboBox_stands) |
1047 | { | 1199 | { |
1048 | mcomboBox_stands->clear(); | 1200 | mComboBox_stands->clear(); |
1049 | mcomboBox_stands->removeall(); | 1201 | mComboBox_stands->removeall(); |
1050 | } | 1202 | } |
1051 | if (mcomboBox_walks) mcomboBox_walks->clear(); | 1203 | if (sInstance && mComboBox_walks) |
1052 | if (mcomboBox_runs) mcomboBox_runs->clear(); | 1204 | mComboBox_walks->clear(); |
1053 | if (mcomboBox_jumps) mcomboBox_jumps->clear(); | 1205 | if (sInstance && mComboBox_runs) |
1054 | if (mcomboBox_sits) mcomboBox_sits->clear(); | 1206 | mComboBox_runs->clear(); |
1055 | if (mcomboBox_gsits) mcomboBox_gsits->clear(); | 1207 | if (sInstance && mComboBox_jumps) |
1056 | if (mcomboBox_crouchs) mcomboBox_cwalks->clear(); | 1208 | mComboBox_jumps->clear(); |
1057 | if (mcomboBox_cwalks) mcomboBox_cwalks->clear(); | 1209 | if (sInstance && mComboBox_sits) |
1058 | if (mcomboBox_falls) mcomboBox_falls->clear(); | 1210 | mComboBox_sits->clear(); |
1059 | if (mcomboBox_hovers) mcomboBox_hovers->clear(); | 1211 | if (sInstance && mComboBox_gsits) |
1060 | if (mcomboBox_flys) mcomboBox_flys->clear(); | 1212 | mComboBox_gsits->clear(); |
1061 | if (mcomboBox_flyslows) mcomboBox_flyslows->clear(); | 1213 | if (sInstance && mComboBox_crouchs) |
1062 | if (mcomboBox_flyups) mcomboBox_flyups->clear(); | 1214 | mComboBox_cwalks->clear(); |
1063 | if (mcomboBox_flydowns) mcomboBox_flydowns->clear(); | 1215 | if (sInstance && mComboBox_cwalks) |
1064 | if (mcomboBox_lands) mcomboBox_lands->clear(); | 1216 | mComboBox_cwalks->clear(); |
1065 | if (mcomboBox_standups) mcomboBox_standups->clear(); | 1217 | if (sInstance && mComboBox_falls) |
1066 | if (mcomboBox_prejumps) mcomboBox_prejumps->clear(); | 1218 | mComboBox_falls->clear(); |
1219 | if (sInstance && mComboBox_hovers) | ||
1220 | mComboBox_hovers->clear(); | ||
1221 | if (sInstance && mComboBox_flys) | ||
1222 | mComboBox_flys->clear(); | ||
1223 | if (sInstance && mComboBox_flyslows) | ||
1224 | mComboBox_flyslows->clear(); | ||
1225 | if (sInstance && mComboBox_flyups) | ||
1226 | mComboBox_flyups->clear(); | ||
1227 | if (sInstance && mComboBox_flydowns) | ||
1228 | mComboBox_flydowns->clear(); | ||
1229 | if (sInstance && mComboBox_lands) | ||
1230 | mComboBox_lands->clear(); | ||
1231 | if (sInstance && mComboBox_standups) | ||
1232 | mComboBox_standups->clear(); | ||
1233 | if (sInstance && mComboBox_prejumps) | ||
1234 | mComboBox_prejumps->clear(); | ||
1067 | 1235 | ||
1068 | 1236 | ||
1069 | struct_stands loader; | 1237 | struct_stands loader; |
@@ -1106,134 +1274,185 @@ void LLFloaterAO::onNotecardLoadComplete(LLVFS *vfs,const LLUUID& asset_uuid,LLA | |||
1106 | { | 1274 | { |
1107 | case STATE_AGENT_STAND: | 1275 | case STATE_AGENT_STAND: |
1108 | loader.ao_id = animid; loader.anim_name = stranim.c_str(); mAOStands.push_back(loader); | 1276 | loader.ao_id = animid; loader.anim_name = stranim.c_str(); mAOStands.push_back(loader); |
1109 | if(mcomboBox_stands != NULL) mcomboBox_stands->add(stranim.c_str(), ADD_BOTTOM, TRUE); | 1277 | if (sInstance && mComboBox_stands != NULL) |
1278 | { | ||
1279 | mComboBox_stands->add(stranim.c_str(), ADD_BOTTOM, TRUE); | ||
1280 | } | ||
1110 | break; | 1281 | break; |
1111 | case STATE_AGENT_WALK: | 1282 | case STATE_AGENT_WALK: |
1112 | { | 1283 | { |
1113 | if (sInstance && (mcomboBox_walks != NULL)) | 1284 | if (sInstance && mComboBox_walks != NULL) |
1114 | { | 1285 | { |
1115 | //llinfos << "1 anim: " << stranim.c_str() << " assetid: " << animid << llendl; | 1286 | //llinfos << "1 anim: " << stranim.c_str() << " assetid: " << animid << llendl; |
1116 | if (!(mcomboBox_walks->selectByValue(stranim.c_str()))) mcomboBox_walks->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1287 | if (!(mComboBox_walks->selectByValue(stranim.c_str()))) |
1288 | { | ||
1289 | mComboBox_walks->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1290 | } | ||
1117 | } | 1291 | } |
1118 | } | 1292 | } |
1119 | break; | 1293 | break; |
1120 | case STATE_AGENT_RUN: | 1294 | case STATE_AGENT_RUN: |
1121 | { | 1295 | { |
1122 | if (sInstance && (mcomboBox_runs != NULL)) | 1296 | if (sInstance && mComboBox_runs != NULL) |
1123 | { | 1297 | { |
1124 | if (!(mcomboBox_runs->selectByValue(stranim.c_str()))) mcomboBox_runs->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1298 | if (!(mComboBox_runs->selectByValue(stranim.c_str()))) |
1299 | { | ||
1300 | mComboBox_runs->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1301 | } | ||
1125 | } | 1302 | } |
1126 | } | 1303 | } |
1127 | break; | 1304 | break; |
1128 | case STATE_AGENT_JUMP: | 1305 | case STATE_AGENT_JUMP: |
1129 | { | 1306 | { |
1130 | if (sInstance && (mcomboBox_jumps != NULL)) | 1307 | if (sInstance && mComboBox_jumps != NULL) |
1131 | { | 1308 | { |
1132 | if (!(mcomboBox_jumps->selectByValue(stranim.c_str()))) mcomboBox_jumps->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1309 | if (!(mComboBox_jumps->selectByValue(stranim.c_str()))) |
1310 | { | ||
1311 | mComboBox_jumps->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1312 | } | ||
1133 | } | 1313 | } |
1134 | } | 1314 | } |
1135 | break; | 1315 | break; |
1136 | case STATE_AGENT_SIT: | 1316 | case STATE_AGENT_SIT: |
1137 | { | 1317 | { |
1138 | if (sInstance && (mcomboBox_sits != NULL)) | 1318 | if (sInstance && mComboBox_sits != NULL) |
1139 | { | 1319 | { |
1140 | if (!(mcomboBox_sits->selectByValue(stranim.c_str()))) mcomboBox_sits->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1320 | if (!(mComboBox_sits->selectByValue(stranim.c_str()))) |
1321 | { | ||
1322 | mComboBox_sits->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1323 | } | ||
1141 | } | 1324 | } |
1142 | } | 1325 | } |
1143 | break; | 1326 | break; |
1144 | case STATE_AGENT_GROUNDSIT: | 1327 | case STATE_AGENT_GROUNDSIT: |
1145 | { | 1328 | { |
1146 | if (sInstance && (mcomboBox_gsits != NULL)) | 1329 | if (sInstance && mComboBox_gsits != NULL) |
1147 | { | 1330 | { |
1148 | if (!(mcomboBox_gsits->selectByValue(stranim.c_str()))) mcomboBox_gsits->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1331 | if (!(mComboBox_gsits->selectByValue(stranim.c_str()))) |
1332 | { | ||
1333 | mComboBox_gsits->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1334 | } | ||
1149 | } | 1335 | } |
1150 | } | 1336 | } |
1151 | break; | 1337 | break; |
1152 | case STATE_AGENT_CROUCH: | 1338 | case STATE_AGENT_CROUCH: |
1153 | { | 1339 | { |
1154 | if (sInstance && (mcomboBox_crouchs != NULL)) | 1340 | if (sInstance && mComboBox_crouchs != NULL) |
1155 | { | 1341 | { |
1156 | if (!(mcomboBox_crouchs->selectByValue(stranim.c_str()))) mcomboBox_crouchs->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1342 | if (!(mComboBox_crouchs->selectByValue(stranim.c_str()))) |
1343 | { | ||
1344 | mComboBox_crouchs->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1345 | } | ||
1157 | } | 1346 | } |
1158 | } | 1347 | } |
1159 | break; | 1348 | break; |
1160 | case STATE_AGENT_CROUCHWALK: | 1349 | case STATE_AGENT_CROUCHWALK: |
1161 | { | 1350 | { |
1162 | if (sInstance && (mcomboBox_cwalks != NULL)) | 1351 | if (sInstance && mComboBox_cwalks != NULL) |
1163 | { | 1352 | { |
1164 | if (!(mcomboBox_cwalks->selectByValue(stranim.c_str()))) mcomboBox_cwalks->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1353 | if (!(mComboBox_cwalks->selectByValue(stranim.c_str()))) |
1354 | { | ||
1355 | mComboBox_cwalks->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1356 | } | ||
1165 | } | 1357 | } |
1166 | } | 1358 | } |
1167 | break; | 1359 | break; |
1168 | case STATE_AGENT_FALLDOWN: | 1360 | case STATE_AGENT_FALLDOWN: |
1169 | { | 1361 | { |
1170 | if (sInstance && (mcomboBox_falls != NULL)) | 1362 | if (sInstance && mComboBox_falls != NULL) |
1171 | { | 1363 | { |
1172 | if (!(mcomboBox_falls->selectByValue(stranim.c_str()))) mcomboBox_falls->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1364 | if (!(mComboBox_falls->selectByValue(stranim.c_str()))) |
1365 | { | ||
1366 | mComboBox_falls->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1367 | } | ||
1173 | } | 1368 | } |
1174 | } | 1369 | } |
1175 | break; | 1370 | break; |
1176 | case STATE_AGENT_HOVER: | 1371 | case STATE_AGENT_HOVER: |
1177 | { | 1372 | { |
1178 | if (sInstance && (mcomboBox_hovers != NULL)) | 1373 | if (sInstance && mComboBox_hovers != NULL) |
1179 | { | 1374 | { |
1180 | if (!(mcomboBox_hovers->selectByValue(stranim.c_str()))) mcomboBox_hovers->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1375 | if (!(mComboBox_hovers->selectByValue(stranim.c_str()))) |
1376 | { | ||
1377 | mComboBox_hovers->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1378 | } | ||
1181 | } | 1379 | } |
1182 | } | 1380 | } |
1183 | break; | 1381 | break; |
1184 | case STATE_AGENT_FLY: | 1382 | case STATE_AGENT_FLY: |
1185 | { | 1383 | { |
1186 | if (sInstance && (mcomboBox_flys != NULL)) | 1384 | if (sInstance && mComboBox_flys != NULL) |
1187 | { | 1385 | { |
1188 | if (!(mcomboBox_flys->selectByValue(stranim.c_str()))) mcomboBox_flys->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1386 | if (!(mComboBox_flys->selectByValue(stranim.c_str()))) |
1387 | { | ||
1388 | mComboBox_flys->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1389 | } | ||
1189 | } | 1390 | } |
1190 | } | 1391 | } |
1191 | break; | 1392 | break; |
1192 | case STATE_AGENT_FLYSLOW: | 1393 | case STATE_AGENT_FLYSLOW: |
1193 | { | 1394 | { |
1194 | if (sInstance && (mcomboBox_flyslows != NULL)) | 1395 | if (sInstance && mComboBox_flyslows != NULL) |
1195 | { | 1396 | { |
1196 | if (!(mcomboBox_flyslows->selectByValue(stranim.c_str()))) mcomboBox_flyslows->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1397 | if (!(mComboBox_flyslows->selectByValue(stranim.c_str()))) |
1398 | { | ||
1399 | mComboBox_flyslows->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1400 | } | ||
1197 | } | 1401 | } |
1198 | } | 1402 | } |
1199 | break; | 1403 | break; |
1200 | case STATE_AGENT_HOVER_UP: | 1404 | case STATE_AGENT_HOVER_UP: |
1201 | { | 1405 | { |
1202 | if (sInstance && (mcomboBox_flyups != NULL)) | 1406 | if (sInstance && mComboBox_flyups != NULL) |
1203 | { | 1407 | { |
1204 | if (!(mcomboBox_flyups->selectByValue(stranim.c_str()))) mcomboBox_flyups->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1408 | if (!(mComboBox_flyups->selectByValue(stranim.c_str()))) |
1409 | { | ||
1410 | mComboBox_flyups->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1411 | } | ||
1205 | } | 1412 | } |
1206 | } | 1413 | } |
1207 | break; | 1414 | break; |
1208 | case STATE_AGENT_HOVER_DOWN: | 1415 | case STATE_AGENT_HOVER_DOWN: |
1209 | { | 1416 | { |
1210 | if (sInstance && (mcomboBox_flydowns != NULL)) | 1417 | if (sInstance && mComboBox_flydowns != NULL) |
1211 | { | 1418 | { |
1212 | if (!(mcomboBox_flydowns->selectByValue(stranim.c_str()))) mcomboBox_flydowns->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1419 | if (!(mComboBox_flydowns->selectByValue(stranim.c_str()))) |
1420 | { | ||
1421 | mComboBox_flydowns->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1422 | } | ||
1213 | } | 1423 | } |
1214 | } | 1424 | } |
1215 | break; | 1425 | break; |
1216 | case STATE_AGENT_LAND: | 1426 | case STATE_AGENT_LAND: |
1217 | { | 1427 | { |
1218 | if (sInstance && (mcomboBox_lands != NULL)) | 1428 | if (sInstance && mComboBox_lands != NULL) |
1219 | { | 1429 | { |
1220 | if (!(mcomboBox_lands->selectByValue(stranim.c_str()))) mcomboBox_lands->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1430 | if (!(mComboBox_lands->selectByValue(stranim.c_str()))) |
1431 | { | ||
1432 | mComboBox_lands->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1433 | } | ||
1221 | } | 1434 | } |
1222 | } | 1435 | } |
1223 | break; | 1436 | break; |
1224 | case STATE_AGENT_STANDUP: | 1437 | case STATE_AGENT_STANDUP: |
1225 | { | 1438 | { |
1226 | if (sInstance && (mcomboBox_standups != NULL)) | 1439 | if (sInstance && mComboBox_standups != NULL) |
1227 | { | 1440 | { |
1228 | if (!(mcomboBox_standups->selectByValue(stranim.c_str()))) mcomboBox_standups->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1441 | if (!(mComboBox_standups->selectByValue(stranim.c_str()))) |
1442 | { | ||
1443 | mComboBox_standups->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1444 | } | ||
1229 | } | 1445 | } |
1230 | } | 1446 | } |
1231 | break; | 1447 | break; |
1232 | case STATE_AGENT_PRE_JUMP: | 1448 | case STATE_AGENT_PRE_JUMP: |
1233 | { | 1449 | { |
1234 | if (sInstance && (mcomboBox_prejumps != NULL)) | 1450 | if (sInstance && mComboBox_prejumps != NULL) |
1235 | { | 1451 | { |
1236 | if (!(mcomboBox_prejumps->selectByValue(stranim.c_str()))) mcomboBox_prejumps->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | 1452 | if (!(mComboBox_prejumps->selectByValue(stranim.c_str()))) |
1453 | { | ||
1454 | mComboBox_prejumps->add(stranim.c_str(), ADD_BOTTOM, TRUE); //check if exist | ||
1455 | } | ||
1237 | } | 1456 | } |
1238 | } | 1457 | } |
1239 | break; | 1458 | break; |
@@ -1259,113 +1478,161 @@ void LLFloaterAO::onNotecardLoadComplete(LLVFS *vfs,const LLUUID& asset_uuid,LLA | |||
1259 | case STATE_AGENT_WALK: | 1478 | case STATE_AGENT_WALK: |
1260 | { | 1479 | { |
1261 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultWalk"); | 1480 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultWalk"); |
1262 | SetDefault(mcomboBox_walks,iter->ao_id,defaultanim); | 1481 | setDefault(mComboBox_walks, iter->ao_id,defaultanim); |
1263 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1482 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1483 | { | ||
1484 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1485 | } | ||
1264 | } | 1486 | } |
1265 | break; | 1487 | break; |
1266 | case STATE_AGENT_RUN: | 1488 | case STATE_AGENT_RUN: |
1267 | { | 1489 | { |
1268 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultRun"); | 1490 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultRun"); |
1269 | SetDefault(mcomboBox_runs,iter->ao_id,defaultanim); | 1491 | setDefault(mComboBox_runs, iter->ao_id,defaultanim); |
1270 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1492 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1493 | { | ||
1494 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1495 | } | ||
1271 | } | 1496 | } |
1272 | break; | 1497 | break; |
1273 | case STATE_AGENT_JUMP: | 1498 | case STATE_AGENT_JUMP: |
1274 | { | 1499 | { |
1275 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultJump"); | 1500 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultJump"); |
1276 | SetDefault(mcomboBox_jumps,iter->ao_id,defaultanim); | 1501 | setDefault(mComboBox_jumps, iter->ao_id,defaultanim); |
1277 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1502 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1503 | { | ||
1504 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1505 | } | ||
1278 | } | 1506 | } |
1279 | break; | 1507 | break; |
1280 | case STATE_AGENT_SIT: | 1508 | case STATE_AGENT_SIT: |
1281 | { | 1509 | { |
1282 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultSit"); | 1510 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultSit"); |
1283 | SetDefault(mcomboBox_sits,iter->ao_id,defaultanim); | 1511 | setDefault(mComboBox_sits, iter->ao_id,defaultanim); |
1284 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1512 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1513 | { | ||
1514 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1515 | } | ||
1285 | } | 1516 | } |
1286 | break; | 1517 | break; |
1287 | case STATE_AGENT_CROUCH: | 1518 | case STATE_AGENT_CROUCH: |
1288 | { | 1519 | { |
1289 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultCrouch"); | 1520 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultCrouch"); |
1290 | SetDefault(mcomboBox_crouchs,iter->ao_id,defaultanim); | 1521 | setDefault(mComboBox_crouchs,iter->ao_id,defaultanim); |
1291 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1522 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1523 | { | ||
1524 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1525 | } | ||
1292 | } | 1526 | } |
1293 | break; | 1527 | break; |
1294 | case STATE_AGENT_GROUNDSIT: | 1528 | case STATE_AGENT_GROUNDSIT: |
1295 | { | 1529 | { |
1296 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultGroundSit"); | 1530 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultGroundSit"); |
1297 | SetDefault(mcomboBox_gsits,iter->ao_id,defaultanim); | 1531 | setDefault(mComboBox_gsits,iter->ao_id,defaultanim); |
1298 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1532 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1533 | { | ||
1534 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1535 | } | ||
1299 | } | 1536 | } |
1300 | break; | 1537 | break; |
1301 | case STATE_AGENT_CROUCHWALK: | 1538 | case STATE_AGENT_CROUCHWALK: |
1302 | { | 1539 | { |
1303 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultCrouchWalk"); | 1540 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultCrouchWalk"); |
1304 | SetDefault(mcomboBox_cwalks,iter->ao_id,defaultanim); | 1541 | setDefault(mComboBox_cwalks,iter->ao_id,defaultanim); |
1305 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1542 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1543 | { | ||
1544 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1545 | } | ||
1306 | } | 1546 | } |
1307 | break; | 1547 | break; |
1308 | case STATE_AGENT_FALLDOWN: | 1548 | case STATE_AGENT_FALLDOWN: |
1309 | { | 1549 | { |
1310 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultFall"); | 1550 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultFall"); |
1311 | SetDefault(mcomboBox_falls,iter->ao_id,defaultanim); | 1551 | setDefault(mComboBox_falls,iter->ao_id,defaultanim); |
1312 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1552 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1553 | { | ||
1554 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1555 | } | ||
1313 | } | 1556 | } |
1314 | break; | 1557 | break; |
1315 | case STATE_AGENT_HOVER: | 1558 | case STATE_AGENT_HOVER: |
1316 | { | 1559 | { |
1317 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultHover"); | 1560 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultHover"); |
1318 | SetDefault(mcomboBox_hovers,iter->ao_id,defaultanim); | 1561 | setDefault(mComboBox_hovers,iter->ao_id,defaultanim); |
1319 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1562 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1563 | { | ||
1564 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1565 | } | ||
1320 | } | 1566 | } |
1321 | break; | 1567 | break; |
1322 | case STATE_AGENT_FLY: | 1568 | case STATE_AGENT_FLY: |
1323 | { | 1569 | { |
1324 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultFly"); | 1570 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultFly"); |
1325 | SetDefault(mcomboBox_flys,iter->ao_id,defaultanim); | 1571 | setDefault(mComboBox_flys,iter->ao_id,defaultanim); |
1326 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1572 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1573 | { | ||
1574 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1575 | } | ||
1327 | } | 1576 | } |
1328 | break; | 1577 | break; |
1329 | case STATE_AGENT_HOVER_UP: | 1578 | case STATE_AGENT_HOVER_UP: |
1330 | { | 1579 | { |
1331 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultFlyUp"); | 1580 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultFlyUp"); |
1332 | SetDefault(mcomboBox_flyups,iter->ao_id,defaultanim); | 1581 | setDefault(mComboBox_flyups,iter->ao_id,defaultanim); |
1333 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1582 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1583 | { | ||
1584 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1585 | } | ||
1334 | } | 1586 | } |
1335 | break; | 1587 | break; |
1336 | case STATE_AGENT_FLYSLOW: | 1588 | case STATE_AGENT_FLYSLOW: |
1337 | { | 1589 | { |
1338 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultFlySlow"); | 1590 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultFlySlow"); |
1339 | SetDefault(mcomboBox_flyslows,iter->ao_id,defaultanim); | 1591 | setDefault(mComboBox_flyslows,iter->ao_id,defaultanim); |
1340 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1592 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1593 | { | ||
1594 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1595 | } | ||
1341 | } | 1596 | } |
1342 | break; | 1597 | break; |
1343 | case STATE_AGENT_HOVER_DOWN: | 1598 | case STATE_AGENT_HOVER_DOWN: |
1344 | { | 1599 | { |
1345 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultFlyDown"); | 1600 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultFlyDown"); |
1346 | SetDefault(mcomboBox_flydowns,iter->ao_id,defaultanim); | 1601 | setDefault(mComboBox_flydowns,iter->ao_id,defaultanim); |
1347 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1602 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1603 | { | ||
1604 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1605 | } | ||
1348 | } | 1606 | } |
1349 | break; | 1607 | break; |
1350 | case STATE_AGENT_LAND: | 1608 | case STATE_AGENT_LAND: |
1351 | { | 1609 | { |
1352 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultLand"); | 1610 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultLand"); |
1353 | SetDefault(mcomboBox_lands,iter->ao_id,defaultanim); | 1611 | setDefault(mComboBox_lands,iter->ao_id,defaultanim); |
1354 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1612 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1613 | { | ||
1614 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1615 | } | ||
1355 | } | 1616 | } |
1356 | break; | 1617 | break; |
1357 | case STATE_AGENT_STANDUP: | 1618 | case STATE_AGENT_STANDUP: |
1358 | { | 1619 | { |
1359 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultStandUp"); | 1620 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultStandUp"); |
1360 | SetDefault(mcomboBox_standups,iter->ao_id,defaultanim); | 1621 | setDefault(mComboBox_standups,iter->ao_id,defaultanim); |
1361 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1622 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1623 | { | ||
1624 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1625 | } | ||
1362 | } | 1626 | } |
1363 | break; | 1627 | break; |
1364 | case STATE_AGENT_PRE_JUMP: | 1628 | case STATE_AGENT_PRE_JUMP: |
1365 | { | 1629 | { |
1366 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultPreJump"); | 1630 | std::string defaultanim = gSavedPerAccountSettings.getString("AODefaultPreJump"); |
1367 | SetDefault(mcomboBox_prejumps,iter->ao_id,defaultanim); | 1631 | setDefault(mComboBox_prejumps,iter->ao_id,defaultanim); |
1368 | if (getAssetIDByName(defaultanim) != LLUUID::null) iter->ao_id = getAssetIDByName(defaultanim); | 1632 | if (getAssetIDByName(defaultanim) != LLUUID::null) |
1633 | { | ||
1634 | iter->ao_id = getAssetIDByName(defaultanim); | ||
1635 | } | ||
1369 | } | 1636 | } |
1370 | break; | 1637 | break; |
1371 | } | 1638 | } |
@@ -1384,7 +1651,8 @@ void LLFloaterAO::onNotecardLoadComplete(LLVFS *vfs,const LLUUID& asset_uuid,LLA | |||
1384 | } | 1651 | } |
1385 | } | 1652 | } |
1386 | 1653 | ||
1387 | BOOL LLFloaterAO::SetDefault(void* userdata, LLUUID ao_id, std::string defaultanim) | 1654 | // static |
1655 | bool LLFloaterAO::setDefault(void* userdata, LLUUID ao_id, std::string defaultanim) | ||
1388 | { | 1656 | { |
1389 | if (sInstance && (userdata)) | 1657 | if (sInstance && (userdata)) |
1390 | { | 1658 | { |
@@ -1427,14 +1695,18 @@ private: | |||
1427 | std::string sName; | 1695 | std::string sName; |
1428 | }; | 1696 | }; |
1429 | 1697 | ||
1698 | // static | ||
1430 | const LLUUID& LLFloaterAO::getAssetIDByName(const std::string& name) | 1699 | const LLUUID& LLFloaterAO::getAssetIDByName(const std::string& name) |
1431 | { | 1700 | { |
1432 | if (name.empty() || !(gInventory.isEverythingFetched())) return LLUUID::null; | 1701 | if (name.empty()) |
1702 | { | ||
1703 | return LLUUID::null; | ||
1704 | } | ||
1433 | 1705 | ||
1434 | LLViewerInventoryCategory::cat_array_t cats; | 1706 | LLViewerInventoryCategory::cat_array_t cats; |
1435 | LLViewerInventoryItem::item_array_t items; | 1707 | LLViewerInventoryItem::item_array_t items; |
1436 | ObjectNameMatches objectnamematches(name); | 1708 | ObjectNameMatches objectnamematches(name); |
1437 | gInventory.collectDescendentsIf(LLUUID::null,cats,items,FALSE,objectnamematches); | 1709 | gInventory.collectDescendentsIf(LLUUID::null, cats, items, FALSE, objectnamematches); |
1438 | 1710 | ||
1439 | if (items.count()) | 1711 | if (items.count()) |
1440 | { | 1712 | { |
diff --git a/linden/indra/newview/floaterao.h b/linden/indra/newview/floaterao.h index 465f32e..45fd7af 100644 --- a/linden/indra/newview/floaterao.h +++ b/linden/indra/newview/floaterao.h | |||
@@ -9,35 +9,35 @@ | |||
9 | 9 | ||
10 | class AONoteCardDropTarget; | 10 | class AONoteCardDropTarget; |
11 | 11 | ||
12 | const int STATE_AGENT_IDLE = 0; | 12 | const S32 STATE_AGENT_IDLE = 0; |
13 | const int STATE_AGENT_WALK = 1; | 13 | const S32 STATE_AGENT_WALK = 1; |
14 | const int STATE_AGENT_RUN = 2; | 14 | const S32 STATE_AGENT_RUN = 2; |
15 | const int STATE_AGENT_STAND = 3; | 15 | const S32 STATE_AGENT_STAND = 3; |
16 | 16 | ||
17 | const int STATE_AGENT_PRE_JUMP = 4; | 17 | const S32 STATE_AGENT_PRE_JUMP = 4; |
18 | const int STATE_AGENT_JUMP = 5; | 18 | const S32 STATE_AGENT_JUMP = 5; |
19 | const int STATE_AGENT_TURNLEFT = 6; | 19 | const S32 STATE_AGENT_TURNLEFT = 6; |
20 | const int STATE_AGENT_TURNRIGHT = 7; | 20 | const S32 STATE_AGENT_TURNRIGHT = 7; |
21 | 21 | ||
22 | const int STATE_AGENT_SIT = 8; | 22 | const S32 STATE_AGENT_SIT = 8; |
23 | const int STATE_AGENT_GROUNDSIT = 9; | 23 | const S32 STATE_AGENT_GROUNDSIT = 9; |
24 | 24 | ||
25 | const int STATE_AGENT_HOVER = 10; | 25 | const S32 STATE_AGENT_HOVER = 10; |
26 | const int STATE_AGENT_HOVER_DOWN = 11; | 26 | const S32 STATE_AGENT_HOVER_DOWN = 11; |
27 | const int STATE_AGENT_HOVER_UP = 12; | 27 | const S32 STATE_AGENT_HOVER_UP = 12; |
28 | |||
29 | const int STATE_AGENT_CROUCH = 13; | ||
30 | const int STATE_AGENT_CROUCHWALK = 14; | ||
31 | const int STATE_AGENT_FALLDOWN = 15; | ||
32 | const int STATE_AGENT_STANDUP = 16; | ||
33 | const int STATE_AGENT_LAND = 17; | ||
34 | |||
35 | const int STATE_AGENT_FLY = 18; | ||
36 | const int STATE_AGENT_FLYSLOW = 19; | ||
37 | 28 | ||
29 | const S32 STATE_AGENT_CROUCH = 13; | ||
30 | const S32 STATE_AGENT_CROUCHWALK = 14; | ||
31 | const S32 STATE_AGENT_FALLDOWN = 15; | ||
32 | const S32 STATE_AGENT_STANDUP = 16; | ||
33 | const S32 STATE_AGENT_LAND = 17; | ||
38 | 34 | ||
35 | const S32 STATE_AGENT_FLY = 18; | ||
36 | const S32 STATE_AGENT_FLYSLOW = 19; | ||
39 | 37 | ||
40 | 38 | ||
39 | class LLFrameTimer; | ||
40 | class LLComboBox; | ||
41 | 41 | ||
42 | class AOStandTimer : public LLEventTimer | 42 | class AOStandTimer : public LLEventTimer |
43 | { | 43 | { |
@@ -51,10 +51,12 @@ public: | |||
51 | class AOInvTimer : public LLEventTimer | 51 | class AOInvTimer : public LLEventTimer |
52 | { | 52 | { |
53 | public: | 53 | public: |
54 | static BOOL fullfetch; | ||
55 | AOInvTimer(); | 54 | AOInvTimer(); |
56 | ~AOInvTimer(); | 55 | ~AOInvTimer(); |
57 | BOOL tick(); | 56 | BOOL tick(); |
57 | |||
58 | private: | ||
59 | static BOOL sInitialized; | ||
58 | }; | 60 | }; |
59 | 61 | ||
60 | class LLFloaterAO : public LLFloater | 62 | class LLFloaterAO : public LLFloater |
@@ -66,7 +68,7 @@ public: | |||
66 | virtual ~LLFloaterAO(); | 68 | virtual ~LLFloaterAO(); |
67 | 69 | ||
68 | static void show(void*); | 70 | static void show(void*); |
69 | static void init(); | 71 | static bool init(); |
70 | 72 | ||
71 | static void onClickToggleAO(LLUICtrl *, void*); | 73 | static void onClickToggleAO(LLUICtrl *, void*); |
72 | static void onClickToggleSits(LLUICtrl *, void*); | 74 | static void onClickToggleSits(LLUICtrl *, void*); |
@@ -75,13 +77,13 @@ public: | |||
75 | 77 | ||
76 | static BOOL loadAnims(); | 78 | static BOOL loadAnims(); |
77 | 79 | ||
78 | static int getAnimationState(); | 80 | static S32 getAnimationState(); |
79 | static void setAnimationState(int state); | 81 | static void setAnimationState(S32 state); |
80 | static void setStates(const LLUUID& id, BOOL start); | 82 | static void setStates(const LLUUID& id, BOOL start); |
81 | 83 | ||
82 | static LLUUID getCurrentStandId(); | 84 | static LLUUID getCurrentStandId(); |
83 | static void setCurrentStandId(const LLUUID& id); | 85 | static void setCurrentStandId(const LLUUID& id); |
84 | static int stand_iterator; | 86 | static S32 stand_iterator; |
85 | static BOOL ChangeStand(); | 87 | static BOOL ChangeStand(); |
86 | 88 | ||
87 | static BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f, BOOL stand = FALSE); | 89 | static BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f, BOOL stand = FALSE); |
@@ -89,9 +91,9 @@ public: | |||
89 | 91 | ||
90 | static LLUUID GetAnimID(const LLUUID& id); | 92 | static LLUUID GetAnimID(const LLUUID& id); |
91 | 93 | ||
92 | static int GetStateFromAnimID(const LLUUID& id); | 94 | static S32 GetStateFromAnimID(const LLUUID& id); |
93 | static LLUUID GetAnimIDFromState(const int state); | 95 | static LLUUID GetAnimIDFromState(const S32 state); |
94 | static int GetStateFromToken(std::string strtoken); | 96 | static S32 GetStateFromToken(std::string strtoken); |
95 | 97 | ||
96 | static void onClickLess(void* data) ; | 98 | static void onClickLess(void* data) ; |
97 | static void onClickMore(void* data) ; | 99 | static void onClickMore(void* data) ; |
@@ -105,19 +107,20 @@ public: | |||
105 | static LLUUID invfolderid; | 107 | static LLUUID invfolderid; |
106 | static const LLUUID& getAssetIDByName(const std::string& name); | 108 | static const LLUUID& getAssetIDByName(const std::string& name); |
107 | 109 | ||
108 | static bool getInstance(); | 110 | static LLFloaterAO* getInstance(); |
111 | static bool getVisible(); | ||
109 | 112 | ||
110 | private: | 113 | private: |
111 | 114 | ||
112 | static LLFloaterAO* sInstance; | 115 | static LLFloaterAO* sInstance; |
113 | static int mAnimationState; | 116 | static S32 sAnimationState; |
114 | static LLUUID mCurrentStandId; | 117 | static LLUUID sCurrentStandId; |
115 | 118 | ||
116 | static AONoteCardDropTarget* mAOItemDropTarget; | 119 | static AONoteCardDropTarget* sAOItemDropTarget; |
117 | static void AOItemDrop(LLViewerInventoryItem* item); | 120 | static void AOItemDrop(LLViewerInventoryItem* item); |
118 | static void onSpinnerCommit(LLUICtrl* ctrl, void* userdata); | 121 | static void onSpinnerCommit(LLUICtrl* ctrl, void* userdata); |
119 | static void onComboBoxCommit(LLUICtrl* ctrl, void* userdata); | 122 | static void onComboBoxCommit(LLUICtrl* ctrl, void* userdata); |
120 | static BOOL SetDefault(void *userdata, LLUUID ao_id, std::string defaultanim); | 123 | static bool setDefault(void *userdata, LLUUID ao_id, std::string defaultanim); |
121 | 124 | ||
122 | BOOL mDirty; | 125 | BOOL mDirty; |
123 | 126 | ||
diff --git a/linden/indra/newview/hippolimits.cpp b/linden/indra/newview/hippolimits.cpp index f6f36fa..d6d6c36 100644 --- a/linden/indra/newview/hippolimits.cpp +++ b/linden/indra/newview/hippolimits.cpp | |||
@@ -8,7 +8,8 @@ | |||
8 | #include "llviewercontrol.h" | 8 | #include "llviewercontrol.h" |
9 | 9 | ||
10 | #include <llerror.h> | 10 | #include <llerror.h> |
11 | 11 | #include "llagent.h" | |
12 | #include "llviewerregion.h" | ||
12 | 13 | ||
13 | HippoLimits *gHippoLimits = 0; | 14 | HippoLimits *gHippoLimits = 0; |
14 | 15 | ||
@@ -23,7 +24,8 @@ HippoLimits::HippoLimits() | |||
23 | mMaxPrimScale(256.0f), | 24 | mMaxPrimScale(256.0f), |
24 | mMaxLinkedPrims(-1), | 25 | mMaxLinkedPrims(-1), |
25 | mMaxDragDistance(0.f), | 26 | mMaxDragDistance(0.f), |
26 | mVoiceConnector("SLVoice") | 27 | mVoiceConnector("SLVoice"), |
28 | mMaxSelectDistance(64.0f) | ||
27 | { | 29 | { |
28 | setLimits(); | 30 | setLimits(); |
29 | } | 31 | } |
@@ -70,6 +72,7 @@ void HippoLimits::setOpenSimLimits() | |||
70 | mEnforceMaxBuild = FALSE; | 72 | mEnforceMaxBuild = FALSE; |
71 | mRenderWater = TRUE; | 73 | mRenderWater = TRUE; |
72 | mVoiceConnector = "SLVoice"; | 74 | mVoiceConnector = "SLVoice"; |
75 | mMaxSelectDistance = 192.0f; | ||
73 | 76 | ||
74 | if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) { | 77 | if (gHippoGridManager->getConnectedGrid()->isRenderCompat()) { |
75 | llinfos << "Using rendering compatible OpenSim limits" << llendl; | 78 | llinfos << "Using rendering compatible OpenSim limits" << llendl; |
@@ -90,7 +93,7 @@ void HippoLimits::setSecondLifeLimits() | |||
90 | S32 max_groups = gHippoGridManager->getConnectedGrid()->getMaxAgentGroups(); | 93 | S32 max_groups = gHippoGridManager->getConnectedGrid()->getMaxAgentGroups(); |
91 | mMaxAgentGroups = llmax(max_groups, 25); | 94 | mMaxAgentGroups = llmax(max_groups, 25); |
92 | 95 | ||
93 | mMaxPrimScale = 10.0f; | 96 | setSecondLifeMaxPrimScale(); |
94 | mMinPrimScale = 0.01f; | 97 | mMinPrimScale = 0.01f; |
95 | mMaxHeight = 4096.0f; | 98 | mMaxHeight = 4096.0f; |
96 | mMinHoleSize = 0.05f; | 99 | mMinHoleSize = 0.05f; |
@@ -113,6 +116,22 @@ void HippoLimits::setSecondLifeLimits() | |||
113 | mEnforceMaxBuild = FALSE; | 116 | mEnforceMaxBuild = FALSE; |
114 | mRenderWater = TRUE; | 117 | mRenderWater = TRUE; |
115 | mVoiceConnector = "SLVoice"; | 118 | mVoiceConnector = "SLVoice"; |
119 | mMaxSelectDistance = 64.0f; | ||
120 | } | ||
121 | |||
122 | void HippoLimits::setSecondLifeMaxPrimScale() | ||
123 | { | ||
124 | // SecondLife Mesh sims that allow 64m prims are ones that have BOTH these caps | ||
125 | if (gAgent.getRegion() | ||
126 | && !gAgent.getRegion()->getCapability("GetMesh").empty() | ||
127 | && !gAgent.getRegion()->getCapability("ObjectAdd").empty()) | ||
128 | { | ||
129 | mMaxPrimScale = 64.f; | ||
130 | } | ||
131 | else | ||
132 | { | ||
133 | mMaxPrimScale = 10.f; | ||
134 | } | ||
116 | } | 135 | } |
117 | 136 | ||
118 | F32 HippoLimits::getMaxPrimScale() const | 137 | F32 HippoLimits::getMaxPrimScale() const |
diff --git a/linden/indra/newview/hippolimits.h b/linden/indra/newview/hippolimits.h index 9d6b2f6..9cc6160 100644 --- a/linden/indra/newview/hippolimits.h +++ b/linden/indra/newview/hippolimits.h | |||
@@ -15,6 +15,7 @@ public: | |||
15 | const S32& getMaxPhysLinkedPrims() const { return mMaxPhysLinkedPrims; } | 15 | const S32& getMaxPhysLinkedPrims() const { return mMaxPhysLinkedPrims; } |
16 | const F32& getMaxInventoryItemsTransfer() const { return mMaxInventoryItemsTransfer; } | 16 | const F32& getMaxInventoryItemsTransfer() const { return mMaxInventoryItemsTransfer; } |
17 | const std::string& getVoiceConnector() const { return mVoiceConnector; } | 17 | const std::string& getVoiceConnector() const { return mVoiceConnector; } |
18 | const F32& getMaxSelectDistance() const { return mMaxSelectDistance; } | ||
18 | 19 | ||
19 | // Returns the max prim size we can use on a grid | 20 | // Returns the max prim size we can use on a grid |
20 | F32 getMinPrimScale() const; | 21 | F32 getMinPrimScale() const; |
@@ -46,6 +47,7 @@ public: | |||
46 | F32 mMinPrimXPos; | 47 | F32 mMinPrimXPos; |
47 | F32 mMinPrimYPos; | 48 | F32 mMinPrimYPos; |
48 | F32 mMinPrimZPos; | 49 | F32 mMinPrimZPos; |
50 | F32 mMaxSelectDistance; | ||
49 | 51 | ||
50 | S32 mRenderName; | 52 | S32 mRenderName; |
51 | 53 | ||
@@ -64,6 +66,7 @@ public: | |||
64 | private: | 66 | private: |
65 | void setOpenSimLimits(); | 67 | void setOpenSimLimits(); |
66 | void setSecondLifeLimits(); | 68 | void setSecondLifeLimits(); |
69 | void setSecondLifeMaxPrimScale(); | ||
67 | }; | 70 | }; |
68 | 71 | ||
69 | 72 | ||
diff --git a/linden/indra/newview/llglsandbox.cpp b/linden/indra/newview/llglsandbox.cpp index 96fd39b..61d0994 100644 --- a/linden/indra/newview/llglsandbox.cpp +++ b/linden/indra/newview/llglsandbox.cpp | |||
@@ -68,6 +68,8 @@ | |||
68 | #include "llresmgr.h" | 68 | #include "llresmgr.h" |
69 | #include "pipeline.h" | 69 | #include "pipeline.h" |
70 | #include "llspatialpartition.h" | 70 | #include "llspatialpartition.h" |
71 | |||
72 | #include "hippolimits.h" | ||
71 | 73 | ||
72 | // [RLVa:KB] | 74 | // [RLVa:KB] |
73 | #include "rlvhandler.h" | 75 | #include "rlvhandler.h" |
@@ -180,7 +182,7 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) | |||
180 | // [/RLVa:KB] | 182 | // [/RLVa:KB] |
181 | 183 | ||
182 | LLVector3 av_pos = gAgent.getPositionAgent(); | 184 | LLVector3 av_pos = gAgent.getPositionAgent(); |
183 | F32 select_dist_squared = gSavedSettings.getF32("MaxSelectDistance"); | 185 | F32 select_dist_squared = gHippoLimits->getMaxSelectDistance(); |
184 | select_dist_squared = select_dist_squared * select_dist_squared; | 186 | select_dist_squared = select_dist_squared * select_dist_squared; |
185 | 187 | ||
186 | BOOL deselect = (mask == MASK_CONTROL); | 188 | BOOL deselect = (mask == MASK_CONTROL); |
@@ -228,15 +230,15 @@ void LLToolSelectRect::handleRectangleSelection(S32 x, S32 y, MASK mask) | |||
228 | glMatrixMode(GL_PROJECTION); | 230 | glMatrixMode(GL_PROJECTION); |
229 | gGL.pushMatrix(); | 231 | gGL.pushMatrix(); |
230 | 232 | ||
231 | BOOL limit_select_distance = gSavedSettings.getBOOL("LimitSelectDistance"); | 233 | BOOL limit_select_distance = (!gSavedSettings.getBOOL("DisableMaxBuildConstraints") && gSavedSettings.getBOOL("LimitSelectDistance")); |
232 | if (limit_select_distance) | 234 | if (limit_select_distance) |
233 | { | 235 | { |
234 | // ...select distance from control | 236 | // ...select distance from control |
235 | LLVector3 relative_av_pos = av_pos; | 237 | LLVector3 relative_av_pos = av_pos; |
236 | relative_av_pos -= LLViewerCamera::getInstance()->getOrigin(); | 238 | relative_av_pos -= LLViewerCamera::getInstance()->getOrigin(); |
237 | 239 | ||
238 | F32 new_far = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() + gSavedSettings.getF32("MaxSelectDistance"); | 240 | F32 new_far = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() + gHippoLimits->getMaxSelectDistance(); |
239 | F32 new_near = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() - gSavedSettings.getF32("MaxSelectDistance"); | 241 | F32 new_near = relative_av_pos * LLViewerCamera::getInstance()->getAtAxis() - gHippoLimits->getMaxSelectDistance(); |
240 | 242 | ||
241 | new_near = llmax(new_near, 0.1f); | 243 | new_near = llmax(new_near, 0.1f); |
242 | 244 | ||
diff --git a/linden/indra/newview/llimpanel.cpp b/linden/indra/newview/llimpanel.cpp index 752ebb4..85ab779 100644 --- a/linden/indra/newview/llimpanel.cpp +++ b/linden/indra/newview/llimpanel.cpp | |||
@@ -1963,6 +1963,12 @@ void LLFloaterIMPanel::onCommitCombo(LLUICtrl* caller, void* userdata) | |||
1963 | { | 1963 | { |
1964 | if (caller->getValue().asString() == "history_entry") | 1964 | if (caller->getValue().asString() == "history_entry") |
1965 | { | 1965 | { |
1966 | #ifdef LL_LINUX | ||
1967 | LLSD args; | ||
1968 | args["[FEATURE]"] = LLNotifications::instance().getGlobalString("view history"); | ||
1969 | args["[OS]"] = "Linux"; | ||
1970 | LLNotifications::instance().add("FeatureNotAvailableOnOS", args, LLSD()); | ||
1971 | #else // LL_LINUX | ||
1966 | if (self->getOtherParticipantID().notNull()) | 1972 | if (self->getOtherParticipantID().notNull()) |
1967 | { | 1973 | { |
1968 | std::string fullname = self->getTitle(); | 1974 | std::string fullname = self->getTitle(); |
@@ -1990,6 +1996,7 @@ void LLFloaterIMPanel::onCommitCombo(LLUICtrl* caller, void* userdata) | |||
1990 | //llinfos << file << " found" << llendl; | 1996 | //llinfos << file << " found" << llendl; |
1991 | } | 1997 | } |
1992 | } | 1998 | } |
1999 | #endif // LL_LINUX | ||
1993 | } | 2000 | } |
1994 | // profile | 2001 | // profile |
1995 | else if (self->getIMType() == IM_PANEL_PLAIN) | 2002 | else if (self->getIMType() == IM_PANEL_PLAIN) |
diff --git a/linden/indra/newview/llinventorymodel.cpp b/linden/indra/newview/llinventorymodel.cpp index 1c7a049..58a2bdc 100644 --- a/linden/indra/newview/llinventorymodel.cpp +++ b/linden/indra/newview/llinventorymodel.cpp | |||
@@ -186,7 +186,16 @@ LLInventoryModel gInventory; | |||
186 | // Default constructor | 186 | // Default constructor |
187 | LLInventoryModel::LLInventoryModel() : | 187 | LLInventoryModel::LLInventoryModel() : |
188 | mModifyMask(LLInventoryObserver::ALL), | 188 | mModifyMask(LLInventoryObserver::ALL), |
189 | mChangedItemIDs(), | ||
190 | mCategoryMap(), | ||
191 | mItemMap(), | ||
192 | mCategoryLock(), | ||
193 | mItemLock(), | ||
189 | mLastItem(NULL), | 194 | mLastItem(NULL), |
195 | mAnimationsFolderUUID(LLUUID::null), | ||
196 | mParentChildCategoryTree(), | ||
197 | mParentChildItemTree(), | ||
198 | mObservers(), | ||
190 | mIsAgentInvUsable(false) | 199 | mIsAgentInvUsable(false) |
191 | { | 200 | { |
192 | } | 201 | } |
@@ -404,7 +413,7 @@ LLUUID LLInventoryModel::createNewCategory(const LLUUID& parent_id, | |||
404 | 413 | ||
405 | if(preferred_type == LLAssetType::AT_SIMSTATE) | 414 | if(preferred_type == LLAssetType::AT_SIMSTATE) |
406 | { | 415 | { |
407 | lldebugs << "Attempt to create simstate category." << llendl; | 416 | LL_DEBUGS("Inventory") << "Attempt to create simstate category." << LL_ENDL; |
408 | return id; | 417 | return id; |
409 | } | 418 | } |
410 | 419 | ||
@@ -761,7 +770,7 @@ void LLInventoryModel::updateCategory(const LLViewerInventoryCategory* cat) | |||
761 | 770 | ||
762 | void LLInventoryModel::moveObject(const LLUUID& object_id, const LLUUID& cat_id) | 771 | void LLInventoryModel::moveObject(const LLUUID& object_id, const LLUUID& cat_id) |
763 | { | 772 | { |
764 | lldebugs << "LLInventoryModel::moveObject()" << llendl; | 773 | LL_DEBUGS("Inventory") << "LLInventoryModel::moveObject()" << LL_ENDL; |
765 | if(!isInventoryUsable()) | 774 | if(!isInventoryUsable()) |
766 | { | 775 | { |
767 | llwarns << "Inventory is broken." << llendl; | 776 | llwarns << "Inventory is broken." << llendl; |
@@ -803,11 +812,11 @@ void LLInventoryModel::moveObject(const LLUUID& object_id, const LLUUID& cat_id) | |||
803 | // Delete a particular inventory object by ID. | 812 | // Delete a particular inventory object by ID. |
804 | void LLInventoryModel::deleteObject(const LLUUID& id) | 813 | void LLInventoryModel::deleteObject(const LLUUID& id) |
805 | { | 814 | { |
806 | lldebugs << "LLInventoryModel::deleteObject()" << llendl; | 815 | LL_DEBUGS("Inventory") << "LLInventoryModel::deleteObject()" << LL_ENDL; |
807 | LLPointer<LLInventoryObject> obj = getObject(id); | 816 | LLPointer<LLInventoryObject> obj = getObject(id); |
808 | if(obj) | 817 | if(obj) |
809 | { | 818 | { |
810 | lldebugs << "Deleting inventory object " << id << llendl; | 819 | LL_DEBUGS("Inventory") << "Deleting inventory object " << id << LL_ENDL; |
811 | mLastItem = NULL; | 820 | mLastItem = NULL; |
812 | LLUUID parent_id = obj->getParentUUID(); | 821 | LLUUID parent_id = obj->getParentUUID(); |
813 | mCategoryMap.erase(id); | 822 | mCategoryMap.erase(id); |
@@ -1103,8 +1112,8 @@ void LLInventoryModel::fetchInventoryResponder::result(const LLSD& content) | |||
1103 | LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; | 1112 | LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; |
1104 | titem->unpackMessage(content["items"][i]); | 1113 | titem->unpackMessage(content["items"][i]); |
1105 | 1114 | ||
1106 | lldebugs << "LLInventoryModel::messageUpdateCore() item id:" | 1115 | LL_DEBUGS("Inventory") << "LLInventoryModel::messageUpdateCore() item id:" |
1107 | << titem->getUUID() << llendl; | 1116 | << titem->getUUID() << LL_ENDL; |
1108 | items.push_back(titem); | 1117 | items.push_back(titem); |
1109 | // examine update for changes. | 1118 | // examine update for changes. |
1110 | LLViewerInventoryItem* itemp = gInventory.getItem(titem->getUUID()); | 1119 | LLViewerInventoryItem* itemp = gInventory.getItem(titem->getUUID()); |
@@ -1673,8 +1682,8 @@ void LLInventoryModel::cache( | |||
1673 | const LLUUID& parent_folder_id, | 1682 | const LLUUID& parent_folder_id, |
1674 | const LLUUID& agent_id) | 1683 | const LLUUID& agent_id) |
1675 | { | 1684 | { |
1676 | lldebugs << "Caching " << parent_folder_id << " for " << agent_id | 1685 | LL_DEBUGS("Inventory") << "Caching " << parent_folder_id << " for " << agent_id |
1677 | << llendl; | 1686 | << LL_ENDL; |
1678 | LLViewerInventoryCategory* root_cat = getCategory(parent_folder_id); | 1687 | LLViewerInventoryCategory* root_cat = getCategory(parent_folder_id); |
1679 | if(!root_cat) return; | 1688 | if(!root_cat) return; |
1680 | cat_array_t categories; | 1689 | cat_array_t categories; |
@@ -1699,7 +1708,7 @@ void LLInventoryModel::cache( | |||
1699 | gzip_filename.append(".gz"); | 1708 | gzip_filename.append(".gz"); |
1700 | if(gzip_file(inventory_filename, gzip_filename)) | 1709 | if(gzip_file(inventory_filename, gzip_filename)) |
1701 | { | 1710 | { |
1702 | lldebugs << "Successfully compressed " << inventory_filename << llendl; | 1711 | LL_DEBUGS("Inventory") << "Successfully compressed " << inventory_filename << LL_ENDL; |
1703 | LLFile::remove(inventory_filename); | 1712 | LLFile::remove(inventory_filename); |
1704 | } | 1713 | } |
1705 | else | 1714 | else |
@@ -1781,8 +1790,8 @@ void LLInventoryModel::accountForUpdate(const LLCategoryUpdate& update) | |||
1781 | } | 1790 | } |
1782 | if(!accounted) | 1791 | if(!accounted) |
1783 | { | 1792 | { |
1784 | lldebugs << "No accounting for: '" << cat->getName() << "' " | 1793 | LL_DEBUGS("Inventory") << "No accounting for: '" << cat->getName() << "' " |
1785 | << version << llendl; | 1794 | << version << LL_ENDL; |
1786 | } | 1795 | } |
1787 | } | 1796 | } |
1788 | else | 1797 | else |
@@ -1914,40 +1923,72 @@ bool LLInventoryModel::isCategoryComplete(const LLUUID& cat_id) const | |||
1914 | return false; | 1923 | return false; |
1915 | } | 1924 | } |
1916 | 1925 | ||
1917 | bool LLInventoryModel::loadSkeleton( | 1926 | bool LLInventoryModel::loadSkeleton(const LLInventoryModel::options_t& options, |
1918 | const LLInventoryModel::options_t& options, | 1927 | const LLUUID& owner_id) |
1919 | const LLUUID& owner_id) | ||
1920 | { | 1928 | { |
1921 | lldebugs << "importing inventory skeleton for " << owner_id << llendl; | 1929 | LL_DEBUGS("Inventory") << "importing inventory skeleton for " << owner_id << LL_ENDL; |
1922 | 1930 | ||
1923 | typedef std::set<LLPointer<LLViewerInventoryCategory>, InventoryIDPtrLess> cat_set_t; | 1931 | typedef std::set<LLPointer<LLViewerInventoryCategory>, InventoryIDPtrLess> cat_set_t; |
1924 | cat_set_t temp_cats; | 1932 | cat_set_t temp_cats; |
1925 | 1933 | ||
1926 | update_map_t child_counts; | 1934 | update_map_t child_counts; |
1927 | |||
1928 | LLUUID id; | 1935 | LLUUID id; |
1929 | LLAssetType::EType preferred_type; | 1936 | LLAssetType::EType preferred_type; |
1930 | bool rv = true; | 1937 | bool rv = true; |
1931 | for(options_t::const_iterator it = options.begin(); it < options.end(); ++it) | 1938 | bool clean_cat = false; |
1939 | |||
1940 | for (options_t::const_iterator it = options.begin(); it < options.end(); ++it) | ||
1932 | { | 1941 | { |
1933 | LLPointer<LLViewerInventoryCategory> cat = new LLViewerInventoryCategory(owner_id); | 1942 | LLPointer<LLViewerInventoryCategory> cat = new LLViewerInventoryCategory(owner_id); |
1943 | |||
1934 | response_t::const_iterator no_response = (*it).end(); | 1944 | response_t::const_iterator no_response = (*it).end(); |
1935 | response_t::const_iterator skel; | 1945 | response_t::const_iterator skel; |
1936 | skel = (*it).find("name"); | 1946 | |
1937 | if(skel == no_response) goto clean_cat; | 1947 | clean_cat = false; |
1938 | cat->rename(std::string((*skel).second)); | 1948 | |
1939 | skel = (*it).find("folder_id"); | 1949 | skel = (*it).find("folder_id"); |
1940 | if(skel == no_response) goto clean_cat; | 1950 | if (skel == no_response) |
1941 | id.set((*skel).second); | 1951 | { |
1952 | clean_cat = true; | ||
1953 | } | ||
1954 | else | ||
1955 | { | ||
1956 | id.set((*skel).second); | ||
1957 | } | ||
1958 | |||
1942 | // if an id is null, it locks the viewer. | 1959 | // if an id is null, it locks the viewer. |
1943 | if(id.isNull()) goto clean_cat; | 1960 | if (id.isNull()) |
1944 | cat->setUUID(id); | 1961 | { |
1962 | clean_cat = true; | ||
1963 | } | ||
1964 | else | ||
1965 | { | ||
1966 | cat->setUUID(id); | ||
1967 | } | ||
1968 | |||
1945 | skel = (*it).find("parent_id"); | 1969 | skel = (*it).find("parent_id"); |
1946 | if(skel == no_response) goto clean_cat; | 1970 | if (skel == no_response) |
1947 | id.set((*skel).second); | 1971 | { |
1948 | cat->setParent(id); | 1972 | clean_cat = true; |
1973 | } | ||
1974 | else | ||
1975 | { | ||
1976 | id.set((*skel).second); | ||
1977 | cat->setParent(id); | ||
1978 | } | ||
1979 | |||
1980 | skel = (*it).find("name"); | ||
1981 | if (skel == no_response) | ||
1982 | { | ||
1983 | clean_cat = true; | ||
1984 | } | ||
1985 | else | ||
1986 | { | ||
1987 | cat->rename(std::string((*skel).second)); | ||
1988 | } | ||
1989 | |||
1949 | skel = (*it).find("type_default"); | 1990 | skel = (*it).find("type_default"); |
1950 | if(skel == no_response) | 1991 | if (skel == no_response) |
1951 | { | 1992 | { |
1952 | preferred_type = LLAssetType::AT_NONE; | 1993 | preferred_type = LLAssetType::AT_NONE; |
1953 | } | 1994 | } |
@@ -1955,40 +1996,71 @@ bool LLInventoryModel::loadSkeleton( | |||
1955 | { | 1996 | { |
1956 | S32 t = atoi((*skel).second.c_str()); | 1997 | S32 t = atoi((*skel).second.c_str()); |
1957 | preferred_type = (LLAssetType::EType)t; | 1998 | preferred_type = (LLAssetType::EType)t; |
1999 | |||
2000 | // This UUID is different for each avatar and "Animations" is hardcoded into the skeleton -- MC | ||
2001 | if (LLAssetType::AT_ANIMATION == preferred_type && cat->getName() == "Animations") | ||
2002 | { | ||
2003 | //llinfos << "Animations folder uuid from skeleton: " << cat->getUUID() << llendl; | ||
2004 | mAnimationsFolderUUID = id; | ||
2005 | } | ||
1958 | } | 2006 | } |
1959 | cat->setPreferredType(preferred_type); | 2007 | cat->setPreferredType(preferred_type); |
2008 | |||
1960 | skel = (*it).find("version"); | 2009 | skel = (*it).find("version"); |
1961 | if(skel == no_response) goto clean_cat; | 2010 | if (skel == no_response) |
1962 | cat->setVersion(atoi((*skel).second.c_str())); | 2011 | { |
1963 | temp_cats.insert(cat); | 2012 | clean_cat = true; |
1964 | continue; | 2013 | } |
1965 | clean_cat: | 2014 | else |
1966 | llwarns << "Unable to import near " << cat->getName() << llendl; | 2015 | { |
1967 | rv = false; | 2016 | cat->setVersion(atoi((*skel).second.c_str())); |
1968 | //delete cat; // automatic when cat is reasigned or destroyed | 2017 | } |
2018 | |||
2019 | if (clean_cat) | ||
2020 | { | ||
2021 | llwarns << "Unable to import near " << cat->getName() << llendl; | ||
2022 | rv = false; | ||
2023 | //delete cat; // automatic when cat is reasigned or destroyed | ||
2024 | temp_cats.clear(); | ||
2025 | break; | ||
2026 | } | ||
2027 | else | ||
2028 | { | ||
2029 | temp_cats.insert(cat); | ||
2030 | } | ||
1969 | } | 2031 | } |
1970 | 2032 | ||
1971 | S32 cached_category_count = 0; | 2033 | S32 cached_category_count = 0; |
1972 | S32 cached_item_count = 0; | 2034 | S32 cached_item_count = 0; |
1973 | if(!temp_cats.empty()) | 2035 | if (temp_cats.empty()) |
2036 | { | ||
2037 | LL_WARNS("Inventory") << "No categories found! Cannot continue!" << LL_ENDL; | ||
2038 | } | ||
2039 | else | ||
1974 | { | 2040 | { |
1975 | cat_array_t categories; | 2041 | cat_array_t categories; |
1976 | item_array_t items; | 2042 | item_array_t items; |
1977 | std::string owner_id_str; | 2043 | std::string owner_id_str; |
1978 | owner_id.toString(owner_id_str); | 2044 | owner_id.toString(owner_id_str); |
2045 | |||
1979 | std::string path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, owner_id_str)); | 2046 | std::string path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, owner_id_str)); |
1980 | std::string inventory_filename; | 2047 | std::string inventory_filename; |
1981 | inventory_filename = llformat(CACHE_FORMAT_STRING, path.c_str()); | 2048 | inventory_filename = llformat(CACHE_FORMAT_STRING, path.c_str()); |
2049 | |||
1982 | const S32 NO_VERSION = LLViewerInventoryCategory::VERSION_UNKNOWN; | 2050 | const S32 NO_VERSION = LLViewerInventoryCategory::VERSION_UNKNOWN; |
2051 | |||
1983 | std::string gzip_filename(inventory_filename); | 2052 | std::string gzip_filename(inventory_filename); |
1984 | gzip_filename.append(".gz"); | 2053 | gzip_filename.append(".gz"); |
1985 | LLFILE* fp = LLFile::fopen(gzip_filename, "rb"); | 2054 | LLFILE* fp = LLFile::fopen(gzip_filename, "rb"); |
2055 | |||
1986 | bool remove_inventory_file = false; | 2056 | bool remove_inventory_file = false; |
1987 | if(fp) | 2057 | |
2058 | // try to ungzip the inventory -- MC | ||
2059 | if (fp) | ||
1988 | { | 2060 | { |
1989 | fclose(fp); | 2061 | fclose(fp); |
1990 | fp = NULL; | 2062 | fp = NULL; |
1991 | if(gunzip_file(gzip_filename, inventory_filename)) | 2063 | if (gunzip_file(gzip_filename, inventory_filename)) |
1992 | { | 2064 | { |
1993 | // we only want to remove the inventory file if it was | 2065 | // we only want to remove the inventory file if it was |
1994 | // gzipped before we loaded, and we successfully | 2066 | // gzipped before we loaded, and we successfully |
@@ -2000,7 +2072,9 @@ bool LLInventoryModel::loadSkeleton( | |||
2000 | llinfos << "Unable to gunzip " << gzip_filename << llendl; | 2072 | llinfos << "Unable to gunzip " << gzip_filename << llendl; |
2001 | } | 2073 | } |
2002 | } | 2074 | } |
2003 | if(loadFromFile(inventory_filename, categories, items)) | 2075 | |
2076 | // begin cache loading -- MC | ||
2077 | if (loadFromFile(inventory_filename, categories, items)) | ||
2004 | { | 2078 | { |
2005 | // We were able to find a cache of files. So, use what we | 2079 | // We were able to find a cache of files. So, use what we |
2006 | // found to generate a set of categories we should add. We | 2080 | // found to generate a set of categories we should add. We |
@@ -2009,10 +2083,11 @@ bool LLInventoryModel::loadSkeleton( | |||
2009 | S32 count = categories.count(); | 2083 | S32 count = categories.count(); |
2010 | cat_set_t::iterator not_cached = temp_cats.end(); | 2084 | cat_set_t::iterator not_cached = temp_cats.end(); |
2011 | std::set<LLUUID> cached_ids; | 2085 | std::set<LLUUID> cached_ids; |
2012 | for(S32 i = 0; i < count; ++i) | 2086 | for (S32 i = 0; i < count; ++i) |
2013 | { | 2087 | { |
2014 | LLViewerInventoryCategory* cat = categories[i]; | 2088 | LLViewerInventoryCategory* cat = categories[i]; |
2015 | cat_set_t::iterator cit = temp_cats.find(cat); | 2089 | cat_set_t::iterator cit = temp_cats.find(cat); |
2090 | |||
2016 | if (cit == temp_cats.end()) | 2091 | if (cit == temp_cats.end()) |
2017 | { | 2092 | { |
2018 | continue; // cache corruption?? not sure why this happens -SJB | 2093 | continue; // cache corruption?? not sure why this happens -SJB |
@@ -2021,18 +2096,23 @@ bool LLInventoryModel::loadSkeleton( | |||
2021 | 2096 | ||
2022 | // we can safely ignore anything loaded from file, but | 2097 | // we can safely ignore anything loaded from file, but |
2023 | // not sent down in the skeleton. | 2098 | // not sent down in the skeleton. |
2024 | if(cit == not_cached) | 2099 | if (cit == not_cached) |
2025 | { | 2100 | { |
2026 | continue; | 2101 | continue; |
2027 | } | 2102 | } |
2028 | if(cat->getVersion() != tcat->getVersion()) | 2103 | |
2104 | // We insert them anyway to keep the cache from breaking. | ||
2105 | // If we delete or add a folder (aka "category") then the server | ||
2106 | // increments the version and we reload the items on next login anyway | ||
2107 | // this *may* result in duplicates that are cleared on relog-- MC | ||
2108 | /*if (cat->getVersion() != tcat->getVersion()) | ||
2029 | { | 2109 | { |
2030 | // if the cached version does not match the server version, | 2110 | // if the cached version does not match the server version, |
2031 | // throw away the version we have so we can fetch the | 2111 | // throw away the version we have so we can fetch the |
2032 | // correct contents the next time the viewer opens the folder. | 2112 | // correct contents the next time the viewer opens the folder. |
2033 | tcat->setVersion(NO_VERSION); | 2113 | tcat->setVersion(NO_VERSION); |
2034 | } | 2114 | } |
2035 | else | 2115 | else*/ |
2036 | { | 2116 | { |
2037 | cached_ids.insert(tcat->getUUID()); | 2117 | cached_ids.insert(tcat->getUUID()); |
2038 | } | 2118 | } |
@@ -2041,9 +2121,9 @@ bool LLInventoryModel::loadSkeleton( | |||
2041 | // go ahead and add the cats returned during the download | 2121 | // go ahead and add the cats returned during the download |
2042 | std::set<LLUUID>::iterator not_cached_id = cached_ids.end(); | 2122 | std::set<LLUUID>::iterator not_cached_id = cached_ids.end(); |
2043 | cached_category_count = cached_ids.size(); | 2123 | cached_category_count = cached_ids.size(); |
2044 | for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) | 2124 | for (cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) |
2045 | { | 2125 | { |
2046 | if(cached_ids.find((*it)->getUUID()) == not_cached_id) | 2126 | if (cached_ids.find((*it)->getUUID()) == not_cached_id) |
2047 | { | 2127 | { |
2048 | // this check is performed so that we do not | 2128 | // this check is performed so that we do not |
2049 | // mark new folders in the skeleton (and not in cache) | 2129 | // mark new folders in the skeleton (and not in cache) |
@@ -2058,15 +2138,14 @@ bool LLInventoryModel::loadSkeleton( | |||
2058 | // Add all the items loaded which are parented to a | 2138 | // Add all the items loaded which are parented to a |
2059 | // category with a correctly cached parent | 2139 | // category with a correctly cached parent |
2060 | count = items.count(); | 2140 | count = items.count(); |
2061 | cat_map_t::iterator unparented = mCategoryMap.end(); | 2141 | for (int i = 0; i < count; ++i) |
2062 | for(int i = 0; i < count; ++i) | ||
2063 | { | 2142 | { |
2064 | cat_map_t::iterator cit = mCategoryMap.find(items[i]->getParentUUID()); | 2143 | cat_map_t::iterator cit = mCategoryMap.find(items[i]->getParentUUID()); |
2065 | 2144 | ||
2066 | if(cit != unparented) | 2145 | if (cit != mCategoryMap.end()) |
2067 | { | 2146 | { |
2068 | LLViewerInventoryCategory* cat = cit->second; | 2147 | LLViewerInventoryCategory* cat = cit->second; |
2069 | if(cat->getVersion() != NO_VERSION) | 2148 | if (cat->getVersion() != NO_VERSION) |
2070 | { | 2149 | { |
2071 | addItem(items[i]); | 2150 | addItem(items[i]); |
2072 | cached_item_count += 1; | 2151 | cached_item_count += 1; |
@@ -2079,7 +2158,7 @@ bool LLInventoryModel::loadSkeleton( | |||
2079 | { | 2158 | { |
2080 | // go ahead and add everything after stripping the version | 2159 | // go ahead and add everything after stripping the version |
2081 | // information. | 2160 | // information. |
2082 | for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) | 2161 | for (cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) |
2083 | { | 2162 | { |
2084 | LLViewerInventoryCategory *llvic = (*it); | 2163 | LLViewerInventoryCategory *llvic = (*it); |
2085 | llvic->setVersion(NO_VERSION); | 2164 | llvic->setVersion(NO_VERSION); |
@@ -2092,13 +2171,13 @@ bool LLInventoryModel::loadSkeleton( | |||
2092 | // needlessly fetch descendents for categories which we have. | 2171 | // needlessly fetch descendents for categories which we have. |
2093 | update_map_t::iterator no_child_counts = child_counts.end(); | 2172 | update_map_t::iterator no_child_counts = child_counts.end(); |
2094 | update_map_t::iterator the_count; | 2173 | update_map_t::iterator the_count; |
2095 | for(cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) | 2174 | for (cat_set_t::iterator it = temp_cats.begin(); it != temp_cats.end(); ++it) |
2096 | { | 2175 | { |
2097 | LLViewerInventoryCategory* cat = (*it); | 2176 | LLViewerInventoryCategory* cat = (*it); |
2098 | if(cat->getVersion() != NO_VERSION) | 2177 | if (cat->getVersion() != NO_VERSION) |
2099 | { | 2178 | { |
2100 | the_count = child_counts.find(cat->getUUID()); | 2179 | the_count = child_counts.find(cat->getUUID()); |
2101 | if(the_count != no_child_counts) | 2180 | if (the_count != no_child_counts) |
2102 | { | 2181 | { |
2103 | cat->setDescendentCount((*the_count).second.mValue); | 2182 | cat->setDescendentCount((*the_count).second.mValue); |
2104 | } | 2183 | } |
@@ -2109,7 +2188,7 @@ bool LLInventoryModel::loadSkeleton( | |||
2109 | } | 2188 | } |
2110 | } | 2189 | } |
2111 | 2190 | ||
2112 | if(remove_inventory_file) | 2191 | if (remove_inventory_file) |
2113 | { | 2192 | { |
2114 | // clean up the gunzipped file. | 2193 | // clean up the gunzipped file. |
2115 | LLFile::remove(inventory_filename); | 2194 | LLFile::remove(inventory_filename); |
@@ -2118,53 +2197,98 @@ bool LLInventoryModel::loadSkeleton( | |||
2118 | } | 2197 | } |
2119 | 2198 | ||
2120 | LL_DEBUGS("Inventory") << "Successfully loaded " << cached_category_count | 2199 | LL_DEBUGS("Inventory") << "Successfully loaded " << cached_category_count |
2121 | << " categories and " << cached_item_count << " items from cache." | 2200 | << " categories and " << cached_item_count << " items from cache skeleton." |
2122 | << LL_ENDL; | 2201 | << LL_ENDL; |
2123 | 2202 | ||
2124 | return rv; | 2203 | return rv; |
2125 | } | 2204 | } |
2126 | 2205 | ||
2127 | bool LLInventoryModel::loadMeat( | 2206 | bool LLInventoryModel::loadMeat(const LLInventoryModel::options_t& options, |
2128 | const LLInventoryModel::options_t& options, const LLUUID& owner_id) | 2207 | const LLUUID& owner_id) |
2129 | { | 2208 | { |
2130 | llinfos << "importing inventory for " << owner_id << llendl; | 2209 | llinfos << "importing inventory for " << owner_id << llendl; |
2131 | LLPermissions default_perm; | 2210 | LLPermissions default_perm; |
2132 | default_perm.init(LLUUID::null, owner_id, LLUUID::null, LLUUID::null); | 2211 | default_perm.init(LLUUID::null, owner_id, LLUUID::null, LLUUID::null); |
2133 | LLPointer<LLViewerInventoryItem> item; | 2212 | LLPointer<LLViewerInventoryItem> item; |
2134 | LLUUID id; | 2213 | LLUUID id; |
2135 | LLAssetType::EType type; | 2214 | LLAssetType::EType type = LLAssetType::AT_NONE; |
2136 | LLInventoryType::EType inv_type; | 2215 | LLInventoryType::EType inv_type; |
2216 | |||
2137 | bool rv = true; | 2217 | bool rv = true; |
2138 | for(options_t::const_iterator it = options.begin(); it < options.end(); ++it) | 2218 | bool clean_item = false; |
2219 | static S32 cached_meat_count = 0; | ||
2220 | |||
2221 | for (options_t::const_iterator it = options.begin(); it < options.end(); ++it) | ||
2139 | { | 2222 | { |
2140 | item = new LLViewerInventoryItem; | 2223 | item = new LLViewerInventoryItem; |
2224 | |||
2141 | response_t::const_iterator no_response = (*it).end(); | 2225 | response_t::const_iterator no_response = (*it).end(); |
2142 | response_t::const_iterator meat; | 2226 | response_t::const_iterator meat; |
2227 | |||
2228 | clean_item = false; | ||
2229 | |||
2143 | meat = (*it).find("name"); | 2230 | meat = (*it).find("name"); |
2144 | if(meat == no_response) goto clean_item; | 2231 | if (meat == no_response) |
2145 | item->rename(std::string((*meat).second)); | 2232 | { |
2233 | clean_item = true; | ||
2234 | } | ||
2235 | else | ||
2236 | { | ||
2237 | item->rename(std::string((*meat).second)); | ||
2238 | } | ||
2239 | |||
2146 | meat = (*it).find("item_id"); | 2240 | meat = (*it).find("item_id"); |
2147 | if(meat == no_response) goto clean_item; | 2241 | if (meat == no_response) |
2148 | id.set((*meat).second); | 2242 | { |
2149 | item->setUUID(id); | 2243 | clean_item = true; |
2244 | } | ||
2245 | else | ||
2246 | { | ||
2247 | id.set((*meat).second); | ||
2248 | item->setUUID(id); | ||
2249 | } | ||
2250 | |||
2150 | meat = (*it).find("parent_id"); | 2251 | meat = (*it).find("parent_id"); |
2151 | if(meat == no_response) goto clean_item; | 2252 | if (meat == no_response) |
2152 | id.set((*meat).second); | 2253 | { |
2153 | item->setParent(id); | 2254 | clean_item = true; |
2255 | } | ||
2256 | else | ||
2257 | { | ||
2258 | id.set((*meat).second); | ||
2259 | item->setParent(id); | ||
2260 | } | ||
2261 | |||
2154 | meat = (*it).find("type"); | 2262 | meat = (*it).find("type"); |
2155 | if(meat == no_response) goto clean_item; | 2263 | if (meat == no_response) |
2156 | type = (LLAssetType::EType)atoi((*meat).second.c_str()); | 2264 | { |
2157 | item->setType(type); | 2265 | clean_item = true; |
2266 | } | ||
2267 | else | ||
2268 | { | ||
2269 | type = (LLAssetType::EType)atoi((*meat).second.c_str()); | ||
2270 | item->setType(type); | ||
2271 | } | ||
2272 | |||
2273 | // Do we want to clean if there's no inv_type too? -- MC | ||
2158 | meat = (*it).find("inv_type"); | 2274 | meat = (*it).find("inv_type"); |
2159 | if(meat != no_response) | 2275 | if (meat != no_response) |
2160 | { | 2276 | { |
2161 | inv_type = (LLInventoryType::EType)atoi((*meat).second.c_str()); | 2277 | inv_type = (LLInventoryType::EType)atoi((*meat).second.c_str()); |
2162 | item->setInventoryType(inv_type); | 2278 | item->setInventoryType(inv_type); |
2163 | } | 2279 | } |
2280 | |||
2164 | meat = (*it).find("data_id"); | 2281 | meat = (*it).find("data_id"); |
2165 | if(meat == no_response) goto clean_item; | 2282 | if (meat == no_response) |
2166 | id.set((*meat).second); | 2283 | { |
2167 | if(LLAssetType::AT_CALLINGCARD == type) | 2284 | clean_item = true; |
2285 | } | ||
2286 | else | ||
2287 | { | ||
2288 | id.set((*meat).second); | ||
2289 | } | ||
2290 | |||
2291 | if (LLAssetType::AT_CALLINGCARD == type) | ||
2168 | { | 2292 | { |
2169 | LLPermissions perm; | 2293 | LLPermissions perm; |
2170 | perm.init(id, owner_id, LLUUID::null, LLUUID::null); | 2294 | perm.init(id, owner_id, LLUUID::null, LLUUID::null); |
@@ -2173,37 +2297,48 @@ bool LLInventoryModel::loadMeat( | |||
2173 | else | 2297 | else |
2174 | { | 2298 | { |
2175 | meat = (*it).find("perm_mask"); | 2299 | meat = (*it).find("perm_mask"); |
2176 | if(meat != no_response) | 2300 | if (meat != no_response) |
2177 | { | 2301 | { |
2178 | PermissionMask perm_mask = atoi((*meat).second.c_str()); | 2302 | PermissionMask perm_mask = atoi((*meat).second.c_str()); |
2179 | default_perm.initMasks( | 2303 | default_perm.initMasks(perm_mask, perm_mask, perm_mask, perm_mask, perm_mask); |
2180 | perm_mask, perm_mask, perm_mask, perm_mask, perm_mask); | ||
2181 | } | 2304 | } |
2182 | else | 2305 | else |
2183 | { | 2306 | { |
2184 | default_perm.initMasks( | 2307 | default_perm.initMasks(PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE); |
2185 | PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE, PERM_NONE); | ||
2186 | } | 2308 | } |
2187 | item->setPermissions(default_perm); | 2309 | item->setPermissions(default_perm); |
2188 | item->setAssetUUID(id); | 2310 | item->setAssetUUID(id); |
2189 | } | 2311 | } |
2312 | |||
2190 | meat = (*it).find("flags"); | 2313 | meat = (*it).find("flags"); |
2191 | if(meat != no_response) | 2314 | if (meat != no_response) |
2192 | { | 2315 | { |
2193 | item->setFlags(strtoul((*meat).second.c_str(), NULL, 0)); | 2316 | item->setFlags(strtoul((*meat).second.c_str(), NULL, 0)); |
2194 | } | 2317 | } |
2318 | |||
2195 | meat = (*it).find("time"); | 2319 | meat = (*it).find("time"); |
2196 | if(meat != no_response) | 2320 | if (meat != no_response) |
2197 | { | 2321 | { |
2198 | item->setCreationDate(atoi((*meat).second.c_str())); | 2322 | item->setCreationDate(atoi((*meat).second.c_str())); |
2199 | } | 2323 | } |
2200 | addItem(item); | 2324 | |
2201 | continue; | 2325 | if (clean_item) |
2202 | clean_item: | 2326 | { |
2203 | llwarns << "Unable to import near " << item->getName() << llendl; | 2327 | llwarns << "Unable to import near " << item->getName() << llendl; |
2204 | rv = false; | 2328 | rv = false; |
2205 | //delete item; // automatic when item is reassigned or destroyed | 2329 | //delete item; // automatic when item is reassigned or destroyed |
2330 | break; | ||
2331 | } | ||
2332 | else | ||
2333 | { | ||
2334 | addItem(item); | ||
2335 | cached_meat_count++; | ||
2336 | } | ||
2206 | } | 2337 | } |
2338 | |||
2339 | LL_DEBUGS("Inventory") << "Successfully added " << cached_meat_count << " items from cache." | ||
2340 | << LL_ENDL; | ||
2341 | |||
2207 | return rv; | 2342 | return rv; |
2208 | } | 2343 | } |
2209 | 2344 | ||
@@ -2528,6 +2663,7 @@ bool LLInventoryModel::loadFromFile(const std::string& filename, | |||
2528 | // *NOTE: This buffer size is hard coded into scanf() below. | 2663 | // *NOTE: This buffer size is hard coded into scanf() below. |
2529 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ | 2664 | char buffer[MAX_STRING]; /*Flawfinder: ignore*/ |
2530 | char keyword[MAX_STRING]; /*Flawfinder: ignore*/ | 2665 | char keyword[MAX_STRING]; /*Flawfinder: ignore*/ |
2666 | static S32 item_count_total = 0; | ||
2531 | while(!feof(file) && fgets(buffer, MAX_STRING, file)) | 2667 | while(!feof(file) && fgets(buffer, MAX_STRING, file)) |
2532 | { | 2668 | { |
2533 | sscanf(buffer, " %254s", keyword); /* Flawfinder: ignore */ | 2669 | sscanf(buffer, " %254s", keyword); /* Flawfinder: ignore */ |
@@ -2552,16 +2688,17 @@ bool LLInventoryModel::loadFromFile(const std::string& filename, | |||
2552 | // *FIX: Need a better solution, this prevents the | 2688 | // *FIX: Need a better solution, this prevents the |
2553 | // application from freezing, but breaks inventory | 2689 | // application from freezing, but breaks inventory |
2554 | // caching. | 2690 | // caching. |
2555 | if(inv_item->getUUID().isNull()) | 2691 | //if(inv_item->getUUID().isNull())MCCABE |
2556 | { | 2692 | //{ |
2557 | //delete inv_item; // automatic when inv_cat is reassigned or destroyed | 2693 | // //delete inv_item; // automatic when inv_cat is reassigned or destroyed |
2558 | llwarns << "Ignoring inventory with null item id: " | 2694 | // llwarns << "Ignoring inventory with null item id: " |
2559 | << inv_item->getName() << llendl; | 2695 | // << inv_item->getName() << llendl; |
2560 | 2696 | // | |
2561 | } | 2697 | //} |
2562 | else | 2698 | //else |
2563 | { | 2699 | { |
2564 | items.put(inv_item); | 2700 | items.put(inv_item); |
2701 | item_count_total++; | ||
2565 | } | 2702 | } |
2566 | } | 2703 | } |
2567 | else | 2704 | else |
@@ -2576,6 +2713,7 @@ bool LLInventoryModel::loadFromFile(const std::string& filename, | |||
2576 | << llendl; | 2713 | << llendl; |
2577 | } | 2714 | } |
2578 | } | 2715 | } |
2716 | LL_DEBUGS("Inventory") << "Inventory items loaded from file: " << item_count_total << LL_ENDL; | ||
2579 | fclose(file); | 2717 | fclose(file); |
2580 | return true; | 2718 | return true; |
2581 | } | 2719 | } |
@@ -2598,6 +2736,9 @@ bool LLInventoryModel::saveToFile(const std::string& filename, | |||
2598 | return false; | 2736 | return false; |
2599 | } | 2737 | } |
2600 | 2738 | ||
2739 | static S32 count_total = 0; | ||
2740 | static S32 category_total = 0; | ||
2741 | |||
2601 | S32 count = categories.count(); | 2742 | S32 count = categories.count(); |
2602 | S32 i; | 2743 | S32 i; |
2603 | for(i = 0; i < count; ++i) | 2744 | for(i = 0; i < count; ++i) |
@@ -2606,6 +2747,7 @@ bool LLInventoryModel::saveToFile(const std::string& filename, | |||
2606 | if(cat->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN) | 2747 | if(cat->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN) |
2607 | { | 2748 | { |
2608 | cat->exportFileLocal(file); | 2749 | cat->exportFileLocal(file); |
2750 | category_total++; | ||
2609 | } | 2751 | } |
2610 | } | 2752 | } |
2611 | 2753 | ||
@@ -2613,8 +2755,11 @@ bool LLInventoryModel::saveToFile(const std::string& filename, | |||
2613 | for(i = 0; i < count; ++i) | 2755 | for(i = 0; i < count; ++i) |
2614 | { | 2756 | { |
2615 | items[i]->exportFile(file); | 2757 | items[i]->exportFile(file); |
2758 | count_total++; | ||
2616 | } | 2759 | } |
2617 | 2760 | ||
2761 | LL_DEBUGS("Inventory") << "Cached " << category_total << " categories and " << count_total << " inventory items" << LL_ENDL; | ||
2762 | |||
2618 | fclose(file); | 2763 | fclose(file); |
2619 | return true; | 2764 | return true; |
2620 | } | 2765 | } |
@@ -2709,8 +2854,8 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account) | |||
2709 | { | 2854 | { |
2710 | LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; | 2855 | LLPointer<LLViewerInventoryItem> titem = new LLViewerInventoryItem; |
2711 | titem->unpackMessage(msg, _PREHASH_InventoryData, i); | 2856 | titem->unpackMessage(msg, _PREHASH_InventoryData, i); |
2712 | lldebugs << "LLInventoryModel::messageUpdateCore() item id:" | 2857 | LL_DEBUGS("Inventory") << "LLInventoryModel::messageUpdateCore() item id:" |
2713 | << titem->getUUID() << llendl; | 2858 | << titem->getUUID() << LL_ENDL; |
2714 | items.push_back(titem); | 2859 | items.push_back(titem); |
2715 | // examine update for changes. | 2860 | // examine update for changes. |
2716 | LLViewerInventoryItem* itemp = gInventory.getItem(titem->getUUID()); | 2861 | LLViewerInventoryItem* itemp = gInventory.getItem(titem->getUUID()); |
@@ -2759,7 +2904,7 @@ bool LLInventoryModel::messageUpdateCore(LLMessageSystem* msg, bool account) | |||
2759 | // static | 2904 | // static |
2760 | void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**) | 2905 | void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**) |
2761 | { | 2906 | { |
2762 | lldebugs << "LLInventoryModel::processRemoveInventoryItem()" << llendl; | 2907 | LL_DEBUGS("Inventory") << "LLInventoryModel::processRemoveInventoryItem()" << LL_ENDL; |
2763 | LLUUID agent_id, item_id; | 2908 | LLUUID agent_id, item_id; |
2764 | msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); | 2909 | msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); |
2765 | if(agent_id != gAgent.getID()) | 2910 | if(agent_id != gAgent.getID()) |
@@ -2796,7 +2941,7 @@ void LLInventoryModel::processRemoveInventoryItem(LLMessageSystem* msg, void**) | |||
2796 | void LLInventoryModel::processUpdateInventoryFolder(LLMessageSystem* msg, | 2941 | void LLInventoryModel::processUpdateInventoryFolder(LLMessageSystem* msg, |
2797 | void**) | 2942 | void**) |
2798 | { | 2943 | { |
2799 | lldebugs << "LLInventoryModel::processUpdateInventoryFolder()" << llendl; | 2944 | LL_DEBUGS("Inventory") << "LLInventoryModel::processUpdateInventoryFolder()" << LL_ENDL; |
2800 | LLUUID agent_id, folder_id, parent_id; | 2945 | LLUUID agent_id, folder_id, parent_id; |
2801 | //char name[DB_INV_ITEM_NAME_BUF_SIZE]; | 2946 | //char name[DB_INV_ITEM_NAME_BUF_SIZE]; |
2802 | msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_AgentID, agent_id); | 2947 | msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_AgentID, agent_id); |
@@ -2856,7 +3001,7 @@ void LLInventoryModel::processUpdateInventoryFolder(LLMessageSystem* msg, | |||
2856 | void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg, | 3001 | void LLInventoryModel::processRemoveInventoryFolder(LLMessageSystem* msg, |
2857 | void**) | 3002 | void**) |
2858 | { | 3003 | { |
2859 | lldebugs << "LLInventoryModel::processRemoveInventoryFolder()" << llendl; | 3004 | LL_DEBUGS("Inventory") << "LLInventoryModel::processRemoveInventoryFolder()" << LL_ENDL; |
2860 | LLUUID agent_id, folder_id; | 3005 | LLUUID agent_id, folder_id; |
2861 | msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_AgentID, agent_id); | 3006 | msg->getUUIDFast(_PREHASH_FolderData, _PREHASH_AgentID, agent_id); |
2862 | if(agent_id != gAgent.getID()) | 3007 | if(agent_id != gAgent.getID()) |
@@ -2905,8 +3050,8 @@ void LLInventoryModel::processSaveAssetIntoInventory(LLMessageSystem* msg, | |||
2905 | // The viewer ignores the asset id because this message is only | 3050 | // The viewer ignores the asset id because this message is only |
2906 | // used for attachments/objects, so the asset id is not used in | 3051 | // used for attachments/objects, so the asset id is not used in |
2907 | // the viewer anyway. | 3052 | // the viewer anyway. |
2908 | lldebugs << "LLInventoryModel::processSaveAssetIntoInventory itemID=" | 3053 | LL_DEBUGS("Inventory") << "LLInventoryModel::processSaveAssetIntoInventory itemID=" |
2909 | << item_id << llendl; | 3054 | << item_id << LL_ENDL; |
2910 | LLViewerInventoryItem* item = gInventory.getItem( item_id ); | 3055 | LLViewerInventoryItem* item = gInventory.getItem( item_id ); |
2911 | if( item ) | 3056 | if( item ) |
2912 | { | 3057 | { |
@@ -3173,7 +3318,7 @@ void LLInventoryModel::processInventoryDescendents(LLMessageSystem* msg,void**) | |||
3173 | // static | 3318 | // static |
3174 | void LLInventoryModel::processMoveInventoryItem(LLMessageSystem* msg, void**) | 3319 | void LLInventoryModel::processMoveInventoryItem(LLMessageSystem* msg, void**) |
3175 | { | 3320 | { |
3176 | lldebugs << "LLInventoryModel::processMoveInventoryItem()" << llendl; | 3321 | LL_DEBUGS("Inventory") << "LLInventoryModel::processMoveInventoryItem()" << LL_ENDL; |
3177 | LLUUID agent_id; | 3322 | LLUUID agent_id; |
3178 | msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); | 3323 | msg->getUUIDFast(_PREHASH_AgentData, _PREHASH_AgentID, agent_id); |
3179 | if(agent_id != gAgent.getID()) | 3324 | if(agent_id != gAgent.getID()) |
@@ -3198,8 +3343,8 @@ void LLInventoryModel::processMoveInventoryItem(LLMessageSystem* msg, void**) | |||
3198 | msg->getUUIDFast(_PREHASH_InventoryData, _PREHASH_FolderID, folder_id, i); | 3343 | msg->getUUIDFast(_PREHASH_InventoryData, _PREHASH_FolderID, folder_id, i); |
3199 | msg->getString("InventoryData", "NewName", new_name, i); | 3344 | msg->getString("InventoryData", "NewName", new_name, i); |
3200 | 3345 | ||
3201 | lldebugs << "moving item " << item_id << " to folder " | 3346 | LL_DEBUGS("Inventory") << "moving item " << item_id << " to folder " |
3202 | << folder_id << llendl; | 3347 | << folder_id << LL_ENDL; |
3203 | update_list_t update; | 3348 | update_list_t update; |
3204 | LLCategoryUpdate old_folder(item->getParentUUID(), -1); | 3349 | LLCategoryUpdate old_folder(item->getParentUUID(), -1); |
3205 | update.push_back(old_folder); | 3350 | update.push_back(old_folder); |
@@ -3759,7 +3904,7 @@ void LLInventoryFetchComboObserver::fetch( | |||
3759 | const folder_ref_t& folder_ids, | 3904 | const folder_ref_t& folder_ids, |
3760 | const item_ref_t& item_ids) | 3905 | const item_ref_t& item_ids) |
3761 | { | 3906 | { |
3762 | lldebugs << "LLInventoryFetchComboObserver::fetch()" << llendl; | 3907 | LL_DEBUGS("Inventory") << "LLInventoryFetchComboObserver::fetch()" << LL_ENDL; |
3763 | for(folder_ref_t::const_iterator fit = folder_ids.begin(); fit != folder_ids.end(); ++fit) | 3908 | for(folder_ref_t::const_iterator fit = folder_ids.begin(); fit != folder_ids.end(); ++fit) |
3764 | { | 3909 | { |
3765 | LLViewerInventoryCategory* cat = gInventory.getCategory(*fit); | 3910 | LLViewerInventoryCategory* cat = gInventory.getCategory(*fit); |
@@ -3767,13 +3912,13 @@ void LLInventoryFetchComboObserver::fetch( | |||
3767 | if(!gInventory.isCategoryComplete(*fit)) | 3912 | if(!gInventory.isCategoryComplete(*fit)) |
3768 | { | 3913 | { |
3769 | cat->fetchDescendents(); | 3914 | cat->fetchDescendents(); |
3770 | lldebugs << "fetching folder " << *fit <<llendl; | 3915 | LL_DEBUGS("Inventory") << "fetching folder " << *fit << LL_ENDL; |
3771 | mIncompleteFolders.push_back(*fit); | 3916 | mIncompleteFolders.push_back(*fit); |
3772 | } | 3917 | } |
3773 | else | 3918 | else |
3774 | { | 3919 | { |
3775 | mCompleteFolders.push_back(*fit); | 3920 | mCompleteFolders.push_back(*fit); |
3776 | lldebugs << "completing folder " << *fit <<llendl; | 3921 | LL_DEBUGS("Inventory") << "completing folder " << *fit << LL_ENDL; |
3777 | } | 3922 | } |
3778 | } | 3923 | } |
3779 | 3924 | ||
@@ -3788,14 +3933,14 @@ void LLInventoryFetchComboObserver::fetch( | |||
3788 | LLViewerInventoryItem* item = gInventory.getItem(*iit); | 3933 | LLViewerInventoryItem* item = gInventory.getItem(*iit); |
3789 | if(!item) | 3934 | if(!item) |
3790 | { | 3935 | { |
3791 | lldebugs << "uanble to find item " << *iit << llendl; | 3936 | LL_DEBUGS("Inventory") << "uanble to find item " << *iit << LL_ENDL; |
3792 | continue; | 3937 | continue; |
3793 | } | 3938 | } |
3794 | if(item->isComplete()) | 3939 | if(item->isComplete()) |
3795 | { | 3940 | { |
3796 | // It's complete, so put it on the complete container. | 3941 | // It's complete, so put it on the complete container. |
3797 | mCompleteItems.push_back(*iit); | 3942 | mCompleteItems.push_back(*iit); |
3798 | lldebugs << "completing item " << *iit << llendl; | 3943 | LL_DEBUGS("Inventory") << "completing item " << *iit << LL_ENDL; |
3799 | continue; | 3944 | continue; |
3800 | } | 3945 | } |
3801 | else | 3946 | else |
@@ -3812,7 +3957,7 @@ void LLInventoryFetchComboObserver::fetch( | |||
3812 | } | 3957 | } |
3813 | else | 3958 | else |
3814 | { | 3959 | { |
3815 | lldebugs << "not worrying about " << *iit << llendl; | 3960 | LL_DEBUGS("Inventory") << "not worrying about " << *iit << LL_ENDL; |
3816 | } | 3961 | } |
3817 | } | 3962 | } |
3818 | fetch_items_from_llsd(items_llsd); | 3963 | fetch_items_from_llsd(items_llsd); |
diff --git a/linden/indra/newview/llinventorymodel.h b/linden/indra/newview/llinventorymodel.h index fee509b..7222c60 100644 --- a/linden/indra/newview/llinventorymodel.h +++ b/linden/indra/newview/llinventorymodel.h | |||
@@ -452,6 +452,9 @@ protected: | |||
452 | // cache recent lookups | 452 | // cache recent lookups |
453 | mutable LLPointer<LLViewerInventoryItem> mLastItem; | 453 | mutable LLPointer<LLViewerInventoryItem> mLastItem; |
454 | 454 | ||
455 | // UUID of the 'Animations' folder in 'My Inventory' | ||
456 | LLUUID mAnimationsFolderUUID; | ||
457 | |||
455 | // This last set of indices is used to map parents to children. | 458 | // This last set of indices is used to map parents to children. |
456 | typedef std::map<LLUUID, cat_array_t*> parent_cat_map_t; | 459 | typedef std::map<LLUUID, cat_array_t*> parent_cat_map_t; |
457 | typedef std::map<LLUUID, item_array_t*> parent_item_map_t; | 460 | typedef std::map<LLUUID, item_array_t*> parent_item_map_t; |
@@ -474,6 +477,8 @@ protected: | |||
474 | bool mIsAgentInvUsable; | 477 | bool mIsAgentInvUsable; |
475 | 478 | ||
476 | public: | 479 | public: |
480 | // Returns the UUID of the 'Animations' folder in 'My Inventory' sent from the server at startup | ||
481 | LLUUID getAnimationsFolderUUID() const { return mAnimationsFolderUUID; } | ||
477 | // *NOTE: DEBUG functionality | 482 | // *NOTE: DEBUG functionality |
478 | void dumpInventory(); | 483 | void dumpInventory(); |
479 | static bool isBulkFetchProcessingComplete(); | 484 | static bool isBulkFetchProcessingComplete(); |
diff --git a/linden/indra/newview/llinventoryview.cpp b/linden/indra/newview/llinventoryview.cpp index f8fb439..927d05c 100644 --- a/linden/indra/newview/llinventoryview.cpp +++ b/linden/indra/newview/llinventoryview.cpp | |||
@@ -491,7 +491,10 @@ LLInventoryView::LLInventoryView(const std::string& name, | |||
491 | LLFloater(name, rect, std::string("Inventory"), RESIZE_YES, | 491 | LLFloater(name, rect, std::string("Inventory"), RESIZE_YES, |
492 | INV_MIN_WIDTH, INV_MIN_HEIGHT, DRAG_ON_TOP, | 492 | INV_MIN_WIDTH, INV_MIN_HEIGHT, DRAG_ON_TOP, |
493 | MINIMIZE_NO, CLOSE_YES), | 493 | MINIMIZE_NO, CLOSE_YES), |
494 | mActivePanel(NULL) | 494 | mActivePanel(NULL), |
495 | mOldItemCount(-1), | ||
496 | mOldFilterText(""), | ||
497 | mFilterText("") | ||
495 | //LLHandle<LLFloater> mFinderHandle takes care of its own initialization | 498 | //LLHandle<LLFloater> mFinderHandle takes care of its own initialization |
496 | { | 499 | { |
497 | init(inventory); | 500 | init(inventory); |
@@ -681,12 +684,12 @@ LLInventoryView::~LLInventoryView( void ) | |||
681 | 684 | ||
682 | void LLInventoryView::draw() | 685 | void LLInventoryView::draw() |
683 | { | 686 | { |
684 | if (LLInventoryModel::isEverythingFetched()) | 687 | if (!LLInventoryModel::backgroundFetchActive()) |
685 | { | 688 | { |
686 | S32 item_count = gInventory.getItemCount(); | 689 | S32 item_count = gInventory.getItemCount(); |
687 | 690 | ||
688 | //don't let llfloater work more than necessary | 691 | //don't let llfloater work more than necessary |
689 | if (item_count != mOldItemCount || mOldFilterText != mFilterText) | 692 | if (item_count > mOldItemCount || mOldFilterText != mFilterText) |
690 | { | 693 | { |
691 | LLLocale locale(LLLocale::USER_LOCALE); | 694 | LLLocale locale(LLLocale::USER_LOCALE); |
692 | std::ostringstream title; | 695 | std::ostringstream title; |
@@ -696,11 +699,10 @@ void LLInventoryView::draw() | |||
696 | title << " (" << item_count_string << " items)"; | 699 | title << " (" << item_count_string << " items)"; |
697 | title << mFilterText; | 700 | title << mFilterText; |
698 | setTitle(title.str()); | 701 | setTitle(title.str()); |
699 | } | ||
700 | |||
701 | mOldFilterText = mFilterText; | ||
702 | mOldItemCount = item_count; | ||
703 | 702 | ||
703 | mOldFilterText = mFilterText; | ||
704 | mOldItemCount = item_count; | ||
705 | } | ||
704 | } | 706 | } |
705 | if (mActivePanel && mSearchEditor) | 707 | if (mActivePanel && mSearchEditor) |
706 | { | 708 | { |
@@ -798,6 +800,8 @@ void LLInventoryView::setVisible( BOOL visible ) | |||
798 | // Destroy all but the last floater, which is made invisible. | 800 | // Destroy all but the last floater, which is made invisible. |
799 | void LLInventoryView::onClose(bool app_quitting) | 801 | void LLInventoryView::onClose(bool app_quitting) |
800 | { | 802 | { |
803 | mOldItemCount = 0; | ||
804 | mOldFilterText = ""; | ||
801 | // S32 count = sActiveViews.count(); | 805 | // S32 count = sActiveViews.count(); |
802 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | 806 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) |
803 | // See LLInventoryView::closeAll() on why we're doing it this way | 807 | // See LLInventoryView::closeAll() on why we're doing it this way |
@@ -889,6 +893,12 @@ void LLInventoryView::changed(U32 mask) | |||
889 | } | 893 | } |
890 | else | 894 | else |
891 | { | 895 | { |
896 | // This is here because it gets called on login even when it shouldn't -- MC | ||
897 | LLLocale locale(LLLocale::USER_LOCALE); | ||
898 | std::string item_count_string; | ||
899 | LLResMgr::getInstance()->getIntegerString(item_count_string, gInventory.getItemCount()); | ||
900 | title << " (" << item_count_string << " items)"; | ||
901 | |||
892 | gSavedPerAccountSettings.setS32("InventoryPreviousCount", gInventory.getItemCount()); | 902 | gSavedPerAccountSettings.setS32("InventoryPreviousCount", gInventory.getItemCount()); |
893 | } | 903 | } |
894 | title << mFilterText; | 904 | title << mFilterText; |
diff --git a/linden/indra/newview/llinventoryview.h b/linden/indra/newview/llinventoryview.h index 3ec1e73..cc5106d 100644 --- a/linden/indra/newview/llinventoryview.h +++ b/linden/indra/newview/llinventoryview.h | |||
@@ -315,7 +315,7 @@ protected: | |||
315 | std::string mOldFilterText; | 315 | std::string mOldFilterText; |
316 | 316 | ||
317 | S32 mItemCount; | 317 | S32 mItemCount; |
318 | S32 mOldItemCount; | 318 | S32 mOldItemCount; |
319 | 319 | ||
320 | // This container is used to hold all active inventory views. This | 320 | // This container is used to hold all active inventory views. This |
321 | // is here to support the inventory toggle show button. | 321 | // is here to support the inventory toggle show button. |
diff --git a/linden/indra/newview/llmaniprotate.cpp b/linden/indra/newview/llmaniprotate.cpp index df503ec..77c8bd5 100644 --- a/linden/indra/newview/llmaniprotate.cpp +++ b/linden/indra/newview/llmaniprotate.cpp | |||
@@ -63,6 +63,8 @@ | |||
63 | #include "lldrawable.h" | 63 | #include "lldrawable.h" |
64 | #include "llglheaders.h" | 64 | #include "llglheaders.h" |
65 | 65 | ||
66 | #include "hippolimits.h" | ||
67 | |||
66 | const F32 RADIUS_PIXELS = 100.f; // size in screen space | 68 | const F32 RADIUS_PIXELS = 100.f; // size in screen space |
67 | const F32 SQ_RADIUS = RADIUS_PIXELS * RADIUS_PIXELS; | 69 | const F32 SQ_RADIUS = RADIUS_PIXELS * RADIUS_PIXELS; |
68 | const F32 WIDTH_PIXELS = 8; | 70 | const F32 WIDTH_PIXELS = 8; |
@@ -1124,9 +1126,9 @@ BOOL LLManipRotate::updateVisiblity() | |||
1124 | F32 z_dist = -1.f * (mCenterToCam * cameraAtAxis); | 1126 | F32 z_dist = -1.f * (mCenterToCam * cameraAtAxis); |
1125 | 1127 | ||
1126 | // Don't drag manip if object too far away | 1128 | // Don't drag manip if object too far away |
1127 | if (gSavedSettings.getBOOL("LimitSelectDistance")) | 1129 | if (!gSavedSettings.getBOOL("DisableMaxBuildConstraints") && gSavedSettings.getBOOL("LimitSelectDistance")) |
1128 | { | 1130 | { |
1129 | F32 max_select_distance = gSavedSettings.getF32("MaxSelectDistance"); | 1131 | F32 max_select_distance = gHippoLimits->getMaxSelectDistance(); |
1130 | if (dist_vec(gAgent.getPositionAgent(), center) > max_select_distance) | 1132 | if (dist_vec(gAgent.getPositionAgent(), center) > max_select_distance) |
1131 | { | 1133 | { |
1132 | visible = FALSE; | 1134 | visible = FALSE; |
diff --git a/linden/indra/newview/llmanipscale.cpp b/linden/indra/newview/llmanipscale.cpp index 0c79a35..fe6bc26 100644 --- a/linden/indra/newview/llmanipscale.cpp +++ b/linden/indra/newview/llmanipscale.cpp | |||
@@ -236,9 +236,9 @@ void LLManipScale::render() | |||
236 | range_from_agent = dist_vec(gAgent.getPositionAgent(), center_agent); | 236 | range_from_agent = dist_vec(gAgent.getPositionAgent(), center_agent); |
237 | 237 | ||
238 | // Don't draw manip if object too far away | 238 | // Don't draw manip if object too far away |
239 | if (gSavedSettings.getBOOL("LimitSelectDistance")) | 239 | if (!gSavedSettings.getBOOL("DisableMaxBuildConstraints") && gSavedSettings.getBOOL("LimitSelectDistance")) |
240 | { | 240 | { |
241 | F32 max_select_distance = gSavedSettings.getF32("MaxSelectDistance"); | 241 | F32 max_select_distance = gHippoLimits->getMaxSelectDistance(); |
242 | if (range_from_agent > max_select_distance) | 242 | if (range_from_agent > max_select_distance) |
243 | { | 243 | { |
244 | return; | 244 | return; |
diff --git a/linden/indra/newview/llmaniptranslate.cpp b/linden/indra/newview/llmaniptranslate.cpp index 82298dd..7a7233e 100644 --- a/linden/indra/newview/llmaniptranslate.cpp +++ b/linden/indra/newview/llmaniptranslate.cpp | |||
@@ -1821,9 +1821,9 @@ void LLManipTranslate::renderTranslationHandles() | |||
1821 | F32 range_from_agent = dist_vec(gAgent.getPositionAgent(), selection_center); | 1821 | F32 range_from_agent = dist_vec(gAgent.getPositionAgent(), selection_center); |
1822 | 1822 | ||
1823 | // Don't draw handles if you're too far away | 1823 | // Don't draw handles if you're too far away |
1824 | if (gSavedSettings.getBOOL("LimitSelectDistance")) | 1824 | if (!gSavedSettings.getBOOL("DisableMaxBuildConstraints") && gSavedSettings.getBOOL("LimitSelectDistance")) |
1825 | { | 1825 | { |
1826 | if (range_from_agent > gSavedSettings.getF32("MaxSelectDistance")) | 1826 | if (range_from_agent > gHippoLimits->getMaxSelectDistance()) |
1827 | { | 1827 | { |
1828 | return; | 1828 | return; |
1829 | } | 1829 | } |
diff --git a/linden/indra/newview/llpanelavatar.cpp b/linden/indra/newview/llpanelavatar.cpp index e3fe141..8854986 100644 --- a/linden/indra/newview/llpanelavatar.cpp +++ b/linden/indra/newview/llpanelavatar.cpp | |||
@@ -1004,6 +1004,15 @@ void LLPanelAvatarPicks::refresh() | |||
1004 | childSetVisible("Delete...", self && getPanelAvatar()->isEditable()); | 1004 | childSetVisible("Delete...", self && getPanelAvatar()->isEditable()); |
1005 | 1005 | ||
1006 | sendAvatarProfileRequestIfNeeded("avatarpicksrequest"); | 1006 | sendAvatarProfileRequestIfNeeded("avatarpicksrequest"); |
1007 | |||
1008 | for (int i = 0; i < tab_count; ++i) | ||
1009 | { | ||
1010 | LLTabContainer::LLTabTuple* tab = tabs->getTab(i); | ||
1011 | if (tab) | ||
1012 | { | ||
1013 | tab->mButton->setToolTip(tabs->getPanelTitle(i)); | ||
1014 | } | ||
1015 | } | ||
1007 | } | 1016 | } |
1008 | 1017 | ||
1009 | 1018 | ||
@@ -1951,29 +1960,37 @@ void LLPanelAvatar::processAvatarPropertiesReply(LLMessageSystem *msg, void**) | |||
1951 | self->mPanelSecondLife->childSetValue("acct", caption_text); | 1960 | self->mPanelSecondLife->childSetValue("acct", caption_text); |
1952 | 1961 | ||
1953 | //Chalice - Show avatar age in days. | 1962 | //Chalice - Show avatar age in days. |
1954 | S32 year; | 1963 | S32 year = 0; |
1955 | S32 month; | 1964 | S32 month = 0; |
1956 | S32 day; | 1965 | S32 day = 0; |
1957 | sscanf(born_on.c_str(), "%d/%d/%d", &month, &day, &year); | 1966 | sscanf(born_on.c_str(), "%d/%d/%d", &month, &day, &year); |
1958 | time_t now = time(NULL); | 1967 | if (year == 0 || month == 0 || day == 0) |
1959 | struct tm * timeinfo; | 1968 | { |
1960 | timeinfo = localtime(&now); | 1969 | // In case the string sent gets screwed up. It happens -- MC |
1961 | timeinfo->tm_mon = --month; | 1970 | born_on = self->mPanelSecondLife->getString("invalid"); |
1962 | timeinfo->tm_year = year - 1900; | 1971 | } |
1963 | timeinfo->tm_mday = day; | 1972 | else |
1964 | time_t birth = mktime(timeinfo); | 1973 | { |
1965 | 1974 | time_t now = time(NULL); | |
1966 | std::stringstream numberString; | 1975 | struct tm * timeinfo; |
1967 | S32 days = difftime(now, birth) / 86400; //(60*60*24) | 1976 | timeinfo = localtime(&now); |
1968 | if (days < 0) days = 0; // Happens for people on different timezones -- MC | 1977 | timeinfo->tm_mon = --month; |
1969 | numberString << days; | 1978 | timeinfo->tm_year = year - 1900; |
1970 | 1979 | timeinfo->tm_mday = day; | |
1971 | LLStringUtil::format_map_t targs; | 1980 | time_t birth = mktime(timeinfo); |
1972 | targs["[DAYS]"] = numberString.str(); | 1981 | |
1973 | std::string born_msg = self->mPanelSecondLife->getString("days_old_text"); | 1982 | std::stringstream numberString; |
1974 | LLStringUtil::format(born_msg, targs); | 1983 | S32 days = difftime(now, birth) / 86400; //(60*60*24) |
1975 | born_on += " "; | 1984 | if (days < 0) days = 0; // Happens for people on different timezones -- MC |
1976 | born_on += born_msg; | 1985 | numberString << days; |
1986 | |||
1987 | LLStringUtil::format_map_t targs; | ||
1988 | targs["[DAYS]"] = numberString.str(); | ||
1989 | std::string born_msg = self->mPanelSecondLife->getString("days_old_text"); | ||
1990 | LLStringUtil::format(born_msg, targs); | ||
1991 | born_on += " "; | ||
1992 | born_on += born_msg; | ||
1993 | } | ||
1977 | self->mPanelSecondLife->childSetValue("born", born_on); | 1994 | self->mPanelSecondLife->childSetValue("born", born_on); |
1978 | 1995 | ||
1979 | EOnlineStatus online_status = (online) ? ONLINE_STATUS_YES : ONLINE_STATUS_NO; | 1996 | EOnlineStatus online_status = (online) ? ONLINE_STATUS_YES : ONLINE_STATUS_NO; |
diff --git a/linden/indra/newview/llpanelgroupgeneral.cpp b/linden/indra/newview/llpanelgroupgeneral.cpp index 8c522cc..e466f05 100644 --- a/linden/indra/newview/llpanelgroupgeneral.cpp +++ b/linden/indra/newview/llpanelgroupgeneral.cpp | |||
@@ -38,6 +38,8 @@ | |||
38 | 38 | ||
39 | #include "lluictrlfactory.h" | 39 | #include "lluictrlfactory.h" |
40 | #include "llagent.h" | 40 | #include "llagent.h" |
41 | #include "llchat.h" | ||
42 | #include "llfloaterchat.h" | ||
41 | #include "roles_constants.h" | 43 | #include "roles_constants.h" |
42 | #include "llfloateravatarinfo.h" | 44 | #include "llfloateravatarinfo.h" |
43 | #include "llfloatergroupinfo.h" | 45 | #include "llfloatergroupinfo.h" |
@@ -56,6 +58,7 @@ | |||
56 | #include "lltextbox.h" | 58 | #include "lltextbox.h" |
57 | #include "lltexteditor.h" | 59 | #include "lltexteditor.h" |
58 | #include "lltexturectrl.h" | 60 | #include "lltexturectrl.h" |
61 | #include "llurldispatcher.h" | ||
59 | #include "llviewercontrol.h" | 62 | #include "llviewercontrol.h" |
60 | #include "llviewerwindow.h" | 63 | #include "llviewerwindow.h" |
61 | 64 | ||
@@ -144,6 +147,13 @@ BOOL LLPanelGroupGeneral::postBuild() | |||
144 | mBtnInfo->setCallbackUserData(this); | 147 | mBtnInfo->setCallbackUserData(this); |
145 | } | 148 | } |
146 | 149 | ||
150 | mBtnCopyLink = getChild<LLButton>("copy_link_button", recurse); | ||
151 | if ( mBtnCopyLink ) | ||
152 | { | ||
153 | mBtnCopyLink->setClickedCallback(onClickCopyLink); | ||
154 | mBtnCopyLink->setCallbackUserData(this); | ||
155 | } | ||
156 | |||
147 | LLTextBox* founder = getChild<LLTextBox>("founder_name"); | 157 | LLTextBox* founder = getChild<LLTextBox>("founder_name"); |
148 | if (founder) | 158 | if (founder) |
149 | { | 159 | { |
@@ -269,6 +279,7 @@ BOOL LLPanelGroupGeneral::postBuild() | |||
269 | 279 | ||
270 | mBtnJoinGroup->setVisible(FALSE); | 280 | mBtnJoinGroup->setVisible(FALSE); |
271 | mBtnInfo->setVisible(FALSE); | 281 | mBtnInfo->setVisible(FALSE); |
282 | mBtnCopyLink->setVisible(FALSE); | ||
272 | mGroupName->setVisible(FALSE); | 283 | mGroupName->setVisible(FALSE); |
273 | } | 284 | } |
274 | 285 | ||
@@ -404,6 +415,39 @@ bool LLPanelGroupGeneral::joinDlgCB(const LLSD& notification, const LLSD& respon | |||
404 | } | 415 | } |
405 | 416 | ||
406 | // static | 417 | // static |
418 | void LLPanelGroupGeneral::onClickCopyLink(void* userdata) | ||
419 | { | ||
420 | LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)userdata; | ||
421 | |||
422 | if (!self || (self->mGroupID).isNull()) return; | ||
423 | |||
424 | LLGroupMgrGroupData* gdatap = LLGroupMgr::getInstance()->getGroupData(self->mGroupID); | ||
425 | |||
426 | // make sure we don't have junk | ||
427 | if (gdatap) | ||
428 | { | ||
429 | std::string buffer = LLURLDispatcher::createGroupJoinLink(gdatap->getID()); | ||
430 | |||
431 | // Say same info in chat -- MC | ||
432 | LLStringUtil::format_map_t targs; | ||
433 | targs["[SLURL]"] = buffer; | ||
434 | std::string msg = self->getString("copy_group_link_info"); | ||
435 | LLStringUtil::format(msg, targs); | ||
436 | |||
437 | LLChat chat; | ||
438 | chat.mSourceType = CHAT_SOURCE_SYSTEM; | ||
439 | chat.mText = msg; | ||
440 | LLFloaterChat::addChat(chat); | ||
441 | |||
442 | gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(buffer)); | ||
443 | } | ||
444 | else | ||
445 | { | ||
446 | llwarns << "Trying to copy group slurl link with no group data!" << llendl; | ||
447 | } | ||
448 | } | ||
449 | |||
450 | // static | ||
407 | void LLPanelGroupGeneral::openProfile(void* data) | 451 | void LLPanelGroupGeneral::openProfile(void* data) |
408 | { | 452 | { |
409 | LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data; | 453 | LLPanelGroupGeneral* self = (LLPanelGroupGeneral*)data; |
diff --git a/linden/indra/newview/llpanelgroupgeneral.h b/linden/indra/newview/llpanelgroupgeneral.h index c4572e2..9e39125 100644 --- a/linden/indra/newview/llpanelgroupgeneral.h +++ b/linden/indra/newview/llpanelgroupgeneral.h | |||
@@ -76,6 +76,7 @@ private: | |||
76 | static void onClickInfo(void* userdata); | 76 | static void onClickInfo(void* userdata); |
77 | static void onReceiveNotices(LLUICtrl* ctrl, void* data); | 77 | static void onReceiveNotices(LLUICtrl* ctrl, void* data); |
78 | static void openProfile(void* data); | 78 | static void openProfile(void* data); |
79 | static void onClickCopyLink(void* userdata); | ||
79 | 80 | ||
80 | static bool joinDlgCB(const LLSD& notification, const LLSD& response); | 81 | static bool joinDlgCB(const LLSD& notification, const LLSD& response); |
81 | 82 | ||
@@ -98,6 +99,7 @@ private: | |||
98 | LLTextEditor *mEditCharter; | 99 | LLTextEditor *mEditCharter; |
99 | LLButton *mBtnJoinGroup; | 100 | LLButton *mBtnJoinGroup; |
100 | LLButton *mBtnInfo; | 101 | LLButton *mBtnInfo; |
102 | LLButton *mBtnCopyLink; | ||
101 | 103 | ||
102 | LLNameListCtrl *mListVisibleMembers; | 104 | LLNameListCtrl *mListVisibleMembers; |
103 | 105 | ||
diff --git a/linden/indra/newview/llprefsadvanced.cpp b/linden/indra/newview/llprefsadvanced.cpp index a9500f7..087acc9 100644 --- a/linden/indra/newview/llprefsadvanced.cpp +++ b/linden/indra/newview/llprefsadvanced.cpp | |||
@@ -48,6 +48,9 @@ | |||
48 | LLPrefsAdvanced* LLPrefsAdvanced::sInstance; | 48 | LLPrefsAdvanced* LLPrefsAdvanced::sInstance; |
49 | 49 | ||
50 | LLPrefsAdvanced::LLPrefsAdvanced() | 50 | LLPrefsAdvanced::LLPrefsAdvanced() |
51 | : | ||
52 | mWLControl(FALSE), | ||
53 | mAOControl(FALSE) | ||
51 | { | 54 | { |
52 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_advanced.xml"); | 55 | LLUICtrlFactory::getInstance()->buildPanel(this, "panel_preferences_advanced.xml"); |
53 | if(sInstance)delete sInstance; | 56 | if(sInstance)delete sInstance; |
@@ -99,6 +102,10 @@ BOOL LLPrefsAdvanced::postBuild() | |||
99 | childSetValue("show_timestamps_check", gSavedSettings.getBOOL("ShowTimestamps")); | 102 | childSetValue("show_timestamps_check", gSavedSettings.getBOOL("ShowTimestamps")); |
100 | childSetValue("arrow_keys_move_avatar_check", gSavedSettings.getBOOL("ArrowKeysMoveAvatar")); | 103 | childSetValue("arrow_keys_move_avatar_check", gSavedSettings.getBOOL("ArrowKeysMoveAvatar")); |
101 | 104 | ||
105 | static BOOL *sEnableAORemote = rebind_llcontrol<BOOL>("EnableAORemote", &gSavedSettings, true); | ||
106 | childSetValue("ao_remote_check", *sEnableAORemote); | ||
107 | mAOControl = (*sEnableAORemote); | ||
108 | |||
102 | refresh(); | 109 | refresh(); |
103 | 110 | ||
104 | return TRUE; | 111 | return TRUE; |
@@ -198,6 +205,9 @@ void LLPrefsAdvanced::apply() | |||
198 | gSavedSettings.setBOOL("ArrowKeysMoveAvatar", childGetValue("arrow_keys_move_avatar_check")); | 205 | gSavedSettings.setBOOL("ArrowKeysMoveAvatar", childGetValue("arrow_keys_move_avatar_check")); |
199 | gSavedSettings.setBOOL("ScriptErrorsAsChat", childGetValue("script_errors_as_chat")); | 206 | gSavedSettings.setBOOL("ScriptErrorsAsChat", childGetValue("script_errors_as_chat")); |
200 | gSavedSettings.setBOOL("ShowTimestamps", childGetValue("show_timestamps_check")); | 207 | gSavedSettings.setBOOL("ShowTimestamps", childGetValue("show_timestamps_check")); |
208 | |||
209 | static BOOL *sEnableAORemote = rebind_llcontrol<BOOL>("EnableAORemote", &gSavedSettings, true); | ||
210 | mAOControl = *sEnableAORemote; | ||
201 | } | 211 | } |
202 | 212 | ||
203 | void LLPrefsAdvanced::cancel() | 213 | void LLPrefsAdvanced::cancel() |
@@ -208,6 +218,7 @@ void LLPrefsAdvanced::cancel() | |||
208 | // LLVOAvatar::sCloud.mPartData.mEndColor = mCloudEndColor; | 218 | // LLVOAvatar::sCloud.mPartData.mEndColor = mCloudEndColor; |
209 | 219 | ||
210 | gSavedSettings.setBOOL("EnableWindlightRemote", mWLControl); | 220 | gSavedSettings.setBOOL("EnableWindlightRemote", mWLControl); |
221 | gSavedSettings.setBOOL("EnableAORemote", mAOControl); | ||
211 | } | 222 | } |
212 | 223 | ||
213 | void LLPrefsAdvanced::refresh() | 224 | void LLPrefsAdvanced::refresh() |
diff --git a/linden/indra/newview/llprefsadvanced.h b/linden/indra/newview/llprefsadvanced.h index b863db3..9f02cbf 100644 --- a/linden/indra/newview/llprefsadvanced.h +++ b/linden/indra/newview/llprefsadvanced.h | |||
@@ -64,6 +64,7 @@ private: | |||
64 | LLColor4 mCloudEndColor; | 64 | LLColor4 mCloudEndColor; |
65 | LLUUID mCloudTextureID; | 65 | LLUUID mCloudTextureID; |
66 | BOOL mWLControl; | 66 | BOOL mWLControl; |
67 | BOOL mAOControl; | ||
67 | }; | 68 | }; |
68 | 69 | ||
69 | #endif // LLPREFSADVANCED_H | 70 | #endif // LLPREFSADVANCED_H |
diff --git a/linden/indra/newview/llselectmgr.cpp b/linden/indra/newview/llselectmgr.cpp index 7d573ea..f6f294a 100644 --- a/linden/indra/newview/llselectmgr.cpp +++ b/linden/indra/newview/llselectmgr.cpp | |||
@@ -92,6 +92,8 @@ | |||
92 | 92 | ||
93 | #include "llglheaders.h" | 93 | #include "llglheaders.h" |
94 | 94 | ||
95 | #include "hippolimits.h" | ||
96 | |||
95 | // [RLVa:KB] | 97 | // [RLVa:KB] |
96 | #include "rlvhandler.h" | 98 | #include "rlvhandler.h" |
97 | // [/RLVa:KB] | 99 | // [/RLVa:KB] |
@@ -3495,15 +3497,15 @@ void LLSelectMgr::deselectAllIfTooFar() | |||
3495 | // if (gSavedSettings.getBOOL("LimitSelectDistance") | 3497 | // if (gSavedSettings.getBOOL("LimitSelectDistance") |
3496 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f | 3498 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f |
3497 | BOOL fRlvFartouch = gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH) && gFloaterTools->getVisible(); | 3499 | BOOL fRlvFartouch = gRlvHandler.hasBehaviour(RLV_BHVR_FARTOUCH) && gFloaterTools->getVisible(); |
3498 | if ( (gSavedSettings.getBOOL("LimitSelectDistance") || (fRlvFartouch) ) | 3500 | if ( ((!gSavedSettings.getBOOL("DisableMaxBuildConstraints") && gSavedSettings.getBOOL("LimitSelectDistance")) || (fRlvFartouch) ) |
3499 | // [/RLVa:KB] | 3501 | // [/RLVa:KB] |
3500 | && (!mSelectedObjects->getPrimaryObject() || !mSelectedObjects->getPrimaryObject()->isAvatar()) | 3502 | && (!mSelectedObjects->getPrimaryObject() || !mSelectedObjects->getPrimaryObject()->isAvatar()) |
3501 | && !mSelectedObjects->isAttachment() | 3503 | && !mSelectedObjects->isAttachment() |
3502 | && !selectionCenter.isExactlyZero()) | 3504 | && !selectionCenter.isExactlyZero()) |
3503 | { | 3505 | { |
3504 | // F32 deselect_dist = gSavedSettings.getF32("MaxSelectDistance"); | 3506 | // F32 deselect_dist = gHippoLimits->getMaxSelectDistance(); |
3505 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f | 3507 | // [RLVa:KB] - Checked: 2009-07-10 (RLVa-1.0.0g) | Modified: RLVa-0.2.0f |
3506 | F32 deselect_dist = (!fRlvFartouch) ? gSavedSettings.getF32("MaxSelectDistance") : 1.5f; | 3508 | F32 deselect_dist = (!fRlvFartouch) ? gHippoLimits->getMaxSelectDistance() : 1.5f; |
3507 | // [/RLVa:KB] | 3509 | // [/RLVa:KB] |
3508 | F32 deselect_dist_sq = deselect_dist * deselect_dist; | 3510 | F32 deselect_dist_sq = deselect_dist * deselect_dist; |
3509 | 3511 | ||
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index 428596b..dcaa249 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -2457,6 +2457,22 @@ bool idle_startup() | |||
2457 | } | 2457 | } |
2458 | } | 2458 | } |
2459 | 2459 | ||
2460 | // start background fetching for animations here in case the cache is empty. | ||
2461 | // We do this to improve AO support (that's Animatoni Overrider, not LL's | ||
2462 | // silly "AO" acronym -- MC | ||
2463 | if (gSavedSettings.getBOOL("FetchInventoryOnLogin2")) | ||
2464 | { | ||
2465 | // Start loading inventory | ||
2466 | if (gInventory.getAnimationsFolderUUID() != LLUUID::null) | ||
2467 | { | ||
2468 | gInventory.startBackgroundFetch(gInventory.getAnimationsFolderUUID()); | ||
2469 | } | ||
2470 | else | ||
2471 | { | ||
2472 | gInventory.startBackgroundFetch(); | ||
2473 | } | ||
2474 | } | ||
2475 | |||
2460 | options.clear(); | 2476 | options.clear(); |
2461 | if(LLUserAuth::getInstance()->getOptions("buddy-list", options)) | 2477 | if(LLUserAuth::getInstance()->getOptions("buddy-list", options)) |
2462 | { | 2478 | { |
@@ -2583,19 +2599,6 @@ bool idle_startup() | |||
2583 | llinfos << "Requesting Agent Data" << llendl; | 2599 | llinfos << "Requesting Agent Data" << llendl; |
2584 | gAgent.sendAgentDataUpdateRequest(); | 2600 | gAgent.sendAgentDataUpdateRequest(); |
2585 | 2601 | ||
2586 | bool shown_at_exit = gSavedSettings.getBOOL("ShowInventory"); | ||
2587 | |||
2588 | // Create the inventory views | ||
2589 | llinfos << "Creating Inventory Views" << llendl; | ||
2590 | LLInventoryView::showAgentInventory(); | ||
2591 | llinfos << "Inventory Views Created" << llendl; | ||
2592 | |||
2593 | // Hide the inventory if it wasn't shown at exit | ||
2594 | if(!shown_at_exit) | ||
2595 | { | ||
2596 | LLInventoryView::toggleVisibility(NULL); | ||
2597 | } | ||
2598 | |||
2599 | // [RLVa:KB] - Checked: 2009-11-27 (RLVa-1.1.0f) | Added: RLVa-1.1.0f | 2602 | // [RLVa:KB] - Checked: 2009-11-27 (RLVa-1.1.0f) | Added: RLVa-1.1.0f |
2600 | if (rlv_handler_t::isEnabled()) | 2603 | if (rlv_handler_t::isEnabled()) |
2601 | { | 2604 | { |
@@ -2917,12 +2920,6 @@ bool idle_startup() | |||
2917 | gStatusBar->updateElements(); | 2920 | gStatusBar->updateElements(); |
2918 | } | 2921 | } |
2919 | 2922 | ||
2920 | // Start the AO now that settings have loaded and login successful -- MC | ||
2921 | if (!gAOInvTimer) | ||
2922 | { | ||
2923 | gAOInvTimer = new AOInvTimer(); | ||
2924 | } | ||
2925 | |||
2926 | LLFirstUse::ClientTags(); | 2923 | LLFirstUse::ClientTags(); |
2927 | #if USE_OTR // [$PLOTR$] | 2924 | #if USE_OTR // [$PLOTR$] |
2928 | LLFirstUse::EmeraldOTR(); | 2925 | LLFirstUse::EmeraldOTR(); |
@@ -2959,12 +2956,6 @@ bool idle_startup() | |||
2959 | // Have the agent start watching the friends list so we can update proxies | 2956 | // Have the agent start watching the friends list so we can update proxies |
2960 | gAgent.observeFriends(); | 2957 | gAgent.observeFriends(); |
2961 | 2958 | ||
2962 | if (gSavedSettings.getBOOL("FetchInventoryOnLogin")) | ||
2963 | { | ||
2964 | // Start loading inventory | ||
2965 | gInventory.startBackgroundFetch(); | ||
2966 | } | ||
2967 | |||
2968 | if (gSavedSettings.getBOOL("LoginAsGod")) | 2959 | if (gSavedSettings.getBOOL("LoginAsGod")) |
2969 | { | 2960 | { |
2970 | gAgent.requestEnterGodMode(); | 2961 | gAgent.requestEnterGodMode(); |
@@ -2993,6 +2984,23 @@ bool idle_startup() | |||
2993 | // Clean up the userauth stuff. | 2984 | // Clean up the userauth stuff. |
2994 | LLUserAuth::getInstance()->reset(); | 2985 | LLUserAuth::getInstance()->reset(); |
2995 | 2986 | ||
2987 | // Show the inventory if it was shown at exit | ||
2988 | // Don't do this before here or we screw up inv loading -- MC | ||
2989 | if (gSavedSettings.getBOOL("ShowInventory")) | ||
2990 | { | ||
2991 | // Create the inventory views | ||
2992 | llinfos << "Creating Inventory Views" << llendl; | ||
2993 | LLInventoryView::showAgentInventory(); | ||
2994 | llinfos << "Inventory Views Created" << llendl; | ||
2995 | //LLInventoryView::toggleVisibility(NULL); | ||
2996 | } | ||
2997 | |||
2998 | // Init the AO now that settings have loaded and login successful -- MC | ||
2999 | if (!gAOInvTimer) | ||
3000 | { | ||
3001 | gAOInvTimer = new AOInvTimer(); | ||
3002 | } | ||
3003 | |||
2996 | LLStartUp::setStartupState( STATE_STARTED ); | 3004 | LLStartUp::setStartupState( STATE_STARTED ); |
2997 | LLStartUp::setStartedOnce(true); | 3005 | LLStartUp::setStartedOnce(true); |
2998 | LLStartUp::setLoginFailed(false); | 3006 | LLStartUp::setLoginFailed(false); |
diff --git a/linden/indra/newview/lltoolplacer.cpp b/linden/indra/newview/lltoolplacer.cpp index bd37832..c8a7891 100644 --- a/linden/indra/newview/lltoolplacer.cpp +++ b/linden/indra/newview/lltoolplacer.cpp | |||
@@ -69,6 +69,8 @@ | |||
69 | #include "llviewerparcelmgr.h" // RezWithLandGroup | 69 | #include "llviewerparcelmgr.h" // RezWithLandGroup |
70 | #include "roles_constants.h" // Ele: Land Group Override | 70 | #include "roles_constants.h" // Ele: Land Group Override |
71 | 71 | ||
72 | #include "hippolimits.h" | ||
73 | |||
72 | // [RLVa:KB] | 74 | // [RLVa:KB] |
73 | #include "rlvhandler.h" | 75 | #include "rlvhandler.h" |
74 | // [/RLVa:KB] | 76 | // [/RLVa:KB] |
@@ -86,7 +88,7 @@ LLToolPlacer::LLToolPlacer() | |||
86 | BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, S32* hit_face, | 88 | BOOL LLToolPlacer::raycastForNewObjPos( S32 x, S32 y, LLViewerObject** hit_obj, S32* hit_face, |
87 | BOOL* b_hit_land, LLVector3* ray_start_region, LLVector3* ray_end_region, LLViewerRegion** region ) | 89 | BOOL* b_hit_land, LLVector3* ray_start_region, LLVector3* ray_end_region, LLViewerRegion** region ) |
88 | { | 90 | { |
89 | F32 max_dist_from_camera = gSavedSettings.getF32( "MaxSelectDistance" ) - 1.f; | 91 | F32 max_dist_from_camera = gHippoLimits->getMaxSelectDistance() - 1.f; |
90 | 92 | ||
91 | // Viewer-side pick to find the right sim to create the object on. | 93 | // Viewer-side pick to find the right sim to create the object on. |
92 | // First find the surface the object will be created on. | 94 | // First find the surface the object will be created on. |
diff --git a/linden/indra/newview/llurldispatcher.cpp b/linden/indra/newview/llurldispatcher.cpp index 1144c58..526c682 100644 --- a/linden/indra/newview/llurldispatcher.cpp +++ b/linden/indra/newview/llurldispatcher.cpp | |||
@@ -374,6 +374,18 @@ std::string LLURLDispatcherImpl::stripProtocol(const std::string& url) | |||
374 | return stripped; | 374 | return stripped; |
375 | } | 375 | } |
376 | 376 | ||
377 | // static | ||
378 | std::string LLURLDispatcher::createGroupJoinLink(const LLUUID& group_id) | ||
379 | { | ||
380 | std::string slurl = ""; | ||
381 | if (group_id.notNull()) | ||
382 | { | ||
383 | //secondlife:///app/group/uuid/about | ||
384 | slurl = SLURL_SECONDLIFE_PREFIX + "/" + SLURL_APP_TOKEN + "group/" + group_id.asString() + "/about"; | ||
385 | } | ||
386 | return slurl; | ||
387 | } | ||
388 | |||
377 | //--------------------------------------------------------------------------- | 389 | //--------------------------------------------------------------------------- |
378 | // Teleportation links are handled here because they are tightly coupled | 390 | // Teleportation links are handled here because they are tightly coupled |
379 | // to URL parsing and sim-fragment parsing | 391 | // to URL parsing and sim-fragment parsing |
diff --git a/linden/indra/newview/llurldispatcher.h b/linden/indra/newview/llurldispatcher.h index ead1480..8a08127 100644 --- a/linden/indra/newview/llurldispatcher.h +++ b/linden/indra/newview/llurldispatcher.h | |||
@@ -66,6 +66,8 @@ public: | |||
66 | 66 | ||
67 | static std::string buildSLURL(const std::string& regionname, S32 x, S32 y, S32 z); | 67 | static std::string buildSLURL(const std::string& regionname, S32 x, S32 y, S32 z); |
68 | // builds: http://slurl.com/secondlife/RegionName/x/y/z/ | 68 | // builds: http://slurl.com/secondlife/RegionName/x/y/z/ |
69 | |||
70 | static std::string createGroupJoinLink(const LLUUID& group_id); | ||
69 | }; | 71 | }; |
70 | 72 | ||
71 | #endif | 73 | #endif |
diff --git a/linden/indra/newview/llviewercamera.cpp b/linden/indra/newview/llviewercamera.cpp index 16f6e57..fecab65 100644 --- a/linden/indra/newview/llviewercamera.cpp +++ b/linden/indra/newview/llviewercamera.cpp | |||
@@ -51,6 +51,8 @@ | |||
51 | #include "lltoolmgr.h" | 51 | #include "lltoolmgr.h" |
52 | #include "llviewerjoystick.h" | 52 | #include "llviewerjoystick.h" |
53 | 53 | ||
54 | #include "hippolimits.h" | ||
55 | |||
54 | //glu pick matrix implementation borrowed from Mesa3D | 56 | //glu pick matrix implementation borrowed from Mesa3D |
55 | glh::matrix4f gl_pick_matrix(GLfloat x, GLfloat y, GLfloat width, GLfloat height, GLint* viewport) | 57 | glh::matrix4f gl_pick_matrix(GLfloat x, GLfloat y, GLfloat width, GLfloat height, GLint* viewport) |
56 | { | 58 | { |
@@ -334,7 +336,7 @@ void LLViewerCamera::setPerspective(BOOL for_selection, | |||
334 | if (limit_select_distance) | 336 | if (limit_select_distance) |
335 | { | 337 | { |
336 | // ...select distance from control | 338 | // ...select distance from control |
337 | z_far = gSavedSettings.getF32("MaxSelectDistance"); | 339 | z_far = gHippoLimits->getMaxSelectDistance(); |
338 | } | 340 | } |
339 | else | 341 | else |
340 | { | 342 | { |
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 9b5c687..09065db 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -2494,7 +2494,7 @@ class LLObjectEnableExport : public view_listener_t | |||
2494 | { | 2494 | { |
2495 | virtual bool apply(LLSelectNode* node) | 2495 | virtual bool apply(LLSelectNode* node) |
2496 | { | 2496 | { |
2497 | return primbackup::check_perms( node ); | 2497 | return PrimBackup::validatePerms(node->mPermissions); |
2498 | } | 2498 | } |
2499 | } func; | 2499 | } func; |
2500 | 2500 | ||
@@ -2521,7 +2521,7 @@ class LLObjectExport : public view_listener_t | |||
2521 | 2521 | ||
2522 | if (!avatar) | 2522 | if (!avatar) |
2523 | { | 2523 | { |
2524 | primbackup::getInstance()->pre_export_object(); | 2524 | PrimBackup::getInstance()->exportObject(); |
2525 | } | 2525 | } |
2526 | 2526 | ||
2527 | return true; | 2527 | return true; |
@@ -2542,7 +2542,7 @@ class LLObjectImport : public view_listener_t | |||
2542 | { | 2542 | { |
2543 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2543 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2544 | { | 2544 | { |
2545 | primbackup::getInstance()->import_object(FALSE); | 2545 | PrimBackup::getInstance()->importObject(FALSE); |
2546 | return true; | 2546 | return true; |
2547 | } | 2547 | } |
2548 | }; | 2548 | }; |
@@ -2551,7 +2551,7 @@ class LLObjectImportUpload : public view_listener_t | |||
2551 | { | 2551 | { |
2552 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 2552 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
2553 | { | 2553 | { |
2554 | primbackup::getInstance()->import_object(TRUE); | 2554 | PrimBackup::getInstance()->importObject(TRUE); |
2555 | return true; | 2555 | return true; |
2556 | } | 2556 | } |
2557 | }; | 2557 | }; |
@@ -8329,7 +8329,7 @@ class LLViewCheckAO: public view_listener_t | |||
8329 | { | 8329 | { |
8330 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | 8330 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) |
8331 | { | 8331 | { |
8332 | gMenuHolder->findControl(userdata["control"].asString())->setValue(LLFloaterAO::getInstance()); | 8332 | gMenuHolder->findControl(userdata["control"].asString())->setValue(LLFloaterAO::getVisible()); |
8333 | return true; | 8333 | return true; |
8334 | } | 8334 | } |
8335 | }; | 8335 | }; |
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 3e686f4..858137a 100755 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp | |||
@@ -938,7 +938,7 @@ void open_offer(const std::vector<LLUUID>& items, const std::string& from_name) | |||
938 | } | 938 | } |
939 | break; | 939 | break; |
940 | case LLAssetType::AT_LANDMARK: | 940 | case LLAssetType::AT_LANDMARK: |
941 | if (!show_keep_discard) | 941 | if (show_keep_discard) |
942 | open_landmark((LLViewerInventoryItem*)item, std::string("Landmark: ") + item->getName(), FALSE, LLUUID::null, FALSE); | 942 | open_landmark((LLViewerInventoryItem*)item, std::string("Landmark: ") + item->getName(), FALSE, LLUUID::null, FALSE); |
943 | break; | 943 | break; |
944 | case LLAssetType::AT_TEXTURE: | 944 | case LLAssetType::AT_TEXTURE: |
@@ -3953,10 +3953,10 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) | |||
3953 | return; | 3953 | return; |
3954 | } | 3954 | } |
3955 | 3955 | ||
3956 | gHippoLimits->setLimits(); | ||
3957 | |||
3956 | if (!gLastVersionChannel.empty()) | 3958 | if (!gLastVersionChannel.empty()) |
3957 | { | 3959 | { |
3958 | gHippoLimits->setLimits(); | ||
3959 | |||
3960 | if (gSavedSettings.getBOOL("ServerVersionChangedChat")) | 3960 | if (gSavedSettings.getBOOL("ServerVersionChangedChat")) |
3961 | { | 3961 | { |
3962 | LLStringUtil::format_map_t args; | 3962 | LLStringUtil::format_map_t args; |
diff --git a/linden/indra/newview/llviewerobjectlist.cpp b/linden/indra/newview/llviewerobjectlist.cpp index 2d6c9f4..ad92fe3 100644 --- a/linden/indra/newview/llviewerobjectlist.cpp +++ b/linden/indra/newview/llviewerobjectlist.cpp | |||
@@ -242,7 +242,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, | |||
242 | updateActive(objectp); | 242 | updateActive(objectp); |
243 | 243 | ||
244 | if(!just_created) | 244 | if(!just_created) |
245 | primbackup::getInstance()->prim_update(objectp); | 245 | PrimBackup::getInstance()->primUpdate(objectp); |
246 | 246 | ||
247 | 247 | ||
248 | 248 | ||
@@ -276,7 +276,7 @@ void LLViewerObjectList::processUpdateCore(LLViewerObject* objectp, | |||
276 | gViewerWindow->getWindow()->decBusyCount(); | 276 | gViewerWindow->getWindow()->decBusyCount(); |
277 | gViewerWindow->getWindow()->setCursor( UI_CURSOR_ARROW ); | 277 | gViewerWindow->getWindow()->setCursor( UI_CURSOR_ARROW ); |
278 | 278 | ||
279 | primbackup::getInstance()->newprim(objectp); | 279 | PrimBackup::getInstance()->newPrim(objectp); |
280 | 280 | ||
281 | } | 281 | } |
282 | } | 282 | } |
diff --git a/linden/indra/newview/llviewerregion.cpp b/linden/indra/newview/llviewerregion.cpp index eba0db7..a43e0c0 100644 --- a/linden/indra/newview/llviewerregion.cpp +++ b/linden/indra/newview/llviewerregion.cpp | |||
@@ -1439,12 +1439,14 @@ void LLViewerRegion::setSeedCapability(const std::string& url) | |||
1439 | capabilityNames.append("FetchLibDescendents"); | 1439 | capabilityNames.append("FetchLibDescendents"); |
1440 | capabilityNames.append("GetDisplayNames"); | 1440 | capabilityNames.append("GetDisplayNames"); |
1441 | capabilityNames.append("SetDisplayName"); | 1441 | capabilityNames.append("SetDisplayName"); |
1442 | capabilityNames.append("GetMesh"); // lets us know if this is a SL-Mesh region | ||
1442 | capabilityNames.append("GetTexture"); | 1443 | capabilityNames.append("GetTexture"); |
1443 | capabilityNames.append("GroupProposalBallot"); | 1444 | capabilityNames.append("GroupProposalBallot"); |
1444 | capabilityNames.append("HomeLocation"); | 1445 | capabilityNames.append("HomeLocation"); |
1445 | capabilityNames.append("MapLayer"); | 1446 | capabilityNames.append("MapLayer"); |
1446 | capabilityNames.append("MapLayerGod"); | 1447 | capabilityNames.append("MapLayerGod"); |
1447 | capabilityNames.append("NewFileAgentInventory"); | 1448 | capabilityNames.append("NewFileAgentInventory"); |
1449 | capabilityNames.append("ObjectAdd"); // lets us know if this is a SL-Mesh region | ||
1448 | capabilityNames.append("ParcelPropertiesUpdate"); | 1450 | capabilityNames.append("ParcelPropertiesUpdate"); |
1449 | capabilityNames.append("ParcelMediaURLFilterList"); | 1451 | capabilityNames.append("ParcelMediaURLFilterList"); |
1450 | capabilityNames.append("ParcelNavigateMedia"); | 1452 | capabilityNames.append("ParcelNavigateMedia"); |
diff --git a/linden/indra/newview/primbackup.cpp b/linden/indra/newview/primbackup.cpp index 29b635e..e6288c6 100644 --- a/linden/indra/newview/primbackup.cpp +++ b/linden/indra/newview/primbackup.cpp | |||
@@ -1,7 +1,6 @@ | |||
1 | 1 | ||
2 | #include "llviewerprecompiledheaders.h" | 2 | #include "llviewerprecompiledheaders.h" |
3 | 3 | ||
4 | |||
5 | // system library includes | 4 | // system library includes |
6 | #include <iostream> | 5 | #include <iostream> |
7 | #include <fstream> | 6 | #include <fstream> |
@@ -60,67 +59,89 @@ | |||
60 | 59 | ||
61 | #include "llviewerobjectlist.h" | 60 | #include "llviewerobjectlist.h" |
62 | 61 | ||
63 | primbackup* primbackup::sInstance = 0; | 62 | PrimBackup* PrimBackup::sInstance = NULL; |
63 | |||
64 | // Note: these default textures are initialized with hard coded values to | ||
65 | // prevent cheating. When not in SL, the user-configurable values are used | ||
66 | // instead (see setDefaultTextures() below). | ||
67 | static LLUUID LL_TEXTURE_PLYWOOD = LLUUID("89556747-24cb-43ed-920b-47caed15465f"); | ||
68 | static LLUUID LL_TEXTURE_BLANK = LLUUID("5748decc-f629-461c-9a36-a35a221fe21f"); | ||
69 | static LLUUID LL_TEXTURE_INVISIBLE = LLUUID("38b86f85-2575-52a9-a531-23108d8da837"); | ||
70 | static LLUUID LL_TEXTURE_TRANSPARENT = LLUUID("8dcd4a48-2d37-4909-9f78-f7a9eb4ef903"); | ||
71 | static LLUUID LL_TEXTURE_MEDIA = LLUUID("8b5fec65-8d8d-9dc5-cda8-8fdf2716e361"); | ||
72 | |||
73 | void setDefaultTextures() | ||
74 | { | ||
75 | if (!gHippoGridManager->getConnectedGrid()->isSecondLife()) | ||
76 | { | ||
77 | // When not in SL (no texture perm check needed), we can get these | ||
78 | // defaults from the user settings... | ||
79 | LL_TEXTURE_PLYWOOD = LLUUID(gSavedSettings.getString("DefaultObjectTexture")); | ||
80 | LL_TEXTURE_BLANK = LLUUID(gSavedSettings.getString("UIImgWhiteUUID")); | ||
81 | if (gSavedSettings.controlExists("UIImgInvisibleUUID")) | ||
82 | { | ||
83 | // This control only exists in the AllowInvisibleTextureInPicker patch | ||
84 | LL_TEXTURE_INVISIBLE = LLUUID(gSavedSettings.getString("UIImgInvisibleUUID")); | ||
85 | } | ||
86 | } | ||
87 | } | ||
64 | 88 | ||
65 | class importResponder: public LLNewAgentInventoryResponder | 89 | class importResponder: public LLNewAgentInventoryResponder |
66 | { | 90 | { |
67 | public: | 91 | public: |
68 | 92 | ||
69 | importResponder(const LLSD& post_data, | 93 | importResponder(const LLSD& post_data, const LLUUID& vfile_id, LLAssetType::EType asset_type) |
70 | const LLUUID& vfile_id, | ||
71 | LLAssetType::EType asset_type) | ||
72 | : LLNewAgentInventoryResponder(post_data, vfile_id, asset_type) | 94 | : LLNewAgentInventoryResponder(post_data, vfile_id, asset_type) |
73 | { | 95 | { |
74 | } | 96 | } |
75 | 97 | ||
76 | 98 | //virtual | |
77 | //virtual | ||
78 | virtual void uploadComplete(const LLSD& content) | 99 | virtual void uploadComplete(const LLSD& content) |
79 | { | 100 | { |
80 | lldebugs << "LLNewAgentInventoryResponder::result from capabilities" << llendl; | 101 | lldebugs << "LLNewAgentInventoryResponder::result from capabilities" << llendl; |
81 | 102 | ||
82 | LLAssetType::EType asset_type = LLAssetType::lookup(mPostData["asset_type"].asString()); | 103 | LLAssetType::EType asset_type = LLAssetType::lookup(mPostData["asset_type"].asString()); |
83 | LLInventoryType::EType inventory_type = LLInventoryType::lookup(mPostData["inventory_type"].asString()); | 104 | LLInventoryType::EType inventory_type = LLInventoryType::lookup(mPostData["inventory_type"].asString()); |
84 | 105 | ||
85 | // Update L$ and ownership credit information | 106 | // Update currency and ownership credit information |
86 | // since it probably changed on the server | 107 | // since it probably changed on the server |
87 | if (asset_type == LLAssetType::AT_TEXTURE || | 108 | if (asset_type == LLAssetType::AT_TEXTURE || |
88 | asset_type == LLAssetType::AT_SOUND || | 109 | asset_type == LLAssetType::AT_SOUND || |
89 | asset_type == LLAssetType::AT_ANIMATION) | 110 | asset_type == LLAssetType::AT_ANIMATION) |
90 | { | ||
91 | gMessageSystem->newMessageFast(_PREHASH_MoneyBalanceRequest); | ||
92 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); | ||
93 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | ||
94 | gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | ||
95 | gMessageSystem->nextBlockFast(_PREHASH_MoneyData); | ||
96 | gMessageSystem->addUUIDFast(_PREHASH_TransactionID, LLUUID::null ); | ||
97 | gAgent.sendReliableMessage(); | ||
98 | |||
99 | // LLStringUtil::format_map_t args; | ||
100 | // args["[AMOUNT]"] = llformat("%d",LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()); | ||
101 | // LLNotifyBox::showXml("UploadPayment", args); | ||
102 | } | ||
103 | |||
104 | // Actually add the upload to viewer inventory | ||
105 | llinfos << "Adding " << content["new_inventory_item"].asUUID() << " " | ||
106 | << content["new_asset"].asUUID() << " to inventory." << llendl; | ||
107 | if(mPostData["folder_id"].asUUID().notNull()) | ||
108 | { | ||
109 | LLPermissions perm; | ||
110 | U32 next_owner_perm; | ||
111 | perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null); | ||
112 | if (mPostData["inventory_type"].asString() == "snapshot") | ||
113 | { | 111 | { |
114 | next_owner_perm = PERM_ALL; | 112 | gMessageSystem->newMessageFast(_PREHASH_MoneyBalanceRequest); |
113 | gMessageSystem->nextBlockFast(_PREHASH_AgentData); | ||
114 | gMessageSystem->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | ||
115 | gMessageSystem->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID()); | ||
116 | gMessageSystem->nextBlockFast(_PREHASH_MoneyData); | ||
117 | gMessageSystem->addUUIDFast(_PREHASH_TransactionID, LLUUID::null ); | ||
118 | gAgent.sendReliableMessage(); | ||
119 | |||
120 | // LLStringUtil::format_map_t args; | ||
121 | // args["[AMOUNT]"] = llformat("%d",LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()); | ||
122 | // LLNotifyBox::showXml("UploadPayment", args); | ||
115 | } | 123 | } |
116 | else | 124 | |
125 | // Actually add the upload to viewer inventory | ||
126 | llinfos << "Adding " << content["new_inventory_item"].asUUID() << " " | ||
127 | << content["new_asset"].asUUID() << " to inventory." << llendl; | ||
128 | if (mPostData["folder_id"].asUUID().notNull()) | ||
117 | { | 129 | { |
118 | next_owner_perm = PERM_MOVE | PERM_TRANSFER; | 130 | LLPermissions perm; |
119 | } | 131 | U32 next_owner_perm; |
120 | perm.initMasks(PERM_ALL, PERM_ALL, PERM_NONE, PERM_NONE, next_owner_perm); | 132 | perm.init(gAgent.getID(), gAgent.getID(), LLUUID::null, LLUUID::null); |
121 | S32 creation_date_now = time_corrected(); | 133 | if (mPostData["inventory_type"].asString() == "snapshot") |
122 | LLPointer<LLViewerInventoryItem> item | 134 | { |
123 | = new LLViewerInventoryItem(content["new_inventory_item"].asUUID(), | 135 | next_owner_perm = PERM_ALL; |
136 | } | ||
137 | else | ||
138 | { | ||
139 | next_owner_perm = PERM_MOVE | PERM_TRANSFER; | ||
140 | } | ||
141 | perm.initMasks(PERM_ALL, PERM_ALL, PERM_NONE, PERM_NONE, next_owner_perm); | ||
142 | S32 creation_date_now = time_corrected(); | ||
143 | LLPointer<LLViewerInventoryItem> item | ||
144 | = new LLViewerInventoryItem(content["new_inventory_item"].asUUID(), | ||
124 | mPostData["folder_id"].asUUID(), | 145 | mPostData["folder_id"].asUUID(), |
125 | perm, | 146 | perm, |
126 | content["new_asset"].asUUID(), | 147 | content["new_asset"].asUUID(), |
@@ -131,95 +152,96 @@ class importResponder: public LLNewAgentInventoryResponder | |||
131 | LLSaleInfo::DEFAULT, | 152 | LLSaleInfo::DEFAULT, |
132 | LLInventoryItem::II_FLAGS_NONE, | 153 | LLInventoryItem::II_FLAGS_NONE, |
133 | creation_date_now); | 154 | creation_date_now); |
134 | gInventory.updateItem(item); | 155 | gInventory.updateItem(item); |
135 | gInventory.notifyObservers(); | 156 | gInventory.notifyObservers(); |
136 | } | 157 | } |
137 | else | 158 | else |
138 | { | 159 | { |
139 | llwarns << "Can't find a folder to put it in" << llendl; | 160 | llwarns << "Can't find a folder to put it into" << llendl; |
140 | } | 161 | } |
141 | 162 | ||
142 | // remove the "Uploading..." message | 163 | // remove the "Uploading..." message |
143 | LLUploadDialog::modalUploadFinished(); | 164 | LLUploadDialog::modalUploadFinished(); |
144 | |||
145 | primbackup::getInstance()->update_map(content["new_asset"].asUUID()); | ||
146 | primbackup::getInstance()->upload_next_asset(); | ||
147 | 165 | ||
166 | PrimBackup::getInstance()->updateMap(content["new_asset"].asUUID()); | ||
167 | PrimBackup::getInstance()->uploadNextAsset(); | ||
148 | } | 168 | } |
149 | |||
150 | }; | 169 | }; |
151 | 170 | ||
152 | |||
153 | |||
154 | class CacheReadResponder : public LLTextureCache::ReadResponder | 171 | class CacheReadResponder : public LLTextureCache::ReadResponder |
172 | { | ||
173 | public: | ||
174 | CacheReadResponder(const LLUUID& id, LLImageFormatted* image) | ||
175 | : mFormattedImage(image), mID(id) | ||
176 | { | ||
177 | setImage(image); | ||
178 | } | ||
179 | void setData(U8* data, S32 datasize, S32 imagesize, S32 imageformat, BOOL imagelocal) | ||
155 | { | 180 | { |
156 | public: | 181 | if (imageformat == IMG_CODEC_TGA && mFormattedImage->getCodec() == IMG_CODEC_J2C) |
157 | CacheReadResponder(const LLUUID& id, LLImageFormatted* image) | ||
158 | : mFormattedImage(image), mID(id) | ||
159 | { | 182 | { |
160 | setImage(image); | 183 | llwarns << "FAILED: texture " << mID << " is formatted as TGA. Not saving." << llendl; |
184 | PrimBackup::getInstance()->mNonExportedTextures |= PrimBackup::TEXTURE_BAD_ENCODING; | ||
185 | mFormattedImage = NULL; | ||
186 | mImageSize = 0; | ||
187 | return; | ||
161 | } | 188 | } |
162 | void setData(U8* data, S32 datasize, S32 imagesize, S32 imageformat, BOOL imagelocal) | 189 | |
190 | if (mFormattedImage.notNull()) | ||
163 | { | 191 | { |
164 | if(imageformat==IMG_CODEC_TGA && mFormattedImage->getCodec()==IMG_CODEC_J2C) | 192 | llassert_always(mFormattedImage->getCodec() == imageformat); |
165 | { | 193 | mFormattedImage->appendData(data, datasize); |
166 | llwarns<<"Bleh its a tga not saving"<<llendl; | 194 | } |
167 | mFormattedImage=NULL; | 195 | else |
168 | mImageSize=0; | 196 | { |
169 | return; | 197 | mFormattedImage = LLImageFormatted::createFromType(imageformat); |
170 | } | 198 | mFormattedImage->setData(data, datasize); |
199 | } | ||
200 | mImageSize = imagesize; | ||
201 | mImageLocal = imagelocal; | ||
202 | } | ||
171 | 203 | ||
172 | if (mFormattedImage.notNull()) | 204 | virtual void completed(bool success) |
173 | { | 205 | { |
174 | llassert_always(mFormattedImage->getCodec() == imageformat); | 206 | if (success && mFormattedImage.notNull() && mImageSize > 0) |
175 | mFormattedImage->appendData(data, datasize); | 207 | { |
176 | } | 208 | llinfos << "SUCCESS getting texture " << mID << llendl; |
177 | else | 209 | std::string name; |
210 | mID.toString(name); | ||
211 | name = PrimBackup::getInstance()->getfolder() + "//" + name; | ||
212 | llinfos << "Saving to " << name << llendl; | ||
213 | if (!mFormattedImage->save(name)) | ||
178 | { | 214 | { |
179 | mFormattedImage = LLImageFormatted::createFromType(imageformat); | 215 | llwarns << "FAILED to save texture " << mID << llendl; |
180 | mFormattedImage->setData(data,datasize); | 216 | PrimBackup::getInstance()->mNonExportedTextures |= PrimBackup::TEXTURE_SAVED_FAILED; |
181 | } | 217 | } |
182 | mImageSize = imagesize; | ||
183 | mImageLocal = imagelocal; | ||
184 | } | 218 | } |
185 | 219 | else | |
186 | virtual void completed(bool success) | ||
187 | { | 220 | { |
188 | if(success && (mFormattedImage.notNull()) && mImageSize>0) | 221 | if (!success) |
189 | { | 222 | { |
190 | 223 | llwarns << "FAILED to get texture " << mID << llendl; | |
191 | llinfos << "SUCCESS getting texture "<<mID<< llendl; | 224 | PrimBackup::getInstance()->mNonExportedTextures |= PrimBackup::TEXTURE_MISSING; |
192 | |||
193 | std::string name; | ||
194 | mID.toString(name); | ||
195 | llinfos << "Saving to "<<(primbackup::getInstance()->getfolder()+"//"+name)<<llendl; | ||
196 | if(!mFormattedImage->save(primbackup::getInstance()->getfolder()+"//"+name)) | ||
197 | { | ||
198 | llinfos << "FAIL saving texture "<<mID<< llendl; | ||
199 | } | ||
200 | |||
201 | } | 225 | } |
202 | else | 226 | if (mFormattedImage.isNull()) |
203 | { | 227 | { |
204 | if(!success) | 228 | llwarns << "FAILED: NULL texture " << mID << llendl; |
205 | llwarns << "FAIL NOT SUCCESSFUL getting texture "<<mID<< llendl; | 229 | PrimBackup::getInstance()->mNonExportedTextures |= PrimBackup::TEXTURE_IS_NULL; |
206 | if(mFormattedImage.isNull()) | 230 | } |
207 | llwarns << "FAIL image is NULL "<<mID<< llendl; | ||
208 | } | ||
209 | |||
210 | primbackup::getInstance()->m_nexttextureready=true; | ||
211 | //JUST SAY NO TO APR DEADLOCKING | ||
212 | //primbackup::getInstance()->export_next_texture(); | ||
213 | } | 231 | } |
214 | private: | ||
215 | LLPointer<LLImageFormatted> mFormattedImage; | ||
216 | LLUUID mID; | ||
217 | }; | ||
218 | 232 | ||
233 | PrimBackup::getInstance()->mNextTextureReady = true; | ||
234 | //JUST SAY NO TO APR DEADLOCKING | ||
235 | //PrimBackup::getInstance()->exportNextTexture(); | ||
236 | } | ||
237 | private: | ||
238 | LLPointer<LLImageFormatted> mFormattedImage; | ||
239 | LLUUID mID; | ||
240 | }; | ||
219 | 241 | ||
220 | 242 | ||
221 | primbackup::primbackup() | 243 | PrimBackup::PrimBackup() |
222 | : LLFloater( std::string("Prim Import Floater") ) | 244 | : LLFloater( std::string("Prim Import Floater"), std::string("FloaterPrimImport"), LLStringUtil::null) |
223 | { | 245 | { |
224 | LLUICtrlFactory::getInstance()->buildFloater( this, "floater_prim_import.xml" ); | 246 | LLUICtrlFactory::getInstance()->buildFloater( this, "floater_prim_import.xml" ); |
225 | 247 | ||
@@ -228,131 +250,131 @@ primbackup::primbackup() | |||
228 | //reshape( rect.getWidth(), rect.getHeight(), FALSE ); | 250 | //reshape( rect.getWidth(), rect.getHeight(), FALSE ); |
229 | //setRect( rect ); | 251 | //setRect( rect ); |
230 | 252 | ||
231 | running=false; | 253 | mRunning = false; |
232 | textures.clear(); | 254 | mTexturesList.clear(); |
233 | assetmap.clear(); | 255 | mAssetMap.clear(); |
234 | current_asset=LLUUID::null; | 256 | mCurrentAsset = LLUUID::null; |
235 | m_retexture=false; | 257 | mRetexture = false; |
236 | close(); | 258 | close(); |
237 | } | 259 | } |
238 | 260 | ||
239 | 261 | ||
240 | //////////////////////////////////////////////////////////////////////////////// | 262 | //////////////////////////////////////////////////////////////////////////////// |
241 | // | 263 | // |
242 | primbackup* primbackup::getInstance() | 264 | PrimBackup* PrimBackup::getInstance() |
243 | { | 265 | { |
244 | if ( ! sInstance ) | 266 | if (!sInstance) |
245 | sInstance = new primbackup(); | 267 | sInstance = new PrimBackup(); |
246 | |||
247 | return sInstance; | 268 | return sInstance; |
248 | } | 269 | } |
249 | 270 | ||
250 | primbackup::~primbackup() | 271 | PrimBackup::~PrimBackup() |
251 | { | 272 | { |
252 | // save position of floater | 273 | // save position of floater |
253 | gSavedSettings.setRect( "FloaterPrimImport", getRect() ); | 274 | gSavedSettings.setRect("FloaterPrimImport", getRect()); |
254 | sInstance = 0; | 275 | sInstance = NULL; |
255 | } | 276 | } |
256 | 277 | ||
257 | void primbackup::draw() | 278 | void PrimBackup::draw() |
258 | { | 279 | { |
259 | LLFloater::draw(); | 280 | LLFloater::draw(); |
260 | } | 281 | } |
261 | 282 | ||
262 | void primbackup::show() | 283 | void PrimBackup::show(bool exporting) |
263 | { | 284 | { |
264 | // set the title | 285 | // set the title |
265 | setTitle( "stuff" ); | 286 | if (exporting) |
266 | m_curobject=1; | 287 | { |
267 | m_curprim=0; | 288 | setTitle("Object export"); |
268 | m_objects=0; | 289 | } |
269 | m_prims=0; | 290 | else |
270 | m_textures=0; | 291 | { |
271 | m_curtexture=0; | 292 | setTitle("Object import"); |
272 | rezcount=0; | 293 | } |
294 | mCurObject = 1; | ||
295 | mCurPrim = 0; | ||
296 | mObjects = 0; | ||
297 | mPrims = 0; | ||
298 | mRezCount = 0; | ||
273 | 299 | ||
274 | // make floater appear | 300 | // make floater appear |
275 | setVisibleAndFrontmost(); | 301 | setVisibleAndFrontmost(); |
276 | } | 302 | } |
277 | 303 | ||
278 | 304 | void PrimBackup::onClose(bool app_quitting) | |
279 | void primbackup::onClose( bool app_quitting ) | ||
280 | { | 305 | { |
281 | setVisible( false ); | 306 | setVisible(false); |
282 | // HACK for fast XML iteration replace with: | 307 | // HACK for fast XML iteration replace with: |
283 | // destroy(); | 308 | // destroy(); |
284 | } | 309 | } |
285 | 310 | ||
286 | void primbackup::updateexportnumbers() | 311 | void PrimBackup::updateExportNumbers() |
287 | { | 312 | { |
313 | std::stringstream sstr; | ||
314 | LLUICtrl* ctrl = getChild<LLUICtrl>("name_label"); | ||
288 | 315 | ||
289 | std::stringstream sstr; | 316 | sstr << "Export Progress \n"; |
290 | LLUICtrl * ctrl=this->getChild<LLUICtrl>("name_label"); | ||
291 | 317 | ||
292 | sstr<<"Export Progress \n"; | 318 | sstr << "Remaining Textures " << mTexturesList.size() << "\n"; |
293 | 319 | ctrl->setValue(LLSD("Text") = sstr.str()); | |
294 | sstr << "Remaining Textures "<<textures.size()<<"\n"; | ||
295 | ctrl->setValue(LLSD("Text")=sstr.str()); | ||
296 | |||
297 | } | 320 | } |
298 | 321 | ||
299 | 322 | void PrimBackup::updateImportNumbers() | |
300 | void primbackup::updateimportnumbers() | ||
301 | { | 323 | { |
302 | std::stringstream sstr; | 324 | std::stringstream sstr; |
303 | LLUICtrl * ctrl=this->getChild<LLUICtrl>("name_label"); | 325 | LLUICtrl* ctrl = getChild<LLUICtrl>("name_label"); |
304 | 326 | ||
305 | if(m_retexture) | 327 | if (mRetexture) |
306 | { | 328 | { |
307 | sstr << " Textures uploads remaining : "<<textures.size()<<"\n"; | 329 | sstr << " Textures uploads remaining : " << mTexturesList.size() << "\n"; |
308 | ctrl->setValue(LLSD("Text")=sstr.str()); | 330 | ctrl->setValue(LLSD("Text") = sstr.str()); |
309 | } | 331 | } |
310 | else | 332 | else |
311 | { | 333 | { |
312 | sstr << " Textures uploads N/A \n"; | 334 | sstr << " Textures uploads N/A \n"; |
313 | ctrl->setValue(LLSD("Text")=sstr.str()); | 335 | ctrl->setValue(LLSD("Text") = sstr.str()); |
314 | } | 336 | } |
315 | sstr << " Objects "<<this->m_curobject<<"/"<<this->m_objects<<"\n"; | ||
316 | ctrl->setValue(LLSD("Text")=sstr.str()); | ||
317 | |||
318 | sstr << " Rez "<<this->rezcount<<"/"<<this->m_prims; | ||
319 | ctrl->setValue(LLSD("Text")=sstr.str()); | ||
320 | 337 | ||
321 | sstr << " Build "<<this->m_curprim<<"/"<<this->m_prims; | 338 | sstr << " Objects " << mCurObject << "/" << mObjects << "\n"; |
322 | ctrl->setValue(LLSD("Text")=sstr.str()); | 339 | ctrl->setValue(LLSD("Text") = sstr.str()); |
323 | 340 | ||
341 | sstr << " Rez "<< mRezCount << "/" << mPrims; | ||
342 | ctrl->setValue(LLSD("Text") = sstr.str()); | ||
324 | 343 | ||
344 | sstr << " Build " << mCurPrim << "/" << mPrims; | ||
345 | ctrl->setValue(LLSD("Text") = sstr.str()); | ||
325 | } | 346 | } |
326 | 347 | ||
327 | void primbackup::pre_export_object() | 348 | void PrimBackup::exportObject() |
328 | { | 349 | { |
329 | textures.clear(); | 350 | mTexturesList.clear(); |
330 | llsd.clear(); | 351 | mLLSD.clear(); |
331 | this_group.clear(); | 352 | mThisGroup.clear(); |
353 | |||
354 | setDefaultTextures(); | ||
332 | 355 | ||
333 | // Open the file save dialog | 356 | // Open the file save dialog |
334 | LLFilePicker& file_picker = LLFilePicker::instance(); | 357 | LLFilePicker& file_picker = LLFilePicker::instance(); |
335 | if( !file_picker.getSaveFile( LLFilePicker::FFSAVE_XML ) ) | 358 | if (!file_picker.getSaveFile(LLFilePicker::FFSAVE_XML, LLSelectMgr::getInstance()->getSelection()->getFirstRootNode()->mName)) |
336 | { | 359 | { |
337 | // User canceled save. | 360 | // User canceled save. |
338 | return; | 361 | return; |
339 | } | 362 | } |
340 | |||
341 | file_name = file_picker.getCurFile(); | ||
342 | folder = gDirUtilp->getDirName(file_name); | ||
343 | 363 | ||
344 | export_state=EXPORT_INIT; | 364 | mFileName = file_picker.getCurFile(); |
345 | gIdleCallbacks.addFunction(exportworker, NULL); | 365 | mFolder = gDirUtilp->getDirName(mFileName); |
346 | } | 366 | |
367 | mNonExportedTextures = TEXTURE_OK; | ||
347 | 368 | ||
369 | mExportState = EXPORT_INIT; | ||
370 | gIdleCallbacks.addFunction(exportWorker, NULL); | ||
371 | } | ||
348 | 372 | ||
349 | // This is the central place where exporting permissions checks are done. | 373 | // This is the central place where exporting permissions checks are done. |
350 | 374 | ||
351 | // static | 375 | // static |
352 | bool primbackup::check_perms( LLSelectNode* node ) | 376 | bool PrimBackup::validatePerms(const LLPermissions *item_permissions) |
353 | { | 377 | { |
354 | LLPermissions *perms = node->mPermissions; | ||
355 | |||
356 | // Exporting other content) from Second Life | 378 | // Exporting other content) from Second Life |
357 | // without checking creator is a violation of the Second Life | 379 | // without checking creator is a violation of the Second Life |
358 | // Policy on Third-Party Viewers and Terms of Service. | 380 | // Policy on Third-Party Viewers and Terms of Service. |
@@ -365,123 +387,226 @@ bool primbackup::check_perms( LLSelectNode* node ) | |||
365 | // on content that the content author did not want. | 387 | // on content that the content author did not want. |
366 | if(gHippoGridManager->getConnectedGrid()->isSecondLife()) | 388 | if(gHippoGridManager->getConnectedGrid()->isSecondLife()) |
367 | { | 389 | { |
368 | return (gAgent.getID() == perms->getOwner() && | 390 | // In Second Life, you must be the creator to be permitted to export the asset. |
369 | gAgent.getID() == perms->getCreator() && | 391 | return (gAgent.getID() == item_permissions->getOwner() && |
370 | (PERM_ITEM_UNRESTRICTED & | 392 | //gAgent.getID() == item_permissions->getCreator() && |
371 | perms->getMaskOwner()) == PERM_ITEM_UNRESTRICTED); | 393 | (PERM_ITEM_UNRESTRICTED & item_permissions->getMaskOwner()) == PERM_ITEM_UNRESTRICTED); |
394 | } | ||
395 | else | ||
396 | { | ||
397 | // Out of Second Life, simply check that you're the owner and the asset is full perms. | ||
398 | return (gAgent.getID() == item_permissions->getOwner() && | ||
399 | (item_permissions->getMaskOwner() & PERM_ITEM_UNRESTRICTED) == PERM_ITEM_UNRESTRICTED); | ||
372 | } | 400 | } |
373 | |||
374 | return (gAgent.getID() == perms->getOwner() && | ||
375 | (PERM_ITEM_UNRESTRICTED & | ||
376 | perms->getMaskOwner()) == PERM_ITEM_UNRESTRICTED); | ||
377 | } | 401 | } |
378 | 402 | ||
403 | // So far, only Second Life forces TPVs to verify the creator for textures... | ||
404 | // which sucks, because there is no other way to check for the texture | ||
405 | // permissions or creator than to try and find the asset(s) corresponding to | ||
406 | // the texture in the inventory and check the permissions/creator on the said | ||
407 | // asset(s), meaning that if you created the texture and subsequently deleted | ||
408 | // it from your inventory, you will not be able to export it any more !!! | ||
409 | // The "must be creator" stuff also goes against the usage in Linden Lab's own | ||
410 | // official viewers, since those allow you to save full perm textures (such as | ||
411 | // the textures in the Library), whoever is the actual creator... Go figure ! | ||
412 | LLUUID PrimBackup::validateTextureID(LLUUID asset_id) | ||
413 | { | ||
414 | if (!gHippoGridManager->getConnectedGrid()->isSecondLife()) | ||
415 | { | ||
416 | // If we are not in Second Life, don't bother | ||
417 | return asset_id; | ||
418 | } | ||
379 | 419 | ||
380 | void primbackup::exportworker(void *userdata) | 420 | LLUUID texture = LL_TEXTURE_PLYWOOD; |
381 | { | 421 | if (asset_id == texture || |
382 | primbackup::getInstance()->updateexportnumbers(); | 422 | asset_id == LL_TEXTURE_BLANK || |
423 | asset_id == LL_TEXTURE_INVISIBLE || | ||
424 | asset_id == LL_TEXTURE_TRANSPARENT || | ||
425 | asset_id == LL_TEXTURE_MEDIA) | ||
426 | { | ||
427 | // Allow to export a grid's default textures | ||
428 | return asset_id; | ||
429 | } | ||
430 | LLViewerInventoryCategory::cat_array_t cats; | ||
431 | LLViewerInventoryItem::item_array_t items; | ||
432 | LLAssetIDMatches asset_id_matches(asset_id); | ||
433 | gInventory.collectDescendentsIf(LLUUID::null, | ||
434 | cats, | ||
435 | items, | ||
436 | LLInventoryModel::INCLUDE_TRASH, | ||
437 | asset_id_matches); | ||
438 | |||
439 | if (items.count()) | ||
440 | { | ||
441 | for (S32 i = 0; i < items.count(); i++) | ||
442 | { | ||
443 | const LLPermissions item_permissions = items[i]->getPermissions(); | ||
444 | if (validatePerms(&item_permissions)) | ||
445 | { | ||
446 | texture = asset_id; | ||
447 | } | ||
448 | } | ||
449 | } | ||
383 | 450 | ||
384 | switch(primbackup::getInstance()->export_state) | 451 | if (texture != asset_id) |
385 | { | 452 | { |
386 | case EXPORT_INIT: { | 453 | mNonExportedTextures |= TEXTURE_BAD_PERM; |
387 | primbackup::getInstance()->show(); | 454 | } |
388 | LLSelectMgr::getInstance()->getSelection()->ref(); | 455 | |
456 | return texture; | ||
457 | } | ||
458 | |||
459 | void PrimBackup::exportWorker(void *userdata) | ||
460 | { | ||
461 | PrimBackup::getInstance()->updateExportNumbers(); | ||
389 | 462 | ||
390 | struct ff : public LLSelectedNodeFunctor | 463 | switch (PrimBackup::getInstance()->mExportState) |
464 | { | ||
465 | case EXPORT_INIT: | ||
391 | { | 466 | { |
392 | virtual bool apply(LLSelectNode* node) | 467 | PrimBackup::getInstance()->show(true); |
468 | LLSelectMgr::getInstance()->getSelection()->ref(); | ||
469 | |||
470 | struct ff : public LLSelectedNodeFunctor | ||
393 | { | 471 | { |
394 | return primbackup::check_perms( node ); | 472 | virtual bool apply(LLSelectNode* node) |
395 | } | 473 | { |
396 | } func; | 474 | return PrimBackup::getInstance()->validatePerms(node->mPermissions); |
475 | } | ||
476 | } func; | ||
397 | 477 | ||
398 | if(LLSelectMgr::getInstance()->getSelection()->applyToNodes(&func,false)) | 478 | if (LLSelectMgr::getInstance()->getSelection()->applyToNodes(&func, false)) |
399 | { | 479 | { |
400 | primbackup::getInstance()->export_state=EXPORT_STRUCTURE; | 480 | PrimBackup::getInstance()->mExportState = EXPORT_STRUCTURE; |
481 | } | ||
482 | else | ||
483 | { | ||
484 | llwarns << "Incorrect permission to export" << llendl; | ||
485 | PrimBackup::getInstance()->mExportState = EXPORT_FAILED; | ||
486 | LLSelectMgr::getInstance()->getSelection()->unref(); | ||
487 | } | ||
401 | } | 488 | } |
402 | else | 489 | break; |
490 | |||
491 | case EXPORT_STRUCTURE: | ||
403 | { | 492 | { |
404 | llwarns << "Incorrect permission to export" << llendl; | 493 | struct ff : public LLSelectedObjectFunctor |
405 | primbackup::getInstance()->export_state=EXPORT_DONE; | 494 | { |
406 | primbackup::getInstance()->close(); | 495 | virtual bool apply(LLViewerObject* object) |
407 | gIdleCallbacks.deleteFunction(exportworker); | 496 | { |
497 | bool is_attachment = object->isAttachment(); | ||
498 | object->boostTexturePriority(TRUE); | ||
499 | LLViewerObject::child_list_t children = object->getChildren(); | ||
500 | children.push_front(object); //push root onto list | ||
501 | LLSD prim_llsd = PrimBackup::getInstance()->primsToLLSD(children, is_attachment); | ||
502 | LLSD stuff; | ||
503 | if (is_attachment) | ||
504 | { | ||
505 | stuff["root_position"] = object->getPositionEdit().getValue(); | ||
506 | stuff["root_rotation"] = ll_sd_from_quaternion(object->getRotationEdit()); | ||
507 | } | ||
508 | else | ||
509 | { | ||
510 | stuff["root_position"] = object->getPosition().getValue(); | ||
511 | stuff["root_rotation"] = ll_sd_from_quaternion(object->getRotation()); | ||
512 | } | ||
513 | stuff["group_body"] = prim_llsd; | ||
514 | PrimBackup::getInstance()->mLLSD["data"].append(stuff); | ||
515 | return true; | ||
516 | } | ||
517 | } func; | ||
518 | |||
519 | PrimBackup::getInstance()->mExportState = EXPORT_LLSD; | ||
520 | LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func, false); | ||
408 | LLSelectMgr::getInstance()->getSelection()->unref(); | 521 | LLSelectMgr::getInstance()->getSelection()->unref(); |
409 | } | 522 | } |
410 | break; | 523 | break; |
411 | } | ||
412 | 524 | ||
413 | case EXPORT_STRUCTURE: { | 525 | case EXPORT_TEXTURES: |
414 | struct ff : public LLSelectedObjectFunctor | ||
415 | { | 526 | { |
416 | virtual bool apply(LLViewerObject* object) | 527 | if (PrimBackup::getInstance()->mNextTextureReady == false) |
528 | return; | ||
529 | |||
530 | // Ok we got work to do | ||
531 | PrimBackup::getInstance()->mNextTextureReady = false; | ||
532 | |||
533 | if (PrimBackup::getInstance()->mTexturesList.empty()) | ||
417 | { | 534 | { |
418 | object->boostTexturePriority(TRUE); | 535 | PrimBackup::getInstance()->mExportState = EXPORT_DONE; |
419 | LLViewerObject::child_list_t children = object->getChildren(); | 536 | return; |
420 | children.push_front(object); //push root onto list | ||
421 | LLSD prim_llsd=primbackup::getInstance()->prims_to_llsd(children); | ||
422 | LLSD stuff; | ||
423 | stuff["root_position"] = object->getPosition().getValue(); | ||
424 | stuff["root_rotation"] = ll_sd_from_quaternion(object->getRotation()); | ||
425 | stuff["group_body"] = prim_llsd; | ||
426 | primbackup::getInstance()->llsd["data"].append(stuff); | ||
427 | return true; | ||
428 | } | 537 | } |
429 | } func; | ||
430 | |||
431 | primbackup::getInstance()->export_state=EXPORT_LLSD; | ||
432 | LLSelectMgr::getInstance()->getSelection()->applyToRootObjects(&func,false); | ||
433 | LLSelectMgr::getInstance()->getSelection()->unref(); | ||
434 | 538 | ||
539 | PrimBackup::getInstance()->exportNextTexture(); | ||
540 | } | ||
435 | break; | 541 | break; |
436 | } | ||
437 | |||
438 | case EXPORT_TEXTURES: { | ||
439 | if(primbackup::getInstance()->m_nexttextureready==false) | ||
440 | return; | ||
441 | 542 | ||
442 | //Ok we got work to do | 543 | case EXPORT_LLSD: |
443 | primbackup::getInstance()->m_nexttextureready=false; | ||
444 | |||
445 | if(primbackup::getInstance()->textures.empty()) | ||
446 | { | 544 | { |
447 | primbackup::getInstance()->export_state=EXPORT_DONE; | 545 | // Create a file stream and write to it |
448 | return; | 546 | llofstream export_file(PrimBackup::getInstance()->mFileName); |
547 | LLSDSerialize::toPrettyXML(PrimBackup::getInstance()->mLLSD, export_file); | ||
548 | export_file.close(); | ||
549 | PrimBackup::getInstance()->mNextTextureReady = true; | ||
550 | PrimBackup::getInstance()->mExportState = EXPORT_TEXTURES; | ||
449 | } | 551 | } |
450 | |||
451 | primbackup::getInstance()->export_next_texture(); | ||
452 | break; | 552 | break; |
453 | } | ||
454 | 553 | ||
455 | case EXPORT_LLSD: { | 554 | case EXPORT_DONE: |
456 | // Create a file stream and write to it | 555 | gIdleCallbacks.deleteFunction(exportWorker); |
457 | llofstream export_file(primbackup::getInstance()->file_name); | 556 | if (PrimBackup::getInstance()->mNonExportedTextures == PrimBackup::TEXTURE_OK) |
458 | LLSDSerialize::toPrettyXML(primbackup::getInstance()->llsd, export_file); | 557 | { |
459 | export_file.close(); | 558 | llinfos << "Export successful and complete." << llendl; |
460 | primbackup::getInstance()->m_nexttextureready=true; | 559 | LLNotifications::instance().add("ExportSuccessful"); |
461 | primbackup::getInstance()->export_state=EXPORT_TEXTURES; | 560 | } |
561 | else | ||
562 | { | ||
563 | llinfos << "Export successful but incomplete: some texture(s) not saved." << llendl; | ||
564 | std::string reason; | ||
565 | if (PrimBackup::getInstance()->mNonExportedTextures & PrimBackup::TEXTURE_BAD_PERM) | ||
566 | { | ||
567 | reason += "\nBad permissions/creator."; | ||
568 | } | ||
569 | if (PrimBackup::getInstance()->mNonExportedTextures & PrimBackup::TEXTURE_MISSING) | ||
570 | { | ||
571 | reason += "\nMissing texture."; | ||
572 | } | ||
573 | if (PrimBackup::getInstance()->mNonExportedTextures & PrimBackup::TEXTURE_BAD_ENCODING) | ||
574 | { | ||
575 | reason += "\nBad texture encoding."; | ||
576 | } | ||
577 | if (PrimBackup::getInstance()->mNonExportedTextures & PrimBackup::TEXTURE_IS_NULL) | ||
578 | { | ||
579 | reason += "\nNull texture."; | ||
580 | } | ||
581 | if (PrimBackup::getInstance()->mNonExportedTextures & PrimBackup::TEXTURE_SAVED_FAILED) | ||
582 | { | ||
583 | reason += "\nCould not write to disk."; | ||
584 | } | ||
585 | LLSD args; | ||
586 | args["REASON"] = reason; | ||
587 | LLNotifications::instance().add("ExportPartial", args); | ||
588 | } | ||
589 | PrimBackup::getInstance()->close(); | ||
462 | break; | 590 | break; |
463 | } | ||
464 | 591 | ||
465 | case EXPORT_DONE: { | 592 | case EXPORT_FAILED: |
466 | llinfos << "Backup complete" << llendl; | 593 | gIdleCallbacks.deleteFunction(exportWorker); |
467 | gIdleCallbacks.deleteFunction(exportworker); | 594 | llwarns << "Export process aborted." << llendl; |
468 | primbackup::getInstance()->close(); | 595 | LLNotifications::instance().add("ExportFailed"); |
596 | PrimBackup::getInstance()->close(); | ||
469 | break; | 597 | break; |
470 | } | ||
471 | } | 598 | } |
472 | } | 599 | } |
473 | 600 | ||
474 | LLSD primbackup::prims_to_llsd(LLViewerObject::child_list_t child_list) | 601 | LLSD PrimBackup::primsToLLSD(LLViewerObject::child_list_t child_list, bool is_attachment) |
475 | { | 602 | { |
476 | |||
477 | LLViewerObject* object; | 603 | LLViewerObject* object; |
478 | LLSD llsd; | 604 | LLSD llsd; |
479 | |||
480 | char localid[16]; | 605 | char localid[16]; |
481 | 606 | ||
482 | for (LLViewerObject::child_list_t::iterator i = child_list.begin(); i != child_list.end(); ++i) | 607 | for (LLViewerObject::child_list_t::iterator i = child_list.begin(); i != child_list.end(); ++i) |
483 | { | 608 | { |
484 | object=(*i); | 609 | object = (*i); |
485 | LLUUID id = object->getID(); | 610 | LLUUID id = object->getID(); |
486 | 611 | ||
487 | llinfos << "Exporting prim " << object->getID().asString() << llendl; | 612 | llinfos << "Exporting prim " << object->getID().asString() << llendl; |
@@ -492,16 +617,31 @@ LLSD primbackup::prims_to_llsd(LLViewerObject::child_list_t child_list) | |||
492 | 617 | ||
493 | if (!object->isRoot()) | 618 | if (!object->isRoot()) |
494 | { | 619 | { |
495 | |||
496 | // Parent id | 620 | // Parent id |
497 | snprintf(localid, sizeof(localid), "%u", object->getSubParent()->getLocalID()); | 621 | snprintf(localid, sizeof(localid), "%u", object->getSubParent()->getLocalID()); |
498 | prim_llsd["parent"] = localid; | 622 | prim_llsd["parent"] = localid; |
499 | } | 623 | } |
500 | 624 | ||
625 | // Name and description | ||
626 | LLSelectNode* node = LLSelectMgr::getInstance()->getSelection()->findNode(object); | ||
627 | if (node) | ||
628 | { | ||
629 | prim_llsd["name"] = node->mName; | ||
630 | prim_llsd["description"] = node->mDescription; | ||
631 | } | ||
632 | |||
501 | // Transforms | 633 | // Transforms |
502 | prim_llsd["position"] = object->getPosition().getValue(); | 634 | if (is_attachment) |
635 | { | ||
636 | prim_llsd["position"] = object->getPositionEdit().getValue(); | ||
637 | prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotationEdit()); | ||
638 | } | ||
639 | else | ||
640 | { | ||
641 | prim_llsd["position"] = object->getPosition().getValue(); | ||
642 | prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotation()); | ||
643 | } | ||
503 | prim_llsd["scale"] = object->getScale().getValue(); | 644 | prim_llsd["scale"] = object->getScale().getValue(); |
504 | prim_llsd["rotation"] = ll_sd_from_quaternion(object->getRotation()); | ||
505 | 645 | ||
506 | // Flags | 646 | // Flags |
507 | prim_llsd["shadows"] = object->flagCastShadows(); | 647 | prim_llsd["shadows"] = object->flagCastShadows(); |
@@ -530,37 +670,55 @@ LLSD primbackup::prims_to_llsd(LLViewerObject::child_list_t child_list) | |||
530 | // Sculpt | 670 | // Sculpt |
531 | LLSculptParams* sculpt = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT); | 671 | LLSculptParams* sculpt = (LLSculptParams*)object->getParameterEntry(LLNetworkData::PARAMS_SCULPT); |
532 | prim_llsd["sculpt"] = sculpt->asLLSD(); | 672 | prim_llsd["sculpt"] = sculpt->asLLSD(); |
533 | 673 | ||
534 | LLUUID sculpt_texture=sculpt->getSculptTexture(); | 674 | LLUUID sculpt_texture = sculpt->getSculptTexture(); |
535 | bool alreadyseen=false; | 675 | if (sculpt_texture == validateTextureID(sculpt_texture)) |
536 | std::list<LLUUID>::iterator iter; | ||
537 | for(iter = textures.begin(); iter != textures.end() ; iter++) | ||
538 | { | 676 | { |
539 | if( (*iter)==sculpt_texture) | 677 | bool alreadyseen = false; |
540 | alreadyseen=true; | 678 | std::list<LLUUID>::iterator iter; |
679 | for (iter = mTexturesList.begin(); iter != mTexturesList.end(); iter++) | ||
680 | { | ||
681 | if ((*iter) == sculpt_texture) | ||
682 | alreadyseen = true; | ||
683 | } | ||
684 | if (alreadyseen == false) | ||
685 | { | ||
686 | llinfos << "Found a sculpt texture, adding to list " << sculpt_texture << llendl; | ||
687 | mTexturesList.push_back(sculpt_texture); | ||
688 | } | ||
541 | } | 689 | } |
542 | if(alreadyseen==false) | 690 | else |
543 | { | 691 | { |
544 | llinfos << "Found a sculpt texture, adding to list "<<sculpt_texture<<llendl; | 692 | llwarns << "Incorrect permission to export a sculpt texture." << llendl; |
545 | textures.push_back(sculpt_texture); | 693 | PrimBackup::getInstance()->mExportState = EXPORT_FAILED; |
546 | } | 694 | } |
547 | } | 695 | } |
548 | 696 | ||
549 | // Textures | 697 | // Textures |
550 | LLSD te_llsd; | 698 | LLSD te_llsd; |
699 | LLSD this_te_llsd; | ||
700 | LLUUID t_id; | ||
551 | U8 te_count = object->getNumTEs(); | 701 | U8 te_count = object->getNumTEs(); |
552 | for (U8 i = 0; i < te_count; i++) | 702 | for (U8 i = 0; i < te_count; i++) |
553 | { | 703 | { |
554 | bool alreadyseen=false; | 704 | bool alreadyseen = false; |
555 | te_llsd.append(object->getTE(i)->asLLSD()); | 705 | t_id = validateTextureID(object->getTE(i)->getID()); |
556 | std::list<LLUUID>::iterator iter; | 706 | this_te_llsd = object->getTE(i)->asLLSD(); |
557 | for(iter = textures.begin(); iter != textures.end() ; iter++) | 707 | this_te_llsd["imageid"] = t_id; |
708 | te_llsd.append(this_te_llsd); | ||
709 | // We export these default textures -- MC | ||
710 | //if (t_id != LL_TEXTURE_BLANK && t_id != LL_TEXTURE_INVISIBLE) | ||
711 | if (t_id.notNull()) | ||
558 | { | 712 | { |
559 | if( (*iter)==object->getTE(i)->getID()) | 713 | std::list<LLUUID>::iterator iter; |
560 | alreadyseen=true; | 714 | for (iter = mTexturesList.begin(); iter != mTexturesList.end(); iter++) |
715 | { | ||
716 | if ((*iter) == t_id) | ||
717 | alreadyseen = true; | ||
718 | } | ||
719 | if (alreadyseen == false) | ||
720 | mTexturesList.push_back(t_id); | ||
561 | } | 721 | } |
562 | if(alreadyseen==false) | ||
563 | textures.push_back(object->getTE(i)->getID()); | ||
564 | } | 722 | } |
565 | prim_llsd["textures"] = te_llsd; | 723 | prim_llsd["textures"] = te_llsd; |
566 | 724 | ||
@@ -570,43 +728,51 @@ LLSD primbackup::prims_to_llsd(LLViewerObject::child_list_t child_list) | |||
570 | llsd[(const char*)localid] = prim_llsd; | 728 | llsd[(const char*)localid] = prim_llsd; |
571 | } | 729 | } |
572 | 730 | ||
573 | updateexportnumbers(); | 731 | updateExportNumbers(); |
574 | 732 | ||
575 | return llsd; | 733 | return llsd; |
576 | } | 734 | } |
577 | 735 | ||
578 | 736 | void PrimBackup::exportNextTexture() | |
579 | void primbackup::export_next_texture() | ||
580 | { | 737 | { |
581 | if(textures.empty()) | 738 | if (mTexturesList.empty()) |
582 | { | 739 | { |
583 | llinfos << "Finished exporting textures "<<llendl; | 740 | llinfos << "Finished exporting textures" << llendl; |
584 | return; | 741 | return; |
585 | } | 742 | } |
586 | 743 | ||
587 | std::list<LLUUID>::iterator iter; | ||
588 | iter = textures.begin(); | ||
589 | |||
590 | LLUUID id; | 744 | LLUUID id; |
745 | std::list<LLUUID>::iterator iter; | ||
746 | iter = mTexturesList.begin(); | ||
591 | 747 | ||
592 | while(1) | 748 | while (true) |
593 | { | 749 | { |
594 | if(iter==textures.end()) | 750 | if (iter == mTexturesList.end()) |
595 | { | 751 | { |
596 | m_nexttextureready=true; | 752 | mNextTextureReady = true; |
597 | return; | 753 | return; |
598 | } | 754 | } |
599 | 755 | ||
600 | id=(*iter); | 756 | id = (*iter); |
757 | if (id.isNull()) | ||
758 | { | ||
759 | // NULL texture id: just remove and ignore. | ||
760 | mTexturesList.remove(id); | ||
761 | iter = mTexturesList.begin(); | ||
762 | continue; | ||
763 | } | ||
601 | 764 | ||
602 | LLViewerImage * imagep = gImageList.hasImage(id); | 765 | LLViewerImage* imagep = gImageList.hasImage(id); |
603 | if(imagep!=NULL) | 766 | if (imagep != NULL) |
604 | { | 767 | { |
605 | S32 cur_discard = imagep->getDiscardLevel(); | 768 | S32 cur_discard = imagep->getDiscardLevel(); |
606 | if(cur_discard>0) | 769 | if (cur_discard > 0) |
607 | { | 770 | { |
608 | if(imagep->getBoostLevel()!=LLViewerImageBoostLevel::BOOST_PREVIEW) | 771 | if (imagep->getBoostLevel() != LLViewerImageBoostLevel::BOOST_PREVIEW) |
609 | imagep->setBoostLevel(LLViewerImageBoostLevel::BOOST_PREVIEW); //we want to force discard 0 this one does this. | 772 | { |
773 | // we want to force discard 0: this one does this. | ||
774 | imagep->setBoostLevel(LLViewerImageBoostLevel::BOOST_PREVIEW); | ||
775 | } | ||
610 | } | 776 | } |
611 | else | 777 | else |
612 | { | 778 | { |
@@ -615,427 +781,428 @@ void primbackup::export_next_texture() | |||
615 | } | 781 | } |
616 | else | 782 | else |
617 | { | 783 | { |
618 | llwarns<<" We *DONT* have the texture "<<llendl; | 784 | llwarns << "We *DON'T* have the texture " << id.asString() << llendl; |
785 | mNonExportedTextures |= TEXTURE_MISSING; | ||
786 | mTexturesList.remove(id); | ||
787 | return; | ||
619 | } | 788 | } |
620 | iter++; | 789 | iter++; |
621 | } | 790 | } |
622 | 791 | ||
623 | textures.remove(id); | 792 | mTexturesList.remove(id); |
624 | 793 | ||
625 | llinfos<<"Requesting texture "<<id<<llendl; | 794 | llinfos << "Requesting texture " << id << llendl; |
626 | LLImageJ2C * mFormattedImage = new LLImageJ2C; | 795 | LLImageJ2C* mFormattedImage = new LLImageJ2C; |
627 | CacheReadResponder* responder = new CacheReadResponder(id, mFormattedImage); | 796 | CacheReadResponder* responder = new CacheReadResponder(id, mFormattedImage); |
628 | LLAppViewer::getTextureCache()->readFromCache(id,LLWorkerThread::PRIORITY_HIGH,0,999999,responder); | 797 | LLAppViewer::getTextureCache()->readFromCache(id, LLWorkerThread::PRIORITY_HIGH, 0, 999999, responder); |
629 | } | 798 | } |
630 | 799 | ||
631 | 800 | void PrimBackup::importObject(bool upload) | |
632 | |||
633 | void primbackup::import_object(bool upload) | ||
634 | { | 801 | { |
802 | mTexturesList.clear(); | ||
803 | mAssetMap.clear(); | ||
804 | mCurrentAsset = LLUUID::null; | ||
635 | 805 | ||
806 | setDefaultTextures(); | ||
636 | 807 | ||
637 | textures.clear(); | 808 | mRetexture = upload; |
638 | assetmap.clear(); | ||
639 | current_asset=LLUUID::null; | ||
640 | |||
641 | this->m_retexture=upload; | ||
642 | 809 | ||
643 | // Open the file open dialog | 810 | // Open the file open dialog |
644 | LLFilePicker& file_picker = LLFilePicker::instance(); | 811 | LLFilePicker& file_picker = LLFilePicker::instance(); |
645 | if( !file_picker.getOpenFile( LLFilePicker::FFLOAD_XML ) ) | 812 | if (!file_picker.getOpenFile(LLFilePicker::FFLOAD_XML)) |
646 | { | 813 | { |
647 | // User canceled save. | 814 | // User canceled save. |
648 | return; | 815 | return; |
649 | } | 816 | } |
650 | std::string file_name = file_picker.getFirstFile().c_str(); | 817 | std::string file_name = file_picker.getFirstFile().c_str(); |
651 | folder = gDirUtilp->getDirName(file_name); | 818 | mFolder = gDirUtilp->getDirName(file_name); |
652 | 819 | ||
653 | { | 820 | LLSD import_llsd; |
654 | LLSD import_llsd; | 821 | llifstream import_file(file_name); |
655 | llifstream import_file(file_name); | 822 | S32 status; |
656 | S32 status; | 823 | status = LLSDSerialize::fromXML(import_llsd, import_file); |
657 | status = LLSDSerialize::fromXML(import_llsd, import_file); | 824 | import_file.close(); |
658 | import_file.close(); | ||
659 | |||
660 | if (LLSDParser::PARSE_FAILURE == status) | ||
661 | { | ||
662 | llwarns << "invalid xml file." << llendl; | ||
663 | return; | ||
664 | } | ||
665 | 825 | ||
666 | llsd = import_llsd; | 826 | if (LLSDParser::PARSE_FAILURE == status) |
827 | { | ||
828 | llwarns << "invalid xml file." << llendl; | ||
829 | return; | ||
667 | } | 830 | } |
668 | 831 | ||
669 | show(); | 832 | mLLSD = import_llsd; |
833 | |||
834 | show(false); | ||
835 | |||
836 | mAgentPos = gAgent.getPositionAgent(); | ||
837 | mAgentRot = LLQuaternion(gAgent.getAtAxis(), gAgent.getLeftAxis(), gAgent.getUpAxis()); | ||
838 | |||
839 | // Get the texture map | ||
670 | 840 | ||
671 | //Get the texture map | ||
672 | |||
673 | LLSD::map_const_iterator prim_it; | 841 | LLSD::map_const_iterator prim_it; |
674 | LLSD::array_const_iterator prim_arr_it; | 842 | LLSD::array_const_iterator prim_arr_it; |
675 | |||
676 | this->m_curobject=1; | ||
677 | this->m_curprim=1; | ||
678 | this->m_objects=llsd["data"].size(); | ||
679 | this->m_prims=0; | ||
680 | rezcount=0; | ||
681 | 843 | ||
682 | updateimportnumbers(); | 844 | mCurObject = 1; |
845 | mCurPrim = 1; | ||
846 | mObjects = mLLSD["data"].size(); | ||
847 | mPrims = 0; | ||
848 | mRezCount = 0; | ||
849 | updateImportNumbers(); | ||
683 | 850 | ||
684 | for( prim_arr_it = llsd["data"].beginArray(); prim_arr_it != llsd["data"].endArray(); prim_arr_it++) | 851 | for (prim_arr_it = mLLSD["data"].beginArray(); prim_arr_it != mLLSD["data"].endArray(); prim_arr_it++) |
685 | { | 852 | { |
686 | |||
687 | LLSD llsd2; | 853 | LLSD llsd2; |
688 | llsd2=(*prim_arr_it)["group_body"]; | 854 | llsd2 = (*prim_arr_it)["group_body"]; |
689 | 855 | ||
690 | for( prim_it = llsd2.beginMap(); prim_it != llsd2.endMap(); prim_it++) | 856 | for (prim_it = llsd2.beginMap(); prim_it != llsd2.endMap(); prim_it++) |
691 | { | 857 | { |
692 | LLSD prim_llsd; | 858 | LLSD prim_llsd; |
693 | prim_llsd=llsd2[prim_it->first]; | 859 | prim_llsd = llsd2[prim_it->first]; |
694 | LLSD::array_iterator text_it; | 860 | LLSD::array_iterator text_it; |
695 | std::list<LLUUID>::iterator iter; | 861 | std::list<LLUUID>::iterator iter; |
696 | 862 | ||
697 | if(prim_llsd.has("sculpt")) | 863 | if (prim_llsd.has("sculpt")) |
698 | { | 864 | { |
699 | LLSculptParams* sculpt=new LLSculptParams(); | 865 | LLSculptParams* sculpt = new LLSculptParams(); |
700 | sculpt->fromLLSD(prim_llsd["sculpt"]); | 866 | sculpt->fromLLSD(prim_llsd["sculpt"]); |
701 | LLUUID orig=sculpt->getSculptTexture(); | 867 | LLUUID orig = sculpt->getSculptTexture(); |
702 | bool alreadyseen=false; | 868 | bool alreadyseen = false; |
703 | for(iter = textures.begin(); iter != textures.end() ; iter++) | 869 | for (iter = mTexturesList.begin(); iter != mTexturesList.end(); iter++) |
704 | { | 870 | { |
705 | if( (*iter)==orig) | 871 | if ((*iter) == orig) |
706 | alreadyseen=true; | 872 | alreadyseen = true; |
707 | } | 873 | } |
708 | if(alreadyseen==false) | 874 | if (alreadyseen == false) |
709 | { | 875 | { |
710 | llinfos << "Found a new SCULPT texture to upload "<<orig<<llendl; | 876 | llinfos << "Found a new SCULPT texture to upload " << orig << llendl; |
711 | textures.push_back(orig); | 877 | mTexturesList.push_back(orig); |
712 | } | 878 | } |
713 | } | 879 | } |
714 | 880 | ||
715 | |||
716 | LLSD te_llsd; | 881 | LLSD te_llsd; |
717 | te_llsd=prim_llsd["textures"]; | 882 | te_llsd = prim_llsd["textures"]; |
718 | 883 | ||
719 | 884 | for (text_it = te_llsd.beginArray(); text_it != te_llsd.endArray(); text_it++) | |
720 | for(text_it=te_llsd.beginArray(); text_it !=te_llsd.endArray(); text_it++) | ||
721 | { | 885 | { |
722 | LLSD the_te; | 886 | LLSD the_te; |
723 | the_te=(*text_it); | 887 | the_te = (*text_it); |
724 | LLTextureEntry te; | 888 | LLTextureEntry te; |
725 | te.fromLLSD(the_te); | 889 | te.fromLLSD(the_te); |
726 | 890 | ||
727 | te.getID(); | 891 | LLUUID id = te.getID(); |
728 | bool alreadyseen=false; | 892 | // We upload the default textures in case we're on a grid with different ones and they're part of the build -- MC |
729 | 893 | //if (id != LL_TEXTURE_PLYWOOD && id != LL_TEXTURE_BLANK && id != LL_TEXTURE_INVISIBLE) | |
730 | for(iter = textures.begin(); iter != textures.end() ; iter++) | 894 | if (id.notNull()) |
731 | { | 895 | { |
732 | if( (*iter)==te.getID()) | 896 | bool alreadyseen = false; |
733 | alreadyseen=true; | 897 | |
898 | for (iter = mTexturesList.begin(); iter != mTexturesList.end(); iter++) | ||
899 | { | ||
900 | if ((*iter) == te.getID()) | ||
901 | alreadyseen = true; | ||
902 | } | ||
903 | if (alreadyseen == false) | ||
904 | { | ||
905 | llinfos << "Found a new texture to upload "<< te.getID() << llendl; | ||
906 | mTexturesList.push_back(te.getID()); | ||
907 | } | ||
734 | } | 908 | } |
735 | if(alreadyseen==false) | ||
736 | { | ||
737 | llinfos << "Found a new texture to upload "<<te.getID()<<llendl; | ||
738 | textures.push_back(te.getID()); | ||
739 | } | ||
740 | } | 909 | } |
741 | |||
742 | } | 910 | } |
743 | } | 911 | } |
744 | 912 | ||
745 | if(m_retexture==TRUE) | 913 | if (mRetexture == TRUE) |
746 | upload_next_asset(); | 914 | uploadNextAsset(); |
747 | else | 915 | else |
748 | import_object1a(); | 916 | importFirstObject(); |
749 | } | 917 | } |
750 | 918 | ||
751 | LLVector3 primbackup::offset_agent(LLVector3 offset) | 919 | LLVector3 PrimBackup::offsetAgent(LLVector3 offset) |
752 | { | 920 | { |
753 | LLVector3 pos= gAgent.getPositionAgent(); | 921 | return offset * mAgentRot + mAgentPos; |
754 | LLQuaternion agent_rot=LLQuaternion(gAgent.getAtAxis(),gAgent.getLeftAxis(),gAgent.getUpAxis()); | ||
755 | pos=(offset*agent_rot+pos); | ||
756 | return pos; | ||
757 | } | 922 | } |
758 | 923 | ||
759 | void primbackup::rez_agent_offset(LLVector3 offset) | 924 | void PrimBackup::rezAgentOffset(LLVector3 offset) |
760 | { | 925 | { |
761 | // This will break for a sitting agent | 926 | // This will break for a sitting agent |
762 | LLToolPlacer* mPlacer = new LLToolPlacer(); | 927 | LLToolPlacer* mPlacer = new LLToolPlacer(); |
763 | mPlacer->setObjectType(LL_PCODE_CUBE); | 928 | mPlacer->setObjectType(LL_PCODE_CUBE); |
764 | //LLVector3 pos=offset_agent(offset); | 929 | //LLVector3 pos = offsetAgent(offset); |
765 | mPlacer->placeObject((S32)(offset.mV[0]), (S32)(offset.mV[1]), 0); | 930 | mPlacer->placeObject((S32)offset.mV[0], (S32)offset.mV[1], MASK_NONE); |
766 | } | 931 | } |
767 | 932 | ||
768 | void primbackup::import_object1a() | 933 | void PrimBackup::importFirstObject() |
769 | { | 934 | { |
770 | running=true; | 935 | mRunning = true; |
936 | show(false); | ||
937 | mGroupPrimImportIter = mLLSD["data"].beginArray(); | ||
938 | mRootRootPos = (*mGroupPrimImportIter)["root_position"]; | ||
939 | mObjects = mLLSD["data"].size(); | ||
940 | mCurObject = 1; | ||
941 | importNextObject(); | ||
942 | } | ||
771 | 943 | ||
772 | show(); | 944 | void PrimBackup::importNextObject() |
945 | { | ||
946 | mToSelect.clear(); | ||
947 | mRezCount = 0; | ||
773 | 948 | ||
774 | group_prim_import_iter=llsd["data"].beginArray(); | 949 | mThisGroup = (*mGroupPrimImportIter)["group_body"]; |
775 | root_root_pos=(*group_prim_import_iter)["root_position"]; | 950 | mPrimImportIter = mThisGroup.beginMap(); |
776 | 951 | ||
777 | this->m_objects=llsd["data"].size(); | 952 | mCurPrim = 0; |
778 | this->m_curobject=1; | 953 | mPrims = mThisGroup.size(); |
779 | import_next_object(); | 954 | updateImportNumbers(); |
780 | } | ||
781 | 955 | ||
782 | void primbackup::import_next_object() | 956 | LLVector3 lgpos = (*mGroupPrimImportIter)["root_position"]; |
783 | { | 957 | mGroupOffset = lgpos - mRootRootPos; |
784 | toselect.clear(); | 958 | mRootPos = offsetAgent(LLVector3(2.0, 0.0, 0.0)); |
785 | rezcount=0; | 959 | mRootRot = ll_quaternion_from_sd((*mGroupPrimImportIter)["root_rotation"]); |
786 | 960 | ||
787 | this_group=(*group_prim_import_iter)["group_body"]; | 961 | rezAgentOffset(LLVector3(0.0, 2.0, 0.0)); |
788 | prim_import_iter=this_group.beginMap(); | ||
789 | |||
790 | m_curprim=0; | ||
791 | m_prims=this_group.size(); | ||
792 | updateimportnumbers(); | ||
793 | LLVector3 lgpos=(*group_prim_import_iter)["root_position"]; | ||
794 | |||
795 | group_offset=lgpos-root_root_pos; | ||
796 | root_pos=offset_agent(LLVector3(2.0,0,0)); | ||
797 | root_rot=ll_quaternion_from_sd((*group_prim_import_iter)["root_rotation"]); | ||
798 | |||
799 | rez_agent_offset(LLVector3(0.0,2.0,0.0)); | ||
800 | // Now we must wait for the callback when ViewerObjectList gets the new objects and we have the correct number selected | 962 | // Now we must wait for the callback when ViewerObjectList gets the new objects and we have the correct number selected |
801 | } | 963 | } |
802 | 964 | ||
803 | // This function takes a pointer to a viewerobject and applys the prim definition that prim_llsd has | 965 | // This function takes a pointer to a viewerobject and applies the prim definition that prim_llsd has |
804 | void primbackup::xmltoprim(LLSD prim_llsd,LLViewerObject * object) | 966 | void PrimBackup::xmlToPrim(LLSD prim_llsd, LLViewerObject* object) |
805 | { | 967 | { |
806 | LLUUID id = object->getID(); | 968 | LLUUID id = object->getID(); |
807 | expecting_update = object->getID(); | 969 | mExpectingUpdate = object->getID(); |
808 | LLSelectMgr::getInstance()->selectObjectAndFamily(object); | 970 | LLSelectMgr::getInstance()->selectObjectAndFamily(object); |
809 | 971 | ||
810 | if(prim_llsd.has("parent")) | 972 | if (prim_llsd.has("name")) |
973 | { | ||
974 | LLSelectMgr::getInstance()->selectionSetObjectName(prim_llsd["name"]); | ||
975 | } | ||
976 | |||
977 | if (prim_llsd.has("description")) | ||
978 | { | ||
979 | LLSelectMgr::getInstance()->selectionSetObjectDescription(prim_llsd["description"]); | ||
980 | } | ||
981 | |||
982 | if (prim_llsd.has("parent")) | ||
811 | { | 983 | { |
812 | //we are not the root node. | 984 | //we are not the root node. |
813 | LLVector3 pos=prim_llsd["position"]; | 985 | LLVector3 pos = prim_llsd["position"]; |
814 | LLQuaternion rot=ll_quaternion_from_sd(prim_llsd["rotation"]); | 986 | LLQuaternion rot = ll_quaternion_from_sd(prim_llsd["rotation"]); |
815 | object->setPositionRegion((pos*root_rot)+(root_pos+group_offset)); | 987 | object->setPositionRegion(pos * mRootRot + mRootPos + mGroupOffset); |
816 | object->setRotation(rot*root_rot); | 988 | object->setRotation(rot * mRootRot); |
817 | } | 989 | } |
818 | else | 990 | else |
819 | { | 991 | { |
820 | object->setPositionRegion(root_pos+group_offset); | 992 | object->setPositionRegion(mRootPos + mGroupOffset); |
821 | LLQuaternion rot=ll_quaternion_from_sd(prim_llsd["rotation"]); | 993 | LLQuaternion rot=ll_quaternion_from_sd(prim_llsd["rotation"]); |
822 | object->setRotation(rot); | 994 | object->setRotation(rot); |
823 | } | 995 | } |
824 | 996 | ||
825 | object->setScale(prim_llsd["scale"]); | 997 | object->setScale(prim_llsd["scale"]); |
826 | 998 | ||
827 | if(prim_llsd.has("shadows")) | 999 | if (prim_llsd.has("shadows")) |
828 | if(prim_llsd["shadows"].asInteger()==1) | 1000 | if (prim_llsd["shadows"].asInteger() == 1) |
829 | object->setFlags(FLAGS_CAST_SHADOWS,true); | 1001 | object->setFlags(FLAGS_CAST_SHADOWS, true); |
830 | 1002 | ||
831 | if(prim_llsd.has("phantom")) | 1003 | if (prim_llsd.has("phantom")) |
832 | if(prim_llsd["phantom"].asInteger()==1) | 1004 | if (prim_llsd["phantom"].asInteger() == 1) |
833 | object->setFlags(FLAGS_PHANTOM,true); | 1005 | object->setFlags(FLAGS_PHANTOM, true); |
834 | 1006 | ||
835 | if(prim_llsd.has("physical")) | 1007 | if (prim_llsd.has("physical")) |
836 | if(prim_llsd["physical"].asInteger()==1) | 1008 | if (prim_llsd["physical"].asInteger() == 1) |
837 | object->setFlags(FLAGS_USE_PHYSICS,true); | 1009 | object->setFlags(FLAGS_USE_PHYSICS, true); |
838 | 1010 | ||
839 | // Volume params | 1011 | // Volume params |
840 | LLVolumeParams volume_params = object->getVolume()->getParams(); | 1012 | LLVolumeParams volume_params = object->getVolume()->getParams(); |
841 | volume_params.fromLLSD(prim_llsd["volume"]) ; | 1013 | volume_params.fromLLSD(prim_llsd["volume"]); |
842 | object->updateVolume(volume_params); | 1014 | object->updateVolume(volume_params); |
843 | 1015 | ||
844 | if(prim_llsd.has("sculpt")) | 1016 | if (prim_llsd.has("sculpt")) |
845 | { | 1017 | { |
846 | LLSculptParams* sculpt=new LLSculptParams(); | 1018 | LLSculptParams* sculpt = new LLSculptParams(); |
847 | sculpt->fromLLSD(prim_llsd["sculpt"]); | 1019 | sculpt->fromLLSD(prim_llsd["sculpt"]); |
848 | |||
849 | //TODO check if map is valid and only set texture is map is valid and changes | ||
850 | 1020 | ||
851 | if(assetmap[sculpt->getSculptTexture()].notNull()) | 1021 | // TODO: check if map is valid and only set texture if map is valid and changes |
1022 | |||
1023 | if (mAssetMap[sculpt->getSculptTexture()].notNull()) | ||
852 | { | 1024 | { |
853 | LLUUID replacment=assetmap[sculpt->getSculptTexture()]; | 1025 | LLUUID replacment = mAssetMap[sculpt->getSculptTexture()]; |
854 | sculpt->setSculptTexture(replacment); | 1026 | sculpt->setSculptTexture(replacment); |
855 | } | 1027 | } |
856 | 1028 | ||
857 | object->setParameterEntry(LLNetworkData::PARAMS_SCULPT,(LLNetworkData&)(*sculpt),true); | 1029 | object->setParameterEntry(LLNetworkData::PARAMS_SCULPT,(LLNetworkData&)(*sculpt),true); |
858 | } | 1030 | } |
859 | 1031 | ||
860 | if(prim_llsd.has("light")) | 1032 | if (prim_llsd.has("light")) |
861 | { | 1033 | { |
862 | LLLightParams * light=new LLLightParams(); | 1034 | LLLightParams* light = new LLLightParams(); |
863 | light->fromLLSD(prim_llsd["light"]); | 1035 | light->fromLLSD(prim_llsd["light"]); |
864 | object->setParameterEntry(LLNetworkData::PARAMS_LIGHT,(LLNetworkData&)(*light),true); | 1036 | object->setParameterEntry(LLNetworkData::PARAMS_LIGHT,(LLNetworkData&)(*light), true); |
865 | } | 1037 | } |
866 | 1038 | ||
867 | if(prim_llsd.has("flexible")) | 1039 | if (prim_llsd.has("flexible")) |
868 | { | 1040 | { |
869 | LLFlexibleObjectData* flex=new LLFlexibleObjectData(); | 1041 | LLFlexibleObjectData* flex = new LLFlexibleObjectData(); |
870 | flex->fromLLSD(prim_llsd["flexible"]); | 1042 | flex->fromLLSD(prim_llsd["flexible"]); |
871 | object->setParameterEntry(LLNetworkData::PARAMS_FLEXIBLE,(LLNetworkData&)(*flex),true); | 1043 | object->setParameterEntry(LLNetworkData::PARAMS_FLEXIBLE,(LLNetworkData&)(*flex), true); |
872 | } | 1044 | } |
873 | 1045 | ||
874 | |||
875 | // Textures | 1046 | // Textures |
876 | LLSD te_llsd; | ||
877 | llinfos << "Processing textures for prim" << llendl; | 1047 | llinfos << "Processing textures for prim" << llendl; |
878 | 1048 | LLSD te_llsd; | |
879 | te_llsd=prim_llsd["textures"]; | 1049 | te_llsd = prim_llsd["textures"]; |
880 | 1050 | ||
881 | LLSD::array_iterator text_it; | 1051 | LLSD::array_iterator text_it; |
882 | U8 i=0; | 1052 | U8 i = 0; |
883 | i=0; | ||
884 | 1053 | ||
885 | for(text_it=te_llsd.beginArray(); text_it !=te_llsd.endArray(); text_it++) | 1054 | for (text_it = te_llsd.beginArray(); text_it != te_llsd.endArray(); text_it++) |
886 | { | 1055 | { |
887 | LLSD the_te; | 1056 | LLSD the_te; |
888 | the_te=(*text_it); | 1057 | the_te = (*text_it); |
889 | LLTextureEntry te; | 1058 | LLTextureEntry te; |
890 | te.fromLLSD(the_te); | 1059 | te.fromLLSD(the_te); |
891 | 1060 | ||
892 | if(assetmap[te.getID()].notNull()) | 1061 | if (mAssetMap[te.getID()].notNull()) |
893 | { | 1062 | { |
894 | LLUUID replacment=assetmap[te.getID()]; | 1063 | LLUUID replacment = mAssetMap[te.getID()]; |
895 | te.setID(replacment); | 1064 | te.setID(replacment); |
896 | } | 1065 | } |
897 | 1066 | ||
898 | object->setTE(i,te); // | 1067 | object->setTE(i, te); |
899 | i++; | 1068 | i++; |
900 | } | 1069 | } |
901 | 1070 | ||
902 | llinfos << "Textures done!" << llendl; | 1071 | llinfos << "Textures done!" << llendl; |
903 | 1072 | ||
904 | //bump the iterator now so the callbacks hook together nicely | 1073 | //bump the iterator now so the callbacks hook together nicely |
905 | //if(prim_import_iter!=this_group.endMap()) | 1074 | //if (mPrimImportIter != mThisGroup.endMap()) |
906 | // prim_import_iter++; | 1075 | // mPrimImportIter++; |
907 | 1076 | ||
908 | object->sendRotationUpdate(); | 1077 | object->sendRotationUpdate(); |
909 | object->sendTEUpdate(); | 1078 | object->sendTEUpdate(); |
910 | object->sendShapeUpdate(); | 1079 | object->sendShapeUpdate(); |
911 | LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_SCALE |UPD_POSITION); | 1080 | LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_SCALE | UPD_POSITION); |
912 | 1081 | ||
913 | LLSelectMgr::getInstance()->deselectAll(); | 1082 | LLSelectMgr::getInstance()->deselectAll(); |
914 | } | 1083 | } |
915 | 1084 | ||
916 | //This is fired when the update packet is processed so we know the prim settings have stuck | 1085 | // This is fired when the update packet is processed so we know the prim settings have stuck |
917 | void primbackup::prim_update(LLViewerObject* object) | 1086 | void PrimBackup::primUpdate(LLViewerObject* object) |
918 | { | 1087 | { |
919 | if(!running) | 1088 | if (!mRunning) |
920 | return; | 1089 | return; |
921 | 1090 | ||
922 | if(object!=NULL) | 1091 | if (object != NULL) |
923 | if(object->mID!=expecting_update) | 1092 | if (object->mID != mExpectingUpdate) |
924 | return; | 1093 | return; |
925 | 1094 | ||
926 | m_curprim++; | 1095 | mCurPrim++; |
927 | updateimportnumbers(); | 1096 | updateImportNumbers(); |
928 | 1097 | mPrimImportIter++; | |
929 | prim_import_iter++; | ||
930 | 1098 | ||
931 | LLUUID x; | 1099 | LLUUID x; |
932 | expecting_update=x.null; | 1100 | mExpectingUpdate = x.null; |
933 | 1101 | ||
934 | if(prim_import_iter==this_group.endMap()) | 1102 | if (mPrimImportIter == mThisGroup.endMap()) |
935 | { | 1103 | { |
936 | llinfos<<"Trying to link"<<llendl; | 1104 | llinfos << "Trying to link" << llendl; |
937 | 1105 | ||
938 | if(toselect.size()>1) | 1106 | if (mToSelect.size() > 1) |
939 | { | 1107 | { |
940 | std::reverse(toselect.begin(),toselect.end()); | 1108 | std::reverse(mToSelect.begin(), mToSelect.end()); |
941 | //Now link | 1109 | // Now link |
942 | LLSelectMgr::getInstance()->deselectAll(); | 1110 | LLSelectMgr::getInstance()->deselectAll(); |
943 | LLSelectMgr::getInstance()->selectObjectAndFamily(toselect,true); | 1111 | LLSelectMgr::getInstance()->selectObjectAndFamily(mToSelect, true); |
944 | LLSelectMgr::getInstance()->sendLink(); | 1112 | LLSelectMgr::getInstance()->sendLink(); |
945 | LLViewerObject * root=toselect.back(); | 1113 | LLViewerObject* root = mToSelect.back(); |
946 | root->setRotation(root_rot); | 1114 | root->setRotation(mRootRot); |
947 | } | 1115 | } |
948 | 1116 | ||
949 | this->m_curobject++; | 1117 | mCurObject++; |
950 | group_prim_import_iter++; | 1118 | mGroupPrimImportIter++; |
951 | if(group_prim_import_iter!=llsd["data"].endArray()) | 1119 | if (mGroupPrimImportIter != mLLSD["data"].endArray()) |
952 | { | 1120 | { |
953 | import_next_object(); | 1121 | importNextObject(); |
954 | return; | 1122 | return; |
955 | } | 1123 | } |
956 | 1124 | ||
957 | running=false; | 1125 | mRunning = false; |
958 | this->close(); | 1126 | close(); |
959 | return; | 1127 | return; |
960 | } | 1128 | } |
961 | 1129 | ||
962 | LLSD prim_llsd; | 1130 | LLSD prim_llsd; |
963 | prim_llsd=this_group[prim_import_iter->first]; | 1131 | prim_llsd = mThisGroup[mPrimImportIter->first]; |
964 | 1132 | ||
965 | if(toselect.empty()) | 1133 | if (mToSelect.empty()) |
966 | { | 1134 | { |
967 | llwarns << "error: ran out of objects to mod" << llendl; | 1135 | llwarns << "error: ran out of objects to mod" << llendl; |
968 | return; | 1136 | return; |
969 | } | 1137 | } |
970 | 1138 | ||
971 | if(prim_import_iter!=this_group.endMap()) | 1139 | if (mPrimImportIter != mThisGroup.endMap()) |
972 | { | 1140 | { |
973 | //rez_agent_offset(LLVector3(1.0,0,0)); | 1141 | //rezAgentOffset(LLVector3(1.0, 0.0, 0.0)); |
974 | LLSD prim_llsd=this_group[prim_import_iter->first]; | 1142 | LLSD prim_llsd = mThisGroup[mPrimImportIter->first]; |
975 | process_iter++; | 1143 | mProcessIter++; |
976 | xmltoprim(prim_llsd,(*process_iter)); | 1144 | xmlToPrim(prim_llsd, *mProcessIter); |
977 | } | 1145 | } |
978 | } | 1146 | } |
979 | 1147 | ||
980 | // Callback when we rez a new object when the importer is running. | 1148 | // Callback when we rez a new object when the importer is running. |
981 | bool primbackup::newprim(LLViewerObject * pobject) | 1149 | bool PrimBackup::newPrim(LLViewerObject* pobject) |
982 | { | 1150 | { |
983 | if(running) | 1151 | if (mRunning) |
984 | { | 1152 | { |
985 | rezcount++; | 1153 | mRezCount++; |
986 | toselect.push_back(pobject); | 1154 | mToSelect.push_back(pobject); |
987 | updateimportnumbers(); | 1155 | updateImportNumbers(); |
988 | prim_import_iter++; | 1156 | mPrimImportIter++; |
989 | 1157 | ||
990 | if(prim_import_iter!=this_group.endMap()) | 1158 | if (mPrimImportIter != mThisGroup.endMap()) |
991 | { | 1159 | { |
992 | 1160 | pobject->setPosition(offsetAgent(LLVector3(0.0, 1.0, 0.0))); | |
993 | pobject->setPosition(this->offset_agent(LLVector3(0,1.0,0))); | ||
994 | LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION); | 1161 | LLSelectMgr::getInstance()->sendMultipleUpdate(UPD_POSITION); |
995 | 1162 | ||
996 | rez_agent_offset(LLVector3(1.0,0,0)); | 1163 | rezAgentOffset(LLVector3(1.0, 0.0 ,0.0)); |
997 | } | 1164 | } |
998 | else | 1165 | else |
999 | { | 1166 | { |
1000 | llinfos << "All prims rezed, moving to build stage" <<llendl; | 1167 | llinfos << "All prims rezzed, moving to build stage" << llendl; |
1001 | prim_import_iter=this_group.beginMap(); | 1168 | // Deselecting is required to ensure that the first child prim |
1002 | LLSD prim_llsd=this_group[prim_import_iter->first]; | 1169 | // in the link set (which is also the last rezzed prim and thus |
1003 | process_iter=toselect.begin(); | 1170 | // currently selected) will be properly renamed and desced. |
1004 | xmltoprim(prim_llsd,(*process_iter)); | 1171 | LLSelectMgr::getInstance()->deselectAll(); |
1172 | mPrimImportIter = mThisGroup.beginMap(); | ||
1173 | LLSD prim_llsd = mThisGroup[mPrimImportIter->first]; | ||
1174 | mProcessIter = mToSelect.begin(); | ||
1175 | xmlToPrim(prim_llsd, *mProcessIter); | ||
1005 | } | 1176 | } |
1006 | } | 1177 | } |
1007 | |||
1008 | return true; | 1178 | return true; |
1009 | } | 1179 | } |
1010 | 1180 | ||
1011 | void primbackup::update_map(LLUUID uploaded_asset) | 1181 | void PrimBackup::updateMap(LLUUID uploaded_asset) |
1012 | { | 1182 | { |
1013 | if(current_asset.isNull()) | 1183 | if (mCurrentAsset.isNull()) |
1014 | return; | 1184 | return; |
1015 | 1185 | ||
1016 | assetmap.insert(std::pair<LLUUID,LLUUID>(current_asset,uploaded_asset)); | 1186 | llinfos << "Mapping " << mCurrentAsset << " to " << uploaded_asset << llendl; |
1017 | llinfos << "Mapping "<<current_asset<<" to "<<uploaded_asset<<llendl; | 1187 | mAssetMap.insert(std::pair<LLUUID, LLUUID>(mCurrentAsset, uploaded_asset)); |
1018 | |||
1019 | } | 1188 | } |
1020 | 1189 | ||
1021 | 1190 | ||
1022 | void myupload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_type, | 1191 | void myupload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_type, |
1023 | std::string name, | 1192 | std::string name, std::string desc, S32 compression_info, |
1024 | std::string desc, S32 compression_info, | ||
1025 | LLAssetType::EType destination_folder_type, | 1193 | LLAssetType::EType destination_folder_type, |
1026 | LLInventoryType::EType inv_type, | 1194 | LLInventoryType::EType inv_type, U32 next_owner_perm, |
1027 | U32 next_owner_perm, | ||
1028 | const std::string& display_name, | 1195 | const std::string& display_name, |
1029 | LLAssetStorage::LLStoreAssetCallback callback, | 1196 | LLAssetStorage::LLStoreAssetCallback callback, |
1030 | void *userdata) | 1197 | void *userdata) |
1031 | { | 1198 | { |
1032 | if(gDisconnected) | 1199 | if (gDisconnected) |
1033 | { | 1200 | { |
1034 | return ; | 1201 | return; |
1035 | } | 1202 | } |
1036 | 1203 | ||
1037 | LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); | 1204 | LLAssetID uuid = tid.makeAssetID(gAgent.getSecureSessionID()); |
1038 | 1205 | ||
1039 | // At this point, we're ready for the upload. | 1206 | // At this point, we're ready for the upload. |
1040 | std::string upload_message = "Uploading...\n\n"; | 1207 | std::string upload_message = "Uploading...\n\n"; |
1041 | upload_message.append(display_name); | 1208 | upload_message.append(display_name); |
@@ -1050,66 +1217,61 @@ void myupload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ | |||
1050 | body["inventory_type"] = LLInventoryType::lookup(inv_type); | 1217 | body["inventory_type"] = LLInventoryType::lookup(inv_type); |
1051 | body["name"] = name; | 1218 | body["name"] = name; |
1052 | body["description"] = desc; | 1219 | body["description"] = desc; |
1053 | 1220 | ||
1054 | std::ostringstream llsdxml; | 1221 | std::ostringstream llsdxml; |
1055 | LLSDSerialize::toXML(body, llsdxml); | 1222 | LLSDSerialize::toXML(body, llsdxml); |
1056 | lldebugs << "posting body to capability: " << llsdxml.str() << llendl; | 1223 | lldebugs << "posting body to capability: " << llsdxml.str() << llendl; |
1057 | //LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, uuid, asset_type)); | 1224 | //LLHTTPClient::post(url, body, new LLNewAgentInventoryResponder(body, uuid, asset_type)); |
1058 | LLHTTPClient::post(url, body, new importResponder(body, uuid, asset_type)); | 1225 | LLHTTPClient::post(url, body, new importResponder(body, uuid, asset_type)); |
1059 | |||
1060 | } | 1226 | } |
1061 | else | 1227 | else |
1062 | { | 1228 | { |
1063 | llinfos << "NewAgentInventory capability not found, FUCK!" << llendl; | 1229 | llinfos << "NewAgentInventory capability not found. Can't upload !" << llendl; |
1064 | } | 1230 | } |
1065 | } | 1231 | } |
1066 | 1232 | ||
1067 | 1233 | void PrimBackup::uploadNextAsset() | |
1068 | |||
1069 | void primbackup::upload_next_asset() | ||
1070 | { | 1234 | { |
1071 | if(textures.empty()) | 1235 | if (mTexturesList.empty()) |
1072 | { | 1236 | { |
1073 | llinfos<<" Texture list is empty, moving to rez statge"<< llendl; | 1237 | llinfos << "Texture list is empty, moving to rez stage." << llendl; |
1074 | current_asset=LLUUID::null; | 1238 | mCurrentAsset = LLUUID::null; |
1075 | import_object1a(); | 1239 | importFirstObject(); |
1076 | return; | 1240 | return; |
1077 | } | 1241 | } |
1078 | 1242 | ||
1079 | this->updateimportnumbers(); | 1243 | updateImportNumbers(); |
1080 | 1244 | ||
1081 | std::list<LLUUID>::iterator iter; | 1245 | std::list<LLUUID>::iterator iter; |
1082 | iter=textures.begin(); | 1246 | iter = mTexturesList.begin(); |
1083 | LLUUID id=(*iter); | 1247 | LLUUID id = *iter; |
1084 | textures.pop_front(); | 1248 | mTexturesList.pop_front(); |
1085 | 1249 | ||
1086 | llinfos<<"Got texture ID "<<id<< "trying to upload"<<llendl; | 1250 | llinfos << "Got texture ID " << id << ": trying to upload" << llendl; |
1087 | 1251 | ||
1088 | current_asset=id; | 1252 | mCurrentAsset = id; |
1089 | std::string struid; | 1253 | std::string struid; |
1090 | id.toString(struid); | 1254 | id.toString(struid); |
1091 | std::string filename=folder+"//"+struid; | 1255 | std::string filename = mFolder + "//" + struid; |
1092 | |||
1093 | |||
1094 | LLAssetID uuid; | 1256 | LLAssetID uuid; |
1095 | LLTransactionID tid; | 1257 | LLTransactionID tid; |
1096 | 1258 | ||
1097 | // gen a new transaction ID for this asset | 1259 | // generate a new transaction ID for this asset |
1098 | tid.generate(); | 1260 | tid.generate(); |
1099 | uuid = tid.makeAssetID(gAgent.getSecureSessionID()); | 1261 | uuid = tid.makeAssetID(gAgent.getSecureSessionID()); |
1100 | 1262 | ||
1101 | S32 file_size; | 1263 | S32 file_size; |
1102 | apr_file_t* fp; | 1264 | apr_file_t* fp; |
1103 | LLAPRFile aFile; | 1265 | LLAPRFile aFile; |
1104 | aFile.open(filename, LL_APR_RB, LLAPRFile::global, &file_size); | 1266 | aFile.open(filename, LL_APR_RB, LLAPRFile::global, &file_size); |
1105 | fp = aFile.getFileHandle(); | 1267 | fp = aFile.getFileHandle(); |
1106 | if (fp) | 1268 | if (fp) |
1107 | { | 1269 | { |
1108 | const S32 buf_size = 65536; | 1270 | const S32 buf_size = 65536; |
1109 | U8 copy_buf[buf_size]; | 1271 | U8 copy_buf[buf_size]; |
1110 | LLVFile file(gVFS, uuid, LLAssetType::AT_TEXTURE, LLVFile::WRITE); | 1272 | LLVFile file(gVFS, uuid, LLAssetType::AT_TEXTURE, LLVFile::WRITE); |
1111 | file.setMaxSize(file_size); | 1273 | file.setMaxSize(file_size); |
1112 | 1274 | ||
1113 | while ((file_size =aFile.read(copy_buf, buf_size))) | 1275 | while ((file_size =aFile.read(copy_buf, buf_size))) |
1114 | { | 1276 | { |
1115 | file.write(copy_buf, file_size); | 1277 | file.write(copy_buf, file_size); |
@@ -1118,21 +1280,12 @@ void primbackup::upload_next_asset() | |||
1118 | } | 1280 | } |
1119 | else | 1281 | else |
1120 | { | 1282 | { |
1121 | llwarns<<"Unable to access output file "<<filename<<llendl; | 1283 | llwarns << "Unable to access output file " << filename << llendl; |
1122 | upload_next_asset(); | 1284 | uploadNextAsset(); |
1123 | return; | 1285 | return; |
1124 | } | 1286 | } |
1125 | 1287 | ||
1126 | myupload_new_resource( | 1288 | myupload_new_resource(tid, LLAssetType::AT_TEXTURE, struid, struid, 0, |
1127 | tid, LLAssetType::AT_TEXTURE, struid, | 1289 | LLAssetType::AT_TEXTURE, LLInventoryType::defaultForAssetType(LLAssetType::AT_TEXTURE), |
1128 | struid, 0, | 1290 | 0x0, "Uploaded texture", NULL, NULL); |
1129 | LLAssetType::AT_TEXTURE, | ||
1130 | LLInventoryType::defaultForAssetType(LLAssetType::AT_TEXTURE), | ||
1131 | 0x0, | ||
1132 | "Uploaded texture", | ||
1133 | NULL, | ||
1134 | NULL); | ||
1135 | |||
1136 | |||
1137 | } | 1291 | } |
1138 | |||
diff --git a/linden/indra/newview/primbackup.h b/linden/indra/newview/primbackup.h index cbd757a..97dd489 100644 --- a/linden/indra/newview/primbackup.h +++ b/linden/indra/newview/primbackup.h | |||
@@ -1,134 +1,149 @@ | |||
1 | 1 | ||
2 | #include "llviewerinventory.h" | 2 | #include "llviewerinventory.h" |
3 | 3 | ||
4 | #define LL_GRID_PERMISSIONS 1 | 4 | enum export_states { |
5 | 5 | EXPORT_INIT, | |
6 | enum export_states {EXPORT_INIT,EXPORT_STRUCTURE,EXPORT_TEXTURES,EXPORT_LLSD,EXPORT_DONE}; | 6 | EXPORT_STRUCTURE, |
7 | 7 | EXPORT_TEXTURES, | |
8 | class primbackup : public LLFloater | 8 | EXPORT_LLSD, |
9 | EXPORT_DONE, | ||
10 | EXPORT_FAILED | ||
11 | }; | ||
9 | 12 | ||
13 | class PrimBackup : public LLFloater | ||
10 | { | 14 | { |
11 | public: | 15 | public: |
12 | //Export state machine | 16 | virtual ~PrimBackup(); |
13 | enum export_states export_state; | 17 | |
14 | 18 | // Floater stuff | |
15 | //Export idle callback | 19 | virtual void show(bool exporting); |
16 | static void exportworker(void *userdata); | ||
17 | |||
18 | //Static accessor | ||
19 | static primbackup* getInstance(); | ||
20 | |||
21 | static bool check_perms( LLSelectNode* node ); | ||
22 | |||
23 | virtual ~primbackup(); | ||
24 | |||
25 | //Floater stuff | ||
26 | virtual void show(); | ||
27 | virtual void draw(); | 20 | virtual void draw(); |
28 | virtual void onClose( bool app_quitting ); | 21 | virtual void onClose(bool app_quitting); |
29 | 22 | ||
30 | //Import entry point | 23 | // Static accessor |
31 | void import_object(bool upload=FALSE); | 24 | static PrimBackup* getInstance(); |
32 | |||
33 | //Export entry point | ||
34 | void pre_export_object(); | ||
35 | 25 | ||
36 | //Update map from texture worker | 26 | // Export idle callback |
37 | void update_map(LLUUID uploaded_asset); | 27 | static void exportWorker(void *userdata); |
38 | 28 | ||
39 | //Move to next texture upload | 29 | // Import entry point |
40 | void upload_next_asset(); | 30 | void importObject(bool upload=FALSE); |
41 | 31 | ||
42 | // is ready for next texture? | 32 | // Export entry point |
43 | bool m_nexttextureready; | 33 | void exportObject(); |
44 | 34 | ||
45 | //Folder public geter | 35 | // Update map from texture worker |
46 | std::string getfolder() {return folder;}; | 36 | void updateMap(LLUUID uploaded_asset); |
47 | 37 | ||
48 | //Prim updated callback | 38 | // Move to next texture upload |
49 | void prim_update(LLViewerObject* object); | 39 | void uploadNextAsset(); |
50 | 40 | ||
51 | //New prim call back | 41 | // Folder public geter |
52 | bool newprim(LLViewerObject * pobject); | 42 | std::string getfolder() { return mFolder; }; |
53 | 43 | ||
54 | private: | 44 | // Prim updated callback |
45 | void primUpdate(LLViewerObject* object); | ||
55 | 46 | ||
56 | //Static singleton stuff | 47 | // New prim call back |
57 | primbackup(); | 48 | bool newPrim(LLViewerObject* pobject); |
58 | static primbackup* sInstance; | ||
59 | 49 | ||
60 | // are we active flag | 50 | static const U32 TEXTURE_OK = 0x00; |
61 | bool running; | 51 | static const U32 TEXTURE_BAD_PERM = 0x01; |
52 | static const U32 TEXTURE_MISSING = 0x02; | ||
53 | static const U32 TEXTURE_BAD_ENCODING = 0x04; | ||
54 | static const U32 TEXTURE_IS_NULL = 0x08; | ||
55 | static const U32 TEXTURE_SAVED_FAILED = 0x10; | ||
62 | 56 | ||
63 | //file and folder name control | 57 | // Is ready for next texture? |
64 | std::string file_name; | 58 | bool mNextTextureReady; |
65 | std::string folder; | ||
66 | 59 | ||
67 | // True if we need to rebase the assets | 60 | // Export state machine |
68 | bool m_retexture; | 61 | enum export_states mExportState; |
69 | 62 | ||
70 | //Counts of import and export objects and textures and prims | 63 | // Export result flags for textures. |
71 | int m_objects,m_curobject; | 64 | U32 mNonExportedTextures; |
72 | int m_prims,m_curprim; | ||
73 | int m_textures,m_curtexture; | ||
74 | 65 | ||
75 | // No prims rezed | 66 | static bool validatePerms(const LLPermissions* item_permissions); |
76 | int rezcount; | 67 | |
68 | private: | ||
69 | // Static singleton stuff | ||
70 | PrimBackup(); | ||
71 | static PrimBackup* sInstance; | ||
77 | 72 | ||
78 | // Update the floater with status numbers | 73 | // Update the floater with status numbers |
79 | void updateimportnumbers(); | 74 | void updateImportNumbers(); |
80 | void updateexportnumbers(); | 75 | void updateExportNumbers(); |
76 | |||
77 | // Permissions stuff. | ||
78 | LLUUID validateTextureID(LLUUID asset_id); | ||
79 | |||
80 | // Convert a selection list of objects to LLSD | ||
81 | LLSD primsToLLSD(LLViewerObject::child_list_t child_list, bool is_attachment); | ||
81 | 82 | ||
82 | //Convert a selection list of objects to LLSD | ||
83 | LLSD prims_to_llsd(LLViewerObject::child_list_t child_list); | ||
84 | |||
85 | // Start the import process | 83 | // Start the import process |
86 | void import_object1a(); | 84 | void importFirstObject(); |
87 | 85 | ||
88 | //Export the next texture in list | 86 | // Move to the next import group |
89 | void export_next_texture(); | 87 | void importNextObject(); |
90 | 88 | ||
91 | //apply LLSD to object | 89 | // Export the next texture in list |
92 | void xmltoprim(LLSD prim_llsd,LLViewerObject * pobject); | 90 | void exportNextTexture(); |
93 | |||
94 | 91 | ||
95 | //rez a prim at a given position (note not agent offset X/Y screen for raycast) | 92 | // Apply LLSD to object |
96 | void rez_agent_offset(LLVector3 offset); | 93 | void xmlToPrim(LLSD prim_llsd, LLViewerObject* pobject); |
97 | |||
98 | //Move to the next import group | ||
99 | void import_next_object(); | ||
100 | |||
101 | //Get an offset from the agent based on rotation and current pos | ||
102 | LLVector3 offset_agent(LLVector3 offset); | ||
103 | 94 | ||
104 | // Rebase map | 95 | // Rez a prim at a given position (note not agent offset X/Y screen for raycast) |
105 | std::map<LLUUID,LLUUID> assetmap; | 96 | void rezAgentOffset(LLVector3 offset); |
106 | |||
107 | //Export texture list | ||
108 | std::list<LLUUID> textures; | ||
109 | |||
110 | //Import object tracking | ||
111 | std::vector<LLViewerObject *> toselect; | ||
112 | std::vector<LLViewerObject *>::iterator process_iter; | ||
113 | |||
114 | //Working LLSD holders | ||
115 | LLUUID current_asset; | ||
116 | LLSD llsd; | ||
117 | LLSD this_group; | ||
118 | LLUUID expecting_update; | ||
119 | |||
120 | //working llsd itterators for objects and linksets | ||
121 | LLSD::map_const_iterator prim_import_iter; | ||
122 | LLSD::array_const_iterator group_prim_import_iter; | ||
123 | |||
124 | // Root pos and central root pos for link set | ||
125 | LLVector3 root_pos; | ||
126 | LLVector3 root_root_pos; | ||
127 | LLVector3 group_offset; | ||
128 | |||
129 | //Agent inital pos and rot when starting import | ||
130 | LLQuaternion root_rot; | ||
131 | LLQuaternion agent_rot; | ||
132 | 97 | ||
133 | }; | 98 | // Get an offset from the agent based on rotation and current pos |
99 | LLVector3 offsetAgent(LLVector3 offset); | ||
100 | |||
101 | // Are we active flag | ||
102 | bool mRunning; | ||
103 | |||
104 | // File and folder name control | ||
105 | std::string mFileName; | ||
106 | std::string mFolder; | ||
107 | |||
108 | // True if we need to rebase the assets | ||
109 | bool mRetexture; | ||
134 | 110 | ||
111 | // Counts of import and export objects and prims | ||
112 | U32 mObjects; | ||
113 | U32 mCurObject; | ||
114 | U32 mPrims; | ||
115 | U32 mCurPrim; | ||
116 | |||
117 | // No prims rezed | ||
118 | U32 mRezCount; | ||
119 | |||
120 | // Rebase map | ||
121 | std::map<LLUUID,LLUUID> mAssetMap; | ||
122 | |||
123 | // Export texture list | ||
124 | std::list<LLUUID> mTexturesList; | ||
125 | |||
126 | // Import object tracking | ||
127 | std::vector<LLViewerObject*> mToSelect; | ||
128 | std::vector<LLViewerObject*>::iterator mProcessIter; | ||
129 | |||
130 | // Working LLSD holders | ||
131 | LLUUID mCurrentAsset; | ||
132 | LLSD mLLSD; | ||
133 | LLSD mThisGroup; | ||
134 | LLUUID mExpectingUpdate; | ||
135 | |||
136 | // Working llsd itterators for objects and linksets | ||
137 | LLSD::map_const_iterator mPrimImportIter; | ||
138 | LLSD::array_const_iterator mGroupPrimImportIter; | ||
139 | |||
140 | // Root pos and rotation and central root pos for link set | ||
141 | LLVector3 mRootPos; | ||
142 | LLQuaternion mRootRot; | ||
143 | LLVector3 mRootRootPos; | ||
144 | LLVector3 mGroupOffset; | ||
145 | |||
146 | // Agent inital pos and rot when starting import | ||
147 | LLVector3 mAgentPos; | ||
148 | LLQuaternion mAgentRot; | ||
149 | }; | ||
diff --git a/linden/indra/newview/skins/default/xui/de/floater_instant_message.xml b/linden/indra/newview/skins/default/xui/de/floater_instant_message.xml index fb40e39..fe38b2a 100644 --- a/linden/indra/newview/skins/default/xui/de/floater_instant_message.xml +++ b/linden/indra/newview/skins/default/xui/de/floater_instant_message.xml | |||
@@ -36,21 +36,21 @@ | |||
36 | <string name="add_friend_string"> | 36 | <string name="add_friend_string"> |
37 | Freund hinzufügen | 37 | Freund hinzufügen |
38 | </string> | 38 | </string> |
39 | <flyout_button label="Profil..." name="profile_callee_btn"/> | 39 | <flyout_button label="Profil..." name="profile_callee_btn"> |
40 | <flyout_button_item name="history_entry"> | 40 | <flyout_button_item name="history_entry"> |
41 | Verlauf anzeigen | 41 | Verlauf anzeigen |
42 | </flyout_button_item> | 42 | </flyout_button_item> |
43 | <flyout_button_item name="pay_entry"> | 43 | <flyout_button_item name="pay_entry"> |
44 | Bezahlen | 44 | Bezahlen |
45 | </flyout_button_item> | 45 | </flyout_button_item> |
46 | <flyout_button_name="teleport_entry"> | 46 | <flyout_button_item name="teleport_entry"> |
47 | Teleport anbieten | 47 | Teleport anbieten |
48 | </flyout_button_item> | 48 | </flyout_button_item> |
49 | </flyout_button> | 49 | </flyout_button> |
50 | <button label="Anrufen" name="start_call_btn" pad_right="7" width="115"/> | 50 | <button label="Anrufen" name="start_call_btn" pad_right="7" width="115"/> |
51 | <button halign="right" label="Anruf beenden" name="end_call_btn" width="115"/> | 51 | <button halign="right" label="Anruf beenden" name="end_call_btn" width="115"/> |
52 | <text name="inventory_send"> | 52 | <text name="inventory_send"> |
53 | Inventar hier hereinziehen (Drag & Drop), um es zu senden | 53 | Inventar hier hereinziehen (Drag & Drop), um es zu senden |
54 | </text> | 54 | </text> |
55 | <panel left_delta="111" name="speaker_controls"> | 55 | <panel left_delta="111" name="speaker_controls"> |
56 | <button label="" name="mute_btn" tool_tip="Voice stummschalten"/> | 56 | <button label="" name="mute_btn" tool_tip="Voice stummschalten"/> |
diff --git a/linden/indra/newview/skins/default/xui/de/floater_instant_message_group.xml b/linden/indra/newview/skins/default/xui/de/floater_instant_message_group.xml index 04a8b08..848413c 100644 --- a/linden/indra/newview/skins/default/xui/de/floater_instant_message_group.xml +++ b/linden/indra/newview/skins/default/xui/de/floater_instant_message_group.xml | |||
@@ -38,7 +38,7 @@ | |||
38 | </string> | 38 | </string> |
39 | <layout_stack name="panels"> | 39 | <layout_stack name="panels"> |
40 | <layout_panel name="im_contents_panel"> | 40 | <layout_panel name="im_contents_panel"> |
41 | <flyout_button label="Gruppeninfo" name="group_info_btn" width="85"/> | 41 | <flyout_button label="Gruppeninfo" name="group_info_btn" width="85"> |
42 | <flyout_button_item name="history_entry"> | 42 | <flyout_button_item name="history_entry"> |
43 | Verlauf anzeigen | 43 | Verlauf anzeigen |
44 | </flyout_button_item> | 44 | </flyout_button_item> |
diff --git a/linden/indra/newview/skins/default/xui/de/notifications.xml b/linden/indra/newview/skins/default/xui/de/notifications.xml index 3e08d33..aedfe41 100644 --- a/linden/indra/newview/skins/default/xui/de/notifications.xml +++ b/linden/indra/newview/skins/default/xui/de/notifications.xml | |||
@@ -2996,4 +2996,8 @@ Sollte das Problem fortbestehen, finden Sie weitere Hilfestellung unter: http:// | |||
2996 | <global name="PermNo"> | 2996 | <global name="PermNo"> |
2997 | Nein | 2997 | Nein |
2998 | </global> | 2998 | </global> |
2999 | |||
3000 | |||
3001 | <global name="view history">Verlauf anzeigen</global> | ||
3002 | |||
2999 | </notifications> | 3003 | </notifications> |
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_about.xml b/linden/indra/newview/skins/default/xui/en-us/floater_about.xml index 95cdcd0..d40d11d 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_about.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_about.xml | |||
@@ -40,6 +40,7 @@ | |||
40 | http://onefang.net/redmine/ for bug reports, feature requests, bitching, and downloads. | 40 | http://onefang.net/redmine/ for bug reports, feature requests, bitching, and downloads. |
41 | http://github.com/onefang/meta-impy for the source code. | 41 | http://github.com/onefang/meta-impy for the source code. |
42 | 42 | ||
43 | |||
43 | The Imprudence Viewer was rocked hard by: | 44 | The Imprudence Viewer was rocked hard by: |
44 | Jacek Antonelli, McCabe Maxsted, Armin Weatherwax, Elektra Hesse, and CodeBastard Redgrave. | 45 | Jacek Antonelli, McCabe Maxsted, Armin Weatherwax, Elektra Hesse, and CodeBastard Redgrave. |
45 | 46 | ||
@@ -47,11 +48,11 @@ | |||
47 | 48 | ||
48 | Imprudence is so awesome thanks to contributions from many generous people: | 49 | Imprudence is so awesome thanks to contributions from many generous people: |
49 | 50 | ||
50 | For their patches and code contributions, we thank Admiral Admiral, Aimee Trescothick, Aleric Inglewood, Alissa Sabre, Archimedies Plutonian, Angus Boyd, Ansariel Hiller, Ardy Lay, Asuka Neely, Balp Allen, Carjay McGinnis, Chalice Yao, Dale Glass, Damian Delacrois, Danny Nolan, Felix Duesenburg, Geneko Nemeth, Henri Beauchamp, Katharine Berry, KirstenLee Cinquetti, Kitty Barnett, Latif Khalifa, Lilly Zenovka, Makomk Makosen, Mana Janus, Matthew Dowd, Michelle2 Zenovka, Mm Alder, Nemurimasu Neiro, Nicholaz Beresford, Patrick Sapinski, Paul Churchill, Peter Lameth, Robin Cornelius, Stephen Zenith, Thickbrick Sleaford, Thomas Shikami, Tom Meta, tx Oh, Vaalith Jinn, Vadim Bigbear, Vex Streeter, Zi Ree, and Zwagoth Klaar. | 51 | For their patches and code contributions, we thank Admiral Admiral, Aimee Trescothick, Aleric Inglewood, Alissa Sabre, Angus Boyd, Ansariel Hiller, Archimedies Plutonian, Ardy Lay, Asuka Neely, Balp Allen, Carjay McGinnis, Chalice Yao, Dale Glass, Damian Delacrois, Danny Nolan, Eryn, Felix Duesenburg, Frederick Martian, Geneko Nemeth, Grandma Bates, Hazim Gazov, Henri Beauchamp, Hg Beeks, Hiroshi Kumaki, Kakurady Drakenar, Katharine Berry, KirstenLee Cinquetti, Kitty Barnett, Latif Khalifa, Lance Corrimal, Lilly Zenovka, Makomk Makosen, Mana Janus, Matthew Dowd, Michelle2 Zenovka, Mimika Oh, Mm Alder, Nemurimasu Neiro, Nicholaz Beresford, Nicky Perian, Patrick Sapinski, Paul Churchill, Peter Lameth, Qarl Fizz, Revolution Smythe, Robin Cornelius, Seraph Linden, Shyotl Kuhr, Siana Gearz, SignpostMarv Martin, Stephen Zenith, TankMaster Finesmith, Thickbrick Sleaford, Thomas Shikami, Tom Meta, Tonya Souther, tx Oh, Vaalith Jinn, Vadim Bigbear, Vex Streeter, WhiteStar Magic, Zi Ree, and Zwagoth Klaar. |
51 | 52 | ||
52 | For their WindLight presets, we thank Ana Lutetia, CodeBastard Redgrave, and Torley Linden. | 53 | For their WindLight presets, we thank Ana Lutetia, CodeBastard Redgrave, and Torley Linden. |
53 | 54 | ||
54 | Thanks also to the developer(s) of the Emerald Viewer, Hippo Viewer, Cool VL Viewer, Snowglobe Viewer, meta 7 Viewer, FrozenGlobe Viewer, and Meerkat Viewer for viewer enhancements we have incorporated, as well as Kitty Barnett for RLVa. Special thanks to the folks at Linden Lab for releasing the viewer source, without which this endeavor would have been impossible. | 55 | Thanks also to the developer(s) of the Ascent Viewer, Astra Viewer, Cool VL Viewer, Dolphin Viewer, Emerald Viewer, FrozenGlobe Viewer, Hippo Viewer, Meerkat Viewer, Meta7 Viewer, Phoenix Viewer, Singularity Viewer and Snowglobe Viewer for viewer enhancements we have incorporated, as well as Kitty Barnett for RLVa. Special thanks to the folks at Linden Lab for releasing the viewer source, without which this endeavor would have been impossible. |
55 | 56 | ||
56 | For a complete list of who did what, read the release notes! | 57 | For a complete list of who did what, read the release notes! |
57 | 58 | ||
diff --git a/linden/indra/newview/skins/default/xui/en-us/notifications.xml b/linden/indra/newview/skins/default/xui/en-us/notifications.xml index b682534..ea48462 100644 --- a/linden/indra/newview/skins/default/xui/en-us/notifications.xml +++ b/linden/indra/newview/skins/default/xui/en-us/notifications.xml | |||
@@ -7302,6 +7302,27 @@ Shadows cannot be enabled due to your graphics settings being set too low. Make | |||
7302 | 7302 | ||
7303 | <notification | 7303 | <notification |
7304 | icon="alert.tga" | 7304 | icon="alert.tga" |
7305 | name="ExportFailed" | ||
7306 | type="alert"> | ||
7307 | Bad permissions for the exported object. Export aborted. | ||
7308 | </notification> | ||
7309 | |||
7310 | <notification | ||
7311 | icon="alert.tga" | ||
7312 | name="ExportPartial" | ||
7313 | type="alert"> | ||
7314 | Object exported. Some textures could not be saved due to: [REASON] | ||
7315 | </notification> | ||
7316 | |||
7317 | <notification | ||
7318 | icon="notifytip.tga" | ||
7319 | name="ExportSuccessful" | ||
7320 | type="notifytip"> | ||
7321 | Export successful. | ||
7322 | </notification> | ||
7323 | |||
7324 | <notification | ||
7325 | icon="alert.tga" | ||
7305 | name="Help_CmdLine" | 7326 | name="Help_CmdLine" |
7306 | type="alert"> | 7327 | type="alert"> |
7307 | Various options for command line features. | 7328 | Various options for command line features. |
@@ -7468,6 +7489,21 @@ The Socks5 proxy "[PROXY]" refused the UDP associate request | |||
7468 | Could not connect to Socks5 proxy server "[PROXY]" | 7489 | Could not connect to Socks5 proxy server "[PROXY]" |
7469 | </notification> | 7490 | </notification> |
7470 | 7491 | ||
7492 | |||
7493 | <notification | ||
7494 | icon="alert.tga" | ||
7495 | name="FeatureNotAvailableOnOS" | ||
7496 | type="alert"> | ||
7497 | Sorry, [FEATURE] is not yet available on [OS]. | ||
7498 | </notification> | ||
7499 | |||
7500 | <!-- Non-specific defaults for use with FeatureNotAvailableOnOS --> | ||
7501 | <global name="this feature">this feature</global> | ||
7502 | <global name="this os">this operating system</global> | ||
7503 | |||
7504 | <global name="view history">View History</global> | ||
7505 | |||
7506 | |||
7471 | <!--End Imprudence notifications--> | 7507 | <!--End Imprudence notifications--> |
7472 | <!-- [KITTY VIEWER] --> | 7508 | <!-- [KITTY VIEWER] --> |
7473 | <notification | 7509 | <notification |
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_ao_remote_expanded.xml b/linden/indra/newview/skins/default/xui/en-us/panel_ao_remote_expanded.xml index 29c34fb..2d71add 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_ao_remote_expanded.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_ao_remote_expanded.xml | |||
@@ -3,8 +3,11 @@ | |||
3 | enabled="true" follows="right|bottom" height="45" left="0" mouse_opaque="true" | 3 | enabled="true" follows="right|bottom" height="45" left="0" mouse_opaque="true" |
4 | name="ao_remote" use_bounding_rect="true" width="96"> | 4 | name="ao_remote" use_bounding_rect="true" width="96"> |
5 | <panel bottom="1" filename="panel_bg_tab.xml" name="panel_bg_tab" height="47" left="0" width="96" /> | 5 | <panel bottom="1" filename="panel_bg_tab.xml" name="panel_bg_tab" height="47" left="0" width="96" /> |
6 | <button bottom="-20" control_name="AOSitsEnabled" enabled="true" | 6 | <button bottom="-20" control_name="AOSitsEnabled" enabled="true" tool_tip="Toggles AO sit animation" |
7 | follows="left|top" font="SansSerif" height="22" label="AO Sits Off" label_selected="AO Sits On" | 7 | follows="left|top" font="SansSerif" height="22" label="Sits Off" label_selected="Sits On" |
8 | mouse_opaque="true" name="ao_sit_btn" width="92" left="3" /> | 8 | mouse_opaque="true" name="ao_sit_btn" width="66" left="3" label_selected_disabled="Sits Off" /> |
9 | <button bottom="-20" enabled="true" tool_tip="Toggle AO window" | ||
10 | follows="left|top" font="SansSerif" height="22" label="" image_overlay="arrow_up.tga" | ||
11 | mouse_opaque="true" name="ao_show_btn" width="22" left_delta="68" /> | ||
9 | <panel bottom="13" filename="panel_ao_remote_controls.xml" name="panel_ao_controls" left="0" width="96" /> | 12 | <panel bottom="13" filename="panel_ao_remote_controls.xml" name="panel_ao_controls" left="0" width="96" /> |
10 | </panel> | 13 | </panel> |
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_avatar.xml b/linden/indra/newview/skins/default/xui/en-us/panel_avatar.xml index 811a196..389e069 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_avatar.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_avatar.xml | |||
@@ -42,6 +42,9 @@ | |||
42 | <string name="days_old_text"> | 42 | <string name="days_old_text"> |
43 | ([DAYS] days old) | 43 | ([DAYS] days old) |
44 | </string> | 44 | </string> |
45 | <string name="invalid"> | ||
46 | (invalid) | ||
47 | </string> | ||
45 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" | 48 | <text bg_visible="false" border_drop_shadow_visible="false" border_visible="false" |
46 | bottom="-23" drop_shadow_visible="true" follows="left|top" | 49 | bottom="-23" drop_shadow_visible="true" follows="left|top" |
47 | font="SansSerifsmall" h_pad="0" halign="left" height="16" left="262" | 50 | font="SansSerifsmall" h_pad="0" halign="left" height="16" left="262" |
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_group_general.xml b/linden/indra/newview/skins/default/xui/en-us/panel_group_general.xml index 0895e3f..9a06d0f 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_group_general.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_group_general.xml | |||
@@ -8,9 +8,12 @@ general Group Preferences and member options. | |||
8 | 8 | ||
9 | Hover your mouse over the options for more help. | 9 | Hover your mouse over the options for more help. |
10 | </string> | 10 | </string> |
11 | <string name="group_info_unchanged"> | 11 | <string name="group_info_unchanged"> |
12 | General group information has changed. | 12 | General group information has changed. |
13 | </string> | 13 | </string> |
14 | <string name="copy_group_link_info"> | ||
15 | Copied group link: [SLURL] | ||
16 | </string> | ||
14 | <button bottom="-24" follows="left|top" font="SansSerif" halign="center" height="16" | 17 | <button bottom="-24" follows="left|top" font="SansSerif" halign="center" height="16" |
15 | label="?" label_selected="?" left="391" mouse_opaque="true" | 18 | label="?" label_selected="?" left="391" mouse_opaque="true" |
16 | name="help_button" width="20" /> | 19 | name="help_button" width="20" /> |
@@ -50,7 +53,10 @@ Hover your mouse over the options for more help. | |||
50 | width="265" word_wrap="true" spell_check="true"> | 53 | width="265" word_wrap="true" spell_check="true"> |
51 | Group Charter | 54 | Group Charter |
52 | </text_editor> | 55 | </text_editor> |
53 | <button bottom_delta="0" follows="left|top" font="SansSerif" halign="center" | 56 | <button bottom_delta="-28" follows="left|top" font="SansSerif" halign="center" |
57 | height="22" label="Copy Group Link" | ||
58 | right="-7" mouse_opaque="true" name="copy_link_button" width="128" /> | ||
59 | <button bottom_delta="28" follows="left|top" font="SansSerif" halign="center" | ||
54 | height="22" label="Join (free)" label_selected="Join (free)" left="7" | 60 | height="22" label="Join (free)" label_selected="Join (free)" left="7" |
55 | mouse_opaque="true" name="join_button" width="128" /> | 61 | mouse_opaque="true" name="join_button" width="128" /> |
56 | <button bottom_delta="0" follows="left|top" font="SansSerif" halign="center" | 62 | <button bottom_delta="0" follows="left|top" font="SansSerif" halign="center" |
diff --git a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml index b589a1d..c037439 100644 --- a/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml +++ b/linden/indra/newview/skins/default/xui/en-us/panel_preferences_advanced.xml | |||
@@ -48,11 +48,16 @@ USE left="270" FOR TABBING OPTIONS | |||
48 | label="Show WindLight toolbar" left="50" mouse_opaque="true" | 48 | label="Show WindLight toolbar" left="50" mouse_opaque="true" |
49 | name="toggle_windlight_control" radio_style="false" width="237" | 49 | name="toggle_windlight_control" radio_style="false" width="237" |
50 | control_name="EnableWindlightRemote" /> | 50 | control_name="EnableWindlightRemote" /> |
51 | <check_box bottom_delta="-18" enabled="true" | 51 | <check_box bottom_delta="0" enabled="true" |
52 | follows="left|top" font="SansSerifSmall" height="16" initial_value="false" | 52 | follows="left|top" font="SansSerifSmall" height="16" initial_value="false" |
53 | label="Use legacy pie menus" left_delta="0" | 53 | label="Use legacy pie menus" left="270" |
54 | mouse_opaque="true" name="legacy_pie_menu_checkbox" radio_style="false" | 54 | mouse_opaque="true" name="legacy_pie_menu_checkbox" radio_style="false" |
55 | width="256" /> | 55 | width="256" /> |
56 | <check_box bottom_delta="-18" enabled="true" follows="left|top" | ||
57 | font="SansSerifSmall" height="16" initial_value="false" | ||
58 | label="Show AO toolbar" left="50" mouse_opaque="true" | ||
59 | name="toggle_ao_control" radio_style="false" width="237" | ||
60 | control_name="EnableAORemote" /> | ||
56 | 61 | ||
57 | 62 | ||
58 | <view_border bevel_style="none" border_thickness="1" bottom_delta="-15" follows="left|top" | 63 | <view_border bevel_style="none" border_thickness="1" bottom_delta="-15" follows="left|top" |
diff --git a/linden/indra/newview/skins/default/xui/zh/notifications.xml b/linden/indra/newview/skins/default/xui/zh/notifications.xml index 0596e76..ea49e35 100644 --- a/linden/indra/newview/skins/default/xui/zh/notifications.xml +++ b/linden/indra/newview/skins/default/xui/zh/notifications.xml | |||
@@ -3795,6 +3795,10 @@ Socks5 代理服务器 [PROXY] 拒绝了 UDP 关联请求 | |||
3795 | 无法连接到 Socks5 代理服务器 [PROXY] | 3795 | 无法连接到 Socks5 代理服务器 [PROXY] |
3796 | </notification> | 3796 | </notification> |
3797 | 3797 | ||
3798 | |||
3799 | <global name="view history">查看对话历史</global> | ||
3800 | |||
3801 | |||
3798 | <!--End Imprudence notifications--> | 3802 | <!--End Imprudence notifications--> |
3799 | <!-- [KITTY VIEWER] --> | 3803 | <!-- [KITTY VIEWER] --> |
3800 | <notification | 3804 | <notification |