Digimon World 3 decomp
The European version, SLES_039.36
Loading...
Searching...
No Matches
field_menu.c File Reference
#include "engine/game.h"
#include <libgs.h>
#include <libetc.h>
#include <libsnd.h>
Include dependency graph for field_menu.c:

Go to the source code of this file.

Functions

void startPanel (PanelAnim *panel, s32 open)
 Starts opening (open != 0) or closing a panel.
 
s32 updatePanel (PanelAnim *panel)
 Advances a panel animation; 1 once it has finished.
 
void createFieldMenuWindows (FieldMenu *task, FieldMenuWindows *win)
 Creates the field menu's windows: the title, the options, the cursor, the money and the pages.
 
void showPartnerPage (void *menu, FieldMenuWindows *win, s32 page, s32 show)
 Fills a party member's page of the field menu (name and five stats), or hides it.
 
s32 getFieldZone (void)
 The field's stages by mode: -1 from MODE_NEW_GAME (where the field menu greys out option 2), 1 from 0x270, else 0.
 
static void openFieldMenu (FieldMenu *task, FieldMenuWindows *win)
 Starts the field menu: opens the panels and the windows, with the extra option when the player has item 0x192 and option 2 only in a field zone.
 
static void showFieldMenuOptions (FieldMenu *task, FieldMenuWindows *win)
 Once the second panel is open: the options (option 2 greyed when disabled)
 
static void showFieldMenuMoney (FieldMenu *task, FieldMenuWindows *win)
 Once the third panel is open: the money and the cursor.
 
static void chooseFieldMenuOption (FieldMenu *task, FieldMenuWindows *win)
 Moves the cursor, or on a choice (option 2 only when enabled) or a cancel closes the panels, with the step that picks the next mode.
 
static void stepFieldMenuFade (FieldMenu *task)
 Steps the fade to the next mode, a CLUT row each 2 frames: its first three sprites through rows 0-7, the next three through rows 8-15; then it asks for the mode (the field's, from the status screen; else the status screen, with the option)
 
static void drawFieldMenuFade (FieldMenu *task)
 Draws the fade to the next mode: the rows already dark, and the current one at its CLUT row.
 
void updateFieldMenu (FieldMenu *task, FieldMenuWindows *win)
 Runs the field menu: opens its panels, moves the cursor and switches mode on a choice.
 
FieldMenu * createFieldMenu (s32 layerId, s32 cursor)
 Opens the field menu on a layer with the cursor on an option.
 

Variables

WindowPos FIELD_MENU_LAYOUT [11]
 The party pages' windows: [0] the name, [1]-[5] the labels and [6]-[10] the values.
 
s32 PAGE_STATS [5] = { 0 , 2 , 3 , 4 , 5 }
 The stats the pages' values show, as indices into the stats halfwords.
 
s32 FIELD_MENU_OPTIONS [2][6]
 The options' strings, without and with the extra option.
 
s32 FIELD_MENU_SPRITES [6] = { 29, 30, 31, 32, 33, 34 }
 

Function Documentation

◆ startPanel()

void startPanel ( PanelAnim *  panel,
s32  open 
)

Starts opening (open != 0) or closing a panel.

< SYSTEM03

< GTE regards 4096 as 1.0

< SYSTEM04

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

Definition at line 7 of file field_menu.c.

Referenced by chooseFieldMenuOption(), and openFieldMenu().

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

◆ updatePanel()

s32 updatePanel ( PanelAnim *  panel)

Advances a panel animation; 1 once it has finished.

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

Definition at line 21 of file field_menu.c.

Referenced by updateFieldMenu().

Here is the caller graph for this function:

◆ createFieldMenuWindows()

void createFieldMenuWindows ( FieldMenu *  task,
FieldMenuWindows *  win 
)

Creates the field menu's windows: the title, the options, the cursor, the money and the pages.

Definition at line 59 of file field_menu.c.

Referenced by openFieldMenu().

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

◆ showPartnerPage()

void showPartnerPage ( void *  menu,
FieldMenuWindows *  win,
s32  page,
s32  show 
)

Fills a party member's page of the field menu (name and five stats), or hides it.

< STATUS: the field menu's and STSTATUS's

< STATUS: the field menu's and STSTATUS's

< STATUS: the field menu's and STSTATUS's

Definition at line 87 of file field_menu.c.

Referenced by chooseFieldMenuOption(), showFieldMenuMoney(), showFieldMenuOptions(), and updateFieldMenu().

Here is the caller graph for this function:

◆ getFieldZone()

s32 getFieldZone ( void  )

The field's stages by mode: -1 from MODE_NEW_GAME (where the field menu greys out option 2), 1 from 0x270, else 0.

< STSTATUS: the field menu's screens (FIELD_MENU_CHOICE)

< FIELDSTG, where a new game starts

Definition at line 124 of file field_menu.c.

Referenced by openFieldMenu().

Here is the caller graph for this function:

◆ openFieldMenu()

static void openFieldMenu ( FieldMenu *  task,
FieldMenuWindows *  win 
)
inlinestatic

Starts the field menu: opens the panels and the windows, with the extra option when the player has item 0x192 and option 2 only in a field zone.

Definition at line 146 of file field_menu.c.

Referenced by updateFieldMenu().

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

◆ showFieldMenuOptions()

static void showFieldMenuOptions ( FieldMenu *  task,
FieldMenuWindows *  win 
)
inlinestatic

Once the second panel is open: the options (option 2 greyed when disabled)

< STATUS: the field menu's and STSTATUS's

< SYSTEM03

< what is unavailable

Definition at line 168 of file field_menu.c.

Referenced by updateFieldMenu().

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

◆ showFieldMenuMoney()

static void showFieldMenuMoney ( FieldMenu *  task,
FieldMenuWindows *  win 
)
inlinestatic

Once the third panel is open: the money and the cursor.

< STATUS: the field menu's and STSTATUS's

Definition at line 181 of file field_menu.c.

Referenced by updateFieldMenu().

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

◆ chooseFieldMenuOption()

static void chooseFieldMenuOption ( FieldMenu *  task,
FieldMenuWindows *  win 
)
inlinestatic

Moves the cursor, or on a choice (option 2 only when enabled) or a cancel closes the panels, with the step that picks the next mode.

< SYSTEM02: a cursor moves

< SYSTEM00: a choice is taken

< STSTATUS: the field menu's screens (FIELD_MENU_CHOICE)

< SYSTEM01

< STSTATUS: the field menu's screens (FIELD_MENU_CHOICE)

Definition at line 193 of file field_menu.c.

Referenced by updateFieldMenu().

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

◆ stepFieldMenuFade()

static void stepFieldMenuFade ( FieldMenu *  task)
inlinestatic

Steps the fade to the next mode, a CLUT row each 2 frames: its first three sprites through rows 0-7, the next three through rows 8-15; then it asks for the mode (the field's, from the status screen; else the status screen, with the option)

< STSTATUS: the field menu's screens (FIELD_MENU_CHOICE)

< STSTATUS: the field menu's screens (FIELD_MENU_CHOICE)

Definition at line 252 of file field_menu.c.

Referenced by updateFieldMenu().

Here is the caller graph for this function:

◆ drawFieldMenuFade()

static void drawFieldMenuFade ( FieldMenu *  task)
inlinestatic

Draws the fade to the next mode: the rows already dark, and the current one at its CLUT row.

Definition at line 300 of file field_menu.c.

Referenced by updateFieldMenu().

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

◆ updateFieldMenu()

void updateFieldMenu ( FieldMenu *  task,
FieldMenuWindows *  win 
)

Runs the field menu: opens its panels, moves the cursor and switches mode on a choice.

< STATUS: the field menu's and STSTATUS's

< SYSTEM03

< SYSTEM04

< SYSTEM04

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

< GTE regards 4096 as 1.0

Definition at line 324 of file field_menu.c.

Referenced by createFieldMenu().

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

◆ createFieldMenu()

FieldMenu * createFieldMenu ( s32  layerId,
s32  cursor 
)

Opens the field menu on a layer with the cursor on an option.

Definition at line 426 of file field_menu.c.

Referenced by openFieldMenu(), and STSTATUS_runScreens().

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

Variable Documentation

◆ FIELD_MENU_LAYOUT

WindowPos FIELD_MENU_LAYOUT[11]
Initial value:
= {
{12, 55, 0, 19},
{1, 16, 0, 28},
{2, 16, 0, 37},
{4, 61, 0, 37},
{3, 16, 0, 46},
{4, 61, 0, 46},
{13, 44, 0, 28},
{14, 59, 0, 37},
{14, 94, 0, 37},
{14, 59, 0, 46},
{14, 94, 0, 46},
}

The party pages' windows: [0] the name, [1]-[5] the labels and [6]-[10] the values.

Definition at line 41 of file field_menu.c.

Referenced by createFieldMenuWindows(), and showPartnerPage().

◆ PAGE_STATS

s32 PAGE_STATS[5] = { 0 , 2 , 3 , 4 , 5 }

The stats the pages' values show, as indices into the stats halfwords.

Definition at line 56 of file field_menu.c.

Referenced by showPartnerPage().

◆ FIELD_MENU_OPTIONS

s32 FIELD_MENU_OPTIONS[2][6]
Initial value:
= {
{ 6, 7, 8, 9, 10, 0 },
{ 6, 7, 8, 9, 10, 11 },
}

The options' strings, without and with the extra option.

Definition at line 137 of file field_menu.c.

Referenced by showFieldMenuOptions().

◆ FIELD_MENU_SPRITES

s32 FIELD_MENU_SPRITES[6] = { 29, 30, 31, 32, 33, 34 }

Definition at line 142 of file field_menu.c.

Referenced by drawFieldMenuFade().