- display name of cards in the shop, when it loads, and any time by pressing triangle
This commit is contained in:
wagic.the.homebrew@gmail.com
2009-09-06 06:35:29 +00:00
parent 1d4b8ef177
commit 5a2a4a7617
3 changed files with 29 additions and 8 deletions

View File

@@ -53,7 +53,6 @@ class ShopItem:public JGuiObject{
class ShopItems:public JGuiController,public JGuiListener{
private:
int showList;
PlayerData * playerdata;
PriceList * pricelist;
int mX, mY, mHeight;
@@ -67,6 +66,7 @@ class ShopItems:public JGuiController,public JGuiListener{
void safeDeleteDisplay();
DeckDataWrapper * myCollection;
public:
bool showCardList;
ShopItems(int id, JGuiListener* listener, JLBFont* font, int x, int y, MTGAllCards * _collection, int _setIds[]);
~ShopItems();
void Render();

View File

@@ -162,7 +162,7 @@ void GameStateShop::Render()
itemFont->SetColor(ARGB(255,255,255,255));
char c[4096];
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);
itemFont->DrawString(c,SCREEN_WIDTH-len,SCREEN_HEIGHT-12);

View File

@@ -229,6 +229,7 @@ ShopItems::ShopItems(int id, JGuiListener* listener, JLBFont* font, int x, int y
setIds[i] = _setIds[i];
};
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");
}
else{
dialog->Update(dt);
dialog->Update(dt);
}
}else{
u32 buttons[] = {PSP_CTRL_LEFT,PSP_CTRL_DOWN,PSP_CTRL_RIGHT,PSP_CTRL_UP,PSP_CTRL_SQUARE};
for (int i = 0; i < 5; ++i){
if (JGE::GetInstance()->GetButtonClick(buttons[i])){
showList = 500;
u32 buttons[] = {PSP_CTRL_LEFT,PSP_CTRL_DOWN,PSP_CTRL_RIGHT,PSP_CTRL_UP,PSP_CTRL_CIRCLE};
for (int i = 0; i < 5; ++i){
if (JGE::GetInstance()->GetButtonClick(buttons[i])){
showCardList = false;
}
}
if (JGE::GetInstance()->GetButtonClick(PSP_CTRL_TRIANGLE)){
showCardList = !showCardList;
}
}
SAFE_DELETE(dialog);
JGuiController::Update(dt);
}
@@ -298,6 +302,23 @@ void ShopItems::Render(){
mFont->SetColor(ARGB(255,255,255,255));
mFont->DrawString(credits, 5, SCREEN_HEIGHT - 15);
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){