E:Point, E:Size, E:Width, E:Height, & cleanup

This commit is contained in:
Crum
2018-05-16 23:20:04 -05:00
parent eac6a04517
commit d52da42f77
65 changed files with 958 additions and 1102 deletions
+13 -18
View File
@@ -257,9 +257,8 @@ function AFK:Initialize()
self.AFKMode:SetScript("OnKeyDown", OnKeyDown)
self.AFKMode.chat = CreateFrame("ScrollingMessageFrame", "AFKChat", self.AFKMode)
self.AFKMode.chat:SetWidth(500)
self.AFKMode.chat:SetHeight(200)
self.AFKMode.chat:SetPoint("TOPLEFT", self.AFKMode, "TOPLEFT", 4, -3)
E:Size(self.AFKMode.chat, 500, 200)
E:Point(self.AFKMode.chat, "TOPLEFT", self.AFKMode, "TOPLEFT", 4, -3)
E:FontTemplate(self.AFKMode.chat)
self.AFKMode.chat:SetJustifyH("LEFT")
self.AFKMode.chat:SetMaxLines(500)
@@ -278,45 +277,41 @@ function AFK:Initialize()
self.AFKMode.bottom = CreateFrame("Frame", nil, self.AFKMode)
self.AFKMode.bottom:SetFrameLevel(0)
E:SetTemplate(self.AFKMode.bottom, "Transparent")
self.AFKMode.bottom:SetPoint("BOTTOM", self.AFKMode, "BOTTOM", 0, -E.Border)
self.AFKMode.bottom:SetWidth(GetScreenWidth() + (E.Border*2))
self.AFKMode.bottom:SetHeight(GetScreenHeight() * 0.1)
E:Point(self.AFKMode.bottom, "BOTTOM", self.AFKMode, "BOTTOM", 0, -E.Border)
E:Size(self.AFKMode.bottom, GetScreenWidth() + (E.Border*2), GetScreenHeight() * 0.1)
self.AFKMode.bottom.logo = self.AFKMode:CreateTexture(nil, "OVERLAY")
self.AFKMode.bottom.logo:SetWidth(320)
self.AFKMode.bottom.logo:SetHeight(150)
self.AFKMode.bottom.logo:SetPoint("CENTER", self.AFKMode.bottom, "CENTER", 0, 50)
E:Size(self.AFKMode.bottom.logo, 320, 150)
E:Point(self.AFKMode.bottom.logo, "CENTER", self.AFKMode.bottom, "CENTER", 0, 50)
self.AFKMode.bottom.logo:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\logo")
local factionGroup = UnitFactionGroup("player")
self.AFKMode.bottom.faction = self.AFKMode.bottom:CreateTexture(nil, "OVERLAY")
self.AFKMode.bottom.faction:SetPoint("BOTTOMLEFT", self.AFKMode.bottom, "BOTTOMLEFT", -20, -16)
E:Point(self.AFKMode.bottom.faction, "BOTTOMLEFT", self.AFKMode.bottom, "BOTTOMLEFT", -20, -16)
self.AFKMode.bottom.faction:SetTexture("Interface\\AddOns\\ElvUI\\media\\textures\\"..factionGroup.."-Logo")
self.AFKMode.bottom.faction:SetWidth(140)
self.AFKMode.bottom.faction:SetHeight(140)
E:Size(self.AFKMode.bottom.faction, 140)
self.AFKMode.bottom.name = self.AFKMode.bottom:CreateFontString(nil, "OVERLAY")
E:FontTemplate(self.AFKMode.bottom.name, nil, 20)
self.AFKMode.bottom.name:SetText(format("%s - %s", E.myname, E.myrealm))
self.AFKMode.bottom.name:SetPoint("TOPLEFT", self.AFKMode.bottom.faction, "TOPRIGHT", -10, -28)
E:Point(self.AFKMode.bottom.name, "TOPLEFT", self.AFKMode.bottom.faction, "TOPRIGHT", -10, -28)
self.AFKMode.bottom.name:SetTextColor(classColor.r, classColor.g, classColor.b)
self.AFKMode.bottom.guild = self.AFKMode.bottom:CreateFontString(nil, "OVERLAY")
E:FontTemplate(self.AFKMode.bottom.guild, nil, 20)
self.AFKMode.bottom.guild:SetText(L["No Guild"])
self.AFKMode.bottom.guild:SetPoint("TOPLEFT", self.AFKMode.bottom.name, "BOTTOMLEFT", 0, -6)
E:Point(self.AFKMode.bottom.guild, "TOPLEFT", self.AFKMode.bottom.name, "BOTTOMLEFT", 0, -6)
self.AFKMode.bottom.guild:SetTextColor(0.7, 0.7, 0.7)
self.AFKMode.bottom.time = self.AFKMode.bottom:CreateFontString(nil, "OVERLAY")
E:FontTemplate(self.AFKMode.bottom.time, nil, 20)
self.AFKMode.bottom.time:SetText("00:00")
self.AFKMode.bottom.time:SetPoint("TOPLEFT", self.AFKMode.bottom.guild, "BOTTOMLEFT", 0, -6)
E:Point(self.AFKMode.bottom.time, "TOPLEFT", self.AFKMode.bottom.guild, "BOTTOMLEFT", 0, -6)
self.AFKMode.bottom.time:SetTextColor(0.7, 0.7, 0.7)
self.AFKMode.bottom.model = CreateFrame("PlayerModel", "ElvUIAFKPlayerModel", self.AFKMode.bottom)
self.AFKMode.bottom.model:SetPoint("BOTTOMRIGHT", self.AFKMode.bottom, "BOTTOMRIGHT", 120, -100)
self.AFKMode.bottom.model:SetWidth(800)
self.AFKMode.bottom.model:SetHeight(800)
E:Point(self.AFKMode.bottom.model, "BOTTOMRIGHT", self.AFKMode.bottom, "BOTTOMRIGHT", 120, -100)
E:Size(self.AFKMode.bottom.model, 800)
self.AFKMode.bottom.model:SetFacing(6)
self.AFKMode.bottom.model:SetUnit("player")
+24 -24
View File
@@ -86,51 +86,51 @@ function M:SkinBubble(frame)
frame.backdrop:SetTexture(unpack(E.media.backdropfadecolor))
frame.bordertop = frame:CreateTexture(nil, "OVERLAY")
frame.bordertop:SetPoint("TOPLEFT", frame, "TOPLEFT", -mult*2, mult*2)
frame.bordertop:SetPoint("TOPRIGHT", frame, "TOPRIGHT", mult*2, mult*2)
frame.bordertop:SetHeight(mult)
E:Point(frame.bordertop, "TOPLEFT", frame, "TOPLEFT", -mult*2, mult*2)
E:Point(frame.bordertop, "TOPRIGHT", frame, "TOPRIGHT", mult*2, mult*2)
E:Height(frame.bordertop, mult)
frame.bordertop:SetTexture(r, g, b)
frame.bordertop.backdrop = frame:CreateTexture(nil, "BORDER")
frame.bordertop.backdrop:SetPoint("TOPLEFT", frame.bordertop, "TOPLEFT", -mult, mult)
frame.bordertop.backdrop:SetPoint("TOPRIGHT", frame.bordertop, "TOPRIGHT", mult, mult)
frame.bordertop.backdrop:SetHeight(mult * 3)
E:Point(frame.bordertop.backdrop, "TOPLEFT", frame.bordertop, "TOPLEFT", -mult, mult)
E:Point(frame.bordertop.backdrop, "TOPRIGHT", frame.bordertop, "TOPRIGHT", mult, mult)
E:Height(frame.bordertop.backdrop, mult * 3)
frame.bordertop.backdrop:SetTexture(0, 0, 0)
frame.borderbottom = frame:CreateTexture(nil, "OVERLAY")
frame.borderbottom:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", -mult*2, -mult*2)
frame.borderbottom:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", mult*2, -mult*2)
frame.borderbottom:SetHeight(mult)
E:Point(frame.borderbottom, "BOTTOMLEFT", frame, "BOTTOMLEFT", -mult*2, -mult*2)
E:Point(frame.borderbottom, "BOTTOMRIGHT", frame, "BOTTOMRIGHT", mult*2, -mult*2)
E:Height(frame.borderbottom, mult)
frame.borderbottom:SetTexture(r, g, b)
frame.borderbottom.backdrop = frame:CreateTexture(nil, "BORDER")
frame.borderbottom.backdrop:SetPoint("BOTTOMLEFT", frame.borderbottom, "BOTTOMLEFT", -mult, -mult)
frame.borderbottom.backdrop:SetPoint("BOTTOMRIGHT", frame.borderbottom, "BOTTOMRIGHT", mult, -mult)
frame.borderbottom.backdrop:SetHeight(mult * 3)
E:Point(frame.borderbottom.backdrop, "BOTTOMLEFT", frame.borderbottom, "BOTTOMLEFT", -mult, -mult)
E:Point(frame.borderbottom.backdrop, "BOTTOMRIGHT", frame.borderbottom, "BOTTOMRIGHT", mult, -mult)
E:Height(frame.borderbottom.backdrop, mult * 3)
frame.borderbottom.backdrop:SetTexture(0, 0, 0)
frame.borderleft = frame:CreateTexture(nil, "OVERLAY")
frame.borderleft:SetPoint("TOPLEFT", frame, "TOPLEFT", -mult*2, mult*2)
frame.borderleft:SetPoint("BOTTOMLEFT", frame, "BOTTOMLEFT", mult*2, -mult*2)
frame.borderleft:SetWidth(mult)
E:Point(frame.borderleft, "TOPLEFT", frame, "TOPLEFT", -mult*2, mult*2)
E:Point(frame.borderleft, "BOTTOMLEFT", frame, "BOTTOMLEFT", mult*2, -mult*2)
E:Width(frame.borderleft, mult)
frame.borderleft:SetTexture(r, g, b)
frame.borderleft.backdrop = frame:CreateTexture(nil, "BORDER")
frame.borderleft.backdrop:SetPoint("TOPLEFT", frame.borderleft, "TOPLEFT", -mult, mult)
frame.borderleft.backdrop:SetPoint("BOTTOMLEFT", frame.borderleft, "BOTTOMLEFT", -mult, -mult)
frame.borderleft.backdrop:SetWidth(mult * 3)
E:Point(frame.borderleft.backdrop, "TOPLEFT", frame.borderleft, "TOPLEFT", -mult, mult)
E:Point(frame.borderleft.backdrop, "BOTTOMLEFT", frame.borderleft, "BOTTOMLEFT", -mult, -mult)
E:Width(frame.borderleft.backdrop, mult * 3)
frame.borderleft.backdrop:SetTexture(0, 0, 0)
frame.borderright = frame:CreateTexture(nil, "OVERLAY")
frame.borderright:SetPoint("TOPRIGHT", frame, "TOPRIGHT", mult*2, mult*2)
frame.borderright:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -mult*2, -mult*2)
frame.borderright:SetWidth(mult)
E:Point(frame.borderright, "TOPRIGHT", frame, "TOPRIGHT", mult*2, mult*2)
E:Point(frame.borderright, "BOTTOMRIGHT", frame, "BOTTOMRIGHT", -mult*2, -mult*2)
E:Width(frame.borderright, mult)
frame.borderright:SetTexture(r, g, b)
frame.borderright.backdrop = frame:CreateTexture(nil, "BORDER")
frame.borderright.backdrop:SetPoint("TOPRIGHT", frame.borderright, "TOPRIGHT", mult, mult)
frame.borderright.backdrop:SetPoint("BOTTOMRIGHT", frame.borderright, "BOTTOMRIGHT", mult, -mult)
frame.borderright.backdrop:SetWidth(mult * 3)
E:Point(frame.borderright.backdrop, "TOPRIGHT", frame.borderright, "TOPRIGHT", mult, mult)
E:Point(frame.borderright.backdrop, "BOTTOMRIGHT", frame.borderright, "BOTTOMRIGHT", mult, -mult)
E:Width(frame.borderright.backdrop, mult * 3)
frame.borderright.backdrop:SetTexture(0, 0, 0)
end
else
+32 -35
View File
@@ -35,7 +35,7 @@ local iconSize = 30
local sq, ss, sn
local OnEnter = function()
local slot = this:GetID()
if(LootSlotIsItem(slot)) then
if LootSlotIsItem(slot) then
GameTooltip:SetOwner(this, "ANCHOR_RIGHT")
GameTooltip:SetLootItem(slot)
CursorUpdate(this)
@@ -46,7 +46,7 @@ local OnEnter = function()
end
local OnLeave = function()
if this.quality and (this.quality > 1) then
if this.quality and this.quality > 1 then
local color = ITEM_QUALITY_COLORS[this.quality]
this.drop:SetVertexColor(color.r, color.g, color.b)
else
@@ -82,21 +82,21 @@ local function anchorSlots(self)
local shownSlots = 0
for i = 1, getn(self.slots) do
local frame = self.slots[i]
if(frame:IsShown()) then
if frame:IsShown() then
shownSlots = shownSlots + 1
frame:SetPoint("TOP", lootFrame, 4, (-8 + iconSize) - (shownSlots * iconSize))
E:Point(frame, "TOP", lootFrame, 4, (-8 + iconSize) - (shownSlots * iconSize))
end
end
self:SetHeight(max(shownSlots * iconSize + 16, 20))
E:Height(self, max(shownSlots * iconSize + 16, 20))
end
local function createSlot(id)
local frame = CreateFrame("LootButton", "ElvLootSlot"..id, lootFrame)
frame:SetPoint("LEFT", 8, 0)
frame:SetPoint("RIGHT", -8, 0)
frame:SetHeight(iconSize - 2)
E:Point(frame, "LEFT", 8, 0)
E:Point(frame, "RIGHT", -8, 0)
E:Height(frame, iconSize - 2)
frame:SetID(id)
frame:SetScript("OnEnter", OnEnter)
@@ -105,9 +105,8 @@ local function createSlot(id)
frame:SetScript("OnShow", OnShow)
local iconFrame = CreateFrame("Frame", nil, frame)
iconFrame:SetWidth(iconSize - 2)
iconFrame:SetHeight(iconSize - 2)
iconFrame:SetPoint("RIGHT", frame)
E:Size(iconFrame, iconSize - 2)
E:Point(iconFrame, "RIGHT", frame)
E:SetTemplate(iconFrame, "Default")
frame.iconFrame = iconFrame
E["frames"][iconFrame] = nil
@@ -119,23 +118,23 @@ local function createSlot(id)
local count = iconFrame:CreateFontString(nil, "OVERLAY")
count:SetJustifyH("RIGHT")
count:SetPoint("BOTTOMRIGHT", iconFrame, -2, 2)
E:Point(count, "BOTTOMRIGHT", iconFrame, -2, 2)
E:FontTemplate(count, nil, nil, "OUTLINE")
count:SetText(1)
frame.count = count
local name = frame:CreateFontString(nil, "OVERLAY")
name:SetJustifyH("LEFT")
name:SetPoint("LEFT", frame)
name:SetPoint("RIGHT", icon, "LEFT")
E:Point(name, "LEFT", frame)
E:Point(name, "RIGHT", icon, "LEFT")
name:SetNonSpaceWrap(true)
E:FontTemplate(name, nil, nil, "OUTLINE")
frame.name = name
local drop = frame:CreateTexture(nil, "ARTWORK")
drop:SetTexture("Interface\\QuestFrame\\UI-QuestLogTitleHighlight")
drop:SetPoint("LEFT", icon, "RIGHT", 0, 0)
drop:SetPoint("RIGHT", frame)
E:Point(drop, "LEFT", icon, "RIGHT", 0, 0)
E:Point(drop, "RIGHT", frame)
drop:SetAllPoints(frame)
drop:SetAlpha(.3)
frame.drop = drop
@@ -171,15 +170,15 @@ end
function M:LOOT_OPENED(_, autoLoot)
lootFrame:Show()
if(not lootFrame:IsShown()) then
if not lootFrame:IsShown() then
CloseLoot(autoLoot == 0)
end
local items = GetNumLootItems()
if(IsFishingLoot()) then
if IsFishingLoot() then
lootFrame.title:SetText(L["Fishy Loot"])
elseif(not UnitIsFriend("player", "target") and UnitIsDead("target")) then
elseif not UnitIsFriend("player", "target") and UnitIsDead("target") then
lootFrame.title:SetText(UnitName("target"))
else
lootFrame.title:SetText(LOOT)
@@ -192,33 +191,33 @@ function M:LOOT_OPENED(_, autoLoot)
y = y / lootFrame:GetEffectiveScale()
lootFrame:ClearAllPoints()
lootFrame:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", x - 40, y + 20)
E:Point(lootFrame, "TOPLEFT", UIParent, "BOTTOMLEFT", x - 40, y + 20)
lootFrame:GetCenter()
lootFrame:Raise()
else
lootFrame:ClearAllPoints()
lootFrame:SetPoint("TOPLEFT", lootFrameHolder, "TOPLEFT")
E:Point(lootFrame, "TOPLEFT", lootFrameHolder, "TOPLEFT")
end
local m, w, t = 0, 0, lootFrame.title:GetStringWidth()
if(items > 0) then
if items > 0 then
for i = 1, items do
local slot = lootFrame.slots[i] or createSlot(i)
local texture, item, quantity, quality = GetLootSlotInfo(i)
local color = ITEM_QUALITY_COLORS[quality]
if(LootSlotIsCoin(i)) then
if LootSlotIsCoin(i) then
item = gsub(item, "\n", ", ")
end
if quantity and (quantity > 1) then
if quantity and quantity > 1 then
slot.count:SetText(quantity)
slot.count:Show()
else
slot.count:Hide()
end
if quality and (quality > 1) then
if quality and quality > 1 then
slot.drop:SetVertexColor(color.r, color.g, color.b)
slot.drop:Show()
else
@@ -268,28 +267,26 @@ function M:LOOT_OPENED(_, autoLoot)
local color = ITEM_QUALITY_COLORS[m]
lootFrame:SetBackdropBorderColor(color.r, color.g, color.b, .8)
lootFrame:SetWidth(max(w, t))
E:Width(lootFrame, max(w, t))
end
function M:LoadLoot()
if not E.private.general.loot then return end
lootFrameHolder = CreateFrame("Frame", "ElvLootFrameHolder", E.UIParent)
lootFrameHolder:SetPoint("TOPLEFT", 36, -195)
lootFrameHolder:SetWidth(150)
lootFrameHolder:SetHeight(22)
E:Point(lootFrameHolder, "TOPLEFT", 36, -195)
E:Size(lootFrameHolder, 150, 22)
lootFrame = CreateFrame("Button", "ElvLootFrame", lootFrameHolder)
lootFrame:SetClampedToScreen(true)
lootFrame:SetPoint("TOPLEFT", 0, 0)
lootFrame:SetWidth(256)
lootFrame:SetHeight(64)
E:Point(lootFrame, "TOPLEFT", 0, 0)
E:Size(lootFrame, 256, 64)
E:SetTemplate(lootFrame, "Transparent")
lootFrame:SetFrameStrata("FULLSCREEN")
lootFrame:SetToplevel(true)
lootFrame.title = lootFrame:CreateFontString(nil, "OVERLAY")
E:FontTemplate(lootFrame.title, nil, nil, "OUTLINE")
lootFrame.title:SetPoint("BOTTOMLEFT", lootFrame, "TOPLEFT", 0, 1)
E:Point(lootFrame.title, "BOTTOMLEFT", lootFrame, "TOPLEFT", 0, 1)
lootFrame.slots = {}
lootFrame:SetScript("OnHide", function()
StaticPopup_Hide("CONFIRM_LOOT_DISTRIBUTION")
@@ -311,9 +308,9 @@ function M:LoadLoot()
tinsert(UISpecialFrames, "ElvLootFrame")
function _G.GroupLootDropDown_GiveLoot()
if(sq >= MASTER_LOOT_THREHOLD) then
if sq >= MASTER_LOOT_THREHOLD then
local dialog = StaticPopup_Show("CONFIRM_LOOT_DISTRIBUTION", ITEM_QUALITY_COLORS[sq].hex..sn..FONT_COLOR_CODE_CLOSE, this:GetText())
if (dialog) then
if dialog then
dialog.data = this.value
end
else
+2 -2
View File
@@ -142,7 +142,7 @@ local function CreateRollButton(parent, ntex, ptex, htex, rolltype, tiptext, poi
E:Point(f, point, relativeFrame, relativePoint, ofsx, ofsy)
E:Size(f, FRAME_HEIGHT - 4)
f:SetNormalTexture(ntex)
if(ptex) then f:SetPushedTexture(ptex) end
if ptex then f:SetPushedTexture(ptex) end
f:SetHighlightTexture(htex)
f.rolltype = rolltype
f.parent = parent
@@ -280,7 +280,7 @@ function M:START_LOOT_ROLL(_, rollID, time)
f.status:SetMinMaxValues(0, time)
f.status:SetValue(time)
f:SetPoint("CENTER", WorldFrame, "CENTER")
E:Point(f, "CENTER", WorldFrame, "CENTER")
f:Show()
if E.db.general.autoRoll and UnitLevel("player") == MAX_PLAYER_LEVEL and quality == 2 and not bindOnPickUp then
+1 -1
View File
@@ -39,7 +39,7 @@ end
function M:COMBAT_LOG_EVENT_UNFILTERED(_, _, event, _, sourceName, _, _, destName, _, _, _, _, spellID, spellName)
if E.db.general.interruptAnnounce == "NONE" then return end
if not (event == "SPELL_INTERRUPT" and sourceName == UnitName("player")) then return end
if not event == "SPELL_INTERRUPT" and sourceName == UnitName("player") then return end
local party = GetNumPartyMembers()
+7 -9
View File
@@ -39,7 +39,7 @@ function M:RaidMarkShowIcons()
end
local x, y = GetCursorPosition()
local scale = E.UIParent:GetEffectiveScale()
self.RaidMarkFrame:SetPoint("CENTER", E.UIParent, "BOTTOMLEFT", x / scale, y / scale)
E:Point(self.RaidMarkFrame, "CENTER", E.UIParent, "BOTTOMLEFT", x / scale, y / scale)
self.RaidMarkFrame:Show()
end
@@ -61,8 +61,8 @@ M:RegisterEvent("PLAYER_TARGET_CHANGED", "RaidMark_OnEvent")
function M:RaidMarkButton_OnEnter()
this.Texture:ClearAllPoints()
this.Texture:SetPoint("TOPLEFT", -10, 10)
this.Texture:SetPoint("BOTTOMRIGHT", 10, -10)
E:Point(this.Texture, "TOPLEFT", -10, 10)
E:Point(this.Texture, "BOTTOMRIGHT", 10, -10)
end
function M:RaidMarkButton_OnLeave()
@@ -78,14 +78,12 @@ end
function M:LoadRaidMarker()
local marker = CreateFrame("Frame", nil, E.UIParent)
marker:EnableMouse(true)
marker:SetWidth(100)
marker:SetHeight(100)
E:Size(marker, 100)
marker:SetFrameStrata("DIALOG")
for i = 1, 8 do
local button = CreateFrame("Button", "RaidMarkIconButton" .. i, marker)
button:SetWidth(40)
button:SetHeight(40)
E:Size(button, 40)
button:SetID(i)
button.Texture = button:CreateTexture(button:GetName() .. "NormalTexture", "ARTWORK")
button.Texture:SetTexture("Interface\\TargetingFrame\\UI-RaidTargetingIcons")
@@ -96,10 +94,10 @@ function M:LoadRaidMarker()
button:SetScript("OnEnter", M.RaidMarkButton_OnEnter)
button:SetScript("OnLeave", M.RaidMarkButton_OnLeave)
if i == 8 then
button:SetPoint("CENTER", 0, 0)
E:Point(button, "CENTER", 0, 0)
else
local angle = pi / 0.7 * i
button:SetPoint("CENTER", sin(angle) * 60, cos(angle) * 60)
E:Point(button, "CENTER", sin(angle) * 60, cos(angle) * 60)
end
end