-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #289 from Bestride/develop
Fix Options panel for Cata
- Loading branch information
Showing
17 changed files
with
330 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ Versions\Common\BeStride_Debug.lua | |
|
||
libs\embeds.xml | ||
|
||
Versions\BeStride_Mainline.xml | ||
Versions\BeStride_Cata.xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<Ui xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd"> | ||
<Script file="Common\version.lua"/> | ||
<Script file="..\localization\de-DE.lua"/> | ||
<Script file="..\localization\en-US.lua"/> | ||
<Script file="..\localization\zh-TW.lua"/> | ||
<Script file="..\localization\ko-KR.lua"/> | ||
<Script file="..\localization\fr-FR.lua"/> | ||
<Script file="Common\BeStride_Constants.lua"/> | ||
<Script file="..\BeStride.lua"/> | ||
<Script file="Common\BeStride_Variables.lua"/> | ||
<Script file="Common\BeStride_ActionButton.lua"/> | ||
<Script file="Common\BeStride_Events.lua"/> | ||
<Script file="Common\BeStride_Mount.lua"/> | ||
<Script file="Common\functions.lua"/> | ||
<Script file="Common\mapping.lua"/> | ||
<Script file="Common\logic.class.lua"/> | ||
<Script file="Common\logic.mounts.lua"/> | ||
<Script file="Common\logic.player.lua"/> | ||
<Script file="Common\logic.special.lua"/> | ||
<Script file="Common\logic.zone.lua"/> | ||
<Script file="Common\mount.lua"/> | ||
<Script file="Common\mount.table.lua"/> | ||
<Script file="Common\mounting.checks.lua"/> | ||
<Script file="Common\mounting.class.lua"/> | ||
<Script file="Common\mounting.player.lua"/> | ||
<Script file="Common\mounting.special.lua"/> | ||
<Script file="Common\mounting.zone.lua"/> | ||
<Script file="Common\settings.lua"/> | ||
<Script file="Common\options.lua"/> | ||
<Script file="Cata\bestride.lua"/> | ||
<Script file="Cata\MountTable.lua"/> | ||
<Script file="Cata\logic.lua"/> | ||
<Script file="Common\upgrade.lua"/> | ||
<Script file="Common\bestride.lua"/> | ||
<Script file="Common\opie.lua"/> | ||
</Ui> |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
function BeStride:BuildMasterMountTable() | ||
for key,value in pairs(C_MountJournal.GetMountIDs()) do | ||
local name,spellID,icon,isActive,isUsable,sourceType,isFavorite,isFactionSpecific,faction,shouldHideOnChar,isCollected,mountID,isSteadyFlight = C_MountJournal.GetMountInfoByID(value) | ||
|
||
if isCollected then | ||
BeStride:AddNewMount(value) | ||
end | ||
end | ||
|
||
for _,value in pairs(C_MountJournal.GetCollectedDragonridingMounts()) do | ||
-- With dynamic flying, we can treat any 'dragonriding' mount as a flying mount | ||
-- Note that some mounts can steady flight but NOT dynamic fly (ie. Otterworldy Ottuk) | ||
mountTable["master"][value]["canFly"] = true | ||
end | ||
end | ||
|
||
|
||
|
||
function BeStride:AddNewMount(mountId) | ||
local name,spellID,icon,isActive,isUsable,sourceType,isFavorite,isFactionSpecific,faction,shouldHideOnChar,isCollected,mountID,isSteadyFlight = C_MountJournal.GetMountInfoByID(mountId) | ||
local creatureDisplayInfoID,description,source,isSelfMount,mountTypeID,uiModelSceneID = C_MountJournal.GetMountInfoExtraByID(mountId) | ||
|
||
if isFactionSpecific then | ||
faction = faction | ||
else | ||
faction = nil | ||
end | ||
|
||
mountTable["master"][mountId] = { | ||
["name"] = name, | ||
["spellID"] = spellID, | ||
["mountID"] = mountID, | ||
["factionLocked"] = isFactionSpecific, | ||
["faction"] = faction, | ||
["description"] = description, | ||
["isActive"] = isActive, | ||
["isUsable"] = isUsable, | ||
["isCollected"] = isCollected, | ||
["icon"] = icon, | ||
["source"] = source, | ||
["sourceType"] = sourceType, | ||
["isSteadyFlight"] = isSteadyFlight, | ||
["type"] = BeStride_Constants.Mount.Types[mountTypeID], | ||
["subtype"] = nil, | ||
} | ||
|
||
if BeStride_Constants.Mount.Mounts[spellID] then | ||
mountOverrides = BeStride_Constants.Mount.Mounts[spellID] | ||
if mountOverrides["subtype"] then | ||
mountTable["master"][mountId]["subtype"] = mountOverrides["subtype"] | ||
end | ||
end | ||
|
||
end | ||
|
||
function BeStride:PrintAllMounts() | ||
for key,value in pairs(C_MountJournal.GetMountIDs()) do | ||
local name,spellID,icon,isActive,isUsable,sourceType,isFavorite,isFactionSpecific,faction,shouldHideOnChar,isCollected,mountID,isSteadyFlight = C_MountJournal.GetMountInfoByID(value) | ||
local creatureDisplayInfoID,description,source,isSelfMount,mountTypeID,uiModelSceneID = C_MountJournal.GetMountInfoExtraByID(mountId) | ||
if isCollected then | ||
print("" + mountID + ":" + name + ":" + spellID + ":" + icon + ":" + isSummoned + ":" + mountTypeID+"") | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
|
||
function BeStride:Version_OnEnable() | ||
end | ||
|
||
function BeStride:IsClassicEra() | ||
return false | ||
end | ||
|
||
function BeStride:IsWrath() | ||
return false | ||
end | ||
|
||
function BeStride:IsCata() | ||
return true | ||
end | ||
|
||
function BeStride:IsMainline() | ||
return false | ||
end | ||
|
||
function BeStride:GetMountInfoBySpellID(id) | ||
local mountID = C_MountJournal.GetMountFromSpell(id) | ||
if mountID then | ||
return self:GetMountInfoByMountID(mountID) | ||
end | ||
end | ||
|
||
function BeStride:IsSpellUsable(spell) | ||
if C_Spell.IsSpellUsable then | ||
return C_Spell.IsSpellUsable(spell) | ||
elseif C_Spell.IsUsableSpell then | ||
return C_Spell.IsUsableSpell(spell) | ||
elseif IsUsableSpell then | ||
return IsUsableSpell(spell) | ||
else | ||
return false | ||
end | ||
end | ||
|
||
function BeStride:GetSpellInfo(spell) | ||
if C_Spell.GetSpellInfo then | ||
local info = C_Spell.GetSpellInfo(spell) | ||
if info and type(info) == "table" then | ||
return { name = info.name, spellID = info.spellID } | ||
else | ||
local name,_,_,_,_,_,spellID = C_Spell.GetSpellInfo(spell) | ||
return { name = name, spellID = spellID } | ||
end | ||
elseif GetSpellInfo then | ||
local name,_,_,_,_,_,spellID = GetSpellInfo(spell) | ||
return { name = name, spellID = spellID } | ||
else | ||
return nil | ||
end | ||
end | ||
|
||
function BeStride:GetSpellOnCooldown(spell) | ||
if C_Spell.GetSpellCooldown then | ||
local info = C_Spell.GetSpellCooldown(spell) | ||
if info and type(info) == "table" then | ||
return info.duration ~= 0 | ||
else | ||
local onCooldown, _, _, _ = GetSpellCooldown(195072) | ||
return onCooldown ~= 0 | ||
end | ||
elseif GetSpellCooldown then | ||
local onCooldown, _, _, _ = GetSpellCooldown(195072) | ||
return onCooldown ~= 0 | ||
else | ||
return nil | ||
end | ||
end | ||
|
||
function BeStride:GetMountInfoByMountID(id) | ||
local creatureName,spellID,icon,active,isUsable,sourceType,isFavorite,isFactionSpecific,faction,hideOnChar,isCollected,mountID,isSteadyFlight = C_MountJournal.GetMountInfoByID(id) | ||
return { | ||
creatureName = creatureName, | ||
spellID = spellID, | ||
mountID = mountID, | ||
icon = icon, | ||
active = active, | ||
isUsable = isUsable, | ||
sourceType = sourceType, | ||
isFavorite = isFavorite, | ||
isFactionSpecific = isFactionSpecific, | ||
faction = faction, | ||
hideOnChar = hideOnChar, | ||
isCollected = isCollected, | ||
isSteadyFlight = isSteadyFlight | ||
} | ||
end | ||
|
||
function BeStride:GetMountInfoByIndex(index) | ||
return nil | ||
end | ||
|
||
function BeStride:GetKnownMountFromTarget() | ||
for i=1,40,1 do | ||
local info = C_UnitAuras.GetBuffDataByIndex("target", i) | ||
if not info then return end | ||
local mountId = C_MountJournal.GetMountFromSpell(info.spellId) | ||
if mountId ~= nil then | ||
return self:isMountUsable(mountId) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
BeStride_Game = "Mainline" | ||
|
||
local class = UnitClass("player") | ||
|
||
function BeStride:isMountUsable(mount) | ||
local name,spellID,icon,isActive,isUsable,sourceType,isFavorite,isFactionSpecific,faction,shouldHideOnChar,isCollected,mountID = C_MountJournal.GetMountInfoByID(mount) | ||
|
||
return spellID,mountID,isUsable | ||
end | ||
|
||
function BeStride:isZoneMount(mountId) | ||
spellId = mountTable.master[mountId].spellID | ||
if mountTable.master[mountId].type == "zone" and BeStride_Constants.Mount.Mounts[spellId] ~= nil and BeStride_Constants.Mount.Mounts[spellId].zone ~= nil then | ||
return true | ||
elseif BeStride_Game == "Mainline" and mountTable.master[mountId].type == "zone" and BeStride_Constants.Mount.Mounts[mountId] ~= nil and BeStride_Constants.Mount.Mounts[mountId].zone ~= nil then | ||
return true | ||
end | ||
|
||
return false | ||
end | ||
|
||
function BeStride:GetProfessions() | ||
return GetProfessions() | ||
end | ||
|
||
function BeStride:GetRidingSkill() | ||
local ridingSkillLevel = 0 | ||
local ridingSpells = {} | ||
|
||
|
||
for spellID,skill in pairsByKeys(BeStride_Constants.Riding.Skill) do | ||
if IsSpellKnown(spellID) and skill.level ~= nil and skill.level > ridingSkillLevel then | ||
ridingSkillLevel = skill.level | ||
ridingSpells[spellID] = true | ||
elseif IsSpellKnown(spellID) and skill.level == nil then | ||
ridingSpells[spellID] = true | ||
end | ||
end | ||
|
||
return ridingSkillLevel,ridingSpells | ||
end | ||
|
||
function BeStride:CanWraithWalk() | ||
return true | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.