Commit 76fca172 authored by Darth Predator's avatar Darth Predator
Browse files

Hell of an update! Legion version is here

parent 60d21327
<Bindings>
<Binding name="CLICK ClearRaidFlares:LeftButton" description="Clear Flares" header="RAIDFLARE">
<Binding name="CLICK SLE_ClearRaidFlares:LeftButton" description="Clear Flares" header="RAIDFLARE" category="BINDING_HEADER_SLE">
</Binding>
<Binding name="CLICK RaidFlare1:LeftButton" description="Blue Flare">
<Binding name="CLICK SLE_RaidFlare1:LeftButton" description="Blue Flare" category="BINDING_HEADER_SLE">
</Binding>
<Binding name="CLICK RaidFlare2:LeftButton" description="Green Flare">
<Binding name="CLICK SLE_RaidFlare2:LeftButton" description="Green Flare" category="BINDING_HEADER_SLE">
</Binding>
<Binding name="CLICK RaidFlare3:LeftButton" description="Purple Flare">
<Binding name="CLICK SLE_RaidFlare3:LeftButton" description="Purple Flare" category="BINDING_HEADER_SLE">
</Binding>
<Binding name="CLICK RaidFlare4:LeftButton" description="Red Flare">
<Binding name="CLICK SLE_RaidFlare4:LeftButton" description="Red Flare" category="BINDING_HEADER_SLE">
</Binding>
<Binding name="CLICK RaidFlare5:LeftButton" description="Yellow Flare">
<Binding name="CLICK SLE_RaidFlare5:LeftButton" description="Yellow Flare" category="BINDING_HEADER_SLE">
</Binding>
<Binding name="CLICK RaidFlare6:LeftButton" description="Orange Flare">
<Binding name="CLICK SLE_RaidFlare6:LeftButton" description="Orange Flare" category="BINDING_HEADER_SLE">
</Binding>
<Binding name="CLICK RaidFlare7:LeftButton" description="White Flare">
<Binding name="CLICK SLE_RaidFlare7:LeftButton" description="White Flare" category="BINDING_HEADER_SLE">
</Binding>
<Binding name="CLICK RaidFlare8:LeftButton" description="Skull Flare">
<Binding name="CLICK SLE_RaidFlare8:LeftButton" description="Skull Flare" category="BINDING_HEADER_SLE">
</Binding>
</Bindings>
\ No newline at end of file
## Interface: 60200
## Interface: 70000
## Title: |cff1784d1ElvUI|r |cff9482c9Shadow & Light|r
## Author: Darth Predator, Repooc
## Version: 2.32
## Notes: Plugin-edit for |cff1784d1ElvUI|r.
## Notes-ruRU: Плагин-редакция для |cff1784d1ElvUI|r.
## eMail: darthpred@gmail.com, repooc@tukui.org
## Version: 3.00
## Notes: Plugin-edit for |cff1784d1ElvUI|r implementing additional features.
## Notes-ruRU: Плагин-редакция для |cff1784d1ElvUI|r, добавляющий новые функции.
## URL: http://tukui.org/
## RequiredDeps: ElvUI
## OptionalDeps: AddonSkins, BigWigs, Clique, Hermes, xCT+
......@@ -12,14 +11,15 @@
## X-ElvVersion: 8.26
## SavedVariables: SLE_ArmoryDB
libs\load_libs.xml
locales\load_locales.xml
media\load_media.xml
core\load_core.xml
defaults\load_defaults.xml
modules\load_modules.xml
options\load_options.xml
skins\load_skins.xml
options\load_options.xml
Bindings.xml
......
......@@ -10,4 +10,4 @@ Authors of this addon hereby grants you the following rights:
3. This copyright notice shall be included in all copies or substantial portions of the Software.
All rights not explicitly addressed in this license are reserved by the copyright holders.
\ No newline at end of file
All rights not explicitly addressed in this license are reserved by the copyright holders.
local E, L, V, P, G = unpack(ElvUI);
local SLE = E:GetModule('SLE');
local split = string.split
local SLE, T, E, L, V, P, G = unpack(select(2, ...))
local BNET_CLIENT_WOW = BNET_CLIENT_WOW
local BNSendGameData = BNSendGameData
local SendAddonMessage = SendAddonMessage
--Building user list for dev tool
local function SendRecieve(self, event, prefix, message, channel, sender)
if event == "CHAT_MSG_ADDON" then
if prefix == 'SLE_DEV_REQ' then
local message = "wut?"
SendAddonMessage('SLE_USER_REQ', message, channel)
elseif prefix == 'SLE_USER_INFO' then
local message = UnitLevel('player')..'#'..E.myclass..'#'..E.myname..'#'..E.myrealm..'#'..SLE.version;
local message = T.UnitLevel('player')..'#'..E.myclass..'#'..E.myname..'#'..E.myrealm..'#'..SLE.version;
SendAddonMessage('SLE_DEV_INFO', message, channel)
end
elseif event == "BN_CHAT_MSG_ADDON" then
if (sender == E.myname.."-"..E.myrealm:gsub(' ','')) then return end
if prefix == 'SLE_DEV_REQ' then
local _, numBNetOnline = BNGetNumFriends()
local _, numBNetOnline = T.BNGetNumFriends()
for i = 1, numBNetOnline do
local presenceID, _, _, _, _, _, client, isOnline = BNGetFriendInfo(i)
local presenceID, _, _, _, _, _, client, isOnline = T.BNGetFriendInfo(i)
if isOnline and client == BNET_CLIENT_WOW then
local message, ID = split("#", message)
local message, ID = T.split("#", message)
if message == 'userlist' then
message = UnitLevel('player')..'#'..E.myclass..'#'..E.myname..'#'..E.myrealm..'#'..SLE.version;
message = T.UnitLevel('player')..'#'..E.myclass..'#'..E.myname..'#'..E.myrealm..'#'..SLE.version;
elseif message == 'slesay' then
message = "SLEinfo"..ID
end
......
local E, L, V, P, G = unpack(ElvUI);
local SLE = E:GetModule('SLE')
local EP = LibStub("LibElvUIPlugin-1.0")
local UF = E:GetModule('UnitFrames')
local Sk = E:GetModule("Skins")
local addon = ...
local AddOnName, Engine = ...;
--localizing functions--
local tinsert = tinsert
local _G = _G
local elvV = tonumber(E.version)
local elvR = tonumber(GetAddOnMetadata("ElvUI_SLE", "X-ElvVersion"))
local SLE = LibStub("AceAddon-3.0"):NewAddon(AddOnName, "AceConsole-3.0", "AceEvent-3.0", 'AceTimer-3.0', 'AceHook-3.0');
SLE.callbacks = SLE.callbacks or LibStub("CallbackHandler-1.0"):New(SLE)
SLE.version = GetAddOnMetadata("ElvUI_SLE", "Version")
--SLE['media'] = {}
BINDING_HEADER_SLE = "|cff9482c9Shadow & Light|r"
function SLE:MismatchText()
local text = format(L['MSG_OUTDATED'],elvV,elvR)
return text
--Creating a toolkit table
local Toolkit = {}
--localizing functions and stuff--
SLE.elvV = tonumber(E.version)
SLE.elvR = tonumber(GetAddOnMetadata("ElvUI_SLE", "X-ElvVersion"))
--Setting up table to unpack. Why? no idea
Engine[1] = SLE
Engine[2] = Toolkit
Engine[3] = E
Engine[4] = L
Engine[5] = V
Engine[6] = P
Engine[7] = G
_G[AddOnName] = Engine;
--A function to concentrate options from different modules to a single table used in plugin reg
local function GetOptions()
for _, func in Toolkit.pairs(SLE.Configs) do
func()
end
end
local function AddTutorials() --Additional tutorials
tinsert(E.TutorialList, #(E.TutorialList)+1, L["To enable full values of health/power on unitframes in Shadow & Light add \":sl\" to the end of the health/power tag.\nExample: [health:current:sl]."]);
function SLE:OnInitialize()
--Incompatibility stuff will go here
SLE:CheckIncompatible()
SLE:AddTutorials()
end
local function ConfigCats() --Additional mover groups
tinsert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L");
local f=CreateFrame("Frame")
f:RegisterEvent("PLAYER_LOGIN")
f:SetScript("OnEvent", function()
SLE:Initialize()
end)
function SLE:ConfigCats() --Additional mover groups
Toolkit.tinsert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L");
E.ConfigModeLocalizedStrings["S&L"] = L["S&L: All"]
tinsert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L DT");
Toolkit.tinsert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L DT");
E.ConfigModeLocalizedStrings["S&L DT"] = L["S&L: Datatexts"]
if E.private.sle.backgrounds then
tinsert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L BG");
E.ConfigModeLocalizedStrings["S&L BG"] = L["S&L: Backgrounds"]
end
tinsert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L MISC");
-- if E.private.sle.backgrounds then
Toolkit.tinsert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L BG");
E.ConfigModeLocalizedStrings["S&L BG"] = L["S&L: Backgrounds"]
-- end
Toolkit.tinsert(E.ConfigModeLayouts, #(E.ConfigModeLayouts)+1, "S&L MISC");
E.ConfigModeLocalizedStrings["S&L MISC"] = L["S&L: Misc"]
end
local function GetOptions()
for _, func in pairs(E.SLEConfigs) do
func()
end
end
local function IncompatibleAddOn(addon, module, optiontable, value)
E.PopupDialogs['SLE_INCOMPATIBLE_ADDON'].button1 = addon
E.PopupDialogs['SLE_INCOMPATIBLE_ADDON'].button2 = 'S&L: '..module
E.PopupDialogs['SLE_INCOMPATIBLE_ADDON'].addon = addon
E.PopupDialogs['SLE_INCOMPATIBLE_ADDON'].module = module
E.PopupDialogs['SLE_INCOMPATIBLE_ADDON'].optiontable = optiontable
E.PopupDialogs['SLE_INCOMPATIBLE_ADDON'].value = value
E.PopupDialogs['SLE_INCOMPATIBLE_ADDON'].showAlert = true
function SLE:IncompatibleAddOn(addon, module, optiontable, value)
E.PopupDialogs["SLE_INCOMPATIBLE_ADDON"].button1 = addon
E.PopupDialogs["SLE_INCOMPATIBLE_ADDON"].button2 = 'S&L: '..module
E.PopupDialogs["SLE_INCOMPATIBLE_ADDON"].addon = addon
E.PopupDialogs["SLE_INCOMPATIBLE_ADDON"].module = module
E.PopupDialogs["SLE_INCOMPATIBLE_ADDON"].optiontable = optiontable
E.PopupDialogs["SLE_INCOMPATIBLE_ADDON"].value = value
E.PopupDialogs["SLE_INCOMPATIBLE_ADDON"].showAlert = true
E:StaticPopup_Show('SLE_INCOMPATIBLE_ADDON', addon, module)
end
local function CheckIncompatible()
if IsAddOnLoaded('ElvUI_Enhanced') and not E.global.ignoreEnhancedIncompatible then
function SLE:CheckIncompatible()
if Toolkit.IsAddOnLoaded('ElvUI_Enhanced') and not E.global.ignoreEnhancedIncompatible then
E:StaticPopup_Show('ENHANCED_SLE_INCOMPATIBLE')
end
if IsAddOnLoaded('SquareMinimapButtons') and E.private.sle.minimap.mapicons.enable then
IncompatibleAddOn('SquareMinimapButtons', 'SquareMinimapButtons', E.private.sle.minimap.mapicons, "enable")
if Toolkit.IsAddOnLoaded('SquareMinimapButtons') and E.private.sle.minimap.mapicons.enable then
SLE:IncompatibleAddOn('SquareMinimapButtons', 'SquareMinimapButtons', E.private.sle.minimap.mapicons, "enable")
end
if IsAddOnLoaded('LootConfirm') then
if Toolkit.IsAddOnLoaded('ElvUI_LocLite') and E.db.sle.minimap.locPanel.enable then
SLE:IncompatibleAddOn('Location Lite', 'Location Panel', E.db.sle.minimap.locPanel.enable, "enable")
end
if Toolkit.IsAddOnLoaded('LootConfirm') then
E:StaticPopup_Show('LOOTCONFIRM_SLE_INCOMPATIBLE')
end
-- if IsAddOnLoaded('oRA3') then
-- E:StaticPopup_Show('ORA_SLE_INCOMPATIBLE')
-- end
if Toolkit.IsAddOnLoaded('ElvUITransparentActionbars') then
E:StaticPopup_Show('TRANSAB_SLE_INCOMPATIBLE')
end
end
function SLE:CreateExport()
local frame = CreateFrame("Frame", "SLEExImFrame", E.UIParent)
tinsert(UISpecialFrames, "SLEExImFrame")
frame:SetTemplate('Transparent')
frame:Size(800, 400)
frame:Point('CENTER', E.UIParent)
frame:Hide()
frame:EnableMouse(true)
frame:SetFrameStrata("DIALOG")
frame:SetMovable(true)
frame:RegisterForDrag("LeftButton")
frame:SetScript("OnDragStart", function(self)
if IsShiftKeyDown() then
self:StartMoving()
end
end)
frame:SetScript("OnDragStop", frame.StopMovingOrSizing)
local text = frame:CreateFontString(nil, "OVERLAY")
text:SetFont(E["media"].normFont, 14)
text:SetPoint("TOP", frame, "TOP", -10, -10)
text:SetText("< "..L["Export / Import"].." >")
text:SetJustifyH("left")
local ExScrollArea = CreateFrame("ScrollFrame", "SLEExportScrollFrame", frame, "UIPanelScrollFrameTemplate")
ExScrollArea:Point("TOPLEFT", frame, "TOPLEFT", 10, -30)
ExScrollArea:Point("BOTTOMRIGHT", frame, "BOTTOM", -25, 10)
ExScrollArea:CreateBackdrop()
Sk:HandleScrollBar(SLEExportScrollFrameScrollBar)
local ImScrollArea = CreateFrame("ScrollFrame", "SLEImportScrollFrame", frame, "UIPanelScrollFrameTemplate")
ImScrollArea:Point("TOPRIGHT", frame, "TOPRIGHT", -30, -30)
ImScrollArea:Point("BOTTOMLEFT", frame, "BOTTOM", 5, 10)
ImScrollArea:CreateBackdrop()
Sk:HandleScrollBar(SLEImportScrollFrameScrollBar)
local ExEditBox = CreateFrame("EditBox", "SLEExportEditBox", frame)
ExEditBox:SetMultiLine(true)
ExEditBox:SetMaxLetters(0)
ExEditBox:EnableMouse(true)
ExEditBox:SetAutoFocus(false)
ExEditBox:SetFontObject(ChatFontNormal)
ExEditBox:Width(ExScrollArea:GetWidth())
ExEditBox:SetScript("OnEscapePressed", function() SLEExImFrame:Hide() end)
ExScrollArea:SetScrollChild(ExEditBox)
SLEExportEditBox:SetScript("OnTextChanged", function(self, userInput)
if userInput then return end
local _, max = SLEExportScrollFrameScrollBar:GetMinMaxValues()
for i=1, max do
ScrollFrameTemplate_OnMouseWheel(SLEExportScrollFrame, -1)
end
end)
local ImEditBox = CreateFrame("EditBox", "SLEImportEditBox", frame)
ImEditBox:SetMultiLine(true)
ImEditBox:SetMaxLetters(0)
ImEditBox:EnableMouse(true)
ImEditBox:SetAutoFocus(false)
ImEditBox:SetFontObject(ChatFontNormal)
ImEditBox:Width(ExScrollArea:GetWidth())
ImEditBox:SetScript("OnEscapePressed", function() SLEExImFrame:Hide() end)
ImScrollArea:SetScrollChild(ImEditBox)
SLEImportEditBox:SetScript("OnTextChanged", function(self, userInput)
if userInput then return end
local _, max = SLEImportScrollFrameScrollBar:GetMinMaxValues()
for i=1, max do
ScrollFrameTemplate_OnMouseWheel(SLEImportScrollFrame, -1)
end
end)
local close = CreateFrame("Button", "SLEExImFrameCloseButton", frame, "UIPanelCloseButton")
close:SetPoint("TOPRIGHT")
close:SetFrameLevel(close:GetFrameLevel() + 1)
close:EnableMouse(true)
Sk:HandleCloseButton(close)
local exHelp = CreateFrame("Button", "SLEExportHelp", frame)
exHelp:Size(20, 20)
exHelp:Point("TOPLEFT", frame, "TOPLEFT", 9, -6)
local exHelp_t = exHelp:CreateFontString(nil, "OVERLAY")
exHelp_t:SetFont(E["media"].normFont, 14)
exHelp_t:SetPoint("CENTER", exHelp)
exHelp_t:SetText("?")
Sk:HandleButton(exHelp)
exHelp:HookScript("OnEnter", function(self)
GameTooltip:SetOwner(self, 'ANCHOR_TOPLEFT', 2, 4)
GameTooltip:ClearLines()
GameTooltip:AddLine([[|cffFFFFFFExporting:
Click the Export button and the settings that are different from defaults in selected options tables' will be dumped to the export box.
- Profile will copy profile based settings;
- Private will copy character specific settings;
- Global will copy global settings.|r
|cffFF0000Warning: exporting may cause your game to freeze for some time.|r
|cffFFFFFFImporting:
To import the settings you need to paste the setting table
or line to the import editbox and click import button.
You can use next formats for settings:
1) E.db.chat.panelHeight = 185
2) E.db['chat']['panelHeight'] = 185
3) E.db['chat'] = {
...
local GetAddOnEnableState = GetAddOnEnableState
--Check if some stuff happens to be enable
SLE._Compatibility = {}
local _CompList = {
"oRA3",
"ElvUI_CustomTweaks",
"ElvUI_MerathilisUI",
"QuestKing",
"ElvUI_Enhanced",
}
In case of the third format you should put at least 2 values.|r
|cffFF0000Know issue: coloring options will be exported anyway no matter the values and exporting options set.|r]])
GameTooltip:Show()
end)
exHelp:HookScript("OnLeave", function() GameTooltip:Hide() end)
exHelp:SetScript("OnClick", function(self)
SLEExportEditBox:SetText(dropdown.selectedID)
end)
local exButton = CreateFrame("Button", "SLEExportButton", frame)
exButton:Size(100, 20)
exButton:Point("LEFT", exHelp, "RIGHT", 4, 0)
local exButton_t = exButton:CreateFontString(nil, "OVERLAY")
exButton_t:SetFont(E["media"].normFont, 14)
exButton_t:SetPoint("CENTER", exButton)
exButton_t:SetText(L["Export"])
Sk:HandleButton(exButton)
exButton:SetScript("OnClick", SLE.Exporting)
local imButton = CreateFrame("Button", "SLEImportButton", frame)
imButton:Size(100, 20)
imButton:Point("LEFT", exButton, "RIGHT", 4, 0)
local imButton_t = imButton:CreateFontString(nil, "OVERLAY")
imButton_t:SetFont(E["media"].normFont, 14)
imButton_t:SetPoint("CENTER", imButton)
imButton_t:SetText(L["Import"])
Sk:HandleButton(imButton)
imButton:SetScript("OnClick", function(self)
local msg = ImEditBox:GetText()
msg = SLE:ImportTableReplace(msg)
if msg then
local func, err = loadstring(msg)
if not err then
func()
E:UpdateAll(true)
ReloadUI()
else
SLE:Print(err)
end
else
SLE:Print("Entered text is not a valid settings table!")
end
end)
local returnB = CreateFrame("Button", "SLEReturnButton", frame)
returnB:Size(100, 20)
returnB:Point("RIGHT", close, "LEFT", 4, 0)
local returnB_t = returnB:CreateFontString(nil, "OVERLAY")
returnB_t:SetFont(E["media"].normFont, 14)
returnB_t:SetPoint("CENTER", returnB)
returnB_t:SetText(L["Back"])
Sk:HandleButton(returnB)
returnB:SetScript("OnClick", function(self)
E:ToggleConfig()
SLEExImFrame:Hide()
end)
end
function SLE:FixDatabase() --For when we dramatically change some options
if E.db.sle.chat.combathide == true then E.db.sle.chat.combathide = "BOTH" end
if E.db.sle.chat.combathide == false then E.db.sle.chat.combathide = "NONE" end
if E.db.sle.uibuttons.position == "uib_vert" then E.db.sle.uibuttons.orientation = "vertical" end
if E.db.sle.uibuttons.position == "uib_hor" then E.db.sle.uibuttons.orientation = "horizontal" end
for i = 1, #_CompList do
if GetAddOnEnableState(E.myname, _CompList[i]) == 0 then SLE._Compatibility[_CompList[i]] = nil else SLE._Compatibility[_CompList[i]] = true end
end
function SLE:Initialize()
SLE:FixDatabase()
--ElvUI's version check
if elvV < elvR then
if SLE.elvV < 10 then return end
if SLE.elvV < SLE.elvR then
E:StaticPopup_Show("VERSION_MISMATCH")
return --Not loading shit if version is too old, prevents shit from being broken
end
EP:RegisterPlugin(addon, GetOptions)
if E.private.unitframe.enable then
self:RegisterEvent("PLAYER_REGEN_DISABLED", UF.Update_CombatIndicator);
end
if E.private.install_complete and E.private.sle.install_complete == nil then SLE:Install() end
SLE:ConfigCats()
self.initialized = true
self:InitializeModules(); --Load Modules
SLE:SetCompareItems() --Blizz cvar for item compare
hooksecurefunc(E, "UpdateAll", SLE.UpdateAll)
--Here goes installation script
--Annoying message
if E.db.general.loginmessage then
SLE:Print(format(L['SLE_LOGIN_MSG'], E["media"].hexvaluecolor, SLE.version))
Toolkit.print(Toolkit.format(L["SLE_LOGIN_MSG"], E["media"].hexvaluecolor, SLE.version))
end
E:GetModule('SLE_DTPanels'):DashboardShow()
AddTutorials()
ConfigCats()
CheckIncompatible()
SLE:BuildGameMenu()
SLE:CyrillicsInit()
if E.private.sle.install_complete == nil or tonumber(E.private.sle.install_complete) < 3 then
E:GetModule("PluginInstaller"):Queue(SLE.installTable)
-- E:GetModule("PluginInstaller"):Queue(SLE.installTable2)
end
LibStub("LibElvUIPlugin-1.0"):RegisterPlugin(AddOnName, GetOptions) --Registering as plugin
end
\ No newline at end of file
local SLE, T, E, L, V, P, G = unpack(select(2, ...))
local DD = SLE:NewModule("Dropdowns", "AceEvent-3.0")
DD.RegisteredMenus = {}
--Cache global variables
local tinsert = tinsert
--WoW API / Variables
local CreateFrame = CreateFrame
local ToggleFrame = ToggleFrame
local GetCursorPosition = GetCursorPosition
--Global variables that we don't cache, list them here for the mikk's Find Globals script
-- GLOBALS: UIParent, UISpecialFrames,
local PADDING = 10
local BUTTON_HEIGHT = 16
local BUTTON_WIDTH = 135
local TITLE_OFFSET = 10
local function OnClick(btn)
if btn.func then btn.func() end
btn:GetParent():Hide()
end
local function OnEnter(btn)
btn.hoverTex:Show()
end
local function OnLeave(btn)
btn.hoverTex:Hide()
end
function SLE:DropDown(list, frame, MenuAnchor, FramePoint, xOffset, yOffset, parent, customWidth, justify)
if T.InCombatLockdown() then return end
if not frame:IsShown() then
if not frame.buttons then
frame.buttons = {}
frame:SetFrameStrata("DIALOG")
frame:SetClampedToScreen(true)
T.tinsert(UISpecialFrames, frame:GetName())
frame:Hide()
end
xOffset = xOffset or 0
yOffset = yOffset or 0
local TitleCount = 0
local AddOffset = 0
for i=1, #frame.buttons do
frame.buttons[i]:Hide()
end
if not parent then FramePoint = "CURSOR" end
for i=1, #list do
if not frame.buttons[i] then
if list[i].secure then
frame.buttons[i] = CreateFrame("Button", nil, frame, "SecureActionButtonTemplate")
else
frame.buttons[i] = CreateFrame("Button", nil, frame)
end
frame.buttons[i].hoverTex = frame.buttons[i]:CreateTexture(nil, 'OVERLAY')
frame.buttons[i].hoverTex:SetAllPoints()
frame.buttons[i].hoverTex:SetTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]])
frame.buttons[i].hoverTex:SetBlendMode("ADD")
frame.buttons[i].hoverTex:Hide()
frame.buttons[i].text = frame.buttons[i]:CreateFontString(nil, 'BORDER')
frame.buttons[i].text:SetAllPoints()
frame.buttons[i].text:FontTemplate()
if not list[i].nohighlight then
frame.buttons[i]:SetScript("OnEnter", OnEnter)
frame.buttons[i]:SetScript("OnLeave", OnLeave)
end
if list[i].func then
frame.buttons[i].func = list[i].func
end
end
frame.buttons[i].text:SetJustifyH(justify or "LEFT")
frame.buttons[i]:Show()
frame.buttons[i]:Height(BUTTON_HEIGHT)
frame.buttons[i]:Width(customWidth or BUTTON_WIDTH)
local icon = ""
if list[i].icon then
icon = "|T"..list[i].icon..":14:14|t "
end
frame.buttons[i].text:SetText(icon..list[i].text)
if list[i].title then
TitleCount = TitleCount + 1
frame.buttons[i].text:SetTextColor(0.98, 0.95, 0.05)
if list[i].ending or i == 1 or list[i-1].title then
AddOffset = AddOffset + 1
end
else
frame.buttons[i].text:SetTextColor(1, 1, 1)
end
if list[i].secure then
frame.buttons[i].secure = list[i].secure
frame.buttons[i]:SetAttribute("type", frame.buttons[i].secure.buttonType)
if frame.buttons[i].secure.buttonType == "item" then
local name = T.GetItemInfo(frame.buttons[i].secure.ID)
frame.buttons[i]:SetAttribute("item", name)
elseif frame.buttons[i].secure.buttonType == "spell" then
local name = T.GetSpellInfo(frame.buttons[i].secure.ID)
frame.buttons[i]:SetAttribute("spell", name)
elseif frame.buttons[i].secure.buttonType == "macro" then
frame.buttons[i]:SetAttribute("macrotext", frame.buttons[i].secure.ID)
else
SLE:Print("Wrong argument for button type: "..frame.buttons[i].secure.buttonType)
end
frame.buttons[i]:HookScript("OnClick", OnClick)
else
frame.buttons[i]:SetScript("OnClick", OnClick)
end
local MARGIN = 10
if justify then
if justify == "RIGHT" then MARGIN = -10 end
if justify == "CENTER" then MARGIN