mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-12 06:41:51 +09:00
new test sprite/display screencaps for imported avatars if available
This commit is contained in:
@@ -351,6 +351,14 @@ class SavegameCollectionPair(private val player: SavegameCollection?, private va
|
||||
fun getImportedPlayer(): DiskSkimmer? {
|
||||
return if (isImported) player!!.loadable() else null
|
||||
}
|
||||
|
||||
fun getPlayerThumbnailPixmap(width: Int, height: Int, shrinkage: Double): Pixmap? {
|
||||
return player?.loadable()?.getThumbnailPixmap(width, height, shrinkage)
|
||||
}
|
||||
|
||||
fun getWorldThumbnailPixmap(width: Int, height: Int, shrinkage: Double): Pixmap? {
|
||||
return world?.loadable()?.getThumbnailPixmap(width, height, shrinkage)
|
||||
}
|
||||
}
|
||||
|
||||
data class DiskPair(val player: DiskSkimmer, val world: DiskSkimmer) {
|
||||
|
||||
@@ -813,8 +813,8 @@ fun AppUpdateListOfSavegames() {
|
||||
// if multiple valid savegames with same UUID exist, only the most recent one is retained
|
||||
if (!App.savegameWorlds.contains(worldUUID)) {
|
||||
App.savegameWorlds[worldUUID] = collection
|
||||
App.savegameWorldsName[worldUUID] = it.getDiskName(Common.CHARSET)
|
||||
App.sortedSavegameWorlds.add(worldUUID)
|
||||
App.savegameWorldsName[worldUUID] = it.getDiskName(Common.CHARSET)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -848,8 +848,8 @@ fun AppUpdateListOfSavegames() {
|
||||
// if multiple valid savegames with same UUID exist, only the most recent one is retained
|
||||
if (!App.savegamePlayers.contains(playerUUID)) {
|
||||
App.savegamePlayers[playerUUID] = collection
|
||||
App.savegamePlayersName[playerUUID] = it.getDiskName(Common.CHARSET)
|
||||
App.sortedPlayers.add(playerUUID)
|
||||
App.savegamePlayersName[playerUUID] = it.getDiskName(Common.CHARSET)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -12,11 +12,11 @@ import net.torvald.terrarum.gameactors.AVKey
|
||||
object PlayerBuilderWerebeastTest {
|
||||
operator fun invoke(): IngamePlayer {
|
||||
val p: IngamePlayer = IngamePlayer(
|
||||
ModMgr.getGdxFile("basegame", "sprites/taimu.properties").path(),
|
||||
ModMgr.getGdxFile("basegame", "sprites/taimu_glow.properties").path(),
|
||||
ModMgr.getGdxFile("basegame", "sprites/taimu2.properties").path(),
|
||||
ModMgr.getGdxFile("basegame", "sprites/taimu2_glow.properties").path(),
|
||||
-589141658L // random value thrown
|
||||
)
|
||||
InjectCreatureRaw(p.actorValue, "basegame", "CreatureWerebeastBase.json")
|
||||
InjectCreatureRaw(p.actorValue, "basegame", "CreatureWerebeastBossBase.json")
|
||||
|
||||
|
||||
p.actorValue[AVKey.__PLAYER_QUICKSLOTSEL] = 0
|
||||
@@ -24,14 +24,8 @@ object PlayerBuilderWerebeastTest {
|
||||
p.actorValue[AVKey.ACTION_INTERVAL] = ActorHumanoid.BASE_ACTION_INTERVAL
|
||||
p.actorValue[AVKey.NAME] = "Taimu"
|
||||
|
||||
|
||||
/*p.makeNewSprite(TextureRegionPack(ModMgr.getGdxFile("basegame", "sprites/npc_template_anim_prototype.tga"), 48, 52))
|
||||
p.sprite!!.delays = floatArrayOf(2f, 1f/12f) // second value does nothing -- overridden by ActorHumanoid.updateSprite(float)
|
||||
p.sprite!!.setRowsAndFrames(2, 4)*/
|
||||
|
||||
p.animDesc?.let { p.sprite = AssembledSpriteAnimation(it, p, false) }
|
||||
p.animDescGlow?.let { p.spriteGlow = AssembledSpriteAnimation(it, p, true) }
|
||||
//p.reassembleSprite(p.sprite, p.spriteGlow, null)
|
||||
p.setHitboxDimension(22, p.actorValue.getAsInt(AVKey.BASEHEIGHT)!!, 30, 0)
|
||||
|
||||
p.setPosition(3.0 * TILE_SIZE, 3.0 * TILE_SIZE)
|
||||
|
||||
@@ -542,7 +542,7 @@ class UIItemPlayerCells(
|
||||
savegameStatus = savegamePair.status
|
||||
// pixmapManual = savegamePair.getManualSave()?.player?.getThumbnailPixmap(SAVE_THUMBNAIL_MAIN_WIDTH, SAVE_THUMBNAIL_MAIN_HEIGHT, 2.0)
|
||||
// pixmapAuto = savegamePair.getAutoSave()?.player?.getThumbnailPixmap(SAVE_THUMBNAIL_MAIN_WIDTH, SAVE_THUMBNAIL_MAIN_HEIGHT, 2.0)
|
||||
savegameThumbnailPixmap = savegamePair.getLoadableSave()?.player?.getThumbnailPixmap(SAVE_THUMBNAIL_MAIN_WIDTH, SAVE_THUMBNAIL_MAIN_HEIGHT, 2.0)
|
||||
savegameThumbnailPixmap = savegamePair.getPlayerThumbnailPixmap(SAVE_THUMBNAIL_MAIN_WIDTH, SAVE_THUMBNAIL_MAIN_HEIGHT, 2.0)
|
||||
|
||||
isImported = savegamePair.isImported
|
||||
}
|
||||
|
||||
@@ -217,10 +217,10 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
||||
mainButtons.forEach { it.render(batch, camera) }
|
||||
|
||||
// draw thumbnails of the most recent game
|
||||
val tex = screencap ?: CommonResourcePool.getAsTextureRegion("terrarum-defaultsavegamethumb")
|
||||
// val tex = screencap ?: CommonResourcePool.getAsTextureRegion("terrarum-defaultsavegamethumb")
|
||||
|
||||
|
||||
if (full.loadables.saveAvaliable()) {
|
||||
if (screencap != null) {
|
||||
val tx = (Toolkit.drawWidth - screencapW) / 2
|
||||
val tys = full.titleTopGradEnd + SAVE_CELL_HEIGHT + buttonGap
|
||||
val tye = buttonRowY2 - buttonGap
|
||||
@@ -232,7 +232,7 @@ class UILoadManage(val full: UILoadSavegame) : UICanvas() {
|
||||
Toolkit.fillArea(batch, tx, ty, screencapW, screencapH)
|
||||
|
||||
batch.color = Color.WHITE
|
||||
batch.draw(tex, tx.toFloat(), ty.toFloat(), screencapW.toFloat(), screencapH.toFloat())
|
||||
batch.draw(screencap, tx.toFloat(), ty.toFloat(), screencapW.toFloat(), screencapH.toFloat())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.torvald.terrarum.App.printdbg
|
||||
import net.torvald.terrarum.gameactors.AVKey
|
||||
import net.torvald.terrarum.langpack.Lang
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.PlayerBuilderTestSubject1
|
||||
import net.torvald.terrarum.modulebasegame.gameactors.PlayerBuilderWerebeastTest
|
||||
import net.torvald.terrarum.savegame.DiskSkimmer
|
||||
import net.torvald.terrarum.savegame.VDUtil
|
||||
import net.torvald.terrarum.savegame.VirtualDisk
|
||||
@@ -55,7 +56,8 @@ class UINewCharacter(val remoCon: UIRemoCon) : UICanvas() {
|
||||
uiLocked = true
|
||||
|
||||
|
||||
val player = PlayerBuilderTestSubject1()
|
||||
// val player = PlayerBuilderTestSubject1()
|
||||
val player = PlayerBuilderWerebeastTest()
|
||||
player.actorValue[AVKey.NAME] = nameInput.getTextOrPlaceholder()
|
||||
|
||||
val disk = VDUtil.createNewDisk(
|
||||
|
||||
@@ -320,7 +320,7 @@ class SpriteAssemblerPreview: Game() {
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
val appConfig = Lwjgl3ApplicationConfiguration()
|
||||
appConfig.setWindowedMode(1024, 1024)
|
||||
appConfig.setWindowedMode(1536, 1024)
|
||||
appConfig.setIdleFPS(5)
|
||||
appConfig.setForegroundFPS(5)
|
||||
appConfig.setResizable(false)
|
||||
|
||||
Reference in New Issue
Block a user