mirror of
https://github.com/parnic/ice-hud.git
synced 2025-06-16 22:51:53 -05:00
Compare commits
28 Commits
Author | SHA1 | Date | |
---|---|---|---|
02c1d04874 | |||
9026b95f6f | |||
74255c2ac3 | |||
b066269ba0 | |||
56ae139c52 | |||
560e0674da | |||
67df0a178b | |||
5e04739306 | |||
605b4884df | |||
d30d971cda | |||
1a62f6b33a | |||
63462ae340 | |||
d9571c6636 | |||
866c439621 | |||
5e778647ff | |||
54469655f6 | |||
bfcf8de7b4 | |||
07ff89e8f8 | |||
7258f037ee | |||
5f48afadff | |||
149d22ad3a | |||
996942ae0e | |||
be6d1f6862 | |||
3334bb6286 | |||
ed5b8f90a9 | |||
9a3b8fb0bd | |||
980cfd2f8e | |||
5c53ab94ce |
2
.mailmap
Normal file
2
.mailmap
Normal file
@ -0,0 +1,2 @@
|
||||
Parnic <parnic@parnic.com> Parnic <chris@parnic.com>
|
||||
rokiyo <rokiyo@example.com> Rokiyo <Rokiyo@example.com>
|
@ -261,12 +261,12 @@ end
|
||||
|
||||
function IceCore.prototype:RedirectRemovedModules()
|
||||
local _, class = UnitClass("player")
|
||||
if class == "WARRIOR" and self.settings.modules["SunderCount"] then
|
||||
if class == "WARRIOR" and self.settings.modules["SunderCount"] and IceHUD.WowVer < 60000 then
|
||||
if self.settings.modules["SunderCount"].enabled or self.settings.modules["SunderCount"].enabled == nil then
|
||||
local bFound = false
|
||||
|
||||
for k,v in pairs(self.elements) do
|
||||
if v.moduleSettings.customBarType == "Counter"
|
||||
if v.moduleSettings.customBarType == "Counter" and v.moduleSettings.auraName
|
||||
and string.upper(v.moduleSettings.auraName) == string.upper(GetSpellInfo(SUNDER_SPELL_ID)) then
|
||||
bFound = true
|
||||
break
|
||||
@ -302,7 +302,7 @@ function IceCore.prototype:RedirectRemovedModules()
|
||||
if self.settings.modules["LacerateCount"].enabled or self.settings.modules["LacerateCount"].enabled == nil then
|
||||
local bFound = false
|
||||
for k,v in pairs(self.elements) do
|
||||
if v.moduleSettings.customBarType == "Counter"
|
||||
if v.moduleSettings.customBarType == "Counter" and v.moduleSettings.auraName
|
||||
and string.upper(v.moduleSettings.auraName) == string.upper(GetSpellInfo(LACERATE_SPELL_ID)) then
|
||||
bFound = true
|
||||
break
|
||||
@ -339,7 +339,7 @@ function IceCore.prototype:RedirectRemovedModules()
|
||||
if self.settings.modules["MaelstromCount"].enabled or self.settings.modules["MaelstromCount"].enabled == nil then
|
||||
local bFound = false
|
||||
for k,v in pairs(self.elements) do
|
||||
if v.moduleSettings.customBarType == "Counter"
|
||||
if v.moduleSettings.customBarType == "Counter" and v.moduleSettings.auraName
|
||||
and string.upper(v.moduleSettings.auraName) == string.upper(GetSpellInfo(MAELSTROM_SPELL_ID)) then
|
||||
bFound = true
|
||||
break
|
||||
|
@ -372,12 +372,12 @@ function IceHUD:GetDebuffCount(unit, ability, onlyMine, matchByName)
|
||||
end
|
||||
|
||||
function IceHUD:GetAuraCount(auraType, unit, ability, onlyMine, matchByName)
|
||||
if not unit then
|
||||
if not unit or not ability then
|
||||
return 0
|
||||
end
|
||||
|
||||
if unit == "main hand weapon" or unit == "off hand weapon" then
|
||||
local hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges
|
||||
local hasMainHandEnchant, mainHandExpiration, mainHandCharges, mainHandEnchantID, hasOffHandEnchant, offHandExpiration, offHandCharges, offHandEnchantID
|
||||
= GetWeaponEnchantInfo()
|
||||
|
||||
if unit == "main hand weapon" and hasMainHandEnchant then
|
||||
|
@ -1,9 +1,9 @@
|
||||
## Interface: 60000
|
||||
## Interface: 60100
|
||||
## Author: Parnic, originally created by Iceroth
|
||||
## Name: IceHUD
|
||||
## Title: IceHUD |cff7fff7f-Ace3-|r
|
||||
## Notes: Another HUD addon
|
||||
## Version: @project-version@ (Revision: @project-revision@)
|
||||
## Version: @project-version@
|
||||
## SavedVariables: IceCoreDB
|
||||
## OptionalDeps: Ace3, LibSharedMedia-3.0, LibDogTag-3.0, LibDogTag-Unit-3.0, LibRangeCheck-2.0, LibDualSpec-1.0, LibDBIcon-1.0, AceGUI-3.0-SharedMediaWidgets
|
||||
## X-Compatible-With: 50400
|
||||
@ -78,6 +78,7 @@ modules\HolyPower.lua
|
||||
modules\Shards.lua
|
||||
modules\EclipseBar.lua
|
||||
modules\Vengeance.lua
|
||||
modules\Resolve.lua
|
||||
modules\PlayerAlternatePower.lua
|
||||
modules\HarmonyPower.lua
|
||||
modules\MonkManaBar.lua
|
||||
@ -85,6 +86,7 @@ modules\ShadowOrbs.lua
|
||||
modules\TargetAbsorb.lua
|
||||
modules\PlayerAbsorb.lua
|
||||
modules\FocusAbsorb.lua
|
||||
modules\Stagger.lua
|
||||
|
||||
#@do-not-package@
|
||||
IceHUD_Options\Options.lua
|
||||
|
@ -1,4 +1,4 @@
|
||||
## Interface: 60000
|
||||
## Interface: 60100
|
||||
## Title: IceHUD |cff7fff7f-Options-|r
|
||||
## Author: Parnic
|
||||
## Version: @project-version@
|
||||
|
@ -71,7 +71,13 @@ This isn't |cff9999ffIceHUD|r - it's Blizzard's new Spell Alerts they added in 4
|
||||
Expand "|cffffdc42Module Settings|r", expand whatever module you want to move (e.g. PlayerHealth, PlayerMana), and adjust the "Side" and "Offset" settings. "Side" controls whether it's on the left or the right and "Offset" controls how far from center it is.
|
||||
|
||||
|cff9999ff14. Which module displays Monk Chi power?|r
|
||||
This module is called HarmonyPower. Harmony was the original name for Chi back when 5.0 was in beta, so I used Blizzard's name for it while I was developing for Cataclysm. I feel like it's too late to change now that many people are familiar with the Harmony name.]]
|
||||
This module is called HarmonyPower. Harmony was the original name for Chi back when 5.0 was in beta, so I used Blizzard's name for it while I was developing for Cataclysm. I feel like it's too late to change now that many people are familiar with the Harmony name.
|
||||
|
||||
|cff9999ff15. How do I add commas/periods into big numbers like health?|r
|
||||
If you have DogTags enabled, you can open the Text Settings for the module in question and add SeparateDigits() around the tag you're trying to split up. To display Health/MaxHealth with commas, use: [(SeparateDigits(HP):HPColor "/" SeparateDigits(MaxHP):HPColor):Bracket]. To use periods instead of commas, use: [(SeparateDigits(HP, "."):HPColor "/" SeparateDigits(MaxHP, "."):HPColor):Bracket]. Use the /dog help menu to build your own similar tags for Mana, etc.
|
||||
|
||||
|cff9999ff16. The countdown timers on buffs and debuffs completely obscure the icon. How do I disable the timer text?|r
|
||||
IceHUD is not responsible for this countdown text and cannot control it. The 6.0 patch added an option in the game client to display counts on top of cooldowns. Look at the Action Bars menu under the game's Interface options. You can turn the text on or off there. Mods like OmniCC or CooldownCount will generally give you the same feature but allow you to control when, where, and how the text shows up.]]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -85,7 +85,7 @@ function IceUnitBar.prototype:GetOptions()
|
||||
end,
|
||||
min = 0,
|
||||
max = 1,
|
||||
step = 0.05,
|
||||
step = 0.01,
|
||||
isPercent = true,
|
||||
order = 30.091
|
||||
}
|
||||
|
@ -659,6 +659,11 @@ function IceClassPowerCounter.prototype:SetDisplayMode()
|
||||
for i=1, self.numRunes do
|
||||
self:SetupRuneTexture(i)
|
||||
self.frame.graphical[i]:Show()
|
||||
if self.moduleSettings.inactiveDisplayMode == "Darkened" then
|
||||
self.frame.graphical[i].runebg:Show()
|
||||
else
|
||||
self.frame.graphical[i].runebg:Hide()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@ -691,8 +696,10 @@ function IceClassPowerCounter.prototype:CreateRune(i)
|
||||
self.frame.graphical[i] = CreateFrame("Frame", nil, self.frame)
|
||||
self.frame.graphical[i]:SetFrameStrata("BACKGROUND")
|
||||
|
||||
self.frame.graphical[i].rune = self.frame.graphical[i]:CreateTexture(nil, "LOW")
|
||||
self.frame.graphical[i].rune = self.frame.graphical[i]:CreateTexture(nil, "ARTWORK")
|
||||
self.frame.graphical[i].rune:SetVertexColor(0, 0, 0)
|
||||
self.frame.graphical[i].runebg = self.frame.graphical[i]:CreateTexture(nil, "BACKGROUND")
|
||||
self.frame.graphical[i].runebg:SetVertexColor(0, 0, 0)
|
||||
self:SetupRuneTexture(i)
|
||||
|
||||
self.frame.graphical[i].shine = self.frame.graphical[i]:CreateTexture(nil, "OVERLAY")
|
||||
@ -713,10 +720,14 @@ function IceClassPowerCounter.prototype:CreateRune(i)
|
||||
self.frame.graphical[i]:SetHeight(self.runeHeight)
|
||||
self.frame.graphical[i].rune:SetWidth(self.runeWidth)
|
||||
self.frame.graphical[i].rune:SetHeight(self.runeHeight)
|
||||
self.frame.graphical[i].runebg:SetWidth(self.runeWidth)
|
||||
self.frame.graphical[i].runebg:SetHeight(self.runeHeight)
|
||||
if self.currentGrowMode == self.growModes["width"] then
|
||||
self.frame.graphical[i].rune:SetPoint("LEFT", self.frame.graphical[i], "LEFT")
|
||||
self.frame.graphical[i].runebg:SetPoint("LEFT", self.frame.graphical[i], "LEFT")
|
||||
else
|
||||
self.frame.graphical[i].rune:SetPoint("BOTTOM", self.frame.graphical[i], "BOTTOM")
|
||||
self.frame.graphical[i].runebg:SetPoint("BOTTOM", self.frame.graphical[i], "BOTTOM")
|
||||
end
|
||||
end
|
||||
|
||||
@ -734,6 +745,7 @@ function IceClassPowerCounter.prototype:SetupRuneTexture(rune)
|
||||
|
||||
-- make sure any texture aside from the special one is square and has the proper coordinates
|
||||
self.frame.graphical[rune].rune:SetTexCoord(a, b, c, d)
|
||||
self.frame.graphical[rune].runebg:SetTexCoord(a, b, c, d)
|
||||
self.frame.graphical[rune]:SetWidth(width)
|
||||
self.frame:SetWidth(width*self.numRunes)
|
||||
local runeAdjust = rune - (self.numRunes / 2) - 0.5
|
||||
@ -754,6 +766,7 @@ function IceClassPowerCounter.prototype:SetupRuneTexture(rune)
|
||||
elseif self:GetRuneMode() == "Graphical Clean Circle" then
|
||||
self.frame.graphical[rune].rune:SetTexture(IceElement.TexturePath .. "ComboCleanCurves")
|
||||
end
|
||||
self.frame.graphical[rune].runebg:SetTexture(self.frame.graphical[rune].rune:GetTexture())
|
||||
end
|
||||
|
||||
function IceClassPowerCounter.prototype:GetAlphaAdd()
|
||||
@ -771,7 +784,7 @@ end
|
||||
function IceClassPowerCounter.prototype:GetGradientColor(curr)
|
||||
local r, g, b = self:GetCustomColor()
|
||||
local mr, mg, mb = self:GetCustomMinColor()
|
||||
local scale = (curr-1)/(self.numRunes-1)
|
||||
local scale = self.numRunes == 1 and 0 or ((curr-1)/(self.numRunes-1))
|
||||
|
||||
if r < mr then
|
||||
r = ((r-mr)*scale) + mr
|
||||
|
@ -185,6 +185,23 @@ function ComboPoints.prototype:GetOptions()
|
||||
order = 34
|
||||
}
|
||||
|
||||
opts["bShowWithNoTarget"] =
|
||||
{
|
||||
type = 'toggle',
|
||||
name = L["Show with no target"],
|
||||
desc = L["Whether or not to display when you have no target selected but have combo points available"],
|
||||
get = function()
|
||||
return self.moduleSettings.bShowWithNoTarget
|
||||
end,
|
||||
set = function(info, v)
|
||||
self.moduleSettings.bShowWithNoTarget = v
|
||||
self:UpdateComboPoints()
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
}
|
||||
|
||||
return opts
|
||||
end
|
||||
|
||||
@ -202,6 +219,7 @@ function ComboPoints.prototype:GetDefaultSettings()
|
||||
defaults["graphicalLayout"] = "Horizontal"
|
||||
defaults["comboGap"] = 0
|
||||
defaults["showAnticipation"] = true
|
||||
defaults["bShowWithNoTarget"] = true
|
||||
return defaults
|
||||
end
|
||||
|
||||
@ -395,7 +413,12 @@ function ComboPoints.prototype:UpdateComboPoints()
|
||||
elseif IceHUD.WowVer >= 30000 then
|
||||
-- Parnic: apparently some fights have combo points while the player is in a vehicle?
|
||||
local isInVehicle = UnitHasVehicleUI("player")
|
||||
points = GetComboPoints(isInVehicle and "vehicle" or "player", "target")
|
||||
local checkUnit = isInVehicle and "vehicle" or "player"
|
||||
if IceHUD.WowVer >= 60000 then
|
||||
points = UnitPower(checkUnit, 4)
|
||||
else
|
||||
points = GetComboPoints(checkUnit, "target")
|
||||
end
|
||||
_, _, _, anticipate = UnitAura("player", AnticipationAuraName)
|
||||
else
|
||||
points = GetComboPoints("target")
|
||||
@ -416,7 +439,7 @@ function ComboPoints.prototype:UpdateComboPoints()
|
||||
pointsText = pointsText.."+"..tostring(anticipate)
|
||||
end
|
||||
|
||||
if points == 0 and anticipate == 0 then
|
||||
if (points == 0 and anticipate == 0) or (not UnitExists("target") and not self.moduleSettings.bShowWithNoTarget) then
|
||||
self.frame.numeric:SetText(nil)
|
||||
else
|
||||
self.frame.numeric:SetText(pointsText)
|
||||
@ -425,19 +448,21 @@ function ComboPoints.prototype:UpdateComboPoints()
|
||||
self.frame.numeric:SetText()
|
||||
|
||||
for i = 1, table.getn(self.frame.graphical) do
|
||||
if (points > 0) or (anticipate > 0) then
|
||||
local hideIfNoTarget = not UnitExists("target") and not self.moduleSettings.bShowWithNoTarget
|
||||
|
||||
if ((points > 0) or (anticipate > 0)) and not hideIfNoTarget then
|
||||
self.frame.graphicalBG[i]:Show()
|
||||
else
|
||||
self.frame.graphicalBG[i]:Hide()
|
||||
end
|
||||
|
||||
if (i <= points) then
|
||||
if (i <= points) and not hideIfNoTarget then
|
||||
self.frame.graphical[i]:Show()
|
||||
else
|
||||
self.frame.graphical[i]:Hide()
|
||||
end
|
||||
|
||||
if (i <= anticipate) then
|
||||
if (i <= anticipate) and not hideIfNoTarget then
|
||||
self.frame.graphicalAnt[i]:Show()
|
||||
else
|
||||
self.frame.graphicalAnt[i]:Hide()
|
||||
|
@ -30,6 +30,23 @@ function ComboPointsBar.prototype:GetOptions()
|
||||
order = 31
|
||||
}
|
||||
|
||||
opts["bShowWithNoTarget"] =
|
||||
{
|
||||
type = 'toggle',
|
||||
name = L["Show with no target"],
|
||||
desc = L["Whether or not to display when you have no target selected but have combo points available"],
|
||||
get = function()
|
||||
return self.moduleSettings.bShowWithNoTarget
|
||||
end,
|
||||
set = function(info, v)
|
||||
self.moduleSettings.bShowWithNoTarget = v
|
||||
self:UpdateComboPoints()
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
}
|
||||
|
||||
return opts
|
||||
end
|
||||
|
||||
@ -40,6 +57,7 @@ function ComboPointsBar.prototype:GetDefaultSettings()
|
||||
defaults.enabled = false
|
||||
defaults.alwaysDisplay = false
|
||||
defaults.desiredLerpTime = 0.05
|
||||
defaults.bShowWithNoTarget = true
|
||||
return defaults
|
||||
end
|
||||
|
||||
@ -69,7 +87,12 @@ function ComboPointsBar.prototype:UpdateComboPoints()
|
||||
elseif IceHUD.WowVer >= 30000 then
|
||||
-- Parnic: apparently some fights have combo points while the player is in a vehicle?
|
||||
local isInVehicle = UnitHasVehicleUI("player")
|
||||
points = GetComboPoints(isInVehicle and "vehicle" or "player", "target")
|
||||
local checkUnit = isInVehicle and "vehicle" or "player"
|
||||
if IceHUD.WowVer >= 60000 then
|
||||
points = UnitPower(checkUnit, 4)
|
||||
else
|
||||
points = GetComboPoints(checkUnit, "target")
|
||||
end
|
||||
else
|
||||
points = GetComboPoints("target")
|
||||
end
|
||||
@ -78,7 +101,7 @@ function ComboPointsBar.prototype:UpdateComboPoints()
|
||||
points = nil
|
||||
end
|
||||
|
||||
if points == nil or points == 0 then
|
||||
if points == nil or points == 0 or (not UnitExists("target") and not self.moduleSettings.bShowWithNoTarget) then
|
||||
self:Show(self.moduleSettings.alwaysDisplay)
|
||||
self:UpdateBar(0, "undef")
|
||||
else
|
||||
@ -86,10 +109,14 @@ function ComboPointsBar.prototype:UpdateComboPoints()
|
||||
local color = {}
|
||||
self:SetScaledColor(color, (points - 1) / 4.0, self.settings.colors["ComboPointsBarMax"], self.settings.colors["ComboPointsBarMin"])
|
||||
self:UpdateBar(points / 5.0, "undef")
|
||||
self.barFrame.bar:SetVertexColor(color.r, color.g, color.b, 1)
|
||||
self.barFrame.bar:SetVertexColor(color.r, color.g, color.b, self.alpha)
|
||||
end
|
||||
|
||||
self:SetBottomText1(points or "0")
|
||||
end
|
||||
|
||||
function ComboPointsBar.prototype:Update()
|
||||
self:UpdateComboPoints()
|
||||
end
|
||||
|
||||
IceHUD.ComboPointsBar = ComboPointsBar:new()
|
||||
|
@ -619,7 +619,7 @@ function IceCustomBar.prototype:GetAuraDuration(unitName, buffName)
|
||||
end
|
||||
|
||||
if unitName == "main hand weapon" or unitName == "off hand weapon" then
|
||||
local hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges
|
||||
local hasMainHandEnchant, mainHandExpiration, mainHandCharges, mainHandEnchantID, hasOffHandEnchant, offHandExpiration, offHandCharges, offHandEnchantID
|
||||
= GetWeaponEnchantInfo()
|
||||
|
||||
if unitName == "main hand weapon" and hasMainHandEnchant then
|
||||
|
@ -166,7 +166,7 @@ end
|
||||
function IceCustomCDBar.prototype:GetDisplayText(fromValue)
|
||||
local v = fromValue
|
||||
|
||||
if self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL then
|
||||
if not self.moduleSettings.cooldownType or self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL then
|
||||
if tonumber(fromValue) ~= nil then
|
||||
local spellName = GetSpellInfo(tonumber(fromValue))
|
||||
if spellName then
|
||||
@ -250,11 +250,11 @@ function IceCustomCDBar.prototype:GetOptions()
|
||||
desc = L["The type of thing to track the cooldown of"],
|
||||
values = cooldownTypes,
|
||||
get = function()
|
||||
return self.moduleSettings.cooldownType
|
||||
return self.moduleSettings.cooldownType or COOLDOWN_TYPE_SPELL
|
||||
end,
|
||||
set = function(info, v)
|
||||
local updateUpperText = false
|
||||
local dispStr = self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL and self.moduleSettings.cooldownToTrack or self.moduleSettings.itemToTrack
|
||||
local dispStr = (not self.moduleSettings.cooldownType or self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL) and self.moduleSettings.cooldownToTrack or self.moduleSettings.itemToTrack
|
||||
if self:GetDisplayText(dispStr)
|
||||
== self.moduleSettings.upperText then
|
||||
updateUpperText = true
|
||||
@ -262,7 +262,7 @@ function IceCustomCDBar.prototype:GetOptions()
|
||||
|
||||
self.moduleSettings.cooldownType = v
|
||||
|
||||
dispStr = self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL and self.moduleSettings.cooldownToTrack or self.moduleSettings.itemToTrack
|
||||
dispStr = (not self.moduleSettings.cooldownType or self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL) and self.moduleSettings.cooldownToTrack or self.moduleSettings.itemToTrack
|
||||
if updateUpperText then
|
||||
self.moduleSettings.upperText = self:GetDisplayText(dispStr)
|
||||
end
|
||||
@ -302,7 +302,7 @@ function IceCustomCDBar.prototype:GetOptions()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
hidden = function()
|
||||
return self.moduleSettings.cooldownType ~= COOLDOWN_TYPE_SPELL
|
||||
return self.moduleSettings.cooldownType and self.moduleSettings.cooldownType ~= COOLDOWN_TYPE_SPELL
|
||||
end,
|
||||
usage = "<which spell to track>",
|
||||
order = 30.6,
|
||||
@ -314,7 +314,7 @@ function IceCustomCDBar.prototype:GetOptions()
|
||||
desc = L["Which item cooldown this bar will be tracking."],
|
||||
values = localizedInventorySlotNames,
|
||||
get = function()
|
||||
return self.moduleSettings.itemToTrack
|
||||
return self.moduleSettings.itemToTrack or 15
|
||||
end,
|
||||
set = function(info, v)
|
||||
if self:GetDisplayText(self.moduleSettings.itemToTrack) == self.moduleSettings.upperText then
|
||||
@ -424,7 +424,7 @@ function IceCustomCDBar.prototype:GetOptions()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
hidden = function()
|
||||
return self.moduleSettings.cooldownType ~= COOLDOWN_TYPE_SPELL
|
||||
return self.moduleSettings.cooldownType and self.moduleSettings.cooldownType ~= COOLDOWN_TYPE_SPELL
|
||||
end,
|
||||
order = 31.2,
|
||||
}
|
||||
@ -663,13 +663,13 @@ end
|
||||
|
||||
function IceCustomCDBar.prototype:UpdateIcon()
|
||||
if self.barFrame.icon then
|
||||
if self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL then
|
||||
if not self.moduleSettings.cooldownType or self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL then
|
||||
local name, rank, icon = GetSpellInfo(self.moduleSettings.cooldownToTrack)
|
||||
|
||||
if icon ~= nil then
|
||||
self.barFrame.icon:SetTexture(icon)
|
||||
end
|
||||
else
|
||||
elseif self.moduleSettings.itemToTrack then
|
||||
local itemId = GetInventoryItemID("player", GetInventorySlotInfo(validInventorySlotNames[self.moduleSettings.itemToTrack]))
|
||||
if itemId then
|
||||
local name, _, _, _, _, _, _, _, _, texture = GetItemInfo(itemId)
|
||||
@ -700,7 +700,7 @@ function IceCustomCDBar.prototype:UpdateItemUnitInventoryChanged(event, unit)
|
||||
end
|
||||
|
||||
function IceCustomCDBar.prototype:UpdateCustomBarEvent()
|
||||
if self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL then
|
||||
if not self.moduleSettings.cooldownType or self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL then
|
||||
self:UpdateCustomBar()
|
||||
end
|
||||
end
|
||||
@ -711,10 +711,10 @@ function IceCustomCDBar.prototype:UpdateCustomBar(fromUpdate)
|
||||
local auraIcon = nil
|
||||
|
||||
if not fromUpdate then
|
||||
if self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL then
|
||||
if not self.moduleSettings.cooldownType or self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL then
|
||||
self.cooldownDuration, remaining =
|
||||
self:GetCooldownDuration(self.moduleSettings.cooldownToTrack)
|
||||
else
|
||||
elseif self.moduleSettings.itemToTrack then
|
||||
local start = nil
|
||||
start, self.cooldownDuration = GetInventoryItemCooldown("player", GetInventorySlotInfo(validInventorySlotNames[self.moduleSettings.itemToTrack]))
|
||||
if start and start > 0 then
|
||||
@ -797,7 +797,7 @@ end
|
||||
|
||||
function IceCustomCDBar.prototype:IsReady()
|
||||
local is_ready = nil
|
||||
if self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL then
|
||||
if not self.moduleSettings.cooldownType or self.moduleSettings.cooldownType == COOLDOWN_TYPE_SPELL then
|
||||
local checkSpell = self:GetSpellNameOrId(self.moduleSettings.cooldownToTrack)
|
||||
|
||||
if (IsUsableSpell(checkSpell)) then
|
||||
|
@ -549,6 +549,10 @@ end
|
||||
|
||||
|
||||
function IceCustomCount.prototype:UpdateCustomCount()
|
||||
if not self.moduleSettings.auraName then
|
||||
return
|
||||
end
|
||||
|
||||
local points
|
||||
if IceHUD.IceCore:IsInConfigMode() then
|
||||
points = tonumber(self.moduleSettings.maxCount)
|
||||
|
@ -14,6 +14,7 @@ function HarmonyPower.prototype:init()
|
||||
{0.00390625, 0.08593750, 0.71093750, 0.87500000},
|
||||
{0.00390625, 0.08593750, 0.71093750, 0.87500000},
|
||||
{0.00390625, 0.08593750, 0.71093750, 0.87500000},
|
||||
{0.00390625, 0.08593750, 0.71093750, 0.87500000},
|
||||
}
|
||||
self.numRunes = 4
|
||||
self.numericColor = "HarmonyPowerNumeric"
|
||||
@ -32,6 +33,8 @@ function HarmonyPower.prototype:Enable(core)
|
||||
HarmonyPower.super.prototype.Enable(self, core)
|
||||
|
||||
self:RegisterEvent("UNIT_POWER_FREQUENT", "UpdateRunePower")
|
||||
|
||||
self:Redraw()
|
||||
end
|
||||
|
||||
function HarmonyPower.prototype:UpdateRunePower(event, arg1, arg2)
|
||||
|
@ -60,30 +60,35 @@ StaticPopupDialogs["ICEHUD_BUFF_DISMISS_UNAVAILABLE"] =
|
||||
hideOnEscape = 0,
|
||||
}
|
||||
|
||||
local function OnBuffMouseUp(frame, button)
|
||||
if IceHUD.WowVer >= 40000 then
|
||||
if button == "RightButton" then
|
||||
StaticPopup_Show("ICEHUD_BUFF_DISMISS_UNAVAILABLE")
|
||||
end
|
||||
else
|
||||
--[[ if( button == "RightButton" ) then
|
||||
if buffs[i].type == "mh" then
|
||||
CancelItemTempEnchantment(1)
|
||||
elseif buffs[i].type == "oh" then
|
||||
CancelItemTempEnchantment(2)
|
||||
else
|
||||
CancelUnitBuff("player", i)
|
||||
end
|
||||
end]]
|
||||
-- playerinfo buffclick event handle
|
||||
function PlayerInfo.prototype:BuffClick(this,event)
|
||||
if not self:AllowMouseBuffInteraction(this) then
|
||||
return
|
||||
end
|
||||
|
||||
-- We want to catch the rightbutton click.
|
||||
-- We also need to check for combat lockdown. The api won't allow cancelling during combat lockdown.
|
||||
if( event == "RightButton" ) and not InCombatLockdown() then
|
||||
if this.type == "mh" then
|
||||
CancelItemTempEnchantment(1)
|
||||
elseif this.type == "oh" then
|
||||
CancelItemTempEnchantment(2)
|
||||
else
|
||||
CancelUnitBuff(self.unit, this.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function PlayerInfo.prototype:CreateIconFrames(parent, direction, buffs, type)
|
||||
local buffs = PlayerInfo.super.prototype.CreateIconFrames(self, parent, direction, buffs, type)
|
||||
|
||||
if not self.MyOnClickBuffFunc then
|
||||
self.MyOnClickBuffFunc = function(this,event) self:BuffClick(this,event) end
|
||||
end
|
||||
|
||||
for i = 1, IceCore.BuffLimit do
|
||||
if (self.moduleSettings.mouseBuff) then
|
||||
buffs[i]:SetScript("OnMouseUp", OnBuffMouseUp)
|
||||
buffs[i]:SetScript("OnMouseUp", self.MyOnClickBuffFunc)
|
||||
else
|
||||
buffs[i]:SetScript("OnMouseUp", nil)
|
||||
end
|
||||
@ -136,7 +141,7 @@ function PlayerInfo.prototype:UpdateBuffs(unit, fromRepeated)
|
||||
PlayerInfo.super.prototype.UpdateBuffs(self)
|
||||
end
|
||||
|
||||
local hasMainHandEnchant, mainHandExpiration, mainHandCharges, hasOffHandEnchant, offHandExpiration, offHandCharges
|
||||
local hasMainHandEnchant, mainHandExpiration, mainHandCharges, mainHandEnchantID, hasOffHandEnchant, offHandExpiration, offHandCharges, offHandEnchantID
|
||||
= GetWeaponEnchantInfo()
|
||||
|
||||
local startingNum = 0
|
||||
|
116
modules/Resolve.lua
Normal file
116
modules/Resolve.lua
Normal file
@ -0,0 +1,116 @@
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false)
|
||||
local Resolve = IceCore_CreateClass(IceUnitBar)
|
||||
|
||||
local RESOLVE_SPELL_ID = 158298
|
||||
local RESOLVE_MAX = 240
|
||||
|
||||
Resolve.prototype.current = nil
|
||||
Resolve.prototype.max = RESOLVE_MAX
|
||||
|
||||
-- constructor
|
||||
function Resolve.prototype:init()
|
||||
Resolve.super.prototype.init(self, "Resolve", "player")
|
||||
|
||||
self.current = 0
|
||||
self:SetDefaultColor("Resolve", 200, 45, 45)
|
||||
|
||||
self.bTreatEmptyAsFull = true
|
||||
end
|
||||
|
||||
-- default settings
|
||||
function Resolve.prototype:GetDefaultSettings()
|
||||
local defaults = Resolve.super.prototype.GetDefaultSettings(self)
|
||||
defaults.enabled = false
|
||||
defaults.usesDogTagStrings = false
|
||||
defaults.lockUpperTextAlpha = false
|
||||
defaults.shouldAnimate = false
|
||||
defaults.hideAnimationSettings = true
|
||||
defaults.offset = 5
|
||||
defaults.side = IceCore.Side.Left
|
||||
return defaults
|
||||
end
|
||||
|
||||
-- enable plugin
|
||||
function Resolve.prototype:Enable(core)
|
||||
Resolve.super.prototype.Enable(self, core)
|
||||
|
||||
-- Avoiding iteration where I can
|
||||
self:RegisterEvent("UNIT_AURA", "UpdateCurrent")
|
||||
|
||||
self:Update()
|
||||
end
|
||||
|
||||
-- disable plugin
|
||||
function Resolve.prototype:Disable(core)
|
||||
Resolve.super.prototype.Disable(self, core)
|
||||
|
||||
self:UnregisterAllEvents()
|
||||
end
|
||||
|
||||
-- scan the tooltip and extract the Resolve value
|
||||
do
|
||||
-- making these local as they're not used anywhere else
|
||||
local regions = {}
|
||||
local spellName = GetSpellInfo(RESOLVE_SPELL_ID)
|
||||
local tooltipBuffer = CreateFrame("GameTooltip","tooltipBuffer",nil,"GameTooltipTemplate")
|
||||
tooltipBuffer:SetOwner(WorldFrame, "ANCHOR_NONE")
|
||||
|
||||
-- suggested by Antiarc as a way to repopulate the same table instead of repeatedly creating a new one
|
||||
local function makeTable(t, ...)
|
||||
wipe(t)
|
||||
for i = 1, select("#", ...) do
|
||||
t[i] = select(i, ...)
|
||||
end
|
||||
end
|
||||
|
||||
function Resolve.prototype:UpdateCurrent(event, unit)
|
||||
if (unit and (unit ~= self.unit)) then
|
||||
return
|
||||
end
|
||||
|
||||
local name = UnitAura(self.unit, spellName)
|
||||
if name then
|
||||
-- Buff found, copy it into the buffer for scanning
|
||||
tooltipBuffer:ClearLines()
|
||||
tooltipBuffer:SetUnitBuff(self.unit, name)
|
||||
|
||||
-- Grab all regions, stuff em into our table
|
||||
makeTable(regions, tooltipBuffer:GetRegions())
|
||||
|
||||
-- Convert FontStrings to strings, replace anything else with ""
|
||||
for i=1, #regions do
|
||||
local region = regions[i]
|
||||
regions[i] = region:GetObjectType() == "FontString" and region:GetText() or ""
|
||||
end
|
||||
|
||||
-- Find the number, save it
|
||||
self.current = tonumber(string.match(table.concat(regions),"%d+")) or 0
|
||||
else
|
||||
self.current = 0
|
||||
end
|
||||
|
||||
self:Update()
|
||||
end
|
||||
end
|
||||
|
||||
function Resolve.prototype:Update()
|
||||
Resolve.super.prototype.Update(self)
|
||||
|
||||
if self.current == 0 then
|
||||
self:Show(false)
|
||||
return
|
||||
else
|
||||
self:Show(true)
|
||||
end
|
||||
|
||||
self:UpdateBar(self.current / self.max, "Resolve")
|
||||
self:SetBottomText1(floor((self.current / self.max) * 100) .. "%")
|
||||
self:SetBottomText2(tostring(self.current) .."/"..tostring(self.max))
|
||||
end
|
||||
|
||||
-- Load for tanks only
|
||||
local _, unitClass = UnitClass("player")
|
||||
if ((unitClass == "DEATHKNIGHT" or unitClass == "DRUID" or unitClass == "PALADIN" or unitClass == "WARRIOR" or unitClass == "MONK")
|
||||
and IceHUD.WowVer >= 60000) then
|
||||
IceHUD.Resolve = Resolve:new()
|
||||
end
|
@ -67,6 +67,13 @@ function ShardCounter.prototype:UpdateRunePower(event, arg1, arg2)
|
||||
ShardCounter.super.prototype.UpdateRunePower(self, event, arg1, arg2)
|
||||
end
|
||||
|
||||
function ShardCounter.prototype:CheckGreenFire()
|
||||
if IsSpellKnown(WARLOCK_GREEN_FIRE) then
|
||||
self:Redraw();
|
||||
self:UnregisterEvent("SPELLS_CHANGED")
|
||||
end
|
||||
end
|
||||
|
||||
function ShardCounter.prototype:UpdatePowerType(event)
|
||||
if IceHUD.WowVer >= 50000 then
|
||||
CurrentSpec = GetSpecialization()
|
||||
@ -121,6 +128,8 @@ function ShardCounter.prototype:UpdatePowerType(event)
|
||||
if not IsPlayerSpell(WARLOCK_BURNING_EMBERS) then
|
||||
self.requiredSpec = -1
|
||||
self:RegisterEvent("SPELLS_CHANGED", "UpdatePowerType")
|
||||
elseif not IsSpellKnown(WARLOCK_GREEN_FIRE) then
|
||||
self:RegisterEvent("SPELLS_CHANGED", "CheckGreenFire")
|
||||
else
|
||||
self:UnregisterEvent("SPELLS_CHANGED", "UpdatePowerType")
|
||||
end
|
||||
@ -186,7 +195,11 @@ function ShardCounter.prototype:GetRuneTexture(rune)
|
||||
end
|
||||
|
||||
if CurrentSpec == SPEC_WARLOCK_DESTRUCTION then
|
||||
return "Interface\\PlayerFrame\\Warlock-DestructionUI"
|
||||
if IsSpellKnown(WARLOCK_GREEN_FIRE) then
|
||||
return "Interface\\PlayerFrame\\Warlock-DestructionUI-Green"
|
||||
else
|
||||
return "Interface\\PlayerFrame\\Warlock-DestructionUI"
|
||||
end
|
||||
elseif CurrentSpec == SPEC_WARLOCK_DEMONOLOGY then
|
||||
return "Interface\\PlayerFrame\\Warlock-DemonologyUI"
|
||||
end
|
||||
@ -195,15 +208,15 @@ function ShardCounter.prototype:GetRuneTexture(rune)
|
||||
end
|
||||
|
||||
function ShardCounter.prototype:ShowBlizz()
|
||||
ShardBarFrame:Show()
|
||||
WarlockPowerFrame:Show()
|
||||
|
||||
ShardBarFrame:GetScript("OnLoad")(ShardBarFrame)
|
||||
WarlockPowerFrame:GetScript("OnLoad")(WarlockPowerFrame)
|
||||
end
|
||||
|
||||
function ShardCounter.prototype:HideBlizz()
|
||||
ShardBarFrame:Hide()
|
||||
WarlockPowerFrame:Hide()
|
||||
|
||||
ShardBarFrame:UnregisterAllEvents()
|
||||
WarlockPowerFrame:UnregisterAllEvents()
|
||||
end
|
||||
|
||||
-- Load us up
|
||||
|
@ -50,7 +50,7 @@ function SliceAndDice.prototype:Enable(core)
|
||||
SliceAndDice.super.prototype.Enable(self, core)
|
||||
|
||||
self:RegisterEvent("UNIT_AURA", "UpdateSliceAndDice")
|
||||
self:RegisterEvent("UNIT_COMBO_POINTS", "UpdateDurationBar")
|
||||
self:RegisterEvent("UNIT_COMBO_POINTS", "ComboPointsChanged")
|
||||
|
||||
if not self.moduleSettings.alwaysFullAlpha then
|
||||
self:Show(false)
|
||||
@ -61,16 +61,15 @@ function SliceAndDice.prototype:Enable(core)
|
||||
self:SetBottomText1("")
|
||||
end
|
||||
|
||||
function SliceAndDice.prototype:TargetChanged()
|
||||
SliceAndDice.super.prototype.TargetChanged(self)
|
||||
self:UpdateDurationBar()
|
||||
self:UpdateSliceAndDice()
|
||||
end
|
||||
|
||||
function SliceAndDice.prototype:Disable(core)
|
||||
SliceAndDice.super.prototype.Disable(self, core)
|
||||
end
|
||||
|
||||
function SliceAndDice.prototype:ComboPointsChanged()
|
||||
self:TargetChanged()
|
||||
self:UpdateDurationBar()
|
||||
end
|
||||
|
||||
-- OVERRIDE
|
||||
function SliceAndDice.prototype:GetDefaultSettings()
|
||||
local settings = SliceAndDice.super.prototype.GetDefaultSettings(self)
|
||||
@ -90,6 +89,7 @@ function SliceAndDice.prototype:GetDefaultSettings()
|
||||
settings["lowerTextVisible"] = false
|
||||
settings["hideAnimationSettings"] = true
|
||||
settings["bAllowExpand"] = true
|
||||
settings["bShowWithNoTarget"] = true
|
||||
|
||||
return settings
|
||||
end
|
||||
@ -137,6 +137,23 @@ function SliceAndDice.prototype:GetOptions()
|
||||
end
|
||||
}
|
||||
|
||||
opts["bShowWithNoTarget"] =
|
||||
{
|
||||
type = 'toggle',
|
||||
name = L["Show with no target"],
|
||||
desc = L["Whether or not to display when you have no target selected but have combo points available"],
|
||||
get = function()
|
||||
return self.moduleSettings.bShowWithNoTarget
|
||||
end,
|
||||
set = function(info, v)
|
||||
self.moduleSettings.bShowWithNoTarget = v
|
||||
self:ComboPointsChanged()
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end,
|
||||
}
|
||||
|
||||
return opts
|
||||
end
|
||||
|
||||
@ -212,11 +229,21 @@ function SliceAndDice.prototype:MyOnUpdate()
|
||||
if self.bUpdateSnd then
|
||||
self:UpdateSliceAndDice(nil, self.unit, true)
|
||||
end
|
||||
if self.target then
|
||||
if self.target or self.moduleSettings.bShowWithNoTarget then
|
||||
self:UpdateDurationBar()
|
||||
end
|
||||
end
|
||||
|
||||
local function SNDGetComboPoints(unit)
|
||||
if IceHUD.WowVer >= 60000 then
|
||||
return UnitPower(unit, 4)
|
||||
elseif IceHUD.WowVer >= 30000 then
|
||||
return GetComboPoints(unit, "target")
|
||||
else
|
||||
return GetComboPoints()
|
||||
end
|
||||
end
|
||||
|
||||
function SliceAndDice.prototype:UpdateSliceAndDice(event, unit, fromUpdate)
|
||||
if unit and unit ~= self.unit then
|
||||
return
|
||||
@ -249,7 +276,7 @@ function SliceAndDice.prototype:UpdateSliceAndDice(event, unit, fromUpdate)
|
||||
else
|
||||
self:UpdateBar(0, "SliceAndDice")
|
||||
|
||||
if ((IceHUD.WowVer >= 30000 and GetComboPoints(self.unit, "target") == 0) or (IceHUD.WowVer < 30000 and GetComboPoints() == 0)) or not UnitExists("target") then
|
||||
if SNDGetComboPoints(self.unit) == 0 or (not UnitExists("target") and not self.moduleSettings.bShowWithNoTarget) then
|
||||
if self.bIsVisible then
|
||||
self.bUpdateSnd = nil
|
||||
end
|
||||
@ -267,18 +294,24 @@ function SliceAndDice.prototype:UpdateSliceAndDice(event, unit, fromUpdate)
|
||||
end
|
||||
end
|
||||
|
||||
function SliceAndDice.prototype:TargetChanged()
|
||||
if self.moduleSettings.bShowWithNoTarget and SNDGetComboPoints(self.unit) > 0 then
|
||||
self.target = true
|
||||
else
|
||||
self.target = UnitExists("target")
|
||||
end
|
||||
self:Update(self.unit)
|
||||
|
||||
self:UpdateDurationBar()
|
||||
self:UpdateSliceAndDice()
|
||||
end
|
||||
|
||||
function SliceAndDice.prototype:UpdateDurationBar(event, unit)
|
||||
if unit and unit ~= self.unit then
|
||||
return
|
||||
end
|
||||
|
||||
local points
|
||||
if IceHUD.WowVer >= 30000 then
|
||||
points = GetComboPoints(self.unit, "target")
|
||||
else
|
||||
points = GetComboPoints("target")
|
||||
end
|
||||
local scale
|
||||
local points = SNDGetComboPoints(self.unit)
|
||||
|
||||
-- first, set the cached upper limit of SnD duration
|
||||
CurrMaxSnDDuration = self:GetMaxBuffTime(maxComboPoints)
|
||||
@ -295,7 +328,7 @@ function SliceAndDice.prototype:UpdateDurationBar(event, unit)
|
||||
self.durationFrame:Show()
|
||||
|
||||
-- if we have combo points and a target selected, go ahead and show the bar so the duration bar can be seen
|
||||
if points > 0 and UnitExists("target") then
|
||||
if points > 0 and (UnitExists("target") or self.moduleSettings.bShowWithNoTarget) then
|
||||
self:Show(true)
|
||||
end
|
||||
|
||||
@ -303,7 +336,7 @@ function SliceAndDice.prototype:UpdateDurationBar(event, unit)
|
||||
PotentialSnDDuration = self:GetMaxBuffTime(points)
|
||||
|
||||
-- compute the scale from the current number of combo points
|
||||
scale = IceHUD:Clamp(PotentialSnDDuration / CurrMaxSnDDuration, 0, 1)
|
||||
local scale = IceHUD:Clamp(PotentialSnDDuration / CurrMaxSnDDuration, 0, 1)
|
||||
|
||||
-- sadly, animation uses bar-local variables so we can't use the animation for 2 bar textures on the same bar element
|
||||
if (self.moduleSettings.reverse) then
|
||||
|
304
modules/Stagger.lua
Normal file
304
modules/Stagger.lua
Normal file
@ -0,0 +1,304 @@
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale("IceHUD", false)
|
||||
local StaggerBar = IceCore_CreateClass(IceUnitBar)
|
||||
local IceHUD = _G.IceHUD
|
||||
|
||||
local tostring = tostring
|
||||
local floor = math.floor
|
||||
local min = math.min
|
||||
local strform = string.format
|
||||
|
||||
local playerName = ""
|
||||
local LightID = 124275
|
||||
local ModerateID = 124274
|
||||
local HeavyID = 124273
|
||||
local StaggerID = 124255
|
||||
local staggerNames = {"", "", ""}
|
||||
|
||||
local MinLevel = 10
|
||||
|
||||
StaggerBar.prototype.StaggerDuration = 0
|
||||
StaggerBar.prototype.StaggerEndTime = 0
|
||||
|
||||
local function ReadableNumber(num, places)
|
||||
local ret
|
||||
local placeValue = ("%%.%df"):format(places or 0)
|
||||
|
||||
if not num then
|
||||
ret = 0
|
||||
elseif num >= 1000000 then
|
||||
ret = placeValue:format(num / 1000000) .. "M" -- million
|
||||
elseif num >= 1000 then
|
||||
ret = placeValue:format(num / 1000) .. "k" -- thousand
|
||||
else
|
||||
ret = num -- hundreds
|
||||
end
|
||||
|
||||
return ret
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:init()
|
||||
StaggerBar.super.prototype.init(self, "Stagger", "player")
|
||||
|
||||
self:SetDefaultColor("Stagger1", 200, 180, 20)
|
||||
self:SetDefaultColor("Stagger2", 200, 90, 10)
|
||||
self:SetDefaultColor("Stagger3", 200, 0, 0)
|
||||
self:SetDefaultColor("StaggerTime", 255, 255, 255)
|
||||
|
||||
self.bTreatEmptyAsFull = false
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:Redraw()
|
||||
StaggerBar.super.prototype.Redraw(self)
|
||||
|
||||
self:MyOnUpdate()
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:GetDefaultSettings()
|
||||
local settings = StaggerBar.super.prototype.GetDefaultSettings(self)
|
||||
|
||||
settings["enabled"] = true
|
||||
settings["shouldAnimate"] = true
|
||||
settings["lowThreshold"] = 0
|
||||
settings["side"] = IceCore.Side.Left
|
||||
settings["offset"] = 3
|
||||
settings["upperText"]=""
|
||||
settings["showAsPercentOfMax"] = true
|
||||
settings["maxPercent"] = 20
|
||||
settings["timerAlpha"] = 0.3
|
||||
settings["usesDogTagStrings"] = false
|
||||
settings["lockLowerFontAlpha"] = false
|
||||
settings["lowerTextString"] = ""
|
||||
settings["lowerTextVisible"] = false
|
||||
settings["hideAnimationSettings"] = true
|
||||
settings["bAllowExpand"] = true
|
||||
settings["bShowWithNoTarget"] = true
|
||||
|
||||
return settings
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:GetOptions()
|
||||
local opts = StaggerBar.super.prototype.GetOptions(self)
|
||||
|
||||
opts.reverse.hidden = true
|
||||
|
||||
opts["maxPercent"] =
|
||||
{
|
||||
type = "range",
|
||||
name = "Max Percent",
|
||||
desc = "Maximum percentage of your maximum health for the Stagger bar to represent. I.e, if set to 20%, the bar will be full when the Stagger damage over time effect is dealing 20% of your maximum health per second.",
|
||||
min = 0,
|
||||
max = 50,
|
||||
step = 1,
|
||||
get = function()
|
||||
return self.moduleSettings.maxPercent
|
||||
end,
|
||||
set = function(info, v)
|
||||
self.moduleSettings.maxPercent = v
|
||||
self:Redraw()
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end
|
||||
}
|
||||
|
||||
opts["timerAlpha"] =
|
||||
{
|
||||
type = "range",
|
||||
name = "Timer bar alpha",
|
||||
desc = "What alpha value to use for the bar that displays how long until Stagger wears off.",
|
||||
min = 0,
|
||||
max = 100,
|
||||
step = 5,
|
||||
get = function()
|
||||
return self.moduleSettings.timerAlpha * 100
|
||||
end,
|
||||
set = function(info, v)
|
||||
self.moduleSettings.timerAlpha = v / 100
|
||||
self:Redraw()
|
||||
end,
|
||||
disabled = function()
|
||||
return not self.moduleSettings.enabled
|
||||
end
|
||||
}
|
||||
|
||||
return opts
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:Enable(core)
|
||||
StaggerBar.super.prototype.Enable(self, core)
|
||||
|
||||
playerName = UnitName(self.unit)
|
||||
staggerNames[1] = GetSpellInfo(LightID)
|
||||
staggerNames[2] = GetSpellInfo(ModerateID)
|
||||
staggerNames[3] = GetSpellInfo(HeavyID)
|
||||
|
||||
self:RegisterEvent("COMBAT_LOG_EVENT_UNFILTERED")
|
||||
self:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
self:RegisterEvent("ACTIVE_TALENT_GROUP_CHANGED")
|
||||
|
||||
self:UpdateShown()
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:Disable(core)
|
||||
StaggerBar.super.prototype.Disable(self, core)
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:CreateFrame()
|
||||
StaggerBar.super.prototype.CreateFrame(self)
|
||||
self:CreateTimerBar()
|
||||
|
||||
self:UpdateShown()
|
||||
self:UpdateAlpha()
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:CreateTimerBar()
|
||||
self.timerFrame = self:BarFactory(self.timerFrame, "MEDIUM","ARTWORK")
|
||||
|
||||
self.CurrScale = 0
|
||||
|
||||
self.timerFrame.bar:SetVertexColor(self:GetColor("StaggerTime", self.moduleSettings.timerAlpha))
|
||||
self.timerFrame.bar:SetHeight(0)
|
||||
|
||||
self:UpdateBar(1, "undef")
|
||||
self:UpdateTimerFrame()
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:UpdateShown()
|
||||
if GetSpecialization() == SPEC_MONK_BREWMASTER and not UnitInVehicle(self.unit) and UnitLevel(self.unit) >= MinLevel then
|
||||
self:Show(true)
|
||||
else
|
||||
self:Show(false)
|
||||
end
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:PLAYER_ENTERING_WORLD()
|
||||
self:UpdateStaggerBar()
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:ACTIVE_TALENT_GROUP_CHANGED()
|
||||
self:UpdateStaggerBar()
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:GetDebuffInfo()
|
||||
local amount = 0
|
||||
local duration = 0
|
||||
local staggerLevel = 1
|
||||
|
||||
for i = 1, IceCore.BuffLimit do
|
||||
local debuffID = select(11, UnitDebuff(self.unit, i))
|
||||
|
||||
if debuffID == LightID or debuffID == ModerateID or debuffID == HeavyID then
|
||||
local spellName = select(1, UnitDebuff(self.unit, i))
|
||||
|
||||
duration = select(6, UnitAura(self.unit, spellName, "", "HARMFUL"))
|
||||
amount = select(15, UnitAura(self.unit, spellName, "", "HARMFUL"))
|
||||
staggerLevel = (debuffID == LightID) and 1 or (debuffID == ModerateID) and 2 or 3
|
||||
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
self.amount = amount or 0
|
||||
self.duration = duration or 0
|
||||
self.staggerLevel = staggerLevel or 1
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:COMBAT_LOG_EVENT_UNFILTERED(_, timestamp, event, hideCaster, sourceGUID, sourceName, sourceFlags, sourceFlags2, destGUID, destName, destFlags, destFlags2, spellID)
|
||||
if destName == playerName then
|
||||
if spellID == StaggerID or event == "SWING_DAMAGE" or event == "SPELL_AURA_APPLIED" or event == "SPELL_AURA_REMOVED" then
|
||||
self:UpdateStaggerBar()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:UpdateStaggerBar()
|
||||
self:GetDebuffInfo()
|
||||
|
||||
-- local health = UnitHealth(self.unit)
|
||||
local maxHealth = UnitHealthMax(self.unit)
|
||||
local percent = (self.amount / maxHealth) * 100
|
||||
local percentText = percent >= 10 and floor(percent) or strform("%.1f", percent)
|
||||
local scale = IceHUD:Clamp((self.amount / maxHealth) * (100 / self.moduleSettings.maxPercent), 0, 1)
|
||||
|
||||
if self.amount > 0 and self.duration <= 10 then
|
||||
-- self.timerFrame.bar:SetVertexColor(self:GetColor("StaggerTime", self.moduleSettings.timerAlpha))
|
||||
self:UpdateBar(scale or 0, "Stagger"..self.staggerLevel)
|
||||
self:SetBottomText1(self.moduleSettings.upperText .. " " .. ReadableNumber(self.amount, 1) .. " (" .. percentText .. "%)")
|
||||
self:UpdateShown()
|
||||
self:UpdateTimerFrame()
|
||||
else
|
||||
self:UpdateBar(0, "Stagger1")
|
||||
self:SetBottomText1("")
|
||||
self:Show(false)
|
||||
end
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:GetDebuffDuration(unitName, buffName)
|
||||
local name, _, _, _, _, duration, endTime = UnitDebuff(unitName, buffName)
|
||||
|
||||
if name then
|
||||
return duration, endTime - GetTime()
|
||||
end
|
||||
|
||||
return nil, nil
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:MyOnUpdate()
|
||||
StaggerBar.super.prototype.MyOnUpdate(self)
|
||||
|
||||
if self.bUpdateTimer then
|
||||
self:UpdateTimerFrame(nil, self.unit, true)
|
||||
end
|
||||
end
|
||||
|
||||
function StaggerBar.prototype:UpdateTimerFrame(event, unit, fromUpdate)
|
||||
if unit and unit ~= self.unit then
|
||||
return
|
||||
end
|
||||
|
||||
local now = GetTime()
|
||||
local remaining = nil
|
||||
|
||||
if not fromUpdate then
|
||||
for i = 1, 3 do
|
||||
self.StaggerDuration, remaining = self:GetDebuffDuration(self.unit, staggerNames[i])
|
||||
|
||||
if remaining then
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
if not remaining then
|
||||
self.StaggerEndTime = 0
|
||||
else
|
||||
self.StaggerEndTime = remaining + now
|
||||
end
|
||||
end
|
||||
|
||||
if self.StaggerEndTime and self.StaggerEndTime >= now then
|
||||
if not fromUpdate then
|
||||
self.bUpdateTimer = true
|
||||
end
|
||||
|
||||
if not remaining and (self.StaggerEndTime and self.StaggerEndTime >= now) then
|
||||
remaining = self.StaggerEndTime - now
|
||||
end
|
||||
|
||||
if remaining then
|
||||
self:SetBarCoord(self.timerFrame, IceHUD:Clamp(remaining / 10, 0, 1))
|
||||
self.timerFrame:Show()
|
||||
else
|
||||
self:SetBarCoord(self.timerFrame, 0)
|
||||
self.timerFrame:Hide()
|
||||
end
|
||||
else
|
||||
self:SetBarCoord(self.timerFrame, 0)
|
||||
self.timerFrame:Hide()
|
||||
self.bUpdateTimer = false
|
||||
end
|
||||
end
|
||||
|
||||
local _, unitClass = UnitClass("player")
|
||||
if unitClass == "MONK" then
|
||||
IceHUD.StaggerBar = StaggerBar:new()
|
||||
end
|
@ -48,6 +48,8 @@ local StunCCList = {
|
||||
47481,
|
||||
-- Fists of Fury
|
||||
113656,
|
||||
-- Fist of Justice
|
||||
105593,
|
||||
}
|
||||
|
||||
local IncapacitateCCList = {
|
||||
@ -344,7 +346,7 @@ end
|
||||
function TargetCC.prototype:UpdateTargetDebuffs(event, unit, isUpdate)
|
||||
local name, duration, remaining
|
||||
|
||||
if not isUpdate then
|
||||
if not isUpdate or not self.lastUpdateTime then
|
||||
self.debuffName, self.debuffDuration, self.debuffRemaining = self:GetMaxDebuffDuration(self.unit, self.debuffList)
|
||||
else
|
||||
self.debuffRemaining = math.max(0, self.debuffRemaining - (GetTime() - self.lastUpdateTime))
|
||||
|
@ -1390,7 +1390,7 @@ function IceTargetInfo.prototype:UpdateBuffType(aura)
|
||||
icon = [[Interface\Icons\Spell_Frost_Frost]]
|
||||
duration = 60
|
||||
expirationTime = GetTime() + 59
|
||||
count = 1
|
||||
count = math.random(5)
|
||||
end
|
||||
|
||||
if icon then
|
||||
@ -1669,6 +1669,19 @@ function IceTargetInfo.prototype:Update(unit)
|
||||
self:UpdateAlpha()
|
||||
end
|
||||
|
||||
function IceTargetInfo.prototype:UpdateAlpha()
|
||||
IceTargetInfo.super.prototype.UpdateAlpha(self)
|
||||
|
||||
-- Temp until Blizzard fixes their cooldown wipes. http://www.wowinterface.com/forums/showthread.php?t=49950
|
||||
for i = 1, #self.frame["buffFrame"].iconFrames do
|
||||
self.frame["buffFrame"].iconFrames[i].cd:SetSwipeColor(0, 0, 0, self.alpha)
|
||||
self.frame["buffFrame"].iconFrames[i].cd:SetDrawEdge(false)
|
||||
end
|
||||
for i = 1, #self.frame["debuffFrame"].iconFrames do
|
||||
self.frame["debuffFrame"].iconFrames[i].cd:SetSwipeColor(0, 0, 0, self.alpha)
|
||||
self.frame["debuffFrame"].iconFrames[i].cd:SetDrawEdge(false)
|
||||
end
|
||||
end
|
||||
|
||||
function IceTargetInfo.prototype:OnEnter(frame)
|
||||
if self.moduleSettings.mouseTooltip then
|
||||
@ -1685,13 +1698,24 @@ function IceTargetInfo.prototype:OnLeave(frame)
|
||||
self.frame.highLight:Hide()
|
||||
end
|
||||
|
||||
|
||||
function IceTargetInfo.prototype:BuffOnEnter(this)
|
||||
function IceTargetInfo.prototype:AllowMouseBuffInteraction(id)
|
||||
if (not self:IsVisible()) then
|
||||
return
|
||||
return false
|
||||
end
|
||||
|
||||
if not self.unit or not this.id then
|
||||
if not self.unit or not id then
|
||||
return false
|
||||
end
|
||||
|
||||
if self.alpha == 0 then
|
||||
return false
|
||||
end
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
function IceTargetInfo.prototype:BuffOnEnter(this)
|
||||
if not self:AllowMouseBuffInteraction(this.id) then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -120,6 +120,7 @@ end
|
||||
|
||||
-- Load for tanks only
|
||||
local _, unitClass = UnitClass("player")
|
||||
if ((unitClass == "DEATHKNIGHT" or unitClass == "DRUID" or unitClass == "PALADIN" or unitClass == "WARRIOR" or unitClass == "MONK") and IceHUD.WowVer >= 40000) then
|
||||
if ((unitClass == "DEATHKNIGHT" or unitClass == "DRUID" or unitClass == "PALADIN" or unitClass == "WARRIOR" or unitClass == "MONK")
|
||||
and IceHUD.WowVer >= 40000 and IceHUD.WowVer < 60000) then
|
||||
IceHUD.Vengeance = Vengeance:new()
|
||||
end
|
Reference in New Issue
Block a user