mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 09:39:41 +00:00
Use an ID parent type as the collection ID in GenericCreator.
Fix impossibility of creation/cloning records from Dialogue subviews in Info tables
This commit is contained in:
parent
581ba55db9
commit
e212414bc7
2 changed files with 10 additions and 2 deletions
|
@ -133,6 +133,15 @@ CSVWorld::GenericCreator::GenericCreator (CSMWorld::Data& data, QUndoStack& undo
|
||||||
mClonedType (CSMWorld::UniversalId::Type_None), mScopes (CSMWorld::Scope_Content), mScope (0),
|
mClonedType (CSMWorld::UniversalId::Type_None), mScopes (CSMWorld::Scope_Content), mScope (0),
|
||||||
mScopeLabel (0), mCloneMode (false)
|
mScopeLabel (0), mCloneMode (false)
|
||||||
{
|
{
|
||||||
|
// If the collection ID has a parent type, use it instead.
|
||||||
|
// It will change IDs with Record/SubRecord class (used for creators in Dialogue subviews)
|
||||||
|
// to IDs with general RecordList class (used for creators in Table subviews).
|
||||||
|
CSMWorld::UniversalId::Type listParentType = CSMWorld::UniversalId::getParentType(mListId.getType());
|
||||||
|
if (listParentType != CSMWorld::UniversalId::Type_None)
|
||||||
|
{
|
||||||
|
mListId = listParentType;
|
||||||
|
}
|
||||||
|
|
||||||
mLayout = new QHBoxLayout;
|
mLayout = new QHBoxLayout;
|
||||||
mLayout->setContentsMargins (0, 0, 0, 0);
|
mLayout->setContentsMargins (0, 0, 0, 0);
|
||||||
|
|
||||||
|
|
|
@ -50,8 +50,7 @@ CSVWorld::InfoCreator::InfoCreator (CSMWorld::Data& data, QUndoStack& undoStack,
|
||||||
|
|
||||||
mTopic = new QLineEdit (this);
|
mTopic = new QLineEdit (this);
|
||||||
CSMWorld::ColumnBase::Display displayType = CSMWorld::ColumnBase::Display_Topic;
|
CSMWorld::ColumnBase::Display displayType = CSMWorld::ColumnBase::Display_Topic;
|
||||||
if (id.getType() == CSMWorld::UniversalId::Type_JournalInfo || // For Dialogue SubView
|
if (getCollectionId().getType() == CSMWorld::UniversalId::Type_JournalInfos)
|
||||||
id.getType() == CSMWorld::UniversalId::Type_JournalInfos) // For Table SubView
|
|
||||||
{
|
{
|
||||||
displayType = CSMWorld::ColumnBase::Display_Journal;
|
displayType = CSMWorld::ColumnBase::Display_Journal;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue