/
## Interface: 70300 |
## Interface: 80000 |
## Title: Stuf Raid Options |
## Author: TotalPackage |
## Notes: Configuration Menu for StufRaid. |
end |
if value then |
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
self.slider:SetValue(value) |
self:Fire("OnMouseUp", value) |
end |
-------------------------------------------------------------------------------]] |
local function Tab_OnClick(frame) |
if not (frame.selected or frame.disabled) then |
PlaySound(PlaySoundKitID and "igCharacterInfoTab" or 841) -- SOUNDKIT.IG_CHARACTER_INFO_TAB |
PlaySound(841) -- SOUNDKIT.IG_CHARACTER_INFO_TAB |
frame.obj:SelectTab(frame.value) |
end |
end |
--[[----------------------------------------------------------------------------- |
Checkbox Widget |
-------------------------------------------------------------------------------]] |
local Type, Version = "CheckBox", 23 |
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(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
else -- for both nil and false (tristate) |
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOff" or 857) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF |
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 |
Scripts |
-------------------------------------------------------------------------------]] |
local function Button_OnClick(frame) |
PlaySound(PlaySoundKitID and "gsTitleOptionExit" or 799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT |
PlaySound(799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT |
frame.obj:Hide() |
end |
--[[ $Id: AceGUIWidget-DropDown.lua 1161 2017-08-12 14:30:16Z funkydude $ ]]-- |
--[[ $Id: AceGUIWidget-DropDown.lua 1167 2017-08-29 22:08:48Z funkydude $ ]]-- |
local AceGUI = LibStub("AceGUI-3.0") |
-- Lua APIs |
local function Dropdown_TogglePullout(this) |
local self = this.obj |
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
if self.open then |
self.open = nil |
self.pullout:Close() |
--[[----------------------------------------------------------------------------- |
EditBox Widget |
-------------------------------------------------------------------------------]] |
local Type, Version = "EditBox", 27 |
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(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
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) |
end |
local function closeOnClick(this) |
PlaySound(PlaySoundKitID and "gsTitleOptionExit" or 799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT |
PlaySound(799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT |
this.obj:Hide() |
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 WoW80 = select(4, GetBuildInfo()) >= 80000 |
-- Lua APIs |
local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type |
local math_min, math_max, floor = math.min, math.max, floor |
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 function Button_OnClick(frame, ...) |
AceGUI:ClearFocus() |
PlaySound(PlaySoundKitID and "igMainMenuOption" or 852) -- SOUNDKIT.IG_MAINMENU_OPTION |
PlaySound(852) -- SOUNDKIT.IG_MAINMENU_OPTION |
frame.obj:Fire("OnClick", ...) |
end |
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1161 2017-08-12 14:30:16Z funkydude $ ]]-- |
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1167 2017-08-29 22:08:48Z funkydude $ ]]-- |
local AceGUI = LibStub("AceGUI-3.0") |
if self.disabled then return end |
self.value = not self.value |
if self.value then |
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
else |
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOff" or 857) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF |
PlaySound(857) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF |
end |
UpdateToggle(self) |
self:Fire("OnValueChanged", self.value) |
-- 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) |
--- 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 1163 2017-08-14 14:04:39Z nevcairiel $ |
-- @release $Id: AceConfigDialog-3.0.lua 1169 2018-02-27 16:18:28Z nevcairiel $ |
local LibStub = LibStub |
local gui = LibStub("AceGUI-3.0") |
local reg = LibStub("AceConfigRegistry-3.0") |
local MAJOR, MINOR = "AceConfigDialog-3.0", 64 |
local MAJOR, MINOR = "AceConfigDialog-3.0", 66 |
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigDialog then return end |
else |
validationErrorPopup(validated) |
end |
PlaySound(PlaySoundKitID and "igPlayerInviteDecline" or 882) -- SOUNDKIT.IG_PLAYER_INVITE_DECLINE || XXX _DECLINE is actually missing from the table |
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 |
-- :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 1161 2017-08-12 14:30:16Z funkydude $ |
-- @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", 17 |
local MAJOR, MINOR = "AceConfigRegistry-3.0", 18 |
local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigRegistry then return 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={ |
--[[ $Id: AceGUIWidget-DropDown.lua 1161 2017-08-12 14:30:16Z funkydude $ ]]-- |
--[[ $Id: AceGUIWidget-DropDown.lua 1167 2017-08-29 22:08:48Z funkydude $ ]]-- |
local AceGUI = LibStub("AceGUI-3.0") |
-- Lua APIs |
local function Dropdown_TogglePullout(this) |
local self = this.obj |
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
if self.open then |
self.open = nil |
self.pullout:Close() |
--[[----------------------------------------------------------------------------- |
EditBox Widget |
-------------------------------------------------------------------------------]] |
local Type, Version = "EditBox", 27 |
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(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
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) |
end |
local function closeOnClick(this) |
PlaySound(PlaySoundKitID and "gsTitleOptionExit" or 799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT |
PlaySound(799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT |
this.obj:Hide() |
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 WoW80 = select(4, GetBuildInfo()) >= 80000 |
-- Lua APIs |
local next, pairs, ipairs, assert, type = next, pairs, ipairs, assert, type |
local math_min, math_max, floor = math.min, math.max, floor |
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 function Button_OnClick(frame, ...) |
AceGUI:ClearFocus() |
PlaySound(PlaySoundKitID and "igMainMenuOption" or 852) -- SOUNDKIT.IG_MAINMENU_OPTION |
PlaySound(852) -- SOUNDKIT.IG_MAINMENU_OPTION |
frame.obj:Fire("OnClick", ...) |
end |
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1161 2017-08-12 14:30:16Z funkydude $ ]]-- |
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1167 2017-08-29 22:08:48Z funkydude $ ]]-- |
local AceGUI = LibStub("AceGUI-3.0") |
if self.disabled then return end |
self.value = not self.value |
if self.value then |
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
else |
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOff" or 857) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF |
PlaySound(857) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF |
end |
UpdateToggle(self) |
self:Fire("OnValueChanged", self.value) |
end |
if value then |
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
self.slider:SetValue(value) |
self:Fire("OnMouseUp", value) |
end |
-------------------------------------------------------------------------------]] |
local function Tab_OnClick(frame) |
if not (frame.selected or frame.disabled) then |
PlaySound(PlaySoundKitID and "igCharacterInfoTab" or 841) -- SOUNDKIT.IG_CHARACTER_INFO_TAB |
PlaySound(841) -- SOUNDKIT.IG_CHARACTER_INFO_TAB |
frame.obj:SelectTab(frame.value) |
end |
end |
--[[----------------------------------------------------------------------------- |
Checkbox Widget |
-------------------------------------------------------------------------------]] |
local Type, Version = "CheckBox", 23 |
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(PlaySoundKitID and "igMainMenuOptionCheckBoxOn" or 856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON |
else -- for both nil and false (tristate) |
PlaySound(PlaySoundKitID and "igMainMenuOptionCheckBoxOff" or 857) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF |
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 |
Scripts |
-------------------------------------------------------------------------------]] |
local function Button_OnClick(frame) |
PlaySound(PlaySoundKitID and "gsTitleOptionExit" or 799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT |
PlaySound(799) -- SOUNDKIT.GS_TITLE_OPTION_EXIT |
frame.obj:Hide() |
end |
-- 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) |
-- :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 1161 2017-08-12 14:30:16Z funkydude $ |
-- @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", 17 |
local MAJOR, MINOR = "AceConfigRegistry-3.0", 18 |
local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigRegistry then return 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={ |
--- 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 1163 2017-08-14 14:04:39Z nevcairiel $ |
-- @release $Id: AceConfigDialog-3.0.lua 1169 2018-02-27 16:18:28Z nevcairiel $ |
local LibStub = LibStub |
local gui = LibStub("AceGUI-3.0") |
local reg = LibStub("AceConfigRegistry-3.0") |
local MAJOR, MINOR = "AceConfigDialog-3.0", 64 |
local MAJOR, MINOR = "AceConfigDialog-3.0", 66 |
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR) |
if not AceConfigDialog then return end |
else |
validationErrorPopup(validated) |
end |
PlaySound(PlaySoundKitID and "igPlayerInviteDecline" or 882) -- SOUNDKIT.IG_PLAYER_INVITE_DECLINE || XXX _DECLINE is actually missing from the table |
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 |
## Interface: 70300 |
## Interface: 80000 |
## Title: Stuf_Options |
## Author: TotalPackage |
## Notes: Configuration Menu for Stuf. |
## Interface: 70300 |
## Interface: 80000 |
## Title: Stuf_Range |
## Author: TotalPackage |
## Notes: Displays estimate distance using LibRangeCheck-2.0. |
--[[ |
Name: LibRangeCheck-2.0 |
Revision: $Revision: 170 $ |
Revision: $Revision: 190 $ |
Author(s): mitch0 |
Website: http://www.wowace.com/projects/librangecheck-2-0/ |
Description: A range checking library based on interact distances and spell ranges |
--- LibRangeCheck-2.0 provides an easy way to check for ranges and get suitable range checking functions for specific ranges.\\ |
-- The checkers use spell and item range checks, or interact based checks for special units where those two cannot be used.\\ |
-- The lib handles the refreshing of checker lists in case talents / spells / glyphs change and in some special cases when equipment changes (for example some of the mage pvp gloves change the range of the Fire Blast spell), and also handles the caching of items used for item-based range checks.\\ |
-- The lib handles the refreshing of checker lists in case talents / spells change and in some special cases when equipment changes (for example some of the mage pvp gloves change the range of the Fire Blast spell), and also handles the caching of items used for item-based range checks.\\ |
-- A callback is provided for those interested in checker changes. |
-- @usage |
-- local rc = LibStub("LibRangeCheck-2.0") |
-- @class file |
-- @name LibRangeCheck-2.0 |
local MAJOR_VERSION = "LibRangeCheck-2.0" |
local MINOR_VERSION = tonumber(("$Revision: 170 $"):match("%d+")) + 100000 |
local MINOR_VERSION = tonumber(("$Revision: 190 $"):match("%d+")) + 100000 |
local lib, oldminor = LibStub:NewLibrary(MAJOR_VERSION, MINOR_VERSION) |
if not lib then |
local UpdateDelay = .5 |
local ItemRequestTimeout = 10.0 |
local FriendColor = 'ff22ff22' |
local HarmColor = 'ffff2222' |
-- interact distance based checks. ranges are based on my own measurements (thanks for all the folks who helped me with this) |
local DefaultInteractList = { |
[3] = 8, |
[2] = 9, |
-- [2] = 9, |
[4] = 28, |
} |
local InteractLists = { |
["Tauren"] = { |
[3] = 6, |
[2] = 7, |
-- [2] = 7, |
[4] = 25, |
}, |
["Scourge"] = { |
[3] = 7, |
[2] = 8, |
-- [2] = 8, |
[4] = 27, |
}, |
} |
local HarmSpells = {} |
FriendSpells["DEATHKNIGHT"] = { |
47541, -- ["Death Coil"], -- 40 |
} |
HarmSpells["DEATHKNIGHT"] = { |
47541, -- ["Death Coil"], -- 40 |
49576, -- ["Death Grip"], -- 30 |
} |
-- Items [Special thanks to Maldivia for the nice list] |
local FriendItems = { |
[5] = { |
[1] = { |
90175, -- Gin-Ji Knife Set -- doesn't seem to work for pets (always returns nil) |
}, |
[2] = { |
37727, -- Ruby Acorn |
}, |
[6] = { |
[3] = { |
42732, -- Everfrost Razor |
}, |
[4] = { |
129055, -- Shoe Shine Kit |
}, |
[5] = { |
8149, -- Voodoo Charm |
136605, -- Solendra's Compassion |
63427, -- Worgsaw |
}, |
[7] = { |
61323, -- Ruby Seeds |
}, |
[8] = { |
34368, -- Attuned Crystal Cores |
33278, -- Burning Torch |
[35] = { |
18904, -- Zorbin's Ultra-Shrinker |
}, |
[38] = { |
140786, -- Ley Spider Eggs |
}, |
[40] = { |
34471, -- Vial of the Sunwell |
}, |
[50] = { |
116139, -- Haunting Memento |
}, |
[55] = { |
74637, -- Kiryn's Poison Vial |
}, |
[60] = { |
32825, -- Soul Cannon |
37887, -- Seeds of Nature's Wrath |
[80] = { |
35278, -- Reinforced Net |
}, |
[90] = { |
133925, -- Fel Lash |
}, |
[100] = { |
41058, -- Hyldnir Harpoon |
}, |
[150] = { |
46954, -- Flaming Spears |
}, |
[200] = { |
75208, -- Rancher's Lariat |
}, |
} |
local HarmItems = { |
[5] = { |
[1] = { |
}, |
[2] = { |
37727, -- Ruby Acorn |
}, |
[6] = { |
[3] = { |
42732, -- Everfrost Razor |
}, |
[4] = { |
129055, -- Shoe Shine Kit |
}, |
[5] = { |
8149, -- Voodoo Charm |
136605, -- Solendra's Compassion |
63427, -- Worgsaw |
}, |
[7] = { |
61323, -- Ruby Seeds |
}, |
[8] = { |
34368, -- Attuned Crystal Cores |
33278, -- Burning Torch |
24269, -- Heavy Netherweave Net |
18904, -- Zorbin's Ultra-Shrinker |
}, |
[38] = { |
140786, -- Ley Spider Eggs |
}, |
[40] = { |
28767, -- The Decapitator |
}, |
[50] = { |
116139, -- Haunting Memento |
}, |
[55] = { |
74637, -- Kiryn's Poison Vial |
}, |
[60] = { |
32825, -- Soul Cannon |
37887, -- Seeds of Nature's Wrath |
[80] = { |
35278, -- Reinforced Net |
}, |
[90] = { |
133925, -- Fel Lash |
}, |
[100] = { |
33119, -- Malister's Frost Wand |
}, |
[150] = { |
46954, -- Flaming Spears |
}, |
[200] = { |
75208, -- Rancher's Lariat |
}, |
} |
-- This could've been done by checking player race as well and creating tables for those, but it's easier like this |
local GetTime = GetTime |
local HandSlotId = GetInventorySlotInfo("HandsSlot") |
local math_floor = math.floor |
local UnitIsVisible = UnitIsVisible |
-- temporary stuff |
end |
-- minRange should be nil if there's no minRange, not 0 |
local function addChecker(t, range, minRange, checker) |
local rc = { ["range"] = range, ["minRange"] = minRange, ["checker"] = checker } |
local function addChecker(t, range, minRange, checker, info) |
local rc = { ["range"] = range, ["minRange"] = minRange, ["checker"] = checker, ["info"] = info } |
for i = 1, #t do |
local v = t[i] |
if rc.range == v.range then return end |
local function createCheckerList(spellList, itemList, interactList) |
local res = {} |
if itemList then |
for range, items in pairs(itemList) do |
for i = 1, #items do |
local item = items[i] |
if GetItemInfo(item) then |
addChecker(res, range, nil, checkers_Item[item], "item:" .. item) |
break |
end |
end |
end |
end |
if spellList then |
for i = 1, #spellList do |
local sid = spellList[i] |
range = MeleeRange |
end |
if minRange then |
addChecker(res, range, minRange, checkers_SpellWithMin[spellIdx]) |
addChecker(res, range, minRange, checkers_SpellWithMin[spellIdx], "spell:" .. sid .. ":" .. tostring(name)) |
else |
addChecker(res, range, minRange, checkers_Spell[spellIdx]) |
addChecker(res, range, minRange, checkers_Spell[spellIdx], "spell:" .. sid .. ":" .. tostring(name)) |
end |
end |
end |
end |
if itemList then |
for range, items in pairs(itemList) do |
for i = 1, #items do |
local item = items[i] |
if GetItemInfo(item) then |
addChecker(res, range, nil, checkers_Item[item]) |
break |
end |
end |
end |
end |
if interactList and not next(res) then |
for index, range in pairs(interactList) do |
addChecker(res, range, nil, checkers_Interact[index]) |
addChecker(res, range, nil, checkers_Interact[index], "interact:" .. index) |
end |
end |
-- returns minRange, maxRange or nil |
local function getRange(unit, checkerList) |
local min, max = 0, nil |
for i = 1, #checkerList do |
local rc = checkerList[i] |
if not max or max > rc.range then |
if rc.minRange then |
local inRange, inMinRange = rc.checker(unit) |
if inMinRange then |
max = rc.minRange |
elseif inRange then |
min, max = rc.minRange, rc.range |
elseif min > rc.range then |
return min, max |
else |
return rc.range, max |
end |
elseif rc.checker(unit) then |
max = rc.range |
elseif min > rc.range then |
return min, max |
else |
return rc.range, max |
end |
local lo, hi = 1, #checkerList |
while lo <= hi do |
local mid = math_floor((lo + hi) / 2) |
local rc = checkerList[mid] |
if rc.checker(unit) then |
lo = mid + 1 |
else |
hi = mid - 1 |
end |
end |
return min, max |
if lo > #checkerList then |
return 0, checkerList[#checkerList].range |
elseif lo <= 1 then |
return checkerList[1].range, nil |
else |
return checkerList[lo].range, checkerList[lo - 1].range |
end |
end |
local function updateCheckers(origList, newList) |
-- << Public API |
--- The callback name that is fired when checkers are changed. |
-- @field |
-- returns the range estimate as a string |
-- deprecated, use :getRange(unit) instead and build your own strings |
-- (checkVisible is not used any more, kept for compatibility only) |
-- @param checkVisible if set to true, then a UnitIsVisible check is made, and **nil** is returned if the unit is not visible |
function lib:getRangeAsString(unit, checkVisible, showOutOfRange) |
local minRange, maxRange = self:getRange(unit) |
local minRange, maxRange = self:getRange(unit, checkVisible) |
if not minRange then return nil end |
if not maxRange then |
return showOutOfRange and minRange .. " +" or nil |
-- fall back to interact distance checks |
if playerClass == "HUNTER" or playerRace == "Tauren" then |
-- for hunters, use interact4 as it's safer |
-- for Taurens interact4 is actually closer than 25yd and interact2 is closer than 8yd, so we can't use that |
-- for Taurens interact4 is actually closer than 25yd and interact3 is closer than 8yd, so we can't use that |
minRangeCheck = checkers_Interact[4] |
else |
minRangeCheck = checkers_Interact[2] |
minRangeCheck = checkers_Interact[3] |
end |
end |
--- Get a range estimate as **minRange**, **maxRange**. |
-- @param unit the target unit to check range to. |
-- @param checkVisible if set to true, then a UnitIsVisible check is made, and **nil** is returned if the unit is not visible |
-- @return **minRange**, **maxRange** pair if a range estimate could be determined, **nil** otherwise. **maxRange** is **nil** if **unit** is further away than the highest possible range we can check. |
-- Includes checks for unit validity and friendly/enemy status. |
-- @usage |
-- local rc = LibStub("LibRangeCheck-2.0") |
-- local minRange, maxRange = rc:GetRange('target') |
function lib:GetRange(unit) |
-- local minRangeIfVisible, maxRangeIfVisible = rc:GetRange('target', true) |
function lib:GetRange(unit, checkVisible) |
if not UnitExists(unit) then |
return nil |
end |
if checkVisible and not UnitIsVisible(unit) then |
return nil |
end |
if UnitIsDeadOrGhost(unit) then |
return getRange(unit, self.miscRC) |
end |
self:scheduleInit() |
end |
function lib:GLYPH_ADDED() |
self:scheduleInit() |
end |
function lib:GLYPH_REMOVED() |
self:scheduleInit() |
end |
function lib:GLYPH_UPDATED() |
self:scheduleInit() |
end |
function lib:SPELLS_CHANGED() |
self:scheduleInit() |
end |
self.frame:Show() |
end |
-- << load-time initialization |
frame:RegisterEvent("LEARNED_SPELL_IN_TAB") |
frame:RegisterEvent("CHARACTER_POINTS_CHANGED") |
frame:RegisterEvent("PLAYER_TALENT_UPDATE") |
frame:RegisterEvent("GLYPH_ADDED") |
frame:RegisterEvent("GLYPH_REMOVED") |
frame:RegisterEvent("GLYPH_UPDATED") |
frame:RegisterEvent("SPELLS_CHANGED") |
local _, playerClass = UnitClass("player") |
if playerClass == "MAGE" or playerClass == "SHAMAN" then |
f:SetInsertMode("BOTTOM") |
uf.refreshfuncs[name] = ClearCombatText |
Stuf:AddEvent("UNIT_COMBAT", UpdateCombatText) |
Stuf:AddEvent("UNIT_SPELLMISS", UpdateCombatText) |
--Stuf:AddEvent("UNIT_SPELLMISS", UpdateCombatText) |
else |
f:Show() |
end |
## Interface: 70300 |
## Interface: 80000 |
## Title: Stuf Unit Frames |
## Author: TotalPackage |
## Notes: Main unitframes replacement. Assembly optional. |
## Version: 7.3.001 |
## Version: 8.0.001 |
## SavedVariables: StufDB |
## SavedVariablesPerCharacter: StufCharDB |
if iswarlock then |
if UnitCreatureFamily("pet") == "Felhunter" then |
for i = 1, 40, 1 do |
name, _, icon, count, atype = UnitDebuff(unit, i) |
name, icon, count, atype = UnitDebuff(unit, i) |
if not name or atype == "Magic" then |
break |
else |
end |
end |
else |
name, _, icon, count, atype = UnitDebuff(unit, 1, "RAID") |
name, icon, count, atype = UnitDebuff(unit, 1, "RAID") |
end |
if name then |
local dc = dbgaura[atype or "none"] or dbgaura.none |
<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> |
## Interface: 70100 |
## Interface: 80000 |
## LoadOnDemand: 1 |
## X-Curse-Packaged-Version: 7.1.0 |
## X-Curse-Project-Name: LibSharedMedia-3.0 |
## X-Curse-Project-ID: libsharedmedia-3-0 |
## X-Curse-Repository-ID: wow/libsharedmedia-3-0/mainline |
## Title: Lib: SharedMedia-3.0 |
## Notes: Shared handling of media data (fonts, sounds, textures, ...) between addons. |
## Author: Elkano |
## Version: 3.0-97 |
## Version: 3.0-102 |
## X-Website: http://www.wowace.com/projects/libsharedmedia-3-0/ |
## X-Category: Library |
## X-Revision: 97 |
## X-Date: 2016-10-25T23:54:36Z |
## X-Revision: 102 |
## X-Date: 2018-07-17T19:25:42Z |
LibStub\LibStub.lua |
CallbackHandler-1.0\CallbackHandler-1.0.lua |
## Interface: 70300 |
## Interface: 80000 |
## Title: Stuf Raid Frames |
## Author: TotalPackage |
## Notes: Raid unit frames. Assembly optional. (Does not require Stuf) |
## Version: 7.3.001 |
## Version: 8.0.001 |
## SavedVariables: StufRaidDB |
## SavedVariablesPerCharacter: StufRaidCharLayoutDB, StufRaidCharDB |
queueaura("Interface\\GossipFrame\\BinderGossipIcon.blp", 0, 0, nil, nil, "Vehicle") |
end |
for i = 1, 32, 1 do -- check for alerts from buffs |
local bname, _, bicon, bcount, _, bduration, bendtime = UnitBuff(u, i) |
local bname, bicon, bcount, _, bduration, bendtime = UnitBuff(u, i) |
if not bname then break end |
if balert[bname] then |
queueaura(bicon, bcount, 0, bduration, bendtime, bname) |
end |
end |
for i = 1, 40, 1 do -- check for alerts from debuffs |
local dname, _, dicon, dcount, dtype, dduration, dendtime = UnitDebuff(u, i) |
local dname, dicon, dcount, dtype, dduration, dendtime = UnitDebuff(u, i) |
if not dname then break end |
if dalert[dname] then |
queueaura(dicon, dcount, dtype, dduration, dendtime, dname) |
a.debuff_funcs = { |
raid = function(u, count) -- what blizzard labels as curable debuffs |
for i = 1, count, 1 do |
local dname, _, dicon, dcount, dtype, dduration, dendtime = UnitDebuff(u, i, "RAID") |
local dname, dicon, dcount, dtype, dduration, dendtime = UnitDebuff(u, i, "RAID") |
if not dname then break end |
if not dexclude[dname] then |
queueaura(dicon, dcount, dtype, dduration, dendtime, dname) |
end |
if not dinclude then return end |
for i = 1, 40, 1 do -- in addition to curable, include these also |
local dname, _, dicon, dcount, dtype, dduration, dendtime = UnitDebuff(u, i) |
local dname, dicon, dcount, dtype, dduration, dendtime = UnitDebuff(u, i) |
if not dname then break end |
if dinclude[dname] then |
queueaura(dicon, dcount, dtype, dduration, dendtime, dname) |
end, |
all = function(u, count) -- all debuffs are shown, no filter of any kind is applied |
for i = 1, count, 1 do |
local dname, _, dicon, dcount, dtype, dduration, dendtime = UnitDebuff(u, i) |
local dname, dicon, dcount, dtype, dduration, dendtime = UnitDebuff(u, i) |
if not dname then break end |
if not dexclude[dname] then |
queueaura(dicon, dcount, dtype, dduration, dendtime, dname) |
justinclude = function(u, count) -- only include debuffs that are found in the filter |
if not dinclude then return end |
for i = 1, 40, 1 do |
local dname, _, dicon, dcount, dtype, dduration, dendtime = UnitDebuff(u, i) |
local dname, dicon, dcount, dtype, dduration, dendtime = UnitDebuff(u, i) |
if not dname then break end |
if dinclude[dname] then |
queueaura(dicon, dcount, dtype, dduration, dendtime, dname) |
a.buff_funcs = { |
raid = function(u, count) -- blizzard's castable buffs, both include and exclude filter is applied |
for i = 1, count, 1 do |
local bname, _, bicon, bcount, _, bduration, bendtime = UnitBuff(u, i, "RAID") |
local bname, bicon, bcount, _, bduration, bendtime = UnitBuff(u, i, "RAID") |
if not bname then break end |
if not bexclude[bname] then |
queueaura(bicon, bcount, 0, bduration, bendtime, bname) |
end |
if not binclude then return end |
for i = 1, 32, 1 do -- in addition to castable, include these also |
local bname, _, bicon, bcount, _, bduration, bendtime = UnitBuff(u, i) |
local bname, bicon, bcount, _, bduration, bendtime = UnitBuff(u, i) |
if not bname then break end |
if binclude[bname] then |
queueaura(bicon, bcount, 0, bduration, bendtime, bname) |
end, |
all = function(u, count) -- show all buffs, no filter of any kind is applied |
for i = 1, count, 1 do |
local bname, _, bicon, bcount, _, bduration, bendtime = UnitBuff(u, i) |
local bname, bicon, bcount, _, bduration, bendtime = UnitBuff(u, i) |
if not bname then break end |
if not bexclude[bname] then |
queueaura(bicon, bcount, 0, bduration, bendtime, bname) |
mine = function(u, count) -- only show player buffs, exclude filter is applied |
if not bexclude then return end |
for i = 1, 32, 1 do |
local bname, _, bicon, bcount, _, bduration, bendtime, bismine = UnitBuff(u, i) |
local bname, bicon, bcount, _, bduration, bendtime, bismine = UnitBuff(u, i) |
if not bname or not (bismine == "player" or bismine == "vehicle") then break end |
if not bexclude[bname] then |
queueaura(bicon, bcount, 0, bduration, bendtime, bname) |
mineinclude = function(u, count) -- only show player buffs that are in the include filter |
if not binclude then return end |
for i = 1, 32, 1 do |
local bname, _, bicon, bcount, _, bduration, bendtime, bismine = UnitBuff(u, i) |
local bname, bicon, bcount, _, bduration, bendtime, bismine = UnitBuff(u, i) |
if not bname or not (bismine == "player" or bismine == "vehicle") then break end |
if binclude[bname] then |
queueaura(bicon, bcount, 0, bduration, bendtime, bname) |
justinclude = function(u, count) |
if not binclude then return end |
for i = 1, 32, 1 do |
local bname, _, bicon, bcount, _, bduration, bendtime = UnitBuff(u, i) |
local bname, bicon, bcount, _, bduration, bendtime = UnitBuff(u, i) |
if not bname then break end |
if binclude[bname] then |
queueaura(bicon, bcount, 0, bduration, bendtime, bname) |
<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> |
## Interface: 70100 |
## Interface: 80000 |
## LoadOnDemand: 1 |
## X-Curse-Packaged-Version: 7.1.0 |
## X-Curse-Project-Name: LibSharedMedia-3.0 |
## X-Curse-Project-ID: libsharedmedia-3-0 |
## X-Curse-Repository-ID: wow/libsharedmedia-3-0/mainline |
## Title: Lib: SharedMedia-3.0 |
## Notes: Shared handling of media data (fonts, sounds, textures, ...) between addons. |
## Author: Elkano |
## Version: 3.0-97 |
## Version: 3.0-102 |
## X-Website: http://www.wowace.com/projects/libsharedmedia-3-0/ |
## X-Category: Library |
## X-Revision: 97 |
## X-Date: 2016-10-25T23:54:36Z |
## X-Revision: 102 |
## X-Date: 2018-07-17T19:25:42Z |
LibStub\LibStub.lua |
CallbackHandler-1.0\CallbackHandler-1.0.lua |