mirror of
https://github.com/redstrate/Novus.git
synced 2025-04-27 14:17:45 +00:00
sagasu: Add support for exlpart, exdpart and mdlpart for more previews
This commit is contained in:
parent
ae41124f93
commit
93b6380b3d
5 changed files with 44 additions and 6 deletions
|
@ -22,6 +22,6 @@ target_sources(novus-sagasu PRIVATE
|
||||||
src/filepropertieswindow.cpp
|
src/filepropertieswindow.cpp
|
||||||
src/filetreemodel.cpp)
|
src/filetreemodel.cpp)
|
||||||
target_include_directories(novus-sagasu PRIVATE include)
|
target_include_directories(novus-sagasu PRIVATE include)
|
||||||
target_link_libraries(novus-sagasu PRIVATE Qt6::Concurrent hexpart novus-sagasu-static)
|
target_link_libraries(novus-sagasu PRIVATE Qt6::Concurrent hexpart exlpart mdlpart exdpart novus-sagasu-static)
|
||||||
|
|
||||||
install(TARGETS novus-sagasu ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS})
|
install(TARGETS novus-sagasu ${KF${QT_MAJOR_VERSION}_INSTALL_TARGETS_DEFAULT_ARGS})
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include <QMdiArea>
|
#include <QMdiArea>
|
||||||
#include <QTreeWidget>
|
#include <QTreeWidget>
|
||||||
|
|
||||||
|
#include "filecache.h"
|
||||||
#include "novusmainwindow.h"
|
#include "novusmainwindow.h"
|
||||||
|
|
||||||
struct GameData;
|
struct GameData;
|
||||||
|
@ -21,5 +22,7 @@ private:
|
||||||
|
|
||||||
GameData *data = nullptr;
|
GameData *data = nullptr;
|
||||||
QTabWidget *partHolder = nullptr;
|
QTabWidget *partHolder = nullptr;
|
||||||
|
FileCache fileCache;
|
||||||
|
|
||||||
void refreshParts(QString qString);
|
void refreshParts(QString qString);
|
||||||
};
|
};
|
|
@ -63,7 +63,7 @@ FileTreeWindow::FileTreeWindow(QString gamePath, GameData *data, QWidget *parent
|
||||||
|
|
||||||
connect(treeWidget, &QTreeView::clicked, [this, treeWidget](const QModelIndex &item) {
|
connect(treeWidget, &QTreeView::clicked, [this, treeWidget](const QModelIndex &item) {
|
||||||
if (item.isValid()) {
|
if (item.isValid()) {
|
||||||
auto path = m_fileModel->data(item, Qt::UserRole).toString();
|
auto path = m_searchModel->data(item, Qt::UserRole).toString();
|
||||||
Q_EMIT pathSelected(path);
|
Q_EMIT pathSelected(path);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,7 +4,15 @@
|
||||||
#include "hashdatabase.h"
|
#include "hashdatabase.h"
|
||||||
#include "settings.h"
|
#include "settings.h"
|
||||||
|
|
||||||
const std::array known_folders{"common", "common/font", "common/graphics", "common/graphics/texture", "common/softwarecursor", "exd"};
|
const std::array known_folders{"common",
|
||||||
|
"common/font",
|
||||||
|
"common/graphics",
|
||||||
|
"common/graphics/texture",
|
||||||
|
"common/softwarecursor",
|
||||||
|
"exd",
|
||||||
|
"chara/equipment/e0000/material/v0001",
|
||||||
|
"chara/equipment/e0000/texture",
|
||||||
|
"chara/human/c0101/obj/face/f0001/model"};
|
||||||
|
|
||||||
const std::array common_font{"common/VulgarWordsFilter.dic",
|
const std::array common_font{"common/VulgarWordsFilter.dic",
|
||||||
"common/VulgarWordsFilter_party.dic",
|
"common/VulgarWordsFilter_party.dic",
|
||||||
|
@ -148,6 +156,11 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
database.addFile(QStringLiteral("exd/root.exl"));
|
database.addFile(QStringLiteral("exd/root.exl"));
|
||||||
|
database.addFile(QStringLiteral("exd/achievement.exh"));
|
||||||
|
database.addFile(QStringLiteral("exd/Achievement_0_en.exd"));
|
||||||
|
database.addFile(QStringLiteral("chara/equipment/e0000/material/v0001/mt_c0101e0000_sho_a.mtrl"));
|
||||||
|
database.addFile(QStringLiteral("chara/equipment/e0000/texture/v01_c0101e0000_sho_d.tex"));
|
||||||
|
database.addFile(QStringLiteral("chara/human/c0101/obj/face/f0001/model/c0101f0001_fac.mdl"));
|
||||||
|
|
||||||
/*const QString gameDir{getGameDirectory()};
|
/*const QString gameDir{getGameDirectory()};
|
||||||
const std::string gameDirStd{gameDir.toStdString()};
|
const std::string gameDirStd{gameDir.toStdString()};
|
||||||
|
|
|
@ -7,15 +7,20 @@
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QHBoxLayout>
|
#include <QHBoxLayout>
|
||||||
|
#include <QLabel>
|
||||||
#include <QMenuBar>
|
#include <QMenuBar>
|
||||||
|
|
||||||
|
#include "exdpart.h"
|
||||||
|
#include "exlpart.h"
|
||||||
#include "filepropertieswindow.h"
|
#include "filepropertieswindow.h"
|
||||||
#include "filetreewindow.h"
|
#include "filetreewindow.h"
|
||||||
#include "hexpart.h"
|
#include "hexpart.h"
|
||||||
|
#include "mdlpart.h"
|
||||||
|
|
||||||
MainWindow::MainWindow(QString gamePath, GameData *data)
|
MainWindow::MainWindow(QString gamePath, GameData *data)
|
||||||
: NovusMainWindow()
|
: NovusMainWindow()
|
||||||
, data(data)
|
, data(data)
|
||||||
|
, fileCache(*data)
|
||||||
{
|
{
|
||||||
setupMenubar();
|
setupMenubar();
|
||||||
|
|
||||||
|
@ -66,11 +71,28 @@ void MainWindow::refreshParts(QString path)
|
||||||
|
|
||||||
auto file = physis_gamedata_extract_file(data, path.toStdString().c_str());
|
auto file = physis_gamedata_extract_file(data, path.toStdString().c_str());
|
||||||
|
|
||||||
// Add properties tab
|
QFileInfo info(path);
|
||||||
auto propertiesWidget = new FilePropertiesWindow(path, file);
|
if (info.completeSuffix() == QStringLiteral("exl")) {
|
||||||
partHolder->addTab(propertiesWidget, QStringLiteral("Properties"));
|
auto exlWidget = new EXLPart(data);
|
||||||
|
exlWidget->load(file);
|
||||||
|
partHolder->addTab(exlWidget, QStringLiteral("Excel List"));
|
||||||
|
} else if (info.completeSuffix() == QStringLiteral("exh")) {
|
||||||
|
auto exdWidget = new EXDPart(data);
|
||||||
|
exdWidget->loadSheet(info.baseName(), file);
|
||||||
|
partHolder->addTab(exdWidget, QStringLiteral("Excel Sheet"));
|
||||||
|
} else if (info.completeSuffix() == QStringLiteral("exd")) {
|
||||||
|
auto exdWidget = new QLabel(QStringLiteral("Note: Excel data files cannot be previewed standalone, select the EXH file instead."));
|
||||||
|
partHolder->addTab(exdWidget, QStringLiteral("Note"));
|
||||||
|
} else if (info.completeSuffix() == QStringLiteral("mdl")) {
|
||||||
|
auto mdlWidget = new MDLPart(data, fileCache);
|
||||||
|
mdlWidget->addModel(physis_mdl_parse(file.size, file.data), QStringLiteral("mdl"), {}, 0);
|
||||||
|
partHolder->addTab(mdlWidget, QStringLiteral("Model"));
|
||||||
|
}
|
||||||
|
|
||||||
auto hexWidget = new HexPart();
|
auto hexWidget = new HexPart();
|
||||||
hexWidget->loadFile(file);
|
hexWidget->loadFile(file);
|
||||||
partHolder->addTab(hexWidget, QStringLiteral("Raw Hex"));
|
partHolder->addTab(hexWidget, QStringLiteral("Raw Hex"));
|
||||||
|
|
||||||
|
auto propertiesWidget = new FilePropertiesWindow(path, file);
|
||||||
|
partHolder->addTab(propertiesWidget, QStringLiteral("Properties"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue