summaryrefslogtreecommitdiff
path: root/indra/newview/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/scripts')
-rw-r--r--indra/newview/scripts/lua/require/UI.lua8
-rw-r--r--indra/newview/scripts/lua/test_toolbars.lua5
2 files changed, 7 insertions, 6 deletions
diff --git a/indra/newview/scripts/lua/require/UI.lua b/indra/newview/scripts/lua/require/UI.lua
index df76b1501c..9bc9a3685d 100644
--- a/indra/newview/scripts/lua/require/UI.lua
+++ b/indra/newview/scripts/lua/require/UI.lua
@@ -177,8 +177,8 @@ end
-- Toolbar buttons
-- ***************************************************************************
-- Clears all buttons off the toolbars
-function UI.clearToolbars()
- leap.send('UI', {op='clearToolbars'})
+function UI.clearAllToolbars()
+ leap.send('UI', {op='clearAllToolbars'})
end
function UI.defaultToolbars()
@@ -186,8 +186,8 @@ function UI.defaultToolbars()
end
-- UI.addToolbarBtn{btn_name=btn_name
--- [, toolbar= 3] -- 1 [TOOLBAR_LEFT], 2 [TOOLBAR_RIGHT], 3 [TOOLBAR_BOTTOM]
--- [, rank=1]} -- position on the toolbar
+-- [, toolbar= bottom] -- left, right, bottom -- default is bottom
+-- [, rank=1]} -- position on the toolbar, starts at 0 (0 - first position, 1 - second position etc.)
function UI.addToolbarBtn(...)
local args = mapargs('btn_name,toolbar,rank', ...)
args.op = 'addToolbarBtn'
diff --git a/indra/newview/scripts/lua/test_toolbars.lua b/indra/newview/scripts/lua/test_toolbars.lua
index 70035db775..9a832c5644 100644
--- a/indra/newview/scripts/lua/test_toolbars.lua
+++ b/indra/newview/scripts/lua/test_toolbars.lua
@@ -3,16 +3,17 @@ UI = require 'UI'
local OK = 'OK_okcancelbuttons'
local BUTTONS = UI.getToolbarBtnNames()
+local TOOLBARS = {'left','right','bottom'}
-- Clear the toolbars and then add the toolbar buttons to the random toolbar
response = popup:alertYesCancel('Toolbars will be randomly reshuffled. Proceed?')
if next(response) == OK then
- UI.clearToolbars()
+ UI.clearAllToolbars()
math.randomseed(os.time())
-- add the buttons to the random toolbar
for i = 1, #BUTTONS do
- UI.addToolbarBtn(BUTTONS[i], math.random(3))
+ UI.addToolbarBtn(BUTTONS[i], TOOLBARS[math.random(3)])
end
-- remove some of the added buttons from the toolbars