Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changelog v4.5.4 #355

Merged
merged 3 commits into from
Oct 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions APR-Core/ChangeLog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ end

function APR.changelog:SetChangeLog()
local news = {
{ "v4.5.4", "2024-10-29" },
"#Bugs",
"- Fixed starting route assign function causing lua error",
"- Changed 'ZoneDoneSave' to 'RouteCompleted'",

{ "v4.5.3", "2024-10-29" },
"#Features",
"- Added new starting route for other Dracthyr classes",
Expand Down
2 changes: 1 addition & 1 deletion APR-Core/QuestHandler.lua
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ function APR:UpdateStep()
APR:UpdateQuestAndStep()
end)
end
if (step.ZoneDoneSave) then
if (step.RouteCompleted) then
local index, currentRouteName = next(APRCustomPath[APR.PlayerID])

-- Force reset heirloom to show heirloom taximap (not avalaible in exile reach)
Expand Down
2 changes: 1 addition & 1 deletion APR-Core/QuestOrderList.lua
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ function APR.questOrderList:AddStepFromRoute(forceRendering)
AddStepFrame(stepIndex, L["GRIND"] .. " " .. step.Grind, color)
elseif (step.GossipOptionIDs or step.GossipOptionID) and step.NPCIDs then
AddStepFrame(stepIndex, L["TALK_NPC"], "gray")
elseif step.ZoneDoneSave then
elseif step.RouteCompleted then
AddStepFrame(stepIndex, L["ROUTE_COMPLETED"], "gray")
end
stepIndex = stepIndex + 1
Expand Down
2 changes: 1 addition & 1 deletion APR-Core/StatusReport.lua
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function APR:getStatusReportInfos()
charName = { "Name", APR.Username },
charRealm = { "Realm", GetRealmName() },
charLevel = { "Level", APR.Level },
charClass = { "Class", APR.ClassName }
charClass = { "Class", APR:titleCase(APR.ClassName) }
}

return infoTable
Expand Down
35 changes: 16 additions & 19 deletions APR-Core/database/AllianceRoutes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -152,27 +152,24 @@ if (APR.Faction == "Alliance") then

-- WARNING Class before race
---
local function applyStartingRoute()
local route
if APR.ClassId == APR.Classes["Demon Hunter"] then
route = startRoutes["Demon Hunter"]
elseif APR.ClassId == APR.Classes["Death Knight"] then
-- Use allied start if race ID is >= 23; otherwise, default Death Knight start
route = APR.RaceID >= 23 and startRoutes["Death Knight"].allied or startRoutes["Death Knight"].default
elseif APR.Race == "Dracthyr" then
-- Check for Dracthyr Evoker-specific start, else use general Dracthyr start
route = APR.ClassId == APR.Classes.Evoker and startRoutes.Dracthyr.evoker or
startRoutes.Dracthyr.default
else
route = startRoutes[APR.Race]
end
if route then
assignRoute(route.expansion, route.key, route.label)
end

local route
if APR.ClassId == APR.Classes["Demon Hunter"] then
route = startRoutes["Demon Hunter"]
elseif APR.ClassId == APR.Classes["Death Knight"] then
-- Use allied start if race ID is >= 23; otherwise, default Death Knight start
route = APR.RaceID >= 23 and startRoutes["Death Knight"].allied or startRoutes["Death Knight"].default
elseif APR.Race == "Dracthyr" then
-- Check for Dracthyr Evoker-specific start, else use general Dracthyr start
route = APR.ClassId == APR.Classes.Evoker and startRoutes.Dracthyr.evoker or
startRoutes.Dracthyr.default
else
route = startRoutes[APR.Race]
end
if route and route.expansion and route.key and route.label then
assignRoute(route.expansion, route.key, route.label)
end

-- Apply starting route based on class and race
applyStartingRoute()

-- Lumbermill Wod route
-- Special case for Warlords of Draenor route based on quest completion
Expand Down
57 changes: 27 additions & 30 deletions APR-Core/database/HordeRoutes.lua
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ if (APR.Faction == "Horde") then

-- Starting Route or custom
---
local function assignRoute(expansion, key, label)
APR.RouteList[expansion][key] = label
end

local startRoutes = {
Orc = { expansion = "Vanilla", key = "1-ValleyOfTrialsOrc", label = "Orc Start" },
Scourge = { expansion = "Vanilla", key = "465-TirisfalGladesUndead", label = "Undead Start" },
Expand Down Expand Up @@ -139,36 +135,37 @@ if (APR.Faction == "Horde") then
EarthenDwarf = { expansion = "TheWarWithin", key = "2248-TWW-Earthen", label = "Earthen Dwarf Start" }
}


local function assignRoute(expansion, key, label)
APR.RouteList[expansion][key] = label
end

-- WARNING Class before race
---
local function applyStartingRoute()
local route
if APR.ClassId == APR.Classes["Demon Hunter"] then
route = startRoutes["Demon Hunter"]
elseif APR.ClassId == APR.Classes["Death Knight"] then
-- Use allied start if race ID is >= 23; otherwise, default Death Knight start
route = APR.RaceID >= 23 and startRoutes["Death Knight"].allied or startRoutes["Death Knight"].default
elseif APR.Race == "Dracthyr" then
-- Check for Dracthyr Evoker-specific start, else use general Dracthyr start
route = APR.ClassId == APR.Classes.Evoker and startRoutes.Dracthyr.evoker or
startRoutes.Dracthyr.default
elseif APR.Race == "Goblin" then
local gob = startRoutes.Goblin
assignRoute(gob.main.expansion, gob.main.key, gob.main.label)
route = gob.secondary
elseif APR.Race == "Troll" and startRoutes.Troll[APR.ClassId] then
local trollRoute = startRoutes.Troll[APR.ClassId]
assignRoute(trollRoute.expansion, trollRoute.key, trollRoute.label)
else
route = startRoutes[APR.Race]
end
if route then
assignRoute(route.expansion, route.key, route.label)
end
local route
if APR.ClassId == APR.Classes["Demon Hunter"] then
route = startRoutes["Demon Hunter"]
elseif APR.ClassId == APR.Classes["Death Knight"] then
-- Use allied start if race ID is >= 23; otherwise, default Death Knight start
route = APR.RaceID >= 23 and startRoutes["Death Knight"].allied or startRoutes["Death Knight"].default
elseif APR.Race == "Dracthyr" then
-- Check for Dracthyr Evoker-specific start, else use general Dracthyr start
route = APR.ClassId == APR.Classes.Evoker and startRoutes.Dracthyr.evoker or
startRoutes.Dracthyr.default
elseif APR.Race == "Goblin" then
local gob = startRoutes.Goblin
assignRoute(gob.main.expansion, gob.main.key, gob.main.label)
route = gob.secondary
elseif APR.Race == "Troll" and startRoutes.Troll[APR:titleCase(APR.ClassName)] then
local trollRoute = startRoutes.Troll[APR:titleCase(APR.ClassName)]
assignRoute(trollRoute.expansion, trollRoute.key, trollRoute.label)
else
route = startRoutes[APR.Race]
end
if route and route.expansion and route.key and route.label then
assignRoute(route.expansion, route.key, route.label)
end

-- Apply starting route based on class and race
applyStartingRoute()

-- Lumbermill Wod route
-- Special case for Warlords of Draenor route based on quest completion
Expand Down
2 changes: 1 addition & 1 deletion APR-Core/helpers/StepHelper.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function APR:GetStepString(step)
GetFP = L["GET_FLIGHTPATH"],
UseFlightPath = L["USE_FLIGHTPATH"],
WarMode = L["TURN_ON_WARMODE"],
ZoneDoneSave = L["ROUTE_COMPLETED"]
RouteCompleted = L["ROUTE_COMPLETED"]
}

for key, _ in pairs(step) do
Expand Down
6 changes: 6 additions & 0 deletions APR-Core/helpers/Utils.lua
Original file line number Diff line number Diff line change
Expand Up @@ -187,3 +187,9 @@ function APR:ExtractColorAndText(text)
return nil, text
end
end

function APR:titleCase(str)
return (str:gsub("(%a)([%w_']*)", function(first, rest)
return first:upper() .. rest:lower()
end))
end
14 changes: 7 additions & 7 deletions Routes/BattleForAzeroth/BattleForAzeroth_Alliance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ if APR.Faction == "Alliance" then
_index = 28,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 29,
},
}
Expand Down Expand Up @@ -4126,7 +4126,7 @@ if APR.Faction == "Alliance" then
_index = 652,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 653,
},
}
Expand Down Expand Up @@ -7009,7 +7009,7 @@ if APR.Faction == "Alliance" then
_index = 471,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 472,
},
}
Expand Down Expand Up @@ -10135,7 +10135,7 @@ if APR.Faction == "Alliance" then
_index = 492,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 493,
},
}
Expand Down Expand Up @@ -10181,7 +10181,7 @@ if APR.Faction == "Alliance" then
_index = 6,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 7,
},
}
Expand Down Expand Up @@ -10227,7 +10227,7 @@ if APR.Faction == "Alliance" then
_index = 6,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 7,
},
}
Expand Down Expand Up @@ -10301,7 +10301,7 @@ if APR.Faction == "Alliance" then
_index = 10,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 11,
},
}
Expand Down
16 changes: 8 additions & 8 deletions Routes/BattleForAzeroth/BattleForAzeroth_Horde.lua
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ if APR.Faction == "Horde" then
_index = 61,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 62,
},
}
Expand Down Expand Up @@ -4006,7 +4006,7 @@ if APR.Faction == "Horde" then
_index = 566,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 567,
},
}
Expand Down Expand Up @@ -6518,7 +6518,7 @@ if APR.Faction == "Horde" then
_index = 418,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 419,
},
}
Expand Down Expand Up @@ -6649,7 +6649,7 @@ if APR.Faction == "Horde" then
_index = 20,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 21,
},
}
Expand Down Expand Up @@ -8891,7 +8891,7 @@ if APR.Faction == "Horde" then
_index = 374,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 375,
},
}
Expand Down Expand Up @@ -8937,7 +8937,7 @@ if APR.Faction == "Horde" then
_index = 6,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 7,
},
}
Expand Down Expand Up @@ -9038,7 +9038,7 @@ if APR.Faction == "Horde" then
_index = 14,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 15,
},
}
Expand Down Expand Up @@ -9146,7 +9146,7 @@ if APR.Faction == "Horde" then
_index = 15,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 16,
},
}
Expand Down
2 changes: 1 addition & 1 deletion Routes/Cataclysm/Cataclysm_Alliance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ if (APR.Faction == "Alliance") then
_index = 211,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 212,
},
}
Expand Down
4 changes: 2 additions & 2 deletions Routes/Cataclysm/Cataclysm_Horde.lua
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ if (APR.Faction == "Horde") then
_index = 86,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 87,
},
}
Expand Down Expand Up @@ -1627,7 +1627,7 @@ if (APR.Faction == "Horde") then
_index = 199,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 200,
},
}
Expand Down
10 changes: 5 additions & 5 deletions Routes/Dragonflight/Dragonflight.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1616,7 +1616,7 @@ APR.RouteQuestStepList["2022-DF03N-WakingShores"] = {
_index = 251,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 252,
},
}
Expand Down Expand Up @@ -3410,7 +3410,7 @@ APR.RouteQuestStepList["2023-DF04-OhnahranPlains"] = {
_index = 293,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 294,
},
}
Expand Down Expand Up @@ -5550,7 +5550,7 @@ APR.RouteQuestStepList["2024-DF05-AzureSpan"] = {
_index = 358,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 359,
},
}
Expand Down Expand Up @@ -6647,7 +6647,7 @@ APR.RouteQuestStepList["2118-DracthyrStart-Evo"] = {
_index = 161,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 162,
},
}
Expand Down Expand Up @@ -6685,7 +6685,7 @@ APR.RouteQuestStepList["2118-DracthyrStart-Other"] = {
_index = 4,
},
{
ZoneDoneSave = 1,
RouteCompleted = 1,
_index = 5,
},
}
Loading