Fixed previous commit always causing recompiling if shadow_pokemon.dat doesn't exist, also rubocopping

This commit is contained in:
Maruno17
2023-01-23 22:27:04 +00:00
parent f6213057d8
commit b0b6e675c3
103 changed files with 1099 additions and 1302 deletions

View File

@@ -16,15 +16,15 @@ class PokemonBag
end
def initialize
@pockets = []
@pockets = []
(0..PokemonBag.pocket_count).each { |i| @pockets[i] = [] }
reset_last_selections
@registered_items = []
@registered_items = []
@ready_menu_selection = [0, 0, 1] # Used by the Ready Menu to remember cursor positions
end
def reset_last_selections
@last_viewed_pocket = 1
@last_viewed_pocket = 1
@last_pocket_selections ||= []
(0..PokemonBag.pocket_count).each { |i| @last_pocket_selections[i] = 0 }
end
@@ -39,7 +39,7 @@ class PokemonBag
return @pockets
end
#=============================================================================
#-----------------------------------------------------------------------------
# Gets the index of the current selected item in the pocket
def last_viewed_index(pocket)
@@ -59,7 +59,7 @@ class PokemonBag
@last_pocket_selections[pocket] = value if value <= @pockets[pocket].length
end
#=============================================================================
#-----------------------------------------------------------------------------
def quantity(item)
item_data = GameData::Item.try_get(item)
@@ -139,7 +139,7 @@ class PokemonBag
return ret
end
#=============================================================================
#-----------------------------------------------------------------------------
# Returns whether item has been registered for quick access in the Ready Menu.
def registered?(item)
@@ -161,7 +161,7 @@ class PokemonBag
@registered_items.delete(item_data.id) if item_data
end
#=============================================================================
#-----------------------------------------------------------------------------
private
@@ -193,8 +193,6 @@ class PokemonBag
end
end
#===============================================================================
# The PC item storage object, which actually contains all the items
#===============================================================================
@@ -260,8 +258,6 @@ class PCItemStorage
end
end
#===============================================================================
# Implements methods that act on arrays of items. Each element in an item
# array is itself an array of [itemID, itemCount].
@@ -333,8 +329,6 @@ module ItemStorageHelper
end
end
#===============================================================================
# Deprecated methods
#===============================================================================