Skip to content

Commit 66e1ae4

Browse files
committed
Tweak group path generation and update dependencies for new release
1 parent d9bb9c9 commit 66e1ae4

5 files changed

Lines changed: 26 additions & 10 deletions

File tree

ComponentSelectorAdditions/ComponentSelectorAdditions.csproj

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<PackageId>ComponentSelectorAdditions</PackageId>
1212
<Title>Component Selector Additions</Title>
1313
<Authors>Banane9</Authors>
14-
<Version>0.7.0-beta</Version>
14+
<Version>0.8.0-beta</Version>
1515
<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>
1616
<PackageReadmeFile>README.md</PackageReadmeFile>
1717
<PackageLicenseExpression>LGPL-3.0-or-later</PackageLicenseExpression>
@@ -30,14 +30,18 @@
3030
</ItemGroup>
3131

3232
<ItemGroup>
33-
<PackageReference Include="MonkeyLoader.GamePacks.Resonite" Version="0.21.2-beta" />
33+
<PackageReference Include="MicroUtils.HarmonyAnalyzers" Version="1.4.0">
34+
<PrivateAssets>all</PrivateAssets>
35+
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
36+
</PackageReference>
37+
<PackageReference Include="MonkeyLoader.GamePacks.Resonite" Version="0.22.1-beta" />
3438
<PackageReference Include="PolySharp" Version="1.15.0">
3539
<PrivateAssets>all</PrivateAssets>
3640
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
3741
</PackageReference>
38-
<PackageReference Include="Resonite.Elements.Assets" Version="1.2.2" />
39-
<PackageReference Include="Resonite.Elements.Core" Version="1.4.2" />
40-
<PackageReference Include="Resonite.Elements.Quantity" Version="1.2.2" />
41-
<PackageReference Include="Resonite.FrooxEngine" Version="2024.11.21.479" />
42+
<PackageReference Include="Resonite.Elements.Assets" Version="1.3.3" />
43+
<PackageReference Include="Resonite.Elements.Core" Version="1.4.3" />
44+
<PackageReference Include="Resonite.Elements.Quantity" Version="1.2.3" />
45+
<PackageReference Include="Resonite.FrooxEngine" Version="2025.3.21.23" />
4246
</ItemGroup>
4347
</Project>

ComponentSelectorAdditions/CurrentPathIndicator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,6 @@ private static string Break(string path)
4141
=> path.Replace("/", "/\u200b").Replace(".", ".\u200b");
4242

4343
private static string Format(SelectorPath path)
44-
=> $"{path.Path}{(path.HasGroup ? $"{(path.GenericType ? ":" : "?")}{path.Group}" : "")}";
44+
=> $"{path.Path}{(path.HasGroup ? $"{(path.GenericType ? "?" : ":")}{path.Group}" : "")}";
4545
}
4646
}

ComponentSelectorAdditions/DefaultHandler.cs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,24 @@ public static TextField MakeGenericArgumentInput(UIBuilder ui, Type component, T
8383
/// <param name="callback">The <see cref="ButtonEventHandler{T}"/> to call when the button is pressed.</param>
8484
/// <param name="argument">The argument for the <paramref name="callback"/>.</param>
8585
/// <param name="category">The optional category path to show.</param>
86-
public static void MakePermanentButton(UIBuilder ui, LocaleString name, colorX tint, ButtonEventHandler<string> callback, string argument, string? category = null)
86+
/// <param name="nonLocalArgument">The optional override for the <paramref name="argument"/> parameter on other users than the local one.</param>
87+
public static void MakePermanentButton(UIBuilder ui, LocaleString name, colorX tint, ButtonEventHandler<string> callback, string argument, string? category = null, string? nonLocalArgument = null)
8788
{
8889
ui.PushStyle();
8990
ui.Style.MinHeight = category is not null ? ConfigSection.IndirectButtonHeight : ConfigSection.DirectButtonHeight;
9091

9192
ui.HorizontalLayout(4, 0, Alignment.MiddleCenter);
9293
ui.Style.FlexibleWidth = 1;
9394

94-
var button = ui.Button(name, tint, callback, argument, .35f);
95+
var button = ui.Button(name, tint, callback, nonLocalArgument ?? argument, .35f);
9596
button.Label.ParseRichText.Value = false;
9697

98+
if (nonLocalArgument is not null)
99+
{
100+
var relay = button.Slot.GetComponent<ButtonRelay<string>>();
101+
relay.Argument.OverrideForUser(button.LocalUser, argument);
102+
}
103+
97104
if (category is not null)
98105
{
99106
var buttonLabel = button.Label;
@@ -152,8 +159,9 @@ void ICancelableEventHandler<BuildGroupButtonEvent>.Handle(BuildGroupButtonEvent
152159
var category = GetPrettyPath(eventData.ItemCategory, eventData.RootCategory);
153160
var tint = RadiantUI_Constants.Sub.PURPLE;
154161
var argument = $"{eventData.RootCategory!.GetPath()}:{eventData.Group}";
162+
var nonLocalArgument = $"{eventData.ItemCategory!.GetPath()}:{eventData.Group}";
155163

156-
MakePermanentButton(eventData.UI, eventData.GroupName, tint, selector.OpenGroupPressed, argument, category);
164+
MakePermanentButton(eventData.UI, eventData.GroupName, tint, selector.OpenGroupPressed, argument, category, nonLocalArgument);
157165

158166
eventData.Canceled = true;
159167
}

ComponentSelectorAdditions/Locale/de.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"localeCode": "de",
33
"authors": [ "Banane9" ],
44
"messages": {
5+
"ComponentSelectorAdditions.Name": "Komponenten-Selektor Ergänzungen",
56
"ComponentSelectorAdditions.Description": "Dieser MonkeyLoader Mod für Resonite strukturiert Komponenten-Selektoren und ProtoFlux Nodebrowser neu und fügt eine Suchfunktion sowie Kategorien für zuletzt genutzte und favorisierte Komponenten / Nodes hinzu.",
67

78
"ComponentSelectorAdditions.Search": "<i>Suchen ...</i>",

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@ Component Selector Additions
33

44
A [MonkeyLoader](https://github.com/MonkeyModdingTroop/MonkeyLoader) mod for [Resonite](https://resonite.com/) that overhauls the Component Selector / Protoflux Node Selector to have a search, as well as favorites and recents categories.
55

6+
67
## Install
8+
79
First, make sure you've installed MonkeyLoader and the necessary GamePacks - combined releases can be found on the page of the Resonite GamePack here: https://github.com/ResoniteModdingGroup/MonkeyLoader.GamePacks.Resonite/releases/
810

911
Then all you have to do is placing the provided `ComponentSelectorAdditions.nupkg` into your `Resonite/MonkeyLoader/Mods/` folder.
1012

13+
1114
## Features
1215

1316
* Makes the UI construction and listing of elements modular by exposing a bunch of events which this mod uses for the other features - but can be used by others too

0 commit comments

Comments
 (0)