Merge pull request #839 from kevlahnota/master

Fix Enstack Attackers
This commit is contained in:
Anthony Calosa
2016-08-07 13:24:54 +08:00
committed by GitHub
2 changed files with 21 additions and 12 deletions
+2 -2
View File
@@ -122,9 +122,9 @@ void GuiHandSelf::Repos()
{ {
float dist = 180.0f / cards.size(); float dist = 180.0f / cards.size();
if (dist > 20) if (dist > 20)
dist = 20.0; dist = 18.0;//20.0
else else
y = 40.0; y = 35.0;//40.0
for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it) for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it)
{ {
(*it)->x = ClosedRowX; (*it)->x = ClosedRowX;
+19 -10
View File
@@ -62,12 +62,20 @@ void GuiPlay::HorzStack::Enstack(CardView* card)
{ {
card->x = x + baseX; card->x = x + baseX;
card->y = y + baseY; card->y = y + baseY;
if (total < 8) /*if (total < 8)
x += CARD_WIDTH; x += CARD_WIDTH;
else if (total < 16) else if (total < 16)
x += (SCREEN_WIDTH - 200 - baseX) / total; x += (SCREEN_WIDTH - 200 - baseX) / total;
else else
x += (SCREEN_WIDTH - 50 - baseX) / total; x += (SCREEN_WIDTH - 50 - baseX) / total;*/
// new adjustment
if (total < 8)
x += CARD_WIDTH;
else if (total < 24)
x += (SCREEN_WIDTH - 200 - baseX) / total;
else
x += (SCREEN_WIDTH - 70 - baseX) / total;
} }
void GuiPlay::VertStack::Enstack(CardView* card) void GuiPlay::VertStack::Enstack(CardView* card)
@@ -83,9 +91,10 @@ void GuiPlay::VertStack::Enstack(CardView* card)
card->x = x + baseX; card->x = x + baseX;
card->y = y + baseY; card->y = y + baseY;
y += 12; y += 8;
if (++count == total - 1 && y == 12) if (++count == total - 1 && y == 8)
y += 12; y += 8;
//last value += 12...
} }
void GuiPlay::VertStack::Render(CardView* card, iterator begin, iterator end) void GuiPlay::VertStack::Render(CardView* card, iterator begin, iterator end)
@@ -124,13 +133,13 @@ void GuiPlay::BattleField::reset(float x, float y)
void GuiPlay::BattleField::EnstackAttacker(CardView* card) void GuiPlay::BattleField::EnstackAttacker(CardView* card)
{ {
//card->x = CARD_WIDTH + 20 + (currentAttacker * (HORZWIDTH) / (attackers+1)); //card->x = CARD_WIDTH + 20 + (currentAttacker * (HORZWIDTH) / (attackers+1));
card->x = x + baseX; card->x = x-12 + baseX;
if (total < 8) if (attackers+1 < 8)
x += CARD_WIDTH; x += CARD_WIDTH;
else if (total < 16) else if (attackers+1 < 24)
x += (SCREEN_WIDTH - 200 - baseX) / total; x += (SCREEN_WIDTH - 200 - baseX) / attackers+1;
else else
x += (SCREEN_WIDTH - 50 - baseX) / total; x += (HORZWIDTH - baseX) / attackers+1;
card->y = baseY + (card->card->getObserver()->getView()->getRenderedPlayer() == card->card->controller() ? 20 + y : -20 - y); card->y = baseY + (card->card->getObserver()->getView()->getRenderedPlayer() == card->card->controller() ? 20 + y : -20 - y);
++currentAttacker; ++currentAttacker;