1
0
Fork 0
mirror of https://github.com/ninjamuffin99/Funkin.git synced 2024-11-15 19:33:36 +00:00
Funkin/source/funkin/data
2024-09-06 20:23:21 -04:00
..
animation
character
dialogue
event Fixes for scripted song events, define vocal tracks per variation, display suffixed difficulties properly. 2024-07-28 01:42:09 -04:00
freeplay Cleanup character unlock impl and queue it for after Story Mode is completed. 2024-09-05 17:54:03 -04:00
notestyle Custom coutndown, judgements, and combo count now use the note style file instead of hardcoded paths. 2024-07-28 17:10:32 -04:00
song Merge branch 'rewrite/master' into bugfix/friday-fixes 2024-09-03 23:42:51 -04:00
stage registry updates 2024-09-07 00:52:38 +01:00
story/level Updated compile defines to use feature flag system 2024-08-26 18:01:36 -04:00
BaseRegistry.hx Custom coutndown, judgements, and combo count now use the note style file instead of hardcoded paths. 2024-07-28 17:10:32 -04:00
DataError.hx
DataParse.hx
DataWrite.hx
IRegistryEntry.hx
JsonFile.hx
README.md

funkin.data

Data structures are parsed using json2object, which uses macros to generate parser classes based on anonymous structures OR classes.

Parsing errors will be returned in parser.errors. See json2object.Error for an enumeration of possible parsing errors. If an error occurred, parser.value will be null.

The properties of these anonymous structures can have their behavior changed with annotations:

  • @:optional: The value is optional and will not throw a parsing error if it is not present in the JSON data.
  • @:default("test"): If the value is optional, this value will be used instead of null. Replace "test" with a value of the property's type.
  • @:default(auto): If the value is an anonymous structure with json2object annotations, each field will be initialized to its default value.
  • @:jignored: This value will be ignored by the parser. Their presence will not be checked in the JSON data and their values will not be parsed.
  • @:alias: Choose the name the value will use in the JSON data to be separate from the property name. Useful if the desired name is a reserved word like public.
  • @:jcustomparse: Provide a custom function for parsing from a JSON string into a value.
    • Functions must be of the signature (hxjsonast.Json, String) -> T, where the String is the property name and T is the type of the property.
    • hxjsonast.Json contains a pos and a value, with value being an enum: https://nadako.github.io/hxjsonast/hxjsonast/JsonValue.html
    • Errors thrown in this function will cause a parsing error (CustomFunctionException) along with a position!
    • Make sure to provide the FULLY QUALIFIED path to the custom function.
  • @:jcustomwrite: Provide a custom function for serializing the property into a string for storage as JSON.
    • Functions must be of the signature (T) -> String, where T is the type of the property.