mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-10 02:24:05 +09:00
font update
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -3,4 +3,4 @@
|
|||||||
# You can disable basegame, but we don't recommend.
|
# You can disable basegame, but we don't recommend.
|
||||||
|
|
||||||
basegame
|
basegame
|
||||||
#dwarventech
|
dwarventech
|
||||||
|
|||||||
|
@@ -1 +0,0 @@
|
|||||||
println("Hello, script !")
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
print "Hello, world!"
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
import net.torvald.terrarum.ModMgr
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by minjaesong on 2017-04-26.
|
|
||||||
*/
|
|
||||||
|
|
||||||
static void invoke(String module) {
|
|
||||||
ModMgr.GameBlockLoader.invoke(module)
|
|
||||||
ModMgr.GameItemLoader.invoke(module)
|
|
||||||
ModMgr.GameLanguageLoader.invoke(module)
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
|
|
||||||
println("Hello, world!!")
|
|
||||||
return 42
|
|
||||||
Binary file not shown.
@@ -102,116 +102,119 @@ object ModMgr {
|
|||||||
fun getTitleScreen(batch: SpriteBatch): IngameInstance? = entryPointClasses.getOrNull(0)?.getTitleScreen(batch)
|
fun getTitleScreen(batch: SpriteBatch): IngameInstance? = entryPointClasses.getOrNull(0)?.getTitleScreen(batch)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
// load modules
|
val loadOrderFile = FileSystems.getDefault().getPath("$modDir/LoadOrder.csv").toFile()
|
||||||
val loadOrderCSVparser = CSVParser.parse(
|
if (loadOrderFile.exists()) {
|
||||||
FileSystems.getDefault().getPath("$modDir/LoadOrder.csv").toFile(),
|
|
||||||
Charsets.UTF_8,
|
// load modules
|
||||||
CSVFormat.DEFAULT.withCommentMarker('#')
|
val loadOrderCSVparser = CSVParser.parse(
|
||||||
)
|
loadOrderFile,
|
||||||
val loadOrder = loadOrderCSVparser.records
|
Charsets.UTF_8,
|
||||||
loadOrderCSVparser.close()
|
CSVFormat.DEFAULT.withCommentMarker('#')
|
||||||
|
)
|
||||||
|
val loadOrder = loadOrderCSVparser.records
|
||||||
|
loadOrderCSVparser.close()
|
||||||
|
|
||||||
|
|
||||||
loadOrder.forEachIndexed { index, it ->
|
loadOrder.forEachIndexed { index, it ->
|
||||||
val moduleName = it[0]
|
val moduleName = it[0]
|
||||||
this.loadOrder.add(moduleName)
|
this.loadOrder.add(moduleName)
|
||||||
printmsg(this, "Loading module $moduleName")
|
printmsg(this, "Loading module $moduleName")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
val modMetadata = Properties()
|
val modMetadata = Properties()
|
||||||
modMetadata.load(FileInputStream("$modDir/$moduleName/$metaFilename"))
|
modMetadata.load(FileInputStream("$modDir/$moduleName/$metaFilename"))
|
||||||
|
|
||||||
if (File("$modDir/$moduleName/$defaultConfigFilename").exists()) {
|
if (File("$modDir/$moduleName/$defaultConfigFilename").exists()) {
|
||||||
val defaultConfig = JsonFetcher("$modDir/$moduleName/$defaultConfigFilename")
|
val defaultConfig = JsonFetcher("$modDir/$moduleName/$defaultConfigFilename")
|
||||||
// read config and store it to the game
|
// read config and store it to the game
|
||||||
|
|
||||||
// write to user's config file
|
// write to user's config file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
val properName = modMetadata.getProperty("propername")
|
val properName = modMetadata.getProperty("propername")
|
||||||
val description = modMetadata.getProperty("description")
|
val description = modMetadata.getProperty("description")
|
||||||
val author = modMetadata.getProperty("author")
|
val author = modMetadata.getProperty("author")
|
||||||
val packageName = modMetadata.getProperty("package")
|
val packageName = modMetadata.getProperty("package")
|
||||||
val entryPoint = modMetadata.getProperty("entrypoint")
|
val entryPoint = modMetadata.getProperty("entrypoint")
|
||||||
val releaseDate = modMetadata.getProperty("releasedate")
|
val releaseDate = modMetadata.getProperty("releasedate")
|
||||||
val version = modMetadata.getProperty("version")
|
val version = modMetadata.getProperty("version")
|
||||||
val jar = modMetadata.getProperty("jar")
|
val jar = modMetadata.getProperty("jar")
|
||||||
val dependency = modMetadata.getProperty("dependency").split(Regex(""";[ ]*""")).toTypedArray()
|
val dependency = modMetadata.getProperty("dependency").split(Regex(""";[ ]*""")).toTypedArray()
|
||||||
val isDir = FileSystems.getDefault().getPath("$modDir/$moduleName").toFile().isDirectory
|
val isDir = FileSystems.getDefault().getPath("$modDir/$moduleName").toFile().isDirectory
|
||||||
moduleInfo[moduleName] = ModuleMetadata(index, isDir, Gdx.files.internal("$modDir/$moduleName/icon.png"), properName, description, author, packageName, entryPoint, releaseDate, version, jar, dependency)
|
moduleInfo[moduleName] = ModuleMetadata(index, isDir, Gdx.files.internal("$modDir/$moduleName/icon.png"), properName, description, author, packageName, entryPoint, releaseDate, version, jar, dependency)
|
||||||
|
|
||||||
printdbg(this, moduleInfo[moduleName])
|
printdbg(this, moduleInfo[moduleName])
|
||||||
|
|
||||||
|
|
||||||
// run entry script in entry point
|
// run entry script in entry point
|
||||||
if (entryPoint.isNotBlank()) {
|
if (entryPoint.isNotBlank()) {
|
||||||
var newClass: Class<*>? = null
|
var newClass: Class<*>? = null
|
||||||
try {
|
try {
|
||||||
// for modules that has JAR defined
|
// for modules that has JAR defined
|
||||||
if (jar.isNotBlank()) {
|
if (jar.isNotBlank()) {
|
||||||
val urls = arrayOf<URL>()
|
val urls = arrayOf<URL>()
|
||||||
|
|
||||||
val cl = JarFileLoader(urls)
|
val cl = JarFileLoader(urls)
|
||||||
cl.addFile("${File(modDir).absolutePath}/$moduleName/$jar")
|
cl.addFile("${File(modDir).absolutePath}/$moduleName/$jar")
|
||||||
moduleClassloader[moduleName] = cl
|
moduleClassloader[moduleName] = cl
|
||||||
newClass = cl.loadClass(entryPoint)
|
newClass = cl.loadClass(entryPoint)
|
||||||
|
}
|
||||||
|
// for modules that are not (meant to be used by the "basegame" kind of modules)
|
||||||
|
else {
|
||||||
|
newClass = Class.forName(entryPoint)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (e: Throwable) {
|
||||||
|
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)?.let { moduleInfoErrored[moduleName] = it }
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newClass != null) {
|
||||||
|
val newClassConstructor = newClass.getConstructor(/* no args defined */)
|
||||||
|
val newClassInstance = newClassConstructor.newInstance(/* no args defined */)
|
||||||
|
|
||||||
|
entryPointClasses.add(newClassInstance as ModuleEntryPoint)
|
||||||
|
(newClassInstance as ModuleEntryPoint).invoke()
|
||||||
|
|
||||||
|
printdbg(this, "$moduleName loaded successfully")
|
||||||
}
|
}
|
||||||
// for modules that are not (meant to be used by the "basegame" kind of modules)
|
|
||||||
else {
|
else {
|
||||||
newClass = Class.forName(entryPoint)
|
moduleInfo.remove(moduleName)?.let { moduleInfoErrored[moduleName] = it }
|
||||||
|
printdbg(this, "$moduleName did not load...")
|
||||||
}
|
}
|
||||||
}
|
|
||||||
catch (e: Throwable) {
|
|
||||||
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)?.let { moduleInfoErrored[moduleName] = it }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newClass != null) {
|
printdbg(this, "Module $moduleName processed")
|
||||||
val newClassConstructor = newClass.getConstructor(/* no args defined */)
|
}
|
||||||
val newClassInstance = newClassConstructor.newInstance(/* no args defined */)
|
catch (noSuchModule: FileNotFoundException) {
|
||||||
|
printdbgerr(this, "No such module: $moduleName, skipping...")
|
||||||
|
|
||||||
entryPointClasses.add(newClassInstance as ModuleEntryPoint)
|
logError(LoadErrorType.NOT_EVEN_THERE, moduleName)
|
||||||
(newClassInstance as ModuleEntryPoint).invoke()
|
|
||||||
|
|
||||||
printdbg(this, "$moduleName loaded successfully")
|
moduleInfo.remove(moduleName)?.let { moduleInfoErrored[moduleName] = it }
|
||||||
}
|
}
|
||||||
else {
|
catch (e: Throwable) {
|
||||||
moduleInfo.remove(moduleName)?.let { moduleInfoErrored[moduleName] = it }
|
printdbgerr(this, "There was an error while loading module $moduleName")
|
||||||
printdbg(this, "$moduleName did not load...")
|
printdbgerr(this, "\t$e")
|
||||||
}
|
print(App.csiR); e.printStackTrace(System.out); print(App.csi0)
|
||||||
|
|
||||||
|
logError(LoadErrorType.YOUR_FAULT, moduleName, e)
|
||||||
|
|
||||||
|
moduleInfo.remove(moduleName)?.let { moduleInfoErrored[moduleName] = it }
|
||||||
|
}
|
||||||
|
finally {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
printdbg(this, "Module $moduleName processed")
|
|
||||||
}
|
|
||||||
catch (noSuchModule: FileNotFoundException) {
|
|
||||||
printdbgerr(this, "No such module: $moduleName, skipping...")
|
|
||||||
|
|
||||||
logError(LoadErrorType.NOT_EVEN_THERE, moduleName)
|
|
||||||
|
|
||||||
moduleInfo.remove(moduleName)?.let { moduleInfoErrored[moduleName] = it }
|
|
||||||
}
|
|
||||||
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)?.let { moduleInfoErrored[moduleName] = it }
|
|
||||||
}
|
|
||||||
finally {
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
operator fun invoke() { }
|
operator fun invoke() { }
|
||||||
|
|||||||
@@ -27,10 +27,10 @@ Aucun module n’est actuellement chargé.
|
|||||||
Veuillez reconfigurer votre ordre de chargement sur :
|
Veuillez reconfigurer votre ordre de chargement sur :
|
||||||
|
|
||||||
現在ロードされたモジュールがありません。
|
現在ロードされたモジュールがありません。
|
||||||
次のパスでロードオーダーを再設定してください。
|
次のファイルでロードオーダーを再設定してください。
|
||||||
|
|
||||||
현재 불러와진 모듈이 없습니다.
|
현재 불러와진 모듈이 없습니다.
|
||||||
다음의 경로에서 불러오기 순서를 재설정하십시오.
|
다음의 파일에서 불러오기 순서를 재설정하십시오.
|
||||||
|
|
||||||
В настоящее время модуль не загружен.
|
В настоящее время модуль не загружен.
|
||||||
Измените конфигурацию вашего порядка загрузки на:
|
Измените конфигурацию вашего порядка загрузки на:
|
||||||
|
|||||||
Reference in New Issue
Block a user