projects
/
supertux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use field width of 9 on sscanf (fixes cppcheck portability issues)
[supertux.git]
/
src
/
gui
/
menu_manager.hpp
diff --git
a/src/gui/menu_manager.hpp
b/src/gui/menu_manager.hpp
index
85ba2ec
..
2be6983
100644
(file)
--- a/
src/gui/menu_manager.hpp
+++ b/
src/gui/menu_manager.hpp
@@
-1,5
+1,5
@@
// SuperTux
// SuperTux
-// Copyright (C) 2009 Ingo Ruhnke <grumbel@gm
x.de
>
+// Copyright (C) 2009 Ingo Ruhnke <grumbel@gm
ail.com
>
//
// 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
//
// 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
@@
-17,12
+17,16
@@
#ifndef HEADER_SUPERTUX_GUI_MENU_MANAGER_HPP
#define HEADER_SUPERTUX_GUI_MENU_MANAGER_HPP
#ifndef HEADER_SUPERTUX_GUI_MENU_MANAGER_HPP
#define HEADER_SUPERTUX_GUI_MENU_MANAGER_HPP
-#include <vector>
#include <list>
#include <memory>
#include <list>
#include <memory>
+#include <vector>
-class Menu;
+#include "SDL.h"
+
+class Dialog;
class DrawingContext;
class DrawingContext;
+class Menu;
+class MenuTransition;
class MenuManager
{
class MenuManager
{
@@
-31,52
+35,42
@@
private:
public:
static MenuManager& instance();
public:
static MenuManager& instance();
-public:
- std::vector<std::unique_ptr<Menu> > m_menu_stack;
-
- bool close;
- float effect_progress;
- float effect_start_time;
+private:
+ std::unique_ptr<Dialog> m_dialog;
+ bool m_has_next_dialog;
+ std::unique_ptr<Dialog> m_next_dialog;
- friend class Menu;
+ std::vector<std::unique_ptr<Menu> > m_menu_stack;
+ std::unique_ptr<MenuTransition> m_transition;
public:
MenuManager();
~MenuManager();
public:
MenuManager();
~MenuManager();
+ void event(const SDL_Event& event);
+ void process_input();
+ void refresh();
+
void draw(DrawingContext& context);
void draw(DrawingContext& context);
- bool check_menu();
- void set_menu(int id);
- void clear_menu_stack();
+ void set_dialog(std::unique_ptr<Dialog> dialog);
- void push_menu(std::unique_ptr<Menu> menu);
+ void set_menu(int id);
+ void set_menu(std::unique_ptr<Menu> menu);
void push_menu(int id);
void push_menu(int id);
+ void push_menu(std::unique_ptr<Menu> menu);
void pop_menu();
void pop_menu();
+ void clear_menu_stack();
- void recalc_pos();
-
- /** Return the current active menu or NULL if none is active */
- Menu* current() const
- {
- if (m_menu_stack.empty())
- {
- return nullptr;
- }
- else
- {
- return m_menu_stack.back().get();
- }
- }
-
+ void on_window_resize();
bool is_active() const
{
return !m_menu_stack.empty();
}
private:
bool is_active() const
{
return !m_menu_stack.empty();
}
private:
- /** Set the current menu, if pmenu is NULL, hide the current menu */
- void
set_menu(std::unique_ptr<Menu> menu
);
+ Menu* current_menu() const;
+ void
transition(Menu* from, Menu* to
);
private:
MenuManager(const MenuManager&);
private:
MenuManager(const MenuManager&);