diff options
-rw-r--r-- | ChangeLog.txt | 60 | ||||
-rw-r--r-- | linden/indra/llui/llscrolllistctrl.cpp | 12 | ||||
-rw-r--r-- | linden/indra/llui/llscrolllistctrl.h | 1 | ||||
-rw-r--r-- | linden/indra/newview/CMakeLists.txt | 6 | ||||
-rw-r--r-- | linden/indra/newview/jcfloater_animation_list.cpp | 462 | ||||
-rw-r--r-- | linden/indra/newview/jcfloater_animation_list.h | 88 | ||||
-rw-r--r-- | linden/indra/newview/llagent.cpp | 30 | ||||
-rw-r--r-- | linden/indra/newview/llagent.h | 7 | ||||
-rw-r--r-- | linden/indra/newview/llappviewer.cpp | 7 | ||||
-rw-r--r-- | linden/indra/newview/llfloaterassetbrowser.cpp | 466 | ||||
-rw-r--r-- | linden/indra/newview/llfloaterassetbrowser.h | 84 | ||||
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 4 | ||||
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 120 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_animation_list.xml | 74 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_asset_browser.xml | 29 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | 19 |
16 files changed, 1468 insertions, 1 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index 499ed27..2fcd080 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt | |||
@@ -1,3 +1,63 @@ | |||
1 | 2009-09-06 McCabe Maxsted <hakushakukun@gmail.com> | ||
2 | |||
3 | * Applied sit anywhere feature from Emerald viewer. | ||
4 | |||
5 | modified: linden/indra/newview/llviewermenu.cpp | ||
6 | modified: linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | ||
7 | |||
8 | |||
9 | * Applied phantom avatar feature from Emerald viewer. | ||
10 | |||
11 | modified: linden/indra/newview/llagent.cpp | ||
12 | modified: linden/indra/newview/llagent.h | ||
13 | modified: linden/indra/newview/llappviewer.cpp | ||
14 | modified: linden/indra/newview/llviewermenu.cpp | ||
15 | modified: linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | ||
16 | |||
17 | |||
18 | * Start fetching inventory at startup. | ||
19 | |||
20 | modified: linden/indra/newview/llstartup.cpp | ||
21 | |||
22 | |||
23 | * Added Emerald viewer's animation list. | ||
24 | |||
25 | new file: linden/indra/newview/jcfloater_animation_list.cpp | ||
26 | new file: linden/indra/newview/jcfloater_animation_list.h | ||
27 | new file: linden/indra/newview/skins/default/xui/en-us/floater_animation_list.xml | ||
28 | modified: linden/indra/newview/CMakeLists.txt | ||
29 | modified: linden/indra/newview/llviewermenu.cpp | ||
30 | modified: linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | ||
31 | |||
32 | |||
33 | * Added Emerald viewer's asset browser. | ||
34 | |||
35 | new file: linden/indra/newview/llfloaterassetbrowser.cpp | ||
36 | new file: linden/indra/newview/llfloaterassetbrowser.h | ||
37 | new file: linden/indra/newview/skins/default/xui/en-us/floater_asset_browser.xml | ||
38 | modified: linden/indra/newview/CMakeLists.txt | ||
39 | modified: linden/indra/newview/llfloaterassetbrowser.cpp | ||
40 | modified: linden/indra/newview/llviewermenu.cpp | ||
41 | modified: linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | ||
42 | |||
43 | |||
44 | * Added LLScrollListCtrl::getSelectedIDs(). | ||
45 | |||
46 | modified: linden/indra/llui/llscrolllistctrl.cpp | ||
47 | modified: linden/indra/llui/llscrolllistctrl.h | ||
48 | |||
49 | |||
50 | * Fixed reference to missing colors.xml entry. | ||
51 | |||
52 | modified: linden/indra/newview/jcfloater_animation_list.cpp | ||
53 | |||
54 | |||
55 | * Fixed ground sit menu entry missing check. | ||
56 | |||
57 | modified: linden/indra/newview/llviewermenu.cpp | ||
58 | modified: linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | ||
59 | |||
60 | |||
1 | 2009-09-04 McCabe Maxsted <hakushakukun@gmail.com> | 61 | 2009-09-04 McCabe Maxsted <hakushakukun@gmail.com> |
2 | 62 | ||
3 | * Updated GStreamer and Zlib windows libs. | 63 | * Updated GStreamer and Zlib windows libs. |
diff --git a/linden/indra/llui/llscrolllistctrl.cpp b/linden/indra/llui/llscrolllistctrl.cpp index 7dba55f..c6da2d7 100644 --- a/linden/indra/llui/llscrolllistctrl.cpp +++ b/linden/indra/llui/llscrolllistctrl.cpp | |||
@@ -703,6 +703,18 @@ std::vector<LLScrollListItem*> LLScrollListCtrl::getAllSelected() const | |||
703 | return ret; | 703 | return ret; |
704 | } | 704 | } |
705 | 705 | ||
706 | LLDynamicArray<LLUUID> LLScrollListCtrl::getSelectedIDs() | ||
707 | { | ||
708 | LLUUID selected_id; | ||
709 | LLDynamicArray<LLUUID> ids; | ||
710 | std::vector<LLScrollListItem*> selected = this->getAllSelected(); | ||
711 | for(std::vector<LLScrollListItem*>::iterator itr = selected.begin(); itr != selected.end(); ++itr) | ||
712 | { | ||
713 | ids.push_back((*itr)->getUUID()); | ||
714 | } | ||
715 | return ids; | ||
716 | } | ||
717 | |||
706 | S32 LLScrollListCtrl::getFirstSelectedIndex() const | 718 | S32 LLScrollListCtrl::getFirstSelectedIndex() const |
707 | { | 719 | { |
708 | S32 CurSelectedIndex = 0; | 720 | S32 CurSelectedIndex = 0; |
diff --git a/linden/indra/llui/llscrolllistctrl.h b/linden/indra/llui/llscrolllistctrl.h index f276562..73f9a5b 100644 --- a/linden/indra/llui/llscrolllistctrl.h +++ b/linden/indra/llui/llscrolllistctrl.h | |||
@@ -517,6 +517,7 @@ public: | |||
517 | LLScrollListItem* getFirstSelected() const; | 517 | LLScrollListItem* getFirstSelected() const; |
518 | virtual S32 getFirstSelectedIndex() const; | 518 | virtual S32 getFirstSelectedIndex() const; |
519 | std::vector<LLScrollListItem*> getAllSelected() const; | 519 | std::vector<LLScrollListItem*> getAllSelected() const; |
520 | LLDynamicArray<LLUUID> getSelectedIDs(); | ||
520 | LLScrollListItem* getLastSelectedItem() const { return mLastSelected; } | 521 | LLScrollListItem* getLastSelectedItem() const { return mLastSelected; } |
521 | 522 | ||
522 | // iterate over all items | 523 | // iterate over all items |
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index fee4d4d..ad044a9 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt | |||
@@ -61,6 +61,7 @@ include_directories( | |||
61 | ) | 61 | ) |
62 | 62 | ||
63 | set(viewer_SOURCE_FILES | 63 | set(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 |
@@ -121,6 +122,7 @@ set(viewer_SOURCE_FILES | |||
121 | llfloaterabout.cpp | 122 | llfloaterabout.cpp |
122 | llfloateractivespeakers.cpp | 123 | llfloateractivespeakers.cpp |
123 | llfloateranimpreview.cpp | 124 | llfloateranimpreview.cpp |
125 | llfloaterassetbrowser.cpp | ||
124 | llfloaterauction.cpp | 126 | llfloaterauction.cpp |
125 | llfloateravatarinfo.cpp | 127 | llfloateravatarinfo.cpp |
126 | llfloateravatarpicker.cpp | 128 | llfloateravatarpicker.cpp |
@@ -454,6 +456,7 @@ set(viewer_HEADER_FILES | |||
454 | CMakeLists.txt | 456 | CMakeLists.txt |
455 | ViewerInstall.cmake | 457 | ViewerInstall.cmake |
456 | 458 | ||
459 | jcfloater_animation_list.h | ||
457 | llagent.h | 460 | llagent.h |
458 | llagentdata.h | 461 | llagentdata.h |
459 | llagentlanguage.h | 462 | llagentlanguage.h |
@@ -516,6 +519,7 @@ set(viewer_HEADER_FILES | |||
516 | llfloaterabout.h | 519 | llfloaterabout.h |
517 | llfloateractivespeakers.h | 520 | llfloateractivespeakers.h |
518 | llfloateranimpreview.h | 521 | llfloateranimpreview.h |
522 | llfloaterassetbrowser.h | ||
519 | llfloaterauction.h | 523 | llfloaterauction.h |
520 | llfloateravatarinfo.h | 524 | llfloateravatarinfo.h |
521 | llfloateravatarpicker.h | 525 | llfloateravatarpicker.h |
@@ -1023,7 +1027,9 @@ set(viewer_XUI_FILES | |||
1023 | skins/default/xui/en-us/floater_about_land.xml | 1027 | skins/default/xui/en-us/floater_about_land.xml |
1024 | skins/default/xui/en-us/floater_about.xml | 1028 | skins/default/xui/en-us/floater_about.xml |
1025 | skins/default/xui/en-us/floater_active_speakers.xml | 1029 | skins/default/xui/en-us/floater_active_speakers.xml |
1030 | skins/default/xui/en-us/floater_animation_list.xml | ||
1026 | skins/default/xui/en-us/floater_animation_preview.xml | 1031 | skins/default/xui/en-us/floater_animation_preview.xml |
1032 | skins/default/xui/en-us/floater_asset_browser.xml | ||
1027 | skins/default/xui/en-us/floater_auction.xml | 1033 | skins/default/xui/en-us/floater_auction.xml |
1028 | skins/default/xui/en-us/floater_audio_volume.xml | 1034 | skins/default/xui/en-us/floater_audio_volume.xml |
1029 | skins/default/xui/en-us/floater_avatar_picker.xml | 1035 | skins/default/xui/en-us/floater_avatar_picker.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..9f5c9bb --- /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 | |||
62 | JCFloaterAnimList::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 | |||
70 | JCFloaterAnimList::~JCFloaterAnimList() | ||
71 | { | ||
72 | } | ||
73 | |||
74 | //static | ||
75 | bool JCFloaterAnimList::visible(LLFloater* instance, const LLSD& key) | ||
76 | { | ||
77 | return VisibilityPolicy<LLFloater>::visible(instance, key); | ||
78 | } | ||
79 | |||
80 | //static | ||
81 | void JCFloaterAnimList::show(LLFloater* instance, const LLSD& key) | ||
82 | { | ||
83 | VisibilityPolicy<LLFloater>::show(instance, key); | ||
84 | } | ||
85 | |||
86 | //static | ||
87 | void JCFloaterAnimList::hide(LLFloater* instance, const LLSD& key) | ||
88 | { | ||
89 | VisibilityPolicy<LLFloater>::hide(instance, key); | ||
90 | } | ||
91 | |||
92 | void JCFloaterAnimList::onVisibilityChange(BOOL new_visibility) | ||
93 | { | ||
94 | if(!new_visibility) { | ||
95 | // *HACK: clean up memory on hiding | ||
96 | mObjectOwners.clear(); | ||
97 | } | ||
98 | } | ||
99 | |||
100 | BOOL 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 | |||
115 | void 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 | |||
132 | void 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 | |||
164 | void JCFloaterAnimList::StopRevokeSelected(void *userdata ) | ||
165 | { | ||
166 | StopSelected(userdata); | ||
167 | RevokeSelected(userdata); | ||
168 | } | ||
169 | |||
170 | void 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 | |||
201 | void JCFloaterAnimList::draw() | ||
202 | { | ||
203 | refresh(); | ||
204 | LLFloater::draw(); | ||
205 | } | ||
206 | //LLScrollListCtrl::getSelectedIDs(); | ||
207 | void 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("ScrollUnselectedColor").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("ScrollUnselectedColor").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("ScrollUnselectedColor").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("ScrollUnselectedColor").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 | |||
333 | void 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 | |||
344 | void 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 | |||
389 | const 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 | |||
441 | void 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 | |||
452 | void 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 | |||
36 | struct AObjectData | ||
37 | { | ||
38 | std::string owner_name; | ||
39 | LLUUID owner_id; | ||
40 | LLUUID root_id; | ||
41 | bool in_object_list; | ||
42 | }; | ||
43 | |||
44 | class JCFloaterAnimList : public LLFloater, public LLUISingleton<JCFloaterAnimList, JCFloaterAnimList> | ||
45 | { | ||
46 | public: | ||
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 | |||
67 | private: | ||
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/llagent.cpp b/linden/indra/newview/llagent.cpp index 5f0a875..7a70316 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp | |||
@@ -232,6 +232,7 @@ LLAgent gAgent; | |||
232 | // Statics | 232 | // Statics |
233 | // | 233 | // |
234 | BOOL LLAgent::sDebugDisplayTarget = FALSE; | 234 | BOOL LLAgent::sDebugDisplayTarget = FALSE; |
235 | BOOL LLAgent::sPhantom = FALSE; | ||
235 | 236 | ||
236 | const F32 LLAgent::TYPING_TIMEOUT_SECS = 5.f; | 237 | const F32 LLAgent::TYPING_TIMEOUT_SECS = 5.f; |
237 | 238 | ||
@@ -835,6 +836,35 @@ void LLAgent::toggleFlying() | |||
835 | 836 | ||
836 | 837 | ||
837 | //----------------------------------------------------------------------------- | 838 | //----------------------------------------------------------------------------- |
839 | // togglePhantom() | ||
840 | //----------------------------------------------------------------------------- | ||
841 | void LLAgent::togglePhantom() | ||
842 | { | ||
843 | BOOL phan = !(sPhantom); | ||
844 | |||
845 | setPhantom( phan ); | ||
846 | } | ||
847 | |||
848 | |||
849 | //----------------------------------------------------------------------------- | ||
850 | // setPhantom() lgg | ||
851 | //----------------------------------------------------------------------------- | ||
852 | void LLAgent::setPhantom(BOOL phantom) | ||
853 | { | ||
854 | sPhantom = phantom; | ||
855 | } | ||
856 | |||
857 | |||
858 | //----------------------------------------------------------------------------- | ||
859 | // getPhantom() lgg | ||
860 | //----------------------------------------------------------------------------- | ||
861 | BOOL LLAgent::getPhantom() | ||
862 | { | ||
863 | return sPhantom; | ||
864 | } | ||
865 | |||
866 | |||
867 | //----------------------------------------------------------------------------- | ||
838 | // setRegion() | 868 | // setRegion() |
839 | //----------------------------------------------------------------------------- | 869 | //----------------------------------------------------------------------------- |
840 | void LLAgent::setRegion(LLViewerRegion *regionp) | 870 | void LLAgent::setRegion(LLViewerRegion *regionp) |
diff --git a/linden/indra/newview/llagent.h b/linden/indra/newview/llagent.h index a4a930f..0b8463f 100644 --- a/linden/indra/newview/llagent.h +++ b/linden/indra/newview/llagent.h | |||
@@ -371,6 +371,11 @@ public: | |||
371 | // Does this parcel allow you to fly? | 371 | // Does this parcel allow you to fly? |
372 | BOOL canFly(); | 372 | BOOL canFly(); |
373 | 373 | ||
374 | //lgg crap | ||
375 | static BOOL getPhantom();// const { return emeraldPhantom; } | ||
376 | static void setPhantom(BOOL phantom); | ||
377 | static void togglePhantom(); | ||
378 | |||
374 | // Animation functions | 379 | // Animation functions |
375 | void stopCurrentAnimations(); | 380 | void stopCurrentAnimations(); |
376 | void requestStopMotion( LLMotion* motion ); | 381 | void requestStopMotion( LLMotion* motion ); |
@@ -801,6 +806,8 @@ private: | |||
801 | LLVector3d mCameraSmoothingLastPositionGlobal; | 806 | LLVector3d mCameraSmoothingLastPositionGlobal; |
802 | LLVector3d mCameraSmoothingLastPositionAgent; | 807 | LLVector3d mCameraSmoothingLastPositionAgent; |
803 | BOOL mCameraSmoothingStop; | 808 | BOOL mCameraSmoothingStop; |
809 | |||
810 | static BOOL sPhantom; | ||
804 | 811 | ||
805 | 812 | ||
806 | //Ventrella | 813 | //Ventrella |
diff --git a/linden/indra/newview/llappviewer.cpp b/linden/indra/newview/llappviewer.cpp index 4d53c88..0f1bfb4 100644 --- a/linden/indra/newview/llappviewer.cpp +++ b/linden/indra/newview/llappviewer.cpp | |||
@@ -3126,7 +3126,12 @@ void LLAppViewer::idle() | |||
3126 | { | 3126 | { |
3127 | // Send avatar and camera info | 3127 | // Send avatar and camera info |
3128 | last_control_flags = gAgent.getControlFlags(); | 3128 | last_control_flags = gAgent.getControlFlags(); |
3129 | send_agent_update(TRUE); | 3129 | |
3130 | if(!gAgent.getPhantom()) | ||
3131 | { | ||
3132 | send_agent_update(TRUE); | ||
3133 | } | ||
3134 | |||
3130 | agent_update_timer.reset(); | 3135 | agent_update_timer.reset(); |
3131 | } | 3136 | } |
3132 | } | 3137 | } |
diff --git a/linden/indra/newview/llfloaterassetbrowser.cpp b/linden/indra/newview/llfloaterassetbrowser.cpp new file mode 100644 index 0000000..615d21a --- /dev/null +++ b/linden/indra/newview/llfloaterassetbrowser.cpp | |||
@@ -0,0 +1,466 @@ | |||
1 | /** | ||
2 | * @file llfloaterassetbrowser.cpp | ||
3 | * @brief LLFloaterAssetBrowser class implementation | ||
4 | * Phox wuz hurr | ||
5 | */ | ||
6 | |||
7 | #include "llviewerprecompiledheaders.h" | ||
8 | #include "llfloaterassetbrowser.h" | ||
9 | #include "llinventoryview.h" | ||
10 | #include "llinventorymodel.h" | ||
11 | #include "llviewerimagelist.h" | ||
12 | #include "llbutton.h" | ||
13 | #include "lltextbox.h" | ||
14 | #include "llpreview.h" | ||
15 | #include "llinventorybridge.h" | ||
16 | #include "llagent.h" | ||
17 | #include "lltooldraganddrop.h" | ||
18 | #include "llfocusmgr.h" | ||
19 | #include "llview.h" | ||
20 | |||
21 | // Externs | ||
22 | extern LLInventoryModel gInventory; | ||
23 | |||
24 | // Statics | ||
25 | LLFloaterAssetBrowser* LLFloaterAssetBrowser::sInstance = NULL; | ||
26 | |||
27 | LLFloaterAssetBrowser::LLFloaterAssetBrowser() | ||
28 | : LLFloater("floater_asset_browser") | ||
29 | { | ||
30 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_asset_browser.xml"); | ||
31 | |||
32 | mInventoryPanel = getChild<LLInventoryPanel>("inventory panel"); | ||
33 | |||
34 | //Open all folders and close them in order to make item list up-to-date | ||
35 | //if(gInventory.getItemCount()==0) | ||
36 | mInventoryPanel->openAllFolders(); | ||
37 | |||
38 | //gInventory.startBackgroundFetch(gInventory.findCategoryUUIDForType(LLAssetType::AT_TEXTURE)); | ||
39 | |||
40 | |||
41 | childSetAction("button next", onClickNext, this); | ||
42 | childSetAction("button previous", onClickPrevious, this); | ||
43 | childSetAction("button refresh", onClickRefresh, this); | ||
44 | |||
45 | initialize(); | ||
46 | createThumbnails(); | ||
47 | mInventoryPanel->closeAllFolders(); | ||
48 | } | ||
49 | |||
50 | // static | ||
51 | void LLFloaterAssetBrowser::show(void*) | ||
52 | { | ||
53 | if (!sInstance) | ||
54 | sInstance = new LLFloaterAssetBrowser(); | ||
55 | |||
56 | sInstance->open(); | ||
57 | } | ||
58 | |||
59 | // virtual | ||
60 | LLFloaterAssetBrowser::~LLFloaterAssetBrowser() | ||
61 | { | ||
62 | clearAssetInfoTexts(); | ||
63 | mTextureAssets.clear(); | ||
64 | mMaxIndex = 0; | ||
65 | mFirstIndex = 0; | ||
66 | mMouseOverIndex = 0; | ||
67 | mMouseOverUUID = LLUUID::null; | ||
68 | mMouseOverAssetUUID = LLUUID::null; | ||
69 | mFloaterTitle = ""; | ||
70 | clearNoAssetsText(); | ||
71 | sInstance=NULL; | ||
72 | } | ||
73 | |||
74 | void LLFloaterAssetBrowser::initialize() | ||
75 | { | ||
76 | mMaxIndex = ITEMS_PER_PAGE; | ||
77 | mFirstIndex = 0; | ||
78 | mAssetInfoLabelList.clear(); | ||
79 | mAssetInfoIndex = 0; | ||
80 | mFloaterHeight = getRect().getHeight(); | ||
81 | mFloaterWidth = getRect().getWidth(); | ||
82 | mMouseOverIndex = 0; | ||
83 | mMouseOverUUID = LLUUID::null; | ||
84 | mMouseOverAssetUUID = LLUUID::null; | ||
85 | mFloaterTitle = ""; | ||
86 | |||
87 | S32 image_top = getRect().getHeight(); | ||
88 | S32 image_bottom = BTN_HEIGHT_SMALL; | ||
89 | S32 image_middle = (image_top + image_bottom) / 2; | ||
90 | S32 line_height = llround(LLFontGL::sSansSerifSmall->getLineHeight()); | ||
91 | |||
92 | mNoAssetsLabel = new LLTextBox("mNoAssetsLabel.", | ||
93 | LLRect(getRect().getWidth()/2, | ||
94 | image_middle + line_height / 2, | ||
95 | getRect().getWidth(), | ||
96 | image_middle - line_height / 2 ), | ||
97 | "No assets found.", | ||
98 | LLFontGL::sSansSerifSmall ); | ||
99 | mNoAssetsLabel->setFollowsAll(); | ||
100 | addChild(mNoAssetsLabel); | ||
101 | mNoAssetsLabel->setVisible(FALSE); | ||
102 | } | ||
103 | |||
104 | void LLFloaterAssetBrowser::createThumbnails() | ||
105 | { | ||
106 | LLViewerInventoryCategory::cat_array_t cats; | ||
107 | LLViewerInventoryItem::item_array_t items; | ||
108 | LLIsType isType(LLAssetType::AT_TEXTURE); | ||
109 | |||
110 | gInventory.collectDescendentsIf(LLUUID::null, | ||
111 | cats, | ||
112 | items, | ||
113 | LLInventoryModel::INCLUDE_TRASH, | ||
114 | isType); | ||
115 | |||
116 | //Get UUID, asset UUID and name | ||
117 | for(S32 i = 0; i < items.count(); i++) | ||
118 | { | ||
119 | LLInventoryItem* itemp = items[i]; | ||
120 | LLAssetSelection temp; | ||
121 | temp.mAssetUUID = itemp->getAssetUUID(); | ||
122 | temp.mUUID = itemp->getUUID(); | ||
123 | temp.mName = itemp->getName(); | ||
124 | temp.mTexturep = NULL; | ||
125 | temp.mAssetRect = LLRect::null; | ||
126 | mTextureAssets.push_back(temp); | ||
127 | } | ||
128 | |||
129 | //Get Texturep | ||
130 | for(S32 i = 0; i < items.count(); i++) | ||
131 | { | ||
132 | mTextureAssets[i].mTexturep = gImageList.getImage(mTextureAssets[i].mAssetUUID, MIPMAP_YES, IMMEDIATE_NO); | ||
133 | mTextureAssets[i].mTexturep->setBoostLevel(LLViewerImage::BOOST_PREVIEW); | ||
134 | //mTextureAssets[i].mTexturep->processTextureStats(); | ||
135 | } | ||
136 | |||
137 | //Generate the asset info text | ||
138 | /*for(S32 i = 0; i < items.count(); i++) | ||
139 | { | ||
140 | LLString asset_info; | ||
141 | LLString dimensions; | ||
142 | |||
143 | asset_info.append(mTextureAssets[i].mName); | ||
144 | |||
145 | //if(mTextureAssets[i].mTexturep->mFullWidth == 0 | ||
146 | //|| mTextureAssets[i].mTexturep->mFullHeight == 0) | ||
147 | |||
148 | dimensions = llformat("\n%d x %d", | ||
149 | mTextureAssets[i].mTexturep->mFullWidth, | ||
150 | mTextureAssets[i].mTexturep->mFullHeight); | ||
151 | asset_info.append(dimensions); | ||
152 | |||
153 | mTextureAssets[i].mAssetInfo = asset_info; | ||
154 | }*/ | ||
155 | |||
156 | mFloaterTitle = llformat("Asset Browser (%d assets fetched)", mTextureAssets.size()); | ||
157 | setTitle(mFloaterTitle); | ||
158 | } | ||
159 | |||
160 | // virtual | ||
161 | BOOL LLFloaterAssetBrowser::handleHover(S32 x, S32 y, MASK mask) | ||
162 | { | ||
163 | if(mTextureAssets.size() > 0) | ||
164 | { | ||
165 | for(U32 i = mFirstIndex; i < mMaxIndex; i++) | ||
166 | { | ||
167 | if(i < mTextureAssets.size()) | ||
168 | { | ||
169 | if(mTextureAssets[i].mAssetRect.pointInRect(x,y)) | ||
170 | { | ||
171 | mMouseOverUUID = mTextureAssets[i].mUUID; | ||
172 | mMouseOverIndex = i; | ||
173 | |||
174 | if(hasMouseCapture()) | ||
175 | { | ||
176 | S32 screen_x; | ||
177 | S32 screen_y; | ||
178 | LLUUID mObjectUUID= LLUUID::null; | ||
179 | const LLViewerInventoryItem *item = gInventory.getItem(mMouseOverUUID); | ||
180 | |||
181 | localPointToScreen(x, y, &screen_x, &screen_y ); | ||
182 | |||
183 | if(item && item->getPermissions().allowCopyBy(gAgent.getID(), gAgent.getGroupID()) | ||
184 | && LLToolDragAndDrop::getInstance()->isOverThreshold(screen_x, screen_y)) | ||
185 | { | ||
186 | EDragAndDropType type; | ||
187 | type = LLAssetType::lookupDragAndDropType(item->getType()); | ||
188 | LLToolDragAndDrop::ESource src = LLToolDragAndDrop::SOURCE_LIBRARY; | ||
189 | |||
190 | if(!mObjectUUID.isNull()) | ||
191 | { | ||
192 | src = LLToolDragAndDrop::SOURCE_WORLD; | ||
193 | } | ||
194 | else if(item->getPermissions().getOwner() == gAgent.getID()) | ||
195 | { | ||
196 | src = LLToolDragAndDrop::SOURCE_AGENT; | ||
197 | } | ||
198 | LLToolDragAndDrop::getInstance()->beginDrag(type, | ||
199 | item->getUUID(), | ||
200 | src, | ||
201 | mObjectUUID); | ||
202 | return LLToolDragAndDrop::getInstance()->handleHover(x, y, mask); | ||
203 | } | ||
204 | return TRUE; | ||
205 | } | ||
206 | return LLFloater::handleHover(x, y, mask); | ||
207 | } | ||
208 | } | ||
209 | } | ||
210 | return LLFloater::handleHover(x, y, mask); | ||
211 | } | ||
212 | else | ||
213 | { | ||
214 | mMouseOverUUID = LLUUID::null; | ||
215 | return LLFloater::handleHover(x, y, mask); | ||
216 | } | ||
217 | } | ||
218 | |||
219 | // virtual | ||
220 | BOOL LLFloaterAssetBrowser::handleMouseDown(S32 x, S32 y, MASK mask) | ||
221 | { | ||
222 | if(mTextureAssets.size() > 0) | ||
223 | { | ||
224 | if(mTextureAssets[mMouseOverIndex].mAssetRect.pointInRect(x,y)) | ||
225 | { | ||
226 | if(mMouseOverUUID.notNull()) | ||
227 | { | ||
228 | gFocusMgr.setMouseCapture(this); | ||
229 | S32 screen_x; | ||
230 | S32 screen_y; | ||
231 | localPointToScreen(x, y, &screen_x, &screen_y); | ||
232 | LLToolDragAndDrop::getInstance()->setDragStart(screen_x, screen_y); | ||
233 | return TRUE; | ||
234 | } | ||
235 | } | ||
236 | } | ||
237 | return LLFloater::handleMouseDown(x, y, mask); | ||
238 | } | ||
239 | |||
240 | // virtual | ||
241 | BOOL LLFloaterAssetBrowser::handleMouseUp(S32 x, S32 y, MASK mask) | ||
242 | { | ||
243 | if(hasMouseCapture()) | ||
244 | { | ||
245 | gFocusMgr.setMouseCapture(NULL); | ||
246 | return TRUE; | ||
247 | } | ||
248 | return LLFloater::handleMouseUp(x, y, mask); | ||
249 | } | ||
250 | |||
251 | // virtual | ||
252 | BOOL LLFloaterAssetBrowser::handleDoubleClick(S32 x, S32 y, MASK mask) | ||
253 | { | ||
254 | if(mTextureAssets.size() > 0) | ||
255 | { | ||
256 | if(mTextureAssets[mMouseOverIndex].mAssetRect.pointInRect(x,y)) | ||
257 | { | ||
258 | if(mMouseOverUUID.notNull()) | ||
259 | { | ||
260 | open_texture(mMouseOverUUID, mTextureAssets[mMouseOverIndex].mName, FALSE); | ||
261 | return TRUE; | ||
262 | } | ||
263 | } | ||
264 | } | ||
265 | return LLFloater::handleDoubleClick(x, y, mask); | ||
266 | } | ||
267 | |||
268 | // virtual | ||
269 | void LLFloaterAssetBrowser::draw() | ||
270 | { | ||
271 | LLFloater::draw(); | ||
272 | |||
273 | if(mTextureAssets.size() > 0) | ||
274 | { | ||
275 | S32 hor_pos = 0; | ||
276 | S32 ver_pos = 0; | ||
277 | U32 items_per_row = 0; | ||
278 | S32 height = getRect().getHeight()/8; | ||
279 | S32 width = height; | ||
280 | |||
281 | for(U32 i = mFirstIndex; i < mMaxIndex; i++) | ||
282 | { | ||
283 | if(i < mTextureAssets.size()) | ||
284 | { | ||
285 | mTexturep = NULL; | ||
286 | mImageAssetID = mTextureAssets[i].mAssetUUID; | ||
287 | |||
288 | if(mImageAssetID.notNull()) | ||
289 | { | ||
290 | mTexturep = gImageList.getImage(mImageAssetID, MIPMAP_YES, IMMEDIATE_NO); | ||
291 | //mTexturep->setBoostLevel(LLViewerImage::BOOST_PREVIEW); | ||
292 | mTexturep->processTextureStats(); | ||
293 | mTextureAssets[i].mWidth = mTexturep->mFullWidth; | ||
294 | mTextureAssets[i].mHeight = mTexturep->mFullHeight; | ||
295 | } | ||
296 | |||
297 | if(isMinimized()) | ||
298 | { | ||
299 | return; | ||
300 | } | ||
301 | |||
302 | //Border | ||
303 | LLRect border; | ||
304 | border.mLeft = START_POS + ver_pos; | ||
305 | border.mTop = getRect().getHeight() - LLFLOATER_HEADER_SIZE - BORDER_PAD - hor_pos; | ||
306 | border.mRight = border.mLeft + width; | ||
307 | border.mBottom = border.mTop - height; | ||
308 | |||
309 | //Save the rect for each thumbnail | ||
310 | mTextureAssets[i].mAssetRect = border; | ||
311 | |||
312 | //Asset info rect | ||
313 | LLRect info_rect; | ||
314 | info_rect.mLeft = border.mLeft; | ||
315 | info_rect.mTop = border.mBottom - 3; | ||
316 | info_rect.mRight = border.mLeft + 130; | ||
317 | info_rect.mBottom = border.mBottom - 2*llround(LLFontGL::sSansSerifSmall->getLineHeight()); | ||
318 | |||
319 | gl_rect_2d(border, LLColor4::black, FALSE); | ||
320 | |||
321 | // Interior | ||
322 | LLRect interior = border; | ||
323 | interior.stretch(1); | ||
324 | |||
325 | //Draw the image | ||
326 | if(mTexturep) | ||
327 | { | ||
328 | if(mTexturep->getComponents() == 4) | ||
329 | { | ||
330 | gl_rect_2d_checkerboard(interior); | ||
331 | } | ||
332 | |||
333 | gl_draw_scaled_image(interior.mLeft, interior.mBottom, interior.getWidth(), interior.getHeight(), mTexturep); | ||
334 | // Pump the priority | ||
335 | mTexturep->addTextureStats((F32)(interior.getWidth() * interior.getHeight())); | ||
336 | |||
337 | //Generate the asset info text | ||
338 | std::string asset_info; | ||
339 | asset_info.append(mTextureAssets[i].mName); | ||
340 | std::string dimensions = llformat("\n%d x %d", | ||
341 | mTexturep->mFullWidth /*mTextureAssets[i].mWidth*/, | ||
342 | mTexturep->mFullHeight /* mTextureAssets[i].mHeight*/); | ||
343 | asset_info.append(dimensions); | ||
344 | |||
345 | // Draw material info below the asset | ||
346 | // LLTextBox object has to be drawn only once, not non-stop like image | ||
347 | if(mAssetInfoIndex < ITEMS_PER_PAGE && | ||
348 | mAssetInfoIndex < mTextureAssets.size() - mFirstIndex) | ||
349 | { | ||
350 | mAssetInfoLabel = new LLTextBox("Asset Info"/*mTextureAssets[i].mAssetInfo*/, | ||
351 | info_rect, | ||
352 | asset_info, | ||
353 | LLFontGL::sSansSerifSmall); | ||
354 | mAssetInfoLabel->setFollowsAll(); | ||
355 | mAssetInfoLabelList.push_back(mAssetInfoLabel); | ||
356 | addChild(mAssetInfoLabelList[mAssetInfoIndex]); | ||
357 | mAssetInfoLabelList[mAssetInfoIndex]->setVisible(TRUE); | ||
358 | mAssetInfoIndex++; | ||
359 | } | ||
360 | |||
361 | } | ||
362 | else | ||
363 | { | ||
364 | // Draw X | ||
365 | gl_rect_2d(interior, LLColor4::grey, TRUE); | ||
366 | gl_draw_x(interior, LLColor4::black); | ||
367 | } | ||
368 | //Move to the right | ||
369 | ver_pos += getRect().getWidth()/6; | ||
370 | items_per_row++; | ||
371 | |||
372 | //Change the row | ||
373 | if(items_per_row % 4 == 0) | ||
374 | { | ||
375 | ver_pos = 0; | ||
376 | hor_pos += getRect().getHeight()/4; | ||
377 | } | ||
378 | } | ||
379 | }//for | ||
380 | |||
381 | //If the size of the floater has changed, clear the asset info texts | ||
382 | //in order to draw them again into the new position | ||
383 | if(getRect().getWidth() != mFloaterWidth || getRect().getHeight() != mFloaterHeight) | ||
384 | { | ||
385 | clearAssetInfoTexts(); | ||
386 | //Save the size of the current floater | ||
387 | mFloaterWidth = getRect().getWidth(); | ||
388 | mFloaterHeight = getRect().getHeight(); | ||
389 | } | ||
390 | if(mMaxIndex >= mTextureAssets.size()) | ||
391 | { | ||
392 | childDisable("button next"); | ||
393 | childEnable("button previous"); | ||
394 | } | ||
395 | else if(mFirstIndex <= 0) | ||
396 | { | ||
397 | childEnable("button next"); | ||
398 | childDisable("button previous"); | ||
399 | } | ||
400 | else | ||
401 | { | ||
402 | childEnable("button next"); | ||
403 | childEnable("button previous"); | ||
404 | } | ||
405 | } | ||
406 | else | ||
407 | { | ||
408 | //No assets found | ||
409 | mNoAssetsLabel->setVisible(TRUE); | ||
410 | childDisable("button next"); | ||
411 | childDisable("button previous"); | ||
412 | } | ||
413 | } | ||
414 | |||
415 | void LLFloaterAssetBrowser::clearAssetInfoTexts() | ||
416 | { | ||
417 | for(U32 i = 0; i < mAssetInfoLabelList.size(); i++) | ||
418 | { | ||
419 | delete mAssetInfoLabelList[i]; | ||
420 | mAssetInfoLabelList[i] = NULL; | ||
421 | } | ||
422 | mAssetInfoLabelList.clear(); | ||
423 | mAssetInfoIndex = 0; | ||
424 | } | ||
425 | |||
426 | void LLFloaterAssetBrowser::clearNoAssetsText() | ||
427 | { | ||
428 | if(mTextureAssets.size() > 0) | ||
429 | { | ||
430 | delete mNoAssetsLabel; | ||
431 | mNoAssetsLabel = NULL; | ||
432 | } | ||
433 | } | ||
434 | |||
435 | // static | ||
436 | void LLFloaterAssetBrowser::onClickNext(void *userdata) | ||
437 | { | ||
438 | LLFloaterAssetBrowser* self = (LLFloaterAssetBrowser*)userdata; | ||
439 | self->mFirstIndex = self->mMaxIndex; | ||
440 | self->mMaxIndex = self->mFirstIndex + ITEMS_PER_PAGE; | ||
441 | self->clearAssetInfoTexts(); | ||
442 | } | ||
443 | |||
444 | // static | ||
445 | void LLFloaterAssetBrowser::onClickPrevious(void *userdata) | ||
446 | { | ||
447 | LLFloaterAssetBrowser* self = (LLFloaterAssetBrowser*)userdata; | ||
448 | self->mFirstIndex = self->mMaxIndex - (2 * ITEMS_PER_PAGE); | ||
449 | self->mMaxIndex = self->mMaxIndex - ITEMS_PER_PAGE; | ||
450 | self->clearAssetInfoTexts(); | ||
451 | } | ||
452 | |||
453 | // static | ||
454 | void LLFloaterAssetBrowser::onClickRefresh(void *userdata) | ||
455 | { | ||
456 | LLFloaterAssetBrowser* self = (LLFloaterAssetBrowser*)userdata; | ||
457 | for(U32 i = 0; i < self->mTextureAssets.size(); i++) | ||
458 | { | ||
459 | self->mTextureAssets[i].mTexturep = NULL; | ||
460 | } | ||
461 | |||
462 | self->mTextureAssets.clear(); | ||
463 | self->createThumbnails(); | ||
464 | self->clearNoAssetsText(); | ||
465 | self->clearAssetInfoTexts(); | ||
466 | } | ||
diff --git a/linden/indra/newview/llfloaterassetbrowser.h b/linden/indra/newview/llfloaterassetbrowser.h new file mode 100644 index 0000000..76eb3ba --- /dev/null +++ b/linden/indra/newview/llfloaterassetbrowser.h | |||
@@ -0,0 +1,84 @@ | |||
1 | /** | ||
2 | * @file llfloaterassetbrowser.h | ||
3 | * @brief LLFloaterAssetBrowser class implementation | ||
4 | * Phox wuz hurr | ||
5 | */ | ||
6 | |||
7 | #ifndef LL_LLFLOATERASSETBROWSERVIEW_H | ||
8 | #define LL_LLFLOATERASSETBROWSERVIEW_H | ||
9 | |||
10 | #include "llfloater.h" | ||
11 | #include "llinventorymodel.h" | ||
12 | #include "llview.h" | ||
13 | #include "llviewerimage.h" | ||
14 | |||
15 | class LLInventoryPanel; | ||
16 | |||
17 | struct LLAssetSelection | ||
18 | { | ||
19 | LLUUID mUUID; | ||
20 | LLUUID mAssetUUID; | ||
21 | std::string mName; | ||
22 | std::string mAssetInfo; | ||
23 | S32 mWidth; | ||
24 | S32 mHeight; | ||
25 | LLTextBox* mAssetInfoTextBox; | ||
26 | LLPointer<LLViewerImage> mTexturep; | ||
27 | LLRect mAssetRect; | ||
28 | }; | ||
29 | |||
30 | class LLFloaterAssetBrowser : public LLFloater | ||
31 | { | ||
32 | public: | ||
33 | LLFloaterAssetBrowser(); | ||
34 | |||
35 | virtual ~LLFloaterAssetBrowser(); | ||
36 | |||
37 | static void show(void*); | ||
38 | |||
39 | virtual BOOL handleHover(S32 x, S32 y, MASK mask); | ||
40 | virtual BOOL handleMouseDown(S32 x, S32 y, MASK mask); | ||
41 | virtual BOOL handleMouseUp(S32 x, S32 y, MASK mask); | ||
42 | virtual BOOL handleDoubleClick(S32 x, S32 y, MASK mask); | ||
43 | virtual void draw(); | ||
44 | |||
45 | static LLFloaterAssetBrowser* getInstance(){ return sInstance; } | ||
46 | |||
47 | private: | ||
48 | void initialize(); | ||
49 | void createThumbnails(); | ||
50 | void clearAssetInfoTexts(); | ||
51 | void clearNoAssetsText(); | ||
52 | |||
53 | static void onClickNext(void *userdata); | ||
54 | static void onClickPrevious(void *userdata); | ||
55 | static void onClickRefresh(void *userdata); | ||
56 | |||
57 | static LLFloaterAssetBrowser* sInstance; | ||
58 | |||
59 | protected: | ||
60 | LLInventoryPanel* mInventoryPanel; | ||
61 | LLUUID mImageAssetID; | ||
62 | LLUUID mMouseOverUUID; | ||
63 | LLUUID mMouseOverAssetUUID; | ||
64 | LLPointer<LLViewerImage> mTexturep; | ||
65 | std::vector<LLAssetSelection> mTextureAssets; | ||
66 | std::vector<LLTextBox*> mAssetInfoLabelList; | ||
67 | U32 mLastIndex; | ||
68 | U32 mMaxIndex; | ||
69 | U32 mFirstIndex; | ||
70 | U32 mAssetInfoIndex; | ||
71 | S32 mFloaterHeight; | ||
72 | S32 mFloaterWidth; | ||
73 | S32 mMouseOverIndex; | ||
74 | LLTextBox* mNoAssetsLabel; | ||
75 | LLTextBox* mAssetInfoLabel; | ||
76 | std::string mFloaterTitle; | ||
77 | }; | ||
78 | |||
79 | static const S32 HPAD = 4; | ||
80 | static const S32 BORDER_PAD = HPAD; | ||
81 | static const U32 ITEMS_PER_PAGE = 16; | ||
82 | static const S32 START_POS = 250; | ||
83 | |||
84 | #endif | ||
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index aca3cac..fdc0182 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -2462,6 +2462,10 @@ bool idle_startup() | |||
2462 | 2462 | ||
2463 | // Have the agent start watching the friends list so we can update proxies | 2463 | // Have the agent start watching the friends list so we can update proxies |
2464 | gAgent.observeFriends(); | 2464 | gAgent.observeFriends(); |
2465 | |||
2466 | // Start loading inventory | ||
2467 | gInventory.startBackgroundFetch(); | ||
2468 | |||
2465 | if (gSavedSettings.getBOOL("LoginAsGod")) | 2469 | if (gSavedSettings.getBOOL("LoginAsGod")) |
2466 | { | 2470 | { |
2467 | gAgent.requestEnterGodMode(); | 2471 | gAgent.requestEnterGodMode(); |
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 2e4f3f4..36ffc21 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -210,6 +210,9 @@ | |||
210 | 210 | ||
211 | #include "lltexlayer.h" | 211 | #include "lltexlayer.h" |
212 | 212 | ||
213 | #include "jcfloater_animation_list.h" | ||
214 | #include "llfloaterassetbrowser.h" | ||
215 | |||
213 | void init_client_menu(LLMenuGL* menu); | 216 | void init_client_menu(LLMenuGL* menu); |
214 | void init_server_menu(LLMenuGL* menu); | 217 | void init_server_menu(LLMenuGL* menu); |
215 | 218 | ||
@@ -5218,6 +5221,10 @@ class LLShowFloater : public view_listener_t | |||
5218 | { | 5221 | { |
5219 | LLFloaterActiveSpeakers::toggleInstance(LLSD()); | 5222 | LLFloaterActiveSpeakers::toggleInstance(LLSD()); |
5220 | } | 5223 | } |
5224 | else if (floater_name == "animation list") | ||
5225 | { | ||
5226 | JCFloaterAnimList::toggleInstance(LLSD()); | ||
5227 | } | ||
5221 | else if (floater_name == "inworld browser") | 5228 | else if (floater_name == "inworld browser") |
5222 | { | 5229 | { |
5223 | LLFloaterMediaBrowser::toggle(); | 5230 | LLFloaterMediaBrowser::toggle(); |
@@ -7555,6 +7562,113 @@ class LLAdvancedCheckHUDInfo : public view_listener_t | |||
7555 | }; | 7562 | }; |
7556 | 7563 | ||
7557 | 7564 | ||
7565 | ////////////////////// | ||
7566 | // FORCE GROUND SIT // | ||
7567 | ////////////////////// | ||
7568 | |||
7569 | class LLAdvancedToggleSit: public view_listener_t | ||
7570 | { | ||
7571 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
7572 | { | ||
7573 | LLChat chat; | ||
7574 | chat.mSourceType = CHAT_SOURCE_SYSTEM; | ||
7575 | if(!gAgent.getAvatarObject()->mIsSitting) | ||
7576 | { | ||
7577 | gAgent.setControlFlags(AGENT_CONTROL_SIT_ON_GROUND); | ||
7578 | chat.mText = "Forcing Ground Sit"; | ||
7579 | } | ||
7580 | else | ||
7581 | { | ||
7582 | gAgent.setControlFlags(!AGENT_CONTROL_SIT_ON_GROUND); | ||
7583 | gAgent.setControlFlags(AGENT_CONTROL_STAND_UP); | ||
7584 | chat.mText = "Standing up"; | ||
7585 | } | ||
7586 | LLFloaterChat::addChat(chat); | ||
7587 | return true; | ||
7588 | } | ||
7589 | }; | ||
7590 | |||
7591 | class LLAdvancedCheckSit : public view_listener_t | ||
7592 | { | ||
7593 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
7594 | { | ||
7595 | if(gAgent.getAvatarObject()->mIsSitting) | ||
7596 | { | ||
7597 | gMenuHolder->findControl(userdata["control"].asString())->setValue(true); | ||
7598 | } | ||
7599 | else | ||
7600 | { | ||
7601 | gMenuHolder->findControl(userdata["control"].asString())->setValue(false); | ||
7602 | } | ||
7603 | return true; | ||
7604 | } | ||
7605 | }; | ||
7606 | |||
7607 | |||
7608 | ///////////// | ||
7609 | // PHANTOM // | ||
7610 | ///////////// | ||
7611 | |||
7612 | class LLAdvancedTogglePhantom: public view_listener_t | ||
7613 | { | ||
7614 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
7615 | { | ||
7616 | LLAgent::togglePhantom(); | ||
7617 | BOOL ph = LLAgent::getPhantom(); | ||
7618 | LLChat chat; | ||
7619 | chat.mSourceType = CHAT_SOURCE_SYSTEM; | ||
7620 | chat.mText = llformat("%s%s","Phantom ",(ph ? "On" : "Off")); | ||
7621 | LLFloaterChat::addChat(chat); | ||
7622 | //gMenuHolder->findControl(userdata["control"].asString())->setValue(ph); | ||
7623 | return true; | ||
7624 | } | ||
7625 | |||
7626 | }; | ||
7627 | |||
7628 | class LLAdvancedCheckPhantom: public view_listener_t | ||
7629 | { | ||
7630 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
7631 | { | ||
7632 | gMenuHolder->findControl(userdata["control"].asString())->setValue(LLAgent::getPhantom()); | ||
7633 | return true; | ||
7634 | } | ||
7635 | }; | ||
7636 | |||
7637 | |||
7638 | /////////////////// | ||
7639 | // ASSET BROWSER // | ||
7640 | /////////////////// | ||
7641 | |||
7642 | class LLAdvancedToggleAssetBrowser: public view_listener_t | ||
7643 | { | ||
7644 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
7645 | { | ||
7646 | //open the floater | ||
7647 | LLFloaterAssetBrowser::show(0); | ||
7648 | |||
7649 | bool vis = false; | ||
7650 | if(LLFloaterAssetBrowser::getInstance()) | ||
7651 | { | ||
7652 | vis = (bool)LLFloaterAssetBrowser::getInstance()->getVisible(); | ||
7653 | } | ||
7654 | return true; | ||
7655 | } | ||
7656 | }; | ||
7657 | |||
7658 | class LLAdvancedCheckAssetBrowser: public view_listener_t | ||
7659 | { | ||
7660 | bool handleEvent(LLPointer<LLEvent> event, const LLSD& userdata) | ||
7661 | { | ||
7662 | bool vis = false; | ||
7663 | if(LLFloaterAssetBrowser::getInstance()) | ||
7664 | { | ||
7665 | vis = (bool)LLFloaterAssetBrowser::getInstance()->getVisible(); | ||
7666 | } | ||
7667 | gMenuHolder->findControl(userdata["control"].asString())->setValue(vis); | ||
7668 | return true; | ||
7669 | } | ||
7670 | }; | ||
7671 | |||
7558 | 7672 | ||
7559 | /////////////////////// | 7673 | /////////////////////// |
7560 | // CLEAR GROUP CACHE // | 7674 | // CLEAR GROUP CACHE // |
@@ -9719,6 +9833,12 @@ void initialize_menus() | |||
9719 | addMenu(new LLAdvancedCheckConsole(), "Advanced.CheckConsole"); | 9833 | addMenu(new LLAdvancedCheckConsole(), "Advanced.CheckConsole"); |
9720 | addMenu(new LLAdvancedDumpInfoToConsole(), "Advanced.DumpInfoToConsole"); | 9834 | addMenu(new LLAdvancedDumpInfoToConsole(), "Advanced.DumpInfoToConsole"); |
9721 | addMenu(new LLAdvancedReloadSettingsOverrides(), "Advanced.ReloadSettingsOverrides"); | 9835 | addMenu(new LLAdvancedReloadSettingsOverrides(), "Advanced.ReloadSettingsOverrides"); |
9836 | addMenu(new LLAdvancedToggleSit(), "Advanced.ToggleSit"); | ||
9837 | addMenu(new LLAdvancedCheckSit(), "Emerald.CheckSit"); | ||
9838 | addMenu(new LLAdvancedTogglePhantom(), "Advanced.TogglePhantom"); | ||
9839 | addMenu(new LLAdvancedCheckPhantom(), "Advanced.CheckPhantom"); | ||
9840 | addMenu(new LLAdvancedToggleAssetBrowser(),"Advanced.ToggleAssetBrowser"); | ||
9841 | addMenu(new LLAdvancedCheckAssetBrowser(),"Advanced.CheckAssetBrowser"); | ||
9722 | 9842 | ||
9723 | // Advanced > HUD Info | 9843 | // Advanced > HUD Info |
9724 | addMenu(new LLAdvancedToggleHUDInfo(), "Advanced.ToggleHUDInfo"); | 9844 | addMenu(new LLAdvancedToggleHUDInfo(), "Advanced.ToggleHUDInfo"); |
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/floater_asset_browser.xml b/linden/indra/newview/skins/default/xui/en-us/floater_asset_browser.xml new file mode 100644 index 0000000..13c6b6c --- /dev/null +++ b/linden/indra/newview/skins/default/xui/en-us/floater_asset_browser.xml | |||
@@ -0,0 +1,29 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> | ||
2 | |||
3 | <floater bottom="-300" can_close="true" can_drag_on_left="false" can_minimize="true" | ||
4 | can_resize="true" enabled="true" follows="left|bottom" height="620" | ||
5 | hidden="false" left="300" min_height="420" min_width="630" | ||
6 | mouse_opaque="true" name="asset browser" title="Asset Browser" width="720"> | ||
7 | |||
8 | <inventory_panel allow_multi_select="false" border="true" bottom="-299" enabled="true" | ||
9 | follows="left|top" height="280" hidden="false" left="10" | ||
10 | mouse_opaque="true" name="inventory panel" | ||
11 | sort_order="TexturePickerSortOrder" width="231"/> | ||
12 | |||
13 | <button bottom="-350" follows="left|top" font="SansSerifSmall" | ||
14 | halign="center" height="20" hidden="false" label="Next >>" | ||
15 | left="160" mouse_opaque="true" name="button next" scale_image="TRUE" | ||
16 | width="80"/> | ||
17 | |||
18 | <button bottom_delta="-30" follows="left|top" font="SansSerifSmall" | ||
19 | halign="center" height="20" hidden="false" label="<< Previous" | ||
20 | left_delta="0" mouse_opaque="true" name="button previous" scale_image="TRUE" | ||
21 | width="80"/> | ||
22 | |||
23 | <button bottom_delta="-30" follows="left|top" font="SansSerifSmall" | ||
24 | halign="center" height="20" hidden="false" label="Refresh" | ||
25 | left_delta="0" mouse_opaque="true" name="button refresh" scale_image="TRUE" | ||
26 | width="80"/> | ||
27 | |||
28 | </floater> | ||
29 | |||
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 f837029..a53e339 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 | |||
@@ -884,6 +884,25 @@ | |||
884 | userdata="QuietSnapshotsToDisk" /> | 884 | userdata="QuietSnapshotsToDisk" /> |
885 | <on_check control="QuietSnapshotsToDisk" /> | 885 | <on_check control="QuietSnapshotsToDisk" /> |
886 | </menu_item_check> | 886 | </menu_item_check> |
887 | <menu_item_call label="Ground Sit" name="Ground Sit" | ||
888 | shortcut="control|alt|s"> | ||
889 | <on_click function="Advanced.ToggleSit" userdata="" /> | ||
890 | <on_Check function="Advanced.CheckSit" userdata="" /> | ||
891 | </menu_item_call> | ||
892 | <menu_item_check label="Phantom Avatar" name="Phantom" | ||
893 | shortcut="control|alt|p"> | ||
894 | <on_click function="Advanced.TogglePhantom" userdata="" /> | ||
895 | <on_check function="Advanced.CheckPhantom" userdata="" /> | ||
896 | </menu_item_check> | ||
897 | <menu_item_check label="Animation List" name="Animation List"> | ||
898 | <on_click function="ShowFloater" userdata="animation list" /> | ||
899 | <on_check function="FloaterVisible" userdata="animation list" /> | ||
900 | </menu_item_check> | ||
901 | <menu_item_check label="Asset Browser" name="asset browser" | ||
902 | shortcut="alt|shift|a"> | ||
903 | <on_click function="Advanced.ToggleAssetBrowser" userdata="" /> | ||
904 | <on_check function="Advanced.CheckAssetBrowser" userdata="" /> | ||
905 | </menu_item_check> | ||
887 | <menu_item_check name="Show Mouselook Crosshairs" | 906 | <menu_item_check name="Show Mouselook Crosshairs" |
888 | label="Show Mouselook Crosshairs"> | 907 | label="Show Mouselook Crosshairs"> |
889 | <on_click function="ToggleControl" | 908 | <on_click function="ToggleControl" |