GurliGebis / WoWAddon-PasteNG

4 stars 0 forks source link

[suggestion] Use a shared global profile as default, not char-specific ones #3

Closed tflo closed 1 year ago

tflo commented 1 year ago

First of all, thanks for your continued support of this addon.

Please consider using a shared global profile as default for AceDB, instead of char-specific profiles.

I think for an addon like this, there is little to no need to have char-specific profiles. (Or do you really use different 'Edit font scales' or Minimap button visibility settings for your toons?)

IMHO, char-specific profiles as default make only sense for addons that tap into class or spec-specific things, which is not really the case here. For "generic" addons (like this) it's just a major annoyance if you have to set the profile to "Default" on each of your 20 alts.

(And if someone really wants a specific profile for a char, he can still set it; we're only speaking of the default here.)


If you agree with me, then the only thing you need to for this is adding one little argument to your AceDB initialization in core.lua.

Here the diff:

*** /Users/tom/_Tmp ƒ/Paste copy/core.lua   2023-01-01 12:26:44.000000000 +0100
--- /Applications/World of Warcraft/_retail_/Interface/AddOns/Paste/core.lua    2023-01-01 13:19:39.000000000 +0100
***************
*** 240,246 ****

  function addon:OnInitialize()
!   addon.db = LibStub("AceDB-3.0"):New("PasteDB", defaults)
    addon:SetupVersion()
    addon:RefreshConfig()
    local options = addon:myOptions()
--- 240,246 ----

  function addon:OnInitialize()
!   addon.db = LibStub("AceDB-3.0"):New("PasteDB", defaults, true)
    addon:SetupVersion()
    addon:RefreshConfig()
    local options = addon:myOptions()

Thanks for considering,

– Tom

GurliGebis commented 1 year ago

I have changed it in the 10.0.5-20230125_1 release.