diff options
-rw-r--r-- | indra/newview/app_settings/settings.xml | 11 | ||||
-rw-r--r-- | indra/newview/llfloaterbuycontents.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llfloaterbuycurrency.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llfloaterbuyland.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llsidepaneltaskinfo.cpp | 4 | ||||
-rw-r--r-- | indra/newview/llviewermenu.cpp | 19 |
6 files changed, 56 insertions, 0 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index ee8c15752b..12e2ff71fd 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -13494,5 +13494,16 @@ <key>Value</key> <integer>0</integer> </map> + <key>AdultCheckEnablePurchse</key> + <map> + <key>Comment</key> + <string>Hack to allow QA testing of purchasing land regardless of maturity rating.</string> + <key>Persist</key> + <integer>0</integer> + <key>Type</key> + <string>Boolean</string> + <key>Value</key> + <integer>0</integer> + </map> </map> </llsd> diff --git a/indra/newview/llfloaterbuycontents.cpp b/indra/newview/llfloaterbuycontents.cpp index a7388d21a3..9bbbbb9867 100644 --- a/indra/newview/llfloaterbuycontents.cpp +++ b/indra/newview/llfloaterbuycontents.cpp @@ -51,6 +51,9 @@ #include "llviewerregion.h" #include "lluictrlfactory.h" #include "llviewerwindow.h" +#ifndef STINSON_ADULT_CHECK_HACK +#include "llviewercontrol.h" +#endif // STINSON_ADULT_CHECK_HACK LLFloaterBuyContents::LLFloaterBuyContents(const LLSD& key) : LLFloater(key) @@ -64,7 +67,11 @@ BOOL LLFloaterBuyContents::postBuild() getChild<LLUICtrl>("buy_btn")->setCommitCallback( boost::bind(&LLFloaterBuyContents::onClickBuy, this)); getChildView("item_list")->setEnabled(FALSE); +#ifndef STINSON_ADULT_CHECK_HACK + getChildView("buy_btn")->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse")); +#else // STINSON_ADULT_CHECK_HACK getChildView("buy_btn")->setEnabled(FALSE); +#endif // STINSON_ADULT_CHECK_HACK getChildView("wear_check")->setEnabled(FALSE); setDefaultBtn("cancel_btn"); // to avoid accidental buy (SL-43130) @@ -163,7 +170,11 @@ void LLFloaterBuyContents::inventoryChanged(LLViewerObject* obj, } // default to turning off the buy button. +#ifndef STINSON_ADULT_CHECK_HACK + getChildView("buy_btn")->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse")); +#else // STINSON_ADULT_CHECK_HACK getChildView("buy_btn")->setEnabled(FALSE); +#endif // STINSON_ADULT_CHECK_HACK LLUUID owner_id; BOOL is_group_owned; diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index e21a8594bc..3e7d265cdf 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -41,6 +41,9 @@ #include "llweb.h" #include "llwindow.h" #include "llappviewer.h" +#ifndef STINSON_ADULT_CHECK_HACK +#include "llviewercontrol.h" +#endif // STINSON_ADULT_CHECK_HACK static const S32 STANDARD_BUY_AMOUNT = 2000; static const S32 MINIMUM_BALANCE_AMOUNT = 0; @@ -156,7 +159,11 @@ void LLFloaterBuyCurrencyUI::draw() } // disable the Buy button when we are not able to buy +#ifndef STINSON_ADULT_CHECK_HACK + getChildView("buy_btn")->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse") || mManager.canBuy()); +#else // STINSON_ADULT_CHECK_HACK getChildView("buy_btn")->setEnabled(mManager.canBuy()); +#endif // STINSON_ADULT_CHECK_HACK LLFloater::draw(); } diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 8223e89b64..6333238c26 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -1305,7 +1305,11 @@ void LLFloaterBuyLandUI::refreshUI() agrees_to_covenant = check->get(); } +#ifndef STINSON_ADULT_CHECK_HACK + getChildView("buy_btn")->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse") || (mCanBuy && mSiteValid && willHaveEnough && !mTransaction && agrees_to_covenant)); +#else // STINSON_ADULT_CHECK_HACK getChildView("buy_btn")->setEnabled(mCanBuy && mSiteValid && willHaveEnough && !mTransaction && agrees_to_covenant); +#endif // STINSON_ADULT_CHECK_HACK } void LLFloaterBuyLandUI::startBuyPreConfirm() diff --git a/indra/newview/llsidepaneltaskinfo.cpp b/indra/newview/llsidepaneltaskinfo.cpp index 24cb559fd0..13a2a395e9 100644 --- a/indra/newview/llsidepaneltaskinfo.cpp +++ b/indra/newview/llsidepaneltaskinfo.cpp @@ -251,7 +251,11 @@ void LLSidepanelTaskInfo::disableAll() mOpenBtn->setEnabled(FALSE); mPayBtn->setEnabled(FALSE); +#ifndef STINSON_ADULT_CHECK_HACK + mBuyBtn->setEnabled(gSavedSettings.getBOOL("AdultCheckEnablePurchse")); +#else // STINSON_ADULT_CHECK_HACK mBuyBtn->setEnabled(FALSE); +#endif // STINSON_ADULT_CHECK_HACK } void LLSidepanelTaskInfo::refresh() diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 12aed8f448..a5effe4f09 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -111,6 +111,9 @@ #include "lltoolgrab.h" #include "llwindow.h" #include "boost/unordered_map.hpp" +#ifndef STINSON_ADULT_CHECK_HACK +#include "llviewercontrol.h" +#endif // STINSON_ADULT_CHECK_HACK using namespace LLVOAvatarDefines; @@ -335,7 +338,11 @@ void LLMenuParcelObserver::changed() { gMenuHolder->childSetEnabled("Land Buy Pass", LLPanelLandGeneral::enableBuyPass(NULL)); +#ifndef STINSON_ADULT_CHECK_HACK + BOOL buyable = gSavedSettings.getBOOL("AdultCheckEnablePurchse") || enable_buy_land(NULL); +#else // STINSON_ADULT_CHECK_HACK BOOL buyable = enable_buy_land(NULL); +#endif // STINSON_ADULT_CHECK_HACK gMenuHolder->childSetEnabled("Land Buy", buyable); gMenuHolder->childSetEnabled("Buy Land...", buyable); } @@ -3241,6 +3248,12 @@ void append_aggregate(std::string& string, const LLAggregatePermissions& ag_perm bool enable_buy_object() { +#ifndef STINSON_ADULT_CHECK_HACK + if (gSavedSettings.getBOOL("AdultCheckEnablePurchse")) + { + return true; + } +#endif // STINSON_ADULT_CHECK_HACK // In order to buy, there must only be 1 purchaseable object in // the selection manger. if(LLSelectMgr::getInstance()->getSelection()->getRootObjectCount() != 1) return false; @@ -5928,6 +5941,12 @@ class LLWorldEnableBuyLand : public view_listener_t { bool handleEvent(const LLSD& userdata) { +#ifndef STINSON_ADULT_CHECK_HACK + if (gSavedSettings.getBOOL("AdultCheckEnablePurchse")) + { + return true; + } +#endif // STINSON_ADULT_CHECK_HACK bool new_value = LLViewerParcelMgr::getInstance()->canAgentBuyParcel( LLViewerParcelMgr::getInstance()->selectionEmpty() ? LLViewerParcelMgr::getInstance()->getAgentParcel() |