Add an Offset field to WithDamageOverlayInfo#21116
Conversation
|
Shouldn't the offset really be random? |
|
Something like #19238 |
Unless there is a specific use-case requested I wouldn't make this more complicated than necessary. If anything the trait should be made conditional and then you can emulate the behavior even better by using multiple instances. |
| { | ||
| [Desc("Renders an overlay when the actor is taking heavy damage.")] | ||
| public class WithDamageOverlayInfo : TraitInfo, Requires<RenderSpritesInfo> | ||
| public class WithDamageOverlayInfo : TraitInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo> |
There was a problem hiding this comment.
shouldn't body orientation be optional?
There was a problem hiding this comment.
We can make it optional, but that trait does not make sense without it. (All our actors have body orientation.) WithIdleOverlay also requires it.
632a30b to
0147a68
Compare
| { | ||
| [Desc("Renders an overlay when the actor is taking heavy damage.")] | ||
| public class WithDamageOverlayInfo : TraitInfo, Requires<RenderSpritesInfo> | ||
| public class WithDamageOverlayInfo : TraitInfo, Requires<RenderSpritesInfo>, NotBefore<BodyOrientationInfo>, IRulesetLoaded |
There was a problem hiding this comment.
the proper way we check is by delaying the acquisition of the trait to INotifyCreated
There was a problem hiding this comment.
Or using Requires? That way the check in RulesetLoaded is redundant. But yes, if this trait doesn't absolutely require a trait, it should use INotifyCreated to retrieve a reference to it.
0147a68 to
02c0bef
Compare
|
Updated. |
Closes #21113.