Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Ace Profiles #279

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions ECS.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---@class ECS
ECS = {...}
ECS = LibStub("AceAddon-3.0"):NewAddon("Questie")

--- Addon is running on Classic "Vanilla" client: Means Classic Era and its seasons like SoM
---@type boolean
Expand All @@ -19,23 +19,22 @@ ECS.IsSoD = ECS.IsClassic and C_Seasons.HasActiveSeason() and (C_Seasons.GetActi

---@type Init
local Init = ECSLoader:ImportModule("Init")
---@type Settings
local Settings = ECSLoader:ImportModule("Settings")

function ECS:OnInitialize()
-- This has to happen OnInitialize to be available asap
self.db = LibStub("AceDB-3.0"):New("ECSSettings", Settings:GetDefaults(), true)

local loadingFrame = CreateFrame("Frame")
ECS.loadingFrame = loadingFrame

loadingFrame:RegisterEvent("ADDON_LOADED") -- Triggers whenever all non-lod addons has been loaded, this will initialize the addon

loadingFrame:SetScript("OnEvent", function(self, event, arg1, ...)
if event == "ADDON_LOADED" and arg1 == "ExtendedCharacterStats" then
Init:OnAddonLoaded()
self:RegisterEvent("PLAYER_LOGIN") -- Triggers whenever the player has logged in and all addons are loaded
end
-- These events basically all mean the same: The active profile changed.
self.db.RegisterCallback(self, "OnProfileChanged", "RefreshConfig")
self.db.RegisterCallback(self, "OnProfileCopied", "RefreshConfig")
self.db.RegisterCallback(self, "OnProfileReset", "RefreshConfig")
end

if event == "PLAYER_LOGIN" then
Init:OnPlayerLogin()
end
end)
function ECS:OnAddonLoaded()
Init:OnAddonLoaded()
end

---@param message string
function ECS:Error(message)
Expand Down
4 changes: 2 additions & 2 deletions ExtendedCharacterStats-BCC.toc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Author: BreakBB, Ethulu
## Notes: Displays an extra window with more information about your characters stats ( Crit/Hit/Block etc )
## OptionalDeps: Ace3, CallbackHandler-1.0, LibStub
## SavedVariablesPerCharacter: ExtendedCharacterStats
## SavedVariables: ECSSettings
## DefaultState: enabled
## X-Curse-Project-ID: 334877
## X-Wago-ID: e56nwDK9
Expand All @@ -21,7 +21,7 @@ Modules\Init.lua
Modules\Utils.lua
Modules\Stats.lua
Modules\GearInfos.lua
Modules\Profile.lua
Modules\Settings.lua
Modules\SlashCommands.lua

# Data
Expand Down
4 changes: 2 additions & 2 deletions ExtendedCharacterStats-Classic.toc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Author: BreakBB, Ethulu
## Notes: Displays an extra window with more information about your characters stats ( Crit/Hit/Block etc )
## OptionalDeps: Ace3, CallbackHandler-1.0, LibStub
## SavedVariablesPerCharacter: ExtendedCharacterStats
## SavedVariables: ECSSettings
## DefaultState: enabled
## X-Curse-Project-ID: 334877
## X-Wago-ID: e56nwDK9
Expand All @@ -21,7 +21,7 @@ Modules\Init.lua
Modules\Utils.lua
Modules\Stats.lua
Modules\GearInfos.lua
Modules\Profile.lua
Modules\Settings.lua
Modules\SlashCommands.lua

# Data
Expand Down
4 changes: 2 additions & 2 deletions ExtendedCharacterStats-WOTLKC.toc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
## Author: BreakBB, Ethulu
## Notes: Displays an extra window with more information about your characters stats ( Crit/Hit/Block etc )
## OptionalDeps: Ace3, CallbackHandler-1.0, LibStub
## SavedVariablesPerCharacter: ExtendedCharacterStats
## SavedVariables: ECSSettings
## DefaultState: enabled
## X-Curse-Project-ID: 334877
## X-Wago-ID: e56nwDK9
Expand All @@ -21,7 +21,7 @@ Modules\Init.lua
Modules\Utils.lua
Modules\Stats.lua
Modules\GearInfos.lua
Modules\Profile.lua
Modules\Settings.lua
Modules\SlashCommands.lua

# Data
Expand Down
Loading
Loading