persona-3-dual
A DS demake of Persona 3
Loading...
Searching...
No Matches
MainMenu Class Reference

#include <MainMenu.hpp>

Inheritance diagram for MainMenu:
Collaboration diagram for MainMenu:

Static Public Member Functions

static void create ()
static void destroy ()
static MainMenu * getInstance ()

Public Attributes

char versionLabel [16] {}

Private Member Functions

 MainMenu ()
virtual ~MainMenu ()=default
ViewState mainMenuOptionSelected ()
ViewState levelOptionSelected ()
ViewState settingOptionSelected ()
void resetHook () override
 Used to set the default pauseMessage and options values.
void closeHook () override
 Execute logic after the root menu is exited.
void updateSave ()

Private Attributes

MenuOption mainMenuOptions [3]
MenuOption levelOptions [6]
MenuOption settingOptions [1]

Static Private Attributes

static MainMenu * instance = nullptr

Additional Inherited Members

Public Member Functions inherited from UIMenu
 UIMenu (bool iCustomRender=false)
 Construct a new UIMenu.
virtual void resetMenu ()
 Resets the menu to its initial state.
virtual ViewState updateHook ()
 Optional hook to call during the update loop.
void updateAnimation ()
int selectionOffset () const
int getSelectedOption () const
 Gets the index of the selected option.
int getStartIndex () const
 Gets the index of the first visible option.
etl::span< MenuOption > getOptions () const
 Gets the options of the active menu.
void setVisibleOptions (int count)
 Sets the visible option count of a custom render menu, as UISystem only sets it for the menus it draws.
Protected Member Functions inherited from UIMenu
ViewState changeMenu (etl::span< MenuOption > newOptions)
 Changes the active menu.
Protected Attributes inherited from UIMenu
std::string pauseMessage = "Pause"
bool isActive = false
TextComponent * text = nullptr
etl::span< MenuOption > options
int selectedOption = 0
int startIndex = 0

Detailed Description

Definition at line 25 of file MainMenu.hpp.

Constructor & Destructor Documentation

◆ MainMenu()

MainMenu::MainMenu ( )
inlineprivate

Definition at line 28 of file MainMenu.hpp.

Here is the caller graph for this function:

Member Function Documentation

◆ closeHook()

void MainMenu::closeHook ( )
overrideprivatevirtual

Execute logic after the root menu is exited.

Implements UIMenu.

Definition at line 41 of file MainMenu.cpp.

Here is the call graph for this function:

◆ create()

void MainMenu::create ( )
static

Definition at line 9 of file MainMenu.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ destroy()

void MainMenu::destroy ( )
static

Definition at line 17 of file MainMenu.cpp.

◆ getInstance()

MainMenu * MainMenu::getInstance ( )
static

Definition at line 26 of file MainMenu.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ levelOptionSelected()

ViewState MainMenu::levelOptionSelected ( )
private

Definition at line 71 of file MainMenu.cpp.

◆ mainMenuOptionSelected()

ViewState MainMenu::mainMenuOptionSelected ( )
private

Definition at line 48 of file MainMenu.cpp.

Here is the call graph for this function:

◆ resetHook()

void MainMenu::resetHook ( )
overrideprivatevirtual

Used to set the default pauseMessage and options values.

Implements UIMenu.

Definition at line 35 of file MainMenu.cpp.

◆ settingOptionSelected()

ViewState MainMenu::settingOptionSelected ( )
private

Definition at line 101 of file MainMenu.cpp.

◆ updateSave()

void MainMenu::updateSave ( )
private

Definition at line 114 of file MainMenu.cpp.

◆ ~MainMenu()

virtual MainMenu::~MainMenu ( )
privatevirtualdefault

Member Data Documentation

◆ instance

MainMenu * MainMenu::instance = nullptr
staticprivate

Definition at line 30 of file MainMenu.hpp.

◆ levelOptions

MenuOption MainMenu::levelOptions[6]
private
Initial value:
= {
{"Start Game", -1, menuBind(&MainMenu::levelOptionSelected)},
{"Iwatodai Dorm", -1, menuBind(&MainMenu::levelOptionSelected)},
{"Iwatodai Streets", -1, menuBind(&MainMenu::levelOptionSelected)},
{"Paulownia Mall", -1, menuBind(&MainMenu::levelOptionSelected)},
{"Sign Contract", -1, menuBind(&MainMenu::levelOptionSelected)},
}
constexpr MenuOptionFunc menuBind(Method method)
Definition UIMenu.hpp:15
ViewState levelOptionSelected()
Definition MainMenu.cpp:71

Definition at line 38 of file MainMenu.hpp.

◆ mainMenuOptions

MenuOption MainMenu::mainMenuOptions[3]
private
Initial value:
= {
{"Return to Title", -1, menuBind(&MainMenu::mainMenuOptionSelected)},
}
ViewState mainMenuOptionSelected()
Definition MainMenu.cpp:48

Definition at line 32 of file MainMenu.hpp.

◆ settingOptions

MenuOption MainMenu::settingOptions[1]
private
Initial value:
= {
{versionLabel, -1, nullptr},
}
char versionLabel[16]
Definition MainMenu.hpp:63

Definition at line 47 of file MainMenu.hpp.

◆ versionLabel

char MainMenu::versionLabel[16] {}

Definition at line 63 of file MainMenu.hpp.


The documentation for this class was generated from the following files: