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

Go to the source code of this file.

Functions

void filemenu_draw_rect (s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileIdx, s32 uls, s32 ult, s32 dsdx, s32 dtdy)
 
void filemenu_set_selected (MenuPanel *menu, s32 col, s32 row)
 
void filemenu_set_cursor_alpha (s32 alpha)
 
void filemenu_set_cursor_goal_pos (s32 windowID, s32 posX, s32 posY)
 
void filemenu_update_cursor (void)
 
void filemenu_update (void)
 
void func_8024330C (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_name_input (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_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)
 
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)
 
void filemenu_update_show_title (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 func_802435C4 (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_hidden_name_input (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_hidden_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_hidden_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)
 
void filemenu_update_hidden_title (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_hidden_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)
 
void filemenu_update_show_with_rotation (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_hidden_with_rotation (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_select_file (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_deselect_file (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_name_confirm (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_hidden_name_confirm (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_draw_cursor (MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
 
void filemenu_draw_contents_copy_arrow (MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
 
void func_PAL_8002B574 (void)
 
void filemenu_init (s32 arg0)
 
void filemenu_cleanup (void)
 
s32 func_80244BC4 ()
 

Variables

HudScript HES_AnimatedCursorHand
 
MenuPanel filemenu_main_menuBP
 
MenuPanel filemenu_yesno_menuBP
 
MenuPanel filemenu_info_menuBP
 
MenuPanel filemenu_createfile_menuBP
 
HudScriptfilemenu_cursor_hudElemScripts [] = { &HES_AnimatedCursorHand }
 
MenuPanelfilemenu_menus []
 
s32 filemenu_cursor_posX = SCREEN_WIDTH / 2
 
s32 filemenu_cursor_posY = -SCREEN_HEIGHT / 2
 
s32 filemenu_cursor_alpha = 0
 
s32 filemenu_cursor_targetX = SCREEN_WIDTH / 2
 
s32 filemenu_cursor_targetY = -SCREEN_HEIGHT / 2
 
s32 filemenu_cursorGoalAlpha = 0
 
s32 filemenu_cursorGoalAlpha2 = 0
 
s32 D_80249BB0 = TRUE
 
s32 D_80249BB8 = 0
 
s16 D_80249BBC [16] = { 315, 303, 283, 260, 235, 210, 185, 160, 135, 110, 85, 60, 37, 17, 5, 0 }
 
s16 D_80249BDC [16] = { 315, 303, 283, 260, 235, 210, 185, 160, 135, 110, 85, 60, 37, 17, 5, 0 }
 
s16 D_80249BFC [16] = { 157, 151, 141, 130, 117, 105, 92, 80, 67, 55, 42, 30, 18, 8, 2, 0 }
 
s16 D_80249C1C [16] = { 157, 151, 141, 130, 117, 105, 92, 80, 67, 55, 42, 30, 18, 8, 2, 0 }
 
s16 D_80249C3C [16] = { 63, 60, 56, 52, 47, 42, 37, 32, 27, 22, 17, 12, 7, 3, 1, 0 }
 
s16 D_80249C5C [16] = { 63, 60, 56, 52, 47, 42, 37, 32, 27, 22, 17, 12, 7, 3, 1, 0 }
 
s16 D_80249C7C [10] = { -5, -17, -37, -60, -85, -110, -135, -160, -185, -210 }
 
s16 D_80249C90 [10] = { -5, -17, -37, -60, -85, -110, -135, -160, -185, -210 }
 
s16 D_80249CA4 [10] = { -2, -8, -18, -30, -42, -55, -70, -85, -100, -115 }
 
s16 D_80249CB8 [10] = { -2, -8, -18, -30, -42, -55, -70, -85, -100, -115 }
 
s16 D_80249CCC [10] = { -1, -3, -7, -12, -17, -22, -27, -32, -37, -42 }
 
s16 D_80249CE0 [10] = { -1, -3, -7, -12, -17, -22, -27, -32, -37, -42 }
 
s16 D_80249CF4 [16] = { 180, 173, 161, 148, 134, 120, 105, 91, 77, 62, 48, 34, 21, 9, 2, 0 }
 
s16 D_80249D14 [16] = { 0, 2, 9, 21, 34, 48, 62, 77, 91, 105, 120, 134, 148, 161, 173, 180 }
 
s16 D_80249D34 [10] = { 185, 160, 135, 110, 85, 60, 37, 17, 5, 0 }
 
s16 D_80249D48 [10] = { 0, 5, 17, 37, 60, 85, 110, 135, 160, 185}
 
Vp D_80249D60
 
f32 CopyArrowAnimOffsets []
 
MenuWindowBP filemenu_common_windowBPs []
 
Gfx filemenu_dl_copyarrow []
 
Gfx D_8024B6F0 []
 
Gfx D_8024B708 []
 
BSS s32 filemenu_CopyToFileIdx
 
BSS s32 filemenu_pressedButtons
 
BSS s32 filemenu_cursorHudElem
 
BSS s32 filemenu_heldButtons
 
BSS s8 filemenu_filename_pos
 
BSS s32 filemenu_CopyFromFileIdx
 
BSS s8 filemenu_currentMenu
 
BSS s32 filemenu_8024C09C
 
BSS s32 filemenu_cursorHudElemID [1]
 
BSS s32 filemenu_8024C0A4 [3]
 
BSS s32 filemenu_hudElemIDs [20]
 
BSS s32 filemenu_createfile_hudElems [4]
 

Function Documentation

◆ filemenu_draw_rect()

void filemenu_draw_rect ( s32 ulx,
s32 uly,
s32 lrx,
s32 lry,
s32 tileIdx,
s32 uls,
s32 ult,
s32 dsdx,
s32 dtdy )

Definition at line 141 of file filemenu_common.c.

141 {
142 if (ulx <= -2688 || uly <= -2688 || lrx <= 0 || lry <= 0) {
143 return;
144 }
145 if (ulx >= 1280 || uly >= 960 || lrx >= 2688 || lry >= 2688) {
146 return;
147 }
148 gSPScisTextureRectangle(gMainGfxPos++, ulx, uly, lrx, lry, tileIdx, uls, ult, dsdx, dtdy);
149}
Gfx * gMainGfxPos
Definition cam_main.c:15

Referenced by filemenu_draw_char(), filemenu_update_hidden_name_confirm(), and filemenu_update_show_name_confirm().

◆ filemenu_set_selected()

void filemenu_set_selected ( MenuPanel * menu,
s32 col,
s32 row )

Definition at line 151 of file filemenu_common.c.

151 {
152 menu->col = col;
153 menu->row = row;
154 menu->selected = menu->gridData[(menu->state * menu->numCols * menu->numRows) +
155 (menu->numCols * menu->row) + menu->col];
156}

Referenced by filemenu_choose_name_handle_input(), filemenu_info_handle_input(), filemenu_init(), filemenu_main_handle_input(), and filemenu_yesno_handle_input().

◆ filemenu_set_cursor_alpha()

void filemenu_set_cursor_alpha ( s32 alpha)

Definition at line 158 of file filemenu_common.c.

158 {
161}
s32 filemenu_cursorGoalAlpha
s32 filemenu_cursorGoalAlpha2

Referenced by filemenu_info_draw_message_contents().

◆ filemenu_set_cursor_goal_pos()

void filemenu_set_cursor_goal_pos ( s32 windowID,
s32 posX,
s32 posY )

Definition at line 163 of file filemenu_common.c.

163 {
164 Window* window = &gWindows[windowID];
165
167 if (D_80249BB0) {
168 s32 i;
169
170 for (i = WIN_FILES_MAIN; i < ARRAY_COUNT(gWindows); i++) {
171 Window* window = &gWindows[i];
172 s8 parent = window->parent;
173
174 if ((parent == WIN_NONE || parent == WIN_FILES_MAIN) && (window->flags & WINDOW_FLAG_INITIAL_ANIMATION)) {
175 break;
176 }
177 }
178 if (i >= ARRAY_COUNT(gWindows)) {
179 D_80249BB0 = FALSE;
180 }
181 }
186 } else if (!(window->flags & WINDOW_FLAG_INITIAL_ANIMATION) &&
187 (window->parent == WIN_NONE || !(gWindows[window->parent].flags & WINDOW_FLAG_INITIAL_ANIMATION))) {
190 }
191}
@ WINDOW_FLAG_INITIAL_ANIMATION
Definition enums.h:4996
@ WIN_FILES_MAIN
Definition enums.h:5288
@ WIN_NONE
Definition enums.h:5240
s32 D_80249BB0
s32 filemenu_cursor_targetX
s32 filemenu_cursor_targetY
s32 filemenu_cursor_posX
s32 filemenu_cursor_posY
s32 get_game_mode(void)
Definition game_modes.c:123
@ GAME_MODE_END_FILE_SELECT
Definition game_modes.h:20
#define ARRAY_COUNT(arr)
Definition macros.h:40
Window gWindows[64]
Definition windows.c:23

Referenced by filemenu_draw_contents_choose_name(), filemenu_draw_contents_file_title(), filemenu_draw_contents_option_center(), filemenu_draw_contents_option_left(), filemenu_draw_contents_option_right(), and filemenu_yesno_draw_options_contents().

◆ filemenu_update_cursor()

void filemenu_update_cursor ( void )

Definition at line 193 of file filemenu_common.c.

193 {
194 s32 targetPosX = filemenu_cursor_targetX;
195 s32 targetPosY = filemenu_cursor_targetY;
196 s32 xDelta;
197 s32 yDelta;
198 s32 i;
199
200 xDelta = (targetPosX - filemenu_cursor_posX) * 0.5;
201 yDelta = (targetPosY - filemenu_cursor_posY) * 0.5;
202
203 if ((targetPosX != filemenu_cursor_posX) || (targetPosY != filemenu_cursor_posY)) {
204 if ((xDelta == 0) && (yDelta == 0)) {
205 filemenu_cursor_posX = targetPosX;
206 filemenu_cursor_posY = targetPosY;
207 }
208 }
209
210 filemenu_cursor_posX += xDelta;
211 filemenu_cursor_posY += yDelta;
212
213 if (filemenu_cursorGoalAlpha == 0) {
215 if (filemenu_cursor_alpha < 0) {
217 }
218 } else {
220 if (filemenu_cursor_alpha > 255) {
222 }
223 }
224
225 for (i = WIN_FILES_MAIN; i < ARRAY_COUNT(gWindows); i++) {
226 Window* window = &gWindows[i];
227 s8 parent = window->parent;
228
229 if ((parent == WIN_NONE || parent == WIN_FILES_MAIN) && (window->flags & WINDOW_FLAG_INITIAL_ANIMATION)) {
230 break;
231 }
232 }
233
234 if (D_80249BB8 == 0) {
235 if (filemenu_cursorGoalAlpha == 0) {
236 D_80249BB8 = 1;
237 }
238 }
239
240 if (i >= ARRAY_COUNT(gWindows)) {
241 if (filemenu_cursorGoalAlpha2 == 255) {
242 if (D_80249BB8 != 0) {
243 D_80249BB8--;
244 if (D_80249BB8 == 0) {
247 }
248 }
249 }
250 if (D_80249BB8 == 0) {
252 }
253 } else if (filemenu_cursorGoalAlpha == 0) {
254 D_80249BB8 = 1;
255 }
256
258}
s32 filemenu_cursor_alpha
s32 D_80249BB8

Referenced by filemenu_draw_cursor().

◆ filemenu_update()

void filemenu_update ( void )

Definition at line 260 of file filemenu_common.c.

260 {
261 MenuPanel* menu;
262 s32 i;
263
264 for (i = WIN_FILES_MAIN; i < ARRAY_COUNT(gWindows); i++) {
265 if ((gWindows[i].parent == WIN_NONE || gWindows[i].parent == WIN_FILES_MAIN) &&
267 {
268 break;
269 }
270 }
271
272 if (i >= ARRAY_COUNT(gWindows)) {
275 } else {
278 }
279
280 // B overrides A
282 filemenu_pressedButtons &= ~BUTTON_A;
283 }
285 filemenu_heldButtons &= ~BUTTON_A;
286 }
287
288 // only process inputs for the current menu
290 if (menu->initialized) {
291 if (menu->fpHandleInput != NULL) {
292 menu->fpHandleInput(menu);
293 }
294 }
295
296 // update all menus
297 for (i = 0; i < ARRAY_COUNT(filemenu_menus); i++) {
298 menu = filemenu_menus[i];
299 if (menu->initialized && menu->fpUpdate != NULL) {
300 menu->fpUpdate(menu);
301 }
302 }
303}
u32 pressedButtons[4]
@ BUTTON_B
Definition enums.h:2789
MenuPanel * filemenu_menus[]
BSS s8 filemenu_currentMenu
BSS s32 filemenu_pressedButtons
BSS s32 filemenu_heldButtons
void(* fpHandleInput)(struct MenuPanel *)
void(* fpUpdate)(struct MenuPanel *)
GameStatus * gGameStatusPtr
Definition main_loop.c:32

Referenced by state_step_file_select().

◆ func_8024330C()

void func_8024330C ( s32 windowIdx,
s32 * flags,
s32 * posX,
s32 * posY,
s32 * posZ,
f32 * scaleX,
f32 * scaleY,
f32 * rotX,
f32 * rotY,
f32 * rotZ,
s32 * darkening,
s32 * opacity )

Definition at line 305 of file filemenu_common.c.

313 {
314 Window* window = &gWindows[windowIdx];
315 s32 updateCounter = window->updateCounter;
316
317 if (updateCounter == 0) {
318 window->flags &= ~WINDOW_FLAG_HIDDEN;
319 }
320
321 if (updateCounter < ARRAY_COUNT(D_80249BBC)) {
322 *posX -= D_80249BBC[updateCounter];
323 } else {
324 *posX -= D_80249BBC[ARRAY_COUNT(D_80249BBC) - 1];
325 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
326 }
327}
s16 D_80249BBC[16]

◆ filemenu_update_show_name_input()

void filemenu_update_show_name_input ( s32 windowIdx,
s32 * flags,
s32 * posX,
s32 * posY,
s32 * posZ,
f32 * scaleX,
f32 * scaleY,
f32 * rotX,
f32 * rotY,
f32 * rotZ,
s32 * darkening,
s32 * opacity )

Definition at line 329 of file filemenu_common.c.

337 {
338 Window* window = &gWindows[windowIdx];
339 s32 updateCounter = window->updateCounter;
340
341 if (updateCounter == 0) {
342 window->flags &= ~WINDOW_FLAG_HIDDEN;
343 }
344
345 if (updateCounter < ARRAY_COUNT(D_80249BDC)) {
346 *posX += D_80249BDC[updateCounter];
347 } else {
348 *posX += D_80249BDC[ARRAY_COUNT(D_80249BDC) - 1];
349 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
350 }
351}
s16 D_80249BDC[16]

Referenced by filemenu_main_handle_input().

◆ filemenu_update_show_options_left()

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 )

Definition at line 353 of file filemenu_common.c.

361 {
362 Window* window = &gWindows[windowIdx];
363 s32 updateCounter = window->updateCounter;
364
365 if (updateCounter == 0) {
366 window->flags &= ~WINDOW_FLAG_HIDDEN;
367 }
368
369 if (updateCounter < ARRAY_COUNT(D_80249BFC)) {
370 *posX -= D_80249BFC[updateCounter];
371 } else {
372 *posX -= D_80249BFC[ARRAY_COUNT(D_80249BFC) - 1];
373 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
374 }
375}
s16 D_80249BFC[16]

Referenced by filemenu_info_handle_input(), and filemenu_main_handle_input().

◆ filemenu_update_show_options_right()

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 )

Definition at line 377 of file filemenu_common.c.

385 {
386 Window* window = &gWindows[windowIdx];
387 s32 updateCounter = window->updateCounter;
388
389 if (updateCounter == 0) {
390 window->flags &= ~WINDOW_FLAG_HIDDEN;
391 }
392
393 if (updateCounter < ARRAY_COUNT(D_80249C1C)) {
394 *posX += D_80249C1C[updateCounter];
395 } else {
396 *posX += D_80249C1C[ARRAY_COUNT(D_80249C1C) - 1];
397 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
398 }
399}
s16 D_80249C1C[16]

Referenced by filemenu_info_handle_input(), and filemenu_main_handle_input().

◆ filemenu_update_show_options_bottom()

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 )

Definition at line 401 of file filemenu_common.c.

409 {
410 Window* window = &gWindows[windowIdx];
411 s32 updateCounter = window->updateCounter;
412
413 if (updateCounter == 0) {
414 window->flags &= ~WINDOW_FLAG_HIDDEN;
415 }
416
417 if (updateCounter < ARRAY_COUNT(D_80249C3C)) {
418 *posY += D_80249C3C[updateCounter];
419 } else {
420 *posY += D_80249C3C[ARRAY_COUNT(D_80249C3C) - 1];
421 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
422 }
423}
s16 D_80249C3C[16]

Referenced by filemenu_info_handle_input(), and filemenu_main_handle_input().

◆ filemenu_update_show_title()

void filemenu_update_show_title ( s32 windowIdx,
s32 * flags,
s32 * posX,
s32 * posY,
s32 * posZ,
f32 * scaleX,
f32 * scaleY,
f32 * rotX,
f32 * rotY,
f32 * rotZ,
s32 * darkening,
s32 * opacity )

Definition at line 425 of file filemenu_common.c.

433 {
434 Window* window = &gWindows[windowIdx];
435 s32 updateCounter = window->updateCounter;
436
437 if (updateCounter == 0) {
438 window->flags &= ~WINDOW_FLAG_HIDDEN;
439 }
440
441 if (updateCounter < ARRAY_COUNT(D_80249C5C)) {
442 *posY -= D_80249C5C[updateCounter];
443 } else {
444 *posY -= D_80249C5C[ARRAY_COUNT(D_80249C5C) - 1];
445 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
446 }
447}
s16 D_80249C5C[16]

◆ func_802435C4()

void func_802435C4 ( s32 windowIdx,
s32 * flags,
s32 * posX,
s32 * posY,
s32 * posZ,
f32 * scaleX,
f32 * scaleY,
f32 * rotX,
f32 * rotY,
f32 * rotZ,
s32 * darkening,
s32 * opacity )

Definition at line 449 of file filemenu_common.c.

457 {
458 Window* window = &gWindows[windowIdx];
459 s32 updateCounter = window->updateCounter;
460
461 if (updateCounter < ARRAY_COUNT(D_80249C7C)) {
462 *posX += D_80249C7C[updateCounter];
463 } else {
464 *posX += D_80249C7C[ARRAY_COUNT(D_80249C7C) - 1];
465 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
466 window->flags |= WINDOW_FLAG_HIDDEN;
467 }
468}
@ WINDOW_FLAG_HIDDEN
Updated but not rendered.
Definition enums.h:4995
s16 D_80249C7C[10]

◆ filemenu_update_hidden_name_input()

void filemenu_update_hidden_name_input ( s32 windowIdx,
s32 * flags,
s32 * posX,
s32 * posY,
s32 * posZ,
f32 * scaleX,
f32 * scaleY,
f32 * rotX,
f32 * rotY,
f32 * rotZ,
s32 * darkening,
s32 * opacity )

Definition at line 470 of file filemenu_common.c.

478 {
479 Window* window = &gWindows[windowIdx];
480 s32 updateCounter = window->updateCounter;
481
482 if (updateCounter < ARRAY_COUNT(D_80249C90)) {
483 *posX -= D_80249C90[updateCounter];
484 } else {
485 *posX -= D_80249C90[ARRAY_COUNT(D_80249C90) - 1];
486 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
487 window->flags |= WINDOW_FLAG_HIDDEN;
488 }
489}
s16 D_80249C90[10]

Referenced by filemenu_choose_name_handle_input(), and filemenu_yesno_handle_input().

◆ filemenu_update_hidden_options_left()

void filemenu_update_hidden_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 )

Definition at line 491 of file filemenu_common.c.

499 {
500 Window* window = &gWindows[windowIdx];
501 s32 updateCounter = window->updateCounter;
502
503 if (updateCounter < ARRAY_COUNT(D_80249CA4)) {
504 *posX += D_80249CA4[updateCounter];
505 } else {
506 *posX += D_80249CA4[ARRAY_COUNT(D_80249CA4) - 1];
507 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
508 window->flags |= WINDOW_FLAG_HIDDEN;
509 }
510}
s16 D_80249CA4[10]

Referenced by filemenu_main_handle_input().

◆ filemenu_update_hidden_options_right()

void filemenu_update_hidden_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 )

Definition at line 512 of file filemenu_common.c.

520 {
521 Window* window = &gWindows[windowIdx];
522 s32 updateCounter = window->updateCounter;
523
524 if (updateCounter < ARRAY_COUNT(D_80249CB8)) {
525 *posX -= D_80249CB8[updateCounter];
526 } else {
527 *posX -= D_80249CB8[ARRAY_COUNT(D_80249CB8) - 1];
528 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
529 window->flags |= WINDOW_FLAG_HIDDEN;
530 }
531}
s16 D_80249CB8[10]

Referenced by filemenu_main_handle_input().

◆ filemenu_update_hidden_title()

void filemenu_update_hidden_title ( s32 windowIdx,
s32 * flags,
s32 * posX,
s32 * posY,
s32 * posZ,
f32 * scaleX,
f32 * scaleY,
f32 * rotX,
f32 * rotY,
f32 * rotZ,
s32 * darkening,
s32 * opacity )

Definition at line 533 of file filemenu_common.c.

541 {
542 Window* window = &gWindows[windowIdx];
543 s32 updateCounter = window->updateCounter;
544
545 if (updateCounter < ARRAY_COUNT(D_80249CCC)) {
546 *posY += D_80249CCC[updateCounter];
547 } else {
548 *posY += D_80249CCC[ARRAY_COUNT(D_80249CCC) - 1];
549 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
550 window->flags |= WINDOW_FLAG_HIDDEN;
551 }
552}
s16 D_80249CCC[10]

Referenced by filemenu_main_handle_input().

◆ filemenu_update_hidden_options_bottom()

void filemenu_update_hidden_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 )

Definition at line 554 of file filemenu_common.c.

562 {
563 Window* window = &gWindows[windowIdx];
564 s32 updateCounter = window->updateCounter;
565
566 if (updateCounter < ARRAY_COUNT(D_80249CE0)) {
567 *posY -= D_80249CE0[updateCounter];
568 } else {
569 *posY -= D_80249CE0[ARRAY_COUNT(D_80249CE0) - 1];
570 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
571 window->flags |= WINDOW_FLAG_HIDDEN;
572 }
573}
s16 D_80249CE0[10]

Referenced by filemenu_main_handle_input().

◆ filemenu_update_show_with_rotation()

void filemenu_update_show_with_rotation ( s32 windowIdx,
s32 * flags,
s32 * posX,
s32 * posY,
s32 * posZ,
f32 * scaleX,
f32 * scaleY,
f32 * rotX,
f32 * rotY,
f32 * rotZ,
s32 * darkening,
s32 * opacity )

Definition at line 575 of file filemenu_common.c.

583 {
584 Window* window = &gWindows[windowIdx];
585 s32 updateCounter = window->updateCounter;
586
587 if (updateCounter == 0) {
588 window->flags &= ~WINDOW_FLAG_HIDDEN;
589 }
590
591 if (updateCounter < ARRAY_COUNT(D_80249CF4)) {
592 *rotY += D_80249CF4[updateCounter];
594 } else {
595 *flags = 0;
596 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
597 }
598}
s8 flags
Definition demo_api.c:15
@ DRAW_FLAG_ROTSCALE
Definition enums.h:5003
@ DRAW_FLAG_CULL_BACK
Definition enums.h:5006
s16 D_80249CF4[16]

Referenced by filemenu_choose_name_handle_input(), and filemenu_yesno_handle_input().

◆ filemenu_update_hidden_with_rotation()

void filemenu_update_hidden_with_rotation ( s32 windowIdx,
s32 * flags,
s32 * posX,
s32 * posY,
s32 * posZ,
f32 * scaleX,
f32 * scaleY,
f32 * rotX,
f32 * rotY,
f32 * rotZ,
s32 * darkening,
s32 * opacity )

Definition at line 600 of file filemenu_common.c.

608 {
609 Window* window = &gWindows[windowIdx];
610 s32 updateCounter = window->updateCounter;
611
612 if (updateCounter < 10) { // TODO: array count?
613 *rotY += -D_80249D14[updateCounter];
615 } else {
616 *flags = 0;
617 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
618 window->flags |= WINDOW_FLAG_HIDDEN;
619 }
620}
s16 D_80249D14[16]

Referenced by filemenu_main_handle_input().

◆ filemenu_update_select_file()

void filemenu_update_select_file ( s32 windowIdx,
s32 * flags,
s32 * posX,
s32 * posY,
s32 * posZ,
f32 * scaleX,
f32 * scaleY,
f32 * rotX,
f32 * rotY,
f32 * rotZ,
s32 * darkening,
s32 * opacity )

Definition at line 622 of file filemenu_common.c.

630 {
631 Window* window = &gWindows[windowIdx];
632 Window* parent = &gWindows[window->parent];
633 s32 updateCounter = window->updateCounter;
634 f32 temp_f4 = updateCounter / 16.0f;
635 s32 widthDelta = (parent->width / 2) - (window->width / 2);
636 s32 heightDelta = (parent->height / 2) - (window->height / 2) - 34;
637
638 if (updateCounter < 16) {
639 *posX += -window->pos.x + (((f32) (widthDelta - window->pos.x) * temp_f4) + window->pos.x);
640 *posY += -window->pos.y + (((f32) (heightDelta - window->pos.y) * temp_f4) + window->pos.y);
641 } else {
642 *posX += -window->pos.x + ((f32) (widthDelta - window->pos.x) + window->pos.x);
643 *posY += -window->pos.y + ((f32) (heightDelta - window->pos.y) + window->pos.y);
644 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
645 }
646}

Referenced by filemenu_main_handle_input().

◆ filemenu_update_deselect_file()

void filemenu_update_deselect_file ( s32 windowIdx,
s32 * flags,
s32 * posX,
s32 * posY,
s32 * posZ,
f32 * scaleX,
f32 * scaleY,
f32 * rotX,
f32 * rotY,
f32 * rotZ,
s32 * darkening,
s32 * opacity )

Definition at line 648 of file filemenu_common.c.

656 {
657 Window* window = &gWindows[windowIdx];
658 s32 updateCounter = window->updateCounter;
659 f32 temp_f4 = 1.0f - (updateCounter / 16.0f);
660
661 if (updateCounter < 16) {
662 *posX += -window->pos.x + (((80 - window->pos.x) * temp_f4) + window->pos.x);
663 *posY += -window->pos.y + (((36 - window->pos.y) * temp_f4) + window->pos.y);
664 } else {
665 *posX += -window->pos.x + ((80 - window->pos.x) * 0.0f + window->pos.x);
666 *posY += -window->pos.y + ((36 - window->pos.y) * 0.0f + window->pos.y);
667 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
668 }
669}

Referenced by filemenu_yesno_handle_input().

◆ filemenu_update_show_name_confirm()

void filemenu_update_show_name_confirm ( s32 windowIdx,
s32 * flags,
s32 * posX,
s32 * posY,
s32 * posZ,
f32 * scaleX,
f32 * scaleY,
f32 * rotX,
f32 * rotY,
f32 * rotZ,
s32 * darkening,
s32 * opacity )

Definition at line 671 of file filemenu_common.c.

679 {
680 Window* window = &gWindows[windowIdx];
681 s32 updateCounter = window->updateCounter;
682 u32 counter;
683
684 gDPPipeSync(gMainGfxPos++);
685 gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
686 gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
687 gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
688 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 140);
689
690 if (updateCounter < 10) {
691 s32 x = updateCounter * 16;
692 s32 y = updateCounter * 12;
693 filemenu_draw_rect(0, 0, SCREEN_WIDTH * 4, y * 4, 0, 0, 0, 0, 0);
694 filemenu_draw_rect(0, (SCREEN_HEIGHT - y) * 4, SCREEN_WIDTH * 4, SCREEN_HEIGHT * 4, 0, 0, 0, 0, 0);
695 filemenu_draw_rect(0, y * 4, x * 4, (SCREEN_HEIGHT - y) * 4, 0, 0, 0, 0, 0);
696 filemenu_draw_rect((SCREEN_WIDTH - x) * 4, y * 4, SCREEN_WIDTH * 4, (SCREEN_HEIGHT - y) * 4, 0, 0, 0, 0, 0);
697 } else {
698 filemenu_draw_rect(0, 0, SCREEN_WIDTH * 4, SCREEN_HEIGHT * 4, 0, 0, 0, 0, 0);
699 }
700
701 counter = updateCounter - 10;
702 if (counter < 10) {
703 window->flags &= ~WINDOW_FLAG_HIDDEN;
704 *posY -= D_80249D34[counter];
705 }
706 if (updateCounter >= 20) {
707 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
708 }
709}
void filemenu_draw_rect(s32 ulx, s32 uly, s32 lrx, s32 lry, s32 tileIdx, s32 uls, s32 ult, s32 dsdx, s32 dtdy)
s16 D_80249D34[10]
#define SCREEN_WIDTH
Definition macros.h:105
#define SCREEN_HEIGHT
Definition macros.h:106

Referenced by filemenu_choose_name_handle_input(), and filemenu_main_handle_input().

◆ filemenu_update_hidden_name_confirm()

void filemenu_update_hidden_name_confirm ( s32 windowIdx,
s32 * flags,
s32 * posX,
s32 * posY,
s32 * posZ,
f32 * scaleX,
f32 * scaleY,
f32 * rotX,
f32 * rotY,
f32 * rotZ,
s32 * darkening,
s32 * opacity )

Definition at line 711 of file filemenu_common.c.

719 {
720 Window* window = &gWindows[windowIdx];
721 s32 updateCounter = window->updateCounter;
722
723 if (updateCounter < ARRAY_COUNT(D_80249D48)) {
724 gDPPipeSync(gMainGfxPos++);
725 gDPSetCycleType(gMainGfxPos++, G_CYC_1CYCLE);
726 gDPSetCombineMode(gMainGfxPos++, G_CC_PRIMITIVE, G_CC_PRIMITIVE);
727 gDPSetRenderMode(gMainGfxPos++, G_RM_CLD_SURF, G_RM_CLD_SURF2);
728 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 140 - updateCounter * 14);
729 filemenu_draw_rect(0, 0, 1280, 960, 0, 0, 0, 0, 0);
730 *posY -= D_80249D48[updateCounter];
731 } else {
732 window->flags &= ~WINDOW_FLAG_INITIAL_ANIMATION;
733 window->flags |= WINDOW_FLAG_HIDDEN;
734 }
735}
s16 D_80249D48[10]

Referenced by filemenu_yesno_handle_input().

◆ filemenu_draw_cursor()

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

Definition at line 737 of file filemenu_common.c.

737 {
738 s32 temp_a1;
739
741 temp_a1 = filemenu_cursor_alpha;
742 if (temp_a1 > 0) {
743 if (temp_a1 > 255) {
744 temp_a1 = 255;
745 }
749 }
750}
BSS s32 filemenu_cursorHudElemID[1]
void filemenu_update_cursor(void)
void hud_element_set_alpha(s32 id, s32 opacity)
void hud_element_draw_without_clipping(s32 id)
void hud_element_set_render_pos(s32 id, s32 x, s32 y)

◆ filemenu_draw_contents_copy_arrow()

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

Definition at line 752 of file filemenu_common.c.

754{
755 Matrix4f transformMtx, tempMtx;
756 f32 startX, startZ;
757 f32 endX, endZ;
758 f32 rotAngle;
759
761 return;
762 }
763
764 // check for invalid selection
765 if (filemenu_menus[FILE_MENU_MAIN]->selected >= 4) {
766 return;
767 }
768
769 // check if different files are selected
771 return;
772 }
773
774 // do not show while message menu is showing
776 return;
777 }
778
779 switch (filemenu_CopyFromFileIdx) {
780 case 0:
781 startX = 130.0f;
782 startZ = 90.0f;
783 break;
784 case 1:
785 startX = 190.0f;
786 startZ = 90.0f;
787 break;
788 case 2:
789 startX = 130.0f;
790 startZ = 150.0f;
791 break;
792 default:
793 startX = 190.0f;
794 startZ = 150.0f;
795 break;
796 }
797
798 switch (filemenu_menus[FILE_MENU_MAIN]->selected) {
799 case 0:
800 endX = 130.0f;
801 endZ = 90.0f;
802 break;
803 case 1:
804 endX = 190.0f;
805 endZ = 90.0f;
806 break;
807 case 2:
808 endX = 130.0f;
809 endZ = 150.0f;
810 break;
811 default:
812 endX = 190.0f;
813 endZ = 150.0f;
814 break;
815 }
816
817 rotAngle = -atan2(startX, startZ, endX, endZ) - 90.0f;
818
819 gSPViewport(gMainGfxPos++, &D_80249D60);
820
821 guOrthoF(transformMtx, 0.0f, SCREEN_WIDTH, SCREEN_HEIGHT, 0.0f, -100.0f, 100.0f, 1.0f);
823
825 G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_PROJECTION);
826 gSPDisplayList(gMainGfxPos++, filemenu_dl_copyarrow);
827 gDPSetPrimColor(gMainGfxPos++, 0, 0, 0, 0, 0, 128);
828 gDPSetEnvColor(gMainGfxPos++, 0, 0, 0, 0);
829
830 guTranslateF(transformMtx, startX + 4.0f, startZ + 4.0f, 0.0f);
831 guScaleF(tempMtx, -1.0f, 1.0f, 1.0f);
832 guMtxCatF(tempMtx, transformMtx, transformMtx);
833 guRotateF(tempMtx, rotAngle, 0.0f, 0.0f, 1.0f);
834 guMtxCatF(tempMtx, transformMtx, transformMtx);
836
838 G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
839 gSPDisplayList(gMainGfxPos++, D_8024B6F0);
840 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
841
843 guMtxCatF(tempMtx, transformMtx, transformMtx);
845
847 G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
848 gDPSetTileSize(gMainGfxPos++, 1, (gGameStatusPtr->frameCounter * 8) % 512, 0,
849 ((gGameStatusPtr->frameCounter * 8) % 512) + 60, 0);
850 gSPDisplayList(gMainGfxPos++, D_8024B708);
851 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
852 gDPSetPrimColor(gMainGfxPos++, 0, 0, 230, 230, 230, 255);
853 gDPSetEnvColor(gMainGfxPos++, 232, 40, 160, 0);
854
855 guTranslateF(transformMtx, startX, startZ, 0.0f);
856 guScaleF(tempMtx, -1.0f, 1.0f, 1.0f);
857 guMtxCatF(tempMtx, transformMtx, transformMtx);
858 guRotateF(tempMtx, rotAngle, 0.0f, 0.0f, 1.0f);
859 guMtxCatF(tempMtx, transformMtx, transformMtx);
861
863 G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
864 gSPDisplayList(gMainGfxPos++, D_8024B6F0);
865 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
866
868 guMtxCatF(tempMtx, transformMtx, transformMtx);
870
872 G_MTX_PUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
873 gDPSetTileSize(gMainGfxPos++, 1, (gGameStatusPtr->frameCounter * 8) % 512, 0,
874 ((gGameStatusPtr->frameCounter * 8) % 512) + 60, 0);
875 gSPDisplayList(gMainGfxPos++, D_8024B708);
876 gSPPopMatrix(gMainGfxPos++, G_MTX_MODELVIEW);
877}
Mtx matrixStack[0x200]
f32 Matrix4f[4][4]
#define guRotateF
#define guOrthoF
#define guMtxF2L
#define guTranslateF
#define guMtxCatF
#define atan2
#define guScaleF
@ FM_MAIN_SELECT_COPY_TO
Definition filemenu.h:27
@ FILE_MENU_MESSAGE
Definition filemenu.h:19
@ FILE_MENU_MAIN
Definition filemenu.h:17
Gfx D_8024B708[]
f32 CopyArrowAnimOffsets[]
BSS s32 filemenu_CopyFromFileIdx
Vp D_80249D60
Gfx D_8024B6F0[]
Gfx filemenu_dl_copyarrow[]
Definition filemenu_gfx.c:8
u16 gMatrixListPos
Definition main_loop.c:45
DisplayContext * gDisplayContext
Definition cam_main.c:16

◆ func_PAL_8002B574()

void func_PAL_8002B574 ( void )

◆ filemenu_init()

void filemenu_init ( s32 arg0)

Definition at line 882 of file filemenu_common.c.

882 {
883 MenuPanel* menu;
884 s32 i;
885
886 DMA_COPY_SEGMENT(ui_images_filemenu_pause);
887
888 for (i = 0; i < ARRAY_COUNT(filemenu_cursorHudElemID); i++) {
891 }
892
894 if (arg0 == 0) {
896 }
898
901
903
904 if (menu->state == FM_MAIN_SELECT_FILE) {
905 for (i = 0; i < ARRAY_COUNT(filemenu_menus); i++) {
906 if (fio_load_game(i)) {
908 gSaveSlotMetadata[i].hasData = TRUE;
911 } else {
912 gSaveSlotMetadata[i].hasData = FALSE;
913 gSaveSlotMetadata[i].validData = FALSE;
914 memset(gSaveSlotMetadata[i].modName, ARRAY_COUNT(gSaveSlotMetadata[i].modName), 0);
915 }
916 }
917
921 }
923 }
924
926
927 for (i = 0; i < ARRAY_COUNT(filemenu_menus); i++) {
928 menu = filemenu_menus[i];
929 if (menu->fpInit != NULL) {
930 menu->fpInit(menu);
931 }
932 }
934}
WindowBackground background
WindowStyleCustom * customStyle
#define DX_MOD_NAME
Creates the version string that appears on the file select menu.
Definition config.h:7
@ WIN_PAUSE_DECRIPTION
Definition enums.h:5264
@ FM_MAIN_SELECT_FILE
Definition filemenu.h:24
BSS s32 filemenu_cursorHudElem
MenuWindowBP filemenu_common_windowBPs[]
HudScript * filemenu_cursor_hudElemScripts[]
void filemenu_set_selected(MenuPanel *menu, s32 col, s32 row)
b32 fio_load_globals(void)
Definition fio.c:75
b32 fio_load_game(s32 saveSlot)
Definition fio.c:167
SaveGlobals gSaveGlobals
Definition fio.c:20
SaveFileSummary gSaveSlotSummary[4]
SaveSlotMetadata gSaveSlotMetadata[4]
void update_window_hierarchy(s32 windowIndex, u8 arg1)
Definition windows.c:393
void setup_pause_menu_tab(MenuWindowBP *bpArray, s32 arraySize)
Definition windows.c:461
s32 hud_element_create(HudScript *anim)
Creates a new HUD element and returns its ID.
void hud_element_set_flags(s32 id, s32 flags)
Turns on the given flags.
@ HUD_ELEMENT_FLAG_80
Definition hud_element.h:80
@ HUD_ELEMENT_FLAG_DROP_SHADOW
#define DMA_COPY_SEGMENT(segment)
Definition macros.h:525
void(* fpInit)(struct MenuPanel *)
WindowStyle style
SaveFileSummary summary
Definition versioning.h:170
SaveData gCurrentSaveFile
Definition fio.c:21
char modName[28]
Definition versioning.h:145
u32 lastFileSelected
Definition versioning.h:15

Referenced by state_step_file_select().

◆ filemenu_cleanup()

void filemenu_cleanup ( void )

Definition at line 936 of file filemenu_common.c.

936 {
937 MenuPanel* menu;
938 s32 i;
939
940 for (i = 0; i < ARRAY_COUNT(filemenu_cursorHudElemID); i++) {
942 }
943
944 for (i = 0; i < ARRAY_COUNT(filemenu_menus); i++) {
945 menu = filemenu_menus[i];
946 if (menu->initialized) {
947 if (menu->fpCleanup != NULL) {
948 menu->fpCleanup(menu);
949 }
950 }
951 }
952
953 for (i = WIN_FILES_MAIN; i < ARRAY_COUNT(gWindows); i++) {
955 }
956
960}
@ WINDOW_UPDATE_HIDE
Definition enums.h:5312
@ WIN_PAUSE_TUTORIAL
Definition enums.h:5266
s32 func_80244BC4()
void set_window_update(s32 panelID, s32)
Definition windows.c:434
void hud_element_free(s32 id)
void(* fpCleanup)(struct MenuPanel *)

Referenced by state_step_exit_file_select().

◆ func_80244BC4()

s32 func_80244BC4 ( void )

Definition at line 962 of file filemenu_common.c.

962 {
965 && filemenu_menus[FILE_MENU_CONFIRM]->selected == 0)
966 {
967 return 2;
968 } else if (filemenu_menus[FILE_MENU_MAIN]->state == FM_MAIN_SELECT_FILE && filemenu_menus[FILE_MENU_MAIN]->selected < 4) {
969 return 1;
970 } else {
971 return 0;
972 }
973}
@ FILE_MENU_CONFIRM
Definition filemenu.h:18

Referenced by filemenu_cleanup(), state_init_exit_file_select(), and state_step_exit_file_select().

Variable Documentation

◆ HES_AnimatedCursorHand

HudScript HES_AnimatedCursorHand
extern

Definition at line 29 of file menu_hud_scripts.c.

29 {
31 hs_SetCustomSize(16, 16)
34 hs_SetCI(4, ui_pause_cursor_hand)
36 hs_SetCI(8, ui_pause_cursor_hand)
38 hs_End
39};
#define hs_SetCustomSize(arg0, arg1)
#define hs_SetVisible
#define hs_End
#define hs_AddTexelOffsetX(x)
#define hs_Restart
#define hs_Loop
#define hs_SetCI(time, name)

Referenced by pause_init().

◆ filemenu_main_menuBP

MenuPanel filemenu_main_menuBP
extern

Definition at line 331 of file filemenu_main.c.

331 {
332 .initialized = FALSE,
333 .col = 0,
334 .row = 0,
335 .selected = 0,
336 .state = 0,
337 .numCols = 3,
338 .numRows = 3,
339 .numPages = 0,
340 .gridData = filemenu_main_gridData,
341 .fpInit = &filemenu_main_init,
342 .fpHandleInput = &filemenu_main_handle_input,
343 .fpUpdate = &filemenu_main_update,
344 .fpCleanup = &filemenu_main_cleanup
345};
void filemenu_main_cleanup(MenuPanel *menu)
void filemenu_main_handle_input(MenuPanel *menu)
void filemenu_main_init(MenuPanel *menu)
void filemenu_main_update(MenuPanel *menu)
u8 filemenu_main_gridData[]

◆ filemenu_yesno_menuBP

MenuPanel filemenu_yesno_menuBP
extern

Definition at line 70 of file filemenu_yesno.c.

70 {
71 .initialized = FALSE,
72 .col = 0,
73 .row = 0,
74 .selected = 0,
75 .state = 0,
76 .numCols = 1,
77 .numRows = 2,
78 .numPages = 0,
79 .gridData = filemenu_yesno_gridData,
80 .fpInit = &filemenu_yesno_init,
81 .fpHandleInput = &filemenu_yesno_handle_input,
82 .fpUpdate = &filemenu_yesno_update,
83 .fpCleanup = &filemenu_yesno_cleanup
84};
void filemenu_yesno_update(MenuPanel *menu)
u8 filemenu_yesno_gridData[]
void filemenu_yesno_handle_input(MenuPanel *menu)
void filemenu_yesno_cleanup(MenuPanel *menu)
void filemenu_yesno_init(MenuPanel *tab)

◆ filemenu_info_menuBP

MenuPanel filemenu_info_menuBP
extern

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};
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)

◆ filemenu_createfile_menuBP

MenuPanel filemenu_createfile_menuBP
extern

Definition at line 60 of file filemenu_createfile.c.

60 {
61 .initialized = FALSE,
62 .col = 0,
63 .row = 0,
64 .selected = 0,
65 .state = 0,
66 .numCols = 13,
67 .numRows = ROWS,
68 .numPages = 0,
71 .fpHandleInput = &filemenu_choose_name_handle_input,
72 .fpUpdate = &filemenu_choose_name_update,
74};
u8 filemenu_createfile_gridData[]
#define ROWS
void filemenu_choose_name_update(MenuPanel *menu)
void filemenu_choose_name_cleanup(MenuPanel *menu)
void filemenu_choose_name_init(MenuPanel *menu)
void filemenu_choose_name_handle_input(MenuPanel *menu)

◆ filemenu_cursor_hudElemScripts

HudScript* filemenu_cursor_hudElemScripts[] = { &HES_AnimatedCursorHand }

Definition at line 18 of file filemenu_common.c.

HudScript HES_AnimatedCursorHand

Referenced by filemenu_init().

◆ filemenu_menus

◆ filemenu_cursor_posX

s32 filemenu_cursor_posX = SCREEN_WIDTH / 2

◆ filemenu_cursor_posY

s32 filemenu_cursor_posY = -SCREEN_HEIGHT / 2

◆ filemenu_cursor_alpha

s32 filemenu_cursor_alpha = 0

Definition at line 27 of file filemenu_common.c.

Referenced by filemenu_draw_cursor(), and filemenu_update_cursor().

◆ filemenu_cursor_targetX

s32 filemenu_cursor_targetX = SCREEN_WIDTH / 2

Definition at line 28 of file filemenu_common.c.

Referenced by filemenu_set_cursor_goal_pos(), and filemenu_update_cursor().

◆ filemenu_cursor_targetY

s32 filemenu_cursor_targetY = -SCREEN_HEIGHT / 2

Definition at line 29 of file filemenu_common.c.

Referenced by filemenu_set_cursor_goal_pos(), and filemenu_update_cursor().

◆ filemenu_cursorGoalAlpha

s32 filemenu_cursorGoalAlpha = 0

Definition at line 30 of file filemenu_common.c.

Referenced by filemenu_set_cursor_alpha(), and filemenu_update_cursor().

◆ filemenu_cursorGoalAlpha2

s32 filemenu_cursorGoalAlpha2 = 0

Definition at line 31 of file filemenu_common.c.

Referenced by filemenu_set_cursor_alpha(), and filemenu_update_cursor().

◆ D_80249BB0

s32 D_80249BB0 = TRUE

Definition at line 32 of file filemenu_common.c.

Referenced by filemenu_set_cursor_goal_pos().

◆ D_80249BB8

s32 D_80249BB8 = 0

Definition at line 33 of file filemenu_common.c.

Referenced by filemenu_update_cursor().

◆ D_80249BBC

s16 D_80249BBC[16] = { 315, 303, 283, 260, 235, 210, 185, 160, 135, 110, 85, 60, 37, 17, 5, 0 }

Definition at line 34 of file filemenu_common.c.

34{ 315, 303, 283, 260, 235, 210, 185, 160, 135, 110, 85, 60, 37, 17, 5, 0 };

Referenced by func_8024330C().

◆ D_80249BDC

s16 D_80249BDC[16] = { 315, 303, 283, 260, 235, 210, 185, 160, 135, 110, 85, 60, 37, 17, 5, 0 }

Definition at line 35 of file filemenu_common.c.

35{ 315, 303, 283, 260, 235, 210, 185, 160, 135, 110, 85, 60, 37, 17, 5, 0 };

Referenced by filemenu_update_show_name_input().

◆ D_80249BFC

s16 D_80249BFC[16] = { 157, 151, 141, 130, 117, 105, 92, 80, 67, 55, 42, 30, 18, 8, 2, 0 }

Definition at line 36 of file filemenu_common.c.

36{ 157, 151, 141, 130, 117, 105, 92, 80, 67, 55, 42, 30, 18, 8, 2, 0 };

Referenced by filemenu_update_show_options_left().

◆ D_80249C1C

s16 D_80249C1C[16] = { 157, 151, 141, 130, 117, 105, 92, 80, 67, 55, 42, 30, 18, 8, 2, 0 }

Definition at line 37 of file filemenu_common.c.

37{ 157, 151, 141, 130, 117, 105, 92, 80, 67, 55, 42, 30, 18, 8, 2, 0 };

Referenced by filemenu_update_show_options_right().

◆ D_80249C3C

s16 D_80249C3C[16] = { 63, 60, 56, 52, 47, 42, 37, 32, 27, 22, 17, 12, 7, 3, 1, 0 }

Definition at line 38 of file filemenu_common.c.

38{ 63, 60, 56, 52, 47, 42, 37, 32, 27, 22, 17, 12, 7, 3, 1, 0 };

Referenced by filemenu_update_show_options_bottom().

◆ D_80249C5C

s16 D_80249C5C[16] = { 63, 60, 56, 52, 47, 42, 37, 32, 27, 22, 17, 12, 7, 3, 1, 0 }

Definition at line 39 of file filemenu_common.c.

39{ 63, 60, 56, 52, 47, 42, 37, 32, 27, 22, 17, 12, 7, 3, 1, 0 };

Referenced by filemenu_update_show_title().

◆ D_80249C7C

s16 D_80249C7C[10] = { -5, -17, -37, -60, -85, -110, -135, -160, -185, -210 }

Definition at line 40 of file filemenu_common.c.

40{ -5, -17, -37, -60, -85, -110, -135, -160, -185, -210 };

Referenced by func_802435C4().

◆ D_80249C90

s16 D_80249C90[10] = { -5, -17, -37, -60, -85, -110, -135, -160, -185, -210 }

Definition at line 41 of file filemenu_common.c.

41{ -5, -17, -37, -60, -85, -110, -135, -160, -185, -210 };

Referenced by filemenu_update_hidden_name_input().

◆ D_80249CA4

s16 D_80249CA4[10] = { -2, -8, -18, -30, -42, -55, -70, -85, -100, -115 }

Definition at line 42 of file filemenu_common.c.

42{ -2, -8, -18, -30, -42, -55, -70, -85, -100, -115 };

Referenced by filemenu_update_hidden_options_left().

◆ D_80249CB8

s16 D_80249CB8[10] = { -2, -8, -18, -30, -42, -55, -70, -85, -100, -115 }

Definition at line 43 of file filemenu_common.c.

43{ -2, -8, -18, -30, -42, -55, -70, -85, -100, -115 };

Referenced by filemenu_update_hidden_options_right().

◆ D_80249CCC

s16 D_80249CCC[10] = { -1, -3, -7, -12, -17, -22, -27, -32, -37, -42 }

Definition at line 44 of file filemenu_common.c.

44{ -1, -3, -7, -12, -17, -22, -27, -32, -37, -42 };

Referenced by filemenu_update_hidden_title().

◆ D_80249CE0

s16 D_80249CE0[10] = { -1, -3, -7, -12, -17, -22, -27, -32, -37, -42 }

Definition at line 45 of file filemenu_common.c.

45{ -1, -3, -7, -12, -17, -22, -27, -32, -37, -42 };

Referenced by filemenu_update_hidden_options_bottom().

◆ D_80249CF4

s16 D_80249CF4[16] = { 180, 173, 161, 148, 134, 120, 105, 91, 77, 62, 48, 34, 21, 9, 2, 0 }

Definition at line 46 of file filemenu_common.c.

46{ 180, 173, 161, 148, 134, 120, 105, 91, 77, 62, 48, 34, 21, 9, 2, 0 };

Referenced by filemenu_update_show_with_rotation().

◆ D_80249D14

s16 D_80249D14[16] = { 0, 2, 9, 21, 34, 48, 62, 77, 91, 105, 120, 134, 148, 161, 173, 180 }

Definition at line 47 of file filemenu_common.c.

47{ 0, 2, 9, 21, 34, 48, 62, 77, 91, 105, 120, 134, 148, 161, 173, 180 };

Referenced by filemenu_update_hidden_with_rotation().

◆ D_80249D34

s16 D_80249D34[10] = { 185, 160, 135, 110, 85, 60, 37, 17, 5, 0 }

Definition at line 48 of file filemenu_common.c.

48{ 185, 160, 135, 110, 85, 60, 37, 17, 5, 0 };

Referenced by filemenu_update_show_name_confirm().

◆ D_80249D48

s16 D_80249D48[10] = { 0, 5, 17, 37, 60, 85, 110, 135, 160, 185}

Definition at line 49 of file filemenu_common.c.

49{ 0, 5, 17, 37, 60, 85, 110, 135, 160, 185};

Referenced by filemenu_update_hidden_name_confirm().

◆ D_80249D60

Vp D_80249D60
Initial value:
= {
.vp = {
.vscale = { 640, 480, 511, 0},
.vtrans = { 640, 480, 511, 0},
}
}

Definition at line 51 of file filemenu_common.c.

51 {
52 .vp = {
53 .vscale = { 640, 480, 511, 0},
54 .vtrans = { 640, 480, 511, 0},
55 }
56};

Referenced by filemenu_draw_contents_copy_arrow().

◆ CopyArrowAnimOffsets

f32 CopyArrowAnimOffsets[]
Initial value:
= {
7.0f, 12.5f, 13.0f, 14.5f, 14.0f,
13.0f, 11.5f, 9.5f, 7.5f, 5.5f,
3.5f, 2.0f, 1.0f, 0.5f, 0.0f
}

Definition at line 57 of file filemenu_common.c.

57 {
58 7.0f, 12.5f, 13.0f, 14.5f, 14.0f,
59 13.0f, 11.5f, 9.5f, 7.5f, 5.5f,
60 3.5f, 2.0f, 1.0f, 0.5f, 0.0f
61};

Referenced by filemenu_draw_contents_copy_arrow().

◆ filemenu_common_windowBPs

MenuWindowBP filemenu_common_windowBPs[]

Definition at line 63 of file filemenu_common.c.

63 {
64 {
65 .windowID = WIN_FILES_MAIN,
66 .pos = {
67 .x = 16,
68 .y = 24,
69 },
70 .width = 288,
71 .height = 192,
72 .priority = WINDOW_PRIORITY_0,
73 .fpDrawContents = NULL,
74 .tab = NULL,
75 .parentID = -1,
76 .fpUpdate = { WINDOW_UPDATE_SHOW },
77 .extraFlags = WINDOW_FLAG_40,
78 .style = { .customStyle = &filemenu_windowStyles[0] },
79 },
80 {
81 .windowID = WIN_FILES_COPYARROW,
82 .pos = {
83 .x = 0,
84 .y = 0,
85 },
86 .width = 288,
87 .height = 192,
88 .priority = WINDOW_PRIORITY_0,
89 .fpDrawContents = filemenu_draw_contents_copy_arrow,
90 .tab = NULL,
91 .parentID = WIN_FILES_MAIN,
92 .fpUpdate = { WINDOW_UPDATE_SHOW } ,
93 .extraFlags = 0,
94 .style = { .customStyle = &filemenu_windowStyles[1] },
95 },
96 {
97 .windowID = WIN_FILES_CURSOR,
98 .pos = {
99 .x = 0,
100 .y = 0,
101 },
102 .width = 320,
103 .height = 240,
104 .priority = WINDOW_PRIORITY_0,
105 .fpDrawContents = filemenu_draw_cursor,
106 .tab = NULL,
107 .parentID = -1,
108 .fpUpdate = { WINDOW_UPDATE_SHOW },
109 .extraFlags = 0,
110 .style = { .customStyle = &filemenu_windowStyles[1] },
111 },
112};
@ WINDOW_PRIORITY_0
Definition enums.h:3182
@ WINDOW_UPDATE_SHOW
Definition enums.h:5311
@ WINDOW_FLAG_40
Definition enums.h:4999
@ WIN_FILES_CURSOR
Definition enums.h:5265
@ WIN_FILES_COPYARROW
Definition enums.h:5267
WindowStyleCustom filemenu_windowStyles[]
void filemenu_draw_cursor(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
void filemenu_draw_contents_copy_arrow(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)

Referenced by filemenu_init().

◆ filemenu_dl_copyarrow

Gfx filemenu_dl_copyarrow[]
extern

Definition at line 8 of file filemenu_gfx.c.

8 {
9 gsDPPipeSync(),
10 gsSPTexture(0xFFFF, 0xFFFF, 0, G_TX_RENDERTILE, G_ON),
11 gsDPSetCycleType(G_CYC_2CYCLE),
12 gsDPSetTexturePersp(G_TP_NONE),
13 gsDPSetTextureDetail(G_TD_CLAMP),
14 gsDPSetTextureLOD(G_TL_TILE),
15 gsDPSetTextureLUT(G_TT_NONE),
16 gsDPSetTextureFilter(G_TF_BILERP),
17 gsDPSetTextureConvert(G_TC_FILT),
18 gsDPSetRenderMode(G_RM_PASS, G_RM_CLD_SURF2),
19 gsDPSetCombineMode(G_CC_DECALRGBA, PM_CC_33),
20 gsDPSetTextureLUT(G_TT_NONE),
21 gsDPLoadTextureTile_4b(D_8024A200, G_IM_FMT_IA, 64, 16, 0, 0, 63, 15, 0, G_TX_NOMIRROR | G_TX_CLAMP, G_TX_MIRROR | G_TX_WRAP, 6, 4, G_TX_NOLOD, G_TX_NOLOD),
22 gsSPClearGeometryMode(G_ZBUFFER | G_SHADE | G_CULL_BOTH | G_FOG | G_LIGHTING | G_TEXTURE_GEN | G_TEXTURE_GEN_LINEAR | G_LOD | G_SHADING_SMOOTH | G_CLIPPING | 0x0040F9FA),
23 gsSPSetGeometryMode(G_SHADE | G_SHADING_SMOOTH),
24 gsSPEndDisplayList(),
25};
#define PM_CC_33
Definition macros.h:387

Referenced by filemenu_draw_contents_copy_arrow().

◆ D_8024B6F0

Gfx D_8024B6F0[]
extern

Definition at line 37 of file filemenu_gfx.c.

37 {
38 gsSPVertex(D_8024B6B0, 2, 0),
39 gsDPPipeSync(),
40 gsSPEndDisplayList(),
41};
Vtx D_8024B6B0[]

Referenced by filemenu_draw_contents_copy_arrow().

◆ D_8024B708

Gfx D_8024B708[]
extern

Definition at line 43 of file filemenu_gfx.c.

43 {
44 gsSPVertex(D_8024B6D0, 2, 2),
45 gsSP2Triangles(0, 1, 2, 0, 0, 2, 3, 0),
46 gsDPPipeSync(),
47 gsSPEndDisplayList(),
48};
Vtx D_8024B6D0[]

Referenced by filemenu_draw_contents_copy_arrow().

◆ filemenu_CopyToFileIdx

BSS s32 filemenu_CopyToFileIdx

◆ filemenu_pressedButtons

◆ filemenu_cursorHudElem

BSS s32 filemenu_cursorHudElem

Definition at line 120 of file filemenu_common.c.

Referenced by filemenu_init().

◆ filemenu_heldButtons

◆ filemenu_filename_pos

◆ filemenu_CopyFromFileIdx

◆ filemenu_currentMenu

◆ filemenu_8024C09C

BSS s32 filemenu_8024C09C

Definition at line 125 of file filemenu_common.c.

◆ filemenu_cursorHudElemID

BSS s32 filemenu_cursorHudElemID[1]

Definition at line 126 of file filemenu_common.c.

Referenced by filemenu_cleanup(), filemenu_draw_cursor(), and filemenu_init().

◆ filemenu_8024C0A4

BSS s32 filemenu_8024C0A4[3]

Definition at line 127 of file filemenu_common.c.

◆ filemenu_hudElemIDs

◆ filemenu_createfile_hudElems