-
Notifications
You must be signed in to change notification settings - Fork 34
feat: Show cost breakdown in tooltip #509
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
base: master
Are you sure you want to change the base?
feat: Show cost breakdown in tooltip #509
Conversation
|
Something to note; The current UI rendering pipeline is a "draw-once" pipeline, that can't react to keyboard modifier changes currently. That means you have to hold control then hover an item to see the tooltip change, as we only build the tooltip content when we hover. I can add a way to react to control state changes and redraw portions of the UI, but it's not relevant to this PR. |
Depends on how much it's going to complicate the current code. I have many questions to Yafc UI code, but I need to read quite a bit of theory before I can formulate my opinion about it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the numbers displayed in the sample tooltip. The logistics cost is negative, and I expected the per unit cost to be either ¥305 (per-50-units or per-recipe-cycle) or ¥6.1 (per single unit).
Are the displayed values the expected ones?
Not entirely true, you just need to use different Win32 APIs to handle inputs. The SDL input events are only fired while the window is focused (for the most part). You can simply use GetAsyncKeyState to get the current state of any key (including modifiers), even when not focused. |





This pull request introduces a feature that displays a detailed cost breakdown when holding the Ctrl key over an item.