FireFox2000000 / Moonscraper-Chart-Editor

BSD 3-Clause "New" or "Revised" License
225 stars 61 forks source link

adding "Detect Files" button to Audio settings page #112

Open chowell1337 opened 1 year ago

chowell1337 commented 1 year ago

Prompts the user for a directory (would prefer if this could be auto-detected) Auto-detects the directory of the currently opened chart and automatically assigns files within that directory to the instrument associated iwth their name

FireFox2000000 commented 10 months ago

Code side looks good, will need to pull down the branch and evaluate the layout next.

FireFox2000000 commented 7 months ago

Bug found-

Auto-detect CH Audio fails to load audio when user is prompted to select a folder via file explorer.

  1. Open Moonscraper in Unity Editor (Windows)
  2. New Song
  3. Audio tab
  4. Select "Auto-Detect CH Files"
  5. Select a song folder containing multiple audio files (Black Window of La Porte was used in testing)
  6. Note audio does not load. Upon some investigation, line 356 of SongPropertiesPanelController is stripping out 1 level of directories in the call Path.GetDirectoryName(currentDir). For example if the path retrieved is E:/GH3 Customs/11.E John 5 Featuring Jim Root - Black Widow of La Porte, the system tries to load from E:/GH3 Customs instead.

Fix requested

FireFox2000000 commented 7 months ago

Bug found-

Multiple assert failures are logged when attempting to use the "Auto-Detect CH Files" button.

  1. Open Moonscraper in Unity Editor (Windows)
  2. Load a song containing multiple audio files (Black Widow of La Porte was used for testing purposes)
  3. Song Properties
  4. Audio tab
  5. Manually clear each stem by clicking the "X" button next to each loaded audio file
  6. Select "Auto-Detect CH Files"
  7. Note assertion failure in console log of Unity Editor for each audio file loaded.
Assertion failed
UnityEngine.Debug:Assert(Boolean)
<KickTasks>d__6:MoveNext() (at Assets/Scripts/Engine/LoadingTasksManager.cs:35)
System.Runtime.CompilerServices.AsyncVoidMethodBuilder:Start(<KickTasks>d__6&)
LoadingTasksManager:KickTasks(IList`1)
<SetAudio>d__51:MoveNext() (at Assets/Scripts/Game/UI/Menus/SongPropertiesPanelController.cs:410)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
SongPropertiesPanelController:LoadInstrumentAudioFromPath(AudioInstrument, String) (at Assets/Scripts/Game/UI/Menus/SongPropertiesPanelController.cs:332)
SongPropertiesPanelController:LoadCloneHeroAudioFromDirectory() (at Assets/Scripts/Game/UI/Menus/SongPropertiesPanelController.cs:366)
UnityEngine.EventSystems.EventSystem:Update() (at C:/buildslave/unity/build/Extensions/guisystem/UnityEngine.UI/EventSystem/EventSystem.cs:377)

Fix requested.