Skip to content

Commit

Permalink
Clean Up Events
Browse files Browse the repository at this point in the history
  • Loading branch information
DanSheps committed Oct 22, 2018
1 parent 9a40650 commit 0e87f09
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 31 deletions.
31 changes: 5 additions & 26 deletions BeStride.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ end
function BeStride:OnEnable()
BeStride:buildMountTables()

self:RegisterEvent("UPDATE_BINDINGS", "UpdateBindings")
self:RegisterEvent("NEW_MOUNT_ADDED", "NewMount")
--BeStride:RegisterEvent("UPDATE_BINDINGS", "EventUpdateKeyBinding")
BeStride:RegisterEvent("NEW_MOUNT_ADDED", "EventNewMount")

BeStride:RegisterEvent("PLAYER_REGEN_DISABLED", "CombatEnter")
BeStride:RegisterEvent("PLAYER_REGEN_ENABLED", "CombatExit")
BeStride:RegisterEvent("PLAYER_REGEN_DISABLED", "EventCombatEnter")
BeStride:RegisterEvent("PLAYER_REGEN_ENABLED", "EventCombatExit")

BeStride:UpdateBindings()
--BeStride:UpdateBindings()
BeStride:Upgrade()
end

Expand All @@ -186,27 +186,6 @@ function BeStride:NewMount(...)
table.foreach(args,function (k,v) print("Arg: " .. k) end)
end

function BeStride:CombatEnter()
--BeStride_Debug:Verbose("Entering Combat")
local combatButton = BeStride_Logic:Combat()

if combatButton ~= nil then
--BeStride_Debug:Verbose("Mount: " .. combatButton)
BeStride_ABRegularMount:SetAttribute("macrotext",combatButton)
BeStride_ABGroundMount:SetAttribute("macrotext",combatButton)
BeStride_ABPassengerMount:SetAttribute("macrotext",combatButton)
BeStride_ABRepairMount:SetAttribute("macrotext",combatButton)
end
end

function BeStride:CombatExit()
--BeStride_Debug:Verbose("Exiting Combat")
BeStride_ABRegularMount:SetAttribute("macrotext",nil)
BeStride_ABGroundMount:SetAttribute("macrotext",nil)
BeStride_ABPassengerMount:SetAttribute("macrotext",nil)
BeStride_ABRepairMount:SetAttribute("macrotext",nil)
end

function BeStride:UpdateBindings()
BeStride_Debug:Verbose("Firing Update Bindings")
BeStride:SetKeyBindings(self.buttons["regular"])
Expand Down
26 changes: 25 additions & 1 deletion BeStride_Events.lua
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
function BeStride_Event:NewMount(arg1, arg2)
function BeStride:EventNewMount(arg1, arg2)
BeStride:AddNewMount(arg2)
--BeStride:GUIHandleNewCompanion(arg2)
end

function BeStride:EventUpdateKeyBinding()
end

function BeStride:EventCombatEnter()
--BeStride_Debug:Verbose("Entering Combat")
local combatButton = BeStride_Logic:Combat()

if combatButton ~= nil then
--BeStride_Debug:Verbose("Mount: " .. combatButton)
BeStride_ABRegularMount:SetAttribute("macrotext",combatButton)
BeStride_ABGroundMount:SetAttribute("macrotext",combatButton)
BeStride_ABPassengerMount:SetAttribute("macrotext",combatButton)
BeStride_ABRepairMount:SetAttribute("macrotext",combatButton)
end
end

function BeStride:EventCombatExit()
--BeStride_Debug:Verbose("Exiting Combat")
BeStride_ABRegularMount:SetAttribute("macrotext",nil)
BeStride_ABGroundMount:SetAttribute("macrotext",nil)
BeStride_ABPassengerMount:SetAttribute("macrotext",nil)
BeStride_ABRepairMount:SetAttribute("macrotext",nil)
end
8 changes: 4 additions & 4 deletions localization/en-US.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
_G["BINDING_HEADER_BESTRIDE_TITLE"] = "BeStride"
_G["BINDING_NAME_BeStride_ABRegularMount"] = "Mount Button"
_G["BINDING_NAME_BeStride_ABGroundMount"] = "Force Ground Mount Button"
_G["BINDING_NAME_BeStride_ABRepairMount"] = "Force Repair Mount Button"
_G["BINDING_NAME_BeStride_ABPassengerMount"] = "Force Passenger Mount Button"
_G["BINDING_NAME_CLICK BeStride_ABRegularMount:LeftButton"] = "Mount Button"
_G["BINDING_NAME_CLICK BeStride_ABGroundMount:LeftButton"] = "Force Ground Mount Button"
_G["BINDING_NAME_CLICK BeStride_ABRepairMount:LeftButton"] = "Force Repair Mount Button"
_G["BINDING_NAME_CLICK BeStride_ABPassengerMount:LeftButton"] = "Force Passenger Mount Button"

BeStride_Locale = {
Zone = {
Expand Down

0 comments on commit 0e87f09

Please sign in to comment.