GameItem item image Pixmap

This commit is contained in:
minjaesong
2024-05-22 17:10:50 +09:00
parent fc509de98f
commit 17e25c9cf7
39 changed files with 401 additions and 234 deletions

View File

@@ -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()