From e8cd87c1f141632795c1956da4183889a6a91f8f Mon Sep 17 00:00:00 2001 From: Abnormal <86753001+AbnormalPoof@users.noreply.github.com> Date: Wed, 11 Jun 2025 00:55:02 -0500 Subject: [PATCH] Add `FEATURE_NAUGHTYNESS` and turn it off for mobile builds --- project.hxp | 9 +++++++++ source/funkin/Preferences.hx | 4 ++++ source/funkin/ui/options/PreferencesMenu.hx | 2 ++ 3 files changed, 15 insertions(+) diff --git a/project.hxp b/project.hxp index 0560ebbf7..065d02953 100644 --- a/project.hxp +++ b/project.hxp @@ -401,6 +401,12 @@ class Project extends HXProject */ static final FEATURE_MOBILE_IAR:FeatureFlag = "FEATURE_MOBILE_IAR"; + /** + * `-DFEATURE_NAUGHTYNESS` + * If this feature flag is enabled, naughtyness will be a toggleable option in the Options Menu. + */ + static final FEATURE_NAUGHTYNESS:FeatureFlag = "FEATURE_NAUGHTYNESS"; + // // CONFIGURATION FUNCTIONS // @@ -758,6 +764,9 @@ class Project extends HXProject // Should be true only on mobile builds. FEATURE_TOUCH_CONTROLS.apply(this, isMobile()); + // Should be true on everything other than mobile. + FEATURE_NAUGHTYNESS.apply(this, !isMobile()); + // Should be true only on mobile release builds. Remember you can add the flag manually for testing. FEATURE_MOBILE_ADVERTISEMENTS.apply(this, (isMobile() && isRelease() && envConfig != null)); FEATURE_MOBILE_IAP.apply(this, (isMobile() && isRelease() && envConfig != null)); diff --git a/source/funkin/Preferences.hx b/source/funkin/Preferences.hx index 030ce9810..c8843e8d5 100644 --- a/source/funkin/Preferences.hx +++ b/source/funkin/Preferences.hx @@ -56,7 +56,11 @@ class Preferences static function get_naughtyness():Bool { + #if NO_FEATURE_NAUGHTYNESS + return false; + #else return Save?.instance?.options?.naughtyness; + #end } static function set_naughtyness(value:Bool):Bool diff --git a/source/funkin/ui/options/PreferencesMenu.hx b/source/funkin/ui/options/PreferencesMenu.hx index 24d3fd791..5ff0803d2 100644 --- a/source/funkin/ui/options/PreferencesMenu.hx +++ b/source/funkin/ui/options/PreferencesMenu.hx @@ -108,9 +108,11 @@ class PreferencesMenu extends Page */ function createPrefItems():Void { + #if FEATURE_NAUGHTYNESS createPrefItemCheckbox('Naughtyness', 'If enabled, raunchy content (such as swearing, etc.) will be displayed.', function(value:Bool):Void { Preferences.naughtyness = value; }, Preferences.naughtyness); + #end createPrefItemCheckbox('Downscroll', 'If enabled, this will make the notes move downwards.', function(value:Bool):Void { Preferences.downscroll = value; }, Preferences.downscroll,