mirror of
https://github.com/nacabaro/vbhelper.git
synced 2026-06-05 13:52:54 +00:00
Removed debugging logging.
This commit is contained in:
parent
d1908d629a
commit
c4450296db
@ -63,14 +63,11 @@ fun AnimatedSpriteImage(
|
|||||||
// Update sprite when animation state changes
|
// Update sprite when animation state changes
|
||||||
LaunchedEffect(animationStateMachine.currentFrameNumber) {
|
LaunchedEffect(animationStateMachine.currentFrameNumber) {
|
||||||
val frameNumber = animationStateMachine.getCurrentFrame()
|
val frameNumber = animationStateMachine.getCurrentFrame()
|
||||||
|
|
||||||
println("Loading animated sprite frame: $frameNumber for character: $characterId")
|
|
||||||
bitmap = spriteManager.loadSpriteFrame(characterId, frameNumber)
|
bitmap = spriteManager.loadSpriteFrame(characterId, frameNumber)
|
||||||
|
|
||||||
if (bitmap == null) {
|
if (bitmap == null) {
|
||||||
println("Failed to load animated sprite frame: $frameNumber for character: $characterId")
|
println("Failed to load animated sprite frame: $frameNumber for character: $characterId")
|
||||||
} else {
|
|
||||||
println("Successfully loaded animated sprite frame: $frameNumber for character: $characterId")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -112,7 +112,6 @@ class ArenaBattleSystem {
|
|||||||
val opponentAttackIsHit: Boolean get() = _opponentAttackIsHit
|
val opponentAttackIsHit: Boolean get() = _opponentAttackIsHit
|
||||||
|
|
||||||
fun startPlayerAttack() {
|
fun startPlayerAttack() {
|
||||||
Log.d(TAG, "Starting player attack")
|
|
||||||
_attackPhase = 1
|
_attackPhase = 1
|
||||||
_attackProgress = 0f
|
_attackProgress = 0f
|
||||||
_isPlayerAttacking = true
|
_isPlayerAttacking = true
|
||||||
@ -121,7 +120,6 @@ class ArenaBattleSystem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun startOpponentAttack() {
|
fun startOpponentAttack() {
|
||||||
Log.d(TAG, "Starting opponent attack")
|
|
||||||
_attackPhase = 3
|
_attackPhase = 3
|
||||||
_attackProgress = 0f
|
_attackProgress = 0f
|
||||||
_isPlayerAttacking = false
|
_isPlayerAttacking = false
|
||||||
@ -131,7 +129,6 @@ class ArenaBattleSystem {
|
|||||||
fun advanceAttackPhase() {
|
fun advanceAttackPhase() {
|
||||||
_attackPhase++
|
_attackPhase++
|
||||||
_attackProgress = 0f
|
_attackProgress = 0f
|
||||||
Log.d(TAG, "Advanced to attack phase: $_attackPhase")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setAttackProgress(progress: Float) {
|
fun setAttackProgress(progress: Float) {
|
||||||
@ -144,12 +141,10 @@ class ArenaBattleSystem {
|
|||||||
|
|
||||||
fun switchToView(view: Int) {
|
fun switchToView(view: Int) {
|
||||||
_currentView = view
|
_currentView = view
|
||||||
Log.d(TAG, "Switched to view: $view")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun enableAttackButton() {
|
fun enableAttackButton() {
|
||||||
_isAttackButtonEnabled = true
|
_isAttackButtonEnabled = true
|
||||||
Log.d(TAG, "Attack button enabled")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun applyDamage(isPlayer: Boolean, damage: Float) {
|
fun applyDamage(isPlayer: Boolean, damage: Float) {
|
||||||
@ -158,19 +153,16 @@ class ArenaBattleSystem {
|
|||||||
} else {
|
} else {
|
||||||
_opponentHP = (_opponentHP - damage).coerceAtLeast(0f)
|
_opponentHP = (_opponentHP - damage).coerceAtLeast(0f)
|
||||||
}
|
}
|
||||||
Log.d(TAG, "Applied damage: ${if (isPlayer) "player" else "opponent"} -$damage")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateHPFromAPI(playerHP: Float, opponentHP: Float) {
|
fun updateHPFromAPI(playerHP: Float, opponentHP: Float) {
|
||||||
_playerHP = playerHP
|
_playerHP = playerHP
|
||||||
_opponentHP = opponentHP
|
_opponentHP = opponentHP
|
||||||
Log.d(TAG, "Updated HP from API: Player=$playerHP, Opponent=$opponentHP")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun initializeHP(playerMaxHP: Float, opponentMaxHP: Float) {
|
fun initializeHP(playerMaxHP: Float, opponentMaxHP: Float) {
|
||||||
_playerHP = playerMaxHP
|
_playerHP = playerMaxHP
|
||||||
_opponentHP = opponentMaxHP
|
_opponentHP = opponentMaxHP
|
||||||
Log.d(TAG, "Initialized HP: Player=$playerMaxHP, Opponent=$opponentMaxHP")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun completeAttackAnimation(playerDamage: Float = 0f, opponentDamage: Float = 0f) {
|
fun completeAttackAnimation(playerDamage: Float = 0f, opponentDamage: Float = 0f) {
|
||||||
@ -180,7 +172,6 @@ class ArenaBattleSystem {
|
|||||||
if (opponentDamage > 0f) {
|
if (opponentDamage > 0f) {
|
||||||
applyDamage(false, opponentDamage)
|
applyDamage(false, opponentDamage)
|
||||||
}
|
}
|
||||||
Log.d(TAG, "Completed attack animation with damage: Player=$playerDamage, Opponent=$opponentDamage")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun resetAttackState() {
|
fun resetAttackState() {
|
||||||
@ -209,7 +200,6 @@ class ArenaBattleSystem {
|
|||||||
_shouldCounterAttack = false
|
_shouldCounterAttack = false
|
||||||
_counterAttackIsHit = false
|
_counterAttackIsHit = false
|
||||||
_opponentAttackIsHit = false
|
_opponentAttackIsHit = false
|
||||||
Log.d(TAG, "Reset attack state")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun checkBattleOver(): Boolean {
|
fun checkBattleOver(): Boolean {
|
||||||
@ -218,7 +208,6 @@ class ArenaBattleSystem {
|
|||||||
|
|
||||||
fun endBattle() {
|
fun endBattle() {
|
||||||
_isBattleOver = true
|
_isBattleOver = true
|
||||||
Log.d(TAG, "Battle ended")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun updateCritBarProgress(progress: Int) {
|
fun updateCritBarProgress(progress: Int) {
|
||||||
@ -231,7 +220,6 @@ class ArenaBattleSystem {
|
|||||||
_isDodging = true
|
_isDodging = true
|
||||||
_dodgeProgress = 0f
|
_dodgeProgress = 0f
|
||||||
_dodgeDirection = 1f // Start moving up
|
_dodgeDirection = 1f // Start moving up
|
||||||
Log.d(TAG, "Started dodge animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setDodgeProgress(progress: Float) {
|
fun setDodgeProgress(progress: Float) {
|
||||||
@ -245,14 +233,12 @@ class ArenaBattleSystem {
|
|||||||
fun endDodge() {
|
fun endDodge() {
|
||||||
_isDodging = false
|
_isDodging = false
|
||||||
_dodgeProgress = 0f
|
_dodgeProgress = 0f
|
||||||
Log.d(TAG, "Ended dodge animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hit animation methods
|
// Hit animation methods
|
||||||
fun startHit() {
|
fun startHit() {
|
||||||
_isHit = true
|
_isHit = true
|
||||||
_hitProgress = 0f
|
_hitProgress = 0f
|
||||||
Log.d(TAG, "Started hit animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setHitProgress(progress: Float) {
|
fun setHitProgress(progress: Float) {
|
||||||
@ -262,7 +248,6 @@ class ArenaBattleSystem {
|
|||||||
fun endHit() {
|
fun endHit() {
|
||||||
_isHit = false
|
_isHit = false
|
||||||
_hitProgress = 0f
|
_hitProgress = 0f
|
||||||
Log.d(TAG, "Ended hit animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Player-specific dodge methods
|
// Player-specific dodge methods
|
||||||
@ -270,13 +255,11 @@ class ArenaBattleSystem {
|
|||||||
_isPlayerDodging = true
|
_isPlayerDodging = true
|
||||||
_playerDodgeProgress = 0f
|
_playerDodgeProgress = 0f
|
||||||
_playerDodgeDirection = 1f
|
_playerDodgeDirection = 1f
|
||||||
Log.d(TAG, "Started player dodge animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun endPlayerDodge() {
|
fun endPlayerDodge() {
|
||||||
_isPlayerDodging = false
|
_isPlayerDodging = false
|
||||||
_playerDodgeProgress = 0f
|
_playerDodgeProgress = 0f
|
||||||
Log.d(TAG, "Ended player dodge animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setPlayerDodgeProgress(progress: Float) {
|
fun setPlayerDodgeProgress(progress: Float) {
|
||||||
@ -292,13 +275,11 @@ class ArenaBattleSystem {
|
|||||||
_isOpponentDodging = true
|
_isOpponentDodging = true
|
||||||
_opponentDodgeProgress = 0f
|
_opponentDodgeProgress = 0f
|
||||||
_opponentDodgeDirection = 1f
|
_opponentDodgeDirection = 1f
|
||||||
Log.d(TAG, "Started opponent dodge animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun endOpponentDodge() {
|
fun endOpponentDodge() {
|
||||||
_isOpponentDodging = false
|
_isOpponentDodging = false
|
||||||
_opponentDodgeProgress = 0f
|
_opponentDodgeProgress = 0f
|
||||||
Log.d(TAG, "Ended opponent dodge animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun setOpponentDodgeProgress(progress: Float) {
|
fun setOpponentDodgeProgress(progress: Float) {
|
||||||
@ -313,67 +294,55 @@ class ArenaBattleSystem {
|
|||||||
fun startPlayerHit() {
|
fun startPlayerHit() {
|
||||||
_isPlayerHit = true
|
_isPlayerHit = true
|
||||||
_hitProgress = 0f
|
_hitProgress = 0f
|
||||||
Log.d(TAG, "Started player hit animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun startPlayerHitDelayed() {
|
fun startPlayerHitDelayed() {
|
||||||
_isPlayerHitDelayed = true
|
_isPlayerHitDelayed = true
|
||||||
Log.d(TAG, "Started delayed player hit animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun endPlayerHit() {
|
fun endPlayerHit() {
|
||||||
_isPlayerHit = false
|
_isPlayerHit = false
|
||||||
_hitProgress = 0f
|
_hitProgress = 0f
|
||||||
Log.d(TAG, "Ended player hit animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun endPlayerHitDelayed() {
|
fun endPlayerHitDelayed() {
|
||||||
_isPlayerHitDelayed = false
|
_isPlayerHitDelayed = false
|
||||||
Log.d(TAG, "Ended delayed player hit animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Opponent-specific hit methods
|
// Opponent-specific hit methods
|
||||||
fun startOpponentHit() {
|
fun startOpponentHit() {
|
||||||
_isOpponentHit = true
|
_isOpponentHit = true
|
||||||
_hitProgress = 0f
|
_hitProgress = 0f
|
||||||
Log.d(TAG, "Started opponent hit animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun startOpponentHitDelayed() {
|
fun startOpponentHitDelayed() {
|
||||||
_isOpponentHitDelayed = true
|
_isOpponentHitDelayed = true
|
||||||
Log.d(TAG, "Started delayed opponent hit animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun endOpponentHit() {
|
fun endOpponentHit() {
|
||||||
_isOpponentHit = false
|
_isOpponentHit = false
|
||||||
_hitProgress = 0f
|
_hitProgress = 0f
|
||||||
Log.d(TAG, "Ended opponent hit animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun endOpponentHitDelayed() {
|
fun endOpponentHitDelayed() {
|
||||||
_isOpponentHitDelayed = false
|
_isOpponentHitDelayed = false
|
||||||
Log.d(TAG, "Ended delayed opponent hit animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Delayed shake methods
|
// Delayed shake methods
|
||||||
fun startPlayerShakeDelayed() {
|
fun startPlayerShakeDelayed() {
|
||||||
_isPlayerShakeDelayed = true
|
_isPlayerShakeDelayed = true
|
||||||
Log.d(TAG, "Started delayed player shake animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun endPlayerShakeDelayed() {
|
fun endPlayerShakeDelayed() {
|
||||||
_isPlayerShakeDelayed = false
|
_isPlayerShakeDelayed = false
|
||||||
Log.d(TAG, "Ended delayed player shake animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun startOpponentShakeDelayed() {
|
fun startOpponentShakeDelayed() {
|
||||||
_isOpponentShakeDelayed = true
|
_isOpponentShakeDelayed = true
|
||||||
Log.d(TAG, "Started delayed opponent shake animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun endOpponentShakeDelayed() {
|
fun endOpponentShakeDelayed() {
|
||||||
_isOpponentShakeDelayed = false
|
_isOpponentShakeDelayed = false
|
||||||
Log.d(TAG, "Ended delayed opponent shake animation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Combined method to handle attack result
|
// Combined method to handle attack result
|
||||||
@ -386,7 +355,6 @@ class ArenaBattleSystem {
|
|||||||
// Player attack missed - opponent dodges
|
// Player attack missed - opponent dodges
|
||||||
startOpponentDodge()
|
startOpponentDodge()
|
||||||
}
|
}
|
||||||
Log.d(TAG, "Handled player attack result: ${if (isHit) "HIT" else "DODGE"}")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Method to handle opponent attack result
|
// Method to handle opponent attack result
|
||||||
@ -399,14 +367,12 @@ class ArenaBattleSystem {
|
|||||||
// Opponent attack missed - player dodges
|
// Opponent attack missed - player dodges
|
||||||
startPlayerDodge()
|
startPlayerDodge()
|
||||||
}
|
}
|
||||||
Log.d(TAG, "Handled opponent attack result: ${if (isHit) "HIT" else "DODGE"}")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Counter-attack methods
|
// Counter-attack methods
|
||||||
fun setupCounterAttack(isHit: Boolean) {
|
fun setupCounterAttack(isHit: Boolean) {
|
||||||
_shouldCounterAttack = true
|
_shouldCounterAttack = true
|
||||||
_counterAttackIsHit = isHit
|
_counterAttackIsHit = isHit
|
||||||
Log.d(TAG, "Setup counter-attack: ${if (isHit) "HIT" else "DODGE"}, isHit=$isHit")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun startCounterAttack() {
|
fun startCounterAttack() {
|
||||||
@ -415,6 +381,5 @@ class ArenaBattleSystem {
|
|||||||
_isPlayerAttacking = false
|
_isPlayerAttacking = false
|
||||||
_currentView = 1
|
_currentView = 1
|
||||||
_opponentAttackIsHit = _counterAttackIsHit
|
_opponentAttackIsHit = _counterAttackIsHit
|
||||||
Log.d(TAG, "Started counter-attack with opponentAttackIsHit=$_opponentAttackIsHit, counterAttackIsHit=$_counterAttackIsHit")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -43,15 +43,12 @@ class AttackSpriteManager(private val context: Context) {
|
|||||||
try {
|
try {
|
||||||
// Get character data
|
// Get character data
|
||||||
val characterData = getCharacterData(characterId) ?: return null
|
val characterData = getCharacterData(characterId) ?: return null
|
||||||
println("AttackSpriteManager: Got character data: $characterData")
|
|
||||||
|
|
||||||
// Determine which attack file to use
|
// Determine which attack file to use
|
||||||
val attackFileName = if (isLarge) {
|
val attackFileName = if (isLarge) {
|
||||||
characterData.laugeFileName
|
characterData.laugeFileName
|
||||||
} else {
|
} else {
|
||||||
characterData.smalefilename
|
characterData.smalefilename
|
||||||
}
|
}
|
||||||
println("AttackSpriteManager: Attack filename = $attackFileName")
|
|
||||||
|
|
||||||
// Skip if no attack file
|
// Skip if no attack file
|
||||||
if (attackFileName == "0") {
|
if (attackFileName == "0") {
|
||||||
@ -61,12 +58,9 @@ class AttackSpriteManager(private val context: Context) {
|
|||||||
|
|
||||||
// Load the attack sprite from external storage
|
// Load the attack sprite from external storage
|
||||||
val attackFile = File(getAttackTexturesBaseDir(), "$attackFileName.png")
|
val attackFile = File(getAttackTexturesBaseDir(), "$attackFileName.png")
|
||||||
println("AttackSpriteManager: Attack file path = ${attackFile.absolutePath}")
|
|
||||||
println("AttackSpriteManager: Attack file exists = ${attackFile.exists()}")
|
|
||||||
|
|
||||||
return if (attackFile.exists()) {
|
return if (attackFile.exists()) {
|
||||||
val bitmap = BitmapFactory.decodeFile(attackFile.absolutePath)
|
val bitmap = BitmapFactory.decodeFile(attackFile.absolutePath)
|
||||||
println("AttackSpriteManager: Successfully loaded bitmap = ${bitmap != null}")
|
|
||||||
bitmap
|
bitmap
|
||||||
} else {
|
} else {
|
||||||
println("AttackSpriteManager: Attack file does not exist")
|
println("AttackSpriteManager: Attack file does not exist")
|
||||||
@ -80,10 +74,8 @@ class AttackSpriteManager(private val context: Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun getCharacterData(characterId: String): CharacterData? {
|
private fun getCharacterData(characterId: String): CharacterData? {
|
||||||
println("AttackSpriteManager: Getting character data for characterId=$characterId")
|
|
||||||
// Check cache first
|
// Check cache first
|
||||||
if (characterDataCache.containsKey(characterId)) {
|
if (characterDataCache.containsKey(characterId)) {
|
||||||
println("AttackSpriteManager: Found character data in cache")
|
|
||||||
return characterDataCache[characterId]
|
return characterDataCache[characterId]
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -91,8 +83,6 @@ class AttackSpriteManager(private val context: Context) {
|
|||||||
// Load character data from JSON file in external storage
|
// Load character data from JSON file in external storage
|
||||||
val externalDir = android.os.Environment.getExternalStorageDirectory()
|
val externalDir = android.os.Environment.getExternalStorageDirectory()
|
||||||
val characterDataFile = File(externalDir, "VBHelper/battle_sprites/extracted_digimon_stats/character_data/CharacterData.json")
|
val characterDataFile = File(externalDir, "VBHelper/battle_sprites/extracted_digimon_stats/character_data/CharacterData.json")
|
||||||
println("AttackSpriteManager: Character data file path = ${characterDataFile.absolutePath}")
|
|
||||||
println("AttackSpriteManager: Character data file exists = ${characterDataFile.exists()}")
|
|
||||||
|
|
||||||
if (!characterDataFile.exists()) {
|
if (!characterDataFile.exists()) {
|
||||||
println("AttackSpriteManager: Character data file does not exist, using default data")
|
println("AttackSpriteManager: Character data file does not exist, using default data")
|
||||||
@ -109,7 +99,6 @@ class AttackSpriteManager(private val context: Context) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
val jsonContent = characterDataFile.readText()
|
val jsonContent = characterDataFile.readText()
|
||||||
println("AttackSpriteManager: JSON content length = ${jsonContent.length}")
|
|
||||||
|
|
||||||
// Parse the JSON response
|
// Parse the JSON response
|
||||||
val response = gson.fromJson(jsonContent, CharacterDataResponse::class.java)
|
val response = gson.fromJson(jsonContent, CharacterDataResponse::class.java)
|
||||||
@ -136,7 +125,6 @@ class AttackSpriteManager(private val context: Context) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
characterDataCache[characterId] = characterData
|
characterDataCache[characterId] = characterData
|
||||||
println("AttackSpriteManager: Found character data: $characterData")
|
|
||||||
return characterData
|
return characterData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -152,7 +140,6 @@ class AttackSpriteManager(private val context: Context) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
characterDataCache[characterId] = characterData
|
characterDataCache[characterId] = characterData
|
||||||
println("AttackSpriteManager: Created default character data: $characterData")
|
|
||||||
return characterData
|
return characterData
|
||||||
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
|||||||
@ -79,11 +79,13 @@ class DigimonAnimationStateMachine(
|
|||||||
DigimonAnimationType.ATTACK to 650L,
|
DigimonAnimationType.ATTACK to 650L,
|
||||||
DigimonAnimationType.FLEE to 150L
|
DigimonAnimationType.FLEE to 150L
|
||||||
)
|
)
|
||||||
|
|
||||||
|
/*
|
||||||
init {
|
init {
|
||||||
println("Initialized DigimonAnimationStateMachine for character: $characterId with frame offset: $initialFrameOffset, timing offset: $timingOffset")
|
println("Initialized DigimonAnimationStateMachine for character: $characterId with frame offset: $initialFrameOffset, timing offset: $timingOffset")
|
||||||
println("Available animation types: ${animationTypeToFrames.keys}")
|
println("Available animation types: ${animationTypeToFrames.keys}")
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
suspend fun playAnimation(animationType: DigimonAnimationType) {
|
suspend fun playAnimation(animationType: DigimonAnimationType) {
|
||||||
if (currentAnimation == animationType && isPlaying) {
|
if (currentAnimation == animationType && isPlaying) {
|
||||||
@ -96,8 +98,6 @@ class DigimonAnimationStateMachine(
|
|||||||
val frameNumbers = animationTypeToFrames[animationType] ?: listOf(1)
|
val frameNumbers = animationTypeToFrames[animationType] ?: listOf(1)
|
||||||
val duration = animationDurations[animationType] ?: 100L
|
val duration = animationDurations[animationType] ?: 100L
|
||||||
|
|
||||||
println("Playing animation: $animationType with frames: $frameNumbers")
|
|
||||||
|
|
||||||
// For non-looping animations like ATTACK, play once and return to IDLE
|
// For non-looping animations like ATTACK, play once and return to IDLE
|
||||||
if (animationType == DigimonAnimationType.ATTACK) {
|
if (animationType == DigimonAnimationType.ATTACK) {
|
||||||
currentFrameNumber = frameNumbers.firstOrNull() ?: 1
|
currentFrameNumber = frameNumbers.firstOrNull() ?: 1
|
||||||
@ -130,8 +130,6 @@ class DigimonAnimationStateMachine(
|
|||||||
// Combine frames for cycling idle animation
|
// Combine frames for cycling idle animation
|
||||||
val combinedFrames = (idleFrames + idle2Frames).distinct()
|
val combinedFrames = (idleFrames + idle2Frames).distinct()
|
||||||
|
|
||||||
println("Playing idle animation with frames: $combinedFrames, starting at offset: $initialFrameOffset, timing offset: $timingOffset")
|
|
||||||
|
|
||||||
val duration = animationDurations[DigimonAnimationType.IDLE] ?: 500L
|
val duration = animationDurations[DigimonAnimationType.IDLE] ?: 500L
|
||||||
|
|
||||||
// Apply initial timing offset
|
// Apply initial timing offset
|
||||||
|
|||||||
@ -39,7 +39,6 @@ fun HitEffectOverlay(
|
|||||||
|
|
||||||
LaunchedEffect(isVisible) {
|
LaunchedEffect(isVisible) {
|
||||||
if (isVisible) {
|
if (isVisible) {
|
||||||
println("DEBUG: Starting hit effect animation")
|
|
||||||
|
|
||||||
// Add delay before starting hit effect animation
|
// Add delay before starting hit effect animation
|
||||||
delay(400) // Increased from 200ms to 400ms delay before hit effect appears
|
delay(400) // Increased from 200ms to 400ms delay before hit effect appears
|
||||||
|
|||||||
@ -44,8 +44,6 @@ class HitEffectSpriteManager(private val context: Context) {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
println("Successfully loaded hit sprite: $spriteName.png (${bitmap.width}x${bitmap.height})")
|
|
||||||
|
|
||||||
// Cache the result
|
// Cache the result
|
||||||
spriteCache[cacheKey] = bitmap
|
spriteCache[cacheKey] = bitmap
|
||||||
|
|
||||||
|
|||||||
@ -53,8 +53,6 @@ class IndividualSpriteManager(private val context: Context) {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
println("Successfully loaded sprite frame: $spriteFileName (${bitmap.width}x${bitmap.height})")
|
|
||||||
|
|
||||||
// Cache the result
|
// Cache the result
|
||||||
spriteCache[cacheKey] = bitmap
|
spriteCache[cacheKey] = bitmap
|
||||||
|
|
||||||
|
|||||||
@ -205,9 +205,6 @@ class RetrofitHelper {
|
|||||||
|
|
||||||
val service: AuthService = retrofit.create<AuthService>(AuthService::class.java)
|
val service: AuthService = retrofit.create<AuthService>(AuthService::class.java)
|
||||||
val request = AuthenticateRequest(userToken = token)
|
val request = AuthenticateRequest(userToken = token)
|
||||||
println("RetrofitHelper: Sending request to api/auth/validate with userToken: $token")
|
|
||||||
//println("RetrofitHelper: Request object: $request")
|
|
||||||
//println("RetrofitHelper: Request JSON will be: {\"userToken\": \"$token\"}")
|
|
||||||
val call: Call<AuthenticateResponse> = service.validate(request)
|
val call: Call<AuthenticateResponse> = service.validate(request)
|
||||||
|
|
||||||
call.enqueue(object : Callback<AuthenticateResponse> {
|
call.enqueue(object : Callback<AuthenticateResponse> {
|
||||||
@ -218,13 +215,10 @@ class RetrofitHelper {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onResponse(call: Call<AuthenticateResponse>, response: Response<AuthenticateResponse>) {
|
override fun onResponse(call: Call<AuthenticateResponse>, response: Response<AuthenticateResponse>) {
|
||||||
println("RetrofitHelper: Validate API response received - Code: ${response.code()}")
|
|
||||||
println("RetrofitHelper: Response body: ${response.body()}")
|
|
||||||
|
|
||||||
if (response.isSuccessful) {
|
if (response.isSuccessful) {
|
||||||
val authResponse: AuthenticateResponse? = response.body()
|
val authResponse: AuthenticateResponse? = response.body()
|
||||||
if (authResponse != null) {
|
if (authResponse != null) {
|
||||||
println("RetrofitHelper: Validation successful: ${authResponse.success}, message: ${authResponse.message}")
|
|
||||||
callback(authResponse)
|
callback(authResponse)
|
||||||
} else {
|
} else {
|
||||||
println("RetrofitHelper: Validation failed: Invalid response body")
|
println("RetrofitHelper: Validation failed: Invalid response body")
|
||||||
|
|||||||
@ -24,8 +24,6 @@ fun SpriteImage(
|
|||||||
bitmap = spriteManager.loadSpriteFrame(characterId, frameNumber)
|
bitmap = spriteManager.loadSpriteFrame(characterId, frameNumber)
|
||||||
if (bitmap == null) {
|
if (bitmap == null) {
|
||||||
println("Failed to load sprite frame: $frameNumber for character: $characterId")
|
println("Failed to load sprite frame: $frameNumber for character: $characterId")
|
||||||
} else {
|
|
||||||
println("Successfully loaded sprite frame: $frameNumber for character: $characterId")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,6 @@ fun AttackSpriteImage(
|
|||||||
val loadedBitmap = withContext(Dispatchers.IO) {
|
val loadedBitmap = withContext(Dispatchers.IO) {
|
||||||
attackSpriteManager.getAttackSprite(characterId, isLarge)
|
attackSpriteManager.getAttackSprite(characterId, isLarge)
|
||||||
}
|
}
|
||||||
println("AttackSpriteImage: Loaded bitmap = ${loadedBitmap != null}")
|
|
||||||
bitmap = loadedBitmap
|
bitmap = loadedBitmap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1051,39 +1051,28 @@ fun MiddleBattleView(
|
|||||||
when (apiResult.state) {
|
when (apiResult.state) {
|
||||||
1 -> {
|
1 -> {
|
||||||
// Match is still ongoing - update HP and continue
|
// Match is still ongoing - update HP and continue
|
||||||
println("Round ${apiResult.currentRound}: Player HP=${apiResult.playerHP}, Opponent HP=${apiResult.opponentHP}")
|
|
||||||
|
|
||||||
// Set pending damage based on API result
|
// Set pending damage based on API result
|
||||||
if (apiResult.playerAttackDamage > 0) {
|
if (apiResult.playerAttackDamage > 0) {
|
||||||
// Player attack hit - enemy takes damage at end of player animation
|
// Player attack hit - enemy takes damage at end of player animation
|
||||||
println("Player attack hit! Enemy will take ${apiResult.playerAttackDamage} damage")
|
|
||||||
onSetPendingDamage(0f, apiResult.playerAttackDamage.toFloat()) // Opponent takes damage
|
onSetPendingDamage(0f, apiResult.playerAttackDamage.toFloat()) // Opponent takes damage
|
||||||
battleSystem.setAttackHitState(true)
|
battleSystem.setAttackHitState(true)
|
||||||
|
|
||||||
// Also check if enemy counter-attacks and hits
|
// Also check if enemy counter-attacks and hits
|
||||||
if (apiResult.opponentAttackDamage > 0) {
|
if (apiResult.opponentAttackDamage > 0) {
|
||||||
println("Enemy counter-attack hits! Player takes ${apiResult.opponentAttackDamage} damage")
|
|
||||||
onSetPendingDamage(apiResult.opponentAttackDamage.toFloat(), apiResult.playerAttackDamage.toFloat()) // Both take damage
|
onSetPendingDamage(apiResult.opponentAttackDamage.toFloat(), apiResult.playerAttackDamage.toFloat()) // Both take damage
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// Player attack missed - enemy counter-attacks
|
// Player attack missed - enemy counter-attacks
|
||||||
println("Player attack missed! Enemy counter-attacks")
|
|
||||||
battleSystem.setAttackHitState(false)
|
battleSystem.setAttackHitState(false)
|
||||||
// Set up counter-attack - determine if it hits based on API result
|
// Set up counter-attack - determine if it hits based on API result
|
||||||
val counterAttackHits = apiResult.opponentAttackDamage > 0
|
val counterAttackHits = apiResult.opponentAttackDamage > 0
|
||||||
println("Setting up counter-attack: counterAttackHits=$counterAttackHits, opponentAttackDamage=${apiResult.opponentAttackDamage}")
|
|
||||||
println("Full API response: status=${apiResult.status}, state=${apiResult.state}, playerAttackHit=${apiResult.playerAttackHit}, playerAttackDamage=${apiResult.playerAttackDamage}, opponentAttackDamage=${apiResult.opponentAttackDamage}, playerHP=${apiResult.playerHP}, opponentHP=${apiResult.opponentHP}")
|
|
||||||
println("DEBUG: Using playerAttackDamage > 0 instead of playerAttackHit for hit detection")
|
|
||||||
|
|
||||||
// Use opponentAttackDamage to determine counter-attack hit
|
// Use opponentAttackDamage to determine counter-attack hit
|
||||||
val finalCounterAttackHits = counterAttackHits
|
val finalCounterAttackHits = counterAttackHits
|
||||||
println("Using opponentAttackDamage > 0 for counter-attack: $finalCounterAttackHits")
|
|
||||||
|
|
||||||
if (finalCounterAttackHits) {
|
if (finalCounterAttackHits) {
|
||||||
println("Counter-attack hits! Player takes ${apiResult.opponentAttackDamage} damage")
|
|
||||||
onSetPendingDamage(apiResult.opponentAttackDamage.toFloat(), 0f) // Player takes damage
|
onSetPendingDamage(apiResult.opponentAttackDamage.toFloat(), 0f) // Player takes damage
|
||||||
} else {
|
} else {
|
||||||
println("Counter-attack misses! Player dodges")
|
|
||||||
onSetPendingDamage(0f, 0f) // No damage
|
onSetPendingDamage(0f, 0f) // No damage
|
||||||
}
|
}
|
||||||
battleSystem.setupCounterAttack(finalCounterAttackHits)
|
battleSystem.setupCounterAttack(finalCounterAttackHits)
|
||||||
@ -1671,13 +1660,11 @@ fun BattlesScreen() {
|
|||||||
|
|
||||||
val currentCharacter = activeUserCharacter
|
val currentCharacter = activeUserCharacter
|
||||||
if (currentCharacter != null && canBattle && playerBattleType != null) {
|
if (currentCharacter != null && canBattle && playerBattleType != null) {
|
||||||
println("BATTLESCREEN: Loading opponents for stage ${currentCharacter.stage}, battle type: $playerBattleType")
|
|
||||||
try {
|
try {
|
||||||
RetrofitHelper().getOpponents(context, playerBattleType!!) { opponents ->
|
RetrofitHelper().getOpponents(context, playerBattleType!!) { opponents ->
|
||||||
try {
|
try {
|
||||||
// Create a new list to trigger UI recomposition
|
// Create a new list to trigger UI recomposition
|
||||||
opponentsList = ArrayList(opponents.opponentsList)
|
opponentsList = ArrayList(opponents.opponentsList)
|
||||||
println("BATTLESCREEN: Loaded ${opponents.opponentsList.size} opponents from API")
|
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
Log.d(TAG, "Error processing opponents data: ${e.message}")
|
Log.d(TAG, "Error processing opponents data: ${e.message}")
|
||||||
e.printStackTrace()
|
e.printStackTrace()
|
||||||
@ -1714,7 +1701,6 @@ fun BattlesScreen() {
|
|||||||
if (!processedTokens.contains(token)) {
|
if (!processedTokens.contains(token)) {
|
||||||
// Mark token as being processed IMMEDIATELY to prevent duplicate API calls
|
// Mark token as being processed IMMEDIATELY to prevent duplicate API calls
|
||||||
processedTokens = processedTokens + token
|
processedTokens = processedTokens + token
|
||||||
println("BATTLESCREEN: Received token from URI: $token (URI: $uri) - marking as processing")
|
|
||||||
|
|
||||||
// Exchange token with battle server
|
// Exchange token with battle server
|
||||||
RetrofitHelper().authenticate(context, token) { response ->
|
RetrofitHelper().authenticate(context, token) { response ->
|
||||||
@ -1770,8 +1756,6 @@ fun BattlesScreen() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
println("BATTLESCREEN: Token already processed (or currently processing), skipping: $token")
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
println("BATTLESCREEN: No token found in URI: $uri (checked 'c' and 'token' parameters)")
|
println("BATTLESCREEN: No token found in URI: $uri (checked 'c' and 'token' parameters)")
|
||||||
@ -1785,7 +1769,6 @@ fun BattlesScreen() {
|
|||||||
val localAuthState = authRepository.isAuthenticated.first()
|
val localAuthState = authRepository.isAuthenticated.first()
|
||||||
val storedToken = authRepository.authToken.first()
|
val storedToken = authRepository.authToken.first()
|
||||||
val storedUserId = authRepository.userId.first()
|
val storedUserId = authRepository.userId.first()
|
||||||
println("BATTLESCREEN: Local authentication status - isAuthenticated: $localAuthState, hasToken: ${storedToken != null}, userId: $storedUserId")
|
|
||||||
|
|
||||||
// Load stored userId if available
|
// Load stored userId if available
|
||||||
if (storedUserId != null) {
|
if (storedUserId != null) {
|
||||||
@ -1799,7 +1782,6 @@ fun BattlesScreen() {
|
|||||||
isAuthenticated = true
|
isAuthenticated = true
|
||||||
isCheckingAuth = false
|
isCheckingAuth = false
|
||||||
userId = storedUserId
|
userId = storedUserId
|
||||||
println("BATTLESCREEN: Restored authentication state from storage (userId: $storedUserId) - isCheckingAuth set to false")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Only check for token in intent if it's a fresh deep link (ACTION_VIEW intent)
|
// Only check for token in intent if it's a fresh deep link (ACTION_VIEW intent)
|
||||||
@ -1808,9 +1790,7 @@ fun BattlesScreen() {
|
|||||||
val intent = activity?.intent
|
val intent = activity?.intent
|
||||||
if (intent?.action == Intent.ACTION_VIEW) {
|
if (intent?.action == Intent.ACTION_VIEW) {
|
||||||
intent.data?.let { uri ->
|
intent.data?.let { uri ->
|
||||||
println("BATTLESCREEN: Found ACTION_VIEW intent with URI: $uri")
|
|
||||||
if (uri.getQueryParameter("c") != null || uri.getQueryParameter("token") != null) {
|
if (uri.getQueryParameter("c") != null || uri.getQueryParameter("token") != null) {
|
||||||
println("BATTLESCREEN: Token found in fresh deep link, processing...")
|
|
||||||
handleTokenFromUri(uri)
|
handleTokenFromUri(uri)
|
||||||
return@LaunchedEffect // Don't open auth URL if we're processing a token
|
return@LaunchedEffect // Don't open auth URL if we're processing a token
|
||||||
}
|
}
|
||||||
@ -1820,7 +1800,6 @@ fun BattlesScreen() {
|
|||||||
// If we have a stored token, validate it with the server in the background
|
// If we have a stored token, validate it with the server in the background
|
||||||
if (localAuthState && storedToken != null && storedToken.isNotEmpty()) {
|
if (localAuthState && storedToken != null && storedToken.isNotEmpty()) {
|
||||||
// State already set above, now validate in background
|
// State already set above, now validate in background
|
||||||
println("BATTLESCREEN: Validating stored token with server in background...")
|
|
||||||
RetrofitHelper().authenticate(context, storedToken) { response ->
|
RetrofitHelper().authenticate(context, storedToken) { response ->
|
||||||
// Update UI on main thread
|
// Update UI on main thread
|
||||||
kotlinx.coroutines.CoroutineScope(Dispatchers.Main).launch {
|
kotlinx.coroutines.CoroutineScope(Dispatchers.Main).launch {
|
||||||
@ -1832,7 +1811,6 @@ fun BattlesScreen() {
|
|||||||
authRepository.setAuthenticated(true, storedToken, extractedUserId)
|
authRepository.setAuthenticated(true, storedToken, extractedUserId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
println("BATTLESCREEN: Token validation successful, userId: $extractedUserId")
|
|
||||||
isAuthenticated = true
|
isAuthenticated = true
|
||||||
isCheckingAuth = false
|
isCheckingAuth = false
|
||||||
userId = extractedUserId
|
userId = extractedUserId
|
||||||
@ -1897,23 +1875,18 @@ fun BattlesScreen() {
|
|||||||
if (intent?.action == Intent.ACTION_VIEW) {
|
if (intent?.action == Intent.ACTION_VIEW) {
|
||||||
val uri = intent.data
|
val uri = intent.data
|
||||||
if (uri != null) {
|
if (uri != null) {
|
||||||
println("BATTLESCREEN: Checking ACTION_VIEW intent data - URI: $uri, scheme: ${uri.scheme}, host: ${uri.host}, path: ${uri.path}")
|
|
||||||
println("BATTLESCREEN: All query parameters: ${uri.queryParameterNames}")
|
|
||||||
|
|
||||||
// Handle vbhelper://auth?token= or vbhelper://auth?c= deep link
|
// Handle vbhelper://auth?token= or vbhelper://auth?c= deep link
|
||||||
if (uri.scheme == "vbhelper" && uri.host == "auth") {
|
if (uri.scheme == "vbhelper" && uri.host == "auth") {
|
||||||
println("BATTLESCREEN: Detected vbhelper://auth deep link")
|
|
||||||
handleTokenFromUri(uri)
|
handleTokenFromUri(uri)
|
||||||
}
|
}
|
||||||
// Handle http://localhost:8080/authenticate?c= redirect
|
// Handle http://localhost:8080/authenticate?c= redirect
|
||||||
else if ((uri.scheme == "http" || uri.scheme == "https") &&
|
else if ((uri.scheme == "http" || uri.scheme == "https") &&
|
||||||
(uri.host == "localhost" || uri.host == "127.0.0.1" || uri.host?.contains("8080") == true)) {
|
(uri.host == "localhost" || uri.host == "127.0.0.1" || uri.host?.contains("8080") == true)) {
|
||||||
println("BATTLESCREEN: Detected localhost redirect, checking for token")
|
|
||||||
handleTokenFromUri(uri)
|
handleTokenFromUri(uri)
|
||||||
}
|
}
|
||||||
// Also check if there's a 'c' or 'token' parameter in any URL
|
// Also check if there's a 'c' or 'token' parameter in any URL
|
||||||
else if (uri.getQueryParameter("c") != null || uri.getQueryParameter("token") != null) {
|
else if (uri.getQueryParameter("c") != null || uri.getQueryParameter("token") != null) {
|
||||||
println("BATTLESCREEN: Found token parameter (c or token) in URI, attempting to authenticate")
|
|
||||||
handleTokenFromUri(uri)
|
handleTokenFromUri(uri)
|
||||||
} else {
|
} else {
|
||||||
println("BATTLESCREEN: URI found but no token parameter detected")
|
println("BATTLESCREEN: URI found but no token parameter detected")
|
||||||
@ -1938,9 +1911,7 @@ fun BattlesScreen() {
|
|||||||
val intent = activity?.intent
|
val intent = activity?.intent
|
||||||
if (intent?.action == Intent.ACTION_VIEW) {
|
if (intent?.action == Intent.ACTION_VIEW) {
|
||||||
intent.data?.let { uri ->
|
intent.data?.let { uri ->
|
||||||
println("BATTLESCREEN: Activity resumed with ACTION_VIEW intent, checking for token - URI: $uri")
|
|
||||||
if (uri.getQueryParameter("c") != null || uri.getQueryParameter("token") != null) {
|
if (uri.getQueryParameter("c") != null || uri.getQueryParameter("token") != null) {
|
||||||
println("BATTLESCREEN: Found token in fresh deep link on resume")
|
|
||||||
handleTokenFromUri(uri)
|
handleTokenFromUri(uri)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2204,7 +2175,6 @@ fun BattlesScreen() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
println("BATTLESCREEN: UI - No opponents in list, showing message")
|
|
||||||
Text("No opponents available for your stage",
|
Text("No opponents available for your stage",
|
||||||
fontSize = 16.sp,
|
fontSize = 16.sp,
|
||||||
color = Color(0xFFFFA500), // Orange color
|
color = Color(0xFFFFA500), // Orange color
|
||||||
@ -2288,7 +2258,6 @@ fun BattlesScreen() {
|
|||||||
selectedOpponent?.name ?: "Opponent",
|
selectedOpponent?.name ?: "Opponent",
|
||||||
opponentStage
|
opponentStage
|
||||||
) { cleanupResult ->
|
) { cleanupResult ->
|
||||||
println("Cleanup call completed")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2460,7 +2429,6 @@ fun MultiLayerAnimatedBattleBackground(
|
|||||||
LaunchedEffect(Unit) {
|
LaunchedEffect(Unit) {
|
||||||
screenWidth = with(density) { configuration.screenWidthDp.dp }
|
screenWidth = with(density) { configuration.screenWidthDp.dp }
|
||||||
screenHeight = with(density) { configuration.screenHeightDp.dp }
|
screenHeight = with(density) { configuration.screenHeightDp.dp }
|
||||||
println("DEBUG: Multi-layer screen dimensions = ${screenWidth.value}x${screenHeight.value}dp")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Load all three background layers from external storage
|
// Load all three background layers from external storage
|
||||||
@ -2473,7 +2441,6 @@ fun MultiLayerAnimatedBattleBackground(
|
|||||||
val backLayerFile = File(externalDir, "VBHelper/battle_sprites/extracted_battlebgs/${selectedSet.backLayer}")
|
val backLayerFile = File(externalDir, "VBHelper/battle_sprites/extracted_battlebgs/${selectedSet.backLayer}")
|
||||||
if (backLayerFile.exists()) {
|
if (backLayerFile.exists()) {
|
||||||
backLayerBitmap = BitmapFactory.decodeFile(backLayerFile.absolutePath)
|
backLayerBitmap = BitmapFactory.decodeFile(backLayerFile.absolutePath)
|
||||||
println("Successfully loaded back layer background (Set ${backgroundSetIndex + 1}): ${backLayerFile.absolutePath}")
|
|
||||||
} else {
|
} else {
|
||||||
println("Back layer background file not found: ${backLayerFile.absolutePath}")
|
println("Back layer background file not found: ${backLayerFile.absolutePath}")
|
||||||
}
|
}
|
||||||
@ -2482,7 +2449,6 @@ fun MultiLayerAnimatedBattleBackground(
|
|||||||
val middleLayerFile = File(externalDir, "VBHelper/battle_sprites/extracted_battlebgs/${selectedSet.middleLayer}")
|
val middleLayerFile = File(externalDir, "VBHelper/battle_sprites/extracted_battlebgs/${selectedSet.middleLayer}")
|
||||||
if (middleLayerFile.exists()) {
|
if (middleLayerFile.exists()) {
|
||||||
middleLayerBitmap = BitmapFactory.decodeFile(middleLayerFile.absolutePath)
|
middleLayerBitmap = BitmapFactory.decodeFile(middleLayerFile.absolutePath)
|
||||||
println("Successfully loaded middle layer background (Set ${backgroundSetIndex + 1}): ${middleLayerFile.absolutePath}")
|
|
||||||
} else {
|
} else {
|
||||||
println("Middle layer background file not found: ${middleLayerFile.absolutePath}")
|
println("Middle layer background file not found: ${middleLayerFile.absolutePath}")
|
||||||
}
|
}
|
||||||
@ -2491,7 +2457,6 @@ fun MultiLayerAnimatedBattleBackground(
|
|||||||
val frontLayerFile = File(externalDir, "VBHelper/battle_sprites/extracted_battlebgs/${selectedSet.frontLayer}")
|
val frontLayerFile = File(externalDir, "VBHelper/battle_sprites/extracted_battlebgs/${selectedSet.frontLayer}")
|
||||||
if (frontLayerFile.exists()) {
|
if (frontLayerFile.exists()) {
|
||||||
frontLayerBitmap = BitmapFactory.decodeFile(frontLayerFile.absolutePath)
|
frontLayerBitmap = BitmapFactory.decodeFile(frontLayerFile.absolutePath)
|
||||||
println("Successfully loaded front layer background (Set ${backgroundSetIndex + 1}): ${frontLayerFile.absolutePath}")
|
|
||||||
} else {
|
} else {
|
||||||
println("Front layer background file not found: ${frontLayerFile.absolutePath}")
|
println("Front layer background file not found: ${frontLayerFile.absolutePath}")
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user