feat: in-game error display
This commit is contained in:
parent
9599a6d652
commit
b4ffbc0a0d
2 changed files with 103 additions and 13 deletions
|
|
@ -1,4 +1,6 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Analytics;
|
||||
|
||||
namespace GBSU.Addons;
|
||||
|
|
@ -31,4 +33,28 @@ public class Helper
|
|||
Plugin.Log.LogError("Could not create rotation folder path: " + e.Message);
|
||||
}
|
||||
}
|
||||
public static string FilesInRotationDir()
|
||||
{
|
||||
// https://stackoverflow.com/a/14877330
|
||||
DirectoryInfo d = new(RotationFolderPath);
|
||||
FileInfo[] files = d.GetFiles();
|
||||
int number = files.Length;
|
||||
|
||||
// no files?
|
||||
if (number == 0)
|
||||
{
|
||||
return @"No files were found in the directory.";
|
||||
}
|
||||
else
|
||||
{
|
||||
string names = "";
|
||||
|
||||
foreach(FileInfo file in files)
|
||||
{
|
||||
names = file.Name + " " + names;
|
||||
}
|
||||
|
||||
return $"There are {number} files: {names}";
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue