Skip to content

Conversation

0HyperCube
Copy link
Contributor

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.

  • PR author has checked that this PR works as intended and doesn't
    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)
  • Initial code review passed (this and further items should not be checked by the PR author)
  • Functionality is confirmed working by another person (see above checklist link)
  • Final code review is passed and code conforms to the
    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.

@revolutionary-bot
Copy link

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.

@0HyperCube 0HyperCube force-pushed the limit-tooltip-size branch from 1d3c1c3 to b9a147f Compare May 30, 2025 17:50
@0HyperCube 0HyperCube marked this pull request as ready for review June 1, 2025 20:06
@0HyperCube 0HyperCube marked this pull request as draft June 8, 2025 20:12
@hhyyrylainen
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
/// returns false
/// returns 0

Should it say this instead?

if (UnlockConditions == null)
return 0;

return UnlockConditions.Select(entry => entry.Progress(worldAndPlayerData)).Max();
Copy link
Member

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;
Copy link
Member

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.

@hhyyrylainen hhyyrylainen moved this from In progress to started but stuck (help wanted) in Thrive Planning Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: started but stuck (help wanted)
Development

Successfully merging this pull request may close these issues.

Do something about too long list of unlock conditions that goes offscreen
3 participants