-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCore.lua
More file actions
105 lines (89 loc) · 3.24 KB
/
Copy pathCore.lua
File metadata and controls
105 lines (89 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
local AbstractBar = LibStub("AceAddon-3.0"):NewAddon("AbstractBar", "AceConsole-3.0", "AceEvent-3.0")
local LSM = LibStub("LibSharedMedia-3.0")
AbstractBar.version = "1.0.0"
-- ============================================================================
-- DATABASE DEFAULTS
-- ============================================================================
local defaults = {
profile = {
theme = {
active = "Abstract",
font = "Friz Quadrata TT",
fontSize = 12,
},
modules = {
bar = true,
}
}
}
-- ============================================================================
-- INITIALIZATION
-- ============================================================================
function AbstractBar:OnInitialize()
-- Debug: Check if LibStub and libraries are available
if not LibStub then
print("|cffff0000AbstractBar Error:|r LibStub not found!")
return
end
local AceDB = LibStub("AceDB-3.0", true) -- true = silent
if not AceDB then
print("|cffff0000AbstractBar Error:|r AceDB-3.0 not found!")
print("Available libraries:")
for k, v in pairs(LibStub.libs or {}) do
print(" - " .. tostring(k))
end
return
end
self.db = AceDB:New("AbstractBarDB", defaults, true)
-- Register slash commands
self:RegisterChatCommand("abar", "SlashCommand")
self:RegisterChatCommand("abstractbar", "SlashCommand")
end
function AbstractBar:OnEnable()
-- Send initialization message to modules
C_Timer.After(0.1, function()
self:SendMessage("AbstractBar_DB_READY")
end)
-- Register options panel after modules load
C_Timer.After(0.3, function()
self:RegisterOptionsPanel()
end)
end
function AbstractBar:RegisterOptionsPanel()
local AceConfig = LibStub("AceConfig-3.0")
local AceConfigDialog = LibStub("AceConfigDialog-3.0")
if not AceConfig or not AceConfigDialog then
print("|cffff0000AbstractBar:|r Could not load configuration libraries")
return
end
-- Get BrokerBar module
local BrokerBar = self:GetModule("BrokerBar", true)
if not BrokerBar then
print("|cffff0000AbstractBar:|r BrokerBar module not found")
return
end
-- Register options table
AceConfig:RegisterOptionsTable("AbstractBar", function() return BrokerBar:GetOptions() end)
-- Add to Blizzard Interface Options
self.optionsFrame = AceConfigDialog:AddToBlizOptions("AbstractBar", "Abstract Bar")
print("|cff00ff00AbstractBar:|r Configuration panel registered")
end
function AbstractBar:OpenConfig()
local AceConfigDialog = LibStub("AceConfigDialog-3.0", true)
if AceConfigDialog then
AceConfigDialog:Open("AbstractBar")
else
-- Fallback: Try to open Blizzard settings
Settings.OpenToCategory(self.optionsFrame)
end
end
function AbstractBar:SlashCommand(input)
if not input or input:trim() == "" then
self:OpenConfig()
elseif input:lower() == "config" then
self:OpenConfig()
else
print("|cff00ff00AbstractBar|r v" .. self.version)
print("Use |cff00ffff/abar|r or |cff00ffff/abar config|r to open configuration")
end
end