diff --git a/CommunityBugFixCollection/BugFixOptions.cs b/CommunityBugFixCollection/BugFixOptions.cs index 1ead671..917b7ad 100644 --- a/CommunityBugFixCollection/BugFixOptions.cs +++ b/CommunityBugFixCollection/BugFixOptions.cs @@ -4,20 +4,27 @@ namespace CommunityBugFixCollection { internal sealed class BugFixOptions : SingletonConfigSection { + private static readonly DefiningConfigKey _forceAprilFools = new("ForceAprilFools", "Whether to force April Fools content to be active.", () => false); + private static readonly DefiningConfigKey _useIecByteFormat = new("UseIecByteFormat", "Whether to format bytes using IEC as opposed to decimal format when LocalizedByteFormatting is enabled.", () => true); /// public override string Description => "Contains the settings for the few fixes that offer them."; + /// + /// Gets whether to force April Fools content to be active. + /// + public bool ForceAprilFools => _forceAprilFools; + /// public override string Id => "Options"; /// /// Gets whether should format bytes using IEC or decimal format. /// - public bool UseIecByteFormat => _useIecByteFormat.GetValue(); + public bool UseIecByteFormat => _useIecByteFormat; /// - public override Version Version { get; } = new(1, 0, 0); + public override Version Version { get; } = new(1, 1, 0); } } \ No newline at end of file diff --git a/CommunityBugFixCollection/Locale/de.json b/CommunityBugFixCollection/Locale/de.json index 10bbadd..358e062 100644 --- a/CommunityBugFixCollection/Locale/de.json +++ b/CommunityBugFixCollection/Locale/de.json @@ -37,6 +37,7 @@ "CommunityBugFixCollection.NoLossOfColorProfile.Description": "Verhindert, dass Farbprofile nicht bei allen Berechnungen erhalten bleiben.", "CommunityBugFixCollection.NoZeroScaleToolRaycast.Description": "Verhinder einen Crash wenn (Multi-)Werkzeuge auf null skaliert werden.", "CommunityBugFixCollection.NodeNameAdjustments.Description": "Verbessert die verwirrenden Namen der Remap [-1; 1] zu [0; 1] ProtoFlux Nodes.", + "CommunityBugFixCollection.NoFunForCorporate.Description": "Verhindert, dass Aprilscherz-Inhalte ausgelöst werden, wenn der Nutzer in einem Universe ist.
Dies wird durch die Erzwinge Aprilscherze Einstellung überschrieben, welche erzwingt, dass diese Inhalte aktiv sind.", "CommunityBugFixCollection.NonHDRColorClamping.Description": "Korrigiert, dass die nicht-HDR Varianten der Color(X) Kanal-Additionen die Werte nicht limitieren.", "CommunityBugFixCollection.NonLinearColorXFromHexCode.Description": "Zwingt colorX From HexCode das sRGB statt dem Linearen Farbprofil zu nutzen.", "CommunityBugFixCollection.NoParentUnderSelfAudioClipPlayer.Description": "Verhindert, dass die ChildParentAudioClipPlayer-Komponente das Spiel crasht, wenn ihr ParentUnder-Feld auf den Slot, auf dem sie ist, gesetzt ist. Fügt außerdem eine Erklärung des Problems im Header hinzu.", @@ -51,6 +52,8 @@ "CommunityBugFixCollection.Config.Options.Name": "Optionen", "CommunityBugFixCollection.Config.Options.Description": "Enthällt die Einstellungen für die wenigen Fixes die diese anbieten.", + "CommunityBugFixCollection.Config.Options.ForceAprilFools.Name": "Erzwinge Aprilscherze", + "CommunityBugFixCollection.Config.Options.ForceAprilFools.Description": "Ob Aprilscherz-Inhalte erzwungenermaßen aktiv sein sollen.", "CommunityBugFixCollection.Config.Options.UseIecByteFormat.Name": "IEC Byte-Format Benutzen", "CommunityBugFixCollection.Config.Options.UseIecByteFormat.Description": "Ob Bytes nach IEC (Faktor 1024) statt dezimal (Faktor 1000) formatiert werden sollen, wenn LocalizedByteFormatting aktiviert ist.", diff --git a/CommunityBugFixCollection/Locale/en.json b/CommunityBugFixCollection/Locale/en.json index bc4bb26..4728619 100644 --- a/CommunityBugFixCollection/Locale/en.json +++ b/CommunityBugFixCollection/Locale/en.json @@ -43,6 +43,7 @@ "CommunityBugFixCollection.NoLossOfColorProfile.Description": "Fixes Color Profile not being preserved on all operations.", "CommunityBugFixCollection.NoZeroScaleToolRaycast.Description": "Fixes a crash when a (multi)tool is scaled to zero.", "CommunityBugFixCollection.NodeNameAdjustments.Description": "Fixes the confusing names of the Remap [-1; 1] to [0; 1] ProtoFlux nodes.", + "CommunityBugFixCollection.NoFunForCorporate.Description": "Prevents April Fools related content from triggering when the user is in a Universe.
This is overridden by the Force April Fools setting, which forces this content to be active.", "CommunityBugFixCollection.NonHDRColorClamping.Description": "Fixes non-HDR variants of Color(X) channel addition not clamping.", "CommunityBugFixCollection.NonLinearColorXFromHexCode.Description": "Forces colorX From HexCode to use the sRGB rather than Linear profile.", "CommunityBugFixCollection.NoParentUnderSelfAudioClipPlayer.Description": "Prevents the ChildParentAudioClipPlayer components from crashing the game if their ParentUnder field is set to the slot that it's on. Also adds a header text explaining the problem.", @@ -57,6 +58,8 @@ "CommunityBugFixCollection.Config.Options.Name": "Options", "CommunityBugFixCollection.Config.Options.Description": "Contains the settings for the few fixes that offer them.", + "CommunityBugFixCollection.Config.Options.ForceAprilFools.Name": "Force April Fools", + "CommunityBugFixCollection.Config.Options.ForceAprilFools.Description": "Whether to force April Fools content to be active.", "CommunityBugFixCollection.Config.Options.UseIecByteFormat.Name": "Use IEC Byte Format", "CommunityBugFixCollection.Config.Options.UseIecByteFormat.Description": "Whether to format bytes using IEC (factor 1024) as opposed to decimal format (factor 1000) when LocalizedByteFormatting is enabled.", diff --git a/CommunityBugFixCollection/NoFunForCorporate.cs b/CommunityBugFixCollection/NoFunForCorporate.cs new file mode 100644 index 0000000..c00967d --- /dev/null +++ b/CommunityBugFixCollection/NoFunForCorporate.cs @@ -0,0 +1,39 @@ +using FrooxEngine; +using HarmonyLib; + +namespace CommunityBugFixCollection +{ + [HarmonyPatch] + [HarmonyPatchCategory(nameof(NoFunForCorporate))] + internal sealed class NoFunForCorporate : ResoniteBugFixMonkey + { + public override IEnumerable Authors => Contributors.Banane9; + + [HarmonyPrefix] + [HarmonyPatch(typeof(Engine), nameof(Engine.IsAprilFools), MethodType.Getter)] + private static bool EngineIsAprilFoolsPrefix(ref bool __result) + { + if (!Enabled) + return true; + + if (ConfigSection.ForceAprilFools) + { + __result = true; + return false; + } + + if (Engine.Current.InUniverse) + { + __result = false; + return false; + } + + return true; + } + + [HarmonyPrefix] + [HarmonyPatch(typeof(ViolentAprilFoolsExplosion), nameof(ViolentAprilFoolsExplosion.OnDestroying))] + private static bool ViolentAprilFoolsExplosionOnDestroyingPrefix() + => !Enabled || ConfigSection.ForceAprilFools || !Engine.Current.InUniverse; + } +} \ No newline at end of file diff --git a/README.md b/README.md index 2ae0577..e15e016 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ just disable them in the settings in the meantime. * Animators updating all associated fields every frame while enabled but not playing (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3480) * Grid World floor shaking on AMD and Intel GPUs (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3829) * DuplicateSlot ProtoFlux node crashes game when if OverrideParent is identical to Template (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3950) +* April Fools content is active for users in Universes (commercial usage) (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/4016) * Instantly removing an AudioOutput component crashes the session (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/4286) Fixes with no issue (that could be found). @@ -91,7 +92,8 @@ just disable them in the settings in the meantime. ## Closed Issues -The issues that were first closed in this mod but have officially been closed now will be linked in the following list. +The issues that were first covered by this mod, +but have officially been implemented now, will be linked in the following list. If they appear here, their implementation has been removed from the mod, unless it is marked with `(Legacy)`. In that case, the original fix is left in but disabled by default.