diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-08-01 16:47:11 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-08-01 16:47:11 -0400 |
commit | c65cf07b12c1e3c24dc47cce3593bb7c82c21f39 (patch) | |
tree | 9b5aa466eb9ab80db46a9a38613492fddce0a6de /indra/newview/scripts/lua/test_top_menu.lua | |
parent | 3214c7bd7e77fdd458d64ec101a8a67287b59ffa (diff) | |
parent | 040545e3173df0483eefad514029cf46da1e483d (diff) |
Merge remote-tracking branch 'origin/lua-top-menu' into lua-callables.
We want to base lua-callables on lua-top-menu.
Diffstat (limited to 'indra/newview/scripts/lua/test_top_menu.lua')
-rw-r--r-- | indra/newview/scripts/lua/test_top_menu.lua | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/test_top_menu.lua b/indra/newview/scripts/lua/test_top_menu.lua new file mode 100644 index 0000000000..780a384c92 --- /dev/null +++ b/indra/newview/scripts/lua/test_top_menu.lua @@ -0,0 +1,34 @@ +UI = require 'UI' + +--Add new drop-down 'LUA Menu' to the Top menu. +local MENU_NAME = "lua_menu" +UI.addMenu{name=MENU_NAME,label="LUA Menu"} + +--Add two new menu items to the 'LUA Menu': 'Debug console' and 'Scripts' +UI.addMenuItem{name="lua_debug",label="Debug console", + param="lua_debug", + func="Floater.ToggleOrBringToFront", + parent_menu=MENU_NAME} + +UI.addMenuItem{name="lua_scripts",label="Scripts", + param="lua_scripts", + func="Floater.ToggleOrBringToFront", + parent_menu=MENU_NAME} + +--Add menu separator to the 'LUA Menu' under added menu items +UI.addMenuSeparator{parent_menu=MENU_NAME} + +--Add two new menu branch 'About...' to the 'LUA Menu' +local BRANCH_NAME = "about_branch" +UI.addMenuBranch{name="about_branch",label="About...",parent_menu=MENU_NAME} + +--Add two new menu items to the 'About...' branch +UI.addMenuItem{name="lua_info",label="Lua...", + param="https://www.lua.org/about.html", + func="Advanced.ShowURL", + parent_menu=BRANCH_NAME} + +UI.addMenuItem{name="lua_info",label="Luau...", + param="https://luau-lang.org/", + func="Advanced.ShowURL", + parent_menu=BRANCH_NAME} |