* moved deck mana display code into separate method.
* since I rescaled the images down to 50%, I moved the display to the upper right info box on the last line to the right of the "# of games played" information. Things look like it will fit as long as the number of games is under 1000
This commit is contained in:
@@ -77,7 +77,8 @@ public:
|
|||||||
void Close();
|
void Close();
|
||||||
void updateScroller();
|
void updateScroller();
|
||||||
void RenderBackground();
|
void RenderBackground();
|
||||||
|
void RenderDeckManaColors();
|
||||||
|
|
||||||
static void destroy();
|
static void destroy();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -99,6 +99,37 @@ JGuiController(id, listener), fontId(fontId), mShowDetailsScreen( showDetailsOve
|
|||||||
updateScroller();
|
updateScroller();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeckMenu::RenderDeckManaColors()
|
||||||
|
{
|
||||||
|
JRenderer *renderer = JRenderer::GetInstance();
|
||||||
|
|
||||||
|
// display the deck mana colors if known
|
||||||
|
// We only want to display the mana symbols on the game screens and not the Deck Editor screens.
|
||||||
|
// Need a better way to determine where/when to display the mana symbols. Perhaps make it a property setting.
|
||||||
|
bool displayDeckMana = backgroundName.find("DeckMenuBackdrop") != string::npos;
|
||||||
|
// current set of coordinates puts the mana symbols to the right of the last stat info in the upper right
|
||||||
|
// box of the deck selection screen.
|
||||||
|
float manaIconX = 398;
|
||||||
|
float manaIconY = 55;
|
||||||
|
if (mSelectedDeck &&displayDeckMana)
|
||||||
|
{
|
||||||
|
string deckManaColors = mSelectedDeck->getColorIndex();
|
||||||
|
if ( deckManaColors.compare("") != 0 && ( deckManaColors.length() == 6 ))
|
||||||
|
{
|
||||||
|
for( int colorIdx = Constants::MTG_COLOR_GREEN; colorIdx < Constants::MTG_COLOR_LAND; ++colorIdx )
|
||||||
|
{
|
||||||
|
if ( (deckManaColors.at(colorIdx) == '1') != 0)
|
||||||
|
{
|
||||||
|
renderer->RenderQuad(manaIcons[colorIdx], manaIconX, manaIconY, 0, 0.5f, 0.5f);
|
||||||
|
manaIconX += 15;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (deckManaColors.compare("") != 0 )
|
||||||
|
DebugTrace("Error with color index string for "<< mSelectedDeck->getName() << ". [" << deckManaColors << "].");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void DeckMenu::RenderBackground()
|
void DeckMenu::RenderBackground()
|
||||||
{
|
{
|
||||||
ostringstream bgFilename;
|
ostringstream bgFilename;
|
||||||
@@ -248,30 +279,7 @@ void DeckMenu::Render()
|
|||||||
|
|
||||||
mScroller->Render();
|
mScroller->Render();
|
||||||
RenderBackground();
|
RenderBackground();
|
||||||
|
RenderDeckManaColors();
|
||||||
// display the deck mana colors if known
|
|
||||||
// We only want to display the mana symbols on the game screens and not the Deck Editor screens.
|
|
||||||
// Need a better way to determine when to display the mana symbols. Perhaps make it a property setting.
|
|
||||||
bool displayDeckMana = backgroundName.find("DeckMenuBackdrop") != string::npos;
|
|
||||||
float manaIconX = 300;
|
|
||||||
float manaIconY = 75;
|
|
||||||
if (mSelectedDeck &&displayDeckMana)
|
|
||||||
{
|
|
||||||
string deckManaColors = mSelectedDeck->getColorIndex();
|
|
||||||
if ( deckManaColors.compare("") != 0 && ( deckManaColors.length() == 6 ))
|
|
||||||
{
|
|
||||||
for( int colorIdx = Constants::MTG_COLOR_ARTIFACT; colorIdx < Constants::MTG_COLOR_LAND; ++colorIdx )
|
|
||||||
{
|
|
||||||
if ( (deckManaColors.at(colorIdx) == '1') != 0)
|
|
||||||
{
|
|
||||||
renderer->RenderQuad(manaIcons[colorIdx], manaIconX, manaIconY, 0, 0.6f, 0.6f);
|
|
||||||
manaIconX += 20;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (deckManaColors.compare("") != 0 )
|
|
||||||
DebugTrace("Error with color index string for "<< mSelectedDeck->getName() << ". [" << deckManaColors << "].");
|
|
||||||
}
|
|
||||||
|
|
||||||
renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE);
|
renderer->SetTexBlend(BLEND_SRC_ALPHA, BLEND_ONE);
|
||||||
stars->Render();
|
stars->Render();
|
||||||
|
|||||||
Reference in New Issue
Block a user