add cursor toggle, master volume

This commit is contained in:
minenice55
2022-07-10 17:39:14 -04:00
parent 7fd1617ea7
commit a7bea351c5
57 changed files with 48810 additions and 3410 deletions

View File

@ -13,6 +13,7 @@ using TMPro;
using Starpelly;
using SFB;
using HeavenStudio.Editor;
using HeavenStudio.Editor.Track;
using HeavenStudio.Util;
@ -63,10 +64,11 @@ namespace HeavenStudio.Editor
private bool loadedMusic = false;
private string currentRemixPath = "";
private string remixName = "";
private bool fullscreen;
public bool fullscreen;
public bool discordDuringTesting = false;
public bool canSelect = true;
public bool editingInputField = false;
public bool isCursorEnabled = true;
public static Editor instance { get; private set; }
@ -456,7 +458,7 @@ namespace HeavenStudio.Editor
MainCanvas.enabled = true;
EditorCamera.enabled = true;
GameCamera.instance.camera.targetTexture = ScreenRenderTexture;
GameManager.instance.CursorCam.enabled = true;
GameManager.instance.CursorCam.enabled = true && isCursorEnabled;
GameManager.instance.OverlayCamera.targetTexture = ScreenRenderTexture;
fullscreen = false;

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Editor.Track;
using HeavenStudio.Util;
using HeavenStudio.StudioDance;
using TMPro;
@ -11,8 +12,9 @@ namespace HeavenStudio.Editor
public class CreditsLegalSettings : MonoBehaviour
{
private int SecretCounter = 0;
private static bool SecretActive = false;
private bool SecretActive = false;
[SerializeField] private GameObject secretObject;
[SerializeField] private StudioDanceManager secretContent;
private void Start()
{
@ -37,6 +39,16 @@ namespace HeavenStudio.Editor
SecretActive = true;
Jukebox.PlayOneShot("applause");
Debug.Log("Activating Studio Dance...");
secretContent.OpenDanceWindow();
}
public void MakeSecretInactive()
{
SecretCounter = 0;
secretObject.SetActive(false);
SecretActive = false;
secretContent.CloseDanceWindow();
}
}
}

View File

@ -1,7 +1,6 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Editor.Track;
using UnityEngine.UI;
using TMPro;
@ -13,6 +12,10 @@ namespace HeavenStudio.Editor
public GameObject customSetter;
public TMP_InputField widthInputField, heightInputField;
public Slider volSlider;
public TMP_InputField volLabel;
private void Start() {
List<TMP_Dropdown.OptionData> dropDownData = new List<TMP_Dropdown.OptionData>();
var vals = GlobalGameManager.DEFAULT_SCREEN_SIZES_STRING;
@ -42,6 +45,9 @@ namespace HeavenStudio.Editor
GlobalGameManager.CustomScreenHeight = System.Math.Max(int.Parse(heightInputField.text), 64);
heightInputField.text = GlobalGameManager.CustomScreenHeight.ToString();
});
volSlider.value = GlobalGameManager.MasterVolume;
volLabel.text = System.Math.Round(volSlider.value * 100, 2).ToString();
}
public void WindowFullScreen()
@ -53,5 +59,17 @@ namespace HeavenStudio.Editor
{
GlobalGameManager.ChangeScreenSize();
}
public void OnVolSliderChanged()
{
GlobalGameManager.ChangeMasterVolume(volSlider.value);
volLabel.text = System.Math.Round(volSlider.value * 100, 2).ToString();
}
public void OnVolLabelChanged()
{
volSlider.value = (float)System.Math.Round(System.Convert.ToSingle(volLabel.text), 2);
GlobalGameManager.ChangeMasterVolume(volSlider.value);
}
}
}

View File

@ -0,0 +1,20 @@
using UnityEngine;
using UnityEngine.UI;
using TMPro;
namespace HeavenStudio.Editor
{
public class EditorSettings : MonoBehaviour
{
public Toggle cursorCheckbox;
public void OnCursorCheckboxChanged()
{
Editor.instance.isCursorEnabled = cursorCheckbox.isOn;
if (!Editor.instance.fullscreen)
{
GameManager.instance.CursorCam.enabled = Editor.instance.isCursorEnabled;
}
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4dcd15958462e4e488a04ef094e7ffcb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: