Skip to content

Commit

Permalink
Merge branch 'develop-0.5.0' of https://github.com/DanSheps/bestride
Browse files Browse the repository at this point in the history
…into develop
  • Loading branch information
DanSheps committed Oct 23, 2018
2 parents fb96b90 + 8ebc5e0 commit c04adf6
Show file tree
Hide file tree
Showing 57 changed files with 16,275 additions and 0 deletions.
571 changes: 571 additions & 0 deletions BeStride.lua

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions BeStride.toc
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
## Interface: 80000
## Title: BeStride
## Notes: Manages your Mounts
## Author: Anaximander - Burning Legion US
## Version: 0.5.0
## X-Category: Interface Enhancements
## X-Embeds: Ace3
## OptionalDeps: Ace3
## SavedVariables: BeStrideDB, BestrideDB

BeStride_Debug.lua
## BeStride.xml

libs\LibStub\LibStub.lua
libs\CallbackHandler-1.0\CallbackHandler-1.0.xml
libs\AceAddon-3.0\AceAddon-3.0.xml
libs\AceEvent-3.0\AceEvent-3.0.xml
libs\AceConsole-3.0\AceConsole-3.0.xml
libs\AceDB-3.0\AceDB-3.0.xml
libs\AceGUI-3.0\AceGUI-3.0.xml


localization\en-US.lua

BeStride.lua
BeStride_Constants.lua
BeStride_ActionButton.lua
BeStride_Events.lua
BeStride_GUI.lua
BeStride_Logic.lua
BeStride_Mount.lua
46 changes: 46 additions & 0 deletions BeStride.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/ ..\FrameXML\UI.xsd">

<Button name="BeStride_ABRegularMount" inherits="SecureActionButtonTemplate" parent="UIParent">
<Attributes>
<Attribute name="type" type="string" value="macro"/>
</Attributes>
<Scripts>
<PreClick>
BeStride_ActionButtonRegularMount:PreClick()
</PreClick>
</Scripts>
</Button>

<Button name="BeStride_ABGroundMount" inherits="SecureActionButtonTemplate" parent="UIParent">
<Attributes>
<Attribute name="type" type="string" value="macro"/>
</Attributes>
<Scripts>
<PreClick>
BeStride_ActionButtonGroundMount:PreClick()
</PreClick>
</Scripts>
</Button>

<Button name="BeStride_ABPassengerMount" inherits="SecureActionButtonTemplate" parent="UIParent">
<Attributes>
<Attribute name="type" type="string" value="macro"/>
</Attributes>
<Scripts>
<PreClick>
BeStride_ActionButtonPassengerMount:PreClick()
</PreClick>
</Scripts>
</Button>

<Button name="BeStride_ABRepairMount" inherits="SecureActionButtonTemplate" parent="UIParent">
<Attributes>
<Attribute name="type" type="string" value="macro"/>
</Attributes>
<Scripts>
<PreClick>
BeStride_ActionButtonRepairMount:PreClick()
</PreClick>
</Scripts>
</Button>
</Ui>
137 changes: 137 additions & 0 deletions BeStride_ActionButton.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
BeStride_ActionButtonRegularMount = {}
BeStride_ActionButtonGroundMount = {}
BeStride_ActionButtonPassengerMount = {}
BeStride_ActionButtonRepairMount = {}

-- Creates Action Buttons
function BeStride:CreateActionButton(buttontype)
local name = "BeStride_AB" .. buttontype .. "Mount"

local br = CreateFrame("Button", name, UIParent, "SecureActionButtonTemplate,ActionButtonTemplate")
br:SetAttribute("type","macro")
br:SetAttribute("macrotext",nil)

if buttontype == "Regular" then
Mixin(br, BeStride_ActionButtonRegularMount)
elseif buttontype == "Ground" then
Mixin(br, BeStride_ActionButtonGroundMount)
elseif buttontype == "Repair" then
Mixin(br, BeStride_ActionButtonRepairMount)
elseif buttontype == "Passenger" then
Mixin(br, BeStride_ActionButtonPassengerMount)
end

br.id = buttontype
br:SetScript("PreClick",function (self) self:PreClick() end )
br:SetScript("PostClick",self.PostClick)
--SaveBindings(GetCurrentBindingSet())
if br then
--print("Returning: " .. br:GetName())
return br
else
BeStride_Debug:Critical("Critical: " .. buttontype)
end
end

-- +-------+ --
-- Any Mount --
-- +-------+ --

-- Action Button Wrapper
function BeStride_ActionButtonRegularMount:PreClick()
if BeStride_Logic:IsCombat() then
return
end

local mount = BeStride_Logic:Regular()
if mount ~= nil then
self:SetAttribute("macrotext",mount)
--BeStride_Debug:Verbose(self:GetAttribute("macrotext"))
end
end

-- Action Button Cleanup
function BeStride_ActionButtonRegularMount:PostClick()
if BeStride_Logic:IsCombat() then
return
end

BeStride_ABRegularMount:SetAttribute("macrotext", nil)
end


-- +----------+ --
-- Ground Mount --
-- +----------+ --

-- Action Button Wrapper
function BeStride_ActionButtonGroundMount:PreClick()
if BeStride_Logic:IsCombat() then
return
end
local mount = BeStride_Logic:GroundMountButton()
if mount ~= nil then
self:SetAttribute("macrotext",mount)
end
end

-- Action Button Cleanup
function BeStride_ActionButtonGroundMount:PostClick()
if BeStride_Logic:IsCombat() then
return
end

BeStride_ABRegularMount:SetAttribute("macrotext", nil)
end


-- +-------------+ --
-- Passenger Mount --
-- +-------------+ --

-- Action Button Wrapper
function BeStride_ActionButtonPassengerMount:PreClick()
if BeStride_Logic:IsCombat() then
return
end

local mount = BeStride_Logic:PassengerMountButton()
if mount ~= nil then
self:SetAttribute("macrotext",mount)
end
end

-- Action Button Cleanup
function BeStride_ActionButtonPassengerMount:PostClick()
if BeStride_Logic:IsCombat() then
return
end

BeStride_ABRegularMount:SetAttribute("macrotext", nil)
end


-- +----------+ --
-- Repair Mount --
-- +----------+ --

-- Action Button Wrapper
function BeStride_ActionButtonRepairMount:PreClick()
if BeStride_Logic:IsCombat() then
return
end

local mount = BeStride_Logic:RepairMountButton()
if mount ~= nil then
self:SetAttribute("macrotext",mount)
end
end

-- Action Button Cleanup
function BeStride_ActionButtonRepairMount:PostClick()
if BeStride_Logic:IsCombat() then
return
end

BeStride_ABRegularMount:SetAttribute("macrotext", nil)
end
Loading

0 comments on commit c04adf6

Please sign in to comment.