Skip to content

Commit

Permalink
Added Localization
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSheps committed Oct 28, 2018
1 parent 3ce85b4 commit e3b4f2c
Show file tree
Hide file tree
Showing 7 changed files with 303 additions and 328 deletions.
39 changes: 24 additions & 15 deletions BeStride.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ BeStride = LibStub("AceAddon-3.0"):NewAddon("Bestride","AceConsole-3.0", "AceEve

debugLevel = 8

playerTable = {}

function sortTable(unsortedTable)
keys = {}
sortedTable = {}
Expand Down Expand Up @@ -37,18 +35,21 @@ function pairsByKeys (t, f)
return iter
end

mountTable = {
["master"] = {},
["ground"] = {},
["flying"] = {},
["swimming"] = {},
["repair"] = {},
["passenger"] = {},
["zone"] = {},
local BeStride_Options = {
name="BeStride",
handler = BeStride,
type = "group",
args = {
enable = {
type = "execute",
name = BeStride_Locale.Options.OpenGUI,
func = "Frame",
},
}
}

local defaults = {
["version"] = version,
version = BeStride_Constants.Version,

profile = {
settings = {
Expand Down Expand Up @@ -129,6 +130,10 @@ function BeStride:OnInitialize()
self:RegisterChatCommand("bestride","ChatCommand")
self:RegisterChatCommand("br","ChatCommand")

local bestrideOptions = LibStub("AceConfigRegistry-3.0")
bestrideOptions:RegisterOptionsTable("BeStride",BeStride_Options)
self.bestrideOptionsFrame = LibStub("AceConfigDialog-3.0"):AddToBlizOptions("BeStride","BeStride")

self.buttons = {
["mount"] = nil,
["ground"] = nil,
Expand Down Expand Up @@ -164,6 +169,10 @@ function BeStride:OnInitialize()
playerTable["faction"]["localization"] = factionLocalized
end

function BeStride:Frame()
BeStride_GUI:Frame()
end

function BeStride:OnEnable()
BeStride:buildMountTables()

Expand Down Expand Up @@ -294,7 +303,7 @@ function BeStride:Upgrade()
end

if savedType == "special" then
if mountData[mountTable.master[mountID].spellID] and mountData[mountTable.master[mountID].spellID].type == "zone" then
if BeStride_Constants.Mount.Mounts[mountTable.master[mountID].spellID] and BeStride_Constants.Mount.Mounts[mountTable.master[mountID].spellID].type == "zone" then
self.db.profile.mounts[mountType][mountID] = status
end
end
Expand Down Expand Up @@ -481,7 +490,7 @@ function BeStride:AddNewMount(mountId)
["icon"] = icon,
["source"] = source,
["sourceType"] = sourceType,
["type"] = mountTypes[mountTypeID],
["type"] = BeStride_Constants.Mount.Types[mountTypeID],
}
end

Expand Down Expand Up @@ -518,13 +527,13 @@ function BeStride:AddCommonMount(mountId)
end

function BeStride:AddPassengerMount(mountId)
if mountData[mountTable["master"][mountId]["spellID"]] ~= nil and mountData[mountTable["master"][mountId]["spellID"]]["type"] == "passenger" then
if BeStride_Constants.Mount.Mounts[mountTable["master"][mountId]["spellID"]] ~= nil and BeStride_Constants.Mount.Mounts[mountTable["master"][mountId]["spellID"]]["type"] == "passenger" then
table.insert(mountTable["passenger"],mountId)
end
end

function BeStride:AddRepairMount(mountId)
if mountData[mountTable["master"][mountId]["spellID"]] ~= nil and mountData[mountTable["master"][mountId]["spellID"]]["repair"] then
if BeStride_Constants.Mount.Mounts[mountTable["master"][mountId]["spellID"]] ~= nil and BeStride_Constants.Mount.Mounts[mountTable["master"][mountId]["spellID"]]["repair"] then
table.insert(mountTable["repair"],mountId)
end
end
Expand Down
6 changes: 4 additions & 2 deletions BeStride.toc
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ libs\AceDB-3.0\AceDB-3.0.xml
libs\AceGUI-3.0\AceGUI-3.0.xml


BeStride_Constants.lua

localization\en-US.lua

BeStride.lua
BeStride_Constants.lua
BeStride_ActionButton.lua
BeStride_Events.lua
BeStride_GUI.lua
BeStride_Logic.lua
BeStride_Mount.lua
BeStride_Mount.lua
BeStride_Variables.lua
Loading

0 comments on commit e3b4f2c

Please sign in to comment.