Commits

Stinson Linden committed 2f6546a

EXP-1941: Adding in debug setting to force enable purchase flow disregarding other checks including maturity.

Comments (0)

Files changed (6)

indra/newview/app_settings/settings.xml

       <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>

indra/newview/llfloaterbuycontents.cpp

 #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)
 	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)
 	}
 
 	// 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;

indra/newview/llfloaterbuycurrency.cpp

 #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;
 	}
 
 	// 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();
 }

indra/newview/llfloaterbuyland.cpp

 	    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()

indra/newview/llsidepaneltaskinfo.cpp

 	
 	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()

indra/newview/llviewermenu.cpp

 #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;
 
 {
 	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);
 }
 
 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;
 {
 	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()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.