diff --git a/Assets/Resources/Sprites/Editor/GameIcons/advanced.png b/Assets/Resources/Sprites/Editor/GameIcons/advanced.png index fab114ee5..ce4e33b90 100644 Binary files a/Assets/Resources/Sprites/Editor/GameIcons/advanced.png and b/Assets/Resources/Sprites/Editor/GameIcons/advanced.png differ diff --git a/Assets/Resources/Sprites/Editor/GameIcons/advanced.png.meta b/Assets/Resources/Sprites/Editor/GameIcons/advanced.png.meta index a96298b84..528f50b61 100644 --- a/Assets/Resources/Sprites/Editor/GameIcons/advanced.png.meta +++ b/Assets/Resources/Sprites/Editor/GameIcons/advanced.png.meta @@ -5,8 +5,8 @@ TextureImporter: externalObjects: {} serializedVersion: 12 mipmaps: - mipMapMode: 0 - enableMipMap: 0 + mipMapMode: 1 + enableMipMap: 1 sRGBTexture: 1 linearTexture: 0 fadeOut: 0 @@ -33,8 +33,8 @@ TextureImporter: maxTextureSize: 2048 textureSettings: serializedVersion: 2 - filterMode: 1 - aniso: 1 + filterMode: 2 + aniso: 8 mipBias: 0 wrapU: 1 wrapV: 1 @@ -67,10 +67,10 @@ TextureImporter: platformSettings: - serializedVersion: 3 buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 + maxTextureSize: 256 resizeAlgorithm: 0 textureFormat: -1 - textureCompression: 1 + textureCompression: 0 compressionQuality: 50 crunchedCompression: 0 allowsAlphaSplitting: 0 diff --git a/Assets/Resources/Sprites/Editor/GameIcons/advanced_mask.png b/Assets/Resources/Sprites/Editor/GameIcons/advanced_mask.png new file mode 100644 index 000000000..fd5b51115 Binary files /dev/null and b/Assets/Resources/Sprites/Editor/GameIcons/advanced_mask.png differ diff --git a/Assets/Resources/Sprites/Editor/GameIcons/advanced_mask.png.meta b/Assets/Resources/Sprites/Editor/GameIcons/advanced_mask.png.meta new file mode 100644 index 000000000..d6950f99e --- /dev/null +++ b/Assets/Resources/Sprites/Editor/GameIcons/advanced_mask.png.meta @@ -0,0 +1,123 @@ +fileFormatVersion: 2 +guid: b497c224147c3654f93eeb5c0482ace6 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + mipmaps: + mipMapMode: 1 + enableMipMap: 1 + 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: 2 + aniso: 8 + 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: 256 + 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: diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 22a78ff4c..4ce730a20 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -623,7 +623,7 @@ namespace HeavenStudio public static void PlaySFXArbitrary(double beat, string game, string name, float pitch, int offset) { if (string.IsNullOrEmpty(name)) return; - if (string.IsNullOrEmpty(game)) { + if (game == "common") { SoundByte.PlayOneShot(name, beat, pitch, offset: offset); } else { SoundByte.PreloadGameAudioClips(game); diff --git a/Assets/Scripts/LevelEditor/Commands/Block.cs b/Assets/Scripts/LevelEditor/Commands/Block.cs index 9d88673ac..23a3b1564 100644 --- a/Assets/Scripts/LevelEditor/Commands/Block.cs +++ b/Assets/Scripts/LevelEditor/Commands/Block.cs @@ -134,7 +134,14 @@ namespace HeavenStudio.Editor.Commands foreach (var entity in entities) { - dupEntityData.Add(entity.DeepCopy()); + var newEntity = entity.DeepCopy(); + // there's gotta be a better way to do this. i just don't know how... -AJ + foreach ((var key, var value) in new Dictionary(newEntity.dynamicData)) { + if (value is EntityTypes.DropdownObj dd) { + newEntity[key] = new EntityTypes.DropdownObj(dd.value, dd.Values); + } + } + dupEntityData.Add(newEntity); } for (var i = 0; i < original.Count; i++) diff --git a/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/ButtonPropertyPrefab.cs b/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/ButtonPropertyPrefab.cs index caa2458cd..61a057392 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/ButtonPropertyPrefab.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/PropertyPrefabs/ButtonPropertyPrefab.cs @@ -45,8 +45,6 @@ namespace HeavenStudio.Editor // buttonText.text = entity[propertyName]; // } - Debug.Log(buttonTextRect.sizeDelta.x > minButtonSize ? "buttonTextRect.sizeDelta.x : " + buttonTextRect.sizeDelta.x : "minButtonSize : " + minButtonSize); - buttonRect.sizeDelta = new(Mathf.Max(buttonTextRect.sizeDelta.x, minButtonSize), buttonRect.sizeDelta.y); } diff --git a/Assets/Scripts/LevelEditor/Timeline/Timeline.cs b/Assets/Scripts/LevelEditor/Timeline/Timeline.cs index f2a9a20b8..a9c4213dc 100644 --- a/Assets/Scripts/LevelEditor/Timeline/Timeline.cs +++ b/Assets/Scripts/LevelEditor/Timeline/Timeline.cs @@ -951,7 +951,13 @@ namespace HeavenStudio.Editor.Track foreach (RiqEntity entity in original) { - CopiedEntities.Add(entity.DeepCopy()); + var newEntity = entity.DeepCopy(); + foreach (var key in newEntity.dynamicData.Keys) { + if (newEntity[key] is EntityTypes.DropdownObj dd) { + newEntity[key] = new EntityTypes.DropdownObj(dd.value, dd.Values); + } + } + CopiedEntities.Add(newEntity); } } diff --git a/Assets/Scripts/Minigames.cs b/Assets/Scripts/Minigames.cs index f542bdb26..15c60e545 100644 --- a/Assets/Scripts/Minigames.cs +++ b/Assets/Scripts/Minigames.cs @@ -16,6 +16,7 @@ using SatorImaging.UnitySourceGenerator; using System; using System.IO; using System.Linq; +using UnityEngine.Assertions.Must; namespace HeavenStudio { @@ -870,7 +871,7 @@ namespace HeavenStudio { 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."), - new Param("valC", new EntityTypes.Float(-0, 250, 10), "In / Out", "Set the position on the Z axis."), + new Param("valC", new EntityTypes.Float(-250, 250, 10), "In / Out", "Set the position on the Z axis."), 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." ) } @@ -900,8 +901,8 @@ namespace HeavenStudio ), new GameAction("scale view", "Scale Viewport", 1f, true, new List() { - new Param("valA", new EntityTypes.Float(0, 50, 1), "Width", "Set the width of the viewport."), - new Param("valB", new EntityTypes.Float(0, 50, 1), "Height", "Set the height of the viewport."), + 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."), new Param("ease", Util.EasingFunction.Ease.Linear, "Ease", "Set the easing of the action."), new Param("axis", StaticCamera.ViewAxis.All, "Axis", "Set if only a specific axis should be modified." ) } @@ -911,10 +912,10 @@ namespace HeavenStudio resizable = true, parameters = new() { - new("x1", new EntityTypes.Float(0f, 50f, 1f), "Start Width", "Set the width at the start of the event."), - new("x2", new EntityTypes.Float(0f, 50f, 1f), "End Width", "Set the width at the end of the event."), - new("y1", new EntityTypes.Float(0f, 50f, 1f), "Start Height", "Set the height at the start of the event."), - new("y2", new EntityTypes.Float(0f, 50f, 1f), "End Height", "Set the height at the end of the event."), + new("x1", new EntityTypes.Float(-50f, 50f, 1f), "Start Width", "Set the width at the start of the event."), + new("x2", new EntityTypes.Float(-50f, 50f, 1f), "End Width", "Set the width at the end of the event."), + new("y1", new EntityTypes.Float(-50f, 50f, 1f), "Start Height", "Set the height at the start of the event."), + new("y2", new EntityTypes.Float(-50f, 50f, 1f), "End Height", "Set the height 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[] { "x1", "y1" }) @@ -1167,8 +1168,9 @@ namespace HeavenStudio ((EntityTypes.DropdownObj)e["animator"]).SetValues(animators.Select(anim => { var obj = anim.gameObject; List path = new() { obj.name }; - while (obj.transform.parent != null && obj.transform.parent.name != game.name) + for (int i = 0; i < 10; i++) { + if (obj.transform.parent == null || obj.transform.parent.name == game.name) break; obj = obj.transform.parent.gameObject; path.Add(obj.name); } @@ -1177,7 +1179,7 @@ namespace HeavenStudio } return game?.displayName ?? "No Game"; }), "Get Animators", "Get all the animators in the current minigame scene. (Make sure to have the minigame you want loaded!)", new() { - new((x, _) => { Debug.Log(x.GetType()); return (string)x != "No Game"; }, "animator", "getAnimations") + new((x, _) => (string)x != "No Game", "animator", "getAnimations") }), new Param("animator", new EntityTypes.Dropdown(), "Animator", "Specify which animator in the scene to play an animation on."), new Param("getAnimations", new EntityTypes.Button("", e => { @@ -1189,16 +1191,17 @@ namespace HeavenStudio if (!string.IsNullOrEmpty(animPath)) { var animObj = gm.minigameObj.transform.Find(animPath); if (animObj != null && animObj.TryGetComponent(out animator) && animator != null) { - var animations = animator - .runtimeAnimatorController - .animationClips - .Select(x => x.name) - .ToList(); - ((EntityTypes.DropdownObj)e["animation"]).SetValues(animations); + List animationClips = new(); + foreach (var clip in animator.runtimeAnimatorController.animationClips) { + if (clip != null) { + animationClips.Add(clip.name); + } + } + ((EntityTypes.DropdownObj)e["animation"]).SetValues(animationClips); } } return animator != null ? animator.name : ""; - }), "Get Animations", "Get all the animators in the current minigame scene. (Make sure to have the minigame you want loaded!)", new() { + }), "Get Animations", "Get all the animations in the selected animator.", new() { new((x, _) => (string)x != "", "animation", "scale") }), new Param("animation", new EntityTypes.Dropdown(), "Animation", "Specify the name of the animation to play."), @@ -1213,18 +1216,24 @@ namespace HeavenStudio new List() { new Param("game", new EntityTypes.Dropdown(), "Which Game", "Specify the game's sfx to play. An empty input will play global sfx."), - new Param("getAnimations", new EntityTypes.Button("", e => { + new Param("getSfx", new EntityTypes.Button("", e => { string gameName = ((EntityTypes.DropdownObj)e["game"]).CurrentValue; - Minigame game = eventCaller.minigames[gameName]; - IEnumerable audioClips = game.GetCommonAssetBundle().LoadAllAssets(); - var localAssBun = game.GetLocalizedAssetBundle(); - if (localAssBun != null) { - audioClips = audioClips.Concat(localAssBun.LoadAllAssets()); + List clips; + if (eventCaller.minigames.TryGetValue(gameName, out Minigame game) && game != null) { + IEnumerable audioClips = game.GetCommonAssetBundle().LoadAllAssets(); + var localAssBun = game.GetLocalizedAssetBundle(); + if (localAssBun != null) { + audioClips = audioClips.Concat(localAssBun.LoadAllAssets()); + } + clips = audioClips.Select(x => x.name).ToList(); + } else { + // this is probably the best way to do it? + clips = new() { "applause", "metronome", "miss", "nearMiss", "perfectMiss", "skillStar" }; } EntityTypes.DropdownObj sfxDD = e["sfxName"]; - sfxDD.SetValues(audioClips.Select(x => x.name).ToList()); - return !string.IsNullOrEmpty(gameName) ? eventCaller.minigames[gameName]?.displayName : "N/A"; - }), "Get Animations", "Get all the animators in the current minigame scene. (Make sure to have the minigame you want loaded!)"), + sfxDD.SetValues(clips); + return game != null ? game.displayName : "Common"; + }), "Get SFX", "Get all the sfx in the selected minigame."), new Param("sfxName", new EntityTypes.Dropdown(), "SFX Name", "The name of the sfx to play."), new Param("pitch", new EntityTypes.Float(0, 5, 1), "Pitch", "The sfx's pitch."), new Param("offset", new EntityTypes.Integer(-500, 500), "Offset (ms)", "The sfx's offset in milliseconds."), @@ -1246,7 +1255,7 @@ namespace HeavenStudio // im so sorry eventCaller.minigames["advanced"].actions - .Find(a => a.actionName == "play sfx").parameters[0].parameter = new EntityTypes.Dropdown(0, eventCaller.minigames.Keys.Skip(defaultGames.Count).Concat(new string[] { "" }).ToArray()); + .Find(a => a.actionName == "play sfx").parameters[0].parameter = new EntityTypes.Dropdown(0, new string[] { "common" }.Concat(eventCaller.minigames.Keys.Skip(defaultGames.Count)).ToArray()); } } } \ No newline at end of file diff --git a/Assets/Scripts/Util/EntityTypes.cs b/Assets/Scripts/Util/EntityTypes.cs index 142713f37..4f954d9e9 100644 --- a/Assets/Scripts/Util/EntityTypes.cs +++ b/Assets/Scripts/Util/EntityTypes.cs @@ -95,7 +95,7 @@ namespace HeavenStudio } public int value; public List Values { get; private set; } - [JsonIgnore] public string CurrentValue => value < Values?.Count - 1 ? Values?[value] : null; + [JsonIgnore] public string CurrentValue => value < Values?.Count ? Values?[value] : null; [JsonIgnore] public Action> onValueChanged; public DropdownObj(int defaultValue = 0, List values = null)