Quantcast

Added an option to change the title height/width of the crazy arrow

James Whitehead II [05-29-08 - 19:08]
Added an option to change the title height/width of the crazy arrow
Filename
Localization.enUS.lua
TomTom.lua
TomTom_Config.lua
TomTom_CrazyArrow.lua
diff --git a/Localization.enUS.lua b/Localization.enUS.lua
index 95d8740..65f8a74 100644
--- a/Localization.enUS.lua
+++ b/Localization.enUS.lua
@@ -76,12 +76,16 @@ TomTomLocals = {
 	["The display of the coordinate block can be customized by changing the options below."] = "The display of the coordinate block can be customized by changing the options below.",
 	["The floating waypoint arrow can change color depending on whether or nor you are facing your destination.  By default it will display green when you are facing it directly, and red when you are facing away from it.  These colors can be changed in this section.  Setting these options to the same color will cause the arrow to not change color at all"] = "The floating waypoint arrow can change color depending on whether or nor you are facing your destination.  By default it will display green when you are facing it directly, and red when you are facing away from it.  These colors can be changed in this section.  Setting these options to the same color will cause the arrow to not change color at all",
 	["There were no waypoints to remove in %s"] = "There were no waypoints to remove in %s",
-	["These options let you customize the size and opacity of the waypoint arrow, making it larger or partially transparent"] = "These options let you customize the size and opacity of the waypoint arrow, making it larger or partially transparent",
+	["These options let you customize the size and opacity of the waypoint arrow, making it larger or partially transparent, as well as limiting the size of the title display."] = "These options let you customize the size and opacity of the waypoint arrow, making it larger or partially transparent, as well as limiting the size of the title display.",
 	["This option will not remove any waypoints that are currently set to persist, but only effects new waypoints that get set"] = "This option will not remove any waypoints that are currently set to persist, but only effects new waypoints that get set",
 	["This option will toggle whether or not you are asked to confirm removing all waypoints.  If enabled, a dialog box will appear, requiring you to confirm removing the waypoints"] = "This option will toggle whether or not you are asked to confirm removing all waypoints.  If enabled, a dialog box will appear, requiring you to confirm removing the waypoints",
 	["This setting allows you to change the opacity of the waypoint arrow, making it transparent or opaque"] = "This setting allows you to change the opacity of the waypoint arrow, making it transparent or opaque",
 	["This setting allows you to change the scale of the waypoint arrow, making it larger or smaller"] = "This setting allows you to change the scale of the waypoint arrow, making it larger or smaller",
+	["This setting allows you to specify the maximum height of the title text.  Any titles that are longer than this height (in game pixels) will be truncated."] = "This setting allows you to specify the maximum height of the title text.  Any titles that are longer than this height (in game pixels) will be truncated.",
+	["This setting allows you to specify the maximum width of the title text.  Any titles that are longer than this width (in game pixels) will be wrapped to the next line."] = "This setting allows you to specify the maximum width of the title text.  Any titles that are longer than this width (in game pixels) will be wrapped to the next line.",
 	["This setting will control the distance at which the waypoint arrow switches to a downwards arrow, indicating you have arrived at your destination"] = "This setting will control the distance at which the waypoint arrow switches to a downwards arrow, indicating you have arrived at your destination",
+	["Title Height"] = "Title Height",
+	["Title Width"] = "Title Width",
 	["TomTom"] = "TomTom",
 	["TomTom Waypoint Arrow"] = "TomTom Waypoint Arrow",
 	["TomTom can display a tooltip containing information abouto waypoints, when they are moused over.  This setting toggles that functionality"] = "TomTom can display a tooltip containing information abouto waypoints, when they are moused over.  This setting toggles that functionality",
diff --git a/TomTom.lua b/TomTom.lua
index 5bd3bfe..fb451f0 100755
--- a/TomTom.lua
+++ b/TomTom.lua
@@ -81,6 +81,8 @@ function TomTom:ADDON_LOADED(event, addon)
 					menu = true,
 					scale = 1.0,
 					alpha = 1.0,
+					title_width = 0,
+					title_height = 0,
 				},
 				minimap = {
 					enable = true,
diff --git a/TomTom_Config.lua b/TomTom_Config.lua
index 148ee81..eebe6a9 100644
--- a/TomTom_Config.lua
+++ b/TomTom_Config.lua
@@ -195,7 +195,7 @@ local function createconfig()
 					help = {
 						type = "description",
 						order = 1,
-						name = L["These options let you customize the size and opacity of the waypoint arrow, making it larger or partially transparent"],
+						name = L["These options let you customize the size and opacity of the waypoint arrow, making it larger or partially transparent, as well as limiting the size of the title display."],
 					},
 					scale = {
 						type = "range",
@@ -210,7 +210,22 @@ local function createconfig()
 						desc = L["This setting allows you to change the opacity of the waypoint arrow, making it transparent or opaque"],
 						min = 0, max = 1.0, step = 0.05,
 						arg = "arrow.alpha",
-					}
+					},
+					title_width = {
+						type = "range",
+						name = L["Title Width"],
+						desc = L["This setting allows you to specify the maximum width of the title text.  Any titles that are longer than this width (in game pixels) will be wrapped to the next line."],
+						min = 0, max = 500, step = 1,
+						arg = "arrow.title_width",
+					},
+					title_height = {
+						type = "range",
+						name = L["Title Height"],
+						desc = L["This setting allows you to specify the maximum height of the title text.  Any titles that are longer than this height (in game pixels) will be truncated."],
+						min = 0, max = 300, step = 1,
+						arg = "arrow.title_height",
+					},
+
 				}
 			},
 			color = {
diff --git a/TomTom_CrazyArrow.lua b/TomTom_CrazyArrow.lua
index 200651f..f0b6681 100644
--- a/TomTom_CrazyArrow.lua
+++ b/TomTom_CrazyArrow.lua
@@ -238,6 +238,11 @@ function TomTom:ShowHideCrazyArrow()
 		-- Set the scale and alpha
 		wayframe:SetScale(TomTom.db.profile.arrow.scale)
 		wayframe:SetAlpha(TomTom.db.profile.arrow.alpha)
+		local width = TomTom.db.profile.arrow.title_width
+		local height = TomTom.db.profile.arrow.title_height
+
+		wayframe.title:SetWidth(width)
+		wayframe.title:SetHeight(height)

 		if self.profile.arrow.showtta then
 			tta:Show()