diff --git a/src/game/data/data_02a0e0.c b/src/game/data/data_02a0e0.c index a2ed51c88..7403df692 100644 --- a/src/game/data/data_02a0e0.c +++ b/src/game/data/data_02a0e0.c @@ -1384,14 +1384,14 @@ struct menudialog g_MpChangeTeamNameMenuDialog = { // 2be50 struct menuitem g_MpTeamNamesMenuItems[] = { - { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(8), (u32)&func0f17e288, menuhandlerMpTeamNameSlot }, // "Red" - { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(9), (u32)&func0f17e288, menuhandlerMpTeamNameSlot }, // "Yellow" - { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(10), (u32)&func0f17e288, menuhandlerMpTeamNameSlot }, // "Blue" - { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(11), (u32)&func0f17e288, menuhandlerMpTeamNameSlot }, // "Magenta" - { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(12), (u32)&func0f17e288, menuhandlerMpTeamNameSlot }, // "Cyan" - { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(13), (u32)&func0f17e288, menuhandlerMpTeamNameSlot }, // "Orange" - { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(14), (u32)&func0f17e288, menuhandlerMpTeamNameSlot }, // "Pink" - { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(15), (u32)&func0f17e288, menuhandlerMpTeamNameSlot }, // "Brown" + { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(8), (u32)&mpMenuTextTeamName, menuhandlerMpTeamNameSlot }, // "Red" + { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(9), (u32)&mpMenuTextTeamName, menuhandlerMpTeamNameSlot }, // "Yellow" + { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(10), (u32)&mpMenuTextTeamName, menuhandlerMpTeamNameSlot }, // "Blue" + { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(11), (u32)&mpMenuTextTeamName, menuhandlerMpTeamNameSlot }, // "Magenta" + { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(12), (u32)&mpMenuTextTeamName, menuhandlerMpTeamNameSlot }, // "Cyan" + { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(13), (u32)&mpMenuTextTeamName, menuhandlerMpTeamNameSlot }, // "Orange" + { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(14), (u32)&mpMenuTextTeamName, menuhandlerMpTeamNameSlot }, // "Pink" + { MENUITEMTYPE_SELECTABLE, 0, 0x00020000, L_OPTIONS(15), (u32)&mpMenuTextTeamName, menuhandlerMpTeamNameSlot }, // "Brown" { MENUITEMTYPE_SEPARATOR, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, { MENUITEMTYPE_SELECTABLE, 0, 0x00000008, L_MPMENU(60), 0x00000000, NULL }, // "Back" { MENUITEMTYPE_END, 0, 0x00000000, 0x00000000, 0x00000000, NULL }, diff --git a/src/game/mplayer/setup.c b/src/game/mplayer/setup.c index f57d63b6f..e2d86aa40 100644 --- a/src/game/mplayer/setup.c +++ b/src/game/mplayer/setup.c @@ -4746,18 +4746,18 @@ glabel menuhandler0017e06c /* f17e284: 00001025 */ or $v0,$zero,$zero ); -GLOBAL_ASM( -glabel func0f17e288 -/* f17e288: 8c830008 */ lw $v1,0x8($a0) -/* f17e28c: 3c0f800b */ lui $t7,%hi(g_MpSetup+0x28) -/* f17e290: 25efcbb0 */ addiu $t7,$t7,%lo(g_MpSetup+0x28) -/* f17e294: 2463a9f8 */ addiu $v1,$v1,-22024 -/* f17e298: 00037080 */ sll $t6,$v1,0x2 -/* f17e29c: 01c37023 */ subu $t6,$t6,$v1 -/* f17e2a0: 000e7080 */ sll $t6,$t6,0x2 -/* f17e2a4: 03e00008 */ jr $ra -/* f17e2a8: 01cf1021 */ addu $v0,$t6,$t7 -); +/** + * item->param2 is a text ID for that team's colour. The text IDs for team + * colours are consecutive, so the index of the team is determined by + * subtracting the first team's colour text ID. + */ +char *mpMenuTextTeamName(struct menuitem *item) +{ + s32 index = item->param2; + index -= L_OPTIONS(8); + + return g_MpSetupSaveFile.teamnames[index]; +} s32 menuhandlerMpTeamNameSlot(u32 operation, struct menuitem *item, union handlerdata *data) { diff --git a/src/include/game/mplayer/setup.h b/src/include/game/mplayer/setup.h index 3e80bdc80..a950b257e 100644 --- a/src/include/game/mplayer/setup.h +++ b/src/include/game/mplayer/setup.h @@ -53,7 +53,7 @@ char *mpMenuTextSelectTuneOrTunes(struct menuitem *item); s32 menuhandler0017dc84(u32 operation, struct menuitem *item, union handlerdata *data); char *mpMenuTextCurrentTrack(struct menuitem *item); s32 menuhandler0017e06c(u32 operation, struct menuitem *item, union handlerdata *data); -u32 func0f17e288(void); +char *mpMenuTextTeamName(struct menuitem *item); char *func0f17e318(struct menudialog *dialog); s32 menudialog0017e3fc(u32 operation, struct menudialog *dialog, union handlerdata *data); s32 menuhandler0017e4d4(u32 operation, struct menuitem *item, union handlerdata *data);