Adds handling for datablocks to be reloaded if the assets they utilize have their files directly edited.

This commit is contained in:
JeffR 2025-04-24 00:58:20 -05:00
parent 0eafadb1a0
commit f31acf774e
23 changed files with 121 additions and 37 deletions

View file

@ -143,7 +143,10 @@ public:
ExplosionData* cloneAndPerformSubstitutions(const SimObject*, S32 index=0);
bool allowSubstitutions() const override { return true; }
void onShapeChanged() {}
void onShapeChanged()
{
reloadOnLocalClient();
}
};

View file

@ -341,7 +341,7 @@ protected:
RectF mBillboardRects[MAX_COVERTYPES];
/// The cover shape filenames.
DECLARE_SHAPEASSET_ARRAY(GroundCover, Shape, MAX_COVERTYPES);
DECLARE_SHAPEASSET_ARRAY(GroundCover, Shape, MAX_COVERTYPES, onShapeChanged);
DECLARE_ASSET_ARRAY_NET_SETGET(GroundCover, Shape, -1);
/// The cover shape instances.
@ -409,6 +409,8 @@ protected:
S32 randSeed );
void _debugRender( ObjectRenderInst *ri, SceneRenderState *state, BaseMatInstance *overrideMat );
void onShapeChanged(){}
};
#endif // _GROUNDCOVER_H_

View file

@ -92,7 +92,10 @@ class ParticleData : public SimDataBlock
static bool protectedSetSizes(void* object, const char* index, const char* data);
static bool protectedSetTimes(void* object, const char* index, const char* data);
void onImageChanged() {}
void onImageChanged()
{
reloadOnLocalClient();
}
public:
ParticleData();

View file

@ -69,8 +69,14 @@ class PrecipitationData : public GameBaseData
void packData(BitStream* stream) override;
void unpackData(BitStream* stream) override;
void onDropChanged() {}
void onSplashChanged() {}
void onDropChanged()
{
reloadOnLocalClient();
}
void onSplashChanged()
{
reloadOnLocalClient();
}
};
struct Raindrop

View file

@ -124,7 +124,10 @@ public:
DECLARE_IMAGEASSET_ARRAY(SplashData, Texture, NUM_TEX, onTextureChanged);
DECLARE_IMAGEASSET_ARRAY_SETGET(SplashData, Texture)
void onTextureChanged() {}
void onTextureChanged()
{
reloadOnLocalClient();
}
ExplosionData* explosion;
S32 explosionId;