Skip to content

Commit

Permalink
Add Wrath support
Browse files Browse the repository at this point in the history
  • Loading branch information
Oppzippy committed Oct 14, 2022
1 parent 2372bf1 commit 980d022
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 8 deletions.
1 change: 1 addition & 0 deletions .pkgmeta
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package-as: TankMD
enable-nolib-creation: no
enable-toc-creation: yes

externals:
Libs/LibStub: https://repos.wowace.com/wow/libstub/trunk
Expand Down
8 changes: 8 additions & 0 deletions LibsClassic.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/
..\FrameXML\UI.xsd">
<!--@non-debug@
<Script file="Libs\LibStub\LibStub.lua" />
<Include file="Libs\CallbackHandler-1.0\CallbackHandler-1.0.lua" />
<Include file="Libs\AceLocale-3.0\AceLocale-3.0.xml" />
@end-non-debug@-->
</Ui>
15 changes: 9 additions & 6 deletions TankMD.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local _, addon = ...
local config = addon.config

local LGIST = LibStub("LibGroupInSpecT-1.1")
local LGIST = LibStub("LibGroupInSpecT-1.1", true)

-- Create frame
local frame = CreateFrame("Frame")
Expand All @@ -23,11 +23,14 @@ for event, _ in pairs(config.updateEvents) do
frame:RegisterEvent(event)
end

local inspectHandler = {}
function inspectHandler:GroupInSpecT_Update(...)
addon:QueueUpdate()
addon:Update()
if LGIST then
local inspectHandler = {}
function inspectHandler:GroupInSpecT_Update(...)
addon:QueueUpdate()
addon:Update()
end

LGIST.RegisterCallback(inspectHandler, "GroupInSpecT_Update")
end
LGIST.RegisterCallback(inspectHandler, "GroupInSpecT_Update")

addon:CreateButtons()
6 changes: 6 additions & 0 deletions TankMD.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
## Interface: 90207
## Interface-Wrath: 30400
## Title: TankMD
## Notes: One button to always misdirect to the tank. Also supports Tricks for rogues, and Innervate for druids (targets healers).
## Author: Oppzippy
Expand All @@ -8,7 +9,12 @@
## X-WoWI-ID: 25625
## X-Wago-ID: xZKxpqKk

#@version-retail@
Libs.xml
#@end-version-retail@
#@non-version-retail@
LibsClassic.xml
#@end-non-version-retail@

TargetMatcher\TargetMatchers.xml
Config.lua
Expand Down
5 changes: 3 additions & 2 deletions TargetMatcher/RoleTargetMatcher.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ local RoleTargetMatcherPrototype = setmetatable({}, addon.TargetMatcherPrototype
addon.RoleTargetMatcherPrototype = RoleTargetMatcherPrototype
RoleTargetMatcherPrototype.__index = RoleTargetMatcherPrototype

local LGIST = LibStub("LibGroupInSpecT-1.1")
-- Not compatible with classic
local LGIST = LibStub("LibGroupInSpecT-1.1", true)

function addon:CreateRoleTargetMatcher(role)
local targetMatcher = setmetatable({}, RoleTargetMatcherPrototype)
Expand All @@ -15,7 +16,7 @@ function RoleTargetMatcherPrototype:Matches(unit)
local role = UnitGroupRolesAssigned(unit)
if role ~= "NONE" then
return self.role == role
else
elseif LGIST then
local guid = UnitGUID(unit)
local inspectInfo = LGIST:GetCachedInfo(guid)
if inspectInfo then
Expand Down

0 comments on commit 980d022

Please sign in to comment.