-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[ISSUE-9451] Loadout Management #9647
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
Open
FenikSRT4
wants to merge
49
commits into
PathOfBuildingCommunity:dev
Choose a base branch
from
FenikSRT4:issue-9451-loadout-management
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
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 829d956
[ISSUE-9451] Loadout Management
FenikSRT4 877ee6b
[ISSUE-9451] Loadout Managment
FenikSRT4 d0236a2
[ISSUE-9541] Loadout Management
FenikSRT4 ff4ec93
[ISSUE-9451] Loadout Management
FenikSRT4 96b1a76
[ISSUE-9451] Loadout Management
FenikSRT4 12ea119
[ISSUE-9451] Loadout Management
FenikSRT4 73c2985
[ISSUE-9451] Loadout Management
FenikSRT4 50cfedd
Merge branch 'dev' into issue-9451-loadout-management
FenikSRT4 7f8b8ed
[ISSUE-9451] Loadout Management
FenikSRT4 03964c6
[ISSUE-8451] Loadout Managment
FenikSRT4 c0b199f
[ISSUE-9451] Loadout Management
FenikSRT4 7845daf
[ISSUE-9451] Loadout Management
FenikSRT4 d72fb79
[ISSUE-9451] Loadout Management
FenikSRT4 565fb82
[ISSUE-9451] Loadout Management
FenikSRT4 e1e48d9
[ISSUE-9451] Loadout Management
FenikSRT4 1d80e0a
[ISSUE-9451] Loadout Management
FenikSRT4 01df330
[ISSUE-9451] Loadout Management
FenikSRT4 423e503
[ISSUE-9451] Loadout Management
FenikSRT4 2b373f4
[ISSUE-9451] Loadout Management
FenikSRT4 a243930
[ISSUE-9451] Loadout Management
FenikSRT4 7b13b85
Merge branch 'dev' into issue-9451-loadout-management
FenikSRT4 ab92f8c
[ISSUE-9451] Loadout Management
FenikSRT4 fa4ad22
[ISSUE-9451] Loadout Management
FenikSRT4 2c2bfdd
[ISSUE-9451] Loadout Management
FenikSRT4 98c1e9b
[ISSUE-9451] Loadout Management
FenikSRT4 86d5b1e
[ISSUE-9451] Loadout Management
FenikSRT4 59e00b1
[ISSUE-9451] Loadout Management
FenikSRT4 80ff35f
[ISSUE-9451] Loadout Management
FenikSRT4 43b97ef
[ISSUE-9451] Loadout Management
FenikSRT4 1d49486
[ISSUE-9451] Loadout Management
FenikSRT4 4a267e7
[ISSUE-9451] Loadout Management
FenikSRT4 404fb22
[ISSUE-9451] Loadout Management
FenikSRT4 49e4710
[ISSUE-9451] Loadout Management
FenikSRT4 bb852e1
[ISSUE-9451] Loadout Management
FenikSRT4 0a84cff
[ISSUE-9451] Loadout Management
FenikSRT4 bc602b6
[ISSUE-9451] Loadout Management
FenikSRT4 ca30b11
[ISSUE-9451] Loadout Management
FenikSRT4 ad59318
Merge branch 'dev' into issue-9451-loadout-management
FenikSRT4 b6bd06c
[ISSUE-9451] Loadout Management
FenikSRT4 f3ffc87
[ISSUE-9451] Loadout Management
FenikSRT4 08ba01e
[ISSUE-9451] Loadout Management
FenikSRT4 bf53fd4
[ISSUE-9451] Loadout Management
FenikSRT4 273ef92
[ISSUE-9451] Loadout Management
FenikSRT4 3c8bcc7
[ISSUE-9451] Loadout Management
FenikSRT4 0b20cd8
[ISSUE-9451] Loadout Management
FenikSRT4 4260e40
[ISSUE-9451] Loadout Management
FenikSRT4 7b52c87
Merge branch 'dev' into issue-9451-loadout-management
FenikSRT4 58bb928
[ISSUE-9451] Loadout Management
FenikSRT4 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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]]) | ||
| 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) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.