mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 13:44:59 +00:00
Added decent spacing to all scripts thanks to Rubocop
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
# Unused
|
||||
class ClippableSprite < Sprite_Character
|
||||
def initialize(viewport,event,tilemap)
|
||||
def initialize(viewport, event, tilemap)
|
||||
@tilemap = tilemap
|
||||
@_src_rect = Rect.new(0,0,0,0)
|
||||
super(viewport,event)
|
||||
@_src_rect = Rect.new(0, 0, 0, 0)
|
||||
super(viewport, event)
|
||||
end
|
||||
|
||||
def update
|
||||
super
|
||||
@_src_rect = self.src_rect
|
||||
tmright = @tilemap.map_data.xsize*Game_Map::TILE_WIDTH-@tilemap.ox
|
||||
tmright = @tilemap.map_data.xsize * Game_Map::TILE_WIDTH - @tilemap.ox
|
||||
echoln "x=#{self.x},ox=#{self.ox},tmright=#{tmright},tmox=#{@tilemap.ox}"
|
||||
if @tilemap.ox-self.ox<-self.x
|
||||
if @tilemap.ox - self.ox < -self.x
|
||||
# clipped on left
|
||||
diff = -self.x-@tilemap.ox+self.ox
|
||||
self.src_rect = Rect.new(@_src_rect.x+diff,@_src_rect.y,
|
||||
@_src_rect.width-diff,@_src_rect.height)
|
||||
echoln "clipped out left: #{diff} #{@tilemap.ox-self.ox} #{self.x}"
|
||||
elsif tmright-self.ox<self.x
|
||||
diff = -self.x - @tilemap.ox + self.ox
|
||||
self.src_rect = Rect.new(@_src_rect.x + diff, @_src_rect.y,
|
||||
@_src_rect.width - diff, @_src_rect.height)
|
||||
echoln "clipped out left: #{diff} #{@tilemap.ox - self.ox} #{self.x}"
|
||||
elsif tmright - self.ox < self.x
|
||||
# clipped on right
|
||||
diff = self.x-tmright+self.ox
|
||||
self.src_rect = Rect.new(@_src_rect.x,@_src_rect.y,
|
||||
@_src_rect.width-diff,@_src_rect.height)
|
||||
echoln "clipped out right: #{diff} #{tmright+self.ox} #{self.x}"
|
||||
diff = self.x - tmright + self.ox
|
||||
self.src_rect = Rect.new(@_src_rect.x, @_src_rect.y,
|
||||
@_src_rect.width - diff, @_src_rect.height)
|
||||
echoln "clipped out right: #{diff} #{tmright + self.ox} #{self.x}"
|
||||
else
|
||||
echoln "-not- clipped out left: #{diff} #{@tilemap.ox-self.ox} #{self.x}"
|
||||
echoln "-not- clipped out left: #{diff} #{@tilemap.ox - self.ox} #{self.x}"
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -55,11 +55,11 @@ class Spriteset_Map
|
||||
@fog.z = 3000
|
||||
@character_sprites = []
|
||||
for i in @map.events.keys.sort
|
||||
sprite = Sprite_Character.new(@@viewport1,@map.events[i])
|
||||
sprite = Sprite_Character.new(@@viewport1, @map.events[i])
|
||||
@character_sprites.push(sprite)
|
||||
end
|
||||
@weather = RPG::Weather.new(@@viewport1)
|
||||
pbOnSpritesetCreate(self,@@viewport1)
|
||||
pbOnSpritesetCreate(self, @@viewport1)
|
||||
update
|
||||
end
|
||||
|
||||
@@ -90,32 +90,32 @@ class Spriteset_Map
|
||||
end
|
||||
|
||||
def update
|
||||
if @panorama_name!=@map.panorama_name || @panorama_hue!=@map.panorama_hue
|
||||
if @panorama_name != @map.panorama_name || @panorama_hue != @map.panorama_hue
|
||||
@panorama_name = @map.panorama_name
|
||||
@panorama_hue = @map.panorama_hue
|
||||
@panorama.set_panorama(nil) if !@panorama.bitmap.nil?
|
||||
@panorama.set_panorama(@panorama_name, @panorama_hue) if !nil_or_empty?(@panorama_name)
|
||||
Graphics.frame_reset
|
||||
end
|
||||
if @fog_name!=@map.fog_name || @fog_hue!=@map.fog_hue
|
||||
if @fog_name != @map.fog_name || @fog_hue != @map.fog_hue
|
||||
@fog_name = @map.fog_name
|
||||
@fog_hue = @map.fog_hue
|
||||
@fog.set_fog(nil) if !@fog.bitmap.nil?
|
||||
@fog.set_fog(@fog_name, @fog_hue) if !nil_or_empty?(@fog_name)
|
||||
Graphics.frame_reset
|
||||
end
|
||||
tmox = (@map.display_x/Game_Map::X_SUBPIXELS).round
|
||||
tmoy = (@map.display_y/Game_Map::Y_SUBPIXELS).round
|
||||
@@viewport1.rect.set(0,0,Graphics.width,Graphics.height)
|
||||
tmox = (@map.display_x / Game_Map::X_SUBPIXELS).round
|
||||
tmoy = (@map.display_y / Game_Map::Y_SUBPIXELS).round
|
||||
@@viewport1.rect.set(0, 0, Graphics.width, Graphics.height)
|
||||
@@viewport1.ox = 0
|
||||
@@viewport1.oy = 0
|
||||
@@viewport1.ox += $game_screen.shake
|
||||
@panorama.ox = tmox/2
|
||||
@panorama.oy = tmoy/2
|
||||
@fog.ox = tmox+@map.fog_ox
|
||||
@fog.oy = tmoy+@map.fog_oy
|
||||
@fog.zoom_x = @map.fog_zoom/100.0
|
||||
@fog.zoom_y = @map.fog_zoom/100.0
|
||||
@panorama.ox = tmox / 2
|
||||
@panorama.oy = tmoy / 2
|
||||
@fog.ox = tmox + @map.fog_ox
|
||||
@fog.oy = tmoy + @map.fog_oy
|
||||
@fog.zoom_x = @map.fog_zoom / 100.0
|
||||
@fog.zoom_y = @map.fog_zoom / 100.0
|
||||
@fog.opacity = @map.fog_opacity
|
||||
@fog.blend_type = @map.fog_blend_type
|
||||
@fog.tone = @map.fog_tone
|
||||
@@ -124,7 +124,7 @@ class Spriteset_Map
|
||||
for sprite in @character_sprites
|
||||
sprite.update
|
||||
end
|
||||
if self.map!=$game_map
|
||||
if self.map != $game_map
|
||||
@weather.fade_in(:None, 0, 20)
|
||||
else
|
||||
@weather.fade_in($game_screen.weather_type, $game_screen.weather_max, $game_screen.weather_duration)
|
||||
|
||||
Reference in New Issue
Block a user