-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
3,143 additions
and
542 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,64 +1,37 @@ | ||
/*! | ||
* \file include/Menu.h | ||
* \brief Menu 'overlay' interface | ||
* \brief Main Menu | ||
* | ||
* \author xythobuz | ||
*/ | ||
|
||
#ifndef _MENU_H_ | ||
#define _MENU_H_ | ||
|
||
#include <functional> | ||
#include <vector> | ||
|
||
#include "Script.h" | ||
#include "utils/Folder.h" | ||
|
||
class Menu { | ||
public: | ||
static int initialize(); | ||
static void shutdown(); | ||
static void display(); | ||
|
||
virtual ~Menu() { } | ||
|
||
virtual int initialize() = 0; | ||
|
||
virtual void display() = 0; | ||
|
||
virtual void handleKeyboard(KeyboardButton key, bool pressed) = 0; | ||
|
||
virtual void handleMouseClick(unsigned int x, unsigned int y, | ||
KeyboardButton button, bool released) = 0; | ||
|
||
virtual void handleMouseScroll(int xrel, int yrel) = 0; | ||
|
||
bool isVisible() { return visible; } | ||
|
||
void setVisible(bool v) { visible = v; } | ||
static bool isVisible() { return visible; } | ||
static void setVisible(bool v) { visible = v; } | ||
|
||
static const glm::vec4 textColor; | ||
static const glm::vec4 selectedColor; | ||
|
||
protected: | ||
|
||
virtual void showDialog(std::string msg, std::string btn1, std::string btn2 = "", | ||
std::function<int (bool state)> callback = std::function<int (bool)>()); | ||
|
||
virtual void ackDialog(); | ||
|
||
virtual bool handleKeyboardDialog(KeyboardButton key, bool pressed); | ||
|
||
virtual bool handleMouseClickDialog(unsigned int x, unsigned int y, | ||
KeyboardButton button, bool released); | ||
|
||
virtual bool handleMouseScrollDialog(int xrel, int yrel); | ||
|
||
virtual void displayDialog(); | ||
|
||
bool dialogState; | ||
std::string dialogText; | ||
std::string dialogButton1; | ||
std::string dialogButton2; | ||
std::function<int (bool state)> dialogFunction; | ||
|
||
bool visible; | ||
private: | ||
static bool visible; | ||
static Folder* mapFolder; | ||
static std::vector<Script> scripts; | ||
static std::vector<Folder> paths; | ||
static std::vector<int> images; | ||
}; | ||
|
||
Menu& getMenu(); | ||
|
||
#endif | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.