Sorry, we don't support your browser.  Install a modern browser

callback function of showConfirmDialog() is not executed if nested#2967

Example:

Player["Black"].showConfirmDialog("Do this?",
   function(_)
      doSomething()
   end
)

function doSomething()
   Player["Black"].showConfirmDialog("Do that?",
      function(_)
         print("here")
      end
   )
end

If Ok is pressed for the “Do that?” dialog (after pressing Ok for the “Do this?” dialog), it won’t execute the function (ie. it doesn’t print “here” to the console)

If I pull doSomething() outside of the “Do this?” dialog, it runs fine (ie. it prints “here” to the console).

I haven’t tested to see if this affects all dialog functions or just showConfirmDialog()

3 months ago