Added mkxp-z and fixed pkmnem, pkmnems and pkmnemn fonts

This commit is contained in:
m3rein
2020-09-06 23:12:36 +02:00
parent 66671efcde
commit a4f5eb16ea
14 changed files with 22991 additions and 6 deletions

View File

@@ -1,3 +1,19 @@
#===============================================================================
# mkxp setup
#===============================================================================
$MKXP = !!defined?(System)
def mkxp?
return $MKXP
end
CHARACTER_OFFSETS = {
"p" => [0, 2],
"g" => [0, 2],
"y" => [0, 2],
"q" => [0, 2]
}
#===============================================================================
# class Class
#===============================================================================

View File

@@ -391,18 +391,21 @@ def pbSetSystemFont(bitmap)
elsif fontname=="Pokemon Emerald Small" || fontname=="Power Green Small"
bitmap.font.size=25
else
bitmap.font.size=31
bitmap.font.name=pbNarrowFontName
bitmap.font.size = mkxp? ? 29 : 31
#bitmap.font.size = mkxp? ? 29 : 31
end
end
# Sets a bitmap's font to the system small font.
def pbSetSmallFont(bitmap)
bitmap.font.name=pbSmallFontName
bitmap.font.size=25
bitmap.font.name = pbSmallFontName
bitmap.font.size = 25
end
# Sets a bitmap's font to the system narrow font.
def pbSetNarrowFont(bitmap)
p "narrow"
bitmap.font.name=pbNarrowFontName
bitmap.font.size=31
end

View File

@@ -1310,6 +1310,11 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
for ch in fmt
chx = ch[1]+ch[3]
chy = ch[2]+ch[4]
offset = CHARACTER_OFFSETS[ch[0]]
if offset
ch[1] += offset[0] if offset[0]
ch[2] += offset[1] if offset[1]
end
width = chx if width<chx
height = chy if height<chy
if !ch[5] && ch[0]=="\n"
@@ -1337,6 +1342,11 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
for ch in @fmtchars
chx = ch[1]+ch[3]
chy = ch[2]+ch[4]
offset = CHARACTER_OFFSETS[ch[0]]
if offset
ch[1] += offset[0] if offset[0]
ch[2] += offset[1] if offset[1]
end
width = chx if width<chx
height = chy if height<chy
@textchars.push(ch[5] ? "" : ch[0])

View File

@@ -951,7 +951,7 @@ def renderLineBrokenChunks(bitmap,xDst,yDst,normtext,maxheight=0)
for i in 0...normtext.length
width=normtext[i][3]
textx=normtext[i][1]+xDst
texty=normtext[i][2]+yDst
texty=normtext[i][2]+yDst + (mkxp? ? 4 : 0)
if maxheight==0 || normtext[i][2]<maxheight
bitmap.font.color=normtext[i][5]
bitmap.draw_text(textx,texty,width+2,normtext[i][4],normtext[i][0])
@@ -963,7 +963,7 @@ def renderLineBrokenChunksWithShadow(bitmap,xDst,yDst,normtext,maxheight,baseCol
for i in 0...normtext.length
width=normtext[i][3]
textx=normtext[i][1]+xDst
texty=normtext[i][2]+yDst
texty=normtext[i][2]+yDst + (mkxp? ? 4 : 0)
if maxheight==0 || normtext[i][2]<maxheight
height=normtext[i][4]
text=normtext[i][0]
@@ -1161,7 +1161,7 @@ def pbDrawTextPositions(bitmap,textpos)
for i in textpos
textsize = bitmap.text_size(i[0])
x = i[1]
y = i[2]
y = i[2] + (mkxp? ? 4 : 0)
if i[3]==true || i[3]==1 # right align
x -= textsize.width
elsif i[3]==2 # centered