diff --git a/indra/newview/llbottomtray.cpp b/indra/newview/llbottomtray.cpp index 6ee438723656d303f24fa8ec8b50cb22ac399e03..ad5447bf33134ec7a629ee6221a04844e64fe238 100644 --- a/indra/newview/llbottomtray.cpp +++ b/indra/newview/llbottomtray.cpp @@ -48,10 +48,17 @@ #include "llsyswellwindow.h" #include "lltoolmgr.h" #include "llviewerparcelmgr.h" +// [RLVa:KB] - Checked: 2010-09-11 (RLVa-1.2.1d) +#include "rlvhandler.h" +#include "rlvui.h" +// [/RLVa:KB] static void update_build_button_enable_state() { - bool can_edit = LLToolMgr::getInstance()->canEdit(); +// bool can_edit = LLToolMgr::getInstance()->canEdit(); +// [RLVa:KB] - Checked: 2010-09-11 (RLVa-1.2.1d) | Added: RLVa-1.2.1d + bool can_edit = RlvUIEnabler::isBuildEnabled(); +// [/RLVa:KB] LLBottomTray::getInstance()->getChildView("build_btn")->setEnabled(can_edit); } diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp index 8f25ec4e9f765a1e018d5515327855bc08d2a173..f9b413410d4ec73f911a01aa402c7050784e4429 100644 --- a/indra/newview/lltoolmgr.cpp +++ b/indra/newview/lltoolmgr.cpp @@ -57,6 +57,7 @@ #include "llviewerparcelmgr.h" // [RLVa:KB] - Checked: 2010-04-11 (RLVa-1.2.0e) #include "rlvhandler.h" +#include "rlvui.h" // [/RLVa:KB] // Used when app not active to avoid processing hover. @@ -82,7 +83,10 @@ LLToolMgr::LLToolMgr() { // Not a panel, register these callbacks globally. LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Active", boost::bind(&LLToolMgr::inEdit, this)); - LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this)); +// LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&LLToolMgr::canEdit, this)); +// [RLVa:KB] - Checked: 2010-09-11 (RLVa-1.2.1d) | Added: RLVa-1.2.1d + LLUICtrl::EnableCallbackRegistry::currentRegistrar().add("Build.Enabled", boost::bind(&RlvUIEnabler::isBuildEnabled)); +// [/RLVa:KB] LLUICtrl::CommitCallbackRegistry::currentRegistrar().add("Build.Toggle", boost::bind(&LLToolMgr::toggleBuildMode, this)); gToolNull = new LLTool(LLStringUtil::null); // Does nothing diff --git a/indra/newview/rlvui.cpp b/indra/newview/rlvui.cpp index 6d55b076eca0e5c316bdf8b0b553165459a40596..59c7a660e25249f5a210d8b385d961b44de657d2 100644 --- a/indra/newview/rlvui.cpp +++ b/indra/newview/rlvui.cpp @@ -65,6 +65,7 @@ RlvUIEnabler::RlvUIEnabler() // onToggleXXX m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_EDIT, boost::bind(&RlvUIEnabler::onToggleEdit, this))); m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_FLY, boost::bind(&RlvUIEnabler::onToggleFly, this))); + m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_REZ, boost::bind(&RlvUIEnabler::onToggleRez, this))); m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SETENV, boost::bind(&RlvUIEnabler::onToggleSetEnv, this))); m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWINV, boost::bind(&RlvUIEnabler::onToggleShowInv, this))); m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWLOC, boost::bind(&RlvUIEnabler::onToggleShowLoc, this))); @@ -127,6 +128,9 @@ void RlvUIEnabler::onToggleEdit() LLToolMgr::instance().toggleBuildMode(); } + // Enable/disable the "Build" bottom tray button (but only if edit *and* rez restricted) + LLBottomTray::getInstance()->getChild<LLButton>("build_btn")->setEnabled(isBuildEnabled()); + // Start or stop filtering opening the beacons floater if (!fEnable) addGenericFloaterFilter("beacons"); @@ -147,6 +151,13 @@ void RlvUIEnabler::onToggleFly() LLFloaterMove::sUpdateFlyingStatus(); } +// Checked: 2010-09-11 (RLVa-1.2.1d) | Added: RLVa-1.2.1d +void RlvUIEnabler::onToggleRez() +{ + // Enable/disable the "Build" bottom tray button + LLBottomTray::getInstance()->getChild<LLButton>("build_btn")->setEnabled(isBuildEnabled()); +} + // Checked: 2010-03-17 (RLVa-1.2.0a) | Added: RLVa-1.2.0a void RlvUIEnabler::onToggleSetEnv() { @@ -597,4 +608,10 @@ bool RlvUIEnabler::hasOpenProfile(const LLUUID& idAgent) return false; } +// Checked: 2010-09-11 (RLVa-1.2.1d) | Added: RLVa-1.2.1d +bool RlvUIEnabler::isBuildEnabled() +{ + return (!gRlvHandler.hasBehaviour(RLV_BHVR_EDIT) || !gRlvHandler.hasBehaviour(RLV_BHVR_REZ)) && LLToolMgr::getInstance()->canEdit(); +} + // ============================================================================ diff --git a/indra/newview/rlvui.h b/indra/newview/rlvui.h index 6c6a6a40eb2ebdba22854c7fccd143502d3e8891..8ac6ab3702e3c83a6b33d6fe6466486cead8256c 100644 --- a/indra/newview/rlvui.h +++ b/indra/newview/rlvui.h @@ -46,6 +46,7 @@ protected: void onRefreshHoverText(); // showloc, shownames, showhovertext(all|world|hud) void onToggleEdit(); // edit void onToggleFly(); // fly + void onToggleRez(); // rez void onToggleSetEnv(); // setenv void onToggleShowInv(); // showinv void onToggleShowLoc(); // showloc @@ -92,6 +93,7 @@ public: static bool canViewRegionProperties(); // showloc static bool hasOpenIM(const LLUUID& idAgent); // shownames static bool hasOpenProfile(const LLUUID& idAgent); // shownames + static bool isBuildEnabled(); // edit and rez /* * Member variables