diff --git a/pom.xml b/pom.xml index 12a7e65..ba05d9b 100644 --- a/pom.xml +++ b/pom.xml @@ -92,7 +92,7 @@ com.github.Maschell JNUSLib - 3eb299d + 95802c7 org.projectlombok diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/WoomyNUSTitleContainer.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/WoomyNUSTitleContainer.java new file mode 100644 index 0000000..81af34b --- /dev/null +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/implementation/WoomyNUSTitleContainer.java @@ -0,0 +1,31 @@ +package de.mas.wiiu.jnus.fuse_wiiu.implementation; + +import java.io.File; +import java.util.Optional; + +import de.mas.wiiu.jnus.NUSTitleLoaderWoomy; +import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; +import de.mas.wiiu.jnus.implementations.FSTDataProviderNUSTitle; + +public class WoomyNUSTitleContainer extends GroupFuseContainer { + private final File file; + + public WoomyNUSTitleContainer(Optional parent, File file) { + super(parent); + this.file = file; + } + + @Override + protected void doInit() { + this.addFuseContainer(file.getName(), new FSTDataProviderContainer(Optional.of(this), () -> { + try { + return new FSTDataProviderNUSTitle(NUSTitleLoaderWoomy.loadNUSTitle(file.getAbsolutePath())); + } catch (Exception e1) { + e1.printStackTrace(); + return null; + } + })); + + } + +} diff --git a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/FuseContainerWrapper.java b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/FuseContainerWrapper.java index 2c34a8a..fdeb312 100644 --- a/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/FuseContainerWrapper.java +++ b/src/main/java/de/mas/wiiu/jnus/fuse_wiiu/utils/FuseContainerWrapper.java @@ -11,6 +11,7 @@ import de.mas.wiiu.jnus.fuse_wiiu.implementation.LocalNUSTitleContainer; import de.mas.wiiu.jnus.fuse_wiiu.implementation.WUDFuseContainer; import de.mas.wiiu.jnus.fuse_wiiu.implementation.WUDMountedFuseContainer; import de.mas.wiiu.jnus.fuse_wiiu.implementation.WUDToWUDContainer; +import de.mas.wiiu.jnus.fuse_wiiu.implementation.WoomyNUSTitleContainer; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseContainer; import de.mas.wiiu.jnus.fuse_wiiu.interfaces.FuseDirectory; import de.mas.wiiu.jnus.implementations.wud.reader.WUDDiscReaderSplitted; @@ -40,6 +41,11 @@ public class FuseContainerWrapper { return result; } } + + if (c.exists() && c.getName().endsWith(".woomy")) { + result.put(prefix + c.getName(), new WoomyNUSTitleContainer(parent, c)); + return result; + } if (checkWUD(result, parent, c)) { return result;