This commit is contained in:
infinitefusion
2021-07-15 14:45:38 -04:00
parent 17c136e050
commit 0190b3c365
5 changed files with 46 additions and 26 deletions

Binary file not shown.

View File

@@ -216,9 +216,7 @@ module Settings
# Dex list, no matter which region the player is currently in. # Dex list, no matter which region the player is currently in.
def self.pokedex_names def self.pokedex_names
return [ return [
[_INTL("Kanto Pokédex"), 0], [_INTL("Kanto Pokédex"), 0]
[_INTL("Johto Pokédex"), 1],
_INTL("National Pokédex")
] ]
end end
# Whether all forms of a given species will be immediately available to view # Whether all forms of a given species will be immediately available to view

View File

@@ -64,7 +64,8 @@ module GameData
end end
def self.front_sprite_bitmap(species, form = 0, gender = 0, shiny = false, shadow = false) def self.front_sprite_bitmap(species, form = 0, gender = 0, shiny = false, shadow = false)
filename = self.front_sprite_filename(species, form, gender, shiny, shadow) #filename = self.front_sprite_filename(species, form, gender, shiny, shadow)
filename = self.front_sprite_filename(GameData::Species.get(species).id_number)
return (filename) ? AnimatedBitmap.new(filename) : nil return (filename) ? AnimatedBitmap.new(filename) : nil
end end

View File

@@ -312,29 +312,46 @@ class PokemonPokedex_Scene
return true # For MODENUMERICAL return true # For MODENUMERICAL
end end
def pbGetDexList # def pbGetDexList
region = pbGetPokedexRegion # region = pbGetPokedexRegion
regionalSpecies = pbAllRegionalSpecies(region) # regionalSpecies = pbAllRegionalSpecies(region)
if !regionalSpecies || regionalSpecies.length == 0 # if !regionalSpecies || regionalSpecies.length == 0
# If no Regional Dex defined for the given region, use the National Pokédex # # If no Regional Dex defined for the given region, use the National Pokédex
regionalSpecies = [] # regionalSpecies = []
GameData::Species.each { |s| regionalSpecies.push(s.id) if s.form == 0 } # GameData::Species.each { |s| regionalSpecies.push(s.id) if s.form == 0 }
# end
# shift = Settings::DEXES_WITH_OFFSETS.include?(region)
# ret = []
# regionalSpecies.each_with_index do |species, i|
# next if !species
# next if !pbCanAddForModeList?($PokemonGlobal.pokedexMode, species)
# species_data = GameData::Species.get(species)
# color = species_data.color
# type1 = species_data.type1
# type2 = species_data.type2 || type1
# shape = species_data.shape
# height = species_data.height
# weight = species_data.weight
# ret.push([species, species_data.name, height, weight, i + 1, shift, type1, type2, color, shape])
# end
# return ret
# end
def pbGetDexList()
dexlist=[]
regionalSpecies=[]
for i in 1..PBSpecies.maxValue
regionalSpecies.push(i)
end end
shift = Settings::DEXES_WITH_OFFSETS.include?(region) for i in 1...PBSpecies.maxValue
ret = [] nationalSpecies=i
regionalSpecies.each_with_index do |species, i| if $Trainer.seen?(nationalSpecies)
next if !species species = GameData::Species.get(nationalSpecies)
next if !pbCanAddForModeList?($PokemonGlobal.pokedexMode, species) dexlist.push([species.id_number,species.real_name,0,0,i+1,0])
species_data = GameData::Species.get(species) end
color = species_data.color
type1 = species_data.type1
type2 = species_data.type2 || type1
shape = species_data.shape
height = species_data.height
weight = species_data.weight
ret.push([species, species_data.name, height, weight, i + 1, shift, type1, type2, color, shape])
end end
return ret return dexlist
end end
def pbRefreshDexList(index=0) def pbRefreshDexList(index=0)

View File

@@ -21,7 +21,10 @@ module GameData
return ret return ret
end end
def self.front_sprite_bitmap(dex_number) def self.front_sprite_bitmap(dex_number,a=0,b=0,c=0,d=0) #la méthode est utilisé ailleurs avec d'autres arguments (gender, form, etc.) mais on les veut pas
if dex_number.is_a?(Symbol)
dex_number = GameData::Species.get(dex_number).id_number
end
filename = self.sprite_filename(dex_number) filename = self.sprite_filename(dex_number)
return (filename) ? AnimatedBitmap.new(filename) : nil return (filename) ? AnimatedBitmap.new(filename) : nil
end end
@@ -37,6 +40,7 @@ module GameData
end end
def self.sprite_filename(dex_number) def self.sprite_filename(dex_number)
return nil if dex_number == nil
if dex_number <= Settings::NB_POKEMON if dex_number <= Settings::NB_POKEMON
folder = dex_number.to_s folder = dex_number.to_s
filename = sprintf("%s.png", dex_number) filename = sprintf("%s.png", dex_number)