Go to most recent revision | Compare with Previous | Blame | View Log
-- Combat Clock -- By : Icecoldcoke function CombatClock_OnLoad() this:RegisterEvent("PLAYER_REGEN_DISABLED"); this:RegisterEvent("PLAYER_REGEN_ENABLED"); this:RegisterEvent("VARIABLES_LOADED") end function CombatClock_OnInitialize() SLASH_COMBATCLOCK1 = "/cc"; SLASH_COMBATCLOCK2 = "/coco"; SlashCmdList["COMBATCLOCK"] = CombatClock_Command; if (not CombatClock_min) then CombatClock_min = 00 end end function CombatClock_Command(CombatClock_arg) if CombatClock_arg == "" then DEFAULT_CHAT_FRAME:AddMessage("[CC]Invalid Command! /cc default or /cc <time>. <Time> = 00-60.") end if CombatClock_arg == "default" then enhbl_shoutmessage = enhbl_defaultshoutmessage DEFAULT_CHAT_FRAME:AddMessage("[CC]Time limit removed."); end if (CombatClock_arg ~= "default") and (CombatClock_arg ~= "") then CombatClock_min = CombatClock_arg DEFAULT_CHAT_FRAME:AddMessage("[CC]Minimum minues has been set to :" .. CombatClock_min); end end function CombatClock_OnEvent() if (event == "VARIABLES_LOADED") then CombatClock_OnInitialize() end if (event == "PLAYER_REGEN_DISABLED") then Stopwatch_Clear() Stopwatch_Play() StopwatchFrame:Show() SetDesaturation(StopwatchPlayPauseButton:GetNormalTexture(), 1) SetDesaturation(StopwatchResetButton:GetNormalTexture(), 1) StopwatchPlayPauseButton:Disable() StopwatchResetButton:Disable() end if (event == "PLAYER_REGEN_ENABLED") then Stopwatch_Pause() SetDesaturation(StopwatchPlayPauseButton:GetNormalTexture()) SetDesaturation(StopwatchResetButton:GetNormalTexture()) StopwatchPlayPauseButton:Enable() StopwatchResetButton:Enable() StopwatchFrame:Hide() if StopwatchTickerMinute:GetText() >= CombatClock_min then DEFAULT_CHAT_FRAME:AddMessage("[CC]Combat Ended in (MM:SS): "..StopwatchTickerMinute:GetText()..":"..StopwatchTickerSecond:GetText()) end end end