From d84ffbe11c0b0fbb046d64cbc6227a86c86a598b Mon Sep 17 00:00:00 2001
From: Sirspam <71392316+Sirspam@users.noreply.github.com>
Date: Thu, 11 May 2023 15:12:57 +0100
Subject: [PATCH 1/5] Updated to 1.29.4
---
Nya/Nya.csproj | 11 +++++------
1 file changed, 5 insertions(+), 6 deletions(-)
diff --git a/Nya/Nya.csproj b/Nya/Nya.csproj
index 999b630..9aa5184 100644
--- a/Nya/Nya.csproj
+++ b/Nya/Nya.csproj
@@ -3,7 +3,7 @@
net48
Library
- 8
+ 9
enable
false
..\Refs
@@ -12,11 +12,6 @@
portable
-
- enable
- 8.0
-
-
True
@@ -104,6 +99,10 @@
$(BeatSaberDir)\Plugins\SiraUtil.dll
false
+
+ $(BeatSaberDir)\Beat Saber_Data\Managed\Tweening.dll
+ False
+
From f13328bc80e25cb123c9f07263c5e64525961e2b Mon Sep 17 00:00:00 2001
From: Sirspam <71392316+Sirspam@users.noreply.github.com>
Date: Fri, 19 May 2023 19:19:11 +0100
Subject: [PATCH 2/5] Added saved positions
---
Nya/Components/NyaSettingsClickableImage.cs | 6 +-
Nya/Configuration/PluginConfig.cs | 4 +
.../SettingsModalController.cs | 32 +++-
.../SettingsModalGameController.cs | 6 +-
.../SettingsModalMenuController.cs | 3 +
.../NyaSettingsMainViewController.cs | 3 +-
Nya/UI/Views/SettingsModalView.bsml | 9 +-
Nya/Utils/FloatingScreenUtils.cs | 149 ++++++++++++++----
Nya/Utils/ImageUtils.cs | 4 +-
9 files changed, 170 insertions(+), 46 deletions(-)
diff --git a/Nya/Components/NyaSettingsClickableImage.cs b/Nya/Components/NyaSettingsClickableImage.cs
index ae89317..b9d70fb 100644
--- a/Nya/Components/NyaSettingsClickableImage.cs
+++ b/Nya/Components/NyaSettingsClickableImage.cs
@@ -11,7 +11,7 @@ internal sealed class NyaSettingsClickableImage : MonoBehaviour, IPointerClickHa
{
private AudioClip[] _audioClips = new AudioClip[3];
private AudioSource _basicUIAudioManagerAudioSource = null!;
-
+
private bool _isBogShamb;
private PluginConfig _pluginConfig = null!;
private IPlatformUserModel _platformUserModel = null!;
@@ -21,7 +21,7 @@ public async void Construct(PluginConfig pluginConfig, IPlatformUserModel platfo
{
_pluginConfig = pluginConfig;
_platformUserModel = platformUserModel;
-
+
_isBogShamb = (await _platformUserModel.GetUserInfo()).platformUserId == "76561198087340992";
}
@@ -37,7 +37,7 @@ private void Awake()
_basicUIAudioManagerAudioSource = BeatSaberUI.BasicUIAudioManager.GetComponent();
}
}
-
+
public void OnPointerClick(PointerEventData eventData)
{
if (_pluginConfig.IsAprilFirst || (_isBogShamb && _pluginConfig.EasterEggs))
diff --git a/Nya/Configuration/PluginConfig.cs b/Nya/Configuration/PluginConfig.cs
index 0eb3880..768f910 100644
--- a/Nya/Configuration/PluginConfig.cs
+++ b/Nya/Configuration/PluginConfig.cs
@@ -27,6 +27,10 @@ internal class PluginConfig
public virtual Vector3 MenuRotation { get; set; } = FloatingScreenUtils.DefaultRotation.eulerAngles;
public virtual Vector3 PausePosition { get; set; } = FloatingScreenUtils.DefaultPosition;
public virtual Vector3 PauseRotation { get; set; } = FloatingScreenUtils.DefaultRotation.eulerAngles;
+ public virtual Vector3 SavedMenuPosition { get; set; } = FloatingScreenUtils.DefaultPosition;
+ public virtual Vector3 SavedMenuRotation { get; set; } = FloatingScreenUtils.DefaultRotation.eulerAngles;
+ public virtual Vector3 SavedPausePosition { get; set; } = FloatingScreenUtils.DefaultPosition;
+ public virtual Vector3 SavedPauseRotation { get; set; } = FloatingScreenUtils.DefaultRotation.eulerAngles;
public virtual bool UseBackgroundColor { get; set; } = false;
public virtual Color BackgroundColor { get; set; } = new Color(0.745f, 0.745f, 0.745f);
public virtual bool RainbowBackgroundColor { get; set; } = false;
diff --git a/Nya/UI/ViewControllers/ModalControllers/SettingsModalController.cs b/Nya/UI/ViewControllers/ModalControllers/SettingsModalController.cs
index 614a0d3..3009d9f 100644
--- a/Nya/UI/ViewControllers/ModalControllers/SettingsModalController.cs
+++ b/Nya/UI/ViewControllers/ModalControllers/SettingsModalController.cs
@@ -104,9 +104,12 @@ protected SettingsModalController(UIUtils uiUtils, ImageUtils imageUtils, MainCa
[UIComponent("set-upright-button")]
protected readonly Button SetUprightButton = null!;
- [UIComponent("default-position-button")]
- protected readonly Button DefaultPositionButton = null!;
-
+ [UIComponent("saved-position-button")]
+ protected readonly Button SavedPositionButton = null!;
+
+ [UIComponent("save-position-button")]
+ protected readonly Button SavePositionButton = null!;
+
[UIComponent("show-handle-checkbox")]
protected readonly GenericInteractableSetting ShowHandleCheckbox = null!;
@@ -267,6 +270,12 @@ protected string NsfwValue
set => PluginConfig.SelectedEndpoints[APIValue].SelectedNsfwEndpoint = value;
}
+ [UIValue("saved-position-button-text")]
+ protected abstract string SavedPositionButtonText
+ {
+ get;
+ }
+
#endregion
#region Actions
@@ -329,13 +338,20 @@ protected void SetUprightClicked()
_floatingScreenUtils.TweenUpright();
}
- [UIAction("default-position-clicked")]
- protected void DefaultPositionClicked()
+ [UIAction("saved-position-clicked")]
+ protected void SavedPositionClicked()
{
- _uiUtils.ButtonUnderlineClick(DefaultPositionButton.gameObject);
- _floatingScreenUtils.TweenToDefaultPosition();
+ _uiUtils.ButtonUnderlineClick(SavedPositionButton.gameObject);
+ _floatingScreenUtils.TweenToSavedPosition();
}
-
+
+ [UIAction("save-position-clicked")]
+ protected void SavePositionClicked()
+ {
+ _uiUtils.ButtonUnderlineClick(SavePositionButton.gameObject);
+ _floatingScreenUtils.SaveCurrentPosition();
+ }
+
[UIAction("show-handle-changed")]
protected void ShowHandleChanged(bool value)
{
diff --git a/Nya/UI/ViewControllers/ModalControllers/SettingsModalGameController.cs b/Nya/UI/ViewControllers/ModalControllers/SettingsModalGameController.cs
index 697eee7..c03f8ad 100644
--- a/Nya/UI/ViewControllers/ModalControllers/SettingsModalGameController.cs
+++ b/Nya/UI/ViewControllers/ModalControllers/SettingsModalGameController.cs
@@ -1,4 +1,5 @@
-using Nya.Configuration;
+using BeatSaberMarkupLanguage.Attributes;
+using Nya.Configuration;
using Nya.Utils;
using Tweening;
using UnityEngine;
@@ -17,5 +18,8 @@ public void ShowModal(Transform parentTransform)
ShowModal(parentTransform, this);
MoreSettingsTab.IsVisible = false;
}
+
+ [UIValue("saved-position-button-text")]
+ protected override string SavedPositionButtonText => PluginConfig.SeparatePositions ? "Saved Game Position" : "Saved Position";
}
}
\ No newline at end of file
diff --git a/Nya/UI/ViewControllers/ModalControllers/SettingsModalMenuController.cs b/Nya/UI/ViewControllers/ModalControllers/SettingsModalMenuController.cs
index ab5a19d..63690d1 100644
--- a/Nya/UI/ViewControllers/ModalControllers/SettingsModalMenuController.cs
+++ b/Nya/UI/ViewControllers/ModalControllers/SettingsModalMenuController.cs
@@ -32,6 +32,9 @@ public void ShowModal(Transform parentTransform)
ScreenTab.IsVisible = false;
}
}
+
+ [UIValue("saved-position-button-text")]
+ protected override string SavedPositionButtonText => PluginConfig.SeparatePositions ? "Saved Menu Position" : "Saved Position";
[UIAction("show-nya-settings")]
private void ShowNyaSettings()
diff --git a/Nya/UI/ViewControllers/SettingsControllers/NyaSettingsMainViewController.cs b/Nya/UI/ViewControllers/SettingsControllers/NyaSettingsMainViewController.cs
index da426d5..1f55b86 100644
--- a/Nya/UI/ViewControllers/SettingsControllers/NyaSettingsMainViewController.cs
+++ b/Nya/UI/ViewControllers/SettingsControllers/NyaSettingsMainViewController.cs
@@ -126,7 +126,7 @@ private bool UpdateAvailable
}
[UIValue("restart-required")]
- private bool RestartRequired => (InMenu != _pluginConfig.InMenu || EasterEggs != _pluginConfig.EasterEggs) && isActiveAndEnabled;
+ private bool RestartRequired => (InMenu != _pluginConfig.InMenu || SeparatePositions != _pluginConfig.SeparatePositions || EasterEggs != _pluginConfig.EasterEggs) && isActiveAndEnabled;
[UIValue("in-menu")]
private bool InMenu
@@ -232,6 +232,7 @@ private bool SeparatePositions
_separatePositions = value;
SeparatePositionsButOpposite = !value;
NotifyPropertyChanged();
+ NotifyPropertyChanged(nameof(RestartRequired));
}
}
diff --git a/Nya/UI/Views/SettingsModalView.bsml b/Nya/UI/Views/SettingsModalView.bsml
index 6e17c0c..3b74068 100644
--- a/Nya/UI/Views/SettingsModalView.bsml
+++ b/Nya/UI/Views/SettingsModalView.bsml
@@ -25,9 +25,12 @@
-
-
-
+
+
+
+
+
+
diff --git a/Nya/Utils/FloatingScreenUtils.cs b/Nya/Utils/FloatingScreenUtils.cs
index 60d34ea..bebc96f 100644
--- a/Nya/Utils/FloatingScreenUtils.cs
+++ b/Nya/Utils/FloatingScreenUtils.cs
@@ -11,7 +11,7 @@
namespace Nya.Utils
{
- internal class FloatingScreenUtils
+ internal class FloatingScreenUtils : IDisposable
{
public static Vector3 DefaultPosition = new Vector3(0f, 3.75f, 4f);
public static Quaternion DefaultRotation = Quaternion.Euler(332f, 0f, 0f);
@@ -51,24 +51,22 @@ public void CreateNyaFloatingScreen(object host, FloatingScreenType type)
switch (type)
{
case FloatingScreenType.Game:
- if (_pluginConfig.SeparatePositions)
- {
- GameFloatingScreen = CreateNyaFloatingScreen(host, _pluginConfig.PausePosition, _pluginConfig.PauseRotation);
- GameFloatingScreen.gameObject.name = "NyaGameFloatingScreen";
- break;
- }
- GameFloatingScreen = CreateNyaFloatingScreen(host, _pluginConfig.MenuPosition, _pluginConfig.MenuRotation);
+ GameFloatingScreen = _pluginConfig.SeparatePositions
+ ? CreateNyaFloatingScreen(host, _pluginConfig.PausePosition, _pluginConfig.PauseRotation)
+ : CreateNyaFloatingScreen(host, _pluginConfig.MenuPosition, _pluginConfig.MenuRotation);
GameFloatingScreen.gameObject.name = "NyaGameFloatingScreen";
+ GameFloatingScreen.HandleGrabbed += GameFloatingScreenOnHandleGrabbed;
break;
case FloatingScreenType.Menu:
default:
MenuFloatingScreen = CreateNyaFloatingScreen(host, _pluginConfig.MenuPosition, _pluginConfig.MenuRotation);
MenuFloatingScreen.gameObject.name = "NyaMenuFloatingScreen";
+ MenuFloatingScreen.HandleGrabbed += MenuFloatingScreenOnHandleGrabbed;
break;
}
}
-
+
private FloatingScreen CreateNyaFloatingScreen(object host, Vector3 position, Vector3 rotation)
{
var floatingScreen = FloatingScreen.CreateFloatingScreen(new Vector2(100f, 80f), true, position, Quaternion.Euler(rotation), 220, true);
@@ -128,43 +126,46 @@ public void ScaleFloatingScreen(float scale)
}
}
- public void TweenToDefaultPosition(bool saveValuesToConfig = true)
+ public void TweenToDefaultPosition(bool saveToConfig = true) => TweenToPosition(DefaultPosition, DefaultRotation, saveToConfig);
+
+ public void TweenToSavedPosition()
{
var floatingScreen = GetActiveFloatingScreen();
-
+
if (floatingScreen == null)
{
return;
}
- _timeTweeningManager.KillAllTweens(floatingScreen);
- var transform = floatingScreen.gameObject.transform;
- var oldPosition = transform.position;
- var oldRotation = transform.rotation;
- var time = (float) Math.Sqrt(Vector3.Distance(oldPosition, DefaultPosition) / 2);
- if (time < 0.5f)
+ if (floatingScreen.gameObject.name == "NyaGameFloatingScreen" && _pluginConfig.SeparatePositions)
{
- time = (float) Math.Sqrt(Quaternion.Angle(oldRotation, DefaultRotation) / 100); // Should probably change this
+ TweenToPosition(floatingScreen, _pluginConfig.SavedPausePosition, Quaternion.Euler(_pluginConfig.SavedPauseRotation), true);
}
- var positionTween = new FloatTween(0f, 1f, val => transform.position = Vector3.Lerp(oldPosition, DefaultPosition, val), time, EaseType.OutQuart);
- var rotationTween = new FloatTween(0f, 1f, val => transform.rotation = Quaternion.Lerp(oldRotation, DefaultRotation, val), time, EaseType.OutQuart);
- _timeTweeningManager.AddTween(positionTween, floatingScreen);
- _timeTweeningManager.AddTween(rotationTween, floatingScreen);
+ else
+ {
+ TweenToPosition(floatingScreen, _pluginConfig.SavedMenuPosition, Quaternion.Euler(_pluginConfig.SavedMenuRotation), true);
+ }
+ }
- if (!saveValuesToConfig)
+ public void SaveCurrentPosition()
+ {
+ var floatingScreen = GetActiveFloatingScreen();
+
+ if (floatingScreen == null)
{
return;
}
- if (floatingScreen.gameObject.name == "NyaGameFloatingScreen" && _pluginConfig.SeparatePositions)
+ var gameObject = floatingScreen.gameObject;
+ if (gameObject.name == "NyaGameFloatingScreen" && _pluginConfig.SeparatePositions)
{
- _pluginConfig.PausePosition = DefaultPosition;
- _pluginConfig.PauseRotation = DefaultRotation.eulerAngles;
+ _pluginConfig.SavedPausePosition = gameObject.transform.position;
+ _pluginConfig.SavedPauseRotation = gameObject.transform.eulerAngles;
}
else
{
- _pluginConfig.MenuPosition = DefaultPosition;
- _pluginConfig.MenuRotation = DefaultRotation.eulerAngles;
+ _pluginConfig.SavedMenuPosition = gameObject.transform.position;
+ _pluginConfig.SavedMenuRotation = gameObject.transform.eulerAngles;
}
}
@@ -216,6 +217,75 @@ public void TweenUpright()
_pluginConfig.MenuRotation = newRotation.eulerAngles;
}
}
+
+ public void TweenToPosition(Vector3? newPosition, Quaternion? newRotation, bool saveToConfig)
+ {
+ var floatingScreen = GetActiveFloatingScreen();
+
+ if (floatingScreen == null || (newPosition is null && newRotation is null))
+ {
+ return;
+ }
+
+ var transform = floatingScreen.transform;
+ var position = transform.position;
+ var rotation = transform.rotation;
+
+ if (newPosition is not null)
+ {
+ position = (Vector3) newPosition;
+ }
+
+ if (newRotation is not null)
+ {
+ rotation = (Quaternion) newRotation;
+ }
+
+ TweenToPosition(floatingScreen, position, rotation, saveToConfig);
+ }
+
+ public void TweenToPosition(FloatingScreen floatingScreen, Vector3 newPosition, Quaternion newRotation, bool saveToConfig)
+ {
+ var transform = floatingScreen.gameObject.transform;
+ var startPosition = transform.position;
+ var startRotation = transform.rotation;
+
+ _timeTweeningManager.KillAllTweens(floatingScreen);
+ if (startPosition == newPosition && startRotation == newRotation)
+ {
+ return;
+ }
+
+ var maxDuration = 1.2f;
+ var positionDuration = maxDuration / Vector3.Distance(startPosition, newPosition);
+ var rotationDuration = maxDuration / Quaternion.Angle(startRotation, newRotation);
+ var duration = Mathf.Max(positionDuration, rotationDuration);
+ // min time
+ duration = Mathf.Max(duration, 0.85f);
+ // max time
+ duration = Mathf.Min(duration, maxDuration);
+
+ var positionTween = new FloatTween(0f, 1f, val => transform.position = Vector3.Lerp(startPosition, newPosition, val), duration, EaseType.OutQuad);
+ var rotationTween = new FloatTween(0f, 1f, val => transform.rotation = Quaternion.Lerp(startRotation, newRotation, val), duration, EaseType.OutCubic);
+ _timeTweeningManager.AddTween(positionTween, floatingScreen);
+ _timeTweeningManager.AddTween(rotationTween, floatingScreen);
+
+ if (!saveToConfig)
+ {
+ return;
+ }
+
+ if (floatingScreen.gameObject.name == "NyaGameFloatingScreen" && _pluginConfig.SeparatePositions)
+ {
+ _pluginConfig.PausePosition = newPosition;
+ _pluginConfig.PauseRotation = newRotation.eulerAngles;
+ }
+ else
+ {
+ _pluginConfig.MenuPosition = newPosition;
+ _pluginConfig.MenuRotation = newRotation.eulerAngles;
+ }
+ }
public void SetNyaMaterialColor(Color color)
{
@@ -298,5 +368,28 @@ private Material InstantiateNyaMaterial()
material.color = color;
return material;
}
+
+ private void GameFloatingScreenOnHandleGrabbed(object sender, FloatingScreenHandleEventArgs e)
+ {
+ _timeTweeningManager.KillAllTweens(GameFloatingScreen);
+ }
+
+ private void MenuFloatingScreenOnHandleGrabbed(object sender, FloatingScreenHandleEventArgs e)
+ {
+ _timeTweeningManager.KillAllTweens(MenuFloatingScreen);
+ }
+
+ public void Dispose()
+ {
+ if (GameFloatingScreen is not null)
+ {
+ GameFloatingScreen.HandleGrabbed -= GameFloatingScreenOnHandleGrabbed;
+ }
+
+ if (MenuFloatingScreen is not null)
+ {
+ MenuFloatingScreen.HandleGrabbed -= MenuFloatingScreenOnHandleGrabbed;
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Nya/Utils/ImageUtils.cs b/Nya/Utils/ImageUtils.cs
index 793450e..9158094 100644
--- a/Nya/Utils/ImageUtils.cs
+++ b/Nya/Utils/ImageUtils.cs
@@ -85,7 +85,7 @@ public void DownloadNyaImage()
return null;
}
}
-
+
private async Task GetImageURL(string endpoint)
{
try
@@ -241,7 +241,7 @@ public void LoadCurrentNyaImage(ImageView image, Action? callback)
image.SetImage(_nyaImageURL, false, options, () => callback?.Invoke());
image.name = _nyaImageURL;
}
-
+
private void LoadErrorSprite(Image image)
{
var oldStateUpdater = image.GetComponent();
From c3fe921154856cd9940952c90af6aaefb4bb2a67 Mon Sep 17 00:00:00 2001
From: Sirspam <71392316+Sirspam@users.noreply.github.com>
Date: Wed, 31 May 2023 15:10:47 +0100
Subject: [PATCH 3/5] Updated for BSIPA 4.3.0
---
Nya/Nya.csproj | 10 +++++++---
Nya/UI/FlowCoordinators/NyaSettingsFlowCoordinator.cs | 2 +-
.../EnableNsfwFeaturesModalController.cs | 4 ++--
.../ModalControllers/NsfwConfirmModalController.cs | 2 +-
.../ModalControllers/SettingsModalController.cs | 2 +-
Nya/Utils/ImageUtils.cs | 2 +-
Nya/manifest.json | 4 ++--
7 files changed, 15 insertions(+), 11 deletions(-)
diff --git a/Nya/Nya.csproj b/Nya/Nya.csproj
index 9aa5184..11158ad 100644
--- a/Nya/Nya.csproj
+++ b/Nya/Nya.csproj
@@ -50,14 +50,17 @@
$(BeatSaberDir)\Beat Saber_Data\Managed\Main.dll
False
+ True
$(BeatSaberDir)\Beat Saber_Data\Managed\HMLib.dll
False
+ True
$(BeatSaberDir)\Beat Saber_Data\Managed\HMUI.dll
False
+ True
$(BeatSaberDir)\Beat Saber_Data\Managed\IPA.Loader.dll
@@ -89,15 +92,15 @@
$(BeatSaberDir)\Beat Saber_Data\Managed\Zenject.dll
- false
+ False
$(BeatSaberDir)\Beat Saber_Data\Managed\Zenject-usage.dll
- false
+ False
$(BeatSaberDir)\Plugins\SiraUtil.dll
- false
+ False
$(BeatSaberDir)\Beat Saber_Data\Managed\Tweening.dll
@@ -122,6 +125,7 @@
all
runtime; build; native; contentfiles; analyzers; buildtransitive
+
diff --git a/Nya/UI/FlowCoordinators/NyaSettingsFlowCoordinator.cs b/Nya/UI/FlowCoordinators/NyaSettingsFlowCoordinator.cs
index 93833b1..b1c2f20 100644
--- a/Nya/UI/FlowCoordinators/NyaSettingsFlowCoordinator.cs
+++ b/Nya/UI/FlowCoordinators/NyaSettingsFlowCoordinator.cs
@@ -16,7 +16,7 @@ public void Constructor(NyaSettingsMainViewController nyaSettingsMainViewControl
_nyaSettingsRightViewController = nyaSettingsRightViewController;
}
- protected override void DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling)
+ public override void DidActivate(bool firstActivation, bool addedToHierarchy, bool screenSystemEnabling)
{
ProvideInitialViewControllers(_nyaSettingsMainViewController, rightScreenViewController: _nyaSettingsRightViewController);
}
diff --git a/Nya/UI/ViewControllers/ModalControllers/EnableNsfwFeaturesModalController.cs b/Nya/UI/ViewControllers/ModalControllers/EnableNsfwFeaturesModalController.cs
index a76cd74..33ede2a 100644
--- a/Nya/UI/ViewControllers/ModalControllers/EnableNsfwFeaturesModalController.cs
+++ b/Nya/UI/ViewControllers/ModalControllers/EnableNsfwFeaturesModalController.cs
@@ -149,8 +149,8 @@ private void Parse(Component parentTransform)
{
BSMLParser.instance.Parse(Utilities.GetResourceContent(Assembly.GetExecutingAssembly(), "Nya.UI.Views.EnableNsfwFeaturesModalView.bsml"), parentTransform.gameObject, this);
_modalView.name = "NyaEnableNsfwFeaturesModal";
- _presentPanelAnimation = _modalView.GetField("_presentPanelAnimations");
- _dismissPanelAnimation = _modalView.GetField("_dismissPanelAnimation");
+ _presentPanelAnimation = _modalView._presentPanelAnimations;
+ _dismissPanelAnimation = _modalView._dismissPanelAnimation;
_parsed = true;
}
diff --git a/Nya/UI/ViewControllers/ModalControllers/NsfwConfirmModalController.cs b/Nya/UI/ViewControllers/ModalControllers/NsfwConfirmModalController.cs
index ad8f498..24ec790 100644
--- a/Nya/UI/ViewControllers/ModalControllers/NsfwConfirmModalController.cs
+++ b/Nya/UI/ViewControllers/ModalControllers/NsfwConfirmModalController.cs
@@ -44,7 +44,7 @@ private void Parse(Component parentTransform)
if (!_modalView && !_parsed)
{
BSMLParser.instance.Parse(Utilities.GetResourceContent(Assembly.GetExecutingAssembly(), "Nya.UI.Views.NsfwConfirmModalView.bsml"), parentTransform.gameObject, this);
- _modalView.SetField("_animateParentCanvas", false);
+ _modalView._animateParentCanvas = false;
_modalView.name = "NyaNsfwConfirmModal";
_parsed = true;
diff --git a/Nya/UI/ViewControllers/ModalControllers/SettingsModalController.cs b/Nya/UI/ViewControllers/ModalControllers/SettingsModalController.cs
index 3009d9f..1c4c412 100644
--- a/Nya/UI/ViewControllers/ModalControllers/SettingsModalController.cs
+++ b/Nya/UI/ViewControllers/ModalControllers/SettingsModalController.cs
@@ -153,7 +153,7 @@ private void BaseParse(Component parentTransform, object host)
private void DropDownButtonClicked(ModalView modalView, Button button)
{
modalView.SetupView(RootTransform);
- modalView.SetField("_parentCanvasGroup", ModalView.gameObject.GetComponent());
+ modalView._parentCanvasGroup = ModalView.gameObject.GetComponent();
modalView.Show(true);
button.onClick.RemoveAllListeners();
diff --git a/Nya/Utils/ImageUtils.cs b/Nya/Utils/ImageUtils.cs
index 9158094..436844e 100644
--- a/Nya/Utils/ImageUtils.cs
+++ b/Nya/Utils/ImageUtils.cs
@@ -108,7 +108,7 @@ public void DownloadNyaImage()
}
var endpointResult = JsonConvert.DeserializeObject(Encoding.UTF8.GetString(response));
- if (endpointResult.Url == null)
+ if (endpointResult?.Url == null)
{
_siraLog.Error($"Couldn't find url value in response: {JsonConvert.SerializeObject(Encoding.UTF8.GetString(response))}");
return null;
diff --git a/Nya/manifest.json b/Nya/manifest.json
index 53dc1c5..1f0e8c7 100644
--- a/Nya/manifest.json
+++ b/Nya/manifest.json
@@ -5,10 +5,10 @@
"author": "Sirspam",
"version": "0.6.2",
"description": "BeatSaber mod for displaying nya-tastic images from various web APIs",
- "gameVersion": "1.21.0",
+ "gameVersion": "1.30.0",
"icon": "Nya.Resources.Chocola_Mini_Sitting.png",
"dependsOn": {
- "BSIPA": "^4.2.2",
+ "BSIPA": "^4.3.0",
"BeatSaberMarkupLanguage": "^1.6.8",
"SiraUtil": "^3.0.5"
},
From 9336bce4c97fc3e0464dc883483a0c82ba290602 Mon Sep 17 00:00:00 2001
From: Sirspam <71392316+Sirspam@users.noreply.github.com>
Date: Fri, 16 Jun 2023 00:31:56 +0100
Subject: [PATCH 4/5] Update mod description
---
Nya/manifest.json | 4 ++--
README.md | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/Nya/manifest.json b/Nya/manifest.json
index 1f0e8c7..10adafa 100644
--- a/Nya/manifest.json
+++ b/Nya/manifest.json
@@ -4,12 +4,12 @@
"name": "Nya",
"author": "Sirspam",
"version": "0.6.2",
- "description": "BeatSaber mod for displaying nya-tastic images from various web APIs",
+ "description": "A BeatSaber mod for displaying nya-tastic images from various web APIs",
"gameVersion": "1.30.0",
"icon": "Nya.Resources.Chocola_Mini_Sitting.png",
"dependsOn": {
"BSIPA": "^4.3.0",
- "BeatSaberMarkupLanguage": "^1.6.8",
+ "BeatSaberMarkupLanguage": "^1.7.1",
"SiraUtil": "^3.0.5"
},
"links": {
diff --git a/README.md b/README.md
index a7f1c87..418c508 100644
--- a/README.md
+++ b/README.md
@@ -1,5 +1,5 @@
# Nya
-Beat Saber mod for displaying nya-tastic images from various web APIs
+A BeatSaber mod for displaying nya-tastic images from various web APIs
## Usage
### Accessing Nya's Settings
Nya's settings can be accessed from the ⚙️ button, pressing this will bring up a modal for common settings, such as the currently selected API. Further settings can be accessed from the ➕ tab.
From 0bd579f27130f32052b0514c584f06fdfdeff099 Mon Sep 17 00:00:00 2001
From: Sirspam <71392316+Sirspam@users.noreply.github.com>
Date: Sun, 25 Jun 2023 19:19:28 +0100
Subject: [PATCH 5/5] Version bump
---
Nya/manifest.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Nya/manifest.json b/Nya/manifest.json
index 10adafa..1bb78f3 100644
--- a/Nya/manifest.json
+++ b/Nya/manifest.json
@@ -3,7 +3,7 @@
"id": "Nya",
"name": "Nya",
"author": "Sirspam",
- "version": "0.6.2",
+ "version": "0.7.0",
"description": "A BeatSaber mod for displaying nya-tastic images from various web APIs",
"gameVersion": "1.30.0",
"icon": "Nya.Resources.Chocola_Mini_Sitting.png",