All done through WoW's PopupDialog API.
Lua Code:
-- Define a new Pop Up message
StaticPopupDialogs["PUDASKNEWCHAR"] = {
-- Message to display
text = MsgTexts[1],
-- Text to show on first button
button1 = MsgTexts[2],
-- Text to show on second button
button2 = MsgTexts[3],
-- Function to call when first button is pressed
OnAccept = function()
-- Call CharAnswered with "Tank" argument
CharAnswered("Tank")
end,
-- Function to call when second button is pressed
OnCancel = function()
-- Call CharAnswered with "Heal" argument
CharAnswered("Heal")
end,
-- Pop Up message stays open until user action
timeout = 0,
-- Pop Up message is shown even if the player is dead
whileDead = true,
-- Hitting Esc won't close the Pop Up message
hideOnEscape = false,
-- Logging out won't send the signal to hit the second button (OnCancel), thereby making the Pop Up message show next time they log in if they didn't click any buttons
notClosableByLogout = true,
}
-- Show the Pop Up message
StaticPopup_Show ("PUDASKNEWCHAR", InterfaceName);
Not sure if that was needed but its still working with no errors.
|
Ahh yes, that was needed. Good catch