Skip to content

Commit

Permalink
Merge pull request #282 from Bestride/develop
Browse files Browse the repository at this point in the history
Add option to only summon random fliers
  • Loading branch information
DanSheps authored Aug 11, 2024
2 parents e8143b1 + f58ee75 commit fa1d2f7
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
13 changes: 12 additions & 1 deletion Versions/Common/BeStride_Mount.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ end
function BeStride_Mount:DBGetMountStatus(mountType,key)

local mounts = BeStride:DBGet("mounts." .. mountType)
print(#mounts)
print(key)
local status = mounts[key]
if status ~= nil and status then
return true
Expand Down Expand Up @@ -57,7 +59,16 @@ end
function BeStride_Mount:Failback()
local mounts = {}
if BeStride:DBGetSetting("mount.emptyrandom") then
for k,v in pairs(mountTable["master"]) do if self:IsUsable(k) then table.insert(mounts,k) end end

for k,v in pairs(mountTable["master"]) do
if BeStride:DBGetSetting("mount.emptyrandomflying") and v.type == "flying" and BeStride:IsFlyable() then
table.insert(mounts,k)
elseif BeStride:DBGetSetting("mount.emptyrandomflying") and v.type == "ground" and not BeStride:IsFlyable() then
table.insert(mounts,k)
elseif not BeStride:DBGetSetting("mount.emptyrandomflying") and self:IsUsable(k) then
table.insert(mounts,k)
end
end

if #mounts == 0 then
BeStride_Debug:Debug("No Mounts")
Expand Down
1 change: 1 addition & 0 deletions Versions/Common/BeStride_Variables.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ BeStride_Variables = {
["mount.enablenew"]={name="mount.enablenew",element="CheckBox",label=LibStub("AceLocale-3.0"):GetLocale("BeStride")["Settings.EnableNew"]},
["mount.remount"]={name="mount.remount",element="CheckBox",label=LibStub("AceLocale-3.0"):GetLocale("BeStride")["Settings.RemountAfterDismount"]},
["mount.emptyrandom"]={name="mount.emptyrandom",element="CheckBox",label=LibStub("AceLocale-3.0"):GetLocale("BeStride")["Settings.EmptyRandom"]},
["mount.emptyrandomflying"]={name="mount.emptyrandomflying",element="CheckBox",label=LibStub("AceLocale-3.0"):GetLocale("BeStride")["Settings.EmptyRandomFlying"]},
["mount.nodismountwhileflying"]={name="mount.nodismountwhileflying",element="CheckBox",label=LibStub("AceLocale-3.0"):GetLocale("BeStride")["Settings.NoDismountWhileFlying"]},
["mount.useflyingmount"]={name="mount.useflyingmount",element="CheckBox",label=LibStub("AceLocale-3.0"):GetLocale("BeStride")["Settings.UseFlyingMount"], dependants = {"mount.forceflyingmount"}},
["mount.forceflyingmount"]={name="mount.forceflyingmount",element="CheckBox",label=LibStub("AceLocale-3.0"):GetLocale("BeStride")["Settings.ForceFlyingMount"], depends = {"mount.useflyingmount"}},
Expand Down
9 changes: 9 additions & 0 deletions Versions/Common/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@ local optionsTable_Options = {
get=function (info) return BeStride:DBGetSetting(info[#info]) end,
set=function (info,val) BeStride:DBSetSetting(info[#info],val) end,
},
["mount.emptyrandomflying"]={
type="toggle",
name=L["Settings.EmptyRandomFlying"],
order=2,
width="full",
get=function (info) return BeStride:DBGetSetting(info[#info]) end,
set=function (info,val) BeStride:DBSetSetting(info[#info],val) end,
disabled=function(info) return not BeStride:DBGetSetting('mount.emptyrandom') end,
},
["mount.remount"]={
type="toggle",
name=L["Settings.RemountAfterDismount"],
Expand Down
1 change: 1 addition & 0 deletions localization/en-US.lua
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ L["Continent.Draenor"] = "Draenor"
L["Skills.Riding"] = "Riding"
L["Settings.EnableNew"] = "Automatically enable new mounts upon learning them"
L["Settings.EmptyRandom"] = "Choose random usable mount if no usable mounts selected"
L["Settings.EmptyRandomFlying"] = "Restrict random mounts to flying when in flyable zones"
L["Settings.RemountAfterDismount"] = "Remount Immediately After Dismounting"
L["Settings.NoDismountWhileFlying"] = "Don't dismount while flying. You'll have to land or (if enabled in Blizzard options) cast a spell"
L["Settings.UseFlyingMount"] = "Use Flying type mounts even in areas where you cannot fly"
Expand Down

0 comments on commit fa1d2f7

Please sign in to comment.