Originally Posted by Xrystal
I hope that helps make a bit more sense of what I was trying to explain.
|
Lua Code:
local addonName, addonData = ...
local function OnEvent(self,event,...)
-- create variables from the event arguments
local login,reload = ...
-- if this is the first time entering the world
if event == "PLAYER_ENTERING_WORLD" and login == true then
local version = GetAddOnMetadata(PawsUI, "Version")
if version ~= addon.version then
-- <Show Your Splash Frame and fill any of the UI with its required data>
local InstallerLogo = CreateFrame("Frame", addonName.."ILogo", UIParent);
InstallerLogo:RegisterEvent("PLAYER_ENTERING_WORLD");
InstallerLogo:SetScript("OnEvent", function(self,event,...)
self:SetSize(850, 480); -- the size of the splash
self:SetPoint("CENTER"); -- its position on the screen
UIFrameFadeIn(InstallerLogo,1,0,1);
end)
-- Then Update the saved variable table for the character with the new version
addon.version = version
end
end
end
So if I wrote it like this it would get the addon version when loaded. Compare it to the saved variable with is in PawDB - Then show the splash if it didn't equal 2. Then make it equal 2?
Headaches are the worst for learning.
EDIT - fixed my code. PawsUI.lua inside saved variables still shows PawDB = nil