Quantcast WoWInterface - View Single Post - nibProfileLoader
View Single Post
04-08-12, 04:36 PM   #10
Nibelheim
local roygbi-
 
Nibelheim's Avatar
Featured
Join Date: Jan 2010
Posts: 1,600
All done through WoW's PopupDialog API.

Lua Code:
  1. -- Define a new Pop Up message
  2. StaticPopupDialogs["PUDASKNEWCHAR"] = {
  3.     -- Message to display
  4.     text = MsgTexts[1],
  5.  
  6.     -- Text to show on first button
  7.     button1 = MsgTexts[2],
  8.  
  9.     -- Text to show on second button
  10.     button2 = MsgTexts[3],
  11.  
  12.     -- Function to call when first button is pressed
  13.     OnAccept = function()
  14.         -- Call CharAnswered with "Tank" argument
  15.         CharAnswered("Tank")
  16.     end,
  17.  
  18.     -- Function to call when second button is pressed
  19.     OnCancel = function()
  20.         -- Call CharAnswered with "Heal" argument
  21.         CharAnswered("Heal")
  22.     end,
  23.  
  24.     -- Pop Up message stays open until user action
  25.     timeout = 0,
  26.  
  27.     -- Pop Up message is shown even if the player is dead
  28.     whileDead = true,
  29.  
  30.     -- Hitting Esc won't close the Pop Up message
  31.     hideOnEscape = false,
  32.  
  33.     -- 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
  34.     notClosableByLogout = true,
  35. }
  36.  
  37. -- Show the Pop Up message
  38. StaticPopup_Show ("PUDASKNEWCHAR", InterfaceName);

Not sure if that was needed but its still working with no errors.
Ahh yes, that was needed. Good catch
  Reply With Quote