mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 14:14:59 +00:00
Makes it possible to download sprites at runtime
This commit is contained in:
@@ -25,7 +25,7 @@ module Settings
|
|||||||
CUSTOM_BATTLERS_FOLDER_INDEXED = "Graphics/CustomBattlers/indexed"
|
CUSTOM_BATTLERS_FOLDER_INDEXED = "Graphics/CustomBattlers/indexed"
|
||||||
BATTLERS_FOLDER = "Graphics/Battlers/"
|
BATTLERS_FOLDER = "Graphics/Battlers/"
|
||||||
DOWNLOADED_SPRITES_FOLDER = "Graphics/temp/"
|
DOWNLOADED_SPRITES_FOLDER = "Graphics/temp/"
|
||||||
|
DEFAULT_SPRITE_PATH = "Graphics/Battlers/Special/000.png"
|
||||||
FRONTSPRITE_POSITION_OFFSET = 20
|
FRONTSPRITE_POSITION_OFFSET = 20
|
||||||
FRONTSPRITE_SCALE = 0.6666666666
|
FRONTSPRITE_SCALE = 0.6666666666
|
||||||
BACKRPSPRITE_SCALE = 1
|
BACKRPSPRITE_SCALE = 1
|
||||||
|
|||||||
@@ -408,7 +408,7 @@ end
|
|||||||
#end
|
#end
|
||||||
|
|
||||||
|
|
||||||
def getCustomSpeciesList()
|
def getCustomSpeciesList(allowOnline=true)
|
||||||
speciesList = []
|
speciesList = []
|
||||||
|
|
||||||
for num in 1..NB_POKEMON
|
for num in 1..NB_POKEMON
|
||||||
@@ -429,6 +429,16 @@ def getCustomSpeciesList()
|
|||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
if speciesList.length <= 200 && allowOnline
|
||||||
|
#try to get list from github
|
||||||
|
print "let's try it online bruh"
|
||||||
|
online_list = list_online_custom_sprites
|
||||||
|
return online_list if online_list !=nil
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
return speciesList
|
return speciesList
|
||||||
end
|
end
|
||||||
# def getCustomSpeciesList()
|
# def getCustomSpeciesList()
|
||||||
|
|||||||
@@ -110,7 +110,8 @@ class DoublePreviewScreen
|
|||||||
bitmap = AnimatedBitmap.new(picturePath)
|
bitmap = AnimatedBitmap.new(picturePath)
|
||||||
bitmap.scale_bitmap(Settings::FRONTSPRITE_SCALE)
|
bitmap.scale_bitmap(Settings::FRONTSPRITE_SCALE)
|
||||||
|
|
||||||
hasCustom = picturePath.include?("CustomBattlers")
|
#hasCustom = picturePath.include?("CustomBattlers")
|
||||||
|
hasCustom = customSpriteExistsBase(body_pokemon,head_pokemon)
|
||||||
|
|
||||||
previewwindow = PictureWindow.new(bitmap)
|
previewwindow = PictureWindow.new(bitmap)
|
||||||
previewwindow.x = x
|
previewwindow.x = x
|
||||||
@@ -131,13 +132,7 @@ class DoublePreviewScreen
|
|||||||
|
|
||||||
|
|
||||||
def getPicturePath(head_pokemon, body_pokemon)
|
def getPicturePath(head_pokemon, body_pokemon)
|
||||||
pathCustom = _INTL("Graphics/CustomBattlers/indexed/{1}/{1}.{2}.png", head_pokemon, body_pokemon)
|
return get_fusion_sprite_path(head_pokemon,body_pokemon)
|
||||||
if (pbResolveBitmap(pathCustom))
|
|
||||||
picturePath = pathCustom
|
|
||||||
else
|
|
||||||
picturePath = _INTL("Graphics/Battlers/{1}/{1}.{2}.png",head_pokemon , body_pokemon)
|
|
||||||
end
|
|
||||||
return picturePath
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def drawFusionInformation(fusedDexNum, level, x = 0)
|
def drawFusionInformation(fusedDexNum, level, x = 0)
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ end
|
|||||||
|
|
||||||
def getRandomCustomFusionForIntro(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3)
|
def getRandomCustomFusionForIntro(returnRandomPokemonIfNoneFound = true, customPokeList = [], maxPoke = -1, recursionLimit = 3)
|
||||||
if customPokeList.length == 0
|
if customPokeList.length == 0
|
||||||
customPokeList = getCustomSpeciesList()
|
customPokeList = getCustomSpeciesList(false )
|
||||||
end
|
end
|
||||||
randPoke = []
|
randPoke = []
|
||||||
if customPokeList.length >= 5000
|
if customPokeList.length >= 5000
|
||||||
@@ -401,9 +401,18 @@ def customSpriteExists(species)
|
|||||||
head = getBasePokemonID(species, false)
|
head = getBasePokemonID(species, false)
|
||||||
body = getBasePokemonID(species, true)
|
body = getBasePokemonID(species, true)
|
||||||
pathCustom = getCustomSpritePath(body,head)
|
pathCustom = getCustomSpritePath(body,head)
|
||||||
return pbResolveBitmap(pathCustom) != nil
|
|
||||||
|
return true if pbResolveBitmap(pathCustom) != nil
|
||||||
|
return download_custom_sprite(head, body) != nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def customSpriteExistsBase(head,body)
|
||||||
|
pathCustom = getCustomSpritePath(body,head)
|
||||||
|
return true if pbResolveBitmap(pathCustom) != nil
|
||||||
|
return download_custom_sprite(head, body) != nil
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
def getArceusPlateType(heldItem)
|
def getArceusPlateType(heldItem)
|
||||||
return :NORMAL if heldItem == nil
|
return :NORMAL if heldItem == nil
|
||||||
case heldItem
|
case heldItem
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ class Scene_Intro
|
|||||||
pbBGMStop(1.0)
|
pbBGMStop(1.0)
|
||||||
# disposes current title screen
|
# disposes current title screen
|
||||||
disposeTitle
|
disposeTitle
|
||||||
|
clearTempFolder
|
||||||
# initializes load screen
|
# initializes load screen
|
||||||
sscene = PokemonLoad_Scene.new
|
sscene = PokemonLoad_Scene.new
|
||||||
sscreen = PokemonLoadScreen.new(sscene)
|
sscreen = PokemonLoadScreen.new(sscene)
|
||||||
@@ -129,19 +130,18 @@ class GenOneStyle
|
|||||||
Kernel.pbDisplayText("Version " + Settings::GAME_VERSION_NUMBER, 254, 308, 99999)
|
Kernel.pbDisplayText("Version " + Settings::GAME_VERSION_NUMBER, 254, 308, 99999)
|
||||||
|
|
||||||
@maxPoke = 140 #1st gen, pas de legend la premiere fois, graduellement plus de poke
|
@maxPoke = 140 #1st gen, pas de legend la premiere fois, graduellement plus de poke
|
||||||
@customPokeList = getCustomSpeciesList()
|
@customPokeList = getCustomSpeciesList(false)
|
||||||
#Get random Pokemon (1st gen orandPokenly, pas de legend la prmeiere fois)
|
#Get random Pokemon (1st gen orandPokenly, pas de legend la prmeiere fois)
|
||||||
|
|
||||||
randPoke = getRandomCustomFusionForIntro(true, @customPokeList, @maxPoke)
|
randPoke = getRandomCustomFusionForIntro(true, @customPokeList, @maxPoke)
|
||||||
randpoke1 = randPoke[0] #rand(@maxPoke)+1
|
randpoke1 = randPoke[0] #rand(@maxPoke)+1
|
||||||
randpoke2 = randPoke[1] #rand(@maxPoke)+1
|
randpoke2 = randPoke[1] #rand(@maxPoke)+1
|
||||||
|
|
||||||
randpoke1s = randpoke1.to_s
|
|
||||||
randpoke2s = randpoke2.to_s
|
randpoke2s = randpoke2.to_s
|
||||||
|
|
||||||
path_s1 = "Graphics/Battlers/" + randpoke1s + "/" + randpoke1s + ".png"
|
path_s1 = get_unfused_sprite_path(randpoke1)
|
||||||
path_s2 = "Graphics/Battlers/" + randpoke2s + "/" + randpoke2s + ".png"
|
path_s2 = get_unfused_sprite_path(randpoke2)
|
||||||
path_f = getFusedPath(randpoke1, randpoke2)
|
path_f = get_fusion_sprite_path(randpoke1, randpoke2)
|
||||||
|
|
||||||
@prevPoke1 = randpoke1
|
@prevPoke1 = randpoke1
|
||||||
@prevPoke2 = randpoke2
|
@prevPoke2 = randpoke2
|
||||||
@@ -219,7 +219,7 @@ class GenOneStyle
|
|||||||
@sprites["poke"].tone = Tone.new(0, 0, 0, 255)
|
@sprites["poke"].tone = Tone.new(0, 0, 0, 255)
|
||||||
@sprites["poke"].opacity = 0
|
@sprites["poke"].opacity = 0
|
||||||
@sprites["poke2"] = Sprite.new(@viewport)
|
@sprites["poke2"] = Sprite.new(@viewport)
|
||||||
@sprites["poke2"].bitmap = pbBitmap("Graphics/Battlers/21364")
|
# @sprites["poke2"].bitmap = pbBitmap("Graphics/Battlers/21364")
|
||||||
@sprites["poke2"].tone = Tone.new(255, 255, 255, 255)
|
@sprites["poke2"].tone = Tone.new(255, 255, 255, 255)
|
||||||
@sprites["poke2"].src_rect.set(0, Graphics.height, Graphics.width, 48)
|
@sprites["poke2"].src_rect.set(0, Graphics.height, Graphics.width, 48)
|
||||||
@sprites["poke2"].y = Graphics.height
|
@sprites["poke2"].y = Graphics.height
|
||||||
@@ -372,11 +372,8 @@ class GenOneStyle
|
|||||||
randpoke1 = randPoke[0] #rand(@maxPoke)+1
|
randpoke1 = randPoke[0] #rand(@maxPoke)+1
|
||||||
randpoke2 = randPoke[1] #rand(@maxPoke)+1
|
randpoke2 = randPoke[1] #rand(@maxPoke)+1
|
||||||
|
|
||||||
randpoke1s = randpoke1.to_s
|
path_s1 = get_unfused_sprite_path(randpoke1)
|
||||||
randpoke2s = randpoke2.to_s
|
path_s2 = get_unfused_sprite_path(randpoke2)
|
||||||
|
|
||||||
path_s1 = "Graphics/Battlers/" + randpoke1s + "/" + randpoke1s + ".png"
|
|
||||||
path_s2 = "Graphics/Battlers/" + randpoke2s + "/" + randpoke2s + ".png"
|
|
||||||
path_f = getFusedPath(randpoke1, randpoke2)
|
path_f = getFusedPath(randpoke1, randpoke2)
|
||||||
|
|
||||||
path_fMod = getFusedPath(@prevPoke1, @prevPoke2)
|
path_fMod = getFusedPath(@prevPoke1, @prevPoke2)
|
||||||
@@ -408,11 +405,11 @@ class GenOneStyle
|
|||||||
|
|
||||||
#new version
|
#new version
|
||||||
def getFusedPath(randpoke1, randpoke2)
|
def getFusedPath(randpoke1, randpoke2)
|
||||||
path = rand(2) == 0 ? GetSpritePathForced(randpoke1, randpoke2, true) : GetSpritePathForced(randpoke2, randpoke1, true)
|
path = rand(2) == 0 ? get_fusion_sprite_path(randpoke1, randpoke2) : get_fusion_sprite_path(randpoke2, randpoke1)
|
||||||
if Input.press?(Input::RIGHT)
|
if Input.press?(Input::RIGHT)
|
||||||
path = GetSpritePathForced(randpoke1, randpoke2, true)
|
path = get_fusion_sprite_path(randpoke2, randpoke1)
|
||||||
elsif Input.press?(Input::LEFT)
|
elsif Input.press?(Input::LEFT)
|
||||||
path = GetSpritePathForced(randpoke2, randpoke1, true)
|
path = get_fusion_sprite_path(randpoke1, randpoke2)
|
||||||
end
|
end
|
||||||
return path
|
return path
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ def handleReplaceExistingSprites()
|
|||||||
end
|
end
|
||||||
|
|
||||||
def pbCallTitle
|
def pbCallTitle
|
||||||
return Scene_DebugIntro.new if $DEBUG
|
#return Scene_DebugIntro.new if $DEBUG
|
||||||
return Scene_Intro.new
|
return Scene_Intro.new
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -144,7 +144,11 @@ def mainFunctionDebug
|
|||||||
Graphics.update
|
Graphics.update
|
||||||
Graphics.freeze
|
Graphics.freeze
|
||||||
clearTempFolder()
|
clearTempFolder()
|
||||||
|
begin
|
||||||
sortCustomBattlers()
|
sortCustomBattlers()
|
||||||
|
rescue
|
||||||
|
echo "failed to sort custom battlers"
|
||||||
|
end
|
||||||
$scene = pbCallTitle
|
$scene = pbCallTitle
|
||||||
$scene.main until $scene.nil?
|
$scene.main until $scene.nil?
|
||||||
Graphics.transition(20)
|
Graphics.transition(20)
|
||||||
|
|||||||
Binary file not shown.
Reference in New Issue
Block a user