Funkin icon indicating copy to clipboard operation
Funkin copied to clipboard

Field Read and Write Overloading for Prefereneces

Open saturn-volv opened this issue 1 year ago • 2 comments

This adds an abstracted PreferenceMap, which behaves as a StringMap but with some field read and write overloading.

So now instead of needing to call:

Save.instance.options.downscroll = true;

You can accomplish the same thing with:

Preferences.get().downscroll = true;

There are other use cases for this but I'm tired and cannot bring myself to list them all right now

saturn-volv avatar May 08 '24 11:05 saturn-volv

return get().value = value;

I initially did but the code style doesn't want inner assignment used. image

saturn-volv avatar May 09 '24 07:05 saturn-volv

i forgot codestyle exists whoopsm..

Raltyro avatar May 09 '24 07:05 Raltyro

This looks like a great bit of code cleanup!

Also, the codestyle is bugged, it should be allowing inner assignment in return statements.

EliteMasterEric avatar May 30 '24 02:05 EliteMasterEric

I just looked into this more and I actually don't think this is much of an improvement over the existing Preferences map.

EliteMasterEric avatar Sep 22 '24 04:09 EliteMasterEric