More aligning of code

This commit is contained in:
Maruno17
2021-12-19 12:19:08 +00:00
parent 13a238cc6a
commit 33781493f4
121 changed files with 977 additions and 838 deletions

View File

@@ -223,7 +223,7 @@ class AnimationWindow < SpriteWrapper
@contents.fill_rect(0, 0, @contents.width, @contents.height, Color.new(180, 180, 180))
@contents.blt(0, 0, @arrows.bitmap, Rect.new(0, 0, arrowwidth, 96))
@contents.blt(arrowwidth + NUMFRAMES * 96, 0, @arrows.bitmap,
Rect.new(arrowwidth, 0, arrowwidth, 96))
Rect.new(arrowwidth, 0, arrowwidth, 96))
havebitmap = (self.animbitmap && !self.animbitmap.disposed?)
if havebitmap
rect = Rect.new(0, 0, 0, 0)
@@ -484,7 +484,7 @@ class AnimationCanvas < Sprite
else
begin
@animbitmap = AnimatedBitmap.new("Graphics/Animations/" + @animation.graphic,
@animation.hue).deanimate
@animation.hue).deanimate
rescue
@animbitmap = nil
end
@@ -527,13 +527,13 @@ class AnimationCanvas < Sprite
@sprites["pokemon_1"].bitmap = @target
@sprites["pokemon_1"].z = 16
pbSpriteSetAnimFrame(@sprites["pokemon_0"],
pbCreateCel(Battle::Scene::FOCUSUSER_X,
Battle::Scene::FOCUSUSER_Y, -1, 2),
@sprites["pokemon_0"], @sprites["pokemon_1"])
pbCreateCel(Battle::Scene::FOCUSUSER_X,
Battle::Scene::FOCUSUSER_Y, -1, 2),
@sprites["pokemon_0"], @sprites["pokemon_1"])
pbSpriteSetAnimFrame(@sprites["pokemon_1"],
pbCreateCel(Battle::Scene::FOCUSTARGET_X,
Battle::Scene::FOCUSTARGET_Y, -2, 1),
@sprites["pokemon_0"], @sprites["pokemon_1"])
pbCreateCel(Battle::Scene::FOCUSTARGET_X,
Battle::Scene::FOCUSTARGET_Y, -2, 1),
@sprites["pokemon_0"], @sprites["pokemon_1"])
usersprite = @sprites["pokemon_#{oppmove ? 1 : 0}"]
targetsprite = @sprites["pokemon_#{oppmove ? 0 : 1}"]
olduserx = usersprite ? usersprite.x : 0
@@ -541,12 +541,15 @@ class AnimationCanvas < Sprite
oldtargetx = targetsprite ? targetsprite.x : 0
oldtargety = targetsprite ? targetsprite.y : 0
@player = PBAnimationPlayerX.new(@animation,
@battle.battlers[oppmove ? 1 : 0], @battle.battlers[oppmove ? 0 : 1], self, oppmove, true)
@battle.battlers[oppmove ? 1 : 0],
@battle.battlers[oppmove ? 0 : 1],
self, oppmove, true)
@player.setLineTransform(
Battle::Scene::FOCUSUSER_X, Battle::Scene::FOCUSUSER_Y,
Battle::Scene::FOCUSTARGET_X, Battle::Scene::FOCUSTARGET_Y,
olduserx, oldusery,
oldtargetx, oldtargety)
Battle::Scene::FOCUSUSER_X, Battle::Scene::FOCUSUSER_Y,
Battle::Scene::FOCUSTARGET_X, Battle::Scene::FOCUSTARGET_Y,
olduserx, oldusery,
oldtargetx, oldtargety
)
@player.start
@playing = true
@sprites["pokemon_0"].x += BORDERSIZE
@@ -992,10 +995,9 @@ class BitmapDisplayWindow < SpriteWindow_Base
wh = sx * wh
ww = self.contents.width
end
dest = Rect.new(
(self.contents.width - ww) / 2,
(self.contents.height - wh) / 2,
ww, wh)
dest = Rect.new((self.contents.width - ww) / 2,
(self.contents.height - wh) / 2,
ww, wh)
src = Rect.new(0, 0, bmap.width, bmap.height)
self.contents.stretch_blt(dest, bmap, src)
bmap.dispose
@@ -1009,7 +1011,8 @@ class AnimationNameWindow
@canvas = canvas
@oldname = nil
@window = Window_UnformattedTextPokemon.newWithSize(
_INTL("Name: {1}", @canvas.animation.name), x, y, width, height, viewport)
_INTL("Name: {1}", @canvas.animation.name), x, y, width, height, viewport
)
end
def viewport=(value); @window.viewport = value; end

View File

@@ -8,8 +8,8 @@ module ShadowText
x += (w / 2) - (width / 2)
end
pbDrawShadowText(bitmap, x, y, w, h, t,
disabled ? Color.new(26 * 8, 26 * 8, 25 * 8) : Color.new(12 * 8, 12 * 8, 12 * 8),
Color.new(26 * 8, 26 * 8, 25 * 8))
disabled ? Color.new(26 * 8, 26 * 8, 25 * 8) : Color.new(12 * 8, 12 * 8, 12 * 8),
Color.new(26 * 8, 26 * 8, 25 * 8))
end
end
@@ -47,10 +47,7 @@ class UIControl
end
def toAbsoluteRect(rc)
return Rect.new(
rc.x + self.parentX,
rc.y + self.parentY,
rc.width, rc.height)
return Rect.new(rc.x + self.parentX, rc.y + self.parentY, rc.width, rc.height)
end
def parentX
@@ -442,7 +439,7 @@ class Slider < UIControl
shadowtext(bitmap, x, y, size, height, self.label)
x += size
shadowtext(bitmap, x, y, leftarrows.width, height, _INTL(" << "),
self.disabled || self.curvalue == self.minvalue)
self.disabled || self.curvalue == self.minvalue)
@leftarrow = Rect.new(x, y, leftarrows.width, height)
x += leftarrows.width
if !self.disabled
@@ -451,7 +448,7 @@ class Slider < UIControl
end
x += numbers
shadowtext(bitmap, x, y, rightarrows.width, height, _INTL(" >> "),
self.disabled || self.curvalue == self.maxvalue)
self.disabled || self.curvalue == self.maxvalue)
@rightarrow = Rect.new(x, y, rightarrows.width, height)
end
end
@@ -690,7 +687,7 @@ class TextSlider < UIControl
shadowtext(bitmap, x, y, size, height, self.label)
x += size
shadowtext(bitmap, x, y, leftarrows.width, height, _INTL(" << "),
self.disabled || self.curvalue == self.minvalue)
self.disabled || self.curvalue == self.minvalue)
@leftarrow = Rect.new(x, y, leftarrows.width, height)
x += leftarrows.width
if !self.disabled
@@ -699,7 +696,7 @@ class TextSlider < UIControl
end
x += @maxoptionwidth
shadowtext(bitmap, x, y, rightarrows.width, height, _INTL(" >> "),
self.disabled || self.curvalue == self.maxvalue)
self.disabled || self.curvalue == self.maxvalue)
@rightarrow = Rect.new(x, y, rightarrows.width, height)
end
end

View File

@@ -283,8 +283,9 @@ def pbDefinePath(canvas)
showline = false
sliderwin2.visible = false
# This window displays the mouse's current position
window = Window_UnformattedTextPokemon.newWithSize("",
0, 320 - 64, 128, 64, canvas.viewport)
window = Window_UnformattedTextPokemon.newWithSize(
"", 0, 320 - 64, 128, 64, canvas.viewport
)
loop do
Graphics.update
Input.update
@@ -363,8 +364,9 @@ def pbDefinePath(canvas)
point.dispose
end
points.clear
window = Window_UnformattedTextPokemon.newWithSize("",
0, 320 - 64, 128, 64, canvas.viewport)
window = Window_UnformattedTextPokemon.newWithSize(
"", 0, 320 - 64, 128, 64, canvas.viewport
)
sliderwin2.visible = false
loop do
Graphics.update

View File

@@ -128,8 +128,9 @@ def pbAnimList(animations, canvas, animwin)
cmdwin.index = animations.selected
cmdwin.viewport = canvas.viewport
helpwindow = Window_UnformattedTextPokemon.newWithSize(
_INTL("Enter: Load/rename an animation\nEsc: Cancel"),
320, 0, 320, 128, canvas.viewport)
_INTL("Enter: Load/rename an animation\nEsc: Cancel"),
320, 0, 320, 128, canvas.viewport
)
maxsizewindow = ControlWindow.new(0, 416, 320, 32 * 3)
maxsizewindow.addSlider(_INTL("Total Animations:"), 1, 2000, animations.length)
maxsizewindow.addButton(_INTL("Resize Animation List"))