From f142363bfa1f48a82957f888890880846b80dda9 Mon Sep 17 00:00:00 2001 From: Anthony Calosa Date: Sun, 24 Jul 2016 12:40:41 +0800 Subject: [PATCH] smaller scaled big quad and forced border Ingame big quads are scaled smaller --- projects/mtg/src/ActionStack.cpp | 21 +++++++++++++++++++-- projects/mtg/src/CardSelector.cpp | 25 ++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 3 deletions(-) diff --git a/projects/mtg/src/ActionStack.cpp b/projects/mtg/src/ActionStack.cpp index 6d9620ec7..e93fa2f22 100644 --- a/projects/mtg/src/ActionStack.cpp +++ b/projects/mtg/src/ActionStack.cpp @@ -130,8 +130,25 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string if (bigQuad) { - Pos pos = Pos(CardGui::BigWidth / 2, CardGui::BigHeight / 2 - 10, 1.0, 0.0, 220); - CardGui::DrawCard(source, pos, observer->getCardSelector()->GetDrawMode()); + //Pos pos = Pos(CardGui::BigWidth / 2, CardGui::BigHeight / 2 - 10, 1.0, 0.0, 220); + Pos npos = Pos(CardGui::BigWidth / 2 + 8.f, CardGui::BigHeight / 2 - 2.f, 1.0f - (1.0f/10), 0.0, 220); + //border + if(observer->getCardSelector()->GetDrawMode() < 2) + { + string cardsetname = setlist[source->setId].c_str(); + if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR"||cardsetname == "DM") + { + JRenderer::GetInstance()->FillRoundRect((npos.actX - (npos.actZ * 84.f))-10.f,(npos.actY - (npos.actZ * 119.7f))-12.5f,npos.actZ * 168.f + 6.5f,npos.actZ * 239.4f + 12.f,6.5f,ARGB(255,248,248,255)); + JRenderer::GetInstance()->DrawRoundRect((npos.actX - (npos.actZ * 84.f))-10.f,(npos.actY - (npos.actZ * 119.7f))-12.5f,npos.actZ * 168.f + 6.5f,npos.actZ * 239.4f + 12.f,6.5f,ARGB(150,20,20,20)); + } + else + { + JRenderer::GetInstance()->FillRoundRect((npos.actX - (npos.actZ * 84.f))-10.f,(npos.actY - (npos.actZ * 119.7f))-12.5f,npos.actZ * 168.f + 6.5f,npos.actZ * 239.4f + 12.f,6.5f,ARGB(255,5,5,5)); + JRenderer::GetInstance()->DrawRoundRect((npos.actX - (npos.actZ * 84.f))-10.f,(npos.actY - (npos.actZ * 119.7f))-12.5f,npos.actZ * 168.f + 6.5f,npos.actZ * 239.4f + 12.f,6.5f,ARGB(50,240,240,240)); + } + } + //render card + CardGui::DrawCard(source, npos, observer->getCardSelector()->GetDrawMode(),false,true); } if (targetQuad) diff --git a/projects/mtg/src/CardSelector.cpp b/projects/mtg/src/CardSelector.cpp index 3a7de16a7..1e82f44ea 100644 --- a/projects/mtg/src/CardSelector.cpp +++ b/projects/mtg/src/CardSelector.cpp @@ -340,7 +340,30 @@ void CardSelector::Render() if (CardView* card = dynamic_cast(active) ) { if(timer > 0) - card->DrawCard(bigpos, mDrawMode); + { + float modx = 0.f; + //if(card->mHasFocus && observer->isInHand(card->getCard()) && !card->getCard()->owner->isAI()) + //modx -= 1.8f;//todo small adjustment + //new npos for smaller bigquad + Pos npos = Pos(bigpos.x+7.f+modx,bigpos.y-4.f,bigpos.zoom-(bigpos.zoom/10),bigpos.t,bigpos.alpha); + //border + if(mDrawMode < 2) + { + string cardsetname = setlist[card->getCard()->setId].c_str(); + if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR"||cardsetname == "DM") + { + JRenderer::GetInstance()->FillRoundRect((npos.actX - (npos.actZ * 84.f))-10.f,(npos.actY - (npos.actZ * 119.7f))-12.5f,npos.actZ * 168.f + 6.5f,npos.actZ * 239.4f + 12.f,6.5f,ARGB(255,248,248,255)); + JRenderer::GetInstance()->DrawRoundRect((npos.actX - (npos.actZ * 84.f))-10.f,(npos.actY - (npos.actZ * 119.7f))-12.5f,npos.actZ * 168.f + 6.5f,npos.actZ * 239.4f + 12.f,6.5f,ARGB(150,20,20,20)); + } + else + { + JRenderer::GetInstance()->FillRoundRect((npos.actX - (npos.actZ * 84.f))-10.f,(npos.actY - (npos.actZ * 119.7f))-12.5f,npos.actZ * 168.f + 6.5f,npos.actZ * 239.4f + 12.f,6.5f,ARGB(255,5,5,5)); + JRenderer::GetInstance()->DrawRoundRect((npos.actX - (npos.actZ * 84.f))-10.f,(npos.actY - (npos.actZ * 119.7f))-12.5f,npos.actZ * 168.f + 6.5f,npos.actZ * 239.4f + 12.f,6.5f,ARGB(50,240,240,240)); + } + } + //render card + card->DrawCard(npos, mDrawMode, false, true); + } } } }