Fix few errors, make app to be in line with current libKonogonka implementation
This commit is contained in:
parent
9a80d759e9
commit
dc45dabd34
6 changed files with 28 additions and 34 deletions
|
@ -115,9 +115,9 @@ public class NPDMController implements ITabController {
|
||||||
public void analyze(File file) { analyze(file, 0); }
|
public void analyze(File file) { analyze(file, 0); }
|
||||||
@Override
|
@Override
|
||||||
public void analyze(ISuperProvider parentProvider, int fileNo) throws Exception {
|
public void analyze(ISuperProvider parentProvider, int fileNo) throws Exception {
|
||||||
Task analyzer = Analyzer.analyzeNPDM(parentProvider, fileNo);
|
Task<NPDMProvider> analyzer = Analyzer.analyzeNPDM(parentProvider, fileNo);
|
||||||
analyzer.setOnSucceeded(e->{
|
analyzer.setOnSucceeded(e->{
|
||||||
NPDMProvider npdm = (NPDMProvider) analyzer.getValue();
|
NPDMProvider npdm = analyzer.getValue();
|
||||||
setData(npdm, null);
|
setData(npdm, null);
|
||||||
});
|
});
|
||||||
Thread workThread = new Thread(analyzer);
|
Thread workThread = new Thread(analyzer);
|
||||||
|
@ -126,9 +126,9 @@ public class NPDMController implements ITabController {
|
||||||
}
|
}
|
||||||
@Override
|
@Override
|
||||||
public void analyze(File file, long offset) {
|
public void analyze(File file, long offset) {
|
||||||
Task analyzer = Analyzer.analyzeNPDM(file, offset);
|
Task<NPDMProvider> analyzer = Analyzer.analyzeNPDM(file, offset);
|
||||||
analyzer.setOnSucceeded(e->{
|
analyzer.setOnSucceeded(e->{
|
||||||
NPDMProvider npdm = (NPDMProvider) analyzer.getValue();
|
NPDMProvider npdm = analyzer.getValue();
|
||||||
if (offset == 0)
|
if (offset == 0)
|
||||||
setData(npdm, file);
|
setData(npdm, file);
|
||||||
else
|
else
|
||||||
|
|
|
@ -29,9 +29,9 @@ import libKonogonka.Tools.ISuperProvider;
|
||||||
import libKonogonka.Tools.RomFs.FileSystemEntry;
|
import libKonogonka.Tools.RomFs.FileSystemEntry;
|
||||||
import libKonogonka.Tools.RomFs.IRomFsProvider;
|
import libKonogonka.Tools.RomFs.IRomFsProvider;
|
||||||
import libKonogonka.Tools.RomFs.Level6Header;
|
import libKonogonka.Tools.RomFs.Level6Header;
|
||||||
import libKonogonka.Tools.RomFs.RomFsDecryptedProvider;
|
|
||||||
import konogonka.Workers.Analyzer;
|
import konogonka.Workers.Analyzer;
|
||||||
import konogonka.Workers.DumbRomFsExtractor;
|
import konogonka.Workers.DumbRomFsExtractor;
|
||||||
|
import libKonogonka.Tools.RomFs.RomFsProvider;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
|
@ -155,9 +155,9 @@ public class RomFsController implements ITabController {
|
||||||
catch (Exception e){
|
catch (Exception e){
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
Task<RomFsDecryptedProvider> analyzer = Analyzer.analyzeRomFS(file, lv6offset);
|
Task<RomFsProvider> analyzer = Analyzer.analyzeRomFS(file, lv6offset);
|
||||||
analyzer.setOnSucceeded(e->{
|
analyzer.setOnSucceeded(e->{
|
||||||
RomFsDecryptedProvider provider = analyzer.getValue();
|
RomFsProvider provider = analyzer.getValue();
|
||||||
this.setData(provider);
|
this.setData(provider);
|
||||||
});
|
});
|
||||||
Thread workThread = new Thread(analyzer);
|
Thread workThread = new Thread(analyzer);
|
||||||
|
|
|
@ -157,13 +157,8 @@ public class Hfs0TableViewController implements Initializable {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
uploadColumn.setCellFactory(new Callback<TableColumn<Hfs0RowModel, Boolean>, TableCell<Hfs0RowModel, Boolean>>() {
|
uploadColumn.setCellFactory(paramFeatures -> new CheckBoxTableCell<>());
|
||||||
@Override
|
|
||||||
public TableCell<Hfs0RowModel, Boolean> call(TableColumn<Hfs0RowModel, Boolean> paramFeatures) {
|
|
||||||
CheckBoxTableCell<Hfs0RowModel, Boolean> cell = new CheckBoxTableCell<>();
|
|
||||||
return cell;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
table.setRowFactory( // this shit is made to implement context menu. It's such a pain..
|
table.setRowFactory( // this shit is made to implement context menu. It's such a pain..
|
||||||
new Callback<TableView<Hfs0RowModel>, TableRow<Hfs0RowModel>>() {
|
new Callback<TableView<Hfs0RowModel>, TableRow<Hfs0RowModel>>() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -185,16 +180,14 @@ public class Hfs0TableViewController implements Initializable {
|
||||||
row.contextMenuProperty().bind(
|
row.contextMenuProperty().bind(
|
||||||
Bindings.when(Bindings.isNotNull(row.itemProperty())).then(contextMenu).otherwise((ContextMenu)null)
|
Bindings.when(Bindings.isNotNull(row.itemProperty())).then(contextMenu).otherwise((ContextMenu)null)
|
||||||
);
|
);
|
||||||
row.setOnMouseClicked(new EventHandler<MouseEvent>() { // Just.. don't ask..
|
// Just.. don't ask..
|
||||||
@Override
|
row.setOnMouseClicked(mouseEvent -> {
|
||||||
public void handle(MouseEvent mouseEvent) {
|
if (!row.isEmpty() && mouseEvent.getButton() == MouseButton.PRIMARY){
|
||||||
if (!row.isEmpty() && mouseEvent.getButton() == MouseButton.PRIMARY){
|
Hfs0RowModel thisItem = row.getItem();
|
||||||
Hfs0RowModel thisItem = row.getItem();
|
thisItem.setMarkSelected(!thisItem.isMarkSelected());
|
||||||
thisItem.setMarkSelected(!thisItem.isMarkSelected());
|
table.refresh();
|
||||||
table.refresh();
|
|
||||||
}
|
|
||||||
mouseEvent.consume();
|
|
||||||
}
|
}
|
||||||
|
mouseEvent.consume();
|
||||||
});
|
});
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
|
@ -117,9 +117,9 @@ public class XCIController implements ITabController {
|
||||||
public void analyze(File selectedFile){
|
public void analyze(File selectedFile){
|
||||||
HFSBlockController.setSelectedFile(selectedFile);
|
HFSBlockController.setSelectedFile(selectedFile);
|
||||||
|
|
||||||
Task analyzer = Analyzer.analyzeXCI(selectedFile, AppPreferences.getInstance().getXciHeaderKey());
|
Task<XCIProvider> analyzer = Analyzer.analyzeXCI(selectedFile, AppPreferences.getInstance().getXciHeaderKey());
|
||||||
analyzer.setOnSucceeded(e->{
|
analyzer.setOnSucceeded(e->{
|
||||||
populateFields((XCIProvider) analyzer.getValue());
|
populateFields(analyzer.getValue());
|
||||||
});
|
});
|
||||||
Thread workThread = new Thread(analyzer);
|
Thread workThread = new Thread(analyzer);
|
||||||
workThread.setDaemon(true);
|
workThread.setDaemon(true);
|
||||||
|
|
|
@ -27,6 +27,7 @@ import konogonka.MainFx;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.ResourceBundle;
|
import java.util.ResourceBundle;
|
||||||
|
|
||||||
public class SettingsWindow {
|
public class SettingsWindow {
|
||||||
|
@ -50,10 +51,10 @@ public class SettingsWindow {
|
||||||
stageSettings.setTitle(resourceBundle.getString("settings_SettingsName"));
|
stageSettings.setTitle(resourceBundle.getString("settings_SettingsName"));
|
||||||
|
|
||||||
stageSettings.getIcons().addAll(
|
stageSettings.getIcons().addAll(
|
||||||
new Image(MainFx.class.getResourceAsStream("/res/settings_icon32x32.png")),
|
new Image(Objects.requireNonNull(MainFx.class.getResourceAsStream("/res/settings_icon32x32.png"))),
|
||||||
new Image(MainFx.class.getResourceAsStream("/res/settings_icon48x48.png")),
|
new Image(Objects.requireNonNull(MainFx.class.getResourceAsStream("/res/settings_icon48x48.png"))),
|
||||||
new Image(MainFx.class.getResourceAsStream("/res/settings_icon64x64.png")),
|
new Image(Objects.requireNonNull(MainFx.class.getResourceAsStream("/res/settings_icon64x64.png"))),
|
||||||
new Image(MainFx.class.getResourceAsStream("/res/settings_icon128x128.png"))
|
new Image(Objects.requireNonNull(MainFx.class.getResourceAsStream("/res/settings_icon128x128.png")))
|
||||||
);
|
);
|
||||||
|
|
||||||
Scene settingsScene = new Scene(parentAbout, 800, 800);
|
Scene settingsScene = new Scene(parentAbout, 800, 800);
|
||||||
|
|
|
@ -25,7 +25,7 @@ import libKonogonka.Tools.ISuperProvider;
|
||||||
import libKonogonka.Tools.NCA.NCAProvider;
|
import libKonogonka.Tools.NCA.NCAProvider;
|
||||||
import libKonogonka.Tools.NPDM.NPDMProvider;
|
import libKonogonka.Tools.NPDM.NPDMProvider;
|
||||||
import libKonogonka.Tools.PFS0.PFS0Provider;
|
import libKonogonka.Tools.PFS0.PFS0Provider;
|
||||||
import libKonogonka.Tools.RomFs.RomFsDecryptedProvider;
|
import libKonogonka.Tools.RomFs.RomFsProvider;
|
||||||
import libKonogonka.Tools.TIK.TIKProvider;
|
import libKonogonka.Tools.TIK.TIKProvider;
|
||||||
import libKonogonka.Tools.XCI.XCIProvider;
|
import libKonogonka.Tools.XCI.XCIProvider;
|
||||||
|
|
||||||
|
@ -161,14 +161,14 @@ public class Analyzer {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Task<RomFsDecryptedProvider> analyzeRomFS(File file, long lv6offset){
|
public static Task<RomFsProvider> analyzeRomFS(File file, long lv6offset){
|
||||||
LogPrinter logPrinter = new LogPrinter();
|
LogPrinter logPrinter = new LogPrinter();
|
||||||
return new Task<RomFsDecryptedProvider>() {
|
return new Task<RomFsProvider>() {
|
||||||
@Override
|
@Override
|
||||||
protected RomFsDecryptedProvider call() {
|
protected RomFsProvider call() {
|
||||||
logPrinter.print("\tStart chain: RomFS", EMsgType.INFO);
|
logPrinter.print("\tStart chain: RomFS", EMsgType.INFO);
|
||||||
try {
|
try {
|
||||||
return new RomFsDecryptedProvider(file, lv6offset);
|
return new RomFsProvider(file, lv6offset);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logPrinter.print(e.getMessage(), EMsgType.FAIL);
|
logPrinter.print(e.getMessage(), EMsgType.FAIL);
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in a new issue