1 //  SuperTuxKart - a fun racing game with go-kart
2 //
3 //  Copyright (C) 2006-2015 SuperTuxKart-Team
4 //
5 //  This program is free software; you can redistribute it and/or
6 //  modify it under the terms of the GNU General Public License
7 //  as published by the Free Software Foundation; either version 3
8 //  of the License, or (at your option) any later version.
9 //
10 //  This program is distributed in the hope that it will be useful,
11 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
12 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 //  GNU General Public License for more details.
14 //
15 //  You should have received a copy of the GNU General Public License
16 //  along with this program; if not, write to the Free Software
17 //  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
18 
19 #ifndef PLAYER_NAME_SPINNER_HPP
20 #define PLAYER_NAME_SPINNER_HPP
21 
22 #include "guiengine/widgets/spinner_widget.hpp"
23 #include <IGUIImage.h>
24 
25 class KartSelectionScreen;
26 
27 namespace GUIEngine
28 {
29     /** A small extension to the spinner widget to add features like player ID
30      *  management or badging */
31     class PlayerNameSpinner : public GUIEngine::SpinnerWidget
32     {
33         int m_player_id;
34         bool m_incorrect;
35         irr::gui::IGUIImage* m_red_mark_widget;
36         KartSelectionScreen* m_parent;
37         //virtual EventPropagation focused(const int m_playerID) ;
38 
39     public:
40         PlayerNameSpinner(KartSelectionScreen* parent, const int playerID);
41         // ------------------------------------------------------------------------
42         void setID(const int m_playerID);
43 
44         // ------------------------------------------------------------------------
45         /** Add a red mark on the spinner to mean "invalid choice" */
46         void markAsIncorrect();
47         // ------------------------------------------------------------------------
48         /** Remove any red mark set with 'markAsIncorrect' */
49         void markAsCorrect();
50     };
51 }
52 
53 #endif
54 
55