ff7tk 0.80.25
Work with Final Fantasy 7 game data
LocationViewer.h
Go to the documentation of this file.
1/****************************************************************************/
2// copyright 2013 - 2020 Chris Rizzitello <sithlord48@gmail.com> //
3// //
4// This file is part of FF7tk //
5// //
6// FF7tk is free software: you can redistribute it and/or modify //
7// it under the terms of the GNU General Public License as published by //
8// the Free Software Foundation, either version 3 of the License, or //
9// (at your option) any later version. //
10// //
11// FF7tk is distributed in the hope that it will be useful, //
12// but WITHOUT ANY WARRANTY; without even the implied warranty of //
13// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
14// GNU General Public License for more details. //
15/****************************************************************************/
16#pragma once
17
18#include <QEvent>
19#include <QModelIndex>
20#include <QWidget>
21
22#include <FF7FieldItemList.h>
23
24#ifndef ff7tkwidgets_export_h
25 #include <ff7tkwidgets_export.h>
26#endif
27
28class QAction;
29class QCheckBox;
30class QGroupBox;
31class QLabel;
32class QLineEdit;
33class QListWidget;
34class QPushButton;
35class QSpinBox;
36class QTableWidget;
37class QToolButton;
38class QTranslator;
39
44class FF7TKWIDGETS_EXPORT LocationViewer : public QWidget
45{
46 Q_OBJECT
47public:
48 enum filterMode {NAME, ITEM};
49 explicit LocationViewer(qreal Scale = 1, QWidget *parent = nullptr);
50 void setFilterString(QString filter = "", LocationViewer::filterMode mode = LocationViewer::NAME);
51signals:
52 void locationChanged(QString);
53 void xChanged(int x);
54 void yChanged(int y);
55 void tChanged(int t);
56 void dChanged(int d);
57 void mapIdChanged(int mapId);
58 void locIdChanged(int locId);
59 void locationStringChanged(QString);
60 void fieldItemConnectRequest(quint8 index, QList<quint16> offset, QList<quint8>bit);
61 void fieldItemCheck(int index);
62 void fieldItemChanged(int index, bool checked);
63
64public slots:
65 void setSelected(const QString &);
66 void setRegion(const QString &region);
67 void setX(int x);
68 void setY(int y);
69 void setT(int t);
70 void setD(int d);
71 void setMapId(int mapId);
72 void setLocationId(int locId);
73 void setLocationString(const QString &);
74 void setHorizontalHeaderStyle(QString styleSheet);
75 void setFieldItemChecked(int row, bool checked);
76 void init_fieldItems(void);
77 void setAdvancedMode(bool advancedMode);
78 bool advancedMode(void);
79
80private slots:
81 void itemChanged(int currentRow, int currentColumn, int prevRow, int prevColumn);
82 void sbMapIdChanged(int mapId);
83 void sbLocIdChanged(int locId);
84 void sbXChanged(int x);
85 void sbYChanged(int y);
86 void sbTChanged(int t);
87 void sbDChanged(int d);
88 void lineLocationNameChanged(const QString &);
89 void setLocation(int mapId, int locId);
90 void filterLocations(QString filter);
91 void actionNameSearchToggled(bool checked);
92 void actionItemSearchToggled(bool checked);
93 void actionRegExpSearchToggled(bool checked);
94 void actionCaseSensitiveToggled(bool checked);
95 void fieldItemListItemChanged(QModelIndex index);
96 void btnUpdateSaveLocationClicked();
97protected:
98 void resizeEvent(QResizeEvent *ev);
99 void changeEvent(QEvent *e);
100private:
101 void init_display(void);
102 void init_connections(void);
103 void init_disconnect(void);
104 void updateText();
105 void updateItemText(int locID = -1, bool currentLoc = false);
106 QString translate(QString text);
107 void searchItem(QRegularExpression exp);
108 void searchName(QRegularExpression exp);
109 qreal scale;
110 QString region;
111 QString langDir;
112 int currentStartingLocation = -1;
113 bool regExpSearch;
114 bool caseSensitive;
115 bool _advancedMode;
116 quint8 searchMode;
117 FF7FieldItemList *fieldItems;
118 QTableWidget *locationTable;
119 QToolButton *btnSearchOptions;
120 QAction *actionNameSearch;
121 QAction *actionItemSearch;
122 QAction *actionRegExpSearch;
123 QAction *actionCaseSensitive;
124 QWidget *CoordsWidget;
125 QLabel *lblLocationPreview;
126 QLineEdit *lineTableFilter;
127 QLineEdit *lineLocationName;
128 QSpinBox *sbMapID;
129 QSpinBox *sbLocID;
130 QSpinBox *sbX;
131 QSpinBox *sbY;
132 QSpinBox *sbT;
133 QSpinBox *sbD;
134 QListWidget *fieldItemList;
135 QGroupBox *groupFieldItems;
136 QPushButton *btnUpdateSaveLocation;
137 QTranslator *translator;
138
139 inline static const QString _tooltip = QStringLiteral("<html><head/><body><p><img src=\":/locations/%1_%2\" width=\"%3\" height\"%4\" /></p></body></html>");
140};
Data Class to allow the tracking and changing of items being picked up on the field.
Definition: FF7FieldItemList.h:41
Set Saves Location or View Field Locations and Toggle the items picked up from them.
Definition: LocationViewer.h:45
void locationChanged(QString)
void fieldItemCheck(int index)
void locIdChanged(int locId)
void xChanged(int x)
void dChanged(int d)
void mapIdChanged(int mapId)
void yChanged(int y)
void tChanged(int t)
filterMode
Definition: LocationViewer.h:48
@ NAME
Definition: LocationViewer.h:48
void fieldItemConnectRequest(quint8 index, QList< quint16 > offset, QList< quint8 >bit)
void fieldItemChanged(int index, bool checked)
void locationStringChanged(QString)