Implemented sorting and context menus on the instance views

This commit is contained in:
parax0
2016-01-23 04:00:26 -07:00
parent 38942988d5
commit cae8caaabb
17 changed files with 421 additions and 255 deletions

View File

@@ -195,7 +195,7 @@ void CTemplateWriter::SaveScriptTemplate(CScriptTemplate *pTemp, const TString&
// Write object name
XMLElement *pName = ScriptXML.NewElement("name");
pName->SetText(*pTemp->TemplateName());
pName->SetText(*pTemp->Name());
pRoot->LinkEndChild(pName);
// Write properties

View File

@@ -33,7 +33,7 @@ EGame CScriptTemplate::Game()
return mpMaster->GetGame();
}
TString CScriptTemplate::TemplateName() const
TString CScriptTemplate::Name() const
{
return mTemplateName;
}
@@ -95,7 +95,7 @@ EVolumeShape CScriptTemplate::VolumeShape(CScriptObject *pObj)
{
if (pObj->Template() != this)
{
Log::Error(pObj->Template()->TemplateName() + " instance somehow called VolumeShape() on " + TemplateName() + " template");
Log::Error(pObj->Template()->Name() + " instance somehow called VolumeShape() on " + Name() + " template");
return eInvalidShape;
}
@@ -112,7 +112,7 @@ float CScriptTemplate::VolumeScale(CScriptObject *pObj)
{
if (pObj->Template() != this)
{
Log::Error(pObj->Template()->TemplateName() + " instance somehow called VolumeScale() on " + TemplateName() + " template");
Log::Error(pObj->Template()->Name() + " instance somehow called VolumeScale() on " + Name() + " template");
return -1;
}
@@ -169,7 +169,7 @@ s32 CScriptTemplate::CheckVolumeConditions(CScriptObject *pObj, bool LogErrors)
}
if (LogErrors)
Log::Error(pObj->Template()->TemplateName() + " instance " + TString::HexString(pObj->InstanceID(), true, true, 8) + " has unexpected volume shape value of " + TString::HexString((u32) v, true, true));
Log::Error(pObj->Template()->Name() + " instance " + TString::HexString(pObj->InstanceID(), true, true, 8) + " has unexpected volume shape value of " + TString::HexString((u32) v, true, true));
}
return -1;

View File

@@ -92,7 +92,7 @@ public:
CMasterTemplate* MasterTemplate();
EGame Game();
TString TemplateName() const;
TString Name() const;
u32 NumPropertySets() const;
ERotationType RotationType() const;
EScaleType ScaleType() const;

View File

@@ -33,7 +33,7 @@ CScriptNode::CScriptNode(CScene *pScene, CSceneNode *pParent, CScriptObject *pOb
mScale = mpInstance->Scale();
MarkTransformChanged();
SetName("[" + pTemp->TemplateName() + "] " + mpInstance->InstanceName());
SetName("[" + pTemp->Name() + "] " + mpInstance->InstanceName());
// Determine display assets
mpActiveModel = mpInstance->GetDisplayModel();

View File

@@ -189,7 +189,7 @@ void CDamageableTriggerExtra::AddToRenderer(CRenderer *pRenderer, const SViewInf
if (ViewInfo.GameMode && !mpInstance->IsActive())
return;
if ((ViewInfo.ShowFlags & eShowObjectGeometry) == 0)
if (!ViewInfo.GameMode && ((ViewInfo.ShowFlags & eShowObjectGeometry) == 0))
return;
if (mRenderSide != eNoRender)