Jeck - [JGE recompile needed] Shop cleanup, Interface enhancements.

Added basic transition system that works with GameApp's phases. Currently does a fade-out between elements, which works well in some places and not-so-well in others. We'll definitely want to think about where and where not to use it... they'd work a lot better if we could spawn a thread to handle loading the next state while transitioning.

Also cleaned up the shop a bit, so it uses ReadButton() instead of GetButtonClick()-- hence the slight change to JGE. Added a tiled image for the task board, which loads conservatively (I tried 128x128, but it didn't look as good).
This commit is contained in:
wagic.jeck
2010-02-01 18:27:25 +00:00
parent e999da6ef7
commit 0a863bcbad
21 changed files with 1619 additions and 1291 deletions

View File

@@ -19,7 +19,7 @@
#include <time.h>
#endif
enum ENUM_DUEL_STATEseems
enum ENUM_DUEL_STATE
{
DUEL_STATE_START,
DUEL_STATE_END,
@@ -97,11 +97,14 @@ void GameStateDuel::Start()
}
}
if(deckmenu){
if (decksneeded){
deckmenu->Add(-1,_("Create your Deck!").c_str(),"Highly recommended to get\nthe full Wagic experience!");
premadeDeck = true;
fillDeckMenu(deckmenu,RESPATH"/player/premade");
}
deckmenu->Add(-1,_("New Deck...").c_str());
}
for (int i = 0; i < 2; ++i){
mPlayers[i] = NULL;
@@ -364,13 +367,16 @@ void GameStateDuel::Update(float dt)
mGamePhase = DUEL_STATE_PLAY;
break;
case DUEL_STATE_BACK_TO_MAIN_MENU:
menu->Update(dt);
if (menu->closed) {
PlayerData * playerdata = NEW PlayerData(mParent->collection);
playerdata->taskList->passOneDay();
playerdata->taskList->save();
SAFE_DELETE(playerdata);
mParent->SetNextState(GAME_STATE_MENU);
if(menu){
menu->Update(dt);
if (menu->closed) {
PlayerData * playerdata = NEW PlayerData(mParent->collection);
playerdata->taskList->passOneDay();
playerdata->taskList->save();
SAFE_DELETE(playerdata);
SAFE_DELETE(menu);
mParent->DoTransition(TRANSITION_FADE,GAME_STATE_MENU,1);
}
}
break;
default:
@@ -456,7 +462,8 @@ void GameStateDuel::Render()
sprintf(buffer,_("Turn:%i").c_str(),game->turn);
mFont->DrawString(buffer,SCREEN_WIDTH/2,0,JGETEXT_CENTER);
}
menu->Render();
if(menu)
menu->Render();
}
LOG("End Render\n");
}