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

Make milestone list scrollable and support more milestones #19

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

veger
Copy link
Collaborator

@veger veger commented Feb 7, 2024

By embedding the milestone elements in a (virtual) scroll list, it will be possible to scroll them, which lifts the restriction of only allowing 60 milestones.

Background: when playing extensive mod packs with lots of new/unknown technologies it is often hard to determine the research path to take. I find it convenient to add a lot (all) technologies to the milestone list, so YAFC shows which technologies I should research to unlock some item/recipe.

This PR also fixes the original (probable) reason for this limitation: ulong can only hold 64 bits, and the Analyser uses bits to keep track of the dependencies of the milestones (and other objects). By replacing ulong with the custom build Bits class, this limitation is lifted.

To be more confident that I did not break things, I first added a (simple) test suite for milestones. Then applied the changes and with minimal changed (had to use the Bits class now) the test suite still runs properly.
Additionally, I made these changes more than a year ago (ShadowTheAge#203) and have been playing with loads/all (!) technologies of Pyanodons added to the milestones without issues:

image

Note that these (open) PRs are very convenient combined with this feature:

I'll open PRs for these features after this one (to keep the list of open PRs reasonable)

Introduces a Bits class that is able to handle a dynamic amount of bits,
instead of the 64 bits stored in the ulong.
@shpaass shpaass merged commit deec621 into shpaass:master Feb 7, 2024
@veger veger deleted the scrollable-milestone-view-ce branch February 7, 2024 20:47
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.

2 participants