Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
filemenu_info.c File Reference

Go to the source code of this file.

Macros

#define NUMBER_OFFSET_Y   0
 
#define CREATE_SUCCESS_NUMBER_X   48
 

Functions

void filemenu_info_draw_message_contents (MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
 
void filemenu_info_init (MenuPanel *tab)
 
void filemenu_info_handle_input (MenuPanel *menu)
 
void filemenu_info_update (MenuPanel *menu)
 
void filemenu_info_cleanup (MenuPanel *menu)
 

Variables

u8 filemenu_info_gridData []
 
MenuWindowBP filemenu_info_windowBPs []
 
MenuPanel filemenu_info_menuBP
 

Macro Definition Documentation

◆ NUMBER_OFFSET_Y

#define NUMBER_OFFSET_Y   0

Definition at line 18 of file filemenu_info.c.

Referenced by filemenu_info_draw_message_contents().

◆ CREATE_SUCCESS_NUMBER_X

#define CREATE_SUCCESS_NUMBER_X   48

Definition at line 19 of file filemenu_info.c.

Referenced by filemenu_info_draw_message_contents().

Function Documentation

◆ filemenu_info_draw_message_contents()

void filemenu_info_draw_message_contents ( MenuPanel * menu,
s32 baseX,
s32 baseY,
s32 width,
s32 height,
s32 opacity,
s32 darkening )

Definition at line 59 of file filemenu_info.c.

64 {
65#if VERSION_PAL
66 s32 xOffset;
67
68 switch (menu->page) {
70 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_28), baseX + 10, baseY + 4, 255, 0, 0);
71 xOffset = D_filemenu_80250934[gCurrentLanguage] + 10;
72 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + xOffset, baseY + 4, 255, 0, 0);
73 xOffset += D_filemenu_802508FC[gCurrentLanguage];
74 draw_number(filemenu_menus[FILE_MENU_MAIN]->selected + 1, baseX + xOffset, baseY + 6, 0, 0, 255, 3);
75 xOffset++;
77 break;
80 xOffset = D_filemenu_80250948[gCurrentLanguage] + 10;
81 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + xOffset, baseY + 4, 255, 0, 0);
82 xOffset += D_filemenu_802508FC[gCurrentLanguage];
83 draw_number(filemenu_CopyFromFileIdx + 1, baseX + xOffset, baseY + 6, 0, 0, 255, 3);
84 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_TO), baseX + 10, baseY + 18, 255, 0, 0);
85 xOffset = D_filemenu_8025094C[gCurrentLanguage] + 10;
86 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + xOffset, baseY + 18, 255, 0, 0);
87 xOffset += D_filemenu_802508FC[gCurrentLanguage];
88 draw_number(filemenu_CopyToFileIdx + 1, baseX + xOffset, baseY + 0x14, 0, 0, 255, 3);
89 xOffset += D_filemenu_80250950[gCurrentLanguage];
91 break;
93 filemenu_draw_message(filemenu_get_menu_message(0x20), baseX + 10, baseY + 4, 255, 0, 0);
94 xOffset = D_filemenu_80250968[gCurrentLanguage] + 10;
95 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + xOffset, baseY + 4, 255, 0, 0);
96 xOffset += D_filemenu_802508FC[gCurrentLanguage];
97 draw_number(filemenu_menus[FILE_MENU_MAIN]->selected + 1, baseX + xOffset, baseY + 6, 0, 0, 255, 3);
98 xOffset++;
99 filemenu_draw_message(filemenu_get_menu_message(0x1F), baseX + xOffset, baseY + 4, 255, 0, 0);
100 break;
101 }
102#else
103 switch (menu->state) {
105 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 10, baseY + 4, 255, 0, 0);
108 break;
110#if VERSION_IQUE
112 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 42, baseY + 7, 255, 0, 0);
114 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_TO), baseX + 84, baseY + 7, 255, 0, 0);
115 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 100, baseY + 7, 255, 0, 0);
118#else
120 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 84, baseY + 4, 255, 0, 0);
122 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_TO), baseX + 10, baseY + 18, 255, 0, 0);
123 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 30, baseY + 18, 255, 0, 0);
126#endif
127 break;
129 filemenu_draw_message(filemenu_get_menu_message(FILE_MESSAGE_FILE_26), baseX + 10, baseY + 4, 255, 0, 0);
132 break;
133 }
134#endif
136}
@ DRAW_NUMBER_STYLE_ALIGN_RIGHT
drawn to the left of posX
Definition enums.h:5393
@ DRAW_NUMBER_STYLE_MONOSPACE
Definition enums.h:5394
@ MSG_PAL_WHITE
Definition enums.h:5405
@ DRAW_NUMBER_CHARSET_NORMAL
Definition enums.h:5400
@ FILE_MESSAGE_28
Definition enums.h:5366
@ FILE_MESSAGE_FILE_26
Definition enums.h:5364
@ FILE_MESSAGE_PERIOD_34
Definition enums.h:5377
@ FILE_MESSAGE_COPY_FROM
Definition enums.h:5367
@ FILE_MESSAGE_HAS_BEEN_DELETED
Definition enums.h:5365
@ FILE_MESSAGE_TO
Definition enums.h:5368
@ FILE_MESSAGE_HAS_BEEN_CREATED
Definition enums.h:5369
@ FM_MESSAGE_COPIED
Definition filemenu.h:35
@ FM_MESSAGE_CREATED
Definition filemenu.h:36
@ FM_MESSAGE_DELETED
Definition filemenu.h:34
void filemenu_draw_message(u8 *, s32, s32, s32, s32, u32)
MenuPanel * filemenu_menus[]
s32 filemenu_CopyFromFileIdx
s32 filemenu_CopyToFileIdx
@ FILE_MENU_MAIN
Definition filemenu.h:17
#define NUMBER_OFFSET_Y
#define CREATE_SUCCESS_NUMBER_X
void filemenu_set_cursor_alpha(s32 arg0)
u8 * filemenu_get_menu_message(s32 idx)
void draw_number(s32 value, s32 x, s32 y, s32 variableWidthChars, s32 palette, s32 opacity, u16 style)
Definition msg.c:2223
#define gCurrentLanguage
Definition variables.h:115

◆ filemenu_info_init()

void filemenu_info_init ( MenuPanel * tab)

Definition at line 138 of file filemenu_info.c.

138 {
139 s32 i;
140
141 for (i = 0; i < ARRAY_COUNT(filemenu_info_windowBPs); i++) {
143 }
144
146 tab->initialized = TRUE;
147}
MenuWindowBP filemenu_info_windowBPs[]
void setup_pause_menu_tab(MenuWindowBP *bpArray, s32 arraySize)
Definition windows.c:461
#define ARRAY_COUNT(arr)
Definition macros.h:40
MenuPanel * tab

◆ filemenu_info_handle_input()

void filemenu_info_handle_input ( MenuPanel * menu)

Definition at line 149 of file filemenu_info.c.

149 {
152
154
155 switch (menu->state) {
157 menu->state = FILE_MENU_MAIN;
162 filemenu_set_selected(menu, 0, 2);
163 break;
165 menu->state = FILE_MENU_MESSAGE;
166 filemenu_set_selected(menu, 1, 2);
167 break;
168 }
170 }
171}
@ BUTTON_A
Definition enums.h:2790
@ BUTTON_B
Definition enums.h:2789
@ WINDOW_UPDATE_HIDE
Definition enums.h:5312
@ WIN_FILES_MESSAGE
Definition enums.h:5291
@ WIN_FILES_OPTION_RIGHT
Definition enums.h:5299
@ WIN_FILES_STEREO
Definition enums.h:5295
@ WIN_FILES_OPTION_LEFT
Definition enums.h:5297
@ WIN_FILES_MONO
Definition enums.h:5296
s8 filemenu_currentMenu
void filemenu_update_show_options_left(s32 windowIdx, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
void filemenu_update_show_options_right(s32 windowIdx, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
@ FILE_MENU_CONFIRM
Definition filemenu.h:18
@ FILE_MENU_MESSAGE
Definition filemenu.h:19
void filemenu_update_show_options_bottom(s32 windowIdx, s32 *flags, s32 *posX, s32 *posY, s32 *posZ, f32 *scaleX, f32 *scaleY, f32 *rotX, f32 *rotY, f32 *rotZ, s32 *darkening, s32 *opacity)
s32 filemenu_pressedButtons
void set_window_update(s32 panelID, s32)
Definition windows.c:434
void filemenu_set_selected(MenuPanel *menu, s32 col, s32 row)

◆ filemenu_info_update()

void filemenu_info_update ( MenuPanel * menu)

Definition at line 173 of file filemenu_info.c.

173 {
174}

◆ filemenu_info_cleanup()

void filemenu_info_cleanup ( MenuPanel * menu)

Definition at line 176 of file filemenu_info.c.

176 {
177}

Variable Documentation

◆ filemenu_info_gridData

u8 filemenu_info_gridData[]
Initial value:
= {
0, 0, 0, 0
}

Definition at line 22 of file filemenu_info.c.

22 {
23 0, 0, 0, 0
24};

◆ filemenu_info_windowBPs

MenuWindowBP filemenu_info_windowBPs[]
Initial value:
= {
{
.windowID = WIN_FILES_MESSAGE,
.unk_01 = 0,
.pos = { .x = 0, .y = 0 },
.width = 0,
.height = 0,
.priority = WINDOW_PRIORITY_64,
.tab = NULL,
.parentID = -1,
.fpUpdate = { WINDOW_UPDATE_HIDE },
.extraFlags = 0,
.style = { .customStyle = &filemenu_windowStyles[20] }
},
}
@ WINDOW_PRIORITY_64
Definition enums.h:3188
WindowStyleCustom filemenu_windowStyles[]
void filemenu_info_draw_message_contents(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)

Definition at line 26 of file filemenu_info.c.

26 {
27 {
28 .windowID = WIN_FILES_MESSAGE,
29 .unk_01 = 0,
30 .pos = { .x = 0, .y = 0 },
31 .width = 0,
32 .height = 0,
33 .priority = WINDOW_PRIORITY_64,
34 .fpDrawContents = &filemenu_info_draw_message_contents,
35 .tab = NULL,
36 .parentID = -1,
37 .fpUpdate = { WINDOW_UPDATE_HIDE },
38 .extraFlags = 0,
39 .style = { .customStyle = &filemenu_windowStyles[20] }
40 },
41};

Referenced by filemenu_info_init().

◆ filemenu_info_menuBP

MenuPanel filemenu_info_menuBP
Initial value:
= {
.initialized = FALSE,
.col = 0,
.row = 0,
.selected = 0,
.state = 0,
.numCols = 1,
.numRows = 1,
.numPages = 0,
.fpInit = &filemenu_info_init,
.fpHandleInput = &filemenu_info_handle_input,
.fpUpdate = &filemenu_info_update,
.fpCleanup = &filemenu_info_cleanup
}
u8 filemenu_info_gridData[]
void filemenu_info_handle_input(MenuPanel *menu)
void filemenu_info_cleanup(MenuPanel *menu)
void filemenu_info_update(MenuPanel *menu)
void filemenu_info_init(MenuPanel *tab)

Definition at line 43 of file filemenu_info.c.

43 {
44 .initialized = FALSE,
45 .col = 0,
46 .row = 0,
47 .selected = 0,
48 .state = 0,
49 .numCols = 1,
50 .numRows = 1,
51 .numPages = 0,
52 .gridData = filemenu_info_gridData,
53 .fpInit = &filemenu_info_init,
54 .fpHandleInput = &filemenu_info_handle_input,
55 .fpUpdate = &filemenu_info_update,
56 .fpCleanup = &filemenu_info_cleanup
57};