Commit a7f5e07c authored by Azilroka's avatar Azilroka

Switching to Tree

parent eea1be1a
......@@ -97,9 +97,6 @@ PA.Title = GetAddOnMetadata('ProjectAzilroka', 'Title')
PA.Version = GetAddOnMetadata('ProjectAzilroka', 'Version')
PA.Authors = GetAddOnMetadata('ProjectAzilroka', 'Author'):gsub(", ", " ")
local Color = CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[PA.MyClass] or RAID_CLASS_COLORS[PA.MyClass]
PA.ClassColor = { Color.r, Color.g, Color.b }
PA.AllPoints = { CENTER = 'CENTER', BOTTOM = 'BOTTOM', TOP = 'TOP', LEFT = 'LEFT', RIGHT = 'RIGHT', BOTTOMLEFT = 'BOTTOMLEFT', BOTTOMRIGHT = 'BOTTOMRIGHT', TOPLEFT = 'TOPLEFT', TOPRIGHT = 'TOPRIGHT' }
PA.ElvUI = PA:IsAddOnEnabled('ElvUI', PA.MyName)
......@@ -117,6 +114,18 @@ local function GetoUF()
end
PA.oUF = GetoUF()
function PA:ClassColorCode(class)
local color = PA:GetClassColor(class)
return format('FF%02x%02x%02x', color.r * 255, color.g * 255, color.b * 255)
end
function PA:GetClassColor(class)
return _G.CUSTOM_CLASS_COLORS and _G.CUSTOM_CLASS_COLORS[class] or _G.RAID_CLASS_COLORS[class] or { r = 1, g = 1, b = 1 }
end
local Color = PA:GetClassColor(PA.MyClass)
PA.ClassColor = { Color.r, Color.g, Color.b }
PA.Classes = {}
PA.ScanTooltip = CreateFrame('GameTooltip', 'PAScanTooltip', _G.UIParent, 'GameTooltipTemplate')
......@@ -143,12 +152,6 @@ function PA:GetUIScale()
return magic/scale
end
function PA:ClassColorCode(class)
local color = class and (CUSTOM_CLASS_COLORS and CUSTOM_CLASS_COLORS[PA.Classes[class]] or RAID_CLASS_COLORS[PA.Classes[class]]) or { r = 1, g = 1, b = 1 }
return format('FF%02x%02x%02x', color.r * 255, color.g * 255, color.b * 255)
end
function PA:GetClassName(class)
return PA.Classes[class]
end
......@@ -230,7 +233,7 @@ function PA:SetTemplate(frame)
if PA.AddOnSkins then
_G.AddOnSkins[1]:SetTemplate(frame)
else
if not frame.SetBackdrop then Mixin(frame, BackdropTemplateMixin) end
if not frame.SetBackdrop then _G.Mixin(frame, _G.BackdropTemplateMixin) end
if frame.SetTemplate then
frame:SetTemplate('Transparent', true)
else
......@@ -248,12 +251,7 @@ function PA:CreateBackdrop(frame)
frame.Backdrop = CreateFrame('Frame', nil, frame)
frame.Backdrop:SetFrameLevel(frame:GetFrameLevel() - 1)
frame.Backdrop:SetOutside(frame)
if not frame.Backdrop.SetBackdrop then Mixin(frame.Backdrop, BackdropTemplateMixin) end
if frame.SetTemplate then
frame.Backdrop:SetTemplate('Transparent', true)
else
PA:SetTemplate(frame.Backdrop)
end
PA:SetTemplate(frame.Backdrop)
end
end
......@@ -516,7 +514,7 @@ PA.Defaults = {
}
}
PA.Options = PA.ACH:Group(PA:Color(PA.Title), nil, 6, 'tab')
PA.Options = PA.ACH:Group(PA:Color(PA.Title), nil, 6, 'tree')
function PA:GetOptions()
PA.AceOptionsPanel.Options.args.ProjectAzilroka = PA.Options
......
......@@ -4,8 +4,7 @@ if PA.Classic then return end
local BB = PA:NewModule('BigButtons', 'AceEvent-3.0')
PA.BB, _G.BigButtons = BB, BB
BB.Title = 'BigButtons'
BB.Header = PA.ACL['|cFF16C3F2Big|r|cFFFFFFFFButtons|r']
BB.Title = PA.ACL['|cFF16C3F2Big|r |cFFFFFFFFButtons|r']
BB.Description = PA.ACL['A farm tool for Sunsong Ranch.']
BB.Authors = 'Azilroka NihilisticPandemonium'
BB.isEnabled = false
......@@ -238,7 +237,7 @@ end
function BB:GetOptions()
PA.Options.args.BigButtons = PA.ACH:Group(BB.Title, BB.Description, nil, nil, function(info) return BB.db[info[#info]] end)
PA.Options.args.BigButtons.args.Header = PA.ACH:Header(BB.Header, 0)
PA.Options.args.BigButtons.args.Description = PA.ACH:Description(BB.Description, 0)
PA.Options.args.BigButtons.args.Enable = PA.ACH:Toggle(PA.ACL['Enable'], nil, 1, nil, nil, nil, nil, function(info, value) BB.db[info[#info]] = value if not BB.isEnabled then BB:Initialize() else _G.StaticPopup_Show('PROJECTAZILROKA_RL') end end)
PA.Options.args.BigButtons.args.General = PA.ACH:Group(PA.ACL['General'], nil, 2, nil, nil, function(info, value) BB.db[info[#info]] = value BB:Update() end)
......
......@@ -7,8 +7,7 @@ local pairs = pairs
local tinsert = tinsert
local tremove = tremove
BrokerLDB.Title = 'BrokerLDB'
BrokerLDB.Header = PA.ACL['|cFF16C3F2Broker|r|cFFFFFFFFLDB|r']
BrokerLDB.Title = PA.ACL['|cFF16C3F2Broker|r|cFFFFFFFFLDB|r']
BrokerLDB.Description = PA.ACL['Provides a Custom DataBroker Bar']
BrokerLDB.Authors = 'Azilroka'
BrokerLDB.isEnabled = false
......@@ -232,7 +231,7 @@ end
function BrokerLDB:GetOptions()
PA.Options.args.BrokerLDB = PA.ACH:Group(BrokerLDB.Title, BrokerLDB.Description, nil, nil, function(info) return BrokerLDB.db[info[#info]] end)
PA.Options.args.BrokerLDB.args.Header = PA.ACH:Header(BrokerLDB.Header, 0)
PA.Options.args.BrokerLDB.args.Description = PA.ACH:Description(BrokerLDB.Description, 0)
PA.Options.args.BrokerLDB.args.Enable = PA.ACH:Toggle(PA.ACL['Enable'], nil, 1, nil, nil, nil, nil, function(info, value) BrokerLDB.db[info[#info]] = value if not BrokerLDB.isEnabled then BrokerLDB:Initialize() else _G.StaticPopup_Show('PROJECTAZILROKA_RL') end end)
PA.Options.args.BrokerLDB.args.General = PA.ACH:Group(PA.ACL['General'], nil, 2, nil, nil, function(info, value) BrokerLDB.db[info[#info]] = value BrokerLDB:Update() end)
......@@ -247,7 +246,7 @@ function BrokerLDB:GetOptions()
PA.Options.args.BrokerLDB.args.General.args.FontSettings = PA.ACH:Group(PA.ACL['Font Settings'], nil, -1)
PA.Options.args.BrokerLDB.args.General.args.FontSettings.inline = true
PA.Options.args.BrokerLDB.args.General.args.FontSettings.args.Font = PA.ACH:SharedMediaFont(PA.ACL['Font'], nil, 1)
PA.Options.args.BrokerLDB.args.General.args.FontSettings.args.FontSize = PA.ACH:Range(FONT_SIZE, nil, 2, { min = 6, max = 22, step = 1 })
PA.Options.args.BrokerLDB.args.General.args.FontSettings.args.FontSize = PA.ACH:Range(PA.ACL['Font Size'], nil, 2, { min = 6, max = 22, step = 1 })
PA.Options.args.BrokerLDB.args.General.args.FontSettings.args.FontFlag = PA.ACH:FontFlags(PA.ACL['Font Outline'], nil, 3)
PA.Options.args.BrokerLDB.args.AuthorHeader = PA.ACH:Header(PA.ACL['Authors:'], -2)
......
......@@ -7,8 +7,7 @@ local pairs, tinsert, select, unpack = pairs, tinsert, select, unpack
local strfind, strsub = strfind, strsub
local UnitIsPlayer, UnitClass, UnitClassification = UnitIsPlayer, UnitClass, UnitClassification
DO.Title = 'Dragon Overlay'
DO.Header = PA.ACL['|cFF16C3F2Dragon|r |cFFFFFFFFOverlay|r']
DO.Title = PA.ACL['|cFF16C3F2Dragon|r |cFFFFFFFFOverlay|r']
DO.Description = PA.ACL['Provides an overlay on UnitFrames for Boss, Elite, Rare and RareElite']
DO.Authors = 'Azilroka NihilisticPandemonium'
DO.ImageCredits = 'Codeblake Kkthnxbye Narley Durandil'
......@@ -61,7 +60,7 @@ end
function DO:GetOptions()
PA.Options.args.DragonOverlay = PA.ACH:Group(DO.Title, DO.Description, nil, nil, function(info) return DO.db[info[#info]] end)
PA.Options.args.DragonOverlay.args.Header = PA.ACH:Header(DO.Header, 0)
PA.Options.args.DragonOverlay.args.Description = PA.ACH:Description(DO.Description, 0)
PA.Options.args.DragonOverlay.args.Enable = PA.ACH:Toggle(PA.ACL['Enable'], nil, 1, nil, nil, nil, nil, function(info, value) DO.db[info[#info]] = value if not DO.isEnabled then DO:Initialize() else _G.StaticPopup_Show('PROJECTAZILROKA_RL') end end)
PA.Options.args.DragonOverlay.args.General = PA.ACH:Group(PA.ACL['General'], nil, 2, nil, nil, function(info, value) DO.db[info[#info]] = value DO:SetOverlay() end)
......
......@@ -2,8 +2,7 @@ local PA = _G.ProjectAzilroka
local EFL = PA:NewModule('EnhancedFriendsList', 'AceEvent-3.0', 'AceHook-3.0', 'AceTimer-3.0')
PA.EFL, _G.EnhancedFriendsList = EFL, EFL
EFL.Title = 'Enhanced Friends List'
EFL.Header = PA.ACL['|cFF16C3F2Enhanced|r |cFFFFFFFFFriends List|r']
EFL.Title = PA.ACL['|cFF16C3F2Enhanced|r |cFFFFFFFFFriends List|r']
EFL.Description = PA.ACL['Provides Friends List Customization']
EFL.Authors = 'Azilroka'
EFL.Credits = 'Marotheit Merathilis'
......@@ -30,131 +29,31 @@ local isBNConnected = _G.BNConnected()
local LEVEL = LEVEL
--[[
/run for i,v in pairs(_G) do if type(v)=="string" and v:match("Honorable") then print(i,"=",v) end end
/run for i,v in pairs(_G) do if type(v)=="string" and i:match("BNET_CLIENT_") then print(i,"=",v) end end
]]
EFL.Icons = {
Game = {
Alliance = {
Name = _G.FACTION_ALLIANCE,
Order = 1,
Default = "Interface/FriendsFrame/Battlenet-WoWicon",
Launcher = MediaPath..'GameIcons/Launcher/Alliance',
},
Horde = {
Name = _G.FACTION_HORDE,
Order = 2,
Default = 'Interface/FriendsFrame/Battlenet-WoWicon',
Launcher = MediaPath..'GameIcons/Launcher/Horde',
},
Neutral = {
Name = _G.FACTION_STANDING_LABEL4,
Order = 3,
Default = 'Interface/FriendsFrame/Battlenet-WoWicon',
Launcher = MediaPath..'GameIcons/Launcher/WoW',
},
App = {
Name = PA.ACL['App'],
Order = 4,
Color = '82C5FF',
Default = 'Interface/FriendsFrame/Battlenet-Battleneticon',
Launcher = MediaPath..'GameIcons/Launcher/BattleNet',
},
BSAp = {
Name = PA.ACL['Mobile'],
Order = 5,
Color = '82C5FF',
Default = 'Interface/FriendsFrame/Battlenet-Battleneticon',
Launcher = MediaPath..'GameIcons/Launcher/BattleNet',
},
[_G.BNET_CLIENT_D3 or 'D3'] = {
Name = PA.ACL['Diablo 3'],
Color = 'C41F3B',
Default = 'Interface/FriendsFrame/Battlenet-D3icon',
Launcher = MediaPath..'GameIcons/Launcher/D3',
},
[_G.BNET_CLIENT_WTCG or 'WTCG'] = {
Name = PA.ACL['Hearthstone'],
Color = 'FFB100',
Default = 'Interface/FriendsFrame/Battlenet-WTCGicon',
Launcher = MediaPath..'GameIcons/Launcher/Hearthstone',
},
[_G.BNET_CLIENT_SC or 'S1'] = {
Name = PA.ACL['Starcraft'],
Color = 'C495DD',
Default = 'Interface/FriendsFrame/Battlenet-Sc2icon',
Launcher = MediaPath..'GameIcons/Launcher/SC',
},
[_G.BNET_CLIENT_SC2 or 'S2'] = {
Name = PA.ACL['Starcraft 2'],
Color = 'C495DD',
Default = "Interface/ChatFrame/UI-ChatIcon-SC2",
Launcher = MediaPath..'GameIcons/Launcher/SC2',
},
[_G.BNET_CLIENT_HEROES or 'Hero'] = {
Name = PA.ACL['Hero of the Storm'],
Color = '00CCFF',
Default = 'Interface/FriendsFrame/Battlenet-HotSicon',
Launcher = MediaPath..'GameIcons/Launcher/Heroes',
},
[_G.BNET_CLIENT_OVERWATCH or 'Pro'] = {
Name = PA.ACL['Overwatch'],
Color = 'FFFFFF',
Default = 'Interface/FriendsFrame/Battlenet-Overwatchicon',
Launcher = MediaPath..'GameIcons/Launcher/Overwatch',
},
[_G.BNET_CLIENT_COD or 'VIPR'] = {
Name = PA.ACL['Call of Duty 4'],
Color = 'FFFFFF',
Default = 'Interface/FriendsFrame/Battlenet-CallOfDutyBlackOps4icon',
Launcher = MediaPath..'GameIcons/Launcher/COD4',
},
[_G.BNET_CLIENT_COD_MW or 'ODIN'] = {
Name = PA.ACL['Call of Duty Modern Warfare'],
Color = 'FFFFFF',
Default = 'Interface/FriendsFrame/Battlenet-CallOfDutyMWicon',
Launcher = MediaPath..'GameIcons/Launcher/CODMW',
},
[_G.BNET_CLIENT_WC3 or 'W3'] = {
Name = PA.ACL['Warcraft 3 Reforged'],
Color = 'FFFFFF',
Default = "Interface/FriendsFrame/Battlenet-Warcraft3Reforged",
Launcher = MediaPath..'GameIcons/Launcher/WC3R',
},
Alliance = { Name = _G.FACTION_ALLIANCE, Order = 1, Default = "Interface/FriendsFrame/Battlenet-WoWicon", Launcher = MediaPath..'GameIcons/Launcher/Alliance' },
Horde = { Name = _G.FACTION_HORDE, Order = 2, Default = 'Interface/FriendsFrame/Battlenet-WoWicon', Launcher = MediaPath..'GameIcons/Launcher/Horde' },
Neutral = { Name = _G.FACTION_STANDING_LABEL4, Order = 3, Default = 'Interface/FriendsFrame/Battlenet-WoWicon', Launcher = MediaPath..'GameIcons/Launcher/WoW' },
App = { Name = PA.ACL['App'], Order = 4, Color = '82C5FF', Default = 'Interface/FriendsFrame/Battlenet-Battleneticon', Launcher = MediaPath..'GameIcons/Launcher/BattleNet' },
BSAp = { Name = PA.ACL['Mobile'], Order = 5, Color = '82C5FF', Default = 'Interface/FriendsFrame/Battlenet-Battleneticon', Launcher = MediaPath..'GameIcons/Launcher/BattleNet' },
D3 = { Name = PA.ACL['Diablo 3'], Color = 'C41F3B', Default = 'Interface/FriendsFrame/Battlenet-D3icon', Launcher = MediaPath..'GameIcons/Launcher/D3' },
WTCG = { Name = PA.ACL['Hearthstone'], Color = 'FFB100', Default = 'Interface/FriendsFrame/Battlenet-WTCGicon', Launcher = MediaPath..'GameIcons/Launcher/Hearthstone' },
S1 = { Name = PA.ACL['Starcraft'], Color = 'C495DD', Default = 'Interface/FriendsFrame/Battlenet-Sc2icon', Launcher = MediaPath..'GameIcons/Launcher/SC' },
S2 = { Name = PA.ACL['Starcraft 2'], Color = 'C495DD', Default = "Interface/ChatFrame/UI-ChatIcon-SC2", Launcher = MediaPath..'GameIcons/Launcher/SC2' },
Hero = { Name = PA.ACL['Hero of the Storm'], Color = '00CCFF', Default = 'Interface/FriendsFrame/Battlenet-HotSicon', Launcher = MediaPath..'GameIcons/Launcher/Heroes' },
Pro = { Name = PA.ACL['Overwatch'], Color = 'FFFFFF', Default = 'Interface/FriendsFrame/Battlenet-Overwatchicon', Launcher = MediaPath..'GameIcons/Launcher/Overwatch' },
VIPR = { Name = PA.ACL['Call of Duty 4'], Color = 'FFFFFF', Default = 'Interface/FriendsFrame/Battlenet-CallOfDutyBlackOps4icon', Launcher = MediaPath..'GameIcons/Launcher/COD4' },
ODIN = { Name = PA.ACL['Call of Duty Modern Warfare'], Color = 'FFFFFF', Default = 'Interface/FriendsFrame/Battlenet-CallOfDutyMWicon', Launcher = MediaPath..'GameIcons/Launcher/CODMW' },
W3 = { Name = PA.ACL['Warcraft 3 Reforged'], Color = 'FFFFFF', Default = "Interface/FriendsFrame/Battlenet-Warcraft3Reforged", Launcher = MediaPath..'GameIcons/Launcher/WC3R' },
},
Status = {
Online = {
Name = _G.FRIENDS_LIST_ONLINE,
Order = 1,
Default = _G.FRIENDS_TEXTURE_ONLINE,
Square = MediaPath..'StatusIcons/Square/Online',
D3 = MediaPath..'StatusIcons/D3/Online',
Color = {.243, .57, 1},
},
Offline = {
Name = _G.FRIENDS_LIST_OFFLINE,
Order = 2,
Default = _G.FRIENDS_TEXTURE_OFFLINE,
Square = MediaPath..'StatusIcons/Square/Offline',
D3 = MediaPath..'StatusIcons/D3/Offline',
Color = {.486, .518, .541},
},
DND = {
Name = _G.DEFAULT_DND_MESSAGE,
Order = 3,
Default = _G.FRIENDS_TEXTURE_DND,
Square = MediaPath..'StatusIcons/Square/DND',
D3 = MediaPath..'StatusIcons/D3/DND',
Color = {1, 0, 0},
},
AFK = {
Name = _G.DEFAULT_AFK_MESSAGE,
Order = 4,
Default = _G.FRIENDS_TEXTURE_AFK,
Square = MediaPath..'StatusIcons/Square/AFK',
D3 = MediaPath..'StatusIcons/D3/AFK',
Color = {1, 1, 0},
},
Online = { Name = _G.FRIENDS_LIST_ONLINE, Order = 1, Default = _G.FRIENDS_TEXTURE_ONLINE, Square = MediaPath..'StatusIcons/Square/Online', D3 = MediaPath..'StatusIcons/D3/Online', Color = {.243, .57, 1} },
Offline = { Name = _G.FRIENDS_LIST_OFFLINE, Order = 2, Default = _G.FRIENDS_TEXTURE_OFFLINE, Square = MediaPath..'StatusIcons/Square/Offline', D3 = MediaPath..'StatusIcons/D3/Offline', Color = {.486, .518, .541} },
DND = { Name = _G.DEFAULT_DND_MESSAGE, Order = 3, Default = _G.FRIENDS_TEXTURE_DND, Square = MediaPath..'StatusIcons/Square/DND', D3 = MediaPath..'StatusIcons/D3/DND', Color = {1, 0, 0} },
AFK = { Name = _G.DEFAULT_AFK_MESSAGE, Order = 4, Default = _G.FRIENDS_TEXTURE_AFK, Square = MediaPath..'StatusIcons/Square/AFK', D3 = MediaPath..'StatusIcons/D3/AFK', Color = {1, 1, 0} },
}
}
......@@ -299,7 +198,7 @@ end
function EFL:GetOptions()
PA.Options.args.EnhancedFriendsList = PA.ACH:Group(EFL.Title, EFL.Description, nil, nil, function(info) return EFL.db[info[#info]] end, function(info, value) EFL.db[info[#info]] = value _G.FriendsFrame_Update() end)
PA.Options.args.EnhancedFriendsList.args.Header = PA.ACH:Header(EFL.Header, 0)
PA.Options.args.EnhancedFriendsList.args.Description = PA.ACH:Description(EFL.Description, 0)
PA.Options.args.EnhancedFriendsList.args.Enable = PA.ACH:Toggle(PA.ACL['Enable'], nil, 1, nil, nil, nil, nil, function(info, value) EFL.db[info[#info]] = value if not EFL.isEnabled then EFL:Initialize() else _G.StaticPopup_Show('PROJECTAZILROKA_RL') end end)
PA.Options.args.EnhancedFriendsList.args.General = PA.ACH:Group(PA.ACL['General'], nil, 2)
......
......@@ -5,8 +5,7 @@ end
local EPB = PA:NewModule("EnhancedPetBattleUI", "AceEvent-3.0")
EPB.Title = "Enhanced Pet Battle UI"
EPB.Header = "|cFF16C3F2Enhanced|r |cFFFFFFFFPet Battle UI|r"
EPB.Title = "|cFF16C3F2Enhanced|r |cFFFFFFFFPet Battle UI|r"
EPB.Description = ""
EPB.Authors = "Azilroka NihilisticPandemonium"
EPB.isEnabled = false
......@@ -1237,10 +1236,10 @@ function EPB:GetOptions()
EPB:Update()
end,
args = {
Header = {
Description = {
order = 0,
type = "header",
name = EPB.Header
type = "description",
name = EPB.Description
},
Enable = {
order = 1,
......
......@@ -2,8 +2,7 @@ local PA = _G.ProjectAzilroka
local ES = PA:NewModule('EnhancedShadows', 'AceEvent-3.0', 'AceTimer-3.0')
PA.ES = ES
ES.Title = 'Enhanced Shadows'
ES.Header = PA.ACL['|cFF16C3F2Enhanced|r |cFFFFFFFFShadows|r']
ES.Title = PA.ACL['|cFF16C3F2Enhanced|r |cFFFFFFFFShadows|r']
ES.Description = PA.ACL['Adds options for registered shadows']
ES.Authors = 'Azilroka NihilisticPandemonium'
ES.isEnabled = false
......@@ -66,7 +65,7 @@ end
function ES:GetOptions()
PA.Options.args.EnhancedShadows = PA.ACH:Group(ES.Title, ES.Description, nil, nil, function(info) return ES.db[info[#info]] end)
PA.Options.args.EnhancedShadows.args.Header = PA.ACH:Header(ES.Header, 0)
PA.Options.args.EnhancedShadows.args.Description = PA.ACH:Description(ES.Description, 0)
PA.Options.args.EnhancedShadows.args.Enable = PA.ACH:Toggle(PA.ACL['Enable'], nil, 1, nil, nil, nil, nil, function(info, value) ES.db[info[#info]] = value if not ES.isEnabled then ES:Initialize() else _G.StaticPopup_Show('PROJECTAZILROKA_RL') end end)
PA.Options.args.EnhancedShadows.args.General = PA.ACH:Group(PA.ACL['General'], nil, 2, nil, nil, function(info, value) ES.db[info[#info]] = value ES:UpdateShadows() end)
......
......@@ -2,8 +2,7 @@ local PA = _G.ProjectAzilroka
local FL = PA:NewModule('FasterLoot', 'AceEvent-3.0')
PA.FL, _G.FasterLoot = FL, FL
FL.Title = 'Faster Loot'
FL.Header = PA.ACL['|cFF16C3F2Faster|r |cFFFFFFFFLoot|r']
FL.Title = PA.ACL['|cFF16C3F2Faster|r |cFFFFFFFFLoot|r']
FL.Description = PA.ACL['Increases auto loot speed near instantaneous.']
FL.Authors = 'Azilroka'
FL.isEnabled = false
......@@ -63,7 +62,7 @@ end
function FL:GetOptions()
PA.Options.args.FasterLoot = PA.ACH:Group(FL.Title, FL.Description, nil, nil, function(info) return FL.db[info[#info]] end)
PA.Options.args.FasterLoot.args.Header = PA.ACH:Header(FL.Header, 0)
PA.Options.args.FasterLoot.args.Description = PA.ACH:Header(FL.Description, 0)
PA.Options.args.FasterLoot.args.Enable = PA.ACH:Toggle(PA.ACL['Enable'], nil, 1, nil, nil, nil, nil, function(info, value) FL.db[info[#info]] = value if not FL.isEnabled then FL:Initialize() else _G.StaticPopup_Show('PROJECTAZILROKA_RL') end end)
PA.Options.args.FasterLoot.args.AuthorHeader = PA.ACH:Header(PA.ACL['Authors:'], -2)
......
......@@ -2,8 +2,7 @@ local PA = _G.ProjectAzilroka
local FG = PA:NewModule('FriendGroups', 'AceEvent-3.0', 'AceTimer-3.0', 'AceHook-3.0')
_G.FriendGroups= FG
FG.Title = 'Friend Groups'
FG.Header = PA.ACL['|cFF16C3F2Friend|r |cFFFFFFFFGroups|r']
FG.Title = PA.ACL['|cFF16C3F2Friend|r |cFFFFFFFFGroups|r']
FG.Description = PA.ACL['Manage Firends List with Groups']
FG.Authors = 'Azilroka'
FG.Credits = 'Mikeprod frankkkkk'
......@@ -950,10 +949,10 @@ function FG:GetOptions()
get = function(info) return FG.db[info[#info]] end,
set = function(info, value) FG.db[info[#info]] = value end,
args = {
Header = {
Description = {
order = 0,
type = 'header',
name = FG.Header,
type = 'description',
name = FG.Description,
},
Enable = {
order = 1,
......
......@@ -4,8 +4,7 @@ if PA.Retail then return end
local LC = PA:NewModule('LootConfirm', 'AceEvent-3.0')
PA.LC, _G.LootConfirm = LC, LC
LC.Title = 'Loot Confirm'
LC.Header = PA.ACL['|cFF16C3F2Loot|r |cFFFFFFFFConfirm|r']
LC.Title = PA.ACL['|cFF16C3F2Loot|r |cFFFFFFFFConfirm|r']
LC.Description = PA.ACL['Confirms Loot for Solo/Groups (Need/Greed)']
LC.Authors = 'Azilroka NihilisticPandemonium'
LC.isEnabled = false
......@@ -50,7 +49,7 @@ end
function LC:GetOptions()
PA.Options.args.LootConfirm = PA.ACH:Group(LC.Title, LC.Description, nil, nil, function(info) return LC.db[info[#info]] end)
PA.Options.args.LootConfirm.args.Header = PA.ACH:Header(LC.Header, 0)
PA.Options.args.LootConfirm.args.Description = PA.ACH:Description(LC.Description, 0)
PA.Options.args.LootConfirm.args.Enable = PA.ACH:Toggle(PA.ACL['Enable'], nil, 1, nil, nil, nil, nil, function(info, value) LC.db[info[#info]] = value if not LC.isEnabled then LC:Initialize() else _G.StaticPopup_Show('PROJECTAZILROKA_RL') end end)
PA.Options.args.LootConfirm.args.General = PA.ACH:Group(PA.ACL['General'], nil, 2)
......
local PA = _G.ProjectAzilroka
local MXP = PA:NewModule('MasterXP', 'AceTimer-3.0', 'AceEvent-3.0')
MXP.Title = 'Master Experience'
MXP.Header = PA.ACL['|cFF16C3F2Master|r |cFFFFFFFFExperience|r']
MXP.Title = PA.ACL['|cFF16C3F2Master|r |cFFFFFFFFExperience|r']
MXP.Description = PA.ACL['Shows Experience Bars for Party / Battle.net Friends']
MXP.Authors = 'Azilroka NihilisticPandemonium'
MXP.isEnabled = false
......@@ -10,6 +9,9 @@ PA.MXP, _G.MasterExperience = MXP, MXP
local _G = _G
local min, format = min, format
local tostring, tonumber = tostring, tonumber
local strsplit = strsplit
local CreateFrame = CreateFrame
local GetXPExhaustion = GetXPExhaustion
local IsXPUserDisabled = IsXPUserDisabled
......@@ -17,16 +19,19 @@ local GetQuestLogRewardXP = GetQuestLogRewardXP
local IsPlayerAtEffectiveMaxLevel = IsPlayerAtEffectiveMaxLevel
local UnitXP, UnitXPMax = UnitXP, UnitXPMax
local BNGetInfo = BNGetInfo
local QuestLogXP, ZoneQuestXP, CompletedQuestXP = 0, 0, 0
local CurrentXP, XPToLevel, RestedXP, CurrentLevel
local PLAYER_NAME_WITH_REALM
MXP.BNFriendsWoW = {}
MXP.BNFriendsName = {}
MXP.playerRealm = format('%s-%s', UnitName("player"), gsub(GetRealmName(), '[%s%-]', ''))
MXP.battleTag = MXP.isBNConnected and select(2, BNGetInfo())
MXP.BNFriends = {}
MXP.isBNConnected = false
MXP.MasterExperience = CreateFrame('Frame', 'MasterExperience', PA.PetBattleFrameHider)
MXP.MasterExperience:SetSize(250, 400)
MXP.MasterExperience:SetPoint('BOTTOM', UIParent, 'BOTTOM', 0, 43)
MXP.MasterExperience:SetPoint('BOTTOM', _G.UIParent, 'BOTTOM', 0, 43)
MXP.MasterExperience.Bars = {}
if not (PA.Tukui or PA.ElvUI) then
......@@ -38,7 +43,7 @@ function MXP:CheckQuests(questID, zoneOnly)
return
end
local isCompleted = C_QuestLog.ReadyForTurnIn(questID)
local isCompleted = _G.C_QuestLog.ReadyForTurnIn(questID)
local experience = GetQuestLogRewardXP(questID)
if zoneOnly then
ZoneQuestXP = ZoneQuestXP + experience
......@@ -153,12 +158,14 @@ function MXP:UpdateBar(barID, infoString)
end
end
displayString = format('%s %s - %s', PA.ACL['Lvl'], info.level, displayString)
bar.Rested:SetShown(isRested)
bar.Quest:SetShown(hasQuestXP)
end
bar.Text:SetText(displayString)
bar.Name:SetText(MXP.BNFriendsName[info.name] or info.name)
bar.Name:SetText(MXP.BNFriends[info.name] and MXP.BNFriends[info.name].accountName or info.name)
local numShown = 0
for _, Bar in ipairs(MXP.MasterExperience.Bars) do
......@@ -183,7 +190,7 @@ function MXP:Bar_OnEnter()
_G.GameTooltip:ClearLines()
_G.GameTooltip:SetOwner(self, 'ANCHOR_CURSOR', 0, -4)
_G.GameTooltip:AddLine(format("%s's %s", MXP.BNFriendsName[self.Info.name] or self.Info.name, PA.ACL["Experience"]))
_G.GameTooltip:AddLine(format("%s's %s", MXP.BNFriends[self.Info.name] and MXP.BNFriends[self.Info.name].accountName or self.Info.name, PA.ACL["Experience"]))
_G.GameTooltip:AddLine(' ')
_G.GameTooltip:AddDoubleLine(PA.ACL["XP:"], format(' %d / %d (%.2f%%)', self.Info.CurrentXP, self.Info.XPToLevel, self.Info.PercentXP), 1, 1, 1)
......@@ -208,6 +215,15 @@ function MXP:Bar_OnLeave()
GameTooltip_Hide(self)
end
function MXP:GetBarPoints(barIndex)
local point = MXP.db.GrowthDirection == 'UP' and 'BOTTOM' or 'TOP'
local relativeFrame = barIndex == 1 and MXP.MasterExperience or MXP.MasterExperience.Bars[barIndex - 1]
local relativePoint = (barIndex == 1 or MXP.db.GrowthDirection == 'DOWN') and 'BOTTOM' or 'TOP'
local yOffset = barIndex == 1 and 0 or MXP.db.GrowthDirection == 'UP' and 2 or -2
return point, relativeFrame, relativePoint, yOffset
end
function MXP:CreateBar()
local barIndex = (#MXP.MasterExperience.Bars + 1)
......@@ -220,11 +236,7 @@ function MXP:CreateBar()
Bar:SetScript('OnLeave', MXP.Bar_OnLeave)
Bar.Info = {}
local point = MXP.db.GrowthDirection == 'UP' and 'BOTTOM' or 'TOP'
local relativeFrame = barIndex == 1 and MXP.MasterExperience or MXP.MasterExperience.Bars[barIndex - 1]
local relativePoint = barIndex == 1 and 'BOTTOM' or 'TOP'
local yOffset = barIndex == 1 and 0 or MXP.db.GrowthDirection == 'UP' and 2 or -2
local point, relativeFrame, relativePoint, yOffset = MXP:GetBarPoints(barIndex)
Bar:SetPoint(point, relativeFrame, relativePoint, 0, yOffset)
Bar.Text = Bar:CreateFontString(nil, 'OVERLAY')
......@@ -319,9 +331,31 @@ function MXP:UpdateAllBars()
C_ChatInfo.SendAddonMessage('PA_MXP', 'REQUESTINFO', 'PARTY')
end
if MXP.db.BattleNet and BNConnected() then
for friend in pairs(MXP.BNFriendsWoW) do
BNSendGameData(friend, 'PA_MXP', 'REQUESTINFO')
if MXP.db.BattleNet and MXP.isBNConnected then
for _, info in pairs(MXP.BNFriends) do
if info.presenceID then
BNSendGameData(info.presenceID, 'PA_MXP', 'REQUESTINFO')
end
end
end
end
function MXP:BattleNetUpdate(_, friendIndex)
if MXP.isBNConnected and friendIndex then
local hideBar = true
local friendInfo = C_BattleNet.GetFriendAccountInfo(friendIndex)
for gameIndex = 1, C_BattleNet.GetFriendNumGameAccounts(friendIndex) do
local info = C_BattleNet.GetFriendGameAccountInfo(friendIndex, gameIndex)
if info and info.clientProgram == 'WoW' then
BNSendGameData(info.gameAccountID, 'PA_MXP', 'REQUESTINFO')
hideBar = false
end
end
if hideBar then
local bar = MXP.MasterExperience.Bars[MXP:GetAssignedBar(friendInfo.battleTag)]
if bar then
bar:Hide()
end
end
end
end
......@@ -337,76 +371,78 @@ function MXP:UpdateCurrentBars()
bar.Text:SetFont(font, fontSize, fontFlag)
bar.Name:SetFont(font, fontSize, fontFlag)
if MXP.db.GrowthDirection == 'UP' then
if barIndex == 1 then
bar:SetPoint('BOTTOM', MXP.MasterExperience, 'BOTTOM', 0, 0)
else
bar:SetPoint('BOTTOM', MXP.MasterExperience.Bars[barIndex - 1], 'TOP', 0, 2)
end
else
if barIndex == 1 then
bar:SetPoint('TOP', MXP.MasterExperience, 'TOP', 0, 0)
else
bar:SetPoint('TOP', MXP.MasterExperience.Bars[barIndex - 1], 'BOTTOM', 0, -2)
end
end
local point, relativeFrame, relativePoint, yOffset = MXP:GetBarPoints(barIndex)
bar:SetPoint(point, relativeFrame, relativePoint, 0, yOffset)
end
end
function MXP:SendMessage()
local message = format('%s:%s:%d:%s:%s:%d:%d:%d:%d:%d:%d:%d', format('%s-%s', UnitName("player"), MXP:ShortenRealm(GetRealmName())), PA.MyClass, CurrentLevel, tostring(IsPlayerAtEffectiveMaxLevel()), tostring(IsXPUserDisabled()), CurrentXP or 0, XPToLevel or 0, RestedXP or 0, QuestLogXP or 0, ZoneQuestXP or 0, CompletedQuestXP or 0)
local message = format('%s:%d:%s:%s:%d:%d:%d:%d:%d:%d:%d', PA.MyClass, CurrentLevel, tostring(IsPlayerAtEffectiveMaxLevel()), tostring(IsXPUserDisabled()), CurrentXP or 0, XPToLevel or 0, RestedXP or 0, QuestLogXP or 0, ZoneQuestXP or 0, CompletedQuestXP or 0)
if MXP.db.Party and IsInGroup(LE_PARTY_CATEGORY_HOME) and not IsInRaid() then
message = format('%s:%s', MXP.playerRealm, message)
C_ChatInfo.SendAddonMessage('PA_MXP', message, 'PARTY')
end
if MXP.db.BattleNet and BNConnected() then
for friend in pairs(MXP.BNFriendsWoW) do
BNSendGameData(friend, 'PA_MXP', message)
if MXP.db.BattleNet and MXP.isBNConnected then
message = format('%s:%s', MXP.battleTag, message)
for _, info in pairs(MXP.BNFriends) do