1
Fork 0
mirror of https://github.com/redstrate/Novus.git synced 2025-04-27 06:07:45 +00:00
novus/parts/exd/exdpart.h

36 lines
955 B
C
Raw Normal View History

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
#pragma once
#include <QFormLayout>
2023-09-23 14:09:00 -04:00
#include <QMap>
#include <QTabWidget>
#include <QWidget>
2023-09-23 14:09:00 -04:00
#include <physis.hpp>
// TODO: rename to "EXDH" or "Excel" part or something similar because you cannot preview EXD on it's own
2023-10-12 23:45:21 -04:00
class EXDPart : public QWidget
{
Q_OBJECT
public:
explicit EXDPart(GameData *data, QWidget *parent = nullptr);
void loadSheet(const QString &name, physis_Buffer buffer, const QString &definitionPath = {});
private:
std::pair<QString, int> getColumnData(physis_ColumnData &columnData);
2023-10-12 23:45:21 -04:00
GameData *data = nullptr;
2023-10-12 23:45:21 -04:00
QTabWidget *pageTabWidget = nullptr;
QFormLayout *headerFormLayout = nullptr;
2023-09-23 14:09:00 -04:00
struct CachedExcel {
2023-10-12 23:45:21 -04:00
physis_EXH *exh = nullptr;
physis_EXD exd{};
2023-09-23 14:09:00 -04:00
};
QMap<QString, CachedExcel> cachedExcelSheets;
2023-10-12 23:45:21 -04:00
Language getSuitableLanguage(physis_EXH *pExh);
};