added morphs, fix some bugs, new images
added onAlienInRadius trigger but it not work right((
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
#include <QGraphicsWidget>
|
||||
#include <QPushButton>
|
||||
#include <QMouseEvent>
|
||||
#include <QEasingCurve>
|
||||
|
||||
#include "adcore.h"
|
||||
|
||||
@@ -14,42 +15,43 @@ class AD_Graphics: public QGraphicsView
|
||||
Q_PROPERTY(bool building READ building WRITE setBuilding)
|
||||
public:
|
||||
explicit AD_Graphics(AD_Core * core, QWidget * parent = 0);
|
||||
QPoint selectedTower() {if (select_tow != 0) return select_tow->tid(); else return QPoint();}
|
||||
int selectedAlien() {if (select_al != 0) return select_al->id(); else return -1;}
|
||||
~AD_Graphics();
|
||||
|
||||
bool building() const
|
||||
{
|
||||
return m_building;
|
||||
}
|
||||
bool building() const {return m_building;}
|
||||
|
||||
public slots:
|
||||
void setBuilding(bool arg)
|
||||
{
|
||||
m_building = arg;
|
||||
}
|
||||
void selectTower(ADItem * item) {select_tow = item;}
|
||||
void setBuilding(bool arg) {m_building = arg;}
|
||||
void alienKilled(int id) {if (select_al != 0) if (select_al->id() == id) select_al = 0;}
|
||||
void towerKilled(QPoint id) {if (select_tow != 0) if (select_tow->tid() == id) {select_tow = 0; emit selected_tower_changed(QPoint());}}
|
||||
|
||||
private:
|
||||
void drawBackground(QPainter * p, const QRectF &);
|
||||
void drawForeground(QPainter *painter, const QRectF &rect);
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
void mouseMoveEvent(QMouseEvent *event);
|
||||
|
||||
QGraphicsScene * scene;
|
||||
AD_Core * core;
|
||||
QImage * mapimg;
|
||||
Game_Data * data;
|
||||
ADItem * focus_item;
|
||||
ADItem * select_al;
|
||||
ADItem * select_tow;
|
||||
ADItem * selection_tow;
|
||||
ADItem * selection_al;
|
||||
QEasingCurve color_curve;
|
||||
|
||||
bool m_building;
|
||||
|
||||
private slots:
|
||||
|
||||
protected:
|
||||
|
||||
void timerEvent(QTimerEvent * );
|
||||
signals:
|
||||
|
||||
signals:
|
||||
void cancel();
|
||||
void add_tow(QPoint pnt);
|
||||
void tower_select(QPoint id);
|
||||
void alien_select(int id);
|
||||
void selected_tower_changed(QPoint id);
|
||||
};
|
||||
|
||||
#endif // AD_GRAPHICS_H
|
||||
|
||||
Reference in New Issue
Block a user