local _G = _G -- import globals for faster usage
-- Create an function so we can give all the frames texts in a smart way!
function CreateOptions(self, TextTitle, DescriptionsText) -- CreateOptions(self, "Header Text", "Description Text")
local title = self:CreateFontString(nil, "OVERLAY")
title:SetFontObject('GameFontNormalLarge')
title:SetPoint('TOPLEFT', 16, -16)
title:SetText(TextTitle) -- Header Text
local title2 = self:CreateFontString(nil, "OVERLAY")
title2:SetFontObject('GameFontHighlightSmall')
title2:SetPoint('TOPLEFT', 17, -37)
title2:SetText(DescriptionsText) -- Description Text.
end
function CloseButton(self) -- CloseButton(self, id)
local closeButton = CreateFrame("CheckButton", "CheckBoxButton", self, "UIPanelCloseButton")
closeButton:SetSize(26, 26)
closeButton:SetPoint("TOPRIGHT", self)
closeButton:SetNormalTexture("")
closeButton:SetHighlightTexture("")
closeButton:SetPushedTexture("")
closeButton:SetDisabledTexture("")
closeButton:SetBackdrop({
bgFile = AftermathhUI.media.backdrop,
insets = {top = 1, left = 1, bottom = 1, right = 1},
})
CreateBorderLight(closeButton, AftermathhUI.media.bordersize-1, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, -2)
local closeButtonfont = closeButton:CreateFontString(nil, "OVERLAY")
closeButtonfont:SetFont(AftermathhUI.media.font, 14, AftermathhUI.media.fontflag)
if AftermathhUI.media.shadowoffset == true then
closeButtonfont:SetShadowOffset(1, -1)
closeButtonfont:SetShadowColor(0, 0, 0)
end
closeButtonfont:SetPoint("CENTER", 1, 1)
closeButtonfont:SetText("x")
closeButton:HookScript("OnEnter", function(self)
closeButtonfont:SetTextColor(1, 0, 0)
ColorBorder(closeButton, 1, 0, 0)
end)
closeButton:HookScript("OnLeave", function(self)
closeButtonfont:SetTextColor(1, 1, 1)
ColorBorder(closeButton, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor)
end)
end
function Checkbox(self, selfid, px, py, description, SetChecked, OnClick) -- Checkbox(self, 1, 14, -55, "Description Text", SetChecked, OnClick)
local checkbox = CreateFrame("CheckButton", "AfterCheckBoxButton" .. selfid, self, "OptionsSmallCheckButtonTemplate")
checkbox:SetPoint("TOPLEFT", self, px, py)
checkbox:SetScript("OnClick", OnClick)
checkbox:SetWidth(28)
checkbox:SetHeight(28)
checkbox:SetFrameStrata("HIGH")
checkbox:SetChecked(SetChecked)
checkbox:SetHitRectInsets(0, -60, 0, 0)
checkbox:SetNormalTexture("")
checkbox:SetPushedTexture("")
checkbox:SetHighlightTexture("")
checkbox:SetBackdrop({
bgFile = AftermathhUI.media.backdrop,
insets = {top = 4, left = 4, bottom = 4, right = 4},
})
CreateBorderLight(checkbox, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, -4)
checkbox:HookScript("OnEnter", function(self)
ColorBorder(checkbox, 1, 1, 1)
end)
checkbox:HookScript("OnLeave", function(self)
ColorBorder(checkbox, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor)
end)
local checkboxtexture = checkbox:CreateTexture(nil, "OVERLAY")
checkboxtexture:SetWidth(25)
checkboxtexture:SetHeight(22)
checkboxtexture:SetAlpha(0.9)
checkboxtexture:SetPoint("LEFT", 2, 1)
checkboxtexture:SetTexture("Interface\\RAIDFRAME\\ReadyCheck-Ready")
checkbox:SetCheckedTexture(checkboxtexture)
local checkboxtext = self:CreateFontString(nil, "ARTWORK", "GameFontNormal")
checkboxtext:SetPoint("LEFT", checkbox, "RIGHT", 5, 1)
checkboxtext:SetFontObject("GameFontNormal")
checkboxtext:SetTextColor(1, 1, 1)
checkboxtext:SetText(description)
end
local function AftermathhUIFrameOnEnter(self, subfont)
self:HookScript("OnEnter", function()
ColorBorder(self, 1, 1, 1)
subfont:SetTextColor(1, 1, 1)
end)
self:HookScript("OnLeave", function()
ColorBorder(self, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor)
subfont:SetTextColor(1.0, 0.82, 0)
end)
end
function ShowBuffs_OnClick()
end
------------------------- MAIN -------------------------------------------------
local AftermathhUIFrame = CreateFrame("Frame", "AftermathhUIFrame", UIParent)
AftermathhUIFrame:SetSize(800, 550)
AftermathhUIFrame:SetFrameStrata("HIGH")
AftermathhUIFrame:SetFrameLevel(25)
AftermathhUIFrame:SetBackdrop({
bgFile = AftermathhUI.media.blank,
insets = {top = -4, left = -4, bottom = -4, right = -4},
})
AftermathhUIFrame:SetBackdropColor(unpack(AftermathhUI.media.backdropcolor))
AftermathhUIFrame:Hide()
--------------------------------
----- Make it moveable! --------
--------------------------------
AftermathhUIFrame:SetClampedToScreen(true)
AftermathhUIFrame:SetMovable(true)
AftermathhUIFrame:SetUserPlaced(true)
AftermathhUIFrame:EnableMouse(true)
AftermathhUIFrame:RegisterForDrag("LeftButton")
AftermathhUIFrame:SetHitRectInsets(-15, -15, -5, -5)
AftermathhUIFrame:ClearAllPoints()
AftermathhUIFrame.ClearAllPoints = function() end
AftermathhUIFrame:SetPoint("CENTER", UIParent)
AftermathhUIFrame.SetPoint = function() end
AftermathhUIFrame:SetScript("OnDragStart", function(self)
AftermathhUIFrame:StartMoving()
end)
AftermathhUIFrame:SetScript("OnDragStop", function(self)
AftermathhUIFrame:StopMovingOrSizing()
end)
-----------------------
-- Create Stuff!!! ----
-----------------------
CreateOptions(AftermathhUIFrame, "AftermathhUI_GUI", "Welcome to AftermathhUI_GUI. Here you can find most of the options that are needed!")
CloseButton(AftermathhUIFrame)
CreateBorderLight(AftermathhUIFrame, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 4)
-------------------- SUB 1 ------------------------------------------
local AftermathhUIFrameSub1 = CreateFrame("Button", "AftermathhUIFrameSub1", AftermathhUIFrame)
AftermathhUIFrameSub1:SetSize(73, 20)
AftermathhUIFrameSub1:SetFrameStrata("HIGH")
AftermathhUIFrameSub1:SetFrameLevel(26)
AftermathhUIFrameSub1:SetBackdrop({
bgFile = AftermathhUI.media.texture2,
})
AftermathhUIFrameSub1:SetBackdropColor(.40, .40, .40, 1)
AftermathhUIFrameSub1:SetPoint("TOPLEFT", AftermathhUIFrame, 19, -65)
AftermathhUIFrameSub1:Hide()
CreateBorderLight(AftermathhUIFrameSub1, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 1)
local AftermathhUIFrameSub1Font = AftermathhUIFrameSub1:CreateFontString(nil, "OVERLAY")
AftermathhUIFrameSub1Font:SetFontObject('GameFontHighlightSmall')
AftermathhUIFrameSub1Font:SetText("Unitframes")
AftermathhUIFrameSub1Font:SetPoint("CENTER")
AftermathhUIFrameSub1Font:SetTextColor(1.0, 0.82, 0)
----------------------------- SUB 2 -------------------------------------
local AftermathhUIFrameSub2 = CreateFrame("Button", "AftermathhUIFrameSub2", AftermathhUIFrame)
AftermathhUIFrameSub2:SetSize(73, 20)
AftermathhUIFrameSub2:SetFrameStrata("HIGH")
AftermathhUIFrameSub2:SetFrameLevel(26)
AftermathhUIFrameSub2:SetBackdrop({
bgFile = AftermathhUI.media.texture2,
})
AftermathhUIFrameSub2:SetBackdropColor(.40, .40, .40, 1)
AftermathhUIFrameSub2:SetPoint("TOPLEFT", AftermathhUIFrame, 97, -65)
AftermathhUIFrameSub2:Hide()
CreateBorderLight(AftermathhUIFrameSub2, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 1)
--Checkbox(AftermathhUIFrameSub2, 1, 14, -55, "Show New Buff Timers Output Is; 28:30.", AftermathhUI.buffs.newbufftimers)
--Checkbox(AftermathhUIFrameSub2, 2, 14, -75, "Show Old Buff Timers Output Is; 28(m with classcolors).", AftermathhUI.buffs.oldbufftimers)
local AftermathhUIFrameSub2Font = AftermathhUIFrameSub2:CreateFontString(nil, "OVERLAY")
AftermathhUIFrameSub2Font:SetFontObject('GameFontHighlightSmall')
AftermathhUIFrameSub2Font:SetText("Buffs")
AftermathhUIFrameSub2Font:SetPoint("CENTER")
AftermathhUIFrameSub2Font:SetTextColor(1.0, 0.82, 0)
-------------------- SUB 3 -------------------------------------------------
local AftermathhUIFrameSub3 = CreateFrame("Button", "AftermathhUIFrameSub3", AftermathhUIFrame)
AftermathhUIFrameSub3:SetSize(73, 20)
AftermathhUIFrameSub3:SetFrameStrata("HIGH")
AftermathhUIFrameSub3:SetFrameLevel(26)
AftermathhUIFrameSub3:SetBackdrop({
bgFile = AftermathhUI.media.texture2,
})
AftermathhUIFrameSub3:SetBackdropColor(.40, .40, .40, 1)
AftermathhUIFrameSub3:SetPoint("TOPLEFT", AftermathhUIFrame, 175, -65)
AftermathhUIFrameSub3:Hide()
CreateBorderLight(AftermathhUIFrameSub3, AftermathhUI.media.bordersize, AftermathhUI.bordercolor, AftermathhUI.bordercolor, AftermathhUI.bordercolor, 1)
local AftermathhUIFrameSub3Font = AftermathhUIFrameSub3:CreateFontString(nil, "OVERLAY")
AftermathhUIFrameSub3Font:SetFontObject('GameFontHighlightSmall')
AftermathhUIFrameSub3Font:SetText("Chat")
AftermathhUIFrameSub3Font:SetPoint("CENTER")
AftermathhUIFrameSub3Font:SetTextColor(1.0, 0.82, 0)
------------------------
-- On enter on button --
------------------------
AftermathhUIFrameOnEnter(AftermathhUIFrameSub1, AftermathhUIFrameSub1Font)
AftermathhUIFrameOnEnter(AftermathhUIFrameSub2, AftermathhUIFrameSub2Font)
AftermathhUIFrameOnEnter(AftermathhUIFrameSub3, AftermathhUIFrameSub3Font)
-------------------------------------------------------------------------------------------
local function CreateCheckboxes(subframe)
local boxes = AftermathUIFramecheckboxes or {}
if subframe == 1 then
boxes[1] = Checkbox(AftermathhUIFrame, 1, 14, -95, "Show PvP Icon.", AftermathhUI.ouf.showpvpicon)
boxes[2] = Checkbox(AftermathhUIFrame, 2, 14, -115, "Show Buffs.", AftermathhUI.ouf.showbuffs, ShowBuffs_OnClick)
boxes[3] = Checkbox(AftermathhUIFrame, 3, 14, -135, "Show Debuffs.", AftermathhUI.ouf.showdebuffs)
boxes[4] = Checkbox(AftermathhUIFrame, 4, 14, -155, "Only Show Player Debuffs.", AftermathhUI.ouf.onlyshowplayerdebuffs)
boxes[5] = Checkbox(AftermathhUIFrame, 5, 14, -175, "Show Aggroo.", AftermathhUI.ouf.showaggroo)
boxes[6] = Checkbox(AftermathhUIFrame, 6, 14, -195, "Show Debuff Highlight", AftermathhUI.ouf.showdebuffhighlight)
boxes[7] = Checkbox(AftermathhUIFrame, 7, 14, -215, "Tooltip On Mouseover (Player etc).", AftermathhUI.ouf.tooltiponouf)
boxes[8] = Checkbox(AftermathhUIFrame, 8, 14, -235, "Show Role Icon.", AftermathhUI.ouf.showroleicon)
boxes[9] = Checkbox(AftermathhUIFrame, 9, 14, -255, "Show Boss Frames.", AftermathhUI.ouf.bossframes)
boxes[10] = Checkbox(AftermathhUIFrame, 10, 14, -275, "Show Party Frames.", AftermathhUI.ouf.showparty)
boxes[11] = Checkbox(AftermathhUIFrame, 11, 14, -295, "Tooltip On Mouseover (Raidframes).", AftermathhUI.ouf.tooltiponraid)
boxes[12] = Checkbox(AftermathhUIFrame, 12, 14, -315, "Highlight On Mouseover (Raidframes).", AftermathhUI.ouf.highlightontarget)
boxes[13] = Checkbox(AftermathhUIFrame, 13, 14, -335, "Make Raid Frames Vertical.", AftermathhUI.ouf.raidframesvertical)
boxes[14] = Checkbox(AftermathhUIFrame, 14, 14, -355, "Aura Watch (Raidframes).", AftermathhUI.ouf.aurawatch)
boxes[15] = Checkbox(AftermathhUIFrame, 15, 14, -375, "Raid Debuffs.", AftermathhUI.ouf.raiddebuffs)
boxes[16] = Checkbox(AftermathhUIFrame, 16, 14, -395, "Show Aggro On Raidframes.", AftermathhUI.ouf.showaggroonraidframes)
boxes[17] = Checkbox(AftermathhUIFrame, 17, 14, -415, "Experiance Bar.", AftermathhUI.ouf.expbar)
boxes[18] = Checkbox(AftermathhUIFrame, 18, 14, -435, "Reputation Bar.", AftermathhUI.ouf.repbar)
boxes[19] = Checkbox(AftermathhUIFrame, 19, 14, -455, "Moveable Frames.", AftermathhUI.ouf.moveableframes)
boxes[20] = Checkbox(AftermathhUIFrame, 20, 14, -475, "Totembar from oUF.", AftermathhUI.ouf.totembar)
boxes[21] = Checkbox(AftermathhUIFrame, 21, 14, -495, "Heal Prediction.", AftermathhUI.ouf.healprediction)
boxes[22] = Checkbox(AftermathhUIFrame, 22, 14, -515, "Combat Feedback.", AftermathhUI.ouf.combatfeedback)
boxes[23] = Checkbox(AftermathhUIFrame, 23, 350, -95, "Classcolor on Castbar.", AftermathhUI.ouf.castbarclasscolor)
boxes[24] = Checkbox(AftermathhUIFrame, 24, 350, -115, "Show Safe Zone.", AftermathhUI.ouf.showsafezone)
boxes[25] = Checkbox(AftermathhUIFrame, 25, 350, -135, "Show Latency.", AftermathhUI.ouf.showlatency)
boxes[26] = Checkbox(AftermathhUIFrame, 26, 350, -155, "Target Castbar Icon.", AftermathhUI.ouf.targetcastbaricon)
boxes[27] = Checkbox(AftermathhUIFrame, 27, 350, -175, "Focus Castbar Icon.", AftermathhUI.ouf.focuscastbaricon)
boxes[28] = Checkbox(AftermathhUIFrame, 28, 350, -195, "Show Interrupt Highlight.", AftermathhUI.ouf.showinterrupthighlight)
end
--elseif subframe == 2 then
-- boxes[1] = Checkbox(nil)
--elseif
--else
--end
for i = i, #boxes do
boxes[i]:Show()
end
AftermathUIFramecheckboxes = checkboxes
end
local function ReleaseCheckboxes()
local boxes = AftermathUIFramecheckboxes
local bin = AftermathUIFramerecyclebin or {}
for i = 1, #boxes do
boxes[i]:Hide()
table.insert(bin, boxes[i])
boxes[i] = nil
end
end
local function DisplayCheckboxes(subframe)
ReleaseCheckboxes()
CreateCheckboxes(subframe)
end
AftermathhUIFrameSub1:SetScript("OnClick", DisplayCheckboxes(1))
SlashCmdList['OPENAFTERMATHHUI'] = function()
AftermathhUIFrame:Show()
AftermathhUIFrameSub1:Show()
AftermathhUIFrameSub2:Show()
AftermathhUIFrameSub3:Show()
end
SLASH_OPENAFTERMATHHUI1 = '/after'
SLASH_OPENAFTERMATHHUI2 = '/aftermathhui'