forked from Mudlet/Mudlet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
T2DMap.h
187 lines (173 loc) · 5.83 KB
/
T2DMap.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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
#ifndef MUDLET_T2DMAP_H
#define MUDLET_T2DMAP_H
/***************************************************************************
* Copyright (C) 2008-2012 by Heiko Koehn - KoehnHeiko@googlemail.com *
* Copyright (C) 2014 by Ahmed Charles - acharles@outlook.com *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "pre_guard.h"
#include <QColor>
#include <QPixmap>
#include <QPointer>
#include <QTreeWidget>
#include <QWidget>
#include "post_guard.h"
class Host;
class TMap;
class QCheckBox;
class QComboBox;
class QListWidgetItem;
class QPushButton;
class QTreeWidgetItem;
class T2DMap : public QWidget
{
Q_OBJECT
public:
explicit T2DMap( QWidget *parent = 0 );
void paintMap();
void setMapZoom( int zoom );
QColor getColor( int id );
QColor _getColor( int id );
void init();
void exportAreaImage( int );
void paintEvent( QPaintEvent * ) override;
void mousePressEvent(QMouseEvent * ) override;
void mouseDoubleClickEvent ( QMouseEvent * event ) override;
bool event(QEvent * event ) override;
void wheelEvent ( QWheelEvent * ) override;
void mouseMoveEvent( QMouseEvent * event ) override;
void mouseReleaseEvent(QMouseEvent * e ) override;
int getTopLeftSelection();
void setRoomSize( double );
void setExitSize( double );
void createLabel( QRectF labelRect );
TMap * mpMap;
QPointer<Host> mpHost;
int xzoom;
int yzoom;
int _rx;
int _ry;
QPoint mPHighlight;
bool mPick;
int mTarget;
//int mRoomSelection;
bool mStartSpeedWalk;
QMap<int, QPoint> mAreaExitList;
QMap<QString, QStringList> mUserActions; //string list: 0 is event name, 1 is menu it is under if it is
QMap<QString, QStringList> mUserMenus; //unique name, List:parent name ("" if null), display name
QPoint mMoveTarget;
bool mRoomBeingMoved;
QPoint mPHighlightMove;
float mTX;
float mTY;
int mChosenRoomColor;
float xspan;
float yspan;
bool mMultiSelection;
QRectF mMultiRect;
bool mPopupMenu;
QList<int> mMultiSelectionList;
QPoint mOldMousePos;
bool mNewMoveAction;
QRectF mMapInfoRect;
int mFontHeight;
bool mShowRoomID;
QMap<int,QPixmap> mPixMap;
// QMap<int, QPixmap > mGridPix;
int gzoom;
double rSize;
double eSize;
int mRID;
int mAID;
int mOx;
int mOy;
int mOz;
bool mShiftMode;
bool mShowInfo;
QComboBox * arealist_combobox;
QPointer<QDialog> mpCustomLinesDialog;
int mCustomLinesRoomFrom;
int mCustomLinesRoomTo;
QString mCustomLinesRoomExit;
QComboBox * mpCurrentLineStyle;
QString mCurrentLineStyle;
QPushButton * mpCurrentLineColor;
QColor mCurrentLineColor;
QCheckBox * mpCurrentLineArrow;
bool mCurrentLineArrow;
bool mShowGrid;
QPointF mLastMouseClick;
bool mBubbleMode;
bool mMapperUseAntiAlias;
bool mLabelHilite;
bool mMoveLabel;
int mCustomLineSelectedRoom;
QString mCustomLineSelectedExit;
int mCustomLineSelectedPoint;
QTreeWidget mMultiSelectionListWidget;
bool mSizeLabel;
bool gridMapSizeChange;
bool isCenterViewCall;
QString mHelpMsg;
signals:
public slots:
void slot_roomSelectionChanged();
void slot_deleteCustomExitLine();
void slot_moveLabel();
void slot_deleteLabel();
void slot_editLabel();
void slot_setPlayerLocation();
void slot_createLabel();
void slot_customLineColor();
void shiftZup();
void shiftZdown();
void switchArea(QString);
void toggleShiftMode();
void shiftUp();
void shiftDown();
void shiftLeft();
void shiftRight();
void slot_setCharacter();
void slot_setImage();
void slot_movePosition();
void slot_defineNewColor();
void slot_selectRoomColor(QListWidgetItem * pI );
void slot_moveRoom();
void slot_deleteRoom();
void slot_changeColor();
void slot_spread();
void slot_shrink();
void slot_setExits();
void slot_setUserData();
void slot_lockRoom();
void slot_unlockRoom();
void slot_setRoomWeight();
void slot_setArea();
void slot_setCustomLine();
void slot_setCustomLine2();
void slot_userAction(QString);
void slot_setCustomLine2B(QTreeWidgetItem*, int);
void slot_undoCustomLineLastPoint();
void slot_doneCustomLine();
void slot_customLineProperties();
void slot_customLineAddPoint();
void slot_customLineRemovePoint();
void slot_cancelCustomLineDialog();
private:
bool mDialogLock;
};
#endif // MUDLET_T2DMAP_H