Commit f22a3efc authored by Simpy's avatar Simpy 🐹

11.34

parents 7eb26b53 e3c2c860
......@@ -3,7 +3,7 @@
------------------------------------------------------------------------
local E, L, V, P, G = unpack(select(2, ...)); --Import: Engine, Locales, PrivateDB, ProfileDB, GlobalDB
--Lua functions
local _G = _G
local random, next, unpack, strsub = random, next, unpack, strsub
E.AnimShake = {{-9,7,-7,12}, {-5,9,-9,5}, {-5,7,-7,5}, {-9,9,-9,9}, {-5,7,-7,5}, {-9,7,-9,5}}
......@@ -18,6 +18,29 @@ function E:RandomAnimShake(index)
return random(s[1], s[2]), random(s[3], s[4])
end
--TEST
--[[local t = UIParent:CreateFontString("FontString","OVERLAY","GameTooltipText")
t:SetText(0)
t:SetPoint("CENTER")
t:FontTemplate(nil, 20)
E:SetUpAnimGroup(t, "Number", 10, 5)
local b = CreateFrame("BUTTON", nil, UIParent)
b:SetPoint("CENTER", 0, -100)
b:SetTemplate()
b:SetSize(40,30)
b:EnableMouse(true)
b:SetScript("OnClick", function()
if t:GetText() == 10 then
t.NumberAnim:SetChange(0)
t.NumberAnimGroup:Play()
else
t.NumberAnim:SetChange(10)
t.NumberAnimGroup:Play()
end
end)]]
function E:SetUpAnimGroup(obj, Type, ...)
if not Type then Type = 'Flash' end
......@@ -59,6 +82,29 @@ function E:SetUpAnimGroup(obj, Type, ...)
shake.path[i]:SetOffset(E.AnimShakeH[i], 0)
end
end
elseif Type == "Elastic" then
local width, height, duration, loop = ...
obj.elastic = _G.CreateAnimationGroup(obj)
for i = 1, 4 do
local anim = obj.elastic:CreateAnimation(i < 3 and 'width' or 'height')
anim:SetChange((i==1 and width*0.45) or (i==2 and width) or (i==3 and height*0.45) or height)
anim:SetEasing('inout-elastic')
anim:SetDuration(duration)
obj.elastic[i] = anim
end
obj.elastic[1]:SetScript('OnFinished', function(anim) anim:Stop() obj.elastic[2]:Play() end)
obj.elastic[3]:SetScript('OnFinished', function(anim) anim:Stop() obj.elastic[4]:Play() end)
obj.elastic[2]:SetScript('OnFinished', function(anim) anim:Stop() if loop then obj.elastic[1]:Play() end end)
obj.elastic[4]:SetScript('OnFinished', function(anim) anim:Stop() if loop then obj.elastic[3]:Play() end end)
elseif Type == "Number" then
local endingNumber, duration = ...
obj.NumberAnimGroup = _G.CreateAnimationGroup(obj)
obj.NumberAnim = obj.NumberAnimGroup:CreateAnimation('number')
obj.NumberAnim:SetChange(endingNumber)
obj.NumberAnim:SetEasing('in-circular')
obj.NumberAnim:SetDuration(duration)
else
local x, y, duration, customName = ...
if not customName then customName = 'anim' end
......@@ -88,6 +134,22 @@ function E:SetUpAnimGroup(obj, Type, ...)
end
end
function E:Elasticize(obj)
if not obj.elastic then
E:SetUpAnimGroup(obj, 'Elastic', 128, 64, 2, false)
end
obj.elastic[1]:Play()
obj.elastic[3]:Play()
end
function E:StopElasticize(obj)
if obj.elastic then
obj.elastic[1]:Stop(true)
obj.elastic[3]:Stop(true)
end
end
function E:Shake(obj)
if not obj.shake then
E:SetUpAnimGroup(obj, 'Shake')
......
This diff is collapsed.
......@@ -51,6 +51,7 @@ local LSM = E.Libs.LSM
--Constants
E.noop = function() end
E.title = format('|cfffe7b2c%s |r', 'ElvUI')
E.version = GetAddOnMetadata('ElvUI', 'Version')
E.myfaction, E.myLocalizedFaction = UnitFactionGroup('player')
E.mylevel = UnitLevel('player')
E.myLocalizedClass, E.myclass, E.myClassID = UnitClass('player')
......@@ -58,13 +59,12 @@ E.myLocalizedRace, E.myrace = UnitRace('player')
E.myname = UnitName('player')
E.myrealm = GetRealmName()
E.myspec = GetSpecialization()
E.version = GetAddOnMetadata('ElvUI', 'Version')
E.wowpatch, E.wowbuild = GetBuildInfo()
E.wowbuild = tonumber(E.wowbuild)
E.isMacClient = IsMacClient()
E.IsRetail = WOW_PROJECT_ID == WOW_PROJECT_MAINLINE
E.screenwidth, E.screenheight = GetPhysicalScreenSize()
E.resolution = format('%dx%d', E.screenwidth, E.screenheight)
E.isMacClient = IsMacClient()
E.NewSign = '|TInterface\\OptionsFrame\\UI-OptionsFrame-NewFeatureIcon:14:14|t' -- not used by ElvUI yet, but plugins like BenikUI and MerathilisUI use it.
E.TexturePath = 'Interface\\AddOns\\ElvUI\\Media\\Textures\\' -- for plugins?
E.InfoColor = '|cfffe7b2c'
......@@ -925,7 +925,7 @@ function E:UpdateNamePlates(skipCallback)
end
function E:UpdateTooltip()
-- for plugins :3
Tooltip:SetTooltipFonts()
end
function E:UpdateBags(skipCallback)
......@@ -1063,6 +1063,9 @@ do
if E.private.chat.enable then
tinsert(staggerTable, 'UpdateChat')
end
if E.private.tooltip.enable then
tinsert(staggerTable, 'UpdateTooltip')
end
tinsert(staggerTable, 'UpdateDataBars')
tinsert(staggerTable, 'UpdateDataTexts')
if E.private.general.minimap.enable then
......@@ -1278,12 +1281,11 @@ function E:InitializeModules()
end
local function buffwatchConvert(spell)
if spell.sizeOverride then
local newSize = spell.sizeOverride
spell.size = (newSize > 8 and newSize) or 8
spell.sizeOverride = nil
elseif not spell.size or spell.size < 6 then
spell.size = 6
if spell.sizeOverride then spell.sizeOverride = nil end
if spell.size then spell.size = nil end
if not spell.sizeOffset then
spell.sizeOffset = 0
end
if spell.styleOverride then
......@@ -1500,6 +1502,15 @@ function E:DBConversions()
for _, spell in pairs(E.db.unitframe.filters.buffwatch) do
buffwatchConvert(spell)
end
-- fix aurabars colors
for spell, info in pairs(E.global.unitframe.AuraBarColors) do
if type(info) == 'boolean' then
E.global.unitframe.AuraBarColors[spell] = { enable = info, color = { r = 1, g = 1, b = 1, a = 1} }
elseif type(info) == 'table' and info.r then
E.global.unitframe.AuraBarColors[spell] = { enable = true, color = info }
end
end
end
function E:RefreshModulesDB()
......@@ -1514,6 +1525,9 @@ function E:Initialize()
twipe(self.global)
twipe(self.private)
LSM.DefaultMedia.font = 'PT Sans Narrow'
LSM.DefaultMedia.statusbar = 'ElvUI Norm'
self.myguid = UnitGUID('player')
self.data = E.Libs.AceDB:New('ElvDB', self.DF)
self.data.RegisterCallback(self, 'OnProfileChanged', 'StaggeredUpdateAll')
......
......@@ -7,6 +7,7 @@ local S = E:GetModule('Skins')
local _G = _G
local gsub = gsub
local format = format
local pairs = pairs
local ipairs = ipairs
local tinsert = tinsert
--WoW API / Variables
......@@ -294,43 +295,13 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
E.db.general.totems.growthDirection = 'HORIZONTAL'
E.db.general.totems.size = 50
E.db.general.totems.spacing = 8
--Movers
E.db.movers.AlertFrameMover = 'TOP,ElvUIParent,TOP,-1,-18'
E.db.movers.AltPowerBarMover = 'TOP,ElvUIParent,TOP,-1,-36'
E.db.movers.AzeriteBarMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-3,-245'
E.db.movers.BelowMinimapContainerMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-4,-274'
E.db.movers.BNETMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-4,-274'
E.db.movers.BossButton = 'BOTTOM,ElvUIParent,BOTTOM,-1,293'
E.db.movers.ElvAB_1 = 'BOTTOM,ElvUIParent,BOTTOM,-1,191'
E.db.movers.ElvAB_2 = 'BOTTOM,ElvUIParent,BOTTOM,0,4'
E.db.movers.ElvAB_3 = 'BOTTOM,ElvUIParent,BOTTOM,-1,139'
E.db.movers.ElvAB_5 = 'BOTTOM,ElvUIParent,BOTTOM,-92,57'
E.db.movers.ElvUF_FocusMover = 'BOTTOM,ElvUIParent,BOTTOM,342,59'
E.db.movers.ElvUF_PartyMover = 'BOTTOMLEFT,ElvUIParent,BOTTOMLEFT,4,248'
E.db.movers.ElvUF_PetMover = 'BOTTOM,ElvUIParent,BOTTOM,-342,100'
E.db.movers.ElvUF_PlayerCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,-1,95'
E.db.movers.ElvUF_PlayerMover = 'BOTTOM,ElvUIParent,BOTTOM,-342,139'
E.db.movers.ElvUF_Raid40Mover = 'TOPLEFT,ElvUIParent,BOTTOMLEFT,4,482'
E.db.movers.ElvUF_RaidMover = 'BOTTOMLEFT,ElvUIParent,BOTTOMLEFT,4,248'
E.db.movers.ElvUF_RaidpetMover = 'TOPLEFT,ElvUIParent,BOTTOMLEFT,4,737'
E.db.movers.ElvUF_TargetCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,-1,243'
E.db.movers.ElvUF_TargetMover = 'BOTTOM,ElvUIParent,BOTTOM,342,139'
E.db.movers.ElvUF_TargetTargetMover = 'BOTTOM,ElvUIParent,BOTTOM,342,100'
E.db.movers.ExperienceBarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,43'
E.db.movers.HonorBarMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-3,-255'
E.db.movers.LevelUpBossBannerMover = 'TOP,ElvUIParent,TOP,-1,-120'
E.db.movers.LootFrameMover = 'TOPLEFT,ElvUIParent,TOPLEFT,418,-186'
E.db.movers.LossControlMover = 'BOTTOM,ElvUIParent,BOTTOM,-1,507'
E.db.movers.MirrorTimer1Mover = 'TOP,ElvUIParent,TOP,-1,-96'
E.db.movers.ObjectiveFrameMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-163,-325'
E.db.movers.ReputationBarMover = 'TOPRIGHT,ElvUIParent,TOPRIGHT,-3,-264'
E.db.movers.ShiftAB = 'TOPLEFT,ElvUIParent,BOTTOMLEFT,4,769'
E.db.movers.SocialMenuMover = 'TOPLEFT,ElvUIParent,TOPLEFT,4,-187'
E.db.movers.TalkingHeadFrameMover = 'BOTTOM,ElvUIParent,BOTTOM,-1,373'
E.db.movers.TotemBarMover = 'BOTTOMLEFT,ElvUIParent,BOTTOMLEFT,490,4'
E.db.movers.VehicleSeatMover = 'TOPLEFT,ElvUIParent,TOPLEFT,4,-4'
E.db.movers.VOICECHAT = 'TOPLEFT,ElvUIParent,TOPLEFT,368,-210'
E.db.movers.ZoneAbility = 'BOTTOM,ElvUIParent,BOTTOM,-1,293'
for mover, position in pairs(E.LayoutMoverPositions["ALL"]) do
E.db.movers[mover] = position
E:SaveMoverDefaultPosition(mover)
end
--Tooltip
E.db.tooltip.fontSize = 10
E.db.tooltip.healthBar.fontOutline = 'MONOCHROMEOUTLINE'
......@@ -443,23 +414,21 @@ function E:SetupLayout(layout, noDataReset, noDisplayMsg)
Layout Tweaks will be handled below,
These are changes that deviate from the shared base layout.
]]
if E.LayoutMoverPositions[layout] then
for mover, position in pairs(E.LayoutMoverPositions[layout]) do
E.db.movers[mover] = position
E:SaveMoverDefaultPosition(mover)
end
end
if layout == 'dpsCaster' then
E.db.movers.ElvUF_PlayerCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,243'
E.db.movers.ElvUF_TargetCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,97'
elseif layout == 'healer' then
E.db.movers.ElvUF_PlayerCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,243'
E.db.movers.ElvUF_TargetCastbarMover = 'BOTTOM,ElvUIParent,BOTTOM,0,97'
E.db.movers.ElvUF_RaidMover = 'BOTTOMLEFT,ElvUIParent,BOTTOMLEFT,202,373'
E.db.movers.LootFrameMover = 'TOPLEFT,ElvUIParent,TOPLEFT,250,-104'
E.db.movers.ShiftAB = 'TOPLEFT,ElvUIParent,BOTTOMLEFT,4,273'
E.db.movers.VOICECHAT = 'TOPLEFT,ElvUIParent,TOPLEFT,250,-82'
if layout == 'healer' then
E.db.unitframe.units.party.enable = false
E.db.unitframe.units.raid.visibility = '[nogroup] hide;show'
end
end
E:StaggeredUpdateAll(nil, true)
E.db.layoutSetting = layout
if _G.InstallStepComplete and not noDisplayMsg then
_G.InstallStepComplete.message = L["Layout Set"]
......@@ -473,8 +442,7 @@ local function SetupAuras(style, noDisplayMsg)
E:CopyTable(E.db.unitframe.units.player.debuffs, P.unitframe.units.player.debuffs)
E:CopyTable(E.db.unitframe.units.player.aurabar, P.unitframe.units.player.aurabar)
if frame then
UF:Configure_Auras(frame, 'Buffs')
UF:Configure_Auras(frame, 'Debuffs')
UF:Configure_AllAuras(frame)
UF:Configure_AuraBars(frame)
end
......@@ -483,8 +451,7 @@ local function SetupAuras(style, noDisplayMsg)
E:CopyTable(E.db.unitframe.units.target.debuffs, P.unitframe.units.target.debuffs)
E:CopyTable(E.db.unitframe.units.target.aurabar, P.unitframe.units.target.aurabar)
if frame then
UF:Configure_Auras(frame, 'Buffs')
UF:Configure_Auras(frame, 'Debuffs')
UF:Configure_AllAuras(frame)
UF:Configure_AuraBars(frame)
end
......@@ -493,8 +460,7 @@ local function SetupAuras(style, noDisplayMsg)
E:CopyTable(E.db.unitframe.units.focus.debuffs, P.unitframe.units.focus.debuffs)
E:CopyTable(E.db.unitframe.units.focus.aurabar, P.unitframe.units.focus.aurabar)
if frame then
UF:Configure_Auras(frame, 'Buffs')
UF:Configure_Auras(frame, 'Debuffs')
UF:Configure_AllAuras(frame)
UF:Configure_AuraBars(frame)
end
......
<Ui xmlns="http://www.blizzard.com/wow/ui/">
<Script file='Patch.lua'/>
<Script file='Core.lua'/>
<Script file='Math.lua'/>
<Script file='API.lua'/>
......
This diff is collapsed.
local issecurevariable = issecurevariable
local hooksecurefunc = hooksecurefunc
local _G = _G
do --taint workarounds by townlong-yak.com (rearranged by Simpy)
--CommunitiesUI - https://www.townlong-yak.com/bugs/Kjq4hm-DisplayModeTaint
if (_G.UIDROPDOWNMENU_OPEN_PATCH_VERSION or 0) < 1 then _G.UIDROPDOWNMENU_OPEN_PATCH_VERSION = 1 end
--CommunitiesUI #2 - https://www.townlong-yak.com/bugs/YhgQma-SetValueRefreshTaint
if (_G.COMMUNITY_UIDD_REFRESH_PATCH_VERSION or 0) < 1 then _G.COMMUNITY_UIDD_REFRESH_PATCH_VERSION = 1 end
-- *NOTE* Simpy: these two were updated to fix an issue which was caused on the dropdowns with submenus
--HonorFrameLoadTaint - https://www.townlong-yak.com/bugs/afKy4k-HonorFrameLoadTaint
if (_G.ELVUI_UIDROPDOWNMENU_VALUE_PATCH_VERSION or 0) < 1 then _G.ELVUI_UIDROPDOWNMENU_VALUE_PATCH_VERSION = 1 end
--RefreshOverread - https://www.townlong-yak.com/bugs/Mx7CWN-RefreshOverread
if (_G.ELVUI_UIDD_REFRESH_OVERREAD_PATCH_VERSION or 0) < 1 then _G.ELVUI_UIDD_REFRESH_OVERREAD_PATCH_VERSION = 1 end
if _G.ELVUI_UIDROPDOWNMENU_VALUE_PATCH_VERSION == 1 or _G.UIDROPDOWNMENU_OPEN_PATCH_VERSION == 1 or _G.ELVUI_UIDD_REFRESH_OVERREAD_PATCH_VERSION == 1 then
local function drop(t, k)
local c = 42
t[k] = nil
while not issecurevariable(t, k) do
if t[c] == nil then
t[c] = nil
end
c = c + 1
end
end
hooksecurefunc('UIDropDownMenu_InitializeHelper', function(frame)
if _G.ELVUI_UIDROPDOWNMENU_VALUE_PATCH_VERSION == 1 or _G.ELVUI_UIDD_REFRESH_OVERREAD_PATCH_VERSION == 1 then
for i=1, _G.UIDROPDOWNMENU_MAXLEVELS do
local d = _G['DropDownList' .. i]
if d and d.numButtons then
for j = d.numButtons+1, _G.UIDROPDOWNMENU_MAXBUTTONS do
local b, _ = _G['DropDownList' .. i .. 'Button' .. j]
if _G.ELVUI_UIDROPDOWNMENU_VALUE_PATCH_VERSION == 1 and not (issecurevariable(b, 'value') or b:IsShown()) then
b.value = nil
repeat j, b['fx' .. j] = j+1, nil
until issecurevariable(b, 'value')
end
if _G.ELVUI_UIDD_REFRESH_OVERREAD_PATCH_VERSION == 1 then
_ = issecurevariable(b, 'checked') or drop(b, 'checked')
_ = issecurevariable(b, 'notCheckable') or drop(b, 'notCheckable')
end
end
end
end
end
if _G.UIDROPDOWNMENU_OPEN_PATCH_VERSION == 1 then
if _G.UIDROPDOWNMENU_OPEN_MENU and _G.UIDROPDOWNMENU_OPEN_MENU ~= frame and not issecurevariable(_G.UIDROPDOWNMENU_OPEN_MENU, 'displayMode') then
_G.UIDROPDOWNMENU_OPEN_MENU = nil
local prefix, i = ' \0', 1
repeat i, _G[prefix .. i] = i + 1, nil
until issecurevariable(_G.UIDROPDOWNMENU_OPEN_MENU)
end
end
end)
end
if _G.COMMUNITY_UIDD_REFRESH_PATCH_VERSION == 1 then
local function CleanDropdowns()
if _G.COMMUNITY_UIDD_REFRESH_PATCH_VERSION == 1 then
local f, f2 = _G.FriendsFrame, _G.FriendsTabHeader
local s = f:IsShown()
f:Hide()
f:Show()
if not f2:IsShown() then
f2:Show()
f2:Hide()
end
if not s then
f:Hide()
end
end
end
hooksecurefunc('Communities_LoadUI', CleanDropdowns)
hooksecurefunc('SetCVar', function(n)
if n == 'lastSelectedClubId' then
CleanDropdowns()
end
end)
end
end
......@@ -87,7 +87,7 @@ function E:PixelScaleChanged(event)
E:UIScale(true) --Repopulate variables
E:UIScale() --Setup the scale
E:UpdateConfigSize(true) --Reposition config
E:Config_UpdateSize(true) --Reposition config
end
function E:Scale(x)
......
......@@ -4,7 +4,6 @@ local Skins = E:GetModule('Skins')
--WoW API / Variables
local CreateFrame = CreateFrame
local GetAddOnInfo = GetAddOnInfo
local GetPhysicalScreenSize = GetPhysicalScreenSize
local GetCVar = GetCVar
local GetLocale = GetLocale
local GetNumAddOns = GetNumAddOns
......@@ -98,62 +97,79 @@ local function GetSpecName()
return EnglishSpecName[GetSpecializationInfo(GetSpecialization())]
end
local function CreateContentLines(num, parent, anchorTo)
local content = CreateFrame('Frame', nil, parent)
content:Size(260, (num * 20) + ((num-1)*5)) --20 height and 5 spacing
content:Point('TOP', anchorTo, 'BOTTOM',0 , -5)
for i = 1, num do
local line = CreateFrame('Frame', nil, content)
line:Size(260, 20)
local text = line:CreateFontString(nil, 'ARTWORK', 'SystemFont_Outline')
text:SetAllPoints()
text:SetJustifyH('LEFT')
text:SetJustifyV('MIDDLE')
line.Text = text
local numLine = line
if i == 1 then
numLine:Point('TOP', content, 'TOP')
else
numLine:Point('TOP', content['Line'..(i-1)], 'BOTTOM', 0, -5)
end
content['Line'..i] = numLine
end
return content
end
local function CloseClicked()
if E.StatusReportToggled then
E.StatusReportToggled = nil
E:ToggleOptionsUI()
end
end
function E:CreateStatusFrame()
local function CreateSection(width, height, parent, anchor1, anchorTo, anchor2, yOffset)
local section = CreateFrame('Frame', nil, parent)
section:Size(width, height)
section:Point(anchor1, anchorTo, anchor2, 0, yOffset)
section.Header = CreateFrame('Frame', nil, section)
section.Header:Size(300, 30)
section.Header:Point('TOP', section)
section.Header.Text = section.Header:CreateFontString(nil, 'ARTWORK', 'SystemFont_Outline')
section.Header.Text:Point('TOP')
section.Header.Text:Point('BOTTOM')
section.Header.Text:SetJustifyH('CENTER')
section.Header.Text:SetJustifyV('MIDDLE')
local font, fontHeight, fontFlags = section.Header.Text:GetFont()
section.Header.Text:FontTemplate(font, fontHeight*1.3, fontFlags)
section.Header.LeftDivider = section.Header:CreateTexture(nil, 'ARTWORK')
section.Header.LeftDivider:Height(8)
section.Header.LeftDivider:Point('LEFT', section.Header, 'LEFT', 5, 0)
section.Header.LeftDivider:Point('RIGHT', section.Header.Text, 'LEFT', -5, 0)
section.Header.LeftDivider:SetTexture('Interface\\Tooltips\\UI-Tooltip-Border')
section.Header.LeftDivider:SetTexCoord(0.81, 0.94, 0.5, 1)
section.Header.RightDivider = section.Header:CreateTexture(nil, 'ARTWORK')
section.Header.RightDivider:Height(8)
section.Header.RightDivider:Point('RIGHT', section.Header, 'RIGHT', -5, 0)
section.Header.RightDivider:Point('LEFT', section.Header.Text, 'RIGHT', 5, 0)
section.Header.RightDivider:SetTexture('Interface\\Tooltips\\UI-Tooltip-Border')
section.Header.RightDivider:SetTexCoord(0.81, 0.94, 0.5, 1)
local header = CreateFrame('Frame', nil, section)
header:Size(300, 30)
header:Point('TOP', section)
section.Header = header
return section
end
local text = section.Header:CreateFontString(nil, 'ARTWORK', 'SystemFont_Outline')
text:Point('TOP')
text:Point('BOTTOM')
text:SetJustifyH('CENTER')
text:SetJustifyV('MIDDLE')
local function CreateContentLines(num, parent, anchorTo)
local content = CreateFrame('Frame', nil, parent)
content:Size(260, (num * 20) + ((num-1)*5)) --20 height and 5 spacing
content:Point('TOP', anchorTo, 'BOTTOM',0 , -5)
for i = 1, num do
local line = CreateFrame('Frame', nil, content)
line:Size(260, 20)
line.Text = line:CreateFontString(nil, 'ARTWORK', 'SystemFont_Outline')
line.Text:SetAllPoints()
line.Text:SetJustifyH('LEFT')
line.Text:SetJustifyV('MIDDLE')
content['Line'..i] = line
if i == 1 then
content['Line'..i]:Point('TOP', content, 'TOP')
else
content['Line'..i]:Point('TOP', content['Line'..(i-1)], 'BOTTOM', 0, -5)
end
end
local font, fontHeight, fontFlags = text:GetFont()
text:FontTemplate(font, fontHeight*1.3, fontFlags)
section.Header.Text = text
return content
local leftDivider = section.Header:CreateTexture(nil, 'ARTWORK')
leftDivider:Height(8)
leftDivider:Point('LEFT', section.Header, 'LEFT', 5, 0)
leftDivider:Point('RIGHT', section.Header.Text, 'LEFT', -5, 0)
leftDivider:SetTexture('Interface\\Tooltips\\UI-Tooltip-Border')
leftDivider:SetTexCoord(0.81, 0.94, 0.5, 1)
section.Header.LeftDivider = leftDivider
local rightDivider = section.Header:CreateTexture(nil, 'ARTWORK')
rightDivider:Height(8)
rightDivider:Point('RIGHT', section.Header, 'RIGHT', -5, 0)
rightDivider:Point('LEFT', section.Header.Text, 'RIGHT', 5, 0)
rightDivider:SetTexture('Interface\\Tooltips\\UI-Tooltip-Border')
rightDivider:SetTexCoord(0.81, 0.94, 0.5, 1)
section.Header.RightDivider = rightDivider
return section
end
--Main frame
......@@ -163,17 +179,24 @@ function E:CreateStatusFrame()
StatusFrame:SetFrameStrata('HIGH')
StatusFrame:CreateBackdrop('Transparent', nil, true)
StatusFrame.backdrop:SetBackdropColor(0, 0, 0, 0.6)
StatusFrame:SetShown(false)
StatusFrame:SetMovable(true)
StatusFrame:Hide()
--Close button and script to retoggle the options.
StatusFrame:CreateCloseButton()
StatusFrame.CloseButton:HookScript('OnClick', CloseClicked)
--Title logo (drag to move frame)
StatusFrame.TitleLogoFrame = CreateFrame('Frame', nil, StatusFrame, 'TitleDragAreaTemplate')
StatusFrame.TitleLogoFrame:Size(128, 64)
StatusFrame.TitleLogoFrame:Point('CENTER', StatusFrame, 'TOP', 0, 0)
StatusFrame.TitleLogoFrame.Texture = StatusFrame.TitleLogoFrame:CreateTexture(nil, 'ARTWORK')
StatusFrame.TitleLogoFrame.Texture:SetTexture(E.Media.Textures.Logo)
StatusFrame.TitleLogoFrame.Texture:SetAllPoints()
local titleLogoFrame = CreateFrame('Frame', nil, StatusFrame, 'TitleDragAreaTemplate')
titleLogoFrame:Point('CENTER', StatusFrame, 'TOP')
titleLogoFrame:Size(240, 80)
StatusFrame.TitleLogoFrame = titleLogoFrame
local titleTexture = StatusFrame.TitleLogoFrame:CreateTexture(nil, 'ARTWORK')
titleTexture:Point('CENTER', titleLogoFrame, 'TOP', 0, -36)
titleTexture:SetTexture(E.Media.Textures.LogoSmall)
titleTexture:Size(128, 64)
titleLogoFrame.Texture = titleTexture
--Sections
StatusFrame.Section1 = CreateSection(300, 125, StatusFrame, 'TOP', StatusFrame, 'TOP', -30)
......@@ -218,35 +241,40 @@ function E:CreateStatusFrame()
StatusFrame.Section4.Content.Button1:Point('LEFT', StatusFrame.Section4.Content, 'LEFT')
StatusFrame.Section4.Content.Button1:SetText('Forum')
StatusFrame.Section4.Content.Button1:SetButtonState('DISABLED')
Skins:HandleButton(StatusFrame.Section4.Content.Button1, true)
StatusFrame.Section4.Content.Button2 = CreateFrame('Button', nil, StatusFrame.Section4.Content, 'UIPanelButtonTemplate')
StatusFrame.Section4.Content.Button2:Size(100, 25)
StatusFrame.Section4.Content.Button2:Point('RIGHT', StatusFrame.Section4.Content, 'RIGHT')
StatusFrame.Section4.Content.Button2:SetText('Ticket')
StatusFrame.Section4.Content.Button2:SetButtonState('DISABLED')
Skins:HandleButton(StatusFrame.Section4.Content.Button1, true)
Skins:HandleButton(StatusFrame.Section4.Content.Button2, true)
E.StatusFrame = StatusFrame
return StatusFrame
end