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

ACHIEVEMENTS: Support achievements with no matching Steam achievement #1508

Open
wants to merge 10 commits into
base: dev
Choose a base branch
from

Conversation

robofinch
Copy link
Contributor

Bitburner achievements have been limited by Steam's cap of 100 achievements for games with limited profile features, but we can add more achievements internally. This change makes a few changes to allow the creation of new Bitburner achievements with no equivalent Steam achievement, including adding an optional NotInSteam boolean to the Achievement interface, and updates the Achievements page with new UI to display this to players. I tested the changes by temporarily setting NotInSteam to true for several existing achievements, and finally adding a new achievement (all in a different branch not in this pull request, achievements-test in my fork). The achievement README, which describes how to add a new achievement, was updated to (hopefully) explain how to do so going forward.

The achievements still properly save and load on both the web and electron versions, and connecting to Steam did not cause any issues.

Screenshots of UI changes:
(note that the branch actually being merged would still show, e.g., Acquired (1/98, 1/98 for Steam))

Screen Shot 2024-07-21 at 1 09 25 AM Screen Shot 2024-07-21 at 1 08 58 AM Screen Shot 2024-07-21 at 1 06 49 AM

Copy link
Collaborator

@d0sboots d0sboots left a comment

Choose a reason for hiding this comment

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

Overall, this looks good to me. @Snarling for approval on the idea, since this would be a significant (but IMO good) shift in how we handle achievements.

# Make background transparent and replace green with black
# The icons will be recolored by css filters matching the player's theme
# MacOS uses FreeBSD-style sed instead of GNU sed
sed -i '' "s/fill:#000000;/fill-opacity: 0%;/g" "$i"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Instead of forking off a whole new script, use the following syntax:
sed -i"" "s/fill:#000000;/fill-opacity: 0%;/g" "$i"

The lack of space after the -i is the key here. This works for GNU sed (I tested it); it should work for BSD (aka MacOS) sed as well (you can test).

// Most parts of the four categories in the old code were very similar (besides the content of
// AccordianDetails), with the Acquired category having a few differences,
// although both the Acquired and Locked categories also had an extra prop in the AccordianDetails.
// The 264px minWidth feels scuffed, but fixes an edge case.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please say what the edge case is.

sx,
children,
}: React.PropsWithChildren<IProps>): JSX.Element {
// Most parts of the four categories in the old code were very similar (besides the content of
Copy link
Collaborator

Choose a reason for hiding this comment

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

These lines can probably be removed. Comments should document the code as it is, not in reference to as it was. It was useful to read right now, though.

title: string;
achievements: { achievement: Achievement }[];
allAchievements?: { achievement: Achievement }[];
sx?: boolean;
Copy link
Collaborator

Choose a reason for hiding this comment

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

The sx prop name doesn't make sense, and also it isn't the right type for a usual sx prop.

I would either call this something like "pad", or just pass a full sx through.

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