Changeset View
Changeset View
Standalone View
Standalone View
source/simulation2/components/CCmpVisualActor.cpp
Show First 20 Lines • Show All 379 Lines • ▼ Show 20 Lines | public: | ||||
virtual CVector3D GetPosition() const | virtual CVector3D GetPosition() const | ||||
{ | { | ||||
if (!m_Unit) | if (!m_Unit) | ||||
return CVector3D(0, 0, 0); | return CVector3D(0, 0, 0); | ||||
return m_Unit->GetModel().GetTransform().GetTranslation(); | return m_Unit->GetModel().GetTransform().GetTranslation(); | ||||
} | } | ||||
virtual std::wstring GetActorShortName() const | |||||
{ | |||||
if (!m_Unit) | |||||
return L""; | |||||
return m_Unit->GetObject().m_Base->m_ShortName; | |||||
} | |||||
virtual std::wstring GetProjectileActor() const | virtual std::wstring GetProjectileActor() const | ||||
{ | { | ||||
if (!m_Unit) | if (!m_Unit) | ||||
return L""; | return L""; | ||||
return m_Unit->GetObject().m_ProjectileModelName; | return m_Unit->GetObject().m_ProjectileModelName; | ||||
} | } | ||||
virtual CFixedVector3D GetProjectileLaunchPoint() const | virtual CFixedVector3D GetProjectileLaunchPoint() const | ||||
▲ Show 20 Lines • Show All 148 Lines • ▼ Show 20 Lines | virtual bool HasConstructionPreview() const | ||||
return m_ConstructionPreview; | return m_ConstructionPreview; | ||||
} | } | ||||
virtual void Hotload(const VfsPath& name) | virtual void Hotload(const VfsPath& name) | ||||
{ | { | ||||
if (!m_Unit) | if (!m_Unit) | ||||
return; | return; | ||||
if (name != m_ActorName) | if (!name.empty() && name != m_ActorName) | ||||
return; | return; | ||||
ReloadActor(); | ReloadActor(); | ||||
} | } | ||||
private: | private: | ||||
// Replace {phenotype} with the correct value in m_ActorName | // Replace {phenotype} with the correct value in m_ActorName | ||||
void ParseActorName(std::wstring base); | void ParseActorName(std::wstring base); | ||||
▲ Show 20 Lines • Show All 228 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator