Merge pull request #955 from kevlahnota/master
Adjust stack display & game credits
This commit is contained in:
@@ -74,6 +74,7 @@ public:
|
|||||||
static bool HasMusic;
|
static bool HasMusic;
|
||||||
static string systemError;
|
static string systemError;
|
||||||
static char mynbcardsStr[512];
|
static char mynbcardsStr[512];
|
||||||
|
static int mycredits;
|
||||||
static JMusic* music;
|
static JMusic* music;
|
||||||
static string currentMusicFile;
|
static string currentMusicFile;
|
||||||
static void playMusic(string filename = "", bool loop = true);
|
static void playMusic(string filename = "", bool loop = true);
|
||||||
|
|||||||
@@ -1394,6 +1394,8 @@ void ActionStack::Render()
|
|||||||
//renderer->FillRoundRect(x0 - 7, y0+2, width + 17, height + 2, 9.0f, ARGB(128,0,0,0));
|
//renderer->FillRoundRect(x0 - 7, y0+2, width + 17, height + 2, 9.0f, ARGB(128,0,0,0));
|
||||||
//stack fill
|
//stack fill
|
||||||
renderer->FillRect(x0 - 7, y0+2, width + 17, height + 14, ARGB(225,5,5,5));
|
renderer->FillRect(x0 - 7, y0+2, width + 17, height + 14, ARGB(225,5,5,5));
|
||||||
|
//top stack fill
|
||||||
|
renderer->FillRect(x0 - 6, y0+37, width + 15, 40.5f, ARGB(60,135,206,235));
|
||||||
//stack highlight
|
//stack highlight
|
||||||
renderer->FillRect(x0 - 6, y0+3, width + 15, 30, ARGB(255,89,89,89));
|
renderer->FillRect(x0 - 6, y0+3, width + 15, 30, ARGB(255,89,89,89));
|
||||||
//another border
|
//another border
|
||||||
@@ -1453,15 +1455,32 @@ void ActionStack::Render()
|
|||||||
|
|
||||||
currenty += kIconVerticalOffset + kSpacer;
|
currenty += kIconVerticalOffset + kSpacer;
|
||||||
|
|
||||||
|
float totalmHeight = 0.f;
|
||||||
|
for (size_t i = 0; i < mObjects.size(); i++)
|
||||||
|
{
|
||||||
|
Interruptible * current = (Interruptible *) mObjects[i];
|
||||||
|
if (current && current->state == NOT_RESOLVED)
|
||||||
|
totalmHeight += current->mHeight;
|
||||||
|
}
|
||||||
|
int sC = 0;//stack Count
|
||||||
for (size_t i = 0; i < mObjects.size(); i++)
|
for (size_t i = 0; i < mObjects.size(); i++)
|
||||||
{
|
{
|
||||||
Interruptible * current = (Interruptible *) mObjects[i];
|
Interruptible * current = (Interruptible *) mObjects[i];
|
||||||
if (current && current->state == NOT_RESOLVED)
|
if (current && current->state == NOT_RESOLVED)
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
current->x = x0;
|
current->x = x0;
|
||||||
current->y = currenty;
|
current->y = currenty;
|
||||||
current->Render();
|
current->Render();
|
||||||
|
|
||||||
|
currenty += current->mHeight;*/
|
||||||
|
sC+=1;
|
||||||
|
float cH = current->mHeight*sC;
|
||||||
|
current->x = x0;
|
||||||
|
current->y = (5+kIconVerticalOffset + kSpacer) + (totalmHeight - cH);
|
||||||
|
//render the stack object
|
||||||
|
current->Render();
|
||||||
|
|
||||||
currenty += current->mHeight;
|
currenty += current->mHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -183,9 +183,9 @@ void Credits::compute(GameObserver* g, GameApp * _app)
|
|||||||
if (p2->isAI() && g->didWin(p1))
|
if (p2->isAI() && g->didWin(p1))
|
||||||
{
|
{
|
||||||
gameLength = time(0) - g->startedAt;
|
gameLength = time(0) - g->startedAt;
|
||||||
value = 400;
|
value = 500;
|
||||||
if (app->gameType != GAME_TYPE_CLASSIC)
|
if (app->gameType == GAME_TYPE_MOMIR)
|
||||||
value = 200;
|
value = 800;//800 credits for momir
|
||||||
int difficulty = options[Options::DIFFICULTY].number;
|
int difficulty = options[Options::DIFFICULTY].number;
|
||||||
if (options[Options::DIFFICULTY_MODE_UNLOCKED].number && difficulty)
|
if (options[Options::DIFFICULTY_MODE_UNLOCKED].number && difficulty)
|
||||||
{
|
{
|
||||||
@@ -360,9 +360,9 @@ void Credits::computeTournament(GameObserver* g, GameApp * _app,bool tournament,
|
|||||||
PlayerData * playerdata = NEW PlayerData(MTGCollection());
|
PlayerData * playerdata = NEW PlayerData(MTGCollection());
|
||||||
if (p2->isAI() && mPlayerWin)
|
if (p2->isAI() && mPlayerWin)
|
||||||
{
|
{
|
||||||
value = 400;
|
value = 500;
|
||||||
if (app->gameType != GAME_TYPE_CLASSIC)
|
if (app->gameType == GAME_TYPE_MOMIR)
|
||||||
value = 200;
|
value = 800;
|
||||||
int difficulty = options[Options::DIFFICULTY].number;
|
int difficulty = options[Options::DIFFICULTY].number;
|
||||||
if (options[Options::DIFFICULTY_MODE_UNLOCKED].number && difficulty)
|
if (options[Options::DIFFICULTY_MODE_UNLOCKED].number && difficulty)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ JMusic * GameApp::music = NULL;
|
|||||||
string GameApp::currentMusicFile = "";
|
string GameApp::currentMusicFile = "";
|
||||||
string GameApp::systemError = "";
|
string GameApp::systemError = "";
|
||||||
char GameApp::mynbcardsStr[512] = {0};
|
char GameApp::mynbcardsStr[512] = {0};
|
||||||
|
int GameApp::mycredits = 0;
|
||||||
|
|
||||||
vector<JQuadPtr > manaIcons;
|
vector<JQuadPtr > manaIcons;
|
||||||
|
|
||||||
|
|||||||
@@ -187,6 +187,12 @@ void GameStateMenu::genNbCardsStr()
|
|||||||
sprintf(GameApp::mynbcardsStr, _("%i cards").c_str(),totalPrints);
|
sprintf(GameApp::mynbcardsStr, _("%i cards").c_str(),totalPrints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(playerdata)
|
||||||
|
{
|
||||||
|
if(playerdata->credits > 0)
|
||||||
|
GameApp::mycredits = playerdata->credits;
|
||||||
|
}
|
||||||
|
|
||||||
SAFE_DELETE(playerdata);
|
SAFE_DELETE(playerdata);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -835,7 +841,17 @@ void GameStateMenu::Render()
|
|||||||
renderer->RenderQuad(mBg.get(), SCREEN_WIDTH_F/2, 2, 0, 256 / mBg->mWidth, 166 / mBg->mHeight);
|
renderer->RenderQuad(mBg.get(), SCREEN_WIDTH_F/2, 2, 0, 256 / mBg->mWidth, 166 / mBg->mHeight);
|
||||||
|
|
||||||
RenderTopMenu();
|
RenderTopMenu();
|
||||||
|
//credits on lower left if available
|
||||||
|
std::ostringstream streamC;
|
||||||
|
streamC << "Credits: " << GameApp::mycredits;
|
||||||
|
mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
|
||||||
|
mFont->SetScale(1.f);
|
||||||
|
mFont->SetColor(ARGB(200,248,248,255));
|
||||||
|
mFont->DrawString(streamC.str(), 12, SCREEN_HEIGHT - 16);
|
||||||
|
mFont->SetColor(ARGB(255,255,255,255));
|
||||||
|
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
|
||||||
|
mFont = WResourceManager::Instance()->GetWFont(Fonts::MENU_FONT);
|
||||||
|
//end
|
||||||
}
|
}
|
||||||
if (subMenuController)
|
if (subMenuController)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user