Add text option, cleanup prefs

This commit is contained in:
rilgamon 2021-03-14 11:37:42 +01:00
parent 3e5178e1c5
commit f61c19a640
7 changed files with 40 additions and 19 deletions

View File

@ -11,7 +11,6 @@ function addonTable:SetupBanker()
dbb = dbf['banker']
faction = addonTable['storage']['faction']
realm = addonTable['storage']['realm']
addonTable['bankHandler'] :SetDB(dbb)
end
local mailframes = {}
local posFrame = CreateFrame("Frame")

View File

@ -68,7 +68,7 @@ function addonTable:displayMoney(money, abr)
money = addonTable:round(money / 10000,0) * 10000
end
end
return addonTable:MoneyString(money, color, db['abrevK'] and L['abrK'] or nil, db['abrevM'] and L['abrM'] or nil)
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'])
end
local pew_events = {}
function pew_events:PLAYER_MONEY(event)

View File

@ -41,6 +41,10 @@ if L then
L['showLog'] = "Logge Ver\195\164nderungen im Chat"
L['ttmenu_title'] = "Tooltip-Einstellungen"
L['ttmenu_desc'] = "Diese Einstellungen ver\195\164ndern den Broker-Tooltip"
L['noIcon'] = "Keine M\195\188nzen"
L['noIconDesk'] = "Benutze Text statt M\195\188nzsymbole"
L['Color text'] = "Farbtext"
L['Color text desc'] = "F\195\164rbe den Text in M\195\188nzfarbe"
end
-- ö \195\182 ß \195\159

View File

@ -41,4 +41,8 @@ if L then
L['showLog'] = "Log changes in chat"
L['ttmenu_title'] = "Tooltip Settings"
L['ttmenu_desc'] = "This settings modify the broker tooltip"
L['noIcon'] = "No Coins"
L['noIconDesk'] = "Use text instead of coin texture"
L['Color text'] = "Use color text"
L['Color text desc'] = "Colorize text in coin colors"
end

View File

@ -41,4 +41,8 @@ if L then
L['showLog'] = "Log changes in chat"
L['ttmenu_title'] = "Tooltip Settings"
L['ttmenu_desc'] = "This settings modify the broker tooltip"
L['noIcon'] = "No Coins"
L['noIconDesk'] = "Use text instead of coin texture"
L['Color text'] = "Use color text"
L['Color text desc'] = "Colorize text in coin colors"
end

View File

@ -41,4 +41,8 @@ if L then
L['showLog'] = "Log changes in chat"
L['ttmenu_title'] = "Tooltip Settings"
L['ttmenu_desc'] = "This settings modify the broker tooltip"
L['noIcon'] = "No Coins"
L['noIconDesk'] = "Use text instead of coin texture"
L['Color text'] = "Use color text"
L['Color text desc'] = "Colorize text in coin colors"
end

View File

@ -50,26 +50,32 @@ 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]
local menu = config:AddConfigMenu(addonTable['options'], L['Bankier'], addonTable['bankHandler'] , 2, { disabled = function() return db['disableBanker']
end})
local ttmenu = config:AddConfigEntry(main, "ttmenu", "group", L['ttmenu_title'], L['ttmenu_desc'], 9)
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)
config:AddConfigEntry(main, "showLog", "toggle", L['showLog'], nil, 1)
config:AddConfigEntry(main, "shortMoney", "toggle", L['shortMoney'], nil, 2)
config:AddConfigEntry(main, "disableBanker", "toggle", L['nobanker'], nil, 3)
config:AddConfigEntry(main, "deleteCharHeader", "header", L['DeleteChar'], nil, 9)
config:AddConfigEntry(main, "deleteChar", "select", L['DeleteChar'], L['DeleteCharDesc'], 10, buildSelectAll)
config:AddConfigEntry(main, "deleteCharOk", "toggle", L['DeleteCharOk'], nil , 11)
config:AddConfigEntry(main, "deleteCharExec", "execute", L['DeleteChar'], L['DeleteCharDesc'], 12, deleteChar)
config:AddConfigEntry(main, "abrevK", "toggle", L['abrevK'], nil, 4)
config:AddConfigEntry(main, "abrevM", "toggle", L['abrevM'], nil, 5)
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, "connectedRealms", "toggle", L['connectedRealms'], nil, 1)
config:AddConfigEntry(ttmenu, "sortDir", "toggle", L['sortDir'], nil, 2)
config:AddConfigEntry(main, "connectedRealms", "toggle", L['connectedRealms'], nil, 2)
config:AddConfigEntry(ttmenu, "accountMoney", "toggle", L['accountMoney'], L['accountMoneyDesc'], 4)
config:AddConfigEntry(main, "shortMoney", "toggle", L['shortMoney'], nil, 5)
config:AddConfigEntry(ttmenu, "shortMoneyTip", "toggle", L['shortMoneyTip'], nil, 5)
config:AddConfigEntry(main, "abrevK", "toggle", L['abrevK'], nil, 6)
config:AddConfigEntry(main, "abrevM", "toggle", L['abrevM'], nil, 6)
config:AddConfigEntry(main, "showLog", "toggle", L['showLog'], nil, 7)
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