Skip to content

Commit

Permalink
add default command button on first launch
Browse files Browse the repository at this point in the history
  • Loading branch information
Neogeekmo committed Aug 30, 2024
1 parent d067cd7 commit 0068f12
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Commands.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function AprRC.command:SlashCmd(input)
print("|cffeda55f/aprrc export |r- " .. "To export data")
print("|cffeda55f/aprrc faction |r- " .. "Faction")
print("|cffeda55f/aprrc fillers, filler |r- " .. "Fillers")
print("|cffeda55f/aprrc forcereset, fr |r- " .. "Clear the Saved Variables")
print("|cffeda55f/aprrc forcereset |r- " .. "Clear the Saved Variables")
print("|cffeda55f/aprrc gender |r- " .. "Gender")
print("|cffeda55f/aprrc grind |r- " .. "Grind")
print("|cffeda55f/aprrc help, h |r- " .. L_APR["HELP_COMMAND"])
Expand Down
1 change: 0 additions & 1 deletion Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ function AprRC:OnInitialize()
AprRCData.QuestLookup = AprRCData.QuestLookup or {}
AprRCData.TaxiLookup = AprRCData.TaxiLookup or {}
AprRCData.BeforePortal = AprRCData.BeforePortal or {}
AprRCData.CommandBarCommands = AprRCData.CommandBarCommands or {}

-- Init module
AprRC.settings:InitializeBlizOptions()
Expand Down
14 changes: 13 additions & 1 deletion frames/CommandsBar.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,17 @@ AprRC.CommandBar.btnList = {}
local FRAME_WIDTH = 80
local FRAME_HEIGHT = 35

local defaultCommands = {
{ command = "waypoint", label = "Waypoint", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\Waypoint" },
{ command = "coord", label = "Coord", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\Coord" },
{ command = "range", label = "Range", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\Range" },
{ command = "noarrow", label = "NoArrow", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\NoArrow" },
{ command = "text", label = "ExtraLineText", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\ExtraLineText" },
{ command = "btn", label = "Button", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\Button" },
{ command = "filler", label = "Fillers", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\Fillers" },
{ command = "qpartpart", label = "QpartPart", texture = "Interface\\AddOns\\APR-Recorder\\assets\\icons\\QpartPart" },
}

---------------------------------------------------------------------------------------
--------------------------------- CommandBar Frames -----------------------------------
---------------------------------------------------------------------------------------
Expand Down Expand Up @@ -45,6 +56,7 @@ function AprRC.CommandBar:UpdateFrame()
end
AprRC.CommandBar.btnList = {}

AprRCData.CommandBarCommands = AprRCData.CommandBarCommands or defaultCommands
for _, commandData in ipairs(AprRCData.CommandBarCommands) do
local btn = CreateButton(CommandBarFrame, commandData.texture, commandData.label, function()
AprRC.command:SlashCmd(commandData.command)
Expand All @@ -70,7 +82,7 @@ function AprRC.CommandBar:UpdateFrame()

-- Create settings button
local settingsBtn = CreateButton(CommandBarFrame, "Interface\\AddOns\\APR-Recorder\\assets\\icons\\settings",
"Settings", function()
"Commands Settings", function()
AprRC.CommandBarSetting:Show()
end)

Expand Down
2 changes: 2 additions & 0 deletions helper/RouteManagement.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
function AprRC:ResetData()
AprRC.settings.profile.recordBarFrame.isRecording = false
AprRCData = {}
AprRCData.CurrentRoute = { name = "", steps = { {} } }
AprRCData.Routes = {}
C_UI.Reload()
end

function AprRC:InitRoute(name)
Expand Down

0 comments on commit 0068f12

Please sign in to comment.