Skip to content

Commit

Permalink
Merge branch 'dev'
Browse files Browse the repository at this point in the history
  • Loading branch information
EliteAsian123 committed May 23, 2023
2 parents 2634e9d + 469c344 commit b3ed8ba
Show file tree
Hide file tree
Showing 118 changed files with 4,264 additions and 732 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@ ProjectSettings/**/* eol=lf
# Items that should be stored in LFS
RawAssets/** filter=lfs diff=lfs merge=lfs -text
Assets/Art/**/*.png filter=lfs diff=lfs merge=lfs -text
Assets/Art/**/*.exr filter=lfs diff=lfs merge=lfs -text
Assets/Art/**/*.exr filter=lfs diff=lfs merge=lfs -text
Assets/Art/**/*.jpg filter=lfs diff=lfs merge=lfs -text
3 changes: 0 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,8 @@
"**/*.meta":true,
"build/":true,
"Build/":true,
"Library/":true,
"library/":true,
"obj/":true,
"Obj/":true,
"ProjectSettings/":true,
"temp/":true,
"Temp/":true
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
46 changes: 46 additions & 0 deletions Assets/Prefabs/UI/DifficultyRing.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ GameObject:
- component: {fileID: 397774209812536582}
- component: {fileID: 397774209812536633}
- component: {fileID: 1575055953060588012}
- component: {fileID: 2857051289790792871}
m_Layer: 5
m_Name: DifficultyRing
m_TagString: Untagged
Expand Down Expand Up @@ -102,6 +103,51 @@ MonoBehaviour:
- {fileID: 1263751245, guid: 3b63aeee98f00194d897a42695807211, type: 3}
- {fileID: 1378811686, guid: 3b63aeee98f00194d897a42695807211, type: 3}
- {fileID: -1032094120, guid: 3b63aeee98f00194d897a42695807211, type: 3}
searchButton: {fileID: 2857051289790792871}
--- !u!114 &2857051289790792871
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 397774209812536635}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_WrapAround: 0
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 397774209812536633}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1 &4109224399020810241
GameObject:
m_ObjectHideFlags: 0
Expand Down
1 change: 1 addition & 0 deletions Assets/Prefabs/UI/TrackView.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
<TrackImage>k__BackingField: {fileID: 539163407594810661}
_aspectRatioFitter: {fileID: 4901975570370130400}
_performanceText: {fileID: 8078771021002508975}
_soloTopText: {fileID: 168029097117233520}
_soloBottomText: {fileID: 9129968958286683376}
Expand Down
14 changes: 2 additions & 12 deletions Assets/Scenes/MenuScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ MonoBehaviour:
m_CharacterValidation: 3
m_RegexValue:
m_GlobalPointSize: 14
m_CharacterLimit: 0
m_CharacterLimit: 4
m_OnEndEdit:
m_PersistentCalls:
m_Calls: []
Expand Down Expand Up @@ -11533,17 +11533,7 @@ MonoBehaviour:
m_ItemImage: {fileID: 0}
m_Value: 0
m_Options:
m_Options:
- m_Text: Five Fret
m_Image: {fileID: 0}
- m_Text: Microphone
m_Image: {fileID: 0}
- m_Text: Pro Guitar
m_Image: {fileID: 0}
- m_Text: Drums (Standard)
m_Image: {fileID: 0}
- m_Text: Drums (5-lane)
m_Image: {fileID: 0}
m_Options: []
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
Expand Down
48 changes: 46 additions & 2 deletions Assets/Scenes/PlayScene.unity
Original file line number Diff line number Diff line change
Expand Up @@ -483,10 +483,10 @@ Light:
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_RenderMode: 2
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_Bits: 503
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
Expand Down Expand Up @@ -1827,6 +1827,50 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 484464889}
m_CullTransparentMesh: 1
--- !u!1 &530943365
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 530943366}
- component: {fileID: 530943367}
m_Layer: 0
m_Name: Venue Manager
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &530943366
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 530943365}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &530943367
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 530943365}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: aa876df80bf74e04d8cff76a0f5f8271, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &534160431
GameObject:
m_ObjectHideFlags: 0
Expand Down
5 changes: 3 additions & 2 deletions Assets/Script/Audio/Bass/BassAudioManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using Cysharp.Threading.Tasks;
using ManagedBass;
using UnityEngine;
using XboxSTFS;
using static XboxSTFS.XboxSTFSParser;
using YARG.Serialization;
using YARG.Song;
using Debug = UnityEngine.Debug;
Expand Down Expand Up @@ -222,8 +224,7 @@ public void LoadMogg(ExtractedConSongEntry exConSong, bool isSpeedUp, params Son
byte[] moggArray;
if (exConSong is ConSongEntry conSong) {
if (!conSong.UsingUpdateMogg)
moggArray = XboxCONInnerFileRetriever.RetrieveFile(conSong.Location,
conSong.MoggFileSize, conSong.MoggFileMemBlockOffsets)[conSong.MoggAddressAudioOffset..];
moggArray = XboxSTFSParser.GetFile(conSong.Location, conSong.FLMogg)[conSong.MoggAddressAudioOffset..];
else moggArray = File.ReadAllBytes(conSong.MoggPath)[conSong.MoggAddressAudioOffset..];
} else {
moggArray = File.ReadAllBytes(exConSong.MoggPath)[exConSong.MoggAddressAudioOffset..];
Expand Down
26 changes: 6 additions & 20 deletions Assets/Script/Audio/Bass/BassPreviewContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class BassPreviewContext : IPreviewContext {
private CancellationTokenSource _loadCanceller;

private bool _loadingPreview;
private SongEntry _nextSongToLoad;
private SongEntry _songToLoad;

public BassPreviewContext(IAudioManager manager) {
_manager = manager;
Expand Down Expand Up @@ -60,7 +60,7 @@ await UniTask.WaitUntil(() =>
}

public async UniTask PlayPreview(SongEntry song) {
_nextSongToLoad = null;
_songToLoad = song;

// Skip if preview shouldn't be played
if (song == null || Mathf.Approximately(SettingsManager.Settings.PreviewVolume.Data, 0f)) {
Expand All @@ -73,8 +73,6 @@ public async UniTask PlayPreview(SongEntry song) {
_loadCanceller.Cancel();
_loadCanceller.Dispose();
}

_nextSongToLoad = song;
return;
}

Expand All @@ -93,8 +91,8 @@ public async UniTask PlayPreview(SongEntry song) {
_loadCanceller = new CancellationTokenSource();
var localCanceller = _loadCanceller;

// Wait for a 100 milliseconds to prevent spam loading (no one likes Music Library lag)
await UniTask.Delay(TimeSpan.FromMilliseconds(150.0), ignoreTimeScale: true);
// Wait for a X milliseconds to prevent spam loading (no one likes Music Library lag)
await UniTask.Delay(TimeSpan.FromMilliseconds(300.0), ignoreTimeScale: true);

// Check if cancelled
if (localCanceller.IsCancellationRequested) {
Expand All @@ -104,26 +102,16 @@ public async UniTask PlayPreview(SongEntry song) {
// Load the song
_loadingPreview = true;
await UniTask.RunOnThreadPool(() => {
if (song is ExtractedConSongEntry conSong) {
if (_songToLoad is ExtractedConSongEntry conSong) {
_manager.LoadMogg(conSong, false, SongStem.Crowd);
} else {
_manager.LoadSong(AudioHelpers.GetSupportedStems(song.Location), false, SongStem.Crowd);
_manager.LoadSong(AudioHelpers.GetSupportedStems(_songToLoad.Location), false, SongStem.Crowd);
}
});
_loadingPreview = false;

// Finish here if cancelled
if (localCanceller.IsCancellationRequested) {
// If another song was requested during the load time, just load that
if (_nextSongToLoad != null) {
_manager.UnloadSong();

// The new preview should be un-cancelled
_loadCanceller = new CancellationTokenSource();

await PlayPreview(_nextSongToLoad);
}

return;
}

Expand All @@ -143,8 +131,6 @@ await UniTask.RunOnThreadPool(() => {
// Start the audio
_manager.FadeIn(SettingsManager.Settings.PreviewVolume.Data);
StartLooping().Forget();

return;
}

public void StopPreview() {
Expand Down
2 changes: 1 addition & 1 deletion Assets/Script/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace YARG {
public static class Constants {
public static readonly YargVersion VERSION_TAG = YargVersion.Parse("v0.10.3");
public static readonly YargVersion VERSION_TAG = YargVersion.Parse("v0.10.4");

// General
public const float HIT_MARGIN = 0.095f;
Expand Down
17 changes: 11 additions & 6 deletions Assets/Script/Input/MicInputStrategy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ namespace YARG.Input {
public sealed class MicInputStrategy : InputStrategy {
public const string CONFIRM = "confirm";
public const string BACK = "back";
public const string MENU_ACTION = "menu_action";
public const string MENU_ACTION_1 = "menu_action_1";
public const string MENU_ACTION_2 = "menu_action_2";
public const string MENU_ACTION_3 = "menu_action_3";

public const string PAUSE = "pause";
public const string UP = "up";
Expand Down Expand Up @@ -59,19 +61,20 @@ static MicInputStrategy() {
protected override Dictionary<string, ControlBinding> GetMappings() => new() {
{ CONFIRM, new(BindingType.BUTTON, "Confirm/Select (Green)", CONFIRM) },
{ BACK, new(BindingType.BUTTON, "Back (Red)", BACK) },
{ MENU_ACTION, new(BindingType.BUTTON, "Menu Action (Yellow)", MENU_ACTION) },
{ MENU_ACTION_1, new(BindingType.BUTTON, "Menu Action 1 (Yellow)", MENU_ACTION_1) },
{ MENU_ACTION_2, new(BindingType.BUTTON, "Menu Action 2 (Blue)", MENU_ACTION_2) },
{ MENU_ACTION_3, new(BindingType.BUTTON, "Menu Action 3 (Orange)", MENU_ACTION_3) },

{ PAUSE, new(BindingType.BUTTON, "Pause", PAUSE) },
{ UP, new(BindingType.BUTTON, "Navigate Up", UP) },
{ DOWN, new(BindingType.BUTTON, "Navigate Down", DOWN) },
};

protected override void UpdatePlayerMode() { }

protected override void OnUpdate() {
base.OnUpdate();
UpdatePlayerMode();
}

protected override void UpdatePlayerMode() {
if (microphoneIndex == INVALID_MIC_INDEX) {
return;
}
Expand Down Expand Up @@ -278,7 +281,9 @@ protected override void UpdateNavigationMode() {
NavigationEventForMapping(MenuAction.Confirm, CONFIRM);
NavigationEventForMapping(MenuAction.Back, BACK);

NavigationEventForMapping(MenuAction.Shortcut1, MENU_ACTION);
NavigationEventForMapping(MenuAction.Shortcut1, MENU_ACTION_1);
NavigationEventForMapping(MenuAction.Shortcut2, MENU_ACTION_2);
NavigationEventForMapping(MenuAction.Shortcut3, MENU_ACTION_3);

NavigationEventForMapping(MenuAction.Up, UP);
NavigationEventForMapping(MenuAction.Down, DOWN);
Expand Down
14 changes: 12 additions & 2 deletions Assets/Script/PlayMode/FiveFretTrack.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,12 +188,14 @@ public override void SetReverb(bool on) {
private void UpdateInput() {
// Only want to decrease strum leniency on frames where we didn't strum
bool strummedCurrentNote = false;
bool strumLeniencyEnded = false;
if (strumLeniency > 0f && !strummed) {
strumLeniency -= Time.deltaTime;

if (strumLeniency <= 0f) {
UpdateOverstrums();
//UpdateOverstrums();
strumLeniency = 0f;
strumLeniencyEnded = true;
} else {
RemoveOldAllowedOverstrums();
if (IsOverstrumForgiven()) { // Consume allowed overstrum as soon as it's "hit"
Expand Down Expand Up @@ -222,6 +224,9 @@ private void UpdateInput() {
}

if (expectedHits.Count <= 0) {
if (strumLeniencyEnded) {
UpdateOverstrums();
}
return;
}

Expand Down Expand Up @@ -252,7 +257,8 @@ private void UpdateInput() {

// If strumming to recover combo, skip to first valid note within the timing window.
// This will make it easier to recover.
if ((strummed || strumLeniency > 0f) && !ChordPressed(chord)) {
bool recoveryStrum = Combo > 0 ? strumLeniencyEnded : (strummed || strumLeniency > 0f);
if (recoveryStrum && !ChordPressed(chord)) {
RemoveOldAllowedOverstrums();
var overstrumForgiven = IsOverstrumForgiven(false); // Do NOT consume allowed overstrums; this is done in other parts of the code

Expand All @@ -271,6 +277,7 @@ private void UpdateInput() {

// If found...
if (found) {
strumLeniencyEnded = false;
// Miss all notes previous to the strummed note
while (expectedHits.Peek() != chord) {
var missedChord = expectedHits.Dequeue();
Expand All @@ -286,6 +293,9 @@ private void UpdateInput() {
}
}
}
if (strumLeniencyEnded) { // Strum leniency ended, and suitable strummable note wasn't found; overstrum
UpdateOverstrums();
}
// If tapping to recover combo during tap note section, skip to first valid note within the timing window.
// This will make it easier to recover.
if (Constants.EASY_TAP_RECOVERY && Combo <= 0 && chord[0].tap && !ChordPressed(chord)) {
Expand Down
Loading

0 comments on commit b3ed8ba

Please sign in to comment.