/
## Interface: 50001 |
## Interface: 50100 |
## Name: Who Framed Watcher Wabbit? |
## Version: 1.7.4 |
## Version: 1.8 |
## Notes: Various tweaks to improve the quest watch frame |
## SavedVariables: WFWWDB |
## SavedVariablesPerCharacter: WFWWPCDB |
scale = 1, |
hideFrame = false, |
instance = false, |
petBattle = true, |
keybind = "", |
} |
type = "header", |
order = 14.5, |
}, |
keybind = { |
name = "Keybinding", |
desc = "Key to minimize/maximize the tracker.", |
type = "keybinding", |
get = function() return db.keybind end, |
set = function(_,key) |
SetOverrideBinding(WFContainer, false, db.keybind, nil) --clear old binding |
if key ~= "" then --set new |
SetOverrideBinding(WFContainer, false, key, "CLICK WatchFrameCollapseExpandButton:LeftButton") |
end |
db.keybind = key |
end, |
order = 15, |
}, |
hideFrame = { |
name = "Hide frame when empty", |
desc = "Hide the watch frame when no quests or achievements are being tracked.", |
WatchFrameCollapseExpandButton:EnableMouse(true) |
end |
end, |
order = 15.5, |
order = 15, |
}, |
instance = { |
name = "Collapse in instance", |
WFContainer:UnregisterEvent("PLAYER_ENTERING_WORLD") |
end |
end, |
order = 15.2, |
}, |
petBattle = { |
name = "Collapse in pet battle", |
desc = "Automatically collapses the watch frame when entering a pet battle.", |
type = "toggle", |
get = function() return db.petBattle end, |
set = function() |
db.petBattle = not db.petBattle |
if db.petBattle then |
WFContainer:RegisterEvent("PET_BATTLE_OPENING_START") |
WFContainer:RegisterEvent("PET_BATTLE_CLOSE") |
else |
WFContainer:RegisterEvent("PET_BATTLE_OPENING_START") |
WFContainer:RegisterEvent("PET_BATTLE_CLOSE") |
end |
end, |
order = 15.5, |
}, |
keybind = { |
name = "Keybinding", |
desc = "Key to minimize/maximize the tracker.", |
type = "keybinding", |
get = function() return db.keybind end, |
set = function(_,key) |
SetOverrideBinding(WFContainer, false, db.keybind, nil) --clear old binding |
if key ~= "" then --set new |
SetOverrideBinding(WFContainer, false, key, "CLICK WatchFrameCollapseExpandButton:LeftButton") |
end |
db.keybind = key |
end, |
order = 15.7, |
}, |
spacer4 = { |
if not db.instance then |
WFContainer:UnregisterEvent("PLAYER_ENTERING_WORLD") |
end |
if not db.petBattle then |
WFContainer:UnregisterEvent("PET_BATTLE_OPENING_START") |
WFContainer:UnregisterEvent("PET_BATTLE_CLOSE") |
end |
WFContainer:RegisterEvent("QUEST_WATCH_UPDATE") |
WFContainer:RegisterEvent("QUEST_AUTOCOMPLETE") |
WFContainer:RegisterEvent("CVAR_UPDATE") |
local notCollapsed |
WFContainer:SetScript("OnEvent", function(_,event,...) |
if event == "PLAYER_ENTERING_WORLD" then |
if IsInInstance() and not WFWWPCDB.collapsed then |
--if you go in the instance and the WF isn't collapsed... |
WatchFrameCollapseExpandButton:Click() --collapse |
--if you go in the instance and the WF isn't collapsed... |
WatchFrameCollapseExpandButton:Click() --collapse |
end |
elseif event == "PET_BATTLE_OPENING_START" and not WFWWPCDB.collapsed then |
notCollapsed = true |
WatchFrameCollapseExpandButton:Click() |
elseif event == "PET_BATTLE_CLOSE" and notCollapsed then |
notCollapsed = false |
WatchFrameCollapseExpandButton:Click() |
elseif event == "CVAR_UPDATE" then |
local cvar,value = ... |
if cvar == "WATCH_FRAME_WIDTH_TEXT" then |
end |
WFContainer:RegisterEvent("PLAYER_ENTERING_WORLD") |
WFContainer:RegisterEvent("PET_BATTLE_OPENING_START") |
WFContainer:RegisterEvent("PET_BATTLE_CLOSE") |
local f = CreateFrame("Frame") --need to create a slight delay to get rid of errors and glitches |
f:Hide() |
f.elapsed = 0 |