1. If you want *just* like the game's script error message tho I'm sure you know this:
/script message("Error message here")
2. If you want the game's confirmation box with an ok button:
/script StaticPopupDialogs["MYALERTMESSAGE"] = { text = "Error message here", button1 = "OK", timeout = 0, showAlert = 1, whileDead = 1 } StaticPopup_Show("MYALERTMESSAGE")
Change timeout to a value for it to dismiss on its own (in seconds). showAlert=1 puts an "alert" icon on the window. You can see lots of settings by looking at the StaticPopup.lua where a lot of confirmation boxes are defined.
3. If you want to send an error via the "tutorial" buttons:
function AddTutorial(title,text)
local found,i=0,0
while found do
i=i+1
found=getglobal("TUTORIAL_TITLE"..i)
end
setglobal("TUTORIAL_TITLE"..i,title)
setglobal("TUTORIAL"..i,text)
TutorialFrame_NewTutorial(i)
end
Then AddTutorial("Error!","Error message here")
(I like that method a lot but unfortunately lots of people disable their tutorials)
4. Or you can make a tooltip with the message:
/script GameTooltip_SetDefaultAnchor(GameTooltip,this) GameTooltip:AddLine("Error message here") GameTooltip:Show() GameTooltip:FadeOut()
5. Or you can send to UIErrorsFrame:
UIErrorsFrame:AddMessage("Error message here",1,.25,.25,1,1,UIERRORS_HOLDTIME)
5. Or you can make a frame with a message inside:
<Frame name="MyError">
<Size><AbsDimension x="200" y="40"/></Size>
<Anchors><Anchor point="CENTER"/></Anchors>
<Layers>
<Layer level="BACKGROUND">
<FontString name="MyErrorMessage" inherits="GameFontNormal">
<Anchors><Anchor point="CENTER"/></Anchors>
</FontString>
</Layer>
</Layers>
</Frame>
To make a fadeout you'd want to put an OnUpdate in there to SetAlpha on a timer and hide the frame when it's completely faded out.