#include <menuBottom.h>
Inherits spriteManager.
Inheritance diagram for menuBottom:
Public Member Functions | |
menuBottom (u8 newScreen=0) | |
create a menu and give it a screen to display on. | |
virtual | ~menuBottom () |
void | loadBackground () |
Load the background for this screen. | |
virtual void | clearOutSprites (bool keepSound=false) |
Flush the sprite system and reset everything for a new round. | |
virtual void | gameTick () |
Handle all the possible menu input that a user can achieve on this screen. | |
virtual void | activate () |
Give this spriteManager control of its screen, and display the main menu. | |
virtual void | deactivate () |
Put this spriteManager into a hibernation state so that tick events are no longer executed for it. | |
void | loadCursorSpriteSet (const unsigned short *p, const unsigned char *s) |
load the sprite data for the menu cursor | |
void | loadPickupSpriteSet (const unsigned short *p, const unsigned char *s) |
load the sprite data for Pickups | |
void | loadMenuSpriteSet (const unsigned short *p, const unsigned char *s) |
load the sprite data for menu instructions | |
void | scoreKill (u8 player, u8 weaponID=18) |
A Player scored a kill during a match - save a record of this into SRAM. | |
void | scoreDeath (u8 player, u8 weaponID=18) |
A Player died during a match - save a record of this into SRAM. | |
void | scoreTime (u8 player, u8 weaponID, u16 timeSecs) |
A Player switched weapons - save a record of how long they were holding their old weapon for. | |
void | scoreRound (u8 winner, u8 loser, bool tied) |
A round has ended - accumulate and save the winner and loser's points in SRAM. | |
void | saveStats () |
Save the game statistics. | |
Public Attributes | |
spriteManager * | menuTop |
spriteManager which handles the top screen during frontend | |
spriteManager * | gameBottom |
spriteManager which handles the bottom screen during gameplay | |
gameManager * | gameTop |
spriteManager which handles the top screen during gameplay | |
u8 | player1id |
u8 | player2id |
const unsigned short * | playerPallete1 |
const unsigned short * | playerPallete2 |
const unsigned short * | playerPallete3 |
const unsigned short * | playerPallete4 |
const unsigned char * | playerSprite1 |
const unsigned char * | playerSprite2 |
const unsigned char * | playerSprite3 |
string | playerNames |
a string of all the character names. Each name is 8 characters, * 6 names = 48 length. | |
u8 | numPickups |
number of pickups that can be active at a time, used by menuGBottom | |
bool | dieWhileDancing |
bool | showPickups |
soundData | menuMove |
soundData | menuOk |
soundData | menuCancel |
Private Member Functions | |
void | normalNav () |
normal navigation actions. The cursor is moved by the DS's D-Pad intuitively around the screen | |
void | statsNav () |
navigation actions for the statistics page. Up/Down navigates the player, Left/Right navigates the page. | |
void | miscNav () |
navigation actions for the misc settings page. Up/Down changes item only. | |
void | charNav () |
navigation actions for character selection page. Up/Down changes character, Left/Right makes them active in either player slot. | |
void | charNameNav () |
navigation actions for character rename page. Up/Down changes letter, Left/Right navigates between letters | |
void | roundsNav () |
navigation actions for round number page. Up/Down changes the number of rounds. | |
void | normalRender (u8 i) |
normal menu item drawing function. | |
void | statsRender (u8 i) |
screen rendering function for statistics menu items. | |
void | pickupsRender (u8 i) |
screen rendering function for Pickups menu items. | |
void | charRender (u8 i) |
screen rendering function for character menu items. | |
void | charNameRender (u8 i) |
screen rendering function for character renaming menu, used to set the cursor frame. | |
void | mainAction (bool stylusTouched=false, bool stylusActivated=false) |
Actions for the main menu. | |
void | charAction (bool stylusTouched=false, bool stylusActivated=false) |
Actions for the character selection menu. | |
void | pickupsAction (bool stylusTouched=false, bool stylusActivated=false) |
Actions for the Pickups menu. | |
void | roundsAction (bool stylusTouched=false, bool stylusActivated=false) |
Actions for the rounds menu. | |
void | sramAction (bool stylusTouched=false, bool stylusActivated=false) |
Actions for the SRAM warning menu. | |
void | controlsAction (bool stylusTouched=false, bool stylusActivated=false) |
Actions for the controls menu. | |
void | charNameAction (bool stylusTouched=false, bool stylusActivated=false) |
Actions for the character names menu. | |
void | creditsAction (bool stylusTouched=false, bool stylusActivated=false) |
Actions for the credits menu. | |
void | miscAction (bool stylusTouched=false, bool stylusActivated=false) |
Actions for the misc settings menu. | |
void | statsAction (bool stylusTouched=false, bool stylusActivated=false) |
Actions for the statistics menu. | |
void | clearMenus () |
Clear the menu screen entirely so that a new menu can replace the current one. | |
void | makeCursor () |
Create a cursor sprite for the currently active menu. | |
void | autoMenuClickRegions () |
fill all menuItem stylus hitboxes out based on text position and length | |
s8 | touchingWhichItem (u16 x, u16 y) |
Find out which menuItem is touched at the coordinates given. | |
void | mainMenu (u8 prevScreen=0) |
load the main menu onto the screen. | |
void | characterMenu () |
load the character selection menu onto the screen. ID 1. | |
void | pickupMenu () |
load the Pickups selection menu onto the screen. ID 2. | |
void | roundsMenu () |
load the round number selection menu onto the screen. ID 3. | |
void | saveWarningMenu () |
load the SRAM format warning onto the screen. ID 4. | |
void | controlsMenu () |
load the controls page onto the screen. ID 5. | |
void | playerRenameMenu (u8 playerID) |
load the rename character menu onto the screen. | |
void | creditsMenu () |
load the credits page onto the screen. ID 7. | |
void | miscMenu () |
load the miscellaneous settings menu onto the screen. ID 8. | |
void | statsMenu () |
load the statistics viewing menu onto the screen. ID 9. | |
void | alterPlayerName (u8 playerID, u8 letterID, s8 modBy) |
Modify a specific char in a character's name by the desired amount. | |
bool | isSRAMSaved () |
Checks whether or not the DS's SRAM has been formatted for MDuel DS, as some flashcarts actually share SRAM between programs (!). | |
void | drawStatsFor (u8 player, u8 page) |
This function draws a state page for the character/page combo. | |
void | writeStatValueAt (u16 offset, u16 value) |
A utility function to write a statistic at a specific offset in memory. | |
u16 | readStatValueAt (u16 offset) const |
A utility function to read a statistic from a specific offset in memory. | |
void | erasePlayer (u8 player) |
Completely clear out all statistical data for a character. | |
u16 | getKillsForPlayer (s8 player, s8 weaponID) const |
Retrieve the number of kills a character has made with a specific weapon. | |
u16 | getDeathsForPlayer (s8 player, s8 weaponID) const |
Retrieve the number of deaths a character has with a specific weapon. | |
u16 | getTimeForPlayer (s8 player, s8 weaponID) const |
Retrieve the time (in seconds) a character has spent with a specific weapon. | |
u16 | getWins (s8 player) const |
Retrieve the number of round wins a character has had. | |
u16 | getLosses (s8 player) const |
Retrieve the number of round losses a character has had. | |
u16 | getTies (s8 player) const |
Retrieve the number of round ties a character has had. | |
void | loadSRAM (bool firstLoad=false) |
Load all saveable variables from the DS's SRAM, or from memory if SRAM has not been formatted. | |
void | saveSRAM (bool dontCheck=false, u8 menuNumber=0) |
Save all persistant variables into the DS's SRAM for retrieval later. | |
void | sramSavePrevVars () |
Save data by setting backup variables in memory. | |
void | sramLoadPrevVars () |
Load persistent variables from backups. | |
void | sramLoadDefaults () |
Set default values for persistent variables when the game is loaded for the first time. | |
bool | pickupSelected (u8 pickupID) |
check if a Pickup ID is currently enabled | |
void | makePickupIcon (string text, u8 num, u16 curx, u16 cury) |
Generate a menu item that comprises a Pickup icon on the Pickup selection screen. | |
void | makeInstructions (u8 frame, u8 xpos) |
Create an instruction sprite and place it at the bottom of the screen. | |
const unsigned char * | getPlayerSpriteData (u8 idNum) |
Retrieve the sprite data for a character GFX id. | |
const unsigned short * | getPlayerPalleteData (u8 idNum) |
Retrieve the pallete data for a character pallete id. | |
u8 | getPlayerPalleteID (u8 idNum) |
Retrieve the preloaded pallete index for a character pallete id. | |
void | updatePlayerIcon (u8 i) |
Destroy and recreate a character sprite, as a visual property of it has been updated. | |
void | loadPlayerGFX (u8 dataNum, u8 playerNum) |
Make the gameManager load the graphics for a Player from the character they have selected. | |
void | pickupToggle (u8 i) |
Modify menuBottom::pickupMask by toggling a desired Pickup. | |
void | selectPlayer (u8 i, u8 playerNum) |
Pick a character for use by a player. | |
void | playerColorCycle (u8 i) |
Change the colour of a character sprite by using a different pallete. | |
void | playerGFXCycle (u8 i) |
Change the sprite of a character by using a different GFX. | |
Private Attributes | |
void(menuBottom::* | navFunction )() |
the screen navigation function that will be currently executed every tick | |
void(menuBottom::* | renderFunction )(u8) |
the menu item display changing function that manipulates each menuItem in the current menu. | |
void(menuBottom::* | actionFunction )(bool, bool) |
the action function that will be currently executed every tick | |
u8 | playerPal1 |
u8 | playerPal2 |
u8 | playerPal3 |
u8 | playerPal4 |
spriteSet | cursorSprite |
spriteSet | pickupSprite |
spriteSet | menuSprite |
u8 | editingName |
id of the character name being edited, for the character selection screen | |
s8 | selectedItem |
index of the selected menu item | |
u8 | menuColSize |
size of menu columns (if present) | |
vector< menuItem > | menuItems |
all the active menuItems for a menu | |
spriteObject * | cursor |
the cursor sprite that shows us what we have selected | |
s8 | selectedItem2 |
Rather nasty hack for the settings screen and its two cursors. I could do it properly, but im impatient. | |
u8 | settingsPlayer |
u8 | settingsPage |
string | prevPlayerNames |
u8 | roundNum |
u8 | prevRoundNum |
u32 | pickupMask |
u32 | prevPickupMask |
u8 | prevPlayer1id |
u8 | prevPlayer2id |
u8 | playerSprs [6] |
u8 | prevPlayerSprs [6] |
u8 | playerPals [6] |
u8 | prevPlayerPals [6] |
bool | prevDieWhileDancing |
bool | prevShowPickups |
u8 | prevNumPickups |
u8 | statistics [798] |
A GIANT array of statistical data in SRAM format. | |
u8 | menuRepeater |
ticks for changing text and round numbers | |
Static Private Attributes | |
static const u8 | PLAYERSLOTSIZE = 120 |
size of an individual character's slot in the menuBottom::statistics array. | |
static const u8 | GLOBALSLOTSIZE = 78 |
size of the global statistics slot in the menuBottom::statistics array. | |
static const u8 | WEAPONBLOCKSIZE = 38 |
size of a weapon statistics block in the menuBottom::statistics array. | |
static const u8 | _SRAMIDOFFSET = 0 |
the SRAM offset to save the format check string (menuBottom::_SRAMID) in | |
static const u8 | _ROUNDSOFFSET = 7 |
the SRAM offset to save the number of rounds to play (menuBottom::roundNum) at | |
static const u8 | _PICKUPOFFSET = 8 |
the SRAM offset to save the active Pickups mask (menuBottom::pickupMask) at | |
static const u8 | _PLAYER1IDOFFSET = 12 |
the SRAM offset to save the selected character for Player 1 (menuBottom::player1id) at | |
static const u8 | _PLAYER2IDOFFSET = 13 |
the SRAM offset to save the selected character for Player 2 (menuBottom::player2id) at | |
static const u8 | _PLAYERSPRSOFFSET = 14 |
the SRAM offset to save the character GFX ids (menuBottom::playerSprs) at | |
static const u8 | _PLAYERPALSOFFSET = 20 |
the SRAM offset to save the character pallete ids (menuBottom::playerPals) at | |
static const u8 | _NAMESOFFSET = 26 |
the SRAM offset to save the character names (menuBottom::playerNames) at | |
static const u8 | _SETTINGSOFFSET = 76 |
the SRAM offset to save the game's miscellaneous settings (menuBottom::dieWhileDancing, menuBottom::numPickups and menuBottom::showPickups) at | |
static const u8 | _STATSOFFSET = 78 |
the SRAM offset to save character statistics (menuBottom::statistics) at | |
static const u16 | _STATSLEN = 798 |
the length of menuBottom::statistics, to manage SRAM size | |
static const char * | _SRAMID |
the ID to save at the base address in SRAM that tells us if SRAM has been formatted for this game | |
static const u8 | _NUMPICKUPS = 18 |
the number of Pickups in the game | |
static const u8 | MAXPICKUPSONSCREEN = 10 |
the maximum number of Pickups that can be configured. Must be low enough so that we do not run out of sprites. | |
static const u32 | _ALLPICKUPS = 262143 |
a bit for every Pickup type turned on | |
static const u8 | _NUMSAVESLOTS = 6 |
number of character save slots | |
static const u8 | menuRepeatDelay = 10 |
number of frames to wait before changing the selected menu item when a scrolling button is held down | |
Classes | |
struct | menuItem |
Properties needed to display a specific menu element. More... |
This spriteManager is responsible for updating and saving all data into SRAM, so that it is stored between game sessions. When SRAM is not or cannot be used, the game variables are stored temporarily and lost when the DS powers off.
It maintains several menu screens to modify this data. These screens are primarily interfaced via the control pad, however some of them respond to stylus taps as well.
Definition at line 50 of file menuBottom.h.
menuBottom::menuBottom | ( | u8 | newScreen = 0 |
) |
create a menu and give it a screen to display on.
newScreen | the screen this spriteManager should handle. 1 is the top screen, 0 is the bottom. |
Definition at line 31 of file menuBottom.cpp.
menuBottom::~menuBottom | ( | ) | [virtual] |
Definition at line 42 of file menuBottom.cpp.
void menuBottom::loadBackground | ( | ) |
Load the background for this screen.
Definition at line 630 of file menuBottom.cpp.
References spriteManager::screen.
Referenced by activate(), and clearMenus().
void menuBottom::clearOutSprites | ( | bool | keepSound = false |
) | [virtual] |
Flush the sprite system and reset everything for a new round.
Sets all spriteSets palleteID's back to -1 so that they will be reloaded again later.
Reimplemented from spriteManager.
Definition at line 639 of file menuBottom.cpp.
References spriteManager::clearOutSprites(), cursorSprite, menuSprite, and pickupSprite.
Referenced by clearMenus().
Here is the call graph for this function:
void menuBottom::gameTick | ( | ) | [virtual] |
Handle all the possible menu input that a user can achieve on this screen.
Detects stylus input on menu items, menu navigation and rendering, and menu changing based on the menu screen and menu item selected.
TODO: deprecate this function and use function pointers to break down menu actions into nicer discrete blocks of logic.
Reimplemented from spriteManager.
Definition at line 56 of file menuBottom.cpp.
References actionFunction, cursor, spriteManager::gameTick(), menuColSize, menuItems, menuMove, menuRepeatDelay, menuRepeater, navFunction, normalRender(), spriteManager::playSound(), renderFunction, selectedItem, spriteObject::setFrame(), spriteObject::setPos(), and touchingWhichItem().
Referenced by main().
Here is the call graph for this function:
virtual void menuBottom::activate | ( | ) | [inline, virtual] |
Give this spriteManager control of its screen, and display the main menu.
Reimplemented from spriteManager.
Definition at line 65 of file menuBottom.h.
References spriteManager::activate(), loadBackground(), loadSRAM(), mainMenu(), and spriteManager::resetText().
Referenced by menuGBottom::gameTick(), and main().
Here is the call graph for this function:
virtual void menuBottom::deactivate | ( | ) | [inline, virtual] |
Put this spriteManager into a hibernation state so that tick events are no longer executed for it.
Reimplemented from spriteManager.
Definition at line 78 of file menuBottom.h.
References spriteManager::deactivate(), and spriteManager::unloadBackground().
Referenced by mainAction().
Here is the call graph for this function:
void menuBottom::loadCursorSpriteSet | ( | const unsigned short * | p, | |
const unsigned char * | s | |||
) |
load the sprite data for the menu cursor
Definition at line 650 of file menuBottom.cpp.
References cursorSprite, and spriteManager::loadSpriteSet().
Referenced by clearMenus(), and main().
Here is the call graph for this function:
void menuBottom::loadPickupSpriteSet | ( | const unsigned short * | p, | |
const unsigned char * | s | |||
) |
load the sprite data for Pickups
Definition at line 656 of file menuBottom.cpp.
References spriteManager::loadSpriteSet(), and pickupSprite.
Referenced by main(), and pickupMenu().
Here is the call graph for this function:
void menuBottom::loadMenuSpriteSet | ( | const unsigned short * | p, | |
const unsigned char * | s | |||
) |
load the sprite data for menu instructions
Definition at line 662 of file menuBottom.cpp.
References spriteManager::loadSpriteSet(), and menuSprite.
Referenced by clearMenus(), and main().
Here is the call graph for this function:
void menuBottom::scoreKill | ( | u8 | player, | |
u8 | weaponID = 18 | |||
) |
A Player scored a kill during a match - save a record of this into SRAM.
player | the 1-indexed id of the character who made the kill | |
weaponID | the id of the weapon the kill was made with. Relates to Pickup::pickupType, except for id 18 which denotes a drowning. |
Definition at line 1534 of file menuBottom.cpp.
References GLOBALSLOTSIZE, PLAYERSLOTSIZE, readStatValueAt(), and writeStatValueAt().
Referenced by gameManager::playerDied().
Here is the call graph for this function:
void menuBottom::scoreDeath | ( | u8 | player, | |
u8 | weaponID = 18 | |||
) |
A Player died during a match - save a record of this into SRAM.
player | the 1-indexed id of the character who died | |
weaponID | the id of the weapon that caused the kill. Relates to Pickup::pickupType, except for id 18 which denotes a drowning. |
Definition at line 1548 of file menuBottom.cpp.
References GLOBALSLOTSIZE, PLAYERSLOTSIZE, readStatValueAt(), WEAPONBLOCKSIZE, and writeStatValueAt().
Referenced by gameManager::playerDied().
Here is the call graph for this function:
void menuBottom::scoreTime | ( | u8 | player, | |
u8 | weaponID, | |||
u16 | timeSecs | |||
) |
A Player switched weapons - save a record of how long they were holding their old weapon for.
player | the 1-indexed id of the character who changed weapons | |
weaponID | the id of the weapon that was just dropped. 18 denotes the Player had no weapon. | |
timeSecs | the total time the weapon was held for |
Definition at line 1566 of file menuBottom.cpp.
References GLOBALSLOTSIZE, PLAYERSLOTSIZE, readStatValueAt(), WEAPONBLOCKSIZE, and writeStatValueAt().
Referenced by Player::weaponChange().
Here is the call graph for this function:
void menuBottom::scoreRound | ( | u8 | winner, | |
u8 | loser, | |||
bool | tied | |||
) |
A round has ended - accumulate and save the winner and loser's points in SRAM.
winner | 1-indexed id of the character who won the round | |
loser | 1-indexed id of the character who lost the round | |
tied | if true, both players store ties instead of a win and a loss |
Definition at line 1584 of file menuBottom.cpp.
References GLOBALSLOTSIZE, PLAYERSLOTSIZE, readStatValueAt(), WEAPONBLOCKSIZE, and writeStatValueAt().
Referenced by gameManager::gameTick().
Here is the call graph for this function:
void menuBottom::saveStats | ( | ) |
Save the game statistics.
Designed to be called by the gameManager every time a statistic changes. The stats will only be saved if SRAM has been formatted for MDuel.
Definition at line 1521 of file menuBottom.cpp.
References _STATSLEN, _STATSOFFSET, isSRAMSaved(), and statistics.
Referenced by writeStatValueAt().
Here is the call graph for this function:
void menuBottom::normalNav | ( | ) | [private] |
normal navigation actions. The cursor is moved by the DS's D-Pad intuitively around the screen
Definition at line 120 of file menuBottom.cpp.
References menuColSize, menuItems, and selectedItem.
Referenced by clearMenus().
void menuBottom::statsNav | ( | ) | [private] |
navigation actions for the statistics page. Up/Down navigates the player, Left/Right navigates the page.
Definition at line 135 of file menuBottom.cpp.
References drawStatsFor(), menuMove, spriteManager::playSound(), selectedItem, and selectedItem2.
Referenced by statsMenu().
Here is the call graph for this function:
void menuBottom::miscNav | ( | ) | [private] |
navigation actions for the misc settings page. Up/Down changes item only.
Definition at line 170 of file menuBottom.cpp.
References menuColSize, menuItems, and selectedItem.
Referenced by miscMenu().
void menuBottom::charNav | ( | ) | [private] |
navigation actions for character selection page. Up/Down changes character, Left/Right makes them active in either player slot.
Definition at line 181 of file menuBottom.cpp.
References menuColSize, menuItems, menuMove, player1id, player2id, playerColorCycle(), playerPals, spriteManager::playSound(), selectedItem, and selectPlayer().
Referenced by characterMenu().
Here is the call graph for this function:
void menuBottom::charNameNav | ( | ) | [private] |
navigation actions for character rename page. Up/Down changes letter, Left/Right navigates between letters
Definition at line 208 of file menuBottom.cpp.
References alterPlayerName(), editingName, macros::getPlayerName(), menuItems, menuMove, menuRepeater, playerNames, spriteManager::playSound(), spriteManager::screen, and selectedItem.
Referenced by playerRenameMenu().
Here is the call graph for this function:
void menuBottom::roundsNav | ( | ) | [private] |
navigation actions for round number page. Up/Down changes the number of rounds.
Definition at line 233 of file menuBottom.cpp.
References gameTop, menuMove, menuRepeater, spriteManager::playSound(), gameManager::pointsToWin, roundNum, and spriteManager::screen.
Referenced by roundsMenu().
Here is the call graph for this function:
void menuBottom::normalRender | ( | u8 | i | ) | [private] |
normal menu item drawing function.
Different to the other render functions as it is not used as a delegate and is actually called all the time
i | the menuItem to render |
Definition at line 256 of file menuBottom.cpp.
References menuItems, and spriteManager::screen.
Referenced by gameTick().
void menuBottom::statsRender | ( | u8 | i | ) | [private] |
screen rendering function for statistics menu items.
Handles the extra cursor position.
i | the menuItem to render |
Definition at line 267 of file menuBottom.cpp.
References menuItems, OFFX, OFFY, spriteManager::screen, selectedItem, and selectedItem2.
Referenced by statsMenu().
void menuBottom::pickupsRender | ( | u8 | i | ) | [private] |
screen rendering function for Pickups menu items.
Handles the extra spriteObject's for the Pickup circles.
i | the menuItem to render |
Definition at line 283 of file menuBottom.cpp.
References cursor, menuColSize, menuItems, OFFX, OFFY, pickupSelected(), selectedItem, and spriteObject::setFrame().
Referenced by pickupMenu().
Here is the call graph for this function:
void menuBottom::charRender | ( | u8 | i | ) | [private] |
screen rendering function for character menu items.
i | the menuItem to render |
Definition at line 304 of file menuBottom.cpp.
References menuItems, player1id, and player2id.
Referenced by characterMenu().
void menuBottom::charNameRender | ( | u8 | i | ) | [private] |
screen rendering function for character renaming menu, used to set the cursor frame.
i | the menuItem to render |
Definition at line 324 of file menuBottom.cpp.
References cursor, spriteObject::getFrame(), and spriteObject::setFrame().
Referenced by playerRenameMenu().
Here is the call graph for this function:
void menuBottom::mainAction | ( | bool | stylusTouched = false , |
|
bool | stylusActivated = false | |||
) | [private] |
Actions for the main menu.
Start a new game, or redirect us to another menu.
stylusTouched | true if any menuItem was tapped | |
stylusActivated | true if the currently selected menuItem was tapped |
Definition at line 335 of file menuBottom.cpp.
References _NUMPICKUPS, spriteManager::activate(), gameManager::activate(), characterMenu(), controlsMenu(), creditsMenu(), deactivate(), spriteManager::deactivate(), gameBottom, gameTop, loadPlayerGFX(), menuOk, menuTop, miscMenu(), gameManager::pickupMask, pickupMenu(), pickupSelected(), player1id, player2id, spriteManager::playSound(), gameManager::pointsToWin, roundNum, roundsMenu(), selectedItem, and statsMenu().
Referenced by mainMenu().
Here is the call graph for this function:
void menuBottom::charAction | ( | bool | stylusTouched = false , |
|
bool | stylusActivated = false | |||
) | [private] |
Actions for the character selection menu.
Save settings, edit names and modify colours/graphics.
stylusTouched | true if any menuItem was tapped | |
stylusActivated | true if the currently selected menuItem was tapped |
Definition at line 402 of file menuBottom.cpp.
References editingName, loadSRAM(), mainMenu(), menuCancel, menuMove, menuOk, playerColorCycle(), playerGFXCycle(), playerRenameMenu(), spriteManager::playSound(), saveSRAM(), and selectedItem.
Referenced by characterMenu().
Here is the call graph for this function:
void menuBottom::pickupsAction | ( | bool | stylusTouched = false , |
|
bool | stylusActivated = false | |||
) | [private] |
Actions for the Pickups menu.
Toggle active Pickups and save settings.
stylusTouched | true if any menuItem was tapped | |
stylusActivated | true if the currently selected menuItem was tapped |
Definition at line 439 of file menuBottom.cpp.
References loadSRAM(), mainMenu(), menuCancel, menuMove, menuOk, pickupToggle(), spriteManager::playSound(), saveSRAM(), and selectedItem.
Referenced by pickupMenu().
Here is the call graph for this function:
void menuBottom::roundsAction | ( | bool | stylusTouched = false , |
|
bool | stylusActivated = false | |||
) | [private] |
Actions for the rounds menu.
Handles settings saving.
stylusTouched | true if any menuItem was tapped | |
stylusActivated | true if the currently selected menuItem was tapped |
Definition at line 465 of file menuBottom.cpp.
References loadSRAM(), mainMenu(), menuCancel, menuOk, spriteManager::playSound(), and saveSRAM().
Referenced by roundsMenu().
Here is the call graph for this function:
void menuBottom::sramAction | ( | bool | stylusTouched = false , |
|
bool | stylusActivated = false | |||
) | [private] |
Actions for the SRAM warning menu.
Allows the user to decide whether to format the SRAM.
stylusTouched | true if any menuItem was tapped | |
stylusActivated | true if the currently selected menuItem was tapped |
Definition at line 486 of file menuBottom.cpp.
References mainMenu(), menuCancel, menuOk, spriteManager::playSound(), and saveSRAM().
Referenced by saveWarningMenu().
Here is the call graph for this function:
void menuBottom::controlsAction | ( | bool | stylusTouched = false , |
|
bool | stylusActivated = false | |||
) | [private] |
Actions for the controls menu.
Resets the background on close.
stylusTouched | true if any menuItem was tapped | |
stylusActivated | true if the currently selected menuItem was tapped |
Definition at line 506 of file menuBottom.cpp.
References mainMenu(), menuCancel, spriteManager::playSound(), spriteManager::resetBackground(), and spriteManager::resetText().
Referenced by controlsMenu().
Here is the call graph for this function:
void menuBottom::charNameAction | ( | bool | stylusTouched = false , |
|
bool | stylusActivated = false | |||
) | [private] |
Actions for the character names menu.
Erase character statistics and save settings.
stylusTouched | true if any menuItem was tapped | |
stylusActivated | true if the currently selected menuItem was tapped |
Definition at line 523 of file menuBottom.cpp.
References characterMenu(), editingName, erasePlayer(), loadSRAM(), menuCancel, menuOk, and spriteManager::playSound().
Referenced by playerRenameMenu().
Here is the call graph for this function:
void menuBottom::creditsAction | ( | bool | stylusTouched = false , |
|
bool | stylusActivated = false | |||
) | [private] |
Actions for the credits menu.
Simply redirects us back to the main menu.
stylusTouched | true if any menuItem was tapped | |
stylusActivated | true if the currently selected menuItem was tapped |
Definition at line 545 of file menuBottom.cpp.
References mainMenu(), menuCancel, and spriteManager::playSound().
Referenced by creditsMenu().
Here is the call graph for this function:
void menuBottom::miscAction | ( | bool | stylusTouched = false , |
|
bool | stylusActivated = false | |||
) | [private] |
Actions for the misc settings menu.
Modify settings and handle saving.
stylusTouched | true if any menuItem was tapped | |
stylusActivated | true if the currently selected menuItem was tapped |
Definition at line 560 of file menuBottom.cpp.
References dieWhileDancing, loadSRAM(), mainMenu(), MAXPICKUPSONSCREEN, menuCancel, menuItems, menuMove, menuOk, numPickups, spriteManager::playSound(), saveSRAM(), selectedItem, and showPickups.
Referenced by miscMenu().
Here is the call graph for this function:
void menuBottom::statsAction | ( | bool | stylusTouched = false , |
|
bool | stylusActivated = false | |||
) | [private] |
Actions for the statistics menu.
Simply returns us to the main menu.
stylusTouched | true if any menuItem was tapped | |
stylusActivated | true if the currently selected menuItem was tapped |
Definition at line 613 of file menuBottom.cpp.
References mainMenu(), menuCancel, and spriteManager::playSound().
Referenced by statsMenu().
Here is the call graph for this function:
void menuBottom::clearMenus | ( | ) | [private] |
Clear the menu screen entirely so that a new menu can replace the current one.
I've put a bunch of waits in here. The thing seems to crash without them. Dunno why.
Definition at line 674 of file menuBottom.cpp.
References actionFunction, clearOutSprites(), cursorSprite, loadBackground(), loadCursorSpriteSet(), loadMenuSpriteSet(), makeCursor(), menuItems, menuSprite, navFunction, normalNav(), renderFunction, spriteManager::resetText(), selectedItem, and selectedItem2.
Referenced by characterMenu(), controlsMenu(), creditsMenu(), mainMenu(), miscMenu(), pickupMenu(), playerRenameMenu(), roundsMenu(), saveWarningMenu(), and statsMenu().
Here is the call graph for this function:
void menuBottom::makeCursor | ( | ) | [private] |
Create a cursor sprite for the currently active menu.
Definition at line 698 of file menuBottom.cpp.
References cursor, cursorSprite, spriteObject::giveSprite(), spriteObject::setFrame(), spriteObject::setLayer(), and spriteObject::setPallete().
Referenced by clearMenus().
Here is the call graph for this function:
void menuBottom::autoMenuClickRegions | ( | ) | [private] |
fill all menuItem stylus hitboxes out based on text position and length
Definition at line 1098 of file menuBottom.cpp.
References menuItems.
Referenced by characterMenu(), mainMenu(), pickupMenu(), and statsMenu().
s8 menuBottom::touchingWhichItem | ( | u16 | x, | |
u16 | y | |||
) | [private] |
Find out which menuItem is touched at the coordinates given.
x | the x position of the coordinate to check (in pixels) | |
y | the y position of the coordinate to check (in pixels) |
Definition at line 1116 of file menuBottom.cpp.
References menuItems.
Referenced by gameTick().
void menuBottom::mainMenu | ( | u8 | prevScreen = 0 |
) | [private] |
load the main menu onto the screen.
ID 0.
prevScreen | the previously chosen menu item, which will start in focus |
Definition at line 714 of file menuBottom.cpp.
References actionFunction, autoMenuClickRegions(), clearMenus(), mainAction(), makeInstructions(), menuColSize, menuItems, and selectedItem.
Referenced by activate(), charAction(), controlsAction(), creditsAction(), miscAction(), pickupsAction(), roundsAction(), saveSRAM(), sramAction(), and statsAction().
Here is the call graph for this function:
void menuBottom::characterMenu | ( | ) | [private] |
load the character selection menu onto the screen. ID 1.
Definition at line 744 of file menuBottom.cpp.
References actionFunction, autoMenuClickRegions(), charAction(), charNav(), charRender(), clearMenus(), macros::getPlayerName(), getPlayerPalleteID(), getPlayerSpriteData(), spriteObject::giveSprite(), spriteManager::loadPallete(), makeInstructions(), menuColSize, menuItems, navFunction, playerNames, playerPal1, playerPal2, playerPal3, playerPal4, playerPallete1, playerPallete2, playerPallete3, playerPallete4, playerPals, playerSprs, renderFunction, spriteManager::screen, and spriteObject::setPallete().
Referenced by charNameAction(), and mainAction().
Here is the call graph for this function:
void menuBottom::pickupMenu | ( | ) | [private] |
load the Pickups selection menu onto the screen. ID 2.
Definition at line 805 of file menuBottom.cpp.
References actionFunction, autoMenuClickRegions(), clearMenus(), loadPickupSpriteSet(), makeInstructions(), makePickupIcon(), menuColSize, pickupsAction(), pickupSprite, pickupsRender(), and renderFunction.
Referenced by mainAction().
Here is the call graph for this function:
void menuBottom::roundsMenu | ( | ) | [private] |
load the round number selection menu onto the screen. ID 3.
Definition at line 899 of file menuBottom.cpp.
References actionFunction, clearMenus(), cursor, spriteObject::destroy(), makeInstructions(), menuColSize, navFunction, roundsAction(), roundsNav(), and spriteManager::screen.
Referenced by mainAction().
Here is the call graph for this function:
void menuBottom::saveWarningMenu | ( | ) | [private] |
load the SRAM format warning onto the screen. ID 4.
Definition at line 917 of file menuBottom.cpp.
References actionFunction, clearMenus(), cursor, spriteObject::destroy(), makeInstructions(), menuColSize, spriteManager::screen, and sramAction().
Referenced by saveSRAM().
Here is the call graph for this function:
void menuBottom::controlsMenu | ( | ) | [private] |
load the controls page onto the screen. ID 5.
Definition at line 932 of file menuBottom.cpp.
References actionFunction, clearMenus(), controlsAction(), cursor, spriteObject::destroy(), makeInstructions(), menuColSize, spriteManager::resetBackground(), and spriteManager::screen.
Referenced by mainAction().
Here is the call graph for this function:
void menuBottom::playerRenameMenu | ( | u8 | playerID | ) | [private] |
load the rename character menu onto the screen.
ID 6.
playerID | ID of the character whose name will be edited |
Definition at line 970 of file menuBottom.cpp.
References actionFunction, charNameAction(), charNameNav(), charNameRender(), clearMenus(), makeInstructions(), menuColSize, menuItems, navFunction, renderFunction, and spriteManager::screen.
Referenced by charAction().
Here is the call graph for this function:
void menuBottom::creditsMenu | ( | ) | [private] |
load the credits page onto the screen. ID 7.
Definition at line 950 of file menuBottom.cpp.
References actionFunction, clearMenus(), creditsAction(), cursor, spriteObject::destroy(), makeInstructions(), menuColSize, and spriteManager::screen.
Referenced by mainAction().
Here is the call graph for this function:
void menuBottom::miscMenu | ( | ) | [private] |
load the miscellaneous settings menu onto the screen. ID 8.
Definition at line 1003 of file menuBottom.cpp.
References actionFunction, clearMenus(), dieWhileDancing, makeInstructions(), menuColSize, menuItems, miscAction(), miscNav(), navFunction, numPickups, and showPickups.
Referenced by mainAction().
Here is the call graph for this function:
void menuBottom::statsMenu | ( | ) | [private] |
load the statistics viewing menu onto the screen. ID 9.
Definition at line 1031 of file menuBottom.cpp.
References actionFunction, autoMenuClickRegions(), clearMenus(), cursorSprite, drawStatsFor(), makeInstructions(), menuColSize, menuItems, navFunction, renderFunction, settingsPlayer, statsAction(), statsNav(), and statsRender().
Referenced by mainAction().
Here is the call graph for this function:
void menuBottom::alterPlayerName | ( | u8 | playerID, | |
u8 | letterID, | |||
s8 | modBy | |||
) | [private] |
Modify a specific char in a character's name by the desired amount.
The char will have moved that many places in the ASCII table.
playerID | 1-indexed id of the character name to change | |
letterID | letter in that character's name to modify | |
modBy | number of places to change the char by |
Definition at line 1319 of file menuBottom.cpp.
References playerNames, and spriteManager::screen.
Referenced by charNameNav().
bool menuBottom::isSRAMSaved | ( | ) | [private] |
Checks whether or not the DS's SRAM has been formatted for MDuel DS, as some flashcarts actually share SRAM between programs (!).
Definition at line 1139 of file menuBottom.cpp.
References _SRAMID, and _SRAMIDOFFSET.
Referenced by loadSRAM(), saveSRAM(), and saveStats().
void menuBottom::drawStatsFor | ( | u8 | player, | |
u8 | page | |||
) | [private] |
This function draws a state page for the character/page combo.
Called every tick when on stats page, so it checks that player & page are different than the tick before before doing anything.
player | 1-indexed id of the character's stats to be retrieved. if -1, the stats for the game as a whole are retrieved. | |
page | the page we are drawing. Page 0 is a global statistics page, page 1 is weapon time, page 2 is kills and page 3 is deaths. |
Definition at line 1773 of file menuBottom.cpp.
References getDeathsForPlayer(), getKillsForPlayer(), getLosses(), macros::getPlayerName(), getTies(), getTimeForPlayer(), getWins(), playerNames, spriteManager::resetText(), spriteManager::screen, settingsPage, and settingsPlayer.
Referenced by statsMenu(), and statsNav().
Here is the call graph for this function:
void menuBottom::writeStatValueAt | ( | u16 | offset, | |
u16 | value | |||
) | [private] |
A utility function to write a statistic at a specific offset in memory.
offset | the memory location (from the beginning of the statistics block) to write to | |
value | the 16-bit value to write at that location |
Definition at line 1490 of file menuBottom.cpp.
References saveStats(), and statistics.
Referenced by scoreDeath(), scoreKill(), scoreRound(), and scoreTime().
Here is the call graph for this function:
u16 menuBottom::readStatValueAt | ( | u16 | offset | ) | const [private] |
A utility function to read a statistic from a specific offset in memory.
offset | the memory location (form the beginning of the statistics block) to read from |
Definition at line 1507 of file menuBottom.cpp.
References statistics.
Referenced by getDeathsForPlayer(), getKillsForPlayer(), getLosses(), getTies(), getTimeForPlayer(), getWins(), scoreDeath(), scoreKill(), scoreRound(), and scoreTime().
void menuBottom::erasePlayer | ( | u8 | player | ) | [private] |
Completely clear out all statistical data for a character.
player | 1-indexed id of the character whose data should be erased |
Definition at line 1610 of file menuBottom.cpp.
References GLOBALSLOTSIZE, PLAYERSLOTSIZE, statistics, and WEAPONBLOCKSIZE.
Referenced by charNameAction().
u16 menuBottom::getKillsForPlayer | ( | s8 | player, | |
s8 | weaponID | |||
) | const [private] |
Retrieve the number of kills a character has made with a specific weapon.
player | 1-indexed id of the character to retrieve data for If -1, the number of kills in total (for all character) is retrieved. | |
weaponID | the id of the weapon to check data for. 18 denotes drownings. If -1, the number of kills with all weapons is retrieved. |
Definition at line 1629 of file menuBottom.cpp.
References GLOBALSLOTSIZE, PLAYERSLOTSIZE, readStatValueAt(), and WEAPONBLOCKSIZE.
Referenced by drawStatsFor().
Here is the call graph for this function:
u16 menuBottom::getDeathsForPlayer | ( | s8 | player, | |
s8 | weaponID | |||
) | const [private] |
Retrieve the number of deaths a character has with a specific weapon.
player | 1-indexed id of the character to retrieve data for If -1, the number of deaths in total (for all character) is retrieved. | |
weaponID | the id of the weapon to check data for. 18 denotes drownings. If -1, the number of deaths with all weapons is retrieved. |
Definition at line 1658 of file menuBottom.cpp.
References GLOBALSLOTSIZE, PLAYERSLOTSIZE, readStatValueAt(), and WEAPONBLOCKSIZE.
Referenced by drawStatsFor().
Here is the call graph for this function:
u16 menuBottom::getTimeForPlayer | ( | s8 | player, | |
s8 | weaponID | |||
) | const [private] |
Retrieve the time (in seconds) a character has spent with a specific weapon.
player | 1-indexed id of the character to retrieve data for If -1, the playtime in total (for all character) is retrieved. | |
weaponID | the id of the weapon to check data for. 18 denotes drownings. If -1, the total playtime for this player is retrieved. |
Definition at line 1687 of file menuBottom.cpp.
References GLOBALSLOTSIZE, PLAYERSLOTSIZE, readStatValueAt(), and WEAPONBLOCKSIZE.
Referenced by drawStatsFor().
Here is the call graph for this function:
u16 menuBottom::getWins | ( | s8 | player | ) | const [private] |
Retrieve the number of round wins a character has had.
player | 1-indexed id of the character to retrieve data for If -1, the number of rounds played in total (for all character) is retrieved. |
Definition at line 1714 of file menuBottom.cpp.
References GLOBALSLOTSIZE, PLAYERSLOTSIZE, readStatValueAt(), and WEAPONBLOCKSIZE.
Referenced by drawStatsFor().
Here is the call graph for this function:
u16 menuBottom::getLosses | ( | s8 | player | ) | const [private] |
Retrieve the number of round losses a character has had.
player | 1-indexed id of the character to retrieve data for If -1, 0 is returned as there is no global loss counter (its redundant!) |
Definition at line 1732 of file menuBottom.cpp.
References GLOBALSLOTSIZE, PLAYERSLOTSIZE, readStatValueAt(), and WEAPONBLOCKSIZE.
Referenced by drawStatsFor().
Here is the call graph for this function:
u16 menuBottom::getTies | ( | s8 | player | ) | const [private] |
Retrieve the number of round ties a character has had.
player | 1-indexed id of the character to retrieve data for If -1, 0 is returned as there is no global tie counter (its redundant!) |
Definition at line 1750 of file menuBottom.cpp.
References GLOBALSLOTSIZE, PLAYERSLOTSIZE, readStatValueAt(), and WEAPONBLOCKSIZE.
Referenced by drawStatsFor().
Here is the call graph for this function:
void menuBottom::loadSRAM | ( | bool | firstLoad = false |
) | [private] |
Load all saveable variables from the DS's SRAM, or from memory if SRAM has not been formatted.
firstLoad | whether or not the SRAM is being loaded for the very first time. if true and SRAM has not been saved before, load default values into memory. |
Definition at line 1156 of file menuBottom.cpp.
References _NAMESOFFSET, _NUMSAVESLOTS, _PICKUPOFFSET, _PLAYER1IDOFFSET, _PLAYER2IDOFFSET, _PLAYERPALSOFFSET, _PLAYERSPRSOFFSET, _ROUNDSOFFSET, _SETTINGSOFFSET, _STATSLEN, _STATSOFFSET, dieWhileDancing, gameTop, isSRAMSaved(), numPickups, pickupMask, player1id, player2id, playerNames, playerPals, playerSprs, gameManager::pointsToWin, roundNum, showPickups, sramLoadDefaults(), sramLoadPrevVars(), sramSavePrevVars(), and statistics.
Referenced by activate(), charAction(), charNameAction(), miscAction(), pickupsAction(), and roundsAction().
Here is the call graph for this function:
void menuBottom::saveSRAM | ( | bool | dontCheck = false , |
|
u8 | menuNumber = 0 | |||
) | [private] |
Save all persistant variables into the DS's SRAM for retrieval later.
dontCheck | if true, the SRAM will be formatted and overwritten even if not already formatted | |
menuNumber | the menu to hilight in the main menu after saving. Works as in menuBottom::mainMenu() |
Definition at line 1198 of file menuBottom.cpp.
References _NAMESOFFSET, _NUMSAVESLOTS, _PICKUPOFFSET, _PLAYER1IDOFFSET, _PLAYER2IDOFFSET, _PLAYERPALSOFFSET, _PLAYERSPRSOFFSET, _ROUNDSOFFSET, _SETTINGSOFFSET, _SRAMID, _SRAMIDOFFSET, _STATSLEN, _STATSOFFSET, dieWhileDancing, isSRAMSaved(), mainMenu(), numPickups, pickupMask, player1id, player2id, playerNames, playerPals, playerSprs, roundNum, saveWarningMenu(), showPickups, sramSavePrevVars(), and statistics.
Referenced by charAction(), miscAction(), pickupsAction(), roundsAction(), and sramAction().
Here is the call graph for this function:
void menuBottom::sramSavePrevVars | ( | ) | [private] |
Save data by setting backup variables in memory.
This is intended to be used as a faux storage engine for when SRAM is disabled.
Definition at line 1228 of file menuBottom.cpp.
References _NUMSAVESLOTS, dieWhileDancing, numPickups, pickupMask, player1id, player2id, playerNames, playerPals, playerSprs, prevDieWhileDancing, prevNumPickups, prevPickupMask, prevPlayer1id, prevPlayer2id, prevPlayerNames, prevPlayerPals, prevPlayerSprs, prevRoundNum, prevShowPickups, roundNum, and showPickups.
Referenced by loadSRAM(), and saveSRAM().
void menuBottom::sramLoadPrevVars | ( | ) | [private] |
Load persistent variables from backups.
This is intended to be used as a faux storage engine for when SRAM is disabled and a user opts to cancel their changes in a particular menu.
Definition at line 1249 of file menuBottom.cpp.
References _NUMSAVESLOTS, dieWhileDancing, gameTop, numPickups, pickupMask, player1id, player2id, playerNames, playerPals, playerSprs, gameManager::pointsToWin, prevDieWhileDancing, prevNumPickups, prevPickupMask, prevPlayer1id, prevPlayer2id, prevPlayerNames, prevPlayerPals, prevPlayerSprs, prevRoundNum, prevShowPickups, roundNum, and showPickups.
Referenced by loadSRAM().
void menuBottom::sramLoadDefaults | ( | ) | [private] |
Set default values for persistent variables when the game is loaded for the first time.
Definition at line 1270 of file menuBottom.cpp.
References _ALLPICKUPS, _STATSLEN, dieWhileDancing, gameTop, numPickups, pickupMask, player1id, player2id, playerNames, playerPals, playerSprs, gameManager::pointsToWin, roundNum, showPickups, and statistics.
Referenced by loadSRAM().
bool menuBottom::pickupSelected | ( | u8 | pickupID | ) | [private] |
check if a Pickup ID is currently enabled
pickupID | the Pickup number to check for. Relates to Pickup::pickupType. |
Definition at line 892 of file menuBottom.cpp.
References pickupMask.
Referenced by mainAction(), pickupsRender(), and pickupToggle().
void menuBottom::makePickupIcon | ( | string | text, | |
u8 | num, | |||
u16 | curx, | |||
u16 | cury | |||
) | [private] |
Generate a menu item that comprises a Pickup icon on the Pickup selection screen.
text | the text for this menu item to show | |
num | the frame number of the Pickup icon | |
curx | the x position (in pixels) to spawn the icon at | |
cury | the y position (in pixels) to spawn the icon at |
Definition at line 847 of file menuBottom.cpp.
References spriteObject::ANIMSPEED, spriteObject::giveSprite(), menuItems, pickupSprite, spriteObject::setAnim(), spriteObject::setFrame(), and spriteObject::setPallete().
Referenced by pickupMenu().
Here is the call graph for this function:
void menuBottom::makeInstructions | ( | u8 | frame, | |
u8 | xpos | |||
) | [private] |
Create an instruction sprite and place it at the bottom of the screen.
frame | the frame the icon should show | |
xpos | the x position (in pixels) to show the instruction at |
Definition at line 875 of file menuBottom.cpp.
References spriteObject::giveSprite(), spriteObject::makeStatic(), menuSprite, spriteObject::setFrame(), spriteObject::setLayer(), and spriteObject::setPallete().
Referenced by characterMenu(), controlsMenu(), creditsMenu(), mainMenu(), miscMenu(), pickupMenu(), playerRenameMenu(), roundsMenu(), saveWarningMenu(), and statsMenu().
Here is the call graph for this function:
const unsigned char * menuBottom::getPlayerSpriteData | ( | u8 | idNum | ) | [private] |
Retrieve the sprite data for a character GFX id.
idNum | id of the GFX to retrieve |
Definition at line 1435 of file menuBottom.cpp.
References playerSprite1, playerSprite2, and playerSprite3.
Referenced by characterMenu(), loadPlayerGFX(), and updatePlayerIcon().
const unsigned short * menuBottom::getPlayerPalleteData | ( | u8 | idNum | ) | [private] |
Retrieve the pallete data for a character pallete id.
idNum | id of the pallete to retrieve |
Definition at line 1451 of file menuBottom.cpp.
References playerPallete1, playerPallete2, playerPallete3, and playerPallete4.
Referenced by loadPlayerGFX().
u8 menuBottom::getPlayerPalleteID | ( | u8 | idNum | ) | [private] |
Retrieve the preloaded pallete index for a character pallete id.
idNum | id of the pallete to retrieve |
Definition at line 1468 of file menuBottom.cpp.
References playerPal1, playerPal2, playerPal3, and playerPal4.
Referenced by characterMenu(), and updatePlayerIcon().
void menuBottom::updatePlayerIcon | ( | u8 | i | ) | [private] |
Destroy and recreate a character sprite, as a visual property of it has been updated.
i | 1-indexed id of the character sprite to modify |
Definition at line 1379 of file menuBottom.cpp.
References getPlayerPalleteID(), getPlayerSpriteData(), menuItems, playerPals, playerSprs, and selectedItem.
Referenced by playerColorCycle(), and playerGFXCycle().
Here is the call graph for this function:
void menuBottom::loadPlayerGFX | ( | u8 | dataNum, | |
u8 | playerNum | |||
) | [private] |
Make the gameManager load the graphics for a Player from the character they have selected.
Call this just before a match is started.
dataNum | character save slot to get pallete and GFX from | |
playerNum | which Player to load the character graphics for (player 1 or player 2) |
Definition at line 1418 of file menuBottom.cpp.
References gameTop, getPlayerPalleteData(), getPlayerSpriteData(), gameManager::loadPlayer1SpriteSet(), gameManager::loadPlayer2SpriteSet(), playerPals, and playerSprs.
Referenced by mainAction().
Here is the call graph for this function:
void menuBottom::pickupToggle | ( | u8 | i | ) | [private] |
Modify menuBottom::pickupMask by toggling a desired Pickup.
The function toggles the nth bit in the mask.
i | the Pickup number to toggle. Relates to Pickup::pickupType. |
Definition at line 1301 of file menuBottom.cpp.
References pickupMask, and pickupSelected().
Referenced by pickupsAction().
Here is the call graph for this function:
void menuBottom::selectPlayer | ( | u8 | i, | |
u8 | playerNum | |||
) | [private] |
Pick a character for use by a player.
i | id of the character to select | |
playerNum | which player has selected this character (player 1 or player 2) |
Definition at line 1398 of file menuBottom.cpp.
References player1id, and player2id.
Referenced by charNav().
void menuBottom::playerColorCycle | ( | u8 | i | ) | [private] |
Change the colour of a character sprite by using a different pallete.
i | 1-indexed id of the player to modify palletes for |
Definition at line 1353 of file menuBottom.cpp.
References playerPals, and updatePlayerIcon().
Referenced by charAction(), and charNav().
Here is the call graph for this function:
void menuBottom::playerGFXCycle | ( | u8 | i | ) | [private] |
Change the sprite of a character by using a different GFX.
i | 1-indexed id of the player to modify appearance of |
Definition at line 1366 of file menuBottom.cpp.
References playerSprs, and updatePlayerIcon().
Referenced by charAction().
Here is the call graph for this function:
spriteManager which handles the top screen during frontend
Definition at line 81 of file menuBottom.h.
Referenced by main(), and mainAction().
spriteManager which handles the bottom screen during gameplay
Definition at line 83 of file menuBottom.h.
Referenced by main(), and mainAction().
spriteManager which handles the top screen during gameplay
Definition at line 85 of file menuBottom.h.
Referenced by loadPlayerGFX(), loadSRAM(), main(), mainAction(), roundsNav(), sramLoadDefaults(), and sramLoadPrevVars().
Definition at line 92 of file menuBottom.h.
Referenced by charNav(), charRender(), menuGBottom::gameTick(), gameManager::gameTick(), menuGBottom::loadBackground(), loadSRAM(), mainAction(), gameManager::playerDied(), saveSRAM(), selectPlayer(), sramLoadDefaults(), sramLoadPrevVars(), sramSavePrevVars(), and Player::weaponChange().
Definition at line 92 of file menuBottom.h.
Referenced by charNav(), charRender(), menuGBottom::gameTick(), gameManager::gameTick(), menuGBottom::loadBackground(), loadSRAM(), mainAction(), gameManager::playerDied(), saveSRAM(), selectPlayer(), sramLoadDefaults(), sramLoadPrevVars(), sramSavePrevVars(), and Player::weaponChange().
const unsigned short* menuBottom::playerPallete1 |
Definition at line 94 of file menuBottom.h.
Referenced by characterMenu(), getPlayerPalleteData(), and main().
const unsigned short * menuBottom::playerPallete2 |
Definition at line 94 of file menuBottom.h.
Referenced by characterMenu(), getPlayerPalleteData(), and main().
const unsigned short * menuBottom::playerPallete3 |
Definition at line 94 of file menuBottom.h.
Referenced by characterMenu(), getPlayerPalleteData(), and main().
const unsigned short * menuBottom::playerPallete4 |
Definition at line 94 of file menuBottom.h.
Referenced by characterMenu(), getPlayerPalleteData(), and main().
const unsigned char* menuBottom::playerSprite1 |
const unsigned char * menuBottom::playerSprite2 |
const unsigned char * menuBottom::playerSprite3 |
string menuBottom::playerNames |
a string of all the character names. Each name is 8 characters, * 6 names = 48 length.
Definition at line 98 of file menuBottom.h.
Referenced by alterPlayerName(), characterMenu(), charNameNav(), drawStatsFor(), menuGBottom::gameTick(), menuGBottom::loadBackground(), loadSRAM(), saveSRAM(), sramLoadDefaults(), sramLoadPrevVars(), and sramSavePrevVars().
number of pickups that can be active at a time, used by menuGBottom
Definition at line 100 of file menuBottom.h.
Referenced by menuGBottom::gameTick(), loadSRAM(), miscAction(), miscMenu(), gameManager::preloadGFX(), menuGBottom::resetIdleTime(), saveSRAM(), sramLoadDefaults(), sramLoadPrevVars(), and sramSavePrevVars().
Definition at line 101 of file menuBottom.h.
Referenced by loadSRAM(), miscAction(), miscMenu(), Player::playVictory(), saveSRAM(), sramLoadDefaults(), sramLoadPrevVars(), and sramSavePrevVars().
Definition at line 101 of file menuBottom.h.
Referenced by menuGBottom::loadBackground(), loadSRAM(), miscAction(), miscMenu(), saveSRAM(), menuGBottom::spawnPickup(), sramLoadDefaults(), sramLoadPrevVars(), and sramSavePrevVars().
soundData menuBottom::menuMove |
Definition at line 111 of file menuBottom.h.
Referenced by charAction(), charNameNav(), charNav(), gameTick(), main(), miscAction(), pickupsAction(), roundsNav(), and statsNav().
soundData menuBottom::menuOk |
Definition at line 111 of file menuBottom.h.
Referenced by charAction(), charNameAction(), main(), mainAction(), miscAction(), pickupsAction(), roundsAction(), and sramAction().
soundData menuBottom::menuCancel |
Definition at line 111 of file menuBottom.h.
Referenced by charAction(), charNameAction(), controlsAction(), creditsAction(), main(), miscAction(), pickupsAction(), roundsAction(), sramAction(), and statsAction().
void(menuBottom::* menuBottom::navFunction)() [private] |
the screen navigation function that will be currently executed every tick
Referenced by characterMenu(), clearMenus(), gameTick(), miscMenu(), playerRenameMenu(), roundsMenu(), and statsMenu().
void(menuBottom::* menuBottom::renderFunction)(u8) [private] |
the menu item display changing function that manipulates each menuItem in the current menu.
Referenced by characterMenu(), clearMenus(), gameTick(), pickupMenu(), playerRenameMenu(), and statsMenu().
void(menuBottom::* menuBottom::actionFunction)(bool, bool) [private] |
the action function that will be currently executed every tick
Referenced by characterMenu(), clearMenus(), controlsMenu(), creditsMenu(), gameTick(), mainMenu(), miscMenu(), pickupMenu(), playerRenameMenu(), roundsMenu(), saveWarningMenu(), and statsMenu().
u8 menuBottom::playerPal1 [private] |
Definition at line 144 of file menuBottom.h.
Referenced by characterMenu(), and getPlayerPalleteID().
u8 menuBottom::playerPal2 [private] |
Definition at line 144 of file menuBottom.h.
Referenced by characterMenu(), and getPlayerPalleteID().
u8 menuBottom::playerPal3 [private] |
Definition at line 144 of file menuBottom.h.
Referenced by characterMenu(), and getPlayerPalleteID().
u8 menuBottom::playerPal4 [private] |
Definition at line 144 of file menuBottom.h.
Referenced by characterMenu(), and getPlayerPalleteID().
spriteSet menuBottom::cursorSprite [private] |
Definition at line 146 of file menuBottom.h.
Referenced by clearMenus(), clearOutSprites(), loadCursorSpriteSet(), makeCursor(), and statsMenu().
spriteSet menuBottom::pickupSprite [private] |
Definition at line 146 of file menuBottom.h.
Referenced by clearOutSprites(), loadPickupSpriteSet(), makePickupIcon(), and pickupMenu().
spriteSet menuBottom::menuSprite [private] |
Definition at line 146 of file menuBottom.h.
Referenced by clearMenus(), clearOutSprites(), loadMenuSpriteSet(), and makeInstructions().
u8 menuBottom::editingName [private] |
id of the character name being edited, for the character selection screen
Definition at line 175 of file menuBottom.h.
Referenced by charAction(), charNameAction(), and charNameNav().
s8 menuBottom::selectedItem [private] |
index of the selected menu item
Definition at line 196 of file menuBottom.h.
Referenced by charAction(), charNameNav(), charNav(), clearMenus(), gameTick(), mainAction(), mainMenu(), miscAction(), miscNav(), normalNav(), pickupsAction(), pickupsRender(), statsNav(), statsRender(), and updatePlayerIcon().
u8 menuBottom::menuColSize [private] |
size of menu columns (if present)
Definition at line 198 of file menuBottom.h.
Referenced by characterMenu(), charNav(), controlsMenu(), creditsMenu(), gameTick(), mainMenu(), miscMenu(), miscNav(), normalNav(), pickupMenu(), pickupsRender(), playerRenameMenu(), roundsMenu(), saveWarningMenu(), and statsMenu().
vector<menuItem> menuBottom::menuItems [private] |
all the active menuItems for a menu
Definition at line 200 of file menuBottom.h.
Referenced by autoMenuClickRegions(), characterMenu(), charNameNav(), charNav(), charRender(), clearMenus(), gameTick(), mainMenu(), makePickupIcon(), miscAction(), miscMenu(), miscNav(), normalNav(), normalRender(), pickupsRender(), playerRenameMenu(), statsMenu(), statsRender(), touchingWhichItem(), and updatePlayerIcon().
spriteObject* menuBottom::cursor [private] |
the cursor sprite that shows us what we have selected
Definition at line 202 of file menuBottom.h.
Referenced by charNameRender(), controlsMenu(), creditsMenu(), gameTick(), makeCursor(), pickupsRender(), roundsMenu(), and saveWarningMenu().
s8 menuBottom::selectedItem2 [private] |
Rather nasty hack for the settings screen and its two cursors. I could do it properly, but im impatient.
Definition at line 205 of file menuBottom.h.
Referenced by clearMenus(), statsNav(), and statsRender().
u8 menuBottom::settingsPlayer [private] |
u8 menuBottom::settingsPage [private] |
string menuBottom::prevPlayerNames [private] |
Definition at line 210 of file menuBottom.h.
Referenced by sramLoadPrevVars(), and sramSavePrevVars().
u8 menuBottom::roundNum [private] |
Definition at line 211 of file menuBottom.h.
Referenced by loadSRAM(), mainAction(), roundsNav(), saveSRAM(), sramLoadDefaults(), sramLoadPrevVars(), and sramSavePrevVars().
u8 menuBottom::prevRoundNum [private] |
Definition at line 211 of file menuBottom.h.
Referenced by sramLoadPrevVars(), and sramSavePrevVars().
u32 menuBottom::pickupMask [private] |
Definition at line 212 of file menuBottom.h.
Referenced by loadSRAM(), pickupSelected(), pickupToggle(), saveSRAM(), sramLoadDefaults(), sramLoadPrevVars(), and sramSavePrevVars().
u32 menuBottom::prevPickupMask [private] |
Definition at line 212 of file menuBottom.h.
Referenced by sramLoadPrevVars(), and sramSavePrevVars().
u8 menuBottom::prevPlayer1id [private] |
Definition at line 213 of file menuBottom.h.
Referenced by sramLoadPrevVars(), and sramSavePrevVars().
u8 menuBottom::prevPlayer2id [private] |
Definition at line 213 of file menuBottom.h.
Referenced by sramLoadPrevVars(), and sramSavePrevVars().
u8 menuBottom::playerSprs[6] [private] |
Definition at line 214 of file menuBottom.h.
Referenced by characterMenu(), loadPlayerGFX(), loadSRAM(), playerGFXCycle(), saveSRAM(), sramLoadDefaults(), sramLoadPrevVars(), sramSavePrevVars(), and updatePlayerIcon().
u8 menuBottom::prevPlayerSprs[6] [private] |
Definition at line 214 of file menuBottom.h.
Referenced by sramLoadPrevVars(), and sramSavePrevVars().
u8 menuBottom::playerPals[6] [private] |
Definition at line 215 of file menuBottom.h.
Referenced by characterMenu(), charNav(), loadPlayerGFX(), loadSRAM(), playerColorCycle(), saveSRAM(), sramLoadDefaults(), sramLoadPrevVars(), sramSavePrevVars(), and updatePlayerIcon().
u8 menuBottom::prevPlayerPals[6] [private] |
Definition at line 215 of file menuBottom.h.
Referenced by sramLoadPrevVars(), and sramSavePrevVars().
bool menuBottom::prevDieWhileDancing [private] |
Definition at line 216 of file menuBottom.h.
Referenced by sramLoadPrevVars(), and sramSavePrevVars().
bool menuBottom::prevShowPickups [private] |
Definition at line 216 of file menuBottom.h.
Referenced by sramLoadPrevVars(), and sramSavePrevVars().
u8 menuBottom::prevNumPickups [private] |
Definition at line 217 of file menuBottom.h.
Referenced by sramLoadPrevVars(), and sramSavePrevVars().
u8 menuBottom::statistics[798] [private] |
A GIANT array of statistical data in SRAM format.
STORED AS:
for characters - {[KILLS][TIME][DEATHS][wins][losses][ties]}
for global - {[KILLS][TIME][rounds]}
Use the mutator functions to manipulate it in meaningful ways.
Definition at line 242 of file menuBottom.h.
Referenced by erasePlayer(), loadSRAM(), readStatValueAt(), saveSRAM(), saveStats(), sramLoadDefaults(), and writeStatValueAt().
const u8 menuBottom::PLAYERSLOTSIZE = 120 [static, private] |
size of an individual character's slot in the menuBottom::statistics array.
Definition at line 256 of file menuBottom.h.
Referenced by erasePlayer(), getDeathsForPlayer(), getKillsForPlayer(), getLosses(), getTies(), getTimeForPlayer(), getWins(), scoreDeath(), scoreKill(), scoreRound(), and scoreTime().
const u8 menuBottom::GLOBALSLOTSIZE = 78 [static, private] |
size of the global statistics slot in the menuBottom::statistics array.
Definition at line 258 of file menuBottom.h.
Referenced by erasePlayer(), getDeathsForPlayer(), getKillsForPlayer(), getLosses(), getTies(), getTimeForPlayer(), getWins(), scoreDeath(), scoreKill(), scoreRound(), and scoreTime().
const u8 menuBottom::WEAPONBLOCKSIZE = 38 [static, private] |
size of a weapon statistics block in the menuBottom::statistics array.
Definition at line 260 of file menuBottom.h.
Referenced by erasePlayer(), getDeathsForPlayer(), getKillsForPlayer(), getLosses(), getTies(), getTimeForPlayer(), getWins(), scoreDeath(), scoreRound(), and scoreTime().
u8 menuBottom::menuRepeater [private] |
ticks for changing text and round numbers
Definition at line 263 of file menuBottom.h.
Referenced by charNameNav(), gameTick(), and roundsNav().
const u8 menuBottom::_SRAMIDOFFSET = 0 [static, private] |
the SRAM offset to save the format check string (menuBottom::_SRAMID) in
Definition at line 287 of file menuBottom.h.
Referenced by isSRAMSaved(), and saveSRAM().
const u8 menuBottom::_ROUNDSOFFSET = 7 [static, private] |
the SRAM offset to save the number of rounds to play (menuBottom::roundNum) at
Definition at line 289 of file menuBottom.h.
Referenced by loadSRAM(), and saveSRAM().
const u8 menuBottom::_PICKUPOFFSET = 8 [static, private] |
the SRAM offset to save the active Pickups mask (menuBottom::pickupMask) at
Definition at line 291 of file menuBottom.h.
Referenced by loadSRAM(), and saveSRAM().
const u8 menuBottom::_PLAYER1IDOFFSET = 12 [static, private] |
the SRAM offset to save the selected character for Player 1 (menuBottom::player1id) at
Definition at line 293 of file menuBottom.h.
Referenced by loadSRAM(), and saveSRAM().
const u8 menuBottom::_PLAYER2IDOFFSET = 13 [static, private] |
the SRAM offset to save the selected character for Player 2 (menuBottom::player2id) at
Definition at line 295 of file menuBottom.h.
Referenced by loadSRAM(), and saveSRAM().
const u8 menuBottom::_PLAYERSPRSOFFSET = 14 [static, private] |
the SRAM offset to save the character GFX ids (menuBottom::playerSprs) at
Definition at line 297 of file menuBottom.h.
Referenced by loadSRAM(), and saveSRAM().
const u8 menuBottom::_PLAYERPALSOFFSET = 20 [static, private] |
the SRAM offset to save the character pallete ids (menuBottom::playerPals) at
Definition at line 299 of file menuBottom.h.
Referenced by loadSRAM(), and saveSRAM().
const u8 menuBottom::_NAMESOFFSET = 26 [static, private] |
the SRAM offset to save the character names (menuBottom::playerNames) at
Definition at line 301 of file menuBottom.h.
Referenced by loadSRAM(), and saveSRAM().
const u8 menuBottom::_SETTINGSOFFSET = 76 [static, private] |
the SRAM offset to save the game's miscellaneous settings (menuBottom::dieWhileDancing, menuBottom::numPickups and menuBottom::showPickups) at
Definition at line 303 of file menuBottom.h.
Referenced by loadSRAM(), and saveSRAM().
const u8 menuBottom::_STATSOFFSET = 78 [static, private] |
the SRAM offset to save character statistics (menuBottom::statistics) at
Definition at line 305 of file menuBottom.h.
Referenced by loadSRAM(), saveSRAM(), and saveStats().
const u16 menuBottom::_STATSLEN = 798 [static, private] |
the length of menuBottom::statistics, to manage SRAM size
Definition at line 307 of file menuBottom.h.
Referenced by loadSRAM(), saveSRAM(), saveStats(), and sramLoadDefaults().
const char * menuBottom::_SRAMID [static, private] |
the ID to save at the base address in SRAM that tells us if SRAM has been formatted for this game
Definition at line 310 of file menuBottom.h.
Referenced by isSRAMSaved(), and saveSRAM().
const u8 menuBottom::_NUMPICKUPS = 18 [static, private] |
the number of Pickups in the game
Definition at line 312 of file menuBottom.h.
Referenced by mainAction().
const u8 menuBottom::MAXPICKUPSONSCREEN = 10 [static, private] |
the maximum number of Pickups that can be configured. Must be low enough so that we do not run out of sprites.
Definition at line 314 of file menuBottom.h.
Referenced by miscAction().
const u32 menuBottom::_ALLPICKUPS = 262143 [static, private] |
a bit for every Pickup type turned on
Definition at line 316 of file menuBottom.h.
Referenced by sramLoadDefaults().
const u8 menuBottom::_NUMSAVESLOTS = 6 [static, private] |
number of character save slots
Definition at line 318 of file menuBottom.h.
Referenced by loadSRAM(), saveSRAM(), sramLoadPrevVars(), and sramSavePrevVars().
const u8 menuBottom::menuRepeatDelay = 10 [static, private] |
number of frames to wait before changing the selected menu item when a scrolling button is held down
Definition at line 320 of file menuBottom.h.
Referenced by gameTick().