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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user