mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
display spriter credits in fusion screen and pokedex
This commit is contained in:
1
Data/.~lock.credits.csv#
Normal file
1
Data/.~lock.credits.csv#
Normal file
@@ -0,0 +1 @@
|
||||
Charles Dubois,DESKTOP-U5METSR/charl,DESKTOP-U5METSR,07.04.2023 22:25,file:///C:/Users/charl/AppData/Roaming/OpenOffice/4;
|
||||
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.
@@ -26,6 +26,7 @@ module Settings
|
||||
BATTLERS_FOLDER = "Graphics/Battlers/"
|
||||
DOWNLOADED_SPRITES_FOLDER = "Graphics/temp/"
|
||||
DEFAULT_SPRITE_PATH = "Graphics/Battlers/Special/000.png"
|
||||
CREDITS_FILE_PATH = "Data/credits.csv"
|
||||
FRONTSPRITE_POSITION_OFFSET = 20
|
||||
FRONTSPRITE_SCALE = 0.6666666666
|
||||
BACKRPSPRITE_SCALE = 1
|
||||
|
||||
@@ -414,6 +414,10 @@ class IconSprite < SpriteWrapper
|
||||
end
|
||||
end
|
||||
|
||||
def getBitmap
|
||||
return @_iconbitmap
|
||||
end
|
||||
|
||||
def clearBitmaps
|
||||
@_iconbitmap.dispose if @_iconbitmap
|
||||
@_iconbitmap = nil
|
||||
|
||||
@@ -1195,6 +1195,7 @@ end
|
||||
def pbDrawTextPositions(bitmap,textpos)
|
||||
for i in textpos
|
||||
textsize = bitmap.text_size(i[0])
|
||||
|
||||
x = i[1]
|
||||
y = i[2] + 6
|
||||
if i[3]==true || i[3]==1 # right align
|
||||
|
||||
@@ -25,6 +25,10 @@ class PokemonSprite < SpriteWrapper
|
||||
changeOrigin
|
||||
end
|
||||
|
||||
def filename
|
||||
return @bitmap
|
||||
end
|
||||
|
||||
def changeOrigin
|
||||
return if !self.bitmap
|
||||
@offset = PictureOrigin::Center if !@offset
|
||||
@@ -76,6 +80,10 @@ class PokemonSprite < SpriteWrapper
|
||||
changeOrigin
|
||||
end
|
||||
|
||||
def getBitmap
|
||||
return @_iconbitmap
|
||||
end
|
||||
|
||||
def update
|
||||
super
|
||||
if @_iconbitmap
|
||||
|
||||
@@ -688,9 +688,12 @@ class PokemonFusionScene
|
||||
newspeciesname = newSpecies.real_name
|
||||
oldspeciesname = GameData::Species.get(@pokemon1.species).real_name
|
||||
|
||||
overlay = BitmapSprite.new(Graphics.width, Graphics.height, @viewport).bitmap
|
||||
drawSpriteCredits(@sprites["rsprite2"].getBitmap.filename, overlay)
|
||||
Kernel.pbMessageDisplay(@sprites["msgwindow"],
|
||||
_INTL("\\se[]Congratulations! Your Pokémon were fused into {2}!\\wt[80]", @pokemon1.name, newspeciesname))
|
||||
|
||||
|
||||
#exp
|
||||
@pokemon1.exp_when_fused_head = @pokemon2.exp
|
||||
@pokemon1.exp_when_fused_body = @pokemon1.exp
|
||||
@@ -705,7 +708,7 @@ class PokemonFusionScene
|
||||
@pokemon1.debug_shiny = true if @pokemon1.debug_shiny || @pokemon2.debug_shiny
|
||||
|
||||
setFusionIVs(superSplicer)
|
||||
#add to pokedex
|
||||
#add to pokedex
|
||||
if !$Trainer.pokedex.owned?(newSpecies)
|
||||
$Trainer.pokedex.set_seen(newSpecies)
|
||||
$Trainer.pokedex.set_owned(newSpecies)
|
||||
@@ -713,6 +716,7 @@ class PokemonFusionScene
|
||||
_INTL("{1}'s data was added to the Pokédex", newspeciesname))
|
||||
@scene.pbShowPokedex(@newspecies)
|
||||
end
|
||||
overlay.dispose
|
||||
#first check if hidden ability
|
||||
# getAbilityList format: [[:ABILITY, index],...]
|
||||
hiddenAbility1 = @pokemon1.ability == @pokemon1.getAbilityList[-1][0]
|
||||
@@ -763,6 +767,25 @@ class PokemonFusionScene
|
||||
end
|
||||
end
|
||||
|
||||
def drawSpriteCredits(filename,overlay)
|
||||
x= Graphics.width/2
|
||||
y=240
|
||||
spritename = File.basename(filename,'.*')
|
||||
discord_name = getSpriteCredits(spritename)
|
||||
return if !discord_name
|
||||
|
||||
author_name = File.basename(discord_name,'#*')
|
||||
return if author_name == nil
|
||||
|
||||
label_base_color = Color.new(98, 231, 110)
|
||||
label_shadow_color = Color.new(27, 169, 40)
|
||||
|
||||
#label_shadow_color = Color.new(33, 209, 50)
|
||||
text = _INTL("Sprite by {1}",author_name)
|
||||
textpos = [[text, x, y, 2, label_base_color, label_shadow_color]]
|
||||
pbDrawTextPositions(overlay, textpos)
|
||||
end
|
||||
|
||||
def clearUIForMoves
|
||||
addBackgroundOrColoredPlane(@sprites, "background", "DNAbg",
|
||||
Color.new(248, 248, 248), @viewport)
|
||||
|
||||
@@ -412,6 +412,15 @@ def customSpriteExistsBase(body,head)
|
||||
return download_custom_sprite(head, body) != nil
|
||||
end
|
||||
|
||||
def getSpriteCredits(spriteName)
|
||||
File.foreach(Settings::CREDITS_FILE_PATH) do |line|
|
||||
row = line.split(';')
|
||||
if row[0].include?(spriteName)
|
||||
return row[1]
|
||||
end
|
||||
end
|
||||
return nil
|
||||
end
|
||||
|
||||
def getArceusPlateType(heldItem)
|
||||
return :NORMAL if heldItem == nil
|
||||
|
||||
@@ -46,6 +46,8 @@ class PokemonPokedexInfo_Scene
|
||||
@sprites["bgSelected_next"].setBitmap(_INTL("Graphics/Pictures/Pokedex/bg_forms_selected_small"))
|
||||
@sprites["bgSelected_next"].visible = false
|
||||
|
||||
@creditsOverlay = BitmapSprite.new(Graphics.width, Graphics.height, @viewport).bitmap
|
||||
|
||||
end
|
||||
|
||||
def initializeSpritesPage(altsList)
|
||||
@@ -129,10 +131,27 @@ class PokemonPokedexInfo_Scene
|
||||
@sprites["previousSprite"].setBitmap(@available[previousIndex]) if previousIndex != nextIndex
|
||||
@sprites["selectedSprite"].setBitmap(@available[@selected_index])
|
||||
@sprites["nextSprite"].setBitmap(@available[nextIndex])
|
||||
|
||||
showSpriteCredits(@sprites["selectedSprite"].getBitmap.filename)
|
||||
update_selected
|
||||
end
|
||||
|
||||
def showSpriteCredits(filename)
|
||||
@creditsOverlay.dispose
|
||||
|
||||
x= Graphics.width/2 -60
|
||||
y=Graphics.height - 60
|
||||
spritename = File.basename(filename,'.*')
|
||||
discord_name = getSpriteCredits(spritename)
|
||||
return if !discord_name
|
||||
|
||||
author_name = File.basename(discord_name,'#*')
|
||||
|
||||
label_base_color = Color.new(248, 248, 248)
|
||||
label_shadow_color = Color.new(104, 104, 104)
|
||||
@creditsOverlay = BitmapSprite.new(Graphics.width, Graphics.height, @viewport).bitmap
|
||||
textpos = [[author_name, x, y, 0, label_base_color, label_shadow_color]]
|
||||
pbDrawTextPositions(@creditsOverlay, textpos)
|
||||
end
|
||||
|
||||
|
||||
def pbChooseForm
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user