LupinV Posted August 8, 2018 Share Posted August 8, 2018 hey guys, how I can create a submenu with note editor in a lua script? Link to comment Share on other sites More sharing options...
CmP Posted August 8, 2018 Share Posted August 8, 2018 You just need to call a function for showing desired submenu, if user has chosen corresponding option in main menu. Simple example of menu with submenu: local function showSubMenu() local choice = gg.choice({'Option 1', 'Option 2'}) if choice == nil then -- Actions, if the dialog was cancelled elseif choice == 1 then -- Actions for option 1 elseif choice == 2 then -- Actions for option 2 end end local function showMenu() local choice = gg.choice({'Option 1 - submenu', 'Option 2', 'Exit'}) if choice == nil then -- Actions, if the dialog was cancelled elseif choice == 1 then showSubMenu() elseif choice == 2 then -- Actions for option 2 elseif choice == 3 then os.exit() end end while true do if gg.isVisible() then showMenu() gg.setVisible(false) else gg.sleep(100) end end submenu_example.lua Link to comment Share on other sites More sharing options...
Question
LupinV
hey guys, how I can create a submenu with note editor in a lua script?
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.