Merge branch 'mkxp-z' into dev

This commit is contained in:
Maruno17
2020-11-20 20:43:27 +00:00
51 changed files with 490 additions and 288 deletions

View File

@@ -387,11 +387,11 @@ def pbSetSystemFont(bitmap)
fontname = MessageConfig.pbGetSystemFontName
bitmap.font.name = fontname
if fontname == "Pokemon FireLeaf" || fontname == "Power Red and Green"
bitmap.font.size = 29
bitmap.font.size = mkxp? ? 27 : 29
elsif fontname == "Pokemon Emerald Small" || fontname == "Power Green Small"
bitmap.font.size = 25
bitmap.font.size = mkxp? ? 29 : 25
else
bitmap.font.size = 31
bitmap.font.size = mkxp? ? 29 : 31
end
end
@@ -404,7 +404,7 @@ end
# Sets a bitmap's font to the system narrow font.
def pbSetNarrowFont(bitmap)
bitmap.font.name = pbNarrowFontName
bitmap.font.size = 31
bitmap.font.size = mkxp? ? 29 : 31
end
#===============================================================================

View File

@@ -71,7 +71,7 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base
def resizeHeightToFit(text,width=-1) # width is current window width
dims=resizeToFitInternal(text,width)
self.width=width<0 ? Graphics.width : width
self.height=dims[1]+self.borderY
self.height = dims[1] + self.borderY - (mkxp? ? 4 : 0)
refresh
end
@@ -1227,7 +1227,7 @@ class Window_CommandPokemon < Window_DrawableCommand
def drawItem(index,_count,rect)
pbSetSystemFont(self.contents) if @starting
rect=drawCursor(index,rect)
pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,
pbDrawShadowText(self.contents,rect.x,rect.y + (mkxp? ? 6 : 0),rect.width,rect.height,
@commands[index],self.baseColor,self.shadowColor)
end
end
@@ -1331,7 +1331,7 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
dims=[]
getAutoDims(commands,dims,width)
self.width=dims[0]
self.height=dims[1]
self.height=dims[1] - (mkxp? ? 6 : 0)
end
def itemCount
@@ -1343,7 +1343,7 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
rect=drawCursor(index,rect)
if toUnformattedText(@commands[index]).gsub(/\n/,"")==@commands[index]
# Use faster alternative for unformatted text without line breaks
pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,
pbDrawShadowText(self.contents,rect.x,rect.y + (mkxp? ? 6 : 0),rect.width,rect.height,
@commands[index],self.baseColor,self.shadowColor)
else
chars=getFormattedText(

View File

@@ -168,6 +168,7 @@ end
def getFormattedTextFast(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight,
newlineBreaks=true,explicitBreaksOnly=false)
yDst += 4 if mkxp?
x=y=0
characters=[]
textchunks=[]
@@ -421,6 +422,7 @@ _drawFormattedChars_ function.
def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32,
newlineBreaks=true,explicitBreaksOnly=false,
collapseAlignments=false)
yDst += 4 if mkxp?
dummybitmap=nil
if !bitmap || bitmap.disposed? # allows function to be called with nil bitmap
dummybitmap=Bitmap.new(1,1)
@@ -888,8 +890,7 @@ end
#===============================================================================
def getLineBrokenChunks(bitmap,value,width,dims,plain=false)
x=0
y=0
textheight=0
y=mkxp? ? 4: 0
ret=[]
if dims
dims[0]=0
@@ -905,9 +906,7 @@ def getLineBrokenChunks(bitmap,value,width,dims,plain=false)
ccheck=c
if ccheck=="\n"
x=0
# y+=(textheight==0) ? bitmap.text_size("X").height : textheight
y+=(textheight==0) ? bitmap.text_size("X").height+1 : textheight
textheight=0
y+=32
next
end
if ccheck[/</] && !plain
@@ -927,14 +926,10 @@ def getLineBrokenChunks(bitmap,value,width,dims,plain=false)
minTextSize=bitmap.text_size(word.gsub(/\s*/,""))
if x>0 && x+minTextSize.width>width
x=0
y+=32 # (textheight==0) ? bitmap.text_size("X").height : textheight
# y+=(textheight==0) ? bitmap.text_size("X").height+1 : textheight
textheight=0
y+=32
end
end
textheight=32 # [textheight,textSize.height].max
# textheight=[textheight,textSize.height+1].max
ret.push([word,x,y,textwidth,textheight,color])
ret.push([word,x,y,textwidth,32,color])
x+=textwidth
dims[0]=x if dims && dims[0]<x
end
@@ -943,7 +938,7 @@ def getLineBrokenChunks(bitmap,value,width,dims,plain=false)
end
end
end
dims[1]=y+textheight if dims
dims[1]=y+32 if dims
return ret
end
@@ -1112,8 +1107,9 @@ end
def pbDrawShadowText(bitmap,x,y,width,height,string,baseColor,shadowColor=nil,align=0)
return if !bitmap || !string
width=(width<0) ? bitmap.text_size(string).width+4 : width
height=(height<0) ? bitmap.text_size(string).height+4 : height
width=(width<0) ? bitmap.text_size(string).width+1 : width
height=(height<0) ? bitmap.text_size(string).height+1 : height
y += -2 if mkxp?
if shadowColor && shadowColor.alpha>0
bitmap.font.color=shadowColor
bitmap.draw_text(x+2,y,width,height,string,align)
@@ -1161,7 +1157,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? ? 6 : 0)
if i[3]==true || i[3]==1 # right align
x -= textsize.width
elsif i[3]==2 # centered

View File

@@ -382,126 +382,6 @@ end
class Game_Interpreter # Used by RMVX
include InterpreterMixin
eval(InterpreterMixin::CustomEventCommands)
@@immediateDisplayAfterWait=false
@buttonInput=false
def pbParams
return @params
end
def command_105
return false if @buttonInput
@buttonInput=true
pbButtonInputProcessing(@list[@index].parameters[0])
@buttonInput=false
@index+=1
return true
end
def command_101
if $game_temp.message_window_showing
return false
end
$game_message=Game_Message.new if !$game_message
message=""
commands=nil
numInputVar=nil
numInputDigitsMax=nil
text=""
facename=@list[@index].parameters[0]
faceindex=@list[@index].parameters[1]
if facename && facename!=""
text+="\\ff[#{facename},#{faceindex}]"
end
if $game_message
$game_message.background=@list[@index].parameters[2]
end
$game_system.message_position=@list[@index].parameters[3]
message+=text
messageend=""
loop do
nextIndex=pbNextIndex(@index)
code=@list[nextIndex].code
if code == 401
text=@list[nextIndex].parameters[0]
text+=" " if text!="" && text[text.length-1,1]!=" "
message+=text
@index=nextIndex
else
if code == 102
commands=@list[nextIndex].parameters
@index=nextIndex
elsif code == 106 && @@immediateDisplayAfterWait
params=@list[nextIndex].parameters
if params[0]<=10
nextcode=@list[nextIndex+1].code
if nextcode==101||nextcode==102||nextcode==103
@index=nextIndex
else
break
end
else
break
end
elsif code == 103
numInputVar=@list[nextIndex].parameters[0]
numInputDigitsMax=@list[nextIndex].parameters[1]
@index=nextIndex
elsif code == 101
messageend="\1"
end
break
end
end
message=_MAPINTL($game_map.map_id,message)
@message_waiting=true
if commands
cmdlist=[]
for cmd in commands[0]
cmdlist.push(_MAPINTL($game_map.map_id,cmd))
end
command=pbMessage(message+messageend,cmdlist,commands[1])
@branch[@list[@index].indent] = command
elsif numInputVar
params=ChooseNumberParams.new
params.setMaxDigits(numInputDigitsMax)
params.setDefaultValue($game_variables[numInputVar])
$game_variables[numInputVar]=pbMessageChooseNumber(message+messageend,params)
$game_map.need_refresh = true if $game_map
else
pbMessage(message+messageend)
end
@message_waiting=false
return true
end
def command_102
@message_waiting=true
command=pbShowCommands(nil,@list[@index].parameters[0],@list[@index].parameters[1])
@message_waiting=false
@branch[@list[@index].indent] = command
Input.update # Must call Input.update again to avoid extra triggers
return true
end
def command_103
varnumber=@list[@index].parameters[0]
@message_waiting=true
params=ChooseNumberParams.new
params.setMaxDigits(@list[@index].parameters[1])
params.setDefaultValue($game_variables[varnumber])
$game_variables[varnumber]=pbChooseNumber(nil,params)
$game_map.need_refresh = true if $game_map
@message_waiting=false
return true
end
end
class Interpreter # Used by RMXP
include InterpreterMixin
eval(InterpreterMixin::CustomEventCommands)

View File

@@ -49,16 +49,16 @@ class Window_CharacterEntry < Window_DrawableCommand
def drawItem(index,_count,rect)
rect=drawCursor(index,rect)
if index==@charset.length # -1
pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,"[ ]",
pbDrawShadowText(self.contents,rect.x,rect.y + (mkxp? ? 6 : 0),rect.width,rect.height,"[ ]",
self.baseColor,self.shadowColor)
elsif index==@charset.length+1 # -2
pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,@othercharset,
pbDrawShadowText(self.contents,rect.x,rect.y + (mkxp? ? 6 : 0),rect.width,rect.height,@othercharset,
self.baseColor,self.shadowColor)
elsif index==@charset.length+2 # -3
pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,_INTL("OK"),
pbDrawShadowText(self.contents,rect.x,rect.y + (mkxp? ? 6 : 0),rect.width,rect.height,_INTL("OK"),
self.baseColor,self.shadowColor)
else
pbDrawShadowText(self.contents,rect.x,rect.y,rect.width,rect.height,@charset[index],
pbDrawShadowText(self.contents,rect.x,rect.y + (mkxp? ? 6 : 0),rect.width,rect.height,@charset[index],
self.baseColor,self.shadowColor)
end
end
@@ -1533,28 +1533,6 @@ end
class Game_Interpreter
def command_303
if $Trainer
$Trainer.name=pbEnterPlayerName(_INTL("Your name?"),1,@params[1],$Trainer.name)
return true
end
if $game_actors && $data_actors && $data_actors[@params[0]] != nil
# Set battle abort flag
pbFadeOutIn {
sscene=PokemonEntryScene.new
sscreen=PokemonEntry.new(sscene)
$game_actors[@params[0]].name=sscreen.pbStartScreen(
_INTL("Enter {1}'s name.",$game_actors[@params[0]].name),
1,@params[1],$game_actors[@params[0]].name)
}
end
return true
end
end
#===============================================================================
#
#===============================================================================