shop enhancements

This commit is contained in:
Anthony Calosa
2017-02-24 17:29:59 +08:00
parent d0b2340a73
commit 8feb870c8f
4 changed files with 29 additions and 9 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ public:
void rotateRight();
bool CheckUserInput(JButton key);
virtual void Update(float dt);
void Render();
void Render(bool norect = false);
void init(MTGGameZone * zone);
virtual ostream& toString(ostream& out) const;
};
+20 -3
View File
@@ -234,11 +234,24 @@ bool CardDisplay::CheckUserInput(JButton key)
return false;
}
void CardDisplay::Render()
void CardDisplay::Render(bool norect)
{
//norect - code shop
JRenderer * r = JRenderer::GetInstance();
r->DrawRect(static_cast<float> (x), static_cast<float> (y), static_cast<float> (nb_displayed_items * 30 + 20), 50,
if(norect)
r->FillRect(0,0,SCREEN_WIDTH_F,SCREEN_HEIGHT_F,ARGB(180,5,5,5));
if(norect)
{
r->FillRect(static_cast<float> (x), static_cast<float> (y), static_cast<float> (nb_displayed_items * 30 + 20), 50,
ARGB(200,5,5,5));
r->DrawRect(static_cast<float> (x), static_cast<float> (y), static_cast<float> (nb_displayed_items * 30 + 20), 50,
ARGB(255,240,240,240));
r->DrawRect(static_cast<float> (x)+1, static_cast<float> (y)+1, static_cast<float> (nb_displayed_items * 30 + 20)-2, 50-2,
ARGB(255,89,89,89));
}
else
r->DrawRect(static_cast<float> (x), static_cast<float> (y), static_cast<float> (nb_displayed_items * 30 + 20), 50,
ARGB(255,255,255,255));
if (!mObjects.size()) return;
for (int i = start_item; i < start_item + nb_displayed_items && i < (int)(mObjects.size()); i++)
@@ -268,6 +281,10 @@ void CardDisplay::Render()
CardGui * cardg = ((CardGui *) mObjects[mCurr]);
//Pos pos = Pos(CardGui::BigWidth / 2, CardGui::BigHeight / 2 - 10, 1.0, 0.0, 220);
Pos pos = Pos((CardGui::BigWidth / 2), CardGui::BigHeight / 2 - 10, 0.80f, 0.0, 220);
if(norect)
pos = Pos((SCREEN_WIDTH - CardGui::BigWidth / 2)+5, CardGui::BigHeight / 2 - 7, 1.0, 0.0, 220);
int drawMode = DrawMode::kNormal;
if (observer)
{
+2 -1
View File
@@ -543,7 +543,8 @@ void CardGui::Render()
myA = 0;
shadow->SetColor(ARGB(myA,255,255,255));
renderer->RenderQuad(shadow.get(), actX, actY, actT, (28 * actZ + 1) / 16, 40 * actZ / 16);
if(myA > 0)
renderer->RenderQuad(shadow.get(), actX, actY, actT, (28 * actZ + 1) / 16, 40 * actZ / 16);
}
}
+6 -4
View File
@@ -308,7 +308,7 @@ void GameStateShop::purchaseBooster(int controlId)
SAFE_DELETE(booster);
deleteDisplay();
booster = NEW MTGDeck(MTGCollection());
boosterDisplay = NEW BoosterDisplay(12, NULL, SCREEN_WIDTH - 200, SCREEN_HEIGHT / 2, this, NULL, 5);
boosterDisplay = NEW BoosterDisplay(12, NULL, 30, SCREEN_HEIGHT/2, this, NULL, 7);
mBooster[controlId].addToDeck(booster, srcCards);
string sort = mBooster[controlId].getSort();
@@ -726,7 +726,7 @@ void GameStateShop::Render()
else
{
if (boosterDisplay)
boosterDisplay->Render();
boosterDisplay->Render(true);
else if (bigDisplay)
{
if (bigDisplay->mOffset.getPos() >= 0)
@@ -743,7 +743,9 @@ void GameStateShop::Render()
{
alpha = static_cast<int> (800 * (elp - LIST_FADEIN));
}
r->FillRoundRect(300, 10, 160, SHOP_SLOTS * 20 + 15, 5, ARGB(alpha,0,0,0));
//r->FillRoundRect(300, 10, 160, SHOP_SLOTS * 20 + 15, 5, ARGB(alpha,0,0,0));
r->FillRect(297, 9.5f, 175, SHOP_SLOTS * 20 + 31, ARGB(alpha,0,0,0));
r->DrawRect(297, 9.5f, 175, SHOP_SLOTS * 20 + 31, ARGB(alpha,20,20,20));
alpha += 55;
for (int i = 0; i < SHOP_SLOTS; i++)
{
@@ -788,7 +790,7 @@ void GameStateShop::Render()
if (menu)
menu->Render();
if (!filterMenu || (filterMenu && filterMenu->isFinished()))
if ((!filterMenu || (filterMenu && filterMenu->isFinished()))&&!boosterDisplay)
renderButtons();
}