module TristantineDisplay
PANEL_WIDTH = 176
PANEL_HEIGHT = 240
BACKGROUND = Color.new(200,191,231)
BORDER = Color.new(0,0,0)
CENTER_BORDER = Color.new(195,195,195)
CENTER_BG = Color.new(248,248,248)
TEXT_BASE_COLOR = Color.new(248,248,248)
TEXT_SHADOW_COLOR = Color.new(128,120,112)
FONT_NAME = MessageConfig::SMALL_FONT_NAME
FONT_SIZE = MessageConfig::SMALL_FONT_SIZE
FONT_Y_OFFSET = MessageConfig::FONT_Y_OFFSET
ROW_LENGTH = 6 #Number of Pokemon displayed per row
PANEL_GAP_X = 2
PANEL_GAP_Y = 2
TYPE_COLORS = [
#Light,Main,Dark
[Color.new(216,216,192),Color.new(168,168,120),Color.new(112,88,72)], #Normal
[Color.new(240,128,48),Color.new(192,48,40),Color.new(72,64,56)], #Fighting
[Color.new(200,192,248),Color.new(168,144,240),Color.new(112,88,152)], #Flying
[Color.new(216,128,184),Color.new(160,64,160),Color.new(72,56,80)], #Poison
[Color.new(248,248,120),Color.new(224,192,104),Color.new(136,104,48)], #Ground
[Color.new(224,192,104),Color.new(184,160,56),Color.new(136,104,48)], #Rock
[Color.new(216,224,48),Color.new(168,184,32),Color.new(120,144,16)], #Bug
[Color.new(168,144,240),Color.new(112,88,152),Color.new(72,56,80)], #Ghost
[Color.new(216,216,192),Color.new(184,184,208),Color.new(128,120,112)],#Steel
[Color.new(112,200,176),Color.new(104,160,144),Color.new(32,104,96)], #???
[Color.new(248,208,48),Color.new(240,128,48),Color.new(192,48,40)], #Fire
[Color.new(152,216,216),Color.new(104,144,240),Color.new(128,120,112)],#Water
[Color.new(192,248,96),Color.new(120,200,80),Color.new(88,128,64)], #Grass
[Color.new(248,248,120),Color.new(248,208,48),Color.new(184,160,56)], #Electric
[Color.new(248,192,176),Color.new(248,88,136),Color.new(144,96,96)], #Psychic
[Color.new(208,248,232),Color.new(152,216,216),Color.new(144,144,160)],#Ice
[Color.new(184,160,248),Color.new(112,56,248),Color.new(72,56,144)], #Dragon
[Color.new(168,168,120),Color.new(112,88,72),Color.new(72,64,56)], #Dark
[Color.new(248,216,224),Color.new(240,168,176),Color.new(168,120,136)],#Fairy
]
def self.pbFakedexPanel(species,regiondex)
species = GameData::Species.get(species)
monotype = (species.types.length == 1)
type = species.types[0]
type2 = species.types[1] if !monotype
type_number = GameData::Type.get(type).icon_position
colors = TYPE_COLORS[type_number]
color_light = colors[0]
color_main = colors[1]
color_dark = colors[2]
base = Bitmap.new(PANEL_WIDTH,PANEL_HEIGHT)
base.fill_rect(0, 0, base.width, base.height, BACKGROUND)
base.fill_rect(2, 0, base.width - 4 , base.height, BORDER)
base.fill_rect(0, 2, base.width , base.height - 4, BORDER)
base.fill_rect(2, 2, base.width - 4, base.height - 4, color_light)
base.fill_rect(4, 4, base.width - 6, base.height - 6, color_dark)
base.fill_rect(4, 4, base.width - 8, base.height - 8, color_main)
base.fill_rect(4, 22, 168, 168, BORDER)
base.fill_rect(6, 24, 164, 164, CENTER_BORDER)
base.fill_rect(8, 26, 160, 160, CENTER_BG)
shadow = Bitmap.new(GameData::Species.shadow_filename(species))
shadow_x = (base.width/2) - (shadow.width/2)
shadow_y = 182 - shadow.height
shadow_rect = Rect.new(0,0,shadow.width,shadow.height)
base.blt(shadow_x, shadow_y, shadow, shadow_rect)
sprite = Bitmap.new(GameData::Species.front_sprite_filename(species.id))
metrics = GameData::SpeciesMetrics.get_species_form(species.id,0)
sprite_x = (base.width/2) - (sprite.width/2)
sprite_x += (metrics.front_sprite[0] * 2)
sprite_y = 14
sprite_y += metrics.front_sprite[1] * 2
sprite_rect = Rect.new(0,0,sprite.width,sprite.height)
base.blt(sprite_x, sprite_y, sprite, sprite_rect)
base.font.name = FONT_NAME
base.font.size = FONT_SIZE
base.text_offset_y = FONT_Y_OFFSET
nationalDexList = [:NONE]
dexnum = regiondex.index(species.species) + 1
dexnum = sprintf("%03d", dexnum)
textpos = [
[dexnum, 8, 6, 0, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR],
["#{species.real_name.upcase}", 172, 6, 1, TEXT_BASE_COLOR, TEXT_SHADOW_COLOR],
]
pbDrawTextPositions(base,textpos)
typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types"))
type_number = GameData::Type.get(type).icon_position
type_rect = Rect.new(0, type_number * 28, 64, 28)
type_x = (monotype) ? 56 : 18
if type2
type2_number = GameData::Type.get(type2).icon_position
type2_rect = Rect.new(0, type2_number * 28, 64, 28)
type2_x = 94
end
base.fill_rect(type_x, 198, 64, 32, CENTER_BG)
base.fill_rect(type_x - 2, 200, 68, 28, CENTER_BG)
base.blt(type_x, 200, typebitmap.bitmap, type_rect)
if type2
base.fill_rect(type2_x, 198, 64, 32, CENTER_BG)
base.fill_rect(type2_x - 2, 200, 68, 28, CENTER_BG)
base.blt(type2_x, 200, typebitmap.bitmap, type2_rect)
end
return base
end
def self.pbFullFakedex(region=-1)
regionalSpecies = pbAllRegionalSpecies(region)
if !regionalSpecies || regionalSpecies.length == 0
# If no Regional Dex specified, use the National Pokédex
regionalSpecies = []
GameData::Species.each_species { |s| regionalSpecies.push(s.id) }
end
columns = (regionalSpecies.length/ROW_LENGTH)
columns += 1 if !((regionalSpecies.length%ROW_LENGTH) == 0)
fullwidth = (PANEL_WIDTH + PANEL_GAP_X) * ROW_LENGTH
fullheight = (PANEL_HEIGHT + PANEL_GAP_Y) * columns
fullbase = Bitmap.new(fullwidth,fullheight)
fullbase.fill_rect(0, 0, fullbase.width, fullbase.height, BACKGROUND)
for i in 0...regionalSpecies.length
s = regionalSpecies[i]
newbitmap = self.pbFakedexPanel(s,regionalSpecies)
newrect = Rect.new(0,0,newbitmap.width,newbitmap.height)
newx = (i%ROW_LENGTH)*(PANEL_WIDTH + PANEL_GAP_X)
newy = (i/ROW_LENGTH)*(PANEL_HEIGHT + PANEL_GAP_Y)
fullbase.blt(newx, newy, newbitmap, newrect)
end
fullbase.to_file("Graphics/Pictures/DexDisplay.png")
end
end