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

#include <BattleMenu.hpp>

Inheritance diagram for BattleMenu:
Collaboration diagram for BattleMenu:

Public Member Functions

ViewState updateHook () override
 Optional hook to call during the update loop.
void prevOption () override
 Changes the current options to the previous options.
Public Member Functions inherited from UIMenu
 UIMenu (bool iCustomRender=false)
 Construct a new UIMenu.
virtual void resetMenu ()
 Resets the menu to its initial state.
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.

Static Public Member Functions

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

Protected Member Functions

void resetLoadedOptions ()
int consumeSelectedBattleOption ()
bool consumeCancel ()
void loadActionOptions (std::array< ActionBase *, 4 > *actions, std::string name)
void loadSkillOptions (PersonaBase *persona)
void loadPersonaOptions (etl::vector< PersonaBase *, 13 > *personas)
void loadTargetOptions (etl::vector< BattleParticipant *, 13 > *targets, bool healTarget)
void loadAllOutAttackConfirmation ()
void loadAlertOptions (const std::string &text)
bool isAlertExpired (int durationFrames) const
Protected Member Functions inherited from UIMenu
ViewState changeMenu (etl::span< MenuOption > newOptions)
 Changes the active menu.

Private Member Functions

 BattleMenu ()
virtual ~BattleMenu ()=default
void resetHook () override
 Used to set the default pauseMessage and options values.
void closeHook () override
 Execute logic after the root menu is exited.
ViewState battleOptionSelected ()

Private Attributes

BattleMenuOptions loadedOption = BattleMenuOptions::NONE
int selectedBattleOption = -1
bool isCancelled = false
etl::vector< MenuOption, 10 > battleOptions
int32_t alertStartFrame = 0
bool messagePrinted = false

Static Private Attributes

static BattleMenu * instance = nullptr

Friends

class BattleSystem

Additional Inherited Members

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 24 of file BattleMenu.hpp.

Constructor & Destructor Documentation

◆ BattleMenu()

BattleMenu::BattleMenu ( )
inlineprivate

Definition at line 28 of file BattleMenu.hpp.

Here is the caller graph for this function:

Member Function Documentation

◆ battleOptionSelected()

ViewState BattleMenu::battleOptionSelected ( )
private

Definition at line 258 of file BattleMenu.cpp.

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

◆ closeHook()

void BattleMenu::closeHook ( )
inlineoverrideprivatevirtual

Execute logic after the root menu is exited.

Implements UIMenu.

Definition at line 41 of file BattleMenu.hpp.

◆ consumeCancel()

bool BattleMenu::consumeCancel ( )
protected

Definition at line 272 of file BattleMenu.cpp.

◆ consumeSelectedBattleOption()

int BattleMenu::consumeSelectedBattleOption ( )
protected

Definition at line 265 of file BattleMenu.cpp.

◆ create()

void BattleMenu::create ( )
static

Definition at line 8 of file BattleMenu.cpp.

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

◆ destroy()

void BattleMenu::destroy ( )
static

Definition at line 16 of file BattleMenu.cpp.

◆ getInstance()

BattleMenu * BattleMenu::getInstance ( )
static

Definition at line 25 of file BattleMenu.cpp.

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

◆ isAlertExpired()

bool BattleMenu::isAlertExpired ( int durationFrames) const
protected

Definition at line 214 of file BattleMenu.cpp.

◆ loadActionOptions()

void BattleMenu::loadActionOptions ( std::array< ActionBase *, 4 > * actions,
std::string name )
protected

Definition at line 35 of file BattleMenu.cpp.

Here is the call graph for this function:

◆ loadAlertOptions()

void BattleMenu::loadAlertOptions ( const std::string & text)
protected

Definition at line 199 of file BattleMenu.cpp.

◆ loadAllOutAttackConfirmation()

void BattleMenu::loadAllOutAttackConfirmation ( )
protected

Definition at line 175 of file BattleMenu.cpp.

Here is the call graph for this function:

◆ loadPersonaOptions()

void BattleMenu::loadPersonaOptions ( etl::vector< PersonaBase *, 13 > * personas)
protected

Definition at line 103 of file BattleMenu.cpp.

Here is the call graph for this function:

◆ loadSkillOptions()

void BattleMenu::loadSkillOptions ( PersonaBase * persona)
protected

Definition at line 67 of file BattleMenu.cpp.

Here is the call graph for this function:

◆ loadTargetOptions()

void BattleMenu::loadTargetOptions ( etl::vector< BattleParticipant *, 13 > * targets,
bool healTarget )
protected

Definition at line 135 of file BattleMenu.cpp.

Here is the call graph for this function:

◆ prevOption()

void BattleMenu::prevOption ( )
overridevirtual

Changes the current options to the previous options.

Note
Override if a menu manually manages its state (doesn't use changeMenu, default prevOption functions)

Reimplemented from UIMenu.

Definition at line 279 of file BattleMenu.cpp.

Here is the call graph for this function:

◆ resetHook()

void BattleMenu::resetHook ( )
overrideprivatevirtual

Used to set the default pauseMessage and options values.

Implements UIMenu.

Definition at line 219 of file BattleMenu.cpp.

◆ resetLoadedOptions()

void BattleMenu::resetLoadedOptions ( )
protected

Definition at line 229 of file BattleMenu.cpp.

Here is the caller graph for this function:

◆ updateHook()

ViewState BattleMenu::updateHook ( )
overridevirtual

Optional hook to call during the update loop.

Can override the return from the standard update loop

Reimplemented from UIMenu.

Definition at line 241 of file BattleMenu.cpp.

◆ ~BattleMenu()

virtual BattleMenu::~BattleMenu ( )
privatevirtualdefault

◆ BattleSystem

friend class BattleSystem
friend

Definition at line 27 of file BattleMenu.hpp.

Member Data Documentation

◆ alertStartFrame

int32_t BattleMenu::alertStartFrame = 0
private

Definition at line 37 of file BattleMenu.hpp.

◆ battleOptions

etl::vector<MenuOption, 10> BattleMenu::battleOptions
private

Definition at line 36 of file BattleMenu.hpp.

◆ instance

BattleMenu * BattleMenu::instance = nullptr
staticprivate

Definition at line 30 of file BattleMenu.hpp.

◆ isCancelled

bool BattleMenu::isCancelled = false
private

Definition at line 34 of file BattleMenu.hpp.

◆ loadedOption

BattleMenuOptions BattleMenu::loadedOption = BattleMenuOptions::NONE
private

Definition at line 32 of file BattleMenu.hpp.

◆ messagePrinted

bool BattleMenu::messagePrinted = false
private

Definition at line 38 of file BattleMenu.hpp.

◆ selectedBattleOption

int BattleMenu::selectedBattleOption = -1
private

Definition at line 33 of file BattleMenu.hpp.


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