Added options to ignore Rising-Gods starter guilds
This commit is contained in:
@@ -34,6 +34,9 @@ local MSG_LOGINREPLY = 2 -- reply to MSG_ANNOUNCELOGIN
|
|||||||
|
|
||||||
local AddonDB_Defaults = {
|
local AddonDB_Defaults = {
|
||||||
global = {
|
global = {
|
||||||
|
Options = {
|
||||||
|
HideStartGuilds = 0, -- Hide Rising-Gods Starter Guilds
|
||||||
|
},
|
||||||
Guilds = {
|
Guilds = {
|
||||||
['*'] = { -- ["Account.Realm.Name"]
|
['*'] = { -- ["Account.Realm.Name"]
|
||||||
faction = nil,
|
faction = nil,
|
||||||
@@ -225,6 +228,11 @@ local GuildCommCallbacks = {
|
|||||||
|
|
||||||
local function GuildCommHandler(prefix, message, distribution, sender)
|
local function GuildCommHandler(prefix, message, distribution, sender)
|
||||||
-- This handler will be used by other modules as well
|
-- 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)
|
local success, msgType, arg1, arg2, arg3 = addon:Deserialize(message)
|
||||||
|
|
||||||
if success and msgType and GuildCommCallbacks[prefix] then
|
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
|
-- module can be either the module name (string) or the module table
|
||||||
-- ex: DS:SetOption("DataStore_Containers", ...) or DS:SetOption(DataStore_Containers, ...)
|
-- ex: DS:SetOption("DataStore_Containers", ...) or DS:SetOption(DataStore_Containers, ...)
|
||||||
if type(module) == "string" then
|
if type(module) == "string" then
|
||||||
module = RegisteredModules[module]
|
if module == "DataStore" then
|
||||||
|
module = addon
|
||||||
|
else
|
||||||
|
module = RegisteredModules[module]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if type(module) == "table" then
|
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
|
-- module can be either the module name (string) or the module table
|
||||||
-- ex: DS:GetOption("DataStore_Containers", ...) or DS:GetOption(DataStore_Containers, ...)
|
-- ex: DS:GetOption("DataStore_Containers", ...) or DS:GetOption(DataStore_Containers, ...)
|
||||||
if type(module) == "string" then
|
if type(module) == "string" then
|
||||||
module = RegisteredModules[module]
|
if module == "DataStore" then
|
||||||
|
module = addon
|
||||||
|
else
|
||||||
|
module = RegisteredModules[module]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if type(module) == "table" then
|
if type(module) == "table" then
|
||||||
|
|||||||
@@ -6,3 +6,7 @@ L["Disabled"] = "Deaktiviert"
|
|||||||
L["Enabled"] = "Aktiviert"
|
L["Enabled"] = "Aktiviert"
|
||||||
L["Memory used for %d |4character:characters;:"] = "Verwendeter Speicher für %d |4charakter:charaktere;:"
|
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."
|
||||||
|
|||||||
@@ -9,3 +9,7 @@ L["Disabled"] = true
|
|||||||
L["Enabled"] = true
|
L["Enabled"] = true
|
||||||
L["Memory used for %d |4character:characters;:"] = 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."
|
||||||
|
|||||||
@@ -141,6 +141,10 @@ function addon:SetupOptions()
|
|||||||
addon:SetupInfoPanel(help, DataStoreHelp_Text)
|
addon:SetupInfoPanel(help, DataStoreHelp_Text)
|
||||||
|
|
||||||
DataStoreGeneralOptions_Title:SetText(TEAL..format("DataStore %s", DataStore.Version))
|
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
|
-- manually adjust the width of a few panes, as resolution/scale may have an impact on the layout
|
||||||
local width = InterfaceOptionsFramePanelContainer:GetWidth() - 45
|
local width = InterfaceOptionsFramePanelContainer:GetWidth() - 45
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
<Anchors>
|
<Anchors>
|
||||||
<Anchor point="TOPLEFT" relativeTo="$parent_AddonsList" relativePoint="BOTTOMLEFT" >
|
<Anchor point="TOPLEFT" relativeTo="$parent_AddonsList" relativePoint="BOTTOMLEFT" >
|
||||||
<Offset>
|
<Offset>
|
||||||
<AbsDimension x="30" y="-30"/>
|
<AbsDimension x="0" y="-10"/>
|
||||||
</Offset>
|
</Offset>
|
||||||
</Anchor>
|
</Anchor>
|
||||||
</Anchors>
|
</Anchors>
|
||||||
@@ -76,6 +76,24 @@
|
|||||||
</OnClick>
|
</OnClick>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
|
<CheckButton name="$parent_HideStartGuilds" inherits="InterfaceOptionsSmallCheckButtonTemplate">
|
||||||
|
<Size>
|
||||||
|
<AbsDimension x="20" y="20"/>
|
||||||
|
</Size>
|
||||||
|
<Anchors>
|
||||||
|
<Anchor point="TOPLEFT" relativeTo="$parent_Refresh" relativePoint="BOTTOMLEFT" >
|
||||||
|
<Offset>
|
||||||
|
<AbsDimension x="0" y="-10"/>
|
||||||
|
</Offset>
|
||||||
|
</Anchor>
|
||||||
|
</Anchors>
|
||||||
|
<Scripts>
|
||||||
|
<OnClick>
|
||||||
|
DataStore:ToggleOption(self, "DataStore", "HideStartGuilds")
|
||||||
|
</OnClick>
|
||||||
|
</Scripts>
|
||||||
|
</CheckButton>
|
||||||
</Frames>
|
</Frames>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user