Quantcast

Welcome message delay

Scott King [07-01-15 - 13:13]
Welcome message delay

Failed attempt at welcome message delay
Filename
PortraitHealth.lua
PortraitHealth.xml
diff --git a/PortraitHealth.lua b/PortraitHealth.lua
index db9456d..025f699 100755
--- a/PortraitHealth.lua
+++ b/PortraitHealth.lua
@@ -5,7 +5,7 @@ PlayerClass = classID;
 PlayerClassName = classDisplayName;
 PlayerClassNameIndex = class;
 PH_v = '3.0'; -- version number
-local total = 0 -- timer set
+total = 0; -- timer set


 PH_p = {}			-- Class:			ID:
@@ -55,25 +55,9 @@ end
 function PH_OnLoad()
   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
+	DEFAULT_CHAT_FRAME:AddMessage("|cffffff00Portrait Health "..PH_v.."|r loaded. Type |cff00aaff/ph|r for a list of commands.");
 end

--- new welcome message. attempts to delay the message so it's not lost in the shuffle.
-local function onUpdate(self,elapsed)
-    total = total + elapsed
-    if total >= 2 then
-        DEFAULT_CHAT_FRAME:AddMessage("|cffffff00Portrait Health "..PH_v.."|r loaded. Type |cff00aaff/ph|r for a list of commands.");
-        total = 0
-    end
-end
-
--- old welcome message
---function DisplayClass(class)
---	local class = PlayerClass;
---	local className = PlayerClassName;
---	local x = RAID_CLASS_COLORS[PlayerClassNameIndex];
---	DEFAULT_CHAT_FRAME:AddMessage("|cffffff00Portrait Health "..PH_v.."|r loaded. Type |cff00aaff/ph|r for a list of commands.");
---end
-
 -- Set the text color and update health output
 function HealthPercentage()

diff --git a/PortraitHealth.xml b/PortraitHealth.xml
index a89a923..fd0c447 100755
--- a/PortraitHealth.xml
+++ b/PortraitHealth.xml
@@ -33,7 +33,6 @@
 					self:RegisterEvent("UNIT_HEALTH");
 					self:RegisterEvent("PLAYER_TARGET_CHANGED");
 					self:RegisterEvent("PLAYER_ENTERING_WORLD");
-					onUpdate();
 					PH_OnLoad();
 				</OnLoad>
 				<OnEvent>