diff options
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llcommandmanager.cpp | 6 | ||||
-rw-r--r-- | indra/llui/llcommandmanager.h | 2 | ||||
-rw-r--r-- | indra/llui/llfloaterreg.cpp | 5 | ||||
-rw-r--r-- | indra/llui/llfloaterreg.h | 2 | ||||
-rw-r--r-- | indra/llui/llfloaterreglistener.cpp | 11 | ||||
-rw-r--r-- | indra/llui/llfloaterreglistener.h | 1 |
6 files changed, 27 insertions, 0 deletions
diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index 270ec86e01..6c3e676c9b 100644 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -32,6 +32,7 @@ #include "llcommandmanager.h" #include "lldir.h" #include "llerror.h" +#include "llsdutil.h" #include "llxuiparser.h" @@ -189,3 +190,8 @@ bool LLCommandManager::load() return true; } + +LLSD LLCommandManager::getCommandNames() +{ + return llsd::toArray(mCommands, [](const auto &cmd) { return cmd->name(); }); + } diff --git a/indra/llui/llcommandmanager.h b/indra/llui/llcommandmanager.h index 3b2586a5a1..cf2270e658 100644 --- a/indra/llui/llcommandmanager.h +++ b/indra/llui/llcommandmanager.h @@ -192,6 +192,8 @@ public: LLCommand * getCommand(const LLCommandId& commandId); LLCommand * getCommand(const std::string& name); + LLSD getCommandNames(); + static bool load(); protected: diff --git a/indra/llui/llfloaterreg.cpp b/indra/llui/llfloaterreg.cpp index 989ce12d09..8f9268ffcb 100644 --- a/indra/llui/llfloaterreg.cpp +++ b/indra/llui/llfloaterreg.cpp @@ -607,3 +607,8 @@ U32 LLFloaterReg::getVisibleFloaterInstanceCount() return count; } + +LLSD LLFloaterReg::getFloaterNames() +{ + return llsd::toArray(sGroupMap, [](const auto &pair) { return pair.first; }); +} diff --git a/indra/llui/llfloaterreg.h b/indra/llui/llfloaterreg.h index 43f3f7b170..31a334b89c 100644 --- a/indra/llui/llfloaterreg.h +++ b/indra/llui/llfloaterreg.h @@ -153,6 +153,8 @@ public: static void blockShowFloaters(bool value) { sBlockShowFloaters = value;} static U32 getVisibleFloaterInstanceCount(); + + static LLSD getFloaterNames(); }; #endif diff --git a/indra/llui/llfloaterreglistener.cpp b/indra/llui/llfloaterreglistener.cpp index 8316101264..e17f9f4dd6 100644 --- a/indra/llui/llfloaterreglistener.cpp +++ b/indra/llui/llfloaterreglistener.cpp @@ -80,6 +80,11 @@ LLFloaterRegListener::LLFloaterRegListener(): add("getFloaterEvents", "Return the table of Lua Floater events which are send to the script", &LLFloaterRegListener::getLuaFloaterEvents); + + add("getFloaterNames", + "Return the table of all registered floaters", + &LLFloaterRegListener::getFloaterNames, + llsd::map("reply", LLSD())); } void LLFloaterRegListener::getBuildMap(const LLSD& event) const @@ -121,6 +126,12 @@ void LLFloaterRegListener::instanceVisible(const LLSD& event) const event); } + +void LLFloaterRegListener::getFloaterNames(const LLSD &event) const +{ + Response response(llsd::map("floaters", LLFloaterReg::getFloaterNames()), event); +} + void LLFloaterRegListener::clickButton(const LLSD& event) const { // If the caller requests a reply, build the reply. diff --git a/indra/llui/llfloaterreglistener.h b/indra/llui/llfloaterreglistener.h index 9cb0af2de5..2165b1b62f 100644 --- a/indra/llui/llfloaterreglistener.h +++ b/indra/llui/llfloaterreglistener.h @@ -49,6 +49,7 @@ private: void toggleInstance(const LLSD& event) const; void instanceVisible(const LLSD& event) const; void clickButton(const LLSD& event) const; + void getFloaterNames(const LLSD &event) const; void getLuaFloaterEvents(const LLSD &event) const; }; |