Skip to content

Commit da1def8

Browse files
committed
rebase and fix
basically add funny that tries to access the methods. this is untested
1 parent 79ab9f5 commit da1def8

4 files changed

Lines changed: 27 additions & 73 deletions

File tree

Lines changed: 14 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,33 @@
1-
<Project Sdk="Microsoft.NET.Sdk">
1+
<Project Sdk="Remora.Resonite.Sdk/2.0.10">
22
<PropertyGroup>
3-
<TargetFramework>net9.0</TargetFramework>
4-
<AssemblyTitle>CommunityBugFixCollection</AssemblyTitle>
5-
<AssemblyFileName>$(AssemblyTitle).dll</AssemblyFileName>
6-
<RootNamespace>CommunityBugFixCollection</RootNamespace>
7-
</PropertyGroup>
8-
9-
<PropertyGroup>
10-
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
113
<PackageId>CommunityBugFixCollection</PackageId>
124
<Title>Community Bug-Fix Collection</Title>
135
<Authors>Banane9; Nytra; art0007i; LeCloutPanda; goat; __Choco__; LJ; 989onan</Authors>
14-
<Version>0.8.2-beta</Version>
6+
<Version>0.9.0-beta</Version>
157
<Description>This MonkeyLoader mod for Resonite that fixes various small Resonite-issues that are still open.</Description>
168
<PackageReadmeFile>README.md</PackageReadmeFile>
179
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>
10+
<RepositoryUrl>$(PackageProjectUrl).git</RepositoryUrl>
1811
<PackageProjectUrl>https://github.com/ResoniteModdingGroup/CommunityBugFixCollection</PackageProjectUrl>
1912
<PackageTags>mod; mods; monkeyloader; resonite; component; attacher; selector; protoflux; node; picker; search; favorites</PackageTags>
2013
</PropertyGroup>
2114

22-
<Target Name="CopyPackage" AfterTargets="Pack">
23-
<Copy Condition="'$(CopyToLibraries)'=='true'" SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFiles="$(ResonitePath)\MonkeyLoader\Mods\$(PackageId).nupkg" />
24-
<Message Condition="'$(CopyToLibraries)'=='true'" Text="Copied '$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg' to '$(ResonitePath)\MonkeyLoader\Mods\$(PackageId).nupkg'" Importance="high" />
25-
</Target>
26-
2715
<ItemGroup>
2816
<None Include="..\README.md" Pack="true" PackagePath="" />
2917
<None Include="Locale\*" Pack="true" PackagePath="content/Locale/" />
3018
</ItemGroup>
3119

3220
<ItemGroup>
33-
<PackageReference Include="MicroUtils.HarmonyAnalyzers" Version="1.6.1">
34-
<PrivateAssets>all</PrivateAssets>
35-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
36-
</PackageReference>
37-
<PackageReference Include="MonkeyLoader.GamePacks.Resonite" Version="0.24.1-beta" />
38-
<PackageReference Include="PolySharp" Version="1.15.0">
39-
<PrivateAssets>all</PrivateAssets>
40-
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
41-
</PackageReference>
42-
<PackageReference Include="Renderite.Renderer.Renderite.Shared" Version="1.1.3" />
43-
<PackageReference Include="Resonite.Elements.Assets" Version="1.3.3" />
44-
<PackageReference Include="Resonite.Elements.Core" Version="1.4.9.4" />
45-
<PackageReference Include="Resonite.Elements.Quantity" Version="1.2.3" />
46-
<PackageReference Include="Resonite.FrooxEngine" Version="2025.8.28.607" />
47-
<PackageReference Include="Resonite.FrooxEngine.Store" Version="1.0.6" />
48-
<PackageReference Include="Resonite.ProtoFlux.Core" Version="1.3.2" />
49-
<PackageReference Include="Resonite.ProtoFlux.Nodes.Core" Version="1.3.2" />
50-
<PackageReference Include="Resonite.ProtoFluxBindings" Version="2025.8.24.607" />
51-
<PackageReference Include="Resonite.SkyFrost.Base" Version="2.1.0" />
52-
<PackageReference Include="Resonite.SkyFrost.Base.Models" Version="2.1.5" />
21+
<ResoniteReference Include="Renderite.Shared" />
22+
<ResoniteReference Include="Elements.Assets" />
23+
<ResoniteReference Include="Elements.Core" />
24+
<ResoniteReference Include="Elements.Quantity" />
25+
<ResoniteReference Include="FrooxEngine" />
26+
<ResoniteReference Include="FrooxEngine.Store" />
27+
<ResoniteReference Include="ProtoFlux.Core" />
28+
<ResoniteReference Include="ProtoFlux.Nodes.Core" />
29+
<ResoniteReference Include="ProtoFluxBindings" />
30+
<ResoniteReference Include="SkyFrost.Base" />
31+
<ResoniteReference Include="SkyFrost.Base.Models" />
5332
</ItemGroup>
5433
</Project>

CommunityBugFixCollection/DontRaycastDeveloper.cs

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System.Linq;
77
using System.Reflection;
88
using System.Reflection.Emit;
9+
using System.Runtime.Serialization.Formatters;
910
using System.Text;
1011

1112
namespace CommunityBugFixCollection
@@ -16,6 +17,10 @@ internal sealed class DontRaycastDeveloper : ResoniteBugFixMonkey<DontRaycastDev
1617
{
1718

1819
public override IEnumerable<string> Authors { get; } = [.. Contributors.Onan];
20+
public static FieldInfo IgnoreHierarchy = AccessTools.Field(typeof(RaycastDriver), "IgnoreHierarchy");//get ignore hierarchy field.
21+
public static FieldInfo Filter = AccessTools.Field(typeof(RaycastDriver), "Filter");//get Filter func field.
22+
public static MethodInfo Func2_Call = AccessTools.Method(typeof(Func<>), "Invoke", new Type[] { typeof(FrooxEngine.ICollider)}, new Type[] { typeof(FrooxEngine.ICollider), typeof(bool) }); //tries to get a call to a function (like Filter) of name "Invoke" with the generic type ("ICollider", "bool") and given a value of "ICollider" in the call from the stack.
23+
1924

2025
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
2126
{
@@ -26,29 +31,23 @@ public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructio
2631
int index = 0;
2732
int start = 0;
2833
int stop = 0;
29-
CodeInstruction Filter = new CodeInstruction(OpCodes.Nop);
3034
foreach (CodeInstruction inst in instructionList)
3135
{
32-
33-
if (inst.operand?.ToString()?.Contains("IgnoreHierarchy") == true)
36+
if (inst.opcode == OpCodes.Ldfld && inst.operand?.Equals(IgnoreHierarchy) == true)
3437
{
35-
if(start == 0)
38+
if (start == 0)
3639
{
3740
start = index;
3841
}
39-
4042
}
41-
if (inst.operand?.ToString()?.ToLower()?.Contains("icollider") == true && inst.operand?.ToString()?.ToLower()?.Contains("bool") == true && inst.operand?.ToString()?.ToLower()?.Contains("invoke") == true)
43+
if (inst.operand?.Equals(Func2_Call) == true)
4244
{
4345
if (stop == 0)
4446
{
4547
stop = index;
48+
break;
4649
}
4750
}
48-
if (inst.opcode == OpCodes.Ldfld && inst.operand?.ToString()?.Contains("Filter") == true)
49-
{
50-
Filter = inst;
51-
}
5251
index++;
5352
}
5453

@@ -60,7 +59,7 @@ public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructio
6059
instructionList[start],
6160
new CodeInstruction(OpCodes.Ldloc_S,8),
6261
new CodeInstruction(OpCodes.Ldarg_0),
63-
Filter,
62+
new CodeInstruction(OpCodes.Ldfld, Filter),
6463
new CodeInstruction(OpCodes.Call, AccessTools.Method(typeof(DontRaycastDeveloper), "DontRaycastDeveloperFilter")),
6564
];
6665
instructionList.RemoveRange(start-1, (stop+2) - start);

CommunityBugFixCollection/NaNtEqual.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using System;
77
using System.Collections.Generic;
88
using System.Text;
9+
using ExecutionContext = ProtoFlux.Runtimes.Execution.ExecutionContext;
910

1011
namespace CommunityBugFixCollection
1112
{

Directory.Build.props

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,17 @@
11
<Project>
22
<PropertyGroup>
3-
<OutputType>Library</OutputType>
4-
<TargetFramework>net9.0</TargetFramework>
5-
<AssemblyFileName>$(AssemblyTitle).dll</AssemblyFileName>
6-
<LangVersion>12.0</LangVersion>
7-
<Nullable>enable</Nullable>
8-
<Deterministic>true</Deterministic>
9-
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
10-
<DebugType>portable</DebugType>
11-
<GenerateDocumentationFile>True</GenerateDocumentationFile>
12-
13-
<CopyToLibraries Condition="'$(CopyToLibraries)'==''">true</CopyToLibraries>
14-
15-
<RestoreAdditionalProjectSources>
16-
https://nuget.pkg.github.com/ResoniteModdingGroup/index.json
17-
</RestoreAdditionalProjectSources>
3+
<ResoniteInstallOnBuild Condition="'$(ResoniteInstallOnBuild)'==''">true</ResoniteInstallOnBuild>
184
</PropertyGroup>
195

206
<PropertyGroup>
217
<PackageReadmeFile>README.md</PackageReadmeFile>
22-
<RepositoryUrl>$(PackageProjectUrl).git</RepositoryUrl>
23-
<RepositoryType>git</RepositoryType>
24-
<IncludeSymbols>False</IncludeSymbols>
25-
<EmbedAllSources>True</EmbedAllSources>
26-
<EmbedUntrackedSources>True</EmbedUntrackedSources>
27-
<SymbolPackageFormat>snupkg</SymbolPackageFormat>
28-
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb</AllowedOutputExtensionsInPackageBuildOutputFolder>
298
</PropertyGroup>
309

3110
<PropertyGroup Condition="'$(GITHUB_ACTIONS)' == 'true'">
32-
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
33-
<CopyToLibraries>false</CopyToLibraries>
11+
<ResoniteInstallOnBuild>false</ResoniteInstallOnBuild>
3412
</PropertyGroup>
3513

3614
<PropertyGroup Condition="'$(ResonitePath)'==''">
37-
<ResonitePath>$(MSBuildThisFileDirectory)Resonite</ResonitePath>
38-
<ResonitePath Condition="Exists('C:/Program Files (x86)/Steam/steamapps/common/Resonite/')">C:/Program Files (x86)/Steam/steamapps/common/Resonite</ResonitePath>
39-
<ResonitePath Condition="Exists('$(HOME)/.steam/steam/steamapps/common/Resonite/')">$(HOME)/.steam/steam/steamapps/common/Resonite</ResonitePath>
4015
<ResonitePath Condition="Exists('D:/Files/Games/Resonite/app/')">D:/Files/Games/Resonite/app</ResonitePath>
4116
<ResonitePath Condition="Exists('D:/SteamLibrary//steamapps/common/Resonite/')">D:/SteamLibrary//steamapps/common/Resonite</ResonitePath>
4217
<ResonitePath Condition="Exists('G:/SteamLibrary/steamapps/common/Resonite')">G:/SteamLibrary\steamapps\common\Resonite</ResonitePath>

0 commit comments

Comments
 (0)