From ae11e50bcd98b0df6bed2ad3d6a503297dba8490 Mon Sep 17 00:00:00 2001 From: parax0 Date: Mon, 24 Aug 2015 21:15:10 -0400 Subject: [PATCH] Display object type in brackets in the script connection tables --- UI/WorldEditor/CLinkModel.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/UI/WorldEditor/CLinkModel.cpp b/UI/WorldEditor/CLinkModel.cpp index 00e3951e..eb436588 100644 --- a/UI/WorldEditor/CLinkModel.cpp +++ b/UI/WorldEditor/CLinkModel.cpp @@ -53,14 +53,14 @@ QVariant CLinkModel::data(const QModelIndex &index, int role) const { CScriptObject *pTargetObj = mpObject->Area()->GetInstanceByID(link.ObjectID); - if (role == Qt::DisplayRole) { - if (pTargetObj) return QString::fromStdString(pTargetObj->GetInstanceName()); - else return QString("0x") + QString::number(link.ObjectID, 16); + if (pTargetObj) { + QString ObjType = QString("[%1] ").arg(QString::fromStdString(pTargetObj->Template()->TemplateName())); + return ObjType + QString::fromStdString(pTargetObj->GetInstanceName()); } else { - QString ObjType = QString("[%1] ").arg(QString::fromStdString(pTargetObj->Template()->TemplateName())); - if (pTargetObj) return ObjType + QString::fromStdString(pTargetObj->GetInstanceName()); - else return ObjType + QString("0x") + QString::number(link.ObjectID, 16); + QString strID = QString::number(link.ObjectID, 16); + while (strID.length() < 8) strID = "0" + strID; + return QString("External: 0x") + strID; } }