From a2fc2880ce6802ed89f8739132c3b5a79bd7aa18 Mon Sep 17 00:00:00 2001 From: Aldric Ducreux Date: Fri, 6 Sep 2024 12:47:23 +0200 Subject: [PATCH] Add backup saved variable for current route --- Commands.lua | 6 ++++++ Core.lua | 1 + frames/exportRoute.lua | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/Commands.lua b/Commands.lua index 0338fcf..3075d6a 100644 --- a/Commands.lua +++ b/Commands.lua @@ -30,6 +30,12 @@ function AprRC.command:SlashCmd(input) APR.settings.profile.coordinateShow = not APR.settings.profile.coordinateShow AprRC.coordinate:RefreshFrameAnchor() return + elseif inputText == 'backup' then + AprRCData.CurrentRoute.steps = {} + for k, v in pairs(AprRCData.BackupRoute) do + AprRCData.CurrentRoute.steps[k] = v + end + return elseif inputText == "help" or inputText == "h" then print(L_APR["COMMAND_LIST"] .. ":") print("|cffeda55f/aprrc achievement |r- " .. "HasAchievement") diff --git a/Core.lua b/Core.lua index 3c3a4e4..19feef1 100644 --- a/Core.lua +++ b/Core.lua @@ -35,6 +35,7 @@ function AprRC:OnInitialize() AprRCData.QuestLookup = AprRCData.QuestLookup or {} AprRCData.TaxiLookup = AprRCData.TaxiLookup or {} AprRCData.BeforePortal = AprRCData.BeforePortal or {} + AprRCData.BackupRoute = AprRCData.BackupRoute or {} -- Init module AprRC.settings:InitializeBlizOptions() diff --git a/frames/exportRoute.lua b/frames/exportRoute.lua index 56aa5cb..00497b8 100644 --- a/frames/exportRoute.lua +++ b/frames/exportRoute.lua @@ -114,6 +114,10 @@ function AprRC.export:Show() if AprRCData.CurrentRoute.name == selectedRouteName then AprRCData.CurrentRoute = newRoute end + AprRCData.BackupRoute = { } + for k, v in pairs(newStepRouteTable) do + AprRCData.BackupRoute[k] = v + end AutoScrollToBottom() end) frame:AddChild(btnSave)