some improve game ui and bugfixes
This commit is contained in:
@@ -73,7 +73,9 @@ void AD_Graphics::mousePressEvent(QMouseEvent *event)
|
||||
// scene->clearSelection();
|
||||
if (event->button() == Qt::LeftButton)
|
||||
{
|
||||
if (m_building) emit add_tow((QPointF(event->pos())/cellSize).toPoint());
|
||||
if (m_building)
|
||||
emit add_tow((QPointF(event->pos())/cellSize).toPoint(),
|
||||
event->modifiers().testFlag(Qt::ShiftModifier));
|
||||
else
|
||||
{
|
||||
QList<QGraphicsItem*> list = scene->items(event->pos(), Qt::IntersectsItemBoundingRect, Qt::AscendingOrder);
|
||||
@@ -126,7 +128,7 @@ void AD_Graphics::timerEvent(QTimerEvent * )
|
||||
} else selection_tow->hide();
|
||||
selection_tow->next();
|
||||
selection_al->next();
|
||||
if (!core->isWaveEnd())
|
||||
if (core->isWaveEnd())
|
||||
scene->update();
|
||||
}
|
||||
|
||||
@@ -185,6 +187,7 @@ void AD_Graphics::alienKilled(int id)
|
||||
{
|
||||
if (select_al != 0) if (select_al->id() == id) select_al = 0;
|
||||
QPainter p(mapimg);
|
||||
p.setCompositionMode(QPainter::CompositionMode_Plus);
|
||||
p.translate((core->addata->aliens->curAliens[id].pos+QPointF(0.5,0.5))*cellSize);
|
||||
p.drawImage(core->addata->bloodrect, *(core->addata->blood));
|
||||
p.end();
|
||||
|
||||
Reference in New Issue
Block a user