From c20d52e4a993e18ced9705ab27d070aaeae72787 Mon Sep 17 00:00:00 2001 From: "James D. Callahan III" Date: Wed, 7 Jul 2010 03:39:34 -0400 Subject: [PATCH] Resetting the GUI's position no longer resets the tooltip scale or font size. --- ARL.lua | 8 ++++++-- Config.lua | 31 +++++++++++++++++++------------ Frame.lua | 8 ++++---- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/ARL.lua b/ARL.lua index 65d0fbc..121f0b4 100644 --- a/ARL.lua +++ b/ARL.lua @@ -201,11 +201,15 @@ function addon:OnInitialize() anchorTo = "", anchorFrom = "", uiscale = 1, - tooltipscale = .9, - fontsize = 11, }, ------------------------------------------------------------------------------- + -- Tooltip Options + tooltip = { + scale = 1, + acquire_fontsize = 11, + }, + ------------------------------------------------------------------------------- -- Sorting Options ------------------------------------------------------------------------------- sorting = "Ascending", diff --git a/Config.lua b/Config.lua index 39ea2f0..512eadb 100644 --- a/Config.lua +++ b/Config.lua @@ -35,14 +35,17 @@ local function giveProfiles() end local function ResetGUI() + local options = addon.db.profile.frameopts + addon.Frame:Hide() - addon.db.profile.frameopts.offsetx = 0 - addon.db.profile.frameopts.offsety = 0 - addon.db.profile.frameopts.anchorTo = "" - addon.db.profile.frameopts.anchorFrom = "" - addon.db.profile.frameopts.uiscale = 1 - addon.db.profile.frameopts.tooltipscale = .9 - addon.db.profile.frameopts.fontsize = 11 + + options.offsetx = 0 + options.offsety = 0 + options.anchorTo = "" + options.anchorFrom = "" + options.uiscale = 1 + options.small_list_font = true + addon.Frame:Show() end @@ -644,7 +647,7 @@ local function giveDisplay() type = "description", name = L["TOOLTIP_OPTIONS_DESC"] .. "\n", }, - fontsize = { + tooltip_fontsize = { order = 19, type = "range", name = _G.FONT_SIZE, @@ -653,8 +656,12 @@ local function giveDisplay() max = 20, step = 1, bigStep = 1, - get = function() return addon.db.profile.frameopts.fontsize end, - set = function(info, v) addon.db.profile.frameopts.fontsize = v end, + get = function() + return addon.db.profile.tooltip.acquire_fontsize + end, + set = function(info, v) + addon.db.profile.tooltip.acquire_fontsize = v + end, }, tooltipscale = { order = 20, @@ -666,10 +673,10 @@ local function giveDisplay() step = .05, bigStep = .05, get = function() - return addon.db.profile.frameopts.tooltipscale + return addon.db.profile.tooltip.scale end, set = function(info, v) - addon.db.profile.frameopts.tooltipscale = v + addon.db.profile.tooltip.scale = v end, }, acquiretooltiplocation = { diff --git a/Frame.lua b/Frame.lua index 8eb266d..52639c1 100644 --- a/Frame.lua +++ b/Frame.lua @@ -476,7 +476,7 @@ do -- will do that for me. local function ttAdd( leftPad, -- number of times to pad two spaces on left side - textSize, -- add to or subtract from addon.db.profile.frameopts.fontsize to get fontsize + textSize, -- add to or subtract from addon.db.profile.tooltip.acquire_fontsize to get fontsize narrow, -- if 1, use ARIALN instead of FRITZQ str1, -- left-hand string hexcolor1, -- hex color code for left-hand side @@ -490,7 +490,7 @@ do local font = narrow and narrowFont or normalFont local fontObj = narrow and narrowFontObj or normalFontObj - fontSize = addon.db.profile.frameopts.fontsize + textSize + fontSize = addon.db.profile.tooltip.acquire_fontsize + textSize fontObj:SetFont(font, fontSize) acquire_tip:SetFont(fontObj) @@ -542,7 +542,7 @@ do spell_tip:SetBackdrop(GameTooltip:GetBackdrop()) spell_tip:SetBackdropColor(GameTooltip:GetBackdropColor()) spell_tip:SetBackdropBorderColor(GameTooltip:GetBackdropBorderColor()) - spell_tip:SetScale(addon.db.profile.frameopts.tooltipscale) + spell_tip:SetScale(addon.db.profile.tooltip.scale) spell_tip:SetClampedToScreen(true) spell_tip:SetHyperlink(link) spell_tip:Show() @@ -828,7 +828,7 @@ do local _, _, _, quality_color = GetItemQualityColor(recipe.quality) acquire_tip:Clear() - acquire_tip:SetScale(addon.db.profile.frameopts.tooltipscale) + acquire_tip:SetScale(addon.db.profile.tooltip.scale) acquire_tip:AddHeader() acquire_tip:SetCell(1, 1, quality_color..recipe.name, "CENTER", 2) -- 1.7.9.5