summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llviewerwindowlistener.cpp9
-rw-r--r--indra/newview/scripts/lua/require/UI.lua2
-rw-r--r--indra/newview/scripts/lua/test_LLChatListener.lua9
-rw-r--r--indra/newview/scripts/lua/test_luafloater_demo.lua2
-rw-r--r--indra/newview/scripts/lua/test_toolbars.lua4
5 files changed, 17 insertions, 9 deletions
diff --git a/indra/newview/llviewerwindowlistener.cpp b/indra/newview/llviewerwindowlistener.cpp
index 52f413792a..6ce5e68642 100644
--- a/indra/newview/llviewerwindowlistener.cpp
+++ b/indra/newview/llviewerwindowlistener.cpp
@@ -35,6 +35,7 @@
// std headers
// external library headers
// other Linden headers
+#include "llcallbacklist.h"
#include "llviewerwindow.h"
LLViewerWindowListener::LLViewerWindowListener(LLViewerWindow* llviewerwindow):
@@ -46,8 +47,7 @@ LLViewerWindowListener::LLViewerWindowListener(LLViewerWindow* llviewerwindow):
add("saveSnapshot",
"Save screenshot: [\"filename\"] (extension may be specified: bmp, jpeg, png)\n"
"[\"width\"], [\"height\"], [\"showui\"], [\"showhud\"], [\"rebuild\"], [\"type\"]\n"
- "type: \"COLOR\", \"DEPTH\"\n"
- "Post on [\"reply\"] an event containing [\"result\"]",
+ "type: \"COLOR\", \"DEPTH\"\n",
&LLViewerWindowListener::saveSnapshot,
llsd::map("filename", LLSD::String(), "reply", LLSD()));
add("requestReshape",
@@ -117,7 +117,10 @@ void LLViewerWindowListener::saveSnapshot(const LLSD& event) const
{
return response.error(stringize("Unrecognized format. [\"png\"], [\"jpeg\"] or [\"bmp\"] is expected."));
}
- response["result"] = mViewerWindow->saveSnapshot(filename, width, height, showui, showhud, rebuild, type, format);
+ // take snapshot on the main coro
+ doOnIdleOneTime([this, filename, width, height, showui, showhud, rebuild, type, format]()
+ { mViewerWindow->saveSnapshot(filename, width, height, showui, showhud, rebuild, type, format); });
+
}
void LLViewerWindowListener::requestReshape(LLSD const & event_data) const
diff --git a/indra/newview/scripts/lua/require/UI.lua b/indra/newview/scripts/lua/require/UI.lua
index 34f3fb75eb..86aa4095e0 100644
--- a/indra/newview/scripts/lua/require/UI.lua
+++ b/indra/newview/scripts/lua/require/UI.lua
@@ -141,7 +141,7 @@ end
function UI.snapshot(...)
local args = mapargs('filename,width,height,showui,showhud,rebuild,type', ...)
args.op = 'saveSnapshot'
- return leap.request('LLViewerWindow', args).result
+ return leap.request('LLViewerWindow', args)
end
-- ***************************************************************************
diff --git a/indra/newview/scripts/lua/test_LLChatListener.lua b/indra/newview/scripts/lua/test_LLChatListener.lua
index 0f269b54e6..5679e9f98a 100644
--- a/indra/newview/scripts/lua/test_LLChatListener.lua
+++ b/indra/newview/scripts/lua/test_LLChatListener.lua
@@ -1,5 +1,6 @@
-local LLListener = require 'LLListener'
+local LLAgent = require 'LLAgent'
local LLChat = require 'LLChat'
+local LLListener = require 'LLListener'
local UI = require 'UI'
-- Chat listener script allows to use the following commands in Nearby chat:
@@ -23,9 +24,13 @@ function openOrEcho(message)
end
local listener = LLListener(LLChat.nearbyChatPump)
+local ageint_id = LLAgent.getID()
function listener:handleMessages(event_data)
- if string.find(event_data.message, '[LUA]') then
+ -- ignore messages and commands from other avatars
+ if event_data.from_id ~= ageint_id then
+ return true
+ elseif string.find(event_data.message, '[LUA]') then
return true
elseif event_data.message == 'stop' then
LLChat.sendNearby('Closing echo script.')
diff --git a/indra/newview/scripts/lua/test_luafloater_demo.lua b/indra/newview/scripts/lua/test_luafloater_demo.lua
index 2158134511..23310c6176 100644
--- a/indra/newview/scripts/lua/test_luafloater_demo.lua
+++ b/indra/newview/scripts/lua/test_luafloater_demo.lua
@@ -14,7 +14,7 @@ function flt:handleEvents(event_data)
end
function flt:commit_disable_ctrl(event_data)
- self:post({action="set_enabled", ctrl_name="open_btn", value = (1 - event_data.value)})
+ self:post({action="set_enabled", ctrl_name="open_btn", value = not event_data.value})
end
function flt:commit_title_cmb(event_data)
diff --git a/indra/newview/scripts/lua/test_toolbars.lua b/indra/newview/scripts/lua/test_toolbars.lua
index 7683fca8a3..9cd1043446 100644
--- a/indra/newview/scripts/lua/test_toolbars.lua
+++ b/indra/newview/scripts/lua/test_toolbars.lua
@@ -20,7 +20,7 @@ if response == 'OK' then
UI.removeToolbarBtn(BUTTONS[i])
end
end
- popup:tip('Toolbars were reshuffled')
+ UI.popup:tip('Toolbars were reshuffled')
else
- popup:tip('Canceled')
+ UI.popup:tip('Canceled')
end