Fixed rendering of some tiles for certain sizes of tilesets, more rubocopping

This commit is contained in:
Maruno17
2023-04-12 21:14:26 +01:00
parent 956a511ec5
commit a714086a39
42 changed files with 392 additions and 374 deletions

View File

@@ -1,9 +1,9 @@
module BattleAnimationEditor
module_function
#===============================================================================
#=============================================================================
# Controls
#===============================================================================
#=============================================================================
class Window_Menu < Window_CommandPokemon
def initialize(commands, x, y)
tempbitmap = Bitmap.new(32, 32)
@@ -41,9 +41,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
# Clipboard
#===============================================================================
#=============================================================================
module Clipboard
@data = nil
@typekey = ""
@@ -63,9 +63,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
def pbTrackPopupMenu(commands)
mousepos = Mouse.getMousePos
return -1 if !mousepos
@@ -94,9 +94,9 @@ module BattleAnimationEditor
return -1
end
#===============================================================================
#=============================================================================
# Sprite sheet scrolling bar
#===============================================================================
#=============================================================================
class AnimationWindow < Sprite
attr_reader :animbitmap
attr_reader :start
@@ -232,9 +232,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class CanvasAnimationWindow < AnimationWindow
def animbitmap
return @canvas.animbitmap
@@ -246,9 +246,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
# Cel sprite
#===============================================================================
#=============================================================================
class InvalidatableSprite < Sprite
def initialize(viewport = nil)
super(viewport)
@@ -283,9 +283,9 @@ module BattleAnimationEditor
def refresh; end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class SpriteFrame < InvalidatableSprite
attr_reader :id
attr_reader :locked
@@ -352,9 +352,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
# Canvas
#===============================================================================
#=============================================================================
class AnimationCanvas < Sprite
attr_reader :viewport
attr_reader :sprites
@@ -930,9 +930,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
# Window classes
#===============================================================================
#=============================================================================
class BitmapDisplayWindow < SpriteWindow_Base
attr_reader :bitmapname
attr_reader :hue
@@ -982,9 +982,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class AnimationNameWindow
def initialize(canvas, x, y, width, height, viewport = nil)
@canvas = canvas

View File

@@ -1,9 +1,7 @@
module BattleAnimationEditor
module_function
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
module ShadowText
def shadowtext(bitmap, x, y, w, h, t, disabled = false, align = 0)
width = bitmap.text_size(t).width
@@ -19,9 +17,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class UIControl
include ShadowText
attr_accessor :bitmap
@@ -95,9 +93,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class Label < UIControl
def text=(value)
self.label = value
@@ -112,9 +110,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class Button < UIControl
attr_accessor :label
@@ -169,9 +167,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class Checkbox < Button
attr_reader :checked
@@ -230,9 +228,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class TextField < UIControl
attr_accessor :label
attr_reader :text
@@ -366,9 +364,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class Slider < UIControl
attr_reader :minvalue
attr_reader :maxvalue
@@ -480,9 +478,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class OptionalSlider < Slider
def initialize(label, minvalue, maxvalue, curvalue)
@slider = Slider.new(label, minvalue, maxvalue, curvalue)
@@ -551,7 +549,7 @@ module BattleAnimationEditor
@checkbox.refresh
end
#-----------------------------------------------------------------------------
#---------------------------------------------------------------------------
private
@@ -573,9 +571,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class ArrayCountSlider < Slider
def maxvalue
return @array.length - 1
@@ -587,9 +585,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class FrameCountSlider < Slider
def maxvalue
return @canvas.animation.length
@@ -601,9 +599,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class FrameCountButton < Button
def label
return _INTL("Total Frames: {1}", @canvas.animation.length)
@@ -615,9 +613,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class TextSlider < UIControl
attr_reader :minvalue
attr_reader :maxvalue
@@ -735,9 +733,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class OptionalTextSlider < TextSlider
def initialize(label, options, curval)
@slider = TextSlider.new(label, options, curval)
@@ -806,7 +804,7 @@ module BattleAnimationEditor
@checkbox.refresh
end
#-----------------------------------------------------------------------------
#---------------------------------------------------------------------------
private
@@ -828,9 +826,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class ControlWindow < SpriteWindow_Base
attr_reader :controls

View File

@@ -1,9 +1,9 @@
module BattleAnimationEditor
module_function
#===============================================================================
#=============================================================================
# Paths and interpolation
#===============================================================================
#=============================================================================
class ControlPointSprite < Sprite
attr_accessor :dragging
@@ -51,9 +51,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class PointSprite < Sprite
def initialize(x, y, viewport = nil)
super(viewport)
@@ -69,9 +69,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class PointPath
include Enumerable
@@ -179,9 +179,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
def catmullRom(p1, p2, p3, p4, t)
# p1=prevPoint, p2=startPoint, p3=endPoint, p4=nextPoint, t is from 0 through 1
t2 = t * t

View File

@@ -1,9 +1,9 @@
module BattleAnimationEditor
module_function
################################################################################
#=============================================================================
# Importing and exporting
################################################################################
#=============================================================================
def pbRgssChdir(dir)
RTP.eachPathFor(dir) { |path| Dir.chdir(path) { yield } }
end
@@ -83,9 +83,9 @@ module BattleAnimationEditor
return
end
################################################################################
#=============================================================================
# Format conversion
################################################################################
#=============================================================================
def pbConvertAnimToNewFormat(textdata)
needconverting = false
textdata.length.times do |i|

View File

@@ -1,9 +1,9 @@
module BattleAnimationEditor
module_function
#===============================================================================
#=============================================================================
# Mini battle scene
#===============================================================================
#=============================================================================
class MiniBattler
attr_accessor :index
attr_accessor :pokemon
@@ -11,9 +11,9 @@ module BattleAnimationEditor
def initialize(index); self.index = index; end
end
#===============================================================================
#=============================================================================
#
#===============================================================================
#=============================================================================
class MiniBattle
attr_accessor :battlers
@@ -23,9 +23,9 @@ module BattleAnimationEditor
end
end
#===============================================================================
#=============================================================================
# Pop-up menus for buttons in bottom menu
#===============================================================================
#=============================================================================
def pbSelectAnim(canvas, animwin)
animfiles = []
pbRgssChdir(File.join("Graphics", "Animations")) { animfiles.concat(Dir.glob("*.png")) }
@@ -182,9 +182,9 @@ module BattleAnimationEditor
cmdwin.dispose
end
#===============================================================================
#=============================================================================
# Pop-up menus for individual cels
#===============================================================================
#=============================================================================
def pbChooseNum(cel)
ret = cel
sliderwin2 = ControlWindow.new(0, 0, 320, 32 * 5)
@@ -370,9 +370,9 @@ module BattleAnimationEditor
return
end
#===============================================================================
#=============================================================================
# Pop-up menus for buttons in right hand menu
#===============================================================================
#=============================================================================
def pbTimingList(canvas)
commands = []
cmdNewSound = -1