From f61c19a6405200b9a8b29235c079e448a75e9ec8 Mon Sep 17 00:00:00 2001 From: rilgamon Date: Sun, 14 Mar 2021 11:37:42 +0100 Subject: [PATCH] Add text option, cleanup prefs --- banker.lua | 1 - core.lua | 2 +- locale_deDE.lua | 4 ++++ locale_enUS.lua | 4 ++++ locale_koKR.lua | 4 ++++ locale_ruRU.lua | 4 ++++ prefs.lua | 40 +++++++++++++++++++++++----------------- 7 files changed, 40 insertions(+), 19 deletions(-) diff --git a/banker.lua b/banker.lua index 7ed2c8c..8ca4e5e 100644 --- a/banker.lua +++ b/banker.lua @@ -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") diff --git a/core.lua b/core.lua index 0f2e2ff..4579007 100644 --- a/core.lua +++ b/core.lua @@ -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) diff --git a/locale_deDE.lua b/locale_deDE.lua index 77bfeb9..d51dcc8 100644 --- a/locale_deDE.lua +++ b/locale_deDE.lua @@ -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 diff --git a/locale_enUS.lua b/locale_enUS.lua index bb822ae..a96db89 100644 --- a/locale_enUS.lua +++ b/locale_enUS.lua @@ -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 \ No newline at end of file diff --git a/locale_koKR.lua b/locale_koKR.lua index 4ec5c7a..469e785 100644 --- a/locale_koKR.lua +++ b/locale_koKR.lua @@ -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 \ No newline at end of file diff --git a/locale_ruRU.lua b/locale_ruRU.lua index a72ad23..7c78fdd 100644 --- a/locale_ruRU.lua +++ b/locale_ruRU.lua @@ -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 \ No newline at end of file diff --git a/prefs.lua b/prefs.lua index ece90f7..c10da46 100644 --- a/prefs.lua +++ b/prefs.lua @@ -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 \ No newline at end of file