EXT-8391 FIXED Landmark creation and error handling.
- Added displaying error messages in Create Landmark panel upon remote parcel request fail. - Moved landmark creation from LLPanelLandmarkInfo::processParcelInfo() because we use only agent's current coordinates instead of waiting for remote parcel request to complete. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/793/. --HG-- branch : product-enginemaster
parent
d6726e6e4b
commit
9908fc1518
|
|
@ -123,11 +123,54 @@ void LLPanelLandmarkInfo::setInfoType(EInfoType type)
|
|||
switch(type)
|
||||
{
|
||||
case CREATE_LANDMARK:
|
||||
{
|
||||
mCurrentTitle = getString("title_create_landmark");
|
||||
|
||||
mLandmarkTitle->setVisible(FALSE);
|
||||
mLandmarkTitleEditor->setVisible(TRUE);
|
||||
mNotesEditor->setEnabled(TRUE);
|
||||
|
||||
LLViewerParcelMgr* parcel_mgr = LLViewerParcelMgr::getInstance();
|
||||
std::string name = parcel_mgr->getAgentParcelName();
|
||||
LLVector3 agent_pos = gAgent.getPositionAgent();
|
||||
|
||||
if (name.empty())
|
||||
{
|
||||
S32 region_x = llround(agent_pos.mV[VX]);
|
||||
S32 region_y = llround(agent_pos.mV[VY]);
|
||||
S32 region_z = llround(agent_pos.mV[VZ]);
|
||||
|
||||
std::string region_name;
|
||||
LLViewerRegion* region = parcel_mgr->getSelectionRegion();
|
||||
if (region)
|
||||
{
|
||||
region_name = region->getName();
|
||||
}
|
||||
else
|
||||
{
|
||||
region_name = getString("unknown");
|
||||
}
|
||||
|
||||
mLandmarkTitleEditor->setText(llformat("%s (%d, %d, %d)",
|
||||
region_name.c_str(), region_x, region_y, region_z));
|
||||
}
|
||||
else
|
||||
{
|
||||
mLandmarkTitleEditor->setText(name);
|
||||
}
|
||||
|
||||
std::string desc;
|
||||
LLAgentUI::buildLocationString(desc, LLAgentUI::LOCATION_FORMAT_FULL, agent_pos);
|
||||
mNotesEditor->setText(desc);
|
||||
|
||||
// Moved landmark creation here from LLPanelLandmarkInfo::processParcelInfo()
|
||||
// because we use only agent's current coordinates instead of waiting for
|
||||
// remote parcel request to complete.
|
||||
if (!LLLandmarkActions::landmarkAlreadyExists())
|
||||
{
|
||||
createLandmark(LLUUID());
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case LANDMARK:
|
||||
|
|
@ -192,28 +235,6 @@ void LLPanelLandmarkInfo::processParcelInfo(const LLParcelData& parcel_data)
|
|||
info["global_y"] = parcel_data.global_y;
|
||||
info["global_z"] = parcel_data.global_z;
|
||||
notifyParent(info);
|
||||
|
||||
if (mInfoType == CREATE_LANDMARK)
|
||||
{
|
||||
if (parcel_data.name.empty())
|
||||
{
|
||||
mLandmarkTitleEditor->setText(llformat("%s (%d, %d, %d)",
|
||||
parcel_data.sim_name.c_str(), region_x, region_y, region_z));
|
||||
}
|
||||
else
|
||||
{
|
||||
mLandmarkTitleEditor->setText(parcel_data.name);
|
||||
}
|
||||
|
||||
std::string desc;
|
||||
LLAgentUI::buildLocationString(desc, LLAgentUI::LOCATION_FORMAT_FULL, gAgent.getPositionAgent());
|
||||
mNotesEditor->setText(desc);
|
||||
|
||||
if (!LLLandmarkActions::landmarkAlreadyExists())
|
||||
{
|
||||
createLandmark(mFolderCombo->getValue().asUUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LLPanelLandmarkInfo::displayItemInfo(const LLInventoryItem* pItem)
|
||||
|
|
|
|||
|
|
@ -103,11 +103,11 @@ void LLPanelPlaceInfo::resetLocation()
|
|||
mPosRegion.clearVec();
|
||||
|
||||
std::string loading = LLTrans::getString("LoadingData");
|
||||
mMaturityRatingIcon->setValue(loading);
|
||||
mMaturityRatingText->setValue(loading);
|
||||
mRegionName->setText(loading);
|
||||
mParcelName->setText(loading);
|
||||
mDescEditor->setText(loading);
|
||||
mMaturityRatingIcon->setValue(LLUUID::null);
|
||||
|
||||
mSnapshotCtrl->setImageAssetID(LLUUID::null);
|
||||
}
|
||||
|
|
@ -185,7 +185,21 @@ void LLPanelPlaceInfo::setErrorStatus(U32 status, const std::string& reason)
|
|||
{
|
||||
error_text = getString("server_forbidden_text");
|
||||
}
|
||||
else
|
||||
{
|
||||
error_text = getString("server_error_text");
|
||||
}
|
||||
|
||||
mDescEditor->setText(error_text);
|
||||
|
||||
std::string not_available = getString("not_available");
|
||||
mMaturityRatingText->setValue(not_available);
|
||||
mRegionName->setText(not_available);
|
||||
mParcelName->setText(not_available);
|
||||
mMaturityRatingIcon->setValue(LLUUID::null);
|
||||
|
||||
// Enable "Back" button that was disabled when parcel request was sent.
|
||||
getChild<LLButton>("back_btn")->setEnabled(TRUE);
|
||||
}
|
||||
|
||||
// virtual
|
||||
|
|
|
|||
Loading…
Reference in New Issue