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
12 changes: 1 addition & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ jobs:
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: ./InspectorPowerTools.nupkg

# Only when it's not from a PR to avoid any funny packages in the cache
- name: Save NuGet Package Cache
Expand All @@ -101,9 +94,6 @@ jobs:
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
9 changes: 9 additions & 0 deletions InspectorPowerTools.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
12 changes: 8 additions & 4 deletions InspectorPowerTools/DragAndDropComponentsOntoSlotHierarchy.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
using FrooxEngine;
using HarmonyLib;
using MonkeyLoader.Resonite;
using System;
using System.Collections.Generic;
using System.Text;

namespace InspectorPowerTools
{
Expand All @@ -22,10 +19,17 @@ private static void Postfix(SlotInspector __instance, bool __state)
if (!__state)
return;

// Lenient allocating user check on children to allow it with MyInspectors as well.
// Checking on the instance wouldn't be correct, since that could've been created by anyone -
// so we add the SlotComponentReceivers whenever we just created the updated slots.
// This will only be the case when we're the Authority (host), or we locally updated the inspector's content.
if (!__instance.Slot.Children.FirstOrDefault().TryGetAllocatingUser(out var user) || !user.IsLocalUser)
return;

__instance.Slot.ForeachComponentInChildren<SlotRecord>(AddComponentReceiver, cacheItems: true);
}

private static void Prefix(SlotInspector __instance, out bool __state)
=> __state = Enabled && __instance.World.IsAuthority && __instance._rootSlot.Target != __instance._setupRoot;
=> __state = Enabled && __instance._rootSlot.Target != __instance._setupRoot;
}
}
Loading