Skip to content

Commit

Permalink
Old Twitch strings fixed, bar border updated to the new framework border
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed May 29, 2021
1 parent 6bde881 commit 4b6c229
Show file tree
Hide file tree
Showing 10 changed files with 168 additions and 114 deletions.
49 changes: 0 additions & 49 deletions Libs/DF/DFFrames.xml

This file was deleted.

42 changes: 0 additions & 42 deletions Libs/DF/DFFramesInclude.lua

This file was deleted.

93 changes: 91 additions & 2 deletions Libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 250
local dversion = 256

local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary (major, minor)
Expand Down Expand Up @@ -3090,6 +3090,95 @@ function DF:CreateBorder (parent, alpha1, alpha2, alpha3)

end

--DFNamePlateBorder as copy from "NameplateFullBorderTemplate" -> DF:CreateFullBorder (name, parent)
local DFNamePlateBorderTemplateMixin = {};

function DFNamePlateBorderTemplateMixin:SetVertexColor(r, g, b, a)
for i, texture in ipairs(self.Textures) do
texture:SetVertexColor(r, g, b, a);
end
end

function DFNamePlateBorderTemplateMixin:SetBorderSizes(borderSize, borderSizeMinPixels, upwardExtendHeightPixels, upwardExtendHeightMinPixels)
self.borderSize = borderSize;
self.borderSizeMinPixels = borderSizeMinPixels;
self.upwardExtendHeightPixels = upwardExtendHeightPixels;
self.upwardExtendHeightMinPixels = upwardExtendHeightMinPixels;
end

function DFNamePlateBorderTemplateMixin:UpdateSizes()
local borderSize = self.borderSize or 1;
local minPixels = self.borderSizeMinPixels or 2;

local upwardExtendHeightPixels = self.upwardExtendHeightPixels or borderSize;
local upwardExtendHeightMinPixels = self.upwardExtendHeightMinPixels or minPixels;

PixelUtil.SetWidth(self.Left, borderSize, minPixels);
PixelUtil.SetPoint(self.Left, "TOPRIGHT", self, "TOPLEFT", 0, upwardExtendHeightPixels, 0, upwardExtendHeightMinPixels);
PixelUtil.SetPoint(self.Left, "BOTTOMRIGHT", self, "BOTTOMLEFT", 0, -borderSize, 0, minPixels);

PixelUtil.SetWidth(self.Right, borderSize, minPixels);
PixelUtil.SetPoint(self.Right, "TOPLEFT", self, "TOPRIGHT", 0, upwardExtendHeightPixels, 0, upwardExtendHeightMinPixels);
PixelUtil.SetPoint(self.Right, "BOTTOMLEFT", self, "BOTTOMRIGHT", 0, -borderSize, 0, minPixels);

PixelUtil.SetHeight(self.Bottom, borderSize, minPixels);
PixelUtil.SetPoint(self.Bottom, "TOPLEFT", self, "BOTTOMLEFT", 0, 0);
PixelUtil.SetPoint(self.Bottom, "TOPRIGHT", self, "BOTTOMRIGHT", 0, 0);

if self.Top then
PixelUtil.SetHeight(self.Top, borderSize, minPixels);
PixelUtil.SetPoint(self.Top, "BOTTOMLEFT", self, "TOPLEFT", 0, 0);
PixelUtil.SetPoint(self.Top, "BOTTOMRIGHT", self, "TOPRIGHT", 0, 0);
end
end

function DF:CreateFullBorder (name, parent)
local border = CreateFrame("Frame", name, parent)
border:SetAllPoints()
border:SetIgnoreParentScale(true)
border:SetFrameLevel(border:GetParent():GetFrameLevel())
border.Textures = {}
Mixin(border, DFNamePlateBorderTemplateMixin)

local left = border:CreateTexture("$parentLeft", "BACKGROUND", nil, -8)
--left:SetDrawLayer("BACKGROUND", -8)
left:SetColorTexture(1, 1, 1, 1)
left:SetWidth(1.0)
left:SetPoint("TOPRIGHT", border, "TOPLEFT", 0, 1.0)
left:SetPoint("BOTTOMRIGHT", border, "BOTTOMLEFT", 0, -1.0)
border.Left = left
tinsert(border.Textures, left)

local right = border:CreateTexture("$parentRight", "BACKGROUND", nil, -8)
--right:SetDrawLayer("BACKGROUND", -8)
right:SetColorTexture(1, 1, 1, 1)
right:SetWidth(1.0)
right:SetPoint("TOPLEFT", border, "TOPRIGHT", 0, 1.0)
right:SetPoint("BOTTOMLEFT", border, "BOTTOMRIGHT", 0, -1.0)
border.Right = right
tinsert(border.Textures, right)

local bottom = border:CreateTexture("$parentBottom", "BACKGROUND", nil, -8)
--bottom:SetDrawLayer("BACKGROUND", -8)
bottom:SetColorTexture(1, 1, 1, 1)
bottom:SetHeight(1.0)
bottom:SetPoint("TOPLEFT", border, "BOTTOMLEFT", 0, 0)
bottom:SetPoint("TOPRIGHT", border, "BOTTOMRIGHT", 0, 0)
border.Bottom = bottom
tinsert(border.Textures, bottom)

local top = border:CreateTexture("$parentTop", "BACKGROUND", nil, -8)
--top:SetDrawLayer("BACKGROUND", -8)
top:SetColorTexture(1, 1, 1, 1)
top:SetHeight(1.0)
top:SetPoint("BOTTOMLEFT", border, "TOPLEFT", 0, 0)
top:SetPoint("BOTTOMRIGHT", border, "TOPRIGHT", 0, 0)
border.Top = top
tinsert(border.Textures, top)

return border
end

function DF:CreateBorderSolid (parent, size)

end
Expand Down Expand Up @@ -3702,7 +3791,7 @@ DF.CLEncounterID = {
}

function DF:GetPlayerRole()
local assignedRole = UnitGroupRolesAssigned ("player")
local assignedRole = DF.UnitGroupRolesAssigned ("player")
if (assignedRole == "NONE") then
local spec = DF.GetSpecialization()
return spec and DF.GetSpecializationRole (spec) or "NONE"
Expand Down
3 changes: 1 addition & 2 deletions Libs/DF/load.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/..\FrameXML\UI.xsd">

<Script file ="DFPixelUtil.lua"/>
<Include file ="DFFrames.xml"/>

<Script file="fw.lua"/>
<Script file="addon.lua"/>
<Script file="colors.lua"/>
<Script file="help.lua"/>
<Script file="schedules.lua"/>
<Script file="label.lua"/>
<Script file="picture.lua"/>
<Script file="slider.lua"/>
Expand Down
67 changes: 67 additions & 0 deletions Libs/DF/schedules.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@



local DF = DetailsFramework
local C_Timer = _G.C_Timer
local unpack = _G.unpack

--make a namespace for schedules
DF.Schedules = {}

--run a scheduled function with its payload
local triggerScheduledTick = function(tickerObject)
local payload = tickerObject.payload
local callback = tickerObject.callback

local result, errortext = pcall(callback, unpack(payload))
if (not result) then
DF:Msg("error on scheduler: ", tickerObject.path, tickerObject.name, errortext)
end
return result
end

--schedule to repeat a task with an interval of @time
function DF.Schedules.NewTicker(time, callback, ...)
local payload = {...}
local newTicker = C_Timer.NewTicker(time, triggerScheduledTick)
newTicker.payload = payload
newTicker.callback = callback
newTicker.expireAt = GetTime() + time

--debug
newTicker.path = debugstack()
--
return newTicker
end

--schedule a task with an interval of @time
function DF.Schedules.NewTimer(time, callback, ...)
local payload = {...}
local newTimer = C_Timer.NewTimer(time, triggerScheduledTick)
newTimer.payload = payload
newTimer.callback = callback
newTimer.expireAt = GetTime() + time

--debug
newTimer.path = debugstack()
--

return newTimer
end

--cancel an ongoing ticker
function DF.Schedules.Cancel(tickerObject)
--ignore if there's no ticker object
if (tickerObject) then
return tickerObject:Cancel()
end
end

--schedule a task with an interval of @time without payload
function DF.Schedules.After(time, callback)
C_Timer.After(time, callback)
end

function DF.Schedules.SetName(object, name)
object.name = name
end
19 changes: 4 additions & 15 deletions Libs/DF/spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -667,19 +667,11 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE) then
DF.CooldownsBySpec[267][30414] = 5 --shadowfury Rank 3

--DRUID - 102
DF.CooldownsBySpec[102][1735] = 5 --demoralizing roar Rank 2
DF.CooldownsBySpec[102][9490] = 5 --demoralizing roar Rank 3
DF.CooldownsBySpec[102][9747] = 5 --demoralizing roar Rank 4
DF.CooldownsBySpec[102][9898] = 5 --demoralizing roar Rank 5
DF.CooldownsBySpec[102][26998] = 5 --demoralizing roar Rank 6
DF.CooldownsBySpec[102][99] = nil --demoralizing roar disabled, no CC in tbc

--DRUID - 103
--DRUID - 104
DF.CooldownsBySpec[104][1735] = 5 --demoralizing roar Rank 2
DF.CooldownsBySpec[104][9490] = 5 --demoralizing roar Rank 3
DF.CooldownsBySpec[104][9747] = 5 --demoralizing roar Rank 4
DF.CooldownsBySpec[104][9898] = 5 --demoralizing roar Rank 5
DF.CooldownsBySpec[104][26998] = 5 --demoralizing roar Rank 6
DF.CooldownsBySpec[104][99] = nil --demoralizing roar disabled, no CC in tbc

--DRUID - 105
DF.CooldownsBySpec[105][8918] = 4 --tranquility Rank 2
Expand Down Expand Up @@ -1018,6 +1010,8 @@ DF.CrowdControlSpells = {

-- additionals for classic
if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE) then
DF.CrowdControlSpells[99] = nil --demoralizing roar disabled, no CC in tbc

--auto-generated
DF.CrowdControlSpells[18657] = "DRUID" --hibernate Rank 2
DF.CrowdControlSpells[18658] = "DRUID" --hibernate Rank 3
Expand All @@ -1035,11 +1029,6 @@ if (WOW_PROJECT_ID ~= WOW_PROJECT_MAINLINE) then
DF.CrowdControlSpells[19974] = "DRUID" --entangling roots Rank 2
DF.CrowdControlSpells[26989] = "DRUID" --entangling roots Rank 7
DF.CrowdControlSpells[27010] = "DRUID" --entangling roots Rank 7
DF.CrowdControlSpells[1735] = "DRUID" --demoralizing roar Rank 2
DF.CrowdControlSpells[9490] = "DRUID" --demoralizing roar Rank 3
DF.CrowdControlSpells[9747] = "DRUID" --demoralizing roar Rank 4
DF.CrowdControlSpells[9898] = "DRUID" --demoralizing roar Rank 5
DF.CrowdControlSpells[26998] = "DRUID" --demoralizing roar Rank 6

DF.CrowdControlSpells[14310] = "HUNTER" --freezing trap Rank 2
DF.CrowdControlSpells[14311] = "HUNTER" --freezing trap Rank 3
Expand Down
3 changes: 2 additions & 1 deletion frames/window_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4015,7 +4015,8 @@ function gump:CreateNewLine (instancia, index)
--border
local lineBorder
if (DetailsFramework.IsTBCWow()) then
lineBorder = CreateFrame("frame", nil, new_row, "DFNamePlateFullBorderTemplate, BackdropTemplate")
lineBorder = DetailsFramework:CreateFullBorder(nil, new_row)
--lineBorder = CreateFrame("frame", nil, new_row, "DFNamePlateFullBorderTemplate, BackdropTemplate")
else
lineBorder = CreateFrame("frame", nil, new_row, "NamePlateFullBorderTemplate, BackdropTemplate")
end
Expand Down
2 changes: 1 addition & 1 deletion frames/window_plater.lua
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ function Details.OpenPlaterIntegrationWindow()
end
end

local PlaterDisabled1 = DF:CreateLabel (f, "Plater isn't installed! you may download it from the Twitch app.", 16, "red")
local PlaterDisabled1 = DF:CreateLabel (f, "Plater isn't installed! you may download it from the Curseforge app.", 16, "red")
PlaterDisabled1:SetPoint (10, -330)
end

Expand Down
2 changes: 1 addition & 1 deletion functions/deathmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ detailsOnDeathMenu.enduranceButton.CoolTip = {
--GameCooltip2:AddLine (" ")

if (not Details:GetPlugin ("DETAILS_PLUGIN_DEATH_GRAPHICS")) then
GameCooltip2:AddLine ("Advanced Death Logs plugin is disabled or not installed, check the Addon Control Panel or download it from the Twitch APP.", "", 1, "red")
GameCooltip2:AddLine ("Advanced Death Logs plugin is disabled or not installed, check the Addon Control Panel or download it from the Curseforge APP.", "", 1, "red")
end

end, --> called when user mouse over the frame
Expand Down
2 changes: 1 addition & 1 deletion startup.lua
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ function Details:StartMeUp() --I'll never stop!

--show warning message about classic beta
if (not DetailsFramework.IsClassicWow()) then
--print ("|CFFFFFF00[Details!]: Details! now has a separated version for Classic, Twitch app should give the right version, any issues report at Discord (/details discord).")

else
print ("|CFFFFFF00[Details!]: you're using Details! for RETAIL on Classic WOW, please get the classic version (Details! Damage Meter Classic WoW), if you need help see our Discord (/details discord).")
end
Expand Down

0 comments on commit 4b6c229

Please sign in to comment.