projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
shorten unstable time
[supertux.git]
/
lib
/
gui
/
menu.h
diff --git
a/lib/gui/menu.h
b/lib/gui/menu.h
index
a1e5c34
..
c9ef6ee
100644
(file)
--- a/
lib/gui/menu.h
+++ b/
lib/gui/menu.h
@@
-21,14
+21,16
@@
#define SUPERTUX_MENU_H
#include <vector>
#define SUPERTUX_MENU_H
#include <vector>
+#include <set>
+#include <string>
+#include <utility>
#include "SDL.h"
#include "video/surface.h"
#include "SDL.h"
#include "video/surface.h"
+#include "video/font.h"
#include "special/timer.h"
#include "special/timer.h"
-#include "special/base.h"
-#include "special/stringlist.h"
-#include "gui/mousecursor.h"
+#include "mousecursor.h"
namespace SuperTux
{
namespace SuperTux
{
@@
-61,19
+63,26
@@
namespace SuperTux
class MenuItem
{
public:
class MenuItem
{
public:
+ MenuItem() {};
+ MenuItem(MenuItemKind kind, int id = -1);
+ MenuItem(MenuItemKind kind, int id, const std::string& text);
MenuItemKind kind;
MenuItemKind kind;
+ int id; // item id
int toggled;
int toggled;
-
char *
text;
-
char *
input;
+
std::string
text;
+
std::string
input;
int *int_p; // used for setting keys (can be used for more stuff...)
int *int_p; // used for setting keys (can be used for more stuff...)
- int id; // item id
- string_list_type* list;
+
+ std::vector<std::string> list; // list of values for a STRINGSELECT item
+ size_t selected; // currently selected item
+
Menu* target_menu;
Menu* target_menu;
- void change_text (const
char *
text);
- void change_input(const
char *
text);
+ void change_text (const
std::string&
text);
+ void change_input(const
std::string&
text);
- static MenuItem* create(MenuItemKind kind, const char *text, int init_toggle, Menu* target_menu, int id, int* int_p);
+ static MenuItem* create(MenuItemKind kind, const std::string& text,
+ int init_toggle, Menu* target_menu, int id, int* int_p);
std::string get_input_with_symbol(bool active_item); // returns the text with an input symbol
private:
std::string get_input_with_symbol(bool active_item); // returns the text with an input symbol
private:
@@
-130,6
+139,12
@@
namespace SuperTux
Timer joystick_timer;
public:
Timer joystick_timer;
public:
+ static Font* default_font;
+ static Font* active_font;
+ static Font* deactive_font;
+ static Font* label_font;
+ static Font* field_font;
+
Timer effect;
int arrange_left;
int active_item;
Timer effect;
int arrange_left;
int active_item;
@@
-139,6
+154,7
@@
namespace SuperTux
Menu();
~Menu();
Menu();
~Menu();
+ void additem(const MenuItem& menu_item);
void additem(MenuItem* pmenu_item);
void additem(MenuItemKind kind, const std::string& text, int init_toggle, Menu* target_menu, int id = -1, int *int_p = NULL);
void additem(MenuItem* pmenu_item);
void additem(MenuItemKind kind, const std::string& text, int init_toggle, Menu* target_menu, int id = -1, int *int_p = NULL);