diff options
author | Cameron Hall <cameronghall@cox.net> | 2018-02-15 01:36:03 -0600 |
---|---|---|
committer | Cameron Hall <cameronghall@cox.net> | 2018-02-15 01:36:03 -0600 |
commit | e58c4ac922c10a2e7c06e1c3d27a95cf51361cb5 (patch) | |
tree | 6fdebecd8f9bac832cfff1f78a6abc7dc55ba207 /src | |
parent | aaa67d9f274611bc0a1eb1a28409e36756417c24 (diff) |
ItemId_GetItem -> ItemId_GetName
Diffstat (limited to 'src')
-rw-r--r-- | src/battle/battle_2.c | 2 | ||||
-rw-r--r-- | src/debug/start_menu_debug.c | 2 | ||||
-rw-r--r-- | src/field/item.c | 26 | ||||
-rw-r--r-- | src/field/item_menu.c | 6 | ||||
-rw-r--r-- | src/field/pokeblock.c | 4 | ||||
-rw-r--r-- | src/field/tv.c | 10 | ||||
-rw-r--r-- | src/pokemon/pokemon_storage_system_4.c | 2 | ||||
-rw-r--r-- | src/pokemon/pokemon_summary_screen.c | 2 | ||||
-rw-r--r-- | src/scene/berry_blender.c | 1 |
9 files changed, 37 insertions, 18 deletions
diff --git a/src/battle/battle_2.c b/src/battle/battle_2.c index 75d66ae9b..d28ef6713 100644 --- a/src/battle/battle_2.c +++ b/src/battle/battle_2.c @@ -2306,7 +2306,7 @@ void debug_sub_8011EA0(u8 a) Text_PrintWindow8002F44(&gUnknown_Debug_03004370); gBattleTextBuff1[0] = EOS; if (gUnknown_Debug_2023A76[gUnknown_Debug_03004360][a] != 0) - StringAppend(gBattleTextBuff1, ItemId_GetItem(gUnknown_Debug_2023A76[gUnknown_Debug_03004360][a])->name); + StringAppend(gBattleTextBuff1, ItemId_GetName(gUnknown_Debug_2023A76[gUnknown_Debug_03004360][a])); else StringAppend(gBattleTextBuff1, Str_821F624); Text_InitWindow( diff --git a/src/debug/start_menu_debug.c b/src/debug/start_menu_debug.c index 4690368d8..04bfb30d1 100644 --- a/src/debug/start_menu_debug.c +++ b/src/debug/start_menu_debug.c @@ -3184,7 +3184,7 @@ void DebugMenu_8077EE0() " mov r2, #0x11\n" " bl Menu_PrintText\n" " add r0, r4, #0\n" - " bl ItemId_GetItem\n" + " bl ItemId_GetName\n" " mov r1, #0x8\n" " mov r2, #0x11\n" " bl Menu_PrintText\n" diff --git a/src/field/item.c b/src/field/item.c index 78f5ce12d..ba294a1ca 100644 --- a/src/field/item.c +++ b/src/field/item.c @@ -8,6 +8,24 @@ #include "string_util.h" #include "strings.h" +struct Item +{ + u8 name[14]; + u16 itemId; + u16 price; + u8 holdEffect; + u8 holdEffectParam; + const u8 *description; + u8 importance; + u8 unk19; + u8 pocket; + u8 type; + ItemUseFunc fieldUseFunc; + u8 battleUsage; + ItemUseFunc battleUseFunc; + u8 secondaryId; +}; + extern u8 gUnknown_02038560; extern struct BagPocket gBagPockets[NUM_BAG_POCKETS]; @@ -49,7 +67,9 @@ void CopyItemName(u16 itemId, u8 *string) StringAppend(string, gOtherText_Berry2); } else - StringCopy(string, ItemId_GetItem(itemId)->name); + { + StringCopy(string, ItemId_GetName(itemId)); + } } //Unreferenced @@ -579,9 +599,9 @@ static u16 SanitizeItemId(u16 itemId) return itemId; } -const struct Item *ItemId_GetItem(u16 itemId) +const u8 *ItemId_GetName(u16 itemId) { - return &gItems[SanitizeItemId(itemId)]; + return gItems[SanitizeItemId(itemId)].name; } u16 ItemId_GetId(u16 itemId) diff --git a/src/field/item_menu.c b/src/field/item_menu.c index ae1465fbd..9fa3fd6cb 100644 --- a/src/field/item_menu.c +++ b/src/field/item_menu.c @@ -1612,7 +1612,7 @@ static void sub_80A4380(u16 a, int b, int c, int d) r5 = i * 2 + 2; text = gStringVar1; text = sub_80A425C(a, text, i); - text = sub_8072C74(text, ItemId_GetItem(gCurrentBagPocketItemSlots[r4].itemId)->name, 0x66, 0); + text = sub_8072C74(text, ItemId_GetName(gCurrentBagPocketItemSlots[r4].itemId), 0x66, 0); *text++ = CHAR_MULT_SIGN; sub_8072C14(text, gCurrentBagPocketItemSlots[r4].quantity, 0x78, 1); Menu_PrintText(gStringVar1, 14, r5); @@ -1636,9 +1636,9 @@ static void sub_80A444C(u16 a, int b, int c, int d) text = gStringVar1; text = sub_80A425C(a, text, i); #if ENGLISH - sub_8072C74(text, ItemId_GetItem(gCurrentBagPocketItemSlots[r4].itemId)->name, 0x60, 0); + sub_8072C74(text, ItemId_GetName(gCurrentBagPocketItemSlots[r4].itemId), 0x60, 0); #else - sub_8072C74(text, ItemId_GetItem(gCurrentBagPocketItemSlots[r4].itemId)->name, 0x63, 0); + sub_8072C74(text, ItemId_GetName(gCurrentBagPocketItemSlots[r4].itemId), 0x63, 0); #endif Menu_PrintText(gStringVar1, 14, r5); if (gUnknown_02038558 != 0) diff --git a/src/field/pokeblock.c b/src/field/pokeblock.c index aa6539e91..6804f55d6 100644 --- a/src/field/pokeblock.c +++ b/src/field/pokeblock.c @@ -462,7 +462,7 @@ void debug_sub_8120F98(void) static void sub_810BB0C(void) { BasicInitMenuWindow(&gWindowTemplate_81E6E34); - sub_8072BD8(ItemId_GetItem(ITEM_POKEBLOCK_CASE)->name, 2, 1, 0x48); + sub_8072BD8(ItemId_GetName(ITEM_POKEBLOCK_CASE), 2, 1, 0x48); } static void sub_810BB30(void) @@ -481,7 +481,7 @@ static void sub_810BB88(u8 a0) u8 y; u8 *buf; BasicInitMenuWindow(&gWindowTemplate_81E6E34); - for (i=a0; i<=a0+8; i++) + for (i = a0; i <= a0 + 8; i++) { y = (i - a0) << 1; if (i == gUnknown_02039248.unk2) diff --git a/src/field/tv.c b/src/field/tv.c index 8bd36bb9c..405422dd7 100644 --- a/src/field/tv.c +++ b/src/field/tv.c @@ -3050,7 +3050,7 @@ void DoTVShowTodaysSmartShopper(void) break; case 1: TVShowConvertInternationalString(gStringVar1, smartShopper->playerName, smartShopper->language); - StringCopy(gStringVar2, ItemId_GetItem(smartShopper->itemIds[0])->name); + StringCopy(gStringVar2, ItemId_GetName(smartShopper->itemIds[0])); sub_80BF088(2, smartShopper->itemAmounts[0]); sTVShowState += (Random() % 4) + 1; break; @@ -3070,7 +3070,7 @@ void DoTVShowTodaysSmartShopper(void) sTVShowState = 10; break; case 6: - StringCopy(gStringVar2, ItemId_GetItem(smartShopper->itemIds[1])->name); + StringCopy(gStringVar2, ItemId_GetName(smartShopper->itemIds[1])); sub_80BF088(2, smartShopper->itemAmounts[1]); if (smartShopper->itemIds[2] != 0) sTVShowState = 7; @@ -3080,7 +3080,7 @@ void DoTVShowTodaysSmartShopper(void) sTVShowState = 9; break; case 7: - StringCopy(gStringVar2, ItemId_GetItem(smartShopper->itemIds[2])->name); + StringCopy(gStringVar2, ItemId_GetName(smartShopper->itemIds[2])); sub_80BF088(2, smartShopper->itemAmounts[2]); if (smartShopper->priceReduced == 1) sTVShowState = 8; @@ -3105,7 +3105,7 @@ void DoTVShowTodaysSmartShopper(void) break; case 11: TVShowConvertInternationalString(gStringVar1, smartShopper->playerName, smartShopper->language); - StringCopy(gStringVar2, ItemId_GetItem(smartShopper->itemIds[0])->name); + StringCopy(gStringVar2, ItemId_GetName(smartShopper->itemIds[0])); if (smartShopper->priceReduced == 1) sTVShowState = 8; else @@ -3237,7 +3237,7 @@ void DoTVShowPokemonTodaySuccessfulCapture(void) sTVShowState = 2; break; case 2: - StringCopy(gStringVar2, ItemId_GetItem(pokemonToday->ball)->name); + StringCopy(gStringVar2, ItemId_GetName(pokemonToday->ball)); sub_80BF088(2, pokemonToday->var12); if (pokemonToday->var12 < 4) sTVShowState = 3; diff --git a/src/pokemon/pokemon_storage_system_4.c b/src/pokemon/pokemon_storage_system_4.c index 19fddc0f7..2f9f79a54 100644 --- a/src/pokemon/pokemon_storage_system_4.c +++ b/src/pokemon/pokemon_storage_system_4.c @@ -2101,7 +2101,7 @@ void sub_809C04C(void *pokemon, u8 a1) buf[1] = 0x06; // size buf[2] = 0x04; buf = gPokemonStorageSystemPtr->unk_127a + 8; - buf = StringCopy(buf, ItemId_GetItem(gPokemonStorageSystemPtr->unk_11f2)->name); + buf = StringCopy(buf, ItemId_GetName(gPokemonStorageSystemPtr->unk_11f2)); buf[0] = EXT_CTRL_CODE_BEGIN; buf[1] = 0x07; // UNKNOWN_7; buf += 2; diff --git a/src/pokemon/pokemon_summary_screen.c b/src/pokemon/pokemon_summary_screen.c index 9c621780a..6ff912a20 100644 --- a/src/pokemon/pokemon_summary_screen.c +++ b/src/pokemon/pokemon_summary_screen.c @@ -3930,7 +3930,7 @@ static void PrintHeldItemName(u16 itemId, u8 left, u8 top) && IsLinkDoubleBattle() == TRUE && (pssData.monIndex == 1 || pssData.monIndex == 4 || pssData.monIndex == 5)) { - StringCopy(gStringVar1, ItemId_GetItem(itemId)->name); + StringCopy(gStringVar1, ItemId_GetName(itemId)); } else if (itemId == 0) { diff --git a/src/scene/berry_blender.c b/src/scene/berry_blender.c index 6eccca047..ef9dd5ab7 100644 --- a/src/scene/berry_blender.c +++ b/src/scene/berry_blender.c @@ -201,7 +201,6 @@ u8 sub_80A7DEC(u8 berryId, u8 x, u8 y, bool8 animate); void MenuCursor_SetPos814A880(u8 a1, u8 a2); u8 MenuCursor_Create814A5C0(u8 a1, u16 a2, u8 a3, u16 a4, u8 a5); s8 GetFirstFreePokeblockSlot(void); -bool8 sub_810CA34(struct Pokeblock *pokeblock); #ifdef GERMAN extern void de_sub_8073110(); #endif |