Skip to content

Commit

Permalink
Localized addon to portuguese
Browse files Browse the repository at this point in the history
Added new way to load the addon interface so I can localize the interface, it was very hard to make it work but I think it was worth it. Localized addon to Portuguese.
  • Loading branch information
SecretX33 committed Dec 26, 2020
1 parent bd01b6b commit 3a758bb
Show file tree
Hide file tree
Showing 15 changed files with 1,441 additions and 288 deletions.
316 changes: 74 additions & 242 deletions AutomaticWeaponRemoval.lua

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions AutomaticWeaponRemoval.toc
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@
## Title: AutomaticWeaponRemoval
## Notes: Remove (swap) your weapons automatically when bosses like Lady cast Mind Control on you.
## Author: SecretX (Freezingice @ WoW-Brasil)
## Version: 1.1.1
## Version: 1.2
## SavedVariables: AWRDB
## SavedVariablesPerCharacter: AWRDBC
## OptionalDeps: BugSack, !Swatter
## X-Category: Combat Assist
## X-Date: 12/23/2020

embeds.xml
localization.lua
AutomaticWeaponRemoval.lua
Locales\locales.xml
AutomaticWeaponRemovalGUI.lua
AutomaticWeaponRemoval.lua
197 changes: 197 additions & 0 deletions AutomaticWeaponRemovalGUI.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,197 @@
local validChannels = AWR_VALID_CHANNELS
local validLanguages = AWR_SUPPORTED_LANGUAGES

local specs = AWR_SPECS

function AWR:LOAD_INTERFACE()
-- Before mind control
local classOptionsListBefore = {
["removeOnlyBowIfHunter"] = AWR_REMOVE_ONLY_BOW_DESC,
}
-- After mind control
local classOptionsListAfter = {
["removePaladinRFAfterControlsEnd"] = AWR_CANCEL_RF_FROM_PALA_IF_NOT_TANK,
["removeDivinePleaAfterControlsEndIfHoly"] = AWR_CANCEL_DIVINE_PLEA_IF_HOLY_PALA,
}

--[[ Option table ]]--
local optionsFrameModel = {
name = "AutomaticWeaponRemoval",
handler = AWR,
type = "group",
args = {
enable = {
type = "toggle",
name = AWR_ENABLE_ADDON,
desc = AWR_ENABLE_ADDON_DESC,
get = "IsAWREnabled",
set = "ToggleEnable",
width = "double",
order = 0,
},
language = {
type = "select",
name = AWR_LANGUAGE,
values = validLanguages,
get = "GetLanguage",
set = "SetLanguage",
style = "dropdown",
order = 1,
},
enablemessage = {
type = "toggle",
name = AWR_SEND_MESSAGE_WHEN_CONTROLLED,
desc = AWR_SEND_MESSAGE_WHEN_CONTROLLED_DESC,
get = "IsMessageEnabled",
set = "ToggleEnableMessage",
width = "double",
order = 2,
},
channel = {
type = "select",
name = AWR_CHANNEL,
desc = AWR_CHANNEL_DESC,
values = validChannels,
get = "GetChannel",
set = "SetChannel",
style = "dropdown",
order = 3,
},
message = {
type = "input",
name = AWR_MESSAGE,
desc = AWR_MESSAGE_DESC,
set = "SetMessage",
get = "GetMessage",
width = "full",
order = 4,
},
desc1 = {
type = "header",
name = AWR_CLASS_OPTIONS,
order = 5,
},
classoptionsbefore = {
type = "multiselect",
name = AWR_BEFORE_MIND_CONTROL,
values = classOptionsListBefore,
tristate = false,
get = "GetClassOption",
set = "SetClassOption",
width = "full",
order = 6,
},
classoptionsafter = {
type = "multiselect",
name = AWR_AFTER_MIND_CONTROL,
values = classOptionsListAfter,
tristate = false,
get = "GetClassOption",
set = "SetClassOption",
width = "full",
order = 7,
},
desc2 = {
type = "header",
name = AWR_REMOVE_WEAPONS_FOR,
order = 8,
},
hunter = {
type = "multiselect",
name = "Hunter",
values = specs.hunter,
tristate = false,
set = "SetSpecState",
get = "GetSpecState",
order = 9,
},
deathknight = {
type = "multiselect",
name = "Death Knight",
values = specs.deathknight,
tristate = false,
set = "SetSpecState",
get = "GetSpecState",
order = 10,
},
paladin = {
type = "multiselect",
name = "Paladin",
values = specs.paladin,
tristate = false,
set = "SetSpecState",
get = "GetSpecState",
order = 11,
},
warrior = {
type = "multiselect",
name = "Warrior",
values = specs.warrior,
tristate = false,
set = "SetSpecState",
get = "GetSpecState",
order = 12,
},
druid = {
type = "multiselect",
name = "Druid",
values = specs.druid,
tristate = false,
set = "SetSpecState",
get = "GetSpecState",
order = 13,
},
rogue = {
type = "multiselect",
name = "Rogue",
values = specs.rogue,
tristate = false,
set = "SetSpecState",
get = "GetSpecState",
order = 14,
},
shaman = {
type = "multiselect",
name = "Shaman",
values = specs.shaman,
tristate = false,
set = "SetSpecState",
get = "GetSpecState",
order = 15,
},
priest = {
type = "multiselect",
name = "Priest",
values = specs.priest,
tristate = false,
set = "SetSpecState",
get = "GetSpecState",
order = 16,
},
mage = {
type = "multiselect",
name = "Mage",
values = specs.mage,
tristate = false,
set = "SetSpecState",
get = "GetSpecState",
order = 17,
},
warlock = {
type = "multiselect",
name = "Warlock",
values = specs.warlock,
tristate = false,
set = "SetSpecState",
get = "GetSpecState",
order = 18,
},
},
}
-- Loading Config Frame
LibStub("AceConfig-3.0"):RegisterOptionsTable("AutomaticWeaponRemoval", optionsFrameModel)
AWR.optionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("AutomaticWeaponRemoval")
CH.UnregisterCallback(self, "LOAD_INTERFACE")
end

CH.RegisterCallback(AWR,"LOAD_INTERFACE")
Loading

0 comments on commit 3a758bb

Please sign in to comment.