mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 20:49:56 +00:00
343f2cb81d
Added creator subclass for body parts to allow adding first person parts. IDs for first person body parts are expected to end with ".1st".
54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
#include "bodypartcreator.hpp"
|
|
|
|
#include <QCheckBox>
|
|
|
|
#include "../../model/world/data.hpp"
|
|
#include "../../model/world/universalid.hpp"
|
|
|
|
std::string CSVWorld::BodyPartCreator::getId() const
|
|
{
|
|
std::string id = CSVWorld::GenericCreator::getId();
|
|
|
|
if (mFirstPerson->isChecked())
|
|
{
|
|
id += ".1st";
|
|
}
|
|
|
|
return id;
|
|
}
|
|
|
|
CSVWorld::BodyPartCreator::BodyPartCreator(
|
|
CSMWorld::Data& data,
|
|
QUndoStack& undoStack,
|
|
const CSMWorld::UniversalId& id
|
|
) : GenericCreator(data, undoStack, id)
|
|
{
|
|
mFirstPerson = new QCheckBox("First Person", this);
|
|
insertBeforeButtons(mFirstPerson, false);
|
|
|
|
connect(mFirstPerson, SIGNAL(clicked(bool)), this, SLOT(checkboxClicked()));
|
|
}
|
|
|
|
std::string CSVWorld::BodyPartCreator::getErrors() const
|
|
{
|
|
std::string errors;
|
|
|
|
std::string id = getId();
|
|
if (getData().hasId(id))
|
|
{
|
|
errors = "ID is already in use";
|
|
}
|
|
|
|
return errors;
|
|
}
|
|
|
|
void CSVWorld::BodyPartCreator::reset()
|
|
{
|
|
CSVWorld::GenericCreator::reset();
|
|
mFirstPerson->setChecked(false);
|
|
}
|
|
|
|
void CSVWorld::BodyPartCreator::checkboxClicked()
|
|
{
|
|
update();
|
|
}
|