SuperTuxKart
Loading...
Searching...
No Matches
addons_screen.hpp
1// SuperTuxKart - a fun racing game with go-kart
2// Copyright (C) 2010-2015 Lucas Baudin, Joerg Henrichs
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#ifndef HEADER_ADDONS_SCREEN_HPP
19#define HEADER_ADDONS_SCREEN_HPP\
20
21#include "addons/addons_manager.hpp"
22#include "guiengine/screen.hpp"
23#include "guiengine/widgets/label_widget.hpp"
24#include "guiengine/widgets/text_box_widget.hpp"
25#include "states_screens/dialogs/addons_loading.hpp"
26
27/* used for the installed/unsinstalled icons*/
28namespace irr { namespace gui { class STKModifiedSpriteBank; } }
29
30namespace GUIEngine { class Widget; }
31
32struct DateFilter {
33 core::stringw label;
34 int year;
35 int month;
36 int day;
37};
38
44 public GUIEngine::ScreenSingleton<AddonsScreen>,
47{
49private:
51 AddonsLoading *m_load;
52 void loadInformations();
61
62 irr::gui::STKModifiedSpriteBank
63 *m_icon_bank;
65 *m_update_status;
66
68 std::string m_type;
69
73
74 float m_icon_height;
75
76 bool m_reloading;
77
78 bool m_sort_desc;
79
81 std::vector<DateFilter> m_date_filters;
82
83public:
84
86 void loadList();
87
89 virtual void loadedFromFile() OVERRIDE;
90
91 virtual void unloaded() OVERRIDE;
92
94 virtual void eventCallback(GUIEngine::Widget* widget, const std::string& name,
95 const int playerID) OVERRIDE;
96
98 virtual void beforeAddingWidget() OVERRIDE;
99
100 virtual void onColumnClicked(int column_id, bool sort_desc, bool sort_default) OVERRIDE;
101
102 virtual void init() OVERRIDE;
103 virtual void tearDown() OVERRIDE;
104
106 virtual void onUpdate(float dt) OVERRIDE;
107
109 virtual void onTextUpdated() OVERRIDE
110 {
111 loadList();
112 }
113
114 void setLastSelected();
115
116};
117
118#endif
Definition: addons_loading.hpp:35
Addons screen.
Definition: addons_screen.hpp:47
virtual void beforeAddingWidget() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: addons_screen.cpp:101
std::string m_type
Currently selected type.
Definition: addons_screen.hpp:68
void setLastSelected()
Selects the last selected item on the list (which is the item that is just being installed) again.
Definition: addons_screen.cpp:496
virtual void onTextUpdated() OVERRIDE
rebuild the list based on search text
Definition: addons_screen.hpp:109
int m_icon_loading
Icon for 'loading'.
Definition: addons_screen.hpp:60
std::vector< DateFilter > m_date_filters
List of date filters.
Definition: addons_screen.hpp:81
int m_icon_installed
Icon for installed addons, no update available.
Definition: addons_screen.hpp:56
virtual void eventCallback(GUIEngine::Widget *widget, const std::string &name, const int playerID) OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: addons_screen.cpp:425
int m_icon_not_installed
Icon for is not installed yet.
Definition: addons_screen.hpp:58
virtual void loadedFromFile() OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: addons_screen.cpp:70
int m_icon_needs_update
Icon for installed addon, which can be updated.
Definition: addons_screen.hpp:54
virtual void onColumnClicked(int column_id, bool sort_desc, bool sort_default) OVERRIDE
Definition: addons_screen.cpp:407
virtual void init() OVERRIDE
Callback invoked when entering this menu (after the widgets have been added).
Definition: addons_screen.cpp:142
virtual void onUpdate(float dt) OVERRIDE
implement callback from parent class GUIEngine::Screen
Definition: addons_screen.cpp:509
virtual void tearDown() OVERRIDE
Callback invoked before leaving this menu.
Definition: addons_screen.cpp:202
int m_selected_index
The currently selected index, used to re-select this item after addons_loading is being displayed.
Definition: addons_screen.hpp:72
virtual void unloaded() OVERRIDE
Callback invoked when this screen is being unloaded.
Definition: addons_screen.cpp:194
void loadList()
Load the addons into the main list.
Definition: addons_screen.cpp:210
Definition: list_widget.hpp:37
Definition: text_box_widget.hpp:42
A simple label widget.
Definition: label_widget.hpp:36
Declares a class to be a singleton.
Definition: screen.hpp:59
Represents a single GUI screen.
Definition: screen.hpp:97
Contains all GUI engine related classes and functions.
Definition: abstract_state_manager.hpp:33
Definition: addons_screen.hpp:32