From bf1c1947d752e1f4d18d77b3190691d8244bc91f Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 25 Jun 2012 14:28:21 -0700 Subject: PATH-743: Updating the cursors for path testing mode to final designs. --- indra/newview/CMakeLists.txt | 2 ++ indra/newview/llpathfindingpathtool.cpp | 22 +++++++++++++++++---- indra/newview/res/lltoolpathfinding.cur | Bin 4286 -> 2238 bytes indra/newview/res/lltoolpathfindingpathend.cur | Bin 4286 -> 2238 bytes indra/newview/res/lltoolpathfindingpathendadd.cur | Bin 0 -> 2238 bytes indra/newview/res/lltoolpathfindingpathstart.cur | Bin 4286 -> 2238 bytes .../newview/res/lltoolpathfindingpathstartadd.cur | Bin 0 -> 2238 bytes indra/newview/res/viewerRes.rc | 4 +++- 8 files changed, 23 insertions(+), 5 deletions(-) create mode 100644 indra/newview/res/lltoolpathfindingpathendadd.cur create mode 100644 indra/newview/res/lltoolpathfindingpathstartadd.cur (limited to 'indra/newview') diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 6358464fb0..ac0b0c0351 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1342,7 +1342,9 @@ if (WINDOWS) res/lltoolpan.cur res/lltoolpathfinding.cur res/lltoolpathfindingpathend.cur + res/lltoolpathfindingpathendadd.cur res/lltoolpathfindingpathstart.cur + res/lltoolpathfindingpathstartadd.cur res/lltoolpipette.cur res/lltoolrotate.cur res/lltoolscale.cur diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp index 82426920d8..fde2257777 100644 --- a/indra/newview/llpathfindingpathtool.cpp +++ b/indra/newview/llpathfindingpathtool.cpp @@ -72,11 +72,11 @@ BOOL LLPathfindingPathTool::handleMouseDown(S32 pX, S32 pY, MASK pMask) { if (isPointAModKeys(pMask)) { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START); + gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD); } else if (isPointBModKeys(pMask)) { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END); + gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD); } computeFinalPoints(pX, pY, pMask); mIsLeftMouseButtonHeld = true; @@ -169,11 +169,25 @@ BOOL LLPathfindingPathTool::handleHover(S32 pX, S32 pY, MASK pMask) { if (isPointAModKeys(pMask)) { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START); + if (mIsLeftMouseButtonHeld) + { + gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD); + } + else + { + gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START); + } } else if (isPointBModKeys(pMask)) { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END); + if (mIsLeftMouseButtonHeld) + { + gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD); + } + else + { + gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END); + } } computeTempPoints(pX, pY, pMask); returnVal = TRUE; diff --git a/indra/newview/res/lltoolpathfinding.cur b/indra/newview/res/lltoolpathfinding.cur index 40c5a40905..2aba2daa45 100644 Binary files a/indra/newview/res/lltoolpathfinding.cur and b/indra/newview/res/lltoolpathfinding.cur differ diff --git a/indra/newview/res/lltoolpathfindingpathend.cur b/indra/newview/res/lltoolpathfindingpathend.cur index df8d56d205..e951a6956b 100644 Binary files a/indra/newview/res/lltoolpathfindingpathend.cur and b/indra/newview/res/lltoolpathfindingpathend.cur differ diff --git a/indra/newview/res/lltoolpathfindingpathendadd.cur b/indra/newview/res/lltoolpathfindingpathendadd.cur new file mode 100644 index 0000000000..0bf3201b23 Binary files /dev/null and b/indra/newview/res/lltoolpathfindingpathendadd.cur differ diff --git a/indra/newview/res/lltoolpathfindingpathstart.cur b/indra/newview/res/lltoolpathfindingpathstart.cur index 5c38bb6c00..fecc716990 100644 Binary files a/indra/newview/res/lltoolpathfindingpathstart.cur and b/indra/newview/res/lltoolpathfindingpathstart.cur differ diff --git a/indra/newview/res/lltoolpathfindingpathstartadd.cur b/indra/newview/res/lltoolpathfindingpathstartadd.cur new file mode 100644 index 0000000000..45e23e5161 Binary files /dev/null and b/indra/newview/res/lltoolpathfindingpathstartadd.cur differ diff --git a/indra/newview/res/viewerRes.rc b/indra/newview/res/viewerRes.rc index 0b469c8d81..df75f3f697 100644 --- a/indra/newview/res/viewerRes.rc +++ b/indra/newview/res/viewerRes.rc @@ -124,7 +124,9 @@ TOOLOPEN CURSOR "toolopen.cur" TOOLSIT CURSOR "toolsit.cur" TOOLPATHFINDING CURSOR "lltoolpathfinding.cur" TOOLPATHFINDINGPATHSTART CURSOR "lltoolpathfindingpathstart.cur" -TOOLPATHFINDINGPATHEND CURSOR "lltoolpathfindingpathend.cur" +TOOLPATHFINDINGPATHSTARTADD CURSOR "lltoolpathfindingpathstartadd.cur" +TOOLPATHFINDINGPATHEND CURSOR "lltoolpathfindingpathend.cur" +TOOLPATHFINDINGPATHENDADD CURSOR "lltoolpathfindingpathendadd.cur" TOOLNO CURSOR "llno.cur" ///////////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 9b46e116a92ee4d005ae3e1d66a4fbaa270770ec Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 25 Jun 2012 14:44:09 -0700 Subject: PATH-743: Small code refactoring for clean-up. --- indra/newview/llpathfindingpathtool.cpp | 36 ++++++--------------------------- 1 file changed, 6 insertions(+), 30 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llpathfindingpathtool.cpp b/indra/newview/llpathfindingpathtool.cpp index fde2257777..6cf90addab 100644 --- a/indra/newview/llpathfindingpathtool.cpp +++ b/indra/newview/llpathfindingpathtool.cpp @@ -70,14 +70,9 @@ BOOL LLPathfindingPathTool::handleMouseDown(S32 pX, S32 pY, MASK pMask) { if (isAnyPathToolModKeys(pMask)) { - if (isPointAModKeys(pMask)) - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD); - } - else if (isPointBModKeys(pMask)) - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD); - } + gViewerWindow->setCursor(isPointAModKeys(pMask) + ? UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD + : UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD); computeFinalPoints(pX, pY, pMask); mIsLeftMouseButtonHeld = true; setMouseCapture(TRUE); @@ -167,28 +162,9 @@ BOOL LLPathfindingPathTool::handleHover(S32 pX, S32 pY, MASK pMask) if (!mIsMiddleMouseButtonHeld && !mIsRightMouseButtonHeld && isAnyPathToolModKeys(pMask)) { - if (isPointAModKeys(pMask)) - { - if (mIsLeftMouseButtonHeld) - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD); - } - else - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_START); - } - } - else if (isPointBModKeys(pMask)) - { - if (mIsLeftMouseButtonHeld) - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD); - } - else - { - gViewerWindow->setCursor(UI_CURSOR_TOOLPATHFINDING_PATH_END); - } - } + gViewerWindow->setCursor(isPointAModKeys(pMask) + ? (mIsLeftMouseButtonHeld ? UI_CURSOR_TOOLPATHFINDING_PATH_START_ADD : UI_CURSOR_TOOLPATHFINDING_PATH_START) + : (mIsLeftMouseButtonHeld ? UI_CURSOR_TOOLPATHFINDING_PATH_END_ADD : UI_CURSOR_TOOLPATHFINDING_PATH_END)); computeTempPoints(pX, pY, pMask); returnVal = TRUE; } -- cgit v1.2.3 From bf86a697313869627f8b7025ecd68032f2556f6f Mon Sep 17 00:00:00 2001 From: Todd Stinson Date: Mon, 25 Jun 2012 15:37:18 -0700 Subject: PATH-717: Minor UI changes from Leo. Also, adding a notification when attempting to return or delete multiple items. --- indra/newview/llfloaterpathfindingobjects.cpp | 56 ++++++++++++++++++++-- indra/newview/llfloaterpathfindingobjects.h | 3 ++ .../xui/en/floater_pathfinding_characters.xml | 24 +++++----- .../xui/en/floater_pathfinding_linksets.xml | 22 ++++----- .../newview/skins/default/xui/en/notifications.xml | 28 ++++++++++- 5 files changed, 105 insertions(+), 28 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llfloaterpathfindingobjects.cpp b/indra/newview/llfloaterpathfindingobjects.cpp index cd6d0851b9..ea93955a5c 100644 --- a/indra/newview/llfloaterpathfindingobjects.cpp +++ b/indra/newview/llfloaterpathfindingobjects.cpp @@ -41,6 +41,8 @@ #include "llcheckboxctrl.h" #include "llenvmanager.h" #include "llfloater.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" #include "llpathfindingmanager.h" #include "llresmgr.h" #include "llscrolllistctrl.h" @@ -581,14 +583,42 @@ void LLFloaterPathfindingObjects::onTakeCopyClicked() void LLFloaterPathfindingObjects::onReturnClicked() { - handle_object_return(); - requestGetObjects(); + LLNotification::Params params("PathfindingReturnMultipleItems"); + params.functor.function(boost::bind(&LLFloaterPathfindingObjects::handleReturnItemsResponse, this, _1, _2)); + + LLSD substitutions; + int numItems = getNumSelectedObjects(); + substitutions["NUM_ITEMS"] = static_cast(numItems); + params.substitutions = substitutions; + + if (numItems == 1) + { + LLNotifications::getInstance()->forceResponse(params, 0); + } + else if (numItems > 1) + { + LLNotifications::getInstance()->add(params); + } } void LLFloaterPathfindingObjects::onDeleteClicked() { - handle_object_delete(); - requestGetObjects(); + LLNotification::Params params("PathfindingDeleteMultipleItems"); + params.functor.function(boost::bind(&LLFloaterPathfindingObjects::handleDeleteItemsResponse, this, _1, _2)); + + LLSD substitutions; + int numItems = getNumSelectedObjects(); + substitutions["NUM_ITEMS"] = static_cast(numItems); + params.substitutions = substitutions; + + if (numItems == 1) + { + LLNotifications::getInstance()->forceResponse(params, 0); + } + else if (numItems > 1) + { + LLNotifications::getInstance()->add(params); + } } void LLFloaterPathfindingObjects::onTeleportClicked() @@ -768,6 +798,24 @@ void LLFloaterPathfindingObjects::selectScrollListItemsInWorld() } } +void LLFloaterPathfindingObjects::handleReturnItemsResponse(const LLSD &pNotification, const LLSD &pResponse) +{ + if (LLNotificationsUtil::getSelectedOption(pNotification, pResponse) == 0) + { + handle_object_return(); + requestGetObjects(); + } +} + +void LLFloaterPathfindingObjects::handleDeleteItemsResponse(const LLSD &pNotification, const LLSD &pResponse) +{ + if (LLNotificationsUtil::getSelectedOption(pNotification, pResponse) == 0) + { + handle_object_delete(); + requestGetObjects(); + } +} + LLPathfindingObjectPtr LLFloaterPathfindingObjects::findObject(const LLScrollListItem *pListItem) const { LLPathfindingObjectPtr objectPtr; diff --git a/indra/newview/llfloaterpathfindingobjects.h b/indra/newview/llfloaterpathfindingobjects.h index 6d5d6d24b2..84b0f3f3fe 100644 --- a/indra/newview/llfloaterpathfindingobjects.h +++ b/indra/newview/llfloaterpathfindingobjects.h @@ -132,6 +132,9 @@ private: void updateStateOnActionControls(); void selectScrollListItemsInWorld(); + void handleReturnItemsResponse(const LLSD &pNotification, const LLSD &pResponse); + void handleDeleteItemsResponse(const LLSD &pNotification, const LLSD &pResponse); + LLPathfindingObjectPtr findObject(const LLScrollListItem *pListItem) const; LLScrollListCtrl *mObjectsScrollList; diff --git a/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml b/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml index a267902b94..c1f1f60c1b 100644 --- a/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml +++ b/indra/newview/skins/default/xui/en/floater_pathfinding_characters.xml @@ -179,14 +179,24 @@