diff options
Diffstat (limited to 'linden')
-rw-r--r-- | linden/indra/newview/CMakeLists.txt | 2 | ||||
-rw-r--r-- | linden/indra/newview/app_settings/settings.xml | 18 | ||||
-rw-r--r-- | linden/indra/newview/llagent.cpp | 29 | ||||
-rw-r--r-- | linden/indra/newview/llagent.h | 9 | ||||
-rw-r--r-- | linden/indra/newview/llfloaterteleporthistory.cpp | 348 | ||||
-rw-r--r-- | linden/indra/newview/llfloaterteleporthistory.h | 93 | ||||
-rw-r--r-- | linden/indra/newview/llstartup.cpp | 10 | ||||
-rw-r--r-- | linden/indra/newview/llviewermenu.cpp | 7 | ||||
-rwxr-xr-x | linden/indra/newview/llviewermessage.cpp | 11 | ||||
-rw-r--r-- | linden/indra/newview/llviewerwindow.cpp | 8 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/floater_teleport_history.xml | 46 | ||||
-rw-r--r-- | linden/indra/newview/skins/default/xui/en-us/menu_viewer.xml | 4 |
12 files changed, 583 insertions, 2 deletions
diff --git a/linden/indra/newview/CMakeLists.txt b/linden/indra/newview/CMakeLists.txt index cd4acdc..995ef7e 100644 --- a/linden/indra/newview/CMakeLists.txt +++ b/linden/indra/newview/CMakeLists.txt | |||
@@ -220,6 +220,7 @@ set(viewer_SOURCE_FILES | |||
220 | llfloatersnapshot.cpp | 220 | llfloatersnapshot.cpp |
221 | llfloaterstats.cpp | 221 | llfloaterstats.cpp |
222 | llfloatertelehub.cpp | 222 | llfloatertelehub.cpp |
223 | llfloaterteleporthistory.cpp | ||
223 | llfloatertest.cpp | 224 | llfloatertest.cpp |
224 | llfloatertools.cpp | 225 | llfloatertools.cpp |
225 | llfloatertopobjects.cpp | 226 | llfloatertopobjects.cpp |
@@ -663,6 +664,7 @@ set(viewer_HEADER_FILES | |||
663 | llfloatersnapshot.h | 664 | llfloatersnapshot.h |
664 | llfloaterstats.h | 665 | llfloaterstats.h |
665 | llfloatertelehub.h | 666 | llfloatertelehub.h |
667 | llfloaterteleporthistory.h | ||
666 | llfloatertest.h | 668 | llfloatertest.h |
667 | llfloatertools.h | 669 | llfloatertools.h |
668 | llfloatertopobjects.h | 670 | llfloatertopobjects.h |
diff --git a/linden/indra/newview/app_settings/settings.xml b/linden/indra/newview/app_settings/settings.xml index 41ec05d..db44efd 100644 --- a/linden/indra/newview/app_settings/settings.xml +++ b/linden/indra/newview/app_settings/settings.xml | |||
@@ -5823,7 +5823,23 @@ | |||
5823 | <integer>0</integer> | 5823 | <integer>0</integer> |
5824 | </array> | 5824 | </array> |
5825 | </map> | 5825 | </map> |
5826 | <key>FloaterViewBottom</key> | 5826 | <key>FloaterTeleportHistoryRect</key> |
5827 | <map> | ||
5828 | <key>Comment</key> | ||
5829 | <string>Rectangle for teleport history window</string> | ||
5830 | <key>Persist</key> | ||
5831 | <integer>1</integer> | ||
5832 | <key>Type</key> | ||
5833 | <string>Rect</string> | ||
5834 | <key>Value</key> | ||
5835 | <array> | ||
5836 | <integer>20</integer> | ||
5837 | <integer>20</integer> | ||
5838 | <integer>470</integer> | ||
5839 | <integer>200</integer> | ||
5840 | </array> | ||
5841 | </map> | ||
5842 | <key>FloaterViewBottom</key> | ||
5827 | <map> | 5843 | <map> |
5828 | <key>Comment</key> | 5844 | <key>Comment</key> |
5829 | <string>[DO NOT MODIFY] Controls layout of floating windows within SL window</string> | 5845 | <string>[DO NOT MODIFY] Controls layout of floating windows within SL window</string> |
diff --git a/linden/indra/newview/llagent.cpp b/linden/indra/newview/llagent.cpp index 38e1c0f..03d5c65 100644 --- a/linden/indra/newview/llagent.cpp +++ b/linden/indra/newview/llagent.cpp | |||
@@ -6102,6 +6102,10 @@ void LLAgent::teleportRequest( | |||
6102 | const LLVector3& pos_local) | 6102 | const LLVector3& pos_local) |
6103 | { | 6103 | { |
6104 | LLViewerRegion* regionp = getRegion(); | 6104 | LLViewerRegion* regionp = getRegion(); |
6105 | |||
6106 | // Set last region data for teleport history | ||
6107 | gAgent.setLastRegionData(regionp->getName(),gAgent.getPositionAgent()); | ||
6108 | |||
6105 | if(regionp && teleportCore()) | 6109 | if(regionp && teleportCore()) |
6106 | { | 6110 | { |
6107 | llinfos << "TeleportRequest: '" << region_handle << "':" << pos_local | 6111 | llinfos << "TeleportRequest: '" << region_handle << "':" << pos_local |
@@ -6133,6 +6137,10 @@ void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) | |||
6133 | // [/RLVa:KB] | 6137 | // [/RLVa:KB] |
6134 | 6138 | ||
6135 | LLViewerRegion *regionp = getRegion(); | 6139 | LLViewerRegion *regionp = getRegion(); |
6140 | |||
6141 | // Set last region data for teleport history | ||
6142 | gAgent.setLastRegionData(regionp->getName(),gAgent.getPositionAgent()); | ||
6143 | |||
6136 | if(regionp && teleportCore()) | 6144 | if(regionp && teleportCore()) |
6137 | { | 6145 | { |
6138 | LLMessageSystem* msg = gMessageSystem; | 6146 | LLMessageSystem* msg = gMessageSystem; |
@@ -6148,6 +6156,10 @@ void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) | |||
6148 | void LLAgent::teleportViaLure(const LLUUID& lure_id, BOOL godlike) | 6156 | void LLAgent::teleportViaLure(const LLUUID& lure_id, BOOL godlike) |
6149 | { | 6157 | { |
6150 | LLViewerRegion* regionp = getRegion(); | 6158 | LLViewerRegion* regionp = getRegion(); |
6159 | |||
6160 | // Set last region data for teleport history | ||
6161 | gAgent.setLastRegionData(regionp->getName(),gAgent.getPositionAgent()); | ||
6162 | |||
6151 | if(regionp && teleportCore()) | 6163 | if(regionp && teleportCore()) |
6152 | { | 6164 | { |
6153 | U32 teleport_flags = 0x0; | 6165 | U32 teleport_flags = 0x0; |
@@ -8082,4 +8094,21 @@ void LLAgent::parseTeleportMessages(const std::string& xml_filename) | |||
8082 | }//end for (all message sets in xml file) | 8094 | }//end for (all message sets in xml file) |
8083 | } | 8095 | } |
8084 | 8096 | ||
8097 | void LLAgent::setLastRegionData(std::string regionName, LLVector3 agentCoords) | ||
8098 | { | ||
8099 | mLastRegion = regionName; | ||
8100 | mLastCoordinates = agentCoords; | ||
8101 | } | ||
8102 | |||
8103 | std::string LLAgent::getLastRegion() | ||
8104 | { | ||
8105 | return mLastRegion; | ||
8106 | } | ||
8107 | |||
8108 | LLVector3 LLAgent::getLastCoords() | ||
8109 | { | ||
8110 | return mLastCoordinates; | ||
8111 | } | ||
8112 | |||
8113 | |||
8085 | // EOF | 8114 | // EOF |
diff --git a/linden/indra/newview/llagent.h b/linden/indra/newview/llagent.h index 798de8c..3a39448 100644 --- a/linden/indra/newview/llagent.h +++ b/linden/indra/newview/llagent.h | |||
@@ -177,6 +177,11 @@ public: | |||
177 | void clearRenderState(U8 clearstate); | 177 | void clearRenderState(U8 clearstate); |
178 | U8 getRenderState(); | 178 | U8 getRenderState(); |
179 | 179 | ||
180 | // get/set last region data | ||
181 | std::string getLastRegion(); | ||
182 | LLVector3 getLastCoords(); | ||
183 | void setLastRegionData(std::string regionName,LLVector3 agentCoords); | ||
184 | |||
180 | // Set the home data | 185 | // Set the home data |
181 | void setRegion(LLViewerRegion *regionp); | 186 | void setRegion(LLViewerRegion *regionp); |
182 | LLViewerRegion *getRegion() const; | 187 | LLViewerRegion *getRegion() const; |
@@ -915,7 +920,9 @@ private: | |||
915 | BOOL mFirstLogin; | 920 | BOOL mFirstLogin; |
916 | BOOL mGenderChosen; | 921 | BOOL mGenderChosen; |
917 | 922 | ||
918 | 923 | std::string mLastRegion; | |
924 | LLVector3 mLastCoordinates; | ||
925 | |||
919 | //-------------------------------------------------------------------- | 926 | //-------------------------------------------------------------------- |
920 | // Wearables | 927 | // Wearables |
921 | //-------------------------------------------------------------------- | 928 | //-------------------------------------------------------------------- |
diff --git a/linden/indra/newview/llfloaterteleporthistory.cpp b/linden/indra/newview/llfloaterteleporthistory.cpp new file mode 100644 index 0000000..70a2d71 --- /dev/null +++ b/linden/indra/newview/llfloaterteleporthistory.cpp | |||
@@ -0,0 +1,348 @@ | |||
1 | /** | ||
2 | * @file llfloaterteleporthistory.cpp | ||
3 | * @author Zi Ree | ||
4 | * @brief LLFloaterTeleportHistory class implementation | ||
5 | * | ||
6 | * $LicenseInfo:firstyear=2001&license=viewergpl$ | ||
7 | * | ||
8 | * Copyright (c) 2008, Linden Research, Inc. | ||
9 | * | ||
10 | * Second Life Viewer Source Code | ||
11 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
12 | * to you under the terms of the GNU General Public License, version 2.0 | ||
13 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
14 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
15 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
16 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
17 | * | ||
18 | * There are special exceptions to the terms and conditions of the GPL as | ||
19 | * it is applied to this Source Code. View the full text of the exception | ||
20 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
21 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
22 | * | ||
23 | * By copying, modifying or distributing this software, you acknowledge | ||
24 | * that you have read and understood your obligations described above, | ||
25 | * and agree to abide by those obligations. | ||
26 | * | ||
27 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
28 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
29 | * COMPLETENESS OR PERFORMANCE. | ||
30 | * $/LicenseInfo$ | ||
31 | */ | ||
32 | |||
33 | #include "llviewerprecompiledheaders.h" | ||
34 | |||
35 | #include "linden_common.h" | ||
36 | |||
37 | #include "llfloaterteleporthistory.h" | ||
38 | #include "llfloaterworldmap.h" | ||
39 | #include "lltimer.h" | ||
40 | #include "lluictrlfactory.h" | ||
41 | #include "llurldispatcher.h" | ||
42 | #include "llurlsimstring.h" | ||
43 | #include "llviewercontrol.h" // gSavedSettings | ||
44 | #include "llviewerwindow.h" | ||
45 | #include "llweb.h" | ||
46 | |||
47 | #include "apr_time.h" | ||
48 | |||
49 | // [RLVa:KB] - Emerald specific | ||
50 | #include "rlvhandler.h" | ||
51 | #include "llsdserialize.h" | ||
52 | // [/RLVa:KB] | ||
53 | |||
54 | // globals | ||
55 | LLFloaterTeleportHistory* gFloaterTeleportHistory; | ||
56 | |||
57 | LLFloaterTeleportHistory::LLFloaterTeleportHistory() | ||
58 | : LLFloater(std::string("teleporthistory")), | ||
59 | mPlacesInList(NULL), | ||
60 | mPlacesOutList(NULL), | ||
61 | pItem(NULL), | ||
62 | id(0) | ||
63 | { | ||
64 | LLUICtrlFactory::getInstance()->buildFloater(this, "floater_teleport_history.xml", NULL); | ||
65 | } | ||
66 | |||
67 | // virtual | ||
68 | LLFloaterTeleportHistory::~LLFloaterTeleportHistory() | ||
69 | { | ||
70 | } | ||
71 | |||
72 | // virtual | ||
73 | void LLFloaterTeleportHistory::onFocusReceived() | ||
74 | { | ||
75 | // take care to enable or disable buttons depending on the selection in the places list | ||
76 | if(pItem) | ||
77 | { | ||
78 | setButtonsEnabled(TRUE); | ||
79 | } | ||
80 | else | ||
81 | { | ||
82 | setButtonsEnabled(FALSE); | ||
83 | } | ||
84 | LLFloater::onFocusReceived(); | ||
85 | } | ||
86 | |||
87 | BOOL LLFloaterTeleportHistory::postBuild() | ||
88 | { | ||
89 | // make sure the cached pointer to the scroll list is valid | ||
90 | mPlacesInList=getChild<LLScrollListCtrl>("places_list_in"); | ||
91 | if(!mPlacesInList) | ||
92 | { | ||
93 | llwarns << "coud not get pointer to places list in" << llendl; | ||
94 | return FALSE; | ||
95 | } | ||
96 | mPlacesOutList=getChild<LLScrollListCtrl>("places_list_out"); | ||
97 | if(!mPlacesOutList) | ||
98 | { | ||
99 | llwarns << "coud not get pointer to places list out" << llendl; | ||
100 | return FALSE; | ||
101 | } | ||
102 | |||
103 | // setup callbacks for the scroll list | ||
104 | mPlacesInList->setDoubleClickCallback(onTeleport); | ||
105 | mPlacesOutList->setDoubleClickCallback(onTeleport); | ||
106 | childSetCommitCallback("places_list_in", onInPlacesSelected, this); | ||
107 | childSetCommitCallback("places_list_out", onOutPlacesSelected, this); | ||
108 | childSetAction("teleport", onTeleport, this); | ||
109 | childSetAction("show_on_map", onShowOnMap, this); | ||
110 | childSetAction("copy_slurl", onCopySLURL, this); | ||
111 | loadEntrys(); | ||
112 | |||
113 | return TRUE; | ||
114 | } | ||
115 | void LLFloaterTeleportHistory::saveEntry(LLSD toSave) | ||
116 | { | ||
117 | tpList.append(toSave); | ||
118 | std::string filename=getFileName(); | ||
119 | llofstream file; | ||
120 | file.open(filename.c_str()); | ||
121 | LLSDSerialize::toPrettyXML(tpList, file); | ||
122 | file.close(); | ||
123 | } | ||
124 | |||
125 | std::string LLFloaterTeleportHistory::getFileName() | ||
126 | { | ||
127 | std::string path=gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, ""); | ||
128 | |||
129 | if (!path.empty()) | ||
130 | { | ||
131 | path = gDirUtilp->getExpandedFilename(LL_PATH_PER_SL_ACCOUNT, "teleport_history.xml"); | ||
132 | } | ||
133 | return path; | ||
134 | } | ||
135 | void LLFloaterTeleportHistory::loadEntrys() | ||
136 | { | ||
137 | std::string filename=getFileName(); | ||
138 | if (filename.empty()) | ||
139 | { | ||
140 | llinfos << "no valid user directory." << llendl; | ||
141 | return; | ||
142 | } | ||
143 | llifstream file; | ||
144 | file.open(filename.c_str()); | ||
145 | if (file.is_open()) | ||
146 | LLSDSerialize::fromXML(tpList, file); | ||
147 | file.close(); | ||
148 | |||
149 | for(int i = 0;i<(int)tpList.size();i++) | ||
150 | { | ||
151 | LLSD data = tpList[i]; | ||
152 | LLScrollListCtrl* pItemPointer; | ||
153 | if(data["out"].asBoolean()) | ||
154 | pItemPointer=mPlacesOutList; | ||
155 | else | ||
156 | pItemPointer=mPlacesInList; | ||
157 | |||
158 | pItemPointer->addElement(data, ADD_TOP); | ||
159 | pItemPointer->deselectAllItems(TRUE); | ||
160 | setButtonsEnabled(FALSE); | ||
161 | id++; | ||
162 | } | ||
163 | } | ||
164 | void LLFloaterTeleportHistory::addEntry(std::string regionName, S16 x, S16 y, S16 z,bool outList) | ||
165 | { | ||
166 | LLScrollListCtrl* pItemPointer; | ||
167 | if(outList) | ||
168 | pItemPointer=mPlacesOutList; | ||
169 | else | ||
170 | pItemPointer=mPlacesInList; | ||
171 | // only if the cached scroll list pointer is valid | ||
172 | if(pItemPointer) | ||
173 | { | ||
174 | // prepare display of position | ||
175 | std::string position=llformat("%d, %d, %d", x, y, z); | ||
176 | // prepare simstring for later parsing | ||
177 | std::string simString = regionName + llformat("/%d/%d/%d", x, y, z); | ||
178 | simString = LLWeb::escapeURL(simString); | ||
179 | |||
180 | // check if we are in daylight savings time | ||
181 | std::string timeZone = "PST"; | ||
182 | if(is_daylight_savings()) timeZone = "PDT"; | ||
183 | |||
184 | // do all time related stuff as closely together as possible, because every other operation | ||
185 | // might change the internal tm* buffer | ||
186 | struct tm* internal_time; | ||
187 | internal_time = utc_to_pacific_time(time_corrected(), is_daylight_savings()); | ||
188 | std::string timeString=llformat("%02d/%02d/%04d - %02d:%02d:%02d ",internal_time->tm_mon+1,internal_time->tm_mday,internal_time->tm_year+1900,internal_time->tm_hour, internal_time->tm_min, internal_time->tm_sec)+timeZone; | ||
189 | |||
190 | // build the list entry | ||
191 | LLSD value; | ||
192 | value["id"] = id; | ||
193 | value["columns"][0]["column"] = "region"; | ||
194 | value["columns"][0]["value"] = regionName; | ||
195 | value["columns"][1]["column"] = "position"; | ||
196 | value["columns"][1]["value"] = position; | ||
197 | value["columns"][2]["column"] = "visited"; | ||
198 | value["columns"][2]["value"] = timeString; | ||
199 | |||
200 | // these columns are hidden and serve as data storage for simstring and SLURL | ||
201 | value["columns"][3]["column"] = "slurl"; | ||
202 | value["columns"][3]["value"] = LLURLDispatcher::buildSLURL(regionName, x, y, z); | ||
203 | value["columns"][4]["column"] = "simstring"; | ||
204 | value["columns"][4]["value"] = simString; | ||
205 | value["out"]=outList; | ||
206 | |||
207 | // [RLVa:KB] - Alternate: Emerald-370 | ||
208 | if (gRlvHandler.hasBehaviour(RLV_BHVR_SHOWLOC)) | ||
209 | { | ||
210 | // TODO: This is the original code from Emerald. It | ||
211 | // uses the class RlvStrings, defined in rlvcommon.cpp | ||
212 | // to load localized strings. For Imprudence we use the | ||
213 | // old fashioned way via RlvHandler with English | ||
214 | // strings only! | ||
215 | // value["columns"][0]["value"] = RlvStrings::getString(RLV_STRING_HIDDEN_REGION); | ||
216 | // value["columns"][1]["value"] = RlvStrings::getString(RLV_STRING_HIDDEN); | ||
217 | // value["columns"][3]["value"] = RlvStrings::getString(RLV_STRING_HIDDEN); | ||
218 | // value["columns"][4]["value"] = RlvStrings::getString(RLV_STRING_HIDDEN); | ||
219 | |||
220 | value["columns"][0]["value"] = RlvHandler::cstrHiddenRegion; | ||
221 | value["columns"][1]["value"] = RlvHandler::cstrHidden; | ||
222 | value["columns"][3]["value"] = RlvHandler::cstrHidden; | ||
223 | value["columns"][4]["value"] = RlvHandler::cstrHidden; | ||
224 | } | ||
225 | // [/RLVa:KB] | ||
226 | saveEntry(value); | ||
227 | // add the new list entry on top of the list, deselect all and disable the buttons | ||
228 | pItemPointer->addElement(value, ADD_TOP); | ||
229 | pItemPointer->deselectAllItems(TRUE); | ||
230 | setButtonsEnabled(FALSE); | ||
231 | id++; | ||
232 | } | ||
233 | else | ||
234 | { | ||
235 | llwarns << "pointer to places list is NULL" << llendl; | ||
236 | } | ||
237 | } | ||
238 | |||
239 | void LLFloaterTeleportHistory::setButtonsEnabled(BOOL on) | ||
240 | { | ||
241 | // [RLVa:KB] - Alternate: Emerald-370 | ||
242 | if (rlv_handler_t::isEnabled()) | ||
243 | { | ||
244 | // TODO: This is the original code from Emerald. It | ||
245 | // uses the class RlvStrings, defined in rlvcommon.cpp | ||
246 | // to load localized strings. For Imprudence we use the | ||
247 | // old fashioned way via RlvHandler with English | ||
248 | // strings only! | ||
249 | //if ( (pItem) && (pItem->getColumn(4)) && (RlvStrings::getString(RLV_STRING_HIDDEN) == pItem->getColumn(4)->getValue().asString()) ) | ||
250 | if ( (pItem) && (pItem->getColumn(4)) && (RlvHandler::cstrHidden == pItem->getColumn(4)->getValue().asString()) ) | ||
251 | { | ||
252 | on = FALSE; | ||
253 | } | ||
254 | } | ||
255 | // [/RLVa:K] | ||
256 | |||
257 | // enable or disable buttons | ||
258 | childSetEnabled("teleport", on); | ||
259 | childSetEnabled("show_on_map", on); | ||
260 | childSetEnabled("copy_slurl", on); | ||
261 | } | ||
262 | |||
263 | // virtual | ||
264 | void LLFloaterTeleportHistory::onClose(bool app_quitting) | ||
265 | { | ||
266 | LLFloater::setVisible(FALSE); | ||
267 | } | ||
268 | |||
269 | // virtual | ||
270 | BOOL LLFloaterTeleportHistory::canClose() | ||
271 | { | ||
272 | return !LLApp::isExiting(); | ||
273 | } | ||
274 | |||
275 | // callbacks | ||
276 | |||
277 | // static | ||
278 | void LLFloaterTeleportHistory::onInPlacesSelected(LLUICtrl* /* ctrl */, void* data) | ||
279 | { | ||
280 | LLFloaterTeleportHistory* self = (LLFloaterTeleportHistory*) data; | ||
281 | self->mPlacesOutList->deselectAllItems(); | ||
282 | self->pItem = self->mPlacesInList->getFirstSelected(); | ||
283 | // on selection change check if we need to enable or disable buttons | ||
284 | if(self->pItem) | ||
285 | { | ||
286 | self->setButtonsEnabled(TRUE); | ||
287 | } | ||
288 | else | ||
289 | { | ||
290 | self->setButtonsEnabled(FALSE); | ||
291 | } | ||
292 | } | ||
293 | |||
294 | // static | ||
295 | void LLFloaterTeleportHistory::onOutPlacesSelected(LLUICtrl* /* ctrl */, void* data) | ||
296 | { | ||
297 | LLFloaterTeleportHistory* self = (LLFloaterTeleportHistory*) data; | ||
298 | self->mPlacesInList->deselectAllItems(); | ||
299 | self->pItem = self->mPlacesOutList->getFirstSelected(); | ||
300 | // on selection change check if we need to enable or disable buttons | ||
301 | if(self->pItem) | ||
302 | { | ||
303 | self->setButtonsEnabled(TRUE); | ||
304 | } | ||
305 | else | ||
306 | { | ||
307 | self->setButtonsEnabled(FALSE); | ||
308 | } | ||
309 | } | ||
310 | |||
311 | // static | ||
312 | void LLFloaterTeleportHistory::onTeleport(void* data) | ||
313 | { | ||
314 | LLFloaterTeleportHistory* self = (LLFloaterTeleportHistory*) data; | ||
315 | |||
316 | // build secondlife::/app link from simstring for instant teleport to destination | ||
317 | std::string slapp="secondlife:///app/teleport/" + self->pItem->getColumn(4)->getValue().asString(); | ||
318 | LLURLDispatcher::dispatch(slapp, NULL, true); | ||
319 | } | ||
320 | |||
321 | // static | ||
322 | void LLFloaterTeleportHistory::onShowOnMap(void* data) | ||
323 | { | ||
324 | LLFloaterTeleportHistory* self = (LLFloaterTeleportHistory*) data; | ||
325 | |||
326 | // get simstring from selected entry and parse it for its components | ||
327 | std::string simString = self->pItem->getColumn(4)->getValue().asString(); | ||
328 | std::string region = ""; | ||
329 | S32 x = 128; | ||
330 | S32 y = 128; | ||
331 | S32 z = 20; | ||
332 | |||
333 | LLURLSimString::parse(simString, ®ion, &x, &y, &z); | ||
334 | |||
335 | // point world map at position | ||
336 | gFloaterWorldMap->trackURL(region, x, y, z); | ||
337 | LLFloaterWorldMap::show(NULL, TRUE); | ||
338 | } | ||
339 | |||
340 | // static | ||
341 | void LLFloaterTeleportHistory::onCopySLURL(void* data) | ||
342 | { | ||
343 | LLFloaterTeleportHistory* self = (LLFloaterTeleportHistory*) data; | ||
344 | |||
345 | // get SLURL of the selected entry and copy it to the clipboard | ||
346 | std::string SLURL=self->pItem->getColumn(3)->getValue().asString(); | ||
347 | gViewerWindow->mWindow->copyTextToClipboard(utf8str_to_wstring(SLURL)); | ||
348 | } | ||
diff --git a/linden/indra/newview/llfloaterteleporthistory.h b/linden/indra/newview/llfloaterteleporthistory.h new file mode 100644 index 0000000..e458259 --- /dev/null +++ b/linden/indra/newview/llfloaterteleporthistory.h | |||
@@ -0,0 +1,93 @@ | |||
1 | /** | ||
2 | * @file llfloaterteleporthistory.h | ||
3 | * @author Zi Ree | ||
4 | * @brief LLFloaterTeleportHistory class definition | ||
5 | * | ||
6 | * This class implements a floater where all visited teleport locations are | ||
7 | * stored, so the resident can quickly see where they have been and go back | ||
8 | * by selecting the location from the list. | ||
9 | * | ||
10 | * $LicenseInfo:firstyear=2007&license=viewergpl$ | ||
11 | * | ||
12 | * Copyright (c) 2008, Linden Research, Inc. | ||
13 | * | ||
14 | * Second Life Viewer Source Code | ||
15 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
16 | * to you under the terms of the GNU General Public License, version 2.0 | ||
17 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
18 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
19 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
20 | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
21 | * | ||
22 | * There are special exceptions to the terms and conditions of the GPL as | ||
23 | * it is applied to this Source Code. View the full text of the exception | ||
24 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
25 | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
26 | * | ||
27 | * By copying, modifying or distributing this software, you acknowledge | ||
28 | * that you have read and understood your obligations described above, | ||
29 | * and agree to abide by those obligations. | ||
30 | * | ||
31 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
32 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
33 | * COMPLETENESS OR PERFORMANCE. | ||
34 | * $/LicenseInfo$ | ||
35 | */ | ||
36 | |||
37 | #ifndef LL_LLFLOATERTELEPORTHISTORY_H | ||
38 | #define LL_LLFLOATERTELEPORTHISTORY_H | ||
39 | |||
40 | #include "linden_common.h" | ||
41 | |||
42 | #include "lldefs.h" | ||
43 | #include "llfloater.h" | ||
44 | #include "llscrolllistctrl.h" | ||
45 | |||
46 | class LLFloaterTeleportHistory : public LLFloater | ||
47 | { | ||
48 | public: | ||
49 | LLFloaterTeleportHistory(); | ||
50 | virtual ~LLFloaterTeleportHistory(); | ||
51 | |||
52 | /// @brief: reimplemented to check for selection changes in the places list scrolllist | ||
53 | virtual void onFocusReceived(); | ||
54 | |||
55 | /// @brief: reimplemented to make the menu toggle work | ||
56 | virtual void onClose(bool app_quitting); | ||
57 | |||
58 | /// @brief: reimplemented to prevent this floater from closing while the viewer is shutting down | ||
59 | virtual BOOL canClose(); | ||
60 | |||
61 | BOOL postBuild(); | ||
62 | |||
63 | /// @brief: adds a teleport destination to the list of visited places | ||
64 | void addEntry(std::string regionName, S16 x, S16 y, S16 z,bool outList); | ||
65 | |||
66 | protected: | ||
67 | static void onInPlacesSelected(LLUICtrl* ctrl, void* data); | ||
68 | static void onOutPlacesSelected(LLUICtrl* ctrl, void* data); | ||
69 | static void onTeleport(void* data); | ||
70 | static void onShowOnMap(void* data); | ||
71 | static void onCopySLURL(void* data); | ||
72 | |||
73 | /// @brief: enables or disables the "Teleport", "Show On Map" and "Copy To SLURL" buttons **/ | ||
74 | void setButtonsEnabled(BOOL on); | ||
75 | |||
76 | void loadEntrys(); | ||
77 | void saveEntry(LLSD toSave); | ||
78 | std::string getFileName(); | ||
79 | |||
80 | LLScrollListCtrl* mPlacesInList; | ||
81 | LLScrollListCtrl* mPlacesOutList; | ||
82 | LLScrollListItem* pItem; | ||
83 | S32 id; | ||
84 | |||
85 | /// @brief: to see if this was the first time setVisible() was called (at program startup) | ||
86 | BOOL firstRun; | ||
87 | LLSD tpList; | ||
88 | }; | ||
89 | |||
90 | // globals | ||
91 | extern LLFloaterTeleportHistory* gFloaterTeleportHistory; | ||
92 | |||
93 | #endif | ||
diff --git a/linden/indra/newview/llstartup.cpp b/linden/indra/newview/llstartup.cpp index b76c5be..6622740 100644 --- a/linden/indra/newview/llstartup.cpp +++ b/linden/indra/newview/llstartup.cpp | |||
@@ -191,6 +191,8 @@ | |||
191 | #include "jcfloater_animation_list.h" | 191 | #include "jcfloater_animation_list.h" |
192 | #include "jcfloaterareasearch.h" | 192 | #include "jcfloaterareasearch.h" |
193 | 193 | ||
194 | #include "llfloaterteleporthistory.h" | ||
195 | |||
194 | #if LL_LIBXUL_ENABLED | 196 | #if LL_LIBXUL_ENABLED |
195 | #include "llmozlib.h" | 197 | #include "llmozlib.h" |
196 | #endif // LL_LIBXUL_ENABLED | 198 | #endif // LL_LIBXUL_ENABLED |
@@ -2730,6 +2732,14 @@ bool idle_startup() | |||
2730 | 2732 | ||
2731 | LLFirstUse::ClientTags(); | 2733 | LLFirstUse::ClientTags(); |
2732 | 2734 | ||
2735 | // Add login location to teleport history 'teleported-into' | ||
2736 | LLVector3 agent_pos=gAgent.getPositionAgent(); | ||
2737 | LLViewerRegion* regionp = gAgent.getRegion(); | ||
2738 | if (gFloaterTeleportHistory) | ||
2739 | { | ||
2740 | gFloaterTeleportHistory->addEntry(regionp->getName(),(S16)agent_pos.mV[0],(S16)agent_pos.mV[1],(S16)agent_pos.mV[2],false); | ||
2741 | } | ||
2742 | |||
2733 | // Let the map know about the inventory. | 2743 | // Let the map know about the inventory. |
2734 | if(gFloaterWorldMap) | 2744 | if(gFloaterWorldMap) |
2735 | { | 2745 | { |
diff --git a/linden/indra/newview/llviewermenu.cpp b/linden/indra/newview/llviewermenu.cpp index 13d7209..e37f33e 100644 --- a/linden/indra/newview/llviewermenu.cpp +++ b/linden/indra/newview/llviewermenu.cpp | |||
@@ -229,6 +229,8 @@ | |||
229 | #include "hippoGridManager.h" | 229 | #include "hippoGridManager.h" |
230 | #include "hippoLimits.h" | 230 | #include "hippoLimits.h" |
231 | 231 | ||
232 | #include "llfloaterteleporthistory.h" | ||
233 | |||
232 | using namespace LLVOAvatarDefines; | 234 | using namespace LLVOAvatarDefines; |
233 | void init_client_menu(LLMenuGL* menu); | 235 | void init_client_menu(LLMenuGL* menu); |
234 | void init_server_menu(LLMenuGL* menu); | 236 | void init_server_menu(LLMenuGL* menu); |
@@ -5912,6 +5914,11 @@ class LLShowFloater : public view_listener_t | |||
5912 | { | 5914 | { |
5913 | LLFloaterChat::toggleInstance(LLSD()); | 5915 | LLFloaterChat::toggleInstance(LLSD()); |
5914 | } | 5916 | } |
5917 | else if (floater_name == "teleport history") | ||
5918 | { | ||
5919 | gFloaterTeleportHistory->setVisible(!gFloaterTeleportHistory->getVisible()); | ||
5920 | gFloaterTeleportHistory->setFocus(TRUE); | ||
5921 | } | ||
5915 | else if (floater_name == "im") | 5922 | else if (floater_name == "im") |
5916 | { | 5923 | { |
5917 | LLFloaterChatterBox::toggleInstance(LLSD()); | 5924 | LLFloaterChatterBox::toggleInstance(LLSD()); |
diff --git a/linden/indra/newview/llviewermessage.cpp b/linden/indra/newview/llviewermessage.cpp index 4cf9c87..56aed12 100755 --- a/linden/indra/newview/llviewermessage.cpp +++ b/linden/indra/newview/llviewermessage.cpp | |||
@@ -88,6 +88,7 @@ | |||
88 | #include "llfloatermute.h" | 88 | #include "llfloatermute.h" |
89 | #include "llfloaterpostcard.h" | 89 | #include "llfloaterpostcard.h" |
90 | #include "llfloaterpreference.h" | 90 | #include "llfloaterpreference.h" |
91 | #include "llfloaterteleporthistory.h" | ||
91 | #include "llfollowcam.h" | 92 | #include "llfollowcam.h" |
92 | #include "llgroupnotify.h" | 93 | #include "llgroupnotify.h" |
93 | #include "llhudeffect.h" | 94 | #include "llhudeffect.h" |
@@ -3561,6 +3562,16 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) | |||
3561 | avatarp->clearChat(); | 3562 | avatarp->clearChat(); |
3562 | avatarp->slamPosition(); | 3563 | avatarp->slamPosition(); |
3563 | } | 3564 | } |
3565 | |||
3566 | // add teleport destination to the list of visited places | ||
3567 | gFloaterTeleportHistory->addEntry(regionp->getName(),(S16)agent_pos.mV[0],(S16)agent_pos.mV[1],(S16)agent_pos.mV[2],false); | ||
3568 | std::string lastRegion = gAgent.getLastRegion(); | ||
3569 | if(lastRegion != regionp->getName()) | ||
3570 | { | ||
3571 | LLVector3 lastCoords = gAgent.getLastCoords(); | ||
3572 | gFloaterTeleportHistory->addEntry(lastRegion,(S16)lastCoords.mV[0],(S16)lastCoords.mV[1],(S16)lastCoords.mV[2],true); | ||
3573 | } | ||
3574 | |||
3564 | } | 3575 | } |
3565 | else | 3576 | else |
3566 | { | 3577 | { |
diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index c89e0c5..eb8977c 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp | |||
@@ -103,6 +103,7 @@ | |||
103 | #include "llfloaternamedesc.h" | 103 | #include "llfloaternamedesc.h" |
104 | #include "llfloaterpreference.h" | 104 | #include "llfloaterpreference.h" |
105 | #include "llfloatersnapshot.h" | 105 | #include "llfloatersnapshot.h" |
106 | #include "llfloaterteleporthistory.h" | ||
106 | #include "llfloatertools.h" | 107 | #include "llfloatertools.h" |
107 | #include "llfloaterworldmap.h" | 108 | #include "llfloaterworldmap.h" |
108 | #include "llfocusmgr.h" | 109 | #include "llfocusmgr.h" |
@@ -1688,6 +1689,13 @@ void LLViewerWindow::initWorldUI() | |||
1688 | gFloaterWorldMap->setVisible(FALSE); | 1689 | gFloaterWorldMap->setVisible(FALSE); |
1689 | } | 1690 | } |
1690 | 1691 | ||
1692 | if (!gFloaterTeleportHistory) | ||
1693 | { | ||
1694 | // open teleport history floater and hide it initially | ||
1695 | gFloaterTeleportHistory = new LLFloaterTeleportHistory(); | ||
1696 | gFloaterTeleportHistory->setVisible(FALSE); | ||
1697 | } | ||
1698 | |||
1691 | // | 1699 | // |
1692 | // Tools for building | 1700 | // Tools for building |
1693 | // | 1701 | // |
diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_teleport_history.xml b/linden/indra/newview/skins/default/xui/en-us/floater_teleport_history.xml new file mode 100644 index 0000000..db36df5 --- /dev/null +++ b/linden/indra/newview/skins/default/xui/en-us/floater_teleport_history.xml | |||
@@ -0,0 +1,46 @@ | |||
1 | <?xml version="1.0" encoding="utf-8" standalone="yes" ?> | ||
2 | <floater can_close="true" can_drag_on_left="false" can_minimize="true" can_resize="true" | ||
3 | min_width="500" min_height="250" width="500" height="250" name="teleporthistory" | ||
4 | rect_control="FloaterTeleportHistoryRect" title="Teleport History"> | ||
5 | <tab_container label="TPlistTabs" bottom="40" height="185" left="5" follows="left|top|right|bottom" mouse_opaque="false" name="tplisttabs" | ||
6 | tab_min_width="50" tab_position="top" width="480" right="-10" bg_opaque_color="0,0,0,0.0"> | ||
7 | <panel border="true" bottom="-185" follows="left|top|right|bottom" height="185" | ||
8 | label="Teleported to" left="2" mouse_opaque="true" name="TP-in" width="455"> | ||
9 | <scroll_list background_visible="true" draw_border="true" draw_stripes="true" | ||
10 | draw_heading="true" follows="left|top|right|bottom" left="2" right="-2" top="5" width="450" | ||
11 | height="175" bottom_delta="-177" multi_select="false" name="places_list_in"> | ||
12 | <column dynamicwidth="true" label="Region" name="region" /> | ||
13 | <column width="100" label="Position" name="position" /> | ||
14 | <column dynamicwidth="true" label="Visited" name="visited" /> | ||
15 | <!--Hidden fields, used as storage for prebuilt strings, please keep at width 0--> | ||
16 | <column width="0" label="SLURL" name="slurl" /> | ||
17 | <column width="0" label="Sim String" name="simstring" /> | ||
18 | </scroll_list> | ||
19 | </panel> | ||
20 | <panel border="true" bottom="-185" follows="left|top|right|bottom" height="185" | ||
21 | label="Teleported from" left="2" mouse_opaque="true" name="TP-out" width="455"> | ||
22 | <scroll_list background_visible="true" draw_border="true" draw_stripes="true" | ||
23 | draw_heading="true" follows="left|top|right|bottom" left="2" right="-2" top="5" width="450" | ||
24 | height="175" bottom_delta="-177" multi_select="false" name="places_list_out"> | ||
25 | <column dynamicwidth="true" label="Region" name="region" /> | ||
26 | <column width="100" label="Position" name="position" /> | ||
27 | <column dynamicwidth="true" label="Visited" name="visited" /> | ||
28 | <!--Hidden fields, used as storage for prebuilt strings, please keep at width 0--> | ||
29 | <column width="0" label="SLURL" name="slurl" /> | ||
30 | <column width="0" label="Sim String" name="simstring" /> | ||
31 | </scroll_list> | ||
32 | </panel> | ||
33 | </tab_container> | ||
34 | <button | ||
35 | bottom_delta="-24" enabled="false" follows="left|bottom" font="SansSerif" halign="center" | ||
36 | width="90" height="20" label="Teleport" label_selected="Teleport" | ||
37 | left="10" mouse_opaque="true" name="teleport" tool_tip="Teleport to selected location" /> | ||
38 | <button bottom_delta="0" enabled="false" follows="left|bottom" font="SansSerif" halign="center" | ||
39 | height="20" label="Show On Map" label_selected="Show On Map" | ||
40 | left_delta="100" mouse_opaque="true" name="show_on_map" | ||
41 | tool_tip="Center map on this location" width="125" /> | ||
42 | <button bottom_delta="0" enabled="false" follows="bottom|right" font="SansSerif" | ||
43 | height="20" label="Copy SLURL to clipboard" left="-190" name="copy_slurl" | ||
44 | tool_tip="Copies current location as SLURL to be used on the web." | ||
45 | width="182" /> | ||
46 | </floater> | ||
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 d15657e..0522981 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 | |||
@@ -343,6 +343,10 @@ | |||
343 | <on_click function="ShowFloater" userdata="mute list" /> | 343 | <on_click function="ShowFloater" userdata="mute list" /> |
344 | <on_check function="FloaterVisible" userdata="mute list" /> | 344 | <on_check function="FloaterVisible" userdata="mute list" /> |
345 | </menu_item_check> | 345 | </menu_item_check> |
346 | <menu_item_check name="Teleport History" label="Teleport History"> | ||
347 | <on_click function="ShowFloater" userdata="teleport history" /> | ||
348 | <on_check function="FloaterVisible" userdata="teleport history" /> | ||
349 | </menu_item_check> | ||
346 | <menu_item_separator /> | 350 | <menu_item_separator /> |
347 | <menu_item_check name="Camera Controls" label="Camera Controls"> | 351 | <menu_item_check name="Camera Controls" label="Camera Controls"> |
348 | <on_click function="ShowFloater" userdata="camera controls" /> | 352 | <on_click function="ShowFloater" userdata="camera controls" /> |