Jeck - Quick crashfix when loading without a profiles directory, slight keypad modifications.
This commit is contained in:
@@ -101,7 +101,7 @@ public:
|
||||
~GameSettings();
|
||||
int save();
|
||||
|
||||
SimplePad * keypadStart(string input, string * _dest = NULL, int _x = SCREEN_WIDTH/2, int _y = SCREEN_HEIGHT/2);
|
||||
SimplePad * keypadStart(string input, string * _dest = NULL, bool _cancel=true, bool _numpad=false, int _x = SCREEN_WIDTH/2, int _y = SCREEN_HEIGHT/2);
|
||||
string keypadFinish();
|
||||
void keypadShutdown();
|
||||
void keypadTitle(string set);
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
|
||||
|
||||
|
||||
SimplePad(bool numbers=false);
|
||||
SimplePad();
|
||||
~SimplePad();
|
||||
|
||||
int mX; int mY;
|
||||
|
||||
@@ -95,7 +95,6 @@ void GameApp::Create()
|
||||
manaIcons[Constants::MTG_COLOR_GREEN] = GameApp::CommonRes->GetQuad("c_green");
|
||||
for (int i = sizeof(manaIcons)/sizeof(manaIcons[0]) - 1; i >= 0; --i) manaIcons[i]->SetHotSpot(16,16);
|
||||
|
||||
|
||||
CommonRes->CreateTexture("sets/back.jpg");
|
||||
CommonRes->CreateQuad("back", "sets/back.jpg", 0, 0, 200, 285);
|
||||
CommonRes->GetQuad("back")->SetHotSpot(100, 145);
|
||||
|
||||
@@ -282,6 +282,7 @@ string GameSettings::themeGraphic(string filename)
|
||||
{
|
||||
char buf[4096];
|
||||
string theme = (*this)[Options::ACTIVE_THEME].str;
|
||||
|
||||
if(theme == "" || theme == "default"){
|
||||
sprintf(buf,"graphics/%s",filename.c_str());
|
||||
return buf;
|
||||
@@ -304,6 +305,8 @@ void GameSettings::checkProfile(){
|
||||
if(profileOptions != NULL)
|
||||
SAFE_DELETE(profileOptions);
|
||||
|
||||
//Force our directories to exist.
|
||||
MAKEDIR(RESPATH"/profiles");
|
||||
string temp = profileFile("","",false,false);
|
||||
MAKEDIR(temp.c_str());
|
||||
temp+="/stats";
|
||||
@@ -394,9 +397,11 @@ void GameSettings::keypadTitle(string set){
|
||||
if(keypad != NULL)
|
||||
keypad->title = set;
|
||||
}
|
||||
SimplePad * GameSettings::keypadStart(string input, string * _dest,int _x,int _y){
|
||||
SimplePad * GameSettings::keypadStart(string input, string * _dest,bool _cancel, bool _numpad, int _x,int _y ){
|
||||
if(keypad == NULL)
|
||||
keypad = new SimplePad();
|
||||
keypad->bShowCancel = _cancel;
|
||||
keypad->bShowNumpad = _numpad;
|
||||
keypad->mX = _x;
|
||||
keypad->mY = _y;
|
||||
keypad->Start(input,_dest);
|
||||
|
||||
@@ -331,6 +331,9 @@ void OptionDirectory::Reload(){
|
||||
char buf[4096];
|
||||
mDip = opendir(root.c_str());
|
||||
|
||||
if(!mDip)
|
||||
return;
|
||||
|
||||
while ((mDit = readdir(mDip))){
|
||||
if(mDit->d_name[0] != '.'){
|
||||
sprintf(buf,"%s/%s",root.c_str(),mDit->d_name);
|
||||
@@ -356,6 +359,9 @@ OptionDirectory::OptionDirectory(string _root, string _id, string _displayValue)
|
||||
root = _root;
|
||||
mDip = opendir(root.c_str());
|
||||
|
||||
if(!mDip)
|
||||
return;
|
||||
|
||||
while ((mDit = readdir(mDip))){
|
||||
if(mDit->d_name[0] != '.'){
|
||||
sprintf(buf,"%s/%s",root.c_str(),mDit->d_name);
|
||||
|
||||
@@ -35,7 +35,7 @@ void SimplePad::linkKeys(int from, int to, int dir){
|
||||
}
|
||||
}
|
||||
|
||||
SimplePad::SimplePad(bool numbers){
|
||||
SimplePad::SimplePad(){
|
||||
nbitems = 0;
|
||||
bActive = false;
|
||||
selected = 0;
|
||||
|
||||
Reference in New Issue
Block a user