Your message FontString has a SetPoint of CENTER to your event frame which has no SetPoint. The SetText function was an "if needed" thought you might add to JDoubleU00MessageBox frame to set the text of its child FontString.
Lua 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
JWNoFav = CreateFrame("Frame", "JWNoFav", UIParent)
JWNoFavFont = [[Interface\Addons\SharedMedia_MyMedia\font\Lato-Regular.ttf]]
JWNoFavFontSize = 18
JWNoFavFontFlags = "NONE"
local function ShowMessage(text)
if not JDoubleU00MessageBox then
local f = CreateFrame("Frame", "JDoubleU00MessageBox", UIParent)
--- Whatever your heart desires to see any messages plus a close (hide) button
f:SetFrameStrata("BACKGROUND")
f:SetHeight(64)
f:SetBackdrop({bgFile = "Interface/Tooltips/UI-Tooltip-Background", edgeFile="Interface/Tooltips/UI-Tooltip-Border", tile = true, tileSize = 8, insets = {left = 8, right = 8, top = 8, bottom = 8},})
f:SetBackdropColor(0.5, 1, 0.5)
f:SetBackdropBorderColor(1, 0, 0)
f:SetPoint("CENTER")
f.Close = CreateFrame("Button", nil, f, "UIPanelButtonTemplate")
f.Close:SetSize(24, 24)
f.Close:SetPoint("TOPRIGHT", -8, -8)
f.Close:SetText("X")
f.Close:SetScript("OnClick", function(self) self:GetParent():Hide() end)
f.nfText = f:CreateFontString("$parentText", "OVERLAY", "NumberFontNormal") --GameFontNormal
f.nfText:SetFont(JWNoFavFont, JWNoFavFontSize, JWNoFavFontFlags)
f.nfText:SetPoint("CENTER")
end
JDoubleU00MessageBox.nfText:SetText(text)
JDoubleU00MessageBox:SetWidth(JDoubleU00MessageBox.nfText:GetWidth() + 50)
if not JDoubleU00MessageBox:IsShown() then
JDoubleU00MessageBox:Show()
end
end
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
ShowMessage("You do not have any mounts selected as a favorite.")
end
end
JWNoFav:RegisterEvent("PLAYER_ENTERING_WORLD")
JWNoFav:SetScript("OnEvent", eventHandler)