HeavenStudioPlus/Assets/Scripts/LevelEditor/SettingsDialog/Tabs/EditorSettings.cs
minenice55 29d8c3c40d
Bugfixes (#340)
* new letterbox implementation

* make DSP buffer larger

* add new "ambient" letterbox option

* remap keyboard control

* enable autoplay cheat mode

* fix editor settings not being applied on start

* run the cursor init in editor init

remove debug prints
2023-03-12 02:56:26 +00:00

45 lines
No EOL
1.4 KiB
C#

using UnityEngine;
using UnityEngine.UI;
using TMPro;
using HeavenStudio.Common;
namespace HeavenStudio.Editor
{
public class EditorSettings : TabsContent
{
public Toggle cursorCheckbox;
public Toggle discordRPCCheckbox;
private void Start() {
cursorCheckbox.isOn = PersistentDataManager.gameSettings.editorCursorEnable;
discordRPCCheckbox.isOn = PersistentDataManager.gameSettings.discordRPCEnable;
}
public void OnCursorCheckboxChanged()
{
Editor.instance.isCursorEnabled = cursorCheckbox.isOn;
PersistentDataManager.gameSettings.editorCursorEnable = cursorCheckbox.isOn;
if (Editor.instance != null && !Editor.instance.fullscreen)
{
GameManager.instance.CursorCam.enabled = Editor.instance.isCursorEnabled;
}
}
public void OnRPCCheckboxChanged()
{
PersistentDataManager.gameSettings.discordRPCEnable = discordRPCCheckbox.isOn;
Editor.instance.isDiscordEnabled = discordRPCCheckbox.isOn;
}
public override void OnOpenTab()
{
cursorCheckbox.isOn = PersistentDataManager.gameSettings.editorCursorEnable;
discordRPCCheckbox.isOn = PersistentDataManager.gameSettings.discordRPCEnable;
}
public override void OnCloseTab()
{
}
}
}