Removed RGSS2 compatibility, condensed BitmapCache into RPG::Cache and made it work

This commit is contained in:
Maruno17
2021-03-10 21:32:00 +00:00
parent 117396f8e2
commit ba1d225b83
13 changed files with 163 additions and 870 deletions

View File

@@ -3,7 +3,7 @@
#===============================================================================
def pbSceneStandby
$scene.disposeSpritesets if $scene && $scene.is_a?(Scene_Map)
GC.start
RPG::Cache.clear
Graphics.frame_reset
yield
$scene.createSpritesets if $scene && $scene.is_a?(Scene_Map)
@@ -131,8 +131,8 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
if (battletype==1 || battletype==3) && foe.length==1 # Against single trainer
tr_type = foe[0].trainer_type
if tr_type
tbargraphic = sprintf("Graphics/Transitions/vsBar_%s", tr_type.to_s) rescue nil
tgraphic = sprintf("Graphics/Transitions/vsTrainer_%s", tr_type.to_s) rescue nil
tbargraphic = sprintf("vsBar_%s", tr_type.to_s) rescue nil
tgraphic = sprintf("vsTrainer_%s", tr_type.to_s) rescue nil
if pbResolveBitmap(tbargraphic) && pbResolveBitmap(tgraphic)
player_tr_type = $Trainer.trainer_type
outfit = $Trainer.outfit
@@ -144,32 +144,32 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
viewvs = Viewport.new(0,0,Graphics.width,Graphics.height)
viewvs.z = viewport.z
fade = Sprite.new(viewport)
fade.bitmap = BitmapCache.load_bitmap("Graphics/Transitions/vsFlash")
fade.bitmap = RPG::Cache.transition("vsFlash")
fade.tone = Tone.new(-255,-255,-255)
fade.opacity = 100
overlay = Sprite.new(viewport)
overlay.bitmap = Bitmap.new(Graphics.width,Graphics.height)
pbSetSystemFont(overlay.bitmap)
pbargraphic = sprintf("Graphics/Transitions/vsBar_%s_%d", player_tr_type.to_s, outfit) rescue nil
pbargraphic = sprintf("vsBar_%s_%d", player_tr_type.to_s, outfit) rescue nil
if !pbResolveBitmap(pbargraphic)
pbargraphic = sprintf("Graphics/Transitions/vsBar_%s", player_tr_type.to_s) rescue nil
pbargraphic = sprintf("vsBar_%s", player_tr_type.to_s) rescue nil
end
xoffset = ((Graphics.width/2)/10)*10
bar1 = Sprite.new(viewplayer)
bar1.bitmap = BitmapCache.load_bitmap(pbargraphic)
bar1.bitmap = RPG::Cache.transition(pbargraphic)
bar1.x = -xoffset
bar2 = Sprite.new(viewopp)
bar2.bitmap = BitmapCache.load_bitmap(tbargraphic)
bar2.bitmap = RPG::Cache.transition(tbargraphic)
bar2.x = xoffset
vs = Sprite.new(viewvs)
vs.bitmap = BitmapCache.load_bitmap("Graphics/Transitions/vs")
vs.bitmap = RPG::Cache.transition("vs")
vs.ox = vs.bitmap.width/2
vs.oy = vs.bitmap.height/2
vs.x = Graphics.width/2
vs.y = Graphics.height/1.5
vs.visible = false
flash = Sprite.new(viewvs)
flash.bitmap = BitmapCache.load_bitmap("Graphics/Transitions/vsFlash")
flash.bitmap = RPG::Cache.transition("vsFlash")
flash.opacity = 0
# Animate bars sliding in from either side
slideInTime = (Graphics.frame_rate*0.25).floor
@@ -186,18 +186,18 @@ def pbBattleAnimationOverride(viewport,battletype=0,foe=nil)
flash.opacity = 255
# Replace bar sprites with AnimatedPlanes, set up trainer sprites
bar1 = AnimatedPlane.new(viewplayer)
bar1.bitmap = BitmapCache.load_bitmap(pbargraphic)
bar1.bitmap = RPG::Cache.transition(pbargraphic)
bar2 = AnimatedPlane.new(viewopp)
bar2.bitmap = BitmapCache.load_bitmap(tbargraphic)
pgraphic = sprintf("Graphics/Transitions/vsTrainer_%s_%d", player_tr_type.to_s, outfit) rescue nil
bar2.bitmap = RPG::Cache.transition(tbargraphic)
pgraphic = sprintf("vsTrainer_%s_%d", player_tr_type.to_s, outfit) rescue nil
if !pbResolveBitmap(pgraphic)
pgraphic = sprintf("Graphics/Transitions/vsTrainer_%s", player_tr_type.to_s) rescue nil
pgraphic = sprintf("vsTrainer_%s", player_tr_type.to_s) rescue nil
end
player = Sprite.new(viewplayer)
player.bitmap = BitmapCache.load_bitmap(pgraphic)
player.bitmap = RPG::Cache.transition(pgraphic)
player.x = -xoffset
trainer = Sprite.new(viewopp)
trainer.bitmap = BitmapCache.load_bitmap(tgraphic)
trainer.bitmap = RPG::Cache.transition(tgraphic)
trainer.x = xoffset
trainer.tone = Tone.new(-255,-255,-255)
# Dim the flash and make the trainer sprites appear, while animating bars

View File

@@ -72,7 +72,7 @@ def pbHiddenMoveAnimation(pokemon)
viewport=Viewport.new(0,0,0,0)
viewport.z=99999
bg=Sprite.new(viewport)
bg.bitmap=BitmapCache.load_bitmap("Graphics/Pictures/hiddenMovebg")
bg.bitmap=RPG::Cache.picture("hiddenMovebg")
sprite=PokemonSprite.new(viewport)
sprite.setOffset(PictureOrigin::Center)
sprite.setPokemonBitmap(pokemon)