HeavenStudioPlus/Assets/Scripts/UI/SettingsDialog/Tabs/EditorSettings.cs

99 lines
3.3 KiB
C#
Raw Normal View History

2022-07-10 21:39:14 +00:00
using UnityEngine;
using UnityEngine.UI;
using TMPro;
using HeavenStudio.Common;
2022-07-10 21:39:14 +00:00
namespace HeavenStudio.Editor
{
2022-09-02 00:57:47 +00:00
public class EditorSettings : TabsContent
2022-07-10 21:39:14 +00:00
{
Advanced Blocks (#720) * play sfx and play animation blocks i also changed prescheduleFunction to preFunction, and removed the unused preFunction argument in GameAction i can revert this if need be but it just seemed vestigial * count in rework + preloading, multisound addition multisound was using an array that was converted to a list..? very silly when you consider it's a list first so sometimes it's list -> array -> list lol new Count-In and Play SFX block preloads sfx now!! epic. * prefab-ify event properties, Button EntityType * things are very nearly working! however i just hit an insane hurdle. how do i modify a dropdown while still being able to access the index/int value of that param directly. UGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH * okay it's WORKING now i just need to do some better dropdown stuff * ITS WORKING ITS WORKING ITS WORKING arbitrary animations, now accessible to those without prefab knowledge! and it's piss easy to use!! * about to make a struct + class, tooltip improvements gonna make the struct define it, then the class will actually be the dropdown this is gonna make things so so so so much easier to comprehend * finishing up, probably one more commit after this * split up Dropdown into Dropdown and DropdownObj, which basically fixed all of my problems lol * fixed a count bug * added param tooltip toggle * grah it's ALMOST DONE * it's 99.9% finished. just some touch ups, i don't think i even know of any bugs * alright, looks like that's all the bugs gone * EVERYTHING IS FINISHED!!
2024-02-26 01:46:23 +00:00
[SerializeField] Toggle cursorCheckbox;
[SerializeField] Toggle discordRPCCheckbox;
[SerializeField] Button editorScaleDecre, editorScaleIncre;
[SerializeField] Toggle scaleWSS;
[SerializeField] Toggle paramTooltipsToggle;
// [SerializeField] Toggle cornerTooltipsToggle;
2023-10-27 20:19:16 +00:00
private void Start()
{
cursorCheckbox.isOn = PersistentDataManager.gameSettings.editorCursorEnable;
discordRPCCheckbox.isOn = PersistentDataManager.gameSettings.discordRPCEnable;
2023-10-27 20:19:16 +00:00
scaleWSS.isOn = PersistentDataManager.gameSettings.scaleWScreenSize;
Advanced Blocks (#720) * play sfx and play animation blocks i also changed prescheduleFunction to preFunction, and removed the unused preFunction argument in GameAction i can revert this if need be but it just seemed vestigial * count in rework + preloading, multisound addition multisound was using an array that was converted to a list..? very silly when you consider it's a list first so sometimes it's list -> array -> list lol new Count-In and Play SFX block preloads sfx now!! epic. * prefab-ify event properties, Button EntityType * things are very nearly working! however i just hit an insane hurdle. how do i modify a dropdown while still being able to access the index/int value of that param directly. UGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH * okay it's WORKING now i just need to do some better dropdown stuff * ITS WORKING ITS WORKING ITS WORKING arbitrary animations, now accessible to those without prefab knowledge! and it's piss easy to use!! * about to make a struct + class, tooltip improvements gonna make the struct define it, then the class will actually be the dropdown this is gonna make things so so so so much easier to comprehend * finishing up, probably one more commit after this * split up Dropdown into Dropdown and DropdownObj, which basically fixed all of my problems lol * fixed a count bug * added param tooltip toggle * grah it's ALMOST DONE * it's 99.9% finished. just some touch ups, i don't think i even know of any bugs * alright, looks like that's all the bugs gone * EVERYTHING IS FINISHED!!
2024-02-26 01:46:23 +00:00
paramTooltipsToggle.isOn = PersistentDataManager.gameSettings.showParamTooltips;
2023-10-27 20:19:16 +00:00
SetDecreIncreInteractable();
}
2022-07-10 21:39:14 +00:00
public void OnCursorCheckboxChanged()
{
Editor.instance.isCursorEnabled = cursorCheckbox.isOn;
PersistentDataManager.gameSettings.editorCursorEnable = cursorCheckbox.isOn;
if (Editor.instance != null && !Editor.instance.fullscreen)
2022-07-10 21:39:14 +00:00
{
GameManager.instance.CursorCam.enabled = Editor.instance.isCursorEnabled;
}
}
2022-09-02 00:57:47 +00:00
public void OnRPCCheckboxChanged()
{
PersistentDataManager.gameSettings.discordRPCEnable = discordRPCCheckbox.isOn;
Editor.instance.isDiscordEnabled = discordRPCCheckbox.isOn;
}
2022-09-02 00:57:47 +00:00
public override void OnOpenTab()
{
Advanced Blocks (#720) * play sfx and play animation blocks i also changed prescheduleFunction to preFunction, and removed the unused preFunction argument in GameAction i can revert this if need be but it just seemed vestigial * count in rework + preloading, multisound addition multisound was using an array that was converted to a list..? very silly when you consider it's a list first so sometimes it's list -> array -> list lol new Count-In and Play SFX block preloads sfx now!! epic. * prefab-ify event properties, Button EntityType * things are very nearly working! however i just hit an insane hurdle. how do i modify a dropdown while still being able to access the index/int value of that param directly. UGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH * okay it's WORKING now i just need to do some better dropdown stuff * ITS WORKING ITS WORKING ITS WORKING arbitrary animations, now accessible to those without prefab knowledge! and it's piss easy to use!! * about to make a struct + class, tooltip improvements gonna make the struct define it, then the class will actually be the dropdown this is gonna make things so so so so much easier to comprehend * finishing up, probably one more commit after this * split up Dropdown into Dropdown and DropdownObj, which basically fixed all of my problems lol * fixed a count bug * added param tooltip toggle * grah it's ALMOST DONE * it's 99.9% finished. just some touch ups, i don't think i even know of any bugs * alright, looks like that's all the bugs gone * EVERYTHING IS FINISHED!!
2024-02-26 01:46:23 +00:00
Start();
2022-09-02 00:57:47 +00:00
}
public override void OnCloseTab()
{
}
2023-10-27 20:19:16 +00:00
public void OnSWSSChanged()
{
PersistentDataManager.gameSettings.scaleWScreenSize = scaleWSS.isOn;
scaleWSS.isOn = PersistentDataManager.gameSettings.scaleWScreenSize;
}
Advanced Blocks (#720) * play sfx and play animation blocks i also changed prescheduleFunction to preFunction, and removed the unused preFunction argument in GameAction i can revert this if need be but it just seemed vestigial * count in rework + preloading, multisound addition multisound was using an array that was converted to a list..? very silly when you consider it's a list first so sometimes it's list -> array -> list lol new Count-In and Play SFX block preloads sfx now!! epic. * prefab-ify event properties, Button EntityType * things are very nearly working! however i just hit an insane hurdle. how do i modify a dropdown while still being able to access the index/int value of that param directly. UGHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH * okay it's WORKING now i just need to do some better dropdown stuff * ITS WORKING ITS WORKING ITS WORKING arbitrary animations, now accessible to those without prefab knowledge! and it's piss easy to use!! * about to make a struct + class, tooltip improvements gonna make the struct define it, then the class will actually be the dropdown this is gonna make things so so so so much easier to comprehend * finishing up, probably one more commit after this * split up Dropdown into Dropdown and DropdownObj, which basically fixed all of my problems lol * fixed a count bug * added param tooltip toggle * grah it's ALMOST DONE * it's 99.9% finished. just some touch ups, i don't think i even know of any bugs * alright, looks like that's all the bugs gone * EVERYTHING IS FINISHED!!
2024-02-26 01:46:23 +00:00
public void OnParamTooltipsChanged()
{
PersistentDataManager.gameSettings.showParamTooltips = paramTooltipsToggle.isOn;
}
// public void OnCornerTooltipsChanged()
// {
// PersistentDataManager.gameSettings.showParamTooltips = cornerTooltipsToggle.isOn;
// }
2023-10-27 20:19:16 +00:00
public void OnEditorScaleDecre()
{
PersistentDataManager.gameSettings.editorScale--;
if (PersistentDataManager.gameSettings.editorScale < -3)
PersistentDataManager.gameSettings.editorScale = -3;
SetDecreIncreInteractable();
}
public void OnEditorScaleIncre()
{
PersistentDataManager.gameSettings.editorScale++;
if (PersistentDataManager.gameSettings.editorScale > 5)
PersistentDataManager.gameSettings.editorScale = 5;
SetDecreIncreInteractable();
}
public void OnEditorScaleReset()
{
PersistentDataManager.gameSettings.editorScale = 0;
SetDecreIncreInteractable();
}
private void SetDecreIncreInteractable()
{
editorScaleDecre.interactable = PersistentDataManager.gameSettings.editorScale > -3; // hardcoded? We might not change.
editorScaleIncre.interactable = PersistentDataManager.gameSettings.editorScale < 5;
}
2022-07-10 21:39:14 +00:00
}
}