mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 05:34:58 +00:00
Fixed the Bag lists having incorrect starting positions when choosing an item from a subset of your Bag
This commit is contained in:
@@ -202,8 +202,12 @@ class Battle::Scene
|
|||||||
# Set Bag starting positions
|
# Set Bag starting positions
|
||||||
oldLastPocket = $bag.last_viewed_pocket
|
oldLastPocket = $bag.last_viewed_pocket
|
||||||
oldChoices = $bag.last_pocket_selections.clone
|
oldChoices = $bag.last_pocket_selections.clone
|
||||||
$bag.last_viewed_pocket = @bagLastPocket if @bagLastPocket
|
if @bagLastPocket
|
||||||
$bag.last_pocket_selections = @bagChoices if @bagChoices
|
$bag.last_viewed_pocket = @bagLastPocket
|
||||||
|
$bag.last_pocket_selections = @bagChoices
|
||||||
|
else
|
||||||
|
$bag.reset_last_selections
|
||||||
|
end
|
||||||
# Start Bag screen
|
# Start Bag screen
|
||||||
itemScene = PokemonBag_Scene.new
|
itemScene = PokemonBag_Scene.new
|
||||||
itemScene.pbStartScene($bag, true,
|
itemScene.pbStartScene($bag, true,
|
||||||
|
|||||||
@@ -16,17 +16,19 @@ class PokemonBag
|
|||||||
end
|
end
|
||||||
|
|
||||||
def initialize
|
def initialize
|
||||||
@last_viewed_pocket = 1
|
@pockets = []
|
||||||
@pockets = []
|
(0..PokemonBag.pocket_count).each { |i| @pockets[i] = [] }
|
||||||
@last_pocket_selections = []
|
reset_last_selections
|
||||||
(0..PokemonBag.pocket_count).each do |i|
|
|
||||||
@pockets[i] = []
|
|
||||||
@last_pocket_selections[i] = 0
|
|
||||||
end
|
|
||||||
@registered_items = []
|
@registered_items = []
|
||||||
@ready_menu_selection = [0, 0, 1] # Used by the Ready Menu to remember cursor positions
|
@ready_menu_selection = [0, 0, 1] # Used by the Ready Menu to remember cursor positions
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def reset_last_selections
|
||||||
|
@last_viewed_pocket = 1
|
||||||
|
@last_pocket_selections ||= []
|
||||||
|
(0..PokemonBag.pocket_count).each { |i| @last_pocket_selections[i] = 0 }
|
||||||
|
end
|
||||||
|
|
||||||
def clear
|
def clear
|
||||||
@pockets.each { |pocket| pocket.clear }
|
@pockets.each { |pocket| pocket.clear }
|
||||||
(PokemonBag.pocket_count + 1).times { |i| @last_pocket_selections[i] = 0 }
|
(PokemonBag.pocket_count + 1).times { |i| @last_pocket_selections[i] = 0 }
|
||||||
|
|||||||
@@ -586,6 +586,7 @@ class PokemonBagScreen
|
|||||||
def pbChooseItemScreen(proc = nil)
|
def pbChooseItemScreen(proc = nil)
|
||||||
oldlastpocket = @bag.last_viewed_pocket
|
oldlastpocket = @bag.last_viewed_pocket
|
||||||
oldchoices = @bag.last_pocket_selections.clone
|
oldchoices = @bag.last_pocket_selections.clone
|
||||||
|
@bag.reset_last_selections if proc
|
||||||
@scene.pbStartScene(@bag, true, proc)
|
@scene.pbStartScene(@bag, true, proc)
|
||||||
item = @scene.pbChooseItem
|
item = @scene.pbChooseItem
|
||||||
@scene.pbEndScene
|
@scene.pbEndScene
|
||||||
|
|||||||
Reference in New Issue
Block a user