diff options
Diffstat (limited to 'linden/indra/newview/llfloaterland.cpp')
-rw-r--r-- | linden/indra/newview/llfloaterland.cpp | 50 |
1 files changed, 29 insertions, 21 deletions
diff --git a/linden/indra/newview/llfloaterland.cpp b/linden/indra/newview/llfloaterland.cpp index 891cde7..9707184 100644 --- a/linden/indra/newview/llfloaterland.cpp +++ b/linden/indra/newview/llfloaterland.cpp | |||
@@ -4,7 +4,7 @@ | |||
4 | * | 4 | * |
5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ | 5 | * $LicenseInfo:firstyear=2002&license=viewergpl$ |
6 | * | 6 | * |
7 | * Copyright (c) 2002-2008, Linden Research, Inc. | 7 | * Copyright (c) 2002-2009, Linden Research, Inc. |
8 | * | 8 | * |
9 | * Second Life Viewer Source Code | 9 | * Second Life Viewer Source Code |
10 | * The source code in this file ("Source Code") is provided by Linden Lab | 10 | * The source code in this file ("Source Code") is provided by Linden Lab |
@@ -604,6 +604,25 @@ void LLPanelLandGeneral::refresh() | |||
604 | mBtnSellLand->setVisible(FALSE); | 604 | mBtnSellLand->setVisible(FALSE); |
605 | mBtnStopSellLand->setVisible(FALSE); | 605 | mBtnStopSellLand->setVisible(FALSE); |
606 | 606 | ||
607 | // show pricing information | ||
608 | S32 area; | ||
609 | S32 claim_price; | ||
610 | S32 rent_price; | ||
611 | F32 dwell; | ||
612 | LLViewerParcelMgr::getInstance()->getDisplayInfo(&area, | ||
613 | &claim_price, | ||
614 | &rent_price, | ||
615 | &for_sale, | ||
616 | &dwell); | ||
617 | |||
618 | // Area | ||
619 | LLUIString price = getString("area_size_text"); | ||
620 | price.setArg("[AREA]", llformat("%d",area)); | ||
621 | mTextPriceLabel->setText(getString("area_text")); | ||
622 | mTextPrice->setText(price.getString()); | ||
623 | |||
624 | mTextDwell->setText(llformat("%.0f", dwell)); | ||
625 | |||
607 | if (for_sale) | 626 | if (for_sale) |
608 | { | 627 | { |
609 | mSaleInfoForSale1->setVisible(TRUE); | 628 | mSaleInfoForSale1->setVisible(TRUE); |
@@ -619,7 +638,15 @@ void LLPanelLandGeneral::refresh() | |||
619 | mSaleInfoForSaleNoObjects->setVisible(TRUE); | 638 | mSaleInfoForSaleNoObjects->setVisible(TRUE); |
620 | } | 639 | } |
621 | mSaleInfoNotForSale->setVisible(FALSE); | 640 | mSaleInfoNotForSale->setVisible(FALSE); |
641 | |||
642 | F32 cost_per_sqm = 0.0f; | ||
643 | if (area > 0) | ||
644 | { | ||
645 | cost_per_sqm = (F32)parcel->getSalePrice() / (F32)area; | ||
646 | } | ||
647 | |||
622 | mSaleInfoForSale1->setTextArg("[PRICE]", llformat("%d", parcel->getSalePrice())); | 648 | mSaleInfoForSale1->setTextArg("[PRICE]", llformat("%d", parcel->getSalePrice())); |
649 | mSaleInfoForSale1->setTextArg("[PRICE_PER_SQM]", llformat("%.1f", cost_per_sqm)); | ||
623 | if (can_be_sold) | 650 | if (can_be_sold) |
624 | { | 651 | { |
625 | mBtnStopSellLand->setVisible(TRUE); | 652 | mBtnStopSellLand->setVisible(TRUE); |
@@ -645,25 +672,6 @@ void LLPanelLandGeneral::refresh() | |||
645 | mBtnBuyGroupLand->setEnabled( | 672 | mBtnBuyGroupLand->setEnabled( |
646 | LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, true)); | 673 | LLViewerParcelMgr::getInstance()->canAgentBuyParcel(parcel, true)); |
647 | 674 | ||
648 | // show pricing information | ||
649 | S32 area; | ||
650 | S32 claim_price; | ||
651 | S32 rent_price; | ||
652 | F32 dwell; | ||
653 | LLViewerParcelMgr::getInstance()->getDisplayInfo(&area, | ||
654 | &claim_price, | ||
655 | &rent_price, | ||
656 | &for_sale, | ||
657 | &dwell); | ||
658 | |||
659 | // Area | ||
660 | LLUIString price = getString("area_size_text"); | ||
661 | price.setArg("[AREA]", llformat("%d",area)); | ||
662 | mTextPriceLabel->setText(getString("area_text")); | ||
663 | mTextPrice->setText(price.getString()); | ||
664 | |||
665 | mTextDwell->setText(llformat("%.0f", dwell)); | ||
666 | |||
667 | if(region_owner) | 675 | if(region_owner) |
668 | { | 676 | { |
669 | mBtnReclaimLand->setEnabled( | 677 | mBtnReclaimLand->setEnabled( |
@@ -1448,7 +1456,7 @@ void LLPanelLandObjects::processParcelObjectOwnersReply(LLMessageSystem *msg, vo | |||
1448 | msg->getBOOLFast(_PREHASH_Data, _PREHASH_IsGroupOwned, is_group_owned, i); | 1456 | msg->getBOOLFast(_PREHASH_Data, _PREHASH_IsGroupOwned, is_group_owned, i); |
1449 | msg->getS32Fast (_PREHASH_Data, _PREHASH_Count, object_count, i); | 1457 | msg->getS32Fast (_PREHASH_Data, _PREHASH_Count, object_count, i); |
1450 | msg->getBOOLFast(_PREHASH_Data, _PREHASH_OnlineStatus, is_online, i); | 1458 | msg->getBOOLFast(_PREHASH_Data, _PREHASH_OnlineStatus, is_online, i); |
1451 | if(msg->getNumberOfBlocks("DataExtended")) | 1459 | if(msg->has("DataExtended")) |
1452 | { | 1460 | { |
1453 | msg->getU32("DataExtended", "TimeStamp", most_recent_time, i); | 1461 | msg->getU32("DataExtended", "TimeStamp", most_recent_time, i); |
1454 | } | 1462 | } |