Skip to content

Commit

Permalink
[AAA] Exclude previous charas from roll
Browse files Browse the repository at this point in the history
  • Loading branch information
Keelhauled committed Jul 22, 2024
1 parent 991f261 commit 8e040a7
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions src/AnimeAssAssistant.Core/Assistant.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ChaCustom;
using ChaCustom;
using KKAPI.Utilities;
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -49,9 +49,20 @@ private void LoadRandomChara()
return;
}

var path = files[UnityEngine.Random.Range(0, files.Length - 1)];
loadedCharacters.Add(path);
LoadChara(path);
files = files.Except(loadedCharacters).ToArray();
Log.Debug($"Found {files.Length} new PNG files in {AAA.SearchFolder.Value}");

if(files.Length > 0)
{
var path = files[UnityEngine.Random.Range(0, files.Length - 1)];
loadedCharacters.Add(path);
LoadChara(path);
}
else
{
LoadChara(loadedCharacters[0]);
}

}

private void RecycleCurrentChara()
Expand Down

0 comments on commit 8e040a7

Please sign in to comment.