-
Notifications
You must be signed in to change notification settings - Fork 1
/
mapobjecteditor.h
67 lines (55 loc) · 1.46 KB
/
mapobjecteditor.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
#ifndef MAPOBJECTEDITOR_H
#define MAPOBJECTEDITOR_H
#include "map.h"
#include "mapview.h"
#include <QWidget>
#include <QComboBox>
#include <QListWidget>
#include <QToolBar>
#include <QSpinBox>
class MapObjectEditor : public QWidget
{
Q_OBJECT
public:
explicit MapObjectEditor(Map* map, MapView* mapView, QWidget* parent = 0);
void setMap(Map* map);
public slots:
void select(MapObject* object);
void deselect();
signals:
void redrawMap();
void objectSelected(MovableObject* o);
void objectDeselected();
private slots:
void typeChanged(int typeId);
void objectListIndexChanged(int index);
void addObjectClicked();
void removeObjectClicked();
void moveUpClicked();
void moveDownClicked();
void nodeIdChanged(int nodeId);
void xChanged(int x);
void yChanged(int y);
void zChanged(int z);
private:
class HorLine : public QFrame { public: HorLine() { setFrameStyle(QFrame::HLine | QFrame::Sunken); } };
Map* map;
MapView* mapView;
MapObject* editObject;
QList<MapObject*>* editList;
QComboBox* type;
QListWidget* objectList;
QToolBar* toolbar;
QSpinBox* nodeId;
QSpinBox* xPos;
QSpinBox* yPos;
QSpinBox* zPos;
void _select(MapObject* object);
void _deselect();
void updateList(bool keepIndex=true);
void setEditsEnabled(bool enabled);
void updateInfo();
void allowChanges(bool allow);
void clearValues();
};
#endif // MAPOBJECTEDITOR_H