From 8ae52e2b90e9767787c14f0ac8a0bc6cc5f1df73 Mon Sep 17 00:00:00 2001 From: Andrew Dyukov Date: Sat, 6 Mar 2010 00:17:16 +0200 Subject: 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 --- indra/newview/llfloaterland.cpp | 43 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'indra/newview/llfloaterland.cpp') 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("region_maturity_text"); if (region_maturity) { - region_maturity->setText(region->getSimAccessString()); + FillMaturityTextBox(region_maturity, gFloaterView->getParentFloater(this)); } LLTextBox* resellable_clause = getChild("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 -- cgit v1.2.3