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

Colorize (red) negative values on city dialog #2250

Merged
merged 2 commits into from
Mar 31, 2024

Conversation

jwrober
Copy link
Collaborator

@jwrober jwrober commented Mar 30, 2024

Closes #1511

@jwrober jwrober requested a review from lmoureaux March 30, 2024 23:19
@jwrober
Copy link
Collaborator Author

jwrober commented Mar 30, 2024

CodeFactor found an issue with something I didn't change. Interesting.

Copy link
Contributor

@lmoureaux lmoureaux left a comment

Choose a reason for hiding this comment

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

CodeFactor found an issue with something I didn't change. Interesting.

You did change the method it's pointing at 😃

I don't think trade, lux, or science can go negative. How much of this code could be factored out in a utility function?

@jwrober
Copy link
Collaborator Author

jwrober commented Mar 30, 2024

I don't think trade, lux, or science can go negative. How much of this code could be factored out in a utility function?

If they don't go negative, then why "surplus"?

IDK on the second question. Why the need for another function when in-line IF does the trick?

@lmoureaux
Copy link
Contributor

If they don't go negative, then why "surplus"?

Good question 🤣

IDK on the second question. Why the need for another function when in-line IF does the trick?

To avoid repeating the same code many times (so when we update it we update it everywhere…)

Also: do we need a different color for the classic theme?

@jwrober
Copy link
Collaborator Author

jwrober commented Mar 30, 2024

Also: do we need a different color for the classic theme?

The hard code "white" is an issue with Classic. Is there a way to unset a stylesheet?

@jwrober
Copy link
Collaborator Author

jwrober commented Mar 30, 2024

I guess I could do a bigger IF with a collection of OR in the evaluation to reduce the number of them.

@lmoureaux
Copy link
Contributor

Where do we have white? I see white-space and red

@jwrober jwrober merged commit 23a9564 into longturn:master Mar 31, 2024
19 of 20 checks passed
@jwrober jwrober deleted the bugfix/color-negative-food branch March 31, 2024 15:46
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.

Colorize/highlight the city growth if its negative
2 participants