Merge branch 'NicolasMerge' into devel

This commit is contained in:
Max-Wilhelm Bruker 2012-06-03 19:23:48 +02:00
commit 17c8bdb1cd
11 changed files with 95 additions and 14 deletions

View file

@ -60,6 +60,7 @@
<file>resources/countries/br.svg</file>
<file>resources/countries/by.svg</file>
<file>resources/countries/ca.svg</file>
<file>resources/countries/cl.svg</file>
<file>resources/countries/cz.svg</file>
<file>resources/countries/ch.svg</file>
<file>resources/countries/cn.svg</file>
@ -96,6 +97,7 @@
<file>resources/countries/ua.svg</file>
<file>resources/countries/uk.svg</file>
<file>resources/countries/us.svg</file>
<file>resources/countries/ve.svg</file>
<file>resources/countries/za.svg</file>
<file>resources/counters/w.svg</file>

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xlink="http://www.w3.org/1999/xlink"
width="1500"
height="1000"
version="1.1">
<rect width="1500" height="1000" fill="#fff"/>
<rect
width="500"
height="1000"
fill="#0039A6"/>
<rect width="1500" height="500"
y="500" fill="#D52B1E"/><g id="star"
transform="translate(250,250) scale(125)"
fill="#fff">
<g id="cone">
<polygon
id="triangle"
points="0,0 0,1 .5,1" transform="translate(0,-1) rotate(18)"/><use
xlink:href="#triangle"
transform="scale(-1,1)" id="use12"/>
</g>
<use
xlink:href="#cone" transform="rotate(72)" id="use14"/>
<use xlink:href="#cone" transform="rotate(-72)"
id="use16"/>
<use xlink:href="#cone" transform="rotate(144)" id="use18"/>
<use
xlink:href="#cone"
transform="rotate(-144)"
id="use20"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 884 B

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.0" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="900" height="600">
<rect width="900" height="210" fill="#f7d117"/>
<rect y="200" width="900" height="210" fill="#0033ab"/>
<rect y="400" width="900" height="200" fill="#cf142b"/>
<g id="s" transform="rotate(-70 450,420) translate(450,240)" fill="#fff">
<g id="c">
<path id="t" d="M 0,-30 V 0 H 15" transform="rotate(18 0,-30)"/>
<use xlink:href="#t" transform="scale(-1,1)"/>
</g>
<use xlink:href="#c" transform="rotate(72)"/>
<use xlink:href="#c" transform="rotate(144)"/>
<use xlink:href="#c" transform="rotate(216)"/>
<use xlink:href="#c" transform="rotate(288)"/>
</g>
<use xlink:href="#s" transform="rotate(20 450,420)"/>
<use xlink:href="#s" transform="rotate(40 450,420)"/>
<use xlink:href="#s" transform="rotate(60 450,420)"/>
<use xlink:href="#s" transform="rotate(80 450,420)"/>
<use xlink:href="#s" transform="rotate(100 450,420)"/>
<use xlink:href="#s" transform="rotate(120 450,420)"/>
<use xlink:href="#s" transform="rotate(140 450,420)"/>
</svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -39,19 +39,31 @@ void HandZone::addCardImpl(CardItem *card, int x, int /*y*/)
card->update();
}
void HandZone::handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint &/*dropPoint*/)
void HandZone::handleDropEvent(const QList<CardDragItem *> &dragItems, CardZone *startZone, const QPoint & dropPoint)
{
QPoint point = dropPoint + scenePos().toPoint();
int x = -1;
if (settingsCache->getHorizontalHand()) {
for (x = 0; x < cards.size(); x++)
if (point.x() < ((CardItem *) cards.at(x))->scenePos().x())
break;
} else {
for (x = 0; x < cards.size(); x++)
if (point.y() < ((CardItem *) cards.at(x))->scenePos().y())
break;
}
Command_MoveCard cmd;
cmd.set_start_player_id(startZone->getPlayer()->getId());
cmd.set_start_zone(startZone->getName().toStdString());
cmd.set_target_player_id(player->getId());
cmd.set_target_zone(getName().toStdString());
cmd.set_x(cards.size());
cmd.set_x(x);
cmd.set_y(-1);
for (int i = 0; i < dragItems.size(); ++i)
cmd.mutable_cards_to_move()->add_card()->set_card_id(dragItems[i]->getId());
player->sendGameCommand(cmd);
}