1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-24 04:57:45 +00:00
novus/karuku/src/mainwindow.cpp

47 lines
1.2 KiB
C++
Raw Normal View History

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
2022-03-16 00:31:24 -04:00
#include "mainwindow.h"
#include <QApplication>
#include <QDesktopServices>
#include <QHBoxLayout>
#include <QListWidget>
#include <QMenuBar>
#include <QUrl>
#include <physis.hpp>
2022-03-16 00:31:24 -04:00
#include "exdpart.h"
#include "sheetlistwidget.h"
2022-03-16 00:31:24 -04:00
2023-10-10 18:02:13 -04:00
MainWindow::MainWindow(GameData *data)
2023-10-10 18:11:40 -04:00
: NovusMainWindow()
, data(data)
2023-10-10 18:02:13 -04:00
{
2023-09-23 14:09:09 -04:00
setMinimumSize(1280, 720);
setupMenubar();
2022-03-16 00:31:24 -04:00
auto dummyWidget = new QWidget();
2022-03-16 00:31:24 -04:00
setCentralWidget(dummyWidget);
auto layout = new QHBoxLayout();
2022-03-16 00:31:24 -04:00
dummyWidget->setLayout(layout);
auto listWidget = new SheetListWidget(data);
listWidget->setMaximumWidth(200);
layout->addWidget(listWidget);
auto exdPart = new EXDPart(data);
layout->addWidget(exdPart);
2022-03-16 00:31:24 -04:00
connect(listWidget, &SheetListWidget::sheetSelected, this, [data, exdPart](const QString &name) {
auto path = QStringLiteral("exd/%1.exh").arg(name.toLower());
auto pathStd = path.toStdString();
auto file = physis_gamedata_extract_file(data, pathStd.c_str());
exdPart->loadSheet(name, file);
});
2023-10-12 23:44:59 -04:00
}
#include "moc_mainwindow.cpp"