/
zoneeditorwidget.h
94 lines (78 loc) · 2.14 KB
/
zoneeditorwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
#ifndef ZONEEDITORWIDGET_H
#define ZONEEDITORWIDGET_H
#include "objects.h"
#include <QWidget>
#include <QListWidget>
#include <QFrame>
#include <QSpinBox>
#include <QComboBox>
#include <QCheckBox>
#include <QLabel>
#include <QScrollArea>
#include <QCheckBox>
class BgPreview : public QLabel
{
Q_OBJECT
public:
BgPreview();
void resizeEvent(QResizeEvent *) Q_DECL_OVERRIDE;
void setBg(QPixmap bg);
private:
QPixmap bg;
};
class ZoneEditorWidget : public QWidget
{
Q_OBJECT
public:
ZoneEditorWidget(QList<Zone*> *zones);
void deselect();
void select(Zone* zone);
void updateEditor();
signals:
void updateLevelView();
void selectedZoneChanged(Object* zone);
private:
QListWidget* zoneList;
QSpinBox* id;
QWidget* edits;
QComboBox* multiplayerTracking;
QMap<int, QString> multiplayerTrackings;
QSpinBox* progPathId;
QComboBox* musicId;
QMap<int, QString> musicIds;
QComboBox* background;
QMap<QString, QString> backgrounds;
BgPreview* backgroundPreview;
QSpinBox* xScrollRate;
QSpinBox* yScrollRate;
QSpinBox* bgXPos;
QSpinBox* bgYPos;
QSpinBox* upperBound;
QSpinBox* lowerBound;
QSpinBox* unkUpperBound;
QSpinBox* unkLowerBound;
QCheckBox* upScrolling;
QList<Zone*> *zones;
Zone* editZone;
class HorLine : public QFrame { public: HorLine() { setFrameStyle(QFrame::HLine | QFrame::Sunken); } };
void loadMusicIDs();
void loadBackgrounds();
void updateList();
void updateInfo();
void updateBgPreview();
bool editingAZone = false;
bool handleChanges = true;
private slots:
void handleZoneListIndexChange(QListWidgetItem* item);
void handleIDChange(int idVal);
void handleProgPathIDChange(int ppIDVal);
void handleMusicIDChange(QString text);
void handleMultiPlayerTrackingChange(QString text);
void handleUpScrollingChange(bool val);
void handleUpperBoundChange(int val);
void handleLowerBoundChange(int val);
void handleUnkUpperBoundChange(int val);
void handleUnkLowerBoundChange(int val);
void handleBackgroundChange(QString text);
};
#endif // ZONEEDITORWIDGET_H