mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-12-13 23:26:19 +00:00
Rewrote SCAN asset handling + loading
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "CPointOfInterestExtra.h"
|
||||
|
||||
//@todo pull these values from tweaks instead of hardcoding them
|
||||
const CColor CPointOfInterestExtra::skRegularColor = CColor::Integral(0xFF,0x70,0x00);
|
||||
const CColor CPointOfInterestExtra::skImportantColor = CColor::Integral(0xFF,0x00,0x00);
|
||||
|
||||
@@ -19,14 +20,17 @@ CPointOfInterestExtra::CPointOfInterestExtra(CScriptObject *pInstance, CScene *p
|
||||
void CPointOfInterestExtra::PropertyModified(IProperty* pProperty)
|
||||
{
|
||||
if (mScanProperty.Property() == pProperty)
|
||||
{
|
||||
mpScanData = gpResourceStore->LoadResource<CScan>( mScanProperty.Get() );
|
||||
mScanIsCritical = (mpScanData ? mpScanData->IsCriticalPropertyRef() : CBoolRef());
|
||||
}
|
||||
}
|
||||
|
||||
void CPointOfInterestExtra::ModifyTintColor(CColor& Color)
|
||||
{
|
||||
if (mpScanData)
|
||||
{
|
||||
if (mpScanData->IsImportant()) Color *= skImportantColor;
|
||||
if (mScanIsCritical) Color *= skImportantColor;
|
||||
else Color *= skRegularColor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define CPOINTOFINTERESTEXTRA_H
|
||||
|
||||
#include "CScriptExtra.h"
|
||||
#include "Core/Resource/CScan.h"
|
||||
#include "Core/Resource/Scan/CScan.h"
|
||||
#include <Common/CColor.h>
|
||||
|
||||
class CPointOfInterestExtra : public CScriptExtra
|
||||
@@ -10,6 +10,7 @@ class CPointOfInterestExtra : public CScriptExtra
|
||||
// Tint POI billboard orange/red depending on scan importance
|
||||
CAssetRef mScanProperty;
|
||||
TResPtr<CScan> mpScanData;
|
||||
CBoolRef mScanIsCritical;
|
||||
|
||||
public:
|
||||
explicit CPointOfInterestExtra(CScriptObject *pInstance, CScene *pScene, CScriptNode *pParent = 0);
|
||||
|
||||
Reference in New Issue
Block a user