Fixes updated spritesheets list not resetting when new spritepack is released

This commit is contained in:
infinitefusion
2025-01-02 09:51:03 -05:00
parent 234f22e78e
commit 804578f4e3

View File

@@ -378,12 +378,26 @@ class PokemonLoadScreen
def check_for_spritepack_update() def check_for_spritepack_update()
$updated_spritesheets = [] if !$updated_spritesheets $updated_spritesheets = [] if !$updated_spritesheets
echoln new_spritepack_was_released() echoln "wawawa"
if new_spritepack_was_released() if new_spritepack_was_released()
echoln "waaaah!"
reset_updated_spritesheets_cache()
$updated_spritesheets = [] $updated_spritesheets = []
end end
end end
def reset_updated_spritesheets_cache()
echoln "resetting updated spritesheets list"
begin
File.open(Settings::UPDATED_SPRITESHEETS_CACHE, 'w') { |file| file.truncate(0) }
echoln "File reset successfully."
rescue => e
echoln "Failed to reset file: #{e.message}"
end
end
def preload_party(trainer) def preload_party(trainer)
spriteLoader = BattleSpriteLoader.new spriteLoader = BattleSpriteLoader.new
for pokemon in trainer.party for pokemon in trainer.party
@@ -429,6 +443,8 @@ class PokemonLoadScreen
handleReplaceExistingSprites() handleReplaceExistingSprites()
end end
if ($game_temp.nb_imported_sprites && $game_temp.nb_imported_sprites > 0) if ($game_temp.nb_imported_sprites && $game_temp.nb_imported_sprites > 0)
echoln $game_temp.nb_imported_sprites
echoln $game_temp.nb_imported_sprites.to_s
pbMessage(_INTL("{1} new custom sprites were imported into the game", $game_temp.nb_imported_sprites.to_s)) pbMessage(_INTL("{1} new custom sprites were imported into the game", $game_temp.nb_imported_sprites.to_s))
end end
checkEnableSpritesDownload checkEnableSpritesDownload