Optimized so it only changes forms when moving items.
This commit is contained in:
parent
b60aab1f6a
commit
0fd9d2c0d5
1 changed files with 19 additions and 1 deletions
|
@ -3799,9 +3799,16 @@ static void GiveChosenBagItem(void)
|
||||||
{
|
{
|
||||||
u8 pos = GetCursorPosition();
|
u8 pos = GetCursorPosition();
|
||||||
if (sInPartyMenu)
|
if (sInPartyMenu)
|
||||||
|
{
|
||||||
|
struct Pokemon *mon = &gPlayerParty[pos];
|
||||||
SetMonData(&gPlayerParty[pos], MON_DATA_HELD_ITEM, &itemId);
|
SetMonData(&gPlayerParty[pos], MON_DATA_HELD_ITEM, &itemId);
|
||||||
|
SetMonFormPSS(&mon->box);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
SetCurrentBoxMonData(pos, MON_DATA_HELD_ITEM, &itemId);
|
SetCurrentBoxMonData(pos, MON_DATA_HELD_ITEM, &itemId);
|
||||||
|
SetMonFormPSS(&gPokemonStoragePtr->boxes[StorageGetCurrentBox()][pos]);
|
||||||
|
}
|
||||||
|
|
||||||
RemoveBagItem(itemId, 1);
|
RemoveBagItem(itemId, 1);
|
||||||
}
|
}
|
||||||
|
@ -7020,7 +7027,6 @@ static void SetDisplayMonData(void *pokemon, u8 mode)
|
||||||
StringCopyPadded(sStorage->displayMonItemName, ItemId_GetName(sStorage->displayMonItemId), CHAR_SPACE, 8);
|
StringCopyPadded(sStorage->displayMonItemName, ItemId_GetName(sStorage->displayMonItemId), CHAR_SPACE, 8);
|
||||||
else
|
else
|
||||||
StringFill(sStorage->displayMonItemName, CHAR_SPACE, 8);
|
StringFill(sStorage->displayMonItemName, CHAR_SPACE, 8);
|
||||||
SetMonFormPSS(pokemon);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8860,11 +8866,14 @@ static void TakeItemFromMon(u8 cursorArea, u8 cursorPos)
|
||||||
{
|
{
|
||||||
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &itemId);
|
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &itemId);
|
||||||
SetBoxMonIconObjMode(cursorPos, 1);
|
SetBoxMonIconObjMode(cursorPos, 1);
|
||||||
|
SetMonFormPSS(&gPokemonStoragePtr->boxes[StorageGetCurrentBox()][cursorPos]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
struct Pokemon *mon = &gPlayerParty[cursorPos];
|
||||||
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &itemId);
|
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &itemId);
|
||||||
SetPartyMonIconObjMode(cursorPos, 1);
|
SetPartyMonIconObjMode(cursorPos, 1);
|
||||||
|
SetMonFormPSS(&mon->box);
|
||||||
}
|
}
|
||||||
|
|
||||||
sStorage->movingItemId = sStorage->displayMonItemId;
|
sStorage->movingItemId = sStorage->displayMonItemId;
|
||||||
|
@ -8899,12 +8908,15 @@ static void SwapItemsWithMon(u8 cursorArea, u8 cursorPos)
|
||||||
itemId = GetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM);
|
itemId = GetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM);
|
||||||
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sStorage->movingItemId);
|
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sStorage->movingItemId);
|
||||||
sStorage->movingItemId = itemId;
|
sStorage->movingItemId = itemId;
|
||||||
|
SetMonFormPSS(&gPokemonStoragePtr->boxes[StorageGetCurrentBox()][cursorPos]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
struct Pokemon *mon = &gPlayerParty[cursorPos];
|
||||||
itemId = GetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM);
|
itemId = GetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM);
|
||||||
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sStorage->movingItemId);
|
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sStorage->movingItemId);
|
||||||
sStorage->movingItemId = itemId;
|
sStorage->movingItemId = itemId;
|
||||||
|
SetMonFormPSS(&mon->box);
|
||||||
}
|
}
|
||||||
|
|
||||||
id = GetItemIconIdxByPosition(CURSOR_AREA_IN_HAND, 0);
|
id = GetItemIconIdxByPosition(CURSOR_AREA_IN_HAND, 0);
|
||||||
|
@ -8926,11 +8938,14 @@ static void GiveItemToMon(u8 cursorArea, u8 cursorPos)
|
||||||
{
|
{
|
||||||
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sStorage->movingItemId);
|
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &sStorage->movingItemId);
|
||||||
SetBoxMonIconObjMode(cursorPos, 0);
|
SetBoxMonIconObjMode(cursorPos, 0);
|
||||||
|
SetMonFormPSS(&gPokemonStoragePtr->boxes[StorageGetCurrentBox()][cursorPos]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
struct Pokemon *mon = &gPlayerParty[cursorPos];
|
||||||
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sStorage->movingItemId);
|
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &sStorage->movingItemId);
|
||||||
SetPartyMonIconObjMode(cursorPos, 0);
|
SetPartyMonIconObjMode(cursorPos, 0);
|
||||||
|
SetMonFormPSS(&mon->box);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8950,11 +8965,14 @@ static void MoveItemFromMonToBag(u8 cursorArea, u8 cursorPos)
|
||||||
{
|
{
|
||||||
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &itemId);
|
SetCurrentBoxMonData(cursorPos, MON_DATA_HELD_ITEM, &itemId);
|
||||||
SetBoxMonIconObjMode(cursorPos, 1);
|
SetBoxMonIconObjMode(cursorPos, 1);
|
||||||
|
SetMonFormPSS(&gPokemonStoragePtr->boxes[StorageGetCurrentBox()][cursorPos]);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
struct Pokemon *mon = &gPlayerParty[cursorPos];
|
||||||
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &itemId);
|
SetMonData(&gPlayerParty[cursorPos], MON_DATA_HELD_ITEM, &itemId);
|
||||||
SetPartyMonIconObjMode(cursorPos, 1);
|
SetPartyMonIconObjMode(cursorPos, 1);
|
||||||
|
SetMonFormPSS(&mon->box);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue