Skip to content

Commit

Permalink
Merge pull request #3 from raethkcj/classic
Browse files Browse the repository at this point in the history
Classic
  • Loading branch information
Brixus3 authored Nov 11, 2022
2 parents 9302929 + 6786a68 commit f524fb6
Show file tree
Hide file tree
Showing 23 changed files with 616 additions and 210 deletions.
18 changes: 7 additions & 11 deletions .github/workflows/packager.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ jobs:
# The type of runner that the job will run on
runs-on: ubuntu-latest

env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand All @@ -30,14 +34,6 @@ jobs:
luarocks install --local luacheck
/home/runner/.luarocks/bin/luacheck . --no-color -q
- name: Create Classic Package
run: curl -s https://raw.githubusercontent.com/BigWigsMods/packager/master/release.sh | bash -s -- -g classic
env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}

- name: Create BCC Package
run: curl -s https://raw.githubusercontent.com/BigWigsMods/packager/master/release.sh | bash -s -- -g bcc
env:
CF_API_KEY: ${{ secrets.CF_API_KEY }}
GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}
- uses: BigWigsMods/packager@v2
with:
args: -S
1 change: 1 addition & 0 deletions .luacheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ read_globals = {
"GetRaidTargetIndex",
"GetReadyCheckStatus",
"GetRuneCooldown",
"GetRuneType",
"GetSpecialization",
"GetSpecializationInfoByID",
"GetSpellInfo",
Expand Down
2 changes: 0 additions & 2 deletions .pkgmeta
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ externals:
url: https://repos.curseforge.com/wow/libclassicdurations
libs/LibClassicCasterino:
url: https://github.com/rgd87/LibClassicCasterino.git
libs/LibHealComm-4.0:
url: https://repos.wowace.com/wow/libhealcomm-4-0
options/libs/AceConfig-3.0:
url: https://repos.wowace.com/wow/ace3/trunk/AceConfig-3.0
options/libs/AceDBOptions-3.0:
Expand Down
36 changes: 33 additions & 3 deletions ShadowedUnitFrames.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,18 @@
ShadowUF = select(2, ...)

local L = ShadowUF.L

local WoWWrath = (WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC)

ShadowUF.dbRevision = 61
ShadowUF.dbRevisionClassic = 4
ShadowUF.dbRevisionClassic = 5
ShadowUF.playerUnit = "player"
ShadowUF.enabledUnits = {}
ShadowUF.modules = {}
ShadowUF.moduleOrder = {}
ShadowUF.unitList = {"player", "pet", "pettarget", "target", "targettarget", "targettargettarget", "focus", "focustarget", "party", "partypet", "partytarget", "partytargettarget", "raid", "raidpet", "boss", "bosstarget", "maintank", "maintanktarget", "mainassist", "mainassisttarget", "arena", "arenatarget", "arenapet", "battleground", "battlegroundtarget", "battlegroundpet", "arenatargettarget", "battlegroundtargettarget", "maintanktargettarget", "mainassisttargettarget", "bosstargettarget"}
ShadowUF.fakeUnits = {["targettarget"] = true, ["targettargettarget"] = true, ["pettarget"] = true, ["arenatarget"] = true, ["arenatargettarget"] = true, ["focustarget"] = true, ["focustargettarget"] = true, ["partytarget"] = true, ["raidtarget"] = true, ["bosstarget"] = true, ["maintanktarget"] = true, ["mainassisttarget"] = true, ["battlegroundtarget"] = true, ["partytargettarget"] = true, ["battlegroundtargettarget"] = true, ["maintanktargettarget"] = true, ["mainassisttargettarget"] = true, ["bosstargettarget"] = true}
L.units = {["raidpet"] = L["Raid pet"], ["PET"] = L["Pet"], ["arena"] = L["Arena"], ["arenapet"] = L["Arena Pet"], ["arenatarget"] = L["Arena Target"], ["arenatargettarget"] = L["Arena Target of Target"], ["boss"] = L["Boss"], ["bosstarget"] = L["Boss Target"], ["focus"] = L["Focus"], ["focustarget"] = L["Focus Target"], ["mainassist"] = L["Main Assist"], ["mainassisttarget"] = L["Main Assist Target"], ["maintank"] = L["Main Tank"], ["maintanktarget"] = L["Main Tank Target"], ["party"] = L["Party"], ["partypet"] = L["Party Pet"], ["partytarget"] = L["Party Target"], ["pet"] = L["Pet"], ["pettarget"] = L["Pet Target"], ["player"] = L["Player"],["raid"] = L["Raid"], ["target"] = L["Target"], ["targettarget"] = L["Target of Target"], ["targettargettarget"] = L["Target of Target of Target"], ["battleground"] = L["Battleground"], ["battlegroundpet"] = L["Battleground Pet"], ["battlegroundtarget"] = L["Battleground Target"], ["partytargettarget"] = L["Party Target of Target"], ["battlegroundtargettarget"] = L["Battleground Target of Target"], ["maintanktargettarget"] = L["Main Tank Target of Target"], ["mainassisttargettarget"] = L["Main Assist Target of Target"], ["bosstargettarget"] = L["Boss Target of Target"]}
L.units = {["raidpet"] = L["Raid pet"], ["PET"] = L["Pet"], ["VEHICLE"] = L["Vehicle"], ["arena"] = L["Arena"], ["arenapet"] = L["Arena Pet"], ["arenatarget"] = L["Arena Target"], ["arenatargettarget"] = L["Arena Target of Target"], ["boss"] = L["Boss"], ["bosstarget"] = L["Boss Target"], ["focus"] = L["Focus"], ["focustarget"] = L["Focus Target"], ["mainassist"] = L["Main Assist"], ["mainassisttarget"] = L["Main Assist Target"], ["maintank"] = L["Main Tank"], ["maintanktarget"] = L["Main Tank Target"], ["party"] = L["Party"], ["partypet"] = L["Party Pet"], ["partytarget"] = L["Party Target"], ["pet"] = L["Pet"], ["pettarget"] = L["Pet Target"], ["player"] = L["Player"],["raid"] = L["Raid"], ["target"] = L["Target"], ["targettarget"] = L["Target of Target"], ["targettargettarget"] = L["Target of Target of Target"], ["battleground"] = L["Battleground"], ["battlegroundpet"] = L["Battleground Pet"], ["battlegroundtarget"] = L["Battleground Target"], ["partytargettarget"] = L["Party Target of Target"], ["battlegroundtargettarget"] = L["Battleground Target of Target"], ["maintanktargettarget"] = L["Main Tank Target of Target"], ["mainassisttargettarget"] = L["Main Assist Target of Target"], ["bosstargettarget"] = L["Boss Target of Target"]}
L.shortUnits = {["battleground"] = L["BG"], ["battlegroundtarget"] = L["BG Target"], ["battlegroundpet"] = L["BG Pet"], ["battlegroundtargettarget"] = L["BG ToT"], ["arenatargettarget"] = L["Arena ToT"], ["partytargettarget"] = L["Party ToT"], ["bosstargettarget"] = L["Boss ToT"], ["maintanktargettarget"] = L["MT ToT"], ["mainassisttargettarget"] = L["MA ToT"]}

-- Cache the units so we don't have to concat every time it updates
Expand Down Expand Up @@ -118,6 +121,26 @@ end
function ShadowUF:CheckUpgrade()
local revisionClassic = self.db.profile.revisionClassic or (self.db.profile.revision and 1 or self.dbRevisionClassic)
local revision = self.db.profile.revision or self.dbRevision
if( revisionClassic <= 4 ) then
-- new resources
self.db.profile.powerColors.RUNES_BLOOD = {r = 0.95, g = 0.0, b = 0.08}
self.db.profile.powerColors.RUNES_FROST = {r = 0.0, g = 0.85, b = 1.0}
self.db.profile.powerColors.RUNES_UNHOLY = {r = 0.0, g = 1.0, b = 0.35}
self.db.profile.powerColors.RUNES_DEATH = {r = 0.69, g = 0.15, b = 1.0}

-- new bars
local config = self.db.profile.units
config.player.runeBar = {enabled = true, background = false, height = 0.40, order = 70}
local hasRuneText = false
for i, text in ipairs(config.player.text) do
if text and text.anchorTo == "$runeBar" and text == "[rune:timer]" then
hasRuneText = true
end
end
if not hasRuneText then
table.insert(config.player.text, {enabled = true, width = 1, name = L["Timer Text"], text = "[rune:timer]", anchorTo = "$runeBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true})
end
end
if( revisionClassic <= 4 or not self.db.profile.revisionClassic ) then
ShadowUF:LoadDefaultLayout(true)
end
Expand Down Expand Up @@ -351,6 +374,7 @@ function ShadowUF:LoadUnitDefaults()
self.defaults.profile.units.player.healthBar.predicted = true
self.defaults.profile.units.player.powerBar.predicted = true
self.defaults.profile.units.player.indicators.status.enabled = true
self.defaults.profile.units.player.runeBar = {enabled = false}
self.defaults.profile.units.player.totemBar = {enabled = false}
self.defaults.profile.units.player.druidBar = {enabled = false}
self.defaults.profile.units.player.xpBar = {enabled = false}
Expand Down Expand Up @@ -431,7 +455,7 @@ function ShadowUF:LoadUnitDefaults()
self.defaults.profile.units.raidpet.fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.60}
self.defaults.profile.units.raidpet.combatText.enabled = false
-- MAINTANK
self.defaults.profile.units.maintank.roleFilter = "TANK"
-- self.defaults.profile.units.maintank.roleFilter = "TANK"
self.defaults.profile.units.maintank.groupFilter = "MAINTANK"
self.defaults.profile.units.maintank.groupBy = "GROUP"
self.defaults.profile.units.maintank.sortOrder = "ASC"
Expand Down Expand Up @@ -741,6 +765,12 @@ function ShadowUF:HideBlizzardFrames()

-- We keep these in case someone is still using the default auras, otherwise it messes up vehicle stuff
PlayerFrame:RegisterEvent("PLAYER_ENTERING_WORLD")
if WoWWrath then
PlayerFrame:RegisterEvent("UNIT_ENTERING_VEHICLE")
PlayerFrame:RegisterEvent("UNIT_ENTERED_VEHICLE")
PlayerFrame:RegisterEvent("UNIT_EXITING_VEHICLE")
PlayerFrame:RegisterEvent("UNIT_EXITED_VEHICLE")
end
PlayerFrame:SetMovable(true)
PlayerFrame:SetUserPlaced(true)
PlayerFrame:SetDontSavePosition(true)
Expand Down
23 changes: 13 additions & 10 deletions ShadowedUnitFrames.toc
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
## Interface: 20501
## Interface-Classic: 11307
## Interface-BCC: 20501
## Interface: 30400
## Interface-Classic: 11403
## Interface-BCC: 20504
## Title: Shadowed Unit Frames
## Notes: Moooooooooooooooooo
## Author: Shadowed
## Version: @project-version@
## SavedVariables: ShadowedUFDB
## X-Website: https://www.wowace.com/addons/shadowed-unit-frames/
#@version-bcc@
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibSpellRange-1.0, Clique, LibHealComm-4.0
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibSpellRange-1.0, Clique
#@end-version-bcc@
#@version-wrath@
## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibSpellRange-1.0, Clique
#@end-version-wrath@
#@non-version-bcc@
# ## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibSpellRange-1.0, LibClassicDurations, Clique, LibHealComm-4.0, LibClassicCasterino
# ## OptionalDeps: Ace3, LibSharedMedia-3.0, AceGUI-3.0-SharedMediaWidgets, LibSpellRange-1.0, LibClassicDurations, Clique, LibClassicCasterino
#@end-non-version-bcc@
## X-Curse-Project-ID: 19268
## X-WoWI-ID: 13494
Expand All @@ -22,11 +25,10 @@ libs\CallbackHandler-1.0\CallbackHandler-1.0.xml
libs\LibSharedMedia-3.0\lib.xml
libs\AceDB-3.0\AceDB-3.0.xml
libs\LibSpellRange-1.0\lib.xml
#@non-version-bcc@
# libs\LibClassicDurations\LibClassicDurations.xml
# libs\LibClassicCasterino\LibClassicCasterino.lua
#@end-non-version-bcc@
libs\LibHealComm-4.0\LibHealComm-4.0.xml
#@version-classic@
libs\LibClassicDurations\LibClassicDurations.xml
libs\LibClassicCasterino\LibClassicCasterino.lua
#@end-version-classic@
#@end-no-lib-strip@

localization\enUS.lua
Expand Down Expand Up @@ -66,6 +68,7 @@ modules\combopoints.lua
modules\range.lua
modules\empty.lua
modules\druid.lua
modules\runes.lua
#@do-not-package@
options\config.lua
#@end-do-not-package@
4 changes: 4 additions & 0 deletions ShadowedUnitFrames.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Button name="SUF_SecureUnitTemplate" virtual="true" inherits="SecureUnitButtonTemplate, SecureHandlerStateTemplate">
<Attributes>
<Attribute name="refreshUnitChange" type="string" value="local unit = self:GetAttribute('unit'); if unit then RegisterStateDriver(self, 'vehicleui', ('[target=%s,unithasvehicleui]vehicle; no'):format(unit)) else UnregisterStateDriver(self, 'vehicleui') end" />
<Attribute name="_onstate-vehicleui" type="string" value="local unit = self:GetAttribute('unit'); if unit and newstate == 'vehicle' and UnitPlayerOrPetInRaid(unit) and not UnitTargetsVehicleInRaidUI(unit) then self:SetAttribute('toggleForVehicle', false) else self:SetAttribute('toggleForVehicle', true) end" />
</Attributes>
</Button>
</Ui>
2 changes: 1 addition & 1 deletion modules/auraindicators.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Indicators.auraConfig = setmetatable({}, {
return tbl[index]
end})

local playerUnits = {player = true, pet = true}
local playerUnits = {player = true, vehicle = true, pet = true}
local backdropTbl = {bgFile = "Interface\\Addons\\ShadowedUnitFrames\\mediabackdrop", edgeFile = "Interface\\Addons\\ShadowedUnitFrames\\media\\backdrop", tile = true, tileSize = 1, edgeSize = 1}

function Indicators:OnEnable(frame)
Expand Down
15 changes: 13 additions & 2 deletions modules/auras.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
local Auras = {}
local playerUnits = {player = true, pet = true}
local playerUnits = {player = true, vehicle = true, pet = true}
local mainHand, offHand, tempEnchantScan = {time = 0}, {time = 0}
local canCure = ShadowUF.Units.canCure
ShadowUF:RegisterModule(Auras, "auras", ShadowUF.L["Auras"])
Expand Down Expand Up @@ -236,7 +236,7 @@ local function hideTooltip(self)
end

local function cancelAura(self, mouse)
if( mouse ~= "RightButton" or not UnitIsUnit(self.parent.unit, "player") or InCombatLockdown() or self.filter == "TEMP" ) then
if( mouse ~= "RightButton" or ( not UnitIsUnit(self.parent.unit, "player") and not UnitIsUnit(self.parent.unit, "vehicle") ) or InCombatLockdown() or self.filter == "TEMP" ) then
return
end

Expand Down Expand Up @@ -465,6 +465,17 @@ end

-- Unfortunately, temporary enchants have basically no support beyond hacks. So we will hack!
tempEnchantScan = function(self, elapsed)
if( self.parent.unit == self.parent.vehicleUnit and self.lastTemporary > 0 ) then
mainHand.has = false
offHand.has = false

self.temporaryEnchants = 0
self.lastTemporary = 0

Auras:Update(self.parent)
return
end

timeElapsed = timeElapsed + elapsed
if( timeElapsed < 0.50 ) then return end
timeElapsed = timeElapsed - 0.50
Expand Down
13 changes: 0 additions & 13 deletions modules/cast.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,6 @@ if WoWClassic then
end
end
end
if WoWBC then
UnitCastingInfo = function(unit)
-- nonInterruptible is missing from the returns
local name, text, texture, startTime, endTime, isTradeSkill, castID, spellID = _G.UnitCastingInfo(unit)
return name, text, texture, startTime, endTime, isTradeSkill, castID, nil, spellID
end

UnitChannelInfo = function(unit)
-- nonInterruptible is missing from the returns
local name, text, texture, startTime, endTime, isTradeSkill, spellID = _G.UnitChannelInfo(unit)
return name, text, texture, startTime, endTime, isTradeSkill, nil, spellID
end
end

function Cast:OnEnable(frame)
if( not frame.castBar ) then
Expand Down
16 changes: 14 additions & 2 deletions modules/combopoints.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
if( not ShadowUF.ComboPoints ) then return end

local WoWWrath = (WOW_PROJECT_ID == WOW_PROJECT_WRATH_CLASSIC)

local Combo = setmetatable({}, {__index = ShadowUF.ComboPoints})
ShadowUF:RegisterModule(Combo, "comboPoints", ShadowUF.L["Combo points"])
local cpConfig = {max = MAX_COMBO_POINTS, key = "comboPoints", colorKey = "COMBOPOINTS", powerType = Enum.PowerType.ComboPoints, eventType = "COMBO_POINTS", icon = "Interface\\AddOns\\ShadowedUnitFrames\\media\\textures\\combo"}
Expand Down Expand Up @@ -30,11 +32,21 @@ function Combo:GetMaxPoints()
end

function Combo:GetPoints(unit)
return UnitPower("player", cpConfig.powerType)
-- For Malygos dragons, they also self cast their CP on themselves, which is why we check CP on ourself
if( WoWWrath and UnitHasVehicleUI("player") and UnitHasVehiclePlayerFrameUI("player") ) then
local points = GetComboPoints("vehicle", "target")
if( points == 0 ) then
points = GetComboPoints("vehicle", "vehicle")
end

return points
else
return UnitPower("player", cpConfig.powerType)
end
end

function Combo:Update(frame, event, unit, powerType)
if( not event or ( unit == frame.unit or unit == "player" ) ) then
if( not event or ( unit == frame.unit or unit == frame.vehicleUnit or unit == "player" or unit == "vehicle" ) ) then
ShadowUF.ComboPoints.Update(self, frame, event, unit, powerType)
end
end
9 changes: 8 additions & 1 deletion modules/defaultlayout.lua
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,18 @@ function ShadowUF:LoadDefaultLayout(useMerge)
MONK = {r = 0.0, g = 1.00 , b = 0.59},
DEMONHUNTER = {r = 0.64, g = 0.19, b = 0.79},
PET = {r = 0.20, g = 0.90, b = 0.20},
VEHICLE = {r = 0.23, g = 0.41, b = 0.23},
}
config.powerColors = {
MANA = {r = 0.30, g = 0.50, b = 0.85},
RAGE = {r = 0.90, g = 0.20, b = 0.30},
FOCUS = {r = 1.0, g = 0.50, b = 0.25},
ENERGY = {r = 1.0, g = 0.85, b = 0.10},
RUNES = {r = 0.50, g = 0.50, b = 0.50},
RUNES_BLOOD = {r = 0.95, g = 0.0, b = 0.08},
RUNES_FROST = {r = 0.0, g = 0.85, b = 1.0},
RUNES_UNHOLY = {r = 0.0, g = 1.0, b = 0.35},
RUNES_DEATH = {r = 0.69, g = 0.15, b = 1.0},
RUNIC_POWER = {b = 0.60, g = 0.45, r = 0.35},
AMMOSLOT = {r = 0.85, g = 0.60, b = 0.55},
FUEL = {r = 0.85, g = 0.47, b = 0.36},
Expand Down Expand Up @@ -331,6 +336,7 @@ function ShadowUF:LoadDefaultLayout(useMerge)
castBar = {order = 60},
xpBar = {order = 55},
fader = {enabled = false, combatAlpha = 1.0, inactiveAlpha = 0.6},
runeBar = {enabled = true, background = false, height = 0.40, order = 70},
totemBar = {enabled = true, background = false, height = 0.40, order = 70},
druidBar = {enabled = true, background = true, height = 0.40, order = 70},
comboPoints = {enabled = true, anchorTo = "$parent", order = 60, anchorPoint = "BR", x = -3, y = 8, size = 14, spacing = -4, growth = "LEFT", isBar = true, height = 0.40},
Expand All @@ -347,7 +353,8 @@ function ShadowUF:LoadDefaultLayout(useMerge)
{text = "[perpp]"},
{text = "[curmaxpp]"},
{text = "[(()afk() )][name][( ()group())]"},
{text = ""}
{text = ""},
{enabled = true, width = 1, name = L["Timer Text"], text = "[rune:timer]", anchorTo = "$runeBar", anchorPoint = "C", size = 0, x = 0, y = 0, default = true, block = true},
},
},
party = {
Expand Down
2 changes: 1 addition & 1 deletion modules/druid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function Druid:OnLayoutApplied(frame)
end

function Druid:PowerChanged(frame)
local visible = UnitPowerType(frame.unit) ~= Enum.PowerType.Mana
local visible = UnitPowerType(frame.unit) ~= Enum.PowerType.Mana and not frame.inVehicle
local type = visible and "RegisterUnitEvent" or "UnregisterSingleEvent"

frame[type](frame, "UNIT_POWER_FREQUENT", self, "Update")
Expand Down
2 changes: 2 additions & 0 deletions modules/health.lua
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ function Health:UpdateColor(frame)
return
elseif( ShadowUF.db.profile.units[frame.unitType].healthBar.colorDispel and frame.healthBar.hasDebuff ) then
color = DebuffTypeColor[frame.healthBar.hasDebuff]
elseif( frame.inVehicle ) then
color = ShadowUF.db.profile.classColors.VEHICLE
elseif( not UnitPlayerControlled(unit) and UnitIsTapDenied(unit) and UnitCanAttack("player", unit) ) then
color = ShadowUF.db.profile.healthColors.tapped
elseif( not UnitPlayerOrPetInRaid(unit) and not UnitPlayerOrPetInParty(unit) and ( ( ( reactionType == "player" or reactionType == "both" ) and UnitIsPlayer(unit) and not UnitIsFriend(unit, "player") ) or ( ( reactionType == "npc" or reactionType == "both" ) and not UnitIsPlayer(unit) ) ) ) then
Expand Down
Loading

0 comments on commit f524fb6

Please sign in to comment.