/
local LSM = LibStub("LibSharedMedia-3.0") |
local widgetLists = AceGUIWidgetLSMlists |
local GameTooltip = GameTooltip |
local WatchFrameCollapseExpandButton = WatchFrameCollapseExpandButton |
local positions = {"TOP", "TOPRIGHT", "TOPLEFT", |
"BOTTOM", "BOTTOMRIGHT", "BOTTOMLEFT", |
"RIGHT", "LEFT", "CENTER"} |
disableShadow = false, |
scale = 1, |
hideFrame = false, |
instance = false, |
keybind = "", |
} |
}, |
hideFrame = { |
name = "Hide frame when empty", |
desc = 'Hide the watch frame when no quests or achievements are being tracked.', |
desc = "Hide the watch frame when no quests or achievements are being tracked.", |
type = "toggle", |
get = function() return db.hideFrame end, |
set = function() |
end, |
order = 15.5, |
}, |
instance = { |
name = "Collapse in instance", |
desc = "Automatically collapses the watch frame when entering an instance.", |
type = "toggle", |
get = function() return db.instance end, |
set = function() |
db.instance = not db.instance |
if db.instance then |
WFContainer:RegisterEvent("PLAYER_ENTERING_WORLD") |
else |
WFContainer:UnregisterEvent("PLAYER_ENTERING_WORLD") |
end |
end, |
order = 15.7, |
}, |
spacer4 = { |
name = " ", |
type = "description", |
SlashCmdList["WFWW"] = function() InterfaceOptionsFrame_OpenToCategory("Who Framed Watcher Wabbit?") end |
SLASH_WFWW1 = "/wfww" |
WFContainer:UnregisterEvent("PLAYER_ENTERING_WORLD") |
if not db.instance then |
WFContainer:UnregisterEvent("PLAYER_ENTERING_WORLD") |
end |
WFContainer:RegisterEvent("QUEST_WATCH_UPDATE") |
WFContainer:RegisterEvent("QUEST_AUTOCOMPLETE") |
WFContainer:RegisterEvent("CVAR_UPDATE") |
WFContainer:SetScript("OnEvent", function(_,event,...) |
if event == "CVAR_UPDATE" then |
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 |
end |
elseif event == "CVAR_UPDATE" then |
local cvar,value = ... |
if cvar == "WATCH_FRAME_WIDTH_TEXT" then |
if not WatchFrame.userCollapsed then |
## Interface: 40000 |
## Interface: 40100 |
## Name: Who Framed Watcher Wabbit? |
## Version: 1.5.4 |
## Version: 1.6 |
## Notes: Various tweaks to improve the quest watch frame |
## SavedVariables: WFWWDB |
## SavedVariablesPerCharacter: WFWWPCDB |
local function OnEditFocusLost(self) -- EditBox |
self:HighlightText(0, 0) |
self.obj:Fire("OnEditFocusLost") |
end |
local function OnEnter(self) -- EditBox / ScrollFrame |
frame:SetScript("OnShow", nil) |
end |
local function OnFocusGained(frame) |
local function OnEditFocusGained(frame) |
AceGUI:SetFocus(frame.obj) |
frame.obj:Fire("OnEditFocusGained") |
end |
--[[----------------------------------------------------------------------------- |
if not self.frame:IsShown() then |
self.frame:SetScript("OnShow", OnShowFocus) |
end |
end |
end, |
["GetCursorPosition"] = function(self) |
return self.editBox:GetCursorPosition() |
end, |
["SetCursorPosition"] = function(self, ...) |
return self.editBox:SetCursorPosition(...) |
end, |
} |
--[[----------------------------------------------------------------------------- |
editBox:SetScript("OnReceiveDrag", OnReceiveDrag) |
editBox:SetScript("OnTextChanged", OnTextChanged) |
editBox:SetScript("OnTextSet", OnTextSet) |
editBox:SetScript("OnEditFocusGained", OnFocusGained) |
editBox:SetScript("OnEditFocusGained", OnEditFocusGained) |
scrollFrame:SetScrollChild(editBox) |
TabGroup Container |
Container that uses tabs on top to switch between groups. |
-------------------------------------------------------------------------------]] |
local Type, Version = "TabGroup", 32 |
local Type, Version = "TabGroup", 34 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
frame:_SetText(text) |
local width = frame.obj.frame.width or frame.obj.frame:GetWidth() or 0 |
if wow_406 then |
PanelTemplates_TabResize(frame, 0, nil, nil, width) |
PanelTemplates_TabResize(frame, 0, nil, nil, width, frame:GetFontString():GetStringWidth()) |
else |
PanelTemplates_TabResize(frame, 0, nil, width) |
end |
for i = starttab, endtab do |
if wow_406 then |
PanelTemplates_TabResize(tabs[i], padding + 4, nil, nil, width) |
PanelTemplates_TabResize(tabs[i], padding + 4, nil, nil, width, tabs[i]:GetFontString():GetStringWidth()) |
else |
PanelTemplates_TabResize(tabs[i], padding + 4, nil, width) |
end |