From edfb0fabd2fa1050b6e5e95bdefc2d44752897fc Mon Sep 17 00:00:00 2001 From: alexiscatnip Date: Mon, 14 Feb 2022 00:37:39 +0800 Subject: [PATCH] update Eula to print from StreamingAssets file --- Assets/Raindrop/UI/modals/EulaView.cs | 19 +++++++++---------- Assets/StreamingAssets/RD_Eula.txt | 15 +++++++++++++++ Assets/StreamingAssets/RD_Eula.txt.meta | 7 +++++++ 3 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 Assets/StreamingAssets/RD_Eula.txt create mode 100644 Assets/StreamingAssets/RD_Eula.txt.meta diff --git a/Assets/Raindrop/UI/modals/EulaView.cs b/Assets/Raindrop/UI/modals/EulaView.cs index f68538f..d7ae75c 100644 --- a/Assets/Raindrop/UI/modals/EulaView.cs +++ b/Assets/Raindrop/UI/modals/EulaView.cs @@ -7,6 +7,7 @@ using Raindrop.Services; using TMPro; using UniRx; using UnityEngine; +using UnityEngine.Serialization; using UnityEngine.UI; //a monobehavior that makes a toggle toggle the eula acceptance in globalSettings @@ -15,21 +16,18 @@ public class EulaView : MonoBehaviour private RaindropInstance instance { get { return ServiceLocator.Instance.Get(); } } [Tooltip("the Acceptance toggle that allows us to continue past this window")] - private Toggle EulaToggle; - public GameObject EulaToggleGO; - - public Button closeBtn; + public Toggle EulaToggle; + + [FormerlySerializedAs("closeBtn")] public Button NextBtn; private void Start() { - FindAndLinkUIComponents(); } //link all children UI components to the reactive events. private void FindAndLinkUIComponents() { - EulaToggle = EulaToggleGO.GetComponent(); if (EulaToggle == null) { Debug.LogWarning("eula toggle UI is not present."); @@ -39,11 +37,12 @@ public class EulaView : MonoBehaviour EulaToggle.onValueChanged.AsObservable().Subscribe(_ => onToggleChanged(_)); //when clicked, runs this method. } + //initialise button/toggle state bool isAcceptedEULA = instance.GlobalSettings["EulaAccepted"]; EulaToggle.isOn = isAcceptedEULA; - //onToggleChanged(isAcceptedEULA); + onToggleChanged(isAcceptedEULA); - closeBtn.onClick.AddListener(closeEula); + NextBtn.onClick.AddListener(closeEula); } private void closeEula() @@ -62,12 +61,12 @@ public class EulaView : MonoBehaviour if (isEulaAccepted) { - closeBtn.gameObject.SetActive(true); + NextBtn.gameObject.SetActive(true); return; } else { - closeBtn.gameObject.SetActive(false); + NextBtn.gameObject.SetActive(false); } } diff --git a/Assets/StreamingAssets/RD_Eula.txt b/Assets/StreamingAssets/RD_Eula.txt new file mode 100644 index 0000000..a918e3c --- /dev/null +++ b/Assets/StreamingAssets/RD_Eula.txt @@ -0,0 +1,15 @@ +Product: Raindrop Viewer +version: +This product is offered 'as-is' and no support or warranty is offered. + +Contact info: +Discord: +Email raindropviewer@gmail.com for important issues. + +Privacy policy: +- This application does not collect your information. +- However, it utilises various 3rd party libraries and frameworks, which may collect your information: +> Unity game engine +> LibreMetaverse library + +If you disagree with any of above information, please quit now and refrain from using this software. \ No newline at end of file diff --git a/Assets/StreamingAssets/RD_Eula.txt.meta b/Assets/StreamingAssets/RD_Eula.txt.meta new file mode 100644 index 0000000..d100b5a --- /dev/null +++ b/Assets/StreamingAssets/RD_Eula.txt.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: a6945d3463c62a84197d55c937d1e173 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: