From 730b05ad1b221d5935295754113f5cb8676ede84 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sat, 30 Jul 2016 07:07:35 +0800 Subject: [PATCH] change enstack attackers their x position is the same in their "default" horizontal stack, so when attacking it always start at left side, not in the middle. Please report if you have bugs... --- projects/mtg/src/GuiPlay.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/projects/mtg/src/GuiPlay.cpp b/projects/mtg/src/GuiPlay.cpp index 02bbe0939..f0d14aa46 100644 --- a/projects/mtg/src/GuiPlay.cpp +++ b/projects/mtg/src/GuiPlay.cpp @@ -123,7 +123,15 @@ void GuiPlay::BattleField::reset(float x, float y) } 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; + if (total < 8) + x += CARD_WIDTH; + else if (total < 16) + x += (SCREEN_WIDTH - 200 - baseX) / total; + else + x += (SCREEN_WIDTH - 50 - baseX) / total; + card->y = baseY + (card->card->getObserver()->getView()->getRenderedPlayer() == card->card->controller() ? 20 + y : -20 - y); ++currentAttacker; // JRenderer::GetInstance()->RenderQuad(WResourceManager::Instance()->GetQuad("BattleIcon"), card->actX, card->actY, 0, 0.5 + 0.1 * sinf(JGE::GetInstance()->GetTime()), 0.5 + 0.1 * sinf(JGE::GetInstance()->GetTime()));