From a087c4dfbb0823c66f21e3587de9d57937333e32 Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 11 Jun 2012 15:00:33 -0700 Subject: PATH-710: Removing the pathfinding basic floater and supporting class. --- indra/newview/CMakeLists.txt | 2 - indra/newview/app_settings/commands.xml | 10 -- indra/newview/llfloaterpathfindingbasic.cpp | 167 --------------------- indra/newview/llfloaterpathfindingbasic.h | 71 --------- indra/newview/llviewerfloaterreg.cpp | 2 - indra/newview/skins/default/textures/textures.xml | 1 - .../default/xui/en/floater_pathfinding_basic.xml | 79 ---------- indra/newview/skins/default/xui/en/menu_viewer.xml | 9 -- indra/newview/skins/default/xui/en/strings.xml | 2 - 9 files changed, 343 deletions(-) delete mode 100644 indra/newview/llfloaterpathfindingbasic.cpp delete mode 100644 indra/newview/llfloaterpathfindingbasic.h delete mode 100644 indra/newview/skins/default/xui/en/floater_pathfinding_basic.xml (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 0be289052c..b47615b198 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -218,7 +218,6 @@ set(viewer_SOURCE_FILES llfloaterobjectweights.cpp llfloateropenobject.cpp llfloateroutbox.cpp - llfloaterpathfindingbasic.cpp llfloaterpathfindingcharacters.cpp llfloaterpathfindingconsole.cpp llfloaterpathfindinglinksets.cpp @@ -790,7 +789,6 @@ set(viewer_HEADER_FILES llfloaterobjectweights.h llfloateropenobject.h llfloateroutbox.h - llfloaterpathfindingbasic.h llfloaterpathfindingcharacters.h llfloaterpathfindingconsole.h llfloaterpathfindinglinksets.h diff --git a/indra/newview/app_settings/commands.xml b/indra/newview/app_settings/commands.xml index ff4d9ceb93..cb6bdc627f 100644 --- a/indra/newview/app_settings/commands.xml +++ b/indra/newview/app_settings/commands.xml @@ -157,16 +157,6 @@ is_running_function="Floater.IsOpen" is_running_parameters="people" /> - - -//--------------------------------------------------------------------------- -// LLFloaterPathfindingBasic -//--------------------------------------------------------------------------- - -BOOL LLFloaterPathfindingBasic::postBuild() -{ - mStatusText = findChild("status_label"); - llassert(mStatusText != NULL); - - mUnfreezeLabel = findChild("unfreeze_label"); - llassert(mUnfreezeLabel != NULL); - - mUnfreezeButton = findChild("enter_unfrozen_mode"); - llassert(mUnfreezeButton != NULL); - mUnfreezeButton->setCommitCallback(boost::bind(&LLFloaterPathfindingBasic::onUnfreezeClicked, this)); - - mFreezeLabel = findChild("freeze_label"); - llassert(mFreezeLabel != NULL); - - mFreezeButton = findChild("enter_frozen_mode"); - llassert(mFreezeButton != NULL); - mFreezeButton->setCommitCallback(boost::bind(&LLFloaterPathfindingBasic::onFreezeClicked, this)); - - return LLFloater::postBuild(); -} - -void LLFloaterPathfindingBasic::onOpen(const LLSD& pKey) -{ - LLFloater::onOpen(pKey); - - if (!mAgentStateSlot.connected()) - { - mAgentStateSlot = LLPathfindingManager::getInstance()->registerAgentStateListener(boost::bind(&LLFloaterPathfindingBasic::onAgentStateCB, this, _1)); - } - setAgentState(LLPathfindingManager::getInstance()->getAgentState()); -} - -void LLFloaterPathfindingBasic::onClose(bool pIsAppQuitting) -{ - if (mAgentStateSlot.connected()) - { - mAgentStateSlot.disconnect(); - } - - LLFloater::onClose(pIsAppQuitting); -} - -LLFloaterPathfindingBasic::LLFloaterPathfindingBasic(const LLSD& pSeed) - : LLFloater(pSeed), - mStatusText(NULL), - mUnfreezeLabel(NULL), - mUnfreezeButton(NULL), - mFreezeLabel(NULL), - mFreezeButton(NULL), - mAgentStateSlot() -{ -} - -LLFloaterPathfindingBasic::~LLFloaterPathfindingBasic() -{ -} - -void LLFloaterPathfindingBasic::onUnfreezeClicked() -{ - mUnfreezeButton->setEnabled(FALSE); - LLPathfindingManager::getInstance()->requestSetAgentState(LLPathfindingManager::kAgentStateUnfrozen); -} - -void LLFloaterPathfindingBasic::onFreezeClicked() -{ - mUnfreezeButton->setEnabled(FALSE); - LLPathfindingManager::getInstance()->requestSetAgentState(LLPathfindingManager::kAgentStateFrozen); -} - -void LLFloaterPathfindingBasic::onAgentStateCB(LLPathfindingManager::EAgentState pAgentState) -{ - setAgentState(pAgentState); -} - -void LLFloaterPathfindingBasic::setAgentState(LLPathfindingManager::EAgentState pAgentState) -{ - static const LLColor4 errorColor = LLUIColorTable::instance().getColor("PathfindingErrorColor"); - LLStyle::Params styleParams; - - switch (pAgentState) - { - case LLPathfindingManager::kAgentStateUnknown : - mStatusText->setVisible(TRUE); - mStatusText->setText((LLStringExplicit)getString("status_querying_state"), styleParams); - break; - case LLPathfindingManager::kAgentStateNotEnabled : - mStatusText->setVisible(TRUE); - styleParams.color = errorColor; - mStatusText->setText((LLStringExplicit)getString("status_pathfinding_not_enabled"), styleParams); - break; - case LLPathfindingManager::kAgentStateError : - mStatusText->setVisible(TRUE); - styleParams.color = errorColor; - mStatusText->setText((LLStringExplicit)getString("status_unable_to_change_state"), styleParams); - break; - default : - mStatusText->setVisible(FALSE); - break; - } - - switch (LLPathfindingManager::getInstance()->getLastKnownNonErrorAgentState()) - { - case LLPathfindingManager::kAgentStateUnknown : - case LLPathfindingManager::kAgentStateNotEnabled : - mUnfreezeLabel->setEnabled(FALSE); - mUnfreezeButton->setEnabled(FALSE); - mFreezeLabel->setEnabled(FALSE); - mFreezeButton->setEnabled(FALSE); - break; - case LLPathfindingManager::kAgentStateFrozen : - mUnfreezeLabel->setEnabled(TRUE); - mUnfreezeButton->setEnabled(TRUE); - mFreezeLabel->setEnabled(FALSE); - mFreezeButton->setEnabled(FALSE); - break; - case LLPathfindingManager::kAgentStateUnfrozen : - mUnfreezeLabel->setEnabled(FALSE); - mUnfreezeButton->setEnabled(FALSE); - mFreezeLabel->setEnabled(TRUE); - mFreezeButton->setEnabled(TRUE); - break; - default : - llassert(0); - break; - } -} diff --git a/indra/newview/llfloaterpathfindingbasic.h b/indra/newview/llfloaterpathfindingbasic.h deleted file mode 100644 index 286985c022..0000000000 --- a/indra/newview/llfloaterpathfindingbasic.h +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @file llfloaterpathfindingbasic.h - * @author William Todd Stinson - * @brief "Pathfinding basic" floater, allowing for basic freezing and unfreezing of the pathfinding avatar mode. - * - * $LicenseInfo:firstyear=2002&license=viewerlgpl$ - * Second Life Viewer Source Code - * Copyright (C) 2010, Linden Research, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; - * version 2.1 of the License only. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - * - * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA - * $/LicenseInfo$ - */ - -#ifndef LL_LLFLOATERPATHFINDINGBASIC_H -#define LL_LLFLOATERPATHFINDINGBASIC_H - -#include "llfloater.h" -#include "llpathfindingmanager.h" - -class LLSD; -class LLTextBase; -class LLButton; - -class LLFloaterPathfindingBasic -: public LLFloater -{ - friend class LLFloaterReg; - -public: - virtual BOOL postBuild(); - virtual void onOpen(const LLSD& pKey); - virtual void onClose(bool pIsAppQuitting); - -protected: - -private: - // Does its own instance management, so clients not allowed - // to allocate or destroy. - LLFloaterPathfindingBasic(const LLSD& pSeed); - virtual ~LLFloaterPathfindingBasic(); - - void onUnfreezeClicked(); - void onFreezeClicked(); - - void onAgentStateCB(LLPathfindingManager::EAgentState pAgentState); - - void setAgentState(LLPathfindingManager::EAgentState pAgentState); - - LLTextBase *mStatusText; - LLTextBase *mUnfreezeLabel; - LLButton *mUnfreezeButton; - LLTextBase *mFreezeLabel; - LLButton *mFreezeButton; - LLPathfindingManager::agent_state_slot_t mAgentStateSlot; -}; - -#endif // LL_LLFLOATERPATHFINDINGBASIC_H diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 12f802b29a..6b7b67dab9 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -84,7 +84,6 @@ #include "llfloaterobjectweights.h" #include "llfloateropenobject.h" #include "llfloateroutbox.h" -#include "llfloaterpathfindingbasic.h" #include "llfloaterpathfindingcharacters.h" #include "llfloaterpathfindinglinksets.h" #include "llfloaterpathfindingconsole.h" @@ -247,7 +246,6 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("outgoing_call", "floater_outgoing_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterPayUtil::registerFloater(); - LLFloaterReg::add("pathfinding_basic", "floater_pathfinding_basic.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("pathfinding_characters", "floater_pathfinding_characters.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("pathfinding_linksets", "floater_pathfinding_linksets.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); LLFloaterReg::add("pathfinding_console", "floater_pathfinding_console.xml", (LLFloaterBuildFunc)&LLFloaterReg::build); diff --git a/indra/newview/skins/default/textures/textures.xml b/indra/newview/skins/default/textures/textures.xml index d5d58235a4..e5778c3263 100644 --- a/indra/newview/skins/default/textures/textures.xml +++ b/indra/newview/skins/default/textures/textures.xml @@ -142,7 +142,6 @@ with the same filename but different name - diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_basic.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_basic.xml deleted file mode 100644 index 7af40bbff6..0000000000 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_basic.xml +++ /dev/null @@ -1,79 +0,0 @@ - - - This region is not enabled for pathfinding. - Unable to change modes successfully. - Checking status ... - - - - Allow object / terrain changes: - -