The Great Enspacening begins!

This commit is contained in:
Maruno17
2021-12-18 12:20:31 +00:00
parent 2480ab0f9e
commit f7b76ae62e
138 changed files with 567 additions and 567 deletions

View File

@@ -174,7 +174,7 @@ def pbBottomLeft(window)
window.y=Graphics.height-window.height
end
def pbBottomLeftLines(window,lines,width=nil)
def pbBottomLeftLines(window,lines,width = nil)
window.x=0
window.width=width ? width : Graphics.width
window.height=(window.borderY rescue 32)+lines*32
@@ -229,7 +229,7 @@ def pbPositionNearMsgWindow(cmdwindow,msgwindow,side)
end
# internal function
def pbRepositionMessageWindow(msgwindow, linecount=2)
def pbRepositionMessageWindow(msgwindow, linecount = 2)
msgwindow.height=32*linecount+msgwindow.borderY
msgwindow.y=(Graphics.height)-(msgwindow.height)
if $game_system
@@ -246,7 +246,7 @@ def pbRepositionMessageWindow(msgwindow, linecount=2)
end
# internal function
def pbUpdateMsgWindowPos(msgwindow,event,eventChanged=false)
def pbUpdateMsgWindowPos(msgwindow,event,eventChanged = false)
if event
if eventChanged
msgwindow.resizeToFit2(msgwindow.text,Graphics.width*2/3,msgwindow.height)
@@ -272,7 +272,7 @@ end
#===============================================================================
# Determine the colour of a background
#===============================================================================
def isDarkBackground(background,rect=nil)
def isDarkBackground(background,rect = nil)
return true if !background || background.disposed?
rect = background.rect if !rect
return true if rect.width<=0 || rect.height<=0
@@ -545,7 +545,7 @@ end
# pbFadeOutIn(z) { block }
# Fades out the screen before a block is run and fades it back in after the
# block exits. z indicates the z-coordinate of the viewport used for this effect
def pbFadeOutIn(z=99999,nofadeout=false)
def pbFadeOutIn(z = 99999,nofadeout = false)
col=Color.new(0,0,0,0)
viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
viewport.z=z
@@ -576,7 +576,7 @@ def pbFadeOutIn(z=99999,nofadeout=false)
end
end
def pbFadeOutInWithUpdate(z,sprites,nofadeout=false)
def pbFadeOutInWithUpdate(z,sprites,nofadeout = false)
col=Color.new(0,0,0,0)
viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
viewport.z=z
@@ -609,7 +609,7 @@ end
# Similar to pbFadeOutIn, but pauses the music as it fades out.
# Requires scripts "Audio" (for bgm_pause) and "SpriteWindow" (for pbFadeOutIn).
def pbFadeOutInWithMusic(zViewport=99999)
def pbFadeOutInWithMusic(zViewport = 99999)
playingBGS = $game_system.getPlayingBGS
playingBGM = $game_system.getPlayingBGM
$game_system.bgm_pause(1.0)
@@ -642,7 +642,7 @@ def pbFadeOutAndHide(sprites)
return visiblesprites
end
def pbFadeInAndShow(sprites,visiblesprites=nil)
def pbFadeInAndShow(sprites,visiblesprites = nil)
if visiblesprites
for i in visiblesprites
if i[1] && sprites[i[0]] && !pbDisposed?(sprites[i[0]])
@@ -713,7 +713,7 @@ end
# _background_ is a filename within the Graphics/Pictures/ folder and can be
# an animated image.
# _viewport_ is a viewport to place the background in.
def addBackgroundPlane(sprites,planename,background,viewport=nil)
def addBackgroundPlane(sprites,planename,background,viewport = nil)
sprites[planename]=AnimatedPlane.new(viewport)
bitmapName=pbResolveBitmap("Graphics/Pictures/#{background}")
if bitmapName==nil
@@ -736,7 +736,7 @@ end
# an animated image.
# _color_ is the color to use if the background can't be found.
# _viewport_ is a viewport to place the background in.
def addBackgroundOrColoredPlane(sprites,planename,background,color,viewport=nil)
def addBackgroundOrColoredPlane(sprites,planename,background,color,viewport = nil)
bitmapName=pbResolveBitmap("Graphics/Pictures/#{background}")
if bitmapName==nil
# Plane should exist in any case

View File

@@ -75,7 +75,7 @@ class Window
@_windowskin
end
def initialize(viewport=nil)
def initialize(viewport = nil)
@sprites={}
@spritekeys=[
"back",
@@ -345,7 +345,7 @@ class Window
end
end
def privRefresh(changeBitmap=false)
def privRefresh(changeBitmap = false)
return if self.disposed?
backopac=self.back_opacity*self.opacity/255
contopac=self.contents_opacity

View File

@@ -52,7 +52,7 @@ class SpriteWindow < Window
privRefresh(true)
end
def initialize(viewport=nil)
def initialize(viewport = nil)
@sprites={}
@spritekeys=[
"back",
@@ -474,7 +474,7 @@ class SpriteWindow < Window
@sprites["cursor"].opacity=cursoropac
end
def privRefresh(changeBitmap=false)
def privRefresh(changeBitmap = false)
return if !self || self.disposed?
backopac=self.back_opacity*self.opacity/255
contopac=self.contents_opacity

View File

@@ -25,7 +25,7 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base
refresh
end
def initialize(text="")
def initialize(text = "")
super(0,0,33,33)
self.contents=Bitmap.new(1,1)
pbSetSystemFont(self.contents)
@@ -37,7 +37,7 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base
resizeToFit(text)
end
def self.newWithSize(text,x,y,width,height,viewport=nil)
def self.newWithSize(text,x,y,width,height,viewport = nil)
ret=self.new(text)
ret.x=x
ret.y=y
@@ -56,7 +56,7 @@ class Window_UnformattedTextPokemon < SpriteWindow_Base
return dims
end
def setTextToFit(text,maxwidth=-1)
def setTextToFit(text,maxwidth = -1)
resizeToFit(text,maxwidth)
self.text=text
end
@@ -118,7 +118,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
attr_accessor :letterbyletter
attr_reader :waitcount
def initialize(text="")
def initialize(text = "")
@cursorMode = MessageConfig::CURSOR_POSITION
@endOfText = nil
@scrollstate = 0
@@ -148,7 +148,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
@starting = false
end
def self.newWithSize(text,x,y,width,height,viewport=nil)
def self.newWithSize(text,x,y,width,height,viewport = nil)
ret = self.new(text)
ret.x = x
ret.y = y
@@ -210,7 +210,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
self.text = self.text if !@starting
end
def resizeToFit(text,maxwidth=-1)
def resizeToFit(text,maxwidth = -1)
dims = resizeToFitInternal(text,maxwidth)
oldstarting = @starting
@starting = true
@@ -242,7 +242,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
return dims
end
def resizeHeightToFit(text,width=-1)
def resizeHeightToFit(text,width = -1)
dims = resizeToFitInternal(text,width)
oldstarting = @starting
@starting = true
@@ -252,7 +252,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
redrawText
end
def setSkin(skin,redrawText=true)
def setSkin(skin,redrawText = true)
super(skin)
privRefresh(true)
oldbaser = @baseColor.red
@@ -275,7 +275,7 @@ class Window_AdvancedTextPokemon < SpriteWindow_Base
end
end
def setTextToFit(text,maxwidth=-1)
def setTextToFit(text,maxwidth = -1)
resizeToFit(text,maxwidth)
self.text = text
end
@@ -913,7 +913,7 @@ class SpriteWindow_Selectable < SpriteWindow_Base
return (self.height - self.borderY) / @row_height * @column_max
end
def priv_update_cursor_rect(force=false)
def priv_update_cursor_rect(force = false)
if @index < 0
self.cursor_rect.empty
self.refresh
@@ -1040,7 +1040,7 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx
attr_reader :baseColor
attr_reader :shadowColor
def initialize(x,y,width,height,viewport=nil)
def initialize(x,y,width,height,viewport = nil)
super(x,y,width,height)
self.viewport = viewport if viewport
if isDarkWindowskin(self.windowskin)
@@ -1076,7 +1076,7 @@ class Window_DrawableCommand < SpriteWindow_SelectableEx
return bitmap.text_size(text).width
end
def getAutoDims(commands,dims,width=nil)
def getAutoDims(commands,dims,width = nil)
rowMax = ((commands.length + self.columns - 1) / self.columns).to_i
windowheight = (rowMax*self.rowHeight)
windowheight += self.borderY
@@ -1146,7 +1146,7 @@ end
class Window_CommandPokemon < Window_DrawableCommand
attr_reader :commands
def initialize(commands,width=nil)
def initialize(commands,width = nil)
@starting=true
@commands=[]
dims=[]
@@ -1163,7 +1163,7 @@ class Window_CommandPokemon < Window_DrawableCommand
@starting=false
end
def self.newWithSize(commands,x,y,width,height,viewport=nil)
def self.newWithSize(commands,x,y,width,height,viewport = nil)
ret=self.new(commands,width)
ret.x=x
ret.y=y
@@ -1173,7 +1173,7 @@ class Window_CommandPokemon < Window_DrawableCommand
return ret
end
def self.newEmpty(x,y,width,height,viewport=nil)
def self.newEmpty(x,y,width,height,viewport = nil)
ret=self.new([],width)
ret.x=x
ret.y=y
@@ -1211,7 +1211,7 @@ class Window_CommandPokemon < Window_DrawableCommand
end
end
def resizeToFit(commands,width=nil)
def resizeToFit(commands,width = nil)
dims=[]
getAutoDims(commands,dims,width)
self.width=dims[0]
@@ -1258,7 +1258,7 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
return dims[1]-dims[0]
end
def initialize(commands,width=nil)
def initialize(commands,width = nil)
@starting=true
@commands=[]
dims=[]
@@ -1275,7 +1275,7 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
@starting=false
end
def self.newWithSize(commands,x,y,width,height,viewport=nil)
def self.newWithSize(commands,x,y,width,height,viewport = nil)
ret=self.new(commands,width)
ret.x=x
ret.y=y
@@ -1285,7 +1285,7 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
return ret
end
def self.newEmpty(x,y,width,height,viewport=nil)
def self.newEmpty(x,y,width,height,viewport = nil)
ret=self.new([],width)
ret.x=x
ret.y=y
@@ -1325,7 +1325,7 @@ class Window_AdvancedCommandPokemon < Window_DrawableCommand
end
end
def resizeToFit(commands,width=nil)
def resizeToFit(commands,width = nil)
dims=[]
getAutoDims(commands,dims,width)
self.width=dims[0]

View File

@@ -4,7 +4,7 @@
class IconWindow < SpriteWindow_Base
attr_reader :name
def initialize(x,y,width,height,viewport=nil)
def initialize(x,y,width,height,viewport = nil)
super(x,y,width,height)
self.viewport=viewport
self.contents=nil
@@ -37,7 +37,7 @@ class IconWindow < SpriteWindow_Base
end
# Sets the icon's filename.
def setBitmap(file,hue=0)
def setBitmap(file,hue = 0)
clearBitmaps()
@name=file
return if file==nil
@@ -91,7 +91,7 @@ class PictureWindow < SpriteWindow_Base
# Sets the icon's bitmap or filename. (hue parameter
# is ignored unless pathOrBitmap is a filename)
def setBitmap(pathOrBitmap,hue=0)
def setBitmap(pathOrBitmap,hue = 0)
clearBitmaps()
if pathOrBitmap!=nil && pathOrBitmap!=""
if pathOrBitmap.is_a?(Bitmap)

View File

@@ -2,7 +2,7 @@
# SpriteWrapper is a class which wraps (most of) Sprite's properties.
#===============================================================================
class SpriteWrapper
def initialize(viewport=nil)
def initialize(viewport = nil)
@sprite = Sprite.new(viewport)
end
@@ -94,7 +94,7 @@ end
# This bitmap can't be changed to a different one.
#===============================================================================
class BitmapSprite < SpriteWrapper
def initialize(width,height,viewport=nil)
def initialize(width,height,viewport = nil)
super(viewport)
self.bitmap=Bitmap.new(width,height)
@initialized=true
@@ -190,7 +190,7 @@ class AnimatedSprite < SpriteWrapper
end
end
def self.create(animname,framecount,frameskip,viewport=nil)
def self.create(animname,framecount,frameskip,viewport = nil)
return self.new([animname,framecount,frameskip,viewport])
end
@@ -275,7 +275,7 @@ class IconSprite < SpriteWrapper
end
# Sets the icon's filename.
def setBitmap(file,hue=0)
def setBitmap(file,hue = 0)
oldrc=self.src_rect
clearBitmaps()
@name=file
@@ -326,7 +326,7 @@ end
# SpriteWrapper that stores multiple bitmaps, and displays only one at once.
#===============================================================================
class ChangelingSprite < SpriteWrapper
def initialize(x=0,y=0,viewport=nil)
def initialize(x = 0,y = 0,viewport = nil)
super(viewport)
self.x = x
self.y = y

View File

@@ -225,14 +225,14 @@ def pbGetTileBitmap(filename, tile_id, hue, width = 1, height = 1)
}
end
def pbGetTileset(name,hue=0)
def pbGetTileset(name,hue = 0)
return AnimatedBitmap.new("Graphics/Tilesets/" + name, hue).deanimate
end
def pbGetAutotile(name,hue=0)
def pbGetAutotile(name,hue = 0)
return AnimatedBitmap.new("Graphics/Autotiles/" + name, hue).deanimate
end
def pbGetAnimation(name,hue=0)
def pbGetAnimation(name,hue = 0)
return AnimatedBitmap.new("Graphics/Animations/" + name, hue).deanimate
end

View File

@@ -157,7 +157,7 @@ def itemIconTag(item)
end
def getFormattedTextForDims(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight,
newlineBreaks=true,explicitBreaksOnly=false)
newlineBreaks = true,explicitBreaksOnly = false)
text2=text.gsub(/<(\/?)(c|c2|c3|o|u|s)(\s*\=\s*([^>]*))?>/i,"")
if newlineBreaks
text2.gsub!(/<(\/?)(br)(\s*\=\s*([^>]*))?>/i,"\n")
@@ -169,7 +169,7 @@ def getFormattedTextForDims(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight,
end
def getFormattedTextFast(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight,
newlineBreaks=true,explicitBreaksOnly=false)
newlineBreaks = true,explicitBreaksOnly = false)
x=y=0
characters=[]
textchunks=[]
@@ -385,9 +385,9 @@ To draw the characters, pass the returned array to the
_drawFormattedChars_ function.
=end
def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight=32,
newlineBreaks=true,explicitBreaksOnly=false,
collapseAlignments=false)
def getFormattedText(bitmap,xDst,yDst,widthDst,heightDst,text,lineheight = 32,
newlineBreaks = true,explicitBreaksOnly = false,
collapseAlignments = false)
dummybitmap=nil
if !bitmap || bitmap.disposed? # allows function to be called with nil bitmap
dummybitmap=Bitmap.new(1,1)
@@ -908,7 +908,7 @@ def getLineBrokenText(bitmap,value,width,dims)
return ret
end
def getLineBrokenChunks(bitmap,value,width,dims,plain=false)
def getLineBrokenChunks(bitmap,value,width,dims,plain = false)
x=0
y=0
ret=[]
@@ -962,7 +962,7 @@ def getLineBrokenChunks(bitmap,value,width,dims,plain=false)
return ret
end
def renderLineBrokenChunks(bitmap,xDst,yDst,normtext,maxheight=0)
def renderLineBrokenChunks(bitmap,xDst,yDst,normtext,maxheight = 0)
for i in 0...normtext.length
width=normtext[i][3]
textx=normtext[i][1]+xDst
@@ -1094,7 +1094,7 @@ def drawTextEx(bitmap,x,y,width,numlines,text,baseColor,shadowColor)
baseColor,shadowColor)
end
def drawFormattedTextEx(bitmap,x,y,width,text,baseColor=nil,shadowColor=nil,lineheight=32)
def drawFormattedTextEx(bitmap,x,y,width,text,baseColor = nil,shadowColor = nil,lineheight = 32)
base=!baseColor ? Color.new(12*8,12*8,12*8) : baseColor.clone
shadow=!shadowColor ? Color.new(26*8,26*8,25*8) : shadowColor.clone
text="<c2="+colorToRgb16(base)+colorToRgb16(shadow)+">"+text
@@ -1108,7 +1108,7 @@ def pbDrawShadow(bitmap,x,y,width,height,string)
pbDrawShadowText(bitmap,x,y,width,height,string,nil,bitmap.font.color)
end
def pbDrawShadowText(bitmap,x,y,width,height,string,baseColor,shadowColor=nil,align=0)
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+1 : width
height=(height<0) ? bitmap.text_size(string).height+1 : height
@@ -1125,7 +1125,7 @@ def pbDrawShadowText(bitmap,x,y,width,height,string,baseColor,shadowColor=nil,al
end
end
def pbDrawOutlineText(bitmap,x,y,width,height,string,baseColor,shadowColor=nil,align=0)
def pbDrawOutlineText(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
@@ -1179,7 +1179,7 @@ end
#===============================================================================
# Draw images on a bitmap
#===============================================================================
def pbCopyBitmap(dstbm,srcbm,x,y,opacity=255)
def pbCopyBitmap(dstbm,srcbm,x,y,opacity = 255)
rc = Rect.new(0,0,srcbm.width,srcbm.height)
dstbm.blt(x,y,srcbm,rc,opacity)
end

View File

@@ -376,7 +376,7 @@ end
#===============================================================================
#
#===============================================================================
def pbCreateStatusWindow(viewport=nil)
def pbCreateStatusWindow(viewport = nil)
msgwindow=Window_AdvancedTextPokemon.new("")
if !viewport
msgwindow.z=99999
@@ -391,7 +391,7 @@ def pbCreateStatusWindow(viewport=nil)
return msgwindow
end
def pbCreateMessageWindow(viewport=nil,skin=nil)
def pbCreateMessageWindow(viewport = nil,skin = nil)
msgwindow=Window_AdvancedTextPokemon.new("")
if !viewport
msgwindow.z=99999
@@ -418,7 +418,7 @@ end
#===============================================================================
# Main message-displaying function
#===============================================================================
def pbMessageDisplay(msgwindow,message,letterbyletter=true,commandProc=nil)
def pbMessageDisplay(msgwindow,message,letterbyletter = true,commandProc = nil)
return if !msgwindow
oldletterbyletter=msgwindow.letterbyletter
msgwindow.letterbyletter=(letterbyletter) ? true : false
@@ -708,7 +708,7 @@ end
#===============================================================================
# Message-displaying functions
#===============================================================================
def pbMessage(message,commands=nil,cmdIfCancel=0,skin=nil,defaultCmd=0,&block)
def pbMessage(message,commands = nil,cmdIfCancel = 0,skin = nil,defaultCmd = 0,&block)
ret = 0
msgwindow = pbCreateMessageWindow(nil,skin)
if commands
@@ -742,7 +742,7 @@ def pbMessageChooseNumber(message,params,&block)
return ret
end
def pbShowCommands(msgwindow,commands=nil,cmdIfCancel=0,defaultCmd=0)
def pbShowCommands(msgwindow,commands = nil,cmdIfCancel = 0,defaultCmd = 0)
return 0 if !commands
cmdwindow=Window_CommandPokemonEx.new(commands)
cmdwindow.z=99999
@@ -778,7 +778,7 @@ def pbShowCommands(msgwindow,commands=nil,cmdIfCancel=0,defaultCmd=0)
return ret
end
def pbShowCommandsWithHelp(msgwindow,commands,help,cmdIfCancel=0,defaultCmd=0)
def pbShowCommandsWithHelp(msgwindow,commands,help,cmdIfCancel = 0,defaultCmd = 0)
msgwin=msgwindow
msgwin=pbCreateMessageWindow(nil) if !msgwindow
oldlbl=msgwin.letterbyletter
@@ -828,7 +828,7 @@ def pbShowCommandsWithHelp(msgwindow,commands,help,cmdIfCancel=0,defaultCmd=0)
end
# frames is the number of 1/20 seconds to wait for
def pbMessageWaitForInput(msgwindow,frames,showPause=false)
def pbMessageWaitForInput(msgwindow,frames,showPause = false)
return if !frames || frames<=0
msgwindow.startPause if msgwindow && showPause
frames = frames*Graphics.frame_rate/20
@@ -845,7 +845,7 @@ def pbMessageWaitForInput(msgwindow,frames,showPause=false)
msgwindow.stopPause if msgwindow && showPause
end
def pbFreeText(msgwindow,currenttext,passwordbox,maxlength,width=240)
def pbFreeText(msgwindow,currenttext,passwordbox,maxlength,width = 240)
window=Window_TextEntry_Keyboard.new(currenttext,0,0,width,64)
ret=""
window.maxlength=maxlength
@@ -875,7 +875,7 @@ def pbFreeText(msgwindow,currenttext,passwordbox,maxlength,width=240)
return ret
end
def pbMessageFreeText(message,currenttext,passwordbox,maxlength,width=240,&block)
def pbMessageFreeText(message,currenttext,passwordbox,maxlength,width = 240,&block)
msgwindow=pbCreateMessageWindow
retval=pbMessageDisplay(msgwindow,message,true,
proc { |msgwindow|

View File

@@ -87,7 +87,7 @@ end
#
#===============================================================================
class Window_TextEntry < SpriteWindow_Base
def initialize(text,x,y,width,height,heading=nil,usedarkercolor=false)
def initialize(text,x,y,width,height,heading = nil,usedarkercolor = false)
super(x,y,width,height)
colors=getDefaultTextColors(self.windowskin)
@baseColor=colors[0]