summaryrefslogtreecommitdiff
path: root/indra/newview/llfloaterpathfindingcharacters.h
diff options
context:
space:
mode:
authorTodd Stinson <stinson@lindenlab.com>2012-03-27 19:05:29 -0700
committerTodd Stinson <stinson@lindenlab.com>2012-03-27 19:05:29 -0700
commit473da43c1bbc20245b3a74c1adc7c92f91d25807 (patch)
treea29a9e6e18d496c6cd195f4c3090db7841c1c997 /indra/newview/llfloaterpathfindingcharacters.h
parent083c81f53f79f53aafdb380a178be081ae461018 (diff)
Refactoring the characters floater code.
Diffstat (limited to 'indra/newview/llfloaterpathfindingcharacters.h')
-rw-r--r--indra/newview/llfloaterpathfindingcharacters.h123
1 files changed, 58 insertions, 65 deletions
diff --git a/indra/newview/llfloaterpathfindingcharacters.h b/indra/newview/llfloaterpathfindingcharacters.h
index c381492784..a242a5503f 100644
--- a/indra/newview/llfloaterpathfindingcharacters.h
+++ b/indra/newview/llfloaterpathfindingcharacters.h
@@ -1,29 +1,29 @@
/**
- * @file llfloaterpathfindingcharacters.h
- * @author William Todd Stinson
- * @brief "Pathfinding linksets" floater, allowing manipulation of the Havok AI pathfinding settings.
- *
- * $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$
- */
+* @file llfloaterpathfindingcharacters.h
+* @author William Todd Stinson
+* @brief "Pathfinding characters" floater, allowing for identification of pathfinding characters and their cpu usage.
+*
+* $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_LLFLOATERPATHFINDINGCHARACTERS_H
#define LL_LLFLOATERPATHFINDINGCHARACTERS_H
@@ -31,9 +31,10 @@
#include <string>
#include <map>
-#include "llhandle.h"
#include "llfloater.h"
#include "llpathfindingcharacter.h"
+#include "llpathfindingcharacterlist.h"
+#include "llpathfindingmanager.h"
#include "llselectmgr.h"
#include <boost/signals2.hpp>
@@ -46,27 +47,23 @@ class LLRadioGroup;
class LLButton;
class LLFloaterPathfindingCharacters
-: public LLFloater
+ : public LLFloater
{
friend class LLFloaterReg;
- friend class CharactersGetResponder;
public:
typedef enum
{
- kMessagingInitial,
- kMessagingFetchStarting,
- kMessagingFetchRequestSent,
- kMessagingFetchRequestSent_MultiRequested,
- kMessagingFetchReceived,
- kMessagingFetchError,
+ kMessagingUnknown,
+ kMessagingGetRequestSent,
+ kMessagingGetError,
kMessagingComplete,
- kMessagingServiceNotAvailable
+ kMessagingNotEnabled
} EMessagingState;
virtual BOOL postBuild();
virtual void onOpen(const LLSD& pKey);
- virtual void onClose(bool app_quitting);
+ virtual void onClose(bool pAppQuitting);
virtual void draw();
static void openCharactersViewer();
@@ -77,38 +74,31 @@ public:
protected:
private:
- typedef std::map<std::string, LLPathfindingCharacter> PathfindingCharacterMap;
-
- LLRootHandle<LLFloaterPathfindingCharacters> mSelfHandle;
- PathfindingCharacterMap mPathfindingCharacters;
- EMessagingState mMessagingState;
- LLScrollListCtrl *mCharactersScrollList;
- LLTextBase *mCharactersStatus;
- LLTextBase *mLabelActions;
- LLCheckBoxCtrl *mShowBeaconCheckBox;
- LLButton *mTakeBtn;
- LLButton *mTakeCopyBtn;
- LLButton *mReturnBtn;
- LLButton *mDeleteBtn;
- LLButton *mTeleportBtn;
- LLObjectSelectionHandle mCharacterSelection;
- boost::signals2::connection mSelectionUpdateSlot;
+ LLScrollListCtrl *mCharactersScrollList;
+ LLTextBase *mCharactersStatus;
+ LLButton *mRefreshListButton;
+ LLButton *mSelectAllButton;
+ LLButton *mSelectNoneButton;
+ LLCheckBoxCtrl *mShowBeaconCheckBox;
+ LLButton *mTakeButton;
+ LLButton *mTakeCopyButton;
+ LLButton *mReturnButton;
+ LLButton *mDeleteButton;
+ LLButton *mTeleportButton;
+
+ EMessagingState mMessagingState;
+ LLPathfindingCharacterListPtr mCharacterListPtr;
+ LLObjectSelectionHandle mCharacterSelection;
+ boost::signals2::connection mSelectionUpdateSlot;
// Does its own instance management, so clients not allowed
// to allocate or destroy.
LLFloaterPathfindingCharacters(const LLSD& pSeed);
virtual ~LLFloaterPathfindingCharacters();
- void sendCharactersDataGetRequest();
- void handleCharactersDataGetReply(const LLSD& pCharactersData);
- void handleCharactersDataGetError(const std::string& pURL, const std::string& pErrorReason);
-
- std::string getRegionName() const;
- std::string getCapabilityURL() const;
-
- void parseCharactersData(const LLSD &pCharactersData);
-
void setMessagingState(EMessagingState pMessagingState);
+ void requestGetCharacters();
+ void handleNewCharacters(LLPathfindingManager::ERequestStatus pCharacterRequestStatus, LLPathfindingCharacterListPtr pCharacterListPtr);
void onCharactersSelectionChange();
void onRefreshCharactersClicked();
@@ -120,14 +110,17 @@ private:
void onDeleteCharactersClicked();
void onTeleportCharacterToMeClicked();
- void updateCharactersList();
void selectAllCharacters();
void selectNoneCharacters();
+ void clearCharacters();
- void updateCharactersStatusMessage();
+ void updateControls();
+ void updateScrollList();
+ LLSD buildCharacterScrollListElement(const LLPathfindingCharacterPtr pCharacterPtr) const;
- void updateActionFields();
- void setEnableActionFields(BOOL pEnabled);
+ void updateStatusMessage();
+ void updateEnableStateOnListActions();
+ void updateEnableStateOnEditFields();
};
#endif // LL_LLFLOATERPATHFINDINGCHARACTERS_H