Compare commits
14 Commits
Author | SHA1 | Date |
---|---|---|
Robin Hüskes | b574c120af | |
Robin Hüskes | 63d61f708f | |
Robin Hüskes | 65d1651374 | |
Robin Hüskes | cb567af2e2 | |
Robin Hüskes | 4f8b3430d0 | |
Robin Hüskes | 6c5ab4a3b0 | |
Robin Hüskes | 9896d06a9d | |
Robin Hüskes | 9f2a53d9c9 | |
Robin Hüskes | ef1fadf665 | |
Robin Hüskes | 8032532c51 | |
Robin Hüskes | 896c9b7c1c | |
Robin Hüskes | badd83aa5e | |
Robin Hüskes | 30dce07db6 | |
Robin Hüskes | 2bafa7f337 |
|
@ -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 1292 2022-09-29 08:00:11Z nevcairiel $
|
||||
-- @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", 85
|
||||
local MAJOR, MINOR = "AceConfigDialog-3.0", 86
|
||||
local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
|
||||
|
||||
if not AceConfigDialog then return end
|
||||
|
@ -147,6 +147,7 @@ local stringIsLiteral = {
|
|||
width = true,
|
||||
image = true,
|
||||
fontSize = true,
|
||||
tooltipHyperlink = true
|
||||
}
|
||||
|
||||
--Is Never a function or method
|
||||
|
@ -501,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)
|
||||
|
|
|
@ -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,5 +1,5 @@
|
|||
--[[ $Id: CallbackHandler-1.0.lua 1284 2022-09-25 09:15:30Z 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,21 +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 error = error
|
||||
local securecallfunction, error = securecallfunction, error
|
||||
local setmetatable, rawget = setmetatable, rawget
|
||||
local next, select, pairs, type, tostring = next, select, pairs, type, tostring
|
||||
|
||||
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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
local lib = LibStub:NewLibrary("zzAddOn", 10)
|
||||
local lib = LibStub:NewLibrary("zzAddOn", 12)
|
||||
if not lib then return end
|
||||
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 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'}
|
||||
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
|
||||
|
@ -103,6 +104,44 @@ end
|
|||
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']
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local lib = LibStub:NewLibrary("zzHelper", 3)
|
||||
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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
local lib = LibStub:NewLibrary("zzLDB", 4)
|
||||
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")
|
||||
|
@ -22,11 +22,22 @@ function lib:DefaultOnClick(_, button, addon, childName)
|
|||
end
|
||||
end
|
||||
else
|
||||
if(InterfaceOptionsFrame:IsVisible() and not InCombatLockdown()) then
|
||||
InterfaceOptionsFrame:Hide()
|
||||
else
|
||||
InterfaceOptionsFrame_OpenToCategory(childName)
|
||||
InterfaceOptionsFrame_OpenToCategory(childName) -- Twice because of a bug in InterfaceOptionsFrame_OpenToCategory
|
||||
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
|
||||
|
|
61
broker.lua
61
broker.lua
|
@ -32,6 +32,7 @@ local replaces = {
|
|||
['December'] = true,
|
||||
}
|
||||
local IsAddOnLoaded = IsAddOnLoaded
|
||||
local ticker
|
||||
-- Fix Classic
|
||||
local C_CVar = C_CVar or {
|
||||
GetCVarBool = function(value)
|
||||
|
@ -68,7 +69,8 @@ local function OnClick(self, button)
|
|||
if(not InCombatLockdown()) then
|
||||
if(SettingsPanel) then
|
||||
if(SettingsPanel:IsVisible()) then
|
||||
SettingsPanel:Hide()
|
||||
HideUIPanel(SettingsPanel)
|
||||
HideUIPanel(GameMenuFrame)
|
||||
else
|
||||
Settings.OpenToCategory(childName)
|
||||
end
|
||||
|
@ -113,8 +115,20 @@ end
|
|||
local function toggleColor(col,col1,col2)
|
||||
return col == col1 and col2 or col1
|
||||
end
|
||||
local function compute_colorpick(name, val)
|
||||
local color = db[format('%scolor', name)]
|
||||
if(db[format('%slow', name)] and tonumber(db[format('%slow', name)]) > 0 and val <= tonumber(db[format('%slow', name)])) then
|
||||
color = db[format('%slowcolor', name)]
|
||||
end
|
||||
if(db[format('%smedium', name)] and tonumber(db[format('%smedium', name)]) > 0 and val >= tonumber(db[format('%smedium', name)])) then
|
||||
color = db[format('%smediumcolor', name)]
|
||||
end
|
||||
if(db[format('%shigh', name)] and tonumber(db[format('%shigh', name)]) > 0 and val >= tonumber(db[format('%shigh', name)])) then
|
||||
color = db[format('%shighcolor', name)]
|
||||
end
|
||||
return color
|
||||
end
|
||||
local function compute()
|
||||
local c = date(db['clockstring'])
|
||||
local d = date(db['datestring'])
|
||||
for k in pairs(replaces) do
|
||||
if(k ~= L[k]) then
|
||||
|
@ -126,8 +140,20 @@ local function compute()
|
|||
l = l:gsub("%%world", w)
|
||||
l = l:gsub("%%local", h)
|
||||
local f = db['fpsstring']
|
||||
f = f:gsub("%%fps",floor(GetFramerate()))
|
||||
return c,d,l,f
|
||||
local fr = floor(GetFramerate())
|
||||
f = f:gsub("%%fps", fr)
|
||||
return {
|
||||
['clockstring'] = date(db['clockstring']),
|
||||
['datestring'] = d,
|
||||
['latencystring'] = l,
|
||||
['latencycolor'] = compute_colorpick('latency', w),
|
||||
['latencyvalue'] = w,
|
||||
['latencyhomevalue'] = h,
|
||||
['latencyhomecolor'] = compute_colorpick('latency', h),
|
||||
['fpscolor'] = compute_colorpick('fps', fr),
|
||||
['fpsstring'] = f,
|
||||
['fpsvalue'] = fr
|
||||
}
|
||||
end
|
||||
local function sortTab(a,b)
|
||||
return a['mem'] > b['mem']
|
||||
|
@ -143,13 +169,13 @@ local function OnTooltipShow(tip)
|
|||
child['lastainfo'] = GetTime() + ainfodelay
|
||||
end
|
||||
local ainfo = child['ainfo']
|
||||
local c,d,l,f = compute()
|
||||
local com = compute()
|
||||
tip:AddLine(childName)
|
||||
local col = "00ff00"
|
||||
if(db['expert']) then
|
||||
tip:AddLine(child:colorize(d,col))
|
||||
tip:AddLine(child:colorize(com['datestring'], col))
|
||||
else
|
||||
tip:AddLine(child:colorize(format("%s, %s.%s",L[date("%A")],date("%d"),L[date("%B")]),col))
|
||||
tip:AddLine(child:colorize(format("%s, %s.%s",L[date("%A")],date("%d"),L[date("%B")]), col))
|
||||
end
|
||||
col = toggleColor(col,"ffffff","00ff00")
|
||||
if(db["12-Hours"]) then
|
||||
|
@ -158,9 +184,9 @@ local function OnTooltipShow(tip)
|
|||
tip:AddDoubleLine(child:colorize(L['Time'],col),child:colorize(date("%H:%M:%S"),toggleColor(col,"ffffff","00ff00")))
|
||||
end
|
||||
col = toggleColor(col,"ffffff","00ff00")
|
||||
tip:AddDoubleLine(child:colorize(L['Latency'],col),child:colorize(format("%s ms",select(3,GetNetStats())),toggleColor(col,"ffffff","00ff00")))
|
||||
tip:AddDoubleLine(child:colorize(L['Latency'],col),child:colorize(format("%s ms", com['latencyvalue']), toggleColor(col,"ffffff","00ff00")))
|
||||
col = toggleColor(col,"ffffff","00ff00")
|
||||
tip:AddDoubleLine(child:colorize(L['FPS'],col),child:colorize(format("%i fps",floor(GetFramerate())),toggleColor(col,"ffffff","00ff00")))
|
||||
tip:AddDoubleLine(child:colorize(L['FPS'],col),child:colorize(format("%i fps",com['fpsvalue']),toggleColor(col,"ffffff","00ff00")))
|
||||
col = toggleColor(col,"ffffff","00ff00")
|
||||
tip:AddDoubleLine(child:colorize(L['AddOn Memory'],col),child:colorize(format("%i MB",floor(collectgarbage('count')/1024)),toggleColor(col,"ffffff","00ff00")))
|
||||
tip:AddLine(" ")
|
||||
|
@ -199,12 +225,13 @@ end
|
|||
local function OnDataUpdate()
|
||||
local line = childName
|
||||
if(db['expert']) then
|
||||
local c,d,l,f = compute()
|
||||
local com = compute()
|
||||
line = db['ldbstring']
|
||||
line = line:gsub("%%clock", child:colorize(c,db['clockcolor']))
|
||||
line = line:gsub("%%date", child:colorize(d,db['datecolor']))
|
||||
line = line:gsub("%%fps", child:colorize(f,db['fpscolor']))
|
||||
line = line:gsub("%%latency", child:colorize(l,db['latencycolor']))
|
||||
line = line:gsub("%%clock", child:colorize(com['clockstring'], db['clockcolor']))
|
||||
line = line:gsub("%%date", child:colorize(com['datestring'], db['datecolor']))
|
||||
line = line:gsub("%%fps", child:colorize(com['fpsvalue'], com['fpscolor']))
|
||||
line = line:gsub("%%latency", child:colorize(com['latencyvalue'], com['latencycolor']))
|
||||
line = line:gsub("%%home", child:colorize(com['latencyhomevalue'], com['latencyhomecolor']))
|
||||
else
|
||||
line = ''
|
||||
if(db["showClock"]) then
|
||||
|
@ -222,10 +249,10 @@ local function OnDataUpdate()
|
|||
else
|
||||
child:OnText(childName, childName)
|
||||
end
|
||||
C_Timer.After(db['update'] or 2, OnDataUpdate)
|
||||
end
|
||||
function child:update()
|
||||
OnDataUpdate()
|
||||
ticker:Cancel()
|
||||
ticker = C_Timer.NewTicker(db['update'] or 2, OnDataUpdate)
|
||||
end
|
||||
child['ldb'] = { -- https://github.com/tekkub/libdatabroker-1-1/wiki/Data-Specifications
|
||||
['type'] = 'data source', -- required: 'data source' or 'launcher'
|
||||
|
@ -239,7 +266,7 @@ local init = {
|
|||
-- print("setup ldb", childName, event)
|
||||
child.OnText = zzLDB.DefaultOnText
|
||||
db = child['db']
|
||||
C_Timer.After(db['update'], OnDataUpdate)
|
||||
ticker = C_Timer.NewTicker(db['update'] or 2, OnDataUpdate)
|
||||
end
|
||||
}
|
||||
addon.RegisterCallback(init, format("Init%s", childName), 'Setup', childName)
|
12
core.lua
12
core.lua
|
@ -33,6 +33,18 @@ child['specs'] = {
|
|||
['fpscolor'] = defcolor,
|
||||
['clockcolor'] = defcolor,
|
||||
['latencycolor'] = "ffff00",
|
||||
['fpshighcolor'] = defcolor,
|
||||
['fpsmediumcolor'] = defcolor,
|
||||
['fpslowcolor'] = defcolor,
|
||||
['latencyhighcolor'] = defcolor,
|
||||
['latencymediumcolor'] = defcolor,
|
||||
['latencylowcolor'] = defcolor,
|
||||
['fpshigh'] = 0,
|
||||
['fpsmedium'] = 0,
|
||||
['fpslow'] = 0,
|
||||
['latencyhigh'] = 0,
|
||||
['latencymedium'] = 0,
|
||||
['latencylow'] = 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -75,17 +75,36 @@ if L then
|
|||
%% is replaced by %.]=]
|
||||
L["Latencystring"] = "%world %local"
|
||||
L['fpsstring'] = "%fps"
|
||||
L['ldbstring'] = "%clock %date %fps %latency"
|
||||
L['ldbstring'] = "%clock %date %fps %latency %home"
|
||||
L["%i kB"] = "%i kB"
|
||||
L["%i ms"] = "%i ms"
|
||||
L["AddOns"] = "AddOns"
|
||||
L['CPU'] = 'CPU'
|
||||
L['total'] = 'Gesamt'
|
||||
L["CPU setting changed. Please Reload UI."] = "CPU Einstellung ge\195\164ndert. Bitte UI neu laden."
|
||||
L['fpsheader'] = ""
|
||||
L['Latency High'] = "Hohe Latenz"
|
||||
L['Latency High Desc'] = "Setze Wert auf 0 für Standardfarbe"
|
||||
L['Latency High Color'] = "Farbe hohe Latenz"
|
||||
L['Latency Medium'] = "Mittlere Latenz"
|
||||
L['Latency Medium Desc'] = "Setze Wert auf 0 für Standardfarbe"
|
||||
L['Latency Medium Color'] = "Farbe mittlere Latenz"
|
||||
L['Latency Low'] = "Niedrige Latenz"
|
||||
L['Latency Low Desc'] = "Setze Wert auf 0 für Standardfarbe"
|
||||
L['Latency Low Color'] = "Farbe niedrige Latenz"
|
||||
L['FPS High'] = "Hohe FPS"
|
||||
L['FPS High Desc'] = "Setze Wert auf 0 für Standardfarbe"
|
||||
L['FPS High Color'] = "Farbe hohe FPS"
|
||||
L['FPS Medium'] = "Mittlere FPS"
|
||||
L['FPS Medium Desc'] = "Setze Wert auf 0 für Standardfarbe"
|
||||
L['FPS Medium Color'] = "Farbe mittlere FPS"
|
||||
L['FPS Low'] = "Niedrige FPS"
|
||||
L['FPS Low Desc'] = "Setze Wert auf 0 für Standardfarbe"
|
||||
L['FPS Low Color'] = "Farbe niedrige FPS"
|
||||
end
|
||||
|
||||
-- ö \195\182 ß \195\159
|
||||
-- ü \195\188 ä \195\164
|
||||
-- Ä \195\132
|
||||
-- ö \195\182
|
||||
-- Ü \195\156
|
||||
-- <EFBFBD> \195\182 <20> \195\159
|
||||
-- <EFBFBD> \195\188 <20> \195\164
|
||||
-- <EFBFBD> \195\132
|
||||
-- <EFBFBD> \195\182
|
||||
-- <EFBFBD> \195\156
|
|
@ -75,11 +75,30 @@ if L then
|
|||
%% is replaced by %.]=]
|
||||
L["Latencystring"] = "%world %local"
|
||||
L['fpsstring'] = "%fps"
|
||||
L['ldbstring'] = "%clock %date %fps %latency"
|
||||
L['ldbstring'] = "%clock %date %fps %latency %home"
|
||||
L["%i kB"] = "%i kB"
|
||||
L["%i ms"] = "%i ms"
|
||||
L["AddOns"] = "AddOns"
|
||||
L['CPU'] = 'CPU'
|
||||
L['total'] = 'Total'
|
||||
L["CPU setting changed. Please Reload UI."] = "CPU setting changed. Please Reload UI."
|
||||
L['fpsheader'] = ""
|
||||
L['Latency High'] = "Latency High"
|
||||
L['Latency High Desc'] = "Set value 0 to disable this"
|
||||
L['Latency High Color'] = "Latency High Color"
|
||||
L['Latency Medium'] = "Latency Medium"
|
||||
L['Latency Medium Desc'] = "Set value 0 to disable this"
|
||||
L['Latency Medium Color'] = "Latency Medium Color"
|
||||
L['Latency Low'] = "Latency Low"
|
||||
L['Latency Low Desc'] = "Set value 0 to disable this"
|
||||
L['Latency Low Color'] = "Latency Low Color"
|
||||
L['FPS High'] = "FPS High"
|
||||
L['FPS High Desc'] = "Set value 0 to disable this"
|
||||
L['FPS High Color'] = "FPS High Color"
|
||||
L['FPS Medium'] = "FPS Medium"
|
||||
L['FPS Medium Desc'] = "Set value 0 to disable this"
|
||||
L['FPS Medium Color'] = "FPS Medium Color"
|
||||
L['FPS Low'] = "FPS Low"
|
||||
L['FPS Low Desc'] = "Set value 0 to disable this"
|
||||
L['FPS Low Color'] = "FPS Low Color"
|
||||
end
|
35
prefs.lua
35
prefs.lua
|
@ -22,8 +22,11 @@ end
|
|||
function child:GetPref(pref)
|
||||
--print("get", pref[#pref], pref['type'],db[pref[#pref]])
|
||||
if(pref['type'] == 'color') then
|
||||
local r,g,b = Hex2RGB(db[pref[#pref]])
|
||||
local r,g,b = 1, 1, 1
|
||||
if(db[pref[#pref]]) then
|
||||
r,g,b = Hex2RGB(db[pref[#pref]])
|
||||
-- print(Hex2RGB(db[pref[#pref]]))
|
||||
end
|
||||
return r/255,g/255,b/255,1
|
||||
end
|
||||
return db[pref[#pref]]
|
||||
|
@ -51,11 +54,37 @@ local init = {
|
|||
local menu3 = config:AddConfigMenu(options, L['Latency'], 5, child, { disabled = expert })
|
||||
config:AddConfigEntry(menu3,"latencystring","input",L['Latency'],nil,1)
|
||||
config:AddConfigEntry(menu3,"latencycolor","color",L['Latency'],nil,2)
|
||||
config:AddConfigEntry(menu3,"latencyinfo","description",L['Latencystring'],nil,100)
|
||||
config:AddConfigEntry(menu3,"latencyinfo","description",L['Latencystring'],nil,3)
|
||||
|
||||
config:AddConfigEntry(menu3,'fpsheader4',"header",L['fpsheader'],nil,4)
|
||||
config:AddConfigEntry(menu3,"latencyhigh","range",L['Latency High'],L['Latency High Desc'],5,0,500,1)
|
||||
config:AddConfigEntry(menu3,"latencyhighcolor","color",L['Latency High Color'],nil,6)
|
||||
|
||||
config:AddConfigEntry(menu3,'fpsheader5',"header",L['fpsheader'],nil,7)
|
||||
config:AddConfigEntry(menu3,"latencymedium","range",L['Latency Medium'],L['Latency Medium Desc'],8,0,500,1)
|
||||
config:AddConfigEntry(menu3,"latencymediumcolor","color",L['Latency Medium Color'],nil,9)
|
||||
|
||||
config:AddConfigEntry(menu3,'fpsheader6',"header",L['fpsheader'],nil,10)
|
||||
config:AddConfigEntry(menu3,"latencylow","range",L['Latency Low'],L['Latency Low Desc'],11,0,500,1)
|
||||
config:AddConfigEntry(menu3,"latencylowcolor","color",L['Latency Low Color'],nil,12)
|
||||
|
||||
local menu4 = config:AddConfigMenu(options, L['FPS'], 6, child, { disabled = expert })
|
||||
config:AddConfigEntry(menu4,"fpsstring","input",L['FPS'],nil,1)
|
||||
config:AddConfigEntry(menu4,"fpscolor","color",L['FPS'],nil,2)
|
||||
config:AddConfigEntry(menu4,"fpsinfo","description",L['fpsstring'],nil,100)
|
||||
config:AddConfigEntry(menu4,"fpsinfo","description",L['fpsstring'],nil,3)
|
||||
|
||||
config:AddConfigEntry(menu4,'fpsheader',"header",L['fpsheader'],nil,4)
|
||||
config:AddConfigEntry(menu4,"fpshigh","range",L['FPS High'],L['FPS High Desc'],5,0,500,1)
|
||||
config:AddConfigEntry(menu4,"fpshighcolor","color",L['FPS High Color'],nil,6)
|
||||
|
||||
config:AddConfigEntry(menu4,'fpsheader2',"header",L['fpsheader'],nil,7)
|
||||
config:AddConfigEntry(menu4,"fpsmedium","range",L['FPS Medium'],L['FPS Medium Desc'],8,0,500,1)
|
||||
config:AddConfigEntry(menu4,"fpsmediumcolor","color",L['FPS Medium Color'],nil,9)
|
||||
|
||||
config:AddConfigEntry(menu4,'fpsheader3',"header",L['fpsheader'],nil,10)
|
||||
config:AddConfigEntry(menu4,"fpslow","range",L['FPS Low'],L['FPS Low Desc'],11,0,500,1)
|
||||
config:AddConfigEntry(menu4,"fpslowcolor","color",L['FPS Low Color'],nil,12)
|
||||
|
||||
local menu5 = config:AddConfigMenu(options, L['LDB'], 5, child, { disabled = expert })
|
||||
config:AddConfigEntry(menu5,"ldbstring","input",L['LDB'],nil,1)
|
||||
config:AddConfigEntry(menu5,"ldbinfo","description",L['ldbstring'],nil,100)
|
||||
|
|
Loading…
Reference in New Issue