diff options
author | William Todd Stinson <stinson@lindenlab.com> | 2012-06-20 00:37:03 -0700 |
---|---|---|
committer | William Todd Stinson <stinson@lindenlab.com> | 2012-06-20 00:37:03 -0700 |
commit | 159af6fe32bdcadab3b60153e62b5c30219f4123 (patch) | |
tree | 6d9b7f594b11216cc75265ae2f767cacb9b37fbc /indra | |
parent | 37e6aa609f2ccd49e6225bad5186ec6ba49b9cb7 (diff) |
PATH-723: Only drawing the rebake navmesh panel if a user has access rights to rebake.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llpanelnavmeshrebake.cpp | 31 | ||||
-rw-r--r-- | indra/newview/llpanelnavmeshrebake.h | 4 |
2 files changed, 22 insertions, 13 deletions
diff --git a/indra/newview/llpanelnavmeshrebake.cpp b/indra/newview/llpanelnavmeshrebake.cpp index 283d6dfff5..b12c970da3 100644 --- a/indra/newview/llpanelnavmeshrebake.cpp +++ b/indra/newview/llpanelnavmeshrebake.cpp @@ -87,8 +87,11 @@ BOOL LLPanelNavMeshRebake::postBuild() void LLPanelNavMeshRebake::draw() { - updatePosition(); - LLPanel::draw(); + if (doDraw()) + { + updatePosition(); + LLPanel::draw(); + } } BOOL LLPanelNavMeshRebake::handleToolTip( S32 x, S32 y, MASK mask ) @@ -104,9 +107,10 @@ BOOL LLPanelNavMeshRebake::handleToolTip( S32 x, S32 y, MASK mask ) } LLPanelNavMeshRebake::LLPanelNavMeshRebake() - : mCanRebakeRegion(TRUE), - mNavMeshRebakeButton( NULL ), - mNavMeshBakingButton( NULL ), + : mCanRebakeRegion(FALSE), + mRebakeNavMeshMode(kRebakeNavMesh_Default), + mNavMeshRebakeButton(NULL), + mNavMeshBakingButton(NULL), mNavMeshSlot(), mRegionCrossingSlot(), mAgentStateSlot() @@ -125,7 +129,6 @@ LLPanelNavMeshRebake* LLPanelNavMeshRebake::getPanel() { LLPanelNavMeshRebake* panel = new LLPanelNavMeshRebake(); panel->buildFromFile("panel_navmesh_rebake.xml"); - panel->setVisible(FALSE); return panel; } @@ -133,7 +136,7 @@ void LLPanelNavMeshRebake::setMode(ERebakeNavMeshMode pRebakeNavMeshMode) { mNavMeshRebakeButton->setVisible(pRebakeNavMeshMode == kRebakeNavMesh_Available); mNavMeshBakingButton->setVisible(pRebakeNavMeshMode == kRebakeNavMesh_RequestSent); - setVisible(pRebakeNavMeshMode != kRebakeNavMesh_NotAvailable); + mRebakeNavMeshMode = pRebakeNavMeshMode; } void LLPanelNavMeshRebake::onNavMeshRebakeClick() @@ -144,8 +147,8 @@ void LLPanelNavMeshRebake::onNavMeshRebakeClick() void LLPanelNavMeshRebake::handleAgentState(BOOL pCanRebakeRegion) { - mCanRebakeRegion = pCanRebakeRegion; llinfos << "STINSON DEBUG: canRebakeRegion => " << (pCanRebakeRegion ? "TRUE" : "FALSE") << llendl; + mCanRebakeRegion = pCanRebakeRegion; } void LLPanelNavMeshRebake::handleRebakeNavMeshResponse(bool pResponseStatus) @@ -161,17 +164,13 @@ void LLPanelNavMeshRebake::handleNavMeshStatus(const LLPathfindingNavMeshStatus switch (pNavMeshStatus.getStatus()) { case LLPathfindingNavMeshStatus::kPending : + case LLPathfindingNavMeshStatus::kRepending : rebakeNavMeshMode = kRebakeNavMesh_Available; break; case LLPathfindingNavMeshStatus::kBuilding : - rebakeNavMeshMode = kRebakeNavMesh_NotAvailable; - break; case LLPathfindingNavMeshStatus::kComplete : rebakeNavMeshMode = kRebakeNavMesh_NotAvailable; break; - case LLPathfindingNavMeshStatus::kRepending : - rebakeNavMeshMode = kRebakeNavMesh_Available; - break; default : rebakeNavMeshMode = kRebakeNavMesh_Default; llassert(0); @@ -194,6 +193,7 @@ void LLPanelNavMeshRebake::createNavMeshStatusListenerForCurrentRegion() { mNavMeshSlot.disconnect(); } + mCanRebakeRegion = FALSE; LLViewerRegion *currentRegion = gAgent.getRegion(); if (currentRegion != NULL) @@ -203,6 +203,11 @@ void LLPanelNavMeshRebake::createNavMeshStatusListenerForCurrentRegion() } } +bool LLPanelNavMeshRebake::doDraw() const +{ + return (mCanRebakeRegion && (mRebakeNavMeshMode != kRebakeNavMesh_NotAvailable)); +} + void LLPanelNavMeshRebake::updatePosition() { S32 y_pos = 0; diff --git a/indra/newview/llpanelnavmeshrebake.h b/indra/newview/llpanelnavmeshrebake.h index f4653ea458..ecd5ad2111 100644 --- a/indra/newview/llpanelnavmeshrebake.h +++ b/indra/newview/llpanelnavmeshrebake.h @@ -80,11 +80,15 @@ private: void createNavMeshStatusListenerForCurrentRegion(); + bool doDraw() const; void updatePosition(); BOOL mCanRebakeRegion; + ERebakeNavMeshMode mRebakeNavMeshMode; + LLButton* mNavMeshRebakeButton; LLButton* mNavMeshBakingButton; + LLPathfindingNavMesh::navmesh_slot_t mNavMeshSlot; boost::signals2::connection mRegionCrossingSlot; LLPathfindingManager::agent_state_slot_t mAgentStateSlot; |