From c880c0f372b58406bf67a8d641befa0a5cec0847 Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Wed, 21 Aug 2024 20:53:58 -0500 Subject: [PATCH 1/5] Fix Options panel for Cata --- BeStride_Cata.toc | 2 +- Versions/Common/bestride.lua | 27 ++++++++++++++++++++++----- Versions/Common/logic.special.lua | 4 ++-- Versions/Common/mount.table.lua | 5 +++-- Versions/Common/opie.lua | 4 ++-- Versions/Common/options.lua | 16 +++++++++++----- Versions/Common/settings.lua | 2 ++ Versions/Mainline/MountTable.lua | 9 +++++++++ 8 files changed, 52 insertions(+), 17 deletions(-) diff --git a/BeStride_Cata.toc b/BeStride_Cata.toc index 7c8f70b..15c686b 100644 --- a/BeStride_Cata.toc +++ b/BeStride_Cata.toc @@ -23,4 +23,4 @@ Versions\Common\BeStride_Debug.lua libs\embeds.xml -Versions\BeStride_Mainline.xml \ No newline at end of file +Versions\BeStride_Cata.xml \ No newline at end of file diff --git a/Versions/Common/bestride.lua b/Versions/Common/bestride.lua index 1d4e53a..e9a7391 100644 --- a/Versions/Common/bestride.lua +++ b/Versions/Common/bestride.lua @@ -160,21 +160,22 @@ function BeStride:ChatCommand(input) elseif command == "spellID" then mount = BeStride:GetMountInfoBySpellID(args) print(mount.creatureName) + elseif command == "mount" then + BeStride:GetMountInfoByName(args) elseif command == "mounts" then LibStub("AceConfigDialog-3.0"):Open("BeStride-Mounts") elseif command == "options" then if self.IsMainline() then + Settings.OpenToCategory(self.configDialogs.options.id) else - InterfaceOptionsFrame_OpenToCategory(self.configDialogs.options.frame) - InterfaceOptionsFrame_OpenToCategory(self.configDialogs.options.frame) + InterfaceOptionsFrame_OpenToCategory("BeStride") end elseif command == "profiles" then if self.IsMainline() then Settings.OpenToCategory(self.configDialogs.profiles.id) else - InterfaceOptionsFrame_OpenToCategory(self.configDialogs.profiles.frame) - InterfaceOptionsFrame_OpenToCategory(self.configDialogs.profiles.frame) + InterfaceOptionsFrame_OpenToCategory("BeStride") end elseif command == "debug" or input == "bug" then LibStub("AceConfigDialog-3.0"):Open("BeStride-Debug") @@ -213,13 +214,28 @@ function BeStride:ChatCommand(input) print("Classic") elseif self:IsWrath() then print("Wrath") + elseif self:IsCata() then + print("Cata") elseif self:IsMainline() then print("Mainline") else print("Other") end else - Settings.OpenToCategory(self.configDialogs.mounts.id) + if self.IsMainline() then + Settings.OpenToCategory(self.configDialogs.mounts.id) + else + InterfaceOptionsFrame_OpenToCategory("BeStride") + end + end +end + +function BeStride:GetMountInfoByName(mount) + 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 name == mount then + self:PrintMount(value) + end end end @@ -227,6 +243,7 @@ function BeStride:PrintMount(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) print(name) + print(" mountId: " .. tostring(mountId)) print(" spellID: " .. tostring(spellID)) print(" icon: " .. tostring(icon)) print(" isActive: " .. tostring(isActive)) diff --git a/Versions/Common/logic.special.lua b/Versions/Common/logic.special.lua index ec62236..ce91762 100644 --- a/Versions/Common/logic.special.lua +++ b/Versions/Common/logic.special.lua @@ -67,7 +67,7 @@ function BeStride:IsRepairable() for i = 0, 4 do - if self.IsMainline() then + if self.IsMainline() or self.IsCata() then local bagSlots = C_Container.GetContainerNumSlots(i) else local bagSlots = GetContainerNumSlots(i) @@ -75,7 +75,7 @@ function BeStride:IsRepairable() for j = 0, bagSlots do local current, maximum = 0, 0 - if self.IsMainline() then + if self.IsMainline() or self.IsCata() then local current, maximum = C_Container.GetContainerItemDurability(i, j) else local current, maximum = GetContainerItemDurability(i, j) diff --git a/Versions/Common/mount.table.lua b/Versions/Common/mount.table.lua index efe6b7d..d9d9962 100644 --- a/Versions/Common/mount.table.lua +++ b/Versions/Common/mount.table.lua @@ -58,8 +58,9 @@ function BeStride:AddCommonMount(mountId) --print("Adding Mount: " .. mount["name"] .. " Id: " .. mountId .. " Type: " .. mount["type"]) table.insert(mountTable["swimming"],mountId) elseif mount.type and mount["type"] == "zone" then - --print("Adding Mount: " .. mount["name"] .. " Id: " .. mountId .. " Type: " .. mount["type"]) - if mountId == 373 then + print("Adding Mount: " .. mount["name"] .. " Id: " .. mountId .. " Type: " .. mount["type"]) + if mountTable.subtype == "swimming" then + print("Adding Mount: " .. mount["name"] .. " Id: " .. mountId .. " Type: swimming" ) table.insert(mountTable["swimming"],mountId) end table.insert(mountTable["zone"],mountId) diff --git a/Versions/Common/opie.lua b/Versions/Common/opie.lua index 54e1bde..1fff90b 100644 --- a/Versions/Common/opie.lua +++ b/Versions/Common/opie.lua @@ -26,7 +26,7 @@ local function addBeStrideRingToOpie() "macrotext", "/click BeStride_ABPassengerMount", _u = "p", -- passenger - icon = BeStride:IsMainline() and "Interface/Icons/inv_misc_stonedragonorange" or + icon = (BeStride:IsMainline() or BeStride:IsCata()) and "Interface/Icons/inv_misc_stonedragonorange" or "Interface/Icons/ability_mount_mammoth_black" }) end @@ -37,7 +37,7 @@ local function addBeStrideRingToOpie() "macrotext", "/click BeStride_ABGroundMount", _u = "g", -- ground - icon = BeStride:IsMainline() and "Interface/Icons/misc_arrowdown" or + icon = (BeStride:IsMainline() or BeStride:IsCata()) and "Interface/Icons/misc_arrowdown" or "Interface/Icons/ability_mount_dreadsteed" }) diff --git a/Versions/Common/options.lua b/Versions/Common/options.lua index 2b36417..0a9e5ab 100644 --- a/Versions/Common/options.lua +++ b/Versions/Common/options.lua @@ -212,7 +212,7 @@ local optionsTable_Options = { deathknight = { type="group", name=L["Classes.DeathKnight"], - disabled = function (info) return BeStride:IsWrath() and not BeStride:IsMainline() end, + disabled = function (info) return (BeStride:IsWrath() or BeStride:IsCata()) and not BeStride:IsMainline() end, args = { ["classes.deathknight.wraithwalk"]={ type="toggle", @@ -227,7 +227,7 @@ local optionsTable_Options = { demonhunter = { type="group", name=L["Classes.DemonHunter"], - disabled = function (info) return BeStride:IsWrath() and not BeStride:IsMainline() end, + disabled = function (info) return (BeStride:IsWrath() or BeStride:IsCata()) and not BeStride:IsMainline() end, args = { ["classes.demonhunter.felrush"]={ type="toggle", @@ -357,7 +357,7 @@ local optionsTable_Options = { monk = { type="group", name=L["Classes.Monk"], - disabled = function (info) return BeStride:IsWrath() and not BeStride:IsMainline() end, + disabled = function (info) return (BeStride:IsWrath() or BeStride:IsCata()) and not BeStride:IsMainline() end, args = { ["classes.monk.roll"]={ type="toggle", @@ -380,7 +380,7 @@ local optionsTable_Options = { paladin = { type="group", name=L["Classes.Paladin"], - disabled = function (info) return BeStride:IsWrath() and not BeStride:IsMainline() end, + disabled = function (info) return (BeStride:IsWrath() or BeStride:IsCata()) and not BeStride:IsMainline() end, args = { ["classes.paladin.steed"]={ type="toggle", @@ -437,7 +437,7 @@ local optionsTable_Options = { warlock = { type="group", name=L["Classes.Warlock"], - disabled = function (info) return BeStride:IsWrath() and not BeStride:IsMainline() end, + disabled = function (info) return (BeStride:IsWrath() or BeStride:IsCata()) and not BeStride:IsMainline() end, args = { ["classes.warlock.rush"]={ type="toggle", @@ -519,9 +519,15 @@ local optionsTable_Mounts = { local function generateMountTable() for _,group in pairs({"ground", "flying", "swimming", "repair", "passenger"}) do + print(group) for key,mountID in pairs(mountTable[group]) do local mount = mountTable.master[mountID] local name = mount.name + + if group == "swimming" then + print(name) + print(mountID) + end options = { name=name, diff --git a/Versions/Common/settings.lua b/Versions/Common/settings.lua index 8deb676..706f72d 100644 --- a/Versions/Common/settings.lua +++ b/Versions/Common/settings.lua @@ -87,6 +87,8 @@ function BeStride:DBCanSetSetting(parent, setting) return false elseif variable["era"] ~= nil and variable["era"]["wrath"] ~= nil and variable["era"]["wrath"] == false and self:IsWrath() then return false + elseif variable["era"] ~= nil and variable["era"]["cata"] ~= nil and variable["era"]["cata"] == false and self:IsCata() then + return false elseif variable["era"] ~= nil and variable["era"]["mainline"] ~= nil and variable["era"]["mainline"] == false and self:IsMainline() then return false else diff --git a/Versions/Mainline/MountTable.lua b/Versions/Mainline/MountTable.lua index 47ee38a..9fd68fd 100644 --- a/Versions/Mainline/MountTable.lua +++ b/Versions/Mainline/MountTable.lua @@ -41,7 +41,16 @@ function BeStride:AddNewMount(mountId) ["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() From 4c63398c5611753d408684e68db59a24babbcc2c Mon Sep 17 00:00:00 2001 From: Daniel Sheppard Date: Wed, 21 Aug 2024 21:01:33 -0500 Subject: [PATCH 2/5] Update options for Cata --- Versions/BeStride_Cata.xml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Versions/BeStride_Cata.xml diff --git a/Versions/BeStride_Cata.xml b/Versions/BeStride_Cata.xml new file mode 100644 index 0000000..22ff7b7 --- /dev/null +++ b/Versions/BeStride_Cata.xml @@ -0,0 +1,36 @@ + +