online highscore can now be selected from Options menu

This commit is contained in:
2011-03-27 22:38:26 +02:00
parent 1c6cb70590
commit 057bf0e1cc
4 changed files with 29 additions and 3 deletions
+18 -1
View File
@@ -928,8 +928,25 @@ void View::DrawUiOptions() {
Engine::SetMusicVolume(music_volume);
}
bool use_online_mode = Model::UseServerHighscore.GetBoolValue();
if (Engine::GUI::Button (5, "Back", screen_right * 0.5 - 100, 380, button_width, button_height)
std::string online_button_caption;
if (use_online_mode) {
online_button_caption = "Highscore: online";
} else {
online_button_caption = "Highscore: offline";
}
if (Engine::GUI::CheckButton (12, online_button_caption.c_str(), use_online_mode,
screen_right*0.5 - 130, 360,
300, button_height)) {
if (use_online_mode)
Model::UseServerHighscore.Set("no");
else
Model::UseServerHighscore.Set("yes");
}
if (Engine::GUI::Button (5, "Back", screen_right * 0.5 - 100, 480, button_width, button_height)
|| Engine::GUI::CheckKeyPressed(SDLK_ESCAPE) ) {
PopViewState();
}