Skip to content

Commit 78fe425

Browse files
committed
Tweaks code and warnings
1 parent 39ebd0b commit 78fe425

12 files changed

Lines changed: 29 additions & 102 deletions
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
using MonkeyLoader.Configuration;
2-
using System;
32

43
namespace DynamicVariablePowerTools
54
{
65
internal sealed class DebugInfoConfig : ConfigSection
76
{
87
private static readonly DefiningConfigKey<bool> _enableLinkedComponentHierarchy = new("EnableLinkedComponentHierarchy", "Allow generating a hierarchical list of all dynamic variable components linked to a space.", () => true);
98
private static readonly DefiningConfigKey<bool> _enableLinkedVariablesList = new("EnableLinkedVariablesList", "Allow generating a list of all dynamic variable definitions linked to a space.", () => true);
9+
1010
public override string Description => "Contains the options for the available debug info buttons on DynamicVariableSpace Components.";
1111

1212
public bool EnableLinkedComponentHierarchy => _enableLinkedComponentHierarchy;
13+
1314
public bool EnableLinkedVariablesList => _enableLinkedVariablesList;
15+
1416
public override string Id => "DebugInfo";
17+
1518
public override Version Version { get; } = new Version(1, 0, 0);
1619
}
1720
}

DynamicVariablePowerTools/DebugInfoGenerator.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections;
3-
using System.Collections.Generic;
4-
using System.Linq;
5-
using System.Text;
1+
using System.Text;
62
using Elements.Core;
73
using FrooxEngine;
84
using MonkeyLoader.Resonite;

DynamicVariablePowerTools/DynamicReferenceReceiving.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
5-
namespace DynamicVariablePowerTools
1+
namespace DynamicVariablePowerTools
62
{
73
// Offer dynamic reference variable drive based on dropped dynamic reference (variable)
84
internal sealed class DynamicReferenceReceiving

DynamicVariablePowerTools/DynamicValueReceiving.cs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
using System;
2-
using System.Collections.Generic;
3-
using System.Text;
4-
5-
namespace DynamicVariablePowerTools
1+
namespace DynamicVariablePowerTools
62
{
73
// Offer dynamic value variable drive based on dropped dynamic value variable / field reference
84
internal sealed class DynamicValueReceiving

DynamicVariablePowerTools/OpenLinkedDynamicVariableSpace.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
using FrooxEngine;
22
using HarmonyLib;
3-
using MonkeyLoader.Resonite.UI;
43
using MonkeyLoader.Resonite.UI.Inspectors;
5-
using System;
6-
using System.Collections.Generic;
7-
using System.Linq;
8-
using System.Text;
9-
using System.Threading.Tasks;
104

115
namespace DynamicVariablePowerTools
126
{

DynamicVariablePowerTools/RenameButtonHelper.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
using FrooxEngine.UIX;
44
using MonkeyLoader.Resonite;
55
using MonkeyLoader.Resonite.UI;
6-
using System;
7-
using System.Collections.Generic;
8-
using System.Text;
96

107
namespace DynamicVariablePowerTools
118
{

DynamicVariablePowerTools/RenameConfig.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
11
using MonkeyLoader.Configuration;
2-
using System;
3-
using System.Collections.Generic;
4-
using System.Text;
52

63
namespace DynamicVariablePowerTools
74
{

DynamicVariablePowerTools/RenameDirectlyLinkedVariables.cs

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
1-
using System;
2-
using FrooxEngine;
1+
using FrooxEngine;
32
using FrooxEngine.ProtoFlux;
43
using HarmonyLib;
54
using MonkeyLoader.Resonite;
65
using MonkeyLoader.Resonite.UI.Inspectors;
76

87
namespace DynamicVariablePowerTools
98
{
10-
[HarmonyPatchCategory(nameof(RenameDirectlyLinkedVariables))]
11-
[HarmonyPatch(typeof(DynamicVariableSpace), nameof(DynamicVariableSpace.UpdateName))]
12-
internal sealed class RenameDirectlyLinkedVariables : ConfiguredResoniteInspectorMonkey<RenameDirectlyLinkedVariables, RenameConfig, BuildInspectorBodyEvent, DynamicVariableSpace>
9+
internal sealed class RenameDirectlyLinkedVariables
10+
: ConfiguredResoniteInspectorMonkey<RenameDirectlyLinkedVariables, RenameConfig, BuildInspectorBodyEvent, DynamicVariableSpace>
1311
{
14-
//[AutoRegisterConfigKey]
15-
//private static ModConfigurationKey<bool> ChangeDynVarNamespaces = new ModConfigurationKey<bool>("ChangeDynVarNamespaces", "Enable searching and renaming directly linked variables and drivers when namespace changes.", () => false);
16-
17-
//[AutoRegisterConfigKey]
18-
//private static ModConfigurationKey<bool> ChangeLogixStringInputs = new ModConfigurationKey<bool>("ChangeLogixStringInputs", "Search and rename logix inputs with the old name in the form OldName/.* (Experimental).", () => false);
19-
2012
public override int Priority => HarmonyLib.Priority.Low;
2113

2214
protected override void Handle(BuildInspectorBodyEvent eventData)

DynamicVariablePowerTools/RenameDynamicVariables.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
using FrooxEngine.ProtoFlux;
44
using MonkeyLoader.Resonite;
55
using MonkeyLoader.Resonite.UI.Inspectors;
6-
using System;
76

87
namespace DynamicVariablePowerTools
98
{

DynamicVariablePowerTools/SetupVariableMemberActions.cs

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,9 @@
11
using FrooxEngine;
2-
using FrooxEngine.UIX;
32
using HarmonyLib;
43
using MonkeyLoader;
54
using MonkeyLoader.Resonite;
65
using MonkeyLoader.Resonite.UI.Inspectors;
7-
using System;
8-
using System.Collections.Generic;
9-
using System.Linq;
106
using System.Reflection;
11-
using System.Text;
12-
using System.Threading.Tasks;
137

148
namespace DynamicVariablePowerTools
159
{
@@ -73,18 +67,18 @@ private static void CreateFieldItems<T>(InspectorMemberActionsMenuItemsGeneratio
7367
var dynamicField = slot.AttachComponent<DynamicField<T>>();
7468
dynamicField.TargetField.Target = (IField<T>)eventData.Target;
7569

76-
button.World.LocalUser.CloseContextMenu(eventData.MemberActions);
70+
button.World.LocalUser.CloseContextMenu(eventData.Summoner);
7771
};
7872

7973
menuItem = eventData.ContextMenu.AddItem("Drive from Dynamic Variable", (Uri)null!, RadiantUI_Constants.Sub.PURPLE);
8074

8175
menuItem.Button.LocalPressed += (button, args) =>
8276
{
83-
button.World.LocalUser.CloseContextMenu(eventData.MemberActions);
77+
button.World.LocalUser.CloseContextMenu(eventData.Summoner);
8478

8579
button.Slot.StartTask(async () =>
8680
{
87-
await button.World.LocalUser.OpenContextMenu(eventData.MemberActions, args.source.Slot);
81+
await button.World.LocalUser.OpenContextMenu(eventData.Summoner, args.source.Slot);
8882

8983
// Need to check dynamic variable spaces hiding eachother
9084
// Also use full space/varName for drive
@@ -98,7 +92,7 @@ private static void CreateFieldItems<T>(InspectorMemberActionsMenuItemsGeneratio
9892
{
9993
var driver = slot.AttachComponent<DynamicValueVariableDriver<T>>();
10094
driver.Target.Target = (IField<T>)eventData.Target;
101-
button.World.LocalUser.CloseContextMenu(eventData.MemberActions);
95+
button.World.LocalUser.CloseContextMenu(eventData.Summoner);
10296
};
10397

10498
foreach (var option in options)
@@ -107,7 +101,7 @@ private static void CreateFieldItems<T>(InspectorMemberActionsMenuItemsGeneratio
107101
menuItem3.Button.LocalPressed += (button2, args2) =>
108102
{
109103
((IField<T>)eventData.Target).DriveFromVariable(option.name);
110-
button.World.LocalUser.CloseContextMenu(eventData.MemberActions);
104+
button.World.LocalUser.CloseContextMenu(eventData.Summoner);
111105
};
112106
}
113107
});

0 commit comments

Comments
 (0)