summaryrefslogtreecommitdiff
path: root/indra/newview/lltoolmgr.cpp
diff options
context:
space:
mode:
authorAndrey Lihatskiy <alihatskiy@productengine.com>2026-07-16 19:22:02 +0300
committerAndrey Lihatskiy <alihatskiy@productengine.com>2026-07-16 19:22:02 +0300
commit72581ab99d2e891821f5266330ecd8a58a277eb7 (patch)
tree528629c8943a400bc1a6186b49cdabdb4b8ed507 /indra/newview/lltoolmgr.cpp
parentf5e788b1b4ff5fb45f20ee5fa5daad7cca42069f (diff)
parent1577ca1724787fdc0f0317ade3dab8ea3c5df7e7 (diff)
Merge branch 'release/26.3' into marchcat/slua-26.3
# Conflicts: # .github/workflows/build.yaml # autobuild.xml # indra/llcommon/llsys.cpp # indra/llrender/llimagegl.cpp # indra/llrender/llimagegl.h # indra/newview/CMakeLists.txt # indra/newview/featuretable.txt # indra/newview/featuretable_linux.txt # indra/newview/featuretable_mac.txt # indra/newview/llvoavatar.cpp # indra/newview/llvoiceclient.cpp # indra/newview/llvoicevivox.cpp # indra/newview/viewer_manifest.py
Diffstat (limited to 'indra/newview/lltoolmgr.cpp')
-rw-r--r--indra/newview/lltoolmgr.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/indra/newview/lltoolmgr.cpp b/indra/newview/lltoolmgr.cpp
index 07963a7bed..c7e6f774dc 100644
--- a/indra/newview/lltoolmgr.cpp
+++ b/indra/newview/lltoolmgr.cpp
@@ -57,6 +57,7 @@
#include "llviewerjoystick.h"
#include "llviewermenu.h"
#include "llviewerparcelmgr.h"
+#include "lleventapi.h"
// Used when app not active to avoid processing hover.
@@ -69,6 +70,67 @@ LLToolset* gMouselookToolset = NULL;
LLToolset* gFaceEditToolset = NULL;
/////////////////////////////////////////////////////
+// LLToolMgrListener
+
+class LLToolMgrListener: public LLEventAPI
+{
+public:
+ LLToolMgrListener():
+ LLEventAPI("LLToolMgr",
+ "LLToolMgr listener for tool management operations")
+ {
+ add("openBuildFloater",
+ "Open the build floater by toggling build mode",
+ &LLToolMgrListener::openFloater);
+ add("selectTool",
+ "Select the specified tool by [\"tool_name\"]. Valid tool names: Focus, Move, Edit, Create, Land",
+ &LLToolMgrListener::selectTool);
+ }
+
+private:
+ void openFloater(const LLSD& event) const
+ {
+ LLToolMgr::getInstance()->toggleBuildMode(LLSD("build"));
+ }
+
+ void selectTool(const LLSD& event) const
+ {
+ if (!event.has("tool_name"))
+ {
+ LL_WARNS() << "selectTool: called without tool_name" << LL_ENDL;
+ return;
+ }
+
+ static const std::unordered_map<std::string, S32> tool_indices = {
+ {"focus", 1},
+ {"move", 2},
+ {"edit", 3},
+ {"create", 4},
+ {"land", 5}
+ };
+
+ const std::string tool_name = utf8str_tolower(event["tool_name"].asString());
+ const auto it = tool_indices.find(tool_name);
+ if (it == tool_indices.end())
+ {
+ LL_WARNS() << "selectTool: unknown tool_name: " << std::quoted(tool_name) << LL_ENDL;
+ return;
+ }
+
+ LLToolset* current_toolset = LLToolMgr::getInstance()->getCurrentToolset();
+ if (!current_toolset)
+ {
+ LL_WARNS() << "selectTool: no current toolset available" << LL_ENDL;
+ return;
+ }
+
+ current_toolset->selectToolByIndex(it->second);
+ }
+};
+
+static LLToolMgrListener sToolMgrListener;
+
+/////////////////////////////////////////////////////
// LLToolMgr
LLToolMgr::LLToolMgr()