diff --git a/data/gui/screens/options_ui.stkgui b/data/gui/screens/options_ui.stkgui index d1c75f2b7..fd367ecf4 100644 --- a/data/gui/screens/options_ui.stkgui +++ b/data/gui/screens/options_ui.stkgui @@ -51,6 +51,16 @@ +
+
+ + +
diff --git a/src/config/user_config.hpp b/src/config/user_config.hpp index c1d82e38b..d1831fb90 100644 --- a/src/config/user_config.hpp +++ b/src/config/user_config.hpp @@ -644,7 +644,7 @@ namespace UserConfigParams &m_video_group, "Generate mipmap for textures using " "high quality method with SSE")); PARAM_PREFIX FloatUserConfigParam m_fonts_size - PARAM_DEFAULT( FloatUserConfigParam(2, "fonts_size", + PARAM_DEFAULT( FloatUserConfigParam(3, "fonts_size", &m_video_group,"The size of fonts. 0 is the smallest and 6 is the biggest") ); // ---- Recording diff --git a/src/main_android.cpp b/src/main_android.cpp index 7375a09fc..9afbdcc18 100644 --- a/src/main_android.cpp +++ b/src/main_android.cpp @@ -52,14 +52,17 @@ void override_default_params() case ACONFIGURATION_SCREENSIZE_NORMAL: UserConfigParams::m_multitouch_scale = 1.3f; UserConfigParams::m_multitouch_sensitivity_x = 0.1f; + UserConfigParams::m_fonts_size = 5.0f; break; case ACONFIGURATION_SCREENSIZE_LARGE: UserConfigParams::m_multitouch_scale = 1.2f; UserConfigParams::m_multitouch_sensitivity_x = 0.15f; + UserConfigParams::m_fonts_size = 5.0f; break; case ACONFIGURATION_SCREENSIZE_XLARGE: UserConfigParams::m_multitouch_scale = 1.1f; UserConfigParams::m_multitouch_sensitivity_x = 0.2f; + UserConfigParams::m_fonts_size = 4.0f; break; default: break; @@ -68,9 +71,6 @@ void override_default_params() // Enable screen keyboard UserConfigParams::m_screen_keyboard = 1; - // Set bigger fonts and buttons - UserConfigParams::m_fonts_size = 4.5f; - // It shouldn't matter, but STK is always run in fullscreen on android UserConfigParams::m_fullscreen = true; diff --git a/src/states_screens/options/options_screen_ui.cpp b/src/states_screens/options/options_screen_ui.cpp index 4685ff6a9..908115015 100644 --- a/src/states_screens/options/options_screen_ui.cpp +++ b/src/states_screens/options/options_screen_ui.cpp @@ -160,6 +160,12 @@ void OptionsScreenUI::init() UserConfigParams::m_minimap_display = 1; } minimap_options->setValue(UserConfigParams::m_minimap_display); + + GUIEngine::SpinnerWidget* font_size = getWidget("font_size"); + assert( font_size != NULL ); + + font_size->setValue((int)roundf(UserConfigParams::m_fonts_size)); + m_prev_font_size = UserConfigParams::m_fonts_size; // ---- video modes CheckBoxWidget* splitscreen_method = getWidget("split_screen_horizontally"); @@ -248,6 +254,12 @@ void OptionsScreenUI::eventCallback(Widget* widget, const std::string& name, con assert( minimap_options != NULL ); UserConfigParams::m_minimap_display = minimap_options->getValue(); } + else if (name == "font_size") + { + GUIEngine::SpinnerWidget* font_size = getWidget("font_size"); + assert( font_size != NULL ); + UserConfigParams::m_fonts_size = font_size->getValue(); + } else if (name == "split_screen_horizontally") { CheckBoxWidget* split_screen_horizontally = getWidget("split_screen_horizontally"); @@ -268,6 +280,11 @@ void OptionsScreenUI::eventCallback(Widget* widget, const std::string& name, con void OptionsScreenUI::tearDown() { + if (m_prev_font_size != UserConfigParams::m_fonts_size) + { + irr_driver->sameRestart(); + } + Screen::tearDown(); // save changes when leaving screen user_config->saveConfig(); diff --git a/src/states_screens/options/options_screen_ui.hpp b/src/states_screens/options/options_screen_ui.hpp index 959cc9723..9e196d4f4 100644 --- a/src/states_screens/options/options_screen_ui.hpp +++ b/src/states_screens/options/options_screen_ui.hpp @@ -35,6 +35,7 @@ class OptionsScreenUI : public GUIEngine::Screen, public GUIEngine::ScreenSingle { OptionsScreenUI(); bool m_inited; + float m_prev_font_size; std::vector m_skins;