changeset 16:d5c8e2c42e04

- Added an options in order to change the size of the dance bar.
author Tercio
date Mon, 08 Jun 2015 12:54:24 -0300
parents 211038c8d073
children 0c160948ac5e
files Hansgar_And_Franzok_Assist.lua
diffstat 1 files changed, 51 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/Hansgar_And_Franzok_Assist.lua	Thu Apr 30 14:06:01 2015 -0300
+++ b/Hansgar_And_Franzok_Assist.lua	Mon Jun 08 12:54:24 2015 -0300
@@ -19,7 +19,7 @@
 --local f = CreateFrame ("frame", "Hansgar_And_Franzok_Assist", UIParent)
 local f = DF:Create1PxPanel (_, 155, 166, "Hans & Franz", "Hansgar_And_Franzok_Assist", nil, "top", true)
 f:SetFrameStrata ("DIALOG")
-f.version = "v0.14"
+f.version = "v0.15"
 
 f.Close:SetScript ("OnClick", function (self)
 	if (f.StampersPhase) then
@@ -351,6 +351,9 @@
 		if (db.NO_VERTICAL == nil) then
 			db.NO_VERTICAL = false
 		end
+		if (db.DANCE_SIZE == nil) then
+			db.DANCE_SIZE = 6
+		end
 		--
 		
 		f:SetLockState (true)
@@ -542,6 +545,18 @@
 			tframe.facing = db.FACING_SIDE == 1
 		end
 	
+	elseif (command == "dancesize") then
+		local t = tonumber (rest)
+		if (t) then
+			db.DANCE_SIZE = t
+			f:SetDanceBarSize()
+			print ("|cFFFFAA00Hansgar and Franzok Assist|r dance bar size set to: ", t)
+		else
+			print ("|cFFFFAA00Hansgar and Franzok Assist|r invalid size, usage: /hansgar dancesize <width>.", t)
+		end
+		
+		f:SetDanceBarSize()
+	
 	elseif (command == "dance") then
 		db.SHOW_DANCE = not db.SHOW_DANCE
 		if (db.SHOW_DANCE) then
@@ -594,6 +609,16 @@
 		name = "Stampers Delay",
 	},
 	{
+		type = "range",
+		get = function() return db.DANCE_SIZE end,
+		set = function (self, fixedparam, value) f:SetDanceBarSize (value) end,
+		min = 3,
+		max = 25,
+		step = 1,
+		desc = "Set the dance bar size, the higher is the value, more thicker will be the bar.",
+		name = "Dance Bar Size",
+	},
+	{
 		type = "toggle",
 		get = function() return db.FRAME_LOCK end,
 		set = function (self, fixedparam, value) 
@@ -733,8 +758,8 @@
 
 local build_options_panel = function()
 	local options_frame = DF:CreateOptionsFrame ("HansgarFranzokAssistOptions", "Hans & Franz Assist", 1)
-	options_frame:SetHeight (200)
-	DF:BuildMenu (options_frame, options_panel, 15, -60, 200)
+	options_frame:SetHeight (220)
+	DF:BuildMenu (options_frame, options_panel, 15, -60, 220)
 	options_frame:SetBackdropColor (0, 0, 0, .9)
 end
 
@@ -1023,6 +1048,28 @@
 	end
 end
 
+function f:SetDanceBarSize (size)
+	if (not size) then
+		size = db.DANCE_SIZE
+	end
+	db.DANCE_SIZE = size
+	
+	t1:SetSize (player_pos_frame:GetWidth()*0.30, size)
+	t2:SetSize (player_pos_frame:GetWidth()*0.15, size)
+	middle:SetSize (player_pos_frame:GetWidth()*0.10, size)
+	t3:SetSize (player_pos_frame:GetWidth()*0.15, size)
+	t4:SetSize (player_pos_frame:GetWidth()*0.30, size)	
+	
+	t1_2:SetSize (size, player_pos_frame:GetWidth()*0.30)
+	t2_2:SetSize (size, player_pos_frame:GetWidth()*0.15)
+	middle_2:SetSize (size, player_pos_frame:GetWidth()*0.10)
+	t3_2:SetSize (size, player_pos_frame:GetWidth()*0.15)
+	t4_2:SetSize (size, player_pos_frame:GetWidth()*0.30)
+	
+	player_pos_frame2:SetSize (size, 155)
+	player_pos_frame:SetSize (155, size)
+end
+
 function f:SetLockState (just_refresh)
 
 	if (not just_refresh) then
@@ -1137,6 +1184,7 @@
 	
 	f.frames_built = true
 	
+	f:SetDanceBarSize()
 end
 
 local safe_track = {