Skip to content

Commit

Permalink
Add profile share options
Browse files Browse the repository at this point in the history
  • Loading branch information
nebularg committed Jun 11, 2024
1 parent eaa6569 commit 2577b27
Show file tree
Hide file tree
Showing 7 changed files with 557 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .pkgmeta
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ externals:
Libs/AceGUI-3.0-SharedMediaWidgets: https://repos.wowace.com/wow/ace-gui-3-0-shared-media-widgets/trunk/AceGUI-3.0-SharedMediaWidgets
Libs/LibDBIcon-1.0: https://repos.wowace.com/wow/libdbicon-1-0/trunk/LibDBIcon-1.0
Libs/LibDualSpec-1.0: https://repos.wowace.com/wow/libdualspec-1-0
Libs/LibSerialize: https://github.com/rossnichols/LibSerialize
Libs/LibDeflate: https://github.com/safeteeWow/LibDeflate
Modules/Aura/Libs/LibPlayerSpells-1.0: https://github.com/AdiAddons/LibPlayerSpells-1.0.git
Modules/DogTagTexts/Libs/LibDogTag-3.0: https://github.com/parnic/LibDogTag-3.0.git
Modules/DogTagTexts/Libs/LibDogTag-Unit-3.0: https://github.com/parnic/LibDogTag-Unit-3.0.git
Expand All @@ -25,6 +27,9 @@ move-folders:

ignore:
- Docs
- Libs/LibDeflate/*.md
- Libs/LibDeflate/docs
- Libs/LibDeflate/example

embedded-libraries:
- libdatabroker-1-1
Expand Down
3 changes: 3 additions & 0 deletions Main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1612,6 +1612,9 @@ function PitBull4:OnProfileChanged()
if LibDBIcon then
LibDBIcon:Refresh("PitBull4", db.profile.minimap_icon)
end

PitBull4.Options.OnProfileChanged()
LibStub("AceConfigRegistry-3.0"):NotifyChange("PitBull4")
end

function PitBull4:OnNewProfile()
Expand Down
1 change: 0 additions & 1 deletion Modules/Aura/Aura.lua
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ function PitBull4_Aura:OnProfileChanged()
for i = 1, #funcs do
funcs[i](self)
end
LibStub("AceConfigRegistry-3.0"):NotifyChange("PitBull4")
end

function PitBull4_Aura:ClearFrame(frame)
Expand Down
27 changes: 21 additions & 6 deletions Options/Options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -104,19 +104,34 @@ function PitBull4.Options.OpenConfig()
PitBull4.Options.get_color_options = nil
options.args.colors.order = new_order()

options.args.profile = LibStub("AceDBOptions-3.0"):GetOptionsTable(PitBull4.db)
options.args.profile.order = new_order()
local old_disabled = options.args.profile.disabled
options.args.profile.disabled = function(info)
options.args.profile = {
type = "group",
childGroups = "tab",
order = new_order(),
disabled = function() return InCombatLockdown() end,
args = {},
}

options.args.profile.args.profile = LibStub("AceDBOptions-3.0"):GetOptionsTable(PitBull4.db)
options.args.profile.args.profile.order = 1
local old_disabled = options.args.profile.args.profile.disabled
options.args.profile.args.profile.disabled = function(info)
return InCombatLockdown() or (old_disabled and old_disabled(info))
end
options.args.profile.name = options.args.profile.args.profile.name

options.args.profile.args.import, options.args.profile.args.export = PitBull4.Options.get_share_options()
PitBull4.Options.get_share_options = nil
options.args.profile.args.export.order = 2
options.args.profile.args.import.order = 3

local LibDualSpec = LibStub("LibDualSpec-1.0", true)
if LibDualSpec and PitBull4.db.IsDualSpecEnabled then
LibDualSpec:EnhanceOptions(options.args.profile, PitBull4.db)
LibDualSpec:EnhanceOptions(options.args.profile.args.profile, PitBull4.db)
end

AceConfig:RegisterOptionsTable("PitBull4", options)
AceConfigDialog:SetDefaultSize("PitBull4", 835, 550)
AceConfigDialog:SetDefaultSize("PitBull4", 835, 560)

LibStub("AceEvent-3.0").RegisterEvent("PitBull4.Options", "PLAYER_REGEN_ENABLED", function()
LibStub("AceConfigRegistry-3.0"):NotifyChange("PitBull4")
Expand Down
Loading

0 comments on commit 2577b27

Please sign in to comment.