diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9ef8f21..343821d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: @@ -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 @@ -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 @@ -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: diff --git a/InspectorPowerTools.sln b/InspectorPowerTools.sln index 7c79c3d..42c2f76 100644 --- a/InspectorPowerTools.sln +++ b/InspectorPowerTools.sln @@ -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 @@ -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 diff --git a/InspectorPowerTools/DragAndDropComponentsOntoSlotHierarchy.cs b/InspectorPowerTools/DragAndDropComponentsOntoSlotHierarchy.cs index bf02e5b..d85f512 100644 --- a/InspectorPowerTools/DragAndDropComponentsOntoSlotHierarchy.cs +++ b/InspectorPowerTools/DragAndDropComponentsOntoSlotHierarchy.cs @@ -1,9 +1,6 @@ using FrooxEngine; using HarmonyLib; using MonkeyLoader.Resonite; -using System; -using System.Collections.Generic; -using System.Text; namespace InspectorPowerTools { @@ -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(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; } } \ No newline at end of file