1 // SuperTuxKart - a fun racing game with go-kart 2 // Copyright (C) 2009-2015 Marianne Gagnon 3 // 4 // This program is free software; you can redistribute it and/or 5 // modify it under the terms of the GNU General Public License 6 // as published by the Free Software Foundation; either version 3 7 // of the License, or (at your option) any later version. 8 // 9 // This program is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU General Public License for more details. 13 // 14 // You should have received a copy of the GNU General Public License 15 // along with this program; if not, write to the Free Software 16 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 18 19 #ifndef __HEADER_OPTIONS_SCREEN_UI_HPP__ 20 #define __HEADER_OPTIONS_SCREEN_UI_HPP__ 21 22 #include <memory> 23 #include <string> 24 25 #include "guiengine/screen.hpp" 26 27 namespace GUIEngine { class Widget; } 28 29 struct CameraPreset 30 { 31 int fov; 32 float distance; 33 float angle; 34 bool smoothing; 35 float backward_angle; 36 }; 37 38 struct Input; 39 40 /** 41 * \brief Graphics options screen 42 * \ingroup states_screens 43 */ 44 class OptionsScreenUI : public GUIEngine::Screen, public GUIEngine::ScreenSingleton<OptionsScreenUI> 45 { 46 struct ReloadOption 47 { 48 bool m_reload_font; 49 bool m_reload_skin; 50 std::string m_focus_name; 51 bool m_focus_right; 52 }; 53 std::unique_ptr<ReloadOption> m_reload_option; 54 OptionsScreenUI(); 55 bool m_inited; 56 57 std::vector<CameraPreset> m_camera_presets; 58 59 std::map<core::stringw, std::string> m_skins; 60 61 void updateCamera(); 62 public: 63 friend class GUIEngine::ScreenSingleton<OptionsScreenUI>; 64 65 /** \brief implement callback from parent class GUIEngine::Screen */ 66 virtual void loadedFromFile() OVERRIDE; 67 68 /** \brief implement callback from parent class GUIEngine::Screen */ 69 virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name, 70 const int playerID) OVERRIDE; 71 72 /** \brief implement callback from parent class GUIEngine::Screen */ 73 virtual void init() OVERRIDE; 74 75 /** \brief implement callback from parent class GUIEngine::Screen */ 76 virtual void tearDown() OVERRIDE; 77 78 /** \brief implement optional callback from parent class GUIEngine::Screen */ 79 virtual void unloaded() OVERRIDE; 80 81 void updateCameraPresetSpinner(); 82 83 virtual void onUpdate(float delta) OVERRIDE; 84 85 void reloadGUIEngine(); 86 }; 87 88 #endif 89