diff options
Diffstat (limited to 'indra/newview/llpanelplaceprofile.cpp')
-rw-r--r-- | indra/newview/llpanelplaceprofile.cpp | 119 |
1 files changed, 77 insertions, 42 deletions
diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index b2a9f6f251..61501cc1b1 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -55,6 +55,23 @@ static LLRegisterPanelClassWrapper<LLPanelPlaceProfile> t_place_profile("panel_place_profile"); +// Statics for textures filenames +static std::string icon_pg; +static std::string icon_m; +static std::string icon_r; +static std::string icon_voice; +static std::string icon_voice_no; +static std::string icon_fly; +static std::string icon_fly_no; +static std::string icon_push; +static std::string icon_push_no; +static std::string icon_build; +static std::string icon_build_no; +static std::string icon_scripts; +static std::string icon_scripts_no; +static std::string icon_damage; +static std::string icon_damage_no; + LLPanelPlaceProfile::LLPanelPlaceProfile() : LLPanelPlaceInfo(), mForSalePanel(NULL), @@ -80,7 +97,6 @@ BOOL LLPanelPlaceProfile::postBuild() setMouseDownCallback(boost::bind(&LLPanelPlaceProfile::onForSaleBannerClick, this)); mParcelOwner = getChild<LLTextBox>("owner_value"); - mLastVisited = getChild<LLTextBox>("last_visited_value"); mParcelRatingIcon = getChild<LLIconCtrl>("rating_icon"); mParcelRatingText = getChild<LLTextBox>("rating_value"); @@ -119,6 +135,22 @@ BOOL LLPanelPlaceProfile::postBuild() mResaleText = getChild<LLTextEditor>("resale"); mSaleToText = getChild<LLTextBox>("sale_to"); + icon_pg = getString("icon_PG"); + icon_m = getString("icon_M"); + icon_r = getString("icon_R"); + icon_voice = getString("icon_Voice"); + icon_voice_no = getString("icon_VoiceNo"); + icon_fly = getString("icon_Fly"); + icon_fly_no = getString("icon_FlyNo"); + icon_push = getString("icon_Push"); + icon_push_no = getString("icon_PushNo"); + icon_build = getString("icon_Build"); + icon_build_no = getString("icon_BuildNo"); + icon_scripts = getString("icon_Scripts"); + icon_scripts_no = getString("icon_ScriptsNo"); + icon_damage = getString("icon_Damage"); + icon_damage_no = getString("icon_DamageNo"); + return TRUE; } @@ -132,7 +164,6 @@ void LLPanelPlaceProfile::resetLocation() std::string not_available = getString("not_available"); mParcelOwner->setValue(not_available); - mLastVisited->setValue(not_available); mParcelRatingIcon->setValue(not_available); mParcelRatingText->setText(not_available); @@ -176,17 +207,13 @@ void LLPanelPlaceProfile::resetLocation() void LLPanelPlaceProfile::setInfoType(INFO_TYPE type) { bool is_info_type_agent = type == AGENT; - bool is_info_type_teleport_history = type == TELEPORT_HISTORY; - getChild<LLTextBox>("maturity_label")->setVisible(!is_info_type_agent); + mMaturityRatingIcon->setVisible(!is_info_type_agent); mMaturityRatingText->setVisible(!is_info_type_agent); getChild<LLTextBox>("owner_label")->setVisible(is_info_type_agent); mParcelOwner->setVisible(is_info_type_agent); - getChild<LLTextBox>("last_visited_label")->setVisible(is_info_type_teleport_history); - mLastVisited->setVisible(is_info_type_teleport_history); - getChild<LLAccordionCtrl>("advanced_info_accordion")->setVisible(is_info_type_agent); switch(type) @@ -205,6 +232,30 @@ void LLPanelPlaceProfile::setInfoType(INFO_TYPE type) LLPanelPlaceInfo::setInfoType(type); } +// virtual +void LLPanelPlaceProfile::processParcelInfo(const LLParcelData& parcel_data) +{ + LLPanelPlaceInfo::processParcelInfo(parcel_data); + + // HACK: Flag 0x2 == adult region, + // Flag 0x1 == mature region, otherwise assume PG + if (parcel_data.flags & 0x2) + { + mMaturityRatingIcon->setValue(icon_r); + mMaturityRatingText->setText(LLViewerRegion::accessToString(SIM_ACCESS_ADULT)); + } + else if (parcel_data.flags & 0x1) + { + mMaturityRatingIcon->setValue(icon_m); + mMaturityRatingText->setText(LLViewerRegion::accessToString(SIM_ACCESS_MATURE)); + } + else + { + mMaturityRatingIcon->setValue(icon_pg); + mMaturityRatingText->setText(LLViewerRegion::accessToString(SIM_ACCESS_PG)); + } +} + void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, LLViewerRegion* region, const LLVector3d& pos_global, @@ -231,22 +282,22 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, case SIM_ACCESS_MATURE: parcel_data.flags = 0x1; - mParcelRatingIcon->setValue("parcel_drk_M"); - mRegionRatingIcon->setValue("parcel_drk_M"); + mParcelRatingIcon->setValue(icon_m); + mRegionRatingIcon->setValue(icon_m); break; case SIM_ACCESS_ADULT: parcel_data.flags = 0x2; - mParcelRatingIcon->setValue("parcel_drk_R"); - mRegionRatingIcon->setValue("parcel_drk_R"); + mParcelRatingIcon->setValue(icon_r); + mRegionRatingIcon->setValue(icon_r); break; default: parcel_data.flags = 0; - mParcelRatingIcon->setValue("parcel_drk_PG"); - mRegionRatingIcon->setValue("parcel_drk_PG"); + mParcelRatingIcon->setValue(icon_pg); + mRegionRatingIcon->setValue(icon_pg); } std::string rating = LLViewerRegion::accessToString(sim_access); @@ -270,45 +321,45 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, // Processing parcel characteristics if (parcel->getParcelFlagAllowVoice()) { - mVoiceIcon->setValue("parcel_drk_Voice"); + mVoiceIcon->setValue(icon_voice); mVoiceText->setText(on); } else { - mVoiceIcon->setValue("parcel_drk_VoiceNo"); + mVoiceIcon->setValue(icon_voice_no); mVoiceText->setText(off); } if (!region->getBlockFly() && parcel->getAllowFly()) { - mFlyIcon->setValue("parcel_drk_Fly"); + mFlyIcon->setValue(icon_fly); mFlyText->setText(on); } else { - mFlyIcon->setValue("parcel_drk_FlyNo"); + mFlyIcon->setValue(icon_fly_no); mFlyText->setText(off); } if (region->getRestrictPushObject() || parcel->getRestrictPushObject()) { - mPushIcon->setValue("parcel_drk_PushNo"); + mPushIcon->setValue(icon_push_no); mPushText->setText(off); } else { - mPushIcon->setValue("parcel_drk_Push"); + mPushIcon->setValue(icon_push); mPushText->setText(on); } if (parcel->getAllowModify()) { - mBuildIcon->setValue("parcel_drk_Build"); + mBuildIcon->setValue(icon_build); mBuildText->setText(on); } else { - mBuildIcon->setValue("parcel_drk_BuildNo"); + mBuildIcon->setValue(icon_build_no); mBuildText->setText(off); } @@ -316,23 +367,23 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, (region->getRegionFlags() & REGION_FLAGS_ESTATE_SKIP_SCRIPTS) || !parcel->getAllowOtherScripts()) { - mScriptsIcon->setValue("parcel_drk_ScriptsNo"); + mScriptsIcon->setValue(icon_scripts_no); mScriptsText->setText(off); } else { - mScriptsIcon->setValue("parcel_drk_Scripts"); + mScriptsIcon->setValue(icon_scripts); mScriptsText->setText(on); } if (region->getAllowDamage() || parcel->getAllowDamage()) { - mDamageIcon->setValue("parcel_drk_Damage"); + mDamageIcon->setValue(icon_damage); mDamageText->setText(on); } else { - mDamageIcon->setValue("parcel_drk_DamageNo"); + mDamageIcon->setValue(icon_damage_no); mDamageText->setText(off); } @@ -488,22 +539,6 @@ void LLPanelPlaceProfile::updateCovenantText(const std::string &text) mCovenantText->setText(text); } -void LLPanelPlaceProfile::updateLastVisitedText(const LLDate &date) -{ - if (date.isNull()) - { - mLastVisited->setText(getString("unknown")); - } - else - { - std::string timeStr = getString("acquired_date"); - LLSD substitution; - substitution["datetime"] = (S32) date.secondsSinceEpoch(); - LLStringUtil::format (timeStr, substitution); - mLastVisited->setText(timeStr); - } -} - void LLPanelPlaceProfile::onForSaleBannerClick() { LLViewerParcelMgr* mgr = LLViewerParcelMgr::getInstance(); @@ -541,7 +576,7 @@ void LLPanelPlaceProfile::updateYouAreHereBanner(void* userdata) if(!self->getVisible()) return; - if(!gDisconnected) + if(!gDisconnected && gAgent.getRegion()) { static F32 radius = gSavedSettings.getF32("YouAreHereDistance"); |