diff --git a/ChangeLog.md b/ChangeLog.md index 64873b14..c0222003 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -2,6 +2,11 @@ ## OpenRaider (0.1.3) xythobuz + [ 20140312 ] + * Now including imguifilesystem dependency + * Completely re-wrote Main menu, now reading TOMBPC.DAT scripts + * Main menu is now just a full-screen ImGui window + [ 20140310 ] * Tried to fix moveable loading. Fixed TR1 angle parser, but still not working better. diff --git a/README.md b/README.md index a88ed0fe..3641c2e3 100644 --- a/README.md +++ b/README.md @@ -187,5 +187,7 @@ See the respective files in `cmake` for their licensing. The [clibs/commander](https://github.com/clibs/commander) dependency is Copyright (c) 2012 TJ Holowaychuk (tj@vision-media.ca) and licensed under the [MIT License](http://opensource.org/licenses/MIT). -The included GUI lib, [imgui](https://github.com/ocornut/imgui/) is Copyright (c) 2014 Omar Cornut. See src/deps/imgui/LICENSE for more informations about the MIT license used. +The included GUI lib, [imgui](https://github.com/ocornut/imgui/) is Copyright (c) 2014 Omar Cornut. See src/deps/imgui/LICENSE for more informations about the MIT license used. + +Also included is the imgui addon [imguifilesystem by Flix01](https://gist.github.com/Flix01/f34b5efa91e50a241c1b). diff --git a/include/Game.h b/include/Game.h index 7dcc0e18..77d63290 100644 --- a/include/Game.h +++ b/include/Game.h @@ -9,7 +9,6 @@ #define _GAME_H_ #include -#include #include "Entity.h" @@ -18,7 +17,7 @@ class Game { static void destroy(); static bool isLoaded() { return mLoaded; } - static int loadLevel(const char* level); + static int loadLevel(std::string level); static void handleAction(ActionEvents action, bool isFinished); static void handleMouseMotion(int xrel, int yrel, int xabs, int yabs); diff --git a/include/Menu.h b/include/Menu.h index 6e5351b7..0fbd7e5b 100644 --- a/include/Menu.h +++ b/include/Menu.h @@ -1,6 +1,6 @@ /*! * \file include/Menu.h - * \brief Menu 'overlay' interface + * \brief Main Menu * * \author xythobuz */ @@ -8,57 +8,30 @@ #ifndef _MENU_H_ #define _MENU_H_ -#include +#include + +#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 callback = std::function()); - - 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 dialogFunction; - - bool visible; + private: + static bool visible; + static Folder* mapFolder; + static std::vector