mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-13 23:26:07 +09:00
Renamed AppLoader into App
This commit is contained in:
@@ -3,7 +3,7 @@ package net.torvald.terrarum.ui
|
||||
import com.badlogic.gdx.graphics.Camera
|
||||
import com.badlogic.gdx.graphics.Color
|
||||
import com.badlogic.gdx.graphics.g2d.SpriteBatch
|
||||
import net.torvald.terrarum.AppLoader
|
||||
import net.torvald.terrarum.App
|
||||
import net.torvald.terrarum.ModMgr
|
||||
import net.torvald.terrarum.blendNormal
|
||||
import net.torvald.terrarum.floor
|
||||
@@ -16,9 +16,9 @@ class UIItemModuleInfoCell(
|
||||
initialY: Int
|
||||
) : UIItem(parent, initialX, initialY) {
|
||||
|
||||
override val height: Int = AppLoader.fontGame.lineHeight.toInt() * 2
|
||||
override val height: Int = App.fontGame.lineHeight.toInt() * 2
|
||||
|
||||
private val numberAreaWidth = AppLoader.fontSmallNumbers.W * 3 + 4
|
||||
private val numberAreaWidth = App.fontSmallNumbers.W * 3 + 4
|
||||
|
||||
override fun render(batch: SpriteBatch, camera: Camera) {
|
||||
blendNormal(batch)
|
||||
@@ -28,53 +28,53 @@ class UIItemModuleInfoCell(
|
||||
|
||||
// print load order index
|
||||
batch.color = Color(0xccccccff.toInt())
|
||||
var strlen = AppLoader.fontSmallNumbers.getWidth(modInfo.order.toString())
|
||||
AppLoader.fontSmallNumbers.draw(batch,
|
||||
var strlen = App.fontSmallNumbers.getWidth(modInfo.order.toString())
|
||||
App.fontSmallNumbers.draw(batch,
|
||||
modInfo.order.toString(),
|
||||
posX + (numberAreaWidth - strlen).div(2f).floor(),
|
||||
posY + (height - AppLoader.fontSmallNumbers.H).div(2f).floor()
|
||||
posY + (height - App.fontSmallNumbers.H).div(2f).floor()
|
||||
)
|
||||
|
||||
// print module name
|
||||
batch.color = Color.WHITE
|
||||
AppLoader.fontGame.draw(batch,
|
||||
App.fontGame.draw(batch,
|
||||
"${modInfo.properName} (${modInfo.version})",
|
||||
posX + numberAreaWidth.toFloat(),
|
||||
posY.toFloat()
|
||||
)
|
||||
|
||||
// print author name
|
||||
strlen = AppLoader.fontGame.getWidth(modInfo.author)
|
||||
AppLoader.fontGame.draw(batch,
|
||||
strlen = App.fontGame.getWidth(modInfo.author)
|
||||
App.fontGame.draw(batch,
|
||||
modInfo.author,
|
||||
posX + width - strlen.toFloat(),
|
||||
posY.toFloat()
|
||||
)
|
||||
|
||||
// print description
|
||||
AppLoader.fontGame.draw(batch,
|
||||
App.fontGame.draw(batch,
|
||||
modInfo.description,
|
||||
posX + numberAreaWidth.toFloat(),
|
||||
posY + AppLoader.fontGame.lineHeight
|
||||
posY + App.fontGame.lineHeight
|
||||
)
|
||||
|
||||
// print releasedate
|
||||
strlen = AppLoader.fontGame.getWidth(modInfo.releaseDate)
|
||||
AppLoader.fontGame.draw(batch,
|
||||
strlen = App.fontGame.getWidth(modInfo.releaseDate)
|
||||
App.fontGame.draw(batch,
|
||||
modInfo.releaseDate,
|
||||
posX + width - strlen.toFloat(),
|
||||
posY + AppLoader.fontGame.lineHeight
|
||||
posY + App.fontGame.lineHeight
|
||||
)
|
||||
|
||||
}
|
||||
else {
|
||||
batch.color = Color(0xff8080_ff.toInt())
|
||||
val str = "InternalError: no such module: '$moduleName'"
|
||||
val strlen = AppLoader.fontSmallNumbers.getWidth(str)
|
||||
AppLoader.fontSmallNumbers.draw(batch,
|
||||
val strlen = App.fontSmallNumbers.getWidth(str)
|
||||
App.fontSmallNumbers.draw(batch,
|
||||
str,
|
||||
posX + (width - numberAreaWidth - strlen).div(2f).floor() + numberAreaWidth,
|
||||
posY + (height - AppLoader.fontSmallNumbers.H).div(2f).floor()
|
||||
posY + (height - App.fontSmallNumbers.H).div(2f).floor()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user