From 8b061ccb37afe4393c66edded4e33fc5e2793eb0 Mon Sep 17 00:00:00 2001 From: McCabe Maxsted Date: Sun, 26 Apr 2009 11:41:55 -0700 Subject: Backported L$/sq meter info from 1.23 --- linden/indra/newview/llfloaterbuyland.cpp | 24 +++++++---- linden/indra/newview/llfloaterland.cpp | 46 +++++++++++++--------- .../skins/default/xui/en-us/floater_about_land.xml | 22 +++++++---- .../skins/default/xui/en-us/floater_buy_land.xml | 14 ++++++- 4 files changed, 70 insertions(+), 36 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/llfloaterbuyland.cpp b/linden/indra/newview/llfloaterbuyland.cpp index de14129..df0c6bf 100644 --- a/linden/indra/newview/llfloaterbuyland.cpp +++ b/linden/indra/newview/llfloaterbuyland.cpp @@ -1020,14 +1020,24 @@ void LLFloaterBuyLandUI::refreshUI() childSetText("info_size", getString("meters_supports_object", string_args)); + F32 cost_per_sqm = 0.0f; + if (mParcelActualArea > 0) + { + cost_per_sqm = (F32)mParcelPrice / (F32)mParcelActualArea; + } - childSetText("info_price", - llformat( - "L$ %d%s", - mParcelPrice, - mParcelSoldWithObjects - ? "\nsold with objects" - : "")); + LLStringUtil::format_map_t info_price_args; + info_price_args["[PRICE]"] = llformat("%d", mParcelPrice); + info_price_args["[PRICE_PER_SQM]"] = llformat("%.1f", cost_per_sqm); + if (mParcelSoldWithObjects) + { + info_price_args["[SOLD_WITH_OBJECTS]"] = getString("sold_with_objects"); + } + else + { + info_price_args["[SOLD_WITH_OBJECTS]"] = getString("sold_without_objects"); + } + childSetText("info_price", getString("info_price_string", info_price_args)); childSetVisible("info_price", mParcelIsForSale); } else diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp index 891cde7..74eb172 100644 --- a/linden/indra/newview/llfloaterland.cpp +++ b/linden/indra/newview/llfloaterland.cpp @@ -604,6 +604,25 @@ void LLPanelLandGeneral::refresh() mBtnSellLand->setVisible(FALSE); mBtnStopSellLand->setVisible(FALSE); + // show pricing information + S32 area; + S32 claim_price; + S32 rent_price; + F32 dwell; + LLViewerParcelMgr::getInstance()->getDisplayInfo(&area, + &claim_price, + &rent_price, + &for_sale, + &dwell); + + // Area + LLUIString price = getString("area_size_text"); + price.setArg("[AREA]", llformat("%d",area)); + mTextPriceLabel->setText(getString("area_text")); + mTextPrice->setText(price.getString()); + + mTextDwell->setText(llformat("%.0f", dwell)); + if (for_sale) { mSaleInfoForSale1->setVisible(TRUE); @@ -619,7 +638,15 @@ void LLPanelLandGeneral::refresh() mSaleInfoForSaleNoObjects->setVisible(TRUE); } mSaleInfoNotForSale->setVisible(FALSE); + + F32 cost_per_sqm = 0.0f; + if (area > 0) + { + cost_per_sqm = (F32)parcel->getSalePrice() / (F32)area; + } + mSaleInfoForSale1->setTextArg("[PRICE]", llformat("%d", parcel->getSalePrice())); + mSaleInfoForSale1->setTextArg("[PRICE_PER_SQM]", llformat("%.1f", cost_per_sqm)); if (can_be_sold) { mBtnStopSellLand->setVisible(TRUE); @@ -645,25 +672,6 @@ void LLPanelLandGeneral::refresh() mBtnBuyGroupLand->setEnabled( LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, true)); - // show pricing information - S32 area; - S32 claim_price; - S32 rent_price; - F32 dwell; - LLViewerParcelMgr::getInstance()->getDisplayInfo(&area, - &claim_price, - &rent_price, - &for_sale, - &dwell); - - // Area - LLUIString price = getString("area_size_text"); - price.setArg("[AREA]", llformat("%d",area)); - mTextPriceLabel->setText(getString("area_text")); - mTextPrice->setText(price.getString()); - - mTextDwell->setText(llformat("%.0f", dwell)); - if(region_owner) { mBtnReclaimLand->setEnabled( diff --git a/linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml b/linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml index fc1b747..f3fd708 100644 --- a/linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml +++ b/linden/indra/newview/skins/default/xui/en-us/floater_about_land.xml @@ -93,8 +93,8 @@ - Price: L$[PRICE]. + mouse_opaque="true" name="For Sale: Price L$[PRICE]." v_pad="0" width="246"> + Price: L$[PRICE] (L$[PRICE_PER_SQM]/sq.m.). About Land or select another parcel to show its details. - + About Land or select another parcel to show its details. + mouse_opaque="true" name="edit land check" radio_style="false" + tool_tip="If checked, anyone can terraform your land. It is best to leave this unchecked, as you can always edit your own land." + width="268" /> + name="check fly" radio_style="false" + tool_tip="If checked, Residents can fly on your land. If unchecked, they can only fly into and over your land." + width="268" /> About Land or select another parcel to show its details. + mouse_opaque="true" name="check safe" radio_style="false" + tool_tip="If checked, sets the land to Safe, disabling damage combat. If cleared, damage combat is enabled." + width="268" /> About Land or select another parcel to show its details.