I got it to work. I searched some more and realised you need to add the Button->onClick() when you are actually creating the button.
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts Menuvoid useItem(const Player::ptr& player, const Item::ptr& item)
{
if (!player)
return;
if (!item)
return;
item->use(player.get());
}
void HUD::update()
{
// Check if inventory slot was clicked
for (int i = 0; i < NUM_INVENTORY_SLOTS; ++i)
{
m_inventory[i]->onClick(useItem, m_player, m_player->getItemByIndex(i));
}
}