diff options
author | Mnikolenko Productengine <mnikolenko@productengine.com> | 2024-08-02 19:46:52 +0300 |
---|---|---|
committer | Mnikolenko Productengine <mnikolenko@productengine.com> | 2024-08-02 19:46:52 +0300 |
commit | 99307b619a5aa27bef3bb67027c4cb5e54f21ad4 (patch) | |
tree | 05700a01c0ec72cdc0899951e7fe4e7ef4a78aba /indra/newview/scripts/lua | |
parent | d6abce3968925c5cb58c11f1c6fc936605f55c57 (diff) |
Lua api for adjusting toolbars
Diffstat (limited to 'indra/newview/scripts/lua')
-rw-r--r-- | indra/newview/scripts/lua/require/UI.lua | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/require/UI.lua b/indra/newview/scripts/lua/require/UI.lua index 06b49c6269..30b7189c3c 100644 --- a/indra/newview/scripts/lua/require/UI.lua +++ b/indra/newview/scripts/lua/require/UI.lua @@ -169,4 +169,34 @@ function UI.addMenuSeparator(...) return leap.request('UI', args) end +-- *************************************************************************** +-- Toolbar buttons +-- *************************************************************************** +-- Clears all buttons off the toolbars +function UI.clearToolbars() + leap.send('UI', {op='clearToolbars'}) +end + +function UI.defaultToolbars() + leap.send('UI', {op='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 +function UI.addToolbarBtn(...) + local args = mapargs('btn_name,toolbar,rank', ...) + args.op = 'addToolbarBtn' + return leap.request('UI', args) +end + +-- Returns the rank(position) of the command in the original list +function UI.removeToolbarBtn(btn_name) + return leap.request('UI', {op = 'removeToolbarBtn', btn_name=btn_name}).rank +end + +function UI.getToolbarBtnNames() + return leap.request('UI', {op = 'getToolbarBtnNames'}).cmd_names +end + return UI |