Changed double-click behavior in the POI list dialog, readded and fixed error message for incorrect struct property count in SCLY
This commit is contained in:
parent
8611e692a9
commit
26485b1151
|
@ -167,7 +167,12 @@ void CScriptLoader::LoadStructMP1(IInputStream& SCLY, CPropertyStruct *pStruct,
|
||||||
Version = pTemp->VersionForPropertyCount(FilePropCount);
|
Version = pTemp->VersionForPropertyCount(FilePropCount);
|
||||||
|
|
||||||
if (Version == -1)
|
if (Version == -1)
|
||||||
Log::FileWarning(SCLY.GetSourceString(), StructStart, "Struct \"" + pTemp->Name() + "\" template prop count doesn't match file");
|
{
|
||||||
|
TIDString IDString = pTemp->IDString(true);
|
||||||
|
if (!IDString.IsEmpty()) IDString = " (" + IDString + ")";
|
||||||
|
|
||||||
|
Log::FileWarning(SCLY.GetSourceString(), StructStart, "Struct \"" + pTemp->Name() + "\"" + IDString + " template prop count doesn't match file");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse properties
|
// Parse properties
|
||||||
|
@ -260,8 +265,13 @@ void CScriptLoader::LoadStructMP2(IInputStream& SCLY, CPropertyStruct *pStruct,
|
||||||
u16 NumProperties = SCLY.ReadShort();
|
u16 NumProperties = SCLY.ReadShort();
|
||||||
Version = pTemp->VersionForPropertyCount(NumProperties);
|
Version = pTemp->VersionForPropertyCount(NumProperties);
|
||||||
|
|
||||||
//if ((NumProperties != PropCount) && (mVersion < eReturns))
|
if ((NumProperties != PropCount) && (mVersion < eReturns))
|
||||||
// Log::FileWarning(SCLY.GetSourceString(), SCLY.Tell() - 2, "Struct \"" + pTemp->Name() + "\" template property count doesn't match file");
|
{
|
||||||
|
TIDString IDString = pTemp->IDString(true);
|
||||||
|
if (!IDString.IsEmpty()) IDString = " (" + IDString + ")";
|
||||||
|
|
||||||
|
Log::FileWarning(SCLY.GetSourceString(), StructStart, "Struct \"" + pTemp->Name() + "\"" + IDString + " template prop count doesn't match file");
|
||||||
|
}
|
||||||
|
|
||||||
PropCount = NumProperties;
|
PropCount = NumProperties;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,10 +16,20 @@ bool IPropertyTemplate::IsInVersion(u32 Version) const
|
||||||
|
|
||||||
TIDString IPropertyTemplate::IDString(bool FullPath) const
|
TIDString IPropertyTemplate::IDString(bool FullPath) const
|
||||||
{
|
{
|
||||||
TIDString out;
|
if (mID != 0xFFFFFFFF)
|
||||||
if (mpParent && FullPath) out = mpParent->IDString(true) + ":";
|
{
|
||||||
out += TIDString::HexString(mID, true, true, 8);
|
TIDString out;
|
||||||
return out;
|
|
||||||
|
if (mpParent && FullPath)
|
||||||
|
{
|
||||||
|
out = mpParent->IDString(true);
|
||||||
|
if (!out.IsEmpty()) out += ":";
|
||||||
|
}
|
||||||
|
|
||||||
|
out += TIDString::HexString(mID, true, true, 8);
|
||||||
|
return out;
|
||||||
|
}
|
||||||
|
else return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
CStructTemplate* IPropertyTemplate::RootStruct()
|
CStructTemplate* IPropertyTemplate::RootStruct()
|
||||||
|
|
|
@ -111,7 +111,7 @@ public:
|
||||||
mpListView->setSelectionMode(QListView::ExtendedSelection);
|
mpListView->setSelectionMode(QListView::ExtendedSelection);
|
||||||
mpListView->setVerticalScrollMode(QListView::ScrollPerPixel);
|
mpListView->setVerticalScrollMode(QListView::ScrollPerPixel);
|
||||||
|
|
||||||
connect(mpListView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(OnDoubleClickItem(QModelIndex)));
|
connect(mpListView, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(OnOkClicked()));
|
||||||
connect(mpButtonBox, SIGNAL(accepted()), this, SLOT(OnOkClicked()));
|
connect(mpButtonBox, SIGNAL(accepted()), this, SLOT(OnOkClicked()));
|
||||||
connect(mpButtonBox, SIGNAL(rejected()), this, SLOT(OnCancelClicked()));
|
connect(mpButtonBox, SIGNAL(rejected()), this, SLOT(OnCancelClicked()));
|
||||||
}
|
}
|
||||||
|
@ -122,14 +122,6 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void OnDoubleClickItem(QModelIndex Index)
|
|
||||||
{
|
|
||||||
QModelIndex SourceIndex = mModel.mapToSource(Index);
|
|
||||||
mSelection.clear();
|
|
||||||
mSelection << mSourceModel.PoiForIndex(SourceIndex);
|
|
||||||
close();
|
|
||||||
}
|
|
||||||
|
|
||||||
void OnOkClicked()
|
void OnOkClicked()
|
||||||
{
|
{
|
||||||
QModelIndexList SelectedIndices = mpListView->selectionModel()->selectedRows();
|
QModelIndexList SelectedIndices = mpListView->selectionModel()->selectedRows();
|
||||||
|
|
Loading…
Reference in New Issue