diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index e982a5c09ade198e099e76c8397d4524ae89fef7..7b315422366ee7d2fd58cde1a36325880b683123 100755 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -4082,10 +4082,7 @@ void LLAgent::teleportRequest( { LLFloaterProgressView* pProgFloater = LLFloaterReg::getTypedInstance<LLFloaterProgressView>("progress_view"); LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromHandle(region_handle); - if (info) - pProgFloater->setRegion(info->getName(), true); - else - pProgFloater->setRegion(LLTrans::getString("APP_NAME"), false); + pProgFloater->setRegion(info ? info->getName() : LLStringUtil::null); LL_INFOS("") << "TeleportLocationRequest: '" << region_handle << "':" << pos_local << LL_ENDL; @@ -4119,6 +4116,10 @@ void LLAgent::doTeleportViaLandmark(const LLUUID& landmark_asset_id) LLViewerRegion *regionp = getRegion(); if(regionp && teleportCore()) { + LLFloaterProgressView* pProgFloater = + static_cast<LLFloaterProgressView*>(LLFloaterReg::getInstance("progress_view")); + pProgFloater->setRegion(); + LLMessageSystem* msg = gMessageSystem; msg->newMessageFast(_PREHASH_TeleportLandmarkRequest); msg->nextBlockFast(_PREHASH_Info); @@ -4140,6 +4141,10 @@ void LLAgent::doTeleportViaLure(const LLUUID& lure_id, BOOL godlike) LLViewerRegion* regionp = getRegion(); if(regionp && teleportCore()) { + LLFloaterProgressView* pProgFloater = + static_cast<LLFloaterProgressView*>(LLFloaterReg::getInstance("progress_view")); + pProgFloater->setRegion(); + U32 teleport_flags = 0x0; if (godlike) { @@ -4204,11 +4209,12 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) } U64 handle = to_region_handle(pos_global); + LLFloaterProgressView* pProgFloater = + LLFloaterReg::getTypedInstance<LLFloaterProgressView>("progress_view"); LLSimInfo* info = LLWorldMap::getInstance()->simInfoFromHandle(handle); - LLFloaterProgressView* pProgFloater = (LLFloaterProgressView*)LLFloaterReg::getInstance("progress_view"); if(regionp && info) { - pProgFloater->setRegion(info->getName(), true); + pProgFloater->setRegion(info ? info->getName() : LLStringUtil::null); LLVector3d region_origin = info->getGlobalOrigin(); LLVector3 pos_local( (F32)(pos_global.mdV[VX] - region_origin.mdV[VX]), @@ -4219,7 +4225,7 @@ void LLAgent::doTeleportViaLocation(const LLVector3d& pos_global) else if(regionp && teleportCore(regionp->getHandle() == to_region_handle_global((F32)pos_global.mdV[VX], (F32)pos_global.mdV[VY]))) { - pProgFloater->setRegion(LLTrans::getString("APP_NAME"), false); + pProgFloater->setRegion(); LL_WARNS() << "Using deprecated teleportlocationrequest." << LL_ENDL; // send the message LLMessageSystem* msg = gMessageSystem; diff --git a/indra/newview/llfloaterprogressview.cpp b/indra/newview/llfloaterprogressview.cpp index a83e7f7f084f35d31e0e77b2c08960867e62282b..50b37e748cfe2567ceb95c619937369af6e1558e 100644 --- a/indra/newview/llfloaterprogressview.cpp +++ b/indra/newview/llfloaterprogressview.cpp @@ -1,4 +1,4 @@ -/* +/** * @file llfloaterprogressview.cpp * @brief Progress floater * @@ -34,6 +34,7 @@ #include "llfloaterreg.h" #include "llprogressbar.h" #include "lltextbase.h" +#include "lltrans.h" #include "llagent.h" @@ -60,17 +61,16 @@ BOOL LLFloaterProgressView::postBuild() return TRUE; } -void LLFloaterProgressView::setRegion(const std::string& region, bool haz_region) +void LLFloaterProgressView::setRegion(const std::string& region) { - // yeah, this bool is pretty fucking stupid. so what? wanna fight about it? - if (haz_region) + if (region.empty()) + mLocationText->setText(getString("teleporting")); + else { LLStringUtil::format_map_t arg; arg["REGION"] = region; mLocationText->setText(getString("loc_fmt", arg)); } - else - mLocationText->setText(region); } void LLFloaterProgressView::setProgressText(const std::string& text) diff --git a/indra/newview/llfloaterprogressview.h b/indra/newview/llfloaterprogressview.h index 48561d5380dc102a4dc0cad16719913e6766736d..292ac1856b5e2add7277726c5eafff152224dacd 100644 --- a/indra/newview/llfloaterprogressview.h +++ b/indra/newview/llfloaterprogressview.h @@ -1,4 +1,4 @@ -/* +/** * @file llfloaterprogressview.h * @brief Progress floater * @@ -41,11 +41,11 @@ class LLFloaterProgressView : public LLFloater { public: LLFloaterProgressView(const LLSD& key); - /*virtual*/ BOOL postBuild(); + BOOL postBuild() override; void setProgressCancelButtonVisible(BOOL visible, const std::string& label = LLStringUtil::null); void setProgressText(const std::string& text); void setProgressPercent(const F32 percent); - void setRegion(const std::string& region, bool haz_region); + void setRegion(const std::string& region = LLStringUtil::null); private: ~LLFloaterProgressView(); diff --git a/indra/newview/skins/default/xui/en/floater_progress_view.xml b/indra/newview/skins/default/xui/en/floater_progress_view.xml index 8ef5eef4c8f2e0e0eb7b8435da024a35567e86ec..1acbf26cbcf92b46470beadde5339ff79154419b 100644 --- a/indra/newview/skins/default/xui/en/floater_progress_view.xml +++ b/indra/newview/skins/default/xui/en/floater_progress_view.xml @@ -14,6 +14,10 @@ <floater.string name="loc_fmt"> Teleporting to [REGION]... + </floater.string> + <floater.string + name="teleporting"> +Teleporting... </floater.string> <text height="26"