Skip to content

Conversation

PurSnake
Copy link
Contributor

@PurSnake PurSnake commented Aug 26, 2025

Description

Rework of base preferences system (not including mobile specific, only base prefs)

  • Allow mods to add custom preferences.
  • Separate default and mods preferences.
  • Implement checkbox preference.
  • Implement number preference.
  • Implement percentage preference.
  • Implement enum preference.
  • Move ALL default preferences into data/preferences.json
  • DefineUtil.
  • Replace every default pref call with getPref.

Mods can add their own custom preferences via Polymod's _merge folder
Example: coolMod/_merge/data/preferences.json

[
  {
    "op": "add",
    "path": "/-",
    "value": {
      "name": "Test Two",
      "desc": "Desc2",
      "defaultValue": true,
      "saveId": "testPref2",
      "type": "checkbox",
      //Wont load any script, cuz it doesnt exists.
      "script": "NullScript"
    }
  },
  {
    "op": "add",
    "path": "/-",
    "value": {
      "name": "Test Number",
      "desc": "Desc Number",
      "defaultValue": 0.5,

      "min": 0.15,
      "max": 2.6,
      "step": 0.15,
      "precision": 3,

      "saveId": "testPref3",
      "type": "number"
    }
  },
  {
    "op": "add",
    "path": "/-",
    "value": {
      "name": "Test Percent",
      "desc": "Desc Percent",
      "defaultValue": 20,

      "min": 0,
      "max": 200,

      "saveId": "testpref4",
      "type": "percent"
    }
  },
  {
    "op": "add",
    "path": "/-",
    "value": {
      "name": "Test Enum",
      "desc": "Desc Enum",
      "defaultValue": "None",
      "options": {
        "None": "Nothing",
        "one": "First",
        "two": "Second",
        "three": "Third"
      },
      "saveId": "testpref5",
      "type": "enum"
    }
  }
]

@github-actions github-actions bot added size: large A large pull request with more than 100 changes. pr: haxe PR modifies game code. status: pending triage Awaiting review. labels Aug 26, 2025
PurSnake and others added 3 commits August 26, 2025 16:54
todo: remove this line cuz of ```allowThisPreference```
@AbnormalPoof AbnormalPoof added type: enhancement Involves an enhancement or new feature. topic: mods Related to the creation or use of mods. status: needs revision Cannot be approved because it is awaiting some work by the contributor. and removed status: pending triage Awaiting review. labels Aug 26, 2025
@AbnormalPoof
Copy link
Member

NOTE: Applying status: needs revision as this PR is a draft.

Added Number and Percentage preferences
Reworked a bit preferences loading (A LOT)
Reworked how user recievev pref value
DefineUtil yo
@github-actions github-actions bot added size: huge A huge pull request with more than 500 changes. and removed size: large A large pull request with more than 100 changes. labels Aug 26, 2025
@PurSnake PurSnake marked this pull request as ready for review August 27, 2025 21:05
@PurSnake
Copy link
Contributor Author

PurSnake commented Aug 27, 2025

Done, methinks

@PurSnake PurSnake changed the title Data driven preferences [MODS] [BC] [ENHANCEMENT?] Data driven preferences [MODS] [BREAKIN CHANGE?] [ENHANCEMENT?] Aug 27, 2025
@PurSnake PurSnake changed the title Data driven preferences [MODS] [BREAKIN CHANGE?] [ENHANCEMENT?] Data driven preferences [MODS] [BREAKING CHANGE?] [ENHANCEMENT?] Aug 27, 2025
@Hundrec Hundrec changed the title Data driven preferences [MODS] [BREAKING CHANGE?] [ENHANCEMENT?] [ENHANCEMENT] [MODS] Data driven preferences Aug 29, 2025
@JugieNoob
Copy link
Contributor

JugieNoob commented Aug 30, 2025

Does this change still allow a modder to access a specific option in a script?

Example (screenshot taken on 0.7.3 Develop):

Strumline shows up when selecting the middlescroll option...
{D4D92E24-66A2-4684-81FC-56DF59B22678}
...but doesn't appear on any other option.
{8395317A-504E-4702-A4E1-DCC957201E37}

This isn't something that's needed but it would be nice to have!

@PurSnake
Copy link
Contributor Author

Does this change still allow a modder to access a specific option in a script?

Example (screenshot taken on 0.7.3 Develop):

Strumline shows up when selecting the middlescroll option... {D4D92E24-66A2-4684-81FC-56DF59B22678} ...but doesn't appear on any other option. {8395317A-504E-4702-A4E1-DCC957201E37}

This isn't something that's needed but it would be nice to have!

I guess so 👍

@JugieNoob
Copy link
Contributor

Does this change still allow a modder to access a specific option in a script?
Example (screenshot taken on 0.7.3 Develop):
Strumline shows up when selecting the middlescroll option... {D4D92E24-66A2-4684-81FC-56DF59B22678} ...but doesn't appear on any other option. {8395317A-504E-4702-A4E1-DCC957201E37}
This isn't something that's needed but it would be nice to have!

I guess so 👍

So it does work with this PR? Just to be clear I didn't test it with this PR just FNF 0.7.3 and 0.7.3 Develop.

@PurSnake
Copy link
Contributor Author

PurSnake commented Sep 3, 2025

oh
image

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: huge A huge pull request with more than 500 changes. status: needs revision Cannot be approved because it is awaiting some work by the contributor. topic: mods Related to the creation or use of mods. type: enhancement Involves an enhancement or new feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants