summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2024-09-27 17:33:01 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2024-09-27 17:46:51 +0300
commit00331d3dca86fd54e6f31aea3c0f5018672e1bcb (patch)
tree3125d03868f35424633437825c22d300dc70efdf /indra/newview/scripts/lua
parent294f6a73ea4fa1b1763250b5f74eb19deb7703e4 (diff)
Add UI callback to invoke specified script via menu
Diffstat (limited to 'indra/newview/scripts/lua')
-rw-r--r--indra/newview/scripts/lua/test_top_menu.lua28
1 files changed, 23 insertions, 5 deletions
diff --git a/indra/newview/scripts/lua/test_top_menu.lua b/indra/newview/scripts/lua/test_top_menu.lua
index 780a384c92..f877cda5eb 100644
--- a/indra/newview/scripts/lua/test_top_menu.lua
+++ b/indra/newview/scripts/lua/test_top_menu.lua
@@ -18,17 +18,35 @@ UI.addMenuItem{name="lua_scripts",label="Scripts",
--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 'Demo scripts...' branch to the 'LUA Menu'
+local DEMO_BRANCH = "demo_scripts"
+UI.addMenuBranch{name=DEMO_BRANCH,label="Demo scripts...",parent_menu=MENU_NAME}
+
+--Add menu items to the 'Demo scripts...' branch, which will invoke specified script on click
+UI.addMenuItem{name="speedometer",label="Speedometer",
+ param="test_luafloater_speedometer.lua",
+ func="Lua.RunScript",
+ parent_menu=DEMO_BRANCH}
+
+UI.addMenuItem{name="gesture_list",label="Gesture list",
+ param="test_luafloater_gesture_list.lua",
+ func="Lua.RunScript",
+ parent_menu=DEMO_BRANCH}
+
+--Add one more menu separator
+UI.addMenuSeparator{parent_menu=MENU_NAME}
+
+--Add 'About...' branch to the 'LUA Menu'
+local ABOUT_BRANCH = "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}
+ parent_menu=ABOUT_BRANCH}
UI.addMenuItem{name="lua_info",label="Luau...",
param="https://luau-lang.org/",
func="Advanced.ShowURL",
- parent_menu=BRANCH_NAME}
+ parent_menu=ABOUT_BRANCH}