mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 21:54:58 +00:00
Fixed previous commit always causing recompiling if shadow_pokemon.dat doesn't exist, also rubocopping
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Controls
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
class Window_Menu < Window_CommandPokemon
|
||||
def initialize(commands, x, y)
|
||||
tempbitmap = Bitmap.new(32, 32)
|
||||
@@ -40,11 +40,9 @@ class Window_Menu < Window_CommandPokemon
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Clipboard
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
module Clipboard
|
||||
@data = nil
|
||||
@typekey = ""
|
||||
@@ -64,11 +62,9 @@ module Clipboard
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Collision testing
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
class Rect < Object
|
||||
def contains(x, y)
|
||||
return x >= self.x && x < self.x + self.width &&
|
||||
@@ -76,8 +72,9 @@ class Rect < Object
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
def pbSpriteHitTest(sprite, x, y, usealpha = true, wholecanvas = false)
|
||||
return false if !sprite || sprite.disposed?
|
||||
return false if !sprite.bitmap
|
||||
@@ -158,11 +155,9 @@ def pbTrackPopupMenu(commands)
|
||||
return -1
|
||||
end
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Sprite sheet scrolling bar
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
class AnimationWindow < Sprite
|
||||
attr_reader :animbitmap
|
||||
attr_reader :start
|
||||
@@ -298,8 +293,9 @@ class AnimationWindow < Sprite
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class CanvasAnimationWindow < AnimationWindow
|
||||
def animbitmap
|
||||
return @canvas.animbitmap
|
||||
@@ -311,33 +307,31 @@ class CanvasAnimationWindow < AnimationWindow
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Cel sprite
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
class InvalidatableSprite < Sprite
|
||||
def initialize(viewport = nil)
|
||||
super(viewport)
|
||||
@invalid = false
|
||||
end
|
||||
|
||||
# Marks that the control must be redrawn to reflect current logic.
|
||||
# Marks that the control must be redrawn to reflect current logic.
|
||||
def invalidate
|
||||
@invalid = true
|
||||
end
|
||||
|
||||
# Determines whether the control is invalid
|
||||
# Determines whether the control is invalid
|
||||
def invalid?
|
||||
return @invalid
|
||||
end
|
||||
|
||||
# Marks that the control is valid. Normally called only by repaint.
|
||||
# Marks that the control is valid. Normally called only by repaint.
|
||||
def validate
|
||||
@invalid = false
|
||||
end
|
||||
|
||||
# Redraws the sprite only if it is invalid, and then revalidates the sprite
|
||||
# Redraws the sprite only if it is invalid, and then revalidates the sprite
|
||||
def repaint
|
||||
if self.invalid?
|
||||
refresh
|
||||
@@ -345,14 +339,15 @@ class InvalidatableSprite < Sprite
|
||||
end
|
||||
end
|
||||
|
||||
# Redraws the sprite. This method should not check whether
|
||||
# the sprite is invalid, to allow it to be explicitly called.
|
||||
# Redraws the sprite. This method should not check whether
|
||||
# the sprite is invalid, to allow it to be explicitly called.
|
||||
def refresh
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class SpriteFrame < InvalidatableSprite
|
||||
attr_reader :id
|
||||
attr_reader :locked
|
||||
@@ -419,11 +414,9 @@ class SpriteFrame < InvalidatableSprite
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Canvas
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
class AnimationCanvas < Sprite
|
||||
attr_reader :viewport
|
||||
attr_reader :sprites
|
||||
@@ -947,11 +940,9 @@ class AnimationCanvas < Sprite
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Window classes
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
class BitmapDisplayWindow < SpriteWindow_Base
|
||||
attr_reader :bitmapname
|
||||
attr_reader :hue
|
||||
@@ -1001,8 +992,9 @@ class BitmapDisplayWindow < SpriteWindow_Base
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class AnimationNameWindow
|
||||
def initialize(canvas, x, y, width, height, viewport = nil)
|
||||
@canvas = canvas
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
module ShadowText
|
||||
def shadowtext(bitmap, x, y, w, h, t, disabled = false, align = 0)
|
||||
width = bitmap.text_size(t).width
|
||||
@@ -13,8 +16,9 @@ module ShadowText
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class UIControl
|
||||
include ShadowText
|
||||
attr_accessor :bitmap
|
||||
@@ -90,8 +94,9 @@ class UIControl
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class Label < UIControl
|
||||
def text=(value)
|
||||
self.label = value
|
||||
@@ -106,8 +111,9 @@ class Label < UIControl
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class Button < UIControl
|
||||
attr_accessor :label
|
||||
|
||||
@@ -155,8 +161,9 @@ class Button < UIControl
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class Checkbox < Button
|
||||
attr_reader :checked
|
||||
|
||||
@@ -210,8 +217,9 @@ class Checkbox < Button
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class TextField < UIControl
|
||||
attr_accessor :label
|
||||
attr_reader :text
|
||||
@@ -340,8 +348,9 @@ class TextField < UIControl
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class Slider < UIControl
|
||||
attr_reader :minvalue
|
||||
attr_reader :maxvalue
|
||||
@@ -453,8 +462,9 @@ class Slider < UIControl
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class OptionalSlider < Slider
|
||||
def initialize(label, minvalue, maxvalue, curvalue)
|
||||
@slider = Slider.new(label, minvalue, maxvalue, curvalue)
|
||||
@@ -543,8 +553,9 @@ class OptionalSlider < Slider
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class ArrayCountSlider < Slider
|
||||
def maxvalue
|
||||
return @array.length - 1
|
||||
@@ -556,8 +567,9 @@ class ArrayCountSlider < Slider
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class FrameCountSlider < Slider
|
||||
def maxvalue
|
||||
return @canvas.animation.length
|
||||
@@ -569,8 +581,9 @@ class FrameCountSlider < Slider
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class FrameCountButton < Button
|
||||
def label
|
||||
return _INTL("Total Frames: {1}", @canvas.animation.length)
|
||||
@@ -582,8 +595,9 @@ class FrameCountButton < Button
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class TextSlider < UIControl
|
||||
attr_reader :minvalue
|
||||
attr_reader :maxvalue
|
||||
@@ -701,8 +715,9 @@ class TextSlider < UIControl
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class OptionalTextSlider < TextSlider
|
||||
def initialize(label, options, curval)
|
||||
@slider = TextSlider.new(label, options, curval)
|
||||
@@ -791,7 +806,9 @@ class OptionalTextSlider < TextSlider
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class ControlWindow < SpriteWindow_Base
|
||||
attr_reader :controls
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Paths and interpolation
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
class ControlPointSprite < Sprite
|
||||
attr_accessor :dragging
|
||||
|
||||
@@ -48,8 +48,9 @@ class ControlPointSprite < Sprite
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class PointSprite < Sprite
|
||||
def initialize(x, y, viewport = nil)
|
||||
super(viewport)
|
||||
@@ -65,8 +66,9 @@ class PointSprite < Sprite
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class PointPath
|
||||
include Enumerable
|
||||
|
||||
@@ -180,8 +182,9 @@ class PointPath
|
||||
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
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Mini battle scene
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
class MiniBattler
|
||||
attr_accessor :index
|
||||
attr_accessor :pokemon
|
||||
@@ -8,8 +8,9 @@ class MiniBattler
|
||||
def initialize(index); self.index = index; end
|
||||
end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
#
|
||||
#===============================================================================
|
||||
class MiniBattle
|
||||
attr_accessor :battlers
|
||||
|
||||
@@ -19,11 +20,9 @@ class MiniBattle
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Pop-up menus for buttons in bottom menu
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
def pbSelectAnim(canvas, animwin)
|
||||
animfiles = []
|
||||
pbRgssChdir(File.join("Graphics", "Animations")) {
|
||||
@@ -182,9 +181,9 @@ def pbAnimList(animations, canvas, animwin)
|
||||
cmdwin.dispose
|
||||
end
|
||||
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Pop-up menus for individual cels
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
def pbChooseNum(cel)
|
||||
ret = cel
|
||||
sliderwin2 = ControlWindow.new(0, 0, 320, 32 * 5)
|
||||
@@ -370,9 +369,9 @@ def pbCellProperties(canvas)
|
||||
return
|
||||
end
|
||||
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Pop-up menus for buttons in right hand menu
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
def pbTimingList(canvas)
|
||||
commands = []
|
||||
cmdNewSound = -1
|
||||
@@ -957,9 +956,9 @@ def pbAnimEditorHelpWindow
|
||||
cmdwin.dispose
|
||||
end
|
||||
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Main
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
def animationEditorMain(animation)
|
||||
viewport = Viewport.new(0, 0, Settings::SCREEN_WIDTH + 288, Settings::SCREEN_HEIGHT + 288)
|
||||
viewport.z = 99999
|
||||
@@ -1172,9 +1171,9 @@ def animationEditorMain(animation)
|
||||
RPG::Cache.clear
|
||||
end
|
||||
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
# Start
|
||||
################################################################################
|
||||
#===============================================================================
|
||||
def pbAnimationEditor
|
||||
pbBGMStop
|
||||
animation = pbLoadBattleAnimations
|
||||
|
||||
Reference in New Issue
Block a user