From 09b86f2e946a4e03ad9069c278305fafd12ac1ff Mon Sep 17 00:00:00 2001 From: James De Ricco Date: Fri, 13 Oct 2023 00:29:47 -0400 Subject: [PATCH] Create stubs for the music picking menu (#2617) --- src/gui/item_music.cpp | 19 +++++++++++++++++++ src/gui/item_music.hpp | 18 ++++++++++++++++++ src/gui/menu_music.hpp | 13 +++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 src/gui/item_music.cpp create mode 100644 src/gui/item_music.hpp create mode 100644 src/gui/menu_music.hpp 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