Funkin icon indicating copy to clipboard operation
Funkin copied to clipboard

Strumline / Notes background dim + Number preferences

Open prplnorangesoda opened this issue 9 months ago • 8 comments

I made a background dim option because my eyes aren't what they used to be and it started getting harder to see the arrows against the background. Other than that, it's a pretty nice accessibility option, for those who'd rather focus on the gameplay over the art (but why would you?) Up to y'all how much you want the max amount of dim to be if merged, I set it to 100% opaque.

Because I wanted this to be a preference, I engineered in a hacky TextMenuItem wrapper that lets you increment a number with a single key.

(not selected)

image

(selected)

image

(in-game)

image

This also comes with a bunch of written documentation for some pre-existing functions because VSCode was yelling at me lmao

this is an incredibly hacky PR. would love comments of improvements.

Note: THIS WILL BREAK ON BLAZIN! Here's an example commit to assets/preload/scripts/songs/blazin.hxc if this is merged that will fix it.

To-do:

  • [x] Configurable option -- (Note: You can only go up, and you can't adjust the increment. I wanna address that)
  • [x] Actual object to adjust alpha of in PlayState (possibly in hoveringStuff?) -- PlayState.instance.strumlineBackground

prplnorangesoda avatar May 09 '24 03:05 prplnorangesoda

~~also I need help undoing some submodule changes because I'm a dumb stupid idiot and was testing with image assets before landing on text-only and I don't know how to undo my changes to a submodule 😭😭~~

the submodule conflict has been fixed

prplnorangesoda avatar May 09 '24 03:05 prplnorangesoda

Commit history is dirty because of rebase (i branched off main instead of develop)

prplnorangesoda avatar May 10 '24 03:05 prplnorangesoda

very cool

amyspark-ng avatar May 10 '24 22:05 amyspark-ng

I'll keep this open but I will say off the top of my own head right now, this might be an unplanned feature for now. If you see me close this, it means it's definitely unplanned (as I would have consulted with others on da game design side of crew)

ninjamuffin99 avatar May 15 '24 01:05 ninjamuffin99

That's fine. ~~I'll open it as an enhancement issue if this PR is closed if that's okay~~ I'll rewrite this as a mod and publish it on my own if it's closed

prplnorangesoda avatar May 15 '24 03:05 prplnorangesoda

Note, this might conflict with #2793 and #2602, both of which implement alternate control types to the options menu.

EliteMasterEric avatar Jun 17 '24 04:06 EliteMasterEric

@prplnorangesoda was going to look at this but it appears to have merge conflicts. Maybe we can rework this for some of the other custom preferences PRs that have been coming in

EliteMasterEric avatar Jun 29 '24 01:06 EliteMasterEric

@EliteMasterEric sure! I (or someone else) can adapt the code to a specific PR if you'd like. The PlayState code just requires a float value from Preferences.

PlayState.hx:1745

...
opponentStrumline.zIndex = 1000;
opponentStrumline.cameras = [camHUD];

+ strumlineBackground.alpha = Preferences.gameplayBackgroundAlpha;
// Position the background slightly offset from the strumbar for a bit of padding
strumlineBackground.x = (FlxG.width / 2 + Constants.STRUMLINE_X_OFFSET) - 15;
strumlineBackground.y = 0;
strumlineBackground.zIndex = 600; // Renders beneath the health bar
strumlineBackground.cameras = [camHUD];

Preferences.hx:160


  /**
   * How dark the black screen behind gameplay should be.
   *
   * 0 = fully transparent. 1 = opaque.
   * @default `0`
   */
  public static var gameplayBackgroundAlpha(get, set):Float;

  static function get_gameplayBackgroundAlpha():Float
  {
    return Save?.instance?.options?.gameplayBackgroundAlpha ?? 0;
  }

  static function set_gameplayBackgroundAlpha(value:Float):Float
  {
    var save:Save = Save.instance;
    save.options.gameplayBackgroundAlpha = value;
    save.flush();
    return value;
  }

The rest of the code in this PR is implementation for these two additions; adapting these should be easy. I've changed my work environment since I put in this PR so I'd have to set up the repo again 😭

prplnorangesoda avatar Jun 30 '24 07:06 prplnorangesoda

Going to supersede this PR with its sloppy commit history with a new PR making use of features implemented in #2942. Will mention here when I open it.

prplnorangesoda avatar Jul 02 '24 16:07 prplnorangesoda

#2949 supersedes this

prplnorangesoda avatar Jul 02 '24 19:07 prplnorangesoda