Skip to content

Commit 813e02a

Browse files
committed
Bump version; update authorship tagging; formatting; comments
1 parent 8380be6 commit 813e02a

4 files changed

Lines changed: 15 additions & 9 deletions

File tree

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<OutputType>Library</OutputType>
44
<TargetFramework>net462</TargetFramework>
55
<AssemblyFileName>$(AssemblyTitle).dll</AssemblyFileName>
6-
<LangVersion>11.0</LangVersion>
6+
<LangVersion>12.0</LangVersion>
77
<Nullable>enable</Nullable>
88
<Deterministic>true</Deterministic>
99
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>

WikiIntegration.ComponentSelectorCompatibility/CategoryWikiArticleButtons.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
using MonkeyLoader.Resonite.UI;
88
using MonkeyLoader.Resonite.Configuration;
99
using ComponentSelectorAdditions;
10+
using System.Collections.Generic;
1011

1112
namespace WikiIntegration
1213
{
@@ -17,6 +18,8 @@ internal sealed class CategoryWikiArticleButtons : ResoniteEventHandlerMonkey<Ca
1718
private static readonly Lazy<LocaleString> _componentLocale = new(() => Mod.GetLocaleString("WikiHyperlink.ComponentCategory"));
1819
private static readonly Lazy<LocaleString> _protoFluxLocale = new(() => Mod.GetLocaleString("WikiHyperlink.ProtoFluxCategory"));
1920

21+
public override IEnumerable<string> Authors { get; } = ["Banane9"];
22+
2023
public override int Priority => HarmonyLib.Priority.Normal;
2124

2225
private static LocaleString ComponentLocale => _componentLocale.Value;
@@ -36,6 +39,8 @@ protected override void Handle(PostProcessButtonsEvent eventData)
3639
var path = button.Slot.GetComponent<ButtonRelay<string>>().Argument.Value;
3740

3841
// more generalized check instead of: path.EndsWith("Favorites") || path.EndsWith("Recents"))
42+
// presuming that all non-user excluded categories are ones added by mods
43+
// which won't have a wiki article to link to anyways
3944
if (SearchConfig.Instance.HasExcludedCategory(path, out var isUserCategory) && !isUserCategory.Value)
4045
continue;
4146

WikiIntegration.ComponentSelectorCompatibility/WikiIntegration.ComponentSelectorCompatibility.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
1212
<PackageId>WikiIntegration</PackageId>
1313
<Title>Wiki Integration</Title>
14-
<Authors>Banane9</Authors>
15-
<Version>0.5.0-beta</Version>
14+
<Authors>Banane9; E1int</Authors>
15+
<Version>0.6.0-beta</Version>
1616
<Description>This MonkeyLoader mod for Resonite that adds links to the Wiki to Components in Worker Inspectors, and ProtoFlux nodes.</Description>
1717
<PackageReadmeFile>README.md</PackageReadmeFile>
1818
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>

WikiIntegration/OpenWikiArticleButton.cs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using FrooxEngine.ProtoFlux;
44
using FrooxEngine.UIX;
55
using HarmonyLib;
6-
using MonkeyLoader.Components;
76
using MonkeyLoader.Configuration;
87
using MonkeyLoader.Events;
98
using MonkeyLoader.Resonite;
@@ -30,18 +29,20 @@ internal sealed class OpenWikiArticleButton : ConfiguredResoniteInspectorMonkey<
3029
IAsyncEventHandler<FallbackLocaleGenerationEvent>
3130
{
3231
private static readonly Lazy<LocaleString> _componentLocale = new(() => Mod.GetLocaleString("WikiHyperlink.Component"));
33-
private static readonly Lazy<LocaleString> _protoFluxLocale = new(() => Mod.GetLocaleString("WikiHyperlink.ProtoFlux"));
34-
private static ProtoFluxCategoryConfig _categoryConfig = null!;
32+
3533
private static readonly Dictionary<string, string> _nameOverrides = new() {
3634
{"dT", "Delta_Time"},
3735
{"ObjectCast", "Object_Cast"},
3836
{"ValueCast", "Value_Cast"}
3937
};
4038

39+
private static readonly Lazy<LocaleString> _protoFluxLocale = new(() => Mod.GetLocaleString("WikiHyperlink.ProtoFlux"));
40+
41+
private static ProtoFluxCategoryConfig _categoryConfig = null!;
42+
4143
public override int Priority => HarmonyLib.Priority.HigherThanNormal;
4244

4345
private static LocaleString ComponentLocale => _componentLocale.Value;
44-
4546
private static LocaleString ProtoFluxLocale => _protoFluxLocale.Value;
4647

4748
public Task Handle(FallbackLocaleGenerationEvent eventData)
@@ -110,8 +111,8 @@ private static void AddHyperlink(Slot slot, Worker worker)
110111
nodeName = dotIndex > 0 ? overload[(dotIndex + 1)..] : nodeName;
111112
}
112113

113-
if (_nameOverrides.TryGetValue(nodeName, out var name))
114-
nodeName = name;
114+
if (_nameOverrides.TryGetValue(nodeName, out var overrideName))
115+
nodeName = overrideName;
115116

116117
wikiPage = $"ProtoFlux:{nodeName.Replace(' ', '_')}";
117118
}

0 commit comments

Comments
 (0)