Editor Refresh (R1) (#911)

* put things in better places

oh this looks. so much fucking better. wow

* new icons and stuff

* modifier, zoom formula, tab name

tab name is future proofing.
also, dllnotfoundexception when using the file explorer? wtf

* dialog placement mostly working

basically ready to pr. just gotta merge stuff into it

* a few tweaks! all good now

---------

Co-authored-by: ev <85412919+iloveoatmeal2022@users.noreply.github.com>
This commit is contained in:
AstrlJelly 2024-05-08 15:26:43 -04:00 committed by GitHub
parent 4c34eb20ea
commit 74f54df651
36 changed files with 6420 additions and 2238 deletions

View file

@ -0,0 +1,108 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: FOT-Rodin Pro B SDF Game Title
m_Shader: {fileID: 4800000, guid: 68e6db2ebdc24f95958faec2be5558d6, type: 3}
m_ValidKeywords: []
m_InvalidKeywords:
- MASK_SOFT
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _Cube:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _FaceTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: -6916996860123676527, guid: 4810e200fa0cb24438bac52343d7674b, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OutlineTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _Ambient: 0.5
- _Bevel: 0.5
- _BevelClamp: 0
- _BevelOffset: 0
- _BevelRoundness: 0
- _BevelWidth: 0
- _BumpFace: 0
- _BumpOutline: 0
- _ColorMask: 15
- _CullMode: 0
- _Diffuse: 0.5
- _FaceDilate: 0.71
- _FaceUVSpeedX: 0
- _FaceUVSpeedY: 0
- _GlowInner: 0.05
- _GlowOffset: 0
- _GlowOuter: 0.05
- _GlowPower: 0.75
- _GradientScale: 13
- _LightAngle: 3.1416
- _MaskSoftnessX: 0
- _MaskSoftnessY: 0
- _OutlineSoftness: 0
- _OutlineUVSpeedX: 0
- _OutlineUVSpeedY: 0
- _OutlineWidth: 1
- _PerspectiveFilter: 0
- _Reflectivity: 10
- _ScaleRatioA: 0.48647004
- _ScaleRatioB: 0.09461542
- _ScaleRatioC: 0.09461542
- _ScaleX: 1
- _ScaleY: 1
- _ShaderFlags: 0
- _Sharpness: 1
- _SpecularPower: 2
- _Stencil: 0
- _StencilComp: 8
- _StencilOp: 0
- _StencilReadMask: 255
- _StencilWriteMask: 255
- _TextureHeight: 1024
- _TextureWidth: 1024
- _UnderlayDilate: 0
- _UnderlayOffsetX: 0
- _UnderlayOffsetY: 0
- _UnderlaySoftness: 0
- _VertexOffsetX: 0
- _VertexOffsetY: 0
- _WeightBold: 0.75
- _WeightNormal: 0
m_Colors:
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
- _EnvMatrixRotation: {r: 0, g: 0, b: 0, a: 0}
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
- _GlowColor: {r: 0, g: 1, b: 0, a: 0.5}
- _MaskCoord: {r: 0, g: 0, b: 32767, a: 32767}
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _ReflectFaceColor: {r: 0, g: 0, b: 0, a: 1}
- _ReflectOutlineColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecularColor: {r: 1, g: 1, b: 1, a: 1}
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
m_BuildTextureStacks: []

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 17640bfdd8e085c43ad7e657ba4e5903
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e66ea59167e0edc41ad445d9226040a7
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5e81b37721d35ec44aed3cde248678ce
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: 4639a7995f013e44bb046e91ee17fd6f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 550 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

After

Width:  |  Height:  |  Size: 498 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 355 B

View file

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: ca006d807d515ab4e8af218e7474f442
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: 93df82601dc3b8a4caf887fc1999707d
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 0
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 0
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 32
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -51,6 +51,8 @@ SpriteAtlas:
m_MasterAtlas: {fileID: 0}
m_PackedSprites:
- {fileID: 21300000, guid: 49e59e302f4a24a4da56bd63185fcb01, type: 3}
- {fileID: 21300000, guid: 93df82601dc3b8a4caf887fc1999707d, type: 3}
- {fileID: 21300000, guid: ca006d807d515ab4e8af218e7474f442, type: 3}
- {fileID: 21300000, guid: 6f76ee0157ff5854295d8d0b12b5f165, type: 3}
- {fileID: 21300000, guid: 9ae7ecf2cc001d14595ec03e1d4d86a6, type: 3}
- {fileID: 21300000, guid: 6dd981c3e3319f243b56549e3f26fb72, type: 3}
@ -84,6 +86,8 @@ SpriteAtlas:
- {fileID: 21300000, guid: b29210cf5b7b8234984ec842a3110005, type: 3}
m_PackedSpriteNamesToIndex:
- cog
- zoom-menu
- usage
- zoom-out
- save
- add-music

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 10 KiB

File diff suppressed because it is too large Load diff

View file

@ -4,6 +4,7 @@ using BurstLinq;
using System.Collections.Generic;
using UnityEngine;
using Jukebox;
using HeavenStudio.Games;
namespace HeavenStudio
{
@ -23,11 +24,8 @@ namespace HeavenStudio
public Minigames.Minigame GetMinigame(string gameName)
{
if (!minigames.ContainsKey(gameName))
{
return null;
}
return minigames[gameName];
minigames.TryGetValue(gameName, out var minigame);
return minigame;
}
public Minigames.GameAction GetGameAction(Minigames.Minigame game, string action)
@ -37,9 +35,9 @@ namespace HeavenStudio
public Minigames.GameAction GetGameAction(string gameName, string action)
{
if (minigames.ContainsKey(gameName))
if (minigames.TryGetValue(gameName, out var minigame))
{
return minigames[gameName].actions.Find(c => c.actionName == action);
return minigame.actions.Find(c => c.actionName == action);
}
else
{

View file

@ -395,7 +395,7 @@ namespace HeavenStudio.Games
new MultiSound.Sound("tambourine/player/turnPass/note1", beat),
new MultiSound.Sound("tambourine/player/turnPass/note2", beat + 0.1f),
new MultiSound.Sound("tambourine/player/turnPass/note3", beat + 0.2f),
new MultiSound.Sound("tambourine/player/turnPass/note3", beat + 0.3f),
new MultiSound.Sound("tambourine/player/turnPass/note4", beat + 0.3f),
}, forcePlay: true);
happyFace.SetActive(true);
BeatAction.New(instance, new List<BeatAction.Action>()

View file

@ -33,6 +33,11 @@ namespace HeavenStudio.InputSystem
{
public class InputKeyboard : InputController
{
#if UNITY_STANDALONE_OSX
public const KeyCode MODIFIER = KeyCode.LeftCommand;
#else
public const KeyCode MODIFIER = KeyCode.LeftControl;
#endif
private static readonly KeyCode[] keyCodes = Enum.GetValues(typeof(KeyCode))
.Cast<KeyCode>()
.Where(k => ((int)k < (int)KeyCode.Mouse0))

View file

@ -9,7 +9,8 @@ namespace HeavenStudio.Editor
{
public class Dialog : MonoBehaviour
{
public bool IsOpen { get { return dialog.activeSelf; } }
public bool IsOpen => dialog.activeSelf;
[SerializeField] internal RectTransform rectTransform;
[SerializeField] protected GameObject dialog;
public void ForceState(bool onoff = false)
{
@ -26,5 +27,26 @@ namespace HeavenStudio.Editor
dialog.ForceState(false);
}
}
public void SwitchDialogue()
{
if (dialog.activeSelf) {
dialog.SetActive(false);
} else {
ResetAllDialogs();
dialog.SetActive(true);
}
}
public void SetPosRelativeToButtonPos(RectTransform buttonRect, Vector2? relativePos = null)
{
// janky? maybe. does it work? you bet it does
rectTransform.SetParent(buttonRect);
rectTransform.localPosition = relativePos ?? new Vector2(210, 120);
// rectTransform.localPosition = new Vector2((rectTransform.rect.width - buttonRect.rect.width) / 2, (rectTransform.rect.height + buttonRect.rect.height) / 2);
// rectTransform.offsetMin = Vector2.up * (buttonRect.rect.height + 7);
rectTransform.SetParent(Editor.instance.MainCanvas.transform, true);
}
}
}

View file

@ -16,6 +16,10 @@ using Jukebox;
using UnityEditor;
using System.Linq;
using BurstLinq;
using HeavenStudio.InputSystem;
using UnityEngine.U2D;
using UnityEditor.U2D;
using UnityEditor.Sprites;
namespace HeavenStudio.Editor
{
@ -89,9 +93,13 @@ namespace HeavenStudio.Editor
public static Editor instance { get; private set; }
private void Start()
private void Awake()
{
instance = this;
}
private void Start()
{
Initializer = GetComponent<GameInitializer>();
canSelect = true;
}
@ -127,7 +135,7 @@ namespace HeavenStudio.Editor
GameIcon_.GetComponent<Image>().sprite = GameIcon(minigame.name);
GameIcon_.GetComponent<GridGameSelectorGame>().MaskTex = GameIconMask(minigame.name);
GameIcon_.GetComponent<GridGameSelectorGame>().UnClickIcon();
GameIcon_.gameObject.SetActive(true);
GameIcon_.SetActive(true);
GameIcon_.name = minigame.name;
var ggs = GridGameSelectorRect.GetComponent<GridGameSelector>();
@ -178,7 +186,7 @@ namespace HeavenStudio.Editor
CommandManager.Instance.AddCommand(new Commands.Delete(Selections.instance.eventsSelected.Select(c => c.entity.guid).ToList()));
}
if (Input.GetKey(KeyCode.LeftControl) && !fullscreen)
if (Input.GetKey(InputKeyboard.MODIFIER) && !fullscreen)
{
if (Input.GetKeyDown(KeyCode.Z))
{
@ -213,7 +221,7 @@ namespace HeavenStudio.Editor
}
}
if (Input.GetKey(KeyCode.LeftControl))
if (Input.GetKey(InputKeyboard.MODIFIER))
{
if (Input.GetKeyDown(KeyCode.N))
{
@ -248,24 +256,12 @@ namespace HeavenStudio.Editor
#endregion
// Undo+Redo
if (CommandManager.Instance.CanUndo())
UndoBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
else
UndoBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
if (CommandManager.Instance.CanRedo())
RedoBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
else
RedoBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
UndoBTN.transform.GetChild(0).GetComponent<Image>().color = CommandManager.Instance.CanUndo() ? Color.white : Color.gray;
RedoBTN.transform.GetChild(0).GetComponent<Image>().color = CommandManager.Instance.CanRedo() ? Color.white : Color.gray;
// Copy+Paste
if (Selections.instance.eventsSelected.Count > 0)
CopyBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
else
CopyBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
if (Timeline.instance.CopiedEntities.Count > 0)
PasteBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
else
PasteBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
CopyBTN.transform.GetChild(0).GetComponent<Image>().color = Selections.instance.eventsSelected.Count > 0 ? Color.white : Color.gray;
PasteBTN.transform.GetChild(0).GetComponent<Image>().color = Timeline.instance.CopiedEntities.Count > 0 ? Color.white : Color.gray;
}
public static Sprite GameIcon(string name)
@ -350,30 +346,23 @@ namespace HeavenStudio.Editor
public void SaveRemix(bool saveAs = true)
{
Debug.Log(GameManager.instance.Beatmap["propertiesmodified"]);
if (!(bool)GameManager.instance.Beatmap["propertiesmodified"])
{
foreach (var dialog in Dialogs)
{
if (dialog.GetType() == typeof(RemixPropertiesDialog))
if (dialog is not null and RemixPropertiesDialog propDialog)
{
if (fullscreen) Fullscreen();
GlobalGameManager.ShowErrorMessage("Set Remix Properties", "Set remix properties before saving.");
(dialog as RemixPropertiesDialog).SwitchPropertiesDialog();
(dialog as RemixPropertiesDialog).SetSaveOnClose(true, saveAs);
propDialog.SwitchPropertiesDialog();
propDialog.SetSaveOnClose(true, saveAs);
return;
}
}
}
else
{
if (saveAs)
{
SaveRemixFilePanel();
}
else
{
if (currentRemixPath is "" or null)
if (saveAs || string.IsNullOrEmpty(currentRemixPath))
{
SaveRemixFilePanel();
}
@ -383,7 +372,6 @@ namespace HeavenStudio.Editor
}
}
}
}
private void SaveRemixFilePanel()
{
@ -421,7 +409,7 @@ namespace HeavenStudio.Editor
public void NewRemix()
{
if (Timeline.instance != null)
Timeline.instance?.Stop(0);
Timeline.instance.Stop(0);
else
GameManager.instance.Stop(0);
LoadRemix(true);

View file

@ -82,7 +82,8 @@ namespace HeavenStudio.Editor
eventSelector.SetActive(true);
DestroyParams();
Editor.instance.SetGameEventTitle($"Select game event for {gridGameSelector.SelectedMinigame.displayName.Replace("\n", "")}");
// Editor.instance.SetGameEventTitle($"Select game event for {gridGameSelector.SelectedMinigame.displayName.Replace("\n", "")}");
Editor.instance?.SetGameEventTitle(gridGameSelector.SelectedMinigame.displayName.Replace("\n", ""));
}
public void StartParams(RiqEntity entity)
@ -95,8 +96,7 @@ namespace HeavenStudio.Editor
{
string[] split = entity.datamodel.Split('/');
var minigame = EventCaller.instance.GetMinigame(split[0]);
int actionIndex = minigame.actions.IndexOf(minigame.actions.Find(c => c.actionName == split[1]));
Minigames.GameAction action = minigame.actions[actionIndex];
Minigames.GameAction action = minigame.actions.Find(c => c.actionName == split[1]);
if (action.parameters != null)
{
@ -111,7 +111,13 @@ namespace HeavenStudio.Editor
4 => EditorTheme.theme.properties.Layer5Col,
_ => EditorTheme.theme.properties.Layer1Col
};
Editor.instance.SetGameEventTitle($"Properties for <color=#{col}>{action.displayName}</color> on Beat {entity.beat.ToString("F2")} on <color=#{col}>Track {(int)entity["track"] + 1}</color>");
string gameName = action.displayName;
const int cutOff = 20;
if (gameName.Length > (cutOff + 3)) {
gameName = gameName[..cutOff] + "...";
}
Editor.instance.SetGameEventTitle($"<color=#{col}>{gameName}</color> at ♪ {entity.beat:F2} on <color=#{col}>Track {(int)entity["track"] + 1}</color>");
DestroyParams();

View file

@ -12,10 +12,13 @@ using HeavenStudio.Util;
using HeavenStudio.Editor.Track;
using System.Text;
using System.Configuration;
using System;
using HeavenStudio.InputSystem;
using UnityEngine.U2D;
namespace HeavenStudio.Editor
{
// I hate the antichrist.
// I LOVE the antichrist!
public class GridGameSelector : MonoBehaviour
{
public Minigames.Minigame SelectedMinigame;
@ -34,8 +37,10 @@ namespace HeavenStudio.Editor
[Header("Properties")]
[SerializeField] private int currentEventIndex;
public List<RectTransform> mgsActive = new List<RectTransform>();
public List<RectTransform> fxActive = new List<RectTransform>();
public Texture Square;
public Texture Circle;
public List<RectTransform> mgsActive = new();
public List<RectTransform> fxActive = new();
public float posDif;
public int ignoreSelectCount;
private int dragTimes;
@ -46,9 +51,13 @@ namespace HeavenStudio.Editor
public static GridGameSelector instance;
private void Start()
private void Awake()
{
instance = this;
}
private void Start()
{
GameEventSelectorRect = GameEventSelector.GetComponent<RectTransform>();
selectorHeight = GameEventSelectorRect.rect.height;
eventSize = EventRef.GetComponent<RectTransform>().rect.height;
@ -160,7 +169,8 @@ namespace HeavenStudio.Editor
currentEventIndex = index;
UpdateIndex(index, false);
Editor.instance?.SetGameEventTitle($"Select game event for {SelectedMinigame.displayName.Replace("\n", "")}");
// Editor.instance?.SetGameEventTitle($"Select game event for {SelectedMinigame.displayName.Replace("\n", "")}");
if (Editor.instance != null) Editor.instance.SetGameEventTitle(SelectedMinigame.displayName.Replace("\n", ""));
}
private void AddEvents(int index = 0)
@ -170,7 +180,9 @@ namespace HeavenStudio.Editor
GameObject sg = Instantiate(EventRef, eventsParent);
sg.GetComponentInChildren<TMP_Text>().text = "Switch Game";
sg.SetActive(true);
if (index == 0) sg.GetComponentInChildren<TMP_Text>().color = EditorTheme.theme.properties.EventSelectedCol.Hex2RGB();
if (index == 0) {
sg.GetComponentInChildren<TMP_Text>().color = EditorTheme.theme.properties.EventSelectedCol.Hex2RGB();
}
} else {
index++;
if (SelectedMinigame.name == "gameManager") index++;
@ -186,13 +198,12 @@ namespace HeavenStudio.Editor
label.text = action.displayName;
if (action.parameters != null && action.parameters.Count > 0)
g.transform.GetChild(1).gameObject.SetActive(true);
g.transform.GetChild(0).GetChild(0).gameObject.SetActive(true);
if (index - 1 == i)
label.color = EditorTheme.theme.properties.EventSelectedCol.Hex2RGB();
g.SetActive(true);
}
}
@ -233,26 +244,24 @@ namespace HeavenStudio.Editor
}
}
// TODO: find the equation to get the sizes automatically, nobody's been able to figure one out yet (might have to be manual?)
public void Zoom()
{
if (!Input.GetKey(KeyCode.LeftControl)) return;
if (!Input.GetKey(InputKeyboard.MODIFIER)) return;
var glg = GetComponent<GridLayoutGroup>();
var sizes = new List<float>() {
209.5f,
102.3f,
66.6f,
48.6f,
37.9f,
30.8f,
25.7f,
//21.9f,
};
int max = 20; // arbitrary
if (glg.constraintCount + 1 > sizes.Count && Input.GetAxisRaw("Mouse ScrollWheel") < 0) return;
if (glg.constraintCount + 1 > max && Input.mouseScrollDelta.y < 0) return;
glg.constraintCount += (Input.GetAxisRaw("Mouse ScrollWheel") > 0) ? -1 : 1;
glg.cellSize = Vector2.one * sizes[glg.constraintCount - 1];
glg.constraintCount += (Input.mouseScrollDelta.y > 0) ? -1 : 1;
// thanks to blank3times (tri) for helping me with this
var size = (1 / (0.00317 * glg.constraintCount)) - 4.75248;
// this, however, doesn't work
// var totalWidth = Editor.instance.GridGameSelectorRect.rect.width;
// var size = (totalWidth - glg.padding.right) * (glg.constraintCount + 1) / glg.constraintCount;
glg.cellSize = Vector2.one * (float)size;
}
// method called when clicking the sort button in the editor, skips sorting fx only "games"
@ -262,21 +271,14 @@ namespace HeavenStudio.Editor
List<RectTransform> mgsSort = mgsActive;
mgsSort.Sort((x, y) => string.Compare(x.name, y.name));
switch (type)
{
case "favorites":
SortFavorites(mgsSort);
break;
case "chronologic":
SortChronologic(mgsSort);
break;
case "usage":
SortUsage(mgsSort);
break;
default: // "alphabet"
SortAlphabet(mgsSort);
break;
}
Action<List<RectTransform>> action = type switch {
"favorites" => SortFavorites,
"chronologic" => SortChronologic,
"usage" => SortUsage,
_ => SortAlphabet
};
action.Invoke(mgsSort);
}
void SortAlphabet(List<RectTransform> mgs)
@ -290,7 +292,7 @@ namespace HeavenStudio.Editor
string AlphabetSortKey(RectTransform minigame)
{
Minigames.Minigame mg = EventCaller.instance.GetMinigame(minigame.name);
if (mg.displayName.StartsWith("the ", System.StringComparison.InvariantCultureIgnoreCase))
if (mg.displayName.StartsWith("the ", StringComparison.InvariantCultureIgnoreCase))
return mg.displayName[4..];
else
return mg.displayName;
@ -408,7 +410,12 @@ namespace HeavenStudio.Editor
public void Drag()
{
if (Conductor.instance.NotStopped() || Editor.instance.inAuthorativeMenu) return;
if (Conductor.instance.NotStopped() || Editor.instance.inAuthorativeMenu) {
if (Conductor.instance.isPaused) {
Debug.Log("it's fuckin paused dude");
}
return;
}
if (Timeline.instance.MouseInTimeline && dragTimes < 1)
{

View file

@ -18,10 +18,12 @@ namespace HeavenStudio.Editor
public Texture MaskTex;
public Texture BgTex;
private Material m_Material;
private Image image;
private void Start()
{
Tooltip.AddTooltip(this.gameObject, EventCaller.instance.GetMinigame(this.gameObject.name).displayName);
// image = GetComponent<Image>();
Tooltip.AddTooltip(gameObject, EventCaller.instance.GetMinigame(gameObject.name).displayName);
}
private void OnEnable()
@ -33,8 +35,10 @@ namespace HeavenStudio.Editor
{
if (m_Material == null)
{
m_Material = Instantiate(GetComponent<Image>().material);
GetComponent<Image>().material = m_Material;
if (image == null) image = GetComponent<Image>();
m_Material = Instantiate(image.material);
image.material = m_Material;
}
m_Material.SetTexture("_MaskTex", MaskTex);
m_Material.SetTexture("_BgTex", BgTex);
@ -53,10 +57,8 @@ namespace HeavenStudio.Editor
if (Input.GetMouseButtonDown(1))
{
// while holding shift and the game icon clicked has a star, it will disable all stars.
if (Input.GetKey(KeyCode.LeftShift)) {
if (!StarActive) return;
for (int i = 0; i < transform.parent.childCount; i++)
{
if (Input.GetKey(KeyCode.LeftShift) && StarActive) {
for (int i = 0; i < transform.parent.childCount; i++) {
var ggsg = transform.parent.GetChild(i).GetComponent<GridGameSelectorGame>();
if (ggsg.StarActive) ggsg.Star();
}
@ -76,14 +78,14 @@ namespace HeavenStudio.Editor
public void ClickIcon()
{
transform.DOScale(new Vector3(1.15f, 1.15f, 1f), 0.1f);
BgTex = Resources.Load<Texture>($"Sprites/GeneralPurpose/Circle");
BgTex = GridGameSelector.Circle;
SetupTextures();
}
public void UnClickIcon()
{
transform.DOScale(new Vector3(1f, 1f, 1f), 0.1f);
BgTex = Resources.Load<Texture>($"Sprites/GeneralPurpose/Square");
BgTex = GridGameSelector.Square;
SetupTextures();
}
}

View file

@ -4,6 +4,7 @@ using System.Linq;
using UnityEngine;
using HeavenStudio.Editor.Track;
using HeavenStudio.InputSystem;
namespace HeavenStudio.Editor
{
@ -31,7 +32,7 @@ namespace HeavenStudio.Editor
*/
if (Editor.instance.isShortcutsEnabled)
{
if (Input.GetKey(KeyCode.LeftControl))
if (Input.GetKey(InputKeyboard.MODIFIER))
if (Input.GetKeyDown(KeyCode.A))
SelectAll();
}

View file

@ -10,9 +10,11 @@ namespace HeavenStudio.Editor
public class SnapDialog : Dialog
{
[SerializeField] private TMP_Text snapText;
[SerializeField] RectTransform btnRectTransform;
private Timeline timeline;
private static float[] CommonDenominators = { 1, 2, 3, 4, 6, 8, 12, 16};
private static float[] CommonDenominators = { 1, 2, 3, 4, 6, 8, 12, 16 };
private int currentCommon = 3;
private void Start()
{
@ -21,26 +23,28 @@ namespace HeavenStudio.Editor
public void SwitchSnapDialog()
{
if(dialog.activeSelf) {
if (dialog.activeSelf) {
dialog.SetActive(false);
} else {
ResetAllDialogs();
SetPosRelativeToButtonPos(btnRectTransform);
// rectTransform.SetParent(btnRectTransform);
// rectTransform.localPosition = new Vector2(210, 120);
// rectTransform.SetParent(Editor.instance.MainCanvas.transform, true);
dialog.SetActive(true);
}
}
public void ChangeCommon(bool down = false)
{
if(down) {
currentCommon--;
} else {
currentCommon++;
}
currentCommon += down ? -1 : 1;
if(currentCommon < 0) {
currentCommon = 0;
} else if(currentCommon >= CommonDenominators.Length) {
currentCommon = CommonDenominators.Length - 1;
}
timeline.SetSnap(1f / CommonDenominators[currentCommon]);
}

View file

@ -9,6 +9,7 @@ using HeavenStudio.Util;
using TMPro;
using Jukebox;
using Jukebox.Legacy;
using HeavenStudio.InputSystem;
namespace HeavenStudio.Editor.Track
{
@ -155,7 +156,7 @@ namespace HeavenStudio.Editor.Track
{
lastTempo *= 2f;
}
else if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl))
else if (Input.GetKey(InputKeyboard.MODIFIER) || Input.GetKey(KeyCode.RightCommand))
{
lastTempo /= 2f;
}

View file

@ -7,6 +7,7 @@ using TMPro;
using DG.Tweening;
using Jukebox;
using Jukebox.Legacy;
using HeavenStudio.InputSystem;
namespace HeavenStudio.Editor.Track
{
@ -30,8 +31,9 @@ namespace HeavenStudio.Editor.Track
if (Input.GetKey(KeyCode.LeftShift))
newTempo *= 5f;
if (Input.GetKey(KeyCode.LeftControl))
if (Input.GetKey(InputKeyboard.MODIFIER)) {
newTempo *= 0.01f;
}
if (newTempo != 0)
{

View file

@ -7,6 +7,7 @@ using TMPro;
using DG.Tweening;
using Jukebox;
using Jukebox.Legacy;
using HeavenStudio.InputSystem;
namespace HeavenStudio.Editor.Track
{
@ -30,9 +31,9 @@ namespace HeavenStudio.Editor.Track
if (Input.GetKey(KeyCode.LeftShift))
newVolume *= 5f;
if (Input.GetKey(KeyCode.LeftControl))
if (Input.GetKey(InputKeyboard.MODIFIER)) {
newVolume *= 0.01f;
}
if (newVolume != 0)
{
SetVolume(chartEntity["volume"] + newVolume);

View file

@ -12,6 +12,7 @@ using System.Linq;
using BurstLinq;
using HeavenStudio.Util;
using HeavenStudio.InputSystem;
namespace HeavenStudio.Editor.Track
{
@ -44,6 +45,7 @@ namespace HeavenStudio.Editor.Track
public float MousePos2Beat { get; private set; }
public float MousePos2Layer { get; private set; }
public float MousePos2BeatSnap => HeavenStudio.Util.MathUtils.Round2Nearest(MousePos2Beat + (SnapInterval() * 0.5f), SnapInterval());
// public float MousePos2BeatSnap => HeavenStudio.Util.MathUtils.Round2Nearest(MousePos2Beat, SnapInterval());
public bool MouseInTimeline { get; private set; }
private Vector2 relativeMousePos;
@ -110,28 +112,28 @@ namespace HeavenStudio.Editor.Track
if (selected)
{
instance.SelectionsBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
instance.SelectionsBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
// instance.SelectionsBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
}
else
instance.SelectionsBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
if (tempoChange)
{
instance.TempoChangeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
instance.TempoChangeBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
// instance.TempoChangeBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
}
else
instance.TempoChangeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
if (musicVolume)
{
instance.MusicVolumeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
instance.MusicVolumeBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
// instance.MusicVolumeBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
}
else
instance.MusicVolumeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
if (chartSection)
{
instance.ChartSectionBTN.transform.GetChild(0).GetComponent<Image>().color = Color.white;
instance.ChartSectionBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
// instance.ChartSectionBTN.GetComponent<TabButton>().Invoke("OnClick", 0);
}
else
instance.ChartSectionBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
@ -179,7 +181,6 @@ namespace HeavenStudio.Editor.Track
public Button ZoomInBTN;
public Button ZoomOutBTN;
public Button ZoomResetBTN;
public Button WaveformBTN;
public Slider PlaybackSpeed;
public Vector3[] LayerCorners = new Vector3[4];
@ -244,40 +245,13 @@ namespace HeavenStudio.Editor.Track
LoadRemix();
TimelineSlider.GetChild(0).GetComponent<Image>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
TimelineSlider.GetChild(1).GetComponent<Image>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
TimelineSlider.GetChild(2).GetComponent<TMP_Text>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
TimelineSlider.GetChild(3).GetComponent<TMP_Text>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
TimelineSongPosLineRef.GetComponent<Image>().color = EditorTheme.theme.properties.CurrentTimeMarkerCol.Hex2RGB();
// TimelineSlider.GetChild(0).GetComponent<Image>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
// TimelineSlider.GetChild(1).GetComponent<Image>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
// TimelineSlider.GetChild(2).GetComponent<TMP_Text>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
// TimelineSlider.GetChild(3).GetComponent<TMP_Text>().color = EditorTheme.theme.properties.BeatMarkerCol.Hex2RGB();
// TimelineSongPosLineRef.GetComponent<Image>().color = EditorTheme.theme.properties.CurrentTimeMarkerCol.Hex2RGB();
TimelineSongPosLineRef.gameObject.SetActive(false);
PlayBTN.onClick.AddListener(delegate
{
if (Conductor.instance.isPaused)
PlayCheck(false);
else
PlayCheck(true);
});
PauseBTN.onClick.AddListener(delegate
{
if (Conductor.instance.isPlaying && !Conductor.instance.isPaused)
PlayCheck(false);
});
StopBTN.onClick.AddListener(delegate
{
if (Conductor.instance.isPlaying || Conductor.instance.isPaused)
PlayCheck(true);
});
MetronomeBTN.onClick.AddListener(delegate
{
MetronomeToggle();
});
AutoplayBTN.onClick.AddListener(delegate
{
AutoPlayToggle();
});
SelectionsBTN.onClick.AddListener(delegate
{
timelineState.SetState(CurrentTimelineState.State.Selection);
@ -295,25 +269,6 @@ namespace HeavenStudio.Editor.Track
timelineState.SetState(CurrentTimelineState.State.ChartSection);
});
ZoomInBTN.onClick.AddListener(delegate
{
zoomComponent.Zoom(0.25f * zoomComponent.Scale.x, Vector2.zero, true);
});
ZoomOutBTN.onClick.AddListener(delegate
{
zoomComponent.Zoom(-0.2f * zoomComponent.Scale.x, Vector2.zero, true);
});
ZoomResetBTN.onClick.AddListener(delegate
{
zoomComponent.ResetZoom();
});
WaveformBTN.onClick.AddListener(delegate
{
WaveformToggle();
});
Tooltip.AddTooltip(WaveformBTN.gameObject, "Waveform Toggle");
SetTimeButtonColors(true, false, false);
MetronomeBTN.transform.GetChild(0).GetComponent<Image>().color = Color.gray;
MetronomeBTN.transform.GetChild(1).GetComponent<Image>().color = Color.gray;
@ -326,6 +281,33 @@ namespace HeavenStudio.Editor.Track
resizeCursor = Resources.Load<Texture2D>("Cursors/horizontal_resize");
}
public void PressPlay()
{
PlayCheck(!Conductor.instance.isPaused);
}
public void PressPause()
{
if (Conductor.instance.isPlaying && !Conductor.instance.isPaused) {
PlayCheck(false);
}
}
public void PressStop()
{
if (Conductor.instance.isPlaying || Conductor.instance.isPaused) {
PlayCheck(true);
}
}
// public void SetState(CurrentTimelineState.State state)
// {
// timelineState.SetState(state);
// }
public void SetState(string state)
{
timelineState.SetState(Enum.Parse<CurrentTimelineState.State>(state));
}
public void FitToSong()
{
var currentSizeDelta = RealTimelineContent.sizeDelta;
@ -338,12 +320,6 @@ namespace HeavenStudio.Editor.Track
RealTimelineContent.sizeDelta = new Vector2(TimelineContent.sizeDelta.x / Zoom, RealTimelineContent.sizeDelta.y);
}
public void CreateWaveform()
{
// DrawWaveform();
// StartCoroutine(DrawWaveformRealtime());
}
public void AutoBtnUpdate()
{
var animName = GameManager.instance.autoplay ? "Idle" : "Disabled";
@ -500,11 +476,11 @@ namespace HeavenStudio.Editor.Track
float moveSpeed = 750;
if (Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)) moveSpeed *= 6;
if (Input.GetKey(KeyCode.LeftArrow) || (!Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.A)))
if (Input.GetKey(KeyCode.LeftArrow) || (!Input.GetKey(InputKeyboard.MODIFIER) && Input.GetKey(KeyCode.A)))
{
RealTimelineContent.transform.localPosition += new Vector3(moveSpeed * Time.deltaTime, 0);
}
else if (Input.GetKey(KeyCode.RightArrow) || (!Input.GetKey(KeyCode.LeftControl) && Input.GetKey(KeyCode.D)))
else if (Input.GetKey(KeyCode.RightArrow) || (!Input.GetKey(InputKeyboard.MODIFIER) && Input.GetKey(KeyCode.D)))
{
RealTimelineContent.transform.localPosition += new Vector3(-moveSpeed * Time.deltaTime, 0);
}
@ -584,7 +560,7 @@ namespace HeavenStudio.Editor.Track
private void SliderControl()
{
TimelinePlaybackBeat.text = $"Beat {string.Format("{0:0.000}", PlaybackBeat)}";
TimelinePlaybackBeat.text = $" {string.Format("{0:0.000}", PlaybackBeat)}";
if (TimelineSongPosLineRef != null && !Conductor.instance.WaitingForDsp)
{
@ -1076,7 +1052,7 @@ namespace HeavenStudio.Editor.Track
public void UpdateOffsetFromText()
{
// Failsafe against empty string.
if (String.IsNullOrEmpty(FirstBeatOffset.text))
if (string.IsNullOrEmpty(FirstBeatOffset.text))
FirstBeatOffset.text = "0";
// Convert ms to s.

View file

@ -1,3 +1,4 @@
using HeavenStudio.InputSystem;
using UnityEngine;
using UnityEngine.EventSystems;
@ -15,6 +16,7 @@ namespace HeavenStudio.Editor.Track
private Vector2 relMousePos;
private RectTransform rectTransform;
private RectTransform timelineContentRectTrans;
private void Awake()
{
@ -28,9 +30,8 @@ namespace HeavenStudio.Editor.Track
private void Update()
{
var scrollDeltaY = Input.mouseScrollDelta.y;
if (scrollDeltaY != 0)
if (scrollDeltaY != 0 && Timeline.instance.MouseInTimeline)
{
if (Timeline.instance.MouseInTimeline)
OnScroll(scrollDeltaY);
}
}
@ -41,41 +42,51 @@ namespace HeavenStudio.Editor.Track
relMousePos = rectTransform.anchoredPosition;
Vector2 relativeMousePosition;
var cam = Editor.instance.EditorCamera;
if (cam == null)
{
Debug.LogError("Camera not set!");
return;
}
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, Input.mousePosition, cam, out relativeMousePosition);
if (scrollDeltaY > 0)
{
if (Input.GetKey(KeyCode.LeftControl))
{
Zoom(0.25f * _scale.y, relativeMousePosition, false);
if (scrollDeltaY > 0) {
if (Input.GetKey(InputKeyboard.MODIFIER)) {
ZoomInVertical();
} else {
ZoomInHorizontal();
}
else
{
Zoom(0.25f * _scale.x, relativeMousePosition, true);
} else if (scrollDeltaY < 0) {
if (Input.GetKey(InputKeyboard.MODIFIER)) {
ZoomOutVertical();
} else {
ZoomOutHorizontal();
}
}
else if (scrollDeltaY < 0)
}
public void ZoomInVertical()
{
if (Input.GetKey(KeyCode.LeftControl))
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, Input.mousePosition, Editor.instance.EditorCamera, out Vector2 mousePos);
Zoom(0.25f * _scale.y, mousePos, false);
}
public void ZoomInHorizontal()
{
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, Input.mousePosition, Editor.instance.EditorCamera, out Vector2 mousePos);
Zoom(0.25f * _scale.x, mousePos, true);
}
public void ZoomOutVertical()
{
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, Input.mousePosition, Editor.instance.EditorCamera, out Vector2 mousePos);
var incre = -0.2f * _scale.y;
if (_scale.y + incre > minScale - 0.1f)
Zoom(-0.2f * _scale.y, relativeMousePosition, false);
Zoom(-0.2f * _scale.y, mousePos, false);
}
else
public void ZoomOutHorizontal()
{
RectTransformUtility.ScreenPointToLocalPointInRectangle(rectTransform, Input.mousePosition, Editor.instance.EditorCamera, out Vector2 mousePos);
var incre = -0.2f * _scale.x;
if (_scale.x + incre > minScale - 0.1f)
Zoom(-0.2f * _scale.x, relativeMousePosition, true);
}
if (_scale.x + incre > minScale - 0.1f) {
Zoom(-0.2f * _scale.x, mousePos, true);
}
}
@ -85,10 +96,10 @@ namespace HeavenStudio.Editor.Track
if (horiz)
{
var newScale = Mathf.Clamp(_scale.x + incre, minScale, maxScale);
float newScale = Mathf.Clamp(_scale.x + incre, minScale, maxScale);
_scale.Set(newScale, _scale.y, 1);
relativeMousePosition = new Vector2(relativeMousePosition.x, 0);
relMousePos -= (relativeMousePosition * incre);
relMousePos -= relativeMousePosition * incre;
rectTransform.localScale = _scale;
rectTransform.anchoredPosition = relMousePos;
@ -101,10 +112,10 @@ namespace HeavenStudio.Editor.Track
}
else
{
var newScale = Mathf.Clamp(_scale.y + incre, 1.0f, maxScale);
float newScale = Mathf.Clamp(_scale.y + incre, 1.0f, maxScale);
_scale.Set(_scale.x, newScale, 1);
relativeMousePosition = new Vector2(0, relativeMousePosition.y);
relMousePos -= (relativeMousePosition * incre);
relMousePos -= relativeMousePosition * incre;
rectTransform.localScale = _scale;
rectTransform.anchoredPosition = relMousePos;
@ -126,7 +137,9 @@ namespace HeavenStudio.Editor.Track
{
_scale.Set(1, 1, 1);
rectTransform.localScale = _scale;
rectTransform.localPosition = new Vector2(rectTransform.localPosition.x, 0);
Timeline.instance.OnZoom(_scale.x);
Timeline.instance.OnZoomVertical(_scale.y);
}
}
}

View file

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 57d18db3e40dbf34391199ee47cecd0d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HeavenStudio.Editor.Track;
using TMPro;
namespace HeavenStudio.Editor
{
public class ZoomDialog : Dialog
{
// [SerializeField] private TMP_Text snapText;
[SerializeField] RectTransform btnRectTransform;
public void SwitchZoomDialog()
{
if (dialog.activeSelf) {
dialog.SetActive(false);
} else {
ResetAllDialogs();
SetPosRelativeToButtonPos(btnRectTransform, new Vector2(146, 120));
dialog.SetActive(true);
}
}
}
}

View file

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

View file

@ -197,9 +197,9 @@ namespace HeavenStudio
public static RiqBeatmapData? PreProcessBeatmap(string version, RiqBeatmapData data)
{
Debug.Log("Preprocessing beatmap...");
Minigames.Minigame game;
Minigames.GameAction action;
System.Type type, pType;
Minigame game;
GameAction action;
Type type, pType;
if (EventCaller.instance != null)
{
string[] split;
@ -212,7 +212,7 @@ namespace HeavenStudio
if (game == null)
{
Debug.LogWarning($"Unknown game {gameName} found in remix.json! Adding game...");
game = new Minigames.Minigame(gameName, gameName.DisplayName() + " \n<color=#eb5454>[inferred from remix.json]</color>", "", false, false, new List<Minigames.GameAction>(), inferred: true);
game = new Minigame(gameName, gameName.DisplayName() + " \n<color=#eb5454>[inferred from remix.json]</color>", "", false, false, new List<GameAction>(), inferred: true);
EventCaller.instance.minigames.Add(gameName, game);
if (Editor.Editor.instance != null)
Editor.Editor.instance.AddIcon(game);
@ -221,7 +221,7 @@ namespace HeavenStudio
if (action == null)
{
Debug.LogWarning($"Unknown action {gameName}/{actionName} found in remix.json! Adding action...");
var parameters = new List<Minigames.Param>();
var parameters = new List<Param>();
foreach (var item in e.dynamicData)
{
Debug.Log($"k: {item.Key}, v: {item.Value}");
@ -234,9 +234,9 @@ namespace HeavenStudio
value = new EntityTypes.Integer(int.MinValue, int.MaxValue, (int)value);
else if (value.GetType() == typeof(double))
value = new EntityTypes.Float(float.NegativeInfinity, float.PositiveInfinity, (float)value);
parameters.Add(new Minigames.Param(item.Key, value, item.Key.DisplayName(), "[inferred from remix.json]"));
parameters.Add(new Param(item.Key, value, item.Key.DisplayName(), "[inferred from remix.json]"));
}
action = new Minigames.GameAction(actionName, actionName.DisplayName(), e.length, true, parameters);
action = new GameAction(actionName, actionName.DisplayName(), "Events", e.length, true, parameters);
game.actions.Add(action);
}
@ -250,12 +250,14 @@ namespace HeavenStudio
if (!e.dynamicData.ContainsKey(param.propertyName))
{
Debug.LogWarning($"Property {param.propertyName} does not exist in the entity's dynamic data! Adding...");
if (type == typeof(EntityTypes.Integer))
e.dynamicData.Add(param.propertyName, ((EntityTypes.Integer)param.parameter).val);
else if (type == typeof(EntityTypes.Float))
e.dynamicData.Add(param.propertyName, ((EntityTypes.Float)param.parameter).val);
else if (type == typeof(EntityTypes.Note))
e.dynamicData.Add(param.propertyName, ((EntityTypes.Note)param.parameter).val);
if (param.parameter is EntityTypes.Integer intParam)
e.dynamicData.Add(param.propertyName, intParam.val);
if (param.parameter is EntityTypes.Float floatParam)
e.dynamicData.Add(param.propertyName, floatParam.val);
if (param.parameter is EntityTypes.Dropdown ddParam)
e.dynamicData.Add(param.propertyName, new EntityTypes.DropdownObj(ddParam));
if (param.parameter is EntityTypes.Note noteParam)
e.dynamicData.Add(param.propertyName, noteParam.val);
else if (type.IsEnum)
e.dynamicData.Add(param.propertyName, (int)param.parameter);
else
@ -657,6 +659,7 @@ namespace HeavenStudio
{
public string actionName;
public string displayName;
public string tabName;
public EventCallback function = delegate { };
public float defaultLength = 1;
public bool resizable = false;
@ -682,11 +685,12 @@ namespace HeavenStudio
/// <param name="preFunction">What the block does when the GameManager seeks to this cue for pre-scheduling.</param>
/// <param name="hidden">Prevents the block from being shown in the game list. Block will still function normally if it is in the timeline.</param>
/// <param name="priority">Priority of this event. Higher priority events will be run first.</param>
public GameAction(string actionName, string displayName, float defaultLength = 1, bool resizable = false, List<Param> parameters = null, EventCallback function = null, EventCallback inactiveFunction = null, EventCallback preFunction = null, bool hidden = false, int priority = 0, float preFunctionLength = 2.0f)
public GameAction(string actionName, string displayName, string tabName, float defaultLength = 1, bool resizable = false, List<Param> parameters = null, EventCallback function = null, EventCallback inactiveFunction = null, EventCallback preFunction = null, bool hidden = false, int priority = 0, float preFunctionLength = 2.0f)
{
this.actionName = actionName;
if (displayName == String.Empty) this.displayName = actionName;
else this.displayName = displayName;
this.displayName = string.IsNullOrEmpty(displayName) ? actionName : displayName;
this.tabName = string.IsNullOrEmpty(tabName) ? "Events" : tabName;
this.defaultLength = defaultLength;
this.resizable = resizable;
this.parameters = parameters;
@ -704,11 +708,12 @@ namespace HeavenStudio
/// </summary>
/// <param name="actionName">Entity model name</param>
/// <param name="displayName">Name of the block used in the UI</param>
public GameAction(string actionName, string displayName)
/// <param name="tabName">Name of the tab to be under when spawning events</param>
public GameAction(string actionName, string displayName, string tabName = "")
{
this.actionName = actionName;
if (displayName == String.Empty) this.displayName = actionName;
else this.displayName = displayName;
this.displayName = string.IsNullOrEmpty(displayName) ? actionName : displayName;
this.tabName = tabName == string.Empty ? "Events" : tabName; // keep it null if it's null
}
}
@ -762,7 +767,7 @@ namespace HeavenStudio
{
new Minigame("gameManager", "Game Manager", "", false, true, new List<GameAction>()
{
new GameAction("switchGame", "Switch Game", 0.5f, false,
new GameAction("switchGame", "Switch Game", null, 0.5f, false,
function: delegate { var e = eventCaller.currentEntity; GameManager.instance.SwitchGame(eventCaller.currentSwitchGame, eventCaller.currentEntity.beat, e["toggle"]); },
parameters: new List<Param>()
{
@ -770,7 +775,7 @@ namespace HeavenStudio
},
inactiveFunction: delegate { var e = eventCaller.currentEntity; GameManager.instance.SwitchGame(eventCaller.currentSwitchGame, eventCaller.currentEntity.beat, e["toggle"]); }
),
new GameAction("end", "End Remix",
new GameAction("end", "End Remix", "",
function: delegate {
Debug.Log("end");
if (Timeline.instance != null)
@ -779,7 +784,7 @@ namespace HeavenStudio
GameManager.instance.Stop(eventCaller.currentEntity.beat);
}
),
new GameAction("skill star", "Skill Star", 1f, true)
new GameAction("skill star", "Skill Star", "", 1f, true)
{
//temp for testing
function = delegate {
@ -787,7 +792,7 @@ namespace HeavenStudio
Common.SkillStarManager.instance.DoStarIn(e.beat, e.length);
}
},
new GameAction("toggle inputs", "Toggle Inputs", 0.5f, true,
new GameAction("toggle inputs", "Toggle Inputs", "", 0.5f, true,
new List<Param>()
{
new Param("toggle", true, "Allow Inputs", "Toggle if the player is able to input. Any missed cues while this is disabled will not be counted as a miss and will not break a perfect.")
@ -801,7 +806,7 @@ namespace HeavenStudio
new Minigame("countIn", "Count-Ins", "", false, true, new List<GameAction>()
{
new GameAction("count-in", "Count-In", 4f, true,
new GameAction("count-in", "Count-In", "Built", 4f, true,
new List<Param>()
{
new Param("alt", false, "Alt", "Set the type of sounds to use for the count-in."),
@ -812,7 +817,7 @@ namespace HeavenStudio
SoundEffects.CountIn(e.beat, e.length, e["alt"], e["go"]);
}
),
new GameAction("4 beat count-in", "4 Beat Count-In", 4f, true,
new GameAction("4 beat count-in", "4 Beat Count-In", "Built", 4f, true,
new List<Param>()
{
new Param("type", SoundEffects.CountInType.Normal, "Type", "Set the type of sounds to use for the count-in.")
@ -822,7 +827,7 @@ namespace HeavenStudio
SoundEffects.FourBeatCountIn(e.beat, e.length / 4f, e["type"]);
}
),
new GameAction("8 beat count-in", "8 Beat Count-In", 8f, true,
new GameAction("8 beat count-in", "8 Beat Count-In", "Built", 8f, true,
new List<Param>()
{
new Param("type", SoundEffects.CountInType.Normal, "Type", "Set the type of sounds to use for the count-in.")
@ -832,7 +837,7 @@ namespace HeavenStudio
SoundEffects.EightBeatCountIn(e.beat, e.length / 8f, e["type"]);
}
),
new GameAction("count", "Count", 1f, false,
new GameAction("count", "Count", "Single", 1f, false,
new List<Param>()
{
new Param("type", SoundEffects.CountNumbers.One, "Type", "Set the number to say."),
@ -843,16 +848,16 @@ namespace HeavenStudio
SoundEffects.Count(e["type"], e["toggle"]);
}
),
new GameAction("cowbell", "Cowbell",
new GameAction("cowbell", "Cowbell", "Single",
function: delegate { SoundEffects.Cowbell(); }
),
new GameAction("ready!", "Ready!", 2f, true,
new GameAction("ready!", "Ready!", "Single", 2f, true,
function: delegate { var e = eventCaller.currentEntity; SoundEffects.Ready(e.beat, (e.length / 2f)); }
),
new GameAction("and", "And", 0.5f,
new GameAction("and", "And", "Single", 0.5f,
function: delegate { SoundEffects.And(); }
),
new GameAction("go!", "Go!", 1f, false,
new GameAction("go!", "Go!", "Single", 1f, false,
new List<Param>()
{
new Param("toggle", false, "Alt", "Toggle if the alternate version of this voice line should be used.")
@ -860,26 +865,26 @@ namespace HeavenStudio
function: delegate { SoundEffects.Go(eventCaller.currentEntity["toggle"]); }
),
// These are still here for backwards-compatibility but are hidden in the editor
new GameAction("4 beat count-in (alt)", "", 4f, function: delegate { var e = eventCaller.currentEntity; SoundEffects.FourBeatCountIn(e.beat, e.length, 1); }, hidden: true),
new GameAction("4 beat count-in (cowbell)", "", 4f, function: delegate { var e = eventCaller.currentEntity; SoundEffects.FourBeatCountIn(e.beat, e.length, 2); }, hidden: true),
new GameAction("8 beat count-in (alt)", "", 8f, function: delegate { var e = eventCaller.currentEntity; SoundEffects.EightBeatCountIn(e.beat, e.length, 1); }, hidden: true),
new GameAction("8 beat count-in (cowbell)", "", 8f, function: delegate { var e = eventCaller.currentEntity; SoundEffects.EightBeatCountIn(e.beat, e.length, 2); }, hidden: true),
// // These are still here for backwards-compatibility but are hidden in the editor
// new GameAction("4 beat count-in (alt)", "", 4f, function: delegate { var e = eventCaller.currentEntity; SoundEffects.FourBeatCountIn(e.beat, e.length, 1); }, hidden: true),
// new GameAction("4 beat count-in (cowbell)", "", 4f, function: delegate { var e = eventCaller.currentEntity; SoundEffects.FourBeatCountIn(e.beat, e.length, 2); }, hidden: true),
// new GameAction("8 beat count-in (alt)", "", 8f, function: delegate { var e = eventCaller.currentEntity; SoundEffects.EightBeatCountIn(e.beat, e.length, 1); }, hidden: true),
// new GameAction("8 beat count-in (cowbell)", "", 8f, function: delegate { var e = eventCaller.currentEntity; SoundEffects.EightBeatCountIn(e.beat, e.length, 2); }, hidden: true),
new GameAction("one", "", function: delegate { SoundEffects.Count(0, false); }, hidden: true),
new GameAction("two", "", function: delegate { SoundEffects.Count(1, false); }, hidden: true),
new GameAction("three", "", function: delegate { SoundEffects.Count(2, false); }, hidden: true),
new GameAction("four", "", function: delegate { SoundEffects.Count(3, false); }, hidden: true),
new GameAction("one (alt)", "", function: delegate { SoundEffects.Count(0, true); }, hidden: true),
new GameAction("two (alt)", "", function: delegate { SoundEffects.Count(1, true); }, hidden: true),
new GameAction("three (alt)", "", function: delegate { SoundEffects.Count(2, true); }, hidden: true),
new GameAction("four (alt)", "", function: delegate { SoundEffects.Count(3, true); }, hidden: true),
new GameAction("go! (alt)", "", function: delegate { SoundEffects.Go(true); }, hidden: true),
// new GameAction("one", "", function: delegate { SoundEffects.Count(0, false); }, hidden: true),
// new GameAction("two", "", function: delegate { SoundEffects.Count(1, false); }, hidden: true),
// new GameAction("three", "", function: delegate { SoundEffects.Count(2, false); }, hidden: true),
// new GameAction("four", "", function: delegate { SoundEffects.Count(3, false); }, hidden: true),
// new GameAction("one (alt)", "", function: delegate { SoundEffects.Count(0, true); }, hidden: true),
// new GameAction("two (alt)", "", function: delegate { SoundEffects.Count(1, true); }, hidden: true),
// new GameAction("three (alt)", "", function: delegate { SoundEffects.Count(2, true); }, hidden: true),
// new GameAction("four (alt)", "", function: delegate { SoundEffects.Count(3, true); }, hidden: true),
// new GameAction("go! (alt)", "", function: delegate { SoundEffects.Go(true); }, hidden: true),
}),
new Minigame("vfx", "Visual Effects", "", false, true, new List<GameAction>()
{
new GameAction("flash", "Flash/Fade", 1f, true,
new GameAction("flash", "Flash/Fade", "VFX", 1f, true,
new List<Param>()
{
new Param("colorA", Color.white, "Start Color", "Set the color at the start of the event."),
@ -892,7 +897,7 @@ namespace HeavenStudio
})
}
),
new GameAction("filter", "Filter", 1f, true,
new GameAction("filter", "Filter", "VFX", 1f, true,
new List<Param>()
{
new Param("filter", Games.Global.Filter.FilterType.grayscale, "Type", "Set the type of filter to use."),
@ -912,7 +917,7 @@ namespace HeavenStudio
}),
}
),
new GameAction("move camera", "Move Camera", 1f, true, new List<Param>()
new GameAction("move camera", "Move Camera", "Camera", 1f, true, new List<Param>()
{
new Param("valA", new EntityTypes.Float(-50, 50, 0), "Right / Left", "Set the position on the X axis."),
new Param("valB", new EntityTypes.Float(-50, 50, 0), "Up / Down", "Set the position on the Y axis."),
@ -921,16 +926,16 @@ namespace HeavenStudio
new Param("axis", GameCamera.CameraAxis.All, "Axis", "Set if only a specific axis should be modified." )
}
),
new GameAction("rotate camera", "Rotate Camera", 1f, true, new List<Param>()
new GameAction("rotate camera", "Rotate Camera", "Camera", 1f, true, new List<Param>()
{
new Param("valA", new EntityTypes.Integer(-360, 360, 0), "Pitch", "Set the up/down rotation."),
new Param("valB", new EntityTypes.Integer(-360, 360, 0), "Yaw", "Set the left/right rotation."),
new Param("valC", new EntityTypes.Integer(-360, 360, 0), "Roll", "Set the clockwise/counterclockwise rotation."),
new Param("valA", new EntityTypes.Float(-360, 360, 0), "Pitch", "Set the up/down rotation."),
new Param("valB", new EntityTypes.Float(-360, 360, 0), "Yaw", "Set the left/right rotation."),
new Param("valC", new EntityTypes.Float(-360, 360, 0), "Roll", "Set the clockwise/counterclockwise rotation."),
new Param("ease", Util.EasingFunction.Ease.Linear, "Ease", "Set the easing of the action."),
new Param("axis", GameCamera.CameraAxis.All, "Axis", "Set if only a specific axis should be modified." )
}
),
new GameAction("pan view", "Pan Viewport", 1f, true, new List<Param>()
new GameAction("pan view", "Pan Viewport", "Camera", 1f, true, new List<Param>()
{
new Param("valA", new EntityTypes.Float(-50, 50, 0), "Right / Left", "Set the position on the X axis."),
new Param("valB", new EntityTypes.Float(-50, 50, 0), "Up / Down", "Set the position on the Y axis."),
@ -938,13 +943,13 @@ namespace HeavenStudio
new Param("axis", StaticCamera.ViewAxis.All, "Axis", "Set if only a specific axis should be modified." )
}
),
new GameAction("rotate view", "Rotate Viewport", 1f, true, new List<Param>()
new GameAction("rotate view", "Rotate Viewport", "Camera", 1f, true, new List<Param>()
{
new Param("valA", new EntityTypes.Float(-360, 360, 0), "Rotation", "Set the clockwise/counterclockwise rotation."),
new Param("ease", Util.EasingFunction.Ease.Linear, "Ease", "Set the easing of the action."),
}
),
new GameAction("scale view", "Scale Viewport", 1f, true, new List<Param>()
new GameAction("scale view", "Scale Viewport", "Camera", 1f, true, new List<Param>()
{
new Param("valA", new EntityTypes.Float(-50f, 50, 1), "Width", "Set the width of the viewport."),
new Param("valB", new EntityTypes.Float(-50f, 50, 1), "Height", "Set the height of the viewport."),
@ -952,7 +957,7 @@ namespace HeavenStudio
new Param("axis", StaticCamera.ViewAxis.All, "Axis", "Set if only a specific axis should be modified." )
}
),
new("stretch camera", "Stretch Camera")
new("stretch camera", "Stretch Camera", "Camera")
{
resizable = true,
parameters = new()
@ -968,7 +973,7 @@ namespace HeavenStudio
new Param("axis", GameCamera.CameraAxis.All, "Axis", "Set if only a specific axis should be modified.")
}
},
new GameAction("fitScreen", "Force Game Stretching To Window")
new GameAction("fitScreen", "Force Game Stretching To Window", "Camera")
{
defaultLength = 0.5f,
parameters = new()
@ -976,7 +981,7 @@ namespace HeavenStudio
new("enable", true, "Enabled", "Toggle if the game should be forced to stretch to the window size, removing the letterbox.")
}
},
new GameAction("screen shake", "Screen Shake", 1f, true,
new GameAction("screen shake", "Screen Shake", "Camera", 1f, true,
new List<Param>()
{
new Param("easedA", new EntityTypes.Float(0, 10, 0), "Start Horizontal Intensity", "Set the horizontal intensity of the screen shake at the start of the event."),
@ -989,7 +994,7 @@ namespace HeavenStudio
}),
}
),
new GameAction("display textbox", "Display Textbox", 1f, true, new List<Param>()
new GameAction("display textbox", "Display Textbox", "Text", 1f, true, new List<Param>()
{
new Param("text1", "", "Text", "Set the text to display in the textbox. Rich text is supported."),
new Param("type", Games.Global.Textbox.TextboxAnchor.TopMiddle, "Anchor", "Set where to anchor the textbox."),
@ -997,7 +1002,7 @@ namespace HeavenStudio
new Param("valB", new EntityTypes.Float(0.5f, 8, 1), "Height", "Set the height of the textbox.")
}
),
new GameAction("display open captions", "Display Open Captions", 1f, true,
new GameAction("display open captions", "Display Open Captions", "Text", 1f, true,
new List<Param>()
{
new Param("text1", "", "Text", "Set the text to display in the captions. Rich text is supported."),
@ -1006,7 +1011,7 @@ namespace HeavenStudio
new Param("valB", new EntityTypes.Float(0.5f, 8, 1), "Height", "Set the height of the captions.")
}
),
new GameAction("display closed captions", "Display Closed Captions", 1f, true,
new GameAction("display closed captions", "Display Closed Captions", "Text", 1f, true,
new List<Param>()
{
new Param("text1", "", "Text", "Set the text to display in the captions. Rich text is supported."),
@ -1014,7 +1019,7 @@ namespace HeavenStudio
new Param("valA", new EntityTypes.Float(0.5f, 4, 1), "Height", "Set the height of the captions.")
}
),
new GameAction("display song artist", "Display Song Info", 1f, true,
new GameAction("display song artist", "Display Song Info", "Text", 1f, true,
new List<Param>()
{
new Param("text1", "", "Title", "Set the text to display in the upper label. Rich text is supported."),
@ -1023,7 +1028,7 @@ namespace HeavenStudio
new Param("instantOff", false, "Instant Hide", "Toggle if the slide-out animation should be skipped."),
}
),
new GameAction("camera background color", "Camera Background Color", 1, true, new List<Param>()
new GameAction("camera background color", "Camera Background Color", "Camera", 1, true, new List<Param>()
{
new Param("color", Color.black, "Start Color", "Set the color at the start of the event."),
new Param("color2", Color.black, "End Color", "Set the color at the end of the event."),
@ -1032,7 +1037,7 @@ namespace HeavenStudio
),
// Post Processing VFX
new GameAction("vignette", "Vignette")
new GameAction("vignette", "Vignette", "VFX")
{
resizable = true,
parameters = new()
@ -1062,7 +1067,7 @@ namespace HeavenStudio
}),
}
},
new GameAction("cabb", "Chromatic Aberration")
new GameAction("cabb", "Chromatic Aberration", "VFX")
{
resizable = true,
parameters = new()
@ -1075,7 +1080,7 @@ namespace HeavenStudio
}),
}
},
new GameAction("bloom", "Bloom")
new GameAction("bloom", "Bloom", "VFX")
{
resizable = true,
parameters = new()
@ -1101,7 +1106,7 @@ namespace HeavenStudio
}),
}
},
new GameAction("lensD", "Lens Distortion")
new GameAction("lensD", "Lens Distortion", "VFX")
{
resizable = true,
parameters = new()
@ -1120,7 +1125,7 @@ namespace HeavenStudio
}),
}
},
new GameAction("grain", "Grain")
new GameAction("grain", "Grain", "VFX")
{
resizable = true,
parameters = new()
@ -1140,7 +1145,7 @@ namespace HeavenStudio
}
},
new GameAction("colorGrading", "Color Grading")
new GameAction("colorGrading", "Color Grading", "VFX")
{
resizable = true,
parameters = new()
@ -1173,7 +1178,7 @@ namespace HeavenStudio
}
},
new GameAction("gaussBlur", "Gaussian Blur")
new GameAction("gaussBlur", "Gaussian Blur", "VFX")
{
resizable = true,
parameters = new()
@ -1188,7 +1193,7 @@ namespace HeavenStudio
}
},
new GameAction("pixelQuad", "Pixelize")
new GameAction("pixelQuad", "Pixelize", "VFX")
{
resizable = true,
parameters = new()
@ -1208,7 +1213,27 @@ namespace HeavenStudio
}
},
new GameAction("retroTv", "Retro TV")
new GameAction("pixelQuad", "Pixelize", "VFX")
{
resizable = true,
parameters = new()
{
new("pixelSizeStart", new EntityTypes.Float(0.00f, 1f, 0.00f), "Start Pixel Size", "Set the pixel size at the start of the event."),
new("pixelSizeEnd", new EntityTypes.Float(0.00f, 1f, 0.5f), "End Pixel Size", "Set the pixel size at the end of the event."),
new("ratioStart", new EntityTypes.Float(0.2f, 5f, 1f), "Start Pixel Ratio", "Set the pixel ratio at the start of the event."),
new("ratioEnd", new EntityTypes.Float(0.2f, 5f, 1f), "End Pixel Ratio", "Set the pixel ratio at the end of the event."),
new("xScaleStart", new EntityTypes.Float(0.2f, 5f, 1f), "Start X Scale", "Set the X scale of the pixels at the start of the event."),
new("xScaleEnd", new EntityTypes.Float(0.2f, 5f, 1f), "End X Scale", "Set the X scale of the pixels at the end of the event."),
new("yScaleStart", new EntityTypes.Float(0.2f, 5f, 1f), "Start Y Scale", "Set the Y scale of the pixels at the start of the event."),
new("yScaleEnd", new EntityTypes.Float(0.2f, 5f, 1f), "End Y Scale", "Set the Y scale of the pixels at the end of the event."),
new("ease", Util.EasingFunction.Ease.Linear, "Ease", "Set the easing of the action.", new()
{
new((x, y) => (Util.EasingFunction.Ease)x != Util.EasingFunction.Ease.Instant, new string[] { "pixelSizeStart", "ratioStart", "xScaleStart", "yScaleStart" })
}),
}
},
new GameAction("retroTv", "Retro TV", "VFX")
{
resizable = true,
parameters = new()
@ -1232,7 +1257,7 @@ namespace HeavenStudio
}
},
new GameAction("scanJitter", "Scan Line Jitter")
new GameAction("scanJitter", "Scan Line Jitter", "VFX")
{
resizable = true,
parameters = new()
@ -1247,7 +1272,7 @@ namespace HeavenStudio
}
},
new GameAction("analogNoise", "Analog Noise")
new GameAction("analogNoise", "Analog Noise", "VFX")
{
resizable = true,
parameters = new()
@ -1268,7 +1293,7 @@ namespace HeavenStudio
}
},
new GameAction("screenJump", "Screen Jump")
new GameAction("screenJump", "Screen Jump", "VFX")
{
resizable = true,
parameters = new()
@ -1283,7 +1308,7 @@ namespace HeavenStudio
}
},
new GameAction("sobelNeon", "Neon")
new GameAction("sobelNeon", "Neon", "VFX")
{
resizable = true,
parameters = new()
@ -1311,7 +1336,7 @@ namespace HeavenStudio
},
new GameAction("screenTiling", "Tile Screen")
new GameAction("screenTiling", "Tile Screen", "VFX")
{
resizable = true,
parameters = new()
@ -1327,7 +1352,7 @@ namespace HeavenStudio
}),
}
},
new GameAction("scrollTiles", "Scroll Tiles")
new GameAction("scrollTiles", "Scroll Tiles", "VFX")
{
resizable = true,
parameters = new()
@ -1349,7 +1374,7 @@ namespace HeavenStudio
new Minigame("advanced", "Advanced", "", false, true, new List<GameAction>()
{
new GameAction("play animation", "Play Animation", 0.5f, false,
new GameAction("play animation", "Play Animation", "Play", 0.5f, false,
new List<Param>()
{
new Param("getAnimators", new EntityTypes.Button("No Game", e => {
@ -1404,7 +1429,7 @@ namespace HeavenStudio
GameManager.instance.PlayAnimationArbitrary(e["animator"].CurrentValue, e["animation"].CurrentValue, e["scale"]);
}
),
new GameAction("play sfx", "Play SFX", 0.5f, true,
new GameAction("play sfx", "Play SFX", "Play", 0.5f, true,
new List<Param>()
{
new Param("game", new EntityTypes.Dropdown(), "Which Game", "Specify the game's sfx to play. An empty input will play global sfx."),
@ -1435,7 +1460,7 @@ namespace HeavenStudio
new Param("semitones", new EntityTypes.Integer(-EntityTypes.Note.maxSemitones, EntityTypes.Note.maxSemitones, 0), "Semitones", "The semitones of the sfx."),
new Param("cents", new EntityTypes.Integer(-100, 100, 0), "Cents", "The cents of the sfx."),
new Param("pitch", new EntityTypes.Float(0, 5, 1), "Pitch", "The pitch of the sfx."),
new Param("volume", new EntityTypes.Float(0, 2, 1), "Volume", "The volume of the sfx."),
new Param("volume", new EntityTypes.Float(0, 5, 1), "Volume", "The volume of the sfx."),
new Param("offset", new EntityTypes.Integer(-500, 500), "Offset (ms)", "The offset of the sfx in milliseconds."),
new Param("loop", false, "Loop", "Loop the sfx for the length of the block."),
},