Skip to content

[CHORE] Add null-safety to 5 classes in funkin.play #4788

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

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

VioletSnowLeopard
Copy link
Contributor

A contribution towards #4303.

This PR adds null-safety to:

  • Countdown
  • PauseSubState
  • GitarooPause
  • ResultScore
  • ScoreNum

Because GameoverSubState, ResultState, and PlayStatePlaylist are already null-safe, this PR makes it so almost all base funkin.play classes have null-safety. The last one would be PlayState. (That file is over 3000 lines long, so it would probably need its own dedicated PR)

(Even though PlayState isn't null-safe yet, I still added checks for its values in Countdown and PauseSubState)

Some Notes for ResultScore and ScoreNum

In ResultScore, there was a variable initialized without a value, but it was unused except in commented-out code, so I removed it and the commented-out code associated with it.

In ScoreNum, there were two public variables initialized without a value (a FlxTimer and a FlxTween), but they were only ever referred to once in the class and no other classes accessed these variables. This meant I could safely remove these variables and set the FlxTimer and FlxTween by themselves instead.

@github-actions github-actions bot added status: pending triage Awaiting review. size: large A large pull request with more than 100 changes. pr: haxe PR modifies game code. labels Apr 23, 2025
@AbnormalPoof AbnormalPoof added the type: chore Involves minor adjustments that do not make functional changes. label Apr 23, 2025
@AbnormalPoof
Copy link
Collaborator

friday night funkin null safety (all bosses)

@NotHyper-474
Copy link
Contributor

I actually have a branch where I'm implementing null-safety for PlayState and LoadingState, it's nearly complete, just needs some final polishing.

I also wanted to include it in #4787 but felt it was too unrelated.

@VioletSnowLeopard VioletSnowLeopard force-pushed the funkin-null-safe-play-classes branch 2 times, most recently from de1f496 to 0703b89 Compare April 23, 2025 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr: haxe PR modifies game code. size: large A large pull request with more than 100 changes. status: pending triage Awaiting review. type: chore Involves minor adjustments that do not make functional changes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants