Thread Tools Display Modes
10-16-05, 08:38 AM   #1
ProfOak
A Cyclonian
Join Date: Oct 2005
Posts: 47
How to Create an Error Frame that displays error messages?

Hi!

I'm still new in this business of addon developing. I need help on how do i create a frame that can display error messages. Just like in game :P
If you can also help with the fade effect it would be great :P

Not to push my luck, but pls explain the how and why :P

Cheers
  Reply With Quote
10-16-05, 09:00 AM   #2
shouryuu
A Chromatic Dragonspawn
 
shouryuu's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2005
Posts: 150
Well I'm quite sure this tutorial guides you through that... https://forums.worldofwarcraft.com/t...&tmp=1#post173
Good luck
  Reply With Quote
10-17-05, 04:46 AM   #3
ProfOak
A Cyclonian
Join Date: Oct 2005
Posts: 47
Thks 4 trying to help but i had already read that post and didn't help a lot.

I'm developing an addon and i did way more things ahead the help post you gave.

I only had a prob with frame :P

But i'll check other stuff to see if I can get into it.

All help is very welcome.
  Reply With Quote
10-17-05, 06:19 AM   #4
Gello
A Molten Giant
AddOn Author - Click to view addons
Join Date: Jan 2005
Posts: 521
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.

Last edited by Gello : 10-17-05 at 06:31 AM.
  Reply With Quote
10-18-05, 01:30 AM   #5
ProfOak
A Cyclonian
Join Date: Oct 2005
Posts: 47
OMG :P THKS :P

Great help :P Really thks :P

I found a way but i like more of 1 of yours, which make code cleaner :P

Really thks 4 your help, gonna test it right away :P

Cheers
  Reply With Quote

WoWInterface » AddOns, Compilations, Macros » AddOn Help/Support » How to Create an Error Frame that displays error messages?


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off