From bccd88e164ba1d5a3b57662689b4207f0cbf343f Mon Sep 17 00:00:00 2001 From: minenice55 <43734252+minenice55@users.noreply.github.com> Date: Sun, 18 Sep 2022 16:48:14 -0400 Subject: [PATCH] Beatmap Sections & Latency Reduction (#170) * prep UI for chart section * all special layers now on one area todo: have buttons toggle between special layers (selection mode shows all?), use the tabs system for this * swapping between special timelines - prelim * special entities can be placed * spec. timeline base functions complete music volume changes should work now * attempt at input lag reduction needs testing * fix dsp issues * smaller DSP buffer? * Revert "smaller DSP buffer?" This reverts commit 9d36db5ff90cf4e2d7bb8db9b4b7376cb493e02b. * make conductor clock use real time (double) change order of execution of input-related scripts to further attempt a reduction in input latency * start values can be changed make the old special entity bar visible when the corresponding type is selected * creation of Chart Sections (TODO: GO REFERENCE) * added GO references * section edit dialog * disable wrapping on chart section obj * backspace can now delete entities * entities don't shift when duplicated * fix PlayerActionEvent order of operations - fixed remix loading trying to clear special timeline while it's writing to itself * make oop check match parity * more operation order fix * fix Karate Man BG initialization * show section progress in editor todo: section progress in-game * more fix for entity duping --- .../Resources/Sprites/Editor/UI/bookmark.png | Bin 0 -> 10260 bytes .../Sprites/Editor/UI/bookmark.png.meta | 108 + .../Sprites/Editor/UI/document-signed.png | Bin 0 -> 6698 bytes .../Editor/UI/document-signed.png.meta | 108 + Assets/Scenes/Editor.unity | 5048 +++++++++++++++-- Assets/Scripts/Conductor.cs | 9 +- Assets/Scripts/GameManager.cs | 92 +- Assets/Scripts/GameManager.cs.meta | 2 +- Assets/Scripts/Games/FanClub/NtrIdolFan.cs | 1 + Assets/Scripts/Games/KarateMan/KarateMan.cs | 44 +- Assets/Scripts/Games/Minigame.cs | 8 +- Assets/Scripts/Games/PlayerActionEvent.cs | 1 + .../Scripts/Games/PlayerActionEvent.cs.meta | 2 +- Assets/Scripts/GlobalGameManager.cs | 1 + Assets/Scripts/LevelEditor/Commands/Block.cs | 2 +- Assets/Scripts/LevelEditor/Editor.cs | 8 +- Assets/Scripts/LevelEditor/EditorTheme.cs | 6 + .../EventSelector/GridGameSelector.cs | 5 +- Assets/Scripts/LevelEditor/Theme.cs | 2 + .../LevelEditor/Timeline/SpecialTmeline.meta | 8 + .../Timeline/SpecialTmeline/SectionDialog.cs | 51 + .../SectionDialog.cs.meta} | 2 +- .../SpecialTmeline/SpecialTimeline.cs | 229 + .../SpecialTimeline.cs.meta} | 2 +- .../Timeline/SpecialTmeline/Tabs.meta | 8 + .../SpecialTmeline/Tabs/SpecialTimelineAll.cs | 31 + .../Tabs/SpecialTimelineAll.cs.meta | 11 + .../Tabs/SpecialTimelineSection.cs | 31 + .../Tabs/SpecialTimelineSection.cs.meta | 11 + .../Tabs/SpecialTimelineTempo.cs | 31 + .../Tabs/SpecialTimelineTempo.cs.meta | 11 + .../Tabs/SpecialTimelineVolume.cs | 31 + .../Tabs/SpecialTimelineVolume.cs.meta | 11 + .../Timeline/SpecialTmeline/TimelineObjs.meta | 8 + .../TimelineObjs/SectionTimelineObj.cs | 92 + .../TimelineObjs/SectionTimelineObj.cs.meta | 11 + .../TimelineObjs/SpecialTimelineObj.cs | 103 + .../TimelineObjs/SpecialTimelineObj.cs.meta | 11 + .../TimelineObjs/TempoTimelineObj.cs | 98 + .../TimelineObjs}/TempoTimelineObj.cs.meta | 0 .../TimelineObjs/VolumeTimelineObj.cs | 96 + .../TimelineObjs}/VolumeTimelineObj.cs.meta | 2 +- .../LevelEditor/Timeline/TempoTimeline.cs | 180 - .../LevelEditor/Timeline/TempoTimelineObj.cs | 106 - .../Scripts/LevelEditor/Timeline/Timeline.cs | 221 +- .../LevelEditor/Timeline/TimelineEventObj.cs | 23 +- .../LevelEditor/Timeline/VolumeTimeline.cs | 89 - .../LevelEditor/Timeline/VolumeTimelineObj.cs | 105 - Assets/Scripts/LevelEditor/editortheme.json | 3 + ProjectSettings/AudioManager.asset | 6 +- ProjectSettings/ProjectSettings.asset | 4 +- 51 files changed, 5944 insertions(+), 1129 deletions(-) create mode 100644 Assets/Resources/Sprites/Editor/UI/bookmark.png create mode 100644 Assets/Resources/Sprites/Editor/UI/bookmark.png.meta create mode 100644 Assets/Resources/Sprites/Editor/UI/document-signed.png create mode 100644 Assets/Resources/Sprites/Editor/UI/document-signed.png.meta create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline.meta create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SectionDialog.cs rename Assets/Scripts/LevelEditor/Timeline/{VolumeTimeline.cs.meta => SpecialTmeline/SectionDialog.cs.meta} (83%) create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SpecialTimeline.cs rename Assets/Scripts/LevelEditor/Timeline/{TempoTimeline.cs.meta => SpecialTmeline/SpecialTimeline.cs.meta} (83%) create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs.meta create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineAll.cs create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineAll.cs.meta create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineSection.cs create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineSection.cs.meta create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineTempo.cs create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineTempo.cs.meta create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineVolume.cs create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineVolume.cs.meta create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs.meta create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SectionTimelineObj.cs create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SectionTimelineObj.cs.meta create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SpecialTimelineObj.cs create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SpecialTimelineObj.cs.meta create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/TempoTimelineObj.cs rename Assets/Scripts/LevelEditor/Timeline/{ => SpecialTmeline/TimelineObjs}/TempoTimelineObj.cs.meta (100%) create mode 100644 Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/VolumeTimelineObj.cs rename Assets/Scripts/LevelEditor/Timeline/{ => SpecialTmeline/TimelineObjs}/VolumeTimelineObj.cs.meta (83%) delete mode 100644 Assets/Scripts/LevelEditor/Timeline/TempoTimeline.cs delete mode 100644 Assets/Scripts/LevelEditor/Timeline/TempoTimelineObj.cs delete mode 100644 Assets/Scripts/LevelEditor/Timeline/VolumeTimeline.cs delete mode 100644 Assets/Scripts/LevelEditor/Timeline/VolumeTimelineObj.cs diff --git a/Assets/Resources/Sprites/Editor/UI/bookmark.png b/Assets/Resources/Sprites/Editor/UI/bookmark.png new file mode 100644 index 0000000000000000000000000000000000000000..b47bf1a31da02437445f37ee36250e7b606037cd GIT binary patch literal 10260 zcmeHt`9IX_`~Ur#M&4wpNl~`WyCx*t(IR1-c0+`aebSf@_X%{F2}r`^|g( znex)vE~^F^%}ghY$pt!9{l@Y5yT(q|lTGxyFS1i3?FmenyvN4X6~?X8&$BRr7Ie5atE5|YmC)3-sIh3CL^Ae*nGNi zmm?uaU`s^a-CK#$vCr+U*%?IzO&3VhbkdneYKMse{XJ-?TrpP8@n`VYzm?Bm_u7Wr zcGxnvCHz_y*;Y>siSlP`Yq=%-`v#g{bJrm8S#+7^9+c$cQM-;<8qL$(v!H$u%W<(Vq03(BTTuXXMOEdZKiRcf^0x@4KANj z8$vd)nC$$DXg8*>)>aS`l|x4)r;l`t8a^NFE*yw%5k*J(!|CqiaE7&hV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(6x zp2yA!JTInkVWq9LRX&Qd!45Knqd)|N-wMP}BG@_HFKUDZM&zfXrQEETn(yuE)7s?4 zlguR-vtP$+>0=9IbjU=kuwr=os!3DgRbBm+(V6NTD945=0gtBaa9aFoEwetV|IHhd zAJi!~!VeBx4ilaiwxXc&Ybs)%G?*Vpq5rSC?mr_t`-f#{?uMUr<;N#>-Tlu&(pJKA zTA*xabw0+s>a;fE!dQKDZ<$xy>;a onBeatChanged; + public event Action onBeatChanged; + public event Action onSectionChange; public int BeatmapEntities() { - return Beatmap.entities.Count + Beatmap.tempoChanges.Count; + return Beatmap.entities.Count + Beatmap.tempoChanges.Count + Beatmap.volumeChanges.Count + Beatmap.beatmapSections.Count; } public static GameManager instance { get; private set; } @@ -218,22 +227,47 @@ namespace HeavenStudio return; if (!Conductor.instance.isPlaying) return; + List entities = Beatmap.entities.Select(c => c.beat).ToList(); - List tempoChanges = Beatmap.tempoChanges.Select(c => c.beat).ToList(); + List tempoChanges = Beatmap.tempoChanges.Select(c => c.beat).ToList(); if (currentTempoEvent < Beatmap.tempoChanges.Count && currentTempoEvent >= 0) { - // Debug.Log("Checking Tempo Change at " + tempoChanges[currentTempoEvent] + ", current beat " + Conductor.instance.songPositionInBeats); if (Conductor.instance.songPositionInBeats >= tempoChanges[currentTempoEvent]) { - // Debug.Log("Tempo Change at " + Conductor.instance.songPositionInBeats + " of bpm " + DynamicBeatmap.tempoChanges[currentTempoEvent].tempo); Conductor.instance.SetBpm(Beatmap.tempoChanges[currentTempoEvent].tempo); Conductor.instance.timeSinceLastTempoChange = Time.time; currentTempoEvent++; } } + List volumeChanges = Beatmap.volumeChanges.Select(c => c.beat).ToList(); + if (currentVolumeEvent < Beatmap.volumeChanges.Count && currentVolumeEvent >= 0) + { + if (Conductor.instance.songPositionInBeats >= volumeChanges[currentVolumeEvent]) + { + Conductor.instance.SetVolume(Beatmap.volumeChanges[currentVolumeEvent].volume); + currentVolumeEvent++; + } + } + + List chartSections = Beatmap.beatmapSections.Select(c => c.beat).ToList(); + if (currentSectionEvent < Beatmap.beatmapSections.Count && currentSectionEvent >= 0) + { + if (Conductor.instance.songPositionInBeats >= chartSections[currentSectionEvent]) + { + Debug.Log("Section " + Beatmap.beatmapSections[currentSectionEvent].sectionName + " started"); + currentSection = Beatmap.beatmapSections[currentSectionEvent]; + currentSectionEvent++; + if (currentSectionEvent < Beatmap.beatmapSections.Count) + nextSection = Beatmap.beatmapSections[currentSectionEvent]; + else + nextSection = null; + onSectionChange?.Invoke(currentSection); + } + } + float seekTime = 8f; //seek ahead to preload games that have assetbundles SeekAheadAndPreload(Conductor.instance.songPositionInBeats, seekTime); @@ -273,6 +307,8 @@ namespace HeavenStudio // currentEvent += gameManagerEntities.Count; } } + + } public void ToggleInputs(bool inputs) @@ -305,6 +341,10 @@ namespace HeavenStudio } KillAllSounds(); + + Minigame miniGame = currentGameO.GetComponent(); + if (miniGame != null) + miniGame.OnPlay(beat); } public void Pause() @@ -389,10 +429,17 @@ namespace HeavenStudio { SetGame(newGame); } + + List allEnds = EventCaller.GetAllInGameManagerList("gameManager", new string[] { "end" }); + if (allEnds.Count > 0) + endBeat = allEnds.Select(c => c.beat).Min(); + else + endBeat = Conductor.instance.SongLengthInBeats(); } else { SetGame("noGame"); + endBeat = Conductor.instance.SongLengthInBeats(); } if (Beatmap.tempoChanges.Count > 0) @@ -413,6 +460,39 @@ namespace HeavenStudio // Debug.Log("currentTempoEvent is now " + currentTempoEvent); } + if (Beatmap.volumeChanges.Count > 0) + { + currentVolumeEvent = 0; + List volumeChanges = Beatmap.volumeChanges.Select(c => c.beat).ToList(); + + for (int t = 0; t < volumeChanges.Count; t++) + { + if (volumeChanges[t] > beat) + { + break; + } + currentVolumeEvent = t; + } + } + + currentSection = null; + nextSection = null; + if (Beatmap.beatmapSections.Count > 0) + { + currentSectionEvent = 0; + List beatmapSections = Beatmap.beatmapSections.Select(c => c.beat).ToList(); + + for (int t = 0; t < beatmapSections.Count; t++) + { + if (beatmapSections[t] > beat) + { + break; + } + currentSectionEvent = t; + } + } + onSectionChange?.Invoke(currentSection); + SeekAheadAndPreload(beat); } diff --git a/Assets/Scripts/GameManager.cs.meta b/Assets/Scripts/GameManager.cs.meta index bf2338a7..e772e389 100644 --- a/Assets/Scripts/GameManager.cs.meta +++ b/Assets/Scripts/GameManager.cs.meta @@ -4,7 +4,7 @@ MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] - executionOrder: -43 + executionOrder: -44 icon: {instanceID: 0} userData: assetBundleName: diff --git a/Assets/Scripts/Games/FanClub/NtrIdolFan.cs b/Assets/Scripts/Games/FanClub/NtrIdolFan.cs index b29ddb52..a71e043e 100644 --- a/Assets/Scripts/Games/FanClub/NtrIdolFan.cs +++ b/Assets/Scripts/Games/FanClub/NtrIdolFan.cs @@ -135,6 +135,7 @@ namespace HeavenStudio.Games.Scripts_FanClub float yWeight = -(yMul*yMul) + 1f; motionRoot.transform.localPosition = new Vector3(0, 3f * yWeight); shadow.transform.localScale = new Vector3((1f-yWeight*0.8f) * 1.4f, (1f-yWeight*0.8f) * 1.4f, 1f); + animator.Play("FanJump", -1, 0); } else { diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs index 93c8ccac..ab92c462 100644 --- a/Assets/Scripts/Games/KarateMan/KarateMan.cs +++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs @@ -446,8 +446,24 @@ namespace HeavenStudio.Games cameraPosition = CameraPosition[0].position; } + public override void OnPlay(float beat) + { + var cond = Conductor.instance; + if (!cond.isPlaying) + { + SetBgEffectsToLast(beat); + // remove all children of the ItemHolder + foreach (Transform child in ItemHolder) + { + Destroy(child.gameObject); + } + } + } + private void Start() { + var cond = Conductor.instance; + GameCamera.additionalPosition = cameraPosition - GameCamera.defaultPosition; bgEffectAnimator = BGEffect.GetComponent(); bgEffectSpriteRenderer = BGEffect.GetComponent(); @@ -456,7 +472,8 @@ namespace HeavenStudio.Games bgBloodRenderer = BGBlood.GetComponent(); bgRadialRenderer = BGRadial.GetComponent(); - SetBgAndShadowCol(WantBgChangeStart, WantBgChangeLength, bgType, (int) currentShadowType, BackgroundColors[bgType], customShadowColour, (int)currentBgEffect); + SetBgEffectsToLast(cond.songPositionInBeats); + SetBgAndShadowCol(WantBgChangeStart, WantBgChangeLength, bgType, (int) currentShadowType, bgColour, customShadowColour, (int)currentBgEffect); SetBgTexture(textureType, textureFilterType, filterColour, filterColour); UpdateMaterialColour(BodyColor, HighlightColor, ItemColor); ToggleBop(WantBop); @@ -806,10 +823,10 @@ namespace HeavenStudio.Games var e = bgfx[i]; if (e.beat > beat) break; - SetBgAndShadowCol(e.beat, e.length, e["type"], e["type2"], e["colorA"], e["colorB"], e["type3"]); - SetBgTexture(e["type4"], e["type5"], e["colorC"], e["colorD"]); + SetBgEffectsUnloaded(e.beat, e.length, e["type"], e["type2"], e["colorA"], e["colorB"], e["type3"], e["type4"], e["type5"], e["colorC"], e["colorD"]); } var camfx = GameManager.instance.Beatmap.entities.FindAll(en => en.datamodel == "karateman/special camera"); + DoSpecialCamera(0, 0, true); for (int i = 0; i < camfx.Count; i++) { var e = camfx[i]; @@ -817,17 +834,16 @@ namespace HeavenStudio.Games break; DoSpecialCamera(e.beat, e.length, e["toggle"]); } - // has issues when creating a new hitx entity so this is deactivated for now - // var hitx = GameManager.instance.Beatmap.entities.FindAll(en => en.datamodel == "karateman/hitX"); - // for (int i = 0; i < hitx.Count; i++) - // { - // var e = hitx[i]; - // if (e.beat > beat) - // break; - // Debug.Log("hitx"); - // DoWord(e.beat, e["type"], false); - // } - + var objfx = GameManager.instance.Beatmap.entities.FindAll(en => en.datamodel == "karateman/set object colors"); + for (int i = 0; i < objfx.Count; i++) + { + var e = objfx[i]; + if (e.beat > beat) + break; + UpdateMaterialColour(e["colorA"], e["colorB"], e["colorC"]); + } + SetBgAndShadowCol(WantBgChangeStart, WantBgChangeLength, bgType, (int) currentShadowType, bgColour, customShadowColour, (int)currentBgEffect); + SetBgTexture(textureType, textureFilterType, filterColour, filterColour); } public static void SetBgEffectsUnloaded(float beat, float length, int newBgType, int newShadowType, Color bgCol, Color shadowCol, int bgFx, int texture, int textureFilter, Color filterCol, Color filterColNext) diff --git a/Assets/Scripts/Games/Minigame.cs b/Assets/Scripts/Games/Minigame.cs index f2cfef12..558bd1aa 100644 --- a/Assets/Scripts/Games/Minigame.cs +++ b/Assets/Scripts/Games/Minigame.cs @@ -6,7 +6,7 @@ namespace HeavenStudio.Games { public class Minigame : MonoBehaviour { - public static float earlyTime = 0.1f, perfectTime = 0.08f, aceEarlyTime = 0.02f, aceLateTime = 0.02f, lateTime = 0.08f, endTime = 0.1f; + public static float earlyTime = 0.1f, perfectTime = 0.08f, aceEarlyTime = 0.025f, aceLateTime = 0.025f, lateTime = 0.08f, endTime = 0.1f; public List EligibleHits = new List(); [System.Serializable] @@ -132,7 +132,6 @@ namespace HeavenStudio.Games { PlayerActionEvent input = GetClosestScheduledInput(); if (input == null) return false; - return input.IsExpectingInputNow(); } @@ -190,6 +189,11 @@ namespace HeavenStudio.Games } + public virtual void OnPlay(float beat) + { + + } + public int MultipleEventsAtOnce() { int sameTime = 0; diff --git a/Assets/Scripts/Games/PlayerActionEvent.cs b/Assets/Scripts/Games/PlayerActionEvent.cs index 83f2b217..f9e48c26 100644 --- a/Assets/Scripts/Games/PlayerActionEvent.cs +++ b/Assets/Scripts/Games/PlayerActionEvent.cs @@ -52,6 +52,7 @@ namespace HeavenStudio.Games this.canHit = canHit; } + public void Update() { if(!Conductor.instance.NotStopped()){CleanUp();} // If the song is stopped entirely in the editor, destroy itself as we don't want duplicates diff --git a/Assets/Scripts/Games/PlayerActionEvent.cs.meta b/Assets/Scripts/Games/PlayerActionEvent.cs.meta index bd61831d..62a52734 100644 --- a/Assets/Scripts/Games/PlayerActionEvent.cs.meta +++ b/Assets/Scripts/Games/PlayerActionEvent.cs.meta @@ -4,7 +4,7 @@ MonoImporter: externalObjects: {} serializedVersion: 2 defaultReferences: [] - executionOrder: 0 + executionOrder: 5 icon: {instanceID: 0} userData: assetBundleName: diff --git a/Assets/Scripts/GlobalGameManager.cs b/Assets/Scripts/GlobalGameManager.cs index 5492cab1..a39a0d4d 100644 --- a/Assets/Scripts/GlobalGameManager.cs +++ b/Assets/Scripts/GlobalGameManager.cs @@ -59,6 +59,7 @@ namespace HeavenStudio DontDestroyOnLoad(this.gameObject); instance = this; Starpelly.OS.ChangeWindowTitle("Heaven Studio DEMO"); + QualitySettings.maxQueuedFrames = 1; PlayerInput.InitInputControllers(); } diff --git a/Assets/Scripts/LevelEditor/Commands/Block.cs b/Assets/Scripts/LevelEditor/Commands/Block.cs index 4d7edbb5..b98aa0ed 100644 --- a/Assets/Scripts/LevelEditor/Commands/Block.cs +++ b/Assets/Scripts/LevelEditor/Commands/Block.cs @@ -64,7 +64,7 @@ namespace HeavenStudio.Editor.Commands { Pos p = new Pos(); p.eventObj = eventObjs[i]; - p.lastPos_ = eventObjs[i].lastPos_; + p.lastPos_ = eventObjs[i].moveStartPos; p.previousPos = eventObjs[i].transform.localPosition; this.pos.Add(p); } diff --git a/Assets/Scripts/LevelEditor/Editor.cs b/Assets/Scripts/LevelEditor/Editor.cs index 3645aca8..70db292e 100644 --- a/Assets/Scripts/LevelEditor/Editor.cs +++ b/Assets/Scripts/LevelEditor/Editor.cs @@ -134,7 +134,7 @@ namespace HeavenStudio.Editor Fullscreen(); } - if (Input.GetKeyDown(KeyCode.Delete)) + if (Input.GetKeyDown(KeyCode.Delete) || Input.GetKeyDown(KeyCode.Backspace)) { List ev = new List(); for (int i = 0; i < Selections.instance.eventsSelected.Count; i++) ev.Add(Selections.instance.eventsSelected[i]); @@ -409,9 +409,9 @@ namespace HeavenStudio.Editor { GameManager.instance.LoadRemix(json, type); Timeline.instance.LoadRemix(); - Timeline.instance.TempoInfo.UpdateStartingBPMText(); - Timeline.instance.VolumeInfo.UpdateStartingVolumeText(); - Timeline.instance.TempoInfo.UpdateOffsetText(); + // Timeline.instance.SpecialInfo.UpdateStartingBPMText(); + // Timeline.instance.VolumeInfo.UpdateStartingVolumeText(); + // Timeline.instance.SpecialInfo.UpdateOffsetText(); Timeline.FitToSong(); currentRemixPath = string.Empty; diff --git a/Assets/Scripts/LevelEditor/EditorTheme.cs b/Assets/Scripts/LevelEditor/EditorTheme.cs index 71b906e3..effab54e 100644 --- a/Assets/Scripts/LevelEditor/EditorTheme.cs +++ b/Assets/Scripts/LevelEditor/EditorTheme.cs @@ -19,8 +19,10 @@ namespace HeavenStudio.Editor [Header("Components")] [SerializeField] private Image layer; + [SerializeField] private Image specialLayers; [SerializeField] private Image tempoLayer; [SerializeField] private Image musicLayer; + [SerializeField] private Image sectionLayer; private void Awake() { @@ -29,10 +31,14 @@ namespace HeavenStudio.Editor private void Start() { + specialLayers.GetComponent().color = theme.properties.SpecialLayersCol.Hex2RGB(); tempoLayer.GetComponent().color = theme.properties.TempoLayerCol.Hex2RGB(); musicLayer.GetComponent().color = theme.properties.MusicLayerCol.Hex2RGB(); + sectionLayer.GetComponent().color = theme.properties.SectionLayerCol.Hex2RGB(); + Tooltip.AddTooltip(specialLayers.gameObject, $"All Special Tracks"); Tooltip.AddTooltip(tempoLayer.gameObject, $"Tempo Track"); Tooltip.AddTooltip(musicLayer.gameObject, $"Music Volume Track"); + Tooltip.AddTooltip(sectionLayer.gameObject, $"Remix Sections Track"); layer.gameObject.SetActive(false); diff --git a/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs b/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs index b5147b65..024d58c4 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs @@ -183,10 +183,11 @@ namespace HeavenStudio.Editor public void Drag() { - if (Conductor.instance.NotStopped() || !Timeline.instance.timelineState.selected) return; - + if (Conductor.instance.NotStopped() || Editor.instance.inAuthorativeMenu) return; + if (Timeline.instance.CheckIfMouseInTimeline() && dragTimes < 1) { + Timeline.instance.timelineState.SetState(Timeline.CurrentTimelineState.State.Selection); dragTimes++; TimelineEventObj eventObj; diff --git a/Assets/Scripts/LevelEditor/Theme.cs b/Assets/Scripts/LevelEditor/Theme.cs index 2b838da9..af8124d7 100644 --- a/Assets/Scripts/LevelEditor/Theme.cs +++ b/Assets/Scripts/LevelEditor/Theme.cs @@ -12,8 +12,10 @@ namespace HeavenStudio.Editor [Serializable] public class Properties { + public string SpecialLayersCol; public string TempoLayerCol; public string MusicLayerCol; + public string SectionLayerCol; public string Layer1Col; public string Layer2Col; diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline.meta b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline.meta new file mode 100644 index 00000000..c45f313a --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a7de3a0880c755a48a30d4e4f740c68c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SectionDialog.cs b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SectionDialog.cs new file mode 100644 index 00000000..51af13c0 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SectionDialog.cs @@ -0,0 +1,51 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +using HeavenStudio; +using HeavenStudio.Editor; +using HeavenStudio.Editor.Track; +using TMPro; + +public class SectionDialog : Dialog +{ + SectionTimelineObj sectionObj; + [SerializeField] TMP_InputField sectionName; + + public void SwitchSectionDialog() + { + if(dialog.activeSelf) { + sectionObj = null; + dialog.SetActive(false); + Editor.instance.inAuthorativeMenu = false; + } else { + Editor.instance.inAuthorativeMenu = true; + ResetAllDialogs(); + dialog.SetActive(true); + } + } + + public void SetSectionObj(SectionTimelineObj sectionObj) + { + this.sectionObj = sectionObj; + sectionName.text = sectionObj.chartSection.sectionName; + } + + public void DeleteSection() + { + if(dialog.activeSelf) { + dialog.SetActive(false); + Editor.instance.inAuthorativeMenu = false; + } + if (sectionObj == null) return; + GameManager.instance.Beatmap.beatmapSections.Remove(sectionObj.chartSection); + sectionObj.DeleteObj(); + } + + public void ChangeSectionName(string name) + { + if (sectionObj == null) return; + sectionObj.chartSection.sectionName = name; + sectionObj.UpdateLabel(); + } +} diff --git a/Assets/Scripts/LevelEditor/Timeline/VolumeTimeline.cs.meta b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SectionDialog.cs.meta similarity index 83% rename from Assets/Scripts/LevelEditor/Timeline/VolumeTimeline.cs.meta rename to Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SectionDialog.cs.meta index 211eb273..365c16cf 100644 --- a/Assets/Scripts/LevelEditor/Timeline/VolumeTimeline.cs.meta +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SectionDialog.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: ea7831ec549a9984c8c3e5afd98bac2f +guid: 7e5d39fb5bc171f44ba013cf8e37fdd2 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SpecialTimeline.cs b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SpecialTimeline.cs new file mode 100644 index 00000000..4e68a185 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SpecialTimeline.cs @@ -0,0 +1,229 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.UI; +using System; + +using TMPro; +using Starpelly; + +namespace HeavenStudio.Editor.Track +{ + public class SpecialTimeline : MonoBehaviour + { + [Header("References")] + [SerializeField] private RectTransform RefTempoChange; + [SerializeField] private RectTransform RefVolumeChange; + [SerializeField] private RectTransform RefSectionChange; + + [Header("Components")] + private RectTransform rectTransform; + + public List specialTimelineObjs = new List(); + + [System.Flags] + public enum HoveringTypes + { + TempoChange = 1, + VolumeChange = 2, + SectionChange = 4, + } + public static HoveringTypes hoveringTypes = 0; + + private bool firstUpdate; + + public static SpecialTimeline instance; + + private void Start() + { + instance = this; + rectTransform = this.GetComponent(); + + Setup(); + } + + public void Setup() + { + ClearSpecialTimeline(); + + foreach (var tempoChange in GameManager.instance.Beatmap.tempoChanges) + AddTempoChange(false, tempoChange); + + foreach (var volumeChange in GameManager.instance.Beatmap.volumeChanges) + AddVolumeChange(false, volumeChange); + + foreach (var sectionChange in GameManager.instance.Beatmap.beatmapSections) + AddChartSection(false, sectionChange); + + Timeline.instance.timelineState.SetState(Timeline.CurrentTimelineState.State.Selection); + FixObjectsVisibility(); + } + + private void Update() + { + if (!firstUpdate) + { + hoveringTypes = 0; + firstUpdate = true; + } + + if (Timeline.instance.userIsEditingInputField || Editor.instance.inAuthorativeMenu) + return; + + if (!Conductor.instance.NotStopped()) + { + if (RectTransformUtility.RectangleContainsScreenPoint(rectTransform, Input.mousePosition, Editor.instance.EditorCamera)) + { + if (Input.GetMouseButtonDown(0)) + { + switch (Timeline.instance.timelineState.currentState) + { + case Timeline.CurrentTimelineState.State.TempoChange: + if (!hoveringTypes.HasFlag(HoveringTypes.TempoChange)) + AddTempoChange(true); + break; + case Timeline.CurrentTimelineState.State.MusicVolume: + if (!hoveringTypes.HasFlag(HoveringTypes.VolumeChange)) + AddVolumeChange(true); + break; + case Timeline.CurrentTimelineState.State.ChartSection: + if (!hoveringTypes.HasFlag(HoveringTypes.SectionChange)) + AddChartSection(true); + break; + } + } + } + } + hoveringTypes = 0; + } + + public void FixObjectsVisibility() + { + foreach (SpecialTimelineObj obj in specialTimelineObjs) + { + obj.SetVisibility(Timeline.instance.timelineState.currentState); + } + } + + public void ClearSpecialTimeline() + { + foreach (SpecialTimelineObj obj in specialTimelineObjs) + { + Destroy(obj.gameObject); + } + specialTimelineObjs.Clear(); + } + + public void AddTempoChange(bool create, DynamicBeatmap.TempoChange tempoChange_ = null) + { + GameObject tempoChange = Instantiate(RefTempoChange.gameObject, this.transform); + + tempoChange.transform.GetChild(0).GetComponent().color = EditorTheme.theme.properties.TempoLayerCol.Hex2RGB(); + tempoChange.transform.GetChild(1).GetComponent().color = EditorTheme.theme.properties.TempoLayerCol.Hex2RGB(); + tempoChange.transform.GetChild(2).GetComponent().color = EditorTheme.theme.properties.TempoLayerCol.Hex2RGB(); + + tempoChange.SetActive(true); + + TempoTimelineObj tempoTimelineObj = tempoChange.GetComponent(); + + if (create == true) + { + tempoChange.transform.position = new Vector3(Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition).x + 0.08f, tempoChange.transform.position.y); + tempoChange.transform.localPosition = new Vector3(Starpelly.Mathp.Round2Nearest(tempoChange.transform.localPosition.x, Timeline.SnapInterval()), tempoChange.transform.localPosition.y); + + DynamicBeatmap.TempoChange tempoC = new DynamicBeatmap.TempoChange(); + tempoC.beat = tempoChange.transform.localPosition.x; + tempoC.tempo = GameManager.instance.Beatmap.bpm; + + tempoTimelineObj.tempoChange = tempoC; + GameManager.instance.Beatmap.tempoChanges.Add(tempoC); + } + else + { + tempoChange.transform.localPosition = new Vector3(tempoChange_.beat, tempoChange.transform.localPosition.y); + + tempoTimelineObj.tempoChange = tempoChange_; + } + tempoTimelineObj.SetVisibility(Timeline.instance.timelineState.currentState); + + specialTimelineObjs.Add(tempoTimelineObj); + + Timeline.instance.FitToSong(); + } + + public void AddVolumeChange(bool create, DynamicBeatmap.VolumeChange volumeChange_ = null) + { + GameObject volumeChange = Instantiate(RefVolumeChange.gameObject, this.transform); + + volumeChange.transform.GetChild(0).GetComponent().color = EditorTheme.theme.properties.MusicLayerCol.Hex2RGB(); + volumeChange.transform.GetChild(1).GetComponent().color = EditorTheme.theme.properties.MusicLayerCol.Hex2RGB(); + volumeChange.transform.GetChild(2).GetComponent().color = EditorTheme.theme.properties.MusicLayerCol.Hex2RGB(); + + volumeChange.SetActive(true); + + VolumeTimelineObj volumeTimelineObj = volumeChange.GetComponent(); + + if (create == true) + { + volumeChange.transform.position = new Vector3(Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition).x + 0.08f, volumeChange.transform.position.y); + volumeChange.transform.localPosition = new Vector3(Starpelly.Mathp.Round2Nearest(volumeChange.transform.localPosition.x, Timeline.SnapInterval()), volumeChange.transform.localPosition.y); + + DynamicBeatmap.VolumeChange volumeC = new DynamicBeatmap.VolumeChange(); + volumeC.beat = volumeChange.transform.localPosition.x; + volumeC.volume = GameManager.instance.Beatmap.musicVolume; + + volumeTimelineObj.volumeChange = volumeC; + GameManager.instance.Beatmap.volumeChanges.Add(volumeC); + } + else + { + volumeChange.transform.localPosition = new Vector3(volumeChange_.beat, volumeChange.transform.localPosition.y); + + volumeTimelineObj.volumeChange = volumeChange_; + } + volumeTimelineObj.SetVisibility(Timeline.instance.timelineState.currentState); + + specialTimelineObjs.Add(volumeTimelineObj); + } + + public void AddChartSection(bool create, DynamicBeatmap.ChartSection chartSection_ = null) + { + GameObject chartSection = Instantiate(RefSectionChange.gameObject, this.transform); + + chartSection.transform.GetChild(0).GetComponent().color = EditorTheme.theme.properties.SectionLayerCol.Hex2RGB(); + chartSection.transform.GetChild(1).GetComponent().color = EditorTheme.theme.properties.SectionLayerCol.Hex2RGB(); + chartSection.transform.GetChild(2).GetComponent().color = EditorTheme.theme.properties.SectionLayerCol.Hex2RGB(); + chartSection.transform.GetChild(3).GetComponent().color = EditorTheme.theme.properties.SectionLayerCol.Hex2RGB(); + + chartSection.SetActive(true); + + SectionTimelineObj sectionTimelineObj = chartSection.GetComponent(); + + if (create == true) + { + chartSection.transform.position = new Vector3(Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition).x + 0.08f, chartSection.transform.position.y); + chartSection.transform.localPosition = new Vector3(Starpelly.Mathp.Round2Nearest(chartSection.transform.localPosition.x, Timeline.SnapInterval()), chartSection.transform.localPosition.y); + + DynamicBeatmap.ChartSection sectionC = new DynamicBeatmap.ChartSection(); + sectionC.beat = chartSection.transform.localPosition.x; + sectionC.sectionName = "New Section"; + sectionC.startPerfect = false; + sectionC.isCheckpoint = false; + + sectionTimelineObj.chartSection = sectionC; + GameManager.instance.Beatmap.beatmapSections.Add(sectionC); + } + else + { + chartSection.transform.localPosition = new Vector3(chartSection_.beat, chartSection.transform.localPosition.y); + + sectionTimelineObj.chartSection = chartSection_; + } + sectionTimelineObj.SetVisibility(Timeline.instance.timelineState.currentState); + + specialTimelineObjs.Add(sectionTimelineObj); + //auto-open the dialog + sectionTimelineObj.OnRightClick(); + } + } +} diff --git a/Assets/Scripts/LevelEditor/Timeline/TempoTimeline.cs.meta b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SpecialTimeline.cs.meta similarity index 83% rename from Assets/Scripts/LevelEditor/Timeline/TempoTimeline.cs.meta rename to Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SpecialTimeline.cs.meta index c0b3f9ee..31fa0a0b 100644 --- a/Assets/Scripts/LevelEditor/Timeline/TempoTimeline.cs.meta +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/SpecialTimeline.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 10dd19278a802c24fbeb39d1ccb23219 +guid: 364cfb513d7ef744cb0d4828804188e0 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs.meta b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs.meta new file mode 100644 index 00000000..476ccf70 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 46f4e0c7199fe9648bcc8cc5c601cdf3 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineAll.cs b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineAll.cs new file mode 100644 index 00000000..969596f5 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineAll.cs @@ -0,0 +1,31 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using HeavenStudio.Editor.Track; + +namespace HeavenStudio.Editor +{ + public class SpecialTimelineAll : TabsContent + { + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } + + public override void OnOpenTab() + { + SpecialTimeline.instance.FixObjectsVisibility(); + } + + public override void OnCloseTab() + { + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineAll.cs.meta b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineAll.cs.meta new file mode 100644 index 00000000..8b34cc28 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineAll.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e15bb84f43093e94d8360fa51074bb97 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineSection.cs b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineSection.cs new file mode 100644 index 00000000..c5ebaa38 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineSection.cs @@ -0,0 +1,31 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using HeavenStudio.Editor.Track; + +namespace HeavenStudio.Editor +{ + public class SpecialTimelineSection : TabsContent + { + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } + + public override void OnOpenTab() + { + SpecialTimeline.instance.FixObjectsVisibility(); + } + + public override void OnCloseTab() + { + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineSection.cs.meta b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineSection.cs.meta new file mode 100644 index 00000000..dbc21b68 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineSection.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: e528ff67df36f6242bd525e4b3911f4e +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineTempo.cs b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineTempo.cs new file mode 100644 index 00000000..cf9363dd --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineTempo.cs @@ -0,0 +1,31 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using HeavenStudio.Editor.Track; + +namespace HeavenStudio.Editor +{ + public class SpecialTimelineTempo : TabsContent + { + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } + + public override void OnOpenTab() + { + SpecialTimeline.instance.FixObjectsVisibility(); + } + + public override void OnCloseTab() + { + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineTempo.cs.meta b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineTempo.cs.meta new file mode 100644 index 00000000..ed6fc405 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineTempo.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 8b802d26536208b4b9ca9994187788a9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineVolume.cs b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineVolume.cs new file mode 100644 index 00000000..84fa3f63 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineVolume.cs @@ -0,0 +1,31 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using HeavenStudio.Editor.Track; + +namespace HeavenStudio.Editor +{ + public class SpecialTimelineVolume : TabsContent + { + // Start is called before the first frame update + void Start() + { + + } + + // Update is called once per frame + void Update() + { + + } + + public override void OnOpenTab() + { + SpecialTimeline.instance.FixObjectsVisibility(); + } + + public override void OnCloseTab() + { + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineVolume.cs.meta b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineVolume.cs.meta new file mode 100644 index 00000000..df10c64a --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/Tabs/SpecialTimelineVolume.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 01f0c8cfacd823a40a2f3cc7d01ac78a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs.meta b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs.meta new file mode 100644 index 00000000..c11384b4 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c80527f878ac1594bb0eedc6884a3a5f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SectionTimelineObj.cs b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SectionTimelineObj.cs new file mode 100644 index 00000000..bde055fa --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SectionTimelineObj.cs @@ -0,0 +1,92 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +using TMPro; + +using DG.Tweening; + +namespace HeavenStudio.Editor.Track +{ + public class SectionTimelineObj : SpecialTimelineObj + { + [Header("Components")] + [SerializeField] private TMP_Text sectionLabel; + [SerializeField] private GameObject chartLine; + [SerializeField] private SectionDialog sectionDialog; + + public DynamicBeatmap.ChartSection chartSection; + + new private void Update() + { + base.Update(); + if (hovering) + { + SpecialTimeline.hoveringTypes |= SpecialTimeline.HoveringTypes.SectionChange; + } + + UpdateLabel(); + } + + public void UpdateLabel() + { + sectionLabel.text = chartSection.sectionName; + } + + public override void Init() + { + UpdateLabel(); + } + + public override void OnLeftClick() + { + if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.ChartSection) + StartMove(); + } + + public override void OnRightClick() + { + if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.ChartSection) + { + sectionDialog.SetSectionObj(this); + sectionDialog.SwitchSectionDialog(); + } + } + + public override bool OnMove(float beat) + { + foreach (var sectionChange in GameManager.instance.Beatmap.beatmapSections) + { + if (this.chartSection == sectionChange) + continue; + if (beat > sectionChange.beat - Timeline.instance.snapInterval && beat < sectionChange.beat + Timeline.instance.snapInterval) + return false; + } + this.chartSection.beat = beat; + return true; + } + + public override void SetVisibility(Timeline.CurrentTimelineState.State state) + { + if (state == Timeline.CurrentTimelineState.State.ChartSection || state == Timeline.CurrentTimelineState.State.Selection) + { + gameObject.SetActive(true); + if (state == Timeline.CurrentTimelineState.State.ChartSection) + { + chartLine.SetActive(true); + sectionLabel.gameObject.SetActive(true); + } + else + { + chartLine.SetActive(false); + sectionLabel.gameObject.SetActive(false); + } + } + else + { + gameObject.SetActive(false); + + } + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SectionTimelineObj.cs.meta b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SectionTimelineObj.cs.meta new file mode 100644 index 00000000..8520fed6 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SectionTimelineObj.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 396d5b0b822f8da4cb7b855a39b4a90f +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SpecialTimelineObj.cs b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SpecialTimelineObj.cs new file mode 100644 index 00000000..d54724b8 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SpecialTimelineObj.cs @@ -0,0 +1,103 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +using TMPro; + +using DG.Tweening; + +namespace HeavenStudio.Editor.Track +{ + public class SpecialTimelineObj : MonoBehaviour + { + [Header("Components")] + [SerializeField] private RectTransform rectTransform; + [SerializeField] private RectTransform raycastRect; + + private float startPosX; + private bool moving = false; + + public bool hovering; + private float lastPosX; + + private void Start() + { + rectTransform = GetComponent(); + } + + protected void Update() + { + if (!Conductor.instance.NotStopped()) + { + if (RectTransformUtility.RectangleContainsScreenPoint(raycastRect, Input.mousePosition, Editor.instance.EditorCamera)) + { + if (Input.GetMouseButtonDown(0)) + { + OnLeftClick(); + } + else if (Input.GetMouseButtonDown(1)) + { + OnRightClick(); + } + hovering = true; + } + else + { + hovering = false; + } + + if (moving) + { + Vector3 mousePos = Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition); + + transform.position = new Vector3(mousePos.x - startPosX, transform.position.y, 0); + transform.localPosition = new Vector3(Mathf.Clamp(Starpelly.Mathp.Round2Nearest(transform.localPosition.x, Timeline.SnapInterval()), 0, Mathf.Infinity), transform.localPosition.y); + + if (Input.GetMouseButtonUp(0)) + { + if (!OnMove(transform.localPosition.x)) + transform.localPosition = new Vector3(lastPosX, transform.localPosition.y); + + moving = false; + lastPosX = transform.localPosition.x; + } + } + } + else + { + if (moving) + { + if (!OnMove(transform.localPosition.x)) + transform.localPosition = new Vector3(lastPosX, transform.localPosition.y); + moving = false; + lastPosX = transform.localPosition.x; + } + hovering = false; + } + } + + public void StartMove() + { + Vector3 mousePos = Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition); + startPosX = mousePos.x - transform.position.x; + moving = true; + lastPosX = transform.localPosition.x; + } + + public void DeleteObj() + { + transform.parent.GetComponent().specialTimelineObjs.Remove(this); + Destroy(this.gameObject); + } + + //events + public virtual void Init() {} + public virtual void OnLeftClick() {} + public virtual void OnRightClick() {} + public virtual bool OnMove(float beat) + { + return true; + } + public virtual void SetVisibility(Timeline.CurrentTimelineState.State state) {} + } +} \ No newline at end of file diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SpecialTimelineObj.cs.meta b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SpecialTimelineObj.cs.meta new file mode 100644 index 00000000..640d14c1 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/SpecialTimelineObj.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 4dda06181c616dc4bb406f3d5f3bb6cf +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/TempoTimelineObj.cs b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/TempoTimelineObj.cs new file mode 100644 index 00000000..3fe34e7a --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/TempoTimelineObj.cs @@ -0,0 +1,98 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +using TMPro; + +using DG.Tweening; + +namespace HeavenStudio.Editor.Track +{ + public class TempoTimelineObj : SpecialTimelineObj + { + [Header("Components")] + [SerializeField] private TMP_Text tempoTXT; + [SerializeField] private GameObject tempoLine; + + public DynamicBeatmap.TempoChange tempoChange; + + new private void Update() + { + base.Update(); + if (hovering) + { + SpecialTimeline.hoveringTypes |= SpecialTimeline.HoveringTypes.TempoChange; + if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.TempoChange) + { + float newTempo = Input.mouseScrollDelta.y; + + if (Input.GetKey(KeyCode.LeftShift)) + newTempo *= 5f; + if (Input.GetKey(KeyCode.LeftControl)) + newTempo /= 100f; + + tempoChange.tempo += newTempo; + + //make sure tempo is positive + if (tempoChange.tempo < 1) + tempoChange.tempo = 1; + } + } + + UpdateTempo(); + } + + private void UpdateTempo() + { + tempoTXT.text = $"{tempoChange.tempo} BPM"; + Timeline.instance.FitToSong(); + } + + public override void Init() + { + UpdateTempo(); + } + + public override void OnLeftClick() + { + if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.TempoChange) + StartMove(); + } + + public override void OnRightClick() + { + if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.TempoChange) + { + GameManager.instance.Beatmap.tempoChanges.Remove(tempoChange); + DeleteObj(); + } + } + + public override bool OnMove(float beat) + { + foreach (var tempoChange in GameManager.instance.Beatmap.tempoChanges) + { + if (this.tempoChange == tempoChange) + continue; + if (beat > tempoChange.beat - Timeline.instance.snapInterval && beat < tempoChange.beat + Timeline.instance.snapInterval) + return false; + } + this.tempoChange.beat = beat; + return true; + } + + public override void SetVisibility(Timeline.CurrentTimelineState.State state) + { + if (state == Timeline.CurrentTimelineState.State.TempoChange || state == Timeline.CurrentTimelineState.State.Selection) + { + gameObject.SetActive(true); + if (state == Timeline.CurrentTimelineState.State.TempoChange) + tempoLine.SetActive(true); + else + tempoLine.SetActive(false); + } + else + gameObject.SetActive(false); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/LevelEditor/Timeline/TempoTimelineObj.cs.meta b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/TempoTimelineObj.cs.meta similarity index 100% rename from Assets/Scripts/LevelEditor/Timeline/TempoTimelineObj.cs.meta rename to Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/TempoTimelineObj.cs.meta diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/VolumeTimelineObj.cs b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/VolumeTimelineObj.cs new file mode 100644 index 00000000..1e68bcb3 --- /dev/null +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/VolumeTimelineObj.cs @@ -0,0 +1,96 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +using TMPro; + +using DG.Tweening; + +namespace HeavenStudio.Editor.Track +{ + public class VolumeTimelineObj : SpecialTimelineObj + { + [Header("Components")] + [SerializeField] private TMP_Text volumeTXT; + [SerializeField] private GameObject volumeLine; + + public DynamicBeatmap.VolumeChange volumeChange; + + new private void Update() + { + base.Update(); + if (hovering) + { + SpecialTimeline.hoveringTypes |= SpecialTimeline.HoveringTypes.VolumeChange; + if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.MusicVolume) + { + float newVolume = Input.mouseScrollDelta.y; + + if (Input.GetKey(KeyCode.LeftShift)) + newVolume *= 5f; + if (Input.GetKey(KeyCode.LeftControl)) + newVolume /= 100f; + + volumeChange.volume += newVolume; + + //make sure volume is positive + volumeChange.volume = Mathf.Clamp(volumeChange.volume, 0, 100); + } + } + + UpdateVolume(); + } + + private void UpdateVolume() + { + volumeTXT.text = $"{volumeChange.volume}%"; + } + + public override void Init() + { + UpdateVolume(); + } + + public override void OnLeftClick() + { + if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.MusicVolume) + StartMove(); + } + + public override void OnRightClick() + { + if (Timeline.instance.timelineState.currentState == Timeline.CurrentTimelineState.State.MusicVolume) + { + GameManager.instance.Beatmap.volumeChanges.Remove(volumeChange); + DeleteObj(); + } + } + + public override bool OnMove(float beat) + { + foreach (var volumeChange in GameManager.instance.Beatmap.volumeChanges) + { + if (this.volumeChange == volumeChange) + continue; + if (beat > volumeChange.beat - Timeline.instance.snapInterval && beat < volumeChange.beat + Timeline.instance.snapInterval) + return false; + } + this.volumeChange.beat = beat; + return true; + } + + public override void SetVisibility(Timeline.CurrentTimelineState.State state) + { + if (state == Timeline.CurrentTimelineState.State.MusicVolume || state == Timeline.CurrentTimelineState.State.Selection) + { + gameObject.SetActive(true); + if (state == Timeline.CurrentTimelineState.State.MusicVolume) + volumeLine.SetActive(true); + else + volumeLine.SetActive(false); + } + else + gameObject.SetActive(false); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/LevelEditor/Timeline/VolumeTimelineObj.cs.meta b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/VolumeTimelineObj.cs.meta similarity index 83% rename from Assets/Scripts/LevelEditor/Timeline/VolumeTimelineObj.cs.meta rename to Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/VolumeTimelineObj.cs.meta index 6e1eb12e..07d5209a 100644 --- a/Assets/Scripts/LevelEditor/Timeline/VolumeTimelineObj.cs.meta +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/VolumeTimelineObj.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 86bb8f2f290876a4387f1ea6fedf332b +guid: 84c1633846a16fb42baa226572335fae MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/LevelEditor/Timeline/TempoTimeline.cs b/Assets/Scripts/LevelEditor/Timeline/TempoTimeline.cs deleted file mode 100644 index 153ad772..00000000 --- a/Assets/Scripts/LevelEditor/Timeline/TempoTimeline.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; -using System; - -using TMPro; -using Starpelly; - -namespace HeavenStudio.Editor.Track -{ - public class TempoTimeline : MonoBehaviour - { - [Header("Components")] - private RectTransform rectTransform; - [SerializeField] private RectTransform RefTempoChange; - public TMP_InputField StartingBPM; - private RectTransform StartingBPMRect; - public TMP_InputField FirstBeatOffset; - - public List tempoTimelineObjs = new List(); - - private bool firstUpdate; - - private void Start() - { - rectTransform = this.GetComponent(); - StartingBPMRect = StartingBPM.GetComponent(); - - for (int i = 0; i < GameManager.instance.Beatmap.tempoChanges.Count; i++) - { - DynamicBeatmap.TempoChange tempoChange = GameManager.instance.Beatmap.tempoChanges[i]; - AddTempoChange(false, tempoChange); - } - } - - private void Update() - { - if (!firstUpdate) - { - UpdateStartingBPMText(); - UpdateOffsetText(); - firstUpdate = true; - } - - if (Timeline.instance.userIsEditingInputField) - return; - - if (Timeline.instance.timelineState.tempoChange && !Conductor.instance.NotStopped()) - { - if (RectTransformUtility.RectangleContainsScreenPoint(rectTransform, Input.mousePosition, Editor.instance.EditorCamera)) - { - if (Input.GetMouseButtonDown(0)) - { - if (tempoTimelineObjs.FindAll(c => c.hovering == true).Count == 0) - { - AddTempoChange(true); - } - } - } - - if (RectTransformUtility.RectangleContainsScreenPoint(StartingBPMRect, Input.mousePosition, Editor.instance.EditorCamera)) - { - float increase = Input.mouseScrollDelta.y; - if (Input.GetKey(KeyCode.LeftControl)) - increase /= 100f; - if (Input.GetKey(KeyCode.LeftShift)) - increase *= 5f; - - if (increase != 0f) - { - GameManager.instance.Beatmap.bpm += increase; - UpdateStartingBPMText(); - UpdateStartingBPMFromText(); // In case the scrolled-to value is invalid. - - } - } - } - } - - public void UpdateStartingBPMText() - { - StartingBPM.text = GameManager.instance.Beatmap.bpm.ToString("G"); - } - - public void UpdateOffsetText() - { - FirstBeatOffset.text = (GameManager.instance.Beatmap.firstBeatOffset * 1000f).ToString("G"); - } - - public void UpdateStartingBPMFromText() - { - // Failsafe against empty string. - if (String.IsNullOrEmpty(StartingBPM.text)) - StartingBPM.text = "120"; - - var newBPM = Convert.ToSingle(StartingBPM.text); - - // Failsafe against negative BPM. - if (newBPM < 1f) - { - StartingBPM.text = "1"; - newBPM = 1; - } - - // Limit decimal places to 4. - newBPM = (float)System.Math.Round(newBPM, 4); - - GameManager.instance.Beatmap.bpm = newBPM; - - // In case the newBPM ended up differing from the inputted string. - UpdateStartingBPMText(); - - Timeline.instance.FitToSong(); - } - - public void UpdateOffsetFromText() - { - // Failsafe against empty string. - if (String.IsNullOrEmpty(FirstBeatOffset.text)) - FirstBeatOffset.text = "0"; - - // Convert ms to s. - var newOffset = Convert.ToSingle(FirstBeatOffset.text) / 1000f; - - // Limit decimal places to 4. - newOffset = (float)System.Math.Round(newOffset, 4); - - GameManager.instance.Beatmap.firstBeatOffset = newOffset; - - UpdateOffsetText(); - } - - public void ClearTempoTimeline() - { - foreach (TempoTimelineObj tempoTimelineObj in tempoTimelineObjs) - { - Destroy(tempoTimelineObj.gameObject); - } - tempoTimelineObjs.Clear(); - } - - public void AddTempoChange(bool create, DynamicBeatmap.TempoChange tempoChange_ = null) - { - GameObject tempoChange = Instantiate(RefTempoChange.gameObject, this.transform); - - tempoChange.transform.GetChild(0).GetComponent().color = EditorTheme.theme.properties.TempoLayerCol.Hex2RGB(); - tempoChange.transform.GetChild(1).GetComponent().color = EditorTheme.theme.properties.TempoLayerCol.Hex2RGB(); - tempoChange.transform.GetChild(2).GetComponent().color = EditorTheme.theme.properties.TempoLayerCol.Hex2RGB(); - - tempoChange.SetActive(true); - - TempoTimelineObj tempoTimelineObj = tempoChange.GetComponent(); - - if (create == true) - { - tempoChange.transform.position = new Vector3(Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition).x + 0.08f, tempoChange.transform.position.y); - tempoChange.transform.localPosition = new Vector3(Starpelly.Mathp.Round2Nearest(tempoChange.transform.localPosition.x, Timeline.SnapInterval()), tempoChange.transform.localPosition.y); - - DynamicBeatmap.TempoChange tempoC = new DynamicBeatmap.TempoChange(); - tempoC.beat = tempoChange.transform.localPosition.x; - tempoC.tempo = GameManager.instance.Beatmap.bpm; - - tempoTimelineObj.tempoChange = tempoC; - GameManager.instance.Beatmap.tempoChanges.Add(tempoC); - } - else - { - tempoChange.transform.localPosition = new Vector3(tempoChange_.beat, tempoChange.transform.localPosition.y); - - tempoTimelineObj.tempoChange = tempoChange_; - } - - tempoTimelineObjs.Add(tempoTimelineObj); - - Timeline.instance.FitToSong(); - } - } - -} \ No newline at end of file diff --git a/Assets/Scripts/LevelEditor/Timeline/TempoTimelineObj.cs b/Assets/Scripts/LevelEditor/Timeline/TempoTimelineObj.cs deleted file mode 100644 index 886e7c6c..00000000 --- a/Assets/Scripts/LevelEditor/Timeline/TempoTimelineObj.cs +++ /dev/null @@ -1,106 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -using TMPro; - -using DG.Tweening; - -namespace HeavenStudio.Editor.Track -{ - public class TempoTimelineObj : MonoBehaviour - { - [Header("Components")] - [SerializeField] private RectTransform rectTransform; - [SerializeField] private TMP_Text tempoTXT; - [SerializeField] private RectTransform raycastRect; - - public DynamicBeatmap.TempoChange tempoChange; - - private float startPosX; - private bool moving = false; - - public bool hovering; - - private float lastPosX; - - private void Start() - { - rectTransform = GetComponent(); - tempoTXT = transform.GetChild(2).GetComponent(); - UpdateTempo(); - } - - private void Update() - { - if (Timeline.instance.timelineState.tempoChange && !Conductor.instance.NotStopped()) - { - if (RectTransformUtility.RectangleContainsScreenPoint(raycastRect, Input.mousePosition, Editor.instance.EditorCamera)) - { - float newTempo = Input.mouseScrollDelta.y; - - if (Input.GetKey(KeyCode.LeftShift)) - newTempo *= 5f; - if (Input.GetKey(KeyCode.LeftControl)) - newTempo /= 100f; - - tempoChange.tempo += newTempo; - - //make sure tempo is positive - if (tempoChange.tempo < 1) - tempoChange.tempo = 1; - - if (Input.GetMouseButtonDown(0)) - { - Vector3 mousePos = Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition); - startPosX = mousePos.x - transform.position.x; - moving = true; - lastPosX = transform.localPosition.x; - } - else if (Input.GetMouseButtonDown(1)) - { - GameManager.instance.Beatmap.tempoChanges.Remove(tempoChange); - transform.parent.GetComponent().tempoTimelineObjs.Remove(this); - Destroy(this.gameObject); - } - - hovering = true; - } - else - { - hovering = false; - } - - if (moving) - { - Vector3 mousePos = Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition); - - transform.position = new Vector3(mousePos.x - startPosX, transform.position.y, 0); - transform.localPosition = new Vector3(Mathf.Clamp(Starpelly.Mathp.Round2Nearest(transform.localPosition.x, Timeline.SnapInterval()), 0, Mathf.Infinity), transform.localPosition.y); - } - if (Input.GetMouseButtonUp(0)) - { - if (transform.parent.GetComponent().tempoTimelineObjs.Find(c => c.gameObject.transform.localPosition.x == this.transform.localPosition.x && c != this) != null) - { - transform.localPosition = new Vector3(lastPosX, transform.localPosition.y); - } - else - { - tempoChange.beat = transform.localPosition.x; - } - - moving = false; - lastPosX = transform.localPosition.x; - } - - UpdateTempo(); - } - } - - private void UpdateTempo() - { - tempoTXT.text = $"{tempoChange.tempo} BPM"; - Timeline.instance.FitToSong(); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/LevelEditor/Timeline/Timeline.cs b/Assets/Scripts/LevelEditor/Timeline/Timeline.cs index de7dc326..d0f0bd17 100644 --- a/Assets/Scripts/LevelEditor/Timeline/Timeline.cs +++ b/Assets/Scripts/LevelEditor/Timeline/Timeline.cs @@ -1,4 +1,4 @@ -using System.Collections; +using System; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; @@ -34,45 +34,109 @@ namespace HeavenStudio.Editor.Track public class CurrentTimelineState { - public bool selected; - public bool tempoChange; - public bool musicVolume; + public enum State + { + Selection, + TempoChange, + MusicVolume, + ChartSection + } + + public State currentState = State.Selection; + + public bool selected { get { return currentState == State.Selection; } } + public bool tempoChange { get { return currentState == State.TempoChange; } } + public bool musicVolume { get { return currentState == State.MusicVolume; } } + public bool chartSection { get { return currentState == State.ChartSection; } } public void SetState(bool selected, bool tempoChange, bool musicVolume) { if (Conductor.instance.NotStopped()) return; - this.selected = selected; - this.tempoChange = tempoChange; - this.musicVolume = musicVolume; - if (selected) + { + currentState = State.Selection; instance.SelectionsBTN.transform.GetChild(0).GetComponent().color = Color.white; + instance.SelectionsBTN.GetComponent().Invoke("OnClick", 0); + } else instance.SelectionsBTN.transform.GetChild(0).GetComponent().color = Color.gray; if (tempoChange) + { + currentState = State.TempoChange; instance.TempoChangeBTN.transform.GetChild(0).GetComponent().color = Color.white; + instance.TempoChangeBTN.GetComponent().Invoke("OnClick", 0); + } else instance.TempoChangeBTN.transform.GetChild(0).GetComponent().color = Color.gray; if (musicVolume) + { + currentState = State.MusicVolume; instance.MusicVolumeBTN.transform.GetChild(0).GetComponent().color = Color.white; + instance.MusicVolumeBTN.GetComponent().Invoke("OnClick", 0); + } else instance.MusicVolumeBTN.transform.GetChild(0).GetComponent().color = Color.gray; } + + public void SetState(State state) + { + if (Conductor.instance.NotStopped()) return; + + currentState = state; + if (selected) + { + instance.SelectionsBTN.transform.GetChild(0).GetComponent().color = Color.white; + instance.SelectionsBTN.GetComponent().Invoke("OnClick", 0); + } + else + instance.SelectionsBTN.transform.GetChild(0).GetComponent().color = Color.gray; + if (tempoChange) + { + instance.TempoChangeBTN.transform.GetChild(0).GetComponent().color = Color.white; + instance.TempoChangeBTN.GetComponent().Invoke("OnClick", 0); + } + else + instance.TempoChangeBTN.transform.GetChild(0).GetComponent().color = Color.gray; + if (musicVolume) + { + instance.MusicVolumeBTN.transform.GetChild(0).GetComponent().color = Color.white; + instance.MusicVolumeBTN.GetComponent().Invoke("OnClick", 0); + } + else + instance.MusicVolumeBTN.transform.GetChild(0).GetComponent().color = Color.gray; + if (chartSection) + { + instance.ChartSectionBTN.transform.GetChild(0).GetComponent().color = Color.white; + instance.ChartSectionBTN.GetComponent().Invoke("OnClick", 0); + } + else + instance.ChartSectionBTN.transform.GetChild(0).GetComponent().color = Color.gray; + } } [Header("Timeline Components")] [SerializeField] private RectTransform TimelineSlider; [SerializeField] private RectTransform TimelineGridSelect; + [SerializeField] private RectTransform TimelineEventGrid; [SerializeField] private TMP_Text TimelinePlaybackBeat; public RectTransform TimelineContent; [SerializeField] private RectTransform TimelineSongPosLineRef; [SerializeField] private RectTransform TimelineEventObjRef; [SerializeField] private RectTransform LayersRect; - public TempoTimeline TempoInfo; - public VolumeTimeline VolumeInfo; + [SerializeField] private GameObject TimelineSectionDisplay; + [SerializeField] private TMP_Text TimelineSectionText; + [SerializeField] private Slider TimelineSectionProgress; + + [Header("Timeline Inputs")] + public TMP_InputField FirstBeatOffset; + public TMP_InputField StartingTempoSpecialAll; + public TMP_InputField StartingTempoSpecialTempo; + public TMP_InputField StartingVolumeSpecialVolume; + + public SpecialTimeline SpecialInfo; private RectTransform TimelineSongPosLine; [Header("Timeline Playbar")] @@ -84,6 +148,7 @@ namespace HeavenStudio.Editor.Track public Button SelectionsBTN; public Button TempoChangeBTN; public Button MusicVolumeBTN; + public Button ChartSectionBTN; public Slider PlaybackSpeed; public Vector3[] LayerCorners = new Vector3[4]; @@ -117,16 +182,10 @@ namespace HeavenStudio.Editor.Track AddEventObject(e.datamodel, false, new Vector3(e.beat, -e.track * LayerHeight()), e, false, RandomID()); } - //tempo changes - TempoInfo.ClearTempoTimeline(); - for (int i = 0; i < GameManager.instance.Beatmap.tempoChanges.Count; i++) - { - var t = GameManager.instance.Beatmap.tempoChanges[i]; - - TempoInfo.AddTempoChange(false, t); - } - - //volume changes + SpecialInfo.Setup(); + UpdateOffsetText(); + UpdateStartingBPMText(); + UpdateStartingVolText(); } public void Init() @@ -170,15 +229,19 @@ namespace HeavenStudio.Editor.Track SelectionsBTN.onClick.AddListener(delegate { - timelineState.SetState(true, false, false); + timelineState.SetState(CurrentTimelineState.State.Selection); }); TempoChangeBTN.onClick.AddListener(delegate { - timelineState.SetState(false, true, false); + timelineState.SetState(CurrentTimelineState.State.TempoChange); }); MusicVolumeBTN.onClick.AddListener(delegate { - timelineState.SetState(false, false, true); + timelineState.SetState(CurrentTimelineState.State.MusicVolume); + }); + ChartSectionBTN.onClick.AddListener(delegate + { + timelineState.SetState(CurrentTimelineState.State.ChartSection); }); Tooltip.AddTooltip(SongBeat.gameObject, "Current Beat"); @@ -195,15 +258,21 @@ namespace HeavenStudio.Editor.Track Tooltip.AddTooltip(SelectionsBTN.gameObject, "Tool: Selection [1]"); Tooltip.AddTooltip(TempoChangeBTN.gameObject, "Tool: Tempo Change [2]"); Tooltip.AddTooltip(MusicVolumeBTN.gameObject, "Tool: Music Volume [3]"); + Tooltip.AddTooltip(ChartSectionBTN.gameObject, "Tool: Beatmap Sections [4]"); + + Tooltip.AddTooltip(StartingTempoSpecialAll.gameObject, "Starting Tempo (BPM)"); + Tooltip.AddTooltip(StartingTempoSpecialTempo.gameObject, "Starting Tempo (BPM)"); + Tooltip.AddTooltip(StartingVolumeSpecialVolume.gameObject, "Starting Volume (%)"); Tooltip.AddTooltip(PlaybackSpeed.gameObject, "The preview's playback speed. Right click to reset to 1.0"); SetTimeButtonColors(true, false, false); MetronomeBTN.transform.GetChild(0).GetComponent().color = Color.gray; - timelineState.SetState(true, false, false); + timelineState.SetState(CurrentTimelineState.State.Selection); AutoBtnUpdate(); + GameManager.instance.onSectionChange += OnSectionChange; } public void FitToSong() @@ -269,6 +338,7 @@ namespace HeavenStudio.Editor.Track SongBeat.text = $"Beat {string.Format("{0:0.000}", Conductor.instance.songPositionInBeats)}"; SongPos.text = FormatTime(Conductor.instance.songPosition); } + TimelineSectionProgress.value = GameManager.instance.sectionProgress; SliderControl(); @@ -300,15 +370,19 @@ namespace HeavenStudio.Editor.Track if (Input.GetKeyDown(KeyCode.Alpha1)) { - timelineState.SetState(true, false, false); + timelineState.SetState(CurrentTimelineState.State.Selection); } else if (Input.GetKeyDown(KeyCode.Alpha2)) { - timelineState.SetState(false, true, false); + timelineState.SetState(CurrentTimelineState.State.TempoChange); } else if (Input.GetKeyDown(KeyCode.Alpha3)) { - timelineState.SetState(false, false, true); + timelineState.SetState(CurrentTimelineState.State.MusicVolume); + } + else if (Input.GetKeyDown(KeyCode.Alpha4)) + { + timelineState.SetState(CurrentTimelineState.State.ChartSection); } @@ -350,7 +424,7 @@ namespace HeavenStudio.Editor.Track TimelineContent.transform.localPosition = new Vector3(Mathf.Clamp(TimelineContent.transform.localPosition.x, Mathf.NegativeInfinity, 0), TimelineContent.transform.localPosition.y); - CurrentTempo.text = $" = {Conductor.instance.songBpm}"; + CurrentTempo.text = $" = {Conductor.instance.songBpm}"; LayersRect.GetWorldCorners(LayerCorners); } @@ -497,7 +571,7 @@ namespace HeavenStudio.Editor.Track public bool CheckIfMouseInTimeline() { - return (this.gameObject.activeSelf && RectTransformUtility.RectangleContainsScreenPoint(TimelineContent.transform.parent.gameObject.GetComponent(), Input.mousePosition, Editor.instance.EditorCamera)); + return (this.gameObject.activeSelf && RectTransformUtility.RectangleContainsScreenPoint(TimelineEventGrid, Input.mousePosition, Editor.instance.EditorCamera)); } #endregion @@ -683,6 +757,95 @@ namespace HeavenStudio.Editor.Track } } + public void UpdateOffsetText() + { + FirstBeatOffset.text = (GameManager.instance.Beatmap.firstBeatOffset * 1000f).ToString("G"); + } + + public void UpdateOffsetFromText() + { + // Failsafe against empty string. + if (String.IsNullOrEmpty(FirstBeatOffset.text)) + FirstBeatOffset.text = "0"; + + // Convert ms to s. + var newOffset = Convert.ToSingle(FirstBeatOffset.text) / 1000f; + + // Limit decimal places to 4. + newOffset = (float)System.Math.Round(newOffset, 4); + + GameManager.instance.Beatmap.firstBeatOffset = newOffset; + + UpdateOffsetText(); + } + + public void UpdateStartingBPMText() + { + StartingTempoSpecialAll.text = GameManager.instance.Beatmap.bpm.ToString("G"); + StartingTempoSpecialTempo.text = StartingTempoSpecialAll.text; + } + + public void UpdateStartingBPMFromText(bool all) + { + string text = all ? StartingTempoSpecialAll.text : StartingTempoSpecialTempo.text; + // Failsafe against empty string. + if (String.IsNullOrEmpty(text)) + text = "120"; + + var newBPM = Convert.ToDouble(text); + + // Failsafe against negative BPM. + if (newBPM < 1f) + { + text = "1"; + newBPM = 1; + } + + // Limit decimal places to 4. + newBPM = System.Math.Round(newBPM, 4); + + GameManager.instance.Beatmap.bpm = (float) newBPM; + + // In case the newBPM ended up differing from the inputted string. + UpdateStartingBPMText(); + + Timeline.instance.FitToSong(); + } + + public void UpdateStartingVolText() + { + StartingVolumeSpecialVolume.text = (GameManager.instance.Beatmap.musicVolume).ToString("G"); + } + + public void UpdateStartingVolFromText() + { + // Failsafe against empty string. + if (String.IsNullOrEmpty(StartingVolumeSpecialVolume.text)) + StartingVolumeSpecialVolume.text = "100"; + + var newVol = Convert.ToInt32(StartingVolumeSpecialVolume.text); + newVol = Mathf.Clamp(newVol, 0, 100); + + GameManager.instance.Beatmap.musicVolume = newVol; + + UpdateStartingVolText(); + } + + public void OnSectionChange(DynamicBeatmap.ChartSection section) + { + if (section == null) + { + TimelineSectionDisplay.SetActive(false); + } + else + { + if (!TimelineSectionDisplay.activeSelf) + TimelineSectionDisplay.SetActive(true); + TimelineSectionText.text = section.sectionName; + TimelineSectionProgress.value = GameManager.instance.sectionProgress; + } + } + #endregion #region Commands diff --git a/Assets/Scripts/LevelEditor/Timeline/TimelineEventObj.cs b/Assets/Scripts/LevelEditor/Timeline/TimelineEventObj.cs index 311fd4da..3bffb848 100644 --- a/Assets/Scripts/LevelEditor/Timeline/TimelineEventObj.cs +++ b/Assets/Scripts/LevelEditor/Timeline/TimelineEventObj.cs @@ -14,7 +14,7 @@ namespace HeavenStudio.Editor.Track private float startPosY; private Vector3 lastPos; - public Vector2 lastPos_; + public Vector2 moveStartPos; private RectTransform rectTransform; [Header("Components")] @@ -50,7 +50,7 @@ namespace HeavenStudio.Editor.Track private void Start() { - lastPos_ = transform.localPosition; + moveStartPos = transform.localPosition; rectTransform = GetComponent(); @@ -163,13 +163,16 @@ namespace HeavenStudio.Editor.Track this.wasDuplicated = false; this.moving = false; + transform.localPosition = moveStartPos; + OnComplete(false); + var te = Timeline.instance.CopyEventObject(this); Selections.instance.DragSelect(te); te.wasDuplicated = true; te.transform.localPosition = transform.localPosition; - te.lastPos_ = transform.localPosition; + te.moveStartPos = transform.localPosition; for (int i = 0; i < Timeline.instance.eventObjs.Count; i++) { @@ -179,12 +182,11 @@ namespace HeavenStudio.Editor.Track te.moving = true; } - - - lastPos_ = transform.localPosition; - - this.transform.position = new Vector3(mousePos.x - startPosX, mousePos.y - startPosY - 0.40f, 0); - this.transform.localPosition = new Vector3(Mathf.Max(Mathp.Round2Nearest(this.transform.localPosition.x, Timeline.SnapInterval()), 0), Timeline.instance.SnapToLayer(this.transform.localPosition.y)); + else + { + this.transform.position = new Vector3(mousePos.x - startPosX, mousePos.y - startPosY - 0.40f, 0); + this.transform.localPosition = new Vector3(Mathf.Max(Mathp.Round2Nearest(this.transform.localPosition.x, Timeline.SnapInterval()), 0), Timeline.instance.SnapToLayer(this.transform.localPosition.y)); + } if (lastPos != transform.localPosition) { @@ -281,7 +283,7 @@ namespace HeavenStudio.Editor.Track { if (selected && Timeline.instance.timelineState.selected) { - lastPos_ = transform.localPosition; + moveStartPos = transform.localPosition; for (int i = 0; i < Timeline.instance.eventObjs.Count; i++) { @@ -314,6 +316,7 @@ namespace HeavenStudio.Editor.Track if (eligibleToMove) { OnComplete(true); + moveStartPos = transform.localPosition; } moving = false; diff --git a/Assets/Scripts/LevelEditor/Timeline/VolumeTimeline.cs b/Assets/Scripts/LevelEditor/Timeline/VolumeTimeline.cs deleted file mode 100644 index bcc460b9..00000000 --- a/Assets/Scripts/LevelEditor/Timeline/VolumeTimeline.cs +++ /dev/null @@ -1,89 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.UI; -using System; - -using TMPro; -using Starpelly; - -namespace HeavenStudio.Editor.Track -{ - public class VolumeTimeline : MonoBehaviour - { - [Header("Components")] - private RectTransform rectTransform; - public TMP_InputField StartingVolume; - private RectTransform StartingVolumeRect; - - public List volumeTimelineObjs = new List(); - - private bool firstUpdate; - - void Start() - { - rectTransform = this.GetComponent(); - StartingVolumeRect = StartingVolume.GetComponent(); - } - - void Update() - { - if (!firstUpdate) - { - UpdateStartingVolumeText(); - firstUpdate = true; - } - - if (Timeline.instance.userIsEditingInputField) - return; - - if (Timeline.instance.timelineState.musicVolume && !Conductor.instance.NotStopped()) - { - if (RectTransformUtility.RectangleContainsScreenPoint(StartingVolumeRect, Input.mousePosition, Editor.instance.EditorCamera)) - { - int increase = Mathf.RoundToInt(Input.mouseScrollDelta.y); - if (Input.GetKey(KeyCode.LeftShift)) - increase *= 5; - - if (increase != 0) - { - GameManager.instance.Beatmap.musicVolume += increase; - UpdateStartingVolumeText(); - UpdateStartingVolumeFromText(); // In case the scrolled-to value is invalid. - } - } - } - } - - public void UpdateStartingVolumeText() - { - StartingVolume.text = GameManager.instance.Beatmap.musicVolume.ToString(); - } - - public void UpdateStartingVolumeFromText() - { - // Failsafe against empty string. - if (String.IsNullOrEmpty(StartingVolume.text)) - StartingVolume.text = "100"; - - var newVol = Convert.ToInt32(StartingVolume.text); - - // Failsafe against invalid volume. - if (newVol > 100) - { - StartingVolume.text = "100"; - newVol = 100; - } - else if (newVol < 0) - { - StartingVolume.text = "0"; - newVol = 0; - } - - GameManager.instance.Beatmap.musicVolume = newVol; - - // In case the newVol ended up differing from the inputted string. - UpdateStartingVolumeText(); - } - } -} diff --git a/Assets/Scripts/LevelEditor/Timeline/VolumeTimelineObj.cs b/Assets/Scripts/LevelEditor/Timeline/VolumeTimelineObj.cs deleted file mode 100644 index af1ec65c..00000000 --- a/Assets/Scripts/LevelEditor/Timeline/VolumeTimelineObj.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -using TMPro; - -using DG.Tweening; - -namespace HeavenStudio.Editor.Track -{ - public class VolumeTimelineObj : MonoBehaviour - { - [Header("Components")] - [SerializeField] private RectTransform rectTransform; - [SerializeField] private TMP_Text volumeTXT; - [SerializeField] private RectTransform raycastRect; - - public DynamicBeatmap.VolumeChange volumeChange; - - private float startPosX; - private bool moving = false; - - public bool hovering; - - private float lastPosX; - - private void Start() - { - rectTransform = GetComponent(); - volumeTXT = transform.GetChild(2).GetComponent(); - UpdateVolume(); - } - - private void Update() - { - if (Timeline.instance.timelineState.musicVolume && !Conductor.instance.NotStopped()) - { - if (RectTransformUtility.RectangleContainsScreenPoint(raycastRect, Input.mousePosition, Editor.instance.EditorCamera)) - { - float newVolume = Input.mouseScrollDelta.y; - - if (Input.GetKey(KeyCode.LeftShift)) - newVolume *= 5f; - if (Input.GetKey(KeyCode.LeftControl)) - newVolume /= 100f; - - volumeChange.volume += newVolume; - - //make sure volume is positive - volumeChange.volume = Mathf.Clamp(volumeChange.volume, 0, 100); - - if (Input.GetMouseButtonDown(0)) - { - Vector3 mousePos = Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition); - startPosX = mousePos.x - transform.position.x; - moving = true; - lastPosX = transform.localPosition.x; - } - else if (Input.GetMouseButtonDown(1)) - { - GameManager.instance.Beatmap.volumeChanges.Remove(volumeChange); - transform.parent.GetComponent().volumeTimelineObjs.Remove(this); - Destroy(this.gameObject); - } - - hovering = true; - } - else - { - hovering = false; - } - - if (moving) - { - Vector3 mousePos = Editor.instance.EditorCamera.ScreenToWorldPoint(Input.mousePosition); - - transform.position = new Vector3(mousePos.x - startPosX, transform.position.y, 0); - transform.localPosition = new Vector3(Mathf.Clamp(Starpelly.Mathp.Round2Nearest(transform.localPosition.x, Timeline.SnapInterval()), 0, Mathf.Infinity), transform.localPosition.y); - } - if (Input.GetMouseButtonUp(0)) - { - if (transform.parent.GetComponent().volumeTimelineObjs.Find(c => c.gameObject.transform.localPosition.x == this.transform.localPosition.x && c != this) != null) - { - transform.localPosition = new Vector3(lastPosX, transform.localPosition.y); - } - else - { - volumeChange.beat = transform.localPosition.x; - } - - moving = false; - lastPosX = transform.localPosition.x; - } - - UpdateVolume(); - } - } - - private void UpdateVolume() - { - volumeTXT.text = $"{volumeChange.volume}%"; - Timeline.instance.FitToSong(); - } - } -} \ No newline at end of file diff --git a/Assets/Scripts/LevelEditor/editortheme.json b/Assets/Scripts/LevelEditor/editortheme.json index 7f69ad1d..fc31832b 100644 --- a/Assets/Scripts/LevelEditor/editortheme.json +++ b/Assets/Scripts/LevelEditor/editortheme.json @@ -5,8 +5,11 @@ "name": "Heaven Studio Default Editor Theme", "properties": { + "SpecialLayersCol": "f06d60", "TempoLayerCol": "6cbcc4", "MusicLayerCol": "a663cc", + "SectionLayerCol": "ed9b2f", + //A7F085 "Layer1Col": "ef476f", "Layer2Col": "f5813d", diff --git a/ProjectSettings/AudioManager.asset b/ProjectSettings/AudioManager.asset index 76ae8000..cbf72d24 100644 --- a/ProjectSettings/AudioManager.asset +++ b/ProjectSettings/AudioManager.asset @@ -8,8 +8,8 @@ AudioManager: Rolloff Scale: 1 Doppler Factor: 1 Default Speaker Mode: 2 - m_SampleRate: 96000 - m_DSPBufferSize: 1024 + m_SampleRate: 48000 + m_DSPBufferSize: 512 m_VirtualVoiceCount: 512 m_RealVoiceCount: 32 m_EnableOutputSuspension: 1 @@ -17,4 +17,4 @@ AudioManager: m_AmbisonicDecoderPlugin: m_DisableAudio: 0 m_VirtualizeEffects: 1 - m_RequestedDSPBufferSize: 0 + m_RequestedDSPBufferSize: 512 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 2ea81a38..92cb2a97 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -320,7 +320,9 @@ PlayerSettings: Android: 1 iPhone: 1 tvOS: 1 - m_BuildTargetGroupLightmapEncodingQuality: [] + m_BuildTargetGroupLightmapEncodingQuality: + - m_BuildTarget: Standalone + m_EncodingQuality: 1 m_BuildTargetGroupLightmapSettings: [] m_BuildTargetNormalMapEncoding: [] playModeTestRunnerEnabled: 0