WoWInterface SVN EventEquip

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /
    from Rev 6 to Rev 7
    Reverse comparison

Rev 6 → Rev 7

trunk/EventEquip/EventEquip.lua
13,9 → 13,10
local gmd = GearManagerDialog
local GameTooltip = GameTooltip
local tkDrop = LibStub("tekKonfig-Dropdown")
local eventSelected, setSelected, previousGear, wasPvP, wasMounted, wasResting
local eventSelected, setSelected, previousGear, wasPvP, wasMounted, wasResting, sets
local counter = 0
local sets = {"None"}
--local sets = {"None"}
local stances = {}
local events = {"Primary Talent Spec",
"Secondary Talent Spec",
"In Town",
119,46 → 120,6
end
end
 
--function EventEquip.ZONE_CHANGED_NEW_AREA()
-- local instance, kind = IsInInstance()
--[[ if IsResting() then --if in town...
print("is resting")
if not wasPvP or wasMounted then --and not coming from a battleground or not mounted
CollectPrevious()
end
EquipmentManager_EquipSet(EventEquipDB["In Town"])
wasResting = true
else
if instance and kind == "party" or kind=="pvp" or kind=="arena" then --"party" is only for testing in Stockades
print("in instance")
if not wasResting then
CollectPrevious()
end
EquipmentManager_EquipSet(EventEquipDB["Battleground/Arena"])
wasPvP = true
else
print("not resting and not in instance")
if wasPvP or wasResting then
wasPvP = false
wasResting = false
if IsMounted() and EventEquipDB["Mounted"] ~= "None" then
EquipmentManager_EquipSet(EventEquipDB["Mounted"])
else
EquipPrevious()
end
end
end]]--
--end
 
--[[EventEquip["Battleground/Arena"] = function()
if EventEquipDB["Battleground/Arena"] == "None" and EventEquipDB["In Town"] == "None" then
EventEquip:UnregisterEvent("ZONE_CHANGED_NEW_AREA")
return
else
EventEquip:RegisterEvent("ZONE_CHANGED_NEW_AREA")
end
end]]--
 
function EventEquip.PLAYER_UPDATE_RESTING()
if IsResting() then
-- print("in town")
190,15 → 151,6
end
end
 
--[[EventEquip["In Town"] = function()
if EventEquipDB["In Town"] == "None" and EventEquipDB["Battleground/Arena"] == "None" then
EventEquip:UnregisterEvent("ZONE_CHANGED_NEW_AREA")
return
else
EventEquip:RegisterEvent("ZONE_CHANGED_NEW_AREA")
end
end]]--
 
function EventEquip.UNIT_SPELLCAST_SUCCEEDED(unit, spell)
if unit == "player" then
if spell == "Activate Primary Spec" and EventEquipDB["Primary Talent Spec"] ~= "None" then
227,6 → 179,33
end
end
 
function EventEquip.UPDATE_SHAPESHIFT_FORM()
local name, active
for i=1,GetNumShapeshiftForms() do
_,name,active = GetShapeshiftFormInfo(i)
if active == 1 then
if EventEquipDB[name] ~= "None" then
EquipmentManager_EquipSet(EventEquipDB[name])
end
return
end
end
end
 
function EventEquip.Stances()
local register = false
for k,v in pairs(stances) do
if EventEquipDB[k] ~= "None" then
register = true
end
end
if register then
EventEquip:RegisterEvent("UPDATE_SHAPESHIFT_FORM")
else
EventEquip:UnregisterEvent("UPDATE_SHAPESHIFT_FORM")
end
end
 
local function CollectSets()
sets = {"None"}
local num = GetNumEquipmentSets()
236,6 → 215,16
return sets
end
 
local function CollectStances()
for i=1,GetNumShapeshiftForms() do
local _,name = GetShapeshiftFormInfo(i)
tinsert(events, name)
stances[name] = true
EventEquipDB[name] = EventEquipDB[name] or "None"
end
EventEquip.Stances()
end
 
local function OnEnter(self, text)
GameTooltip:SetOwner(self, "ANCHOR_BOTTOMRIGHT")
GameTooltip:SetText(text)
347,7 → 336,11
else
DEFAULT_CHAT_FRAME:AddMessage("EventEquip: You must select an event and a set to save!",.8,1,.2)
end
EventEquip[eventSelected]()
if stances[eventSelected] then
EventEquip.Stances()
else
EventEquip[eventSelected]()
end
end)
end
 
390,11 → 383,17
end
end
 
local _,class = UnitClass("player")
if class == "DRUID" or "WARRIOR" or "DEATHKNIGHT" then
CollectStances()
end
CollectSets()
CreateButton()
 
for k,v in pairs(events) do
EventEquip[v]()
if EventEquip[v] then
EventEquip[v]()
end
end
 
if UnitIsPVP("player") == 1 then
trunk/EventEquip/EventEquip.toc
1,7 → 1,7
## Interface: 30100
## Title: EventEquip
## Author: Seerah
## Version: 0.3
## Version: 0.4
## Notes: Equip item sets created by the in-game Equipment Manager based on events.
## SavedVariablesPerCharacter: EventEquipDB