Closed NicolasGrosjean closed 6 years ago
We have now for each Mod object a Set of modified Files.
So if 2 mods modify same files we can indicate that there is a potential conflict.
The conflict doesn't work on compressed mods, because the Java API doesn't support the compression method used by Steam ... https://stackoverflow.com/questions/24368236/how-to-determine-the-compression-method-of-a-zip-file
When using the code from Stackoverflow, I can see that the problematic file is descriptor.mod I will write again my code using this code to not try to unzip the .mod file
Now I have performance issues. Computing the list of the modified files of all the mods is relatively expensive.
The problem is that the application does it at each Windows focus !
I don't know what is the goal of this updateList.
There are also some useless Mod creation like when creating ListCreator. The mod objects need to be created once.
I have done the refactoring, now the Mod constructor is only called in ListManager#loadModFilesArray
Things to improve :
Ok, i saw conflict loading is very heavy... (up to 1min for my 178 installed mod on Stellaris)
So i agree we need a ProgressBar. It can be shown in a loader window (usefull for the first loading). This should be interesting : http://blog.carl.pro/2016/05/modal-jaxafx-progress-indicator-running-in-background/ (and maybe also for the app updater)
Another solution (maybe) :
Bugs & improvements :
I've got 2 conflicts : "(-NSC2 Addon: Unlimited Supercapitals-)" and "(-NSC2 Season 1 - Episode 3 - v1.3-)". If i remove one mod, the other stay in orange.
The new color also reveal a coloration bug after list scroll (orange become green again)
Just need those little modifications of this old code :
I don't think ExpandableContent is useful since user will always expand
Just put
setContent(expContent)
instead of setExpandableContent(expContent)
(line 643)
Seriously ! Even "fixed" close issue !
Ok... {close, closes, closed, fix, fixes, fixed, resolve, resolves, resolved} So now i will use "solve"/"solved"
2018-03-28 13:55:41 : type ERROR MESSAGE
Unable to unzip /home/tsimonfine/.local/share/Paradox Interactive/Stellaris/workshop/content/281990/1219685453/hivefocus.zip
If a zip file is missing it make the app crash.
EDIT:
Error generated also if file is here, it's two mods i download from a website...
java.util.zip.ZipException: invalid compression method
again.
One of the test file : '.mod' goes in 'mod/' and '1219685453' goes in 'workshop/content/281990/' 1219685453_Collective_Focus_for_Hive_and_Machine_Empires.zip
I work on the "loader window" from http://blog.carl.pro/2016/05/modal-jaxafx-progress-indicator-running-in-background/ Functional version (but i don't think it's stable/optimal for now).
Very low battery so i push my progression (add some 'TODO' tag) Need tests, if unstable comment/uncomment 'newloadModFilesArray()'/'loadModFilesArray()'
EDIT :
Solution to performance issue
Yes by default we need to NOT compute the conflicts. I was thinking about a checkbox to enable it when selecting the game, but an action to compute conflicts seems better because you can update.
Bugs
Thanks for fixing my bug, I have bad insert my code in your for the coloration, and I have done a bad copy-paste for the Dialog
If a zip file is missing it make the app crash.
I will fix it, I have the stack trace
java.lang.NullPointerException at mod.Mod.addModifiedFiles(Mod.java:189) at mod.Mod.setModifiedFiles(Mod.java:136) at mod.Mod.<init>(Mod.java:70) at mod.Mod.<init>(Mod.java:41) at tests.TestMod.modifiedFilestest(TestMod.java:47)
Error generated also if file is here, it's two mods i download from a website...
Is the ZIP incorrect ? I will catch the exception.
Functional version (but i don't think it's stable/optimal for now).
I have a NPE :
java.lang.NullPointerException
at mod.ModList.computeConflicts(ModList.java:203)
at mod.ModList.
I can continue to develop despite it
Still working on wait window :)
Don't know where we can put WorkIndicatorDialog ... maybe a "dialog" package...
Don't know where we can put WorkIndicatorDialog ... maybe a "dialog" package...
In a dialog package with BasicDialog seems a good idea
java.util.zip.ZipException: invalid compression method
I have it on each zip file ... Java didn't support the compression of the .mod file which is in each zip directory. I will check if some files are missing or not
No modified files are missing because the directories are browse deeply and the mod file is in root.
Forgot to put the # in the last commit...
I see that I have done a commit with message "Fix NPE #18" and the issue hasn't been closed.
I'm a bit jealous...
In fact if you put some words between fix (and other synonymous) and the issue number, it don't close the issue
I add some opacity (i have a problem with the size, the upper window is a bit bigger)
Due to window decoration i use scene width and height... Maybe i can remove a fixed margin...
The option
This option is stored in the ModManager.APP_PARAMS Map<String,String>, with key DetectConflict
.
if(ModManager.APP_PARAMS.containsKey("DetectConflict")){
if(ModManager.APP_PARAMS.get("DetectConflict").equals("true"))
//Do conflict stuff
}
The text in the loading window screen already implements the code. So you can put the test where you want.
I have enclosed it in a static method it is more readable.
I have noticed that when saving I remove some useless import. I advise you to use this Eclipse preference to remove useless imports and so reduce the Jar size.
When you need to import one class, you can do Ctrl+Shift+O.
I have discovered these tricks recently
It's good for me.
Ok, I will test this evening and like you have said in another issue, we can create a new version.
Bugs :
The bug source is this modification of ListCreator :
I remove other list.removeMod() and list.addMod(), so I need to replace them.
Thanks.
Bug in the conflict display between CK2 mods WtWSMS and BLG :
Yeah it's caused by the auto wrap, because the line contains one "word" : the path "\tPATH" so the textarea wrap :
\t
PATH
You agree the word is too long so textArea has wrapped it.
So I will set wrapping to false (another bad copy-paste)
What I noticed is that many conflicts stem from the fact that many mods have a 'changelog.txt', 'description.txt', 'readme.txt' or some other generic file in them which are named the same but should not impact gameplay (afaik). Would it be able to add a whitelist for file names which are excluded from the conflict check?
Maybe files in the mod's root directory can be skiped ?
Thanks you for the copy paste, I have not access to the Stellaris forum.
I have also observed this phenomenon after the release on mods done by the same person but I have conclude it should be rare. Or I simply wait that somebody report this.
Like you, my idea to counter this was to filter files in the root directory. I will implement this.
I close this issue like the development is delivered in 0.6.0.
Someone asked again about a conflict determination feature.
I have seen that you have already talked about. Now with plenty of mods in the workshop it can be very interesting feature.
A warning when 2 mods modify the same file can be a first good iteration.