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
16 changes: 3 additions & 13 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,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 All @@ -69,10 +66,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 +74,7 @@ jobs:
name: NuGet Packages
if-no-files-found: error
retention-days: 7
path: ./*.nupkg
path: ./ComponentSelectorAdditions.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 +91,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 ComponentSelectorAdditions.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 ComponentSelectorAdditions/CaseSensitivityFix.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
using FrooxEngine;
using HarmonyLib;
using MonkeyLoader.Patching;
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;

namespace ComponentSelectorAdditions
{
Expand Down
3 changes: 0 additions & 3 deletions ComponentSelectorAdditions/CategoryOverride.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
using ComponentSelectorAdditions.Events;
using FrooxEngine;
using System;
using System.Collections.Generic;
using System.Text;

namespace ComponentSelectorAdditions
{
Expand Down
9 changes: 3 additions & 6 deletions ComponentSelectorAdditions/CategoryOverrideHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,15 @@
using EnumerableToolkit;
using FrooxEngine;
using MonkeyLoader.Resonite;
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Text;

namespace ComponentSelectorAdditions
{
internal sealed class CategoryOverrideHandler : ResoniteCancelableEventHandlerMonkey<CategoryOverrideHandler, EnumerateComponentsEvent>
{
private static readonly Dictionary<CategoryNode<Type>, HashSet<CategoryOverride>> _overridesByCategory = new();
private static readonly Dictionary<CategoryNode<Type>, HashSet<CategoryOverride>> _overridesByCategory = [];

/// <inheritdoc/>
public override bool CanBeDisabled => true;

/// <inheritdoc/>
Expand All @@ -26,7 +23,7 @@ public static bool AddOverride(CategoryOverride categoryOverride)
=> _overridesByCategory.GetOrCreateValue(categoryOverride.TargetCategory).Add(categoryOverride);

public static IEnumerable<CategoryOverride> GetOverrides(CategoryNode<Type> category)
=> _overridesByCategory.TryGetValue(category, out var overrides) ? overrides.AsSafeEnumerable() : Enumerable.Empty<CategoryOverride>();
=> _overridesByCategory.TryGetValue(category, out var overrides) ? overrides.AsSafeEnumerable() : [];

public static bool HasAnyOverride(CategoryNode<Type> category)
=> _overridesByCategory.TryGetValue(category, out var overrides) && overrides.Count > 0;
Expand Down
5 changes: 0 additions & 5 deletions ComponentSelectorAdditions/ComponentResult.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
using Elements.Core;
using FrooxEngine;
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace ComponentSelectorAdditions
{
Expand Down
34 changes: 7 additions & 27 deletions ComponentSelectorAdditions/ComponentSelectorAdditions.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Remora.Resonite.Sdk/2.3.1">
<PropertyGroup>
<AssemblyTitle>ComponentSelectorAdditions</AssemblyTitle>
<AssemblyFileName>$(AssemblyTitle).dll</AssemblyFileName>
<RootNamespace>ComponentSelectorAdditions</RootNamespace>
</PropertyGroup>

<PropertyGroup>
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<PackageId>ComponentSelectorAdditions</PackageId>
<Title>Component Selector Additions</Title>
<Authors>Banane9</Authors>
<Version>0.10.0-beta</Version>
<Version>0.10.1-beta</Version>
<Description>This MonkeyLoader mod for Resonite overhauls the Component Selector / Protoflux Node Selector to have a search, as well as favorites and recents categories.</Description>
<PackageReadmeFile>README.md</PackageReadmeFile>
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>
Expand All @@ -19,29 +12,16 @@
<PackageTags>mod; mods; monkeyloader; resonite; component; attacher; selector; protoflux; node; picker; search; favorites</PackageTags>
</PropertyGroup>

<Target Name="CopyPackage" AfterTargets="Pack">
<Copy Condition="'$(CopyToLibraries)'=='true'" SourceFiles="$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg" DestinationFiles="$(ResonitePath)\MonkeyLoader\Mods\$(PackageId).nupkg" />
<Message Condition="'$(CopyToLibraries)'=='true'" Text="Copied '$(OutputPath)..\$(PackageId).$(PackageVersion).nupkg' to '$(ResonitePath)\MonkeyLoader\Mods\$(PackageId).nupkg'" Importance="high" />
</Target>

<ItemGroup>
<None Include="..\README.md" Pack="true" PackagePath="" />
<None Include="Locale\*" Pack="true" PackagePath="content/Locale/" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="MicroUtils.HarmonyAnalyzers" Version="1.6.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MonkeyLoader.GamePacks.Resonite" Version="0.24.1-beta" />
<PackageReference Include="PolySharp" Version="1.15.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Resonite.Elements.Assets" Version="1.3.3" />
<PackageReference Include="Resonite.Elements.Core" Version="1.4.9.4" />
<PackageReference Include="Resonite.Elements.Quantity" Version="1.2.3" />
<PackageReference Include="Resonite.FrooxEngine" Version="2025.8.25.222" />
<ResoniteReference Include="Elements.Assets" />
<ResoniteReference Include="Elements.Core" />
<ResoniteReference Include="Elements.Quantity" />
<ResoniteReference Include="FrooxEngine" />
<ResoniteReference Include="Renderite.Shared" />
</ItemGroup>
</Project>
10 changes: 1 addition & 9 deletions ComponentSelectorAdditions/CurrentPathIndicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,14 @@
using FrooxEngine.UIX;
using MonkeyLoader.Patching;
using MonkeyLoader.Resonite;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ComponentSelectorAdditions
{
internal sealed class CurrentPathIndicator : ResoniteEventHandlerMonkey<CurrentPathIndicator, BuildSelectorFooterEvent>
{
public override bool CanBeDisabled => true;
public override int Priority => HarmonyLib.Priority.Normal;

protected override bool AppliesTo(BuildSelectorFooterEvent eventData) => Enabled;

protected override IEnumerable<IFeaturePatch> GetFeaturePatches() => Enumerable.Empty<IFeaturePatch>();
public override int Priority => HarmonyLib.Priority.Normal;

protected override void Handle(BuildSelectorFooterEvent eventData)
{
Expand Down
26 changes: 6 additions & 20 deletions ComponentSelectorAdditions/DefaultConfig.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,25 @@
using Elements.Core;
using MonkeyLoader.Configuration;
using System;
using System.Diagnostics.CodeAnalysis;

namespace ComponentSelectorAdditions
{
/// <summary>
/// Contains settings for the buttons generated by default.
/// </summary>
public sealed class DefaultConfig : ConfigSection
public sealed class DefaultConfig : SingletonConfigSection<DefaultConfig>
{
private static readonly DefiningConfigKey<float> _directButtonHeight = new("DirectButtonHeight", "The height of a button that is targeting the direct child of the current category, in canvas units. The default value is 32.", () => 32)
private readonly DefiningConfigKey<float> _directButtonHeight = new("DirectButtonHeight", "The height of a button that is targeting the direct child of the current category, in canvas units. The default value is 32.", () => 32)
{
new ConfigKeyRange<float>(32, 64)
};

private static readonly DefiningConfigKey<float> _indirectButtonHeight = new("IndirectButtonHeight", "The height of a button that is not targeting a direct child of the current category and has to fit a category path as well, in canvas units. The default value is 48.", () => 48)
private readonly DefiningConfigKey<float> _indirectButtonHeight = new("IndirectButtonHeight", "The height of a button that is not targeting a direct child of the current category and has to fit a category path as well, in canvas units. The default value is 48.", () => 48)
{
new ConfigKeyRange<float>(32, 64)
};

private static readonly DefiningConfigKey<colorX?> _separateConcreteGenericColor = new("separateConcreteGenericColor", "The color to use for concrete generic buttons, if defined. Defaults to a blend between the generic component buttons' green and the non-generic component buttons' cyan.", () => colorX.FromHexCode("#255447"));

/// <summary>
/// Gets this config's instance.
/// </summary>
public static DefaultConfig Instance { get; private set; } = null!;
private readonly DefiningConfigKey<colorX?> _separateConcreteGenericColor = new("separateConcreteGenericColor", "The color to use for concrete generic buttons, if defined. Defaults to a blend between the generic component buttons' green and the non-generic component buttons' cyan.", () => colorX.FromHexCode("#255447"));

/// <inheritdoc/>
public override string Description => "Contains settings for the buttons generated by default.";
Expand Down Expand Up @@ -59,16 +53,8 @@ public sealed class DefaultConfig : ConfigSection
/// <inheritdoc/>
public override Version Version { get; } = new Version(1, 0, 0);

/// <summary>
/// Creates an instance of this config once.
/// </summary>
/// <exception cref="InvalidOperationException"></exception>
/// <inheritdoc/>
public DefaultConfig()
{
if (Instance is not null)
throw new InvalidOperationException();

Instance = this;
}
{ }
}
}
Loading
Loading