feat: in-game error display

This commit is contained in:
anavoi 2025-07-12 23:39:20 +02:00
commit b4ffbc0a0d
2 changed files with 103 additions and 13 deletions

View file

@ -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}";
}
}
}