- shop shows default thumbnails if no image available
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-08-22 12:31:14 +00:00
parent a59fb35d78
commit 61ebbbe497

View File

@@ -71,7 +71,17 @@ ShopItem::ShopItem(int id, JLBFont *font, int _cardid, float _xy[], bool hasFocu
thumb = cache.getThumb(card);
if (!thumb) thumb = GameApp::CommonRes->GetQuad("back_thumb");
if (!thumb){
switch(card->getColor())
{
case Constants::MTG_COLOR_GREEN: thumb = GameApp::CommonRes->GetQuad("green_thumb"); break;
case Constants::MTG_COLOR_BLUE : thumb = GameApp::CommonRes->GetQuad("blue_thumb"); break;
case Constants::MTG_COLOR_RED : thumb = GameApp::CommonRes->GetQuad("red_thumb"); break;
case Constants::MTG_COLOR_BLACK: thumb = GameApp::CommonRes->GetQuad("black_thumb"); break;
case Constants::MTG_COLOR_WHITE: thumb = GameApp::CommonRes->GetQuad("white_thumb"); break;
default: thumb = GameApp::CommonRes->GetQuad("black_thumb"); break;
}
}
if (thumb){
mesh=NEW hgeDistortionMesh(2,2);
mesh->SetTexture(thumb->mTex);
@@ -161,7 +171,7 @@ void ShopItem::Render(){
quad->SetColor(ARGB(255,255,255,255));
renderer->RenderQuad(quad,SCREEN_WIDTH - 105,SCREEN_HEIGHT/2 - 5,0, 0.9f,0.9f);
}else{
if (card) CardGui::alternateRender(card,Pos(SCREEN_WIDTH/2 + 100 + 20,133,0.9f* 285/250, 0,255));
if (card) CardGui::alternateRender(card,Pos(SCREEN_WIDTH - 105,SCREEN_HEIGHT/2 - 5,0.9f* 285/250, 0,255));
}
mFont->DrawString(mText.c_str(), SCREEN_WIDTH/2 - 50, SCREEN_HEIGHT - 16,JGETEXT_CENTER);