Skip to content

Commit

Permalink
Fixing buff font problem and position
Browse files Browse the repository at this point in the history
  • Loading branch information
Geigerkind committed Dec 21, 2016
1 parent 4351889 commit 438dc24
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 6 deletions.
42 changes: 41 additions & 1 deletion VCB.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

-- Global variables
VCB_NAME = "Vanilla Consolidate Buffs"
VCB_VERSION = "3.3"
VCB_VERSION = "3.4"
VCB_IS_LOADED = false
VCB_BF_DUMMY_MODE = false
VCB_FONT_ARRAY = {}
Expand Down Expand Up @@ -249,6 +249,16 @@ VCB_THEME[1] = {
WP_TIMER_fontsize = 10,
MISC_disable_CF = false,
MISC_disable_BB = false,
BF_POS = {
[1] = "CENTER",
[2] = 0,
[3] = 0,
},
DBF_POS = {
[1] = "CENTER",
[2] = 0,
[3] = 0,
},
}

--[[
Expand All @@ -261,6 +271,7 @@ function VCB_OnLoad()
this:RegisterEvent("PARTY_MEMBERS_CHANGED")
this:RegisterEvent("RAID_ROSTER_UPDATE")
this:RegisterEvent("PLAYER_ENTERING_WORLD")
this:RegisterEvent("PLAYER_LOGOUT")

SLASH_VCB1 = "/VanillaConsolidateBuffs"
SLASH_VCB2 = "/vanillaconsolidatebuffs"
Expand Down Expand Up @@ -478,6 +489,16 @@ function VCB_OnEvent(event)
WP_TIMER_fontsize = 10,
MISC_disable_CF = false,
MISC_disable_BB = false,
BF_POS = {
[1] = "CENTER",
[2] = 0,
[3] = 0,
},
DBF_POS = {
[1] = "CENTER",
[2] = 0,
[3] = 0,
},
}
end
if VCB_BF_LOCKED == nil then
Expand Down Expand Up @@ -579,6 +600,25 @@ function VCB_OnEvent(event)
end
elseif (event == "PLAYER_ENTERING_WORLD") then
VCB_BF_WEAPON_BUTTON_OnEvent(false)
if (VCB_SAVE["BF_POS"] and VCB_SAVE["BF_POS"][1]) then
VCB_BF_BUFF_FRAME:ClearAllPoints()
VCB_BF_BUFF_FRAME:SetPoint(VCB_SAVE["BF_POS"][1], UIParent, VCB_SAVE["BF_POS"][1], VCB_SAVE["BF_POS"][2], VCB_SAVE["BF_POS"][3])
end
if (VCB_SAVE["DBF_POS"] and VCB_SAVE["DBF_POS"][1]) then
VCB_BF_DEBUFF_FRAME:ClearAllPoints()
VCB_BF_DEBUFF_FRAME:SetPoint(VCB_SAVE["DBF_POS"][1], UIParent, VCB_SAVE["DBF_POS"][1], VCB_SAVE["DBF_POS"][2], VCB_SAVE["DBF_POS"][3])
end
elseif (event == "PLAYER_LOGOUT") then
local point, _, _, xOfs, yOfs = VCB_BF_BUFF_FRAME:GetPoint()
VCB_SAVE["BF_POS"] = {}
VCB_SAVE["BF_POS"][1] = point;
VCB_SAVE["BF_POS"][2] = xOfs;
VCB_SAVE["BF_POS"][3] = yOfs;
local point, _, _, xOfs, yOfs = VCB_BF_DEBUFF_FRAME:GetPoint()
VCB_SAVE["DBF_POS"] = {}
VCB_SAVE["DBF_POS"][1] = point;
VCB_SAVE["DBF_POS"][2] = xOfs;
VCB_SAVE["DBF_POS"][3] = yOfs;
end
end

Expand Down
14 changes: 9 additions & 5 deletions VCB_Buffframe.lua
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ function VCB_BF_RepositioningAndResizing()
end
end
if VCB_SAVE["Timer_below_60"] and timeLeft < 60 then
buttonDuration:SetTextColor(VCB_SAVE["Timer_below_60_color_r"],VCB_SAVE["Timer_below_60_color_g"],VCB_SAVE["Timer_below_60_color_b"])
buttonDuration:SetTextColor(VCB_SAVE["Timer_below_60_color_r"],VCB_SAVE["Timer_below_60_color_g"],VCB_SAVE["Timer_below_60_color_b"],VCB_SAVE["BF_TIMER_fontopacity"])
else
buttonDuration:SetTextColor(VCB_SAVE["BF_TIMER_fontcolor_r"],VCB_SAVE["BF_TIMER_fontcolor_g"],VCB_SAVE["BF_TIMER_fontcolor_b"],VCB_SAVE["BF_TIMER_fontopacity"])
end
Expand Down Expand Up @@ -405,7 +405,7 @@ function VCB_BF_RepositioningAndResizing()
end
end
if VCB_SAVE["Timer_below_60"] and timeLeft < 60 then
buttonDuration:SetTextColor(VCB_SAVE["Timer_below_60_color_r"],VCB_SAVE["Timer_below_60_color_g"],VCB_SAVE["Timer_below_60_color_b"])
buttonDuration:SetTextColor(VCB_SAVE["Timer_below_60_color_r"],VCB_SAVE["Timer_below_60_color_g"],VCB_SAVE["Timer_below_60_color_b"],VCB_SAVE["CF_TIMER_fontopacity"])
else
buttonDuration:SetTextColor(VCB_SAVE["CF_TIMER_fontcolor_r"],VCB_SAVE["CF_TIMER_fontcolor_g"],VCB_SAVE["CF_TIMER_fontcolor_b"],VCB_SAVE["CF_TIMER_fontopacity"])
end
Expand Down Expand Up @@ -760,12 +760,16 @@ function VCB_BF_BUFF_BUTTON_OnUpdate(elapsed, button)
timeLeft = random(1,150)+(random(1,99)/100)
end
if VCB_SAVE["Timer_below_60"] and timeLeft < 60 then
buffDuration:SetTextColor(VCB_SAVE["Timer_below_60_color_r"],VCB_SAVE["Timer_below_60_color_g"],VCB_SAVE["Timer_below_60_color_b"])
if button.cat == "buff" then
buffDuration:SetTextColor(VCB_SAVE["Timer_below_60_color_r"],VCB_SAVE["Timer_below_60_color_g"],VCB_SAVE["Timer_below_60_color_b"],VCB_SAVE["BF_TIMER_fontopacity"])
elseif button.cat == "debuff" then
buffDuration:SetTextColor(VCB_SAVE["Timer_below_60_color_r"],VCB_SAVE["Timer_below_60_color_g"],VCB_SAVE["Timer_below_60_color_b"],VCB_SAVE["CF_TIMER_fontopacity"])
end
else
if button.cat == "buff" then
buffDuration:SetTextColor(VCB_SAVE["BF_TIMER_fontcolor_r"],VCB_SAVE["BF_TIMER_fontcolor_g"],VCB_SAVE["BF_TIMER_fontcolor_b"])
buffDuration:SetTextColor(VCB_SAVE["BF_TIMER_fontcolor_r"],VCB_SAVE["BF_TIMER_fontcolor_g"],VCB_SAVE["BF_TIMER_fontcolor_b"],VCB_SAVE["BF_TIMER_fontopacity"])
elseif button.cat == "debuff" then
buffDuration:SetTextColor(VCB_SAVE["DBF_TIMER_fontcolor_r"],VCB_SAVE["DBF_TIMER_fontcolor_g"],VCB_SAVE["DBF_TIMER_fontcolor_b"])
buffDuration:SetTextColor(VCB_SAVE["DBF_TIMER_fontcolor_r"],VCB_SAVE["DBF_TIMER_fontcolor_g"],VCB_SAVE["DBF_TIMER_fontcolor_b"],VCB_SAVE["CF_TIMER_fontopacity"])
end
end
buffDuration:SetText(VCB_BF_GetDuration(timeLeft))
Expand Down
15 changes: 15 additions & 0 deletions VCB_Buffframe.xml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,11 @@
VCB_ICON_POSY = yOfs
else
VCB_BF_BUFF_FRAME:StopMovingOrSizing()
local point, _, _, xOfs, yOfs = VCB_BF_BUFF_FRAME:GetPoint()
VCB_SAVE["BF_POS"] = {}
VCB_SAVE["BF_POS"][1] = point;
VCB_SAVE["BF_POS"][2] = xOfs;
VCB_SAVE["BF_POS"][3] = yOfs;
end
end
</OnMouseUp>
Expand Down Expand Up @@ -274,6 +279,11 @@
<OnMouseUp>
if (not VCB_BF_LOCKED) then
VCB_BF_BUFF_FRAME:StopMovingOrSizing()
local point, _, _, xOfs, yOfs = VCB_BF_BUFF_FRAME:GetPoint()
VCB_SAVE["BF_POS"] = {}
VCB_SAVE["BF_POS"][1] = point;
VCB_SAVE["BF_POS"][2] = xOfs;
VCB_SAVE["BF_POS"][3] = yOfs;
end
</OnMouseUp>
</Scripts>
Expand Down Expand Up @@ -332,6 +342,11 @@
<OnMouseUp>
if (not VCB_BF_LOCKED) then
VCB_BF_DEBUFF_FRAME:StopMovingOrSizing()
local point, _, _, xOfs, yOfs = VCB_BF_DEBUFF_FRAME:GetPoint()
VCB_SAVE["DBF_POS"] = {}
VCB_SAVE["DBF_POS"][1] = point;
VCB_SAVE["DBF_POS"][2] = xOfs;
VCB_SAVE["DBF_POS"][3] = yOfs;
end
</OnMouseUp>
</Scripts>
Expand Down

0 comments on commit 438dc24

Please sign in to comment.