added the name of the selected player deck when selecting an opponent.
added deck names to screen when bringing up the menu during a match. The deck names appear below the AI avatar and above the player avatar. fixed a mem leak in ZipArchive.mm
This commit is contained in:
@@ -350,7 +350,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Copy name to array
|
// Copy name to array
|
||||||
[AllFilenames addObject:[strPath copy]];
|
[AllFilenames addObject:[[strPath copy] autorelease]];
|
||||||
|
|
||||||
unzCloseCurrentFile( _unzFile );
|
unzCloseCurrentFile( _unzFile );
|
||||||
ret = unzGoToNextFile( _unzFile );
|
ret = unzGoToNextFile( _unzFile );
|
||||||
|
|||||||
@@ -498,8 +498,7 @@ void GameStateDuel::Update(float dt)
|
|||||||
{
|
{
|
||||||
if (!menu)
|
if (!menu)
|
||||||
{
|
{
|
||||||
menu = NEW SimpleMenu(JGE::GetInstance(), DUEL_MENU_GAME_MENU, this, Fonts::MENU_FONT, SCREEN_WIDTH / 2 - 100, 25,
|
menu = NEW SimpleMenu(JGE::GetInstance(), DUEL_MENU_GAME_MENU, this, Fonts::MENU_FONT, SCREEN_WIDTH / 2 - 100, 25);
|
||||||
game->players[1]->deckName.c_str());
|
|
||||||
int cardsinhand = game->currentPlayer->game->hand->nb_cards;
|
int cardsinhand = game->currentPlayer->game->hand->nb_cards;
|
||||||
|
|
||||||
//almosthumane - mulligan
|
//almosthumane - mulligan
|
||||||
@@ -686,7 +685,12 @@ void GameStateDuel::Render()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (opponentMenu && !opponentMenu->isClosed())
|
if (opponentMenu && !opponentMenu->isClosed())
|
||||||
|
{
|
||||||
opponentMenu->Render();
|
opponentMenu->Render();
|
||||||
|
// display the selected player deck name too
|
||||||
|
string selectedPlayerDeckName = "Player Deck: " + deckmenu->getSelectedDeck()->getName();
|
||||||
|
mFont->DrawString( selectedPlayerDeckName.c_str(), 30, 40);
|
||||||
|
}
|
||||||
else if (deckmenu && !deckmenu->isClosed()) deckmenu->Render();
|
else if (deckmenu && !deckmenu->isClosed()) deckmenu->Render();
|
||||||
|
|
||||||
if (menu) menu->Render();
|
if (menu) menu->Render();
|
||||||
@@ -715,7 +719,16 @@ void GameStateDuel::Render()
|
|||||||
mFont->DrawString(buffer, SCREEN_WIDTH / 2, 0, JGETEXT_CENTER);
|
mFont->DrawString(buffer, SCREEN_WIDTH / 2, 0, JGETEXT_CENTER);
|
||||||
}
|
}
|
||||||
if (menu)
|
if (menu)
|
||||||
|
{
|
||||||
menu->Render();
|
menu->Render();
|
||||||
|
|
||||||
|
// display the player deck names in their respective corners
|
||||||
|
string playerDeckName = game->players[0]->deckName;
|
||||||
|
string opponentDeckName = game->players[1]->deckName;
|
||||||
|
float playerDeckNamePixelLength = mFont->GetStringWidth(playerDeckName.c_str());
|
||||||
|
mFont->DrawString( opponentDeckName, 0, 50);
|
||||||
|
mFont->DrawString( playerDeckName, SCREEN_WIDTH_F - playerDeckNamePixelLength, SCREEN_HEIGHT_F - 50);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user