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 fuel consumption recipe for products #109

Merged
merged 3 commits into from
May 10, 2024
Merged

Conversation

Dorus
Copy link
Collaborator

@Dorus Dorus commented May 5, 2024

Fixes #76

example

This adds the option for products that are usable as fuel, to select a recipe based on that fuel consumption. YaFC will then attempt to add said recipe using the selected fuel.

I had to do some performance optimization since the electric power, or biomass, tends to select most py recipes (!), i saw over 8000 of them in my debugger. It now pre-sorts the list when the popup is opened, not each time you move the mouse over.

@shpaass
Copy link
Owner

shpaass commented May 5, 2024

example

For some reason, I can't see the example image in your initial message. Have you put it into a message differently from pasting it with Ctrl+V?

@shpaass
Copy link
Owner

shpaass commented May 5, 2024

This adds the option for products that are usable as fuel, to select a receipt based on that fuel consumption.

Did you mean recipe instead of receipt?

@Dorus
Copy link
Collaborator Author

Dorus commented May 5, 2024

example

For some reason, I can't see the example image in your initial message. Have you put it into a message differently from pasting it with Ctrl+V?

Oops, i tried to copy the image from #76 (comment) and somehow messed up. Should work now.

This adds the option for products that are usable as fuel, to select a receipt based on that fuel consumption.

Did you mean recipe instead of receipt?

Yes.

@shpaass
Copy link
Owner

shpaass commented May 5, 2024

For clarity, I advise to fix the recipe typo across this PR and the linked issue. This word has been used quite a number of times in them.

@shpaass
Copy link
Owner

shpaass commented May 6, 2024

Fixes #76

I think that Hint: ctrl+click to add multiple needs to be shown only once instead of thrice.

I also think that headers like Add consumption recipe need to be a bit smaller because now there are more of them.

@Dorus
Copy link
Collaborator Author

Dorus commented May 6, 2024

afbeelding

Made it so the hint only shows up once. Also decreased the header size. This will affect a few more pop-ups since this display function is reused a few times.

Yafc.UI/Rendering/Font.cs Outdated Show resolved Hide resolved
@Dorus
Copy link
Collaborator Author

Dorus commented May 6, 2024

One question, do we prefer to keep a linear commit history to see how we progressed and improved the code, or would a rebase that squashes it all minor changes together be preferable?

@shpaass
Copy link
Owner

shpaass commented May 6, 2024

do we prefer to keep a linear commit history to see how we progressed and improved the code, or would a rebase that squashes it all minor changes together be preferable?

Our goal is to make the commit history as understandable as possible. It means that ideally we want changes to be separated into logical steps of digestable size, without ad-hoc hotfixes or previous versions.

However, I also understand how much effort and energy that can take. So I would say go for low-hanging fruits like squashing hotfixes, and separating formatting updates from logic changes. The rest is optional and depends on how good you want it to be.

@Dorus
Copy link
Collaborator Author

Dorus commented May 6, 2024

My typical commit history is an utter mess of small tries and fixes so i prefer to rebase a lot and squash related changes together. If only because that makes it so much easier for myself to review the changes and make later rebases so much smoother too. I'm also getting quite adept with the git rebase -i command ^_^

@shpaass
Copy link
Owner

shpaass commented May 6, 2024

I see you're a man of culture as well. Props to a git rebase -i enjoyer :D
Don't forget about git commit --fixup=%commitHash% and git rebase -i --autosquash.

Dorus added 3 commits May 10, 2024 09:17
perf: sort add fuel list once, not in display loop

feat: prefer selected fuel
@shpaass shpaass merged commit 3e55845 into shpaass:master May 10, 2024
1 check passed
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.

Add fuel consumption recipes to item popup
2 participants