Quantcast

Added Display Option to toggle between using a small (default) or large font in the recipe list.

James D. Callahan III [07-07-10 - 07:41]
Added Display Option to toggle between using a small (default) or large font in the recipe list.
Filename
ARL.lua
Config.lua
Frame.lua
Locales/devel-enUS.lua
diff --git a/ARL.lua b/ARL.lua
index 121f0b4..da9a5e6 100644
--- a/ARL.lua
+++ b/ARL.lua
@@ -201,10 +201,12 @@ function addon:OnInitialize()
 				anchorTo = "",
 				anchorFrom = "",
 				uiscale = 1,
+				small_list_font = true,
 			},

 			-------------------------------------------------------------------------------
 			-- Tooltip Options
+			-------------------------------------------------------------------------------
 			tooltip = {
 				scale = 1,
 				acquire_fontsize = 11,
diff --git a/Config.lua b/Config.lua
index 512eadb..9c1ff95 100644
--- a/Config.lua
+++ b/Config.lua
@@ -606,6 +606,23 @@ local function giveDisplay()
 							  addon.Frame:SetScale(v)
 						  end,
 				},
+				small_list_font = {
+					order	= 4,
+					width	= "full",
+					type	= "toggle",
+					name	= L["Small Font"],
+					desc	= L["SMALL_FONT_DESC"],
+					get	= function()
+							  return addon.db.profile.frameopts.small_list_font
+						  end,
+					set	= function()
+							  addon.db.profile.frameopts.small_list_font = not addon.db.profile.frameopts.small_list_font
+
+							  if addon.Frame:IsVisible() then
+								  addon:Scan()
+							  end
+						  end,
+				},
 				closegui = {
 					width	= "full",
 					order	= 5,
diff --git a/Frame.lua b/Frame.lua
index 52639c1..586601b 100644
--- a/Frame.lua
+++ b/Frame.lua
@@ -2572,11 +2572,15 @@ do

 	-- Reset the current buttons/lines
 	function ListFrame:ClearLines()
+		local font_object = addon.db.profile.frameopts.small_list_font and "GameFontNormalSmall" or "GameFontNormal"
+
 		for i = 1, NUM_RECIPE_LINES do
 			local entry = self.entry_buttons[i]
 			local state = self.state_buttons[i]

 			entry.string_index = 0
+			entry.text:SetFontObject(font_object)
+
 			entry:SetText("")
 			entry:SetScript("OnEnter", nil)
 			entry:SetScript("OnLeave", nil)
@@ -2584,6 +2588,8 @@ do
 			entry:Disable()

 			state.string_index = 0
+			state.text:SetFontObject(font_object)
+
 			state:Hide()
 			state:SetScript("OnEnter", nil)
 			state:SetScript("OnLeave", nil)
diff --git a/Locales/devel-enUS.lua b/Locales/devel-enUS.lua
index b24fc0d..738bf20 100644
--- a/Locales/devel-enUS.lua
+++ b/Locales/devel-enUS.lua
@@ -174,6 +174,9 @@ L["Sort"]			= true
 L["SORTING_DESC"]		= "Change the way in which displayed recipes are sorted."
 L["TOOLTIP_OPTIONS_DESC"]	= "Allows you to specify how the tooltips for ARL behave.  The acquire tooltip lists the different information on how to acquire the recipe, whereas the spell tooltip lists the recipe information itself."
 L["MAP_OPTIONS_DESC"]		= "Allows you to change how ARL integrates into the world map and into the mini-map."
+
+L["Small Font"]			= true
+L["SMALL_FONT_DESC"]		= "Toggle on to use a smaller font for entries in the recipe list."
 L["Right"]			= true
 L["Left"]			= true
 L["Top"]			= true