From 01145c458153ef6fd0f72f0f7d0cafd6499fcdc1 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sun, 7 Aug 2016 13:24:14 +0800 Subject: [PATCH] new adjustments --- projects/mtg/src/GuiHand.cpp | 4 ++-- projects/mtg/src/GuiPlay.cpp | 25 +++++++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/projects/mtg/src/GuiHand.cpp b/projects/mtg/src/GuiHand.cpp index 950585dd9..22daf0612 100644 --- a/projects/mtg/src/GuiHand.cpp +++ b/projects/mtg/src/GuiHand.cpp @@ -122,9 +122,9 @@ void GuiHandSelf::Repos() { float dist = 180.0f / cards.size(); if (dist > 20) - dist = 20.0; + dist = 18.0;//20.0 else - y = 40.0; + y = 35.0;//40.0 for (vector::iterator it = cards.begin(); it != cards.end(); ++it) { (*it)->x = ClosedRowX; diff --git a/projects/mtg/src/GuiPlay.cpp b/projects/mtg/src/GuiPlay.cpp index 0433eb9eb..718516537 100644 --- a/projects/mtg/src/GuiPlay.cpp +++ b/projects/mtg/src/GuiPlay.cpp @@ -62,12 +62,20 @@ void GuiPlay::HorzStack::Enstack(CardView* card) { card->x = x + baseX; card->y = y + baseY; - if (total < 8) + /*if (total < 8) x += CARD_WIDTH; else if (total < 16) x += (SCREEN_WIDTH - 200 - baseX) / total; 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) @@ -83,9 +91,10 @@ void GuiPlay::VertStack::Enstack(CardView* card) card->x = x + baseX; card->y = y + baseY; - y += 12; - if (++count == total - 1 && y == 12) - y += 12; + y += 8; + if (++count == total - 1 && y == 8) + y += 8; + //last value += 12... } 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) { //card->x = CARD_WIDTH + 20 + (currentAttacker * (HORZWIDTH) / (attackers+1)); - card->x = x + baseX; + card->x = x-12 + baseX; if (attackers+1 < 8) x += CARD_WIDTH; - else if (attackers+1 < 16) + else if (attackers+1 < 24) x += (SCREEN_WIDTH - 200 - baseX) / attackers+1; else - x += (HORZWIDTH - 50 - baseX) / attackers+1; + x += (HORZWIDTH - baseX) / attackers+1; card->y = baseY + (card->card->getObserver()->getView()->getRenderedPlayer() == card->card->controller() ? 20 + y : -20 - y); ++currentAttacker;