Thread: Fading Textures
View Single Post
08-16-18, 08:16 PM   #17
candrid
Premium Member
 
candrid's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Aug 2008
Posts: 61
Originally Posted by Xrystal View Post
I hope that helps make a bit more sense of what I was trying to explain.
Lua Code:
  1. local addonName, addonData = ...
  2. local function OnEvent(self,event,...)
  3.       -- create variables from the event arguments
  4.     local login,reload = ...
  5.         -- if this is the first time entering the world
  6.         if event == "PLAYER_ENTERING_WORLD" and login == true then
  7.            local version = GetAddOnMetadata(PawsUI, "Version")
  8.             if version ~= addon.version then
  9.  
  10.               -- <Show Your Splash Frame and fill any of the UI with its required data>
  11.             local InstallerLogo = CreateFrame("Frame", addonName.."ILogo", UIParent);
  12.             InstallerLogo:RegisterEvent("PLAYER_ENTERING_WORLD");
  13.             InstallerLogo:SetScript("OnEvent", function(self,event,...)
  14.                 self:SetSize(850, 480); -- the size of the splash
  15.                 self:SetPoint("CENTER"); -- its position on the screen            
  16.                 UIFrameFadeIn(InstallerLogo,1,0,1);
  17.             end)  
  18.               -- Then Update the saved variable table for the character with the new version
  19.               addon.version = version
  20.             end
  21.         end
  22.     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

Last edited by candrid : 08-16-18 at 08:38 PM.
  Reply With Quote