From 986bc0055e914b5e92c31597a7b82c61a2ae0c92 Mon Sep 17 00:00:00 2001 From: James Whitehead II Date: Sun, 31 Dec 2006 22:19:31 +0000 Subject: [PATCH] * Minor adjustments to aggro code * Added PerfectRaidOptions for gui work --- PerfectRaid.lua | 1 + PerfectRaidOptions.lua | 42 ++++++++++++++++++++++++++++++++++++++++-- PerfectRaid_Aggro.lua | 10 ++++++++-- 3 files changed, 49 insertions(+), 4 deletions(-) diff --git a/PerfectRaid.lua b/PerfectRaid.lua index 2d83b9d..67cdf96 100644 --- a/PerfectRaid.lua +++ b/PerfectRaid.lua @@ -191,6 +191,7 @@ function PerfectRaid:UNIT_HEALTH(event, unit) deficit = "" end + --TODO: Seperate this out properly into the logical module if aggro[unit] and aggro[unit] >= 15 then if deficit == "" then deficit = L["Aggro"] diff --git a/PerfectRaidOptions.lua b/PerfectRaidOptions.lua index 41c9b84..d9db593 100644 --- a/PerfectRaidOptions.lua +++ b/PerfectRaidOptions.lua @@ -1,4 +1,43 @@ ---[[ +--[[------------------------------------------------------------------------- + Copyright (c) 2006, Jim Whitehead II + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of PerfectRaid nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +---------------------------------------------------------------------------]] + +local Options = PerfectRaid:NewModule("PerfectRaid-Options") + +function Options:Initialize() +end + +function Options:Enable() +end + +function Options:CreateOptions() foo = CreateFrame("Frame", "PRTestOptions", UIParent, "PROptionsTemplate") foo:SetHeight(300) foo:SetWidth(450) foo:SetPoint("CENTER", 0, 0) @@ -25,4 +64,3 @@ check1:Show() local button1 = CreateFrame("Button", "PRButton1", foo, "PRButtonTemplate") button1:SetPoint("BOTTOMRIGHT", foo, -15, 17) button1:Show() ---]] \ No newline at end of file diff --git a/PerfectRaid_Aggro.lua b/PerfectRaid_Aggro.lua index 643af34..072135d 100644 --- a/PerfectRaid_Aggro.lua +++ b/PerfectRaid_Aggro.lua @@ -34,7 +34,7 @@ local Aggro = PerfectRaid:NewModule("PerfectRaid-Aggro") local frames,aggro local victims = {} local targets = {} -local flashing = {} +local marked = {} function Aggro:Initialize() frames = PerfectRaid.frames @@ -67,7 +67,13 @@ function Aggro.OnUpdate() if aggro[unit] < 20 then local val = aggro[unit] if val >= 5 and val <= 10 then - PerfectRaid:UNIT_HEALTH(nil, unit) + if not marked[unit] then + PerfectRaid:UNIT_HEALTH(nil, unit) + end + else + if marked[unit] then + PerfectRaid:UNIT_HEALTH(nil, unit) + end end aggro[unit] = val + 10 end -- 1.7.9.5