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
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
3 changes: 0 additions & 3 deletions CommunityBugFixCollection/AnyProtocolHyperlinks.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using Elements.Core;
using FrooxEngine;
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;

namespace CommunityBugFixCollection
{
Expand Down
39 changes: 29 additions & 10 deletions CommunityBugFixCollection/BetterGridWorldPreset.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using Elements.Core;
using FrooxEngine;
using FrooxEngine.FrooxEngine.ProtoFlux.CoreNodes;
using FrooxEngine.ProtoFlux.Runtimes.Execution.Nodes;
using FrooxEngine.ProtoFlux.Runtimes.Execution.Nodes.Operators;
using HarmonyLib;
using Renderite.Shared;
using System;
using System.Collections.Generic;
using System.Text;

namespace CommunityBugFixCollection
{
Expand All @@ -19,14 +19,16 @@ private static bool Prefix(World w)
if (!Enabled)
return true;

WorldPresets.BlankWorld(w);
WorldPresets.SetupWorldControllers(w);
WorldPresets.SetupSimpleSkyBox(w, WorldPresets.SetupSimpleWorldLighting(w));

var ground = w.AddSlot("Ground");
ground.LocalRotation = floatQ.Euler(90, 0, 0);

var attachedModel = ground.AttachMesh<GridMesh, PBS_Metallic>();
attachedModel.mesh.Size.Value = 1000 * float2.One;
attachedModel.mesh.Facing = float3.Up;
attachedModel.mesh.Points.Value = 20 * int2.One;
attachedModel.mesh.Size.Value = 1000 * float2.One;
attachedModel.mesh.UVScale.DriveFrom(attachedModel.mesh.Size, true);

var gridTexture = ground.AttachComponent<GridTexture>();
gridTexture.BackgroundColor.Value = new colorX(0.07f, 0.08f, 0.11f);
Expand All @@ -48,15 +50,32 @@ private static bool Prefix(World w)
majorGrid.Offset.Value = int2.Zero;

attachedModel.material.AlbedoTexture.Target = gridTexture;
attachedModel.material.TextureScale.DriveFrom(attachedModel.mesh.Size);
attachedModel.material.Smoothness.Value = 0f;

var boxCollider = ground.AttachComponent<BoxCollider>();
var swizzle = ground.AttachComponent<Float2ToFloat3SwizzleDriver>();
swizzle.Source.Target = attachedModel.mesh.Size;
swizzle.Target.Target = boxCollider.Size;
boxCollider.Offset.Value = new(0, -0.5f, 0);
boxCollider.SetCharacterCollider();

var swizzleSlot = ground.AddSlot("Collider Swizzle");

var meshSizeSource = swizzleSlot.AttachComponent<ValueSource<float2>>();
meshSizeSource.TrySetRootSource(attachedModel.mesh.Size);

var unpackSize = swizzleSlot.AttachComponent<Unpack_Float2>();
unpackSize.V.Target = meshSizeSource;

var oneConstant = swizzleSlot.AttachComponent<ValueInput<float>>();
oneConstant.Value.Value = 1;

var packSize = swizzleSlot.AttachComponent<Pack_Float3>();
packSize.X.Target = unpackSize.X;
packSize.Y.Target = oneConstant;
packSize.Z.Target = unpackSize.Y;

var colliderSizeDrive = swizzleSlot.AttachComponent<ValueFieldDrive<float3>>();
colliderSizeDrive.TrySetRootTarget(boxCollider.Size);
colliderSizeDrive.Value.Target = packSize;

return false;
}
}
Expand Down
108 changes: 108 additions & 0 deletions CommunityBugFixCollection/BetterListEditor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
using Elements.Core;
using FrooxEngine;
using FrooxEngine.UIX;
using HarmonyLib;
using System.Globalization;

namespace CommunityBugFixCollection
{
[HarmonyPatch(typeof(ListEditor))]
[HarmonyPatchCategory(nameof(BetterListEditor))]
internal sealed class BetterListEditor : ResoniteBugFixMonkey<BetterListEditor>
{
public override IEnumerable<string> Authors => Contributors.Banane9;

[HarmonyPrefix]
[HarmonyPatch(nameof(ListEditor.Target_ElementsAdded))]
private static bool ElementsAddedPrefix(ListEditor __instance, ISyncList list, int startIndex, int count)
{
if (!Enabled)
return true;

if (count is 0)
return false;

var addedElements = Pool.BorrowList<ISyncMember>();

for (var i = startIndex; i < startIndex + count; ++i)
addedElements.Add(list.GetElement(i));

__instance.World.RunSynchronously(() =>
{
for (var i = __instance.Slot.ChildrenCount - 1; i >= startIndex; --i)
__instance.Slot[i].OrderOffset += count;

for (var i = 0; i < addedElements.Count; ++i)
{
if (addedElements[i].FilterWorldElement() is null)
continue;

var slot = __instance.Slot.AddSlot("Element");
slot.OrderOffset = startIndex + i;

__instance.BuildListItem(list, startIndex + i, addedElements[i], slot);
}

Pool.Return(ref addedElements);
});

return false;
}

[HarmonyPrefix]
[HarmonyPatch(nameof(ListEditor.GetElementName))]
private static bool GetElementNamePrefix(int index, ref string __result)
{
if (!Enabled)
return true;

__result = index.ToString(CultureInfo.InvariantCulture) + ':';
return false;
}

[HarmonyPrefix]
[HarmonyPatch(nameof(ListEditor.MoveElement))]
private static bool MoveElementPrefix(ListEditor __instance, IButton button, int offset)
{
if (!Enabled)
return true;

if (__instance._targetList.Target.FilterWorldElement() is null)
return false;

if (__instance._targetList.Target is ConflictingSyncElement { DirectAccessOnly: true } && !__instance.LocalUser.IsDirectlyInteracting())
return false;

var index = __instance.FindButtonIndex(button);
var newIndex = index + offset;

if (index < 0 || newIndex < 0 || newIndex >= __instance._targetList.Target.Count)
return false;

__instance._targetList.Target.MoveElementToIndex(index, newIndex);

__instance.reindex = true;
__instance.MarkChangeDirty();

return false;
}

[HarmonyPrefix]
[HarmonyPatch(nameof(ListEditor.Reindex))]
private static bool ReindexPrefix(ListEditor __instance)
{
if (!Enabled)
return true;

for (var i = 0; i < __instance.Slot.ChildrenCount; ++i)
{
if (__instance.Slot[i].GetComponentInChildren<Text>() is not Text text)
continue;

text.Content.Value = __instance.GetElementName(__instance._targetList.Target, i);
}

return false;
}
}
}
6 changes: 1 addition & 5 deletions CommunityBugFixCollection/Box.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace CommunityBugFixCollection
namespace CommunityBugFixCollection
{
internal sealed class Box<T>
where T : struct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,6 @@
using FrooxEngine;
using FrooxEngine.UIX;
using HarmonyLib;
using MonkeyLoader;
using MonkeyLoader.Meta;
using NuGet.Versioning;
using System;
using System.Collections.Generic;
using System.Text;

namespace CommunityBugFixCollection
{
Expand Down
15 changes: 9 additions & 6 deletions CommunityBugFixCollection/BugFixOptions.cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
using MonkeyLoader.Configuration;
using MonkeyLoader.Patching;
using System;
using System.Collections.Generic;
using System.Text;

namespace CommunityBugFixCollection
{
internal sealed class BugFixOptions : SingletonConfigSection<BugFixOptions>
{
private static readonly DefiningConfigKey<bool> _forceAprilFools = new("ForceAprilFools", "Whether to force April Fools content to be active.", () => false);

private static readonly DefiningConfigKey<bool> _useIecByteFormat = new("UseIecByteFormat", "Whether to format bytes using IEC as opposed to decimal format when <i>LocalizedByteFormatting</i> is enabled.", () => true);

/// <inheritdoc/>
public override string Description => "Contains the settings for the few fixes that offer them.";

/// <summary>
/// Gets whether to force April Fools content to be active.
/// </summary>
public bool ForceAprilFools => _forceAprilFools;

/// <inheritdoc/>
public override string Id => "Options";

/// <summary>
/// Gets whether <see cref="LocalizedByteFormatting"/> should format bytes using IEC or decimal format.
/// </summary>
public bool UseIecByteFormat => _useIecByteFormat.GetValue();
public bool UseIecByteFormat => _useIecByteFormat;

/// <inheritdoc/>
public override Version Version { get; } = new(1, 0, 0);
public override Version Version { get; } = new(1, 1, 0);
}
}
3 changes: 0 additions & 3 deletions CommunityBugFixCollection/CaseInsensitiveCustomGenerics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@
using MonkeyLoader;
using MonkeyLoader.Meta;
using MonkeyLoader.Patching;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;

// Taken from ComponentSelectorAdditions
// https://github.com/ResoniteModdingGroup/ComponentSelectorAdditions
Expand Down
3 changes: 0 additions & 3 deletions CommunityBugFixCollection/CenteredNotifications.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using FrooxEngine;
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Text;

// Originally released under MIT-0 here:
// https://github.com/art0007i/NotificationFixer
Expand Down
3 changes: 0 additions & 3 deletions CommunityBugFixCollection/CheckSelfForDuplicateSlot.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using FrooxEngine;
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Reflection.Emit;
using System.Text;

namespace CommunityBugFixCollection
{
Expand Down
3 changes: 0 additions & 3 deletions CommunityBugFixCollection/ColorDisplayValueProxy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
using FrooxEngine.ProtoFlux;
using FrooxEngine.ProtoFlux.Runtimes.Execution.Nodes;
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Text;

namespace CommunityBugFixCollection
{
Expand Down
3 changes: 0 additions & 3 deletions CommunityBugFixCollection/ColorXNodeNamesSpacing.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using Elements.Core;
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Text;

namespace CommunityBugFixCollection
{
Expand Down
2 changes: 1 addition & 1 deletion CommunityBugFixCollection/CommunityBugFixCollection.csproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project Sdk="Remora.Resonite.Sdk/2.0.10">
<Project Sdk="Remora.Resonite.Sdk/2.1.0">
<PropertyGroup>
<PackageId>CommunityBugFixCollection</PackageId>
<Title>Community Bug-Fix Collection</Title>
Expand Down
3 changes: 0 additions & 3 deletions CommunityBugFixCollection/ConsistentContextMenuAngularSize.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using Elements.Core;
using FrooxEngine;
using HarmonyLib;
using System;
using System.Collections.Generic;
using System.Text;

namespace CommunityBugFixCollection
{
Expand Down
Loading