diff --git a/IceBarElement.lua b/IceBarElement.lua index 8bc0635..24ea18e 100644 --- a/IceBarElement.lua +++ b/IceBarElement.lua @@ -3,7 +3,6 @@ local AceOO = AceLibrary("AceOO-2.0") IceBarElement = AceOO.Class(IceElement) IceBarElement.virtual = true -IceBarElement.TexturePath = IceHUD.Location .. "\\textures\\" IceBarElement.BarTextureWidth = 128 IceBarElement.prototype.barFrame = nil @@ -208,10 +207,12 @@ end function IceBarElement.prototype:CreateFrame() -- don't call overridden method self.alpha = self.settings.alphaooc - + self:CreateBackground() self:CreateBar() self:CreateTexts() + + self.frame:SetScale(self.moduleSettings.scale) end @@ -229,7 +230,7 @@ function IceBarElement.prototype:CreateBackground() self.frame.bg = self.frame:CreateTexture(nil, "BACKGROUND") end - self.frame.bg:SetTexture(IceBarElement.TexturePath .. self.settings.barTexture.."BG") + self.frame.bg:SetTexture(IceElement.TexturePath .. self.settings.barTexture.."BG") self.frame.bg:ClearAllPoints() self.frame.bg:SetAllPoints(self.frame) @@ -274,7 +275,7 @@ function IceBarElement.prototype:CreateBar() self.barFrame.bar = self.frame:CreateTexture(nil, "BACKGROUND") end - self.barFrame.bar:SetTexture(IceBarElement.TexturePath .. self.settings.barTexture) + self.barFrame.bar:SetTexture(IceElement.TexturePath .. self.settings.barTexture) self.barFrame.bar:SetAllPoints(self.frame) self.barFrame:SetStatusBarTexture(self.barFrame.bar) @@ -391,9 +392,8 @@ function IceBarElement.prototype:UpdateBar(scale, color, alpha) self.alpha = self.settings.alphaooc self.backgroundAlpha = self.settings.alphaoocbg end - + self.frame:SetStatusBarColor(r, g, b, self.backgroundAlpha) - self.barFrame:SetStatusBarColor(self:GetColor(color)) self:SetScale(self.barFrame.bar, scale) @@ -410,8 +410,7 @@ function IceBarElement.prototype:SetBottomText1(text, color) if not (color) then color = "text" end - - + local alpha = self.alpha if (self.alpha > 0) then @@ -450,8 +449,8 @@ function IceBarElement.prototype:SetBottomText2(text, color, alpha) alpha = 1 end end - end + self.frame.bottomLowerText:SetTextColor(self:GetColor(color, alpha)) self.frame.bottomLowerText:SetText(text) end diff --git a/IceCore.lua b/IceCore.lua index c0bebd6..6bced5e 100644 --- a/IceCore.lua +++ b/IceCore.lua @@ -40,11 +40,11 @@ function IceCore.prototype:init() alphaooc = 0.3, alphaic = 0.6, - alphaTarget = 0.3, - + alphaTarget = 0.4, + alphaoocbg = 0.2, - alphaicbg = 0.2, - alphaTargetbg = 0.2, + alphaicbg = 0.3, + alphaTargetbg = 0.25, backgroundToggle = false, backgroundColor = {r = 0.2, g = 0.2, b = 0.2}, diff --git a/IceElement.lua b/IceElement.lua index 52a0c0e..6512915 100644 --- a/IceElement.lua +++ b/IceElement.lua @@ -3,6 +3,8 @@ local AceOO = AceLibrary("AceOO-2.0") IceElement = AceOO.Class("AceEvent-2.0") IceElement.virtual = true +IceElement.TexturePath = IceHUD.Location .. "\\textures\\" + -- Protected variables -- IceElement.prototype.name = nil IceElement.prototype.parent = nil @@ -15,6 +17,7 @@ IceElement.settings = nil IceElement.moduleSettings = nil IceElement.prototype.configColor = "ff8888ff" +IceElement.prototype.scalingEnabled = nil -- Constructor -- -- IceElements are to be instantiated before IceCore is loaded. @@ -23,10 +26,11 @@ IceElement.prototype.configColor = "ff8888ff" function IceElement.prototype:init(name) IceElement.super.prototype.init(self) assert(name, "IceElement must have a name") - + self.name = name self.alpha = 1 - + self.scalingEnabled = false + -- Some common colors self:SetColor("text", 1, 1, 1) self:SetColor("undef", 0.7, 0.7, 0.7) @@ -89,6 +93,7 @@ end -- AceOptions table for configuration function IceElement.prototype:GetOptions() local opts = {} + opts["enabled"] = { type = "toggle", name = "|c" .. self.configColor .. "Enabled|r", @@ -106,6 +111,27 @@ function IceElement.prototype:GetOptions() end, order = 20 } + + opts["scale"] = + { + type = 'range', + name = "|c" .. self.configColor .. "Scale|r", + desc = 'Scale of the element', + min = 0.2, + max = 2, + step = 0.1, + isPercent = true, + hidden = not self.scalingEnabled, + get = function() + return self.moduleSettings.scale + end, + set = function(value) + self.moduleSettings.scale = value + self:Redraw() + end, + order = 21 + } + return opts end @@ -116,6 +142,7 @@ end function IceElement.prototype:GetDefaultSettings() local defaults = {} defaults["enabled"] = true + defaults["scale"] = 1 return defaults end @@ -128,6 +155,8 @@ function IceElement.prototype:CreateFrame() if not (self.frame) then self.frame = CreateFrame("Frame", "IceHUD_"..self.name, self.parent) end + + self.frame:SetScale(self.moduleSettings.scale) end diff --git a/IceHUD.lua b/IceHUD.lua index 0155f17..8aa0dfe 100644 --- a/IceHUD.lua +++ b/IceHUD.lua @@ -403,7 +403,7 @@ IceHUD.options = name = '|cffff0000Reset|r', desc = "Resets all IceHUD options - WARNING: Reloads UI", func = function() - IceHUD.IceCore:ResetSettings() + StaticPopup_Show("ICEHUD_RESET") end, order = 92 }, @@ -445,7 +445,7 @@ IceHUD.slashMenu = type = 'execute', func = function() if not (IceHUD.dewdrop:IsRegistered(IceHUD.IceCore.IceHUDFrame)) then - IceHUD.dewdrop:Register(IceHUD.IceCore.IceHUDFrame, + IceHUD.dewdrop:Register(IceHUD.IceCore.IceHUDFrame, 'children', IceHUD.options, 'point', "BOTTOMLEFT", 'relativePoint', "TOPLEFT", @@ -456,6 +456,20 @@ IceHUD.slashMenu = end } +StaticPopupDialogs["ICEHUD_RESET"] = +{ + text = "Are you sure you want to reset IceHUD settings?", + button1 = "Okay", + button2 = "Cancel", + timeout = 0, + whileDead = 1, + hideOnEscape = 1, + OnAccept = function() + print("hellooo") + IceHUD.IceCore:ResetSettings() + end +} + function IceHUD:OnInitialize() diff --git a/IceHUD.toc b/IceHUD.toc index 40d1f1c..faa8fb9 100644 --- a/IceHUD.toc +++ b/IceHUD.toc @@ -3,7 +3,7 @@ ## Name: IceHUD ## Title: IceHUD |cff7fff7f -Ace2-|r ## Notes: Another HUD mod -## Version: 0.4.3 ($Revision$) +## Version: 0.5 ($Revision$) ## SavedVariables: IceCoreDB ## OptionalDeps: FuBar_ToFu, DruidBar, SoleManax, MobHealth ## X-Category: UnitFrame @@ -42,6 +42,7 @@ modules\PetMana.lua modules\DruidMana.lua modules\TargetInfo.lua modules\TargetOfTarget.lua +modules\ComboPoints.lua modules\CastBar.lua modules\MirrorBar.lua modules\TimerBar.lua diff --git a/modules/ComboPoints.lua b/modules/ComboPoints.lua new file mode 100644 index 0000000..505528b --- /dev/null +++ b/modules/ComboPoints.lua @@ -0,0 +1,210 @@ +local AceOO = AceLibrary("AceOO-2.0") + +local ComboPoints = AceOO.Class(IceElement) + +ComboPoints.prototype.comboSize = 20 + +-- Constructor -- +function ComboPoints.prototype:init() + ComboPoints.super.prototype.init(self, "ComboPoints") + + self:SetColor("combo", 1, 1, 0) + self.scalingEnabled = true +end + + + +-- 'Public' methods ----------------------------------------------------------- + + +-- OVERRIDE +function ComboPoints.prototype:GetOptions() + local opts = ComboPoints.super.prototype.GetOptions(self) + + opts["vpos"] = { + type = "range", + name = "Vertical Position", + desc = "Vertical Position", + get = function() + return self.moduleSettings.vpos + end, + set = function(v) + self.moduleSettings.vpos = v + self:Redraw() + end, + min = -300, + max = 200, + step = 10, + order = 31 + } + + opts["comboFontSize"] = { + type = "range", + name = "Combo Points Font Size", + desc = "Combo Points Font Size", + get = function() + return self.moduleSettings.comboFontSize + end, + set = function(v) + self.moduleSettings.comboFontSize = v + self:Redraw() + end, + min = 10, + max = 40, + step = 1, + order = 32 + } + + opts["comboMode"] = { + type = "text", + name = "Display Mode", + desc = "Show graphical or numeric combo points", + get = function() + return self.moduleSettings.comboMode + end, + set = function(v) + self.moduleSettings.comboMode = v + self:Redraw() + end, + validate = { "Numeric", "Graphical" }, + order = 33 + } + + return opts +end + + +-- OVERRIDE +function ComboPoints.prototype:GetDefaultSettings() + local defaults = ComboPoints.super.prototype.GetDefaultSettings(self) + defaults["vpos"] = -30 + defaults["comboFontSize"] = 20 + defaults["comboMode"] = "Graphical" + return defaults +end + + +-- OVERRIDE +function ComboPoints.prototype:Redraw() + ComboPoints.super.prototype.Redraw(self) + + self:CreateFrame() + self:UpdateComboPoints() +end + + +-- OVERRIDE +function ComboPoints.prototype:Enable() + ComboPoints.super.prototype.Enable(self) + + self:RegisterEvent("PLAYER_TARGET_CHANGED", "UpdateComboPoints") + self:RegisterEvent("PLAYER_COMBO_POINTS", "UpdateComboPoints") +end + + + +-- 'Protected' methods -------------------------------------------------------- + +-- OVERRIDE +function ComboPoints.prototype:CreateFrame() + ComboPoints.super.prototype.CreateFrame(self) + + self.frame:SetFrameStrata("BACKGROUND") + self.frame:SetWidth(self.comboSize*5) + self.frame:SetHeight(1) + self.frame:ClearAllPoints() + self.frame:SetPoint("TOP", self.parent, "BOTTOM", 0, self.moduleSettings.vpos) + + self.frame:Show() + + self:CreateComboFrame() +end + + + +function ComboPoints.prototype:CreateComboFrame() + + -- create numeric combo points + self.frame.numeric = self:FontFactory("Bold", self.moduleSettings.comboFontSize, nil, self.frame.numeric) + + self.frame.numeric:SetWidth(50) + self.frame.numeric:SetJustifyH("CENTER") + self.frame.numeric:SetTextColor(self:GetColor("combo", 0.7)) + + self.frame.numeric:SetPoint("TOP", self.frame, "TOP", 0, 0) + self.frame.numeric:Show() + + if (not self.frame.graphicalBG) then + self.frame.graphicalBG = {} + self.frame.graphical = {} + end + + -- create backgrounds + for i = 1, 5 do + if (not self.frame.graphicalBG[i]) then + self.frame.graphicalBG[i] = CreateFrame("StatusBar", nil, self.frame) + self.frame.graphicalBG[i]:SetStatusBarTexture(IceElement.TexturePath .. "ComboBG") + end + self.frame.graphicalBG[i]:SetFrameStrata("BACKGROUND") + self.frame.graphicalBG[i]:SetWidth(self.comboSize) + self.frame.graphicalBG[i]:SetHeight(self.comboSize) + self.frame.graphicalBG[i]:SetPoint("TOPLEFT", (i-1) * (self.comboSize-5) + (i-1), 0) + self.frame.graphicalBG[i]:SetAlpha(0.3) + self.frame.graphicalBG[i]:SetStatusBarColor(self:GetColor("combo")) + + self.frame.graphicalBG[i]:Hide() + end + + -- create combo points + for i = 1, 5 do + if (not self.frame.graphical[i]) then + self.frame.graphical[i] = CreateFrame("StatusBar", nil, self.frame.graphicalBG[i]) + self.frame.graphical[i]:SetStatusBarTexture(IceElement.TexturePath .. "Combo") + end + self.frame.graphical[i]:SetFrameStrata("BACKGROUND") + self.frame.graphical[i]:SetAllPoints(self.frame.graphicalBG[i]) + + local r, g, b = self:GetColor("combo") + g = g - (0.15*i) + self.frame.graphical[i]:SetStatusBarColor(r, g, b) + + self.frame.graphical[i]:Hide() + end +end + + + +function ComboPoints.prototype:UpdateComboPoints() + local points = GetComboPoints("target") + + if (points == 0) then + points = nil + end + + if (self.moduleSettings.comboMode == "Numeric") then + self.frame.numeric:SetText(points) + else + self.frame.numeric:SetText() + + for i = 1, table.getn(self.frame.graphical) do + if (points ~= nil) then + self.frame.graphicalBG[i]:Show() + else + self.frame.graphicalBG[i]:Hide() + end + + if (points ~= nil and i <= points) then + self.frame.graphical[i]:Show() + else + self.frame.graphical[i]:Hide() + end + end + end +end + + + + + +-- Load us up +ComboPoints:new() diff --git a/modules/MirrorBar.lua b/modules/MirrorBar.lua index 8bc1102..aceaf61 100644 --- a/modules/MirrorBar.lua +++ b/modules/MirrorBar.lua @@ -13,7 +13,7 @@ local MirrorBar = AceOO.Class(IceBarElement) MirrorBar.prototype.timer = nil MirrorBar.prototype.value = nil MirrorBar.prototype.maxValue = nil -MirrorBar.prototype.scale = nil +MirrorBar.prototype.timerScale = nil MirrorBar.prototype.paused = nil MirrorBar.prototype.label = nil @@ -65,7 +65,7 @@ function MirrorBar.prototype:OnUpdate(elapsed) self:Update() - self.value = self.value + (self.scale * elapsed * 1000) + self.value = self.value + (self.timerScale * elapsed * 1000) scale = self.value / self.maxValue @@ -77,12 +77,15 @@ function MirrorBar.prototype:OnUpdate(elapsed) end - local timeRemaining = (self.maxValue - self.value) / 1000 + local timeRemaining = (self.value) / 1000 local remaining = string.format("%.1f", timeRemaining) if (timeRemaining < 0) then -- lag compensation remaining = 0 end + if (timeRemaining > self.maxValue/1000) then + remaining = self.maxValue/1000 + end self:UpdateBar(scale, self.timer) @@ -102,7 +105,7 @@ function MirrorBar.prototype:MirrorStart(timer, value, maxValue, scale, paused, self.timer = timer self.value = value self.maxValue = maxValue - self.scale = scale + self.timerScale = scale self.paused = (paused > 0) self.label = label @@ -134,7 +137,7 @@ function MirrorBar.prototype:CleanUp() self.timer = nil self.value = nil self.maxValue = nil - self.scale = nil + self.timerScale = nil self.paused = nil self.label = nil self.startTime = nil @@ -399,6 +402,7 @@ function MirrorBarHandler.prototype:SetSettings(bar) bar.moduleSettings.barFontBold = self.moduleSettings.barFontBold bar.moduleSettings.lockTextAlpha = self.moduleSettings.lockTextAlpha bar.moduleSettings.textVisible = self.moduleSettings.textVisible + bar.moduleSettings.scale = self.moduleSettings.scale end diff --git a/modules/PetHealth.lua b/modules/PetHealth.lua index ee21071..6c04522 100644 --- a/modules/PetHealth.lua +++ b/modules/PetHealth.lua @@ -7,55 +7,32 @@ function PetHealth.prototype:init() PetHealth.super.prototype.init(self, "PetHealth", "pet") self:SetColor("petHealth", 37, 164, 30) -end - - -function PetHealth.prototype:GetDefaultSettings() - local settings = PetHealth.super.prototype.GetDefaultSettings(self) - settings["side"] = IceCore.Side.Left - settings["offset"] = -1 - settings["scale"] = 0.7 - return settings + + self.scalingEnabled = true end -- OVERRIDE -function PetHealth.prototype:GetOptions() - local opts = PetHealth.super.prototype.GetOptions(self) - opts["scale"] = - { - type = 'range', - name = 'Scale', - desc = 'Scale of the bar', - min = 0.2, - max = 1, - step = 0.05, - isPercent = true, - get = function() - return self.moduleSettings.scale - end, - set = function(value) - self.moduleSettings.scale = value - self:Redraw() - end, - order = 51 - } - return opts +function PetHealth.prototype:GetDefaultSettings() + local settings = PetHealth.super.prototype.GetDefaultSettings(self) + settings["side"] = IceCore.Side.Left + settings["offset"] = -1 + settings.scale = 0.7 + return settings end -- OVERRIDE function PetHealth.prototype:CreateFrame() PetHealth.super.prototype.CreateFrame(self) - self.frame:SetScale(self.moduleSettings.scale) - + local point, relativeTo, relativePoint, xoff, yoff = self.frame.bottomUpperText:GetPoint() if (point == "TOPLEFT") then point = "BOTTOMLEFT" else point = "BOTTOMRIGHT" end - + self.frame.bottomUpperText:ClearAllPoints() self.frame.bottomUpperText:SetPoint(point, relativeTo, relativePoint, 0, 0) end diff --git a/modules/PetMana.lua b/modules/PetMana.lua index ffde534..6b36747 100644 --- a/modules/PetMana.lua +++ b/modules/PetMana.lua @@ -10,39 +10,17 @@ function PetMana.prototype:init() self:SetColor("petRage", 171, 59, 59) self:SetColor("petEnergy", 218, 231, 31) self:SetColor("targetFocus", 242, 149, 98) + + self.scalingEnabled = true end -- OVERRIDE -function PetMana.prototype:GetOptions() - local opts = PetMana.super.prototype.GetOptions(self) - opts["scale"] = - { - type = 'range', - name = 'Scale', - desc = 'Scale of the bar', - min = 0.2, - max = 1, - step = 0.05, - isPercent = true, - get = function() - return self.moduleSettings.scale - end, - set = function(value) - self.moduleSettings.scale = value - self:Redraw() - end, - order = 51 - } - return opts -end - - function PetMana.prototype:GetDefaultSettings() local settings = PetMana.super.prototype.GetDefaultSettings(self) settings["side"] = IceCore.Side.Right settings["offset"] = -1 - settings["scale"] = 0.7 + settings.scale = 0.7 return settings end @@ -50,8 +28,7 @@ end -- OVERRIDE function PetMana.prototype:CreateFrame() PetMana.super.prototype.CreateFrame(self) - self.frame:SetScale(self.moduleSettings.scale) - + local point, relativeTo, relativePoint, xoff, yoff = self.frame.bottomUpperText:GetPoint() if (point == "TOPLEFT") then point = "BOTTOMLEFT" diff --git a/modules/PlayerMana.lua b/modules/PlayerMana.lua index 9e7a5f7..58465c7 100644 --- a/modules/PlayerMana.lua +++ b/modules/PlayerMana.lua @@ -135,6 +135,15 @@ function PlayerMana.prototype:Update(unit) end self:UpdateBar(self.mana/self.maxMana, color) + + -- hide ticker if rest of the bar is not visible + if (self.alpha == 0) then + self.tickerFrame:SetStatusBarColor(self:GetColor("playerEnergy", 0)) + else + self.tickerFrame:SetStatusBarColor(self:GetColor("playerEnergy", self.moduleSettings.tickerAlpha)) + end + + self:SetBottomText1(self.manaPercentage) local amount = self:GetFormattedText(self.mana, self.maxMana) @@ -203,7 +212,7 @@ function PlayerMana.prototype:CreateTickerFrame() self.tickerFrame:Hide() end - self.tickerFrame.spark:SetTexture(IceBarElement.TexturePath .. self.settings.barTexture) + self.tickerFrame.spark:SetTexture(IceElement.TexturePath .. self.settings.barTexture) self.tickerFrame.spark:SetBlendMode("ADD") self.tickerFrame.spark:ClearAllPoints() self.tickerFrame.spark:SetAllPoints(self.tickerFrame) diff --git a/modules/TargetInfo.lua b/modules/TargetInfo.lua index f56e77d..dd2e221 100644 --- a/modules/TargetInfo.lua +++ b/modules/TargetInfo.lua @@ -10,8 +10,9 @@ TargetInfo.prototype.buffSize = nil function TargetInfo.prototype:init() TargetInfo.super.prototype.init(self, "TargetInfo") - self:SetColor("combo", 1, 1, 0) self.buffSize = math.floor((TargetInfo.Width - 15) / 16) + + self.scalingEnabled = true end @@ -23,6 +24,23 @@ end function TargetInfo.prototype:GetOptions() local opts = TargetInfo.super.prototype.GetOptions(self) + opts["vpos"] = { + type = "range", + name = "Vertical Position", + desc = "Vertical Position", + get = function() + return self.moduleSettings.vpos + end, + set = function(v) + self.moduleSettings.vpos = v + self:Redraw() + end, + min = -300, + max = 300, + step = 10, + order = 31 + } + opts["fontSize"] = { type = 'range', name = 'Font Size', @@ -37,26 +55,9 @@ function TargetInfo.prototype:GetOptions() min = 8, max = 20, step = 1, - order = 31 - } - - opts["comboFontSize"] = { - type = 'range', - name = 'Combo Points Font Size', - desc = 'Combo Points Font Size', - get = function() - return self.moduleSettings.comboFontSize - end, - set = function(v) - self.moduleSettings.comboFontSize = v - self:Redraw() - end, - min = 10, - max = 40, - step = 1, order = 32 } - + return opts end @@ -65,7 +66,7 @@ end function TargetInfo.prototype:GetDefaultSettings() local defaults = TargetInfo.super.prototype.GetDefaultSettings(self) defaults["fontSize"] = 13 - defaults["comboFontSize"] = 20 + defaults["vpos"] = -50 return defaults end @@ -73,10 +74,8 @@ end -- OVERRIDE function TargetInfo.prototype:Redraw() TargetInfo.super.prototype.Redraw(self) - - self:CreateTextFrame() - self:CreateInfoTextFrame() - self:CreateComboFrame() + + self:CreateFrame() end @@ -93,8 +92,6 @@ function TargetInfo.prototype:Enable() self:RegisterEvent("UNIT_DYNAMIC_FLAGS", "InfoTextChanged") self:RegisterEvent("RAID_TARGET_UPDATE", "RaidIconChanged") - - self:RegisterEvent("PLAYER_COMBO_POINTS", "ComboPointsChanged") end @@ -108,7 +105,8 @@ function TargetInfo.prototype:CreateFrame() self.frame:SetWidth(TargetInfo.Width) self.frame:SetHeight(42) self.frame:ClearAllPoints() - self.frame:SetPoint("TOP", self.parent, "BOTTOM", 0, -50) + self.frame:SetPoint("TOP", self.parent, "BOTTOM", 0, self.moduleSettings.vpos) + self.frame:SetScale(self.moduleSettings.scale) self.frame:Show() @@ -117,7 +115,6 @@ function TargetInfo.prototype:CreateFrame() self:CreateBuffFrame() self:CreateDebuffFrame() self:CreateRaidIconFrame() - self:CreateComboFrame() end @@ -147,18 +144,11 @@ function TargetInfo.prototype:CreateInfoTextFrame() end -function TargetInfo.prototype:CreateComboFrame() - self.frame.comboPoints = self:FontFactory("Bold", self.moduleSettings.comboFontSize, nil, self.frame.comboPoints) - - self.frame.comboPoints:SetWidth(TargetInfo.Width) - self.frame.comboPoints:SetJustifyH("CENTER") - - self.frame.comboPoints:SetPoint("BOTTOM", self.frame, "TOP", 0, 5) - self.frame.comboPoints:Show() -end - - function TargetInfo.prototype:CreateRaidIconFrame() + if (self.frame.raidIcon) then + return + end + self.frame.raidIcon = self.frame:CreateTexture(nil, "BACKGROUND") self.frame.raidIcon:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcons") @@ -171,6 +161,10 @@ end function TargetInfo.prototype:CreateBuffFrame() + if (self.frame.buffFrame) then + return + end + self.frame.buffFrame = CreateFrame("Frame", nil, self.frame) self.frame.buffFrame:SetFrameStrata("BACKGROUND") @@ -185,6 +179,10 @@ end function TargetInfo.prototype:CreateDebuffFrame() + if (self.frame.debuffFrame) then + return + end + self.frame.debuffFrame = CreateFrame("Frame", nil, self.frame) self.frame.debuffFrame:SetFrameStrata("BACKGROUND") @@ -263,11 +261,6 @@ function TargetInfo.prototype:AuraChanged(unit) end -function TargetInfo.prototype:ComboPointsChanged() - self:UpdateComboPoints() -end - - function TargetInfo.prototype:RaidIconChanged(unit) if (unit == "target") then self:UpdateRaidTargetIcon() @@ -291,18 +284,6 @@ function TargetInfo.prototype:UpdateRaidTargetIcon() end -function TargetInfo.prototype:UpdateComboPoints() - local points = GetComboPoints("target") - self.frame.comboPoints:SetTextColor(self:GetColor("combo", 0.7)) - - if (points == 0) then - points = nil - end - - self.frame.comboPoints:SetText(points) -end - - function TargetInfo.prototype:TargetChanged() local name = UnitName("target") local _, unitClass = UnitClass("target") @@ -312,16 +293,9 @@ function TargetInfo.prototype:TargetChanged() self.frame.targetInfo:SetText(self:GetInfoString()) self:UpdateBuffs() self:UpdateRaidTargetIcon() - self:UpdateComboPoints() end -function TargetInfo.prototype:CombatCheck(arg1) - print(arg1) -end - - - function TargetInfo.prototype:GetInfoString() local u = "target" diff --git a/modules/TargetOfTarget.lua b/modules/TargetOfTarget.lua index 4d425dd..69df680 100644 --- a/modules/TargetOfTarget.lua +++ b/modules/TargetOfTarget.lua @@ -16,6 +16,8 @@ function TargetOfTarget.prototype:init() self.buffSize = 15 self.stackedDebuffs = {} + + self.scalingEnabled = true end @@ -23,6 +25,23 @@ end function TargetOfTarget.prototype:GetOptions() local opts = TargetOfTarget.super.prototype.GetOptions(self) + opts["vpos"] = { + type = "range", + name = "Vertical Position", + desc = "Vertical Position", + get = function() + return self.moduleSettings.vpos + end, + set = function(v) + self.moduleSettings.vpos = v + self:Redraw() + end, + min = -300, + max = 300, + step = 10, + order = 31 + } + opts["showDebuffs"] = { type = "toggle", name = "Show stacking debuffs", @@ -34,7 +53,7 @@ function TargetOfTarget.prototype:GetOptions() self.moduleSettings.showDebuffs = value self:UpdateBuffs() end, - order = 31 + order = 32 } opts["fontSize"] = { @@ -51,7 +70,7 @@ function TargetOfTarget.prototype:GetOptions() min = 8, max = 20, step = 1, - order = 32 + order = 33 } return opts @@ -61,6 +80,7 @@ end -- OVERRIDE function TargetOfTarget.prototype:GetDefaultSettings() local defaults = TargetOfTarget.super.prototype.GetDefaultSettings(self) + defaults["vpos"] = -50 defaults["showDebuffs"] = true defaults["fontSize"] = 13 return defaults @@ -71,8 +91,7 @@ end function TargetOfTarget.prototype:Redraw() TargetOfTarget.super.prototype.Redraw(self) - self:CreateToTFrame() - self:CreateToTHPFrame() + self:CreateFrame() end @@ -103,7 +122,8 @@ function TargetOfTarget.prototype:CreateFrame() self.frame:SetFrameStrata("BACKGROUND") self.frame:SetWidth(260) self.frame:SetHeight(50) - self.frame:SetPoint("TOP", self.parent, "BOTTOM", 0, -50) + self.frame:SetPoint("TOP", self.parent, "BOTTOM", 0, self.moduleSettings.vpos) + self.frame:SetScale(self.moduleSettings.scale) self.frame:Show() self:CreateToTFrame() @@ -139,15 +159,18 @@ end function TargetOfTarget.prototype:CreateDebuffFrame() + if (self.frame.debuffFrame) then + return + end self.frame.debuffFrame = CreateFrame("Frame", nil, self.frame) - + self.frame.debuffFrame:SetFrameStrata("BACKGROUND") self.frame.debuffFrame:SetWidth(200) self.frame.debuffFrame:SetHeight(20) - + self.frame.debuffFrame:SetPoint("TOPLEFT", self.frame, "TOPRIGHT", 4, 0) self.frame.debuffFrame:Show() - + self.frame.debuffFrame.buffs = self:CreateIconFrames(self.frame.debuffFrame) end diff --git a/textures/Combo.blp b/textures/Combo.blp new file mode 100644 index 0000000..e1a2f90 Binary files /dev/null and b/textures/Combo.blp differ diff --git a/textures/ComboBG.blp b/textures/ComboBG.blp new file mode 100644 index 0000000..95d7661 Binary files /dev/null and b/textures/ComboBG.blp differ