1
// SuperTuxKart - a fun racing game with go-kart
2
// Copyright (C) 2010 Lucas Baudin
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.
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.
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.
20
#ifndef HEADER_ADDONS_SCREEN_HPP
21
#define HEADER_ADDONS_SCREEN_HPP
23
#include "guiengine/screen.hpp"
24
#include "states_screens/dialogs/addons_loading.hpp"
25
#include "addons/addons.hpp"
26
#include "guiengine/widgets/label_widget.hpp"
29
/* used for the installed/unsinstalled icons*/
30
namespace irr { namespace gui { class STKModifiedSpriteBank; } }
32
namespace GUIEngine { class Widget; }
35
* \brief Addons screen
36
* \ingroup states_screens
38
class AddonsScreen : public GUIEngine::Screen, public GUIEngine::ScreenSingleton<AddonsScreen>
40
friend class GUIEngine::ScreenSingleton<AddonsScreen>;
45
void loadInformations();
46
/** For the addons list, a package when it is installed. */
47
irr::gui::STKModifiedSpriteBank* m_icon_bank;
48
GUIEngine::LabelWidget* m_update_status;
53
pthread_mutex_t mutex;
56
/** Load the addons into the main list.*/
59
/** \brief implement callback from parent class GUIEngine::Screen */
60
virtual void loadedFromFile();
62
/** \brief implement callback from parent class GUIEngine::Screen */
63
virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name, const int playerID);
65
/** \brief implement callback from parent class GUIEngine::Screen */
68
friend void * startInstall(void *);
70
/** This function is used to download a text from the server to show the news. */
71
static void * downloadList(void *);
73
/** This function is used to handle the thread (load the new list, etc...). */
74
virtual void onUpdate(float delta, irr::video::IVideoDriver*);