Added decent spacing to all scripts thanks to Rubocop

This commit is contained in:
Maruno17
2021-12-18 15:25:40 +00:00
parent f7b76ae62e
commit d17fc40a47
207 changed files with 18577 additions and 18587 deletions

View File

@@ -7,7 +7,7 @@ class ItemIconSprite < SpriteWrapper
ANIM_ICON_SIZE = 48
FRAMES_PER_CYCLE = Graphics.frame_rate
def initialize(x,y,item,viewport = nil)
def initialize(x, y, item, viewport = nil)
super(viewport)
@animbitmap = nil
@animframe = 0
@@ -28,7 +28,7 @@ class ItemIconSprite < SpriteWrapper
def width
return 0 if !self.bitmap || self.bitmap.disposed?
return (@numframes==1) ? self.bitmap.width : ANIM_ICON_SIZE
return (@numframes == 1) ? self.bitmap.width : ANIM_ICON_SIZE
end
def height
@@ -53,7 +53,7 @@ class ItemIconSprite < SpriteWrapper
when PictureOrigin::TopLeft, PictureOrigin::Top, PictureOrigin::TopRight
self.oy = 0
when PictureOrigin::Left, PictureOrigin::Center, PictureOrigin::Right
self.oy = self.height/2
self.oy = self.height / 2
when PictureOrigin::BottomLeft, PictureOrigin::Bottom, PictureOrigin::BottomRight
self.oy = self.height
end
@@ -61,26 +61,26 @@ class ItemIconSprite < SpriteWrapper
when PictureOrigin::TopLeft, PictureOrigin::Left, PictureOrigin::BottomLeft
self.ox = 0
when PictureOrigin::Top, PictureOrigin::Center, PictureOrigin::Bottom
self.ox = self.width/2
self.ox = self.width / 2
when PictureOrigin::TopRight, PictureOrigin::Right, PictureOrigin::BottomRight
self.ox = self.width
end
end
def item=(value)
return if @item==value && !@forceitemchange
return if @item == value && !@forceitemchange
@item = value
@animbitmap.dispose if @animbitmap
@animbitmap = nil
if @item || !@blankzero
@animbitmap = AnimatedBitmap.new(GameData::Item.icon_filename(@item))
self.bitmap = @animbitmap.bitmap
if self.bitmap.height==ANIM_ICON_SIZE
@numframes = [(self.bitmap.width/ANIM_ICON_SIZE).floor,1].max
self.src_rect = Rect.new(0,0,ANIM_ICON_SIZE,ANIM_ICON_SIZE)
if self.bitmap.height == ANIM_ICON_SIZE
@numframes = [(self.bitmap.width / ANIM_ICON_SIZE).floor, 1].max
self.src_rect = Rect.new(0, 0, ANIM_ICON_SIZE, ANIM_ICON_SIZE)
else
@numframes = 1
self.src_rect = Rect.new(0,0,self.bitmap.width,self.bitmap.height)
self.src_rect = Rect.new(0, 0, self.bitmap.width, self.bitmap.height)
end
@animframe = 0
@frame = 0
@@ -96,12 +96,12 @@ class ItemIconSprite < SpriteWrapper
if @animbitmap
@animbitmap.update
self.bitmap = @animbitmap.bitmap
if @numframes>1
frameskip = (FRAMES_PER_CYCLE/@numframes).floor
@frame = (@frame+1)%FRAMES_PER_CYCLE
if @frame>=frameskip
@animframe = (@animframe+1)%@numframes
self.src_rect.x = @animframe*ANIM_ICON_SIZE
if @numframes > 1
frameskip = (FRAMES_PER_CYCLE / @numframes).floor
@frame = (@frame + 1) % FRAMES_PER_CYCLE
if @frame >= frameskip
@animframe = (@animframe + 1) % @numframes
self.src_rect.x = @animframe * ANIM_ICON_SIZE
@frame = 0
end
end
@@ -116,7 +116,7 @@ end
# Item held icon (used in the party screen)
#===============================================================================
class HeldItemIconSprite < SpriteWrapper
def initialize(x,y,pokemon,viewport = nil)
def initialize(x, y, pokemon, viewport = nil)
super(viewport)
self.x = x
self.y = y
@@ -136,7 +136,7 @@ class HeldItemIconSprite < SpriteWrapper
end
def item=(value)
return if @item==value
return if @item == value
@item = value
@animbitmap.dispose if @animbitmap
@animbitmap = nil