diff --git a/Altoholic-Addon/DataStore/DataStore.lua b/Altoholic-Addon/DataStore/DataStore.lua index aa2f77b..970b7f0 100644 --- a/Altoholic-Addon/DataStore/DataStore.lua +++ b/Altoholic-Addon/DataStore/DataStore.lua @@ -34,6 +34,9 @@ local MSG_LOGINREPLY = 2 -- reply to MSG_ANNOUNCELOGIN local AddonDB_Defaults = { global = { + Options = { + HideStartGuilds = 0, -- Hide Rising-Gods Starter Guilds + }, Guilds = { ['*'] = { -- ["Account.Realm.Name"] faction = nil, @@ -225,6 +228,11 @@ local GuildCommCallbacks = { local function GuildCommHandler(prefix, message, distribution, sender) -- This handler will be used by other modules as well + local guild = GetGuildInfo("player") + if guild and addon:GetOption("DataStore", "HideStartGuilds") == 1 and (guild == "Community Horde" or guild == "Community Allianz") then + return -- block if ignore starter guilds + end + local success, msgType, arg1, arg2, arg3 = addon:Deserialize(message) if success and msgType and GuildCommCallbacks[prefix] then @@ -566,7 +574,11 @@ function addon:SetOption(module, option, value) -- module can be either the module name (string) or the module table -- ex: DS:SetOption("DataStore_Containers", ...) or DS:SetOption(DataStore_Containers, ...) if type(module) == "string" then - module = RegisteredModules[module] + if module == "DataStore" then + module = addon + else + module = RegisteredModules[module] + end end if type(module) == "table" then @@ -580,7 +592,11 @@ function addon:GetOption(module, option) -- module can be either the module name (string) or the module table -- ex: DS:GetOption("DataStore_Containers", ...) or DS:GetOption(DataStore_Containers, ...) if type(module) == "string" then - module = RegisteredModules[module] + if module == "DataStore" then + module = addon + else + module = RegisteredModules[module] + end end if type(module) == "table" then diff --git a/Altoholic-Addon/DataStore/Locales/deDE.lua b/Altoholic-Addon/DataStore/Locales/deDE.lua index 49caf0a..7b9e250 100644 --- a/Altoholic-Addon/DataStore/Locales/deDE.lua +++ b/Altoholic-Addon/DataStore/Locales/deDE.lua @@ -6,3 +6,7 @@ L["Disabled"] = "Deaktiviert" L["Enabled"] = "Aktiviert" L["Memory used for %d |4character:characters;:"] = "Verwendeter Speicher für %d |4charakter:charaktere;:" +L["HIDE_START_GUILD_TEXT"] = "Verstecke Starter-Gilden (Rising-Gods)" +L["HIDE_START_GUILD_TITLE"] = "Verstecke Starter-Gilden" +L["HIDE_START_GUILD_ENABLED"] = "Addon-Kommunikation aus den Gilden 'Community Allianz' & 'Community Horde' werden ignoriert." +L["HIDE_START_GUILD_DISABLED"] = "Keine Gilde wird ignoriert." diff --git a/Altoholic-Addon/DataStore/Locales/enUS.lua b/Altoholic-Addon/DataStore/Locales/enUS.lua index d15daa1..7c636dc 100644 --- a/Altoholic-Addon/DataStore/Locales/enUS.lua +++ b/Altoholic-Addon/DataStore/Locales/enUS.lua @@ -9,3 +9,7 @@ L["Disabled"] = true L["Enabled"] = true L["Memory used for %d |4character:characters;:"] = true +L["HIDE_START_GUILD_TEXT"] = "Hide starter guilds (Rising-Gods)" +L["HIDE_START_GUILD_TITLE"] = "Hide starter guilds" +L["HIDE_START_GUILD_ENABLED"] = "Addon messages from the guilds 'Community Allianz' & 'Community Horde' will be ignored." +L["HIDE_START_GUILD_DISABLED"] = "No guild will be ignored." diff --git a/Altoholic-Addon/DataStore/Options.lua b/Altoholic-Addon/DataStore/Options.lua index 22075b9..4245dc4 100644 --- a/Altoholic-Addon/DataStore/Options.lua +++ b/Altoholic-Addon/DataStore/Options.lua @@ -141,6 +141,10 @@ function addon:SetupOptions() addon:SetupInfoPanel(help, DataStoreHelp_Text) DataStoreGeneralOptions_Title:SetText(TEAL..format("DataStore %s", DataStore.Version)) + DataStoreGeneralOptions_HideStartGuildsText:SetText(L["HIDE_START_GUILD_TEXT"]) + DataStore:SetCheckBoxTooltip(DataStoreGeneralOptions_HideStartGuilds, L["HIDE_START_GUILD_TITLE"], L["HIDE_START_GUILD_ENABLED"], L["HIDE_START_GUILD_DISABLED"]) + + DataStoreGeneralOptions_HideStartGuilds:SetChecked(DataStore:GetOption("DataStore", "HideStartGuilds")) -- manually adjust the width of a few panes, as resolution/scale may have an impact on the layout local width = InterfaceOptionsFramePanelContainer:GetWidth() - 45 diff --git a/Altoholic-Addon/DataStore/Options.xml b/Altoholic-Addon/DataStore/Options.xml index 33dbc07..3fe2d2c 100644 --- a/Altoholic-Addon/DataStore/Options.xml +++ b/Altoholic-Addon/DataStore/Options.xml @@ -66,7 +66,7 @@ - + @@ -76,6 +76,24 @@ + + + + + + + + + + + + + + + DataStore:ToggleOption(self, "DataStore", "HideStartGuilds") + + +