Skip to content

Commit

Permalink
Address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
cbt6 committed Feb 13, 2025
1 parent 452e7af commit 809b571
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 23 deletions.
1 change: 1 addition & 0 deletions generated/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ foreach gen_key : metang_generators.keys()
)
endforeach

npc_trades_txt = files('npc_trades.txt')
species_txt = files('species.txt')
text_banks_txt = files('text_banks.txt')
trainers_txt = files('trainers.txt')
Expand Down
2 changes: 1 addition & 1 deletion include/overlay006/npc_trade.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ NpcTradeData *NpcTrade_Init(u32 heapID, u32 entryID);
void NpcTrade_Free(NpcTradeData *data);
u32 NpcTrade_GetSpecies(const NpcTradeData *data);
u32 NpcTrade_GetRequestedSpecies(const NpcTradeData *data);
void ov6_02246234(FieldSystem *fieldSystem, NpcTradeData *data, int slot);
void NpcTrade_ReceiveMon(FieldSystem *fieldSystem, NpcTradeData *data, int slot);
void ov6_02246254(FieldSystem *fieldSystem, NpcTradeData *data, int slot, UnkStruct_ov6_02246254 *param3, Pokemon *givingMon, Pokemon *receivingMon);

#endif // POKEPLATINUM_NPC_TRADE_H
21 changes: 9 additions & 12 deletions res/field/trades/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,26 @@ npc_trades_bin_gen = generator(
output: '@BASENAME@'
)

npc_trades_files = files(
'npc_trade_kazza_abra.json',
'npc_trade_charap_chatot.json',
'npc_trade_gaspar_haunter.json',
'npc_trade_foopa_magikarp.json',
)
npc_trades_consts = fs.read(npc_trades_txt).splitlines()
npc_trades_files = []
foreach npc_trade: npc_trades_consts
if npc_trade.startswith('MAX_')
continue
endif
npc_trades_files += files(npc_trade.to_lower() + '.json')
endforeach

npc_trades_order = files('npc_trades.order')
npc_trades_narc = custom_target('fld_trade.narc',
output: [
'fld_trade.narc',
'fld_trade.naix',
],
output: 'fld_trade.narc',
input: npc_trades_bin_gen.process(npc_trades_files, env: json2bin_env),
depends: [ py_consts_generators ],
command: [
narc_exe, 'create',
'--naix',
'--order', npc_trades_order,
'--output', '@OUTPUT0@',
'@PRIVATE_DIR@',
]
)

nitrofs_files += npc_trades_narc
naix_headers += npc_trades_narc[1]
16 changes: 8 additions & 8 deletions res/text/npc_trade_names.gmm
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
<?xml version="1.0"?>
<body language="English">
<key value="4839" />
<row id="npc_trades_names_kazza" index="0">
<row id="npc_trade_names_kazza" index="0">
<attribute name="window_context_name">used</attribute>
<language name="English">Kazza</language>
</row>
<row id="npc_trades_names_charap" index="1">
<row id="npc_trade_names_charap" index="1">
<attribute name="window_context_name">used</attribute>
<language name="English">Charap</language>
</row>
<row id="npc_trades_names_gaspar" index="2">
<row id="npc_trade_names_gaspar" index="2">
<attribute name="window_context_name">used</attribute>
<language name="English">Gaspar</language>
</row>
<row id="npc_trades_names_foppa" index="3">
<row id="npc_trade_names_foppa" index="3">
<attribute name="window_context_name">used</attribute>
<language name="English">Foppa</language>
</row>
<row id="npc_trades_names_hilary" index="4">
<row id="npc_trade_names_hilary" index="4">
<attribute name="window_context_name">used</attribute>
<language name="English">Hilary</language>
</row>
<row id="npc_trades_names_norton" index="5">
<row id="npc_trade_names_norton" index="5">
<attribute name="window_context_name">used</attribute>
<language name="English">Norton</language>
</row>
<row id="npc_trades_names_mindy" index="6">
<row id="npc_trade_names_mindy" index="6">
<attribute name="window_context_name">used</attribute>
<language name="English">Mindy</language>
</row>
<row id="npc_trades_names_meister" index="7">
<row id="npc_trade_names_meister" index="7">
<attribute name="window_context_name">used</attribute>
<language name="English">Meister</language>
</row>
Expand Down
2 changes: 1 addition & 1 deletion src/overlay006/npc_trade.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ u32 NpcTrade_GetRequestedSpecies(const NpcTradeData *data)
return data->npcTradeMon->requestedSpecies;
}

void ov6_02246234(FieldSystem *fieldSystem, NpcTradeData *data, int slot)
void NpcTrade_ReceiveMon(FieldSystem *fieldSystem, NpcTradeData *data, int slot)
{
sub_0207A128(Party_GetFromSavedata(fieldSystem->saveData), slot, data->mon);
sub_0202F180(fieldSystem->saveData, data->mon);
Expand Down
2 changes: 1 addition & 1 deletion src/unk_0206C660.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ static BOOL sub_0206C680(FieldTask *param0)
switch (v1->unk_04) {
case 0:
ov6_02246254(fieldSystem, v1->unk_00, v1->unk_08, &v1->unk_0C, v1->unk_24, v1->unk_28);
ov6_02246234(fieldSystem, v1->unk_00, v1->unk_08);
NpcTrade_ReceiveMon(fieldSystem, v1->unk_00, v1->unk_08);
v1->unk_04++;
break;
case 1:
Expand Down

0 comments on commit 809b571

Please sign in to comment.