Skip to content
Merged
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
2 changes: 2 additions & 0 deletions CommunityBugFixCollection/Contributors.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ internal static class Contributors

public static string[] Banane9 { get; } = ["Banane9"];

public static string[] E1int { get; } = ["E1int"];

public static string[] Goat { get; } = ["goat"];

public static string[] LeCloutPanda { get; } = ["LeCloutPanda"];
Expand Down
38 changes: 38 additions & 0 deletions CommunityBugFixCollection/FlipAtUserView.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using Elements.Core;
using FrooxEngine;
using HarmonyLib;
using MonkeyLoader.Resonite;
using System.Collections.Generic;
using System.Reflection.Emit;

namespace CommunityBugFixCollection
{
[HarmonyPatchCategory(nameof(FlipAtUserView))]
[HarmonyPatch(typeof(FlipAtUser), nameof(FlipAtUser.OnCommonUpdate))]
internal sealed class FlipAtUserView : ResoniteMonkey<FlipAtUserView>
{
public override IEnumerable<string> Authors => Contributors.E1int;

public override bool CanBeDisabled => true;

private static float3 GetUserPosition(UserRoot userRoot)
=> Enabled ? userRoot.ViewPosition : userRoot.HeadPosition;

private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
var headPositionGetter = AccessTools.PropertyGetter(typeof(UserRoot), nameof(UserRoot.HeadPosition));
var getUserPositionMethod = AccessTools.DeclaredMethod(typeof(FlipAtUserView), nameof(GetUserPosition));

foreach (var instruction in instructions)
{
if (instruction.Calls(headPositionGetter))
{
yield return new CodeInstruction(OpCodes.Call, getUserPositionMethod);
continue;
}

yield return instruction;
}
}
}
}
1 change: 1 addition & 0 deletions CommunityBugFixCollection/Locale/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"CommunityBugFixCollection.FadeContextMenuLabelOutlines.Description": "Makes the outlines of the labels of the context menu fade out like the rest of it.",
"CommunityBugFixCollection.FireBrushToolDequipEvents.Description": "Fixes tools derived from BrushTool not firing OnDequipped events.",
"CommunityBugFixCollection.FixMigratedItemMessages.Description": "Fixes migrated items sent as messages not spawning because they still point to the old platform.",
"CommunityBugFixCollection.FlipAtUserView.Description": "Fixes FlipAtUser component by using the view position as reference instead of the head slot position.",
"CommunityBugFixCollection.GammaCorrectedColorXLuminance.Description": "Fixes ColorX Luminance calculations being incorrect for non-linear color profiles.",
"CommunityBugFixCollection.GroupCloudHomeTemplate.Description": "Uses the User Cloud Home template instead of the missing Group template.",
"CommunityBugFixCollection.HighlightHomeWorldInInventory.Description": "Fixes the selected Home World in the Inventory not being highlighted as a favorite.",
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ just disable them in the settings in the meantime.
* Storage units can't be localized (and they use GB instead of GiB and so on)
* https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/1157
* 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)
* ProtoFlux value casts from byte to other values converting incorrectly (mono / graphical client only) (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/2257)
* `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)
Expand Down