/
end |
end |
function EventEquip.PLAYER_FLAGS_CHANGED(unit) |
function EventEquip.PLAYER_FLAGS_CHANGED(unit) --decide if I want pvp set on in-town - also about mounted set while pvp |
if unit == "player" then |
if UnitIsPVP("player") then |
-- print("is pvp flagged") |
-- print("just pvp flagged") |
if not wasResting then |
CollectPrevious() |
-- EquipmentManager_EquipSet(EventEquipDB["PvP"]) |
end |
EquipmentManager_EquipSet(EventEquipDB["PvP"]) |
wasPvP = true |
-- print("mounted: "..tostring(wasMounted)) |
if wasMounted and EventEquipDB["Mounted"] ~= "None" then |
EquipmentManager_EquipSet(EventEquipDB["Mounted"]) |
-- elseif wasPvP and EventEquipDB["PvP"] ~= "None" then |
-- EquipmentManager_EquipSet(EventEquipDB["PvP"]) |
else |
EquipPrevious() |
end |
end |
local function OnEnter(self, text) |
GameTooltip:SetOwner(self, "ANCHOR_TOPRIGHT") |
GameTooltip:SetOwner(self, "ANCHOR_BOTTOMRIGHT") |
GameTooltip:SetText(text) |
GameTooltip:Show() |
end |
GameTooltip:Hide() |
end |
local function SetTooltips(self) |
local set = GetEquipmentSetInfo(strsub(self:GetName(),14)) |
OnEnter(self, set) |
local items = GetEquipmentSetLocations(set) |
for k,v in pairs(items) do |
local _,item = EquipmentManager_GetItemInfoByLocation(v) |
if item then |
GameTooltip:AddLine(" - "..item,1,1,1) |
end |
end |
GameTooltip:AddLine("\nCurrently saved to...") |
for k,v in pairs(EventEquipDB) do |
if v == set then |
GameTooltip:AddDoubleLine(" ", k,1,1,1,1,1,1) |
end |
end |
GameTooltip:Show() |
end |
local function SetUpOptions() |
local eeOpts = CreateFrame("Frame", "EEOptions", gmd) |
eeOpts:SetPoint("TOPLEFT", gmd, "BOTTOMLEFT", 3, 4) |
EEOptions:Hide() |
end |
end) |
for i=1,10 do |
button = _G["GearSetButton"..i] |
SetScriptHook(button, "OnEnter", function(self) SetTooltips(self) end) |
SetScriptHook(button, "OnLeave", OnLeave) |
end |
EventEquip:UnregisterEvent("PLAYER_ENTERING_WORLD") |
end |
## Interface: 30100 |
## Title: EventEquip |
## Author: Seerah |
## Version: 0.2 |
## Version: 0.3 |
## Notes: Equip item sets created by the in-game Equipment Manager based on events. |
## SavedVariablesPerCharacter: EventEquipDB |