mirror of
https://github.com/huderlem/porymap.git
synced 2026-09-30 20:06:56 -05:00
custom table widget for mon data, add new encounter fields to maps
This commit is contained in:
@@ -19,19 +19,20 @@ struct WildMonInfo {
|
||||
// for extensibility, make a QVector<WildMonInfo>
|
||||
// or QMap<QString, WildMonInfo>
|
||||
struct WildPokemonHeader {
|
||||
WildMonInfo landMons;
|
||||
WildMonInfo waterMons;
|
||||
WildMonInfo rockSmashMons;
|
||||
WildMonInfo fishingMons;
|
||||
|
||||
QMap<QString, WildMonInfo> wildMons;
|
||||
};
|
||||
|
||||
class Project;
|
||||
QWidget *newSpeciesTableEntry(Project *project, WildPokemon mon, int index);
|
||||
void createSpeciesTableRow(Project *, QTableWidget *, WildPokemon, int, QString);
|
||||
typedef QVector<QPair<QString, QVector<int>>> Fields;
|
||||
typedef QPair<QString, QVector<int>> Field;
|
||||
|
||||
//class Project;
|
||||
//class MonTabWidget;
|
||||
//QWidget *newSpeciesTableEntry(Project *project, WildPokemon mon, int index);
|
||||
//void createSpeciesTableRow(Project *, QTableWidget *, WildPokemon, int, QString);
|
||||
void clearTabWidget(QLayout *tab);
|
||||
void clearTable(QTableWidget *table);
|
||||
void populateWildMonTabWidget(QTabWidget *tabWidget, QVector<QPair<QString, QVector<int>>> fields);
|
||||
//void clearTable(QTableWidget *table);
|
||||
//void populateWildMonTabWidget(MonTabWidget *tabWidget, Fields /* QVector<QPair<QString, QVector<int>>> */ fields);
|
||||
|
||||
WildMonInfo getDefaultMonInfo(Field field);
|
||||
|
||||
#endif // GUARD_WILDMONINFO_H
|
||||
|
||||
51
include/ui/montabwidget.h
Normal file
51
include/ui/montabwidget.h
Normal file
@@ -0,0 +1,51 @@
|
||||
// montablewidget.h
|
||||
|
||||
#ifndef MONTABWIDGET_H
|
||||
#define MONTABWIDGET_H
|
||||
|
||||
#include "wildmoninfo.h"
|
||||
|
||||
#include <QtWidgets>
|
||||
#include <QVector>
|
||||
|
||||
//
|
||||
class Project;
|
||||
|
||||
class MonTabWidget : public QTabWidget {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit MonTabWidget(Project *project = nullptr, QWidget *parent = nullptr);
|
||||
~MonTabWidget(){};
|
||||
|
||||
void populate();
|
||||
void populateTab(int tabIndex, WildMonInfo monInfo, QString fieldName);
|
||||
void clear();
|
||||
|
||||
void createSpeciesTableRow(QTableWidget *table, WildPokemon mon, int index, QString fieldName);
|
||||
|
||||
void clearTableAt(int index);
|
||||
|
||||
QTableWidget *tableAt(int tabIndex);
|
||||
//void setupTableAt(int tabIndex);
|
||||
|
||||
public slots:
|
||||
void setTabActive(int index, bool active = true);
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject *object, QEvent *event);
|
||||
void askActivateTab(int tabIndex, QPoint menuPos);
|
||||
|
||||
QVector<bool> activeTabs;
|
||||
|
||||
Project *project;
|
||||
|
||||
private slots:
|
||||
//
|
||||
|
||||
signals:
|
||||
// right click
|
||||
};
|
||||
|
||||
#endif // MONTABWIDGET_H
|
||||
Reference in New Issue
Block a user