diff --git a/mp/src/game/server/env_projectedtexture.cpp b/mp/src/game/server/env_projectedtexture.cpp index 2ad953a14..8cc7ddd10 100644 --- a/mp/src/game/server/env_projectedtexture.cpp +++ b/mp/src/game/server/env_projectedtexture.cpp @@ -73,7 +73,7 @@ BEGIN_DATADESC( CEnvProjectedTexture ) DEFINE_KEYFIELD( m_bLightWorld, FIELD_BOOLEAN, "lightworld" ), DEFINE_KEYFIELD( m_bCameraSpace, FIELD_BOOLEAN, "cameraspace" ), DEFINE_KEYFIELD( m_flAmbient, FIELD_FLOAT, "ambient" ), - DEFINE_AUTO_ARRAY_KEYFIELD( m_SpotlightTextureName, FIELD_CHARACTER, "texturename" ), + DEFINE_AUTO_ARRAY( m_SpotlightTextureName, FIELD_CHARACTER ), DEFINE_KEYFIELD( m_nSpotlightTextureFrame, FIELD_INTEGER, "textureframe" ), DEFINE_KEYFIELD( m_flNearZ, FIELD_FLOAT, "nearz" ), DEFINE_KEYFIELD( m_flFarZ, FIELD_FLOAT, "farz" ), @@ -161,6 +161,10 @@ bool CEnvProjectedTexture::KeyValue( const char *szKeyName, const char *szValue UTIL_ColorStringToLinearFloatColor( tmp, szValue ); m_LinearFloatLightColor = tmp; } + else if ( FStrEq(szKeyName, "texturename" ) ) + { + Q_strcpy( m_SpotlightTextureName.GetForModify(), szValue ); + } else { return BaseClass::KeyValue( szKeyName, szValue ); diff --git a/sp/game/sdk2013CE/sdk2013ce.fgd b/sp/game/sdk2013CE/sdk2013ce.fgd index bc18631b1..fe277d970 100644 --- a/sp/game/sdk2013CE/sdk2013ce.fgd +++ b/sp/game/sdk2013CE/sdk2013ce.fgd @@ -26,4 +26,48 @@ // Outputs output OnIgnite(void) : "Fired when this object catches fire." -] \ No newline at end of file +] + +// lightprop("models/editor/spot.mdl") <---- use this once the orientation is unfucked +@PointClass base(Targetname, Parentname, Angles) size(-2 -2 -2, 2 2 2) frustum(lightfov,nearz,farz,lightcolor,-1) = env_projectedtexture : + "Projected texture entity." +[ + spawnflags(flags) = + [ + 1 : "Enabled" : 1 + ] + + target(target_destination) : "target" : : "target" + lightfov(float) : "FOV" : "90.0" : "FOV" + nearz(float) : "NearZ" : "4.0" : "Near Z for projected texture" + farz(float) : "FarZ" : "750.0" : "Far Z for projected texture" + + enableshadows(Choices) : "Enable Shadows" : 0 : "Enables/disables shadows from this projected texture." = + [ + 0 : "No" + 1 : "Yes" + ] + shadowquality(Choices) : "Shadow Quality" : 1 : "Quality of shadows." = + [ + 0 : "Low" + 1 : "High" + ] + lightonlytarget(Choices) : "Light Only Target" : 0 : "Limit flashlight effect to only effect target entity." = + [ + 0 : "No" + 1 : "Yes" + ] + lightworld(Choices) : "Light World" : 1 : "Control whether flashlight effects static world geometry." = + [ + 0 : "No" + 1 : "Yes" + ] + lightcolor(color255) : "Light Color" : "255 255 255 200" : "Light Color RGB-Intensity" + cameraspace(integer) : "Camera Space" : 0 : "Angles are interpreted as being relative to camera." + texturename(material) : "Texture" : : "path/texture to be projected. Relative to main/materials/" + + // Inputs + input TurnOn(void) : "Turn on the texture" + input TurnOff(void) : "Turn off the texture" + input SetFOV(float) : "Set FOV" +] diff --git a/sp/src/game/server/env_projectedtexture.cpp b/sp/src/game/server/env_projectedtexture.cpp index 2ad953a14..8cc7ddd10 100644 --- a/sp/src/game/server/env_projectedtexture.cpp +++ b/sp/src/game/server/env_projectedtexture.cpp @@ -73,7 +73,7 @@ BEGIN_DATADESC( CEnvProjectedTexture ) DEFINE_KEYFIELD( m_bLightWorld, FIELD_BOOLEAN, "lightworld" ), DEFINE_KEYFIELD( m_bCameraSpace, FIELD_BOOLEAN, "cameraspace" ), DEFINE_KEYFIELD( m_flAmbient, FIELD_FLOAT, "ambient" ), - DEFINE_AUTO_ARRAY_KEYFIELD( m_SpotlightTextureName, FIELD_CHARACTER, "texturename" ), + DEFINE_AUTO_ARRAY( m_SpotlightTextureName, FIELD_CHARACTER ), DEFINE_KEYFIELD( m_nSpotlightTextureFrame, FIELD_INTEGER, "textureframe" ), DEFINE_KEYFIELD( m_flNearZ, FIELD_FLOAT, "nearz" ), DEFINE_KEYFIELD( m_flFarZ, FIELD_FLOAT, "farz" ), @@ -161,6 +161,10 @@ bool CEnvProjectedTexture::KeyValue( const char *szKeyName, const char *szValue UTIL_ColorStringToLinearFloatColor( tmp, szValue ); m_LinearFloatLightColor = tmp; } + else if ( FStrEq(szKeyName, "texturename" ) ) + { + Q_strcpy( m_SpotlightTextureName.GetForModify(), szValue ); + } else { return BaseClass::KeyValue( szKeyName, szValue );