-
-
Notifications
You must be signed in to change notification settings - Fork 556
Limit unlock tooltip size #6161
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?
Limit unlock tooltip size #6161
Conversation
The lead programmer for Thrive is currently on vacation until 2025-07-07. Until then other programmers will try to make pull request reviews, but please be patient if your PR is not getting reviewed. PRs may be merged after multiple programmers have approved the changes (especially making sure to ensure style guide conformance and gameplay testing are good). If there are no active experienced programmers who can perform merges, PRs may need to wait until the lead programmer is back to be merged. |
1d3c1c3
to
b9a147f
Compare
What still needs to be done for this PR? |
/// </summary> | ||
/// <param name="data"> | ||
/// The data about the world, if this condition doesn't handle the data of the given type this always | ||
/// returns false |
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.
/// returns false | |
/// returns 0 |
Should it say this instead?
if (UnlockConditions == null) | ||
return 0; | ||
|
||
return UnlockConditions.Select(entry => entry.Progress(worldAndPlayerData)).Max(); |
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.
This might allocate a temporary delegate...
var playerData = worldArgs.PlayerData; | ||
|
||
if (playerData == null) | ||
return null; |
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.
And also this I think causes boxing on the return value of this method.
Brief Description of What This PR Does
In order to rank the unlocks, we probably need a function to return the progress (0 to 1) of each unlock condition. Where multiple unlock conditions are required, the average is used. Where one is needed, the maximum can be taken.
Unlock conditions can then be sorted by the progress and only the first 4 displayed.
Related Issues
Closes #5936
Progress Checklist
Note: before starting this checklist the PR should be marked as non-draft.
break existing features:
https://wiki.revolutionarygamesstudio.com/wiki/Testing_Checklist
(this is important as to not waste the time of Thrive team
members reviewing this PR)
styleguide.
Before merging all CI jobs should finish on this PR without errors, if
there are automatically detected style issues they should be fixed by
the PR author. Merging must follow our
styleguide.