/trunk
## Interface: 70000 |
## Interface: 80000 |
## Name: Who Framed Watcher Wabbit? |
## Version: 2.2.1 |
## Version: 2.3 |
## Notes: Various tweaks to improve the quest watch frame |
## SavedVariables: WFWWDB |
## SavedVariablesPerCharacter: WFWWPCDB |
Slider Widget |
Graphical Slider, like, for Range values. |
-------------------------------------------------------------------------------]] |
local Type, Version = "Slider", 21 |
local Type, Version = "Slider", 22 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
end |
if value then |
PlaySound("igMainMenuOptionCheckBoxOn") |
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
self.slider:SetValue(value) |
self:Fire("OnMouseUp", value) |
end |
TabGroup Container |
Container that uses tabs on top to switch between groups. |
-------------------------------------------------------------------------------]] |
local Type, Version = "TabGroup", 35 |
local Type, Version = "TabGroup", 36 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
-------------------------------------------------------------------------------]] |
local function Tab_OnClick(frame) |
if not (frame.selected or frame.disabled) then |
PlaySound("igCharacterInfoTab") |
PlaySound(841) -- SOUNDKIT.IG_CHARACTER_INFO_TAB |
frame.obj:SelectTab(frame.value) |
end |
end |
--[[----------------------------------------------------------------------------- |
Checkbox Widget |
-------------------------------------------------------------------------------]] |
local Type, Version = "CheckBox", 22 |
local Type, Version = "CheckBox", 24 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
self.text:SetPoint("LEFT", self.checkbg, "RIGHT") |
self.text:SetPoint("RIGHT") |
else |
self.text:SetPoint("LEFT", self.image,"RIGHT", 1, 0) |
self.text:SetPoint("LEFT", self.checkbg, "RIGHT", self.image:GetWidth() + 2, 0) |
self.text:SetPoint("RIGHT") |
end |
end |
self:ToggleChecked() |
if self.checked then |
PlaySound("igMainMenuOptionCheckBoxOn") |
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
else -- for both nil and false (tristate) |
PlaySound("igMainMenuOptionCheckBoxOff") |
PlaySound(857) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF |
end |
self:Fire("OnValueChanged", self.checked) |
desc:ClearAllPoints() |
desc:SetPoint("TOPLEFT", self.checkbg, "TOPRIGHT", 5, -21) |
desc:SetWidth(self.frame.width - 30) |
desc:SetPoint("RIGHT", self.frame, "RIGHT", -30, 0) |
desc:SetJustifyH("LEFT") |
desc:SetJustifyV("TOP") |
self.desc = desc |
--[[----------------------------------------------------------------------------- |
Frame Container |
-------------------------------------------------------------------------------]] |
local Type, Version = "Frame", 24 |
local Type, Version = "Frame", 26 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
Scripts |
-------------------------------------------------------------------------------]] |
local function Button_OnClick(frame) |
PlaySound("gsTitleOptionExit") |
PlaySound(799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT |
frame.obj:Hide() |
end |
local function Frame_OnShow(frame) |
frame.obj:Fire("OnShow") |
end |
local function Frame_OnClose(frame) |
frame.obj:Fire("OnClose") |
end |
frame:SetBackdropColor(0, 0, 0, 1) |
frame:SetMinResize(400, 200) |
frame:SetToplevel(true) |
frame:SetScript("OnShow", Frame_OnShow) |
frame:SetScript("OnHide", Frame_OnClose) |
frame:SetScript("OnMouseDown", Frame_OnMouseDown) |
--[[ $Id: AceGUIWidget-DropDown.lua 1116 2014-10-12 08:15:46Z nevcairiel $ ]]-- |
--[[ $Id: AceGUIWidget-DropDown.lua 1167 2017-08-29 22:08:48Z funkydude $ ]]-- |
local AceGUI = LibStub("AceGUI-3.0") |
-- Lua APIs |
do |
local widgetType = "Dropdown" |
local widgetVersion = 30 |
local widgetVersion = 31 |
--[[ Static data ]]-- |
local function Dropdown_TogglePullout(this) |
local self = this.obj |
PlaySound("igMainMenuOptionCheckBoxOn") -- missleading name, but the Blizzard code uses this sound |
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
if self.open then |
self.open = nil |
self.pullout:Close() |
--[[----------------------------------------------------------------------------- |
EditBox Widget |
-------------------------------------------------------------------------------]] |
local Type, Version = "EditBox", 26 |
local Type, Version = "EditBox", 28 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
local value = frame:GetText() |
local cancel = self:Fire("OnEnterPressed", value) |
if not cancel then |
PlaySound("igMainMenuOptionCheckBoxOn") |
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
HideButton(self) |
end |
end |
local function EditBox_OnReceiveDrag(frame) |
local self = frame.obj |
local type, id, info = GetCursorInfo() |
local name |
if type == "item" then |
self:SetText(info) |
self:Fire("OnEnterPressed", info) |
ClearCursor() |
name = info |
elseif type == "spell" then |
local name = GetSpellInfo(id, info) |
self:SetText(name) |
self:Fire("OnEnterPressed", name) |
ClearCursor() |
name = GetSpellInfo(id, info) |
elseif type == "macro" then |
local name = GetMacroInfo(id) |
name = GetMacroInfo(id) |
end |
if name then |
self:SetText(name) |
self:Fire("OnEnterPressed", name) |
ClearCursor() |
HideButton(self) |
AceGUI:ClearFocus() |
end |
HideButton(self) |
AceGUI:ClearFocus() |
end |
local function EditBox_OnTextChanged(frame) |
]] |
do |
local Type = "Window" |
local Version = 4 |
local Version = 6 |
local function frameOnShow(this) |
this.obj:Fire("OnShow") |
end |
local function frameOnClose(this) |
this.obj:Fire("OnClose") |
end |
local function closeOnClick(this) |
PlaySound("gsTitleOptionExit") |
PlaySound(799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT |
this.obj:Hide() |
end |
frame:SetFrameStrata("FULLSCREEN_DIALOG") |
frame:SetScript("OnMouseDown", frameOnMouseDown) |
frame:SetScript("OnShow",frameOnShow) |
frame:SetScript("OnHide",frameOnClose) |
frame:SetMinResize(240,240) |
frame:SetToplevel(true) |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
local IsLegion = select(4, GetBuildInfo()) >= 70000 |
-- Lua APIs |
local pairs, assert, type = pairs, assert, type |
local min, max, floor, abs = math.min, math.max, math.floor, math.abs |
local scrollbg = scrollbar:CreateTexture(nil, "BACKGROUND") |
scrollbg:SetAllPoints(scrollbar) |
if IsLegion then |
scrollbg:SetColorTexture(0, 0, 0, 0.4) |
else |
scrollbg:SetTexture(0, 0, 0, 0.4) |
end |
scrollbg:SetColorTexture(0, 0, 0, 0.4) |
--Container Support |
local content = CreateFrame("Frame", nil, scrollframe) |
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1137 2016-05-15 10:57:36Z nevcairiel $ ]]-- |
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1167 2017-08-29 22:08:48Z funkydude $ ]]-- |
local AceGUI = LibStub("AceGUI-3.0") |
local IsLegion = select(4, GetBuildInfo()) >= 70000 |
-- Lua APIs |
local select, assert = select, assert |
-- Does not close the pullout on click. |
do |
local widgetType = "Dropdown-Item-Toggle" |
local widgetVersion = 3 |
local widgetVersion = 4 |
local function UpdateToggle(self) |
if self.value then |
if self.disabled then return end |
self.value = not self.value |
if self.value then |
PlaySound("igMainMenuOptionCheckBoxOn") |
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
else |
PlaySound("igMainMenuOptionCheckBoxOff") |
PlaySound(857) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF |
end |
UpdateToggle(self) |
self:Fire("OnValueChanged", self.value) |
local line = self.frame:CreateTexture(nil, "OVERLAY") |
line:SetHeight(1) |
if IsLegion then |
line:SetColorTexture(.5, .5, .5) |
else |
line:SetTexture(.5, .5, .5) |
end |
line:SetColorTexture(.5, .5, .5) |
line:SetPoint("LEFT", self.frame, "LEFT", 10, 0) |
line:SetPoint("RIGHT", self.frame, "RIGHT", -10, 0) |
Button Widget |
Graphical Button. |
-------------------------------------------------------------------------------]] |
local Type, Version = "Button", 23 |
local Type, Version = "Button", 24 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
-------------------------------------------------------------------------------]] |
local function Button_OnClick(frame, ...) |
AceGUI:ClearFocus() |
PlaySound("igMainMenuOption") |
PlaySound(852) -- SOUNDKIT.IG_MAINMENU_OPTION |
frame.obj:Fire("OnClick", ...) |
end |
TreeGroup Container |
Container that uses a tree control to switch between groups. |
-------------------------------------------------------------------------------]] |
local Type, Version = "TreeGroup", 40 |
local Type, Version = "TreeGroup", 41 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
local IsLegion = select(4, GetBuildInfo()) >= 70000 |
local WoW80 = select(4, GetBuildInfo()) >= 80000 |
-- Lua APIs |
local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type |
local function FirstFrameUpdate(frame) |
local self = frame.obj |
frame:SetScript("OnUpdate", nil) |
self:RefreshTree() |
self:RefreshTree(nil, true) |
end |
local function BuildUniqueValue(...) |
["OnRelease"] = function(self) |
self.status = nil |
self.tree = nil |
self.frame:SetScript("OnUpdate", nil) |
for k, v in pairs(self.localstatus) do |
if k == "groups" then |
for k2 in pairs(v) do |
end |
end, |
["RefreshTree"] = function(self,scrollToSelection) |
local buttons = self.buttons |
["RefreshTree"] = function(self,scrollToSelection,fromOnUpdate) |
local buttons = self.buttons |
local lines = self.lines |
for i, v in ipairs(buttons) do |
local maxlines = (floor(((self.treeframe:GetHeight()or 0) - 20 ) / 18)) |
if maxlines <= 0 then return end |
-- workaround for lag spikes on WoW 8.0 |
if WoW80 and self.frame:GetParent() == UIParent and not fromOnUpdate then |
self.frame:SetScript("OnUpdate", FirstFrameUpdate) |
return |
end |
local first, last |
scrollToSelection = status.scrollToSelection |
local scrollbg = scrollbar:CreateTexture(nil, "BACKGROUND") |
scrollbg:SetAllPoints(scrollbar) |
scrollbg:SetColorTexture(0,0,0,0.4) |
if IsLegion then |
scrollbg:SetColorTexture(0,0,0,0.4) |
else |
scrollbg:SetTexture(0,0,0,0.4) |
end |
local border = CreateFrame("Frame",nil,frame) |
border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT") |
border:SetPoint("BOTTOMRIGHT") |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
local IsLegion = select(4, GetBuildInfo()) >= 70000 |
-- Lua APIs |
local pairs = pairs |
local texture = frame:CreateTexture(nil, "BACKGROUND") |
texture:SetWidth(16) |
texture:SetHeight(16) |
if IsLegion then |
texture:SetColorTexture(1, 1, 1) |
else |
texture:SetTexture(1, 1, 1) |
end |
texture:SetColorTexture(1, 1, 1) |
texture:SetPoint("CENTER", colorSwatch) |
texture:Show() |
--[[----------------------------------------------------------------------------- |
InteractiveLabel Widget |
-------------------------------------------------------------------------------]] |
local Type, Version = "InteractiveLabel", 20 |
local Type, Version = "InteractiveLabel", 21 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
Label Widget |
Displays text and optionally an icon. |
-------------------------------------------------------------------------------]] |
local Type, Version = "Label", 23 |
local Type, Version = "Label", 24 |
local AceGUI = LibStub and LibStub("AceGUI-3.0", true) |
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end |
self:SetImageSize(16, 16) |
self:SetColor() |
self:SetFontObject() |
self:SetJustifyH("LEFT") |
self:SetJustifyV("TOP") |
-- reset the flag |
self.resizing = nil |
self.image:SetHeight(height) |
UpdateImageAnchor(self) |
end, |
["SetJustifyH"] = function(self, justifyH) |
self.label:SetJustifyH(justifyH) |
end, |
["SetJustifyV"] = function(self, justifyV) |
self.label:SetJustifyV(justifyV) |
end, |
} |
--[[----------------------------------------------------------------------------- |
frame:Hide() |
local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontHighlightSmall") |
label:SetJustifyH("LEFT") |
label:SetJustifyV("TOP") |
local image = frame:CreateTexture(nil, "BACKGROUND") |
-- create widget |
-- f:AddChild(btn) |
-- @class file |
-- @name AceGUI-3.0 |
-- @release $Id: AceGUI-3.0.lua 1102 2013-10-25 14:15:23Z nevcairiel $ |
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 34 |
-- @release $Id: AceGUI-3.0.lua 1177 2018-06-25 12:12:48Z nevcairiel $ |
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 36 |
local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR) |
if not AceGUI then return end -- No upgrade needed |
height = height + rowheight + 3 |
safecall(content.obj.LayoutFinished, content.obj, nil, height) |
end) |
-- Get alignment method and value. Possible alignment methods are a callback, a number, "start", "middle", "end", "fill" or "TOPLEFT", "BOTTOMRIGHT" etc. |
local GetCellAlign = function (dir, tableObj, colObj, cellObj, cell, child) |
local fn = cellObj and (cellObj["align" .. dir] or cellObj.align) |
or colObj and (colObj["align" .. dir] or colObj.align) |
or tableObj["align" .. dir] or tableObj.align |
or "CENTERLEFT" |
local child, cell, val = child or 0, cell or 0, nil |
if type(fn) == "string" then |
fn = fn:lower() |
fn = dir == "V" and (fn:sub(1, 3) == "top" and "start" or fn:sub(1, 6) == "bottom" and "end" or fn:sub(1, 6) == "center" and "middle") |
or dir == "H" and (fn:sub(-4) == "left" and "start" or fn:sub(-5) == "right" and "end" or fn:sub(-6) == "center" and "middle") |
or fn |
val = (fn == "start" or fn == "fill") and 0 or fn == "end" and cell - child or (cell - child) / 2 |
elseif type(fn) == "function" then |
val = fn(child or 0, cell, dir) |
else |
val = fn |
end |
return fn, max(0, min(val, cell)) |
end |
-- Get width or height for multiple cells combined |
local GetCellDimension = function (dir, laneDim, from, to, space) |
local dim = 0 |
for cell=from,to do |
dim = dim + (laneDim[cell] or 0) |
end |
return dim + max(0, to - from) * (space or 0) |
end |
--[[ Options |
============ |
Container: |
- columns ({col, col, ...}): Column settings. "col" can be a number (<= 0: content width, <1: rel. width, <10: weight, >=10: abs. width) or a table with column setting. |
- space, spaceH, spaceV: Overall, horizontal and vertical spacing between cells. |
- align, alignH, alignV: Overall, horizontal and vertical cell alignment. See GetCellAlign() for possible values. |
Columns: |
- width: Fixed column width (nil or <=0: content width, <1: rel. width, >=1: abs. width). |
- min or 1: Min width for content based width |
- max or 2: Max width for content based width |
- weight: Flexible column width. The leftover width after accounting for fixed-width columns is distributed to weighted columns according to their weights. |
- align, alignH, alignV: Overwrites the container setting for alignment. |
Cell: |
- colspan: Makes a cell span multiple columns. |
- rowspan: Makes a cell span multiple rows. |
- align, alignH, alignV: Overwrites the container and column setting for alignment. |
]] |
AceGUI:RegisterLayout("Table", |
function (content, children) |
local obj = content.obj |
obj:PauseLayout() |
local tableObj = obj:GetUserData("table") |
local cols = tableObj.columns |
local spaceH = tableObj.spaceH or tableObj.space or 0 |
local spaceV = tableObj.spaceV or tableObj.space or 0 |
local totalH = (content:GetWidth() or content.width or 0) - spaceH * (#cols - 1) |
-- We need to reuse these because layout events can come in very frequently |
local layoutCache = obj:GetUserData("layoutCache") |
if not layoutCache then |
layoutCache = {{}, {}, {}, {}, {}, {}} |
obj:SetUserData("layoutCache", layoutCache) |
end |
local t, laneH, laneV, rowspans, rowStart, colStart = unpack(layoutCache) |
-- Create the grid |
local n, slotFound = 0 |
for i,child in ipairs(children) do |
if child:IsShown() then |
repeat |
n = n + 1 |
local col = (n - 1) % #cols + 1 |
local row = ceil(n / #cols) |
local rowspan = rowspans[col] |
local cell = rowspan and rowspan.child or child |
local cellObj = cell:GetUserData("cell") |
slotFound = not rowspan |
-- Rowspan |
if not rowspan and cellObj and cellObj.rowspan then |
rowspan = {child = child, from = row, to = row + cellObj.rowspan - 1} |
rowspans[col] = rowspan |
end |
if rowspan and i == #children then |
rowspan.to = row |
end |
-- Colspan |
local colspan = max(0, min((cellObj and cellObj.colspan or 1) - 1, #cols - col)) |
n = n + colspan |
-- Place the cell |
if not rowspan or rowspan.to == row then |
t[n] = cell |
rowStart[cell] = rowspan and rowspan.from or row |
colStart[cell] = col |
if rowspan then |
rowspans[col] = nil |
end |
end |
until slotFound |
end |
end |
local rows = ceil(n / #cols) |
-- Determine fixed size cols and collect weights |
local extantH, totalWeight = totalH, 0 |
for col,colObj in ipairs(cols) do |
laneH[col] = 0 |
if type(colObj) == "number" then |
colObj = {[colObj >= 1 and colObj < 10 and "weight" or "width"] = colObj} |
cols[col] = colObj |
end |
if colObj.weight then |
-- Weight |
totalWeight = totalWeight + (colObj.weight or 1) |
else |
if not colObj.width or colObj.width <= 0 then |
-- Content width |
for row=1,rows do |
local child = t[(row - 1) * #cols + col] |
if child then |
local f = child.frame |
f:ClearAllPoints() |
local childH = f:GetWidth() or 0 |
laneH[col] = max(laneH[col], childH - GetCellDimension("H", laneH, colStart[child], col - 1, spaceH)) |
end |
end |
laneH[col] = max(colObj.min or colObj[1] or 0, min(laneH[col], colObj.max or colObj[2] or laneH[col])) |
else |
-- Rel./Abs. width |
laneH[col] = colObj.width < 1 and colObj.width * totalH or colObj.width |
end |
extantH = max(0, extantH - laneH[col]) |
end |
end |
-- Determine sizes based on weight |
local scale = totalWeight > 0 and extantH / totalWeight or 0 |
for col,colObj in pairs(cols) do |
if colObj.weight then |
laneH[col] = scale * colObj.weight |
end |
end |
-- Arrange children |
for row=1,rows do |
local rowV = 0 |
-- Horizontal placement and sizing |
for col=1,#cols do |
local child = t[(row - 1) * #cols + col] |
if child then |
local colObj = cols[colStart[child]] |
local cellObj = child:GetUserData("cell") |
local offsetH = GetCellDimension("H", laneH, 1, colStart[child] - 1, spaceH) + (colStart[child] == 1 and 0 or spaceH) |
local cellH = GetCellDimension("H", laneH, colStart[child], col, spaceH) |
local f = child.frame |
f:ClearAllPoints() |
local childH = f:GetWidth() or 0 |
local alignFn, align = GetCellAlign("H", tableObj, colObj, cellObj, cellH, childH) |
f:SetPoint("LEFT", content, offsetH + align, 0) |
if child:IsFullWidth() or alignFn == "fill" or childH > cellH then |
f:SetPoint("RIGHT", content, "LEFT", offsetH + align + cellH, 0) |
end |
if child.DoLayout then |
child:DoLayout() |
end |
rowV = max(rowV, (f:GetHeight() or 0) - GetCellDimension("V", laneV, rowStart[child], row - 1, spaceV)) |
end |
end |
laneV[row] = rowV |
-- Vertical placement and sizing |
for col=1,#cols do |
local child = t[(row - 1) * #cols + col] |
if child then |
local colObj = cols[colStart[child]] |
local cellObj = child:GetUserData("cell") |
local offsetV = GetCellDimension("V", laneV, 1, rowStart[child] - 1, spaceV) + (rowStart[child] == 1 and 0 or spaceV) |
local cellV = GetCellDimension("V", laneV, rowStart[child], row, spaceV) |
local f = child.frame |
local childV = f:GetHeight() or 0 |
local alignFn, align = GetCellAlign("V", tableObj, colObj, cellObj, cellV, childV) |
if child:IsFullHeight() or alignFn == "fill" then |
f:SetHeight(cellV) |
end |
f:SetPoint("TOP", content, 0, -(offsetV + align)) |
end |
end |
end |
-- Calculate total height |
local totalV = GetCellDimension("V", laneV, 1, #laneV, spaceV) |
-- Cleanup |
for _,v in pairs(layoutCache) do wipe(v) end |
safecall(obj.LayoutFinished, obj, nil, totalV) |
obj:ResumeLayout() |
end) |
--[[ |
Name: LibSharedMedia-3.0 |
Revision: $Revision: 89 $ |
Revision: $Revision: 91 $ |
Author: Elkano (elkano@gmx.de) |
Inspired By: SurfaceLib by Haste/Otravi (troeks@gmail.com) |
Website: http://www.wowace.com/projects/libsharedmedia-3-0/ |
License: LGPL v2.1 |
]] |
local MAJOR, MINOR = "LibSharedMedia-3.0", 6000201 -- 6.0.2 v1 / increase manually on changes |
local MAJOR, MINOR = "LibSharedMedia-3.0", 6010002 -- 6.1.0 v2 / increase manually on changes |
local lib = LibStub:NewLibrary(MAJOR, MINOR) |
if not lib then return end |
end |
mediatype = mediatype:lower() |
if mediatype == lib.MediaType.FONT and ((langmask and band(langmask, LOCALE_MASK) == 0) or not (langmask or locale_is_western)) then return false end |
if mediatype == lib.MediaType.SOUND and type(data) == "string" then |
local path = data:lower() |
-- Only ogg and mp3 are valid sounds. |
if not path:find(".ogg", nil, true) and not path:find(".mp3", nil, true) then |
return false |
end |
end |
if not mediaTable[mediatype] then mediaTable[mediatype] = {} end |
local mtable = mediaTable[mediatype] |
if mtable[key] then return false end |
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ |
..\FrameXML\UI.xsd"> |
<Script file="LibSharedMedia-3.0.lua" /> |
</Ui> |
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ |
..\FrameXML\UI.xsd"> |
<Script file="AceConfigRegistry-3.0.lua"/> |
</Ui> |
-- :IterateOptionsTables() (and :GetOptionsTable() if only given one argument) return a function reference that the requesting config handling addon must call with valid "uiType", "uiName". |
-- @class file |
-- @name AceConfigRegistry-3.0 |
-- @release $Id: AceConfigRegistry-3.0.lua 1139 2016-07-03 07:43:51Z nevcairiel $ |
local MAJOR, MINOR = "AceConfigRegistry-3.0", 16 |
-- @release $Id: AceConfigRegistry-3.0.lua 1169 2018-02-27 16:18:28Z nevcairiel $ |
local CallbackHandler = LibStub("CallbackHandler-1.0") |
local MAJOR, MINOR = "AceConfigRegistry-3.0", 18 |
local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigRegistry then return end |
AceConfigRegistry.tables = AceConfigRegistry.tables or {} |
local CallbackHandler = LibStub:GetLibrary("CallbackHandler-1.0") |
if not AceConfigRegistry.callbacks then |
AceConfigRegistry.callbacks = CallbackHandler:New(AceConfigRegistry) |
end |
local opttable={["nil"]=true,["table"]=true, _="table"} |
local optbool={["nil"]=true,["boolean"]=true, _="boolean"} |
local optboolnumber={["nil"]=true,["boolean"]=true,["number"]=true, _="boolean or number"} |
local optstringnumber={["nil"]=true,["string"]=true,["number"]=true, _="string or number"} |
local basekeys={ |
type=isstring, |
set=optmethodfalse, |
func=optmethodfalse, |
arg={["*"]=true}, |
width=optstring, |
width=optstringnumber, |
} |
local typedkeys={ |
<Include file="AceConfigDialog-3.0\AceConfigDialog-3.0.xml"/> |
<!--<Include file="AceConfigDropdown-3.0\AceConfigDropdown-3.0.xml"/>--> |
<Script file="AceConfig-3.0.lua"/> |
</Ui> |
-- as well as associate it with a slash command. |
-- @class file |
-- @name AceConfig-3.0 |
-- @release $Id: AceConfig-3.0.lua 969 2010-10-07 02:11:48Z shefki $ |
-- @release $Id: AceConfig-3.0.lua 1161 2017-08-12 14:30:16Z funkydude $ |
--[[ |
AceConfig-3.0 |
]] |
local MAJOR, MINOR = "AceConfig-3.0", 2 |
local cfgreg = LibStub("AceConfigRegistry-3.0") |
local cfgcmd = LibStub("AceConfigCmd-3.0") |
local MAJOR, MINOR = "AceConfig-3.0", 3 |
local AceConfig = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfig then return end |
local cfgreg = LibStub("AceConfigRegistry-3.0") |
local cfgcmd = LibStub("AceConfigCmd-3.0") |
--TODO: local cfgdlg = LibStub("AceConfigDialog-3.0", true) |
--TODO: local cfgdrp = LibStub("AceConfigDropdown-3.0", true) |
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ |
..\FrameXML\UI.xsd"> |
<Script file="AceConfigDialog-3.0.lua"/> |
</Ui> |
--- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables. |
-- @class file |
-- @name AceConfigDialog-3.0 |
-- @release $Id: AceConfigDialog-3.0.lua 1139 2016-07-03 07:43:51Z nevcairiel $ |
-- @release $Id: AceConfigDialog-3.0.lua 1169 2018-02-27 16:18:28Z nevcairiel $ |
local LibStub = LibStub |
local MAJOR, MINOR = "AceConfigDialog-3.0", 61 |
local gui = LibStub("AceGUI-3.0") |
local reg = LibStub("AceConfigRegistry-3.0") |
local MAJOR, MINOR = "AceConfigDialog-3.0", 66 |
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigDialog then return end |
AceConfigDialog.frame.closing = AceConfigDialog.frame.closing or {} |
AceConfigDialog.frame.closeAllOverride = AceConfigDialog.frame.closeAllOverride or {} |
local gui = LibStub("AceGUI-3.0") |
local reg = LibStub("AceConfigRegistry-3.0") |
-- Lua APIs |
local tconcat, tinsert, tsort, tremove, tsort = table.concat, table.insert, table.sort, table.remove, table.sort |
local strmatch, format = string.match, string.format |
end |
end |
local function validationErrorPopup(message) |
if not StaticPopupDialogs["ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG"] then |
StaticPopupDialogs["ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG"] = {} |
end |
local t = StaticPopupDialogs["ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG"] |
t.text = message |
t.button1 = OKAY |
t.preferredIndex = STATICPOPUP_NUMDIALOGS |
local dialog, oldstrata |
t.OnAccept = function() |
if dialog and oldstrata then |
dialog:SetFrameStrata(oldstrata) |
end |
end |
t.timeout = 0 |
t.whileDead = 1 |
t.hideOnEscape = 1 |
dialog = StaticPopup_Show("ACECONFIGDIALOG30_VALIDATION_ERROR_DIALOG") |
if dialog then |
oldstrata = dialog:GetFrameStrata() |
dialog:SetFrameStrata("TOOLTIP") |
end |
end |
local function ActivateControl(widget, event, ...) |
--This function will call the set / execute handler for the widget |
--widget:GetUserDataTable() contains the needed info |
end |
local rootframe = user.rootframe |
if type(validated) == "string" then |
--validate function returned a message to display |
if rootframe.SetStatusText then |
rootframe:SetStatusText(validated) |
else |
-- TODO: do something else. |
end |
PlaySound("igPlayerInviteDecline") |
del(info) |
return true |
elseif not validated then |
--validate returned false |
if rootframe.SetStatusText then |
if not validated or type(validated) == "string" then |
if not validated then |
if usage then |
rootframe:SetStatusText(name..": "..usage) |
validated = name..": "..usage |
else |
if pattern then |
rootframe:SetStatusText(name..": Expected "..pattern) |
validated = name..": Expected "..pattern |
else |
rootframe:SetStatusText(name..": Invalid Value") |
validated = name..": Invalid Value" |
end |
end |
end |
-- show validate message |
if rootframe.SetStatusText then |
rootframe:SetStatusText(validated) |
else |
-- TODO: do something else |
validationErrorPopup(validated) |
end |
PlaySound("igPlayerInviteDecline") |
PlaySound(882) -- SOUNDKIT.IG_PLAYER_INVITE_DECLINE || _DECLINE is actually missing from the table |
del(info) |
return true |
else |
entry.value = k |
entry.text = GetOptionsMemberValue("name", v, options, path, appName) |
entry.icon = GetOptionsMemberValue("icon", v, options, path, appName) |
entry.iconCoords = GetOptionsMemberValue("iconCoords", v, options, path, appName) |
entry.disabled = CheckOptionDisabled(v, options, path, appName) |
tinsert(tree,entry) |
if recurse and (v.childGroups or "tree") == "tree" then |
radio:SetWidth(width_multiplier * 2) |
elseif width == "half" then |
radio:SetWidth(width_multiplier / 2) |
elseif (type(width) == "number") then |
radio:SetWidth(width_multiplier * width) |
elseif width == "full" then |
radio.width = "fill" |
else |
control:SetWidth(width_multiplier * 2) |
elseif width == "half" then |
control:SetWidth(width_multiplier / 2) |
elseif (type(width) == "number") then |
control:SetWidth(width_multiplier * width) |
elseif width == "full" then |
control.width = "fill" |
else |
check:SetWidth(width_multiplier * 2) |
elseif width == "half" then |
check:SetWidth(width_multiplier / 2) |
elseif (type(width) == "number") then |
control:SetWidth(width_multiplier * width) |
elseif width == "full" then |
check.width = "fill" |
else |
control:SetWidth(width_multiplier * 2) |
elseif width == "half" then |
control:SetWidth(width_multiplier / 2) |
elseif (type(width) == "number") then |
control:SetWidth(width_multiplier * width) |
elseif width == "full" then |
control.width = "fill" |
else |
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ |
..\FrameXML\UI.xsd"> |
<Script file="AceConfigCmd-3.0.lua"/> |
</Ui> |
--- AceConfigCmd-3.0 handles access to an options table through the "command line" interface via the ChatFrames. |
-- @class file |
-- @name AceConfigCmd-3.0 |
-- @release $Id: AceConfigCmd-3.0.lua 1045 2011-12-09 17:58:40Z nevcairiel $ |
-- @release $Id: AceConfigCmd-3.0.lua 1161 2017-08-12 14:30:16Z funkydude $ |
--[[ |
AceConfigCmd-3.0 |
-- TODO: plugin args |
local cfgreg = LibStub("AceConfigRegistry-3.0") |
local MAJOR, MINOR = "AceConfigCmd-3.0", 13 |
local MAJOR, MINOR = "AceConfigCmd-3.0", 14 |
local AceConfigCmd = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigCmd then return end |
AceConfigCmd.commands = AceConfigCmd.commands or {} |
local commands = AceConfigCmd.commands |
local cfgreg = LibStub("AceConfigRegistry-3.0") |
local AceConsole -- LoD |
local AceConsoleName = "AceConsole-3.0" |
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ |
..\FrameXML\UI.xsd"> |
<Script file="CallbackHandler-1.0.lua"/> |
</Ui> |
local otfTitle = ObjectiveTrackerFrame.HeaderMenu.Title |
local otfQuests = ObjectiveTrackerBlocksFrame.QuestHeader |
local _, questTitle = ObjectiveTrackerBlocksFrame.QuestHeader:GetRegions() |
local maxQuests = MAX_WATCHABLE_QUESTS |
local otfAchievements = ObjectiveTrackerBlocksFrame.AchievementHeader |
local otfScenarios = ObjectiveTrackerBlocksFrame.ScenarioHeader |
local otfBonus = BONUS_OBJECTIVE_TRACKER_MODULE.Header |
local positions = {"TOP", "TOPRIGHT", "TOPLEFT", |
"BOTTOM", "BOTTOMRIGHT", "BOTTOMLEFT", |
"RIGHT", "LEFT", "CENTER"} |
local fontFlags = {"None", "Outline", "Monochrome Outline"} --, "Monochrome"} |
local fontFlags = {"None", "Outline", "Monochrome Outline", "Monochrome"} |
local _,class = UnitClass("player") |
local db, font, classColor |
local WFWWSkinnedHeaders = {} |
borderWidth = 16, |
inset = 5, |
anchorPoint = "TOPRIGHT", |
xOffset = "-15", |
xOffset = "-25", |
yOffset = "-250", |
height = 600, |
bgColor = {r = .1, g = .1, b = .1, a = .6}, |
name = " ", |
type = "description", |
width = "full", |
order = 0, |
order = 1, |
}, |
title1 = { |
name = "Size and Position", |
type = "header", |
order = .5, |
order = 2, |
}, |
anchor = { |
name = "Screen Anchor", |
db.yOffset = "0" |
MoveObjectiveTracker() |
end, |
order = 1, |
order = 3, |
}, |
xOffset = { |
name = "X Offset", |
db.xOffset = xOffset |
MoveObjectiveTracker() |
end, |
order = 2, |
order = 4, |
}, |
yOffset = { |
name = "Y Offset", |
db.yOffset = yOffset |
MoveObjectiveTracker() |
end, |
order = 3, |
order = 5, |
}, |
scale = { |
name = "WatchFrame scale", |
db.scale = scale |
SetSize() |
end, |
order = 4, |
order = 6, |
}, |
height = { |
name = "WatchFrame height", |
db.height = height |
SetSize() |
end, |
order = 5, |
order = 7, |
}, |
spacer1 = { |
name = " ", |
type = "description", |
width = "full", |
order = 5.4, |
order = 8, |
}, |
title2 = { |
name = "Font Options", |
type = "header", |
order = 5.5, |
order = 9, |
}, |
font = { |
name = "Font", |
db.font = font |
FontChanges() |
end, |
order = 6, |
order = 10, |
}, |
fontSize = { |
name = "Text Size", |
db.fontSize = size |
FontChanges() |
end, |
order = 7, |
order = 11, |
}, |
fontFlag = { |
name = "Font Flag", |
db.fontFlag = fontFlags[key] |
FontChanges() |
end, |
order = 8, |
order = 12, |
}, |
disableShadow = { |
name = "Disable Font Shadow", |
db.disableShadow = not db.disableShadow |
FontChanges() |
end, |
order = 8.5, |
order = 13, |
}, |
--[[ questSpacing = { |
questSpacing = { |
name = "Quest Spacing", |
desc = "Change the spacing between quests.", |
type = "range", |
min = 0, |
max = 12, |
max = 20, |
step = 1, |
get = function() return db.questSpacing end, |
set = function(_,size) |
DEFAULT_OBJECTIVE_TRACKER_MODULE.blockOffsetY = -db.questSpacing |
ObjectiveTracker_Update() |
end, |
order = 8.51, |
},]] |
order = 14, |
}, |
--[[lineSpacing = { |
name = "Line Spacing", |
desc = "Change the spacing between lines.", |
db.lineSpacing = size |
otfQuests.module.linespacing = db.lineSpacing |
otfAchievements.module.linespacing = db.lineSpacing |
--ObjectiveTracker_Update() |
ObjectiveTracker_Update() |
end, |
order = 8.52, |
order = 15, |
},]] |
spacer2 = { |
name = " ", |
type = "description", |
width = "full", |
order = 8.6, |
order = 16, |
}, |
title3 = { |
name = "Texture Options", |
type = "header", |
order = 8.7, |
order = 17, |
}, |
bg = { |
name = "Background", |
db.bg = bg |
Appearance() |
end, |
order = 9, |
order = 18, |
}, |
bgColor = { |
name = "Background Color/Alpha", |
db.bgColor.a = a |
Appearance() |
end, |
order = 10, |
order = 19, |
}, |
hideArt = { |
name = "Hide Title Art", |
db.hideArt = not db.hideArt |
Appearance() |
end, |
order = 10.5, |
order = 20, |
}, |
border = { |
name = "Border", |
db.border = border |
Appearance() |
end, |
order = 11, |
order = 21, |
}, |
borderColor = { |
name = "Border Color", |
db.borderColor.b = b |
Appearance() |
end, |
order = 12, |
order = 22, |
}, |
classBorder = { |
name = "Class Colored Border", |
db.classBorder = not db.classBorder |
Appearance() |
end, |
order = 12.5, |
order = 23, |
}, |
borderAlpha = { |
name = "Border Alpha", |
db.borderAlpha = borderAlpha |
Appearance() |
end, |
order = 13, |
order = 24, |
}, |
borderWidth = { |
name = "Border Width", |
db.borderWidth = borderWidth |
Appearance() |
end, |
order = 13.5, |
order = 25, |
}, |
inset = { |
name = "Inset", |
db.inset = inset |
Appearance() |
end, |
order = 14, |
order = 26, |
}, |
spacer3 = { |
name = " ", |
type = "description", |
width = "full", |
order = 14.4, |
order = 27, |
}, |
title4 = { |
name = "Miscellaneous", |
type = "header", |
order = 14.5, |
order = 28, |
}, |
hideFrame = { |
name = "Hide frame when empty", |
minimizeButton:EnableMouse(true) |
end |
end, |
order = 15, |
order = 29, |
}, |
instance = { |
name = "Collapse in instance", |
OTFContainer:UnregisterEvent("PLAYER_ENTERING_WORLD") |
end |
end, |
order = 15.2, |
order = 30, |
}, |
petBattle = { |
name = "Collapse in pet battle", |
FRAMELOCK_STATES.PETBATTLES.OTFContainer = "hidden" |
end |
end, |
order = 15.5, |
order = 31, |
}, |
scrolling = { |
name = "Scrolling Tracker", |
OTFContainerScrollBar:SetAlpha(ObjectiveTrackerFrame.collapsed and 0 or 1) |
OTFContainer:EnableMouseWheel(true) |
OTFContainerBG:SetWidth(ObjectiveTrackerFrame.collapsed and 150 or 297) |
ObjectiveTrackerFrame:SetHeight(980 or db.height - 20) |
ObjectiveTrackerFrame:SetHeight(db.height - 20) |
else |
OTFContainerBG:SetWidth(ObjectiveTrackerFrame.collapsed and 150 or 280) |
OTFContainerScrollBar:Hide() |
ObjectiveTrackerFrame:SetHeight(db.height - 20) |
end |
end, |
order = 15.6, |
order = 32, |
}, |
showNum = { |
name = "Show Number of Quests", |
questTitle:SetText(TRACKER_HEADER_QUESTS) |
end |
end, |
order = 15.7, |
order = 33, |
}, |
keybind = { |
name = "Keybinding", |
end |
db.keybind = key |
end, |
order = 15.8, |
order = 34, |
}, |
spacer4 = { |
name = " ", |
type = "description", |
width = "full", |
order = 16, |
order = 35, |
}, |
divider = { |
name = "Profile Management", |
type = "header", |
order = 17, |
order = 36, |
}, |
charSpec = { |
name = "Character specific settings", |
WFWWPCDB.charSpec = not WFWWPCDB.charSpec |
ReloadUI() |
end, |
order = 18, |
order = 37, |
}, |
copyProfile = { |
name = "Copy from Default", |
WFWWPCDB.charSpec = true |
ReloadUI() |
end, |
order = 19, |
order = 38, |
}, |
resetProfile = { |
name = "Profile Reset", |
end |
ReloadUI() |
end, |
order = 20, |
order = 39, |
}, |
}, |
} |
SetOverrideBindingClick(OTFContainer, false, db.keybind, "WFWWkeybindButton") |
end |
-- DEFAULT_OBJECTIVE_TRACKER_MODULE.blockOffsetY = -db.questSpacing |
DEFAULT_OBJECTIVE_TRACKER_MODULE.blockOffsetY = -db.questSpacing |
--otfQuests.module.linespacing = db.lineSpacing |
--otfAchievements.module.linespacing = db.lineSpacing |
InterfaceOptionsFrame_OpenToCategory("Who Framed Watcher Wabbit?") |
InterfaceOptionsFrame_OpenToCategory("Who Framed Watcher Wabbit?") |
elseif btn == "RightButton" then |
ToggleFrame(WorldMapFrame) |
QuestMapFrameViewAllButton_OnClick() |
ToggleQuestLog() |
else |
if not WFWWPCDB.collapsed then --if the container's not collapsed, collapse it |
CollapseObjectiveTracker() |
end |
function UpdateNumQuests() |
local _, numQuests = GetNumQuestLogEntries() |
otfTitle:SetText(strformat("%s (%d)", TRACKER_HEADER_OBJECTIVE, numQuests)) |
questTitle:SetText(strformat("%s (%d)", TRACKER_HEADER_QUESTS, numQuests)) |
local numEntries, numQuests = GetNumQuestLogEntries() |
otfTitle:SetText(strformat("%s (%d/%d)", TRACKER_HEADER_OBJECTIVE, numQuests, maxQuests)) |
questTitle:SetText(strformat("%s (%d/%d)", TRACKER_HEADER_QUESTS, numQuests, maxQuests)) |
end |
local function SetUpDB() |
OTFContainer:SetScript("OnEvent", function() |
Initialize() |
SetUpContainer() |
Initialize = nil |
end) |