-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathaddons_screen.hpp
More file actions
121 lines (93 loc) · 3.69 KB
/
addons_screen.hpp
File metadata and controls
121 lines (93 loc) · 3.69 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
// SuperTuxKart - a fun racing game with go-kart
// Copyright (C) 2010-2015 Lucas Baudin, Joerg Henrichs
//
// 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_ADDONS_SCREEN_HPP
#define HEADER_ADDONS_SCREEN_HPP\
#include "addons/addons_manager.hpp"
#include "guiengine/screen.hpp"
#include "guiengine/widgets/list_widget.hpp"
#include "guiengine/widgets/text_box_widget.hpp"
#include <list>
/* used for the installed/unsinstalled icons*/
namespace irr { namespace gui { class STKModifiedSpriteBank; } }
namespace GUIEngine { class LabelWidget; class Widget; }
class AddonsLoading;
struct DateFilter {
core::stringw label;
int year;
int month;
int day;
};
/**
* \brief Addons screen
* \ingroup states_screens
*/
class AddonsScreen : public GUIEngine::Screen,
public GUIEngine::ScreenSingleton<AddonsScreen>,
public GUIEngine::IListWidgetHeaderListener,
public GUIEngine::ITextBoxWidgetListener
{
friend class GUIEngine::ScreenSingleton<AddonsScreen>;
private:
AddonsScreen();
AddonsLoading *m_load;
void loadInformations();
/** Icon for installed addon, which can be updated. */
int m_icon_needs_update;
/** Icon for installed addons, no update available. */
int m_icon_installed;
/** Icon for is not installed yet. */
int m_icon_not_installed;
/** Icon for 'loading' */
int m_icon_loading;
std::list<std::string> m_addon_queue;
AddonsLoading * m_addons_loading;
irr::gui::STKModifiedSpriteBank
*m_icon_bank;
/** Currently selected type. */
std::string m_type;
/** The currently selected index, used to re-select this item after
* addons_loading is being displayed. */
int m_selected_index;
bool m_reloading;
bool m_sort_desc;
bool m_cancelled;
/** List of date filters **/
std::vector<DateFilter> m_date_filters;
public:
/** Load the addons into the main list.*/
void loadList();
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void loadedFromFile() OVERRIDE;
virtual void unloaded() 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 beforeAddingWidget() OVERRIDE;
virtual void onColumnClicked(int column_id, bool sort_desc, bool sort_default) OVERRIDE;
virtual void init() OVERRIDE;
virtual void tearDown() OVERRIDE;
/** \brief implement callback from parent class GUIEngine::Screen */
virtual void onUpdate(float dt) OVERRIDE;
/** \brief rebuild the list based on search text */
virtual void onTextUpdated() OVERRIDE
{
loadList();
}
void setLastSelected();
};
#endif