Update 6.8

This commit is contained in:
chardub
2026-07-10 15:42:06 -04:00
parent 5b85e72cb2
commit 6a6f126a18
7871 changed files with 493193 additions and 224825 deletions
@@ -14,6 +14,10 @@ module MessageConfig
NARROW_FONT_NAME = "Power Green Narrow"
NARROW_FONT_SIZE = 29
FONT_NAME_CHINESE = "Fusion Poke Pixel Normal zh_hans"
SMALL_FONT_NAME_CHINESE = "Fusion Poke Pixel Small zh_hans"
NARROW_FONT_NAME_CHINESE = "Fusion Poke Pixel Narrow zh_hans"
BUBBLE_TEXT_BASE = Color.new(248,248,248)#(72,80,88)#DIALOG
BUBBLE_TEXT_SHADOW= Color.new(166,160,151)
@@ -110,14 +114,30 @@ module MessageConfig
#-----------------------------------------------------------------------------
def self.pbDefaultSystemFontName
current_language = getCurrentLanguage
if current_language == :CHINESE
return MessageConfig.pbTryFonts(FONT_NAME_CHINESE)
end
return MessageConfig.pbTryFonts(FONT_NAME)
end
def self.pbResetSystemFontName
@@systemFont = nil
end
def self.pbDefaultSmallFontName
current_language = getCurrentLanguage
if current_language == :CHINESE
return MessageConfig.pbTryFonts(SMALL_FONT_NAME_CHINESE)
end
return MessageConfig.pbTryFonts(SMALL_FONT_NAME)
end
def self.pbDefaultNarrowFontName
current_language = getCurrentLanguage
if current_language == :CHINESE
return MessageConfig.pbTryFonts(NARROW_FONT_NAME_CHINESE)
end
return MessageConfig.pbTryFonts(NARROW_FONT_NAME)
end
@@ -424,18 +444,33 @@ end
#===============================================================================
# Sets a bitmap's font to the system font.
def pbSetSystemFont(bitmap)
bitmap.font.name = MessageConfig.pbGetSystemFontName
bitmap.font.size = MessageConfig::FONT_SIZE
if getCurrentLanguage == :CHINESE
bitmap.font.name = MessageConfig::FONT_NAME_CHINESE
bitmap.font.size = MessageConfig::FONT_SIZE
else
bitmap.font.name = MessageConfig.pbGetSystemFontName
bitmap.font.size = MessageConfig::FONT_SIZE
end
end
# Sets a bitmap's font to the system small font.
def pbSetSmallFont(bitmap)
if getCurrentLanguage == :CHINESE
bitmap.font.name = MessageConfig::SMALL_FONT_NAME_CHINESE
bitmap.font.size = MessageConfig::SMALL_FONT_SIZE
return
end
bitmap.font.name = MessageConfig.pbGetSmallFontName
bitmap.font.size = MessageConfig::SMALL_FONT_SIZE
end
# Sets a bitmap's font to the system narrow font.
def pbSetNarrowFont(bitmap)
if getCurrentLanguage == :CHINESE
bitmap.font.name = MessageConfig::NARROW_FONT_NAME_CHINESE
bitmap.font.size = MessageConfig::NARROW_FONT_SIZE
return
end
bitmap.font.name = MessageConfig.pbGetNarrowFontName
bitmap.font.size = MessageConfig::NARROW_FONT_SIZE
end
@@ -732,7 +767,13 @@ end
# _viewport_ is a viewport to place the background in.
def addBackgroundPlane(sprites,planename,background,viewport=nil)
sprites[planename]=AnimatedPlane.new(viewport)
bitmapName=pbResolveBitmap("Graphics/Pictures/#{background}")
background_dark = "Graphics/Pictures/#{background}_dark"
background_normal = "Graphics/Pictures/#{background}"
bitmapName = (isDarkMode && pbResolveBitmap(background_dark)) ||
pbResolveBitmap(background_normal)
if bitmapName==nil
# Plane should exist in any case
sprites[planename].bitmap=nil
File diff suppressed because it is too large Load Diff
@@ -407,6 +407,11 @@ class IconSprite < SpriteWrapper
# Sets the icon's filename.
def setBitmap(file, hue = 0)
file = pbLocalizedBitmapFilename(file)
if isDarkMode
darkmode_file = file + "_dark"
file = darkmode_file if pbResolveBitmap(darkmode_file)
end
oldrc = self.src_rect
clearBitmaps()
@name = file
@@ -468,8 +473,11 @@ class ChangelingSprite < SpriteWrapper
end
def addBitmap(key, path)
path = pbLocalizedBitmapFilename(path)
path_dark = path + "_dark"
finalPath = (isDarkMode && pbResolveBitmap(path_dark)) ? path_dark : path
@bitmaps[key].dispose if @bitmaps[key]
@bitmaps[key] = AnimatedBitmap.new(path)
@bitmaps[key] = AnimatedBitmap.new(finalPath)
end
def changeBitmap(key)
@@ -8,6 +8,7 @@ class AnimatedBitmap
def initialize(file, hue = 0)
raise "Filename is nil (missing graphic)." if file.nil?
file = pbLocalizedBitmapFilename(file)
path = file
filename = ""
if file.last != '/' # Isn't just a directory
@@ -225,6 +225,11 @@ class AnimatedPlane < LargePlane
def setBitmap(file, hue=0)
clearBitmaps()
return if file==nil
file = pbLocalizedBitmapFilename(file)
if isDarkMode
darkmode_file = file + "_dark"
file = darkmode_file if pbResolveBitmap(darkmode_file)
end
@bitmap=AnimatedBitmap.new(file,hue)
end
end
@@ -244,6 +244,20 @@ def getFormattedTextFast(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight,
x+=charwidth
end
lastword[1]=0
elsif !explicitBreaksOnly && x+2>widthDst && lastword[1]==0 &&
characters.length > 0 && characters[-1][0] != "\n"
havenl=true
break_index = characters.length - 1
characters.insert(break_index,["\n",0,y*lineheight+yDst,0,lineheight,
false,false,false,colorclone,nil,false,false,"",8,position])
y+=1
x=0
for i in break_index+1...characters.length
characters[i][2]+=lineheight
charwidth=characters[i][3]-2
characters[i][1]=x
x+=charwidth
end
end
position+=1
end
@@ -741,6 +755,24 @@ def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32,
x+=charwidth
end
lastword[1]=0
elsif !explicitBreaksOnly && x+2>widthDst && lastword[1]==0 &&
characters.length > 0 && characters[-1][0] != "\n"
havenl=true
break_index = characters.length - 1
characters.insert(break_index,["\n",0,y*lineheight+yDst,0,lineheight,false,
false,false,defaultcolors[0],defaultcolors[1],false,false,"",8,position,
nil])
charactersInternal.insert(break_index,[alignment,y,0])
y+=1
x=0
for i in break_index+1...characters.length
characters[i][2]+=lineheight
charactersInternal[i][1]+=1
extraspace=(charactersInternal[i][4]) ? charactersInternal[i][4] : 0
charwidth=characters[i][3]-extraspace
characters[i][1]=x+charactersInternal[i][2]
x+=charwidth
end
end
position+=1 if !graphic
end
@@ -985,6 +1017,19 @@ def getLineBrokenChunks(bitmap,value,width,dims,plain=false)
y+=32
end
end
if textwidth>width && word.scan(/\s/).empty?
word.scan(/./m).each do |char|
charwidth=bitmap.text_size(char).width
if x>0 && x+charwidth>width
x=0
y+=32
end
ret.push([char,x,y,charwidth,32,color])
x+=charwidth
dims[0]=x if dims && dims[0]<x
end
next
end
ret.push([word,x,y,textwidth,32,color])
x+=textwidth
dims[0]=x if dims && dims[0]<x
@@ -1131,8 +1176,17 @@ def drawTextEx(bitmap,x,y,width,numlines,text,baseColor,shadowColor)
end
def drawFormattedTextEx(bitmap,x,y,width,text,baseColor=nil,shadowColor=nil,lineheight=32)
default_base = baseColor.nil?
default_shadow = shadowColor.nil?
base=!baseColor ? Color.new(12*8,12*8,12*8) : baseColor.clone
shadow=!shadowColor ? Color.new(26*8,26*8,25*8) : shadowColor.clone
if default_base && default_shadow
if isDarkMode
base, shadow = shadow, base
end
end
text="<c2="+colorToRgb16(base)+colorToRgb16(shadow)+">"+text
chars=getFormattedText(bitmap,x,y,width,-1,text,lineheight)
drawFormattedChars(bitmap,chars)
@@ -1274,4 +1328,4 @@ end
def drawTextExMulti(bitmap,x,y,width,numlines,text,baseColor,shadowColor)
normtext=getLineBrokenChunks(bitmap,text,width,nil,true)
renderMultiLine(bitmap,x,y,normtext,numlines*32,baseColor,shadowColor)
end
end
@@ -265,6 +265,7 @@ def pbChooseNumber(msgwindow, params)
pbUpdateSceneMap
cmdwindow.update
msgwindow.update if msgwindow
$game_temp.choose_number_window = cmdwindow
yield if block_given?
if Input.trigger?(Input::USE)
ret = cmdwindow.number
@@ -282,6 +283,7 @@ def pbChooseNumber(msgwindow, params)
break
end
end
$game_temp.choose_number_window = nil
cmdwindow.dispose
Input.update
return ret
@@ -339,7 +341,10 @@ def pbGetBasicMapNameFromId(id)
end
def pbGetMapNameFromId(id)
map = pbGetBasicMapNameFromId(id)
map = pbGetMessage(MessageTypes::MapNames, id)
if nil_or_empty?(map)
map = pbGetBasicMapNameFromId(id)
end
map.gsub!(/\\PN/, $Trainer.name) if $Trainer
return map
end
@@ -404,7 +409,8 @@ def pbGetGoldString
return moneyString
end
def pbDisplayGoldWindow(msgwindow)
def pbDisplayGoldWindow(msgwindow,x=nil,y=nil)
moneyString = pbGetGoldString()
goldwindow = Window_AdvancedTextPokemon.new(_INTL("Money:\n<ar>{1}</ar>", moneyString))
goldwindow.setSkin("Graphics/Windowskins/goldskin")
@@ -415,11 +421,42 @@ def pbDisplayGoldWindow(msgwindow)
else
goldwindow.y = 0
end
goldwindow.x = x if x
goldwindow.y = y if y
goldwindow.viewport = msgwindow.viewport
goldwindow.z = msgwindow.z
return goldwindow
end
def pbDisplayCosmeticsMoneyWindow(msgwindow,x=nil,y=nil)
moneyString = pbGetCosmeticsMoneyString()
goldwindow = Window_AdvancedTextPokemon.new(_INTL("{2}:\n<ar>{1}</ar>", moneyString,COSMETIC_CURRENCY_NAME))
goldwindow.setSkin("Graphics/Windowskins/goldskin")
goldwindow.resizeToFit(goldwindow.text, Graphics.width)
goldwindow.width = 160 if goldwindow.width <= 160
if msgwindow.y <= 10
goldwindow.y = Graphics.height - goldwindow.height
else
goldwindow.y = 0
end
goldwindow.x = x if x
goldwindow.y = y if y
goldwindow.viewport = msgwindow.viewport
goldwindow.z = msgwindow.z
return goldwindow
end
def pbGetCosmeticsMoneyString
begin
moneyString = _INTL("{1}", $Trainer.cosmetics_money.to_s_formatted)
rescue
moneyString = ""
end
return moneyString
end
def pbDisplayBattleFactoryPointsWindow(msgwindow)
pbDisplayVariableWindow(msgwindow, "Tokens", VAR_BATTLE_FACTORY_TOKENS)
end
@@ -474,8 +511,6 @@ def pbDisplayHeartScalesWindow(msgwindow)
return pointswindow
end
def pbDisplayCoinsWindow(msgwindow, goldwindow)
coinString = ($Trainer) ? $Trainer.coins.to_s_formatted : "0"
coinwindow = Window_AdvancedTextPokemon.new(_INTL("Coins:\n<ar>{1}</ar>", coinString))
@@ -590,8 +625,9 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
linecount = (Graphics.height > 400) ? 3 : 2
### Text replacement
text.gsub!(/\\sign\[([^\]]*)\]/i) { # \sign[something] gets turned into
next "\\op\\cl\\ts[]\\w[" + $1 + "]" # \op\cl\ts[]\w[something]
next "\\op\\cl\\ts[]\\w[" + $1 + "]" # \op\cl\ts[]\w[something]
}
text.gsub!(" ", " ")
text.gsub!(/\\\\/, "\5")
text.gsub!(/\\1/, "\1")
if $game_actors
@@ -627,6 +663,13 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
end
next ""
}
if $PokemonTemp.windowSkin
path = "Graphics/Windowskins/#{$PokemonTemp.windowSkin}"
if pbResolveBitmap(path)
msgwindow.setSkin(path)
end
$PokemonTemp.windowSkin = nil
end
isDarkSkin = isDarkWindowskin(msgwindow.windowskin)
text.gsub!(/\\[Cc]\[([0-9]+)\]/) {
m = $1.to_i
@@ -758,10 +801,10 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
head = getBasePokemonID(param.to_i, false)
body = getBasePokemonID(param.to_i, true)
facewindow.dispose if facewindow
#path = obtainPokemonSpritePath(body, head, true) if isFusion
# path = obtainPokemonSpritePath(body, head, true) if isFusion
spriteLoader = BattleSpriteLoader.new
facewindow = isFusion ? PictureWindow.new(spriteLoader.load_fusion_sprite(head,body)) : PictureWindow.new(spriteLoader.load_base_sprite(head))
facewindow = isFusion ? PictureWindow.new(spriteLoader.load_fusion_sprite(head, body)) : PictureWindow.new(spriteLoader.load_base_sprite(head))
pbPositionNearMsgWindow(facewindow, msgwindow, :left)
facewindow.viewport = msgwindow.viewport
facewindow.z = msgwindow.z
@@ -775,6 +818,9 @@ def pbMessageDisplay(msgwindow, message, letterbyletter = true, commandProc = ni
when "g" # Display gold window
goldwindow.dispose if goldwindow
goldwindow = pbDisplayGoldWindow(msgwindow)
when "cm" # Display cosmetics money window
goldwindow.dispose if goldwindow
goldwindow = pbDisplayCosmeticsMoneyWindow(msgwindow)
when "ft" # Display battle factory tokens
goldwindow.dispose if goldwindow
goldwindow = pbDisplayBattleFactoryPointsWindow(msgwindow)
@@ -935,14 +981,14 @@ def pbMessageChooseNumber(message, params, &block)
return ret
end
def pbShowCommands(msgwindow, commands = nil, cmdIfCancel = 0, defaultCmd = 0, x_offset=nil, y_offset=nil)
def pbShowCommands(msgwindow, commands = nil, cmdIfCancel = 0, defaultCmd = 0, x_offset = nil, y_offset = nil, font= nil)
return 0 if !commands
$PokemonTemp.speechbubble_arrow.visible =false if $PokemonTemp.speechbubble_arrow && !$PokemonTemp.speechbubble_arrow.disposed?
$PokemonTemp.speechbubble_arrow.visible = false if $PokemonTemp.speechbubble_arrow && !$PokemonTemp.speechbubble_arrow.disposed?
if defaultCmd == 0 && ($game_variables && $game_variables[VAR_COMMAND_WINDOW_INDEX] != 0)
defaultCmd = $game_variables[VAR_COMMAND_WINDOW_INDEX]
end
cmdwindow = Window_CommandPokemonEx.new(commands)
cmdwindow.contents.font.name = font if font
cmdwindow.z = 99999
cmdwindow.visible = true
cmdwindow.resizeToFit(cmdwindow.commands)