diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-06-20 16:21:17 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-06-20 16:21:17 -0400 |
commit | 6d29c1fcf80441cc4619e672ca07469cc3efe100 (patch) | |
tree | 7009289bbd04654b998db9c64fb23a714632ff15 /indra | |
parent | 100a1d95f0e1aa28d6398fe3401a5cf4d19b133e (diff) |
Use new popup.lua, which supersedes LLNotification.lua.
Use ClassName(ctor args) for classes using util.classctor().
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/scripts/lua/LLNotification.lua | 15 | ||||
-rw-r--r-- | indra/newview/scripts/lua/test_luafloater_speedometer.lua | 11 |
2 files changed, 5 insertions, 21 deletions
diff --git a/indra/newview/scripts/lua/LLNotification.lua b/indra/newview/scripts/lua/LLNotification.lua deleted file mode 100644 index f47730d1cc..0000000000 --- a/indra/newview/scripts/lua/LLNotification.lua +++ /dev/null @@ -1,15 +0,0 @@ --- Engage the LLNotificationsListener LLEventAPI - -leap = require 'leap' - -local LLNotification = {} - -function LLNotification.add(name, substitutions) - leap.send('LLNotifications', {op='requestAdd', name=name, substitutions=substitutions}) -end - -function LLNotification.requestAdd(name, substitutions) - return leap.request('LLNotifications', {op='requestAdd', name=name, substitutions=substitutions})['response'] -end - -return LLNotification diff --git a/indra/newview/scripts/lua/test_luafloater_speedometer.lua b/indra/newview/scripts/lua/test_luafloater_speedometer.lua index a9d3a70330..af7189a2cb 100644 --- a/indra/newview/scripts/lua/test_luafloater_speedometer.lua +++ b/indra/newview/scripts/lua/test_luafloater_speedometer.lua @@ -1,10 +1,10 @@ local Floater = require 'Floater' local leap = require 'leap' -local LLNotification = require 'LLNotification' +local popup = require 'popup' local startup = require 'startup' local Timer = (require 'timers').Timer local max_speed = 0 -local flt = Floater:new("luafloater_speedometer.xml") +local flt = Floater("luafloater_speedometer.xml") startup.wait('STATE_STARTED') local timer @@ -13,8 +13,7 @@ function flt:floater_close(event_data) if timer then timer:cancel() end - msg = "Registered max speed: " .. string.format("%.2f", max_speed) .. " m/s"; - LLNotification.add('SystemMessageTip', {MESSAGE = msg}) + popup:tip(string.format("Registered max speed: %.2f m/s", max_speed)) end local function idle(event_data) @@ -24,9 +23,9 @@ local function idle(event_data) end msg = 'Are you sure you want to run this "speedometer" script?' -response = LLNotification.requestAdd('GenericAlertYesCancel', {MESSAGE = msg}) +response = popup:alertYesCancel(msg) if response.OK_okcancelbuttons then flt:show() - timer = Timer:new(1, idle, true) -- iterate + timer = Timer(1, idle, true) -- iterate end |