Skip to content

Commit

Permalink
Merge pull request #47 from Azeroth-Pilot-Reloaded/TWW
Browse files Browse the repository at this point in the history
TWW BETA
  • Loading branch information
Neogeekmo authored Jul 19, 2024
2 parents 98bcf3b + 6510b3b commit d01a2a8
Show file tree
Hide file tree
Showing 53 changed files with 1,221 additions and 597 deletions.
11 changes: 6 additions & 5 deletions APR-Recorder.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 100207
## X-Min-Interface: 100205
## Interface: 110002
## X-Min-Interface: 110000

## Title: Azeroth Pilot Reloaded - [|cffeda55fRoute Recorder|r]
## Notes: A route recorder for Azeroth Pilot Reloaded
Expand All @@ -16,7 +16,7 @@
## X-Discord: https://discord.gg/YgcdybKdWX
## X-Curse-Project-ID: 965240
## X-Wago-ID: rN4VYvKD
## X-WoWI-ID: ------
## X-WoWI-ID: 26704

libs/embeds.xml
locales/locales.xml
Expand All @@ -29,12 +29,13 @@ helper/RouteManagement.lua
Commands.lua
Event.lua

frames/autocompleteLocales.lua
frames/autocomplete.lua
frames/CommandsBar.lua
frames/CommandsBarSetting.lua
frames/exportExtraLineText.lua
frames/exportRoute.lua
frames/fillersSelection.lua
frames/QuestionPopUp.lua
frames/QuestObjectiveSelector.lua
frames/RecorderBar.lua
frames/routeSelector.lua
frames/selectButton.lua
115 changes: 71 additions & 44 deletions Commands.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
local L = LibStub("AceLocale-3.0"):GetLocale("APR-Recorder")
local L_APR = LibStub("AceLocale-3.0"):GetLocale("APR")
local AceGUI = LibStub("AceGUI-3.0")

AprRC.command = AprRC:NewModule("Command")

Expand Down Expand Up @@ -125,72 +126,94 @@ function AprRC.command:SlashCmd(input)
print("|cff00bfffNoArrow|r Added")
return
elseif inputText == "text" or inputText == "txt" then
AprRC.autocomplete:Show()
AprRC.autocomplete:ShowLocaleAutoComplete()
return
elseif inputText == "button" or inputText == "btn" then
AprRC.SelectButton:Show()
return
elseif inputText == "fillers" or inputText == "filler" then
AprRC.fillers:Show()
AprRC.QuestObjectiveSelector:Show({
title = "Fillers quest list",
statusText = "Click on an objective to add it as a filler",
questList = AprRC.QuestObjectiveSelector:GetQuestList(),
onClick = function(questID, objectiveID)
local currentStep = AprRC:GetLastStep()
if not currentStep.Fillers then
currentStep.Fillers = {}
end
if not currentStep.Fillers[questID] then
currentStep.Fillers[questID] = {}
end
table.insert(currentStep.Fillers[questID], objectiveID)
print("|cff00bfffFillers - [" ..
C_QuestLog.GetTitleForQuestID(questID) .. "] - " .. objectiveID .. "|r Added")
end
})
return
elseif inputText == "spelltrigger" then
AprRC.questionDialog:CreateEditBoxPopupWithCallback("SpellTrigger (Spell ID)", function(text)
AprRC.autocomplete:ShowSpellAutoComplete(questID, objectiveID, function(_, spellID, frame)
local currentStep = AprRC:GetLastStep()
currentStep.SpellTrigger = tonumber(text, 10)
print("|cff00bfffSpellTrigger -" .. tonumber(text, 10) .. "|r Added")

currentStep.SpellTrigger = tonumber(spellID, 10)
print("|cff00bfff SpellTrigger |r Added")
AceGUI:Release(frame)
end)

return
elseif inputText == "pickupdb" then
if AprRC:HasStepOption("PickUp") then
AprRC.questionDialog:CreateEditBoxPopupWithCallback("PickUp DB (QuestID)", function(questId)
local currentStep = AprRC:GetLastStep()
if AprRC:HasStepOption("PickUpDB") then
tinsert(currentStep.PickUpDB, tonumber(questId, 10))
else
currentStep.PickUpDB = { tonumber(questId, 10) }
for _, qID in pairs(currentStep.PickUp) do
tinsert(currentStep.PickUpDB, qID)
AprRC.questionDialog:CreateEditBoxPopupWithCallback("PickUp DB (QuestID) - Also add PickUp QuestID",
function(questId)
local currentStep = AprRC:GetLastStep()
if AprRC:HasStepOption("PickUpDB") then
tinsert(currentStep.PickUpDB, tonumber(questId, 10))
else
currentStep.PickUpDB = { tonumber(questId, 10) }
for _, qID in pairs(currentStep.PickUp) do
tinsert(currentStep.PickUpDB, qID)
end
end
end
print("|cff00bfffPickUpDB - " .. tonumber(questId, 10) .. "|r Added")
end)
print("|cff00bfffPickUpDB - " .. tonumber(questId, 10) .. "|r Added")
end)
else
AprRC:Error('Missing PickUp option on current step')
end
return
elseif inputText == "qpartdb" then
if AprRC:HasStepOption("Qpart") then
AprRC.questionDialog:CreateEditBoxPopupWithCallback("Qpart DB (QuestID)", function(questId)
local currentStep = AprRC:GetLastStep()
if AprRC:HasStepOption("QpartDB") then
tinsert(currentStep.QpartDB, tonumber(questId, 10))
else
currentStep.QpartDB = { tonumber(questId, 10) }
AprRC.questionDialog:CreateEditBoxPopupWithCallback("Qpart DB (QuestID) - Also add Qpart QuestID",
function(questId)
local currentStep = AprRC:GetLastStep()
if AprRC:HasStepOption("QpartDB") then
tinsert(currentStep.QpartDB, tonumber(questId, 10))
else
currentStep.QpartDB = { tonumber(questId, 10) }

for qID, _ in pairs(currentStep.Qpart) do
tinsert(currentStep.QpartDB, qID)
for qID, _ in pairs(currentStep.Qpart) do
tinsert(currentStep.QpartDB, qID)
end
end
end
print("|cff00bfffQpartDB - " .. tonumber(questId, 10) .. "|r Added")
end)
print("|cff00bfffQpartDB - " .. tonumber(questId, 10) .. "|r Added")
end)
else
AprRC:Error('Missing Qpart option on current step')
end
return
elseif inputText == "donedb" then
if AprRC:HasStepOption("Done") then
AprRC.questionDialog:CreateEditBoxPopupWithCallback("Done DB (QuestID)", function(questId)
local currentStep = AprRC:GetLastStep()
if AprRC:HasStepOption("DoneDB") then
tinsert(currentStep.DoneDB, tonumber(questId, 10))
else
currentStep.DoneDB = { tonumber(questId, 10) }
for _, qID in pairs(currentStep.Done) do
tinsert(currentStep.DoneDB, qID)
AprRC.questionDialog:CreateEditBoxPopupWithCallback("Done DB (QuestID) - Also add Done QuestID",
function(questId)
local currentStep = AprRC:GetLastStep()
if AprRC:HasStepOption("DoneDB") then
tinsert(currentStep.DoneDB, tonumber(questId, 10))
else
currentStep.DoneDB = { tonumber(questId, 10) }
for _, qID in pairs(currentStep.Done) do
tinsert(currentStep.DoneDB, qID)
end
end
end
print("|cff00bfffDoneDB - " .. tonumber(questId, 10) .. "|r Added")
end)
print("|cff00bfffDoneDB - " .. tonumber(questId, 10) .. "|r Added")
end)
else
AprRC:Error('Missing Done option on current step')
end
Expand Down Expand Up @@ -225,17 +248,21 @@ function AprRC.command:SlashCmd(input)
print("|cff00bfffClass - " .. select(2, UnitClass("player")) .. "|r Added")
return
elseif inputText == "achievement" then
AprRC.questionDialog:CreateEditBoxPopupWithCallback("Has Achievement (ID)", function(text)
AprRC.autocomplete:ShowAchievementAutoComplete(function(name, achievementID, frame)
local currentStep = AprRC:GetLastStep()
currentStep.HasAchievement = tonumber(text, 10)
print("|cff00bfffHasAchievement - " .. tonumber(text, 10) .. "|r Added")
currentStep.HasAchievement = tonumber(achievementID, 10)
print("|cff00bfffHasAchievement - " .. name .. "|r Added")

AceGUI:Release(frame)
end)
return
elseif inputText == "noachievement" then
AprRC.questionDialog:CreateEditBoxPopupWithCallback("Dont Have Achievement (ID)", function(text)
AprRC.autocomplete:ShowAchievementAutoComplete(function(name, achievementID, frame)
local currentStep = AprRC:GetLastStep()
currentStep.DontHaveAchievement = tonumber(text, 10)
print("|cff00bfffDontHaveAchievement - " .. tonumber(text, 10) .. "|r Added")
currentStep.DontHaveAchievement = tonumber(achievementID, 10)
print("|cff00bfffDontHaveAchievement - " .. name .. "|r Added")

AceGUI:Release(frame)
end)
return
elseif inputText == "vehicle" then
Expand Down
72 changes: 53 additions & 19 deletions Config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ function AprRC.settings:InitializeSettings()
commandsBarFrame = {
rotation = "HORIZONTAL",
position = {},
isRecording = false,
},
commandBarSettingFrame = {},
--debug
minimap = { minimapPos = 285 },
enableMinimapButton = true,
Expand Down Expand Up @@ -120,31 +120,20 @@ function AprRC.settings:createBlizzOptions()
order = 2,
type = "header",
width = "full",
name = "Somthing :)",
name = "Settings",
},
somthing = {
icon = {
order = 3,
type = "group",
name = "What a group",
name = "Minimap",
inline = true,
args = {
enableAddon = {
order = 3.1,
type = "toggle",
name = L_APR["ENABLE_ADDON"],
width = "full",
get = GetProfileOption,
set = function(info, value)
SetProfileOption(info, value)
self:ToggleAddon()
end,
},
enableMinimapButton = {
name = L_APR["ENABLE_MINIMAP_BUTTON"],
desc = L_APR["ENABLE_MINIMAP_BUTTON_DESC"],
type = "toggle",
width = "full",
order = 9.20,
order = 3.1,
get = GetProfileOption,
set = function(info, value)
SetProfileOption(info, value)
Expand All @@ -155,8 +144,28 @@ function AprRC.settings:createBlizzOptions()
end
end
},

}
},
debug = {
order = 4,
type = "group",
name = "Debug",
inline = true,
args = {
enableAddon = {
order = 4.1,
type = "toggle",
name = L_APR["ENABLE_ADDON"],
width = "full",
get = GetProfileOption,
set = function(info, value)
SetProfileOption(info, value)
self:ToggleAddon()
end,
},
debug = {
order = 3.2,
order = 4.2,
type = "toggle",
name = L_APR["DEBUG"],
width = "full",
Expand All @@ -179,6 +188,9 @@ function AprRC.settings:createBlizzOptions()
-- add profile to bliz option
aceConfig:RegisterOptionsTable(AprRC.title .. "/Profile", _G.LibStub("AceDBOptions-3.0"):GetOptionsTable(SettingsDB))
aceDialog:AddToBlizOptions(AprRC.title .. "/Profile", L_APR["PROFILES"], AprRC.title)

local category, layout = Settings.RegisterCanvasLayoutCategory(AprRC, AprRC.title);
AprRC.settings.category = category
end

function AprRC.settings:CreateMiniMapButton()
Expand All @@ -192,7 +204,11 @@ function AprRC.settings:CreateMiniMapButton()
self.profile.enableAddon = not self.profile.enableAddon
self:ToggleAddon()
else
AprRC.settings:OpenSettings(AprRC.title)
if SettingsPanel:IsShown() then
self:CloseSettings()
else
self:OpenSettings(AprRC.title)
end
end
end,
OnTooltipShow = function(tooltip)
Expand All @@ -219,7 +235,11 @@ end

function AprRC.settings:OpenSettings(name)
if name == AprRC.title then
InterfaceOptionsFrame_OpenToCategory(AprRC.title)
if InterfaceOptionsFrame_OpenToCategory then
InterfaceOptionsFrame_OpenToCategory(AprRC.title)
else
Settings.OpenToCategory(self.category.ID)
end
AprRC.settings:OpenSettings(L_APR["PROFILES"])
end
if AprRC.Options then
Expand All @@ -244,6 +264,20 @@ function AprRC.settings:OpenSettings(name)
InterfaceOptionsFrame_OpenToCategory(AprRC.OptionsRoute)
end
return
else
Settings.OpenToCategory(self.category.ID)
end
end
end

function AprRC.settings:CloseSettings()
if AprRC.Options then
if SettingsPanel then
local category = SettingsPanel:GetCategoryList():GetCategory(AprRC.Options.name)
if category then
SettingsPanel:Hide()
end
return
end
end
end
3 changes: 3 additions & 0 deletions Core.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,12 @@ function AprRC:OnInitialize()
AprRCData.ExtraLineTexts = AprRCData.ExtraLineTexts or {}
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()
AprRC.CommandBar:OnInit()
AprRC.record:OnInit()
AprRC.event:MyRegisterEvent()
AprRC:saveQuestInfo()
Expand Down
Loading

0 comments on commit d01a2a8

Please sign in to comment.