fix crash bug when buying a card pack
This fixes the shop crashing the game when you buy a card packs in the shop. The targeting indicator looks at the stack so it needs to be enabled only when you're in the "game"...
This commit is contained in:
@@ -248,15 +248,18 @@ void CardGui::Render()
|
|||||||
renderer->RenderQuad(fakeborder.get(), actX, actY, actT, (29 * actZ + 1) / 16, 42 * actZ / 16);
|
renderer->RenderQuad(fakeborder.get(), actX, actY, actT, (29 * actZ + 1) / 16, 42 * actZ / 16);
|
||||||
}
|
}
|
||||||
//draw border for highlighting
|
//draw border for highlighting
|
||||||
if (card && card->isTargetted() && highlightborder)
|
if (game)
|
||||||
{
|
{
|
||||||
highlightborder->SetColor(ARGB(95,255,0,0));
|
if (card && card->isTargetted() && highlightborder)
|
||||||
renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16);
|
{
|
||||||
}
|
highlightborder->SetColor(ARGB(95,255,0,0));
|
||||||
if (card && card->isTargetter() && highlightborder)
|
renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16);
|
||||||
{
|
}
|
||||||
highlightborder->SetColor(ARGB(95,0,245,0));
|
if (card && card->isTargetter() && highlightborder)
|
||||||
renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16);
|
{
|
||||||
|
highlightborder->SetColor(ARGB(95,0,245,0));
|
||||||
|
renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
//draw the card image
|
//draw the card image
|
||||||
renderer->RenderQuad(quad.get(), actX, actY, actT, scale, scale);
|
renderer->RenderQuad(quad.get(), actX, actY, actT, scale, scale);
|
||||||
@@ -300,29 +303,32 @@ void CardGui::Render()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//draw line
|
//draw line
|
||||||
if (card && card->isTargetted())
|
if (game)
|
||||||
{
|
{
|
||||||
if(card->isTapped())
|
if (card && card->isTargetted())
|
||||||
{
|
{
|
||||||
if(mHasFocus)
|
if(card->isTapped())
|
||||||
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-10,actY - (scale * quad->mHeight / 2)+6.5f, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,255,0,0));
|
{
|
||||||
|
if(mHasFocus)
|
||||||
|
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-10,actY - (scale * quad->mHeight / 2)+6.5f, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,255,0,0));
|
||||||
|
else
|
||||||
|
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-8,actY - (scale * quad->mHeight / 2)+4, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,255,0,0));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-8,actY - (scale * quad->mHeight / 2)+4, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,255,0,0));
|
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-2,actY - (scale * quad->mHeight / 2)-2, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 1.8f,ARGB(250,255,0,0));
|
||||||
}
|
}
|
||||||
else
|
if (card && card->isTargetter())
|
||||||
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-2,actY - (scale * quad->mHeight / 2)-2, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 1.8f,ARGB(250,255,0,0));
|
|
||||||
}
|
|
||||||
if (card && card->isTargetter())
|
|
||||||
{
|
|
||||||
if(card->isTapped())
|
|
||||||
{
|
{
|
||||||
if(mHasFocus)
|
if(card->isTapped())
|
||||||
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-10,actY - (scale * quad->mHeight / 2)+6.5f, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,0,255,0));
|
{
|
||||||
|
if(mHasFocus)
|
||||||
|
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-10,actY - (scale * quad->mHeight / 2)+6.5f, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,0,255,0));
|
||||||
|
else
|
||||||
|
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-8,actY - (scale * quad->mHeight / 2)+4, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,0,255,0));
|
||||||
|
}
|
||||||
else
|
else
|
||||||
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-8,actY - (scale * quad->mHeight / 2)+4, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,0,255,0));
|
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-2,actY - (scale * quad->mHeight / 2)-2, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 1.8f,ARGB(250,0,255,0));
|
||||||
}
|
}
|
||||||
else
|
|
||||||
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-2,actY - (scale * quad->mHeight / 2)-2, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 1.8f,ARGB(250,0,255,0));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//draws the numbers power/toughness
|
//draws the numbers power/toughness
|
||||||
|
|||||||
Reference in New Issue
Block a user