From 9cac312f57391792e9fce380c2c38ae4060ae1d7 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 11 Jun 2012 10:55:18 -0700 Subject: Backed out changeset: 18b06d44c5a3 --- indra/newview/llpathfindingmanager.cpp | 47 ---------------------------------- 1 file changed, 47 deletions(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 85a315a3e7..e282a3e2f4 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -93,25 +93,6 @@ public: LLHTTPRegistration gHTTPRegistrationAgentStateChangeNode(SIM_MESSAGE_AGENT_STATE_UPDATE); -//--------------------------------------------------------------------------- -// StinsonResponder -//--------------------------------------------------------------------------- - -class StinsonResponder : public LLHTTPClient::Responder -{ -public: - StinsonResponder(const std::string &pCapabilityURL); - virtual ~StinsonResponder(); - - virtual void result(const LLSD &pContent); - virtual void error(U32 pStatus, const std::string& pReason); - -protected: - -private: - std::string mCapabilityURL; -}; - //--------------------------------------------------------------------------- // NavMeshStatusResponder //--------------------------------------------------------------------------- @@ -538,10 +519,6 @@ void LLPathfindingManager::requestGetCharacters(request_id_t pRequestId, object_ LLHTTPClient::ResponderPtr charactersResponder = new CharactersResponder(charactersURL, pRequestId, pCharactersCallback); LLHTTPClient::get(charactersURL, charactersResponder); - - std::string googleURL = "http://www.google.com/"; - LLHTTPClient::ResponderPtr stinsonResponder = new StinsonResponder(googleURL); - LLHTTPClient::get(googleURL, stinsonResponder); } } } @@ -825,30 +802,6 @@ void LLNavMeshSimStateChangeNode::post(ResponsePtr pResponse, const LLSD &pConte LLPathfindingManager::getInstance()->handleNavMeshStatusUpdate(navMeshStatus); } -//--------------------------------------------------------------------------- -// StinsonResponder -//--------------------------------------------------------------------------- - -StinsonResponder::StinsonResponder(const std::string &pCapabilityURL) - : LLHTTPClient::Responder(), - mCapabilityURL(pCapabilityURL) -{ -} - -StinsonResponder::~StinsonResponder() -{ -} - -void StinsonResponder::result(const LLSD &pContent) -{ - llinfos << "STINSON DEBUG: success to URL '" << mCapabilityURL << "' with content " << pContent << llendl; -} - -void StinsonResponder::error(U32 pStatus, const std::string& pReason) -{ - llwarns << "STINSON DEBUG: error with request to URL '" << mCapabilityURL << "' because " << pReason << " (statusCode:" << pStatus << ")" << llendl; -} - //--------------------------------------------------------------------------- // LLAgentStateChangeNode //--------------------------------------------------------------------------- -- cgit v1.3 From ff7223fafef58d9f8025e97fee87cf7911d93ccf Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 11 Jun 2012 14:45:59 -0700 Subject: PATH-706: Removing enforcement on frozen/unfrozen state from the linksets floater. Also, removing handlers for agent state change. --- indra/newview/llfloaterpathfindinglinksets.cpp | 30 ++-------------------- indra/newview/llfloaterpathfindinglinksets.h | 7 ----- indra/newview/llpathfindingmanager.cpp | 5 ---- indra/newview/llpathfindingmanager.h | 1 - indra/newview/llviewermenu.cpp | 9 ------- indra/newview/skins/default/xui/en/menu_viewer.xml | 2 +- 6 files changed, 3 insertions(+), 51 deletions(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llfloaterpathfindinglinksets.cpp b/indra/newview/llfloaterpathfindinglinksets.cpp index 1d7f165ad9..8488ee1aa3 100644 --- a/indra/newview/llfloaterpathfindinglinksets.cpp +++ b/indra/newview/llfloaterpathfindinglinksets.cpp @@ -60,26 +60,6 @@ // LLFloaterPathfindingLinksets //--------------------------------------------------------------------------- -void LLFloaterPathfindingLinksets::onOpen(const LLSD& pKey) -{ - LLFloaterPathfindingObjects::onOpen(pKey); - - if (!mAgentStateSlot.connected()) - { - mAgentStateSlot = LLPathfindingManager::getInstance()->registerAgentStateListener(boost::bind(&LLFloaterPathfindingLinksets::onAgentStateChange, this, _1)); - } -} - -void LLFloaterPathfindingLinksets::onClose(bool pIsAppQuitting) -{ - if (mAgentStateSlot.connected()) - { - mAgentStateSlot.disconnect(); - } - - LLFloaterPathfindingObjects::onClose(pIsAppQuitting); -} - void LLFloaterPathfindingLinksets::openLinksetsEditor() { LLFloaterReg::toggleInstanceOrBringToFront("pathfinding_linksets"); @@ -107,8 +87,7 @@ LLFloaterPathfindingLinksets::LLFloaterPathfindingLinksets(const LLSD& pSeed) mLabelEditD(NULL), mEditD(NULL), mApplyEditsButton(NULL), - mBeaconColor(), - mAgentStateSlot() + mBeaconColor() { } @@ -337,11 +316,6 @@ void LLFloaterPathfindingLinksets::onApplyChangesClicked() applyEdit(); } -void LLFloaterPathfindingLinksets::onAgentStateChange(LLPathfindingManager::EAgentState pAgentState) -{ - updateControls(); -} - void LLFloaterPathfindingLinksets::applyFilters() { rebuildObjectsScrollList(); @@ -530,7 +504,7 @@ bool LLFloaterPathfindingLinksets::isShowCannotBeVolumeWarning(LLPathfindingLink void LLFloaterPathfindingLinksets::updateStateOnEditFields() { int numSelectedItems = getNumSelectedObjects(); - bool isEditEnabled = ((numSelectedItems > 0) && LLPathfindingManager::getInstance()->isAllowAlterPermanent()); + bool isEditEnabled = (numSelectedItems > 0); mEditLinksetUse->setEnabled(isEditEnabled); diff --git a/indra/newview/llfloaterpathfindinglinksets.h b/indra/newview/llfloaterpathfindinglinksets.h index 4b19f09cda..8c464dc1d5 100644 --- a/indra/newview/llfloaterpathfindinglinksets.h +++ b/indra/newview/llfloaterpathfindinglinksets.h @@ -46,10 +46,6 @@ class LLVector3; class LLFloaterPathfindingLinksets : public LLFloaterPathfindingObjects { public: - - virtual void onOpen(const LLSD& pKey); - virtual void onClose(bool pIsAppQuitting); - static void openLinksetsEditor(); protected: @@ -78,7 +74,6 @@ private: void onClearFiltersClicked(); void onWalkabilityCoefficientEntered(LLUICtrl *pUICtrl); void onApplyChangesClicked(); - void onAgentStateChange(LLPathfindingManager::EAgentState pAgentState); void applyFilters(); void clearFilters(); @@ -131,8 +126,6 @@ private: LLButton *mApplyEditsButton; LLColor4 mBeaconColor; - - LLPathfindingManager::agent_state_slot_t mAgentStateSlot; }; #endif // LL_LLFLOATERPATHFINDINGLINKSETS_H diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index e282a3e2f4..5e2a9e1213 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -292,11 +292,6 @@ bool LLPathfindingManager::isPathfindingNavMeshVersioningEnabledForCurrentRegion } #endif // DEPRECATED_UNVERSIONED_NAVMESH -bool LLPathfindingManager::isAllowAlterPermanent() -{ - return (!isPathfindingEnabledForCurrentRegion() || (getAgentState() == kAgentStateUnfrozen)); -} - bool LLPathfindingManager::isAllowViewTerrainProperties() const { LLViewerRegion* region = getCurrentRegion(); diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index 3c9af91e7b..1ae6e06b40 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -80,7 +80,6 @@ public: bool isPathfindingNavMeshVersioningEnabledForCurrentRegionXXX() const; #endif // DEPRECATED_UNVERSIONED_NAVMESH - bool isAllowAlterPermanent(); bool isAllowViewTerrainProperties() const; LLPathfindingNavMesh::navmesh_slot_t registerNavMeshListenerForRegion(LLViewerRegion *pRegion, LLPathfindingNavMesh::navmesh_callback_t pNavMeshCallback); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 6944ae1a9b..5a0239c2e4 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4806,14 +4806,6 @@ class LLToolsEnablePathfinding : public view_listener_t } }; -class LLToolsEnablePathfindingLinksets : public view_listener_t -{ - bool handleEvent(const LLSD& userdata) - { - return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLPathfindingManager::getInstance()->isAllowAlterPermanent(); - } -}; - // Round the position of all root objects to the grid class LLToolsSnapObjectXY : public view_listener_t { @@ -8209,7 +8201,6 @@ void initialize_menus() view_listener_t::addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.EnableSaveToObjectInventory"); view_listener_t::addMenu(new LLToolsEnablePathfinding(), "Tools.EnablePathfinding"); - view_listener_t::addMenu(new LLToolsEnablePathfindingLinksets(), "Tools.EnablePathfindingLinksets"); // Help menu // most items use the ShowFloater method diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index ad02beff7a..7b21f1f135 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -967,7 +967,7 @@ function="Floater.ToggleOrBringToFront" parameter="pathfinding_linksets" /> + function="Tools.EnablePathfinding" /> Date: Mon, 11 Jun 2012 16:40:53 -0700 Subject: PATH-711: Implementing Leo's changes for the pathfinding console. --- indra/newview/llfloaterpathfindingconsole.cpp | 137 +-------------------- indra/newview/llfloaterpathfindingconsole.h | 18 --- indra/newview/llpathfindingcharacterlist.cpp | 6 +- indra/newview/llpathfindingmanager.cpp | 14 +++ indra/newview/llpathfindingmanager.h | 4 + indra/newview/llpathfindingnavmeshzone.h | 1 + indra/newview/llpathfindingpathtool.cpp | 5 - indra/newview/llstartup.cpp | 4 + indra/newview/llviewermenu.cpp | 11 +- .../default/xui/en/floater_pathfinding_console.xml | 91 +------------- indra/newview/skins/default/xui/en/menu_viewer.xml | 18 +-- 11 files changed, 47 insertions(+), 262 deletions(-) (limited to 'indra/newview/llpathfindingmanager.cpp') diff --git a/indra/newview/llfloaterpathfindingconsole.cpp b/indra/newview/llfloaterpathfindingconsole.cpp index 54e60ce0f4..59ce330a10 100644 --- a/indra/newview/llfloaterpathfindingconsole.cpp +++ b/indra/newview/llfloaterpathfindingconsole.cpp @@ -64,9 +64,6 @@ #define XUI_CHARACTER_TYPE_C 3 #define XUI_CHARACTER_TYPE_D 4 -#define XUI_EDIT_TAB_INDEX 0 -#define XUI_TEST_TAB_INDEX 1 - #define SET_SHAPE_RENDER_FLAG(_flag,_type) _flag |= (1U << _type) #define CONTROL_NAME_RETRIEVE_NEIGHBOR "RetrieveNeighboringRegion" @@ -138,37 +135,9 @@ BOOL LLFloaterPathfindingConsole::postBuild() llassert(mViewCharactersButton != NULL); mViewCharactersButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onViewCharactersClicked, this)); - mEditTestTabContainer = findChild("edit_test_tab_container"); - llassert(mEditTestTabContainer != NULL); - mEditTestTabContainer->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onTabSwitch, this)); - - mEditTab = findChild("edit_panel"); - llassert(mEditTab != NULL); - mTestTab = findChild("test_panel"); llassert(mTestTab != NULL); - mUnfreezeLabel = findChild("unfreeze_label"); - llassert(mUnfreezeLabel != NULL); - - mUnfreezeButton = findChild("enter_unfrozen_mode"); - llassert(mUnfreezeButton != NULL); - mUnfreezeButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onUnfreezeClicked, this)); - - mLinksetsLabel = findChild("edit_linksets_label"); - llassert(mLinksetsLabel != NULL); - - mLinksetsButton = findChild("view_and_edit_linksets"); - llassert(mLinksetsButton != NULL); - mLinksetsButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onViewEditLinksetClicked, this)); - - mFreezeLabel = findChild("freeze_label"); - llassert(mFreezeLabel != NULL); - - mFreezeButton = findChild("enter_frozen_mode"); - llassert(mFreezeButton != NULL); - mFreezeButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onFreezeClicked, this)); - mPathfindingViewerStatus = findChild("pathfinding_viewer_status"); llassert(mPathfindingViewerStatus != NULL); @@ -205,11 +174,6 @@ BOOL LLFloaterPathfindingConsole::postBuild() llassert(mClearPathButton != NULL); mClearPathButton->setCommitCallback(boost::bind(&LLFloaterPathfindingConsole::onClearPathClicked, this)); - if (LLPathingLib::getInstance() == NULL) - { - LLPathingLib::initSystem(); - } - if (LLPathingLib::getInstance() != NULL) { mPathfindingToolset = new LLToolset(); @@ -246,11 +210,6 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey) fillInColorsForNavMeshVisualization(); } - if (!mAgentStateSlot.connected()) - { - mAgentStateSlot = LLPathfindingManager::getInstance()->registerAgentStateListener(boost::bind(&LLFloaterPathfindingConsole::onAgentStateCB, this, _1)); - } - if (!mRegionBoundarySlot.connected()) { mRegionBoundarySlot = LLEnvManagerNew::instance().setRegionChangeCallback(boost::bind(&LLFloaterPathfindingConsole::onRegionBoundaryCross, this)); @@ -266,14 +225,10 @@ void LLFloaterPathfindingConsole::onOpen(const LLSD& pKey) mPathEventSlot = LLPathfindingPathTool::getInstance()->registerPathEventListener(boost::bind(&LLFloaterPathfindingConsole::onPathEvent, this)); } - setAgentState(LLPathfindingManager::getInstance()->getAgentState()); setDefaultInputs(); updatePathTestStatus(); - if (mEditTestTabContainer->getCurrentPanelIndex() == XUI_TEST_TAB_INDEX) - { - switchIntoTestPathMode(); - } + switchIntoTestPathMode(); } void LLFloaterPathfindingConsole::onClose(bool pIsAppQuitting) @@ -295,11 +250,6 @@ void LLFloaterPathfindingConsole::onClose(bool pIsAppQuitting) mRegionBoundarySlot.disconnect(); } - if (mAgentStateSlot.connected()) - { - mAgentStateSlot.disconnect(); - } - if (mNavMeshZoneSlot.connected()) { mNavMeshZoneSlot.disconnect(); @@ -501,15 +451,7 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mPathfindingViewerStatus(NULL), mPathfindingSimulatorStatus(NULL), mViewCharactersButton(NULL), - mEditTestTabContainer(NULL), - mEditTab(NULL), mTestTab(NULL), - mUnfreezeLabel(NULL), - mUnfreezeButton(NULL), - mLinksetsLabel(NULL), - mLinksetsButton(NULL), - mFreezeLabel(NULL), - mFreezeButton(NULL), mCtrlClickLabel(), mShiftClickLabel(), mCharacterWidthLabel(), @@ -522,7 +464,6 @@ LLFloaterPathfindingConsole::LLFloaterPathfindingConsole(const LLSD& pSeed) mNavMeshZoneSlot(), mNavMeshZone(), mIsNavMeshUpdating(false), - mAgentStateSlot(), mRegionBoundarySlot(), mTeleportFailedSlot(), mPathEventSlot(), @@ -577,35 +518,6 @@ void LLFloaterPathfindingConsole::onViewCharactersClicked() LLFloaterPathfindingCharacters::openCharactersViewer(); } -void LLFloaterPathfindingConsole::onTabSwitch() -{ - if (mEditTestTabContainer->getCurrentPanelIndex() == XUI_TEST_TAB_INDEX) - { - switchIntoTestPathMode(); - } - else - { - switchOutOfTestPathMode(); - } -} - -void LLFloaterPathfindingConsole::onUnfreezeClicked() -{ - mUnfreezeButton->setEnabled(FALSE); - LLPathfindingManager::getInstance()->requestSetAgentState(LLPathfindingManager::kAgentStateUnfrozen); -} - -void LLFloaterPathfindingConsole::onFreezeClicked() -{ - mFreezeButton->setEnabled(FALSE); - LLPathfindingManager::getInstance()->requestSetAgentState(LLPathfindingManager::kAgentStateFrozen); -} - -void LLFloaterPathfindingConsole::onViewEditLinksetClicked() -{ - LLFloaterPathfindingLinksets::openLinksetsEditor(); -} - void LLFloaterPathfindingConsole::onCharacterWidthSet() { updateCharacterWidth(); @@ -658,11 +570,6 @@ void LLFloaterPathfindingConsole::onNavMeshZoneCB(LLPathfindingNavMeshZone::ENav } } -void LLFloaterPathfindingConsole::onAgentStateCB(LLPathfindingManager::EAgentState pAgentState) -{ - setAgentState(pAgentState); -} - void LLFloaterPathfindingConsole::onRegionBoundaryCross() { initializeNavMeshZoneForCurrentRegion(); @@ -706,7 +613,6 @@ void LLFloaterPathfindingConsole::onPathEvent() void LLFloaterPathfindingConsole::setDefaultInputs() { - mEditTestTabContainer->selectTab(XUI_EDIT_TAB_INDEX); setRenderWorld(TRUE); setRenderNavMesh(FALSE); setRenderWalkables(FALSE); @@ -776,7 +682,6 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mShowRenderWaterPlaneCheckBox->setEnabled(FALSE); mShowXRayCheckBox->setEnabled(FALSE); mViewCharactersButton->setEnabled(FALSE); - mEditTestTabContainer->selectTab(0); mTestTab->setEnabled(FALSE); mCtrlClickLabel->setEnabled(FALSE); mShiftClickLabel->setEnabled(FALSE); @@ -802,7 +707,6 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mShowRenderWaterPlaneCheckBox->setEnabled(FALSE); mShowXRayCheckBox->setEnabled(FALSE); mViewCharactersButton->setEnabled(TRUE); - mEditTestTabContainer->selectTab(0); mTestTab->setEnabled(FALSE); mCtrlClickLabel->setEnabled(FALSE); mShiftClickLabel->setEnabled(FALSE); @@ -830,7 +734,6 @@ void LLFloaterPathfindingConsole::updateControlsOnConsoleState() mShowRenderWaterPlaneCheckBox->setEnabled(FALSE); mShowXRayCheckBox->setEnabled(FALSE); mViewCharactersButton->setEnabled(TRUE); - mEditTestTabContainer->selectTab(0); mTestTab->setEnabled(FALSE); mCtrlClickLabel->setEnabled(FALSE); mShiftClickLabel->setEnabled(FALSE); @@ -1028,44 +931,6 @@ void LLFloaterPathfindingConsole::cleanupRenderableRestoreItems() } } -void LLFloaterPathfindingConsole::setAgentState(LLPathfindingManager::EAgentState pAgentState) -{ - switch (LLPathfindingManager::getInstance()->getLastKnownNonErrorAgentState()) - { - case LLPathfindingManager::kAgentStateUnknown : - case LLPathfindingManager::kAgentStateNotEnabled : - mEditTab->setEnabled(FALSE); - mUnfreezeLabel->setEnabled(FALSE); - mUnfreezeButton->setEnabled(FALSE); - mLinksetsLabel->setEnabled(FALSE); - mLinksetsButton->setEnabled(FALSE); - mFreezeLabel->setEnabled(FALSE); - mFreezeButton->setEnabled(FALSE); - break; - case LLPathfindingManager::kAgentStateFrozen : - mEditTab->setEnabled(TRUE); - mUnfreezeLabel->setEnabled(TRUE); - mUnfreezeButton->setEnabled(TRUE); - mLinksetsLabel->setEnabled(FALSE); - mLinksetsButton->setEnabled(FALSE); - mFreezeLabel->setEnabled(FALSE); - mFreezeButton->setEnabled(FALSE); - break; - case LLPathfindingManager::kAgentStateUnfrozen : - mEditTab->setEnabled(TRUE); - mUnfreezeLabel->setEnabled(FALSE); - mUnfreezeButton->setEnabled(FALSE); - mLinksetsLabel->setEnabled(TRUE); - mLinksetsButton->setEnabled(TRUE); - mFreezeLabel->setEnabled(TRUE); - mFreezeButton->setEnabled(TRUE); - break; - default : - llassert(0); - break; - } -} - void LLFloaterPathfindingConsole::switchIntoTestPathMode() { if (LLPathingLib::getInstance() != NULL) diff --git a/indra/newview/llfloaterpathfindingconsole.h b/indra/newview/llfloaterpathfindingconsole.h index edbeae2012..2529b241bf 100644 --- a/indra/newview/llfloaterpathfindingconsole.h +++ b/indra/newview/llfloaterpathfindingconsole.h @@ -31,7 +31,6 @@ #include "llfloater.h" #include "llhandle.h" #include "llpathinglib.h" -#include "llpathfindingmanager.h" #include "llpathfindingnavmeshzone.h" #include "llpathfindingpathtool.h" @@ -43,7 +42,6 @@ class LLSliderCtrl; class LLLineEditor; class LLTextBase; class LLCheckBoxCtrl; -class LLTabContainer; class LLComboBox; class LLButton; class LLToolset; @@ -120,16 +118,11 @@ private: void onShowNavMeshSet(); void onShowWalkabilitySet(); void onViewCharactersClicked(); - void onTabSwitch(); - void onUnfreezeClicked(); - void onFreezeClicked(); - void onViewEditLinksetClicked(); void onCharacterWidthSet(); void onCharacterTypeSwitch(); void onClearPathClicked(); void onNavMeshZoneCB(LLPathfindingNavMeshZone::ENavMeshZoneRequestStatus pNavMeshZoneRequestStatus); - void onAgentStateCB(LLPathfindingManager::EAgentState pAgentState); void onRegionBoundaryCross(); void onPathEvent(); @@ -145,8 +138,6 @@ private: void initializeNavMeshZoneForCurrentRegion(); - void setAgentState(LLPathfindingManager::EAgentState pAgentState); - void switchIntoTestPathMode(); void switchOutOfTestPathMode(); void updateCharacterWidth(); @@ -177,15 +168,7 @@ private: LLTextBase *mPathfindingViewerStatus; LLTextBase *mPathfindingSimulatorStatus; LLButton *mViewCharactersButton; - LLTabContainer *mEditTestTabContainer; - LLPanel *mEditTab; LLPanel *mTestTab; - LLTextBase *mUnfreezeLabel; - LLButton *mUnfreezeButton; - LLTextBase *mLinksetsLabel; - LLButton *mLinksetsButton; - LLTextBase *mFreezeLabel; - LLButton *mFreezeButton; LLTextBase *mCtrlClickLabel; LLTextBase *mShiftClickLabel; LLTextBase *mCharacterWidthLabel; @@ -200,7 +183,6 @@ private: LLPathfindingNavMeshZone mNavMeshZone; bool mIsNavMeshUpdating; - LLPathfindingManager::agent_state_slot_t mAgentStateSlot; boost::signals2::connection mRegionBoundarySlot; boost::signals2::connection mTeleportFailedSlot; LLPathfindingPathTool::path_event_slot_t mPathEventSlot; diff --git a/indra/newview/llpathfindingcharacterlist.cpp b/indra/newview/llpathfindingcharacterlist.cpp index 15eaac771f..ac1fb15be9 100644 --- a/indra/newview/llpathfindingcharacterlist.cpp +++ b/indra/newview/llpathfindingcharacterlist.cpp @@ -47,12 +47,10 @@ LLPathfindingCharacterList::LLPathfindingCharacterList() LLPathfindingCharacterList::LLPathfindingCharacterList(const LLSD& pCharacterListData) : LLPathfindingObjectList() { - if ( LLPathingLib::getInstance() == NULL ) + if (LLPathingLib::getInstance() != NULL) { - LLPathingLib::initSystem(); + LLPathingLib::getInstance()->cleanupPhysicsCapsuleRepResiduals( ); } - - LLPathingLib::getInstance()->cleanupPhysicsCapsuleRepResiduals( ); parseCharacterListData(pCharacterListData); } diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 5e2a9e1213..ae1c228c69 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -45,6 +45,7 @@ #include "llpathfindingnavmesh.h" #include "llpathfindingnavmeshstatus.h" #include "llpathfindingobject.h" +#include "llpathinglib.h" #include "llsingleton.h" #include "llsd.h" #include "lltrans.h" @@ -273,6 +274,14 @@ LLPathfindingManager::~LLPathfindingManager() { } +void LLPathfindingManager::initSystem() +{ + if (LLPathingLib::getInstance() == NULL) + { + LLPathingLib::initSystem(); + } +} + bool LLPathfindingManager::isPathfindingEnabledForCurrentRegion() const { return isPathfindingEnabledForRegion(getCurrentRegion()); @@ -292,6 +301,11 @@ bool LLPathfindingManager::isPathfindingNavMeshVersioningEnabledForCurrentRegion } #endif // DEPRECATED_UNVERSIONED_NAVMESH +bool LLPathfindingManager::isPathfindingDebugEnabled() const +{ + return (LLPathingLib::getInstance() != NULL); +} + bool LLPathfindingManager::isAllowViewTerrainProperties() const { LLViewerRegion* region = getCurrentRegion(); diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index 1ae6e06b40..24b58d1fe9 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -74,12 +74,16 @@ public: LLPathfindingManager(); virtual ~LLPathfindingManager(); + void initSystem(); + bool isPathfindingEnabledForCurrentRegion() const; bool isPathfindingEnabledForRegion(LLViewerRegion *pRegion) const; #ifdef DEPRECATED_UNVERSIONED_NAVMESH bool isPathfindingNavMeshVersioningEnabledForCurrentRegionXXX() const; #endif // DEPRECATED_UNVERSIONED_NAVMESH + bool isPathfindingDebugEnabled() const; + bool isAllowViewTerrainProperties() const; LLPathfindingNavMesh::navmesh_slot_t registerNavMeshListenerForRegion(LLViewerRegion *pRegion, LLPathfindingNavMesh::navmesh_callback_t pNavMeshCallback); diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index 8c330559a9..1e92f6b131 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -32,6 +32,7 @@ #include "lluuid.h" #include "llpathfindingnavmesh.h" #include "llpathfindingnavmeshstatus.h" +#include "llviewerregion.h" #include diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp index bc5a265111..5567869a1c 100644 --- a/indra/newview/llpathfindingpathtool.cpp +++ b/indra/newview/llpathfindingpathtool.cpp @@ -54,11 +54,6 @@ LLPathfindingPathTool::LLPathfindingPathTool() mIsMiddleMouseButtonHeld(false), mIsRightMouseButtonHeld(false) { - if (!LLPathingLib::getInstance()) - { - LLPathingLib::initSystem(); - } - setCharacterWidth(1.0f); setCharacterType(mCharacterType); } diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp index 0ac8c1fe39..6bee373181 100644 --- a/indra/newview/llstartup.cpp +++ b/indra/newview/llstartup.cpp @@ -186,6 +186,7 @@ #include "llappearancemgr.h" #include "llavatariconctrl.h" #include "llvoicechannel.h" +#include "llpathfindingmanager.h" #include "lllogin.h" #include "llevents.h" @@ -1968,6 +1969,9 @@ bool idle_startup() } } + llassert(LLPathfindingManager::getInstance() != NULL); + LLPathfindingManager::getInstance()->initSystem(); + display_startup(); //DEV-17797. get null folder. Any items found here moved to Lost and Found LLInventoryModelBackgroundFetch::instance().findLostItems(); diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5a0239c2e4..69421d240b 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -4802,7 +4802,15 @@ class LLToolsEnablePathfinding : public view_listener_t { bool handleEvent(const LLSD& userdata) { - return LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion(); + return (LLPathfindingManager::getInstance() != NULL) && LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion(); + } +}; + +class LLToolsEnablePathfindingDebug : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + return (LLPathfindingManager::getInstance() != NULL) && LLPathfindingManager::getInstance()->isPathfindingEnabledForCurrentRegion() && LLPathfindingManager::getInstance()->isPathfindingDebugEnabled(); } }; @@ -8201,6 +8209,7 @@ void initialize_menus() view_listener_t::addMenu(new LLToolsEnableSaveToObjectInventory(), "Tools.EnableSaveToObjectInventory"); view_listener_t::addMenu(new LLToolsEnablePathfinding(), "Tools.EnablePathfinding"); + view_listener_t::addMenu(new LLToolsEnablePathfindingDebug(), "Tools.EnablePathfindingDebug"); // Help menu // most items use the ShowFloater method diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml index 54d44be015..a9815dcb00 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_console.xml @@ -9,7 +9,7 @@ reuse_instance="true" save_rect="true" single_instance="true" - title="Pathfinding edit / test" + title="Pathfinding debug" width="456"> Cannot find pathing library implementation. @@ -233,93 +233,6 @@ top="14" height="268" width="218"> - - - Allow object / terrain changes: - -