From 36b168377b0114d7a91f0dd0377c65bdb2d3d5ad Mon Sep 17 00:00:00 2001 From: Arne Kiesewetter Date: Tue, 22 Apr 2025 20:15:44 +0200 Subject: [PATCH] Center content of notifications Co-authored-by: art0007i --- .../CenteredNotifications.cs | 32 +++++++++++++++++++ .../DuplicateAndMoveMultipleGrabbedItems.cs | 2 +- CommunityBugFixCollection/Locale/de.json | 3 +- CommunityBugFixCollection/Locale/en.json | 3 +- README.md | 3 ++ 5 files changed, 40 insertions(+), 3 deletions(-) create mode 100644 CommunityBugFixCollection/CenteredNotifications.cs diff --git a/CommunityBugFixCollection/CenteredNotifications.cs b/CommunityBugFixCollection/CenteredNotifications.cs new file mode 100644 index 0000000..001b345 --- /dev/null +++ b/CommunityBugFixCollection/CenteredNotifications.cs @@ -0,0 +1,32 @@ +using FrooxEngine; +using HarmonyLib; +using MonkeyLoader.Resonite; +using System; +using System.Collections.Generic; +using System.Text; + +// Originally released under MIT-0 here: +// https://github.com/art0007i/NotificationFixer + +namespace CommunityBugFixCollection +{ + [HarmonyPatchCategory(nameof(CenteredNotifications))] + [HarmonyPatch(typeof(NotificationPanel), nameof(NotificationPanel.OnCommonUpdate))] + internal class CenteredNotifications : ResoniteMonkey + { + public override IEnumerable Authors => Contributors.Art0007i; + + public override bool CanBeDisabled => true; + + public static IEnumerable Transpiler(IEnumerable codes) + { + foreach (var code in codes) + { + if (Enabled && code.LoadsConstant(36.0f)) + code.operand = 32.0f; + + yield return code; + } + } + } +} \ No newline at end of file diff --git a/CommunityBugFixCollection/DuplicateAndMoveMultipleGrabbedItems.cs b/CommunityBugFixCollection/DuplicateAndMoveMultipleGrabbedItems.cs index 6d17297..bee0980 100644 --- a/CommunityBugFixCollection/DuplicateAndMoveMultipleGrabbedItems.cs +++ b/CommunityBugFixCollection/DuplicateAndMoveMultipleGrabbedItems.cs @@ -1,6 +1,5 @@ using Elements.Core; using FrooxEngine; -using FrooxEngine.ProtoFlux.Runtimes.Execution.Nodes.FrooxEngine.Slots; using FrooxEngine.Undo; using HarmonyLib; using MonkeyLoader.Resonite; @@ -8,6 +7,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; + using static FrooxEngine.Worker; // This code is mainly decompiled Resonite source code, diff --git a/CommunityBugFixCollection/Locale/de.json b/CommunityBugFixCollection/Locale/de.json index 6a139d4..d2ddd8b 100644 --- a/CommunityBugFixCollection/Locale/de.json +++ b/CommunityBugFixCollection/Locale/de.json @@ -7,9 +7,10 @@ "CommunityBugFixCollection.CopyToClipboard": "In Zwischenablage kopieren", - "CommunityBugFixCollection.CaseInsensitiveCustomGenerics.Description": "Macht das Auswählen von eigenen generischen Typparametern unabhängig von Groß- und Kleinschreibung.", "CommunityBugFixCollection.BreakDragAndDropCopiedComponentDrives.Description": "Sorgt dafür, dass Drives beim Kopieren von Komponenten mittels Drag-und-Drop nicht kaputt gehen.", "CommunityBugFixCollection.BreakDuplicatedComponentDrives.Description": "Sorgt dafür, dass Drives beim Duplizieren von Komponenten nicht kaputt gehen.", + "CommunityBugFixCollection.CaseInsensitiveCustomGenerics.Description": "Macht das Auswählen von eigenen generischen Typparametern unabhängig von Groß- und Kleinschreibung.", + "CommunityBugFixCollection.CenteredNotifications.Description": "Zentriert den Inhalt von Benachrichtigungen.", "CommunityBugFixCollection.CheckSelfForDuplicateSlot.Description": "Verhindert einen Crash wenn der OverrideParent bei der Duplicate Slot ProtoFlux Node gleich dem Template ist.", "CommunityBugFixCollection.ColorDisplayValueProxy.Description": "Sorgt dafür, dass ValueDisplay Nodes eine ValueProxySource Komponente haben.", "CommunityBugFixCollection.ColorXNodeNamesSpacing.Description": "Korrigiert die Schreibweise der Namen von ProtoFlux Nodes die ColorX enthalten.", diff --git a/CommunityBugFixCollection/Locale/en.json b/CommunityBugFixCollection/Locale/en.json index ef81342..65f52f3 100644 --- a/CommunityBugFixCollection/Locale/en.json +++ b/CommunityBugFixCollection/Locale/en.json @@ -7,9 +7,10 @@ "CommunityBugFixCollection.CopyToClipboard": "Copy to Clipboard", - "CommunityBugFixCollection.CaseInsensitiveCustomGenerics.Description": "Makes picking custom generic type parameters case-insensitive.", "CommunityBugFixCollection.BreakDragAndDropCopiedComponentDrives.Description": "Fixes copying components using drag-and-drop breaking drives.", "CommunityBugFixCollection.BreakDuplicatedComponentDrives.Description": "Fixes duplicating components breaking drives.", + "CommunityBugFixCollection.CaseInsensitiveCustomGenerics.Description": "Makes picking custom generic type parameters case-insensitive.", + "CommunityBugFixCollection.CenteredNotifications.Description": "Centers the content of notifications.", "CommunityBugFixCollection.CheckSelfForDuplicateSlot.Description": "Fixes a crash when the OverrideParent of the Duplicate Slot ProtoFlux node is identical to the Template.", "CommunityBugFixCollection.ColorDisplayValueProxy.Description": "Fixes ValueDisplay not having a ValueProxySource component.", "CommunityBugFixCollection.ColorXNodeNamesSpacing.Description": "Fixes ProtoFlux node names containing ColorX being spaced wrong.", diff --git a/README.md b/README.md index ed6a737..15dabbe 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,9 @@ just disable them in the settings in the meantime. * Direct cursor size becoming very large when snapped to an object much closer than the true cursor (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3654) * DuplicateSlot ProtoFlux node crashes game when if OverrideParent is identical to Template (https://github.com/Yellow-Dog-Man/Resonite-Issues/issues/3950) +Fixes with no issue (that could be found). +* Content of notification being off-center. + ## Workarounds