ThibautSF / ParadoxosModManager

Software to manage mods for recent Paradox games
37 stars 6 forks source link

ListManager and MyXML refactor cause errors with missing mods #19

Closed ThibautSF closed 6 years ago

ThibautSF commented 6 years ago

We still need to generate fake Mod (with filename and remoteID) and set isMissing to true in availableMods. Conflict compute have to ignore missing mods.

NicolasGrosjean commented 6 years ago

Stack trace : java.lang.NullPointerException at mod.ModList.computeConflicts(ModList.java:203) at mod.ModList.(ModList.java:37) at settings.MyXML.getSavedList(MyXML.java:154) at application.ListManager.updateList(ListManager.java:487) at application.ListManager.access$0(ListManager.java:485)

NicolasGrosjean commented 6 years ago

With 4d5b9d3c, I have this : image

ThibautSF commented 6 years ago

Hmmm... In this version there is

Mod oneMod = availableMods.get(fileName);
if (oneMod == null) {
    oneMod = new Mod(fileName, false);
}
listMods.add(oneMod);

but my version have

Mod oneMod = availableMods.get(fileName);
listMods.add(oneMod);

Manip error somewhere ? :thinking:

NicolasGrosjean commented 6 years ago

You need to refresh with Eclipse after pulling, maybe.

NicolasGrosjean commented 6 years ago

I suggest to display the name of the missing mod (in addition of MOD MISSING) because if it was removed from Steam, we have no mean to know the name.

ThibautSF commented 6 years ago

But Pull generally refresh all active views...

I was also trying smthing like this :

Mod oneMod = availableMods.get(fileName);
if (oneMod==null) {
    if (remoteFileId!=null){
        for (Mod mod : availableMods.values()) {
            if (mod.getRemoteFileID().equals(remoteFileId)) {
                oneMod = mod;
            }
        }
    } else {
        //TODO
        //Generate a missing mod
        oneMod = new Mod(fileName,false);
    }
}
listMods.add(oneMod);

Because sometimes (generally after a list import) a mod is tagged as missing because filename isn't the same (for example if i have dev version 'modName.mod' and my friend have a workshop version 'ugc_XXX.mod')

ThibautSF commented 6 years ago

For mod name it was supposed...

Old XML image

Recent : image

NicolasGrosjean commented 6 years ago

The constant MOD_NAME is still used.

2 options :

NicolasGrosjean commented 6 years ago

I have committed a version with mod name, you can revert this commit if you prefer without the mod name. image

I let you add the remoteId check that you have shown.

ThibautSF commented 6 years ago

Ok, the mod name is added only when list is modified... image

I will refactor that. There is too much similar code.