Equipment Slots

Content and general development discussion, including maps, quests, and server code from the development team.
Post Reply
allenmoatallen
Peon
Peon
Posts: 32
Joined: 10 Apr 2008, 18:39

Equipment Slots

Post by allenmoatallen » 29 May 2008, 19:45

Hey guys! I have a question, if I want to determine which equip slot an item should be put into, how would I go about that? I am attempting to get equipment to show on the character screen, but have no way of figuring out which slot to set the sprite to. My code so far looks like this:

Code: Select all

void
PlayerBox::draw(gcn::Graphics *graphics)
{
    if (mPlayer)
    {
        // Draw character
        int x, y, bs;
        bs = getFrameSize();
        x = getWidth() / 2 - 16 + bs;
        y = getHeight() / 2 + bs;
        mPlayer->draw(static_cast<Graphics*>(graphics), x, y);
		
		for (int i = 0; i < EQUIPMENT_SIZE; i++)
		{
			Item *item = mEquipment->getEquipment(i);
			ItemInfo const *info = &item->getInfo();
			
			if (item->getId() > 2)
			{
				mPlayer->setSprite(6, item->getId());
			}
		}
    }
}
Post Reply