Page MenuHomeWildfire Games

Fix mod list not enabling/disabling correct mod when applied filter
Needs ReviewPublic

Authored by Angen on Jun 1 2019, 10:28 PM.

Details

Reviewers
None
Group Reviewers
Restricted Owners Package(Owns No Changed Paths)
Summary

Currently when you apply filter in mod selection and tries to enable/disable some mod, you will not enable/disable the one you have selected (if you are lucky and the position of that mod is the same as not filtered you will but ... )

This patch is fixing this and assertion error when you have applied filter and you keep pressing down button and then enable mod.

Test Plan

Test that mods enable, disable as should

Diff Detail

Repository
rP 0 A.D. Public Repository
Branch
/ps/trunk
Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 7738
Build 12604: Vulcan BuildJenkins
Build 12603: arc lint + arc unit

Event Timeline

Angen created this revision.Jun 1 2019, 10:28 PM
Stan added a subscriber: Stan.Jun 1 2019, 10:32 PM
Stan added inline comments.
binaries/data/mods/mod/gui/modmod/modmod.js
218

Why do the selection after displaying the list ?

Angen added inline comments.Jun 1 2019, 10:35 PM
binaries/data/mods/mod/gui/modmod/modmod.js
218

displayModLists does filter action and sets what should be displayed so we need to do selection after we know what will be displayed to trigger event in cpp part

if we do this before, we can end up out of range

Stan added inline comments.Jun 1 2019, 10:37 PM
binaries/data/mods/mod/gui/modmod/modmod.js
218

Might deserve a comment then ;)

Angen added a comment.Jun 1 2019, 10:38 PM

fixing problem in rP15677

Successful build - Chance fights ever on the side of the prudent.

Linter detected issues:
Executing section Source...
Executing section JS...
|    | [NORMAL] ESLintBear (indent):
|    | Expected indentation of 3 tabs but found 2.
|----|    | /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/mod/gui/modmod/modmod.js
|    |++++| /mnt/data/jenkins-phabricator/workspace/differential/binaries/data/mods/mod/gui/modmod/modmod.js
| 369| 369| 
| 370| 370| 	g_ModsEnabled.sort((folder1, folder2) =>
| 371| 371| 		dependencies[folder1].indexOf(g_Mods[folder2].name) != -1 ? 1 :
| 372|    |-		dependencies[folder2].indexOf(g_Mods[folder1].name) != -1 ? -1 : 0);
|    | 372|+			dependencies[folder2].indexOf(g_Mods[folder1].name) != -1 ? -1 : 0);
| 373| 373| 
| 374| 374| 	displayModList("modsEnabledList", g_ModsEnabled);
| 375| 375| }
Executing section cli...

Link to build: https://jenkins.wildfiregames.com/job/differential/1583/display/redirect

Angen added a reviewer: Restricted Owners Package.Jun 3 2019, 1:24 PM