Skip to content

Commit 1290383

Browse files
Banane9art0007i
andcommitted
Fix migrated items from messages not spawning because they still point to the old platform
Adds a fix for Yellow-Dog-Man/Resonite-Issues#83 Co-authored-by: art0007i <art0007i@gmail.com>
1 parent a46d1fe commit 1290383

File tree

4 files changed

+33
-0
lines changed

4 files changed

+33
-0
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
using FrooxEngine;
2+
using HarmonyLib;
3+
using MonkeyLoader.Resonite;
4+
using SkyFrost.Base;
5+
using System;
6+
using System.Collections.Generic;
7+
using System.Text;
8+
9+
// Originally released under MIT-0 here:
10+
// https://github.com/art0007i/FixMigratedItemMessages
11+
12+
namespace CommunityBugFixCollection
13+
{
14+
[HarmonyPatchCategory(nameof(FixMigratedItemMessages))]
15+
[HarmonyPatch(typeof(ContactsDialog), nameof(ContactsDialog.SpawnMessageItem))]
16+
internal sealed class FixMigratedItemMessages : ResoniteMonkey<FixMigratedItemMessages>
17+
{
18+
private const string OldPrefix = "neosdb";
19+
20+
public override IEnumerable<string> Authors => Contributors.Art0007i;
21+
22+
public override bool CanBeDisabled => true;
23+
24+
public static void Prefix(ref Record record)
25+
{
26+
if (Enabled && record.AssetURI.StartsWith(OldPrefix))
27+
record.AssetURI = $"{Engine.Current.PlatformProfile.DBScheme}{record.AssetURI[OldPrefix.Length..]}";
28+
}
29+
}
30+
}

CommunityBugFixCollection/Locale/de.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"CommunityBugFixCollection.CorrectMaterialGizmoScaling.Description": "Verhindert, dass das MaterialGizmo zweimal skaliert wird, wenn man Editieren auf dem Materialwerzeug nutzt.",
1818
"CommunityBugFixCollection.DuplicateAndMoveMultipleGrabbedItems.Description": "Verhindert, dass Referenzen zwischen mehreren duplizierten oder zwischen Welten transferierten Objekten gebrochen werden.",
1919
"CommunityBugFixCollection.FireBrushToolDequipEvents.Description": "Sorgt dafür, dass von BrushTool abgeleitete Werkzeuge OnDequipped Events abschicken.",
20+
"CommunityBugFixCollection.FixMigratedItemMessages.Description": "Sorgt dafür, dass migrierte Objekte aus Nachrichten gespawnt werden können, obwohl sie noch auf die alte Platform verweisen.",
2021
"CommunityBugFixCollection.GammaCorrectedColorXLuminance.Description": "Korrigiert die Berechnung der Luminanz bei nicht-linearen ColorX Farbprofilen.",
2122
"CommunityBugFixCollection.HighlightHomeWorldInInventory.Description": "Sorgt dafür, dass die ausgewählte Heimatwelt im Inventar korrekt hervorgehoben wird.",
2223
"CommunityBugFixCollection.ImportMultipleAudioFiles.Description": "Macht es möglich mehrere Audiodateien auf einmal zu importieren.",

CommunityBugFixCollection/Locale/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"CommunityBugFixCollection.CorrectMaterialGizmoScaling.Description": "Fixes the MaterialGizmo being scaled twice when using Edit on the Material Tool.",
1818
"CommunityBugFixCollection.DuplicateAndMoveMultipleGrabbedItems.Description": "Fixes references between multiple duplicated or transferred-between-worlds items breaking.",
1919
"CommunityBugFixCollection.FireBrushToolDequipEvents.Description": "Fixes tools derived from BrushTool not firing OnDequipped events.",
20+
"CommunityBugFixCollection.FixMigratedItemMessages.Description": "Fixes migrated items sent as messages not spawning because they still point to the old platform.",
2021
"CommunityBugFixCollection.GammaCorrectedColorXLuminance.Description": "Fixes ColorX Luminance calculations being incorrect for non-linear color profiles.",
2122
"CommunityBugFixCollection.HighlightHomeWorldInInventory.Description": "Fixes the selected Home World in the Inventory not being highlighted as a favorite.",
2223
"CommunityBugFixCollection.ImportMultipleAudioFiles.Description": "Fixes it not being possible to import multiple audio clips at once.",

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ The issues fixed by this mod will be linked in the following list.
2020
If any of them have been closed and not removed from the mod,
2121
just disable them in the settings in the meantime.
2222

23+
* Migrated items sent as messages do not spawn because they still point to `neosdb` (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/83)
2324
* Grab World Locomotion moving the user forward a little every time it's activated (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/86)
2425
* Duplicating Components breaking drives (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/92)
2526
* Pressing Duplicate on the Component in an Inspector

0 commit comments

Comments
 (0)