mirror of
https://github.com/Luca1991/NDSFactory.git
synced 2026-02-07 07:06:14 +01:00
FAT Data Extractor moved to FAT Tools Tab
This commit is contained in:
@@ -1,6 +1,12 @@
|
||||
#include "./../../mainwindow.h"
|
||||
|
||||
|
||||
bool MainWindow::extractFatData(const std::string& fatDataSectionPath, const std::string& fatSectionPath,
|
||||
const std::string& fntSectionPath, uint32_t originalFatDataAddr, const std::string& savePath)
|
||||
{
|
||||
return ndsFactory.extractFatData(fatDataSectionPath, fatSectionPath, fntSectionPath, originalFatDataAddr, savePath);
|
||||
}
|
||||
|
||||
bool MainWindow::patchFat(const std::string& loadPath, uint32_t shiftSize, const std::string& savePath)
|
||||
{
|
||||
return ndsFactory.patchFat(loadPath, shiftSize, savePath);
|
||||
|
||||
@@ -3,6 +3,64 @@
|
||||
#include "./../../mainwindow.h"
|
||||
#include "./../../ui_mainwindow.h"
|
||||
|
||||
void MainWindow::on_fatExtractorLoadFatDataBtn_clicked()
|
||||
{
|
||||
QString FatDataPath = QFileDialog::getOpenFileName(
|
||||
Q_NULLPTR,
|
||||
"NDS Fat Data",
|
||||
QDir::currentPath(),
|
||||
"NDS FAT_DATA (*.bin)");
|
||||
|
||||
if (!FatDataPath.isNull())
|
||||
{
|
||||
ui->fatExtractorFatDataPathEdt->setText(FatDataPath.toUtf8());
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_fatExtractorLoadFatBtn_clicked()
|
||||
{
|
||||
QString FatPath = QFileDialog::getOpenFileName(
|
||||
Q_NULLPTR,
|
||||
"NDS Fat",
|
||||
QDir::currentPath(),
|
||||
"NDS FAT (*.bin)");
|
||||
|
||||
if (!FatPath.isNull())
|
||||
{
|
||||
ui->fatExtractorFatPathEdt->setText(FatPath.toUtf8());
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_fatExtractorLoadFntBtn_clicked()
|
||||
{
|
||||
QString FntPath = QFileDialog::getOpenFileName(
|
||||
Q_NULLPTR,
|
||||
"NDS Fnt",
|
||||
QDir::currentPath(),
|
||||
"NDS FNT (*.bin)");
|
||||
|
||||
if (!FntPath.isNull())
|
||||
{
|
||||
ui->fatExtractorFntPathEdt->setText(FntPath.toUtf8());
|
||||
}
|
||||
}
|
||||
|
||||
void MainWindow::on_fatExtractorExtractBtn_clicked()
|
||||
{
|
||||
QString dirPath = QFileDialog::getExistingDirectory(
|
||||
this, tr("Select Directory"),
|
||||
"",
|
||||
QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks);
|
||||
|
||||
if (!dirPath.isNull())
|
||||
extractFatData(ui->fatExtractorFatDataPathEdt->text().toStdString(),
|
||||
ui->fatExtractorFatPathEdt->text().toStdString(),
|
||||
ui->fatExtractorFntPathEdt->text().toStdString(),
|
||||
ui->fatExtractorOriginalFatFilesAddrEdt->text().toUInt(nullptr, 16),
|
||||
dirPath.toStdString()) ? QMessageBox::information(this, tr("NDS Factory"), tr("FAT files extraction completed!"))
|
||||
: QMessageBox::critical(this, tr("NDS Factory"), tr("Error extracting FAT files!"));
|
||||
|
||||
}
|
||||
|
||||
void MainWindow::on_fatPatcherLoadFatBtn_clicked()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user