Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WithSwitchableOverlay for Firestrom Generator #21413

Merged
merged 2 commits into from
May 19, 2024

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

OpenRA.Mods.Common/Traits/Render/WithSwitchableOverlay.cs Outdated Show resolved Hide resolved
OpenRA.Mods.Common/Traits/Render/WithSwitchableOverlay.cs Outdated Show resolved Hide resolved
mods/ts/rules/gdi-structures.yaml Show resolved Hide resolved
@PunkPun PunkPun mentioned this pull request May 7, 2024
5 tasks
mods/ts/sequences/structures.yaml Outdated Show resolved Hide resolved
mods/ts/rules/gdi-structures.yaml Outdated Show resolved Hide resolved
@dnqbob dnqbob force-pushed the switchable-overlay branch 2 times, most recently from 11765e1 to 36444da Compare May 8, 2024 00:59
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
3 checks passed
@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.

None yet

2 participants