Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
dotnet-version: 10.x
source-url: https://nuget.pkg.github.com/ResoniteModdingGroup/index.json

- name: Add MonkeyLoader NuGet Source
Expand All @@ -69,10 +69,6 @@ jobs:

- name: Move NuGet Packages
run: mv (Get-ChildItem -Recurse ./ -Include *.nupkg) ./

# Removes the version number from the package name
- name: Rename NuGet Packages
run: Get-ChildItem -Include *.nupkg -Path ./* | Rename-Item -NewName { $_.Name -Replace '\.\d+\.\d+\.\d+.*$','.nupkg' }

# Publish the NuGet package(s) as an artifact, so they can be used in the following jobs
- name: Upload NuGet Packages Artifact
Expand All @@ -81,7 +77,7 @@ jobs:
name: NuGet Packages
if-no-files-found: error
retention-days: 7
path: ./*.nupkg
path: ./CommunityBugFixCollection.nupkg

# Only when it's not from a PR to avoid any funny packages in the cache
- name: Save NuGet Package Cache
Expand All @@ -98,12 +94,9 @@ jobs:
- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
dotnet-version: 10.x
source-url: https://nuget.pkg.github.com/ResoniteModdingGroup/index.json

- name: Add MonkeyLoader NuGet Source
run: dotnet nuget add source https://pkg.munally.com/MonkeyModdingTroop/index.json

- name: Restore NuGet Package Cache
uses: actions/cache/restore@v4
with:
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,8 @@ jobs:
- name: Setup Dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: 9.x
dotnet-version: 10.x
source-url: https://nuget.pkg.github.com/ResoniteModdingGroup/index.json

- name: Add MonkeyLoader NuGet Source
run: dotnet nuget add source https://pkg.munally.com/MonkeyModdingTroop/index.json

# Publish all NuGet packages to the GitHub feed
# Use --skip-duplicate to prevent errors if a package with the same version already exists.
Expand Down
9 changes: 9 additions & 0 deletions CommunityBugFixCollection.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
README.md = README.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "workflows", "workflows", "{02EA681E-C7D8-13C7-8484-4AC65E1B71E8}"
ProjectSection(SolutionItems) = preProject
.github\workflows\build.yml = .github\workflows\build.yml
.github\workflows\publish.yml = .github\workflows\publish.yml
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -25,6 +31,9 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{02EA681E-C7D8-13C7-8484-4AC65E1B71E8} = {07124CF9-EE3D-4A7E-A2F8-8FD07966E423}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {7D505B2E-FBA2-4F50-BC1C-838BC8DF0D5C}
EndGlobalSection
Expand Down
5 changes: 4 additions & 1 deletion CommunityBugFixCollection/Locale/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
"CommunityBugFixCollection.NodeNameAdjustments.Description": "Verbessert die verwirrenden Namen der Remap [-1; 1] zu [0; 1] ProtoFlux Nodes.",
"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 <i>ParentUnder</i>-Feld auf den Slot, auf dem sie ist, gesetzt ist. Fügt außerdem eine Erklärung des Problems im Header hinzu.",
"CommunityBugFixCollection.PauseAnimatorUpdates.Description": "Verhindert, dass Animatoren jeden Frame in alle assoziierten Felder schreiben, obwohl sie nicht am animieren sind.",
"CommunityBugFixCollection.ReallyNoDestroyUndo.Description": "Sorgt dafür, dass die NoDestroyUndo Komponente tatsächlich verhindert, dass das Zerstören eines Objekts rückgängig gemacht werden kann.",
"CommunityBugFixCollection.SmoothDraggables.Description": "Umgeht, dass Slider und Joints in Headless-Sessions verrutschen.",
Expand All @@ -50,6 +51,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.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 <i>LocalizedByteFormatting</i> aktiviert ist."
"CommunityBugFixCollection.Config.Options.UseIecByteFormat.Description": "Ob Bytes nach IEC (Faktor 1024) statt dezimal (Faktor 1000) formatiert werden sollen, wenn <i>LocalizedByteFormatting</i> aktiviert ist.",

"CommunityBugFixCollection.ChildParentAudioClipPlayer.Header": "Das <i>ParentUnder</i>-Feld dieser AudioClipPlayer-Komponente darf niemals auf den Slot, auf dem sie ist, gesetzt werden. Andernfalls crasht das Spiel wenn ein Clip ausgelöst wird."
}
}
5 changes: 4 additions & 1 deletion CommunityBugFixCollection/Locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
"CommunityBugFixCollection.NodeNameAdjustments.Description": "Fixes the confusing names of the Remap [-1; 1] to [0; 1] ProtoFlux nodes.",
"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 <i>ParentUnder</i> field is set to the slot that it's on. Also adds a header text explaining the problem.",
"CommunityBugFixCollection.PauseAnimatorUpdates.Description": "Fixes animators updating all associated fields every frame while enabled but not playing.",
"CommunityBugFixCollection.ReallyNoDestroyUndo.Description": "Makes the NoDestroyUndo component actually prevent undoing destroying something.",
"CommunityBugFixCollection.SmoothDraggables.Description": "Workaround for Sliders and Joints snapping in sessions hosted by a headless.",
Expand All @@ -70,6 +71,8 @@
"CommunityBugFixCollection.StorageUnits.MB": "MB",
"CommunityBugFixCollection.StorageUnits.GB": "GB",
"CommunityBugFixCollection.StorageUnits.TB": "TB",
"CommunityBugFixCollection.StorageUnits.PB": "PB"
"CommunityBugFixCollection.StorageUnits.PB": "PB",

"CommunityBugFixCollection.ChildParentAudioClipPlayer.Header": "This AudioClipPlayer component's <i>ParentUnder</i> field must never be set to the slot it's on. Otherwise, the game will crash when a clip is triggered."
}
}
62 changes: 62 additions & 0 deletions CommunityBugFixCollection/NoParentUnderSelfAudioClipPlayer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using FrooxEngine;
using HarmonyLib;
using MonkeyLoader.Resonite;
using MonkeyLoader.Resonite.UI.Inspectors;

namespace CommunityBugFixCollection
{
[HarmonyPatch(typeof(ChildParentAudioClipPlayer))]
[HarmonyPatchCategory(nameof(NoParentUnderSelfAudioClipPlayer))]
internal sealed class NoParentUnderSelfAudioClipPlayer : ResoniteEventHandlerMonkey<NoParentUnderSelfAudioClipPlayer, ResolveInspectorHeaderTextEvent>
{
public override IEnumerable<string> Authors => Contributors.Banane9;

public override bool CanBeDisabled => true;

public override int Priority => HarmonyLib.Priority.Low;

protected override void Handle(ResolveInspectorHeaderTextEvent eventData)
=> eventData.AddItem(new(Mod.GetLocaleString("ChildParentAudioClipPlayer.Header")));

private static User? GetAllocatingUser(ChildParentAudioClipPlayer element)
{
if (element.FilterWorldElement() is null)
return null;

element.ReferenceID.ExtractIDs(out var position, out var allocationId);
var user = element.World.GetUserByAllocationID(allocationId);

if (user is null || position < user.AllocationIDStart)
return null;

return user;
}

[HarmonyPostfix]
[HarmonyPatch(nameof(ChildParentAudioClipPlayer.OnAwake))]
private static void OnAwakePostfix(ChildParentAudioClipPlayer __instance)
{
if (__instance.ParentUnder.Target == __instance.Slot)
{
Logger.Warn(() => $"User [{GetAllocatingUser(__instance)}] tried loading a ChildParentAudioClipPlayer targeting itself on: {__instance.ParentHierarchyToString()}");

if (Enabled)
__instance.ParentUnder.Target = null!;
}

__instance.ParentUnder.OnTargetChange += _ =>
{
if (Enabled && __instance.ParentUnder.Target == __instance.Slot)
__instance.RunSynchronously(() => __instance.ParentUnder.Target = null!);
};
}

[HarmonyPostfix]
[HarmonyPatch(nameof(ChildParentAudioClipPlayer.PlayClip))]
private static void PlayClipPrefix(ChildParentAudioClipPlayer __instance)
{
if (Enabled && __instance.World.CanMakeSynchronousChanges && __instance.ParentUnder.Target == __instance.Slot)
__instance.ParentUnder.Target = null!;
}
}
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ just disable them in the settings in the meantime.
* https://github.com/Yellow-Dog-Man/Locale/issues/186
* FlipAtUser component does not respect view position (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1335)
* ColorX From HexCode (ProtoFlux node) defaults to Linear profile (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1404)
* ChildParentAudioClipPlayer component crashes the game when it's triggered while its *ParentUnder* field is set to the slot it's on (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1457)
* Resolution scale may get stuck at 0.5 when opening and closing the SteamVR dashboard while the game is hitching (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2337)
* `ValueMod<Decimal>` node crashes the game when B input is set to zero or disconnected. (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2746)
* Grid World grid being off-center (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2754)
Expand Down
Loading