Quantcast

Delay for loading message

Scott King [07-04-15 - 16:30]
Delay for loading message
Filename
PortraitHealth.lua
PortraitHealth.xml
diff --git a/PortraitHealth.lua b/PortraitHealth.lua
index ad4e6cf..9f63887 100755
--- a/PortraitHealth.lua
+++ b/PortraitHealth.lua
@@ -33,10 +33,10 @@ PH_p[10] = 10 	-- Monk				  10
 PH_p[11] = 25 	-- Druid			  11

 -- Welcome message
-function PH_OnLoad()
+function PH_OnLoad(elapsed)
   SlashCmdList["PH"] = PH_SlashCommandHandler; -- Add our slash command handler to the list of slash commands
   SLASH_PH1 = "/ph"; -- Associate /ph with the slash command list entry for PORTRAITHEALTH
-	if(IsAddOnLoaded("PortraitHealth")) then
+	if(IsAddOnLoaded("PortraitHealth")) and elapsed > 5 then
 		DEFAULT_CHAT_FRAME:AddMessage("|cffffff00Portrait Health "..PH_v.."|r loaded. Type |cff00aaff/ph|r for a list of commands.");
 	else
 	end
diff --git a/PortraitHealth.xml b/PortraitHealth.xml
index 60e26cb..4c668e1 100755
--- a/PortraitHealth.xml
+++ b/PortraitHealth.xml
@@ -33,7 +33,7 @@
 					self:RegisterEvent("UNIT_HEALTH");
 					self:RegisterEvent("PLAYER_TARGET_CHANGED");
 					self:RegisterEvent("PLAYER_ENTERING_WORLD");
-					PH_OnLoad();
+					PH_OnLoad(elapsed);
 				</OnLoad>
 				<OnEvent>
 					HealthPercentage(event);