Jeck - Support for user profiles, preliminary theme support, virtual keypad, options GUI update. Still a bit unorganized, but it works.

This commit is contained in:
wagic.jeck
2009-08-26 20:13:09 +00:00
parent 0dfa3f2e16
commit 355ee7a271
30 changed files with 2779 additions and 1049 deletions

View File

@@ -1,4 +1,5 @@
#include "../include/config.h"
#include "../include/GameOptions.h"
#include "../include/PlayerData.h"
#include <string.h>
@@ -7,7 +8,8 @@
PlayerData::PlayerData(MTGAllCards * allcards){
//CREDITS
credits = 3000; //Default value
std::ifstream file(PLAYER_SAVEFILE);
std::ifstream file(options.profileFile(PLAYER_SAVEFILE,"",false).c_str());
std::string s;
if(file){
if(std::getline(file,s)){
@@ -19,12 +21,12 @@ PlayerData::PlayerData(MTGAllCards * allcards){
}
//COLLECTION
collection = NEW MTGDeck(RESPATH"/player/collection.dat", allcards->mCache , allcards);
collection = NEW MTGDeck(options.profileFile(PLAYER_COLLECTION,"",false).c_str(), allcards->mCache, allcards);
}
int PlayerData::save(){
std::ofstream file(PLAYER_SAVEFILE);
std::ofstream file(options.profileFile(PLAYER_SAVEFILE,"",false).c_str());
char writer[64];
if (file){
sprintf(writer,"%i\n", credits);