aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorMcCabe Maxsted2009-09-06 21:51:06 -0700
committerMcCabe Maxsted2009-09-06 21:51:06 -0700
commit18e1aead704e0605ceefb9e47db9acdb4c40928e (patch)
tree238ca469419f09df900d31df5d1eb8e97e1f34cb /linden
parentStart fetching inventory at startup (diff)
downloadmeta-impy-18e1aead704e0605ceefb9e47db9acdb4c40928e.zip
meta-impy-18e1aead704e0605ceefb9e47db9acdb4c40928e.tar.gz
meta-impy-18e1aead704e0605ceefb9e47db9acdb4c40928e.tar.bz2
meta-impy-18e1aead704e0605ceefb9e47db9acdb4c40928e.tar.xz
Added Emerald viewer's animation list
Diffstat (limited to 'linden')
-rw-r--r--linden/indra/newview/CMakeLists.txt3
-rw-r--r--linden/indra/newview/jcfloater_animation_list.cpp462
-rw-r--r--linden/indra/newview/jcfloater_animation_list.h88
-rw-r--r--linden/indra/newview/llviewermenu.cpp6
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/floater_animation_list.xml74
-rw-r--r--linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml4
6 files changed, 637 insertions, 0 deletions
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt
index fee4d4d..5a83624 100644
--- a/linden/indra/newview/CMakeLists.txt
+++ b/linden/indra/newview/CMakeLists.txt
@@ -61,6 +61,7 @@ include_directories(
61 ) 61 )
62 62
63set(viewer_SOURCE_FILES 63set(viewer_SOURCE_FILES
64 jcfloater_animation_list.cpp
64 llagent.cpp 65 llagent.cpp
65 llagentdata.cpp 66 llagentdata.cpp
66 llagentlanguage.cpp 67 llagentlanguage.cpp
@@ -454,6 +455,7 @@ set(viewer_HEADER_FILES
454 CMakeLists.txt 455 CMakeLists.txt
455 ViewerInstall.cmake 456 ViewerInstall.cmake
456 457
458 jcfloater_animation_list.h
457 llagent.h 459 llagent.h
458 llagentdata.h 460 llagentdata.h
459 llagentlanguage.h 461 llagentlanguage.h
@@ -1023,6 +1025,7 @@ set(viewer_XUI_FILES
1023 skins/default/xui/en-us/floater_about_land.xml 1025 skins/default/xui/en-us/floater_about_land.xml
1024 skins/default/xui/en-us/floater_about.xml 1026 skins/default/xui/en-us/floater_about.xml
1025 skins/default/xui/en-us/floater_active_speakers.xml 1027 skins/default/xui/en-us/floater_active_speakers.xml
1028 skins/default/xui/en-us/floater_animation_list.xml
1026 skins/default/xui/en-us/floater_animation_preview.xml 1029 skins/default/xui/en-us/floater_animation_preview.xml
1027 skins/default/xui/en-us/floater_auction.xml 1030 skins/default/xui/en-us/floater_auction.xml
1028 skins/default/xui/en-us/floater_audio_volume.xml 1031 skins/default/xui/en-us/floater_audio_volume.xml
diff --git a/linden/indra/newview/jcfloater_animation_list.cpp b/linden/indra/newview/jcfloater_animation_list.cpp
new file mode 100644
index 0000000..d913292
--- /dev/null
+++ b/linden/indra/newview/jcfloater_animation_list.cpp
@@ -0,0 +1,462 @@
1/* Copyright (c) 2009
2 *
3 * Modular Systems Ltd. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or
6 * without modification, are permitted provided that the following
7 * conditions are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following
13 * disclaimer in the documentation and/or other materials provided
14 * with the distribution.
15 * 3. Neither the name Modular Systems Ltd nor the names of its contributors
16 * may be used to endorse or promote products derived from this
17 * software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY MODULAR SYSTEMS LTD AND CONTRIBUTORS “AS IS”
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MODULAR SYSTEMS OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29 * THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#include "llviewerprecompiledheaders.h"
33
34#include "lluuid.h"
35#include "lluictrlfactory.h"
36#include "llvoavatar.h"
37
38#include "llagent.h"
39
40#include "llscrolllistctrl.h"
41
42#include "llviewerobjectlist.h"
43
44#include "jcfloater_animation_list.h"
45
46#include "llviewercontrol.h"
47
48#include "llinventorymodel.h"
49
50#include "llcategory.h"
51
52#include "llfloaterchat.h"
53
54#include "llfloateravatarinfo.h"
55
56
57
58
59
60//std::map<LLUUID, AObjectData> JCFloaterAnimList::mObjectOwners;
61
62JCFloaterAnimList::JCFloaterAnimList(const LLSD& seed) :
63 LLFloater(std::string("animation list")),
64 mAnimList(0)
65{
66 BOOL no_open = FALSE;
67 LLUICtrlFactory::getInstance()->buildFloater(this, "floater_animation_list.xml",&getFactoryMap(),no_open);
68}
69
70JCFloaterAnimList::~JCFloaterAnimList()
71{
72}
73
74//static
75bool JCFloaterAnimList::visible(LLFloater* instance, const LLSD& key)
76{
77 return VisibilityPolicy<LLFloater>::visible(instance, key);
78}
79
80//static
81void JCFloaterAnimList::show(LLFloater* instance, const LLSD& key)
82{
83 VisibilityPolicy<LLFloater>::show(instance, key);
84}
85
86//static
87void JCFloaterAnimList::hide(LLFloater* instance, const LLSD& key)
88{
89 VisibilityPolicy<LLFloater>::hide(instance, key);
90}
91
92void JCFloaterAnimList::onVisibilityChange(BOOL new_visibility)
93{
94 if(!new_visibility) {
95 // *HACK: clean up memory on hiding
96 mObjectOwners.clear();
97 }
98}
99
100BOOL JCFloaterAnimList::postBuild()
101{
102 mAnimList = getChild<LLScrollListCtrl>("animation_list");
103 mAnimList->setCallbackUserData(this);
104 mAnimList->setDoubleClickCallback(onDoubleClick);
105 mAnimList->sortByColumn("animation_uuid", TRUE);
106
107 childSetAction("Stop Selected",StopSelected,this);
108 childSetAction("Revoke Selected",RevokeSelected,this);
109 childSetAction("Stop+Revoke Selected",StopRevokeSelected,this);
110 childSetAction("Open Owner Profile",OpenProfile,this);
111
112 return 1;
113}
114
115void JCFloaterAnimList::StopSelected(void *userdata )
116{
117 JCFloaterAnimList *self = (JCFloaterAnimList*)userdata;
118 LLDynamicArray<LLUUID> ids;
119 std::vector< LLScrollListItem * > items = self->mAnimList->getAllSelected();
120 for( std::vector< LLScrollListItem * >::iterator itr = items.begin(); itr != items.end(); itr++ )
121 {
122 LLScrollListItem *item = *itr;
123 const LLUUID &id = item->getColumn(LIST_ANIMATION_UUID)->getValue().asUUID();
124 if( ids.find(id) == LLDynamicArray<LLUUID>::FAIL )
125 {
126 ids.put(id);
127 }
128 }
129 gAgent.sendAnimationRequests(ids,ANIM_REQUEST_STOP);
130}
131
132void JCFloaterAnimList::RevokeSelected(void *userdata )
133{
134 JCFloaterAnimList *self = (JCFloaterAnimList*)userdata;
135 LLDynamicArray<LLUUID> ids;
136 std::vector< LLScrollListItem * > items = self->mAnimList->getAllSelected();
137 for( std::vector< LLScrollListItem * >::iterator itr = items.begin(); itr != items.end(); itr++ )
138 {
139 LLScrollListItem *item = *itr;
140 const LLUUID &id = item->getColumn(LIST_OBJECT_UUID)->getValue().asUUID();
141 if( ids.find(id) == LLDynamicArray<LLUUID>::FAIL )
142 {
143 ids.put(id);
144 }
145 }
146 if( !ids.empty() )
147 {
148 for(LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
149 {
150 LLUUID id = *itr;
151 LLMessageSystem* msg = gMessageSystem;
152 msg->newMessageFast(_PREHASH_RevokePermissions);
153 msg->nextBlockFast(_PREHASH_AgentData);
154 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
155 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
156 msg->nextBlockFast(_PREHASH_Data);
157 msg->addUUIDFast(_PREHASH_ObjectID, id);
158 msg->addU32Fast(_PREHASH_ObjectPermissions, U32_MAX);
159 gAgent.sendReliableMessage();
160 }
161 }
162}
163
164void JCFloaterAnimList::StopRevokeSelected(void *userdata )
165{
166 StopSelected(userdata);
167 RevokeSelected(userdata);
168}
169
170void JCFloaterAnimList::OpenProfile(void *userdata )
171{
172 JCFloaterAnimList *self = (JCFloaterAnimList*)userdata;
173 std::vector< LLScrollListItem * > items = self->mAnimList->getAllSelected();
174 if(!items.empty())
175 {
176 //LLVOAvatar* avatarp = gAgent.getAvatarObject();
177 for(std::vector< LLScrollListItem * >::iterator itr = items.begin(); itr != items.end(); ++itr)
178 {
179 LLScrollListItem *item = *itr;
180 const LLUUID &object_id = item->getColumn(LIST_OBJECT_UUID)->getValue().asUUID();
181 LLFloaterAvatarInfo::showFromDirectory(self->mObjectOwners[object_id].owner_id);
182 }
183 }
184}
185
186/*void JCFloaterAnimList::ReturnSelected(void *userdata )
187{
188 JCFloaterAnimList *self = (JCFloaterAnimList*)userdata;
189 LLDynamicArray<LLUUID> ids = self->mAnimList->getSelectedIDs();
190 if(ids.size() > 0)
191 {
192 LLVOAvatar* avatarp = gAgent.getAvatarObject();
193 for(LLDynamicArray<LLUUID>::iterator itr = ids.begin(); itr != ids.end(); ++itr)
194 {
195 LLUUID id = *itr;
196
197 }
198 }
199}*/
200
201void JCFloaterAnimList::draw()
202{
203 refresh();
204 LLFloater::draw();
205}
206//LLScrollListCtrl::getSelectedIDs();
207void JCFloaterAnimList::refresh()
208{
209 LLDynamicArray<LLUUID> selected = mAnimList->getSelectedIDs();
210 S32 scrollpos = mAnimList->getScrollPos();
211 mAnimList->deleteAllItems();
212 LLVOAvatar* avatarp = gAgent.getAvatarObject();
213 if (avatarp)
214 {
215 LLVOAvatar::AnimSourceIterator ai;
216
217 for(ai = avatarp->mAnimationSources.begin(); ai != avatarp->mAnimationSources.end(); ++ai)
218 {
219 LLSD element;
220 const LLUUID &aifirst = ai->first;
221 LLViewerInventoryItem* item = gInventory.getItem(findItemID(ai->second,0));
222
223 // *NOTE: conceal id to prevent bugs, use
224 // item->getColumn(LIST_ANIMATION_UUID)->getValue().asUUID()
225 // instead
226 element["id"] = LLUUID::null.combine(ai->second);
227 element["columns"][LIST_ANIMATION_NAME]["column"] = "Anim Name";
228 element["columns"][LIST_ANIMATION_NAME]["type"] = "text";
229 element["columns"][LIST_ANIMATION_NAME]["color"] = gColors.getColor("DefaultListText").getValue();
230 if(item)
231 {
232 element["columns"][LIST_ANIMATION_NAME]["value"] = item->getName();//ai->second//"avatar_icon";
233 }else
234 {
235 element["columns"][LIST_ANIMATION_NAME]["value"] = "Not in Inventory";
236 }
237 element["columns"][LIST_ANIMATION_UUID]["column"] = "Animation UUID";
238 element["columns"][LIST_ANIMATION_UUID]["type"] = "text";
239 element["columns"][LIST_ANIMATION_UUID]["color"] = gColors.getColor("DefaultListText").getValue();
240 element["columns"][LIST_ANIMATION_UUID]["value"] = ai->second;
241 element["columns"][LIST_OBJECT_UUID]["column"] = "Source Object UUID";
242 element["columns"][LIST_OBJECT_UUID]["type"] = "text";
243 element["columns"][LIST_OBJECT_UUID]["color"] = gColors.getColor("DefaultListText").getValue();
244 element["columns"][LIST_OBJECT_UUID]["value"] = aifirst;
245 element["columns"][LIST_OBJECT_OWNER]["column"] = "Source Owner";
246 element["columns"][LIST_OBJECT_OWNER]["type"] = "text";
247 element["columns"][LIST_OBJECT_OWNER]["color"] = gColors.getColor("DefaultListText").getValue();
248 std::string name("?");
249 LLViewerObject *object = gObjectList.findObject(aifirst);
250 bool is_first = ( mObjectOwners.count( aifirst ) == 0 );
251 bool just_shown = false;
252 LLUUID owner_id(LLUUID::null);
253
254 if( !is_first )
255 {
256 name = mObjectOwners[aifirst].owner_name;
257 owner_id = mObjectOwners[aifirst].owner_id;
258 }
259
260 if( object )
261 {
262 if( object->permYouOwner() )
263 {
264 owner_id = gAgent.getID();
265 gAgent.getName(name);
266 }
267 else
268 {
269 object = (LLViewerObject *) object->getRoot();
270 if( object->isAvatar() )
271 {
272 owner_id = object->getID();
273 name = ((LLVOAvatar *)object)->getFullname();
274 }
275 }
276 }
277
278 {
279 AObjectData &data = mObjectOwners[aifirst];
280 if( object )
281 {
282 if( !data.in_object_list )
283 {
284 just_shown = true;
285 data.in_object_list = true;
286 }
287 data.root_id = ( (LLViewerObject*)object->getRoot() )->getID();
288 }
289 data.owner_name = name;
290 data.owner_id = owner_id;
291 }
292
293 if( is_first || just_shown ) {
294 if( name == "?" && !aifirst.isNull()) {
295 LLMessageSystem* msg = gMessageSystem;
296 msg->newMessageFast(_PREHASH_RequestObjectPropertiesFamily);
297 msg->nextBlockFast(_PREHASH_AgentData);
298 msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID());
299 msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID());
300 msg->nextBlockFast(_PREHASH_ObjectData);
301 msg->addU32Fast(_PREHASH_RequestFlags, 0 );
302 if( object )
303 {
304 LL_INFOS("Avatar List") << "Sending RequestObjectPropertiesFamily packet for id( " << aifirst.asString() << " ) on object( " << object->getID().asString() << " )" << LL_ENDL;
305 msg->addUUIDFast(_PREHASH_ObjectID, object->getID());
306 }
307 else
308 {
309 LL_INFOS("Avatar List") << "Sending RequestObjectPropertiesFamily packet for id( " << aifirst.asString() << " )" << LL_ENDL;
310 msg->addUUIDFast(_PREHASH_ObjectID, aifirst);
311 }
312 gAgent.sendReliableMessage();
313 }
314 }
315 element["columns"][LIST_OBJECT_OWNER]["value"] = name;
316 mAnimList->addElement(element, ADD_BOTTOM);
317 //LLViewerObject* objectp = gObjectList.findObject(ai->first);
318 //if(objectp)
319 //{
320 // //objectp->
321 //}
322
323 //object_ids.insert(ai->first);
324 //animation_ids.insert(ai->second);
325 }
326 }
327
328 mAnimList->sortItems();
329 mAnimList->selectMultiple(selected);
330 mAnimList->setScrollPos(scrollpos);
331}
332
333void JCFloaterAnimList::callbackLoadOwnerName(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data)
334{
335 LLUUID *oid = (LLUUID*)data;
336 JCFloaterAnimList *self = JCFloaterAnimList::getInstance(LLSD());
337 if(self->mObjectOwners.count( *oid ) > 0)
338 {
339 self->mObjectOwners[*oid].owner_name = first + " " + last;
340 }
341 delete oid;
342}
343
344void JCFloaterAnimList::processObjectPropertiesFamily(LLMessageSystem* msg, void** user_data)
345{
346 if(!JCFloaterAnimList::instanceVisible(LLSD())) return;
347 JCFloaterAnimList *self = JCFloaterAnimList::getInstance(LLSD());
348 LLUUID object_id;
349 U32 request_flags;
350 LLUUID creator_id;
351 LLUUID owner_id;
352 LLUUID group_id;
353 LLUUID extra_id;
354 U32 base_mask, owner_mask, group_mask, everyone_mask, next_owner_mask;
355 LLSaleInfo sale_info;
356 LLCategory category;
357 msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_RequestFlags, request_flags );
358 msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_ObjectID, object_id );
359 msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_OwnerID, owner_id );
360 msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_GroupID, group_id );
361 msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_BaseMask, base_mask );
362 msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_OwnerMask, owner_mask );
363 msg->getU32Fast(_PREHASH_ObjectData,_PREHASH_GroupMask, group_mask );
364 msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_EveryoneMask, everyone_mask );
365 msg->getU32Fast(_PREHASH_ObjectData, _PREHASH_NextOwnerMask, next_owner_mask);
366 sale_info.unpackMessage(msg, _PREHASH_ObjectData);
367 category.unpackMessage(msg, _PREHASH_ObjectData);
368 LLUUID last_owner_id;
369 msg->getUUIDFast(_PREHASH_ObjectData, _PREHASH_LastOwnerID, last_owner_id );
370 std::string name;
371 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Name, name);
372 std::string desc;
373 msg->getStringFast(_PREHASH_ObjectData, _PREHASH_Description, desc);
374
375 for( std::map<LLUUID, AObjectData>::iterator di = self->mObjectOwners.begin(); di != self->mObjectOwners.end(); di++ )
376 {
377 const LLUUID &id = di->first;
378 const AObjectData &data = di->second;
379
380 if(data.root_id == object_id || data.owner_id == object_id)
381 {
382 LLUUID* ref = new LLUUID(id);
383 self->mObjectOwners[id].owner_id = owner_id;
384 gCacheName->get(owner_id, FALSE, callbackLoadOwnerName, (void*)ref);
385 }
386 }
387}
388
389const LLUUID& JCFloaterAnimList::findItemID(const LLUUID& asset_id, BOOL copyable_only)
390{
391 LLViewerInventoryCategory::cat_array_t cats;
392 LLViewerInventoryItem::item_array_t items;
393 LLAssetIDMatches asset_id_matches(asset_id);
394 gInventory.collectDescendentsIf(LLUUID::null,
395 cats,
396 items,
397 LLInventoryModel::INCLUDE_TRASH,
398 asset_id_matches);
399
400 if (items.count())
401 {
402 // search for copyable version first
403 for (S32 i = 0; i < items.count(); i++)
404 {
405 LLInventoryItem* itemp = items[i];
406 LLPermissions item_permissions = itemp->getPermissions();
407 if (item_permissions.allowCopyBy(gAgent.getID(), gAgent.getGroupID()))
408 {
409 return itemp->getUUID();
410 }
411 }
412 // otherwise just return first instance, unless copyable requested
413 if (copyable_only)
414 {
415 return LLUUID::null;
416 }
417 else
418 {
419 return items[0]->getUUID();
420 }
421 }
422
423 return LLUUID::null;
424}
425
426/*void JCFloaterAnimList::onClickCopyAnimationUUID(void *userdata)
427{
428 LLFloaterAvatarList *self = (LLFloaterAvatarList*)userdata;
429 LLScrollListItem *item = self->mAvatarList->getFirstSelected();
430
431 if ( NULL == item ) return;
432
433 LLUUID agent_id = item->getUUID();
434
435 char buffer[UUID_STR_LENGTH];
436 agent_id.toString(buffer);
437
438 gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(buffer));
439}*/
440
441void JCFloaterAnimList::onDoubleClick(void *userdata)
442{
443 //JCFloaterAnimList *self = (JCFloaterAnimList*)userdata;
444 //LLScrollListItem *item = self->mAnimList->getFirstSelected();
445 //if(!item)return;
446 //LLUUID agent_id = item->getUUID();
447
448 //gAgent.setFocusObject(gObjectList.findObject(agent_id));
449 //gAgent.setFocusOnAvatar(FALSE, TRUE);
450}
451
452void JCFloaterAnimList::close(bool app)
453{
454 //sInstance->setVisible(0);
455//#ifdef RECONSTRUCT_ON_TOGGLE
456// sInstance = NULL;
457 LLFloater::close(app);
458//#else
459// sInstance->setVisible(!(sInstance->getVisible()));
460//#endif
461}
462
diff --git a/linden/indra/newview/jcfloater_animation_list.h b/linden/indra/newview/jcfloater_animation_list.h
new file mode 100644
index 0000000..d8262f0
--- /dev/null
+++ b/linden/indra/newview/jcfloater_animation_list.h
@@ -0,0 +1,88 @@
1/* Copyright (c) 2009
2 *
3 * Modular Systems Ltd. All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or
6 * without modification, are permitted provided that the following
7 * conditions are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above
12 * copyright notice, this list of conditions and the following
13 * disclaimer in the documentation and/or other materials provided
14 * with the distribution.
15 * 3. Neither the name Modular Systems Ltd nor the names of its contributors
16 * may be used to endorse or promote products derived from this
17 * software without specific prior written permission.
18 *
19 * THIS SOFTWARE IS PROVIDED BY MODULAR SYSTEMS LTD AND CONTRIBUTORS “AS IS”
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MODULAR SYSTEMS OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
29 * THE POSSIBILITY OF SUCH DAMAGE.
30 */
31
32#include "llfloater.h"
33#include "lluuid.h"
34#include "llstring.h"
35
36struct AObjectData
37{
38 std::string owner_name;
39 LLUUID owner_id;
40 LLUUID root_id;
41 bool in_object_list;
42};
43
44class JCFloaterAnimList : public LLFloater, public LLUISingleton<JCFloaterAnimList, JCFloaterAnimList>
45{
46public:
47 JCFloaterAnimList(const LLSD& seed);
48 virtual ~JCFloaterAnimList();
49
50 /*virtual*/ BOOL postBuild();
51 /*virtual*/ void draw();
52 /*virtual*/ void onVisibilityChange(BOOL new_visibility);
53
54 /*virtual*/ void close(bool app = 0);
55 void refresh();
56
57 const LLUUID& findItemID(const LLUUID& asset_id, BOOL copyable_only);
58
59 static void callbackLoadOwnerName(const LLUUID& id, const std::string& first, const std::string& last, BOOL is_group, void* data);
60
61 static void processObjectPropertiesFamily(LLMessageSystem* msg, void** user_data);
62
63 static bool visible(LLFloater* instance, const LLSD& key);
64 static void show(LLFloater* instance, const LLSD& key);
65 static void hide(LLFloater* instance, const LLSD& key);
66
67private:
68
69 enum ANIMATION_COLUMN_ORDER
70 {
71 LIST_ANIMATION_NAME,
72 LIST_ANIMATION_UUID,
73 LIST_OBJECT_UUID,
74 LIST_OBJECT_OWNER
75 };
76
77 LLScrollListCtrl* mAnimList;
78
79 std::map<LLUUID, AObjectData> mObjectOwners;
80
81 static void StopSelected(void *userdata );
82 static void RevokeSelected(void *userdata );
83 static void StopRevokeSelected(void *userdata );
84 static void OpenProfile(void *userdata );
85 static void onDoubleClick(void *userdata);
86
87};
88
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp
index 3be857e..b937894 100644
--- a/linden/indra/newview/llviewermenu.cpp
+++ b/linden/indra/newview/llviewermenu.cpp
@@ -210,6 +210,8 @@
210 210
211#include "lltexlayer.h" 211#include "lltexlayer.h"
212 212
213#include "jcfloater_animation_list.h"
214
213void init_client_menu(LLMenuGL* menu); 215void init_client_menu(LLMenuGL* menu);
214void init_server_menu(LLMenuGL* menu); 216void init_server_menu(LLMenuGL* menu);
215 217
@@ -5218,6 +5220,10 @@ class LLShowFloater : public view_listener_t
5218 { 5220 {
5219 LLFloaterActiveSpeakers::toggleInstance(LLSD()); 5221 LLFloaterActiveSpeakers::toggleInstance(LLSD());
5220 } 5222 }
5223 else if (floater_name == "animation list")
5224 {
5225 JCFloaterAnimList::toggleInstance(LLSD());
5226 }
5221 else if (floater_name == "inworld browser") 5227 else if (floater_name == "inworld browser")
5222 { 5228 {
5223 LLFloaterMediaBrowser::toggle(); 5229 LLFloaterMediaBrowser::toggle();
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_animation_list.xml b/linden/indra/newview/skins/default/xui/en-us/floater_animation_list.xml
new file mode 100644
index 0000000..be7de86
--- /dev/null
+++ b/linden/indra/newview/skins/default/xui/en-us/floater_animation_list.xml
@@ -0,0 +1,74 @@
1<?xml version="1.0" encoding="utf-8" standalone="yes"?>
2<floater
3 name="animation list"
4 title="Animation List"
5 can_resize="true"
6 can_minimize="true"
7 can_close="true"
8 can_drag_on_left="false"
9 rect_control="FloaterAnimationListRect"
10 min_width="1000"
11 min_height="275"
12 >
13 <scroll_list
14 name="animation_list"
15 left="10"
16 right="-10"
17 top="-20"
18 bottom="100"
19 column_padding="0"
20 can_resize="true"
21 follows="left|top|bottom|right"
22 draw_heading="true"
23 multi_select="true"
24 search_column="1"
25 tool_tip="Hold shift or control while clicking to select multiple thingers"
26 >
27 <!-- Icons relating to the avatar, currently: tracking, and marked -->
28 <column name="Anim Name" label="Anim Name" width="250"/>
29 <column name="Animation UUID" label="Animation UUID" width="250"/>
30 <!--<column name="object_name" label="Distance" dynamicwidth="true"/>-->
31 <column name="Source Object UUID" label="Source Object UUID" width="250"/>
32 <column name="Source Owner" label="Source Owner" width="250"/>
33 <!-- What the avatar is doing: producing sounds, rezzing, particles, etc -->
34 </scroll_list>
35 <panel
36 name="options"
37 left="10"
38 right="-10"
39 top="90"
40 bottom="10"
41 border="true"
42 mouse_opaque="true"
43 bevel_style="in"
44 background_visible="true"
45 background_opaque="true"
46 follows="left|right|bottom"
47 bg_opaque_color="0,0,0,0.3"
48 bg_alpha_color="blue"
49 can_resize="false"
50 >
51 </panel>
52
53 <button bottom="55" follows="left|bottom" font="SansSerifSmall" halign="center"
54 height="20" label="Stop Selected" left_delta="5"
55 mouse_opaque="true" name="Stop Selected"
56 tool_tip="Stop selected animations" width="150" />
57 <button bottom_delta="0" follows="left|bottom" font="SansSerifSmall" halign="center"
58 height="20" label="Revoke Selected" left_delta="155"
59 mouse_opaque="true" name="Revoke Selected"
60 tool_tip="Revokes animation permissions for object associated with the selections" width="150" />
61 <button bottom_delta="0" follows="left|bottom" font="SansSerifSmall" halign="center"
62 height="20" label="Stop+Revoke Selected" left_delta="155"
63 mouse_opaque="true" name="Stop+Revoke Selected"
64 tool_tip="Revokes animation permissions for object(s) associated with the selections, as well as stopping the anim" width="150" />
65 <button bottom_delta="0" follows="left|bottom" font="SansSerifSmall" halign="center"
66 height="20" label="Open Owner Profile" left_delta="155"
67 mouse_opaque="true" name="Open Owner Profile"
68 tool_tip="Opens profile of the owner(s) of object(s) associated with the selections" width="150" />
69 <button bottom_delta="-25" enabled="false" follows="left|bottom" font="SansSerifSmall" halign="center"
70 height="20" label="Return Object" left_delta="-465"
71 mouse_opaque="true" name="Return Object"
72 tool_tip="Returns object(s) selected, if you have land powers" width="150" />
73
74</floater> \ No newline at end of file
diff --git a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
index 86b5315..b091be2 100644
--- a/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
+++ b/linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml
@@ -893,6 +893,10 @@
893 <on_click function="Advanced.TogglePhantom" userdata="" /> 893 <on_click function="Advanced.TogglePhantom" userdata="" />
894 <on_check function="Advanced.CheckPhantom" userdata="" /> 894 <on_check function="Advanced.CheckPhantom" userdata="" />
895 </menu_item_check> 895 </menu_item_check>
896 <menu_item_check label="Animation List" name="Animation List">
897 <on_click function="ShowFloater" userdata="animation list" />
898 <on_check function="FloaterVisible" userdata="animation list" />
899 </menu_item_check>
896 <menu_item_check name="Show Mouselook Crosshairs" 900 <menu_item_check name="Show Mouselook Crosshairs"
897 label="Show Mouselook Crosshairs"> 901 label="Show Mouselook Crosshairs">
898 <on_click function="ToggleControl" 902 <on_click function="ToggleControl"