-
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 #234 from TylerR909/feat/opie-integration
OPie Integration
- Loading branch information
Showing
4 changed files
with
60 additions
and
0 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
local name, addon = ... | ||
local f = CreateFrame("Frame"); | ||
local L = LibStub("AceLocale-3.0"):GetLocale("BeStride") | ||
|
||
-- Basedd off of Opie Rings\Default.lua file | ||
local function addBeStrideRingToOpie() | ||
local ringname = L["Bindings.Header"] | ||
if not (OPie and OPie.CustomRings) then return end | ||
local _, major = OPie.GetVersion() | ||
if not (major and major == 4) then return end | ||
|
||
local opieMountRing = { | ||
{ "macrotext", "/click BeStride_ABRegularMount", icon = "Interface/Icons/inv_misc_summerfest_brazierorange", | ||
fastClick = true }, | ||
} | ||
|
||
-- Passenger | ||
if next(BeStride:DBGet("mounts.passenger")) then tinsert(opieMountRing, | ||
{ "macrotext", "/click BeStride_ABPassengerMount", | ||
icon = BeStride:IsMainline() and "Interface/Icons/inv_misc_stonedragonorange" or | ||
"Interface/Icons/ability_mount_mammoth_black" }) | ||
end | ||
|
||
-- Ground Mount | ||
tinsert(opieMountRing, | ||
{ "macrotext", "/click BeStride_ABGroundMount", | ||
icon = BeStride:IsMainline() and "Interface/Icons/misc_arrowdown" or | ||
"Interface/Icons/ability_mount_dreadsteed" }) | ||
|
||
-- Repair | ||
if next(BeStride:DBGet("mounts.repair")) then tinsert(opieMountRing, | ||
{ "macrotext", "/click BeStride_ABRepairMount", icon = "Interface/Icons/trade_blacksmithing" }) | ||
end | ||
|
||
opieMountRing["name"] = ringname | ||
opieMountRing["hotkey"] = "SHIFT-SPACE" | ||
opieMountRing["u"] = "OPCBR" | ||
|
||
OPie.CustomRings:AddDefaultRing(ringname, opieMountRing) | ||
end | ||
|
||
local function awaitAddonThen(addonName, andThen) | ||
if (IsAddOnLoaded(addonName)) then | ||
andThen() | ||
else | ||
f:RegisterEvent("ADDON_LOADED"); | ||
f:SetScript("OnEvent", function(self, event, arg1) | ||
if (event ~= "ADDON_LOADED") then return end | ||
if (arg1 ~= addonName) then return end | ||
andThen() | ||
f:UnregisterEvent("ADDON_LOADED") | ||
end | ||
) | ||
end | ||
end | ||
|
||
awaitAddonThen("OPie", addBeStrideRingToOpie) |