diff --git a/src/gui/item_music.cpp b/src/gui/item_music.cpp new file mode 100644 index 00000000000..395e3a6cbdc --- /dev/null +++ b/src/gui/item_music.cpp @@ -0,0 +1,19 @@ +#include "gui/item_music.hpp" + +#include "gui/menu_manager.hpp" +#include "gui/menu_music.hpp" + +ItemMusic::ItemMusic(const std::string& text, int id) : + MenuItem(text, id) +{ +} + +void +ItemMusic::process_action(const MenuAction& action) +{ + if (action == MenuAction::HIT) { + MenuManager::instance().push_menu(std::make_unique()); + } +} + +/* EOF */ \ No newline at end of file diff --git a/src/gui/item_music.hpp b/src/gui/item_music.hpp new file mode 100644 index 00000000000..bd47e052a80 --- /dev/null +++ b/src/gui/item_music.hpp @@ -0,0 +1,18 @@ +#ifndef HEADER_SUPERTUX_GUI_ITEM_MUSIC_HPP +#define HEADER_SUPERTUX_GUI_ITEM_MUSIC_HPP + +#include "gui/menu_item.hpp" + +class ItemMusic : public MenuItem +{ +public: + ItemMusic(const std::string& text, int id = -1); + + /** Processes the menu action. */ + virtual void process_action(const MenuAction& action) override; + +}; + +#endif + +/* EOF */ \ No newline at end of file diff --git a/src/gui/menu_music.hpp b/src/gui/menu_music.hpp new file mode 100644 index 00000000000..0bf800ecff0 --- /dev/null +++ b/src/gui/menu_music.hpp @@ -0,0 +1,13 @@ +#ifndef HEADER_SUPERTUX_GUI_MENU_MUSIC_HPP +#define HEADER_SUPERTUX_GUI_MENU_MUSIC_HPP + +#include "gui/menu.hpp" + +class MusicMenu : public Menu { +public: + MusicMenu(); +}; + +#endif + +/* EOF */ \ No newline at end of file