Various bugfixes

This commit is contained in:
chardub
2023-02-01 16:15:06 -05:00
parent abb49168ba
commit ee2e718361
26 changed files with 87 additions and 30 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -24,6 +24,8 @@ module Settings
CUSTOM_BATTLERS_FOLDER = "Graphics/CustomBattlers/"
CUSTOM_BATTLERS_FOLDER_INDEXED = "Graphics/CustomBattlers/indexed"
BATTLERS_FOLDER = "Graphics/Battlers/"
DOWNLOADED_SPRITES_FOLDER = "Graphics/temp/"
FRONTSPRITE_POSITION_OFFSET = 20
FRONTSPRITE_SCALE = 0.6666666666
BACKRPSPRITE_SCALE = 1

View File

@@ -540,6 +540,7 @@ module PluginManager
# Get a list of all the plugin directories to inspect
#-----------------------------------------------------------------------------
def self.listAll
return []
return [] if !$DEBUG || safeExists?("Game.rgssad")
# get a list of all directories in the `Plugins/` folder
dirs = []

View File

@@ -235,7 +235,9 @@ class PokemonDataBox < SpriteWrapper
# Draw shiny icon
if @battler.shiny?
shinyX = (@battler.opposes?(0)) ? 206 : -6 # Foe's/player's
addShinyStarsToGraphicsArray(imagePos,@spriteBaseX+shinyX,35, @battler.pokemon.bodyShiny?,@battler.pokemon.headShiny?,@battler.pokemon.debugShiny?)
pokeRadarShiny= !@battler.pokemon.debugShiny? && !@battler.pokemon.naturalShiny?
addShinyStarsToGraphicsArray(imagePos,@spriteBaseX+shinyX,35, @battler.pokemon.bodyShiny?,@battler.pokemon.headShiny?,@battler.pokemon.debugShiny?, pokeRadarShiny)
end
# Draw Mega Evolution/Primal Reversion icon
if @battler.mega?

View File

@@ -22,6 +22,7 @@ class DoublePreviewScreen
@picture2 = nil
@draw_types = nil
@draw_level = nil
@draw_sprite_info = nil
@selected = 0
@last_post=0
@sprites = {}
@@ -143,6 +144,7 @@ class DoublePreviewScreen
viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
@typewindows << drawPokemonType(fusedDexNum, viewport, x + 55, 220) if @draw_types
drawFusionPreviewText(viewport, "Lv. " + level.to_s, x + 80, 40,) if @draw_level
drawSpriteInfoIcons(getPokemon(fusedDexNum),viewport) if @draw_sprite_info
end
@@ -179,6 +181,16 @@ class DoublePreviewScreen
pbDrawTextPositions(overlay, textpos)
end
#todo
# Adds the icons indicating if the fusion has alt sprites and if the final evo has a custom sprite
# also add a second icon to indidcate if the final evolution has a custom
def drawSpriteInfoIcons(fusedPokemon, viewport)
#pokedexUtils = PokedexUtils.new
#hasAltSprites = pokedexUtils.pbGetAvailableAlts(fusedPokemon).size>1
#pokedexUtils.getFinalEvolution(fusedPokemon).real_name
#todo
end
def dispose
@picture1.dispose
@picture2.dispose

View File

@@ -14,6 +14,7 @@ class FusionPreviewScreen < DoublePreviewScreen
super(poke1,poke2)
@draw_types = true
@draw_level = true
@draw_sprite_info=true
#@viewport = viewport
@poke1 = poke1

View File

@@ -161,7 +161,7 @@ end
def addShinyStarsToGraphicsArray(imageArray, xPos, yPos, shinyBody, shinyHead, debugShiny, srcx=nil, srcy=nil, width=nil, height=nil,
showSecondStarUnder=false, showSecondStarAbove=false)
showSecondStarUnder=false, showSecondStarAbove=false )
color = debugShiny ? Color.new(0,0,0,255) : nil
imageArray.push(["Graphics/Pictures/shiny",xPos,yPos,srcx,srcy,width,height,color])
if shinyBody && shinyHead
@@ -174,6 +174,10 @@ def addShinyStarsToGraphicsArray(imageArray, xPos, yPos, shinyBody, shinyHead, d
end
imageArray.push(["Graphics/Pictures/shiny",xPos,yPos,srcx,srcy,width,height,color])
end
# if onlyOutline
# imageArray.push(["Graphics/Pictures/shiny_black",xPos,yPos,srcx,srcy,width,height,color])
# end
end
def getRandomCustomFusion(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3, maxBST=300)
@@ -369,9 +373,14 @@ end
def obtainPokemonSpritePath(id, includeCustoms = true)
head = getBasePokemonID(param.to_i, false)
body = getBasePokemonID(param.to_i, true)
return obtainPokemonSpritePath(body, head, includeCustoms)
end
def obtainPokemonSpritePath(bodyId, headId, include_customs = true)
picturePath = _INTL("Graphics/Battlers/{1}/{1}.{2}.png", headId, bodyId)

View File

@@ -0,0 +1,48 @@
class PokedexUtils
POSSIBLE_ALTS = %w[a b c d e f g h i j k x]
def pbGetAvailableAlts(species)
ret = []
return ret if !species
dexNum = getDexNumberForSpecies(species)
isFusion = dexNum > NB_POKEMON
if !isFusion
ret << Settings::BATTLERS_FOLDER + dexNum.to_s + "/" + dexNum.to_s + ".png"
return ret
end
body_id = getBodyID(species)
head_id = getHeadID(species, body_id)
baseFilename = head_id.to_s + "." + body_id.to_s
baseFilePath = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + "/" + head_id.to_s + "/" + baseFilename + ".png"
if pbResolveBitmap(baseFilePath)
ret << baseFilePath
end
POSSIBLE_ALTS.each { |alt_letter|
altFilePath = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + "/" + head_id.to_s + "/" + baseFilename + alt_letter + ".png"
if pbResolveBitmap(altFilePath)
ret << altFilePath
end
}
ret << Settings::BATTLERS_FOLDER + head_id.to_s + "/" + baseFilename + ".png"
return ret
end
#todo: return array for split evolution lines that have multiple final evos
def getFinalEvolution(species)
#ex: [[B3H4,Level 32],[B2H5, Level 35]]
evolution_line = species.get_evolutions
return species if evolution_line.empty?
finalEvoId = evolution_line[0][0]
return evolution_line[]
for evolution in evolution_line
evoSpecies = evolution[0]
p GameData::Species.get(evoSpecies).get_evolutions
isFinalEvo = GameData::Species.get(evoSpecies).get_evolutions.empty?
return evoSpecies if isFinalEvo
end
return nil
end
end

View File

@@ -92,10 +92,9 @@ class PokemonPokedexInfo_Scene
end
POSSIBLE_ALTS = %w[a b c d e f g h i j k x]
def pbGetAvailableForms
return pbGetAvailableAlts
return PokedexUtils.new.pbGetAvailableAlts(@species)
end
def hide_all_selected_windows
@@ -134,32 +133,7 @@ class PokemonPokedexInfo_Scene
update_selected
end
def pbGetAvailableAlts
ret = []
return ret if !@species
dexNum = getDexNumberForSpecies(@species)
isFusion = dexNum > NB_POKEMON
if !isFusion
ret << Settings::BATTLERS_FOLDER + dexNum.to_s + "/" + dexNum.to_s + ".png"
return ret
end
body_id = getBodyID(@species)
head_id = getHeadID(@species, body_id)
baseFilename = head_id.to_s + "." + body_id.to_s
baseFilePath = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + "/" + head_id.to_s + "/" + baseFilename + ".png"
if pbResolveBitmap(baseFilePath)
ret << baseFilePath
end
POSSIBLE_ALTS.each { |alt_letter|
altFilePath = Settings::CUSTOM_BATTLERS_FOLDER_INDEXED + "/" + head_id.to_s + "/" + baseFilename + alt_letter + ".png"
if pbResolveBitmap(altFilePath)
ret << altFilePath
end
}
ret << Settings::BATTLERS_FOLDER + head_id.to_s + "/" + baseFilename + ".png"
return ret
end
def pbChooseForm
loop do

View File

@@ -57,7 +57,14 @@ def mainFunction
return 1
end
def clearTempFolder()
folder_path = Settings::DOWNLOADED_SPRITES_FOLDER
Dir.foreach(folder_path) do |file|
next if file == '.' or file == '..'
file_path = File.join(folder_path, file)
File.delete(file_path) if File.file?(file_path)
end
end
def sortCustomBattlers()
$game_temp.nb_imported_sprites=0
@@ -136,6 +143,7 @@ def mainFunctionDebug
Game.set_up_system
Graphics.update
Graphics.freeze
clearTempFolder()
sortCustomBattlers()
$scene = pbCallTitle
$scene.main until $scene.nil?

Binary file not shown.