Skip to content

Commit

Permalink
Create stubs for the music picking menu (SuperTux#2617)
Browse files Browse the repository at this point in the history
  • Loading branch information
James De Ricco committed Nov 23, 2023
1 parent 6539a28 commit 09b86f2
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/gui/item_music.cpp
Original file line number Diff line number Diff line change
@@ -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<MusicMenu>());
}
}

/* EOF */
18 changes: 18 additions & 0 deletions src/gui/item_music.hpp
Original file line number Diff line number Diff line change
@@ -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 */
13 changes: 13 additions & 0 deletions src/gui/menu_music.hpp
Original file line number Diff line number Diff line change
@@ -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 */

0 comments on commit 09b86f2

Please sign in to comment.