diff options
author | Andrew Dyukov <adyukov@productengine.com> | 2010-03-06 00:17:16 +0200 |
---|---|---|
committer | Andrew Dyukov <adyukov@productengine.com> | 2010-03-06 00:17:16 +0200 |
commit | 8ae52e2b90e9767787c14f0ac8a0bc6cc5f1df73 (patch) | |
tree | 0dc75ad729bbcad86f87a49330c11ee84336e382 | |
parent | 870dcca7871a1903d688c3f6a8f2b30d7cf62b7e (diff) |
Partially implemented nice-to have sub-task EXT-4706 (Add maturity icons to About Land).
- Added maturity icons to General and Covenant tabs.
--HG--
branch : product-engine
-rw-r--r-- | indra/newview/llfloaterland.cpp | 43 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/floater_about_land.xml | 12 |
2 files changed, 53 insertions, 2 deletions
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 26c6db9652..fa7d7e3a38 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -102,6 +102,10 @@ public: virtual void changed() { LLFloaterLand::refreshAll(); } }; +// fills target textbox with maturity info(icon and text) +// names_floater - pointer to floater which contains strings with maturity icons filenames +void FillMaturityTextBox(LLTextBox* target_textbox, LLFloater* names_floater); + //--------------------------------------------------------------------------- // LLFloaterLand //--------------------------------------------------------------------------- @@ -554,7 +558,7 @@ void LLPanelLandGeneral::refresh() if (regionp) { - mContentRating->setText(regionp->getSimAccessString()); + FillMaturityTextBox(mContentRating, gFloaterView->getParentFloater(this)); mLandType->setText(regionp->getSimProductName()); } @@ -2858,7 +2862,7 @@ void LLPanelLandCovenant::refresh() LLTextBox* region_maturity = getChild<LLTextBox>("region_maturity_text"); if (region_maturity) { - region_maturity->setText(region->getSimAccessString()); + FillMaturityTextBox(region_maturity, gFloaterView->getParentFloater(this)); } LLTextBox* resellable_clause = getChild<LLTextBox>("resellable_clause"); @@ -2939,3 +2943,38 @@ void LLPanelLandCovenant::updateEstateOwnerName(const std::string& name) if (editor) editor->setText(name); } } + +// fills target textbox with maturity info(icon and text) +// names_floater - pointer to floater which contains strings with maturity icons filenames +void FillMaturityTextBox(LLTextBox* target_textbox, LLFloater* names_floater) +{ + LLViewerRegion* region = LLViewerParcelMgr::getInstance()->getSelectionRegion(); + if (!region) + return; + + LLStyle::Params style; + + U8 sim_access = region->getSimAccess(); + + switch(sim_access) + { + case SIM_ACCESS_PG: + style.image(LLUI::getUIImage(names_floater->getString("maturity_icon_general"))); + break; + + case SIM_ACCESS_ADULT: + style.image(LLUI::getUIImage(names_floater->getString("maturity_icon_adult"))); + break; + + case SIM_ACCESS_MATURE: + style.image(LLUI::getUIImage(names_floater->getString("maturity_icon_moderate"))); + break; + + default: + break; + } + + // any text may be here instead of "icon" except "" + target_textbox->setText(std::string("icon"),style); + target_textbox->appendText(LLViewerParcelMgr::getInstance()->getSelectionRegion()->getSimAccessString(), false); +}
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/floater_about_land.xml b/indra/newview/skins/default/xui/en/floater_about_land.xml index 29c6ae8009..8d45bdd4aa 100644 --- a/indra/newview/skins/default/xui/en/floater_about_land.xml +++ b/indra/newview/skins/default/xui/en/floater_about_land.xml @@ -9,6 +9,18 @@ title="ABOUT LAND" width="490"> <floater.string + name="maturity_icon_general"> + "Parcel_PG_Dark" + </floater.string> + <floater.string + name="maturity_icon_moderate"> + "Parcel_M_Dark" + </floater.string> + <floater.string + name="maturity_icon_adult"> + "Parcel_R_Dark" + </floater.string> + <floater.string name="Minutes"> [MINUTES] minutes </floater.string> |