Exemplo n.º 1
0
    void RaceDialog::updatePreview()
    {
        ESM::NPC record = mPreview->getPrototype();
        record.mRace = mCurrentRaceId;
        record.setIsMale(mGenderIndex == 0);

        record.mHead = mAvailableHeads[mFaceIndex];
        record.mHair = mAvailableHairs[mHairIndex];

        mPreview->setPrototype(record);
        mPreviewDirty = true;
    }
Exemplo n.º 2
0
    void RaceDialog::updatePreview()
    {
        ESM::NPC record = mPreview->getPrototype();
        record.mRace = mCurrentRaceId;
        record.setIsMale(mGenderIndex == 0);

        record.mHead = mAvailableHeads[mFaceIndex];
        record.mHair = mAvailableHairs[mHairIndex];

        try
        {
            mPreview->setPrototype(record);
        }
        catch (std::exception& e)
        {
            std::cerr << "Error creating preview: " << e.what() << std::endl;
        }
    }
Exemplo n.º 3
0
    void RaceDialog::updatePreview()
    {
        ESM::NPC record = mPreview->getPrototype();
        record.mRace = mCurrentRaceId;
        record.setIsMale(mGenderIndex == 0);

        if (mFaceIndex >= 0 && mFaceIndex < int(mAvailableHeads.size()))
            record.mHead = mAvailableHeads[mFaceIndex];

        if (mHairIndex >= 0 && mHairIndex < int(mAvailableHairs.size()))
            record.mHair = mAvailableHairs[mHairIndex];

        try
        {
            mPreview->setPrototype(record);
        }
        catch (std::exception& e)
        {
            Log(Debug::Error) << "Error creating preview: " << e.what();
        }
    }
Exemplo n.º 4
0
void RaceDialog::updatePreview()
{
    ESM::NPC record = mPreview->getPrototype();
    record.mRace = mCurrentRaceId;
    record.setIsMale(mGenderIndex == 0);

    std::string prefix =
        "b_n_" + mCurrentRaceId + ((record.isMale()) ? "_m_" : "_f_");

    std::string headIndex = (boost::format("%02d") % (mFaceIndex + 1)).str();
    std::string hairIndex = (boost::format("%02d") % (mHairIndex + 1)).str();

    record.mHead = prefix + "head_" + headIndex;
    record.mHair = prefix + "hair_" + hairIndex;

    const MWWorld::Store<ESM::BodyPart> &parts =
        MWBase::Environment::get().getWorld()->getStore().get<ESM::BodyPart>();

    if (parts.search(record.mHair) == 0) {
        record.mHair = prefix + "hair" + hairIndex;
    }
    mPreview->setPrototype(record);
}