Skip to content
Snippets Groups Projects
Commit 1c6b4da6 authored by Kitty Barnett's avatar Kitty Barnett
Browse files

- changed : only prevent teleporting home when both @tplm=n *and* @tploc=n restricted

- changed : visually disable the "Home" button on the navigation bar when unable to teleport home
- changed : visually disable the "Go Home" button on the worldmap floater when unable to teleport home

--HG--
branch : RLVa
parent 8c32b5fe
No related branches found
No related tags found
No related merge requests found
...@@ -3311,10 +3311,11 @@ void LLAgent::teleportRequest( ...@@ -3311,10 +3311,11 @@ void LLAgent::teleportRequest(
// Landmark ID = LLUUID::null means teleport home // Landmark ID = LLUUID::null means teleport home
void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id)
{ {
// [RLVa:KB] - Checked: 2010-04-01 (RLVa-1.2.0c) | Modified: RLVa-1.0.0d // [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Modified: RLVa-1.2.1a
// TODO-RLVa: [RLVa-1.2.1] Allow teleporting home if @tplm=n restricted but not @tploc=n restricted and vice versa? // NOTE: we'll allow teleporting home unless both @tplm=n *and* @tploc=n restricted
if ( (rlv_handler_t::isEnabled()) && if ( (rlv_handler_t::isEnabled()) &&
( (gRlvHandler.hasBehaviour(RLV_BHVR_TPLM)) || ( ( (landmark_asset_id.notNull()) ? gRlvHandler.hasBehaviour(RLV_BHVR_TPLM)
: gRlvHandler.hasBehaviour(RLV_BHVR_TPLM) && gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC) ) ||
((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (isAgentAvatarValid()) && (gAgentAvatarp->isSitting())) )) ((gRlvHandler.hasBehaviour(RLV_BHVR_UNSIT)) && (isAgentAvatarValid()) && (gAgentAvatarp->isSitting())) ))
{ {
return; return;
......
...@@ -75,6 +75,10 @@ ...@@ -75,6 +75,10 @@
#include "llwindow.h" // copyTextToClipboard() #include "llwindow.h" // copyTextToClipboard()
// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a)
#include "rlvhandler.h"
// [/RLVa:KB]
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
// Constants // Constants
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
...@@ -434,6 +438,10 @@ void LLFloaterWorldMap::draw() ...@@ -434,6 +438,10 @@ void LLFloaterWorldMap::draw()
// childSetEnabled("Clear", (BOOL)tracking_status); // childSetEnabled("Clear", (BOOL)tracking_status);
childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->isTracking()); childSetEnabled("Show Destination", (BOOL)tracking_status || LLWorldMap::getInstance()->isTracking());
childSetEnabled("copy_slurl", (mSLURL.isValid()) ); childSetEnabled("copy_slurl", (mSLURL.isValid()) );
// [RLVa:KB] - Checked: 2010-08-22 (RLVa-1.2.1a) | Added: RLVa-1.2.1a
childSetEnabled("Go Home",
(!rlv_handler_t::isEnabled()) || !(gRlvHandler.hasBehaviour(RLV_BHVR_TPLM) && gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)));
// [/RLVa:KB]
setMouseOpaque(TRUE); setMouseOpaque(TRUE);
getDragHandle()->setMouseOpaque(TRUE); getDragHandle()->setMouseOpaque(TRUE);
......
...@@ -69,6 +69,10 @@ RlvUIEnabler::RlvUIEnabler() ...@@ -69,6 +69,10 @@ RlvUIEnabler::RlvUIEnabler()
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWWORLDMAP, boost::bind(&RlvUIEnabler::onToggleShowWorldMap, this))); m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_SHOWWORLDMAP, boost::bind(&RlvUIEnabler::onToggleShowWorldMap, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_UNSIT, boost::bind(&RlvUIEnabler::onToggleUnsit, this))); m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_UNSIT, boost::bind(&RlvUIEnabler::onToggleUnsit, this)));
// onToggleTp
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_TPLOC, boost::bind(&RlvUIEnabler::onToggleTp, this)));
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_TPLM, boost::bind(&RlvUIEnabler::onToggleTp, this)));
// onUpdateLoginLastLocation // onUpdateLoginLastLocation
#ifdef RLV_EXTENSION_STARTLOCATION #ifdef RLV_EXTENSION_STARTLOCATION
m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_TPLOC, boost::bind(&RlvUIEnabler::onUpdateLoginLastLocation, this))); m_Handlers.insert(std::pair<ERlvBehaviour, behaviour_handler_t>(RLV_BHVR_TPLOC, boost::bind(&RlvUIEnabler::onUpdateLoginLastLocation, this)));
...@@ -323,6 +327,16 @@ void RlvUIEnabler::onToggleShowWorldMap() ...@@ -323,6 +327,16 @@ void RlvUIEnabler::onToggleShowWorldMap()
removeGenericFloaterFilter("world_map"); removeGenericFloaterFilter("world_map");
} }
// Checked: 2010-08-22 (RLVa-1.2.1a) | Added: RLVa-1.2.1a
void RlvUIEnabler::onToggleTp()
{
// Disable the navigation bar "Home" button if both @tplm=n *and* @tploc=n restricted
LLButton* pNavBarHomeBtn = LLNavigationBar::getInstance()->getChild<LLButton>("home_btn");
RLV_ASSERT(pNavBarHomeBtn);
if (pNavBarHomeBtn)
pNavBarHomeBtn->setEnabled(!(gRlvHandler.hasBehaviour(RLV_BHVR_TPLM) && gRlvHandler.hasBehaviour(RLV_BHVR_TPLOC)));
}
// Checked: 2010-03-01 (RLVa-1.2.0c) | Added: RLVa-1.2.0a // Checked: 2010-03-01 (RLVa-1.2.0c) | Added: RLVa-1.2.0a
void RlvUIEnabler::onToggleUnsit() void RlvUIEnabler::onToggleUnsit()
{ {
......
...@@ -52,6 +52,7 @@ protected: ...@@ -52,6 +52,7 @@ protected:
void onToggleShowMinimap(); // showminimap void onToggleShowMinimap(); // showminimap
void onToggleShowNames(); // shownames void onToggleShowNames(); // shownames
void onToggleShowWorldMap(); // showworldmap void onToggleShowWorldMap(); // showworldmap
void onToggleTp(); // tploc and tplm
void onToggleUnsit(); // unsit void onToggleUnsit(); // unsit
void onToggleViewXXX(); // viewnote, viewscript, viewtexture void onToggleViewXXX(); // viewnote, viewscript, viewtexture
void onUpdateLoginLastLocation(); // tploc and unsit void onUpdateLoginLastLocation(); // tploc and unsit
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment