mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-06-09 10:04:05 +09:00
GameItem item image Pixmap
This commit is contained in:
@@ -973,9 +973,10 @@ object BTeXParser {
|
||||
val btexObjName = "IMG@${makeRandomObjName()}"
|
||||
val img = attribs["src"]
|
||||
val fromgame = attribs["fromgame"]
|
||||
val itemimg = attribs["itemimg"]
|
||||
val caption = attribs["caption"]
|
||||
|
||||
if (listOf(img, fromgame).count { it != null } != 1) {
|
||||
if (listOf(img, fromgame, itemimg).count { it != null } != 1) {
|
||||
throw IllegalArgumentException()
|
||||
}
|
||||
|
||||
@@ -1010,6 +1011,9 @@ object BTeXParser {
|
||||
val modulePath = fromgame.substringAfter(':')
|
||||
Pixmap(ModMgr.getGdxFile(moduleName, modulePath))
|
||||
}
|
||||
else if (itemimg != null) {
|
||||
ItemCodex.getItemImagePixmap(itemimg)!!
|
||||
}
|
||||
else throw InternalError()
|
||||
|
||||
val imgWidth = (imgHeight.toFloat() / inputPixmap.height * inputPixmap.width).roundToInt()
|
||||
|
||||
Reference in New Issue
Block a user