Guest User

EmuLua Menu Sample

a guest
Nov 6th, 2010
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.01 KB | None | 0 0
  1. -- menu function example
  2.  
  3. -- define menu callbacks first
  4. local checked = true
  5. function func1() print("Pink Forte Wave!!") end
  6. function func2() print("Blue Forte Wave!!") checked = not checked end
  7. function func3() print("Gold Forte Burst!!") end
  8. function func4() print("Silver Forte Wave!!") end
  9. function func5() print("Puri Puri") end
  10. function func6() print("Puririn") end
  11.  
  12. -- add an new menu to emu
  13. local submenu1 = {
  14.     { "Tsubomi", func1 },
  15.     { "Erika", func2 },
  16.     { "Itsuki", func3 },
  17.     { "Yuri", func4 }
  18. }
  19. local submenu2 = {
  20.     { "Cure Blossom", func1 },
  21.     { "Cure Marine", func2 },
  22.     { "Cure Sunshine", func3 },
  23.     { "Cure Moonlight", func4 }
  24. }
  25. local menu = {
  26.     { "Before Transformation", submenu1 },
  27.     { "After Transformation", submenu2 },
  28.     nil,
  29.     { "Chypre", func5 },
  30.     { "Coffret", func6 }
  31. }
  32. emu.addmenu("Heartcatch", menu)
  33.  
  34. -- update menu enabled/checked state here
  35. emu.registermenustart(function()
  36.     emu.setmenuiteminfo(func5, { enabled = false })
  37.     emu.setmenuiteminfo(func2, { checked = checked })
  38. end)
Advertisement
Add Comment
Please, Sign In to add comment