mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-02-01 19:11:02 +00:00
show selected sprite in preview underneath in pc fusion screen
This commit is contained in:
@@ -56,13 +56,17 @@ class PokemonBoxIcon < IconSprite
|
|||||||
@startRelease = true
|
@startRelease = true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def refresh(fusion_enabled = true)
|
||||||
def refresh
|
|
||||||
return if !@pokemon
|
return if !@pokemon
|
||||||
if useRegularIcon(@pokemon.species) || @pokemon.egg?
|
if useRegularIcon(@pokemon.species) || @pokemon.egg?
|
||||||
self.setBitmap(GameData::Species.icon_filename_from_pokemon(@pokemon))
|
self.setBitmap(GameData::Species.icon_filename_from_pokemon(@pokemon))
|
||||||
else
|
else
|
||||||
self.setBitmapDirectly(createFusionIcon(@pokemon.species))
|
self.setBitmapDirectly(createFusionIcon(@pokemon.species))
|
||||||
|
if fusion_enabled
|
||||||
|
self.visible = true
|
||||||
|
else
|
||||||
|
self.visible = false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
self.src_rect = Rect.new(0, 0, self.bitmap.height, self.bitmap.height)
|
self.src_rect = Rect.new(0, 0, self.bitmap.height, self.bitmap.height)
|
||||||
end
|
end
|
||||||
@@ -349,7 +353,7 @@ class PokemonBoxSprite < SpriteWrapper
|
|||||||
attr_accessor :refreshBox
|
attr_accessor :refreshBox
|
||||||
attr_accessor :refreshSprites
|
attr_accessor :refreshSprites
|
||||||
|
|
||||||
def initialize(storage,boxnumber,viewport=nil)
|
def initialize(storage, boxnumber, viewport = nil, fusionsEnabled=true )
|
||||||
super(viewport)
|
super(viewport)
|
||||||
@storage = storage
|
@storage = storage
|
||||||
@boxnumber = boxnumber
|
@boxnumber = boxnumber
|
||||||
@@ -365,9 +369,25 @@ class PokemonBoxSprite < SpriteWrapper
|
|||||||
self.bitmap = @contents
|
self.bitmap = @contents
|
||||||
self.x = 184
|
self.x = 184
|
||||||
self.y = 18
|
self.y = 18
|
||||||
|
|
||||||
|
@fusions_enabled = fusionsEnabled
|
||||||
refresh
|
refresh
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def disableFusions()
|
||||||
|
@fusions_enabled = false
|
||||||
|
refreshAllBoxSprites()
|
||||||
|
end
|
||||||
|
|
||||||
|
def enableFusions()
|
||||||
|
@fusions_enabled = true
|
||||||
|
refreshAllBoxSprites()
|
||||||
|
end
|
||||||
|
|
||||||
|
def isFusionEnabled
|
||||||
|
return @fusions_enabled
|
||||||
|
end
|
||||||
|
|
||||||
def dispose
|
def dispose
|
||||||
if !disposed?
|
if !disposed?
|
||||||
for i in 0...PokemonBox::BOX_SIZE
|
for i in 0...PokemonBox::BOX_SIZE
|
||||||
@@ -448,14 +468,14 @@ class PokemonBoxSprite < SpriteWrapper
|
|||||||
if sprite
|
if sprite
|
||||||
arrow.grab(sprite)
|
arrow.grab(sprite)
|
||||||
@pokemonsprites[index] = nil
|
@pokemonsprites[index] = nil
|
||||||
refresh
|
update
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def deletePokemon(index)
|
def deletePokemon(index)
|
||||||
@pokemonsprites[index].dispose
|
@pokemonsprites[index].dispose
|
||||||
@pokemonsprites[index] = nil
|
@pokemonsprites[index] = nil
|
||||||
refresh
|
update
|
||||||
end
|
end
|
||||||
|
|
||||||
def refresh
|
def refresh
|
||||||
@@ -487,6 +507,14 @@ class PokemonBoxSprite < SpriteWrapper
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def refreshAllBoxSprites
|
||||||
|
for i in 0...PokemonBox::BOX_SIZE
|
||||||
|
if @pokemonsprites[i] && !@pokemonsprites[i].disposed?
|
||||||
|
@pokemonsprites[i].refresh(@fusions_enabled)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def update
|
def update
|
||||||
super
|
super
|
||||||
for i in 0...PokemonBox::BOX_SIZE
|
for i in 0...PokemonBox::BOX_SIZE
|
||||||
@@ -624,6 +652,7 @@ end
|
|||||||
#===============================================================================
|
#===============================================================================
|
||||||
class PokemonStorageScene
|
class PokemonStorageScene
|
||||||
attr_reader :quickswap
|
attr_reader :quickswap
|
||||||
|
attr_accessor :sprites
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@command = 1
|
@command = 1
|
||||||
@@ -1073,7 +1102,7 @@ class PokemonStorageScene
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbSwitchBoxToRight(newbox)
|
def pbSwitchBoxToRight(newbox)
|
||||||
newbox = PokemonBoxSprite.new(@storage,newbox,@boxviewport)
|
newbox = PokemonBoxSprite.new(@storage, newbox, @boxviewport,@sprites["box"].isFusionEnabled)
|
||||||
newbox.x = 520
|
newbox.x = 520
|
||||||
Graphics.frame_reset
|
Graphics.frame_reset
|
||||||
distancePerFrame = 64 * 20 / Graphics.frame_rate
|
distancePerFrame = 64 * 20 / Graphics.frame_rate
|
||||||
@@ -1090,10 +1119,11 @@ class PokemonStorageScene
|
|||||||
@sprites["box"].x -= diff
|
@sprites["box"].x -= diff
|
||||||
@sprites["box"].dispose
|
@sprites["box"].dispose
|
||||||
@sprites["box"] = newbox
|
@sprites["box"] = newbox
|
||||||
|
newbox.refreshAllBoxSprites
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbSwitchBoxToLeft(newbox)
|
def pbSwitchBoxToLeft(newbox)
|
||||||
newbox = PokemonBoxSprite.new(@storage,newbox,@boxviewport)
|
newbox = PokemonBoxSprite.new(@storage, newbox, @boxviewport,@sprites["box"].isFusionEnabled)
|
||||||
newbox.x = -152
|
newbox.x = -152
|
||||||
Graphics.frame_reset
|
Graphics.frame_reset
|
||||||
distancePerFrame = 64 * 20 / Graphics.frame_rate
|
distancePerFrame = 64 * 20 / Graphics.frame_rate
|
||||||
@@ -1110,6 +1140,7 @@ class PokemonStorageScene
|
|||||||
@sprites["box"].x -= diff
|
@sprites["box"].x -= diff
|
||||||
@sprites["box"].dispose
|
@sprites["box"].dispose
|
||||||
@sprites["box"] = newbox
|
@sprites["box"] = newbox
|
||||||
|
newbox.refreshAllBoxSprites
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbJumpToBox(newbox)
|
def pbJumpToBox(newbox)
|
||||||
@@ -1120,6 +1151,7 @@ class PokemonStorageScene
|
|||||||
pbSwitchBoxToLeft(newbox)
|
pbSwitchBoxToLeft(newbox)
|
||||||
end
|
end
|
||||||
@storage.currentBox = newbox
|
@storage.currentBox = newbox
|
||||||
|
newbox.refreshAllBoxSprites
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1340,16 +1372,24 @@ class PokemonStorageScene
|
|||||||
selection -= 3 if selection % 3 == 0
|
selection -= 3 if selection % 3 == 0
|
||||||
end
|
end
|
||||||
when Input::UP
|
when Input::UP
|
||||||
if selection==7; selection = 6
|
if selection == 7;
|
||||||
elsif selection==6; selection = 4
|
selection = 6
|
||||||
elsif selection<3; selection = 7
|
elsif selection == 6;
|
||||||
else; selection -= 3
|
selection = 4
|
||||||
|
elsif selection < 3;
|
||||||
|
selection = 7
|
||||||
|
else
|
||||||
|
; selection -= 3
|
||||||
end
|
end
|
||||||
when Input::DOWN
|
when Input::DOWN
|
||||||
if selection==7; selection = 1
|
if selection == 7;
|
||||||
elsif selection==6; selection = 7
|
selection = 1
|
||||||
elsif selection>=3; selection = 6
|
elsif selection == 6;
|
||||||
else; selection += 3
|
selection = 7
|
||||||
|
elsif selection >= 3;
|
||||||
|
selection = 6
|
||||||
|
else
|
||||||
|
; selection += 3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return selection
|
return selection
|
||||||
@@ -1470,7 +1510,7 @@ class PokemonStorageScene
|
|||||||
[_INTL("Exit"), 446, 326, 2, buttonbase, buttonshadow, 1],
|
[_INTL("Exit"), 446, 326, 2, buttonbase, buttonshadow, 1],
|
||||||
])
|
])
|
||||||
pokemon = nil
|
pokemon = nil
|
||||||
if @screen.pbHeldPokemon
|
if @screen.pbHeldPokemon && !@screen.fusionMode
|
||||||
pokemon = @screen.pbHeldPokemon
|
pokemon = @screen.pbHeldPokemon
|
||||||
elsif selection >= 0
|
elsif selection >= 0
|
||||||
pokemon = (party) ? party[selection] : @storage[@storage.currentBox, selection]
|
pokemon = (party) ? party[selection] : @storage[@storage.currentBox, selection]
|
||||||
@@ -1532,9 +1572,6 @@ class PokemonStorageScene
|
|||||||
pbUpdateSpriteHash(@sprites)
|
pbUpdateSpriteHash(@sprites)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def setFusing(fusing, item = 0)
|
def setFusing(fusing, item = 0)
|
||||||
sprite = @sprites["arrow"].setFusing(fusing)
|
sprite = @sprites["arrow"].setFusing(fusing)
|
||||||
if item == :INFINITESPLICERS
|
if item == :INFINITESPLICERS
|
||||||
@@ -1556,6 +1593,7 @@ class PokemonStorageScreen
|
|||||||
attr_reader :scene
|
attr_reader :scene
|
||||||
attr_reader :storage
|
attr_reader :storage
|
||||||
attr_accessor :heldpkmn
|
attr_accessor :heldpkmn
|
||||||
|
attr_accessor :fusionMode
|
||||||
|
|
||||||
def initialize(scene, storage)
|
def initialize(scene, storage)
|
||||||
@scene = scene
|
@scene = scene
|
||||||
@@ -1563,8 +1601,6 @@ class PokemonStorageScreen
|
|||||||
@pbHeldPokemon = nil
|
@pbHeldPokemon = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def pbStartScreen(command)
|
def pbStartScreen(command)
|
||||||
@heldpkmn = nil
|
@heldpkmn = nil
|
||||||
if command == 0 # Organise
|
if command == 0 # Organise
|
||||||
@@ -1696,10 +1732,13 @@ class PokemonStorageScreen
|
|||||||
_INTL("Cancel")
|
_INTL("Cancel")
|
||||||
])
|
])
|
||||||
case command
|
case command
|
||||||
when 0 then pbWithdraw(selected, nil)
|
when 0 then
|
||||||
when 1 then pbSummary(selected, nil)
|
pbWithdraw(selected, nil)
|
||||||
|
when 1 then
|
||||||
|
pbSummary(selected, nil)
|
||||||
#when 2 then pbMark(selected, nil)
|
#when 2 then pbMark(selected, nil)
|
||||||
when 2 then pbRelease(selected, nil)
|
when 2 then
|
||||||
|
pbRelease(selected, nil)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
@@ -1730,10 +1769,14 @@ class PokemonStorageScreen
|
|||||||
_INTL("Cancel")
|
_INTL("Cancel")
|
||||||
])
|
])
|
||||||
case command
|
case command
|
||||||
when 0 then pbStore([-1, selected], nil)
|
when 0 then
|
||||||
when 1 then pbSummary([-1, selected], nil)
|
pbStore([-1, selected], nil)
|
||||||
when 2 then pbMark([-1, selected], nil)
|
when 1 then
|
||||||
when 3 then pbRelease([-1, selected], nil)
|
pbSummary([-1, selected], nil)
|
||||||
|
when 2 then
|
||||||
|
pbMark([-1, selected], nil)
|
||||||
|
when 3 then
|
||||||
|
pbRelease([-1, selected], nil)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1752,7 +1795,8 @@ class PokemonStorageScreen
|
|||||||
@scene.pbHardRefresh
|
@scene.pbHardRefresh
|
||||||
end
|
end
|
||||||
|
|
||||||
def pbRefreshSingle(i) # For debug
|
def pbRefreshSingle(i)
|
||||||
|
# For debug
|
||||||
@scene.pbUpdateOverlay(i[1], (i[0] == -1) ? @storage.party : nil)
|
@scene.pbUpdateOverlay(i[1], (i[0] == -1) ? @storage.party : nil)
|
||||||
@scene.pbHardRefresh
|
@scene.pbHardRefresh
|
||||||
end
|
end
|
||||||
@@ -2095,7 +2139,6 @@ class PokemonStorageScreen
|
|||||||
return retval
|
return retval
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Fusion stuff
|
# Fusion stuff
|
||||||
#
|
#
|
||||||
@@ -2112,13 +2155,11 @@ class PokemonStorageScreen
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
splicerItem = selectSplicer()
|
splicerItem = selectSplicer()
|
||||||
if splicerItem == nil
|
if splicerItem == nil
|
||||||
cancelFusion()
|
cancelFusion()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
isSuperSplicer = isSuperSplicer?(splicerItem)
|
|
||||||
|
|
||||||
if !heldpoke
|
if !heldpoke
|
||||||
@fusionMode = true
|
@fusionMode = true
|
||||||
@@ -2126,6 +2167,7 @@ class PokemonStorageScreen
|
|||||||
@scene.setFusing(true, @fusionItem)
|
@scene.setFusing(true, @fusionItem)
|
||||||
pbHold(selected)
|
pbHold(selected)
|
||||||
pbDisplay(_INTL("Select a Pokémon to fuse it with"))
|
pbDisplay(_INTL("Select a Pokémon to fuse it with"))
|
||||||
|
@scene.sprites["box"].disableFusions()
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
if !poke_body
|
if !poke_body
|
||||||
@@ -2146,6 +2188,7 @@ class PokemonStorageScreen
|
|||||||
@splicerItem = nil
|
@splicerItem = nil
|
||||||
@scene.setFusing(false)
|
@scene.setFusing(false)
|
||||||
@fusionMode = false
|
@fusionMode = false
|
||||||
|
@scene.sprites["box"].enableFusions()
|
||||||
end
|
end
|
||||||
|
|
||||||
def canDeleteItem(item)
|
def canDeleteItem(item)
|
||||||
@@ -2156,7 +2199,6 @@ class PokemonStorageScreen
|
|||||||
return item == :SUPERSPLICERS || item == :INFINITESPLICERS2
|
return item == :SUPERSPLICERS || item == :INFINITESPLICERS2
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def pbFusionCommands(selected)
|
def pbFusionCommands(selected)
|
||||||
heldpoke = pbHeldPokemon
|
heldpoke = pbHeldPokemon
|
||||||
pokemon = @storage[selected[0], selected[1]]
|
pokemon = @storage[selected[0], selected[1]]
|
||||||
@@ -2202,6 +2244,7 @@ class PokemonStorageScreen
|
|||||||
deleteHeldPokemon(heldpoke, selected)
|
deleteHeldPokemon(heldpoke, selected)
|
||||||
@scene.setFusing(false)
|
@scene.setFusing(false)
|
||||||
@fusionMode = false
|
@fusionMode = false
|
||||||
|
@scene.sprites["box"].enableFusions()
|
||||||
return
|
return
|
||||||
else
|
else
|
||||||
# print "fusion cancelled"
|
# print "fusion cancelled"
|
||||||
@@ -2242,7 +2285,6 @@ class PokemonStorageScreen
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def selectSplicer()
|
def selectSplicer()
|
||||||
dna_splicers_const = "DNA Splicers"
|
dna_splicers_const = "DNA Splicers"
|
||||||
super_splicers_const = "Super Splicers"
|
super_splicers_const = "Super Splicers"
|
||||||
@@ -2278,5 +2320,4 @@ class PokemonStorageScreen
|
|||||||
return nil
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user