Skip to content

Commit

Permalink
Added config for stockpile.zone display, and for initial follow offset
Browse files Browse the repository at this point in the history
  • Loading branch information
Kris Parker committed Dec 20, 2009
1 parent f8f32df commit fea451c
Showing 1 changed file with 69 additions and 45 deletions.
114 changes: 69 additions & 45 deletions Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,22 +115,30 @@ void parseConfigLine( string line ){
string result = parseStrFromLine( "TRACK_CENTER", line );
config.track_center = (result == "YES");
}
if( line.find("FOLLOW_DF_SCREEN") != -1){
string result = parseStrFromLine( "FOLLOW_DF_SCREEN", line );
config.follow_DFscreen = (result == "YES");
}
if( line.find("SHOW_CREATURE_NAMES") != -1){
string result = parseStrFromLine( "SHOW_CREATURE_NAMES", line );
config.show_creature_names = (result == "YES");
}
if( line.find("SHOW_OSD") != -1){
string result = parseStrFromLine( "SHOW_OSD", line );
config.show_osd = (result == "YES");
}
if( line.find("INTRO") != -1){
string result = parseStrFromLine( "INTRO", line );
config.show_intro = !(result == "OFF");
}
if( line.find("FOLLOW_DF_SCREEN") != -1){
string result = parseStrFromLine( "FOLLOW_DF_SCREEN", line );
config.follow_DFscreen = (result == "YES");
}
if( line.find("SHOW_CREATURE_NAMES") != -1){
string result = parseStrFromLine( "SHOW_CREATURE_NAMES", line );
config.show_creature_names = (result == "YES");
}
if( line.find("SHOW_OSD") != -1){
string result = parseStrFromLine( "SHOW_OSD", line );
config.show_osd = (result == "YES");
}
if( line.find("SHOW_STOCKPILES") != -1){
string result = parseStrFromLine( "SHOW_STOCKPILES", line );
config.show_stockpiles = (result == "YES");
}
if( line.find("SHOW_ZONES") != -1){
string result = parseStrFromLine( "SHOW_ZONES", line );
config.show_zones = (result == "YES");
}
if( line.find("INTRO") != -1){
string result = parseStrFromLine( "INTRO", line );
config.show_intro = !(result == "OFF");
}
if( line.find("FOG_RED") != -1){
int value = parseIntFromLine( "FOG_RED", line);
if(value > 255) value = 255;
Expand All @@ -147,32 +155,50 @@ void parseConfigLine( string line ){
int value = parseIntFromLine( "FOG_BLUE", line);
if(value > 255) value = 255;
if(value < 0) value = 0;
config.fogb = value;
}
if( line.find("FOG_ALPHA") != -1){
int value = parseIntFromLine( "FOG_ALPHA", line);
if(value > 255) value = 255;
if(value < 0) value = 0;
config.foga = value;
}
if( line.find("BACK_RED") != -1){
int value = parseIntFromLine( "BACK_RED", line);
if(value > 255) value = 255;
if(value < 0) value = 0;
config.backr = value;
}
if( line.find("BACK_GREEN") != -1){
int value = parseIntFromLine( "BACK_GREEN", line);
if(value > 255) value = 255;
if(value < 0) value = 0;
config.backg = value;
}
if( line.find("BACK_BLUE") != -1){
int value = parseIntFromLine( "BACK_BLUE", line);
if(value > 255) value = 255;
if(value < 0) value = 0;
config.backb = value;
}
config.fogb = value;
}
if( line.find("FOG_ALPHA") != -1){
int value = parseIntFromLine( "FOG_ALPHA", line);
if(value > 255) value = 255;
if(value < 0) value = 0;
config.foga = value;
}
if( line.find("BACK_RED") != -1){
int value = parseIntFromLine( "BACK_RED", line);
if(value > 255) value = 255;
if(value < 0) value = 0;
config.backr = value;
}
if( line.find("BACK_GREEN") != -1){
int value = parseIntFromLine( "BACK_GREEN", line);
if(value > 255) value = 255;
if(value < 0) value = 0;
config.backg = value;
}
if( line.find("BACK_BLUE") != -1){
int value = parseIntFromLine( "BACK_BLUE", line);
if(value > 255) value = 255;
if(value < 0) value = 0;
config.backb = value;
}
if( line.find("FOLLOW_OFFSET_X") != -1){
int value = parseIntFromLine( "FOLLOW_OFFSET_X", line);
if(value > 30) value = 30;
if(value < -30) value = -30;
config.viewXoffset = value;
}
if( line.find("FOLLOW_OFFSET_Y") != -1){
int value = parseIntFromLine( "FOLLOW_OFFSET_Y", line);
if(value > 30) value = 30;
if(value < -30) value = -30;
config.viewYoffset = value;
}
if( line.find("FOLLOW_OFFSET_Z") != -1){
int value = parseIntFromLine( "FOLLOW_OFFSET_Z", line);
if(value > 30) value = 30;
if(value < -30) value = -30;
config.viewZoffset = value;
}
}


Expand All @@ -192,7 +218,5 @@ bool loadConfigFile(){
parseConfigLine( line );
}
myfile.close();


return true;
}
}

0 comments on commit fea451c

Please sign in to comment.