diff --git a/Notification/NotificationSystem.cs b/Notification/NotificationSystem.cs index dbf549d..5e3283b 100644 --- a/Notification/NotificationSystem.cs +++ b/Notification/NotificationSystem.cs @@ -16,6 +16,9 @@ public class NotificationSystem public static Color DefaultColour = new Color(0.1764f, 0.2549f, .3333f, 1f); public static MelonPreferences_Entry NotificationAlpha; public static MelonPreferences_Entry NotificationAlignment; + public static MelonPreferences_Entry NotificationCoordinateAlignment; + public static MelonPreferences_Entry NotificationX; + public static MelonPreferences_Entry NotificationY; public static bool UseVRChatNotificationSystem; //AssetBundle Parts @@ -48,8 +51,14 @@ public static void SetupNotifications() MelonPreferences.CreateCategory("ReModCore", "ReMod.Core"); NotificationAlpha = MelonPreferences.CreateEntry("ReModCore", "NotificationAlpha", .7f, "Notification Alpha", "Controls transparency of the notification system."); NotificationAlignment = MelonPreferences.CreateEntry("ReModCore", "NotificationAlignment", "centerMiddle", "Notification Alignment"); + NotificationCoordinateAlignment = MelonPreferences.CreateEntry("ReModCore", "NotificationCoordinateAlignment", false, "Use Coordinate Alignment"); + NotificationX = MelonPreferences.CreateEntry("ReModCore", "NotificationX", .5f, "Notification X", "Controls the X position of the notification system."); + NotificationY = MelonPreferences.CreateEntry("ReModCore", "NotificationY", .5f, "Notification Y", "Controls the Y position of the notification system."); NotificationAlignment.OnValueChanged += UpdateNotificationAlignment; + NotificationCoordinateAlignment.OnValueChanged += (_, _) => UpdateNotificationAlignment(null, null); + NotificationX.OnValueChanged += (_, _) => UpdateNotificationAlignment(null, null); + NotificationY.OnValueChanged += (_, _) => UpdateNotificationAlignment(null, null); //Create UIX settings enum RegSettingsEnum("ReModCore", "NotificationAlignment", new[] {("centerMiddle", "Middle Centered"), ("topCenter", "Top Centered"), ("topLeft", "Top Left"), ("topRight", "Top Right"), ("bottomCenter", "Bottom Centered"), ("bottomLeft", "Bottom Left"), ("bottomRight", "Bottom Right")}); @@ -116,6 +125,14 @@ public static void CloseNotification() private static void UpdateNotificationAlignment(string sender, string args) { if (_notificationRect == null) return; + + if (NotificationCoordinateAlignment.Value) + { + _notificationRect.anchorMin = new Vector2(NotificationX.Value, NotificationY.Value); + _notificationRect.anchorMax = new Vector2(NotificationX.Value, NotificationY.Value); + _notificationRect.pivot = new Vector2(NotificationX.Value, NotificationY.Value); + return; + } switch (NotificationAlignment.Value) { @@ -222,4 +239,4 @@ private static bool RegSettingsEnum(string settingsCat, string settingsName, ILi #endregion } -} \ No newline at end of file +}