Use tooklit functions, fixed

This commit is contained in:
Logan Payton
2018-04-15 13:22:29 -04:00
parent fd354c6d36
commit ce432eb94a
2 changed files with 23 additions and 22 deletions
+2 -1
View File
@@ -47,7 +47,8 @@ end
function E:Size(frame, width, height) function E:Size(frame, width, height)
assert(width) assert(width)
frame:SetSize(E:Scale(width), E:Scale(height or width)) frame:SetWidth(E:Scale(width))
frame:SetHeight(E:Scale(height or width))
end end
function E:Width(frame, width) function E:Width(frame, width)
+21 -21
View File
@@ -137,8 +137,8 @@ end
local function CreateRollButton(parent, ntex, ptex, htex, rolltype, tiptext) local function CreateRollButton(parent, ntex, ptex, htex, rolltype, tiptext)
local f = CreateFrame("Button", nil, parent) local f = CreateFrame("Button", nil, parent)
E:Point(f, unpack(args)) -- E:Point(f, unpack(args))
f:Size(FRAME_HEIGHT - 4) E:Size(f, FRAME_HEIGHT - 4)
f:SetNormalTexture(ntex) f:SetNormalTexture(ntex)
if(ptex) then f:SetPushedTexture(ptex) end if(ptex) then f:SetPushedTexture(ptex) end
f:SetHighlightTexture(htex) f:SetHighlightTexture(htex)
@@ -149,23 +149,23 @@ local function CreateRollButton(parent, ntex, ptex, htex, rolltype, tiptext)
f:SetScript("OnLeave", HideTip) f:SetScript("OnLeave", HideTip)
f:SetScript("OnClick", ClickRoll) f:SetScript("OnClick", ClickRoll)
local txt = f:CreateFontString(nil, nil) local txt = f:CreateFontString(nil, nil)
txt:FontTemplate(nil, nil, "OUTLINE") E:FontTemplate(txt, nil, nil, "OUTLINE")
txt:Point("CENTER", 0, rolltype == 2 and 1 or rolltype == 0 and -1.2 or 0) E:Point(txt, "CENTER", 0, rolltype == 2 and 1 or rolltype == 0 and -1.2 or 0)
return f, txt return f, txt
end end
function M:CreateRollFrame() function M:CreateRollFrame()
local frame = CreateFrame("Frame", nil, E.UIParent) local frame = CreateFrame("Frame", nil, E.UIParent)
frame:Size(FRAME_WIDTH, FRAME_HEIGHT) E:Size(frame, FRAME_WIDTH, FRAME_HEIGHT)
frame:SetTemplate("Default") E:SetTemplate(frame, "Default")
frame:SetScript("OnEvent", OnEvent) frame:SetScript("OnEvent", OnEvent)
frame:RegisterEvent("CANCEL_LOOT_ROLL") frame:RegisterEvent("CANCEL_LOOT_ROLL")
frame:Hide() frame:Hide()
local button = CreateFrame("Button", nil, frame) local button = CreateFrame("Button", nil, frame)
button:Point("RIGHT", frame, "LEFT", -(E.Spacing*3), 0) E:Point(button, "RIGHT", frame, "LEFT", -(E.Spacing*3), 0)
button:Size(FRAME_HEIGHT - (E.Border * 2)) E:Size(button, FRAME_HEIGHT - (E.Border * 2))
button:CreateBackdrop("Default") E:CreateBackdrop(button, "Default")
button:SetScript("OnEnter", SetItemTip) button:SetScript("OnEnter", SetItemTip)
button:SetScript("OnLeave", HideTip2) button:SetScript("OnLeave", HideTip2)
button:SetScript("OnUpdate", ItemOnUpdate) button:SetScript("OnUpdate", ItemOnUpdate)
@@ -177,14 +177,14 @@ function M:CreateRollFrame()
button.icon:SetTexCoord(unpack(E.TexCoords)) button.icon:SetTexCoord(unpack(E.TexCoords))
local tfade = frame:CreateTexture(nil, "BORDER") local tfade = frame:CreateTexture(nil, "BORDER")
tfade:Point("TOPLEFT", frame, "TOPLEFT", 4, 0) E:Point(tfade, "TOPLEFT", frame, "TOPLEFT", 4, 0)
tfade:Point("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -4, 0) E:Point(tfade, "BOTTOMRIGHT", frame, "BOTTOMRIGHT", -4, 0)
tfade:SetTexture("Interface\\ChatFrame\\ChatFrameBackground") tfade:SetTexture("Interface\\ChatFrame\\ChatFrameBackground")
tfade:SetBlendMode("ADD") tfade:SetBlendMode("ADD")
tfade:SetGradientAlpha("VERTICAL", .1, .1, .1, 0, .1, .1, .1, 0) tfade:SetGradientAlpha("VERTICAL", .1, .1, .1, 0, .1, .1, .1, 0)
local status = CreateFrame("StatusBar", nil, frame) local status = CreateFrame("StatusBar", nil, frame)
status:SetInside() E:SetInside(status)
status:SetScript("OnUpdate", StatusUpdate) status:SetScript("OnUpdate", StatusUpdate)
status:SetFrameLevel(status:GetFrameLevel() - 1) status:SetFrameLevel(status:GetFrameLevel() - 1)
status:SetStatusBarTexture(E["media"].normTex) status:SetStatusBarTexture(E["media"].normTex)
@@ -197,7 +197,7 @@ function M:CreateRollFrame()
status.bg:SetAlpha(0.1) status.bg:SetAlpha(0.1)
status.bg:SetAllPoints() status.bg:SetAllPoints()
local spark = frame:CreateTexture(nil, "OVERLAY") local spark = frame:CreateTexture(nil, "OVERLAY")
spark:Size(14, FRAME_HEIGHT) E:Size(spark, 14, FRAME_HEIGHT)
spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark") spark:SetTexture("Interface\\CastingBar\\UI-CastingBar-Spark")
spark:SetBlendMode("ADD") spark:SetBlendMode("ADD")
status.spark = spark status.spark = spark
@@ -209,15 +209,15 @@ function M:CreateRollFrame()
frame.need, frame.greed, frame.pass = needtext, greedtext, passtext frame.need, frame.greed, frame.pass = needtext, greedtext, passtext
local bind = frame:CreateFontString() local bind = frame:CreateFontString()
bind:Point("LEFT", pass, "RIGHT", 3, 1) E:Point(bind, "LEFT", pass, "RIGHT", 3, 1)
bind:FontTemplate(nil, nil, "OUTLINE") E:FontTemplate(bind, nil, nil, "OUTLINE")
frame.fsbind = bind frame.fsbind = bind
local loot = frame:CreateFontString(nil, "ARTWORK") local loot = frame:CreateFontString(nil, "ARTWORK")
loot:FontTemplate(nil, nil, "OUTLINE") E:FontTemplate(loot, nil, nil, "OUTLINE")
loot:Point("LEFT", bind, "RIGHT", 0, 0) E:Point(loot, "LEFT", bind, "RIGHT", 0, 0)
loot:Point("RIGHT", frame, "RIGHT", -5, 0) E:Point(loot, "RIGHT", frame, "RIGHT", -5, 0)
loot:Size(200, 10) E:Size(loot, 200, 10)
loot:SetJustifyH("LEFT") loot:SetJustifyH("LEFT")
frame.fsloot = loot frame.fsloot = loot
@@ -235,9 +235,9 @@ local function GetFrame()
local f = M:CreateRollFrame() local f = M:CreateRollFrame()
if(pos == "TOP") then if(pos == "TOP") then
f:Point("TOP", next(M.RollBars) and M.RollBars[getn(M.RollBars)] or AlertFrameHolder, "BOTTOM", 0, -4) E:Point(f, "TOP", next(M.RollBars) and M.RollBars[getn(M.RollBars)] or AlertFrameHolder, "BOTTOM", 0, -4)
else else
f:Point("BOTTOM", next(M.RollBars) and M.RollBars[getn(M.RollBars)] or AlertFrameHolder, "TOP", 0, 4) E:Point(f, "BOTTOM", next(M.RollBars) and M.RollBars[getn(M.RollBars)] or AlertFrameHolder, "TOP", 0, 4)
end end
tinsert(M.RollBars, f) tinsert(M.RollBars, f)