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
6 changes: 3 additions & 3 deletions BepisModSettings/BepisModSettings.csproj
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<Version>1.2.0</Version>
<Version>1.3.0</Version>
<Authors>ResoniteModding</Authors>
<TargetFramework>net9.0</TargetFramework>
<Product>Bepis Mod Settings</Product>
<RepositoryUrl>https://github.com/ResoniteModding/$(AssemblyName)</RepositoryUrl>
<PackageId>ResoniteModding.$(AssemblyName)</PackageId>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<CopyToPlugins>false</CopyToPlugins>
<CopyToPlugins>true</CopyToPlugins>
<ThunderstorePackable>true</ThunderstorePackable>
<GamePath Condition="'$(ResonitePath)' != ''">$(ResonitePath)/</GamePath>
<GamePath Condition="Exists('$(MSBuildProgramFiles32)\Steam\steamapps\common\Resonite\')">$(MSBuildProgramFiles32)\Steam\steamapps\common\Resonite\</GamePath>
<GamePath Condition="Exists('$(HOME)/.steam/steam/steamapps/common/Resonite/')">$(HOME)/.steam/steam/steamapps/common/Resonite/</GamePath>
<PluginTargetDir>$(GamePath)BepInEx\plugins\$(AssemblyName)</PluginTargetDir>
<PluginTargetDir>$(GamePath)BepInEx\plugins\$(Authors)-$(AssemblyName)\$(AssemblyName)</PluginTargetDir>
<RootNamespace>$(AssemblyName)</RootNamespace>
<RestoreAdditionalProjectSources>
https://nuget-modding.resonite.net/v3/index.json;
Expand Down
460 changes: 460 additions & 0 deletions BepisModSettings/DataFeeds/BepisConfigsPage.cs

Large diffs are not rendered by default.

38 changes: 31 additions & 7 deletions BepisModSettings/DataFeeds/BepisNestedCategoryPage.cs
Original file line number Diff line number Diff line change
@@ -1,29 +1,53 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using BepInEx.NET.Common;
using Elements.Core;
using FrooxEngine;

namespace BepisModSettings.DataFeeds;

public static class BepisNestedCategoryPage
{
public static event Func<IReadOnlyList<string>, IAsyncEnumerable<DataFeedItem>> CustomNestedCategoryPages;

internal static async IAsyncEnumerable<DataFeedItem> Enumerate(IReadOnlyList<string> path)
{
await Task.CompletedTask;

if (BepisPluginPage.CategoryHandlers.TryGetValue(path[^1], out Func<IReadOnlyList<string>, IAsyncEnumerable<DataFeedItem>> handler))
string pluginId = path[1];

if (!DataFeedHelpers.DoesPluginExist(pluginId))
{
await foreach (DataFeedItem item in handler(path))
if (CustomNestedCategoryPages != null)
{
yield return item;
foreach (Delegate del in CustomNestedCategoryPages.GetInvocationList())
{
if (del is not Func<IReadOnlyList<string>, IAsyncEnumerable<DataFeedItem>> customNestedHandler) continue;

await foreach (DataFeedItem item in customNestedHandler(path))
{
yield return item;
}
}
}

yield break;
}
else

if (BepisConfigsPage.CategoryHandlers.TryGetValue(path[^1], out Func<IReadOnlyList<string>, IAsyncEnumerable<DataFeedItem>> flagsHandler))
{
DataFeedLabel invalidCategory = new DataFeedLabel();
invalidCategory.InitBase("InvalidCategory", path, null, "Settings.BepInEx.Plugins.Error".AsLocaleKey());
yield return invalidCategory;
await foreach (DataFeedItem item in flagsHandler(path))
{
yield return item;
}

yield break;
}

DataFeedLabel invalidCategory = new DataFeedLabel();
invalidCategory.InitBase("InvalidCategory", path, null, "Settings.BepInEx.Plugins.Error".AsLocaleKey());
yield return invalidCategory;
}
}
Loading