一共需要修改四个文件。
include\constants\items.h
新增道具名称,例如:
ITEM_TREE_OF_TIME_LEAF = 874,src\data\items.h
新增道具信息,例如:
[ITEM_TREE_OF_TIME_LEAF] ={
.name = ITEM_NAME("时之树的叶子"),
.price = 500,
.description = COMPOUND_STRING(
"来自时之树的\n"
"神秘叶子。据说拥有\n穿越时空的力量。"),
.pocket = POCKET_KEY_ITEMS,
.sortType = ITEM_TYPE_UNCATEGORIZED,
.type = ITEM_USE_BAG_MENU,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
.iconPic = gItemIcon_Leaf,
.iconPalette = gItemIconPalette_Leaf,
},</code></pre><p> </p><p>src\data\graphics\items.h</p><p>新增素材引用代码:</p><pre class="enlighter-pre"><code class="gl">const u32 gItemIcon_Leaf[] = INCBIN_U32("graphics/items/icons/leaf.4bpp.smol");
const u16 gItemIconPalette_Leaf[] = INCBIN_U16("graphics/items/icons/leaf.gbapal");
include\graphics.h
新增素材定义:
extern const u32 gItemIcon_Leaf[];
extern const u16 gItemIconPalette_Leaf[];
发表评论