2017-09-07 19:03:18 +02:00
|
|
|
#ifndef _TEXTVIEWER_HPP_
|
|
|
|
#define _TEXTVIEWER_HPP_
|
|
|
|
|
|
|
|
#include "ViewerInterface.hpp"
|
|
|
|
|
|
|
|
#include <fonts/GameTexts.hpp>
|
|
|
|
|
|
|
|
#include <QTableView>
|
|
|
|
|
2019-01-03 12:59:57 +01:00
|
|
|
#include <filesystem>
|
2017-09-07 19:03:18 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
class TextModel;
|
|
|
|
class ViewerWidget;
|
|
|
|
|
|
|
|
class QLayout;
|
|
|
|
class QItemSelection;
|
|
|
|
class QLineEdit;
|
|
|
|
class QTextEdit;
|
|
|
|
class QModelIndex;
|
|
|
|
class QString;
|
|
|
|
class QWidget;
|
|
|
|
|
|
|
|
class TextTableView : public QTableView {
|
|
|
|
Q_OBJECT
|
|
|
|
protected slots:
|
|
|
|
virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override;
|
|
|
|
signals:
|
|
|
|
void gameStringChanged(const GameString &string);
|
|
|
|
};
|
|
|
|
|
|
|
|
class TextViewer : public ViewerInterface {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
TextModel *textModel;
|
|
|
|
TextTableView *textTable;
|
|
|
|
ViewerWidget *viewerWidget;
|
|
|
|
|
|
|
|
QLineEdit *hexLineEdit;
|
|
|
|
QTextEdit *textEdit;
|
|
|
|
|
2018-08-30 02:19:38 +02:00
|
|
|
void worldChanged() override;
|
2017-09-07 19:03:18 +02:00
|
|
|
|
|
|
|
GameString currentGameString;
|
|
|
|
font_t currentFont;
|
|
|
|
int currentFontSize;
|
|
|
|
|
|
|
|
void updateRender();
|
|
|
|
|
|
|
|
void setGameString(const GameString &gameString);
|
|
|
|
std::vector<std::string> getFontTextureNames();
|
|
|
|
public:
|
2018-08-06 00:06:33 +02:00
|
|
|
TextViewer(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
|
2017-09-07 19:03:18 +02:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void fontChanged(font_t font);
|
|
|
|
private slots:
|
|
|
|
void onGameStringChange(const GameString &gameString);
|
|
|
|
void onStringChange();
|
|
|
|
void onFontChange(size_t font);
|
|
|
|
void onFontSizeChange(int font);
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|