Skip to content

Commit

Permalink
Started vocal starpower
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteAsian123 committed Mar 16, 2023
1 parent a8c86a7 commit b220a3e
Show file tree
Hide file tree
Showing 23 changed files with 138 additions and 214 deletions.
12 changes: 11 additions & 1 deletion Assets/Script/PlayMode/MicPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ public static MicPlayer Instance {
private float totalSingTime;
private LyricInfo currentLyric = null;

private EventInfo visualStarpowerSection = null;
private EventInfo starpowerSection = null;

private int rawMultiplier = 1;

private void Start() {
Expand Down Expand Up @@ -212,11 +215,18 @@ private void Update() {
float compensation = TRACK_SPAWN_OFFSET - CalcLagCompensation(RelativeTime, eventInfo.time);
if (eventInfo.name == "vocal_endPhrase") {
notePool.AddEndPhraseLine(compensation);
} else if (eventInfo.name == "starpower_vocals") {
visualStarpowerSection = eventInfo;
}

visualEventChartIndex++;
}

// Update visual starpower
if (visualStarpowerSection?.EndTime < RelativeTime) {
visualStarpowerSection = null;
}

// Update event logic
while (events.Count > eventChartIndex && events[eventChartIndex].time <= Play.Instance.SongTime) {
var eventInfo = events[eventChartIndex];
Expand Down Expand Up @@ -408,7 +418,7 @@ private void SpawnLyric(LyricInfo lyricInfo, float time) {
var pos = TRACK_SPAWN_OFFSET - lagCompensation;

// Spawn text
lyricPool.AddLyric(lyricInfo, pos);
lyricPool.AddLyric(lyricInfo, visualStarpowerSection != null, pos);

// Spawn note
if (lyricInfo.inharmonic) {
Expand Down
4 changes: 2 additions & 2 deletions Assets/Script/Pools/LyricPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ private void Update() {
lastLyricLocation -= Time.deltaTime * MicPlayer.TRACK_SPEED;
}

public Transform AddLyric(LyricInfo lyric, float x) {
public Transform AddLyric(LyricInfo lyric, bool starpower, float x) {
// Don't let lyrics collide
if (x < lastLyricLocation) {
x = lastLyricLocation + 0.125f;
}

var poolable = (VocalLyric) Add("lyric", new Vector3(x, 0f, -0.68f));
poolable.SetLyric(lyric);
poolable.SetLyric(lyric, starpower);

// Calculate the location of the end of the lyric
lastLyricLocation = x + poolable.text.preferredWidth;
Expand Down
10 changes: 8 additions & 2 deletions Assets/Script/Pools/VocalLyric.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ public class VocalLyric : Poolable {
public TextMeshPro text;

private LyricInfo lyric;
private bool starpower;

public void SetLyric(LyricInfo lyricInfo) {
public void SetLyric(LyricInfo lyricInfo, bool starpower) {
lyric = lyricInfo;
this.starpower = starpower;

// I like this line of code
text.text = lyric.lyric;
Expand All @@ -25,7 +27,11 @@ private void Update() {

// Set color
if (Play.Instance.SongTime < lyric.time) {
text.color = Color.white;
if (starpower) {
text.color = Color.yellow;
} else {
text.color = Color.white;
}
} else if (Play.Instance.SongTime > lyric.time && Play.Instance.SongTime < lyric.EndTime) {
text.color = new Color(0.000f, 1.000f, 0.349f);
} else {
Expand Down
1 change: 1 addition & 0 deletions Assets/Script/Serialization/Parser/MidiParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ public override void Parse(Chart chart) {
case "PART VOCALS":
chart.genericLyrics = ParseGenericLyrics(trackChunk, tempo);
chart.realLyrics = ParseRealLyrics(eventIR, trackChunk, tempo);
ParseStarpower(eventIR, trackChunk, "vocals");
break;
case "PART REAL_GUITAR":
for (int i = 0; i < 4; i++) {
Expand Down
80 changes: 80 additions & 0 deletions Assets/Settings/AddressableAssetsData/link.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
<linker>
<assembly fullname="Assembly-CSharp, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="YARG.PlayMode.DrumsTrack" preserve="all" />
<type fullname="YARG.PlayMode.FiveFretTrack" preserve="all" />
<type fullname="YARG.PlayMode.Fret" preserve="all" />
<type fullname="YARG.PlayMode.RealGuitarTrack" preserve="all" />
<type fullname="YARG.Pools.BeatLine" preserve="all" />
<type fullname="YARG.Pools.NoteComponent" preserve="all" />
<type fullname="YARG.Pools.NotePool" preserve="all" />
<type fullname="YARG.Pools.Pool" preserve="all" />
<type fullname="YARG.Util.FadeLight" preserve="all" />
<type fullname="YARG.Util.ParticleGroup" preserve="all" />
<type fullname="YARG.Util.WaveyLight" preserve="all" />
<type fullname="YARG.Pools.Pool/KVP" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="Unity.Addressables, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
<type fullname="UnityEngine.AddressableAssets.Addressables" preserve="all" />
</assembly>
<assembly fullname="Unity.RenderPipelines.Universal.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.Rendering.Universal.UniversalAdditionalCameraData" preserve="all" />
<type fullname="UnityEngine.Rendering.Universal.UniversalAdditionalLightData" preserve="all" />
<type fullname="UnityEngine.Rendering.Universal.TemporalAA/Settings" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null" preserve="all">
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.LegacyResourcesProvider" preserve="all" />
<type fullname="UnityEngine.ResourceManagement.ResourceProviders.SceneProvider" preserve="all" />
</assembly>
<assembly fullname="Unity.TextMeshPro, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="TMPro.TextMeshPro" preserve="all" />
<type fullname="TMPro.TMP_FontAsset" preserve="all" />
<type fullname="TMPro.FaceInfo_Legacy" preserve="nothing" serialized="true" />
<type fullname="TMPro.FontAssetCreationSettings" preserve="nothing" serialized="true" />
<type fullname="TMPro.KerningTable" preserve="nothing" serialized="true" />
<type fullname="TMPro.TMP_Character" preserve="nothing" serialized="true" />
<type fullname="TMPro.TMP_FontFeatureTable" preserve="nothing" serialized="true" />
<type fullname="TMPro.TMP_FontWeightPair" preserve="nothing" serialized="true" />
<type fullname="TMPro.VertexGradient" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.Camera" preserve="all" />
<type fullname="UnityEngine.GameObject" preserve="all" />
<type fullname="UnityEngine.Light" preserve="all" />
<type fullname="UnityEngine.LineRenderer" preserve="all" />
<type fullname="UnityEngine.Material" preserve="all" />
<type fullname="UnityEngine.Mesh" preserve="all" />
<type fullname="UnityEngine.MeshFilter" preserve="all" />
<type fullname="UnityEngine.MeshRenderer" preserve="all" />
<type fullname="UnityEngine.Object" preserve="all" />
<type fullname="UnityEngine.RectTransform" preserve="all" />
<type fullname="UnityEngine.RenderTexture" preserve="all" />
<type fullname="UnityEngine.Shader" preserve="all" />
<type fullname="UnityEngine.Sprite" preserve="all" />
<type fullname="UnityEngine.Texture2D" preserve="all" />
<type fullname="UnityEngine.Transform" preserve="all" />
<type fullname="UnityEngine.Events.PersistentCallGroup" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="UnityEngine.ParticleSystemModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.ParticleSystem" preserve="all" />
<type fullname="UnityEngine.ParticleSystemRenderer" preserve="all" />
</assembly>
<assembly fullname="UnityEngine.PhysicsModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.BoxCollider" preserve="all" />
<type fullname="UnityEngine.MeshCollider" preserve="all" />
</assembly>
<assembly fullname="UnityEngine.TextRenderingModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null">
<type fullname="UnityEngine.Font" preserve="all" />
</assembly>
<assembly fullname="UnityEngine.TextCoreFontEngineModule">
<type fullname="UnityEngine.TextCore.FaceInfo" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.TextCore.Glyph" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.TextCore.GlyphMetrics" preserve="nothing" serialized="true" />
<type fullname="UnityEngine.TextCore.GlyphRect" preserve="nothing" serialized="true" />
</assembly>
<assembly fullname="UnityEngine.UI">
<type fullname="UnityEngine.UI.MaskableGraphic/CullStateChangedEvent" preserve="nothing" serialized="true" />
</assembly>
</linker>

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 0 additions & 25 deletions Assets/UI/EditPlayers.uxml

This file was deleted.

10 changes: 0 additions & 10 deletions Assets/UI/EditPlayers.uxml.meta

This file was deleted.

39 changes: 0 additions & 39 deletions Assets/UI/PanelSettings.asset

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/UI/PanelSettings.asset.meta

This file was deleted.

5 changes: 0 additions & 5 deletions Assets/UI/PostSong.uxml

This file was deleted.

10 changes: 0 additions & 10 deletions Assets/UI/PostSong.uxml.meta

This file was deleted.

9 changes: 0 additions & 9 deletions Assets/UI/PreSong.uxml

This file was deleted.

10 changes: 0 additions & 10 deletions Assets/UI/PreSong.uxml.meta

This file was deleted.

8 changes: 0 additions & 8 deletions Assets/UI/Themes.meta

This file was deleted.

28 changes: 0 additions & 28 deletions Assets/UI/Themes/LightStyle.uss

This file was deleted.

11 changes: 0 additions & 11 deletions Assets/UI/Themes/LightStyle.uss.meta

This file was deleted.

2 changes: 1 addition & 1 deletion Assets/UnityDefaultRuntimeTheme.tss.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions Packages/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
"com.unity.2d.sprite": "1.0.0",
"com.unity.addressables": "1.21.9",
"com.unity.ai.navigation": "1.1.1",
"com.unity.collab-proxy": "1.17.6",
"com.unity.ide.rider": "3.0.16",
"com.unity.collab-proxy": "2.0.0",
"com.unity.ide.rider": "3.0.18",
"com.unity.ide.vscode": "1.2.5",
"com.unity.inputsystem": "1.4.4",
"com.unity.inputsystem": "1.5.0",
"com.unity.nuget.newtonsoft-json": "3.0.2",
"com.unity.probuilder": "5.0.6",
"com.unity.render-pipelines.universal": "14.0.3",
"com.unity.render-pipelines.universal": "14.0.6",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.7.2",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.3",
"com.unity.timeline": "1.7.3",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.4",
"com.unity.ugui": "1.0.0",
"com.unity.modules.ai": "1.0.0",
"com.unity.modules.androidjni": "1.0.0",
Expand Down
Loading

0 comments on commit b220a3e

Please sign in to comment.