Skip to content

Fix ProductionBar visually glitching for units without value#21088

Merged
PunkPun merged 1 commit into
OpenRA:bleedfrom
abcdefg30:negativeCostBar
Oct 11, 2023
Merged

Fix ProductionBar visually glitching for units without value#21088
PunkPun merged 1 commit into
OpenRA:bleedfrom
abcdefg30:negativeCostBar

Conversation

@abcdefg30
Copy link
Copy Markdown
Member

I made a unit buildable for testing purposes without giving them a cost/value. (The default for Valued.Cost even is zero.) That caused the production bar in TS to glitch to the bottom left for a brief second. Setting the value to one displays the bar correctly as full for the split second the unit is build.

@dnqbob
Copy link
Copy Markdown
Contributor

dnqbob commented Oct 3, 2023

How about use time instead of cost?

We also have InstantCashDrain in production queue, and it makes ProductionBar buggy too.

if (current == null)
value = 0;
else if (current.TotalCost <= 0)
value = 1;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

shouldn't this be 0 as well?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

No, the unit will be produced instantly so we want to display a full bar.

Setting the value to one displays the bar correctly as full for the split second the unit is build.

@PunkPun PunkPun merged commit 85c8f6c into OpenRA:bleed Oct 11, 2023
@PunkPun
Copy link
Copy Markdown
Member

PunkPun commented Oct 11, 2023

Changelog

@abcdefg30 abcdefg30 deleted the negativeCostBar branch October 11, 2023 11:18
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.

3 participants