[FIXED] Toolbar and menu items no longer disable when their matching restrictions are active

master
Kitty Barnett 2020-05-02 22:28:12 +02:00
parent a7e5b8ecc9
commit 00f561ec80
4 changed files with 22 additions and 9 deletions

View File

@ -279,6 +279,8 @@
tooltip_ref="Command_Environments_Tooltip"
execute_function="Floater.ToggleOrBringToFront"
execute_parameters="my_environments"
is_enabled_function="RLV.EnableIfNot"
is_enabled_parameters="setenv"
is_running_function="Floater.IsOpen"
is_running_parameters="my_environments"
/>

View File

@ -8979,8 +8979,8 @@ class LLWorldEnvSettings : public view_listener_t
bool handleEvent(const LLSD& userdata)
{
// [RLVa:KB] - Checked: 2010-03-18 (RLVa-1.2.0a) | Modified: RLVa-1.0.0g
if (gRlvHandler.hasBehaviour(RLV_BHVR_SETENV))
// [RLVa:KB] - @setenv
if (!RlvActions::canChangeEnvironment())
return true;
// [/RLVa:KB]
@ -9807,10 +9807,7 @@ void initialize_menus()
// [RLVa:KB] - Checked: RLVa-2.0.0
enable.add("RLV.MainToggleVisible", boost::bind(&rlvMenuMainToggleVisible, _1));
if (RlvActions::isRlvEnabled())
{
enable.add("RLV.CanShowName", boost::bind(&rlvMenuCanShowName));
enable.add("RLV.EnableIfNot", boost::bind(&rlvMenuEnableIfNot, _2));
}
enable.add("RLV.CanShowName", boost::bind(&rlvMenuCanShowName));
enable.add("RLV.EnableIfNot", boost::bind(&rlvMenuEnableIfNot, _2));
// [/RLVa:KB]
}

View File

@ -728,8 +728,13 @@ void rlvMenuToggleVisible()
bool rlvMenuCanShowName()
{
const LLVOAvatar* pAvatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
return (pAvatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, pAvatar->getID()));
bool fEnable = true;
if (rlv_handler_t::isEnabled())
{
const LLVOAvatar* pAvatar = find_avatar_from_object(LLSelectMgr::getInstance()->getSelection()->getPrimaryObject());
fEnable = (pAvatar) && (RlvActions::canShowName(RlvActions::SNC_DEFAULT, pAvatar->getID()));
}
return fEnable;
}
// Checked: 2010-04-23 (RLVa-1.2.0g) | Modified: RLVa-1.2.0g

View File

@ -727,6 +727,9 @@
<menu_item_call.on_click
function="World.EnvSettings"
parameter="my_environs" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="setenv" />
</menu_item_call>
<menu_item_call
@ -735,6 +738,9 @@
<menu_item_call.on_click
function="World.EnvSettings"
parameter="adjust_tool" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="setenv" />
</menu_item_call>
<menu_item_separator/>
<menu_item_check
@ -746,6 +752,9 @@
<menu_item_check.on_check
function="World.EnableEnvSettings"
parameter="pause_clouds" />
<menu_item_call.on_enable
function="RLV.EnableIfNot"
parameter="setenv" />
</menu_item_check>
</menu>