shaders moved to subdir; console click on the actor to type its id in

This commit is contained in:
minjaesong
2021-12-04 16:16:01 +09:00
parent 63487a1386
commit c0b2f4c8df
62 changed files with 352 additions and 25 deletions

View File

@@ -63,6 +63,19 @@ object ModMgr {
"\tJarfile: $jar\n" +
"\tDependencies: ${dependencies.joinToString("\n\t")}"
}
data class ModuleErrorInfo(
val type: LoadErrorType,
val moduleName: String,
val cause: Throwable? = null,
)
enum class LoadErrorType {
YOUR_FAULT,
MY_FAULT,
NOT_EVEN_THERE
}
const val modDir = "./assets/mods"
/** Module name (directory name), ModuleMetadata */
@@ -73,6 +86,12 @@ object ModMgr {
val loadOrder = ArrayList<String>()
val errorLogs = ArrayList<ModuleErrorInfo>()
fun logError(type: LoadErrorType, moduleName: String, cause: Throwable? = null) {
errorLogs.add(ModuleErrorInfo(type, moduleName, cause))
}
init {
// load modules
val loadOrderCSVparser = CSVParser.parse(
@@ -139,6 +158,9 @@ object ModMgr {
printdbgerr(this, "$moduleName failed to load, skipping...")
printdbgerr(this, "\t$e")
print(App.csiR); e.printStackTrace(System.out); print(App.csi0)
logError(LoadErrorType.YOUR_FAULT, moduleName, e)
moduleInfo.remove(moduleName)
}
@@ -162,12 +184,18 @@ object ModMgr {
}
catch (noSuchModule: FileNotFoundException) {
printdbgerr(this, "No such module: $moduleName, skipping...")
logError(LoadErrorType.NOT_EVEN_THERE, moduleName)
moduleInfo.remove(moduleName)
}
catch (e: Throwable) {
printdbgerr(this, "There was an error while loading module $moduleName")
printdbgerr(this, "\t$e")
print(App.csiR); e.printStackTrace(System.out); print(App.csi0)
logError(LoadErrorType.YOUR_FAULT, moduleName, e)
moduleInfo.remove(moduleName)
}
finally {