|
SSBM Decomp
|
#include "mndiagram2.h"#include "mndiagram2.static.h"#include "baselib/forward.h"#include <stdbool.h>#include <baselib/gobj.h>#include <baselib/gobjgxlink.h>#include <baselib/gobjobject.h>#include <baselib/gobjplink.h>#include <baselib/gobjproc.h>#include <baselib/gobjuserdata.h>#include <baselib/jobj.h>#include <baselib/memory.h>#include <baselib/sislib.h>#include <melee/gm/gm_1601.h>#include <melee/gm/gmmain_lib.h>#include <melee/lb/lb_00B0.h>#include <melee/lb/lb_00F9.h>#include <melee/lb/lbaudio_ax.h>#include <melee/mn/mndiagram.h>#include <melee/mn/mndiagram3.h>#include <melee/mn/mnmain.h>#include <melee/mn/mnname.h>Data Structures | |
| union | mnDiagram2_SortEntry |
| struct | JObjContainer |
| Container struct with JObj at offset 0x10. More... | |
| struct | Diagram2DetailView |
| User data for detail view GObj (used in mnDiagram2_ClearDetailView). More... | |
| struct | mnDiagram2_AnimCompleteData |
Macros | |
| #define | mnDiagram_GetNameByIndex_s(x) ((int) mnDiagram_GetNameByIndex(x)) |
| #define | mnDiagram_GetFighterByIndex_s(x) ((int) mnDiagram_GetFighterByIndex(x)) |
| #define | mnDiagram_GetFighterByIndex_BBC(x) mnDiagram_GetFighterByIndex_s(x) |
Functions | |
| static u8 | mnDiagram_GetEntityByIndex (u8 is_name_mode, u8 idx) |
| Gets entity index based on mode (name or fighter). | |
| bool | mnDiagram2_IsTimeStat (u8 stat_type) |
| Checks if stat type uses time format (H:MM:SS). | |
| bool | mnDiagram2_IsDistanceStat (u8 stat_type) |
| Checks if stat type is a distance stat (shown in feet). | |
| bool | mnDiagram2_IsPercentageStat (u8 stat_type) |
| Checks if stat type is a percentage stat. | |
| bool | mnDiagram2_IsIconOnlyStat (u8 stat_type) |
| Checks if stat type displays as icon only (no numeric value). | |
| void | mnDiagram2_ClearStatRows (HSD_GObj *gobj) |
| Clears all stat row text objects and icon JObjs. | |
| void | mnDiagram2_UpdateHeader (HSD_GObj *gobj, u8 is_name_mode, u8 entity_idx) |
| Updates the header display with fighter/name icon and text. | |
| static void | mnDiagram2_RefreshStatRows (void) |
| Clears and repopulates stat rows based on current selection. | |
| void | mnDiagram2_HandleInput (HSD_GObj *gobj) |
| Handles input for the VS Records character details page. | |
| int | mnDiagram2_GetStatValue (int is_name_mode, u8 stat_type, u8 entity_idx) |
| Retrieves a stat value for a fighter or name entry. | |
| void | mnDiagram2_CreateStatRow (HSD_GObj *gobj, u8 is_name_mode, u8 stat_type, u8 row_idx, u8 entity_idx) |
| Creates a single stat row entry in the VS Records display. | |
| void | mnDiagram2_PopulateStatRows (HSD_GObj *gobj, u8 scroll_offset, u8 is_name_mode, u8 entity_idx) |
| Populates all 10 visible stat rows in the diagram. | |
| void | mnDiagram2_OnAnimComplete (HSD_GObj *gobj) |
| Animation completion callback - destroys GObj when animation ends. | |
| void | mnDiagram2_UpdateScrollArrows (HSD_GObj *gobj) |
| Updates navigation arrow visibility based on scroll/selection state. | |
| void | mnDiagram2_Think (HSD_GObj *gobj) |
| Per-frame callback that updates scroll arrows or starts exit animation. | |
| void | mnDiagram2_FreeUserData (Diagram2 *data) |
| GObj destructor callback that frees user data. | |
| void | mnDiagram2_InitUserData (void *arg, int unused) |
| Initializes user data fields to default values. | |
| void | mnDiagram2_Create (int arg0) |
| Creates the VS Records diagram GObj and populates initial stat rows. | |
| void | mnDiagram2_Init (void) |
| Entry point for VS Records page 2 - initializes diagram and input handler. | |
| u8 | mnDiagram2_GetRankedFighter (u8 stat_type, u8 rank) |
| Returns the fighter at rank N for a given stat type. | |
| u8 | mnDiagram2_GetRankedName (u8 stat_type, u8 rank) |
| Returns the name entry at rank N for a given stat type. | |
| void | mnDiagram2_GetAggregatedFighterRank (u8 *out, u8 type, u8 idx) |
| Computes aggregated fighter ranking across all saved names for icon stats. | |
| void | mnDiagram2_ClearDetailView (HSD_GObj *gobj) |
| Clears the detail view by freeing text objects and removing JObj. | |
| #define mnDiagram_GetNameByIndex_s | ( | x | ) | ((int) mnDiagram_GetNameByIndex(x)) |
| #define mnDiagram_GetFighterByIndex_s | ( | x | ) | ((int) mnDiagram_GetFighterByIndex(x)) |
| #define mnDiagram_GetFighterByIndex_BBC | ( | x | ) | mnDiagram_GetFighterByIndex_s(x) |
Gets entity index based on mode (name or fighter).
Checks if stat type uses time format (H:MM:SS).
| stat_type | The stat type index (VSRecordsStatType) |
Only VSSTAT_PLAY_TIME (0x0B) uses time display format.
Checks if stat type is a distance stat (shown in feet).
| stat_type | The stat type index (VSRecordsStatType) |
Distance stats: Walk, Run, Fall, Peak Height (0x0E-0x11).
Checks if stat type is a percentage stat.
| stat_type | The stat type index (VSRecordsStatType) |
Percentage stats: Hit %, Play %, Avg Players (0x03, 0x0C, 0x0D).
Checks if stat type displays as icon only (no numeric value).
| stat_type | The stat type index (VSRecordsStatType) |
Icon-only stats: Most/2nd/Least played fighter (0x15-0x17). These are only shown in Name mode and display a character icon.
| void mnDiagram2_ClearStatRows | ( | HSD_GObj * | gobj | ) |
Clears all stat row text objects and icon JObjs.
| gobj | The diagram GObj |
|
inlinestatic |
Clears and repopulates stat rows based on current selection.
Reads is_name_mode to determine which entity index to use.
| void mnDiagram2_HandleInput | ( | HSD_GObj * | gobj | ) |
Handles input for the VS Records character details page.
| gobj | The diagram GObj (unused, uses global mnDiagram2_804D6C18) |
Input mapping:
| void mnDiagram2_OnAnimComplete | ( | HSD_GObj * | gobj | ) |
Animation completion callback - destroys GObj when animation ends.
| void mnDiagram2_UpdateScrollArrows | ( | HSD_GObj * | gobj | ) |
Updates navigation arrow visibility based on scroll/selection state.
| gobj | The diagram GObj |
Shows/hides arrows:
| void mnDiagram2_Think | ( | HSD_GObj * | gobj | ) |
Per-frame callback that updates scroll arrows or starts exit animation.
| gobj | The diagram GObj |
| void mnDiagram2_FreeUserData | ( | Diagram2 * | data | ) |
GObj destructor callback that frees user data.
| data | The user data to free |
| void mnDiagram2_InitUserData | ( | void * | arg, |
| int | unused | ||
| ) |
Initializes user data fields to default values.
| arg | The user data struct to initialize |
| void mnDiagram2_Create | ( | int | arg0 | ) |
Creates the VS Records diagram GObj and populates initial stat rows.
| arg0 | Unused parameter |
| void mnDiagram2_Init | ( | void | ) |
Entry point for VS Records page 2 - initializes diagram and input handler.
Returns the fighter at rank N for a given stat type.
| stat_type | The stat type to rank by |
| rank | The rank to retrieve (0 = highest, 1 = second highest, etc.) |
Returns the name entry at rank N for a given stat type.
| stat_type | The stat type to rank by |
| rank | The rank to retrieve (0 = highest, 1 = second highest, etc.) |
Computes aggregated fighter ranking across all saved names for icon stats.
| out | Output buffer (cast to SortEntry*) for result |
| type | Stat type (0x15=Most Played, 0x16=2nd Most, 0x17=Least Played) |
| idx | Rank index to retrieve |
| void mnDiagram2_ClearDetailView | ( | HSD_GObj * | gobj | ) |
Clears the detail view by freeing text objects and removing JObj.
| gobj | The GObj containing the detail view data |