From 606547dd4fb7ed3c4578e82b16fa43551660092e Mon Sep 17 00:00:00 2001 From: Scott King Date: Wed, 1 Jul 2015 08:12:29 -0600 Subject: [PATCH] Trying a new welcome message using IsAddOnLoaded --- PortraitHealth.lua | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/PortraitHealth.lua b/PortraitHealth.lua index 025f699..455a0c8 100755 --- a/PortraitHealth.lua +++ b/PortraitHealth.lua @@ -5,8 +5,6 @@ PlayerClass = classID; PlayerClassName = classDisplayName; PlayerClassNameIndex = class; PH_v = '3.0'; -- version number -total = 0; -- timer set - PH_p = {} -- Class: ID: PH_p[1] = "20" -- Warrior 1 @@ -21,6 +19,16 @@ PH_p[9] = "25" -- Warlock 9 PH_p[10] = "10" -- Monk 10 PH_p[11] = "25" -- Druid 11 +-- Welcome message +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 + if(IsAddOnLoaded("PortraitHealth")) then + DEFAULT_CHAT_FRAME:AddMessage("|cffffff00Portrait Health "..PH_v.."|r loaded. Type |cff00aaff/ph|r for a list of commands."); + else + end +end + -- Slash Commands function PH_SlashCommandHandler( msg, class ) local class = PlayerClass; @@ -52,12 +60,6 @@ function PH_SlashCommandHandler( msg, class ) end 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 - -- Set the text color and update health output function HealthPercentage() -- 1.7.9.5