summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/lluilistener.cpp10
-rw-r--r--indra/newview/lluilistener.h2
-rw-r--r--indra/newview/scripts/lua/require/UI.lua23
-rw-r--r--indra/newview/scripts/lua/test_luafloater_demo.lua (renamed from indra/newview/scripts/lua/test_luafloater_demo2.lua)0
-rw-r--r--indra/newview/scripts/lua/test_luafloater_gesture_list.lua (renamed from indra/newview/scripts/lua/test_luafloater_gesture_list2.lua)0
5 files changed, 35 insertions, 0 deletions
diff --git a/indra/newview/lluilistener.cpp b/indra/newview/lluilistener.cpp
index 6d1d5ac735..07a8b45f89 100644
--- a/indra/newview/lluilistener.cpp
+++ b/indra/newview/lluilistener.cpp
@@ -39,6 +39,7 @@
#include "llui.h" // getRootView(), resolvePath()
#include "lluictrl.h"
#include "llerror.h"
+#include "llviewermenufile.h" // close_all_windows()
extern LLMenuBarGL* gMenuBarView;
@@ -124,6 +125,10 @@ LLUIListener::LLUIListener():
"Return the table of Toolbar buttons names",
&LLUIListener::getToolbarBtnNames,
llsd::map("reply", LLSD()));
+
+ add("closeAllFloaters",
+ "Close all the floaters",
+ &LLUIListener::closeAllFloaters);
}
typedef LLUICtrl::CommitCallbackInfo cb_info;
@@ -348,3 +353,8 @@ void LLUIListener::getToolbarBtnNames(const LLSD &event) const
{
Response response(llsd::map("cmd_names", LLCommandManager::instance().getCommandNames()), event);
}
+
+void LLUIListener::closeAllFloaters(const LLSD &event) const
+{
+ close_all_windows();
+}
diff --git a/indra/newview/lluilistener.h b/indra/newview/lluilistener.h
index f4bee00807..bae6724b3d 100644
--- a/indra/newview/lluilistener.h
+++ b/indra/newview/lluilistener.h
@@ -56,6 +56,8 @@ private:
void removeToolbarBtn(const LLSD &event) const;
void getToolbarBtnNames(const LLSD &event) const;
+ void closeAllFloaters(const LLSD &event) const;
+
F64 mLastUntrustedThrottle {0};
F64 mLastMinThrottle {0};
};
diff --git a/indra/newview/scripts/lua/require/UI.lua b/indra/newview/scripts/lua/require/UI.lua
index 30b7189c3c..df77eb2b56 100644
--- a/indra/newview/scripts/lua/require/UI.lua
+++ b/indra/newview/scripts/lua/require/UI.lua
@@ -199,4 +199,27 @@ function UI.getToolbarBtnNames()
return leap.request('UI', {op = 'getToolbarBtnNames'}).cmd_names
end
+-- ***************************************************************************
+-- Floaters
+-- ***************************************************************************
+function UI.showFloater(floater_name)
+ leap.send("LLFloaterReg", {op = "showInstance", name = floater_name})
+end
+
+function UI.hideFloater(floater_name)
+ leap.send("LLFloaterReg", {op = "hideInstance", name = floater_name})
+end
+
+function UI.toggleFloater(floater_name)
+ leap.send("LLFloaterReg", {op = "toggleInstance", name = floater_name})
+end
+
+function UI.isFloaterVisible(floater_name)
+ return leap.request("LLFloaterReg", {op = "instanceVisible", name = floater_name}).visible
+end
+
+function UI.closeAllFloaters()
+ return leap.send("UI", {op = "closeAllFloaters"})
+end
+
return UI
diff --git a/indra/newview/scripts/lua/test_luafloater_demo2.lua b/indra/newview/scripts/lua/test_luafloater_demo.lua
index 3903d01e65..3903d01e65 100644
--- a/indra/newview/scripts/lua/test_luafloater_demo2.lua
+++ b/indra/newview/scripts/lua/test_luafloater_demo.lua
diff --git a/indra/newview/scripts/lua/test_luafloater_gesture_list2.lua b/indra/newview/scripts/lua/test_luafloater_gesture_list.lua
index bd397ef2a6..bd397ef2a6 100644
--- a/indra/newview/scripts/lua/test_luafloater_gesture_list2.lua
+++ b/indra/newview/scripts/lua/test_luafloater_gesture_list.lua