Thread Tools Display Modes
Prev Previous Post   Next Post Next
12-25-18, 12:07 AM   #1
JDoubleU00
A Firelord
 
JDoubleU00's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2008
Posts: 463
Message Box

I'm trying to see if there are any other solutions for displaying a pop up message box other than message("xxx"). This addon displays a message box if you do not have any favorite mounts selected. I know favorite mounts are usually across characters, but I use an addon that lets me select favorites per character. Here is the code, any suggestions are appreciated.

Code:
--Addon will check to see if you have a favorite mount and remind you if you do not.

local JWNumMounts =  C_MountJournal.GetNumMounts();
local JWFav = 0
local JWNoFav = CreateFrame("Frame", "JWNoFav", UIParent)

JWNoFav:RegisterEvent("PLAYER_ENTERING_WORLD")

local function eventHandler(self, event, ...)
	for i = 1, JWNumMounts do
		if C_MountJournal.GetIsFavorite(i) then
			JWFav = JWFav + 1
		end
	end
	if JWFav == 0 then
		message("You do not have any mounts selected as a favorite.")
	end
end

JWNoFav:SetScript("OnEvent", eventHandler)
__________________
Author of JWExpBar and JWRepBar.
  Reply With Quote
 

WoWInterface » Developer Discussions » General Authoring Discussion » Message Box


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