Annotation of /trunk/linden/indra/newview/llfloatertopobjects.cpp
Parent Directory
|
Revision Log
Revision 61 - (view) (download)
| 1 : | mjm | 57 | /** |
| 2 : | * @file llfloatertopobjects.cpp | ||
| 3 : | * @brief Shows top colliders, top scripts, etc. | ||
| 4 : | * | ||
| 5 : | * $LicenseInfo:firstyear=2005&license=viewergpl$ | ||
| 6 : | * | ||
| 7 : | * Copyright (c) 2005-2008, Linden Research, Inc. | ||
| 8 : | * | ||
| 9 : | * Second Life Viewer Source Code | ||
| 10 : | * The source code in this file ("Source Code") is provided by Linden Lab | ||
| 11 : | * to you under the terms of the GNU General Public License, version 2.0 | ||
| 12 : | * ("GPL"), unless you have obtained a separate licensing agreement | ||
| 13 : | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
| 14 : | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
| 15 : | * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2 | ||
| 16 : | * | ||
| 17 : | * There are special exceptions to the terms and conditions of the GPL as | ||
| 18 : | * it is applied to this Source Code. View the full text of the exception | ||
| 19 : | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
| 20 : | * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception | ||
| 21 : | * | ||
| 22 : | * By copying, modifying or distributing this software, you acknowledge | ||
| 23 : | * that you have read and understood your obligations described above, | ||
| 24 : | * and agree to abide by those obligations. | ||
| 25 : | * | ||
| 26 : | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
| 27 : | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
| 28 : | * COMPLETENESS OR PERFORMANCE. | ||
| 29 : | * $/LicenseInfo$ | ||
| 30 : | */ | ||
| 31 : | |||
| 32 : | #include "llviewerprecompiledheaders.h" | ||
| 33 : | |||
| 34 : | #include "llfloatertopobjects.h" | ||
| 35 : | |||
| 36 : | #include "message.h" | ||
| 37 : | #include "llfontgl.h" | ||
| 38 : | |||
| 39 : | #include "llagent.h" | ||
| 40 : | #include "llbutton.h" | ||
| 41 : | #include "llfloatergodtools.h" | ||
| 42 : | #include "llparcel.h" | ||
| 43 : | #include "llscrolllistctrl.h" | ||
| 44 : | #include "lllineeditor.h" | ||
| 45 : | #include "lltextbox.h" | ||
| 46 : | #include "lltracker.h" | ||
| 47 : | #include "llviewermessage.h" | ||
| 48 : | #include "llviewerparcelmgr.h" | ||
| 49 : | #include "llviewerregion.h" | ||
| 50 : | #include "lluictrlfactory.h" | ||
| 51 : | #include "llviewerwindow.h" | ||
| 52 : | |||
| 53 : | LLFloaterTopObjects* LLFloaterTopObjects::sInstance = NULL; | ||
| 54 : | |||
| 55 : | // Globals | ||
| 56 : | // const U32 TIME_STR_LENGTH = 30; | ||
| 57 : | |||
| 58 : | // static | ||
| 59 : | void LLFloaterTopObjects::show() | ||
| 60 : | { | ||
| 61 : | if (sInstance) | ||
| 62 : | { | ||
| 63 : | sInstance->setVisibleAndFrontmost(); | ||
| 64 : | return; | ||
| 65 : | } | ||
| 66 : | |||
| 67 : | sInstance = new LLFloaterTopObjects(); | ||
| 68 : | LLUICtrlFactory::getInstance()->buildFloater(sInstance, "floater_top_objects.xml"); | ||
| 69 : | sInstance->center(); | ||
| 70 : | } | ||
| 71 : | |||
| 72 : | LLFloaterTopObjects::LLFloaterTopObjects() | ||
| 73 : | : LLFloater(std::string("top_objects")), | ||
| 74 : | mInitialized(FALSE), | ||
| 75 : | mtotalScore(0.f) | ||
| 76 : | { | ||
| 77 : | sInstance = this; | ||
| 78 : | } | ||
| 79 : | |||
| 80 : | LLFloaterTopObjects::~LLFloaterTopObjects() | ||
| 81 : | { | ||
| 82 : | sInstance = NULL; | ||
| 83 : | } | ||
| 84 : | |||
| 85 : | // virtual | ||
| 86 : | BOOL LLFloaterTopObjects::postBuild() | ||
| 87 : | { | ||
| 88 : | childSetCommitCallback("objects_list", onCommitObjectsList, this); | ||
| 89 : | childSetDoubleClickCallback("objects_list", onDoubleClickObjectsList); | ||
| 90 : | childSetFocus("objects_list"); | ||
| 91 : | LLScrollListCtrl *objects_list = getChild<LLScrollListCtrl>("objects_list"); | ||
| 92 : | if (objects_list) | ||
| 93 : | { | ||
| 94 : | objects_list->setCommitOnSelectionChange(TRUE); | ||
| 95 : | } | ||
| 96 : | |||
| 97 : | childSetAction("show_beacon_btn", onClickShowBeacon, this); | ||
| 98 : | setDefaultBtn("show_beacon_btn"); | ||
| 99 : | |||
| 100 : | childSetAction("return_selected_btn", onReturnSelected, this); | ||
| 101 : | childSetAction("return_all_btn", onReturnAll, this); | ||
| 102 : | childSetAction("disable_selected_btn", onDisableSelected, this); | ||
| 103 : | childSetAction("disable_all_btn", onDisableAll, this); | ||
| 104 : | childSetAction("refresh_btn", onRefresh, this); | ||
| 105 : | |||
| 106 : | |||
| 107 : | childSetAction("filter_object_btn", onGetByObjectNameClicked, this); | ||
| 108 : | childSetAction("filter_owner_btn", onGetByOwnerNameClicked, this); | ||
| 109 : | |||
| 110 : | |||
| 111 : | /* | ||
| 112 : | LLLineEditor* line_editor = getChild<LLLineEditor>("owner_name_editor"); | ||
| 113 : | if (line_editor) | ||
| 114 : | { | ||
| 115 : | line_editor->setCommitOnFocusLost(FALSE); | ||
| 116 : | line_editor->setCommitCallback(onGetByOwnerName); | ||
| 117 : | line_editor->setCallbackUserData(this); | ||
| 118 : | } | ||
| 119 : | |||
| 120 : | line_editor = getChild<LLLineEditor>("object_name_editor"); | ||
| 121 : | if (line_editor) | ||
| 122 : | { | ||
| 123 : | line_editor->setCommitOnFocusLost(FALSE); | ||
| 124 : | line_editor->setCommitCallback(onGetByObjectName); | ||
| 125 : | line_editor->setCallbackUserData(this); | ||
| 126 : | }*/ | ||
| 127 : | |||
| 128 : | mCurrentMode = STAT_REPORT_TOP_SCRIPTS; | ||
| 129 : | mFlags = 0; | ||
| 130 : | mFilter.clear(); | ||
| 131 : | |||
| 132 : | return TRUE; | ||
| 133 : | } | ||
| 134 : | |||
| 135 : | void LLFloaterTopObjects::handle_land_reply(LLMessageSystem* msg, void** data) | ||
| 136 : | { | ||
| 137 : | // Make sure dialog is on screen | ||
| 138 : | show(); | ||
| 139 : | sInstance->handleReply(msg, data); | ||
| 140 : | |||
| 141 : | //HACK: for some reason sometimes top scripts originally comes back | ||
| 142 : | //with no results even though they're there | ||
| 143 : | if (!sInstance->mObjectListIDs.size() && !sInstance->mInitialized) | ||
| 144 : | { | ||
| 145 : | sInstance->onRefresh(NULL); | ||
| 146 : | sInstance->mInitialized = TRUE; | ||
| 147 : | } | ||
| 148 : | |||
| 149 : | } | ||
| 150 : | |||
| 151 : | void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) | ||
| 152 : | { | ||
| 153 : | U32 request_flags; | ||
| 154 : | U32 total_count; | ||
| 155 : | |||
| 156 : | msg->getU32Fast(_PREHASH_RequestData, _PREHASH_RequestFlags, request_flags); | ||
| 157 : | msg->getU32Fast(_PREHASH_RequestData, _PREHASH_TotalObjectCount, total_count); | ||
| 158 : | msg->getU32Fast(_PREHASH_RequestData, _PREHASH_ReportType, mCurrentMode); | ||
| 159 : | |||
| 160 : | LLScrollListCtrl *list = getChild<LLScrollListCtrl>("objects_list"); | ||
| 161 : | |||
| 162 : | S32 block_count = msg->getNumberOfBlocks("ReportData"); | ||
| 163 : | for (S32 block = 0; block < block_count; ++block) | ||
| 164 : | { | ||
| 165 : | U32 task_local_id; | ||
| 166 : | U32 time_stamp = 0; | ||
| 167 : | LLUUID task_id; | ||
| 168 : | F32 location_x, location_y, location_z; | ||
| 169 : | F32 score; | ||
| 170 : | std::string name_buf; | ||
| 171 : | std::string owner_buf; | ||
| 172 : | F32 mono_score = 0.f; | ||
| 173 : | bool have_extended_data = false; | ||
| 174 : | |||
| 175 : | msg->getU32Fast(_PREHASH_ReportData, _PREHASH_TaskLocalID, task_local_id, block); | ||
| 176 : | msg->getUUIDFast(_PREHASH_ReportData, _PREHASH_TaskID, task_id, block); | ||
| 177 : | msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationX, location_x, block); | ||
| 178 : | msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationY, location_y, block); | ||
| 179 : | msg->getF32Fast(_PREHASH_ReportData, _PREHASH_LocationZ, location_z, block); | ||
| 180 : | msg->getF32Fast(_PREHASH_ReportData, _PREHASH_Score, score, block); | ||
| 181 : | msg->getStringFast(_PREHASH_ReportData, _PREHASH_TaskName, name_buf, block); | ||
| 182 : | msg->getStringFast(_PREHASH_ReportData, _PREHASH_OwnerName, owner_buf, block); | ||
| 183 : | if(msg->getNumberOfBlocks("DataExtended")) | ||
| 184 : | { | ||
| 185 : | have_extended_data = true; | ||
| 186 : | msg->getU32("DataExtended", "TimeStamp", time_stamp, block); | ||
| 187 : | msg->getF32(_PREHASH_ReportData, "MonoScore", mono_score, block); | ||
| 188 : | } | ||
| 189 : | |||
| 190 : | LLSD element; | ||
| 191 : | |||
| 192 : | element["id"] = task_id; | ||
| 193 : | element["object_name"] = name_buf; | ||
| 194 : | element["owner_name"] = owner_buf; | ||
| 195 : | element["columns"][0]["column"] = "score"; | ||
| 196 : | element["columns"][0]["value"] = llformat("%0.3f", score); | ||
| 197 : | element["columns"][0]["font"] = "SANSSERIF"; | ||
| 198 : | |||
| 199 : | element["columns"][1]["column"] = "name"; | ||
| 200 : | element["columns"][1]["value"] = name_buf; | ||
| 201 : | element["columns"][1]["font"] = "SANSSERIF"; | ||
| 202 : | element["columns"][2]["column"] = "owner"; | ||
| 203 : | element["columns"][2]["value"] = owner_buf; | ||
| 204 : | element["columns"][2]["font"] = "SANSSERIF"; | ||
| 205 : | element["columns"][3]["column"] = "location"; | ||
| 206 : | element["columns"][3]["value"] = llformat("<%0.1f,%0.1f,%0.1f>", location_x, location_y, location_z); | ||
| 207 : | element["columns"][3]["font"] = "SANSSERIF"; | ||
| 208 : | element["columns"][4]["column"] = "time"; | ||
| 209 : | element["columns"][4]["value"] = formatted_time((time_t)time_stamp); | ||
| 210 : | element["columns"][4]["font"] = "SANSSERIF"; | ||
| 211 : | |||
| 212 : | if (mCurrentMode == STAT_REPORT_TOP_SCRIPTS | ||
| 213 : | && have_extended_data) | ||
| 214 : | { | ||
| 215 : | element["columns"][5]["column"] = "Mono Time"; | ||
| 216 : | element["columns"][5]["value"] = llformat("%0.3f", mono_score); | ||
| 217 : | element["columns"][5]["font"] = "SANSSERIF"; | ||
| 218 : | } | ||
| 219 : | |||
| 220 : | list->addElement(element); | ||
| 221 : | |||
| 222 : | mObjectListData.append(element); | ||
| 223 : | mObjectListIDs.push_back(task_id); | ||
| 224 : | |||
| 225 : | mtotalScore += score; | ||
| 226 : | } | ||
| 227 : | |||
| 228 : | if (total_count == 0 && list->getItemCount() == 0) | ||
| 229 : | { | ||
| 230 : | list->addCommentText(getString("none_descriptor")); | ||
| 231 : | } | ||
| 232 : | else | ||
| 233 : | { | ||
| 234 : | list->selectFirstItem(); | ||
| 235 : | } | ||
| 236 : | |||
| 237 : | if (mCurrentMode == STAT_REPORT_TOP_SCRIPTS) | ||
| 238 : | { | ||
| 239 : | setTitle(getString("top_scripts_title")); | ||
| 240 : | list->setColumnLabel("score", getString("scripts_score_label")); | ||
| 241 : | |||
| 242 : | LLUIString format = getString("top_scripts_text"); | ||
| 243 : | format.setArg("[COUNT]", llformat("%d", total_count)); | ||
| 244 : | format.setArg("[TIME]", llformat("%0.1f", mtotalScore)); | ||
| 245 : | childSetValue("title_text", LLSD(format)); | ||
| 246 : | } | ||
| 247 : | else | ||
| 248 : | { | ||
| 249 : | setTitle(getString("top_colliders_title")); | ||
| 250 : | list->setColumnLabel("score", getString("colliders_score_label")); | ||
| 251 : | LLUIString format = getString("top_colliders_text"); | ||
| 252 : | format.setArg("[COUNT]", llformat("%d", total_count)); | ||
| 253 : | childSetValue("title_text", LLSD(format)); | ||
| 254 : | } | ||
| 255 : | } | ||
| 256 : | |||
| 257 : | // static | ||
| 258 : | void LLFloaterTopObjects::onCommitObjectsList(LLUICtrl* ctrl, void* data) | ||
| 259 : | { | ||
| 260 : | LLFloaterTopObjects* self = (LLFloaterTopObjects*)data; | ||
| 261 : | |||
| 262 : | self->updateSelectionInfo(); | ||
| 263 : | } | ||
| 264 : | |||
| 265 : | void LLFloaterTopObjects::updateSelectionInfo() | ||
| 266 : | { | ||
| 267 : | LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list"); | ||
| 268 : | |||
| 269 : | if (!list) return; | ||
| 270 : | |||
| 271 : | LLUUID object_id = list->getCurrentID(); | ||
| 272 : | if (object_id.isNull()) return; | ||
| 273 : | |||
| 274 : | std::string object_id_string = object_id.asString(); | ||
| 275 : | |||
| 276 : | childSetValue("id_editor", LLSD(object_id_string)); | ||
| 277 : | childSetValue("object_name_editor", list->getFirstSelected()->getColumn(1)->getValue().asString()); | ||
| 278 : | childSetValue("owner_name_editor", list->getFirstSelected()->getColumn(2)->getValue().asString()); | ||
| 279 : | } | ||
| 280 : | |||
| 281 : | // static | ||
| 282 : | void LLFloaterTopObjects::onDoubleClickObjectsList(void* data) | ||
| 283 : | { | ||
| 284 : | LLFloaterTopObjects* self = (LLFloaterTopObjects*)data; | ||
| 285 : | self->showBeacon(); | ||
| 286 : | } | ||
| 287 : | |||
| 288 : | // static | ||
| 289 : | void LLFloaterTopObjects::onClickShowBeacon(void* data) | ||
| 290 : | { | ||
| 291 : | LLFloaterTopObjects* self = (LLFloaterTopObjects*)data; | ||
| 292 : | if (!self) return; | ||
| 293 : | self->showBeacon(); | ||
| 294 : | } | ||
| 295 : | |||
| 296 : | void LLFloaterTopObjects::doToObjects(int action, bool all) | ||
| 297 : | { | ||
| 298 : | LLMessageSystem *msg = gMessageSystem; | ||
| 299 : | |||
| 300 : | LLViewerRegion* region = gAgent.getRegion(); | ||
| 301 : | if (!region) return; | ||
| 302 : | |||
| 303 : | LLCtrlListInterface *list = childGetListInterface("objects_list"); | ||
| 304 : | if (!list || list->getItemCount() == 0) return; | ||
| 305 : | |||
| 306 : | std::vector<LLUUID>::iterator id_itor; | ||
| 307 : | |||
| 308 : | bool start_message = true; | ||
| 309 : | |||
| 310 : | for (id_itor = mObjectListIDs.begin(); id_itor != mObjectListIDs.end(); ++id_itor) | ||
| 311 : | { | ||
| 312 : | LLUUID task_id = *id_itor; | ||
| 313 : | if (!all && !list->isSelected(task_id)) | ||
| 314 : | { | ||
| 315 : | // Selected only | ||
| 316 : | continue; | ||
| 317 : | } | ||
| 318 : | if (start_message) | ||
| 319 : | { | ||
| 320 : | if (action == ACTION_RETURN) | ||
| 321 : | { | ||
| 322 : | msg->newMessageFast(_PREHASH_ParcelReturnObjects); | ||
| 323 : | } | ||
| 324 : | else | ||
| 325 : | { | ||
| 326 : | msg->newMessageFast(_PREHASH_ParcelDisableObjects); | ||
| 327 : | } | ||
| 328 : | msg->nextBlockFast(_PREHASH_AgentData); | ||
| 329 : | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID()); | ||
| 330 : | msg->addUUIDFast(_PREHASH_SessionID,gAgent.getSessionID()); | ||
| 331 : | msg->nextBlockFast(_PREHASH_ParcelData); | ||
| 332 : | msg->addS32Fast(_PREHASH_LocalID, -1); // Whole region | ||
| 333 : | msg->addS32Fast(_PREHASH_ReturnType, RT_NONE); | ||
| 334 : | start_message = false; | ||
| 335 : | } | ||
| 336 : | |||
| 337 : | msg->nextBlockFast(_PREHASH_TaskIDs); | ||
| 338 : | msg->addUUIDFast(_PREHASH_TaskID, task_id); | ||
| 339 : | |||
| 340 : | if (msg->isSendFullFast(_PREHASH_TaskIDs)) | ||
| 341 : | { | ||
| 342 : | msg->sendReliable(region->getHost()); | ||
| 343 : | start_message = true; | ||
| 344 : | } | ||
| 345 : | } | ||
| 346 : | |||
| 347 : | if (!start_message) | ||
| 348 : | { | ||
| 349 : | msg->sendReliable(region->getHost()); | ||
| 350 : | } | ||
| 351 : | } | ||
| 352 : | |||
| 353 : | //static | ||
| 354 : | void LLFloaterTopObjects::callbackReturnAll(S32 option, void* userdata) | ||
| 355 : | { | ||
| 356 : | if (option == 0) | ||
| 357 : | { | ||
| 358 : | sInstance->doToObjects(ACTION_RETURN, true); | ||
| 359 : | } | ||
| 360 : | } | ||
| 361 : | |||
| 362 : | void LLFloaterTopObjects::onReturnAll(void* data) | ||
| 363 : | { | ||
| 364 : | gViewerWindow->alertXml("ReturnAllTopObjects", callbackReturnAll, NULL); | ||
| 365 : | } | ||
| 366 : | |||
| 367 : | |||
| 368 : | void LLFloaterTopObjects::onReturnSelected(void* data) | ||
| 369 : | { | ||
| 370 : | sInstance->doToObjects(ACTION_RETURN, false); | ||
| 371 : | } | ||
| 372 : | |||
| 373 : | |||
| 374 : | //static | ||
| 375 : | void LLFloaterTopObjects::callbackDisableAll(S32 option, void* userdata) | ||
| 376 : | { | ||
| 377 : | if (option == 0) | ||
| 378 : | { | ||
| 379 : | sInstance->doToObjects(ACTION_DISABLE, true); | ||
| 380 : | } | ||
| 381 : | } | ||
| 382 : | |||
| 383 : | void LLFloaterTopObjects::onDisableAll(void* data) | ||
| 384 : | { | ||
| 385 : | gViewerWindow->alertXml("DisableAllTopObjects", callbackDisableAll, NULL); | ||
| 386 : | } | ||
| 387 : | |||
| 388 : | void LLFloaterTopObjects::onDisableSelected(void* data) | ||
| 389 : | { | ||
| 390 : | sInstance->doToObjects(ACTION_DISABLE, false); | ||
| 391 : | } | ||
| 392 : | |||
| 393 : | //static | ||
| 394 : | void LLFloaterTopObjects::clearList() | ||
| 395 : | { | ||
| 396 : | LLCtrlListInterface *list = sInstance->childGetListInterface("objects_list"); | ||
| 397 : | |||
| 398 : | if (list) | ||
| 399 : | { | ||
| 400 : | list->operateOnAll(LLCtrlListInterface::OP_DELETE); | ||
| 401 : | } | ||
| 402 : | |||
| 403 : | sInstance->mObjectListData.clear(); | ||
| 404 : | sInstance->mObjectListIDs.clear(); | ||
| 405 : | sInstance->mtotalScore = 0.f; | ||
| 406 : | } | ||
| 407 : | |||
| 408 : | //static | ||
| 409 : | void LLFloaterTopObjects::onRefresh(void* data) | ||
| 410 : | { | ||
| 411 : | U32 mode = STAT_REPORT_TOP_SCRIPTS; | ||
| 412 : | U32 flags = 0; | ||
| 413 : | std::string filter = ""; | ||
| 414 : | |||
| 415 : | if (sInstance) | ||
| 416 : | { | ||
| 417 : | mode = sInstance->mCurrentMode; | ||
| 418 : | flags = sInstance->mFlags; | ||
| 419 : | filter = sInstance->mFilter; | ||
| 420 : | sInstance->clearList(); | ||
| 421 : | } | ||
| 422 : | |||
| 423 : | LLMessageSystem *msg = gMessageSystem; | ||
| 424 : | msg->newMessageFast(_PREHASH_LandStatRequest); | ||
| 425 : | msg->nextBlockFast(_PREHASH_AgentData); | ||
| 426 : | msg->addUUIDFast(_PREHASH_AgentID, gAgent.getID() ); | ||
| 427 : | msg->addUUIDFast(_PREHASH_SessionID, gAgent.getSessionID() ); | ||
| 428 : | msg->nextBlockFast(_PREHASH_RequestData); | ||
| 429 : | msg->addU32Fast(_PREHASH_ReportType, mode); | ||
| 430 : | msg->addU32Fast(_PREHASH_RequestFlags, flags); | ||
| 431 : | msg->addStringFast(_PREHASH_Filter, filter); | ||
| 432 : | msg->addS32Fast(_PREHASH_ParcelLocalID, 0); | ||
| 433 : | |||
| 434 : | msg->sendReliable(gAgent.getRegionHost()); | ||
| 435 : | |||
| 436 : | if (sInstance) | ||
| 437 : | { | ||
| 438 : | sInstance->mFilter.clear(); | ||
| 439 : | sInstance->mFlags = 0; | ||
| 440 : | } | ||
| 441 : | } | ||
| 442 : | |||
| 443 : | void LLFloaterTopObjects::onGetByObjectName(LLUICtrl* ctrl, void* data) | ||
| 444 : | { | ||
| 445 : | if (sInstance) | ||
| 446 : | { | ||
| 447 : | sInstance->mFlags = STAT_FILTER_BY_OBJECT; | ||
| 448 : | sInstance->mFilter = sInstance->childGetText("object_name_editor"); | ||
| 449 : | onRefresh(NULL); | ||
| 450 : | } | ||
| 451 : | } | ||
| 452 : | |||
| 453 : | void LLFloaterTopObjects::onGetByOwnerName(LLUICtrl* ctrl, void* data) | ||
| 454 : | { | ||
| 455 : | if (sInstance) | ||
| 456 : | { | ||
| 457 : | sInstance->mFlags = STAT_FILTER_BY_OWNER; | ||
| 458 : | sInstance->mFilter = sInstance->childGetText("owner_name_editor"); | ||
| 459 : | onRefresh(NULL); | ||
| 460 : | } | ||
| 461 : | } | ||
| 462 : | |||
| 463 : | void LLFloaterTopObjects::showBeacon() | ||
| 464 : | { | ||
| 465 : | LLScrollListCtrl* list = getChild<LLScrollListCtrl>("objects_list"); | ||
| 466 : | if (!list) return; | ||
| 467 : | |||
| 468 : | LLScrollListItem* first_selected = list->getFirstSelected(); | ||
| 469 : | if (!first_selected) return; | ||
| 470 : | |||
| 471 : | std::string name = first_selected->getColumn(1)->getValue().asString(); | ||
| 472 : | std::string pos_string = first_selected->getColumn(3)->getValue().asString(); | ||
| 473 : | |||
| 474 : | F32 x, y, z; | ||
| 475 : | S32 matched = sscanf(pos_string.c_str(), "<%g,%g,%g>", &x, &y, &z); | ||
| 476 : | if (matched != 3) return; | ||
| 477 : | |||
| 478 : | LLVector3 pos_agent(x, y, z); | ||
| 479 : | LLVector3d pos_global = gAgent.getPosGlobalFromAgent(pos_agent); | ||
| 480 : | std::string tooltip(""); | ||
| 481 : | LLTracker::trackLocation(pos_global, name, tooltip, LLTracker::LOCATION_ITEM); | ||
| 482 : | } |
| ViewVC Help | |
| Powered by ViewVC 1.0.0 |

