diff --git a/rwgame/MenuSystem.hpp b/rwgame/MenuSystem.hpp index 55b1590a..09a36f3e 100644 --- a/rwgame/MenuSystem.hpp +++ b/rwgame/MenuSystem.hpp @@ -48,17 +48,26 @@ public: virtual void activate(float clickX, float clickY) = 0; }; - + struct Entry : public MenuEntry { - std::function callback; - - Entry(const std::string& title, std::function cb, float size) - : MenuEntry(title, size), callback(cb) {} - - void activate(float clickX, float clickY) { callback(); } + std::function callback; + + Entry(const std::string& title, + std::function cb, + float size) + : MenuEntry(title, size), callback(cb) + { + } + + void activate(float clickX, float clickY) + { + RW_UNUSED(clickX); + RW_UNUSED(clickY); + callback(); + } }; - + static std::shared_ptr lambda(const std::string& n, std::function callback, float size = 30.f) { return std::shared_ptr(new Entry(n, callback, size)); diff --git a/rwgame/debugstate.cpp b/rwgame/debugstate.cpp index 3a65ec98..37c96c56 100644 --- a/rwgame/debugstate.cpp +++ b/rwgame/debugstate.cpp @@ -213,11 +213,6 @@ Menu* DebugState::createMapMenu() Menu* DebugState::createVehicleMenu() { - CharacterObject* player = nullptr; - if (game->getPlayer()) { - player = game->getPlayer()->getCharacter(); - } - Menu* m = new Menu(2); m->offset = kDebugMenuOffset; @@ -252,11 +247,6 @@ Menu* DebugState::createVehicleMenu() Menu* DebugState::createAIMenu() { - CharacterObject* player = nullptr; - if (game->getPlayer()) { - player = game->getPlayer()->getCharacter(); - } - Menu* m = new Menu(2); m->offset = kDebugMenuOffset;