Skip to content

Instantly share code, notes, and snippets.

@Marforius
Last active December 20, 2015 00:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Marforius/6044135 to your computer and use it in GitHub Desktop.
Save Marforius/6044135 to your computer and use it in GitHub Desktop.
Changes the about land floater to refresh the land objects panel when you return people's objects. Also makes it so you always at least have the parcel you are on selected, you can still select other parcels however. I changed the formatting in this file because it was spaghetti so let me detail what I did in here, and what the bug is. 1173 + LL…
diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp
index 1911387..c5bc00d 100644
--- a/indra/newview/llfloaterland.cpp
+++ b/indra/newview/llfloaterland.cpp
@@ -481,52 +481,9 @@ void LLPanelLandGeneral::refresh()
}
if (!parcel)
{
- // nothing selected, disable panel
- mEditName->setEnabled(FALSE);
- mEditName->setText(LLStringUtil::null);
-
- mEditDesc->setEnabled(FALSE);
- mEditDesc->setText(getString("no_selection_text"));
-
- mTextSalePending->setText(LLStringUtil::null);
- mTextSalePending->setEnabled(FALSE);
-
- mBtnDeedToGroup->setEnabled(FALSE);
- mBtnSetGroup->setEnabled(FALSE);
- mBtnStartAuction->setEnabled(FALSE);
-
- mCheckDeedToGroup ->set(FALSE);
- mCheckDeedToGroup ->setEnabled(FALSE);
- mCheckContributeWithDeed->set(FALSE);
- mCheckContributeWithDeed->setEnabled(FALSE);
-
- mTextOwner->setText(LLStringUtil::null);
- mContentRating->setText(LLStringUtil::null);
- mLandType->setText(LLStringUtil::null);
- mBtnProfile->setLabel(getString("profile_text"));
- mBtnProfile->setEnabled(FALSE);
-
- mTextClaimDate->setText(LLStringUtil::null);
- mTextGroup->setText(LLStringUtil::null);
- mTextPrice->setText(LLStringUtil::null);
-
- mSaleInfoForSale1->setVisible(FALSE);
- mSaleInfoForSale2->setVisible(FALSE);
- mSaleInfoForSaleObjects->setVisible(FALSE);
- mSaleInfoForSaleNoObjects->setVisible(FALSE);
- mSaleInfoNotForSale->setVisible(FALSE);
- mBtnSellLand->setVisible(FALSE);
- mBtnStopSellLand->setVisible(FALSE);
-
- mTextPriceLabel->setText(LLStringUtil::null);
- mTextDwell->setText(LLStringUtil::null);
-
- mBtnBuyLand->setEnabled(FALSE);
- mBtnScriptLimits->setEnabled(FALSE);
- mBtnBuyGroupLand->setEnabled(FALSE);
- mBtnReleaseLand->setEnabled(FALSE);
- mBtnReclaimLand->setEnabled(FALSE);
- mBtnBuyPass->setEnabled(FALSE);
+ // if nothing selected select the current parcel you are on
+ LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal());
+ LLFloaterLand::showInstance();
}
else
{
@@ -1193,15 +1150,9 @@ void LLPanelLandObjects::refresh()
if (!parcel)
{
- mSWTotalObjects->setTextArg("[COUNT]", llformat("%d", 0));
- mSWTotalObjects->setTextArg("[TOTAL]", llformat("%d", 0));
- mSWTotalObjects->setTextArg("[AVAILABLE]", llformat("%d", 0));
- mObjectContribution->setTextArg("[COUNT]", llformat("%d", 0));
- mTotalObjects->setTextArg("[COUNT]", llformat("%d", 0));
- mOwnerObjects->setTextArg("[COUNT]", llformat("%d", 0));
- mGroupObjects->setTextArg("[COUNT]", llformat("%d", 0));
- mOtherObjects->setTextArg("[COUNT]", llformat("%d", 0));
- mSelectedObjects->setTextArg("[COUNT]", llformat("%d", 0));
+ // if nothing selected select the current parcel you are on
+ LLViewerParcelMgr::getInstance()->selectParcelAt(gAgent.getPositionGlobal());
+ LLFloaterLand::showInstance();
}
else
{
@@ -1283,6 +1234,8 @@ void LLPanelLandObjects::refresh()
mBtnRefresh->setEnabled(TRUE);
}
}
+ LLPanelLandObjects* CurrentLandObjects = LLFloaterLand::getCurrentPanelLandObjects();
+ LLPanelLandObjects::onClickRefresh(CurrentLandObjects); // here is where the bug exists.
}
// virtual
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment