mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-09 06:04:59 +00:00
Added decent spacing to all scripts thanks to Rubocop
This commit is contained in:
@@ -6,7 +6,7 @@ class PokegearButton < SpriteWrapper
|
||||
attr_reader :name
|
||||
attr_reader :selected
|
||||
|
||||
def initialize(command,x,y,viewport = nil)
|
||||
def initialize(command, x, y, viewport = nil)
|
||||
super(viewport)
|
||||
@image = command[0]
|
||||
@name = command[1]
|
||||
@@ -16,7 +16,7 @@ class PokegearButton < SpriteWrapper
|
||||
else
|
||||
@button = AnimatedBitmap.new("Graphics/Pictures/Pokegear/icon_button")
|
||||
end
|
||||
@contents = BitmapWrapper.new(@button.width,@button.height)
|
||||
@contents = BitmapWrapper.new(@button.width, @button.height)
|
||||
self.bitmap = @contents
|
||||
self.x = x
|
||||
self.y = y
|
||||
@@ -33,22 +33,22 @@ class PokegearButton < SpriteWrapper
|
||||
def selected=(val)
|
||||
oldsel = @selected
|
||||
@selected = val
|
||||
refresh if oldsel!=val
|
||||
refresh if oldsel != val
|
||||
end
|
||||
|
||||
def refresh
|
||||
self.bitmap.clear
|
||||
rect = Rect.new(0,0,@button.width,@button.height/2)
|
||||
rect.y = @button.height/2 if @selected
|
||||
self.bitmap.blt(0,0,@button.bitmap,rect)
|
||||
rect = Rect.new(0, 0, @button.width, @button.height / 2)
|
||||
rect.y = @button.height / 2 if @selected
|
||||
self.bitmap.blt(0, 0, @button.bitmap, rect)
|
||||
textpos = [
|
||||
[@name,self.bitmap.width/2,4,2,Color.new(248,248,248),Color.new(40,40,40)],
|
||||
[@name, self.bitmap.width / 2, 4, 2, Color.new(248, 248, 248), Color.new(40, 40, 40)],
|
||||
]
|
||||
pbDrawTextPositions(self.bitmap,textpos)
|
||||
pbDrawTextPositions(self.bitmap, textpos)
|
||||
imagepos = [
|
||||
[sprintf("Graphics/Pictures/Pokegear/icon_"+@image),18,10]
|
||||
[sprintf("Graphics/Pictures/Pokegear/icon_" + @image), 18, 10]
|
||||
]
|
||||
pbDrawImagePositions(self.bitmap,imagepos)
|
||||
pbDrawImagePositions(self.bitmap, imagepos)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -58,7 +58,7 @@ end
|
||||
class PokemonPokegear_Scene
|
||||
def pbUpdate
|
||||
for i in 0...@commands.length
|
||||
@sprites["button#{i}"].selected = (i==@index)
|
||||
@sprites["button#{i}"].selected = (i == @index)
|
||||
end
|
||||
pbUpdateSpriteHash(@sprites)
|
||||
end
|
||||
@@ -66,18 +66,18 @@ class PokemonPokegear_Scene
|
||||
def pbStartScene(commands)
|
||||
@commands = commands
|
||||
@index = 0
|
||||
@viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
|
||||
@viewport = Viewport.new(0, 0, Graphics.width, Graphics.height)
|
||||
@viewport.z = 99999
|
||||
@sprites = {}
|
||||
@sprites["background"] = IconSprite.new(0,0,@viewport)
|
||||
@sprites["background"] = IconSprite.new(0, 0, @viewport)
|
||||
if $player.female? && pbResolveBitmap(sprintf("Graphics/Pictures/Pokegear/bg_f"))
|
||||
@sprites["background"].setBitmap("Graphics/Pictures/Pokegear/bg_f")
|
||||
else
|
||||
@sprites["background"].setBitmap("Graphics/Pictures/Pokegear/bg")
|
||||
end
|
||||
for i in 0...@commands.length
|
||||
y = 196 - (@commands.length*24) + (i*48)
|
||||
@sprites["button#{i}"] = PokegearButton.new(@commands[i],118,y,@viewport)
|
||||
y = 196 - (@commands.length * 24) + (i * 48)
|
||||
@sprites["button#{i}"] = PokegearButton.new(@commands[i], 118, y, @viewport)
|
||||
end
|
||||
pbFadeInAndShow(@sprites) { pbUpdate }
|
||||
end
|
||||
@@ -96,13 +96,13 @@ class PokemonPokegear_Scene
|
||||
ret = @index
|
||||
break
|
||||
elsif Input.trigger?(Input::UP)
|
||||
pbPlayCursorSE if @commands.length>1
|
||||
pbPlayCursorSE if @commands.length > 1
|
||||
@index -= 1
|
||||
@index = @commands.length-1 if @index<0
|
||||
@index = @commands.length - 1 if @index < 0
|
||||
elsif Input.trigger?(Input::DOWN)
|
||||
pbPlayCursorSE if @commands.length>1
|
||||
pbPlayCursorSE if @commands.length > 1
|
||||
@index += 1
|
||||
@index = 0 if @index>=@commands.length
|
||||
@index = 0 if @index >= @commands.length
|
||||
end
|
||||
end
|
||||
return ret
|
||||
@@ -132,17 +132,17 @@ class PokemonPokegearScreen
|
||||
cmdMap = -1
|
||||
cmdPhone = -1
|
||||
cmdJukebox = -1
|
||||
commands[cmdMap = commands.length] = ["map",_INTL("Map")]
|
||||
if $PokemonGlobal.phoneNumbers && $PokemonGlobal.phoneNumbers.length>0
|
||||
commands[cmdPhone = commands.length] = ["phone",_INTL("Phone")]
|
||||
commands[cmdMap = commands.length] = ["map", _INTL("Map")]
|
||||
if $PokemonGlobal.phoneNumbers && $PokemonGlobal.phoneNumbers.length > 0
|
||||
commands[cmdPhone = commands.length] = ["phone", _INTL("Phone")]
|
||||
end
|
||||
commands[cmdJukebox = commands.length] = ["jukebox",_INTL("Jukebox")]
|
||||
commands[cmdJukebox = commands.length] = ["jukebox", _INTL("Jukebox")]
|
||||
@scene.pbStartScene(commands)
|
||||
loop do
|
||||
cmd = @scene.pbScene
|
||||
if cmd<0
|
||||
if cmd < 0
|
||||
break
|
||||
elsif cmdMap>=0 && cmd==cmdMap
|
||||
elsif cmdMap >= 0 && cmd == cmdMap
|
||||
pbFadeOutIn {
|
||||
scene = PokemonRegionMap_Scene.new(-1, false)
|
||||
screen = PokemonRegionMapScreen.new(scene)
|
||||
@@ -153,11 +153,11 @@ class PokemonPokegearScreen
|
||||
end
|
||||
}
|
||||
break if $game_temp.fly_destination
|
||||
elsif cmdPhone>=0 && cmd==cmdPhone
|
||||
elsif cmdPhone >= 0 && cmd == cmdPhone
|
||||
pbFadeOutIn {
|
||||
PokemonPhoneScene.new.start
|
||||
}
|
||||
elsif cmdJukebox>=0 && cmd==cmdJukebox
|
||||
elsif cmdJukebox >= 0 && cmd == cmdJukebox
|
||||
pbFadeOutIn {
|
||||
scene = PokemonJukebox_Scene.new
|
||||
screen = PokemonJukeboxScreen.new(scene)
|
||||
|
||||
Reference in New Issue
Block a user