Erwan
- display name of cards in the shop, when it loads, and any time by pressing triangle
This commit is contained in:
@@ -53,7 +53,6 @@ class ShopItem:public JGuiObject{
|
|||||||
|
|
||||||
class ShopItems:public JGuiController,public JGuiListener{
|
class ShopItems:public JGuiController,public JGuiListener{
|
||||||
private:
|
private:
|
||||||
int showList;
|
|
||||||
PlayerData * playerdata;
|
PlayerData * playerdata;
|
||||||
PriceList * pricelist;
|
PriceList * pricelist;
|
||||||
int mX, mY, mHeight;
|
int mX, mY, mHeight;
|
||||||
@@ -67,6 +66,7 @@ class ShopItems:public JGuiController,public JGuiListener{
|
|||||||
void safeDeleteDisplay();
|
void safeDeleteDisplay();
|
||||||
DeckDataWrapper * myCollection;
|
DeckDataWrapper * myCollection;
|
||||||
public:
|
public:
|
||||||
|
bool showCardList;
|
||||||
ShopItems(int id, JGuiListener* listener, JLBFont* font, int x, int y, MTGAllCards * _collection, int _setIds[]);
|
ShopItems(int id, JGuiListener* listener, JLBFont* font, int x, int y, MTGAllCards * _collection, int _setIds[]);
|
||||||
~ShopItems();
|
~ShopItems();
|
||||||
void Render();
|
void Render();
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ void GameStateShop::Render()
|
|||||||
itemFont->SetColor(ARGB(255,255,255,255));
|
itemFont->SetColor(ARGB(255,255,255,255));
|
||||||
char c[4096];
|
char c[4096];
|
||||||
r->FillRect(0,SCREEN_HEIGHT-17,SCREEN_WIDTH,17,ARGB(128,0,0,0));
|
r->FillRect(0,SCREEN_HEIGHT-17,SCREEN_WIDTH,17,ARGB(128,0,0,0));
|
||||||
sprintf(c, _("press [] to refresh").c_str());
|
sprintf(c, _("[]:other cards /\\:list").c_str());
|
||||||
unsigned int len = 4 + itemFont->GetStringWidth(c);
|
unsigned int len = 4 + itemFont->GetStringWidth(c);
|
||||||
itemFont->DrawString(c,SCREEN_WIDTH-len,SCREEN_HEIGHT-12);
|
itemFont->DrawString(c,SCREEN_WIDTH-len,SCREEN_HEIGHT-12);
|
||||||
|
|
||||||
|
|||||||
@@ -229,6 +229,7 @@ ShopItems::ShopItems(int id, JGuiListener* listener, JLBFont* font, int x, int y
|
|||||||
setIds[i] = _setIds[i];
|
setIds[i] = _setIds[i];
|
||||||
};
|
};
|
||||||
myCollection = NEW DeckDataWrapper(NEW MTGDeck(options.profileFile(PLAYER_COLLECTION).c_str(), _collection));
|
myCollection = NEW DeckDataWrapper(NEW MTGDeck(options.profileFile(PLAYER_COLLECTION).c_str(), _collection));
|
||||||
|
showCardList = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -264,15 +265,18 @@ void ShopItems::Update(float dt){
|
|||||||
dialog->Add(2,"No");
|
dialog->Add(2,"No");
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
dialog->Update(dt);
|
dialog->Update(dt);
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
u32 buttons[] = {PSP_CTRL_LEFT,PSP_CTRL_DOWN,PSP_CTRL_RIGHT,PSP_CTRL_UP,PSP_CTRL_SQUARE};
|
u32 buttons[] = {PSP_CTRL_LEFT,PSP_CTRL_DOWN,PSP_CTRL_RIGHT,PSP_CTRL_UP,PSP_CTRL_CIRCLE};
|
||||||
for (int i = 0; i < 5; ++i){
|
for (int i = 0; i < 5; ++i){
|
||||||
if (JGE::GetInstance()->GetButtonClick(buttons[i])){
|
if (JGE::GetInstance()->GetButtonClick(buttons[i])){
|
||||||
showList = 500;
|
showCardList = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (JGE::GetInstance()->GetButtonClick(PSP_CTRL_TRIANGLE)){
|
||||||
|
showCardList = !showCardList;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
SAFE_DELETE(dialog);
|
SAFE_DELETE(dialog);
|
||||||
JGuiController::Update(dt);
|
JGuiController::Update(dt);
|
||||||
}
|
}
|
||||||
@@ -298,6 +302,23 @@ void ShopItems::Render(){
|
|||||||
mFont->SetColor(ARGB(255,255,255,255));
|
mFont->SetColor(ARGB(255,255,255,255));
|
||||||
mFont->DrawString(credits, 5, SCREEN_HEIGHT - 15);
|
mFont->DrawString(credits, 5, SCREEN_HEIGHT - 15);
|
||||||
if (display) display->Render();
|
if (display) display->Render();
|
||||||
|
|
||||||
|
if (showCardList){
|
||||||
|
JRenderer * r = JRenderer::GetInstance();
|
||||||
|
r->FillRoundRect(290,5, 160, mCount * 20 + 15,5,ARGB(200,0,0,0));
|
||||||
|
|
||||||
|
for (int i = 0; i< mCount; ++i){
|
||||||
|
if (!mObjects[i]) continue;
|
||||||
|
ShopItem * s = (ShopItem *)(mObjects[i]);
|
||||||
|
if (i == mCurr) mFont->SetColor(ARGB(255,255,255,0));
|
||||||
|
else mFont->SetColor(ARGB(255,255,255,255));
|
||||||
|
char buffer[512];
|
||||||
|
sprintf(buffer, "%s", s->getText());
|
||||||
|
float x = 300;
|
||||||
|
float y = 10 + 20*i;
|
||||||
|
mFont->DrawString(buffer,x,y);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShopItems::pricedialog(int id, int mode){
|
void ShopItems::pricedialog(int id, int mode){
|
||||||
|
|||||||
Reference in New Issue
Block a user