- [NEW] Menú de redefinició de tecles acabat
- [NEW] Les tecles es guarden al arxiu de config
This commit is contained in:
@@ -29,21 +29,28 @@ char tmp[100];
|
||||
|
||||
void loadConfig()
|
||||
{
|
||||
file::setConfigFolder("thepool");
|
||||
file::setConfigFolder("thepool");
|
||||
|
||||
if (strcmp(file::getConfigValue("music").c_str(), "no")==0) config::setMusic(false);
|
||||
if (strcmp(file::getConfigValue("music").c_str(), "no")==0) config::setMusic(false);
|
||||
|
||||
const char *so = file::getConfigValue("sound").c_str();
|
||||
if (strcmp(so, "basic")==0)
|
||||
config::setSound(SOUND_BASIC);
|
||||
else if (strcmp(so, "none")==0)
|
||||
config::setSound(SOUND_NONE);
|
||||
|
||||
std::string txt_zoom = file::getConfigValue("zoom");
|
||||
if (txt_zoom!="") zoom = SDL_atoi(txt_zoom.c_str());
|
||||
|
||||
std::string txt_fullscreen = file::getConfigValue("fullscreen");
|
||||
if (txt_fullscreen=="yes") fullscreen = true;
|
||||
const char *so = file::getConfigValue("sound").c_str();
|
||||
if (strcmp(so, "basic")==0)
|
||||
config::setSound(SOUND_BASIC);
|
||||
else if (strcmp(so, "none")==0)
|
||||
config::setSound(SOUND_NONE);
|
||||
|
||||
std::string txt_zoom = file::getConfigValue("zoom");
|
||||
if (txt_zoom!="") zoom = SDL_atoi(txt_zoom.c_str());
|
||||
|
||||
std::string txt_fullscreen = file::getConfigValue("fullscreen");
|
||||
if (txt_fullscreen=="yes") fullscreen = true;
|
||||
|
||||
static const char* nomtecles[6] = {"keyup", "keydown", "keyleft", "keyright", "keyjump", "keypick"};
|
||||
for (int i=0; i<6; ++i)
|
||||
{
|
||||
const int value = SDL_atoi( file::getConfigValue(nomtecles[i]).c_str() );
|
||||
if (value != 0) config::defineKey(i, value);
|
||||
}
|
||||
}
|
||||
|
||||
void game::init()
|
||||
|
||||
Reference in New Issue
Block a user