From d18efd553edef95e9a01ad2479930aa3107921ed Mon Sep 17 00:00:00 2001 From: Scott King Date: Tue, 30 Jun 2015 09:22:40 -0600 Subject: [PATCH] Added new welcome message --- PortraitHealth.lua | 26 ++++++++++++++++++-------- PortraitHealth.xml | 12 ++++++------ 2 files changed, 24 insertions(+), 14 deletions(-) diff --git a/PortraitHealth.lua b/PortraitHealth.lua index ed4774e..50f966e 100755 --- a/PortraitHealth.lua +++ b/PortraitHealth.lua @@ -5,6 +5,8 @@ PlayerClass = classID; PlayerClassName = classDisplayName; PlayerClassNameIndex = class; PH_v = '3.0'; -- version number +local total = 0 -- timer set + PH_p = {} -- Class: ID: PH_p[1] = "20" -- Warrior 1 @@ -40,7 +42,7 @@ function PH_SlashCommandHandler( msg, class ) DEFAULT_CHAT_FRAME:AddMessage("Addon version |cFFFFFF00" ..PH_v.. "|r"); DEFAULT_CHAT_FRAME:AddMessage("Execute at |cFFFF0000"..PH_p[class].."%|r \(|c"..x.colorStr..""..PlayerClassName.."|r\)"); - -- display list of available commands + -- display list of available commands elseif msg == '' then DEFAULT_CHAT_FRAME:AddMessage( "|cffffff00Portrait Health "..PH_v.."|r commands:"); DEFAULT_CHAT_FRAME:AddMessage( "Type |cff00aaff/ph|r before the command. Ex: |cff00aaff/ph off|r disables the health display."); @@ -55,15 +57,23 @@ function PH_OnLoad() SLASH_PH1 = "/ph"; -- Associate /ph with the slash command list entry for PORTRAITHEALTH end - --- Tell the player what their execute phase is set to -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."); +-- welcome message +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 7408a51..a89a923 100755 --- a/PortraitHealth.xml +++ b/PortraitHealth.xml @@ -1,6 +1,6 @@ -