Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
e6e88f5
[ISSUE-9451] Loadout Management
FenikSRT4 Mar 15, 2026
829d956
[ISSUE-9451] Loadout Management
FenikSRT4 Mar 16, 2026
877ee6b
[ISSUE-9451] Loadout Managment
FenikSRT4 Mar 17, 2026
d0236a2
[ISSUE-9541] Loadout Management
FenikSRT4 Mar 18, 2026
ff4ec93
[ISSUE-9451] Loadout Management
FenikSRT4 Mar 19, 2026
96b1a76
[ISSUE-9451] Loadout Management
FenikSRT4 Mar 19, 2026
12ea119
[ISSUE-9451] Loadout Management
FenikSRT4 Mar 29, 2026
73c2985
[ISSUE-9451] Loadout Management
FenikSRT4 Mar 29, 2026
50cfedd
Merge branch 'dev' into issue-9451-loadout-management
FenikSRT4 Mar 29, 2026
7f8b8ed
[ISSUE-9451] Loadout Management
FenikSRT4 Mar 30, 2026
03964c6
[ISSUE-8451] Loadout Managment
FenikSRT4 Apr 1, 2026
c0b199f
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 4, 2026
7845daf
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 4, 2026
d72fb79
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 4, 2026
565fb82
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 4, 2026
e1e48d9
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 4, 2026
1d80e0a
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 4, 2026
01df330
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 5, 2026
423e503
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 9, 2026
2b373f4
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 9, 2026
a243930
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 10, 2026
7b13b85
Merge branch 'dev' into issue-9451-loadout-management
FenikSRT4 Apr 10, 2026
ab92f8c
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 10, 2026
fa4ad22
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 14, 2026
2c2bfdd
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 15, 2026
98c1e9b
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 19, 2026
86d5b1e
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 22, 2026
59e00b1
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 22, 2026
80ff35f
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 22, 2026
43b97ef
[ISSUE-9451] Loadout Management
FenikSRT4 Apr 27, 2026
1d49486
[ISSUE-9451] Loadout Management
FenikSRT4 May 9, 2026
4a267e7
[ISSUE-9451] Loadout Management
FenikSRT4 May 10, 2026
404fb22
[ISSUE-9451] Loadout Management
FenikSRT4 May 10, 2026
49e4710
[ISSUE-9451] Loadout Management
FenikSRT4 May 11, 2026
bb852e1
[ISSUE-9451] Loadout Management
FenikSRT4 May 12, 2026
0a84cff
[ISSUE-9451] Loadout Management
FenikSRT4 May 12, 2026
bc602b6
[ISSUE-9451] Loadout Management
FenikSRT4 May 12, 2026
ca30b11
[ISSUE-9451] Loadout Management
FenikSRT4 May 13, 2026
ad59318
Merge branch 'dev' into issue-9451-loadout-management
FenikSRT4 May 13, 2026
b6bd06c
[ISSUE-9451] Loadout Management
FenikSRT4 May 14, 2026
f3ffc87
[ISSUE-9451] Loadout Management
FenikSRT4 May 15, 2026
08ba01e
[ISSUE-9451] Loadout Management
FenikSRT4 May 15, 2026
bf53fd4
[ISSUE-9451] Loadout Management
FenikSRT4 May 20, 2026
273ef92
[ISSUE-9451] Loadout Management
FenikSRT4 May 28, 2026
3c8bcc7
[ISSUE-9451] Loadout Management
FenikSRT4 May 28, 2026
0b20cd8
[ISSUE-9451] Loadout Management
FenikSRT4 May 28, 2026
4260e40
[ISSUE-9451] Loadout Management
FenikSRT4 May 28, 2026
7b52c87
Merge branch 'dev' into issue-9451-loadout-management
FenikSRT4 May 28, 2026
58bb928
[ISSUE-9451] Loadout Management
FenikSRT4 Jun 1, 2026
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
138 changes: 138 additions & 0 deletions spec/System/TestLoadouts_spec.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
describe("TestLoadouts", function()
before_each(function()
newBuild()

build.itemsTab:CreateDisplayItemFromRaw([[Dialla's Malefaction
Sage's Robe
Energy Shield: 95
EnergyShieldBasePercentile: 0
Variant: Pre 3.19.0
Variant: Current
Selected Variant: 2
Sage's Robe
Quality: 20
Sockets: R-G-B-B-B-B
LevelReq: 37
Implicits: 0
Gems can be Socketed in this Item ignoring Socket Colour
{variant:1}Gems Socketed in Red Sockets have +1 to Level
{variant:2}Gems Socketed in Red Sockets have +2 to Level
{variant:1}Gems Socketed in Green Sockets have +10% to Quality
{variant:2}Gems Socketed in Green Sockets have +30% to Quality
{variant:1}Gems Socketed in Blue Sockets gain 25% increased Experience
{variant:2}Gems Socketed in Blue Sockets gain 100% increased Experience
Has no Attribute Requirements]])
Comment thread
FenikSRT4 marked this conversation as resolved.
Outdated
build.itemsTab:AddDisplayItem()
runCallback("OnFrame")
end)

teardown(function()
-- newBuild() takes care of resetting everything in setup()
end)

local function getSelectedLoadout(treeId, itemIndex, itemId, skillIndex, skillId, configIndex, configId)
local selectedLoadout = {
treeId = treeId,
itemIndex = itemIndex,
itemId = itemId,
skillIndex = skillIndex,
skillId = skillId,
configIndex = configIndex,
configId = configId,
}
return selectedLoadout
end

describe("NewLoadout", function()
it("Creates a new loadout with the correct name", function()
build:NewLoadout("Loadout Name", function() end)
build:SyncLoadouts()
-- There are 5 static items in the list
assert.are.equals(7, #build.controls.buildLoadouts.list)
end)

it("calls the callback function", function()
local callbackCalled = false
build:NewLoadout("Loadout Name", function() callbackCalled = true end)
build:SyncLoadouts()
-- There are 5 static items in the list
assert.are.equals(7, #build.controls.buildLoadouts.list)
assert.are.equals(true, callbackCalled)
end)
end)

describe("CopyLoadout", function()
it("Copies a loadout with a new name", function()
local loadoutName = "Loadout Name"
local newSpec, newItemSet, newSkillSet, newConfigSet = build:CopyLoadout(1, 1, 1, 1, loadoutName)
build:SyncLoadouts()
-- There are 5 static items in the list
assert.are.equals(7, #build.controls.buildLoadouts.list)
-- First index is the "Loadout: " header, second index is the start of the loadouts
assert.is_not.same(build.controls.buildLoadouts.list[2], build.controls.buildLoadouts.list[3])
assert.are.equals(loadoutName, build.controls.buildLoadouts.list[3])
assert.is_not.same(newSpec, build.spec)
assert.is_not.same(newItemSet, build.itemsTab.itemSets[1])
assert.is_not.same(newSkillSet, build.skillsTab.skillSets[1])
assert.is_not.same(newConfigSet, build.configTab.configSets[1])
assert.is_same(loadoutName, newSpec.title)
assert.is_same(loadoutName, newItemSet.title)
assert.is_same(loadoutName, newSkillSet.title)
assert.is_same(loadoutName, newConfigSet.title)
end)
end)

describe("DeleteLoadout", function()
it("Deletes a loadout and sets the next to the requested loadout by name", function()
local loadoutNameToDelete = "Delete Me"
build:NewLoadout(loadoutNameToDelete, function() end)
build:SyncLoadouts()
-- There are 5 static items in the list
assert.are.equals(7, #build.controls.buildLoadouts.list)
local loadoutToDelete = build:GetLoadoutByName(loadoutNameToDelete)
local nextLoadout = build.controls.buildLoadouts.list[2] -- Default loadout

build:DeleteLoadout(loadoutNameToDelete, nextLoadout)
build:SyncLoadouts()

assert.is_nil(build.treeTab.specList[loadoutToDelete.specId])
assert.is_nil(build.skillsTab.skillSets[loadoutToDelete.skillSetId])
assert.is_nil(build.itemsTab.itemSets[loadoutToDelete.itemSetId])
assert.is_nil(build.configTab.configSets[loadoutToDelete.configSetId])

assert.is_nil(build.itemsTab.itemSetOrderList[loadoutToDelete.itemSetId])
assert.is_nil(build.skillsTab.skillSetOrderList[loadoutToDelete.skillSetId])
assert.is_nil(build.configTab.configSetOrderList[loadoutToDelete.configSetId])

assert.is_same(nextLoadout.specId, build.treeTab.displaySpecId)
assert.is_same(nextLoadout.itemSetId, build.itemsTab.displayItemSetId)
assert.is_same(nextLoadout.skillSetId, build.skillsTab.displaySkillSetId)
assert.is_same(nextLoadout.configSetId, build.configTab.displayConfigSetId)
end)
end)

describe("RenameLoadout", function()
it("renames a loadout and calls the callback", function()
local oldName = "Old Loadout"
local newName = "New Loadout"
local callbackCalled = false
build:NewLoadout(oldName, function() end)
build:SyncLoadouts()

build:RenameLoadout(oldName, newName, function() callbackCalled = true end)
build:SyncLoadouts()
-- Verify the new name appears in the loadout list
assert.is_same(newName, build.controls.buildLoadouts.list[3])
-- Verify titles updated on spec, itemSet, skillSet, and configSet
local loadout = build:GetLoadoutByName(newName)
assert.is_same(newName, build.treeTab.specList[loadout.specId].title)
assert.is_same(newName, build.itemsTab.itemSets[loadout.itemSetId].title)
assert.is_same(newName, build.skillsTab.skillSets[loadout.skillSetId].title)
assert.is_same(newName, build.configTab.configSets[loadout.configSetId].title)
-- Ensure callback was called
assert.is_true(callbackCalled)
-- Old name should no longer exist
assert.is_nil(build:GetLoadoutByName(oldName))
end)
end)
end)
4 changes: 4 additions & 0 deletions src/Modules/Build.lua
Original file line number Diff line number Diff line change
Expand Up @@ -891,6 +891,10 @@ function buildMode:GetLoadoutByName(loadoutName)
local configId = oneConfig and 1 or
findSetId(self.configTab.configSetOrderList, loadoutName, self.configTab.configSets, self.configListSpecialLinks)

if not specId and not itemId and not skillId and not configId then
return nil
end

return {
specId = specId,
itemSetId = itemId,
Expand Down