Skip to content

Add WithSwitchableOverlay for Firestrom Generator#21413

Merged
PunkPun merged 2 commits intoOpenRA:bleedfrom
dnqbob:switchable-overlay
May 19, 2024
Merged

Add WithSwitchableOverlay for Firestrom Generator#21413
PunkPun merged 2 commits intoOpenRA:bleedfrom
dnqbob:switchable-overlay

Conversation

@dnqbob
Copy link
Contributor

@dnqbob dnqbob commented May 1, 2024

testcase2

Copy link
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM, just a few naming nits

@PunkPun PunkPun mentioned this pull request May 7, 2024
5 tasks
@dnqbob dnqbob force-pushed the switchable-overlay branch 2 times, most recently from 11765e1 to 36444da Compare May 8, 2024 00:59
@dnqbob dnqbob force-pushed the switchable-overlay branch from 36444da to ec65e79 Compare May 8, 2024 01:18
else if (!string.IsNullOrEmpty(Info.DisabledSequence))
overlay.PlayRepeating(RenderSprites.NormalizeSequence(overlay, self.GetDamageState(), Info.DisabledSequence));
else if (!string.IsNullOrEmpty(Info.SwitchingSequence))
overlay.PlayRepeating(RenderSprites.NormalizeSequence(overlay, self.GetDamageState(), Info.SwitchingSequence));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm just wondering. Does this pattern exist anywhere else? It feels a bit wrong for it to not be handling conditions. Perhaps it should be handled in INotifyCreated?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nah, it just because if there is no sequence being played, AnimationWithOffset will crash:

var anim = new AnimationWithOffset(overlay, ...);

The lines here try to find out a valid sequence, or any valid sequence to fill the blank since you must allow a null value for all sequences.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the same even you move it to "INotifyCreated", and it is not related to conditions.

Copy link
Member

@PunkPun PunkPun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@PunkPun PunkPun merged commit 1a3d3cd into OpenRA:bleed May 19, 2024
@PunkPun
Copy link
Member

PunkPun commented May 19, 2024

changelog

@dnqbob dnqbob deleted the switchable-overlay branch May 23, 2024 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants