mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2026-07-22 15:47:00 +00:00
Rearranged Bag pockets, replaced Mail pocket with Held Items pocket
This commit is contained in:
@@ -92,25 +92,31 @@ SaveData.register_conversion(:v22_convert_bag_object) do
|
|||||||
to_value :bag do |bag|
|
to_value :bag do |bag|
|
||||||
bag.instance_eval do
|
bag.instance_eval do
|
||||||
all_pockets = GameData::BagPocket.all_pockets
|
all_pockets = GameData::BagPocket.all_pockets
|
||||||
|
if @pockets.is_a?(Array)
|
||||||
|
new_pockets = {}
|
||||||
|
all_pockets.each { |pckt| new_pockets[pckt] = [] }
|
||||||
|
@pockets.each_with_index do |value, i|
|
||||||
|
next if i == 0
|
||||||
|
value.each do |item|
|
||||||
|
pckt = GameData::Item.get(item[0]).bag_pocket
|
||||||
|
new_pockets[pckt].push(item)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@pockets = new_pockets
|
||||||
|
end
|
||||||
if @last_viewed_pocket.is_a?(Integer)
|
if @last_viewed_pocket.is_a?(Integer)
|
||||||
@last_viewed_pocket = all_pockets[@last_viewed_pocket - 1]
|
@last_viewed_pocket = all_pockets[@last_viewed_pocket - 1] || all_pockets.first
|
||||||
end
|
end
|
||||||
if @last_pocket_selections.is_a?(Array)
|
if @last_pocket_selections.is_a?(Array)
|
||||||
new_sels = {}
|
new_sels = {}
|
||||||
|
all_pockets.each { |pckt| new_sels[pckt] = 0 }
|
||||||
@last_pocket_selections.each_with_index do |value, i|
|
@last_pocket_selections.each_with_index do |value, i|
|
||||||
next if i == 0
|
next if i == 0
|
||||||
new_sels[all_pockets[i - 1]] = value
|
pckt = all_pockets[i - 1]
|
||||||
|
new_sels[pckt] = value if pckt && value <= @pockets[pckt].length - 1
|
||||||
end
|
end
|
||||||
@last_pocket_selections = new_sels
|
@last_pocket_selections = new_sels
|
||||||
end
|
end
|
||||||
if @pockets.is_a?(Array)
|
|
||||||
new_pockets = {}
|
|
||||||
@pockets.each_with_index do |value, i|
|
|
||||||
next if i == 0
|
|
||||||
new_pockets[all_pockets[i - 1]] = value
|
|
||||||
end
|
|
||||||
@pockets = new_pockets
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ end
|
|||||||
|
|
||||||
GameData::BagPocket.register({
|
GameData::BagPocket.register({
|
||||||
:id => :Items,
|
:id => :Items,
|
||||||
:name => _INTL("Items"),
|
:name => _INTL("Other Items"),
|
||||||
:icon_position => 0,
|
:icon_position => 0,
|
||||||
:order => 10
|
:order => 10
|
||||||
})
|
})
|
||||||
@@ -107,6 +107,28 @@ GameData::BagPocket.register({
|
|||||||
:order => 30
|
:order => 30
|
||||||
})
|
})
|
||||||
|
|
||||||
|
GameData::BagPocket.register({
|
||||||
|
:id => :Berries,
|
||||||
|
:name => _INTL("Berries"),
|
||||||
|
:icon_position => 3,
|
||||||
|
:order => 40,
|
||||||
|
:auto_sort => true
|
||||||
|
})
|
||||||
|
|
||||||
|
GameData::BagPocket.register({
|
||||||
|
:id => :HeldItems,
|
||||||
|
:name => _INTL("Held Items"),
|
||||||
|
:icon_position => 4,
|
||||||
|
:order => 50
|
||||||
|
})
|
||||||
|
|
||||||
|
GameData::BagPocket.register({
|
||||||
|
:id => :BattleItems,
|
||||||
|
:name => _INTL("Battle Items"),
|
||||||
|
:icon_position => 5,
|
||||||
|
:order => 60
|
||||||
|
})
|
||||||
|
|
||||||
# This pocket is hardcoded to allow showing the details of a machine item in
|
# This pocket is hardcoded to allow showing the details of a machine item in
|
||||||
# this pocket in the Bag. The display of this information is toggled by pressing
|
# this pocket in the Bag. The display of this information is toggled by pressing
|
||||||
# the Action input. It is not possible to open the screen menu with the Action
|
# the Action input. It is not possible to open the screen menu with the Action
|
||||||
@@ -115,31 +137,9 @@ GameData::BagPocket.register({
|
|||||||
GameData::BagPocket.register({
|
GameData::BagPocket.register({
|
||||||
:id => :Machines,
|
:id => :Machines,
|
||||||
:name => _INTL("TMs & HMs"),
|
:name => _INTL("TMs & HMs"),
|
||||||
:icon_position => 3,
|
|
||||||
:order => 40,
|
|
||||||
:auto_sort => true
|
|
||||||
})
|
|
||||||
|
|
||||||
GameData::BagPocket.register({
|
|
||||||
:id => :Berries,
|
|
||||||
:name => _INTL("Berries"),
|
|
||||||
:icon_position => 4,
|
|
||||||
:order => 50,
|
|
||||||
:auto_sort => true
|
|
||||||
})
|
|
||||||
|
|
||||||
GameData::BagPocket.register({
|
|
||||||
:id => :Mail,
|
|
||||||
:name => _INTL("Mail"),
|
|
||||||
:icon_position => 5,
|
|
||||||
:order => 60
|
|
||||||
})
|
|
||||||
|
|
||||||
GameData::BagPocket.register({
|
|
||||||
:id => :BattleItems,
|
|
||||||
:name => _INTL("Battle Items"),
|
|
||||||
:icon_position => 6,
|
:icon_position => 6,
|
||||||
:order => 70
|
:order => 70,
|
||||||
|
:auto_sort => true
|
||||||
})
|
})
|
||||||
|
|
||||||
GameData::BagPocket.register({
|
GameData::BagPocket.register({
|
||||||
|
|||||||
@@ -30,7 +30,12 @@ class PokemonBag
|
|||||||
|
|
||||||
def clear
|
def clear
|
||||||
@pockets.each_value { |pocket| pocket.clear }
|
@pockets.each_value { |pocket| pocket.clear }
|
||||||
GameData::BagPocket.all_pockets.each { |pckt| @last_pocket_selections[pckt] = 0 }
|
@pockets.clear
|
||||||
|
@last_pocket_selections.clear
|
||||||
|
GameData::BagPocket.all_pockets.each do |pckt|
|
||||||
|
@pockets[pckt] = []
|
||||||
|
@last_pocket_selections[pckt] = 0
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -821,7 +821,6 @@ MenuHandlers.add(:debug_menu, :fill_bag, {
|
|||||||
bag = $bag.pockets # Called here so that it only rearranges itself once
|
bag = $bag.pockets # Called here so that it only rearranges itself once
|
||||||
GameData::Item.each do |i|
|
GameData::Item.each do |i|
|
||||||
bag_pocket = i.bag_pocket
|
bag_pocket = i.bag_pocket
|
||||||
next if GameData::BagPocket.get(bag_pocket).max_slots
|
|
||||||
next if !pocket_sizes[bag_pocket] || pocket_sizes[bag_pocket] == 0
|
next if !pocket_sizes[bag_pocket] || pocket_sizes[bag_pocket] == 0
|
||||||
next if pocket_sizes[bag_pocket] > 0 && bag[bag_pocket].length >= pocket_sizes[bag_pocket]
|
next if pocket_sizes[bag_pocket] > 0 && bag[bag_pocket].length >= pocket_sizes[bag_pocket]
|
||||||
item_qty = (i.is_important?) ? 1 : qty
|
item_qty = (i.is_important?) ? 1 : qty
|
||||||
|
|||||||
+2696
-2696
File diff suppressed because it is too large
Load Diff
+3282
-3282
File diff suppressed because it is too large
Load Diff
+3245
-3245
File diff suppressed because it is too large
Load Diff
+3840
-3840
File diff suppressed because it is too large
Load Diff
+3953
-3953
File diff suppressed because it is too large
Load Diff
+3953
-3953
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user