-
+
+
+
+
+
+
+
diff --git a/data/gui/icons/License.txt b/data/gui/icons/License.txt
index 3762085cd..ce20ece7f 100644
--- a/data/gui/icons/License.txt
+++ b/data/gui/icons/License.txt
@@ -41,6 +41,7 @@ crown.png by glitch, from https://openclipart.org/detail/210257/misc-game-crown,
ghost_plus.png by Alayan, based on https://openclipart.org/detail/17847/cartoon-ghost by lemmling, released under CC-O
options_language.png by Alayan, based on http://www.languageicon.org/, released under CC-BY-SA 3+
+options_general.png by Alayan, released under CC-BY-SA 4
blue_flag.png, heart.png and red_flag.png by Benau, released under CC-BY-SA 4
diff --git a/data/gui/icons/options_general.png b/data/gui/icons/options_general.png
new file mode 100644
index 000000000..656a440c5
Binary files /dev/null and b/data/gui/icons/options_general.png differ
diff --git a/data/gui/screens/options_audio.stkgui b/data/gui/screens/options_audio.stkgui
index 7d2e8ac09..e2033d70d 100644
--- a/data/gui/screens/options_audio.stkgui
+++ b/data/gui/screens/options_audio.stkgui
@@ -8,6 +8,8 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/data/gui/screens/options_input.stkgui b/data/gui/screens/options_input.stkgui
index 9f85e953a..3e1611321 100644
--- a/data/gui/screens/options_input.stkgui
+++ b/data/gui/screens/options_input.stkgui
@@ -8,6 +8,8 @@
+
+
+
+
+
-
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
@@ -46,6 +56,4 @@
-
-
diff --git a/data/gui/screens/options_ui.stkgui b/data/gui/screens/options_ui.stkgui
index 0fc9c485a..d1c75f2b7 100644
--- a/data/gui/screens/options_ui.stkgui
+++ b/data/gui/screens/options_ui.stkgui
@@ -8,6 +8,8 @@
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/data/gui/screens/options_video.stkgui b/data/gui/screens/options_video.stkgui
index b3fa50e62..b6081eed0 100644
--- a/data/gui/screens/options_video.stkgui
+++ b/data/gui/screens/options_video.stkgui
@@ -8,6 +8,8 @@
+
-
+
-
+
diff --git a/data/gui/screens/user_screen_tab.stkgui b/data/gui/screens/user_screen_tab.stkgui
index d330e8613..b07a55f18 100644
--- a/data/gui/screens/user_screen_tab.stkgui
+++ b/data/gui/screens/user_screen_tab.stkgui
@@ -8,6 +8,8 @@
+
-
+
@@ -555,7 +555,7 @@
max-adjust-time: Maximum time spent in each smoothing stage.
adjust-length-threshold: The higher this value, the larger the correction curve.
-->
- getSteer() < 0.0f)
{
all_actions.emplace_back(PA_STEER_LEFT,
- fabsf(m_ai_controls->getSteer()) * 32768);
+ int(fabsf(m_ai_controls->getSteer()) * 32768));
}
else
{
all_actions.emplace_back(PA_STEER_RIGHT,
- fabsf(m_ai_controls->getSteer()) * 32768);
+ int(fabsf(m_ai_controls->getSteer()) * 32768));
}
all_actions.emplace_back(PA_ACCEL,
- m_ai_controls->getAccel() * 32768);
+ int(m_ai_controls->getAccel() * 32768));
all_actions.emplace_back(PA_BRAKE,
m_ai_controls->getBrake() ? 32768 : 0);
all_actions.emplace_back(PA_FIRE,
diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp
index a7f330744..f8148b97c 100644
--- a/src/karts/kart.cpp
+++ b/src/karts/kart.cpp
@@ -993,17 +993,19 @@ void Kart::finishedRace(float time, bool from_server)
RaceGUIBase* m = World::getWorld()->getRaceGUI();
if (m)
{
- if (race_manager->
- getMinorMode() == RaceManager::MINOR_MODE_FOLLOW_LEADER &&
- getPosition() == 2)
- m->addMessage(_("You won the race!"), this, 2.0f);
- else if (race_manager->getMinorMode() == RaceManager::MINOR_MODE_NORMAL_RACE ||
- race_manager->getMinorMode() == RaceManager::MINOR_MODE_TIME_TRIAL)
- {
- m->addMessage((getPosition() == 1 ?
- _("You won the race!") : _("You finished the race!")) ,
- this, 2.0f);
- }
+ bool won_the_race = false;
+ unsigned int win_position = 1;
+
+ if (race_manager->getMinorMode() == RaceManager::MINOR_MODE_FOLLOW_LEADER)
+ win_position = 2;
+
+ if (getPosition() == (int)win_position &&
+ World::getWorld()->getNumKarts() > win_position)
+ won_the_race = true;
+
+ m->addMessage((won_the_race ?
+ _("You won the race!") : _("You finished the race!")) ,
+ this, 2.0f, video::SColor(255, 255, 255, 255), true, true, true);
}
}
diff --git a/src/main_android.cpp b/src/main_android.cpp
index 8a43a5e13..2e6e55d4f 100644
--- a/src/main_android.cpp
+++ b/src/main_android.cpp
@@ -105,7 +105,7 @@ void android_main(struct android_app* app)
// its state is remembered when the window is restored. We will use exit
// call to make sure that all variables are cleared until a proper fix will
// be done.
- exit(0);
+ _exit(0);
}
#endif
diff --git a/src/states_screens/dialogs/race_paused_dialog.cpp b/src/states_screens/dialogs/race_paused_dialog.cpp
index 3086f4b93..aeac50f7d 100644
--- a/src/states_screens/dialogs/race_paused_dialog.cpp
+++ b/src/states_screens/dialogs/race_paused_dialog.cpp
@@ -35,7 +35,7 @@
#include "states_screens/main_menu_screen.hpp"
#include "states_screens/race_gui_base.hpp"
#include "states_screens/race_setup_screen.hpp"
-#include "states_screens/options/options_screen_video.hpp"
+#include "states_screens/options/options_screen_general.hpp"
#include "states_screens/state_manager.hpp"
#include "utils/translation.hpp"
@@ -174,7 +174,7 @@ GUIEngine::EventPropagation
else if (selection == "options")
{
dismiss();
- OptionsScreenVideo::getInstance()->push();
+ OptionsScreenGeneral::getInstance()->push();
return GUIEngine::EVENT_BLOCK;
}
else if (selection == "restart")
diff --git a/src/states_screens/dialogs/select_challenge.cpp b/src/states_screens/dialogs/select_challenge.cpp
index d3513e808..eecf38265 100644
--- a/src/states_screens/dialogs/select_challenge.cpp
+++ b/src/states_screens/dialogs/select_challenge.cpp
@@ -174,11 +174,28 @@ void SelectChallengeDialog::updateSolvedIcon(const ChallengeStatus* c, RaceManag
}
} //updateSolvedIcon
+// -----------------------------------------------------------------------------
+void SelectChallengeDialog::onUpdate(float dt)
+{
+ if (m_self_destroy)
+ {
+ ModalDialog::clearWindow();
+ ModalDialog::dismiss();
+ return;
+ }
+} // onUpdate
+
// ----------------------------------------------------------------------------
GUIEngine::EventPropagation SelectChallengeDialog::processEvent(const std::string& eventSourceParam)
{
std::string eventSource = eventSourceParam;
+ if (eventSource == "back")
+ {
+ m_self_destroy = true;
+ return GUIEngine::EVENT_BLOCK;
+ }
+
if (eventSource == "novice" || eventSource == "intermediate" ||
eventSource == "expert" || eventSource == "supertux")
{
diff --git a/src/states_screens/dialogs/select_challenge.hpp b/src/states_screens/dialogs/select_challenge.hpp
index e6aaabb8b..8677e7486 100644
--- a/src/states_screens/dialogs/select_challenge.hpp
+++ b/src/states_screens/dialogs/select_challenge.hpp
@@ -30,6 +30,7 @@
class SelectChallengeDialog : public GUIEngine::ModalDialog
{
private:
+ bool m_self_destroy = false;
std::string m_challenge_id;
void updateSolvedIcon(const ChallengeStatus* c, RaceManager::Difficulty diff,
const char* widget_name, const char* path);
@@ -40,6 +41,7 @@ public:
virtual ~SelectChallengeDialog();
virtual GUIEngine::EventPropagation processEvent(const std::string& eventSource);
+ virtual void onUpdate(float dt);
};
#endif
diff --git a/src/states_screens/main_menu_screen.cpp b/src/states_screens/main_menu_screen.cpp
index 3107252c4..424af5837 100644
--- a/src/states_screens/main_menu_screen.cpp
+++ b/src/states_screens/main_menu_screen.cpp
@@ -47,7 +47,7 @@
#include "states_screens/online/online_profile_achievements.hpp"
#include "states_screens/online/online_profile_servers.hpp"
#include "states_screens/online/online_screen.hpp"
-#include "states_screens/options/options_screen_video.hpp"
+#include "states_screens/options/options_screen_general.hpp"
#include "states_screens/state_manager.hpp"
#include "states_screens/options/user_screen.hpp"
#if DEBUG_MENU_ITEM
@@ -401,7 +401,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name,
}
else if (selection == "options")
{
- OptionsScreenVideo::getInstance()->push();
+ OptionsScreenGeneral::getInstance()->push();
}
else if (selection == "quit")
{
diff --git a/src/states_screens/options/options_screen_audio.cpp b/src/states_screens/options/options_screen_audio.cpp
index 3ec86d73e..5f5d4f56b 100644
--- a/src/states_screens/options/options_screen_audio.cpp
+++ b/src/states_screens/options/options_screen_audio.cpp
@@ -27,6 +27,7 @@
#include "guiengine/widgets/spinner_widget.hpp"
#include "guiengine/widget.hpp"
#include "io/file_manager.hpp"
+#include "states_screens/options/options_screen_general.hpp"
#include "states_screens/options/options_screen_input.hpp"
#include "states_screens/options/options_screen_language.hpp"
#include "states_screens/options/options_screen_ui.hpp"
@@ -112,6 +113,8 @@ void OptionsScreenAudio::eventCallback(Widget* widget, const std::string& name,
screen = OptionsScreenInput::getInstance();
else if (selection == "tab_ui")
screen = OptionsScreenUI::getInstance();
+ else if (selection == "tab_general")
+ screen = OptionsScreenGeneral::getInstance();
else if (selection == "tab_language")
screen = OptionsScreenLanguage::getInstance();
if(screen)
diff --git a/src/states_screens/options/options_screen_device.cpp b/src/states_screens/options/options_screen_device.cpp
index 5e01da7f9..ce6f7cc13 100644
--- a/src/states_screens/options/options_screen_device.cpp
+++ b/src/states_screens/options/options_screen_device.cpp
@@ -32,6 +32,7 @@
#include "io/file_manager.hpp"
#include "states_screens/dialogs/press_a_key_dialog.hpp"
#include "states_screens/options/options_screen_audio.hpp"
+#include "states_screens/options/options_screen_general.hpp"
#include "states_screens/options/options_screen_input.hpp"
#include "states_screens/options/options_screen_language.hpp"
#include "states_screens/options/options_screen_video.hpp"
@@ -550,6 +551,8 @@ void OptionsScreenDevice::eventCallback(Widget* widget,
// screen = OptionsScreenInput::getInstance();
else if (selection == "tab_ui")
screen = OptionsScreenUI::getInstance();
+ else if (selection == "tab_general")
+ screen = OptionsScreenGeneral::getInstance();
else if (selection == "tab_language")
screen = OptionsScreenLanguage::getInstance();
if(screen)
diff --git a/src/states_screens/options/options_screen_general.cpp b/src/states_screens/options/options_screen_general.cpp
new file mode 100644
index 000000000..a6360ae77
--- /dev/null
+++ b/src/states_screens/options/options_screen_general.cpp
@@ -0,0 +1,229 @@
+// SuperTuxKart - a fun racing game with go-kart
+// Copyright (C) 2009-2015 Marianne Gagnon
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 3
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+#include "states_screens/options/options_screen_general.hpp"
+
+#include "addons/news_manager.hpp"
+#include "audio/sfx_manager.hpp"
+#include "audio/sfx_base.hpp"
+#include "config/hardware_stats.hpp"
+#include "config/player_manager.hpp"
+#include "config/user_config.hpp"
+#include "font/bold_face.hpp"
+#include "font/font_manager.hpp"
+#include "font/regular_face.hpp"
+#include "graphics/irr_driver.hpp"
+#include "guiengine/scalable_font.hpp"
+#include "guiengine/screen.hpp"
+#include "guiengine/widgets/button_widget.hpp"
+#include "guiengine/widgets/check_box_widget.hpp"
+#include "guiengine/widgets/dynamic_ribbon_widget.hpp"
+#include "guiengine/widgets/label_widget.hpp"
+#include "guiengine/widgets/list_widget.hpp"
+#include "guiengine/widgets/spinner_widget.hpp"
+#include "guiengine/widget.hpp"
+#include "io/file_manager.hpp"
+#include "online/request_manager.hpp"
+#include "states_screens/main_menu_screen.hpp"
+#include "states_screens/options/options_screen_audio.hpp"
+#include "states_screens/options/options_screen_input.hpp"
+#include "states_screens/options/options_screen_language.hpp"
+#include "states_screens/options/options_screen_ui.hpp"
+#include "states_screens/options/options_screen_video.hpp"
+#include "states_screens/state_manager.hpp"
+#include "states_screens/options/user_screen.hpp"
+#include "utils/log.hpp"
+#include "utils/string_utils.hpp"
+#include "utils/translation.hpp"
+
+#include
+#include
+#include
+
+using namespace GUIEngine;
+using namespace Online;
+
+// -----------------------------------------------------------------------------
+
+OptionsScreenGeneral::OptionsScreenGeneral() : Screen("options_general.stkgui")
+{
+ m_inited = false;
+} // OptionsScreenVideo
+
+// -----------------------------------------------------------------------------
+
+void OptionsScreenGeneral::loadedFromFile()
+{
+ m_inited = false;
+} // loadedFromFile
+
+// -----------------------------------------------------------------------------
+
+void OptionsScreenGeneral::init()
+{
+ Screen::init();
+ RibbonWidget* ribbon = getWidget("options_choice");
+ assert(ribbon != NULL);
+ ribbon->setFocusForPlayer(PLAYER_ID_GAME_MASTER);
+ ribbon->select( "tab_general", PLAYER_ID_GAME_MASTER );
+
+ CheckBoxWidget* news = getWidget("enable-internet");
+ assert( news != NULL );
+ news->setState( UserConfigParams::m_internet_status
+ ==RequestManager::IPERM_ALLOWED );
+ CheckBoxWidget* stats = getWidget("enable-hw-report");
+ assert( stats != NULL );
+ LabelWidget *stats_label = getWidget("label-hw-report");
+ assert( stats_label );
+ stats->setState(UserConfigParams::m_hw_report_enable);
+
+ getWidget("enable-lobby-chat")
+ ->setState(UserConfigParams::m_lobby_chat);
+
+ if(news->getState())
+ {
+ stats_label->setVisible(true);
+ stats->setVisible(true);
+ stats->setState(UserConfigParams::m_hw_report_enable);
+ }
+ else
+ {
+ stats_label->setVisible(false);
+ stats->setVisible(false);
+ }
+ CheckBoxWidget* difficulty = getWidget("perPlayerDifficulty");
+ assert( difficulty != NULL );
+ difficulty->setState( UserConfigParams::m_per_player_difficulty );
+ // I18N: Tooltip in the UI menu. Use enough linebreaks to make sure the text fits the screen in low resolutions.
+ difficulty->setTooltip(_("In multiplayer mode, players can select handicapped\n(more difficult) profiles on the kart selection screen"));
+
+ CheckBoxWidget* show_login = getWidget("show-login");
+ assert( show_login!= NULL );
+ show_login->setState( UserConfigParams::m_always_show_login_screen);
+
+} // init
+
+// -----------------------------------------------------------------------------
+
+void OptionsScreenGeneral::eventCallback(Widget* widget, const std::string& name, const int playerID)
+{
+#ifndef SERVER_ONLY
+ if (name == "options_choice")
+ {
+ std::string selection = ((RibbonWidget*)widget)->getSelectionIDString(PLAYER_ID_GAME_MASTER);
+
+ Screen *screen = NULL;
+ if (selection == "tab_audio")
+ screen = OptionsScreenAudio::getInstance();
+ else if (selection == "tab_video")
+ screen = OptionsScreenVideo::getInstance();
+ else if (selection == "tab_players")
+ screen = TabbedUserScreen::getInstance();
+ else if (selection == "tab_controls")
+ screen = OptionsScreenInput::getInstance();
+ else if (selection == "tab_ui")
+ screen = OptionsScreenUI::getInstance();
+ //else if (selection == "tab_general")
+ // screen = OptionsScreenGeneral::getInstance();
+ else if (selection == "tab_language")
+ screen = OptionsScreenLanguage::getInstance();
+ if(screen)
+ StateManager::get()->replaceTopMostScreen(screen);
+ }
+ else if(name == "back")
+ {
+ StateManager::get()->escapePressed();
+ }
+ else if (name=="enable-internet")
+ {
+ CheckBoxWidget* internet = getWidget("enable-internet");
+ assert( internet != NULL );
+ UserConfigParams::m_internet_status =
+ internet->getState() ? RequestManager::IPERM_ALLOWED
+ : RequestManager::IPERM_NOT_ALLOWED;
+ // If internet gets enabled, re-initialise the addon manager (which
+ // happens in a separate thread) so that news.xml etc can be
+ // downloaded if necessary.
+ CheckBoxWidget* stats = getWidget("enable-hw-report");
+ LabelWidget* stats_label = getWidget("label-hw-report");
+ CheckBoxWidget* chat = getWidget("enable-lobby-chat");
+ LabelWidget* chat_label = getWidget("label-lobby-chat");
+ if(internet->getState())
+ {
+ NewsManager::get()->init(false);
+ stats->setVisible(true);
+ stats_label->setVisible(true);
+ stats->setState(UserConfigParams::m_hw_report_enable);
+ chat->setVisible(true);
+ stats->setState(UserConfigParams::m_lobby_chat);
+ chat_label->setVisible(true);
+ }
+ else
+ {
+ chat->setVisible(false);
+ chat_label->setVisible(false);
+ stats->setVisible(false);
+ stats_label->setVisible(false);
+ PlayerProfile* profile = PlayerManager::getCurrentPlayer();
+ if (profile != NULL && profile->isLoggedIn())
+ profile->requestSignOut();
+ }
+ }
+ else if (name=="enable-hw-report")
+ {
+ CheckBoxWidget* stats = getWidget("enable-hw-report");
+ UserConfigParams::m_hw_report_enable = stats->getState();
+ if(stats->getState())
+ HardwareStats::reportHardwareStats();
+ }
+ else if (name=="enable-lobby-chat")
+ {
+ CheckBoxWidget* chat = getWidget("enable-lobby-chat");
+ UserConfigParams::m_lobby_chat = chat->getState();
+ }
+ else if (name=="show-login")
+ {
+ CheckBoxWidget* show_login = getWidget("show-login");
+ assert( show_login != NULL );
+ UserConfigParams::m_always_show_login_screen = show_login->getState();
+ }
+ else if (name=="perPlayerDifficulty")
+ {
+ CheckBoxWidget* difficulty = getWidget("perPlayerDifficulty");
+ assert( difficulty != NULL );
+ UserConfigParams::m_per_player_difficulty = difficulty->getState();
+ }
+#endif
+} // eventCallback
+
+// -----------------------------------------------------------------------------
+
+void OptionsScreenGeneral::tearDown()
+{
+ Screen::tearDown();
+ // save changes when leaving screen
+ user_config->saveConfig();
+} // tearDown
+
+// -----------------------------------------------------------------------------
+
+void OptionsScreenGeneral::unloaded()
+{
+ m_inited = false;
+} // unloaded
+
+// -----------------------------------------------------------------------------
diff --git a/src/states_screens/options/options_screen_general.hpp b/src/states_screens/options/options_screen_general.hpp
new file mode 100644
index 000000000..2a714966a
--- /dev/null
+++ b/src/states_screens/options/options_screen_general.hpp
@@ -0,0 +1,61 @@
+// SuperTuxKart - a fun racing game with go-kart
+// Copyright (C) 2009-2015 Marianne Gagnon
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of the GNU General Public License
+// as published by the Free Software Foundation; either version 3
+// of the License, or (at your option) any later version.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+
+#ifndef __HEADER_OPTIONS_SCREEN_GENERAL_HPP__
+#define __HEADER_OPTIONS_SCREEN_GENERAL_HPP__
+
+#include
+
+#include "guiengine/screen.hpp"
+
+namespace GUIEngine { class Widget; }
+
+struct Input;
+
+/**
+ * \brief Graphics options screen
+ * \ingroup states_screens
+ */
+class OptionsScreenGeneral : public GUIEngine::Screen, public GUIEngine::ScreenSingleton
+{
+ OptionsScreenGeneral();
+ bool m_inited;
+
+ std::vector m_skins;
+
+public:
+ friend class GUIEngine::ScreenSingleton;
+
+ /** \brief implement callback from parent class GUIEngine::Screen */
+ virtual void loadedFromFile() OVERRIDE;
+
+ /** \brief implement callback from parent class GUIEngine::Screen */
+ virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name,
+ const int playerID) OVERRIDE;
+
+ /** \brief implement callback from parent class GUIEngine::Screen */
+ virtual void init() OVERRIDE;
+
+ /** \brief implement callback from parent class GUIEngine::Screen */
+ virtual void tearDown() OVERRIDE;
+
+ /** \brief implement optional callback from parent class GUIEngine::Screen */
+ virtual void unloaded() OVERRIDE;
+};
+
+#endif
diff --git a/src/states_screens/options/options_screen_input.cpp b/src/states_screens/options/options_screen_input.cpp
index 23f4d8a72..db5fa69d2 100644
--- a/src/states_screens/options/options_screen_input.cpp
+++ b/src/states_screens/options/options_screen_input.cpp
@@ -30,6 +30,7 @@
#include "io/file_manager.hpp"
#include "states_screens/options/options_screen_device.hpp"
#include "states_screens/options/options_screen_audio.hpp"
+#include "states_screens/options/options_screen_general.hpp"
#include "states_screens/options/options_screen_language.hpp"
#include "states_screens/options/options_screen_video.hpp"
#include "states_screens/options/options_screen_ui.hpp"
@@ -222,6 +223,8 @@ void OptionsScreenInput::eventCallback(Widget* widget, const std::string& name,
// screen = OptionsScreenInput::getInstance();
else if (selection == "tab_ui")
screen = OptionsScreenUI::getInstance();
+ else if (selection == "tab_general")
+ screen = OptionsScreenGeneral::getInstance();
else if (selection == "tab_language")
screen = OptionsScreenLanguage::getInstance();
if(screen)
diff --git a/src/states_screens/options/options_screen_language.cpp b/src/states_screens/options/options_screen_language.cpp
index ca4ebe0cf..c742b7dab 100644
--- a/src/states_screens/options/options_screen_language.cpp
+++ b/src/states_screens/options/options_screen_language.cpp
@@ -40,6 +40,7 @@
#include "online/request_manager.hpp"
#include "states_screens/main_menu_screen.hpp"
#include "states_screens/options/options_screen_audio.hpp"
+#include "states_screens/options/options_screen_general.hpp"
#include "states_screens/options/options_screen_input.hpp"
#include "states_screens/options/options_screen_ui.hpp"
#include "states_screens/options/options_screen_video.hpp"
@@ -139,6 +140,8 @@ void OptionsScreenLanguage::eventCallback(Widget* widget, const std::string& nam
screen = OptionsScreenInput::getInstance();
else if (selection == "tab_ui")
screen = OptionsScreenUI::getInstance();
+ else if (selection == "tab_general")
+ screen = OptionsScreenGeneral::getInstance();
//else if (selection == "tab_language")
// screen = OptionsScreenLanguage::getInstance();
if(screen)
diff --git a/src/states_screens/options/options_screen_ui.cpp b/src/states_screens/options/options_screen_ui.cpp
index 96ed74917..d448becd7 100644
--- a/src/states_screens/options/options_screen_ui.cpp
+++ b/src/states_screens/options/options_screen_ui.cpp
@@ -40,6 +40,7 @@
#include "online/request_manager.hpp"
#include "states_screens/main_menu_screen.hpp"
#include "states_screens/options/options_screen_audio.hpp"
+#include "states_screens/options/options_screen_general.hpp"
#include "states_screens/options/options_screen_input.hpp"
#include "states_screens/options/options_screen_language.hpp"
#include "states_screens/options/options_screen_video.hpp"
@@ -163,39 +164,6 @@ void OptionsScreenUI::init()
CheckBoxWidget* fps = getWidget("showfps");
assert( fps != NULL );
fps->setState( UserConfigParams::m_display_fps );
- CheckBoxWidget* news = getWidget("enable-internet");
- assert( news != NULL );
- news->setState( UserConfigParams::m_internet_status
- ==RequestManager::IPERM_ALLOWED );
- CheckBoxWidget* stats = getWidget("enable-hw-report");
- assert( stats != NULL );
- LabelWidget *stats_label = getWidget("label-hw-report");
- assert( stats_label );
- stats->setState(UserConfigParams::m_hw_report_enable);
-
- getWidget("enable-lobby-chat")
- ->setState(UserConfigParams::m_lobby_chat);
-
- if(news->getState())
- {
- stats_label->setVisible(true);
- stats->setVisible(true);
- stats->setState(UserConfigParams::m_hw_report_enable);
- }
- else
- {
- stats_label->setVisible(false);
- stats->setVisible(false);
- }
- CheckBoxWidget* difficulty = getWidget("perPlayerDifficulty");
- assert( difficulty != NULL );
- difficulty->setState( UserConfigParams::m_per_player_difficulty );
- // I18N: Tooltip in the UI menu. Use enough linebreaks to make sure the text fits the screen in low resolutions.
- difficulty->setTooltip(_("In multiplayer mode, players can select handicapped\n(more difficult) profiles on the kart selection screen"));
-
- CheckBoxWidget* show_login = getWidget("show-login");
- assert( show_login!= NULL );
- show_login->setState( UserConfigParams::m_always_show_login_screen);
// --- select the right skin in the spinner
bool currSkinFound = false;
@@ -243,6 +211,8 @@ void OptionsScreenUI::eventCallback(Widget* widget, const std::string& name, con
screen = OptionsScreenInput::getInstance();
//else if (selection == "tab_ui")
// screen = OptionsScreenUI::getInstance();
+ else if (selection == "tab_general")
+ screen = OptionsScreenGeneral::getInstance();
else if (selection == "tab_language")
screen = OptionsScreenLanguage::getInstance();
if(screen)
@@ -282,65 +252,6 @@ void OptionsScreenUI::eventCallback(Widget* widget, const std::string& name, con
assert( fps != NULL );
UserConfigParams::m_display_fps = fps->getState();
}
- else if (name=="enable-internet")
- {
- CheckBoxWidget* internet = getWidget("enable-internet");
- assert( internet != NULL );
- UserConfigParams::m_internet_status =
- internet->getState() ? RequestManager::IPERM_ALLOWED
- : RequestManager::IPERM_NOT_ALLOWED;
- // If internet gets enabled, re-initialise the addon manager (which
- // happens in a separate thread) so that news.xml etc can be
- // downloaded if necessary.
- CheckBoxWidget* stats = getWidget("enable-hw-report");
- LabelWidget* stats_label = getWidget("label-hw-report");
- CheckBoxWidget* chat = getWidget("enable-lobby-chat");
- LabelWidget* chat_label = getWidget("label-lobby-chat");
- if(internet->getState())
- {
- NewsManager::get()->init(false);
- stats->setVisible(true);
- stats_label->setVisible(true);
- stats->setState(UserConfigParams::m_hw_report_enable);
- chat->setVisible(true);
- stats->setState(UserConfigParams::m_lobby_chat);
- chat_label->setVisible(true);
- }
- else
- {
- chat->setVisible(false);
- chat_label->setVisible(false);
- stats->setVisible(false);
- stats_label->setVisible(false);
- PlayerProfile* profile = PlayerManager::getCurrentPlayer();
- if (profile != NULL && profile->isLoggedIn())
- profile->requestSignOut();
- }
- }
- else if (name=="enable-hw-report")
- {
- CheckBoxWidget* stats = getWidget("enable-hw-report");
- UserConfigParams::m_hw_report_enable = stats->getState();
- if(stats->getState())
- HardwareStats::reportHardwareStats();
- }
- else if (name=="enable-lobby-chat")
- {
- CheckBoxWidget* chat = getWidget("enable-lobby-chat");
- UserConfigParams::m_lobby_chat = chat->getState();
- }
- else if (name=="show-login")
- {
- CheckBoxWidget* show_login = getWidget("show-login");
- assert( show_login != NULL );
- UserConfigParams::m_always_show_login_screen = show_login->getState();
- }
- else if (name=="perPlayerDifficulty")
- {
- CheckBoxWidget* difficulty = getWidget("perPlayerDifficulty");
- assert( difficulty != NULL );
- UserConfigParams::m_per_player_difficulty = difficulty->getState();
- }
#endif
} // eventCallback
diff --git a/src/states_screens/options/options_screen_video.cpp b/src/states_screens/options/options_screen_video.cpp
index 2121706bc..e2d66cb6a 100644
--- a/src/states_screens/options/options_screen_video.cpp
+++ b/src/states_screens/options/options_screen_video.cpp
@@ -31,6 +31,7 @@
#include "io/file_manager.hpp"
#include "states_screens/dialogs/custom_video_settings.hpp"
#include "states_screens/options/options_screen_audio.hpp"
+#include "states_screens/options/options_screen_general.hpp"
#include "states_screens/options/options_screen_input.hpp"
#include "states_screens/options/options_screen_language.hpp"
#include "states_screens/options/options_screen_ui.hpp"
@@ -513,6 +514,8 @@ void OptionsScreenVideo::eventCallback(Widget* widget, const std::string& name,
screen = OptionsScreenInput::getInstance();
else if (selection == "tab_ui")
screen = OptionsScreenUI::getInstance();
+ else if (selection == "tab_general")
+ screen = OptionsScreenGeneral::getInstance();
else if (selection == "tab_language")
screen = OptionsScreenLanguage::getInstance();
if(screen)
diff --git a/src/states_screens/options/user_screen.cpp b/src/states_screens/options/user_screen.cpp
index 73cf7cf1e..5e6180699 100644
--- a/src/states_screens/options/user_screen.cpp
+++ b/src/states_screens/options/user_screen.cpp
@@ -36,6 +36,7 @@
#include "states_screens/dialogs/recovery_dialog.hpp"
#include "states_screens/main_menu_screen.hpp"
#include "states_screens/options/options_screen_audio.hpp"
+#include "states_screens/options/options_screen_general.hpp"
#include "states_screens/options/options_screen_input.hpp"
#include "states_screens/options/options_screen_language.hpp"
#include "states_screens/options/options_screen_ui.hpp"
@@ -748,6 +749,8 @@ void TabbedUserScreen::eventCallback(GUIEngine::Widget* widget,
screen = OptionsScreenInput::getInstance();
else if (selection == "tab_ui")
screen = OptionsScreenUI::getInstance();
+ else if (selection == "tab_general")
+ screen = OptionsScreenGeneral::getInstance();
else if (selection == "tab_language")
screen = OptionsScreenLanguage::getInstance();
if(screen)