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

PipCount: 0 still occupies pip space causing offset issues with other visible pips #15546

Open
FrameLimiter opened this Issue Aug 20, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@FrameLimiter
Contributor

FrameLimiter commented Aug 20, 2018

A simple example is the ra stnk:
Give it a self reloading AmmoPool with a PipCount of zero. You'll notice the cargo pips display above the invisible AmmoPool pip row.
Ideally setting the pips to zero should also free up this unused pip space.

pip

@abcdefg30 abcdefg30 added the Bug label Aug 21, 2018

@MunWolf

This comment has been minimized.

Show comment
Hide comment
@MunWolf

MunWolf Aug 21, 2018

Contributor

Best way to fix this would probably be to add a Where linq clause in SelectionDecorations.cs to filter out the IPips with a PipCount of 0, this would require adding a method / property to get that information from IPips.
pipSources = self.TraitsImplementing<IPips>().ToArray(); ->
pipSources = self.TraitsImplementing<IPips>().Where(p -> p.PipCount()).ToArray();

EDIT: You could also not add the new method and just do a count on the IEnumerable that is returned by the method in IPips

Contributor

MunWolf commented Aug 21, 2018

Best way to fix this would probably be to add a Where linq clause in SelectionDecorations.cs to filter out the IPips with a PipCount of 0, this would require adding a method / property to get that information from IPips.
pipSources = self.TraitsImplementing<IPips>().ToArray(); ->
pipSources = self.TraitsImplementing<IPips>().Where(p -> p.PipCount()).ToArray();

EDIT: You could also not add the new method and just do a count on the IEnumerable that is returned by the method in IPips

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment