Paper Mario DX
Paper Mario (N64) modding
 
Loading...
Searching...
No Matches
filemenu_info.c
Go to the documentation of this file.
1#include "common.h"
2#include "filemenu.h"
3#include "hud_element.h"
4
5#if VERSION_PAL
6extern u8 D_filemenu_802508FC[];
7extern u8 D_filemenu_80250934[];
8extern u8 D_filemenu_80250948[];
9extern u8 D_filemenu_8025094C[];
10extern s8 D_filemenu_80250950[];
11extern u8 D_filemenu_80250968[];
12#endif
13
14#if VERSION_IQUE
15#define CREATE_SUCCESS_NUMBER_X 49
16#define NUMBER_OFFSET_Y 1
17#else
18#define NUMBER_OFFSET_Y 0
19#define CREATE_SUCCESS_NUMBER_X 48
20#endif
21
23 0, 0, 0, 0
24};
25
27 {
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};
42
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};
58
60 MenuPanel* menu,
61 s32 baseX, s32 baseY,
62 s32 width, s32 height,
63 s32 opacity, s32 darkening
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}
137
139 s32 i;
140
141 for (i = 0; i < ARRAY_COUNT(filemenu_info_windowBPs); i++) {
143 }
144
146 tab->initialized = TRUE;
147}
148
172
175
178
@ DRAW_NUMBER_STYLE_ALIGN_RIGHT
drawn to the left of posX
Definition enums.h:5393
@ DRAW_NUMBER_STYLE_MONOSPACE
Definition enums.h:5394
@ BUTTON_A
Definition enums.h:2790
@ BUTTON_B
Definition enums.h:2789
@ WINDOW_PRIORITY_64
Definition enums.h:3188
@ MSG_PAL_WHITE
Definition enums.h:5405
@ WINDOW_UPDATE_HIDE
Definition enums.h:5312
@ 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
@ 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
WindowStyleCustom filemenu_windowStyles[]
@ FM_MESSAGE_COPIED
Definition filemenu.h:35
@ FM_MESSAGE_CREATED
Definition filemenu.h:36
@ FM_MESSAGE_DELETED
Definition filemenu.h:34
s8 filemenu_currentMenu
void filemenu_draw_message(u8 *, s32, s32, s32, s32, u32)
MenuPanel * filemenu_menus[]
s32 filemenu_CopyFromFileIdx
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)
s32 filemenu_CopyToFileIdx
@ FILE_MENU_CONFIRM
Definition filemenu.h:18
@ FILE_MENU_MESSAGE
Definition filemenu.h:19
@ FILE_MENU_MAIN
Definition filemenu.h:17
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
u8 filemenu_info_gridData[]
void filemenu_info_handle_input(MenuPanel *menu)
void filemenu_info_draw_message_contents(MenuPanel *menu, s32 baseX, s32 baseY, s32 width, s32 height, s32 opacity, s32 darkening)
#define NUMBER_OFFSET_Y
void filemenu_info_cleanup(MenuPanel *menu)
#define CREATE_SUCCESS_NUMBER_X
MenuWindowBP filemenu_info_windowBPs[]
void filemenu_info_update(MenuPanel *menu)
MenuPanel filemenu_info_menuBP
void filemenu_info_init(MenuPanel *tab)
void set_window_update(s32 panelID, s32)
Definition windows.c:434
void setup_pause_menu_tab(MenuWindowBP *bpArray, s32 arraySize)
Definition windows.c:461
void filemenu_set_cursor_alpha(s32 arg0)
u8 * filemenu_get_menu_message(s32 idx)
void filemenu_set_selected(MenuPanel *menu, s32 col, s32 row)
void draw_number(s32 value, s32 x, s32 y, s32 variableWidthChars, s32 palette, s32 opacity, u16 style)
Definition msg.c:2223
#define ARRAY_COUNT(arr)
Definition macros.h:40
MenuPanel * tab
#define gCurrentLanguage
Definition variables.h:115