SLASH_WFWW1 = "/wfww" |
|
WFContainer:UnregisterEvent("PLAYER_ENTERING_WORLD") |
WFContainer:RegisterEvent("QUEST_WATCH_UPDATE") |
WFContainer:RegisterEvent("QUEST_AUTOCOMPLETE") |
WFContainer:RegisterEvent("CVAR_UPDATE") |
WFContainer:SetScript("OnEvent", function(_,_,cvar,value) |
if cvar == "WATCH_FRAME_WIDTH_TEXT" then |
if not WatchFrame.userCollapsed then |
if value == "1" then |
WFContainer:SetWidth(350) |
else |
WFContainer:SetWidth(250) |
WFContainer:SetScript("OnEvent", function(_,event,...) |
if event == "CVAR_UPDATE" then |
local cvar,value = ... |
if cvar == "WATCH_FRAME_WIDTH_TEXT" then |
if not WatchFrame.userCollapsed then |
if value == "1" then |
WFContainer:SetWidth(350) |
else |
WFContainer:SetWidth(250) |
end |
end |
wideFrame = value |
end |
wideFrame = value |
else |
local index = ... |
if event == "QUEST_AUTOCOMPLETE" or index == 0 then |
if WFWWPCDB.collapsed then |
WFContainer:SetHeight(db.height) |
if wideFrame == "1" then |
WFContainer:SetWidth(350) |
else |
WFContainer:SetWidth(250) |
end |
WFWWPCDB.collapsed = false |
end |
end |
end |
end) |
end |