Creating a Lua Popup

  • Hey,

    I am new to lua and haven´t found a way to create a popup Settings window,

    were you can choose from 2 options and they each execute another Plugin.


    If somebody could help me a little bit, I would be so thankfull!


    Greetings Doubletap

  • Something like this:


    Code
    local function Main(display_handle,argument) -- we need this display_handle
        -- ...
        local question = "What do you like on your pizza?"
        local toppings = {"Pineapple", "Pepperoni", "Mushroom"}
        local choice = PopupInput(question, display_handle, toppings);
        Echo( "You choose : %d", choice ) -- You choose : 0
  • Ok one more question, my menu is now working and I tryed the following to get a function to the menupoints:

  • Close, Cmd is a function so it needs zero or more parameters in parentheses.


    Undo is just here for example, though for some reason it doesn't work exactly the way I would have expected, still learning myself.

  • But you´re pretty good and help me a lot!!! Now I tryed to put a Menu inside a Menu. :D But gMA 3 dosen´t like it.

    when I execute this, the following Error appears, you know why?

    Code
    MainTask         14m39.683s : ===== Menu Started =====
    MainTask         14m40.953s : OK:Call Plugin 2
    LUA              14m42.072s : LUA API Syntax error at  :22
    LUA              14m42.072s :    PopupInput ( [string:title],UIcaller:lightuserdata,table:{{'str'|'int'|'lua'|'handle', name, type-dependent}...}[,string:selectedValue[,integer:x,integer:y]] ) returns string:value
  • The reason looks like it's because display_handle is local to Main but you arent passing it to areyousure(). try changing the above line 36 to Areyousure(display_handle)