Exemplo n.º 1
0
void CharacterModule::setCharacter(Character* character)
{
   if (character != NULL)
   {
      characterName = character->getName();
      characterNameLabel->setCaption(characterName);
      characterNameLabel->adjustSize();

      std::stringstream hpSummary;
      hpSummary << character->getHP() << '/' << character->getMaxHP();
      characterHPLabel->setCaption(hpSummary.str());
      characterHPLabel->adjustSize();

      std::stringstream spSummary;
      spSummary << character->getSP() << '/' << character->getMaxSP();
      characterSPLabel->setCaption(spSummary.str());
      characterSPLabel->adjustSize();

      characterPortrait->setImage(character->getPortraitPath());

      characterStats->adjustContent();
      adjustContent();

      setVisible(true);
   }
   else
   {
      characterNameLabel->setCaption("");
      characterHPLabel->setCaption("");
      characterSPLabel->setCaption("");
      characterPortrait->clearImage();
      setVisible(false);
   }
}
Exemplo n.º 2
0
SaveGameModule::SaveGameModule(PlayerData& playerData) : playerData(playerData)
{
   setNumberOfColumns(PlayerData::PARTY_SIZE);
   setHorizontalSpacing(10);
   setPadding(5, 5, 5, 5);

   CharacterList party = playerData.getParty();
   for(CharacterList::iterator iter = party.begin(); iter != party.end(); ++iter)
   {
      edwt::Icon* characterPicture = new edwt::Icon((*iter)->getPortraitPath());

      add(characterPicture);
      characterPortraits.push_back(characterPicture);
   }
   
   adjustContent();
   setOpaque(false);
   
   addMouseListener(this);
}
Exemplo n.º 3
0
 void AdjustingContainer::logic()
 {
     Container::logic();
     adjustContent();
 }