forked from Ports/perfect_dark
Merge pull request #501 from jonaeru/port-mpcopysimulantmenu
Add "Copy Simulant" mp menu
This commit is contained in:
4 files changed
+49
No files matched your search
@@ -3146,6 +3146,21 @@ void mpRemoveSimulant(s32 index)
|
||||
mpGenerateBotNames();
|
||||
}
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
void mpCopySimulant(s32 index)
|
||||
{
|
||||
s32 dest = mpGetSlotForNewBot();
|
||||
|
||||
g_MpSetup.chrslots |= 1 << (dest + 4);
|
||||
g_BotConfigsArray[dest].base.name[0] = g_BotConfigsArray[index].base.name[0];
|
||||
g_BotConfigsArray[dest].base.mpheadnum = g_BotConfigsArray[index].base.mpheadnum;
|
||||
g_BotConfigsArray[dest].base.mpbodynum = g_BotConfigsArray[index].base.mpbodynum;
|
||||
g_BotConfigsArray[dest].type = g_BotConfigsArray[index].type;
|
||||
g_BotConfigsArray[dest].difficulty = g_BotConfigsArray[index].difficulty;
|
||||
mpGenerateBotNames();
|
||||
}
|
||||
#endif
|
||||
|
||||
bool mpHasSimulants(void)
|
||||
{
|
||||
if ((g_MpSetup.chrslots & 0xfff0) != 0) {
|
||||
|
||||
@@ -2933,6 +2933,24 @@ MenuItemHandlerResult menuhandlerMpDeleteSimulant(s32 operation, struct menuitem
|
||||
return 0;
|
||||
}
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
MenuItemHandlerResult menuhandlerMpCopySimulant(s32 operation, struct menuitem *item, union handlerdata *data)
|
||||
{
|
||||
switch (operation) {
|
||||
case MENUOP_SET:
|
||||
mpCopySimulant(g_Menus[g_MpPlayerNum].mpsetup.slotindex);
|
||||
menuPopDialog();
|
||||
break;
|
||||
case MENUOP_CHECKDISABLED:
|
||||
if (mpHasUnusedBotSlots() == 0) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
char *mpMenuTitleEditSimulant(struct menudialogdef *dialogdef)
|
||||
{
|
||||
sprintf(g_StringPointer, "%s", &g_BotConfigsArray[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.name);
|
||||
@@ -3151,6 +3169,16 @@ struct menuitem g_MpEditSimulantMenuItems[] = {
|
||||
0,
|
||||
NULL,
|
||||
},
|
||||
#ifndef PLATFORM_N64
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
0,
|
||||
MENUITEMFLAG_LOCKABLEMINOR | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"Copy Simulant\n",
|
||||
0,
|
||||
menuhandlerMpCopySimulant,
|
||||
},
|
||||
#endif
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
0,
|
||||
|
||||
@@ -90,6 +90,9 @@ void mpCreateBotFromProfile(s32 botnum, u8 difficulty);
|
||||
void mpSetBotDifficulty(s32 botnum, s32 difficulty);
|
||||
s32 mpGetSlotForNewBot(void);
|
||||
void mpRemoveSimulant(s32 index);
|
||||
#ifndef PLATFORM_N64
|
||||
void mpCopySimulant(s32 index);
|
||||
#endif
|
||||
bool mpHasSimulants(void);
|
||||
bool mpHasUnusedBotSlots(void);
|
||||
bool mpIsSimSlotEnabled(s32 slot);
|
||||
|
||||
@@ -144,6 +144,9 @@ MenuDialogHandlerResult menudialogMpSimulant(s32 operation, struct menudialogdef
|
||||
MenuItemHandlerResult menuhandlerMpSimulantHead(s32 operation, struct menuitem *item, union handlerdata *data);
|
||||
MenuItemHandlerResult menuhandlerMpSimulantBody(s32 operation, struct menuitem *item, union handlerdata *data);
|
||||
MenuItemHandlerResult menuhandlerMpDeleteSimulant(s32 operation, struct menuitem *item, union handlerdata *data);
|
||||
#ifndef PLATFORM_N64
|
||||
MenuItemHandlerResult menuhandlerMpCopySimulant(s32 operation, struct menuitem *item, union handlerdata *data);
|
||||
#endif
|
||||
MenuItemHandlerResult menuhandlerMpChangeSimulantType(s32 operation, struct menuitem *item, union handlerdata *data);
|
||||
MenuItemHandlerResult menuhandlerMpClearAllSimulants(s32 operation, struct menuitem *item, union handlerdata *data);
|
||||
MenuItemHandlerResult menuhandlerMpAddSimulant(s32 operation, struct menuitem *item, union handlerdata *data);
|
||||
|
||||
Reference in new issue
Block a user