comparison Hansgar_And_Franzok_Assist.lua @ 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 dc1c77254f80
comparison
equal deleted inserted replaced
15:211038c8d073 16:d5c8e2c42e04
17 local _ 17 local _
18 18
19 --local f = CreateFrame ("frame", "Hansgar_And_Franzok_Assist", UIParent) 19 --local f = CreateFrame ("frame", "Hansgar_And_Franzok_Assist", UIParent)
20 local f = DF:Create1PxPanel (_, 155, 166, "Hans & Franz", "Hansgar_And_Franzok_Assist", nil, "top", true) 20 local f = DF:Create1PxPanel (_, 155, 166, "Hans & Franz", "Hansgar_And_Franzok_Assist", nil, "top", true)
21 f:SetFrameStrata ("DIALOG") 21 f:SetFrameStrata ("DIALOG")
22 f.version = "v0.14" 22 f.version = "v0.15"
23 23
24 f.Close:SetScript ("OnClick", function (self) 24 f.Close:SetScript ("OnClick", function (self)
25 if (f.StampersPhase) then 25 if (f.StampersPhase) then
26 return f:StopTracking() 26 return f:StopTracking()
27 end 27 end
349 db.STOP_CAST = true 349 db.STOP_CAST = true
350 end 350 end
351 if (db.NO_VERTICAL == nil) then 351 if (db.NO_VERTICAL == nil) then
352 db.NO_VERTICAL = false 352 db.NO_VERTICAL = false
353 end 353 end
354 if (db.DANCE_SIZE == nil) then
355 db.DANCE_SIZE = 6
356 end
354 -- 357 --
355 358
356 f:SetLockState (true) 359 f:SetLockState (true)
357 360
358 elseif (event == "ENCOUNTER_START" or event == "ENCOUNTER_END") then 361 elseif (event == "ENCOUNTER_START" or event == "ENCOUNTER_END") then
540 else 543 else
541 print ("|cFFFFAA00Hansgar and Franzok Assist|r auto facing disabled.") 544 print ("|cFFFFAA00Hansgar and Franzok Assist|r auto facing disabled.")
542 tframe.facing = db.FACING_SIDE == 1 545 tframe.facing = db.FACING_SIDE == 1
543 end 546 end
544 547
548 elseif (command == "dancesize") then
549 local t = tonumber (rest)
550 if (t) then
551 db.DANCE_SIZE = t
552 f:SetDanceBarSize()
553 print ("|cFFFFAA00Hansgar and Franzok Assist|r dance bar size set to: ", t)
554 else
555 print ("|cFFFFAA00Hansgar and Franzok Assist|r invalid size, usage: /hansgar dancesize <width>.", t)
556 end
557
558 f:SetDanceBarSize()
559
545 elseif (command == "dance") then 560 elseif (command == "dance") then
546 db.SHOW_DANCE = not db.SHOW_DANCE 561 db.SHOW_DANCE = not db.SHOW_DANCE
547 if (db.SHOW_DANCE) then 562 if (db.SHOW_DANCE) then
548 if (f.on_encounter) then 563 if (f.on_encounter) then
549 f:StartTrackPlayerPosition() 564 f:StartTrackPlayerPosition()
590 min = 4, 605 min = 4,
591 max = 8, 606 max = 8,
592 step = 1, 607 step = 1,
593 desc = "Time in seconds to move out from a heating up stamper.", 608 desc = "Time in seconds to move out from a heating up stamper.",
594 name = "Stampers Delay", 609 name = "Stampers Delay",
610 },
611 {
612 type = "range",
613 get = function() return db.DANCE_SIZE end,
614 set = function (self, fixedparam, value) f:SetDanceBarSize (value) end,
615 min = 3,
616 max = 25,
617 step = 1,
618 desc = "Set the dance bar size, the higher is the value, more thicker will be the bar.",
619 name = "Dance Bar Size",
595 }, 620 },
596 { 621 {
597 type = "toggle", 622 type = "toggle",
598 get = function() return db.FRAME_LOCK end, 623 get = function() return db.FRAME_LOCK end,
599 set = function (self, fixedparam, value) 624 set = function (self, fixedparam, value)
731 }, 756 },
732 } 757 }
733 758
734 local build_options_panel = function() 759 local build_options_panel = function()
735 local options_frame = DF:CreateOptionsFrame ("HansgarFranzokAssistOptions", "Hans & Franz Assist", 1) 760 local options_frame = DF:CreateOptionsFrame ("HansgarFranzokAssistOptions", "Hans & Franz Assist", 1)
736 options_frame:SetHeight (200) 761 options_frame:SetHeight (220)
737 DF:BuildMenu (options_frame, options_panel, 15, -60, 200) 762 DF:BuildMenu (options_frame, options_panel, 15, -60, 220)
738 options_frame:SetBackdropColor (0, 0, 0, .9) 763 options_frame:SetBackdropColor (0, 0, 0, .9)
739 end 764 end
740 765
741 f.OpenOptionsPanel = function() 766 f.OpenOptionsPanel = function()
742 if (not HansgarFranzokAssistOptions) then 767 if (not HansgarFranzokAssistOptions) then
1021 block.cooldown:SetDrawEdge (true) 1046 block.cooldown:SetDrawEdge (true)
1022 end 1047 end
1023 end 1048 end
1024 end 1049 end
1025 1050
1051 function f:SetDanceBarSize (size)
1052 if (not size) then
1053 size = db.DANCE_SIZE
1054 end
1055 db.DANCE_SIZE = size
1056
1057 t1:SetSize (player_pos_frame:GetWidth()*0.30, size)
1058 t2:SetSize (player_pos_frame:GetWidth()*0.15, size)
1059 middle:SetSize (player_pos_frame:GetWidth()*0.10, size)
1060 t3:SetSize (player_pos_frame:GetWidth()*0.15, size)
1061 t4:SetSize (player_pos_frame:GetWidth()*0.30, size)
1062
1063 t1_2:SetSize (size, player_pos_frame:GetWidth()*0.30)
1064 t2_2:SetSize (size, player_pos_frame:GetWidth()*0.15)
1065 middle_2:SetSize (size, player_pos_frame:GetWidth()*0.10)
1066 t3_2:SetSize (size, player_pos_frame:GetWidth()*0.15)
1067 t4_2:SetSize (size, player_pos_frame:GetWidth()*0.30)
1068
1069 player_pos_frame2:SetSize (size, 155)
1070 player_pos_frame:SetSize (155, size)
1071 end
1072
1026 function f:SetLockState (just_refresh) 1073 function f:SetLockState (just_refresh)
1027 1074
1028 if (not just_refresh) then 1075 if (not just_refresh) then
1029 db.FRAME_LOCK = not db.FRAME_LOCK 1076 db.FRAME_LOCK = not db.FRAME_LOCK
1030 end 1077 end
1135 1182
1136 f:SetLockState (true) 1183 f:SetLockState (true)
1137 1184
1138 f.frames_built = true 1185 f.frames_built = true
1139 1186
1187 f:SetDanceBarSize()
1140 end 1188 end
1141 1189
1142 local safe_track = { 1190 local safe_track = {
1143 --space 1 1191 --space 1
1144 { 1192 {