Skip to content
Snippets Groups Projects
Commit b20f1a51 authored by Todd Stinson's avatar Todd Stinson
Browse files

PATH-750: Adding icon to display pathfinding dirty state.

parent 8b8f2fed
No related branches found
No related tags found
No related merge requests found
...@@ -44,10 +44,14 @@ ...@@ -44,10 +44,14 @@
// newview includes // newview includes
#include "llagent.h" #include "llagent.h"
#include "llenvmanager.h"
#include "llfloatersidepanelcontainer.h" #include "llfloatersidepanelcontainer.h"
#include "llinventoryobserver.h" #include "llinventoryobserver.h"
#include "lllandmarkactions.h" #include "lllandmarkactions.h"
#include "lllandmarklist.h" #include "lllandmarklist.h"
#include "llpathfindingmanager.h"
#include "llpathfindingnavmesh.h"
#include "llpathfindingnavmeshstatus.h"
#include "llteleporthistory.h" #include "llteleporthistory.h"
#include "llslurl.h" #include "llslurl.h"
#include "llstatusbar.h" // getHealth() #include "llstatusbar.h" // getHealth()
...@@ -192,6 +196,7 @@ LLLocationInputCtrl::Params::Params() ...@@ -192,6 +196,7 @@ LLLocationInputCtrl::Params::Params()
damage_text("damage_text"), damage_text("damage_text"),
see_avatars_icon("see_avatars_icon"), see_avatars_icon("see_avatars_icon"),
maturity_help_topic("maturity_help_topic"), maturity_help_topic("maturity_help_topic"),
pathfinding_dirty_icon("pathfinding_dirty_icon"),
pathfinding_disabled_icon("pathfinding_disabled_icon") pathfinding_disabled_icon("pathfinding_disabled_icon")
{ {
} }
...@@ -204,6 +209,9 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) ...@@ -204,6 +209,9 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
mAddLandmarkBtn(NULL), mAddLandmarkBtn(NULL),
mForSaleBtn(NULL), mForSaleBtn(NULL),
mInfoBtn(NULL), mInfoBtn(NULL),
mRegionCrossingSlot(),
mNavMeshSlot(),
mIsNavMeshDirty(false),
mLandmarkImageOn(NULL), mLandmarkImageOn(NULL),
mLandmarkImageOff(NULL), mLandmarkImageOff(NULL),
mIconMaturityGeneral(NULL), mIconMaturityGeneral(NULL),
...@@ -338,6 +346,13 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) ...@@ -338,6 +346,13 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
mParcelIcon[DAMAGE_ICON]->setMouseDownCallback(boost::bind(&LLLocationInputCtrl::onParcelIconClick, this, DAMAGE_ICON)); mParcelIcon[DAMAGE_ICON]->setMouseDownCallback(boost::bind(&LLLocationInputCtrl::onParcelIconClick, this, DAMAGE_ICON));
addChild(mParcelIcon[DAMAGE_ICON]); addChild(mParcelIcon[DAMAGE_ICON]);
LLIconCtrl::Params pathfinding_dirty_icon = p.pathfinding_dirty_icon;
pathfinding_dirty_icon.tool_tip = LLTrans::getString("LocationCtrlPathfindingDirtyTooltip");
pathfinding_dirty_icon.mouse_opaque = true;
mParcelIcon[PATHFINDING_DIRTY_ICON] = LLUICtrlFactory::create<LLIconCtrl>(pathfinding_dirty_icon);
mParcelIcon[PATHFINDING_DIRTY_ICON]->setMouseDownCallback(boost::bind(&LLLocationInputCtrl::onParcelIconClick, this, PATHFINDING_DIRTY_ICON));
addChild(mParcelIcon[PATHFINDING_DIRTY_ICON]);
LLIconCtrl::Params pathfinding_disabled_icon = p.pathfinding_disabled_icon; LLIconCtrl::Params pathfinding_disabled_icon = p.pathfinding_disabled_icon;
pathfinding_disabled_icon.tool_tip = LLTrans::getString("LocationCtrlPathfindingDisabledTooltip"); pathfinding_disabled_icon.tool_tip = LLTrans::getString("LocationCtrlPathfindingDisabledTooltip");
pathfinding_disabled_icon.mouse_opaque = true; pathfinding_disabled_icon.mouse_opaque = true;
...@@ -399,6 +414,9 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p) ...@@ -399,6 +414,9 @@ LLLocationInputCtrl::LLLocationInputCtrl(const LLLocationInputCtrl::Params& p)
mLocationHistoryConnection = LLLocationHistory::getInstance()->setChangedCallback( mLocationHistoryConnection = LLLocationHistory::getInstance()->setChangedCallback(
boost::bind(&LLLocationInputCtrl::onLocationHistoryChanged, this,_1)); boost::bind(&LLLocationInputCtrl::onLocationHistoryChanged, this,_1));
mRegionCrossingSlot = LLEnvManagerNew::getInstance()->setRegionChangeCallback(boost::bind(&LLLocationInputCtrl::onRegionBoundaryCrossed, this));
createNavMeshStatusListenerForCurrentRegion();
mRemoveLandmarkObserver = new LLRemoveLandmarkObserver(this); mRemoveLandmarkObserver = new LLRemoveLandmarkObserver(this);
mAddLandmarkObserver = new LLAddLandmarkObserver(this); mAddLandmarkObserver = new LLAddLandmarkObserver(this);
gInventory.addObserver(mRemoveLandmarkObserver); gInventory.addObserver(mRemoveLandmarkObserver);
...@@ -423,6 +441,8 @@ LLLocationInputCtrl::~LLLocationInputCtrl() ...@@ -423,6 +441,8 @@ LLLocationInputCtrl::~LLLocationInputCtrl()
LLViewerParcelMgr::getInstance()->removeObserver(mParcelChangeObserver); LLViewerParcelMgr::getInstance()->removeObserver(mParcelChangeObserver);
delete mParcelChangeObserver; delete mParcelChangeObserver;
mRegionCrossingSlot.disconnect();
mNavMeshSlot.disconnect();
mCoordinatesControlConnection.disconnect(); mCoordinatesControlConnection.disconnect();
mParcelPropertiesControlConnection.disconnect(); mParcelPropertiesControlConnection.disconnect();
mParcelMgrConnection.disconnect(); mParcelMgrConnection.disconnect();
...@@ -644,6 +664,17 @@ void LLLocationInputCtrl::onMaturityButtonClicked() ...@@ -644,6 +664,17 @@ void LLLocationInputCtrl::onMaturityButtonClicked()
LLUI::sHelpImpl->showTopic(mMaturityHelpTopic); LLUI::sHelpImpl->showTopic(mMaturityHelpTopic);
} }
void LLLocationInputCtrl::onRegionBoundaryCrossed()
{
createNavMeshStatusListenerForCurrentRegion();
}
void LLLocationInputCtrl::onNavMeshStatusChange(const LLPathfindingNavMeshStatus &pNavMeshStatus)
{
mIsNavMeshDirty = pNavMeshStatus.isValid() && (pNavMeshStatus.getStatus() != LLPathfindingNavMeshStatus::kComplete);
refreshParcelIcons();
}
void LLLocationInputCtrl::onLandmarkLoaded(LLLandmark* lm) void LLLocationInputCtrl::onLandmarkLoaded(LLLandmark* lm)
{ {
(void) lm; (void) lm;
...@@ -836,7 +867,8 @@ void LLLocationInputCtrl::refreshParcelIcons() ...@@ -836,7 +867,8 @@ void LLLocationInputCtrl::refreshParcelIcons()
mParcelIcon[BUILD_ICON]->setVisible( !allow_build ); mParcelIcon[BUILD_ICON]->setVisible( !allow_build );
mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts ); mParcelIcon[SCRIPTS_ICON]->setVisible( !allow_scripts );
mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage ); mParcelIcon[DAMAGE_ICON]->setVisible( allow_damage );
mParcelIcon[PATHFINDING_DISABLED_ICON]->setVisible( !pathfinding_dynamic_enabled ); mParcelIcon[PATHFINDING_DIRTY_ICON]->setVisible(mIsNavMeshDirty);
mParcelIcon[PATHFINDING_DISABLED_ICON]->setVisible(!mIsNavMeshDirty && !pathfinding_dynamic_enabled);
mDamageText->setVisible(allow_damage); mDamageText->setVisible(allow_damage);
mParcelIcon[SEE_AVATARS_ICON]->setVisible( !see_avs ); mParcelIcon[SEE_AVATARS_ICON]->setVisible( !see_avs );
...@@ -1176,6 +1208,9 @@ void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon) ...@@ -1176,6 +1208,9 @@ void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon)
case BUILD_ICON: case BUILD_ICON:
LLNotificationsUtil::add("NoBuild"); LLNotificationsUtil::add("NoBuild");
break; break;
case PATHFINDING_DIRTY_ICON:
LLNotificationsUtil::add("PathfindingDirty");
break;
case PATHFINDING_DISABLED_ICON: case PATHFINDING_DISABLED_ICON:
LLNotificationsUtil::add("DynamicPathfindingDisabled"); LLNotificationsUtil::add("DynamicPathfindingDisabled");
break; break;
...@@ -1207,3 +1242,18 @@ void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon) ...@@ -1207,3 +1242,18 @@ void LLLocationInputCtrl::onParcelIconClick(EParcelIcon icon)
// no default to get compiler warning when a new icon gets added // no default to get compiler warning when a new icon gets added
} }
} }
void LLLocationInputCtrl::createNavMeshStatusListenerForCurrentRegion()
{
if (mNavMeshSlot.connected())
{
mNavMeshSlot.disconnect();
}
LLViewerRegion *currentRegion = gAgent.getRegion();
if (currentRegion != NULL)
{
mNavMeshSlot = LLPathfindingManager::getInstance()->registerNavMeshListenerForRegion(currentRegion, boost::bind(&LLLocationInputCtrl::onNavMeshStatusChange, this, _2));
LLPathfindingManager::getInstance()->requestGetNavMeshForRegion(currentRegion, true);
}
}
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include "lliconctrl.h" // Params #include "lliconctrl.h" // Params
#include "lltextbox.h" // Params #include "lltextbox.h" // Params
#include "lllocationhistory.h" #include "lllocationhistory.h"
#include "llpathfindingnavmesh.h"
class LLLandmark; class LLLandmark;
...@@ -40,6 +41,7 @@ class LLRemoveLandmarkObserver; ...@@ -40,6 +41,7 @@ class LLRemoveLandmarkObserver;
class LLParcelChangeObserver; class LLParcelChangeObserver;
class LLMenuGL; class LLMenuGL;
class LLTeleportHistoryItem; class LLTeleportHistoryItem;
class LLPathfindingNavMeshStatus;
/** /**
* Location input control. * Location input control.
...@@ -79,6 +81,7 @@ class LLLocationInputCtrl ...@@ -79,6 +81,7 @@ class LLLocationInputCtrl
scripts_icon, scripts_icon,
damage_icon, damage_icon,
see_avatars_icon, see_avatars_icon,
pathfinding_dirty_icon,
pathfinding_disabled_icon; pathfinding_disabled_icon;
Optional<LLTextBox::Params> damage_text; Optional<LLTextBox::Params> damage_text;
Params(); Params();
...@@ -117,8 +120,9 @@ class LLLocationInputCtrl ...@@ -117,8 +120,9 @@ class LLLocationInputCtrl
SCRIPTS_ICON, // 4 SCRIPTS_ICON, // 4
DAMAGE_ICON, // 5 DAMAGE_ICON, // 5
SEE_AVATARS_ICON, // 6 SEE_AVATARS_ICON, // 6
PATHFINDING_DISABLED_ICON,// 7 PATHFINDING_DIRTY_ICON, // 7
ICON_COUNT // 8 total PATHFINDING_DISABLED_ICON,// 8
ICON_COUNT // 9 total
}; };
friend class LLUICtrlFactory; friend class LLUICtrlFactory;
...@@ -157,11 +161,15 @@ class LLLocationInputCtrl ...@@ -157,11 +161,15 @@ class LLLocationInputCtrl
void onAddLandmarkButtonClicked(); void onAddLandmarkButtonClicked();
void onAgentParcelChange(); void onAgentParcelChange();
void onMaturityButtonClicked(); void onMaturityButtonClicked();
void onRegionBoundaryCrossed();
void onNavMeshStatusChange(const LLPathfindingNavMeshStatus &pNavMeshStatus);
// callbacks // callbacks
bool onLocationContextMenuItemEnabled(const LLSD& userdata); bool onLocationContextMenuItemEnabled(const LLSD& userdata);
void onLocationContextMenuItemClicked(const LLSD& userdata); void onLocationContextMenuItemClicked(const LLSD& userdata);
void onParcelIconClick(EParcelIcon icon); void onParcelIconClick(EParcelIcon icon);
void createNavMeshStatusListenerForCurrentRegion();
LLMenuGL* mLocationContextMenu; LLMenuGL* mLocationContextMenu;
LLButton* mAddLandmarkBtn; LLButton* mAddLandmarkBtn;
LLButton* mForSaleBtn; LLButton* mForSaleBtn;
...@@ -181,6 +189,9 @@ class LLLocationInputCtrl ...@@ -181,6 +189,9 @@ class LLLocationInputCtrl
boost::signals2::connection mParcelPropertiesControlConnection; boost::signals2::connection mParcelPropertiesControlConnection;
boost::signals2::connection mParcelMgrConnection; boost::signals2::connection mParcelMgrConnection;
boost::signals2::connection mLocationHistoryConnection; boost::signals2::connection mLocationHistoryConnection;
boost::signals2::connection mRegionCrossingSlot;
LLPathfindingNavMesh::navmesh_slot_t mNavMeshSlot;
bool mIsNavMeshDirty;
LLUIImage* mLandmarkImageOn; LLUIImage* mLandmarkImageOn;
LLUIImage* mLandmarkImageOff; LLUIImage* mLandmarkImageOff;
LLPointer<LLUIImage> mIconMaturityGeneral; LLPointer<LLUIImage> mIconMaturityGeneral;
......
indra/newview/skins/default/textures/icons/Pathfinding_Dirty.png

553 B

...@@ -432,6 +432,7 @@ with the same filename but different name ...@@ -432,6 +432,7 @@ with the same filename but different name
<texture name="Parcel_Voice_Light" file_name="icons/Parcel_Voice_Light.png" preload="false" /> <texture name="Parcel_Voice_Light" file_name="icons/Parcel_Voice_Light.png" preload="false" />
<texture name="Parcel_VoiceNo_Light" file_name="icons/Parcel_VoiceNo_Light.png" preload="false" /> <texture name="Parcel_VoiceNo_Light" file_name="icons/Parcel_VoiceNo_Light.png" preload="false" />
<texture name="Pathfinding_Dirty" file_name="icons/Pathfinding_Dirty.png" preload="false" />
<texture name="Pathfinding_Disabled" file_name="icons/Pathfinding_Disabled.png" preload="false" /> <texture name="Pathfinding_Disabled" file_name="icons/Pathfinding_Disabled.png" preload="false" />
<texture name="Pause_Off" file_name="icons/Pause_Off.png" preload="false" /> <texture name="Pause_Off" file_name="icons/Pause_Off.png" preload="false" />
......
...@@ -5779,7 +5779,16 @@ This area has voice chat disabled. You won&apos;t be able to hear anyone talking ...@@ -5779,7 +5779,16 @@ This area has voice chat disabled. You won&apos;t be able to hear anyone talking
<unique/> <unique/>
This area has building disabled. You can&apos;t build or rez objects here. This area has building disabled. You can&apos;t build or rez objects here.
</notification> </notification>
<notification
icon="notify.tga"
name="PathfindingDirty"
persist="true"
type="notify">
<unique/>
The pathfinding navmesh is not up-to-date on the current region. If you have build rights, you may rebake the navmesh by clicking on the Rebake Region button.
</notification>
<notification <notification
icon="notify.tga" icon="notify.tga"
name="DynamicPathfindingDisabled" name="DynamicPathfindingDisabled"
......
...@@ -3325,7 +3325,8 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. ...@@ -3325,7 +3325,8 @@ If you continue to receive this message, contact the [SUPPORT_SITE].
<string name="LocationCtrlModerateIconTooltip">Moderate Region</string> <string name="LocationCtrlModerateIconTooltip">Moderate Region</string>
<string name="LocationCtrlGeneralIconTooltip">General Region</string> <string name="LocationCtrlGeneralIconTooltip">General Region</string>
<string name="LocationCtrlSeeAVsTooltip">Avatars visible and chat allowed outside of this parcel</string> <string name="LocationCtrlSeeAVsTooltip">Avatars visible and chat allowed outside of this parcel</string>
<string name="LocationCtrlPathfindingDisabledTooltip">Dynamic pathfinding is not disabled on this region</string> <string name="LocationCtrlPathfindingDirtyTooltip">The pathfinding navmesh is not up-to-date.</string>
<string name="LocationCtrlPathfindingDisabledTooltip">Dynamic pathfinding is not disabled on this region.</string>
<!-- Strings used by the (currently Linux) auto-updater app --> <!-- Strings used by the (currently Linux) auto-updater app -->
<string name="UpdaterWindowTitle"> <string name="UpdaterWindowTitle">
[APP_NAME] Update [APP_NAME] Update
......
...@@ -112,6 +112,15 @@ ...@@ -112,6 +112,15 @@
follows="right|top" follows="right|top"
image_name="Parcel_Health_Dark" image_name="Parcel_Health_Dark"
/> />
<pathfinding_dirty_icon
name="pathfinding_dirty_icon"
width="14"
height="13"
top="19"
left="2"
follows="right|top"
image_name="Pathfinding_Dirty"
/>
<pathfinding_disabled_icon <pathfinding_disabled_icon
name="pathfinding_disabled_icon" name="pathfinding_disabled_icon"
width="14" width="14"
......
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