Jeck - Fix signed/unsigned in AllAbilities (please review), bug fixes for trophy room (new status now saves).
This commit is contained in:
@@ -717,6 +717,11 @@ OptionDifficulty::OptionDifficulty(){
|
||||
};
|
||||
|
||||
//GameOptionAward
|
||||
GameOptionAward::GameOptionAward(){
|
||||
achieved = time(NULL);
|
||||
number = 0;
|
||||
viewed = false;
|
||||
}
|
||||
bool GameOptionAward::read(string input){
|
||||
//This is quick and dirty.
|
||||
bool bNumeric = true;
|
||||
@@ -806,6 +811,12 @@ bool GameOptionAward::giveAward(){
|
||||
number = 1;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool GameOptionAward::isViewed(){
|
||||
if(!number)
|
||||
return true;
|
||||
return viewed;
|
||||
};
|
||||
string GameOptionAward::menuStr(){
|
||||
if(!number)
|
||||
return _("Not unlocked.");
|
||||
@@ -815,6 +826,9 @@ string GameOptionAward::menuStr(){
|
||||
|
||||
char buf[256];
|
||||
Translator * t = Translator::GetInstance();
|
||||
strftime(buf,255,_("%B %d, %I:%M%p %Y").c_str(),localtime(&achieved));
|
||||
tm * lt = localtime(&achieved);
|
||||
if(!lt)
|
||||
return "Error";
|
||||
strftime(buf,255,_("%B %d, %I:%M%p %Y").c_str(),lt);
|
||||
return buf;
|
||||
}
|
||||
@@ -30,7 +30,8 @@ void GameStateAwards::End()
|
||||
SAFE_DELETE(listview);
|
||||
SAFE_DELETE(setSrc);
|
||||
|
||||
//TODO Memoize viewed status here.
|
||||
if(saveMe)
|
||||
options.save();
|
||||
}
|
||||
void GameStateAwards::Start()
|
||||
{
|
||||
@@ -38,6 +39,7 @@ void GameStateAwards::Start()
|
||||
mState = STATE_LISTVIEW;
|
||||
|
||||
menu = NULL;
|
||||
saveMe = options.newAward();
|
||||
|
||||
listview = NEW WGuiList("Listview");
|
||||
listview->setX(210);
|
||||
|
||||
Reference in New Issue
Block a user