From bab351de00b48ce2c9cb5232b934e7bdb07ec064 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Wed, 27 Jul 2016 20:10:23 +0300 Subject: [PATCH] fonts and shit --- ElvUI_SLE/defaults/profile.lua | 10 ++++ ElvUI_SLE/locales/english.lua | 7 +++ ElvUI_SLE/locales/russian.lua | 7 +++ ElvUI_SLE/options/skins_c.lua | 73 +++++++++++++++++++++++++---- ElvUI_SLE/skins/blizzard/merchantList.lua | 28 ++++++----- ElvUI_SLE/skins/skins.lua | 11 +++++ 6 files changed, 116 insertions(+), 20 deletions(-) diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua index 564bdfd..f22bdc4 100644 --- a/ElvUI_SLE/defaults/profile.lua +++ b/ElvUI_SLE/defaults/profile.lua @@ -556,6 +556,16 @@ P["sle"] = { ["underlineClass"] = false, ["underlineColor"] = {r = 1, g = 0.82, b = 0}, }, + ["merchant"] = { + ["list"] = { + ["nameFont"] = "PT Sans Narrow", + ["nameSize"] = 13, + ["nameOutline"] = "OUTLINE", + ["subFont"] = "PT Sans Narrow", + ["subSize"] = 12, + ["subOutline"] = "OUTLINE", + }, + }, }, --Unitfrmes ["unitframes"] = { diff --git a/ElvUI_SLE/locales/english.lua b/ElvUI_SLE/locales/english.lua index 7dae1f3..3b55460 100644 --- a/ElvUI_SLE/locales/english.lua +++ b/ElvUI_SLE/locales/english.lua @@ -689,6 +689,13 @@ L["SLE_QUESTKING_Required"] = " Required: " L["ElvUI Objective Tracker"] = true L["ElvUI Skins"] = true L["As List"] = true +L["List Style Fonts"] = true +L["Item Name Font"] = true +L["Item Name Size"] = true +L["Item Name Outline"] = true +L["Item Info Font"] = true +L["Item Info Size"] = true +L["Item Info Outline"] = true --Toolbars L["We are sorry, but you can't do this now. Try again after the end of this combat."] = true diff --git a/ElvUI_SLE/locales/russian.lua b/ElvUI_SLE/locales/russian.lua index a8c10be..f367839 100644 --- a/ElvUI_SLE/locales/russian.lua +++ b/ElvUI_SLE/locales/russian.lua @@ -680,6 +680,13 @@ L["Subpages are blocks of 10 items. This option set how many of subpages will be L["ElvUI Objective Tracker"] = "Список задач ElvUI" L["ElvUI Skins"] = "Скины ElvUI" L["As List"] = "Списком" +L["List Style Fonts"] = "Шрифты стиля списка" +L["Item Name Font"] = "Шрифт названия" +L["Item Name Size"] = "Размер названия" +L["Item Name Outline"] = "Граница названия" +L["Item Info Font"] = "Шрифт информации" +L["Item Info Size"] = "Размер информации" +L["Item Info Outline"] = "Граница информации" --Toolbars L["We are sorry, but you can't do this now. Try again after the end of this combat."] = "Извините, но Вы не можете этого сделать сейчас. Попробуйте снова после окончания текущего боя." diff --git a/ElvUI_SLE/options/skins_c.lua b/ElvUI_SLE/options/skins_c.lua index f5bc7dc..a0a9a54 100644 --- a/ElvUI_SLE/options/skins_c.lua +++ b/ElvUI_SLE/options/skins_c.lua @@ -337,14 +337,6 @@ local function configTable() type = "toggle", name = L["Enable"], }, - style = { - order = 2, type = "select", - name = L["Style"], - values = { - ["Default"] = DEFAULT, - ["List"] = L["As List"], - }, - }, subpages = { order = 2, type = 'range', @@ -353,6 +345,71 @@ local function configTable() min = 2, max = 5, step = 1, disabled = function() return not E.private.sle.skins.merchant.enable or E.private.sle.skins.merchant.style ~= "Default" end, }, + style = { + order = 3, type = "select", + name = L["Style"], + values = { + ["Default"] = DEFAULT, + ["List"] = L["As List"], + }, + }, + listFonts = { + order = 4, + name = L["List Style Fonts"], + type = "group", + guiInline = true, + disabled = function() return E.private.sle.skins.merchant.style ~= "List" end, + get = function(info) return E.db.sle.skins.merchant.list[ info[#info] ] end, + set = function(info, value) E.db.sle.skins.merchant.list[ info[#info] ] = value; Sk:Media() end, + args = { + nameFont = { + type = "select", dialogControl = 'LSM30_Font', + order = 1, + name = L["Item Name Font"], + values = AceGUIWidgetLSMlists.font, + }, + nameSize = { + order = 2, + name = L["Item Name Size"], + type = "range", + min = 8, max = 32, step = 1, + }, + nameOutline = { + order = 3, + name = L["Item Name Outline"], + type = "select", + values = { + ["NONE"] = L["None"], + ["OUTLINE"] = 'OUTLINE', + ["MONOCHROMEOUTLINE"] = 'MONOCROMEOUTLINE', + ["THICKOUTLINE"] = 'THICKOUTLINE', + }, + }, + subFont = { + type = "select", dialogControl = 'LSM30_Font', + order = 4, + name = L["Item Info Font"], + values = AceGUIWidgetLSMlists.font, + }, + subSize = { + order = 5, + name = L["Item Info Size"], + type = "range", + min = 8, max = 32, step = 1, + }, + subOutline = { + order = 6, + name = L["Item Info Outline"], + type = "select", + values = { + ["NONE"] = L["None"], + ["OUTLINE"] = 'OUTLINE', + ["MONOCHROMEOUTLINE"] = 'MONOCROMEOUTLINE', + ["THICKOUTLINE"] = 'THICKOUTLINE', + }, + }, + } + }, }, }, petbattles = { diff --git a/ElvUI_SLE/skins/blizzard/merchantList.lua b/ElvUI_SLE/skins/blizzard/merchantList.lua index 7434799..410956e 100644 --- a/ElvUI_SLE/skins/blizzard/merchantList.lua +++ b/ElvUI_SLE/skins/blizzard/merchantList.lua @@ -1,6 +1,7 @@ local SLE, T, E, L, V, P, G = unpack(select(2, ...)) local Sk = SLE:GetModule("Skins") local S = E:GetModule('Skins') +local LSM = LibStub("LibSharedMedia-3.0") --GLOBALS: CreateFrame, hooksecurefunc, ChatFontSmall, UIParent, INVSLOT_FIRST_EQUIPPED, INVSLOT_LAST_EQUIPPED --Rebuilding Merchant Frame as a scrollable list. Based on a code by Nils Ruesch (xMerchant addon) local _G = _G @@ -611,17 +612,6 @@ local function Create_ListButton(frame, i) highlight:SetTexture("Interface\\Buttons\\UI-Listbox-Highlight2"); highlight:Hide(); - local itemname = button:CreateFontString("ARTWORK", "$parentItemName", "GameFontHighlightSmall"); - button.itemname = itemname; - itemname:SetPoint("TOPLEFT", 30.4, -3); - itemname:SetJustifyH("LEFT"); - - local iteminfo = button:CreateFontString("ARTWORK", "$parentItemInfo", "GameFontDisableSmall"); - button.iteminfo = iteminfo; - iteminfo:SetPoint("BOTTOMLEFT", 30.4, 3); - iteminfo:SetJustifyH("LEFT"); - iteminfo:SetTextHeight(12); - local icon = button:CreateTexture("$parentIcon", "BORDER"); button.icon = icon; icon:SetWidth(25.4); @@ -629,11 +619,25 @@ local function Create_ListButton(frame, i) icon:SetPoint("LEFT", 2, 0); icon:SetTexture("Interface\\Icons\\temp"); + local itemname = button:CreateFontString("ARTWORK", "$parentItemName") + button.itemname = itemname; + itemname:SetFont(LSM:Fetch('font', E.db.sle.skins.merchant.list.nameFont), E.db.sle.skins.merchant.list.nameSize, E.db.sle.skins.merchant.list.nameOutline) + itemname:SetPoint("TOPLEFT", icon, "TOPRIGHT", 4, -3); + itemname:SetJustifyH("LEFT"); + + local iteminfo = button:CreateFontString("ARTWORK", "$parentItemInfo") + button.iteminfo = iteminfo; + iteminfo:SetFont(LSM:Fetch('font', E.db.sle.skins.merchant.list.subFont), E.db.sle.skins.merchant.list.subSize, E.db.sle.skins.merchant.list.subOutline) + -- iteminfo:SetPoint("BOTTOMLEFT", 30.4, 3); + iteminfo:SetPoint("BOTTOMLEFT", icon, "BOTTOMRIGHT", 4, -3); + iteminfo:SetJustifyH("LEFT"); + local money = button:CreateFontString("ARTWORK", "$parentMoney", "GameFontHighlight"); button.money = money; money:SetPoint("RIGHT", -2, 0); money:SetJustifyH("RIGHT"); - itemname:SetPoint("RIGHT", money, "LEFT", -2, 0); + itemname:SetPoint("BOTTOMRIGHT", money, "LEFT", -2, 0); + iteminfo:SetPoint("TOPRIGHT", money, "LEFT", -2, 0); button.item = {}; for j=1, MAX_ITEM_COST do diff --git a/ElvUI_SLE/skins/skins.lua b/ElvUI_SLE/skins/skins.lua index 497c88e..03c2c1d 100644 --- a/ElvUI_SLE/skins/skins.lua +++ b/ElvUI_SLE/skins/skins.lua @@ -24,11 +24,22 @@ function Sk:CreateUnderline(frame, texture, shadow, height) return line end +function Sk:Media() + if E.private.skins.blizzard.enable == true or E.private.skins.blizzard.merchant == true or E.private.sle.skins.merchant.enable == true and E.private.sle.skins.merchant.style == "List" then + for i = 1, 10 do + local button = _G["SLE_ListMerchantFrame_Button"..i] + button.itemname:SetFont(LSM:Fetch('font', E.db.sle.skins.merchant.list.nameFont), E.db.sle.skins.merchant.list.nameSize, E.db.sle.skins.merchant.list.nameOutline) + button.iteminfo:SetFont(LSM:Fetch('font', E.db.sle.skins.merchant.list.subFont), E.db.sle.skins.merchant.list.subSize, E.db.sle.skins.merchant.list.subOutline) + end + end +end + function Sk:Initialize() function Sk:ForUpdateAll() Sk:Update_ObjectiveTrackerUnderlinesVisibility() Sk:Update_ObjectiveTrackerUnderlinesColor() + Sk:Media() end end -- 1.7.9.5