Compare commits
37 Commits
Author | SHA1 | Date |
---|---|---|
Robin Hüskes | ffb7a86172 | |
Robin Hüskes | f199a8ed04 | |
Robin Hüskes | 1638f6b18b | |
Robin Hüskes | 5da6c1ef71 | |
Robin Hüskes | 8a5d8017a8 | |
Robin Hüskes | 47a19ae79a | |
Robin Hüskes | 7a3d0e082c | |
Robin Hüskes | 2df3712fa0 | |
Robin Hüskes | 4f4365909d | |
Robin Hüskes | c0e617228c | |
Robin Hüskes | cb73105a3b | |
Robin Hüskes | 892fae4623 | |
Robin Hüskes | a506efb447 | |
Robin Hüskes | 6770bd4d9f | |
Robin Hüskes | 81ef8987ec | |
Robin Hüskes | fc6ba406b4 | |
Robin Hüskes | 28c06f5814 | |
robin | 0038a49d2a | |
robin | 54139c82df | |
robin | 34bcf9aa9c | |
robin | b17bd377ac | |
robin | 7b0aa16288 | |
robin | 47d5f33fca | |
robin | 1f1b530678 | |
robin | 53b4c4a849 | |
robin | ddb671f77a | |
robin | 982feb03af | |
robin | 74b574cc72 | |
robin | 5b0edffad8 | |
robin | fff78468e6 | |
rilgamon | 47217fe37a | |
rilgamon | 960620cd17 | |
rilgamon | 72bb00215b | |
rilgamon | c919193c0b | |
rilgamon | 856401f00c | |
rilgamon | 11818afa8f | |
rilgamon | 29f50033c1 |
|
@ -5,4 +5,4 @@
|
|||
<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>
|
||||
</Ui>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
--- 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 1202 2019-05-15 23:11:22Z nevcairiel $
|
||||
-- @release $Id: AceConfigCmd-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
|
||||
|
||||
--[[
|
||||
AceConfigCmd-3.0
|
||||
|
@ -37,17 +37,10 @@ local error, assert = error, assert
|
|||
-- WoW APIs
|
||||
local _G = _G
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: LibStub, SELECTED_CHAT_FRAME, DEFAULT_CHAT_FRAME
|
||||
|
||||
|
||||
local L = setmetatable({}, { -- TODO: replace with proper locale
|
||||
__index = function(self,k) return k end
|
||||
})
|
||||
|
||||
|
||||
|
||||
local function print(msg)
|
||||
(SELECTED_CHAT_FRAME or DEFAULT_CHAT_FRAME):AddMessage(msg)
|
||||
end
|
||||
|
@ -401,7 +394,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||
return
|
||||
end
|
||||
|
||||
local str = strsub(info.input,inputpos);
|
||||
local strInput = strsub(info.input,inputpos);
|
||||
|
||||
if tab.type=="execute" then
|
||||
------------ execute --------------------------------------------
|
||||
|
@ -414,21 +407,21 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||
|
||||
local res = true
|
||||
if tab.pattern then
|
||||
if not(type(tab.pattern)=="string") then err(info, inputpos, "'pattern' - expected a string") end
|
||||
if not strmatch(str, tab.pattern) then
|
||||
usererr(info, inputpos, "'"..str.."' - " .. L["invalid input"])
|
||||
if type(tab.pattern)~="string" then err(info, inputpos, "'pattern' - expected a string") end
|
||||
if not strmatch(strInput, tab.pattern) then
|
||||
usererr(info, inputpos, "'"..strInput.."' - " .. L["invalid input"])
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
do_final(info, inputpos, tab, "set", str)
|
||||
do_final(info, inputpos, tab, "set", strInput)
|
||||
|
||||
|
||||
|
||||
elseif tab.type=="toggle" then
|
||||
------------ toggle --------------------------------------------
|
||||
local b
|
||||
local str = strtrim(strlower(str))
|
||||
local str = strtrim(strlower(strInput))
|
||||
if str=="" then
|
||||
b = callmethod(info, inputpos, tab, "get")
|
||||
|
||||
|
@ -465,9 +458,9 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||
|
||||
elseif tab.type=="range" then
|
||||
------------ range --------------------------------------------
|
||||
local val = tonumber(str)
|
||||
local val = tonumber(strInput)
|
||||
if not val then
|
||||
usererr(info, inputpos, "'"..str.."' - "..L["expected number"])
|
||||
usererr(info, inputpos, "'"..strInput.."' - "..L["expected number"])
|
||||
return
|
||||
end
|
||||
if type(info.step)=="number" then
|
||||
|
@ -487,7 +480,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||
|
||||
elseif tab.type=="select" then
|
||||
------------ select ------------------------------------
|
||||
local str = strtrim(strlower(str))
|
||||
local str = strtrim(strlower(strInput))
|
||||
|
||||
local values = tab.values
|
||||
if type(values) == "function" or type(values) == "string" then
|
||||
|
@ -528,7 +521,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||
|
||||
elseif tab.type=="multiselect" then
|
||||
------------ multiselect -------------------------------------------
|
||||
local str = strtrim(strlower(str))
|
||||
local str = strtrim(strlower(strInput))
|
||||
|
||||
local values = tab.values
|
||||
if type(values) == "function" or type(values) == "string" then
|
||||
|
@ -565,7 +558,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||
|
||||
--check that the opt is valid
|
||||
local ok
|
||||
for k,v in pairs(values) do
|
||||
for k in pairs(values) do
|
||||
if strlower(k)==opt then
|
||||
opt = k -- overwrite with key (in case of case mismatches)
|
||||
ok = true
|
||||
|
@ -634,7 +627,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||
|
||||
elseif tab.type=="color" then
|
||||
------------ color --------------------------------------------
|
||||
local str = strtrim(strlower(str))
|
||||
local str = strtrim(strlower(strInput))
|
||||
if str == "" then
|
||||
--TODO: Show current value
|
||||
return
|
||||
|
@ -706,7 +699,7 @@ local function handle(info, inputpos, tab, depth, retfalse)
|
|||
|
||||
elseif tab.type=="keybinding" then
|
||||
------------ keybinding --------------------------------------------
|
||||
local str = strtrim(strlower(str))
|
||||
local str = strtrim(strlower(strInput))
|
||||
if str == "" then
|
||||
--TODO: Show current value
|
||||
return
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<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>
|
||||
</Ui>
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
--- 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 1247 2021-01-23 23:16:39Z funkehdude $
|
||||
-- @release $Id: AceConfigDialog-3.0.lua 1296 2022-11-04 18:50:10Z nevcairiel $
|
||||
|
||||
local LibStub = LibStub
|
||||
local gui = LibStub("AceGUI-3.0")
|
||||
local reg = LibStub("AceConfigRegistry-3.0")
|
||||
|
||||
local MAJOR, MINOR = "AceConfigDialog-3.0", 80
|
||||
local MAJOR, MINOR = "AceConfigDialog-3.0", 86
|
||||
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
|
||||
if not AceConfigDialog then return end
|
||||
|
@ -29,12 +29,6 @@ local pairs, next, select, type, unpack, ipairs = pairs, next, select, type, unp
|
|||
local tostring, tonumber = tostring, tonumber
|
||||
local math_min, math_max, math_floor = math.min, math.max, math.floor
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: NORMAL_FONT_COLOR, ACCEPT, CANCEL
|
||||
-- GLOBALS: PlaySound, GameFontHighlight, GameFontHighlightSmall, GameFontHighlightLarge
|
||||
-- GLOBALS: CloseSpecialWindows, InterfaceOptions_AddCategory, geterrorhandler
|
||||
|
||||
local emptyTbl = {}
|
||||
|
||||
--[[
|
||||
|
@ -153,6 +147,7 @@ local stringIsLiteral = {
|
|||
width = true,
|
||||
image = true,
|
||||
fontSize = true,
|
||||
tooltipHyperlink = true
|
||||
}
|
||||
|
||||
--Is Never a function or method
|
||||
|
@ -194,9 +189,8 @@ local function GetOptionsMemberValue(membername, option, options, path, appName,
|
|||
--We have a function to call
|
||||
local info = new()
|
||||
--traverse the options table, picking up the handler and filling the info with the path
|
||||
local handler
|
||||
local group = options
|
||||
handler = group.handler or handler
|
||||
local handler = group.handler
|
||||
|
||||
for i = 1, #path do
|
||||
group = GetSubOption(group, path[i])
|
||||
|
@ -508,6 +502,14 @@ local function OptionOnMouseOver(widget, event)
|
|||
local tooltip = AceConfigDialog.tooltip
|
||||
|
||||
tooltip:SetOwner(widget.frame, "ANCHOR_TOPRIGHT")
|
||||
|
||||
local tooltipHyperlink = GetOptionsMemberValue("tooltipHyperlink", opt, options, path, appName)
|
||||
if tooltipHyperlink then
|
||||
tooltip:SetHyperlink(tooltipHyperlink)
|
||||
tooltip:Show()
|
||||
return
|
||||
end
|
||||
|
||||
local name = GetOptionsMemberValue("name", opt, options, path, appName)
|
||||
local desc = GetOptionsMemberValue("desc", opt, options, path, appName)
|
||||
local usage = GetOptionsMemberValue("usage", opt, options, path, appName)
|
||||
|
@ -535,8 +537,7 @@ local function OptionOnMouseLeave(widget, event)
|
|||
end
|
||||
|
||||
local function GetFuncName(option)
|
||||
local type = option.type
|
||||
if type == "execute" then
|
||||
if option.type == "execute" then
|
||||
return "func"
|
||||
else
|
||||
return "set"
|
||||
|
@ -544,12 +545,13 @@ local function GetFuncName(option)
|
|||
end
|
||||
do
|
||||
local frame = AceConfigDialog.popup
|
||||
if not frame then
|
||||
if not frame or oldminor < 81 then
|
||||
frame = CreateFrame("Frame", nil, UIParent)
|
||||
AceConfigDialog.popup = frame
|
||||
frame:Hide()
|
||||
frame:SetPoint("CENTER", UIParent, "CENTER")
|
||||
frame:SetSize(320, 72)
|
||||
frame:EnableMouse(true) -- Do not allow click-through on the frame
|
||||
frame:SetFrameStrata("TOOLTIP")
|
||||
frame:SetFrameLevel(100) -- Lots of room to draw under it
|
||||
frame:SetScript("OnKeyDown", function(self, key)
|
||||
|
@ -565,28 +567,17 @@ do
|
|||
end
|
||||
end)
|
||||
|
||||
if not frame.SetFixedFrameStrata then -- API capability check (classic check)
|
||||
frame:SetBackdrop({
|
||||
bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]],
|
||||
edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]],
|
||||
tile = true,
|
||||
tileSize = 32,
|
||||
edgeSize = 32,
|
||||
insets = { left = 11, right = 11, top = 11, bottom = 11 },
|
||||
})
|
||||
else
|
||||
local border = CreateFrame("Frame", nil, frame, "DialogBorderDarkTemplate")
|
||||
border:SetAllPoints(frame)
|
||||
frame:SetFixedFrameStrata(true)
|
||||
frame:SetFixedFrameLevel(true)
|
||||
end
|
||||
local border = CreateFrame("Frame", nil, frame, "DialogBorderOpaqueTemplate")
|
||||
border:SetAllPoints(frame)
|
||||
frame:SetFixedFrameStrata(true)
|
||||
frame:SetFixedFrameLevel(true)
|
||||
|
||||
local text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlight")
|
||||
text:SetSize(290, 0)
|
||||
text:SetPoint("TOP", 0, -16)
|
||||
frame.text = text
|
||||
|
||||
local function newButton(text)
|
||||
local function newButton(newText)
|
||||
local button = CreateFrame("Button", nil, frame)
|
||||
button:SetSize(128, 21)
|
||||
button:SetNormalFontObject(GameFontNormal)
|
||||
|
@ -597,7 +588,7 @@ do
|
|||
button:GetPushedTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875)
|
||||
button:SetHighlightTexture(130762) -- "Interface\\Buttons\\UI-DialogBox-Button-Highlight"
|
||||
button:GetHighlightTexture():SetTexCoord(0.0, 1.0, 0.0, 0.71875)
|
||||
button:SetText(text)
|
||||
button:SetText(newText)
|
||||
return button
|
||||
end
|
||||
|
||||
|
@ -684,7 +675,7 @@ local function ActivateControl(widget, event, ...)
|
|||
if group[funcname] ~= nil then
|
||||
func = group[funcname]
|
||||
end
|
||||
handler = group.handler or handler
|
||||
handler = group.handler
|
||||
confirm = group.confirm
|
||||
validate = group.validate
|
||||
for i = 1, #path do
|
||||
|
@ -748,7 +739,6 @@ local function ActivateControl(widget, event, ...)
|
|||
end
|
||||
end
|
||||
|
||||
local rootframe = user.rootframe
|
||||
if not validated or type(validated) == "string" then
|
||||
if not validated then
|
||||
if usage then
|
||||
|
@ -763,8 +753,8 @@ local function ActivateControl(widget, event, ...)
|
|||
end
|
||||
|
||||
-- show validate message
|
||||
if rootframe.SetStatusText then
|
||||
rootframe:SetStatusText(validated)
|
||||
if user.rootframe.SetStatusText then
|
||||
user.rootframe:SetStatusText(validated)
|
||||
else
|
||||
validationErrorPopup(validated)
|
||||
end
|
||||
|
@ -801,14 +791,14 @@ local function ActivateControl(widget, event, ...)
|
|||
if type(confirm) == "boolean" then
|
||||
if confirm then
|
||||
if not confirmText then
|
||||
local name, desc = option.name, option.desc
|
||||
if type(name) == "function" then
|
||||
name = name(info)
|
||||
local option_name, desc = option.name, option.desc
|
||||
if type(option_name) == "function" then
|
||||
option_name = option_name(info)
|
||||
end
|
||||
if type(desc) == "function" then
|
||||
desc = desc(info)
|
||||
end
|
||||
confirmText = name
|
||||
confirmText = option_name
|
||||
if desc then
|
||||
confirmText = confirmText.." - "..desc
|
||||
end
|
||||
|
@ -1150,8 +1140,6 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
|||
--Control to feed
|
||||
local control
|
||||
|
||||
local name = GetOptionsMemberValue("name", v, options, path, appName)
|
||||
|
||||
if v.type == "execute" then
|
||||
|
||||
local imageCoords = GetOptionsMemberValue("imageCoords",v, options, path, appName)
|
||||
|
@ -1254,7 +1242,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
|||
end
|
||||
tsort(sorting, sortTblAsStrings)
|
||||
end
|
||||
for k, value in ipairs(sorting) do
|
||||
for _, value in ipairs(sorting) do
|
||||
local text = values[value]
|
||||
local radio = gui:Create("CheckBox")
|
||||
radio:SetLabel(text)
|
||||
|
@ -1336,8 +1324,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
|||
control:SetWidth(width_multiplier)
|
||||
end
|
||||
--check:SetTriState(v.tristate)
|
||||
for i = 1, #valuesort do
|
||||
local key = valuesort[i]
|
||||
for s = 1, #valuesort do
|
||||
local key = valuesort[s]
|
||||
local value = GetOptionsMemberValue("get",v, options, path, appName, key)
|
||||
control:SetItemValue(key,value)
|
||||
end
|
||||
|
@ -1349,8 +1337,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
|||
|
||||
control:PauseLayout()
|
||||
local width = GetOptionsMemberValue("width",v,options,path,appName)
|
||||
for i = 1, #valuesort do
|
||||
local value = valuesort[i]
|
||||
for s = 1, #valuesort do
|
||||
local value = valuesort[s]
|
||||
local text = values[value]
|
||||
local check = gui:Create("CheckBox")
|
||||
check:SetLabel(text)
|
||||
|
@ -1367,7 +1355,7 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
|||
elseif width == "half" then
|
||||
check:SetWidth(width_multiplier / 2)
|
||||
elseif (type(width) == "number") then
|
||||
control:SetWidth(width_multiplier * width)
|
||||
check:SetWidth(width_multiplier * width)
|
||||
elseif width == "full" then
|
||||
check.width = "fill"
|
||||
else
|
||||
|
@ -1437,8 +1425,8 @@ local function FeedOptions(appName, options,container,rootframe,path,group,inlin
|
|||
end
|
||||
control:SetImageSize(width, height)
|
||||
end
|
||||
local width = GetOptionsMemberValue("width",v,options,path,appName)
|
||||
control.width = not width and "fill"
|
||||
local controlWidth = GetOptionsMemberValue("width",v,options,path,appName)
|
||||
control.width = not controlWidth and "fill"
|
||||
end
|
||||
|
||||
--Common Init
|
||||
|
@ -1693,29 +1681,29 @@ function AceConfigDialog:FeedGroup(appName,options,container,rootframe,path, isR
|
|||
|
||||
elseif grouptype == "select" then
|
||||
|
||||
local select = gui:Create("DropdownGroup")
|
||||
select:SetTitle(name)
|
||||
InjectInfo(select, options, group, path, rootframe, appName)
|
||||
select:SetCallback("OnGroupSelected", GroupSelected)
|
||||
local selectGroup = gui:Create("DropdownGroup")
|
||||
selectGroup:SetTitle(name)
|
||||
InjectInfo(selectGroup, options, group, path, rootframe, appName)
|
||||
selectGroup:SetCallback("OnGroupSelected", GroupSelected)
|
||||
local status = AceConfigDialog:GetStatusTable(appName, path)
|
||||
if not status.groups then
|
||||
status.groups = {}
|
||||
end
|
||||
select:SetStatusTable(status.groups)
|
||||
selectGroup:SetStatusTable(status.groups)
|
||||
local grouplist, orderlist = BuildSelect(group, options, path, appName)
|
||||
select:SetGroupList(grouplist, orderlist)
|
||||
select:SetUserData("grouplist", grouplist)
|
||||
select:SetUserData("orderlist", orderlist)
|
||||
selectGroup:SetGroupList(grouplist, orderlist)
|
||||
selectGroup:SetUserData("grouplist", grouplist)
|
||||
selectGroup:SetUserData("orderlist", orderlist)
|
||||
|
||||
local firstgroup = orderlist[1]
|
||||
if firstgroup then
|
||||
select:SetGroup((GroupExists(appName, options, path,status.groups.selected) and status.groups.selected) or firstgroup)
|
||||
selectGroup:SetGroup((GroupExists(appName, options, path,status.groups.selected) and status.groups.selected) or firstgroup)
|
||||
end
|
||||
|
||||
select.width = "fill"
|
||||
select.height = "fill"
|
||||
selectGroup.width = "fill"
|
||||
selectGroup.height = "fill"
|
||||
|
||||
container:AddChild(select)
|
||||
container:AddChild(selectGroup)
|
||||
|
||||
--assume tree group by default
|
||||
--if parenttype is tree then this group is already a node on that tree
|
||||
|
@ -1943,13 +1931,13 @@ end
|
|||
-- convert pre-39 BlizOptions structure to the new format
|
||||
if oldminor and oldminor < 39 and AceConfigDialog.BlizOptions then
|
||||
local old = AceConfigDialog.BlizOptions
|
||||
local new = {}
|
||||
local newOpt = {}
|
||||
for key, widget in pairs(old) do
|
||||
local appName = widget:GetUserData("appName")
|
||||
if not new[appName] then new[appName] = {} end
|
||||
new[appName][key] = widget
|
||||
if not newOpt[appName] then newOpt[appName] = {} end
|
||||
newOpt[appName][key] = widget
|
||||
end
|
||||
AceConfigDialog.BlizOptions = new
|
||||
AceConfigDialog.BlizOptions = newOpt
|
||||
else
|
||||
AceConfigDialog.BlizOptions = AceConfigDialog.BlizOptions or {}
|
||||
end
|
||||
|
@ -1982,6 +1970,7 @@ end
|
|||
-- @param parent The parent to use in the interface options tree.
|
||||
-- @param ... The path in the options table to feed into the interface options panel.
|
||||
-- @return The reference to the frame registered into the Interface Options.
|
||||
-- @return The category ID to pass to Settings.OpenToCategory (or InterfaceOptionsFrame_OpenToCategory)
|
||||
function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
|
||||
local BlizOptions = AceConfigDialog.BlizOptions
|
||||
|
||||
|
@ -1997,7 +1986,6 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
|
|||
if not BlizOptions[appName][key] then
|
||||
local group = gui:Create("BlizOptionsGroup")
|
||||
BlizOptions[appName][key] = group
|
||||
group:SetName(name or appName, parent)
|
||||
|
||||
group:SetTitle(name or appName)
|
||||
group:SetUserData("appName", appName)
|
||||
|
@ -2010,8 +1998,30 @@ function AceConfigDialog:AddToBlizOptions(appName, name, parent, ...)
|
|||
end
|
||||
group:SetCallback("OnShow", FeedToBlizPanel)
|
||||
group:SetCallback("OnHide", ClearBlizPanel)
|
||||
InterfaceOptions_AddCategory(group.frame)
|
||||
return group.frame
|
||||
if Settings and Settings.RegisterCanvasLayoutCategory then
|
||||
local categoryName = name or appName
|
||||
if parent then
|
||||
local category = Settings.GetCategory(parent)
|
||||
if not category then
|
||||
error(("The parent category '%s' was not found"):format(parent), 2)
|
||||
end
|
||||
local subcategory = Settings.RegisterCanvasLayoutSubcategory(category, group.frame, categoryName)
|
||||
|
||||
-- force the generated ID to be used for subcategories, as these can have very simple names like "Profiles"
|
||||
group:SetName(subcategory.ID, parent)
|
||||
else
|
||||
local category = Settings.RegisterCanvasLayoutCategory(group.frame, categoryName)
|
||||
-- using appName here would be cleaner, but would not be 100% compatible
|
||||
-- but for top-level categories it should be fine, as these are typically addon names
|
||||
category.ID = categoryName
|
||||
group:SetName(categoryName, parent)
|
||||
Settings.RegisterAddOnCategory(category)
|
||||
end
|
||||
else
|
||||
group:SetName(name or appName, parent)
|
||||
InterfaceOptions_AddCategory(group.frame)
|
||||
end
|
||||
return group.frame, group.frame.name
|
||||
else
|
||||
error(("%s has already been added to the Blizzard Options Window with the given path"):format(appName), 2)
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<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>
|
||||
</Ui>
|
||||
|
|
|
@ -8,10 +8,10 @@
|
|||
-- :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 1207 2019-06-23 12:08:33Z nevcairiel $
|
||||
-- @release $Id: AceConfigRegistry-3.0.lua 1296 2022-11-04 18:50:10Z nevcairiel $
|
||||
local CallbackHandler = LibStub("CallbackHandler-1.0")
|
||||
|
||||
local MAJOR, MINOR = "AceConfigRegistry-3.0", 20
|
||||
local MAJOR, MINOR = "AceConfigRegistry-3.0", 21
|
||||
local AceConfigRegistry = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
|
||||
if not AceConfigRegistry then return end
|
||||
|
@ -83,6 +83,7 @@ local basekeys={
|
|||
dialogHidden=optmethodbool,
|
||||
dropdownHidden=optmethodbool,
|
||||
cmdHidden=optmethodbool,
|
||||
tooltipHyperlink=optstringfunc,
|
||||
icon=optstringnumberfunc,
|
||||
iconCoords=optmethodtable,
|
||||
handler=opttable,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<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>
|
||||
</Ui>
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
-- end
|
||||
-- @class file
|
||||
-- @name AceDB-3.0.lua
|
||||
-- @release $Id: AceDB-3.0.lua 1217 2019-07-11 03:06:18Z funkydude $
|
||||
-- @release $Id: AceDB-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
|
||||
local ACEDB_MAJOR, ACEDB_MINOR = "AceDB-3.0", 27
|
||||
local AceDB = LibStub:NewLibrary(ACEDB_MAJOR, ACEDB_MINOR)
|
||||
|
||||
|
@ -53,10 +53,6 @@ local setmetatable, rawset, rawget = setmetatable, rawset, rawget
|
|||
-- WoW APIs
|
||||
local _G = _G
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: LibStub
|
||||
|
||||
AceDB.db_registry = AceDB.db_registry or {}
|
||||
AceDB.frame = AceDB.frame or CreateFrame("Frame")
|
||||
|
||||
|
@ -98,11 +94,11 @@ local function copyDefaults(dest, src)
|
|||
-- This is a metatable used for table defaults
|
||||
local mt = {
|
||||
-- This handles the lookup and creation of new subtables
|
||||
__index = function(t,k)
|
||||
if k == nil then return nil end
|
||||
__index = function(t,k2)
|
||||
if k2 == nil then return nil end
|
||||
local tbl = {}
|
||||
copyDefaults(tbl, v)
|
||||
rawset(t, k, tbl)
|
||||
rawset(t, k2, tbl)
|
||||
return tbl
|
||||
end,
|
||||
}
|
||||
|
@ -115,7 +111,7 @@ local function copyDefaults(dest, src)
|
|||
end
|
||||
else
|
||||
-- Values are not tables, so this is just a simple return
|
||||
local mt = {__index = function(t,k) return k~=nil and v or nil end}
|
||||
local mt = {__index = function(t,k2) return k2~=nil and v or nil end}
|
||||
setmetatable(dest, mt)
|
||||
end
|
||||
elseif type(v) == "table" then
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<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="AceDB-3.0.lua"/>
|
||||
</Ui>
|
||||
</Ui>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
--- AceDBOptions-3.0 provides a universal AceConfig options screen for managing AceDB-3.0 profiles.
|
||||
-- @class file
|
||||
-- @name AceDBOptions-3.0
|
||||
-- @release $Id: AceDBOptions-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
|
||||
-- @release $Id: AceDBOptions-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
|
||||
local ACEDBO_MAJOR, ACEDBO_MINOR = "AceDBOptions-3.0", 15
|
||||
local AceDBOptions = LibStub:NewLibrary(ACEDBO_MAJOR, ACEDBO_MINOR)
|
||||
|
||||
|
@ -13,10 +13,6 @@ local pairs, next = pairs, next
|
|||
-- WoW APIs
|
||||
local UnitClass = UnitClass
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: NORMAL_FONT_COLOR_CODE, FONT_COLOR_CODE_CLOSE
|
||||
|
||||
AceDBOptions.optionTables = AceDBOptions.optionTables or {}
|
||||
AceDBOptions.handlers = AceDBOptions.handlers or {}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<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="AceDBOptions-3.0.lua"/>
|
||||
</Ui>
|
||||
</Ui>
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
-- f:AddChild(btn)
|
||||
-- @class file
|
||||
-- @name AceGUI-3.0
|
||||
-- @release $Id: AceGUI-3.0.lua 1247 2021-01-23 23:16:39Z funkehdude $
|
||||
-- @release $Id: AceGUI-3.0.lua 1288 2022-09-25 14:19:00Z funkehdude $
|
||||
local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 41
|
||||
local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR)
|
||||
|
||||
|
@ -35,17 +35,11 @@ local tinsert, wipe = table.insert, table.wipe
|
|||
local select, pairs, next, type = select, pairs, next, type
|
||||
local error, assert = error, assert
|
||||
local setmetatable, rawget = setmetatable, rawget
|
||||
local math_max = math.max
|
||||
local math_max, math_min, math_ceil = math.max, math.min, math.ceil
|
||||
|
||||
-- WoW APIs
|
||||
local UIParent = UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: geterrorhandler, LibStub
|
||||
|
||||
--local con = LibStub("AceConsole-3.0",true)
|
||||
|
||||
AceGUI.WidgetRegistry = AceGUI.WidgetRegistry or {}
|
||||
AceGUI.LayoutRegistry = AceGUI.LayoutRegistry or {}
|
||||
AceGUI.WidgetBase = AceGUI.WidgetBase or {}
|
||||
|
@ -94,38 +88,38 @@ do
|
|||
AceGUI.objPools = AceGUI.objPools or {}
|
||||
local objPools = AceGUI.objPools
|
||||
--Returns a new instance, if none are available either returns a new table or calls the given contructor
|
||||
function newWidget(type)
|
||||
if not WidgetRegistry[type] then
|
||||
function newWidget(widgetType)
|
||||
if not WidgetRegistry[widgetType] then
|
||||
error("Attempt to instantiate unknown widget type", 2)
|
||||
end
|
||||
|
||||
if not objPools[type] then
|
||||
objPools[type] = {}
|
||||
if not objPools[widgetType] then
|
||||
objPools[widgetType] = {}
|
||||
end
|
||||
|
||||
local newObj = next(objPools[type])
|
||||
local newObj = next(objPools[widgetType])
|
||||
if not newObj then
|
||||
newObj = WidgetRegistry[type]()
|
||||
newObj.AceGUIWidgetVersion = WidgetVersions[type]
|
||||
newObj = WidgetRegistry[widgetType]()
|
||||
newObj.AceGUIWidgetVersion = WidgetVersions[widgetType]
|
||||
else
|
||||
objPools[type][newObj] = nil
|
||||
objPools[widgetType][newObj] = nil
|
||||
-- if the widget is older then the latest, don't even try to reuse it
|
||||
-- just forget about it, and grab a new one.
|
||||
if not newObj.AceGUIWidgetVersion or newObj.AceGUIWidgetVersion < WidgetVersions[type] then
|
||||
return newWidget(type)
|
||||
if not newObj.AceGUIWidgetVersion or newObj.AceGUIWidgetVersion < WidgetVersions[widgetType] then
|
||||
return newWidget(widgetType)
|
||||
end
|
||||
end
|
||||
return newObj
|
||||
end
|
||||
-- Releases an instance to the Pool
|
||||
function delWidget(obj,type)
|
||||
if not objPools[type] then
|
||||
objPools[type] = {}
|
||||
function delWidget(obj,widgetType)
|
||||
if not objPools[widgetType] then
|
||||
objPools[widgetType] = {}
|
||||
end
|
||||
if objPools[type][obj] then
|
||||
if objPools[widgetType][obj] then
|
||||
error("Attempt to Release Widget that is already released", 2)
|
||||
end
|
||||
objPools[type][obj] = true
|
||||
objPools[widgetType][obj] = true
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -141,9 +135,9 @@ end
|
|||
-- OnAcquire function on it, before returning.
|
||||
-- @param type The type of the widget.
|
||||
-- @return The newly created widget.
|
||||
function AceGUI:Create(type)
|
||||
if WidgetRegistry[type] then
|
||||
local widget = newWidget(type)
|
||||
function AceGUI:Create(widgetType)
|
||||
if WidgetRegistry[widgetType] then
|
||||
local widget = newWidget(widgetType)
|
||||
|
||||
if rawget(widget, "Acquire") then
|
||||
widget.OnAcquire = widget.Acquire
|
||||
|
@ -161,7 +155,7 @@ function AceGUI:Create(type)
|
|||
if widget.OnAcquire then
|
||||
widget:OnAcquire()
|
||||
else
|
||||
error(("Widget type %s doesn't supply an OnAcquire Function"):format(type))
|
||||
error(("Widget type %s doesn't supply an OnAcquire Function"):format(widgetType))
|
||||
end
|
||||
-- Set the default Layout ("List")
|
||||
safecall(widget.SetLayout, widget, "List")
|
||||
|
@ -589,25 +583,25 @@ AceGUI.counts = AceGUI.counts or {}
|
|||
-- This is used by widgets that require a named frame, e.g. when a Blizzard
|
||||
-- Template requires it.
|
||||
-- @param type The widget type
|
||||
function AceGUI:GetNextWidgetNum(type)
|
||||
if not self.counts[type] then
|
||||
self.counts[type] = 0
|
||||
function AceGUI:GetNextWidgetNum(widgetType)
|
||||
if not self.counts[widgetType] then
|
||||
self.counts[widgetType] = 0
|
||||
end
|
||||
self.counts[type] = self.counts[type] + 1
|
||||
return self.counts[type]
|
||||
self.counts[widgetType] = self.counts[widgetType] + 1
|
||||
return self.counts[widgetType]
|
||||
end
|
||||
|
||||
--- Return the number of created widgets for this type.
|
||||
-- In contrast to GetNextWidgetNum, the number is not incremented.
|
||||
-- @param type The widget type
|
||||
function AceGUI:GetWidgetCount(type)
|
||||
return self.counts[type] or 0
|
||||
-- @param widgetType The widget type
|
||||
function AceGUI:GetWidgetCount(widgetType)
|
||||
return self.counts[widgetType] or 0
|
||||
end
|
||||
|
||||
--- Return the version of the currently registered widget type.
|
||||
-- @param type The widget type
|
||||
function AceGUI:GetWidgetVersion(type)
|
||||
return WidgetVersions[type]
|
||||
-- @param widgetType The widget type
|
||||
function AceGUI:GetWidgetVersion(widgetType)
|
||||
return WidgetVersions[widgetType]
|
||||
end
|
||||
|
||||
-------------
|
||||
|
@ -770,7 +764,6 @@ AceGUI:RegisterLayout("Flow",
|
|||
|
||||
usedwidth = 0
|
||||
rowstart = frame
|
||||
rowstartoffset = frameoffset
|
||||
|
||||
if child.DoLayout then
|
||||
child:DoLayout()
|
||||
|
@ -813,7 +806,8 @@ local GetCellAlign = function (dir, tableObj, colObj, cellObj, cell, child)
|
|||
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
|
||||
local val
|
||||
child, cell = child or 0, cell or 0
|
||||
|
||||
if type(fn) == "string" then
|
||||
fn = fn:lower()
|
||||
|
@ -827,7 +821,7 @@ local GetCellAlign = function (dir, tableObj, colObj, cellObj, cell, child)
|
|||
val = fn
|
||||
end
|
||||
|
||||
return fn, max(0, min(val, cell))
|
||||
return fn, math_max(0, math_min(val, cell))
|
||||
end
|
||||
|
||||
-- Get width or height for multiple cells combined
|
||||
|
@ -836,7 +830,7 @@ local GetCellDimension = function (dir, laneDim, from, to, space)
|
|||
for cell=from,to do
|
||||
dim = dim + (laneDim[cell] or 0)
|
||||
end
|
||||
return dim + max(0, to - from) * (space or 0)
|
||||
return dim + math_max(0, to - from) * (space or 0)
|
||||
end
|
||||
|
||||
--[[ Options
|
||||
|
@ -882,7 +876,7 @@ AceGUI:RegisterLayout("Table",
|
|||
repeat
|
||||
n = n + 1
|
||||
local col = (n - 1) % #cols + 1
|
||||
local row = ceil(n / #cols)
|
||||
local row = math_ceil(n / #cols)
|
||||
local rowspan = rowspans[col]
|
||||
local cell = rowspan and rowspan.child or child
|
||||
local cellObj = cell:GetUserData("cell")
|
||||
|
@ -898,7 +892,7 @@ AceGUI:RegisterLayout("Table",
|
|||
end
|
||||
|
||||
-- Colspan
|
||||
local colspan = max(0, min((cellObj and cellObj.colspan or 1) - 1, #cols - col))
|
||||
local colspan = math_max(0, math_min((cellObj and cellObj.colspan or 1) - 1, #cols - col))
|
||||
n = n + colspan
|
||||
|
||||
-- Place the cell
|
||||
|
@ -915,7 +909,7 @@ AceGUI:RegisterLayout("Table",
|
|||
end
|
||||
end
|
||||
|
||||
local rows = ceil(n / #cols)
|
||||
local rows = math_ceil(n / #cols)
|
||||
|
||||
-- Determine fixed size cols and collect weights
|
||||
local extantH, totalWeight = totalH, 0
|
||||
|
@ -940,16 +934,16 @@ AceGUI:RegisterLayout("Table",
|
|||
f:ClearAllPoints()
|
||||
local childH = f:GetWidth() or 0
|
||||
|
||||
laneH[col] = max(laneH[col], childH - GetCellDimension("H", laneH, colStart[child], col - 1, spaceH))
|
||||
laneH[col] = math_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]))
|
||||
laneH[col] = math_max(colObj.min or colObj[1] or 0, math_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])
|
||||
extantH = math_max(0, extantH - laneH[col])
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -988,7 +982,7 @@ AceGUI:RegisterLayout("Table",
|
|||
child:DoLayout()
|
||||
end
|
||||
|
||||
rowV = max(rowV, (f:GetHeight() or 0) - GetCellDimension("V", laneV, rowStart[child], row - 1, spaceV))
|
||||
rowV = math_max(rowV, (f:GetHeight() or 0) - GetCellDimension("V", laneV, rowStart[child], row - 1, spaceV))
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
BlizOptionsGroup Container
|
||||
Simple container widget for the integration of AceGUI into the Blizzard Interface Options
|
||||
-------------------------------------------------------------------------------]]
|
||||
local Type, Version = "BlizOptionsGroup", 21
|
||||
local Type, Version = "BlizOptionsGroup", 26
|
||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||
|
||||
|
@ -99,7 +99,7 @@ local methods = {
|
|||
Constructor
|
||||
-------------------------------------------------------------------------------]]
|
||||
local function Constructor()
|
||||
local frame = CreateFrame("Frame")
|
||||
local frame = CreateFrame("Frame", nil, InterfaceOptionsFramePanelContainer)
|
||||
frame:Hide()
|
||||
|
||||
-- support functions for the Blizzard Interface Options
|
||||
|
@ -108,6 +108,11 @@ local function Constructor()
|
|||
frame.default = default
|
||||
frame.refresh = refresh
|
||||
|
||||
-- 10.0 support function aliases (cancel has been removed)
|
||||
frame.OnCommit = okay
|
||||
frame.OnDefault = default
|
||||
frame.OnRefresh = refresh
|
||||
|
||||
frame:SetScript("OnHide", OnHide)
|
||||
frame:SetScript("OnShow", OnShow)
|
||||
|
||||
|
|
|
@ -125,7 +125,7 @@ local function Constructor()
|
|||
dropdown.frame:Show()
|
||||
dropdown:SetLabel("")
|
||||
|
||||
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||
border:SetPoint("TOPLEFT", 0, -26)
|
||||
border:SetPoint("BOTTOMRIGHT", 0, 3)
|
||||
border:SetBackdrop(PaneBackdrop)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
--[[-----------------------------------------------------------------------------
|
||||
Frame Container
|
||||
-------------------------------------------------------------------------------]]
|
||||
local Type, Version = "Frame", 28
|
||||
local Type, Version = "Frame", 30
|
||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||
|
||||
|
@ -13,10 +13,6 @@ local wipe = table.wipe
|
|||
local PlaySound = PlaySound
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: CLOSE
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Scripts
|
||||
-------------------------------------------------------------------------------]]
|
||||
|
@ -180,7 +176,7 @@ local PaneBackdrop = {
|
|||
}
|
||||
|
||||
local function Constructor()
|
||||
local frame = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local frame = CreateFrame("Frame", nil, UIParent, "BackdropTemplate")
|
||||
frame:Hide()
|
||||
|
||||
frame:EnableMouse(true)
|
||||
|
@ -190,7 +186,11 @@ local function Constructor()
|
|||
frame:SetFrameLevel(100) -- Lots of room to draw under it
|
||||
frame:SetBackdrop(FrameBackdrop)
|
||||
frame:SetBackdropColor(0, 0, 0, 1)
|
||||
frame:SetMinResize(400, 200)
|
||||
if frame.SetResizeBounds then -- WoW 10.0
|
||||
frame:SetResizeBounds(400, 200)
|
||||
else
|
||||
frame:SetMinResize(400, 200)
|
||||
end
|
||||
frame:SetToplevel(true)
|
||||
frame:SetScript("OnShow", Frame_OnShow)
|
||||
frame:SetScript("OnHide", Frame_OnClose)
|
||||
|
@ -203,7 +203,7 @@ local function Constructor()
|
|||
closebutton:SetWidth(100)
|
||||
closebutton:SetText(CLOSE)
|
||||
|
||||
local statusbg = CreateFrame("Button", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local statusbg = CreateFrame("Button", nil, frame, "BackdropTemplate")
|
||||
statusbg:SetPoint("BOTTOMLEFT", 15, 15)
|
||||
statusbg:SetPoint("BOTTOMRIGHT", -132, 15)
|
||||
statusbg:SetHeight(24)
|
||||
|
@ -271,7 +271,7 @@ local function Constructor()
|
|||
line2:SetHeight(8)
|
||||
line2:SetPoint("BOTTOMRIGHT", -8, 8)
|
||||
line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
|
||||
local x = 0.1 * 8/17
|
||||
x = 0.1 * 8/17
|
||||
line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5)
|
||||
|
||||
local sizer_s = CreateFrame("Frame", nil, frame)
|
||||
|
|
|
@ -75,7 +75,7 @@ local function Constructor()
|
|||
titletext:SetJustifyH("LEFT")
|
||||
titletext:SetHeight(18)
|
||||
|
||||
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||
border:SetPoint("TOPLEFT", 0, -17)
|
||||
border:SetPoint("BOTTOMRIGHT", -1, 3)
|
||||
border:SetBackdrop(PaneBackdrop)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
TabGroup Container
|
||||
Container that uses tabs on top to switch between groups.
|
||||
-------------------------------------------------------------------------------]]
|
||||
local Type, Version = "TabGroup", 37
|
||||
local Type, Version = "TabGroup", 38
|
||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||
|
||||
|
@ -14,10 +14,6 @@ local PlaySound = PlaySound
|
|||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
local _G = _G
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: PanelTemplates_TabResize, PanelTemplates_SetDisabledTabState, PanelTemplates_SelectTab, PanelTemplates_DeselectTab
|
||||
|
||||
-- local upvalue storage used by BuildTabs
|
||||
local widths = {}
|
||||
local rowwidths = {}
|
||||
|
@ -26,6 +22,143 @@ local rowends = {}
|
|||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
|
||||
local function PanelTemplates_TabResize(tab, padding, absoluteSize, minWidth, maxWidth, absoluteTextSize)
|
||||
local tabName = tab:GetName();
|
||||
|
||||
local buttonMiddle = tab.Middle or tab.middleTexture or _G[tabName.."Middle"];
|
||||
local buttonMiddleDisabled = tab.MiddleDisabled or (tabName and _G[tabName.."MiddleDisabled"]);
|
||||
local left = tab.Left or tab.leftTexture or _G[tabName.."Left"];
|
||||
local sideWidths = 2 * left:GetWidth();
|
||||
local tabText = tab.Text or _G[tab:GetName().."Text"];
|
||||
local highlightTexture = tab.HighlightTexture or (tabName and _G[tabName.."HighlightTexture"]);
|
||||
|
||||
local width, tabWidth;
|
||||
local textWidth;
|
||||
if ( absoluteTextSize ) then
|
||||
textWidth = absoluteTextSize;
|
||||
else
|
||||
tabText:SetWidth(0);
|
||||
textWidth = tabText:GetWidth();
|
||||
end
|
||||
-- If there's an absolute size specified then use it
|
||||
if ( absoluteSize ) then
|
||||
if ( absoluteSize < sideWidths) then
|
||||
width = 1;
|
||||
tabWidth = sideWidths
|
||||
else
|
||||
width = absoluteSize - sideWidths;
|
||||
tabWidth = absoluteSize
|
||||
end
|
||||
tabText:SetWidth(width);
|
||||
else
|
||||
-- Otherwise try to use padding
|
||||
if ( padding ) then
|
||||
width = textWidth + padding;
|
||||
else
|
||||
width = textWidth + 24;
|
||||
end
|
||||
-- If greater than the maxWidth then cap it
|
||||
if ( maxWidth and width > maxWidth ) then
|
||||
if ( padding ) then
|
||||
width = maxWidth + padding;
|
||||
else
|
||||
width = maxWidth + 24;
|
||||
end
|
||||
tabText:SetWidth(width);
|
||||
else
|
||||
tabText:SetWidth(0);
|
||||
end
|
||||
if (minWidth and width < minWidth) then
|
||||
width = minWidth;
|
||||
end
|
||||
tabWidth = width + sideWidths;
|
||||
end
|
||||
|
||||
if ( buttonMiddle ) then
|
||||
buttonMiddle:SetWidth(width);
|
||||
end
|
||||
if ( buttonMiddleDisabled ) then
|
||||
buttonMiddleDisabled:SetWidth(width);
|
||||
end
|
||||
|
||||
tab:SetWidth(tabWidth);
|
||||
|
||||
if ( highlightTexture ) then
|
||||
highlightTexture:SetWidth(tabWidth);
|
||||
end
|
||||
end
|
||||
|
||||
local function PanelTemplates_DeselectTab(tab)
|
||||
local name = tab:GetName();
|
||||
|
||||
local left = tab.Left or _G[name.."Left"];
|
||||
local middle = tab.Middle or _G[name.."Middle"];
|
||||
local right = tab.Right or _G[name.."Right"];
|
||||
left:Show();
|
||||
middle:Show();
|
||||
right:Show();
|
||||
--tab:UnlockHighlight();
|
||||
tab:Enable();
|
||||
local text = tab.Text or _G[name.."Text"];
|
||||
text:SetPoint("CENTER", tab, "CENTER", (tab.deselectedTextX or 0), (tab.deselectedTextY or 2));
|
||||
|
||||
local leftDisabled = tab.LeftDisabled or _G[name.."LeftDisabled"];
|
||||
local middleDisabled = tab.MiddleDisabled or _G[name.."MiddleDisabled"];
|
||||
local rightDisabled = tab.RightDisabled or _G[name.."RightDisabled"];
|
||||
leftDisabled:Hide();
|
||||
middleDisabled:Hide();
|
||||
rightDisabled:Hide();
|
||||
end
|
||||
|
||||
local function PanelTemplates_SelectTab(tab)
|
||||
local name = tab:GetName();
|
||||
|
||||
local left = tab.Left or _G[name.."Left"];
|
||||
local middle = tab.Middle or _G[name.."Middle"];
|
||||
local right = tab.Right or _G[name.."Right"];
|
||||
left:Hide();
|
||||
middle:Hide();
|
||||
right:Hide();
|
||||
--tab:LockHighlight();
|
||||
tab:Disable();
|
||||
tab:SetDisabledFontObject(GameFontHighlightSmall);
|
||||
local text = tab.Text or _G[name.."Text"];
|
||||
text:SetPoint("CENTER", tab, "CENTER", (tab.selectedTextX or 0), (tab.selectedTextY or -3));
|
||||
|
||||
local leftDisabled = tab.LeftDisabled or _G[name.."LeftDisabled"];
|
||||
local middleDisabled = tab.MiddleDisabled or _G[name.."MiddleDisabled"];
|
||||
local rightDisabled = tab.RightDisabled or _G[name.."RightDisabled"];
|
||||
leftDisabled:Show();
|
||||
middleDisabled:Show();
|
||||
rightDisabled:Show();
|
||||
|
||||
if GameTooltip:IsOwned(tab) then
|
||||
GameTooltip:Hide();
|
||||
end
|
||||
end
|
||||
|
||||
local function PanelTemplates_SetDisabledTabState(tab)
|
||||
local name = tab:GetName();
|
||||
local left = tab.Left or _G[name.."Left"];
|
||||
local middle = tab.Middle or _G[name.."Middle"];
|
||||
local right = tab.Right or _G[name.."Right"];
|
||||
left:Show();
|
||||
middle:Show();
|
||||
right:Show();
|
||||
--tab:UnlockHighlight();
|
||||
tab:Disable();
|
||||
tab.text = tab:GetText();
|
||||
-- Gray out text
|
||||
tab:SetDisabledFontObject(GameFontDisableSmall);
|
||||
local leftDisabled = tab.LeftDisabled or _G[name.."LeftDisabled"];
|
||||
local middleDisabled = tab.MiddleDisabled or _G[name.."MiddleDisabled"];
|
||||
local rightDisabled = tab.RightDisabled or _G[name.."RightDisabled"];
|
||||
leftDisabled:Hide();
|
||||
middleDisabled:Hide();
|
||||
rightDisabled:Hide();
|
||||
end
|
||||
|
||||
local function UpdateTabLook(frame)
|
||||
if frame.disabled then
|
||||
PanelTemplates_SetDisabledTabState(frame)
|
||||
|
@ -103,11 +236,64 @@ local methods = {
|
|||
|
||||
["CreateTab"] = function(self, id)
|
||||
local tabname = ("AceGUITabGroup%dTab%d"):format(self.num, id)
|
||||
local tab = CreateFrame("Button", tabname, self.border, "OptionsFrameTabButtonTemplate")
|
||||
local tab = CreateFrame("Button", tabname, self.border)
|
||||
tab:SetSize(115, 24)
|
||||
tab.deselectedTextY = -3
|
||||
tab.selectedTextY = -2
|
||||
|
||||
tab.LeftDisabled = tab:CreateTexture(tabname .. "LeftDisabled", "BORDER")
|
||||
tab.LeftDisabled:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-ActiveTab")
|
||||
tab.LeftDisabled:SetSize(20, 24)
|
||||
tab.LeftDisabled:SetPoint("BOTTOMLEFT", 0, -3)
|
||||
tab.LeftDisabled:SetTexCoord(0, 0.15625, 0, 1.0)
|
||||
|
||||
tab.MiddleDisabled = tab:CreateTexture(tabname .. "MiddleDisabled", "BORDER")
|
||||
tab.MiddleDisabled:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-ActiveTab")
|
||||
tab.MiddleDisabled:SetSize(88, 24)
|
||||
tab.MiddleDisabled:SetPoint("LEFT", tab.LeftDisabled, "RIGHT")
|
||||
tab.MiddleDisabled:SetTexCoord(0.15625, 0.84375, 0, 1.0)
|
||||
|
||||
tab.RightDisabled = tab:CreateTexture(tabname .. "RightDisabled", "BORDER")
|
||||
tab.RightDisabled:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-ActiveTab")
|
||||
tab.RightDisabled:SetSize(20, 24)
|
||||
tab.RightDisabled:SetPoint("LEFT", tab.MiddleDisabled, "RIGHT")
|
||||
tab.RightDisabled:SetTexCoord(0.84375, 1.0, 0, 1.0)
|
||||
|
||||
tab.Left = tab:CreateTexture(tabname .. "Left", "BORDER")
|
||||
tab.Left:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-InActiveTab")
|
||||
tab.Left:SetSize(20, 24)
|
||||
tab.Left:SetPoint("TOPLEFT")
|
||||
tab.Left:SetTexCoord(0, 0.15625, 0, 1.0)
|
||||
|
||||
tab.Middle = tab:CreateTexture(tabname .. "Middle", "BORDER")
|
||||
tab.Middle:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-InActiveTab")
|
||||
tab.Middle:SetSize(88, 24)
|
||||
tab.Middle:SetPoint("LEFT", tab.Left, "RIGHT")
|
||||
tab.Middle:SetTexCoord(0.15625, 0.84375, 0, 1.0)
|
||||
|
||||
tab.Right = tab:CreateTexture(tabname .. "Right", "BORDER")
|
||||
tab.Right:SetTexture("Interface\\OptionsFrame\\UI-OptionsFrame-InActiveTab")
|
||||
tab.Right:SetSize(20, 24)
|
||||
tab.Right:SetPoint("LEFT", tab.Middle, "RIGHT")
|
||||
tab.Right:SetTexCoord(0.84375, 1.0, 0, 1.0)
|
||||
|
||||
tab.Text = tab:CreateFontString(tabname .. "Text")
|
||||
tab:SetFontString(tab.Text)
|
||||
|
||||
tab:SetNormalFontObject(GameFontNormalSmall)
|
||||
tab:SetHighlightFontObject(GameFontHighlightSmall)
|
||||
tab:SetDisabledFontObject(GameFontHighlightSmall)
|
||||
tab:SetHighlightTexture("Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight", "ADD")
|
||||
tab.HighlightTexture = tab:GetHighlightTexture()
|
||||
tab.HighlightTexture:ClearAllPoints()
|
||||
tab.HighlightTexture:SetPoint("LEFT", tab, "LEFT", 10, -4)
|
||||
tab.HighlightTexture:SetPoint("RIGHT", tab, "RIGHT", -10, -4)
|
||||
_G[tabname .. "HighlightTexture"] = tab.HighlightTexture
|
||||
|
||||
tab.obj = self
|
||||
tab.id = id
|
||||
|
||||
tab.text = _G[tabname .. "Text"]
|
||||
tab.text = tab.Text -- compat
|
||||
tab.text:ClearAllPoints()
|
||||
tab.text:SetPoint("LEFT", 14, -3)
|
||||
tab.text:SetPoint("RIGHT", -12, -3)
|
||||
|
@ -316,7 +502,7 @@ local function Constructor()
|
|||
titletext:SetHeight(18)
|
||||
titletext:SetText("")
|
||||
|
||||
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||
border:SetPoint("TOPLEFT", 1, -27)
|
||||
border:SetPoint("BOTTOMRIGHT", -1, 3)
|
||||
border:SetBackdrop(PaneBackdrop)
|
||||
|
|
|
@ -2,22 +2,18 @@
|
|||
TreeGroup Container
|
||||
Container that uses a tree control to switch between groups.
|
||||
-------------------------------------------------------------------------------]]
|
||||
local Type, Version = "TreeGroup", 45
|
||||
local Type, Version = "TreeGroup", 47
|
||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||
|
||||
-- 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 math_min, math_max, floor = math.min, math.max, math.floor
|
||||
local select, tremove, unpack, tconcat = select, table.remove, unpack, table.concat
|
||||
|
||||
-- WoW APIs
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: FONT_COLOR_CODE_CLOSE
|
||||
|
||||
-- Recycling functions
|
||||
local new, del
|
||||
do
|
||||
|
@ -567,7 +563,11 @@ local methods = {
|
|||
if maxtreewidth > 100 and status.treewidth > maxtreewidth then
|
||||
self:SetTreeWidth(maxtreewidth, status.treesizable)
|
||||
end
|
||||
treeframe:SetMaxResize(maxtreewidth, 1600)
|
||||
if treeframe.SetResizeBounds then
|
||||
treeframe:SetResizeBounds(100, 1, maxtreewidth, 1600)
|
||||
else
|
||||
treeframe:SetMaxResize(maxtreewidth, 1600)
|
||||
end
|
||||
end,
|
||||
|
||||
["OnHeightSet"] = function(self, height)
|
||||
|
@ -637,7 +637,7 @@ local function Constructor()
|
|||
local num = AceGUI:GetNextWidgetNum(Type)
|
||||
local frame = CreateFrame("Frame", nil, UIParent)
|
||||
|
||||
local treeframe = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local treeframe = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||
treeframe:SetPoint("TOPLEFT")
|
||||
treeframe:SetPoint("BOTTOMLEFT")
|
||||
treeframe:SetWidth(DEFAULT_TREE_WIDTH)
|
||||
|
@ -646,13 +646,17 @@ local function Constructor()
|
|||
treeframe:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
|
||||
treeframe:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
||||
treeframe:SetResizable(true)
|
||||
treeframe:SetMinResize(100, 1)
|
||||
treeframe:SetMaxResize(400, 1600)
|
||||
if treeframe.SetResizeBounds then -- WoW 10.0
|
||||
treeframe:SetResizeBounds(100, 1, 400, 1600)
|
||||
else
|
||||
treeframe:SetMinResize(100, 1)
|
||||
treeframe:SetMaxResize(400, 1600)
|
||||
end
|
||||
treeframe:SetScript("OnUpdate", FirstFrameUpdate)
|
||||
treeframe:SetScript("OnSizeChanged", Tree_OnSizeChanged)
|
||||
treeframe:SetScript("OnMouseWheel", Tree_OnMouseWheel)
|
||||
|
||||
local dragger = CreateFrame("Frame", nil, treeframe, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local dragger = CreateFrame("Frame", nil, treeframe, "BackdropTemplate")
|
||||
dragger:SetWidth(8)
|
||||
dragger:SetPoint("TOP", treeframe, "TOPRIGHT")
|
||||
dragger:SetPoint("BOTTOM", treeframe, "BOTTOMRIGHT")
|
||||
|
@ -677,7 +681,7 @@ local function Constructor()
|
|||
scrollbg:SetAllPoints(scrollbar)
|
||||
scrollbg:SetColorTexture(0,0,0,0.4)
|
||||
|
||||
local border = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||
border:SetPoint("TOPLEFT", treeframe, "TOPRIGHT")
|
||||
border:SetPoint("BOTTOMRIGHT")
|
||||
border:SetBackdrop(PaneBackdrop)
|
||||
|
|
|
@ -7,10 +7,6 @@ local pairs, assert, type = pairs, assert, type
|
|||
local PlaySound = PlaySound
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GameFontNormal
|
||||
|
||||
----------------
|
||||
-- Main Frame --
|
||||
----------------
|
||||
|
@ -21,7 +17,7 @@ local CreateFrame, UIParent = CreateFrame, UIParent
|
|||
]]
|
||||
do
|
||||
local Type = "Window"
|
||||
local Version = 6
|
||||
local Version = 8
|
||||
|
||||
local function frameOnShow(this)
|
||||
this.obj:Fire("OnShow")
|
||||
|
@ -186,7 +182,11 @@ do
|
|||
|
||||
frame:SetScript("OnShow",frameOnShow)
|
||||
frame:SetScript("OnHide",frameOnClose)
|
||||
frame:SetMinResize(240,240)
|
||||
if frame.SetResizeBounds then -- WoW 10.0
|
||||
frame:SetResizeBounds(240,240)
|
||||
else
|
||||
frame:SetMinResize(240,240)
|
||||
end
|
||||
frame:SetToplevel(true)
|
||||
|
||||
local titlebg = frame:CreateTexture(nil, "BACKGROUND")
|
||||
|
@ -300,7 +300,7 @@ do
|
|||
line2:SetHeight(8)
|
||||
line2:SetPoint("BOTTOMRIGHT", -8, 8)
|
||||
line2:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
|
||||
local x = 0.1 * 8/17
|
||||
x = 0.1 * 8/17
|
||||
line2:SetTexCoord(0.05 - x, 0.5, 0.05, 0.5 + x, 0.05, 0.5 - x, 0.5 + x, 0.5)
|
||||
|
||||
local sizer_s = CreateFrame("Frame",nil,frame)
|
||||
|
|
|
@ -12,10 +12,6 @@ local select, pairs = select, pairs
|
|||
local PlaySound = PlaySound
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: SetDesaturation, GameFontHighlight
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
|
@ -199,14 +195,14 @@ local methods = {
|
|||
["SetDescription"] = function(self, desc)
|
||||
if desc then
|
||||
if not self.desc then
|
||||
local desc = self.frame:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
||||
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
|
||||
local f = self.frame:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
|
||||
f:ClearAllPoints()
|
||||
f:SetPoint("TOPLEFT", self.checkbg, "TOPRIGHT", 5, -21)
|
||||
f:SetWidth(self.frame.width - 30)
|
||||
f:SetPoint("RIGHT", self.frame, "RIGHT", -30, 0)
|
||||
f:SetJustifyH("LEFT")
|
||||
f:SetJustifyV("TOP")
|
||||
self.desc = f
|
||||
end
|
||||
self.desc:Show()
|
||||
--self.text:SetFontObject(GameFontNormal)
|
||||
|
|
|
@ -11,10 +11,6 @@ local pairs = pairs
|
|||
-- WoW APIs
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: ColorPickerFrame, OpacitySliderFrame
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1202 2019-05-15 23:11:22Z nevcairiel $ ]]--
|
||||
--[[ $Id: AceGUIWidget-DropDown-Items.lua 1272 2022-08-29 15:56:35Z nevcairiel $ ]]--
|
||||
|
||||
local AceGUI = LibStub("AceGUI-3.0")
|
||||
|
||||
|
@ -41,7 +41,7 @@ local ItemBase = {
|
|||
-- NOTE: The ItemBase version is added to each item's version number
|
||||
-- to ensure proper updates on ItemBase changes.
|
||||
-- Use at least 1000er steps.
|
||||
version = 1000,
|
||||
version = 2000,
|
||||
counter = 0,
|
||||
}
|
||||
|
||||
|
@ -178,7 +178,7 @@ function ItemBase.Create(type)
|
|||
highlight:Hide()
|
||||
self.highlight = highlight
|
||||
|
||||
local check = frame:CreateTexture("OVERLAY")
|
||||
local check = frame:CreateTexture(nil, "OVERLAY")
|
||||
check:SetWidth(16)
|
||||
check:SetHeight(16)
|
||||
check:SetPoint("LEFT",frame,"LEFT",3,-1)
|
||||
|
@ -186,7 +186,7 @@ function ItemBase.Create(type)
|
|||
check:Hide()
|
||||
self.check = check
|
||||
|
||||
local sub = frame:CreateTexture("OVERLAY")
|
||||
local sub = frame:CreateTexture(nil, "OVERLAY")
|
||||
sub:SetWidth(16)
|
||||
sub:SetHeight(16)
|
||||
sub:SetPoint("RIGHT",frame,"RIGHT",-3,-1)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
--[[ $Id: AceGUIWidget-DropDown.lua 1239 2020-09-20 10:22:02Z nevcairiel $ ]]--
|
||||
--[[ $Id: AceGUIWidget-DropDown.lua 1284 2022-09-25 09:15:30Z nevcairiel $ ]]--
|
||||
local AceGUI = LibStub("AceGUI-3.0")
|
||||
|
||||
-- Lua APIs
|
||||
|
@ -11,10 +11,6 @@ local PlaySound = PlaySound
|
|||
local UIParent, CreateFrame = UIParent, CreateFrame
|
||||
local _G = _G
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: CLOSE
|
||||
|
||||
local function fixlevels(parent,...)
|
||||
local i = 1
|
||||
local child = select(i, ...)
|
||||
|
@ -253,7 +249,7 @@ do
|
|||
|
||||
local function Constructor()
|
||||
local count = AceGUI:GetNextWidgetNum(widgetType)
|
||||
local frame = CreateFrame("Frame", "AceGUI30Pullout"..count, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local frame = CreateFrame("Frame", "AceGUI30Pullout"..count, UIParent, "BackdropTemplate")
|
||||
local self = {}
|
||||
self.count = count
|
||||
self.type = widgetType
|
||||
|
@ -304,7 +300,7 @@ do
|
|||
scrollFrame.obj = self
|
||||
itemFrame.obj = self
|
||||
|
||||
local slider = CreateFrame("Slider", "AceGUI30PulloutScrollbar"..count, scrollFrame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local slider = CreateFrame("Slider", "AceGUI30PulloutScrollbar"..count, scrollFrame, "BackdropTemplate")
|
||||
slider:SetOrientation("VERTICAL")
|
||||
slider:SetHitRectInsets(0, 0, -10, 0)
|
||||
slider:SetBackdrop(sliderBackdrop)
|
||||
|
@ -351,7 +347,7 @@ end
|
|||
|
||||
do
|
||||
local widgetType = "Dropdown"
|
||||
local widgetVersion = 35
|
||||
local widgetVersion = 36
|
||||
|
||||
--[[ Static data ]]--
|
||||
|
||||
|
@ -376,7 +372,6 @@ do
|
|||
|
||||
local function Dropdown_TogglePullout(this)
|
||||
local self = this.obj
|
||||
PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON
|
||||
if self.open then
|
||||
self.open = nil
|
||||
self.pullout:Close()
|
||||
|
|
|
@ -14,10 +14,6 @@ local GetCursorInfo, ClearCursor, GetSpellInfo = GetCursorInfo, ClearCursor, Get
|
|||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
local _G = _G
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: AceGUIEditBoxInsertLink, ChatFontNormal, OKAY
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
|
|
|
@ -13,10 +13,6 @@ local pairs = pairs
|
|||
local IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown = IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: NOT_BOUND
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Scripts
|
||||
-------------------------------------------------------------------------------]]
|
||||
|
@ -214,7 +210,7 @@ local function Constructor()
|
|||
label:SetJustifyH("CENTER")
|
||||
label:SetHeight(18)
|
||||
|
||||
local msgframe = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local msgframe = CreateFrame("Frame", nil, UIParent, "BackdropTemplate")
|
||||
msgframe:SetHeight(30)
|
||||
msgframe:SetBackdrop(ControlBackdrop)
|
||||
msgframe:SetBackdropColor(0,0,0)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Label Widget
|
||||
Displays text and optionally an icon.
|
||||
-------------------------------------------------------------------------------]]
|
||||
local Type, Version = "Label", 27
|
||||
local Type, Version = "Label", 28
|
||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||
|
||||
|
@ -12,10 +12,6 @@ local max, select, pairs = math.max, select, pairs
|
|||
-- WoW APIs
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GameFontHighlightSmall
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
|
@ -129,12 +125,16 @@ local methods = {
|
|||
end,
|
||||
|
||||
["SetFont"] = function(self, font, height, flags)
|
||||
self.label:SetFont(font, height, flags)
|
||||
UpdateImageAnchor(self)
|
||||
if not self.fontObject then
|
||||
self.fontObject = CreateFont("AceGUI30LabelFont" .. AceGUI:GetNextWidgetNum(Type))
|
||||
end
|
||||
self.fontObject:SetFont(font, height, flags)
|
||||
self:SetFontObject(self.fontObject)
|
||||
end,
|
||||
|
||||
["SetFontObject"] = function(self, font)
|
||||
self:SetFont((font or GameFontHighlightSmall):GetFont())
|
||||
self.label:SetFontObject(font or GameFontHighlightSmall)
|
||||
UpdateImageAnchor(self)
|
||||
end,
|
||||
|
||||
["SetImageSize"] = function(self, width, height)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local Type, Version = "MultiLineEditBox", 29
|
||||
local Type, Version = "MultiLineEditBox", 32
|
||||
local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
|
||||
if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
|
||||
|
||||
|
@ -10,10 +10,6 @@ local GetCursorInfo, GetSpellInfo, ClearCursor = GetCursorInfo, GetSpellInfo, Cl
|
|||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
local _G = _G
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: ACCEPT, ChatFontNormal
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
|
@ -145,6 +141,14 @@ local function OnVerticalScroll(self, offset)
|
|||
editBox:SetHitRectInsets(0, 0, offset, editBox:GetHeight() - offset - self:GetHeight())
|
||||
end
|
||||
|
||||
local function OnScrollRangeChanged(self, xrange, yrange)
|
||||
if yrange == 0 then
|
||||
self.obj.editBox:SetHitRectInsets(0, 0, 0, 0)
|
||||
else
|
||||
OnVerticalScroll(self, self:GetVerticalScroll())
|
||||
end
|
||||
end
|
||||
|
||||
local function OnShowFocus(frame)
|
||||
frame.obj.editBox:SetFocus()
|
||||
frame:SetScript("OnShow", nil)
|
||||
|
@ -257,8 +261,6 @@ local methods = {
|
|||
["SetCursorPosition"] = function(self, ...)
|
||||
return self.editBox:SetCursorPosition(...)
|
||||
end,
|
||||
|
||||
|
||||
}
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
|
@ -297,7 +299,7 @@ local function Constructor()
|
|||
text:SetPoint("BOTTOMRIGHT", button, "BOTTOMRIGHT", -5, 1)
|
||||
text:SetJustifyV("MIDDLE")
|
||||
|
||||
local scrollBG = CreateFrame("Frame", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local scrollBG = CreateFrame("Frame", nil, frame, "BackdropTemplate")
|
||||
scrollBG:SetBackdrop(backdrop)
|
||||
scrollBG:SetBackdropColor(0, 0, 0)
|
||||
scrollBG:SetBackdropBorderColor(0.4, 0.4, 0.4)
|
||||
|
@ -321,6 +323,7 @@ local function Constructor()
|
|||
scrollFrame:SetScript("OnReceiveDrag", OnReceiveDrag)
|
||||
scrollFrame:SetScript("OnSizeChanged", OnSizeChanged)
|
||||
scrollFrame:HookScript("OnVerticalScroll", OnVerticalScroll)
|
||||
scrollFrame:HookScript("OnScrollRangeChanged", OnScrollRangeChanged)
|
||||
|
||||
local editBox = CreateFrame("EditBox", ("%s%dEdit"):format(Type, widgetNum), scrollFrame)
|
||||
editBox:SetAllPoints()
|
||||
|
|
|
@ -14,10 +14,6 @@ local tonumber, pairs = tonumber, pairs
|
|||
local PlaySound = PlaySound
|
||||
local CreateFrame, UIParent = CreateFrame, UIParent
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GameFontHighlightSmall
|
||||
|
||||
--[[-----------------------------------------------------------------------------
|
||||
Support functions
|
||||
-------------------------------------------------------------------------------]]
|
||||
|
@ -31,13 +27,13 @@ local function UpdateText(self)
|
|||
end
|
||||
|
||||
local function UpdateLabels(self)
|
||||
local min, max = (self.min or 0), (self.max or 100)
|
||||
local min_value, max_value = (self.min or 0), (self.max or 100)
|
||||
if self.ispercent then
|
||||
self.lowtext:SetFormattedText("%s%%", (min * 100))
|
||||
self.hightext:SetFormattedText("%s%%", (max * 100))
|
||||
self.lowtext:SetFormattedText("%s%%", (min_value * 100))
|
||||
self.hightext:SetFormattedText("%s%%", (max_value * 100))
|
||||
else
|
||||
self.lowtext:SetText(min)
|
||||
self.hightext:SetText(max)
|
||||
self.lowtext:SetText(min_value)
|
||||
self.hightext:SetText(max_value)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -175,13 +171,13 @@ local methods = {
|
|||
self.label:SetText(text)
|
||||
end,
|
||||
|
||||
["SetSliderValues"] = function(self, min, max, step)
|
||||
["SetSliderValues"] = function(self, min_value, max_value, step)
|
||||
local frame = self.slider
|
||||
frame.setup = true
|
||||
self.min = min
|
||||
self.max = max
|
||||
self.min = min_value
|
||||
self.max = max_value
|
||||
self.step = step
|
||||
frame:SetMinMaxValues(min or 0,max or 100)
|
||||
frame:SetMinMaxValues(min_value or 0,max_value or 100)
|
||||
UpdateLabels(self)
|
||||
frame:SetValueStep(step or 1)
|
||||
if self.value then
|
||||
|
@ -225,7 +221,7 @@ local function Constructor()
|
|||
label:SetJustifyH("CENTER")
|
||||
label:SetHeight(15)
|
||||
|
||||
local slider = CreateFrame("Slider", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local slider = CreateFrame("Slider", nil, frame, "BackdropTemplate")
|
||||
slider:SetOrientation("HORIZONTAL")
|
||||
slider:SetHeight(15)
|
||||
slider:SetHitRectInsets(0, 0, -10, 0)
|
||||
|
@ -247,7 +243,7 @@ local function Constructor()
|
|||
local hightext = slider:CreateFontString(nil, "ARTWORK", "GameFontHighlightSmall")
|
||||
hightext:SetPoint("TOPRIGHT", slider, "BOTTOMRIGHT", -2, 3)
|
||||
|
||||
local editbox = CreateFrame("EditBox", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil)
|
||||
local editbox = CreateFrame("EditBox", nil, frame, "BackdropTemplate")
|
||||
editbox:SetAutoFocus(false)
|
||||
editbox:SetFontObject(GameFontHighlightSmall)
|
||||
editbox:SetPoint("TOP", slider, "BOTTOM")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
--- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings.
|
||||
-- @class file
|
||||
-- @name AceLocale-3.0
|
||||
-- @release $Id: AceLocale-3.0.lua 1035 2011-07-09 03:20:13Z kaelten $
|
||||
-- @release $Id: AceLocale-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
|
||||
local MAJOR,MINOR = "AceLocale-3.0", 6
|
||||
|
||||
local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
|
@ -12,10 +12,6 @@ if not AceLocale then return end -- no upgrade needed
|
|||
local assert, tostring, error = assert, tostring, error
|
||||
local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: GAME_LOCALE, geterrorhandler
|
||||
|
||||
local gameLocale = GetLocale()
|
||||
if gameLocale == "enGB" then
|
||||
gameLocale = "enUS"
|
||||
|
@ -93,7 +89,7 @@ local writedefaultproxy = setmetatable({}, {
|
|||
function AceLocale:NewLocale(application, locale, isDefault, silent)
|
||||
|
||||
-- GAME_LOCALE allows translators to test translations of addons without having that wow client installed
|
||||
local gameLocale = GAME_LOCALE or gameLocale
|
||||
local activeGameLocale = GAME_LOCALE or gameLocale
|
||||
|
||||
local app = AceLocale.apps[application]
|
||||
|
||||
|
@ -111,7 +107,7 @@ function AceLocale:NewLocale(application, locale, isDefault, silent)
|
|||
AceLocale.appnames[app] = application
|
||||
end
|
||||
|
||||
if locale ~= gameLocale and not isDefault then
|
||||
if locale ~= activeGameLocale and not isDefault then
|
||||
return -- nop, we don't need these translations
|
||||
end
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<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="AceLocale-3.0.lua"/>
|
||||
</Ui>
|
||||
</Ui>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
--[[ $Id: CallbackHandler-1.0.lua 1186 2018-07-21 14:19:18Z nevcairiel $ ]]
|
||||
local MAJOR, MINOR = "CallbackHandler-1.0", 7
|
||||
--[[ $Id: CallbackHandler-1.0.lua 26 2022-12-12 15:09:39Z nevcairiel $ ]]
|
||||
local MAJOR, MINOR = "CallbackHandler-1.0", 8
|
||||
local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
|
||||
if not CallbackHandler then return end -- No upgrade needed
|
||||
|
@ -7,26 +7,16 @@ if not CallbackHandler then return end -- No upgrade needed
|
|||
local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end}
|
||||
|
||||
-- Lua APIs
|
||||
local tconcat = table.concat
|
||||
local assert, error, loadstring = assert, error, loadstring
|
||||
local setmetatable, rawset, rawget = setmetatable, rawset, rawget
|
||||
local securecallfunction, error = securecallfunction, error
|
||||
local setmetatable, rawget = setmetatable, rawget
|
||||
local next, select, pairs, type, tostring = next, select, pairs, type, tostring
|
||||
|
||||
-- Global vars/functions that we don't upvalue since they might get hooked, or upgraded
|
||||
-- List them here for Mikk's FindGlobals script
|
||||
-- GLOBALS: geterrorhandler
|
||||
|
||||
local xpcall = xpcall
|
||||
|
||||
local function errorhandler(err)
|
||||
return geterrorhandler()(err)
|
||||
end
|
||||
|
||||
local function Dispatch(handlers, ...)
|
||||
local index, method = next(handlers)
|
||||
if not method then return end
|
||||
repeat
|
||||
xpcall(method, errorhandler, ...)
|
||||
securecallfunction(method, ...)
|
||||
index, method = next(handlers, index)
|
||||
until not method
|
||||
end
|
||||
|
@ -39,7 +29,7 @@ end
|
|||
-- UnregisterName - name of the callback unregistration API, default "UnregisterCallback"
|
||||
-- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API.
|
||||
|
||||
function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAllName)
|
||||
function CallbackHandler.New(_self, target, RegisterName, UnregisterName, UnregisterAllName)
|
||||
|
||||
RegisterName = RegisterName or "RegisterCallback"
|
||||
UnregisterName = UnregisterName or "UnregisterCallback"
|
||||
|
@ -67,13 +57,13 @@ function CallbackHandler:New(target, RegisterName, UnregisterName, UnregisterAll
|
|||
|
||||
if registry.insertQueue and oldrecurse==0 then
|
||||
-- Something in one of our callbacks wanted to register more callbacks; they got queued
|
||||
for eventname,callbacks in pairs(registry.insertQueue) do
|
||||
local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten.
|
||||
for self,func in pairs(callbacks) do
|
||||
events[eventname][self] = func
|
||||
for event,callbacks in pairs(registry.insertQueue) do
|
||||
local first = not rawget(events, event) or not next(events[event]) -- test for empty before. not test for one member after. that one member may have been overwritten.
|
||||
for object,func in pairs(callbacks) do
|
||||
events[event][object] = func
|
||||
-- fire OnUsed callback?
|
||||
if first and registry.OnUsed then
|
||||
registry.OnUsed(registry, target, eventname)
|
||||
registry.OnUsed(registry, target, event)
|
||||
first = nil
|
||||
end
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<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>
|
||||
</Ui>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
--@curseforge-project-slug: libdbicon-1-0@
|
||||
-----------------------------------------------------------------------
|
||||
-- LibDBIcon-1.0
|
||||
--
|
||||
|
@ -6,7 +6,7 @@
|
|||
--
|
||||
|
||||
local DBICON10 = "LibDBIcon-1.0"
|
||||
local DBICON10_MINOR = 44 -- Bump on changes
|
||||
local DBICON10_MINOR = 45 -- Bump on changes
|
||||
if not LibStub then error(DBICON10 .. " requires LibStub.") end
|
||||
local ldb = LibStub("LibDataBroker-1.1", true)
|
||||
if not ldb then error(DBICON10 .. " requires LibDataBroker-1.1.") end
|
||||
|
@ -218,37 +218,49 @@ local function createButton(name, object, db)
|
|||
button.dataObject = object
|
||||
button.db = db
|
||||
button:SetFrameStrata("MEDIUM")
|
||||
if button.SetFixedFrameStrata then -- Classic support
|
||||
button:SetFixedFrameStrata(true)
|
||||
end
|
||||
button:SetFixedFrameStrata(true)
|
||||
button:SetFrameLevel(8)
|
||||
if button.SetFixedFrameLevel then -- Classic support
|
||||
button:SetFixedFrameLevel(true)
|
||||
end
|
||||
button:SetFixedFrameLevel(true)
|
||||
button:SetSize(31, 31)
|
||||
button:RegisterForClicks("anyUp")
|
||||
button:RegisterForDrag("LeftButton")
|
||||
button:SetHighlightTexture(136477) --"Interface\\Minimap\\UI-Minimap-ZoomButton-Highlight"
|
||||
local overlay = button:CreateTexture(nil, "OVERLAY")
|
||||
overlay:SetSize(53, 53)
|
||||
overlay:SetTexture(136430) --"Interface\\Minimap\\MiniMap-TrackingBorder"
|
||||
overlay:SetPoint("TOPLEFT")
|
||||
local background = button:CreateTexture(nil, "BACKGROUND")
|
||||
background:SetSize(20, 20)
|
||||
background:SetTexture(136467) --"Interface\\Minimap\\UI-Minimap-Background"
|
||||
background:SetPoint("TOPLEFT", 7, -5)
|
||||
local icon = button:CreateTexture(nil, "ARTWORK")
|
||||
icon:SetSize(17, 17)
|
||||
icon:SetTexture(object.icon)
|
||||
icon:SetPoint("TOPLEFT", 7, -6)
|
||||
button.icon = icon
|
||||
if WOW_PROJECT_ID == WOW_PROJECT_MAINLINE then
|
||||
local overlay = button:CreateTexture(nil, "OVERLAY")
|
||||
overlay:SetSize(50, 50)
|
||||
overlay:SetTexture(136430) --"Interface\\Minimap\\MiniMap-TrackingBorder"
|
||||
overlay:SetPoint("TOPLEFT", button, "TOPLEFT", 0, 0)
|
||||
local background = button:CreateTexture(nil, "BACKGROUND")
|
||||
background:SetSize(24, 24)
|
||||
background:SetTexture(136467) --"Interface\\Minimap\\UI-Minimap-Background"
|
||||
background:SetPoint("CENTER", button, "CENTER", 0, 1)
|
||||
local icon = button:CreateTexture(nil, "ARTWORK")
|
||||
icon:SetSize(18, 18)
|
||||
icon:SetTexture(object.icon)
|
||||
icon:SetPoint("CENTER", button, "CENTER", 0, 1)
|
||||
button.icon = icon
|
||||
else
|
||||
local overlay = button:CreateTexture(nil, "OVERLAY")
|
||||
overlay:SetSize(53, 53)
|
||||
overlay:SetTexture(136430) --"Interface\\Minimap\\MiniMap-TrackingBorder"
|
||||
overlay:SetPoint("TOPLEFT")
|
||||
local background = button:CreateTexture(nil, "BACKGROUND")
|
||||
background:SetSize(20, 20)
|
||||
background:SetTexture(136467) --"Interface\\Minimap\\UI-Minimap-Background"
|
||||
background:SetPoint("TOPLEFT", 7, -5)
|
||||
local icon = button:CreateTexture(nil, "ARTWORK")
|
||||
icon:SetSize(17, 17)
|
||||
icon:SetTexture(object.icon)
|
||||
icon:SetPoint("TOPLEFT", 7, -6)
|
||||
button.icon = icon
|
||||
end
|
||||
|
||||
button.isMouseDown = false
|
||||
local r, g, b = button.icon:GetVertexColor()
|
||||
button.icon:SetVertexColor(object.iconR or r, object.iconG or g, object.iconB or b)
|
||||
|
||||
local r, g, b = icon:GetVertexColor()
|
||||
icon:SetVertexColor(object.iconR or r, object.iconG or g, object.iconB or b)
|
||||
|
||||
icon.UpdateCoord = updateCoord
|
||||
icon:UpdateCoord()
|
||||
button.icon.UpdateCoord = updateCoord
|
||||
button.icon:UpdateCoord()
|
||||
|
||||
button:SetScript("OnEnter", onEnter)
|
||||
button:SetScript("OnLeave", onLeave)
|
||||
|
|
|
@ -7,24 +7,24 @@ if not LibStub or LibStub.minor < LIBSTUB_MINOR then
|
|||
LibStub = LibStub or {libs = {}, minors = {} }
|
||||
_G[LIBSTUB_MAJOR] = LibStub
|
||||
LibStub.minor = LIBSTUB_MINOR
|
||||
|
||||
|
||||
function LibStub:NewLibrary(major, minor)
|
||||
assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
|
||||
minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
|
||||
|
||||
minor = assert(tonumber(string.match(minor, "%d+")), "Minor version must either be a number or contain a number.")
|
||||
|
||||
local oldminor = self.minors[major]
|
||||
if oldminor and oldminor >= minor then return nil end
|
||||
self.minors[major], self.libs[major] = minor, self.libs[major] or {}
|
||||
return self.libs[major], oldminor
|
||||
end
|
||||
|
||||
|
||||
function LibStub:GetLibrary(major, silent)
|
||||
if not self.libs[major] and not silent then
|
||||
error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
|
||||
end
|
||||
return self.libs[major], self.minors[major]
|
||||
end
|
||||
|
||||
|
||||
function LibStub:IterateLibraries() return pairs(self.libs) end
|
||||
setmetatable(LibStub, { __call = LibStub.GetLibrary })
|
||||
end
|
||||
|
|
|
@ -1,64 +1,167 @@
|
|||
local lib, oldminor = LibStub:NewLibrary("zzAddOn", 2)
|
||||
local lib = LibStub:NewLibrary("zzAddOn", 12)
|
||||
if not lib then return end
|
||||
oldminor = oldminor or 0
|
||||
local config = LibStub:GetLibrary("zzConfig")
|
||||
lib['callbacks'] = lib['callbacks'] or LibStub:GetLibrary("CallbackHandler-1.0"):New(lib)
|
||||
lib['addons'] = lib['addons'] or {}
|
||||
lib['managerframe'] = lib['managerframe'] or CreateFrame("FRAME")
|
||||
lib['events'] = lib['events'] or CreateFrame("FRAME")
|
||||
local mixins = {'RegisterEvent','UnregisterEvent','IsClassic', 'GetSpecs'}
|
||||
local events = lib['events']
|
||||
local function errormsg(err)
|
||||
print(format("|cffff0000Error:|r %s",err))
|
||||
end
|
||||
local mixins = {'NewAddOn', 'GetAddOn', 'AddChild', 'HasChild', 'IsChild', 'HasParent', 'GetParent', 'GetOptions', 'RegisterEvent','UnregisterEvent','IsClassic','IsBCC','IsRetail', 'GetSpecs', 'Fire', 'RegisterOpen', 'RegisterClose'}
|
||||
function lib:Fire(...)
|
||||
lib['callbacks']:Fire(...)
|
||||
end
|
||||
function lib:GetAddOn(childName)
|
||||
return lib['addons'][childName]
|
||||
end
|
||||
function lib:GetOptions()
|
||||
return self['options']
|
||||
end
|
||||
function lib:GetParent()
|
||||
return self['parent']
|
||||
end
|
||||
function lib:HasParent()
|
||||
return self['parent'] and true or false
|
||||
end
|
||||
function lib:IsChild()
|
||||
return self:HasParent()
|
||||
end
|
||||
function lib:HasChild()
|
||||
return self['children'] and #self['children'] > 0
|
||||
end
|
||||
function lib:GetSpecs(childName)
|
||||
if(self['specs']) then
|
||||
return self['specs'][childName]
|
||||
return lib['addons'][childName]['specs']
|
||||
end
|
||||
local function joinTables(tab1, tab2, prefix)
|
||||
prefix = prefix or ''
|
||||
for k, v in pairs(tab2) do
|
||||
if(tab1[k] and type(v) == 'table') then
|
||||
joinTables(tab1[k], v, format("%s ", prefix))
|
||||
else
|
||||
tab1[k] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
function lib:RegisterEvent(event)
|
||||
local function childExists(parent, child)
|
||||
if(parent['children']) then
|
||||
for i = 1, #parent['children'] do
|
||||
if(parent['children'][i]['specs']['name'] == child['specs']['name']) then return true end
|
||||
end
|
||||
end
|
||||
end
|
||||
function lib:AddChild(parentName, child)
|
||||
local parent = self:GetAddOn(parentName)
|
||||
if(parent) then
|
||||
parent['children'] = parent['children'] or {}
|
||||
if(childExists(parent, child)) then return end
|
||||
child['parent'] = parent
|
||||
parent['children'][#parent['children'] + 1] = child
|
||||
if(child['specs']['defaults']) then
|
||||
joinTables(parent['specs']['defaults'], child['specs']['defaults'])
|
||||
end
|
||||
end
|
||||
end
|
||||
function lib:RegisterEvent(event, globalfunc)
|
||||
if(type(event) == 'table') then
|
||||
for ev, func in pairs(event) do
|
||||
-- print("[zza] Registertab CB", type(ev),ev)
|
||||
for k, v in pairs(event) do
|
||||
local ev = k
|
||||
local func = v
|
||||
if(type(v) == 'string') then
|
||||
ev = v
|
||||
func = globalfunc
|
||||
end
|
||||
if(type(ev) == 'string' and type(func) == 'function' and not self['events'][ev]) then
|
||||
self['events'][ev] = func
|
||||
end
|
||||
self:RegisterEvent(ev)
|
||||
self:RegisterEvent(ev, func)
|
||||
end
|
||||
elseif(type(event) == 'string') then
|
||||
-- print("[zza] Register CB", type(event),event)
|
||||
if(not lib['events']:IsEventRegistered(event)) then
|
||||
lib['events']:RegisterEvent(event)
|
||||
end
|
||||
lib['RegisterCallback'](self['events'], event)
|
||||
lib.RegisterCallback(self, event, globalfunc)
|
||||
else
|
||||
print("ign reg", type(event), event)
|
||||
errormsg("ign reg", type(event), event)
|
||||
end
|
||||
end
|
||||
function lib:UnregisterEvent(event)
|
||||
if(type(event) == 'table') then
|
||||
for key, ev in pairs(event) do
|
||||
for k, v in pairs(event) do
|
||||
local ev = type(v) == 'string' and v or k
|
||||
self:UnregisterEvent(ev)
|
||||
end
|
||||
else
|
||||
lib['UnregisterCallback'](self['events'], event)
|
||||
lib['UnregisterCallback'](self, event)
|
||||
end
|
||||
end
|
||||
function lib:IsBCC()
|
||||
return WOW_PROJECT_ID == WOW_PROJECT_BURNING_CRUSADE_CLASSIC
|
||||
end
|
||||
function lib:IsClassic()
|
||||
return WOW_PROJECT_ID == WOW_PROJECT_CLASSIC
|
||||
end
|
||||
function lib:NewAddOn(specs, addonName, addonTable)
|
||||
function lib:IsRetail()
|
||||
return WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
|
||||
end
|
||||
local function handleManagerFrame(self, event, num)
|
||||
if(event == "PLAYER_INTERACTION_MANAGER_FRAME_SHOW") then
|
||||
lib['callbacks']:Fire(format("show-%i", num))
|
||||
else
|
||||
lib['callbacks']:Fire(format("hide-%i", num))
|
||||
end
|
||||
end
|
||||
local function addManagerFrame(self, mode, num, globalfunc)
|
||||
if(type(num) == 'table') then
|
||||
for k, v in pairs(num) do
|
||||
local n = k
|
||||
local func = v
|
||||
if(type(v) == 'number') then
|
||||
n = v
|
||||
func = globalfunc
|
||||
end
|
||||
addManagerFrame(self, mode, n, func)
|
||||
end
|
||||
elseif(type(num) == 'number') then
|
||||
lib.RegisterCallback(self, format("%s-%i", mode, num), globalfunc)
|
||||
end
|
||||
end
|
||||
function lib:RegisterOpen(num, func)
|
||||
if(not num) then return end
|
||||
if(not lib['managerframe']:IsEventRegistered("PLAYER_INTERACTION_MANAGER_FRAME_SHOW")) then
|
||||
lib['managerframe']:RegisterEvent("PLAYER_INTERACTION_MANAGER_FRAME_SHOW")
|
||||
lib['managerframe']:SetScript("OnEvent", handleManagerFrame)
|
||||
end
|
||||
addManagerFrame(self, 'show', num, func)
|
||||
end
|
||||
function lib:RegisterClose(num, func)
|
||||
if(not num) then return end
|
||||
if(not lib['managerframe']:IsEventRegistered("PLAYER_INTERACTION_MANAGER_FRAME_HIDE")) then
|
||||
lib['managerframe']:RegisterEvent("PLAYER_INTERACTION_MANAGER_FRAME_HIDE")
|
||||
lib['managerframe']:SetScript("OnEvent", handleManagerFrame)
|
||||
end
|
||||
addManagerFrame(self, 'hide', num, func)
|
||||
end
|
||||
function lib:NewAddOn(addonName, addonTable)
|
||||
local specs = self['specs']
|
||||
local childName = specs['name']
|
||||
addonTable['parentName'] = addonName
|
||||
addonTable['specs'] = addonTable['specs'] or {}
|
||||
addonTable['specs'][childName] = specs
|
||||
if(type(childName) == 'string') then
|
||||
lib['addons'][childName] = addonTable
|
||||
lib:Embed(addonTable)
|
||||
if(addonTable['events']) then
|
||||
for ev, func in pairs(addonTable['events']) do
|
||||
self.GetAddOnTable = function() return addonTable end
|
||||
lib['addons'][childName] = self
|
||||
local child = lib['addons'][childName]
|
||||
lib:Embed(self)
|
||||
if(childName ~= addonName) then
|
||||
local parent = lib['addons'][addonName]
|
||||
parent:AddChild(parent['specs']['name'], self)
|
||||
end
|
||||
if(self['events']) then
|
||||
for ev, func in pairs(self['events']) do
|
||||
if(type(func) == 'function') then
|
||||
-- print("[zza] Register", ev)
|
||||
addonTable:RegisterEvent(ev)
|
||||
self:RegisterEvent(ev, func)
|
||||
end
|
||||
end
|
||||
end
|
||||
return lib['addons'][childName]
|
||||
return self
|
||||
end
|
||||
end
|
||||
function lib:Embed(target)
|
||||
|
@ -66,35 +169,61 @@ function lib:Embed(target)
|
|||
target[name] = lib[name]
|
||||
end
|
||||
end
|
||||
for target, _ in pairs(lib['addons']) do
|
||||
for _, target in pairs(lib['addons']) do
|
||||
lib:Embed(target)
|
||||
end
|
||||
lib['events']:RegisterEvent('ADDON_LOADED')
|
||||
lib['events']:SetScript("OnEvent", function(self, event, ...)
|
||||
-- print("[zza]", self, event, ...)
|
||||
local addonName = ...
|
||||
local addon = lib['addons'][addonName]
|
||||
if(addon) then
|
||||
if(event == 'ADDON_LOADED') then
|
||||
local specs = addon:GetSpecs(addonName)
|
||||
if(specs and specs['sv'] and not addon['db']) then
|
||||
-- print('dbname',type(specs['sv']),type(specs['sv']) == 'boolean' and addonName or specs['sv'])
|
||||
local dbname = format('%sDB', type(specs['sv']) == 'boolean' and addonName or specs['sv'])
|
||||
addon['db'] = LibStub("AceDB-3.0"):New(dbname, type(specs['defaults']) == 'table' and specs['defaults'] or {}, 'Default')
|
||||
if(specs['ldb']) then
|
||||
local ldbobj = LibStub:GetLibrary("zzLDB"):AddLDB(specs['name'], specs['ldb'], addon['db'])
|
||||
end
|
||||
if(specs['cfg']) then
|
||||
local config = LibStub:GetLibrary("zzConfig")
|
||||
addon['options'] = config:InitConfig(addon, addonName)
|
||||
addon['options']['args']['profile'] = LibStub("AceDBOptions-3.0"):GetOptionsTable(addon['db'])
|
||||
if(type(specs['cfgReset']) == 'function') then
|
||||
addon['db'].RegisterCallback(specs, "OnProfileReset", 'cfgReset')
|
||||
end
|
||||
local function addLDB(...)
|
||||
return LibStub:GetLibrary("zzLDB"):AddLDB(...)
|
||||
end
|
||||
local function addConfig(addonName, child, specs)
|
||||
local at = child:GetAddOnTable()
|
||||
if(addonName == child['specs']['name']) then
|
||||
config:InitConfig(child, addonName)
|
||||
child['options']['args']['profile'] = LibStub("AceDBOptions-3.0"):GetOptionsTable(at['db'])
|
||||
else
|
||||
config:AddConfig(child, addonName)
|
||||
end
|
||||
if(type(specs['cfgReset']) == 'function') then
|
||||
specs['cfgReset'](child)
|
||||
at['db'].RegisterCallback(specs, "OnProfileReset", 'cfgReset')
|
||||
end
|
||||
end
|
||||
local function SetupSpecs(addonName, child)
|
||||
local specs = child['specs']
|
||||
if(specs and specs['sv'] and not child['db']) then
|
||||
local dbname = format('%sDB', type(specs['sv']) == 'boolean' and addonName or specs['sv'])
|
||||
local at = child:GetAddOnTable()
|
||||
at['db'] = LibStub("AceDB-3.0"):New(dbname, type(specs['defaults']) == 'table' and specs['defaults'] or {}, 'Default')
|
||||
if(specs['ldb']) then
|
||||
addLDB(specs['name'], specs['ldb'], at['db'])
|
||||
end
|
||||
if(specs['cfg']) then
|
||||
addConfig(addonName, child, specs)
|
||||
end
|
||||
if(child:HasChild()) then
|
||||
for i = 1, #child['children'] do
|
||||
local child = child['children'][i]
|
||||
|
||||
local childSpecs = child['specs']
|
||||
if(childSpecs['ldb']) then
|
||||
addLDB(childSpecs['name'], childSpecs['ldb'], at['db'])
|
||||
end
|
||||
if(childSpecs['cfg']) then
|
||||
addConfig(addonName, child, childSpecs)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
lib['events']:SetScript("OnEvent", function(self, event, ...)
|
||||
local addonName = ...
|
||||
local child = lib['addons'][addonName]
|
||||
if(child) then
|
||||
if(event == 'ADDON_LOADED') then
|
||||
SetupSpecs(addonName, child)
|
||||
end
|
||||
end
|
||||
-- print("[zza] Fire", event, ...)
|
||||
lib['callbacks']:Fire(event, ...)
|
||||
lib['callbacks']:Fire(event, self, event, ...)
|
||||
end)
|
|
@ -1,22 +1,23 @@
|
|||
local lib = LibStub:NewLibrary("zzConfig", 3)
|
||||
local lib = LibStub:NewLibrary("zzConfig", 6)
|
||||
if not lib then return end
|
||||
local ldb = LibStub:GetLibrary("LibDataBroker-1.1")
|
||||
local ldbicon = LibStub:GetLibrary("LibDBIcon-1.0")
|
||||
local mixins = {'AddConfigMenu','AddConfigEntry','InitConfig', 'GetDefaultHandler'}
|
||||
local mixins = {'AddConfigMenu', 'AddConfigEntry', 'InitConfig', 'GetDefaultHandler'}
|
||||
lib['configs'] = lib['configs'] or {}
|
||||
local function getDB(objname)
|
||||
if(ldbicon) then
|
||||
ldbicon:Show(objname)
|
||||
local iconbtn = ldbicon:GetMinimapButton(objname)
|
||||
local db = iconbtn['db']
|
||||
if(db['hide']) then
|
||||
ldbicon:Hide(objname)
|
||||
if(iconbtn) then
|
||||
local db = iconbtn['db']
|
||||
if(db['hide']) then
|
||||
ldbicon:Hide(objname)
|
||||
end
|
||||
return db
|
||||
else
|
||||
-- print("noicon", objname)
|
||||
end
|
||||
return db
|
||||
end
|
||||
end
|
||||
local function ldbiconUpdate(objname)
|
||||
local db = getDB(objname)
|
||||
return {}
|
||||
end
|
||||
local function minimapGet(pref)
|
||||
local objname = pref[#pref - 2]
|
||||
|
@ -27,7 +28,6 @@ local function minimapSet(pref,value)
|
|||
local objname = pref[#pref - 2]
|
||||
local db = getDB(objname)
|
||||
db[pref[#pref]] = value
|
||||
ldbiconUpdate(objname)
|
||||
end
|
||||
local function notify(pref, value, oldvalue)
|
||||
if(type(pref['handler'].PrefChanged) == 'function') then
|
||||
|
@ -38,14 +38,16 @@ local function getPref(pref)
|
|||
if(type(pref['handler']['GetPref']) == 'function') then
|
||||
return pref['handler']:GetPref(pref)
|
||||
end
|
||||
return pref['handler']['db']['profile'][pref[#pref-1]] and pref['handler']['db']['profile'][pref[#pref-1]][pref[#pref]] or nil
|
||||
local db = pref['handler']['db'] or pref['handler']:GetAddOnTable()['db']['profile'][pref['appName']]
|
||||
return db and db[pref[#pref]]
|
||||
end
|
||||
local function setPref(pref,value)
|
||||
local function setPref(pref, value, ...)
|
||||
if(type(pref['handler']['SetPref']) == 'function') then
|
||||
pref['handler']:SetPref(pref,value)
|
||||
pref['handler']:SetPref(pref, value, ...)
|
||||
else
|
||||
local oldvalue = pref['handler']['db']['profile'][pref[#pref-1]][pref[#pref]]
|
||||
pref['handler']['db']['profile'][pref[#pref-1]][pref[#pref]] = value
|
||||
local db = pref['handler']['db'] or pref['handler']:GetAddonTable()['db']['profile'][pref[#pref-1]]
|
||||
local oldvalue = db[pref[#pref]]
|
||||
db[pref[#pref]] = value
|
||||
if(value ~= oldvalue) then
|
||||
notify(pref, value, oldvalue)
|
||||
end
|
||||
|
@ -134,6 +136,7 @@ function lib:AddConfigMenu(options, parentName, order, handler, more)
|
|||
['name'] = parentName,
|
||||
['type'] = 'group',
|
||||
['handler'] = handler or self['handler'],
|
||||
['childGroups'] = 'tab',
|
||||
['order'] = order or 1,
|
||||
['args'] = {}
|
||||
}
|
||||
|
@ -145,22 +148,47 @@ function lib:AddConfigMenu(options, parentName, order, handler, more)
|
|||
options['args'][parentName] = menu
|
||||
return options['args'][parentName]
|
||||
end
|
||||
function lib:InitConfig(addon, parentName, gp, sp)
|
||||
addon['options'] = {
|
||||
['type']='group',
|
||||
['handler']=addon,
|
||||
['get']=gp or getPref,
|
||||
['set']=sp or setPref,
|
||||
['childGroups']='tab',
|
||||
['args']={}
|
||||
lib.AddedToBlizz = lib.AddedToBlizz or {}
|
||||
local function addToBlizz(pName, cName)
|
||||
if(not lib['AddedToBlizz'][pName]) then
|
||||
lib['AddedToBlizz'][pName] = true
|
||||
LibStub("AceConfigDialog-3.0"):AddToBlizOptions(pName, pName, cName)
|
||||
end
|
||||
end
|
||||
function lib:InitConfig(child, parentName, gp, sp)
|
||||
child['options'] = {
|
||||
['name'] = parentName,
|
||||
['type'] = 'group',
|
||||
['handler'] = child,
|
||||
['childGroups'] = 'tab',
|
||||
['get'] = gp or getPref,
|
||||
['set'] = sp or setPref,
|
||||
['args'] = {}
|
||||
}
|
||||
local options = addon['options']
|
||||
local options = child['options']
|
||||
local par = self:AddConfigMenu(options, parentName)
|
||||
self:AddLDBIconOptions(par, 'minimap')
|
||||
LibStub("AceConfig-3.0"):RegisterOptionsTable(parentName, options)
|
||||
LibStub("AceConfigDialog-3.0"):AddToBlizOptions(parentName, parentName, self['parentName'])
|
||||
addToBlizz(parentName, child['parentName'])
|
||||
return options
|
||||
end
|
||||
function lib:AddConfig(child, parentName, gp, sp)
|
||||
local specs = child['specs']
|
||||
child['options'] = {
|
||||
['name'] = specs['name'],
|
||||
['type'] = 'group',
|
||||
['handler'] = child,
|
||||
['childGroups']='tab',
|
||||
['get']=gp or getPref,
|
||||
['set']=sp or setPref,
|
||||
['args'] = {}
|
||||
}
|
||||
local par = self:AddConfigMenu(child['options'], specs['name'])
|
||||
self:AddLDBIconOptions(par, 'minimap')
|
||||
LibStub("AceConfig-3.0"):RegisterOptionsTable(specs['name'], child['options'])
|
||||
addToBlizz(specs['name'], parentName)
|
||||
return child['options']
|
||||
end
|
||||
function lib:Embed(target)
|
||||
for _,name in pairs(mixins) do
|
||||
target[name] = lib[name]
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local lib = LibStub:NewLibrary("zzHelper", 2)
|
||||
local lib = LibStub:NewLibrary("zzHelper", 4)
|
||||
if not lib then return end
|
||||
lib['targets'] = lib['targets'] or {}
|
||||
local mixins = {'colorize', 'round', 'sortArray', 'IsTwink', 'classcolor', 'MoneyString', 'MoneyStringSetString', 'MoneyStringSetSize'}
|
||||
|
@ -34,7 +34,7 @@ function lib:MoneyStringSetSize(size)
|
|||
iconSize = size
|
||||
end
|
||||
end
|
||||
function lib:MoneyString(money, color, abrevK, abrevM, noicon, noiconcolor, size)
|
||||
function lib:MoneyString(money, color, abrevK, abrevM, noicon, noiconcolor, size, seperate)
|
||||
local iconSize = size or iconSize
|
||||
local goldicon = noicon and (noiconcolor and moneyText['goldColor'] or moneyText['gold']) or format(iconbase, 'Gold', iconSize, iconSize)
|
||||
local silvericon = noicon and (noiconcolor and moneyText['silverColor'] or moneyText['silver']) or format(iconbase, 'Silver', iconSize, iconSize)
|
||||
|
@ -66,6 +66,9 @@ function lib:MoneyString(money, color, abrevK, abrevM, noicon, noiconcolor, size
|
|||
end
|
||||
if(money > 0) then
|
||||
if(g>0) then
|
||||
if(seperate) then
|
||||
g = BreakUpLargeNumbers(g)
|
||||
end
|
||||
moneystring = format("%s%s%s", color and lib:colorize(g, neg and "ff0000" or "44dd44") or g,abrev, goldicon)
|
||||
end
|
||||
if(s>0) then
|
||||
|
@ -95,13 +98,13 @@ end
|
|||
*** Arrayfunctions ***
|
||||
]]
|
||||
|
||||
function lib:sortArray(tmp,dir)
|
||||
function lib:sortArray(tmp, dir)
|
||||
local newtmp = {}
|
||||
local n = 1
|
||||
local cnt = 0
|
||||
local maximum = 0
|
||||
local first
|
||||
for k,v in pairs(tmp) do
|
||||
for k, v in pairs(tmp) do
|
||||
cnt = cnt + 1
|
||||
if(v > maximum) then
|
||||
maximum = v + 1
|
||||
|
@ -109,15 +112,15 @@ function lib:sortArray(tmp,dir)
|
|||
first = first or k
|
||||
end
|
||||
while(cnt > 0) do
|
||||
local mx, mn = dir and maximum or 0,first
|
||||
for k,v in pairs(tmp) do
|
||||
local mx, mn = dir and maximum or 0, first
|
||||
for k, v in pairs(tmp) do
|
||||
if(dir) then
|
||||
if(tonumber(v)<=tonumber(mx)) then
|
||||
if(tonumber(v) <= tonumber(mx)) then
|
||||
mx = v
|
||||
mn = k
|
||||
end
|
||||
else
|
||||
if(tonumber(v)>=tonumber(mx)) then
|
||||
if(tonumber(v) >= tonumber(mx)) then
|
||||
mx = v
|
||||
mn = k
|
||||
end
|
||||
|
@ -126,7 +129,7 @@ function lib:sortArray(tmp,dir)
|
|||
newtmp[n] = mn
|
||||
tmp[mn] = nil
|
||||
cnt = 0
|
||||
for k,v in pairs(tmp) do
|
||||
for _ in pairs(tmp) do
|
||||
cnt = cnt + 1
|
||||
end
|
||||
n = n + 1
|
||||
|
@ -141,11 +144,13 @@ end
|
|||
]]
|
||||
|
||||
function lib:IsTwink(name)
|
||||
local at = self:GetAddOnTable()
|
||||
local db = at['db']
|
||||
local realm = GetRealmName()
|
||||
local _
|
||||
if(self['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(self['db']['sv']['profileKeys']) do
|
||||
local n,m = strsplit(" - ",k,2)
|
||||
if(db['sv']['profileKeys']) then
|
||||
for k, _ in pairs(db['sv']['profileKeys']) do
|
||||
local n, m = strsplit(" - ", k, 2)
|
||||
_,m = strsplit(" ",m,2)
|
||||
if(n) then
|
||||
if(n == name and m == realm) then
|
||||
|
|
|
@ -1,15 +1,51 @@
|
|||
local lib, oldminor = LibStub:NewLibrary("zzLDB", 3)
|
||||
local lib = LibStub:NewLibrary("zzLDB", 6)
|
||||
if not lib then return end
|
||||
local ldb = LibStub:GetLibrary("LibDataBroker-1.1")
|
||||
local ldbicon = LibStub:GetLibrary("LibDBIcon-1.0")
|
||||
oldminor = oldminor or 0
|
||||
local mixins = {'AddLDB', 'GetLDB'}
|
||||
local mixins = {'AddLDB', 'GetLDB', 'DefaultOnClick', 'DefaultOnText'}
|
||||
local defaults = {
|
||||
['hide'] = false,
|
||||
}
|
||||
lib['ldbs'] = lib['ldbs'] or {}
|
||||
local function proto_OnClick(self, button)
|
||||
print("onclick required", self, button)
|
||||
-- print("onclick required", self, button)
|
||||
end
|
||||
function lib:DefaultOnClick(_, button, addon, childName)
|
||||
if(IsShiftKeyDown() and button == "LeftButton") then
|
||||
local sb = addon['db']['global']['ldbicons']
|
||||
sb[childName]['hide'] = not sb[childName]['hide']
|
||||
if(ldbicon) then
|
||||
if(sb[childName]['hide']) then
|
||||
ldbicon:Hide(childName)
|
||||
else
|
||||
ldbicon:Show(childName)
|
||||
end
|
||||
end
|
||||
else
|
||||
if(not InCombatLockdown()) then
|
||||
if(SettingsPanel) then
|
||||
if(SettingsPanel:IsVisible()) then
|
||||
HideUIPanel(SettingsPanel)
|
||||
HideUIPanel(GameMenuFrame)
|
||||
else
|
||||
Settings.OpenToCategory(childName)
|
||||
end
|
||||
elseif(InterfaceOptionsFrame) then
|
||||
if(InterfaceOptionsFrame:IsVisible()) then
|
||||
InterfaceOptionsFrame:Hide()
|
||||
else
|
||||
InterfaceOptionsFrame_OpenToCategory(childName)
|
||||
InterfaceOptionsFrame_OpenToCategory(childName) -- Twice because of a bug in InterfaceOptionsFrame_OpenToCategory
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
function lib:DefaultOnText(objname, message)
|
||||
local ldbobj = lib:GetLDB(objname)
|
||||
if(ldbobj['text'] ~= message) then
|
||||
ldbobj['text'] = message
|
||||
end
|
||||
end
|
||||
function lib:GetLDB(objname)
|
||||
return ldb:GetDataObjectByName(objname)
|
||||
|
@ -28,7 +64,10 @@ function lib:AddLDB(objname, obj, db)
|
|||
db['global']['ldbicons'] = db['global']['ldbicons'] or {}
|
||||
local sb = db['global']['ldbicons']
|
||||
sb[objname] = sb[objname] or CopyTable(defaults)
|
||||
local oldstatus = sb[objname]['hide']
|
||||
sb[objname]['hide'] = false
|
||||
ldbicon:Register(objname, ldbobj, sb[objname])
|
||||
sb[objname]['hide'] = oldstatus
|
||||
end
|
||||
return ldbobj
|
||||
end
|
||||
|
|
|
@ -1,17 +1,8 @@
|
|||
local addonName, addonTable = ...
|
||||
addonTable['events'] = addonTable['events'] or {}
|
||||
local addonName, addon = ...
|
||||
local childName = addon['childName']
|
||||
local child = addon[childName]
|
||||
local db, mailSum, mailRec, player, dbb, dbr, dbf, L, faction, realm
|
||||
local events = addonTable['events']
|
||||
function addonTable:SetupBanker()
|
||||
player = UnitName('player')
|
||||
L = addonTable['storage']['L']
|
||||
db = addonTable['storage']['db']
|
||||
dbr = addonTable['storage']['dbr']
|
||||
dbf = addonTable['storage']['dbf']
|
||||
dbb = dbf['banker']
|
||||
faction = addonTable['storage']['faction']
|
||||
realm = addonTable['storage']['realm']
|
||||
end
|
||||
local events = child['events']
|
||||
local mailframes = {}
|
||||
local posFrame = CreateFrame("Frame")
|
||||
posFrame:SetSize(32,1)
|
||||
|
@ -35,10 +26,11 @@ local lastframe = posFrame
|
|||
local function GetFactionList()
|
||||
local n,m,_
|
||||
local l = {}
|
||||
if(addonTable['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addonTable['db']['sv']['profileKeys']) do
|
||||
if(addon['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addon['db']['sv']['profileKeys']) do
|
||||
n,_,m = strsplit(' ',k,3)
|
||||
if(n) then
|
||||
m = string.gsub(m, "%s+", "")
|
||||
if(m == realm) then
|
||||
if(faction == dbr[n]['faction']) then
|
||||
l[n] = true
|
||||
|
@ -71,7 +63,7 @@ local function getDeliver(name)
|
|||
end
|
||||
local function Click(self,button)
|
||||
local sendSum = getDeliver(self['destName'])
|
||||
if(addonTable:IsTwink(self['destName']) and self['destName']~=player) then
|
||||
if(child:IsTwink(self['destName']) and self['destName']~=player) then
|
||||
if(sendSum>0) then
|
||||
if(SetSendMailMoney(sendSum)) then
|
||||
posFrame:RegisterEvent('MAIL_SEND_SUCCESS')
|
||||
|
@ -83,7 +75,6 @@ local function Click(self,button)
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
local function Mouse(self)
|
||||
local tip = GameTooltip
|
||||
tip:SetOwner(self, "ANCHOR_BOTTOM")
|
||||
|
@ -161,3 +152,16 @@ end
|
|||
function events:MAIL_SHOW()
|
||||
buildMailFrames()
|
||||
end
|
||||
local init = {
|
||||
Setup = function(self)
|
||||
player = UnitName('player')
|
||||
L = child['storage']['L']
|
||||
db = child['storage']['db']
|
||||
dbr = child['storage']['dbr']
|
||||
dbf = child['storage']['dbf']
|
||||
dbb = dbf['banker']
|
||||
faction = child['storage']['faction']
|
||||
realm = child['storage']['realm']
|
||||
end
|
||||
}
|
||||
addon.RegisterCallback(init, format("Init%s", childName), 'Setup')
|
|
@ -1,29 +1,18 @@
|
|||
local addonName, addonTable = ...
|
||||
local childName = "zz_Money"
|
||||
local addonName, addon = ...
|
||||
local childName = addon['childName']
|
||||
local child = addon[childName]
|
||||
local db, dbr, dbp, L, lineIn, lineOut, session, faction, realm
|
||||
local ldbicon = LibStub:GetLibrary("LibDBIcon-1.0")
|
||||
function addonTable:SetupBroker()
|
||||
L = addonTable['storage']['L']
|
||||
db = addonTable['storage']['db']
|
||||
dbr = addonTable['storage']['dbr']
|
||||
dbp = addonTable['storage']['dbp']
|
||||
session = addonTable['storage']['session']
|
||||
faction = addonTable['storage']['faction']
|
||||
realm = addonTable['storage']['realm']
|
||||
local folder = addonName ~= childName and format("Interface\\AddOns\\%s\\%s", addonName, childName) or format("Interface\\AddOns\\%s", childName)
|
||||
lineIn = format("|T%s:0|t %s", format("%s\\in.tga", folder), L['Einnahmen'])
|
||||
lineOut = format("|T%s:0|t %s", format("%s\\out.tga", folder), L['Ausgaben'])
|
||||
end
|
||||
local zzLDB = LibStub:GetLibrary("zzLDB")
|
||||
local function cdbCheck(n,realm)
|
||||
db[realm] = db[realm] or {}
|
||||
db[realm][n] = db[realm][n] or { currentGold = 0 }
|
||||
end
|
||||
addonTable.cdbCheck = cdbCheck
|
||||
child.cdbCheck = cdbCheck
|
||||
local function getSumToday(d)
|
||||
if(faction=='Neutral') then return 0,0 end
|
||||
local sumIn,sumOut = 0,0
|
||||
d = d or 0
|
||||
local day = addonTable:getDateString() + d
|
||||
local day = child:getDateString() + d
|
||||
for a,b in pairs(dbr['activity'][faction][tostring(day)] or {}) do
|
||||
if(b < 0) then
|
||||
sumOut = sumOut + b
|
||||
|
@ -53,118 +42,119 @@ local function Helper_Tooltip3(realm)
|
|||
end
|
||||
end
|
||||
end
|
||||
addonTable.Helper_Tooltip3 = Helper_Tooltip3
|
||||
child.Helper_Tooltip3 = Helper_Tooltip3
|
||||
local function OnClick(self, button)
|
||||
if(IsShiftKeyDown() and button == "LeftButton") then
|
||||
local sb = addonTable['db']['global']['ldbicons']
|
||||
sb[childName]['hide'] = not sb[childName]['hide']
|
||||
if(ldbicon) then
|
||||
if(sb[childName]['hide']) then
|
||||
ldbicon:Hide(childName)
|
||||
else
|
||||
ldbicon:Show(childName)
|
||||
end
|
||||
end
|
||||
else
|
||||
if(not InCombatLockdown()) then
|
||||
if(InterfaceOptionsFrame:IsVisible()) then
|
||||
InterfaceOptionsFrame:Hide()
|
||||
else
|
||||
InterfaceOptionsFrame_OpenToCategory(childName)
|
||||
InterfaceOptionsFrame_OpenToCategory(childName) -- Twice because of a bug in InterfaceOptionsFrame_OpenToCategory
|
||||
end
|
||||
end
|
||||
end
|
||||
zzLDB:DefaultOnClick(self, button, addon, childName)
|
||||
end
|
||||
local function OnTooltipShow(tip)
|
||||
tip:AddLine(childName)
|
||||
if(faction == 'Neutral') then
|
||||
tip:AddLine(L['neutral'])
|
||||
return
|
||||
end
|
||||
local sessdiff = dbp['currentGold'] - session['start']
|
||||
local sdr,sdg,sdb = 1, 1, 1
|
||||
if(sessdiff<0) then
|
||||
sdr,sdg,sdb = 1, 0, 0
|
||||
end
|
||||
tip:AddDoubleLine(L['Sitzung'], addonTable:displayMoney(abs(sessdiff), db['shortMoneyTip']),1,1,0,sdr,sdg,sdb)
|
||||
tip:AddDoubleLine(lineIn, addonTable:displayMoney(session['income'], db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddDoubleLine(lineOut, addonTable:displayMoney(abs(session['expense']), db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddLine(childName)
|
||||
if(faction == 'Neutral') then
|
||||
tip:AddLine(L['neutral'])
|
||||
return
|
||||
end
|
||||
local sessdiff = dbp['currentGold'] - session['start']
|
||||
local sdr,sdg,sdb = 1, 1, 1
|
||||
if(sessdiff<0) then
|
||||
sdr,sdg,sdb = 1, 0, 0
|
||||
end
|
||||
tip:AddDoubleLine(L['Sitzung'], child:displayMoney(abs(sessdiff), db['shortMoneyTip']),1,1,0,sdr,sdg,sdb)
|
||||
tip:AddDoubleLine(lineIn, child:displayMoney(session['income'], db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddDoubleLine(lineOut, child:displayMoney(abs(session['expense']), db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddLine(' ')
|
||||
local sumOut,sumIn = getSumToday()
|
||||
sessdiff = sumOut+sumIn
|
||||
if(sessdiff<0) then
|
||||
sdr,sdg,sdb = 1, 0, 0
|
||||
else
|
||||
sdr,sdg,sdb = 1, 1, 1
|
||||
end
|
||||
tip:AddDoubleLine(L['Heute'], child:displayMoney(abs(sessdiff), db['shortMoneyTip']),1,1,0,sdr,sdg,sdb)
|
||||
tip:AddDoubleLine(lineIn, child:displayMoney(sumIn, db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddDoubleLine(lineOut, child:displayMoney(abs(sumOut), db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddLine(' ')
|
||||
local sumOut,sumIn = getSumToday(-1)
|
||||
sessdiff = sumOut+sumIn
|
||||
if(sessdiff<0) then
|
||||
sdr,sdg,sdb = 1, 0, 0
|
||||
else
|
||||
sdr,sdg,sdb = 1, 1, 1
|
||||
end
|
||||
tip:AddDoubleLine(L['Gestern'], child:displayMoney(abs(sessdiff), db['shortMoneyTip']),1,1,0,sdr,sdg,sdb)
|
||||
tip:AddDoubleLine(lineIn, child:displayMoney(sumIn, db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddDoubleLine(lineOut, child:displayMoney(abs(sumOut), db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddLine(' ')
|
||||
local sumOut,sumIn = getSumWeek()
|
||||
sessdiff = sumOut+sumIn
|
||||
if(sessdiff<0) then
|
||||
sdr,sdg,sdb = 1, 0, 0
|
||||
else
|
||||
sdr,sdg,sdb = 1, 1, 1
|
||||
end
|
||||
tip:AddDoubleLine(L['7-Tage'], child:displayMoney(abs(sessdiff), db['shortMoneyTip']),1,1,0,sdr,sdg,sdb)
|
||||
tip:AddDoubleLine(lineIn, child:displayMoney(sumIn, db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddDoubleLine(lineOut, child:displayMoney(abs(sumOut), db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddLine(' ')
|
||||
local sumOut,sumIn = getSumToday()
|
||||
sessdiff = sumOut+sumIn
|
||||
if(sessdiff<0) then
|
||||
sdr,sdg,sdb = 1, 0, 0
|
||||
else
|
||||
sdr,sdg,sdb = 1, 1, 1
|
||||
end
|
||||
tip:AddDoubleLine(L['Heute'], addonTable:displayMoney(abs(sessdiff), db['shortMoneyTip']),1,1,0,sdr,sdg,sdb)
|
||||
tip:AddDoubleLine(lineIn, addonTable:displayMoney(sumIn, db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddDoubleLine(lineOut, addonTable:displayMoney(abs(sumOut), db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddLine(' ')
|
||||
local sumOut,sumIn = getSumToday(-1)
|
||||
sessdiff = sumOut+sumIn
|
||||
if(sessdiff<0) then
|
||||
sdr,sdg,sdb = 1, 0, 0
|
||||
else
|
||||
sdr,sdg,sdb = 1, 1, 1
|
||||
end
|
||||
tip:AddDoubleLine(L['Gestern'], addonTable:displayMoney(abs(sessdiff), db['shortMoneyTip']),1,1,0,sdr,sdg,sdb)
|
||||
tip:AddDoubleLine(lineIn, addonTable:displayMoney(sumIn, db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddDoubleLine(lineOut, addonTable:displayMoney(abs(sumOut), db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddLine(' ')
|
||||
local sumOut,sumIn = getSumWeek()
|
||||
sessdiff = sumOut+sumIn
|
||||
if(sessdiff<0) then
|
||||
sdr,sdg,sdb = 1, 0, 0
|
||||
else
|
||||
sdr,sdg,sdb = 1, 1, 1
|
||||
end
|
||||
tip:AddDoubleLine(L['7-Tage'], addonTable:displayMoney(abs(sessdiff), db['shortMoneyTip']),1,1,0,sdr,sdg,sdb)
|
||||
tip:AddDoubleLine(lineIn, addonTable:displayMoney(sumIn, db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddDoubleLine(lineOut, addonTable:displayMoney(abs(sumOut), db['shortMoneyTip']),1,1,1,1,1,1)
|
||||
tip:AddLine(' ')
|
||||
local sum = 0
|
||||
local ttlist = {}
|
||||
if(addonTable['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addonTable['db']['sv']['profileKeys']) do
|
||||
local n,_,m = strsplit(' ',k,3)
|
||||
if(n) then
|
||||
local cr = Helper_Tooltip3(m)
|
||||
if(m == realm or cr) then
|
||||
cdbCheck(n, m)
|
||||
if( faction == db[m][n]['faction']) then
|
||||
local sum = 0
|
||||
local ttlist = {}
|
||||
if(addon['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addon['db']['sv']['profileKeys']) do
|
||||
local n,_,m = strsplit(' ',k,3)
|
||||
if(n) then
|
||||
m = string.gsub(m, "%s+", "")
|
||||
local cr = Helper_Tooltip3(m)
|
||||
if(m == realm or cr) then
|
||||
cdbCheck(n, m)
|
||||
if( faction == db[m][n]['faction']) then
|
||||
-- sum = sum + db[m][n]['currentGold']
|
||||
ttlist[k] = db[m][n]['currentGold']
|
||||
end
|
||||
elseif(db['accountMoney']) then
|
||||
|
||||
-- sum = sum + db[m][n]['currentGold']
|
||||
ttlist[k] = db[m][n]['currentGold']
|
||||
end
|
||||
elseif(db['accountMoney']) then
|
||||
|
||||
-- sum = sum + db[m][n]['currentGold']
|
||||
end
|
||||
end
|
||||
end
|
||||
for _,v in pairs(addonTable:sortArray(ttlist,db['sortDir'])) do
|
||||
local n,_,m = strsplit(' ',v,3)
|
||||
local cr = Helper_Tooltip3(m)
|
||||
tip:AddDoubleLine(addonTable:classcolor(n,db[cr and m or realm][n]['class']),addonTable:displayMoney(db[cr and m or realm][n]['currentGold']+(db[cr and m or realm][n]['incoming'] or 0), db['shortMoneyTip']),0,1,0,1,1,1)
|
||||
end
|
||||
tip:AddLine(' ')
|
||||
tip:AddDoubleLine(L['Gesamt'],addonTable:displayMoney(addonTable:GetGold(db['displaySelTT'] or 2), db['shortMoneyTip']),0,1,0,1,1,1)
|
||||
end
|
||||
function addonTable:GetBroker(objname)
|
||||
return LibStub:GetLibrary("zzLDB"):GetLDB(objname)
|
||||
end
|
||||
function addonTable:OnText(objname, message)
|
||||
local ldbobj = addonTable:GetBroker(objname)
|
||||
if(ldbobj['text'] ~= message) then
|
||||
ldbobj['text'] = message
|
||||
end
|
||||
for _,v in pairs(child:sortArray(ttlist,db['sortDir'])) do
|
||||
local n,_,m = strsplit(' ',v,3)
|
||||
m = string.gsub(m, "%s+", "")
|
||||
local cr = Helper_Tooltip3(m)
|
||||
local rm = cr and m or realm
|
||||
tip:AddDoubleLine(
|
||||
child:classcolor(n,db[rm][n]['class']),
|
||||
child:displayMoney(db[rm][n]['currentGold']+(db[rm][n]['incoming'] or 0), db['shortMoneyTip']),
|
||||
0,1,0,
|
||||
1,1,1
|
||||
)
|
||||
end
|
||||
tip:AddLine(' ')
|
||||
tip:AddDoubleLine(L['Gesamt'],child:displayMoney(child:GetGold(db['displaySelTT'] or 2), db['shortMoneyTip']),0,1,0,1,1,1)
|
||||
end
|
||||
addonTable['ldb'] = { -- https://github.com/tekkub/libdatabroker-1-1/wiki/Data-Specifications
|
||||
child['ldb'] = { -- https://github.com/tekkub/libdatabroker-1-1/wiki/Data-Specifications
|
||||
['type'] = 'data source', -- required: 'data source' or 'launcher'
|
||||
['text'] = childName, -- required/optional for launcher
|
||||
['icon'] = 'Interface\\Icons\\INV_Misc_Bag_10_Blue', -- optional/required for launcher
|
||||
['OnClick'] = OnClick, -- optional/required for launcher
|
||||
['OnTooltipShow'] = OnTooltipShow, -- optional
|
||||
}
|
||||
function child:OnText(objname, message)
|
||||
local ldbobj = zzLDB:GetLDB(objname)
|
||||
if(ldbobj['text'] ~= message) then
|
||||
ldbobj['text'] = message
|
||||
end
|
||||
end
|
||||
local init = {
|
||||
Setup = function(self, childName, event)
|
||||
L = child['storage']['L']
|
||||
db = child['storage']['db']
|
||||
dbr = child['storage']['dbr']
|
||||
dbp = child['storage']['dbp']
|
||||
session = child['storage']['session']
|
||||
faction = child['storage']['faction']
|
||||
realm = child['storage']['realm']
|
||||
local folder = addonName ~= childName and format("Interface\\AddOns\\%s\\%s", addonName, childName) or format("Interface\\AddOns\\%s", childName)
|
||||
lineIn = format("|T%s:0|t %s", format("%s\\in.tga", folder), L['Einnahmen'])
|
||||
lineOut = format("|T%s:0|t %s", format("%s\\out.tga", folder), L['Ausgaben'])
|
||||
end
|
||||
}
|
||||
addon.RegisterCallback(init, format("Init%s", childName), 'Setup', childName)
|
|
@ -1,19 +1,19 @@
|
|||
local addonName, addonTable = ...
|
||||
local childName = "zz_Money"
|
||||
local addonName, addon = ...
|
||||
local childName = addon['childName']
|
||||
local child = addon[childName]
|
||||
local events = child['events']
|
||||
local db, dbr, dbp, faction, realm
|
||||
LibStub("zzHelper"):Embed(addonTable)
|
||||
addonTable['events'] = addonTable['events'] or {}
|
||||
local events = addonTable['events']
|
||||
LibStub("zzHelper"):Embed(child)
|
||||
local session = { start = 0, income = 0, expense = 0 }
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale(childName, true)
|
||||
local function prepareDB()
|
||||
local function prepareDB(self)
|
||||
local player = UnitName('player')
|
||||
realm = GetNormalizedRealmName()
|
||||
if(not realm) then return end
|
||||
faction = UnitFactionGroup('player')
|
||||
local className, classFilename, classId = UnitClass('player')
|
||||
addonTable['db']['profile'][childName] = addonTable['db']['profile'][childName] or {}
|
||||
db = addonTable['db']['profile'][childName]
|
||||
addon['db']['profile'][childName] = addon['db']['profile'][childName] or {}
|
||||
db = addon['db']['profile'][childName]
|
||||
db[realm] = db[realm] or {}
|
||||
db[faction] = db[faction] or {}
|
||||
db[faction]['banker'] = db[faction]['banker'] or {
|
||||
|
@ -31,7 +31,7 @@ local function prepareDB()
|
|||
dbp['currentGold'] = dbp['currentGold'] or 0
|
||||
dbp['class'] = classFilename
|
||||
dbp['faction'] = faction
|
||||
addonTable['storage'] = {
|
||||
child['storage'] = {
|
||||
['db'] = db,
|
||||
['dbr'] = dbr,
|
||||
['dbp'] = dbp,
|
||||
|
@ -41,39 +41,23 @@ local function prepareDB()
|
|||
['faction'] = faction,
|
||||
['realm'] = realm,
|
||||
}
|
||||
addonTable:SetupPrefs(childName)
|
||||
addonTable:SetupBroker()
|
||||
addonTable:SetupBanker()
|
||||
child['db'] = db
|
||||
addon['callbacks']:Fire(format("Init%s", childName))
|
||||
child['events']['PLAYER_MONEY']()
|
||||
end
|
||||
function addonTable:getDateString()
|
||||
function child:getDateString()
|
||||
return format("%s%s",tostring(date("%Y")),tostring(1000 + date("%j")))
|
||||
end
|
||||
local specs = {
|
||||
['name'] = childName,
|
||||
['sv'] = true,
|
||||
['cfg'] = true,
|
||||
['cfgReset'] = prepareDB,
|
||||
['ldb'] = addonTable['ldb'] ,
|
||||
['defaults'] = {
|
||||
['profile'] = {
|
||||
[childName] = {
|
||||
['disableBanker'] = true,
|
||||
['displaySelTT'] = 2,
|
||||
['displaySel'] = 2,
|
||||
['connectedRealms'] = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
function addonTable:GetGold(val)
|
||||
function child:GetGold(val)
|
||||
local val = val or 2
|
||||
local sums = { dbp['currentGold'], 0, 0, 0 }
|
||||
if(addonTable['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addonTable['db']['sv']['profileKeys']) do
|
||||
if(addon['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addon['db']['sv']['profileKeys']) do
|
||||
local n,_,m = strsplit(' ',k,3)
|
||||
if(n) then
|
||||
local cr = addonTable.Helper_Tooltip3(m)
|
||||
addonTable.cdbCheck(n, m)
|
||||
m = string.gsub(m, "%s+", "")
|
||||
local cr = child.Helper_Tooltip3(m)
|
||||
child.cdbCheck(n, m)
|
||||
local ch = db[m][n]
|
||||
sums[3] = sums[3] + ch['currentGold'] -- global all
|
||||
if(faction == ch['faction']) then
|
||||
|
@ -87,29 +71,28 @@ function addonTable:GetGold(val)
|
|||
end
|
||||
return sums[val]
|
||||
end
|
||||
function addonTable:displayMoney(money, abr)
|
||||
function child:displayMoney(money, abr)
|
||||
if(abr) then
|
||||
if(db['shortMoney'] and money>10000)then
|
||||
money = addonTable:round(money / 10000,0) * 10000
|
||||
money = child:round(money / 10000,0) * 10000
|
||||
end
|
||||
end
|
||||
return addonTable:MoneyString(money, color, abr and (db['abrevK'] and L['abrK'] or nil) or nil, abr and (db['abrevM'] and L['abrM'] or nil) or nil, db['noIcon'], db['noIconColor'])
|
||||
return child:MoneyString(money, false, abr and (db['abrevK'] and L['abrK'] or nil) or nil, abr and (db['abrevM'] and L['abrM'] or nil) or nil, db['noIcon'], db['noIconColor'], nil, db['seperateMoney'])
|
||||
end
|
||||
local pew_events = {}
|
||||
function pew_events:PLAYER_MONEY(event)
|
||||
function events:PLAYER_MONEY(event)
|
||||
local money = GetMoney()
|
||||
if(money == 0) then return end
|
||||
if(session['start'] == 0) then
|
||||
session['start'] = money
|
||||
end
|
||||
dbp['currentGold'] = dbp['currentGold'] or 0
|
||||
dbp['incoming'] = 0
|
||||
dbp['incoming'] = nil
|
||||
if(money ~= dbp['currentGold']) then
|
||||
local diff = money - dbp['currentGold']
|
||||
local out = GetCoinTextureString(abs(diff))
|
||||
local color = "ffffff"
|
||||
local stamp = time()
|
||||
local day = addonTable:getDateString()
|
||||
local day = child:getDateString()
|
||||
local dba = dbr['activity'][faction]
|
||||
dba[day] = dba[day] or {}
|
||||
local dbd = dba[day]
|
||||
|
@ -124,21 +107,36 @@ function pew_events:PLAYER_MONEY(event)
|
|||
end
|
||||
dbd[stamp] = diff
|
||||
if(db['showLog']) then
|
||||
print(addonTable:colorize(out, color))
|
||||
print(child:colorize(out, color))
|
||||
end
|
||||
dbp['currentGold'] = money
|
||||
end
|
||||
local sum = addonTable:GetGold(db['displaySel'] or 2)
|
||||
addonTable:OnText(childName, addonTable:displayMoney(sum, true))
|
||||
local sum = child:GetGold(db['displaySel'] or 2)
|
||||
child:OnText(childName, child:displayMoney(sum, true))
|
||||
end
|
||||
function addonTable:PrefChanged(pref, value, oldvalue)
|
||||
pew_events:PLAYER_MONEY()
|
||||
child['specs'] = {
|
||||
['name'] = childName,
|
||||
['sv'] = true,
|
||||
['cfg'] = true,
|
||||
['cfgReset'] = prepareDB,
|
||||
['ldb'] = child['ldb'],
|
||||
['defaults'] = {
|
||||
['profile'] = {
|
||||
[childName] = {
|
||||
['disableBanker'] = true,
|
||||
['displaySelTT'] = 2,
|
||||
['displaySel'] = 2,
|
||||
['connectedRealms'] = true
|
||||
}
|
||||
}
|
||||
},
|
||||
['events'] = events
|
||||
}
|
||||
function events:PLAYER_ENTERING_WORLD()
|
||||
if(not realm) then
|
||||
prepareDB()
|
||||
else
|
||||
child:UnregisterEvent('PLAYER_ENTERING_WORLD')
|
||||
end
|
||||
end
|
||||
function events:PLAYER_ENTERING_WORLD(event)
|
||||
prepareDB()
|
||||
addonTable:UnregisterEvent('PLAYER_ENTERING_WORLD')
|
||||
addonTable:RegisterEvent(pew_events)
|
||||
pew_events:PLAYER_MONEY()
|
||||
end
|
||||
LibStub:GetLibrary("zzAddOn"):NewAddOn(specs, ...)
|
||||
|
||||
child:NewAddOn(...)
|
|
@ -0,0 +1,12 @@
|
|||
local addonName, addon = ...
|
||||
addon['childName'] = "zz_Money"
|
||||
addon['callbacks'] = addon['callbacks'] or LibStub("CallbackHandler-1.0"):New(addon)
|
||||
local loaded, finished = IsAddOnLoaded("BrokerPack")
|
||||
if(finished) then
|
||||
addonName = "BrokerPack"
|
||||
end
|
||||
addon[addon['childName']] = {
|
||||
['parentName'] = addonName ~= addon['childName'] and addonName or nil,
|
||||
['events'] = {}
|
||||
}
|
||||
LibStub:GetLibrary("zzAddOn"):Embed(addon[addon['childName']])
|
|
@ -1,9 +1,9 @@
|
|||
local addonname, addon = ...
|
||||
local name = "zz_Money"
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(name, "deDE", false)
|
||||
local addonName, addon = ...
|
||||
local childName = addon['childName']
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(childName, "deDE", false)
|
||||
if L then
|
||||
L[name] = name
|
||||
L[name..' Settings'] = name..' Einstellungen'
|
||||
L[childName] = childName
|
||||
L[childName..' Settings'] = childName..' Einstellungen'
|
||||
L['Sitzung']='Sitzung'
|
||||
L['Einnahmen']='Einnahmen'
|
||||
L['Ausgaben']='Ausgaben'
|
||||
|
@ -51,10 +51,12 @@ if L then
|
|||
L['displayMoneyGlobalFaction'] = "Global (nur deine Fraktion)"
|
||||
L['Displayvalue'] = "Broker Anzeige"
|
||||
L['DisplayvalueDesc'] = "Legt fest welcher Wert im Broker angezeigt wird. Global zeigt alle Fraktionen. Realm zeigt nur die eigene Fraktion (Falls aktiviert auch die verbundenen Realms)."
|
||||
L['seperate'] = "Benutze Trennzeichen"
|
||||
L['seperateDesc'] = format("F\195\188gt '%s' f\195\188r bessere Lesbarkeit in Zahlen ein", LARGE_NUMBER_SEPERATOR)
|
||||
end
|
||||
|
||||
-- ö \195\182 ß \195\159
|
||||
-- ü \195\188 ä \195\164
|
||||
-- Ä \195\132
|
||||
-- ö \195\182
|
||||
-- Ü \195\156
|
||||
-- ö \195\182 ß \195\159
|
||||
-- ü \195\188 ä \195\164
|
||||
-- <EFBFBD> \195\132
|
||||
-- <EFBFBD> \195\182
|
||||
-- <EFBFBD> \195\156
|
|
@ -1,9 +1,9 @@
|
|||
local addonname, addon = ...
|
||||
local name = "zz_Money"
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(name, "enUS", true)
|
||||
local childName = addon['childName']
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(childName, "enUS", true)
|
||||
if L then
|
||||
L[name] = name
|
||||
L[name..' Settings'] = name..' Settings'
|
||||
L[childName] = childName
|
||||
L[childName..' Settings'] = childName..' Settings'
|
||||
L['Sitzung']='Session'
|
||||
L['Einnahmen']='Income'
|
||||
L['Ausgaben']='Expenses'
|
||||
|
@ -51,4 +51,6 @@ if L then
|
|||
L['displayMoneyGlobalFaction'] = "Global (only your faction)"
|
||||
L['Displayvalue'] = "Broker Display"
|
||||
L['DisplayvalueDesc'] = "Selects the sum diplayed by the broker. Global is for all factions and chars or only your faction. Realm is for your faction (pool when selected)."
|
||||
L['seperate'] = "Use seperator"
|
||||
L['seperateDesc'] = format("Add '%s' to make numbers readable", LARGE_NUMBER_SEPERATOR)
|
||||
end
|
|
@ -1,9 +1,9 @@
|
|||
local addonname, addon = ...
|
||||
local name = "zz_Money"
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(name, "koKR", false)
|
||||
local childName = addon['childName']
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(childName, "koKR", false)
|
||||
if L then
|
||||
L[name] = name
|
||||
L[name..' Settings'] = name..' 설정'
|
||||
L[childName] = childName
|
||||
L[childName..' Settings'] = childName..' 설정'
|
||||
L['Sitzung']='세션'
|
||||
L['Einnahmen']='수입'
|
||||
L['Ausgaben']='지출'
|
||||
|
@ -51,4 +51,6 @@ if L then
|
|||
L['displayMoneyGlobalFaction'] = "Global (only your faction)"
|
||||
L['Displayvalue'] = "Broker Display"
|
||||
L['DisplayvalueDesc'] = "Selects the sum diplayed by the broker. Global is for all factions and chars. Realm is for your faction (pool when selected)."
|
||||
L['seperate'] = "Use seperator"
|
||||
L['seperateDesc'] = format("Add '%s' to make numbers readable", LARGE_NUMBER_SEPERATOR)
|
||||
end
|
|
@ -1,9 +1,9 @@
|
|||
local addonname, addon = ...
|
||||
local name = "zz_Money"
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(name, "ruRU", false)
|
||||
local childName = addon['childName']
|
||||
local L = LibStub("AceLocale-3.0"):NewLocale(childName, "ruRU", false)
|
||||
if L then
|
||||
L[name] = name
|
||||
L[name..' Settings'] = name..' Настройки'
|
||||
L[childName] = childName
|
||||
L[childName..' Settings'] = childName..' Настройки'
|
||||
L['Sitzung']='Сессия'
|
||||
L['Einnahmen']='Доход'
|
||||
L['Ausgaben']='Расход'
|
||||
|
@ -51,4 +51,6 @@ if L then
|
|||
L['displayMoneyGlobalFaction'] = "Global (only your faction)"
|
||||
L['Displayvalue'] = "Broker Display"
|
||||
L['DisplayvalueDesc'] = "Selects the sum diplayed by the broker. Global is for all factions and chars. Realm is for your faction (pool when selected)."
|
||||
L['seperate'] = "Use seperator"
|
||||
L['seperateDesc'] = format("Add '%s' to make numbers readable", LARGE_NUMBER_SEPERATOR)
|
||||
end
|
|
@ -1,10 +1,11 @@
|
|||
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">
|
||||
<script file="locale_deDE.lua"/>
|
||||
<script file="locale_koKR.lua"/>
|
||||
<script file="locale_enUS.lua"/>
|
||||
<script file="locale_ruRU.lua"/>
|
||||
<Script file="init.lua"/>
|
||||
<Script file="locale_enUS.lua"/>
|
||||
<Script file="locale_deDE.lua"/>
|
||||
<Script file="locale_koKR.lua"/>
|
||||
<Script file="locale_ruRU.lua"/>
|
||||
<Script file="banker.lua"/>
|
||||
<Script file="prefs.lua"/>
|
||||
<Script file="broker.lua"/>
|
||||
<Script file="banker.lua"/>
|
||||
<Script file="core.lua"/>
|
||||
</Ui>
|
|
@ -1,24 +1,14 @@
|
|||
local addonName, addonTable = ...
|
||||
local addonName, addon = ...
|
||||
local childName = addon['childName']
|
||||
local child = addon[childName]
|
||||
local db, dbr, faction
|
||||
local childName = "zz_Money"
|
||||
local L = LibStub("AceLocale-3.0"):GetLocale(childName, true)
|
||||
addonTable['bankHandler'] = {
|
||||
SetDB = function(self, db) self.db = db end,
|
||||
GetPref = function(self, pref)
|
||||
return self['db'][pref[#pref]]
|
||||
end,
|
||||
SetPref = function (self, pref, value)
|
||||
self['db'][pref[#pref]] = value
|
||||
addonTable['events']['MAIL_SHOW'](addonTable)
|
||||
end,
|
||||
}
|
||||
local function buildSelect()
|
||||
local sel = {}
|
||||
local n,m,_
|
||||
if(addonTable['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addonTable['db']['sv']['profileKeys']) do
|
||||
if(addon['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addon['db']['sv']['profileKeys']) do
|
||||
n,_,m = strsplit(' ',k,3)
|
||||
if(addonTable:IsTwink(n)) then
|
||||
if(child:IsTwink(n)) then
|
||||
if(dbr[n] and faction == dbr[n]['faction']) then
|
||||
sel[n] = n
|
||||
end
|
||||
|
@ -27,16 +17,11 @@ local function buildSelect()
|
|||
end
|
||||
return sel
|
||||
end
|
||||
|
||||
local buildDisplayValue = {
|
||||
L['displayMoneyChar'], L['displayMoneyRealm'], L['displayMoneyGlobal'], L['displayMoneyGlobalFaction']
|
||||
}
|
||||
|
||||
local function buildSelectAll()
|
||||
local sel = {}
|
||||
local n,m,_
|
||||
if(addonTable['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addonTable['db']['sv']['profileKeys']) do
|
||||
if(addon['db']['sv']['profileKeys']) then
|
||||
for k,v in pairs(addon['db']['sv']['profileKeys']) do
|
||||
n,_,m = strsplit(' ',k,3)
|
||||
sel[format("%s-%s",n,m)] = format("%s-%s",n,m)
|
||||
end
|
||||
|
@ -48,43 +33,54 @@ local function deleteChar()
|
|||
local charName, charRealm = strsplit('-', db['deleteChar'],2)
|
||||
if(db[charRealm] and db[charRealm][charName]) then
|
||||
db[charRealm][charName] = nil
|
||||
addonTable['db']['sv']['profileKeys'][format("%s - %s", charName, charRealm)] = nil
|
||||
addon['db']['sv']['profileKeys'][format("%s - %s", charName, charRealm)] = nil
|
||||
end
|
||||
end
|
||||
db['deleteCharOk'] = nil
|
||||
end
|
||||
function addonTable:SetupPrefs(childName)
|
||||
local L = addonTable['storage']['L']
|
||||
dbr = addonTable['storage']['dbr']
|
||||
db = addonTable['storage']['db']
|
||||
local dbf = addonTable['storage']['dbf']
|
||||
local dbb = dbf['banker']
|
||||
faction = addonTable['storage']['faction']
|
||||
local config = LibStub:GetLibrary("zzConfig")
|
||||
local main = addonTable['options']['args'][childName]
|
||||
config:AddConfigEntry(main, "displaySel", "select", L['Displayvalue'], L['DisplayvalueDesc'], 1, buildDisplayValue)
|
||||
config:AddConfigEntry(main, "connectedRealms", "toggle", L['connectedRealms'], nil, 2)
|
||||
config:AddConfigEntry(main, "showLog", "toggle", L['showLog'], nil, 3)
|
||||
config:AddConfigEntry(main, "shortMoney", "toggle", L['shortMoney'], nil, 4)
|
||||
config:AddConfigEntry(main, "disableBanker", "toggle", L['nobanker'], nil, 5)
|
||||
config:AddConfigEntry(main, "abrevK", "toggle", L['abrevK'], nil, 6)
|
||||
config:AddConfigEntry(main, "abrevM", "toggle", L['abrevM'], nil, 7)
|
||||
local noicon = config:AddConfigEntry(main, "noIcon", "toggle", L['noIcon'], L['noIconDesk'], 6)
|
||||
local noiconColor = config:AddConfigEntry(main, "noIconColor", "toggle", L['Color text'], L['Color text desc'], 7)
|
||||
noiconColor['disabled'] = function(self) if(not db['noIcon']) then return true end end
|
||||
local menu = config:AddConfigMenu(addonTable['options'], L['Bankier'], 2, config:GetDefaultHandler(addonTable['events']['MAIL_SHOW'], dbb), { disabled = function() return db['disableBanker']
|
||||
end})
|
||||
config:AddConfigEntry(menu, "minLimit", "range", L['Minimum Limit'], L['Desc MinL'], 1, 10, 150000, 5, false)
|
||||
config:AddConfigEntry(menu, "maxLimit", "range", L['Maximum Limit'], L['Desc MaxL'], 2, 10, 150000, 5, false)
|
||||
config:AddConfigEntry(menu, "banker","select",L['Bankier'],nil,3,buildSelect)
|
||||
local ttmenu = config:AddConfigEntry(main, "ttmenu", "group", L['ttmenu_title'], L['ttmenu_desc'], 9, config:GetDefaultHandler(addonTable['events']['PLAYER_MONEY'], db), true)
|
||||
config:AddConfigEntry(ttmenu, "displaySelTT", "select", L['Gesamt'], L['DisplayvalueDesc'], 1, buildDisplayValue)
|
||||
config:AddConfigEntry(ttmenu, "sortDir", "toggle", L['sortDir'], nil, 2)
|
||||
config:AddConfigEntry(ttmenu, "accountMoney", "toggle", L['accountMoney'], L['accountMoneyDesc'], 3)
|
||||
local short = config:AddConfigEntry(ttmenu, "shortMoneyTip", "toggle", L['shortMoneyTip'], nil, 4)
|
||||
short['disabled'] = function(self) if(not db['abrevK'] and not db['abrevM']) then return true end end
|
||||
local delmenu = config:AddConfigEntry(main, "delmenu", "group", L['DeleteChar'], L['DeleteCharDesc'], 10, config:GetDefaultHandler(nil, db), true)
|
||||
config:AddConfigEntry(delmenu, "deleteChar", "select", L['DeleteChar'], L['DeleteCharDesc'], 1, buildSelectAll)
|
||||
config:AddConfigEntry(delmenu, "deleteCharOk", "toggle", L['DeleteCharOk'], nil , 2)
|
||||
config:AddConfigEntry(delmenu, "deleteCharExec", "execute", L['DeleteChar'], L['DeleteCharDesc'], 3, deleteChar)
|
||||
end
|
||||
|
||||
|
||||
local init = {
|
||||
Setup = function(self)
|
||||
local L = child['storage']['L']
|
||||
dbr = child['storage']['dbr']
|
||||
db = child['storage']['db']
|
||||
local dbf = child['storage']['dbf']
|
||||
local dbb = dbf['banker']
|
||||
faction = child['storage']['faction']
|
||||
local config = LibStub:GetLibrary("zzConfig")
|
||||
local options = child['options']
|
||||
local main = options['args'][childName]
|
||||
local buildDisplayValue = {
|
||||
L['displayMoneyChar'], L['displayMoneyRealm'], L['displayMoneyGlobal'], L['displayMoneyGlobalFaction']
|
||||
}
|
||||
config:AddConfigEntry(main, "displaySel", "select", L['Displayvalue'], L['DisplayvalueDesc'], 1, buildDisplayValue)
|
||||
config:AddConfigEntry(main, "connectedRealms", "toggle", L['connectedRealms'], nil, 2)
|
||||
config:AddConfigEntry(main, "showLog", "toggle", L['showLog'], nil, 3)
|
||||
config:AddConfigEntry(main, "shortMoney", "toggle", L['shortMoney'], nil, 4)
|
||||
config:AddConfigEntry(main, "disableBanker", "toggle", L['nobanker'], nil, 5)
|
||||
config:AddConfigEntry(main, "abrevK", "toggle", L['abrevK'], nil, 6)
|
||||
config:AddConfigEntry(main, "abrevM", "toggle", L['abrevM'], nil, 7)
|
||||
local noicon = config:AddConfigEntry(main, "noIcon", "toggle", L['noIcon'], L['noIconDesk'], 6)
|
||||
local noiconColor = config:AddConfigEntry(main, "noIconColor", "toggle", L['Color text'], L['Color text desc'], 7)
|
||||
noiconColor['disabled'] = function(self) if(not db['noIcon']) then return true end end
|
||||
local menu = config:AddConfigMenu(options, L['Bankier'], 2, config:GetDefaultHandler(child['events']['MAIL_SHOW'], dbb), { disabled = function() return db['disableBanker']
|
||||
end})
|
||||
config:AddConfigEntry(menu, "minLimit", "range", L['Minimum Limit'], L['Desc MinL'], 1, 10, 150000, 5, false)
|
||||
config:AddConfigEntry(menu, "maxLimit", "range", L['Maximum Limit'], L['Desc MaxL'], 2, 10, 150000, 5, false)
|
||||
config:AddConfigEntry(menu, "banker","select",L['Bankier'],nil,3,buildSelect)
|
||||
local ttmenu = config:AddConfigEntry(main, "ttmenu", "group", L['ttmenu_title'], L['ttmenu_desc'], 9, config:GetDefaultHandler(child['events']['PLAYER_MONEY'], db), true)
|
||||
config:AddConfigEntry(ttmenu, "displaySelTT", "select", L['Gesamt'], L['DisplayvalueDesc'], 1, buildDisplayValue)
|
||||
config:AddConfigEntry(ttmenu, "sortDir", "toggle", L['sortDir'], nil, 2)
|
||||
config:AddConfigEntry(ttmenu, "accountMoney", "toggle", L['accountMoney'], L['accountMoneyDesc'], 3)
|
||||
local short = config:AddConfigEntry(ttmenu, "shortMoneyTip", "toggle", L['shortMoneyTip'], nil, 4)
|
||||
config:AddConfigEntry(ttmenu, "seperateMoney", "toggle", L['seperate'], L['seperateDesc'], 5)
|
||||
short['disabled'] = function(self) if(not db['abrevK'] and not db['abrevM']) then return true end end
|
||||
local delmenu = config:AddConfigEntry(main, "delmenu", "group", L['DeleteChar'], L['DeleteCharDesc'], 10, config:GetDefaultHandler(nil, db), true)
|
||||
config:AddConfigEntry(delmenu, "deleteChar", "select", L['DeleteChar'], L['DeleteCharDesc'], 1, buildSelectAll)
|
||||
config:AddConfigEntry(delmenu, "deleteCharOk", "toggle", L['DeleteCharOk'], nil , 2)
|
||||
config:AddConfigEntry(delmenu, "deleteCharExec", "execute", L['DeleteChar'], L['DeleteCharDesc'], 3, deleteChar)
|
||||
child.PrefChanged = child['events']['PLAYER_MONEY']
|
||||
end
|
||||
}
|
||||
addon.RegisterCallback(init, format("Init%s", childName), 'Setup')
|
|
@ -0,0 +1,9 @@
|
|||
## Interface: 11403
|
||||
## X-Repository: https://git.grml.de/rilgamon/zz_Money.git
|
||||
## X-WoWI-ID: 15621
|
||||
## X-Curse-Project-ID: 39054
|
||||
## Title: Money
|
||||
## OptionalDeps: zzLib, Ace3, BrokerPack
|
||||
## SavedVariables: zz_MoneyDB
|
||||
Libs\embeds.xml
|
||||
pack.xml
|
|
@ -0,0 +1,9 @@
|
|||
## Interface: 30400
|
||||
## X-Repository: https://git.grml.de/rilgamon/zz_Money.git
|
||||
## X-WoWI-ID: 15621
|
||||
## X-Curse-Project-ID: 39054
|
||||
## Title: Money
|
||||
## OptionalDeps: zzLib, Ace3, BrokerPack
|
||||
## SavedVariables: zz_MoneyDB
|
||||
Libs\embeds.xml
|
||||
pack.xml
|
|
@ -1,12 +1,9 @@
|
|||
## Interface: 90005
|
||||
## Title: Money
|
||||
## Notes: Broker Money display
|
||||
## Notes-deDE: Broker zur Goldanzeige
|
||||
## Author: Rilgamon
|
||||
## X-WoWI-ID: 15621
|
||||
## X-Curse-Project-ID: 39054
|
||||
## X-Repository: https://git.grml.de/rilgamon/zz_Money.git
|
||||
## OptionalDeps: zzLib, Ace3, BrokerPack
|
||||
## SavedVariables: zz_MoneyDB
|
||||
Libs\embeds.xml
|
||||
## Interface: 100002
|
||||
## X-Repository: https://git.grml.de/rilgamon/zz_Money.git
|
||||
## X-WoWI-ID: 15621
|
||||
## X-Curse-Project-ID: 39054
|
||||
## Title: Money
|
||||
## OptionalDeps: zzLib, Ace3, BrokerPack
|
||||
## SavedVariables: zz_MoneyDB
|
||||
Libs\embeds.xml
|
||||
pack.xml
|
Loading…
Reference in New Issue