move fusion menu fixes

This commit is contained in:
infinitefusion
2022-06-24 16:24:23 -04:00
parent 3606af7cd4
commit fa093a726a
19 changed files with 165 additions and 61 deletions

View File

@@ -1,16 +1,39 @@
class FusionMovesOptionsScene < PokemonOption_Scene
attr_accessor :move1
attr_accessor :move2
attr_accessor :move3
attr_accessor :move4
def initialize(poke1, poke2)
@poke1 = poke1
@poke2 = poke2
@move1 = nil
@move2 = nil
@move3 = nil
@move4 = nil
@move1 = @poke1.moves[0]
@move2 = @poke1.moves[1]
@move3 = @poke1.moves[2]
@move4 = @poke1.moves[3]
@index1=0
@index2=0
@index3=0
@index4=0
@selBaseColor = Color.new(48,96,216)
@selShadowColor = Color.new(32,32,32)
end
def initUIElements
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL(""), 0, 0, Graphics.width, 64, @viewport)
@sprites["textbox"] = pbCreateMessageWindow
@sprites["textbox"].letterbyletter = false
pbSetSystemFont(@sprites["textbox"].contents)
end
def pbStartScene(inloadscreen = false)
super
@typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types"))
@@ -26,14 +49,20 @@ class FusionMovesOptionsScene < PokemonOption_Scene
end
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("Select moves"), 0, 0, Graphics.width, 64, @viewport)
@sprites["textbox"].text = _INTL("Select moves")
@sprites["title"].setSkin("Graphics/Windowskins/invisible")
@sprites["option"].setSkin("Graphics/Windowskins/invisible")
@sprites["textbox"].setSkin("Graphics/Windowskins/invisible")
# @sprites["textbox"].text = _INTL("Select moves")
updateDescription(0)
pbFadeInAndShow(@sprites) { pbUpdate }
end
def draw_empty_move_info
# code here
end
def draw_move_info(pokemonMove)
move = GameData::Move.get(pokemonMove.id)
move_base_color = Color.new(50, 40, 230)
move_base_shadow = Color.new(14, 14, 114)
@@ -47,6 +76,12 @@ class FusionMovesOptionsScene < PokemonOption_Scene
damage = move.base_damage == 0 ? "-" : move.base_damage.to_s
accuracy = move.accuracy == 0 ? "100" : move.accuracy.to_s
pp = move.total_pp.to_s
if !move
damage="-"
accuracy="-"
pp="-"
end
textpos = [
[_INTL("Type"), 20, 84, 0, label_base_color, label_shadow_color],
@@ -59,7 +94,7 @@ class FusionMovesOptionsScene < PokemonOption_Scene
[_INTL("{1}%", accuracy), 140, 180, 0, value_base_color, value_shadow_color],
[_INTL("PP"), 20, 212, 0, label_base_color, label_shadow_color], #move.total_pp
[_INTL("{1}", move.total_pp.to_s), 140, 212, 0, value_base_color, value_shadow_color] #move.total_pp
[_INTL("{1}", pp), 140, 212, 0, value_base_color, value_shadow_color] #move.total_pp
]
imagepos = []
@@ -69,7 +104,9 @@ class FusionMovesOptionsScene < PokemonOption_Scene
category = move.category
imagepos.push(["Graphics/Pictures/types", 120, 94, 0, type_number * 28, 64, 28]) #248
imagepos.push(["Graphics/Pictures/category", 120, 124, 0, category * 28, 64, 28])
if !move
imagepos=[]
end
@sprites["overlay"].bitmap.clear
pbDrawTextPositions(@sprites["overlay"].bitmap, textpos)
pbDrawImagePositions(@sprites["overlay"].bitmap, imagepos)
@@ -101,6 +138,10 @@ class FusionMovesOptionsScene < PokemonOption_Scene
end
end
def getDefaultDescription
return _INTL("No move selected")
end
def getMoveForIndex(index)
case index
when 0
@@ -121,13 +162,13 @@ class FusionMovesOptionsScene < PokemonOption_Scene
end
def getMoveName(move)
return "" if !@sprites["option"] && !move
return " - " if !@sprites["option"] && !move
move = @poke1.moves[@sprites["option"].index] if !move
return GameData::Move.get(move.id).real_name
end
def getMoveDescription(move)
return "" if !@sprites["option"] && !move
return " - " if !@sprites["option"] && !move
move = @poke1.moves[@sprites["option"].index] if !move
return GameData::Move.get(move.id).real_description
end
@@ -137,28 +178,63 @@ class FusionMovesOptionsScene < PokemonOption_Scene
EnumOption.new(_INTL(""), [_INTL(getMoveName(@poke1.moves[0])), _INTL(getMoveName(@poke2.moves[0]))],
proc { 0 },
proc { |value|
@move1 = value == 1 ? @poke1.moves[0] : @poke2.moves[0]
@move1 = value == 0 ? @poke1.moves[0] : @poke2.moves[0]
}, [getMoveDescription(@poke1.moves[0]), getMoveDescription(@poke2.moves[0])]
),
EnumOption.new(_INTL(""), [_INTL(getMoveName(@poke1.moves[1])), _INTL(getMoveName(@poke2.moves[1]))],
proc { 0 },
proc { |value|
@move2 = value == 1 ? @poke1.moves[1] : @poke2.moves[1]
@move2 = value == 0 ? @poke1.moves[1] : @poke2.moves[1]
}, [getMoveDescription(@poke1.moves[1]), getMoveDescription(@poke2.moves[1])]
),
EnumOption.new(_INTL(""), [_INTL(getMoveName(@poke1.moves[2])), _INTL(getMoveName(@poke2.moves[2]))],
proc { 0 },
proc { |value|
@move3 = value == 1 ? @poke1.moves[2] : @poke2.moves[2]
@move3 = value == 0 ? @poke1.moves[2] : @poke2.moves[2]
}, [getMoveDescription(@poke1.moves[2]), getMoveDescription(@poke2.moves[2])]
),
EnumOption.new(_INTL(""), [_INTL(getMoveName(@poke1.moves[3])), _INTL(getMoveName(@poke2.moves[3]))],
proc { 0 },
proc { |value|
@move4 = value == 1 ? @poke1.moves[3] : @poke2.moves[3]
@move4 = value == 0 ? @poke1.moves[3] : @poke2.moves[3]
}, [getMoveDescription(@poke1.moves[3]), getMoveDescription(@poke2.moves[3])]
)
]
return options
end
def isConfirmedOnKeyPress
return true
end
def initOptionsWindow
optionsWindow = Window_PokemonOptionFusionMoves.new(@PokemonOptions, 0,
@sprites["title"].height, Graphics.width,
Graphics.height - @sprites["title"].height - @sprites["textbox"].height)
optionsWindow.viewport = @viewport
optionsWindow.visible = true
return optionsWindow
end
end
class Window_PokemonOptionFusionMoves < Window_PokemonOption
def initialize(options, x, y, width, height)
super
@mustUpdateOptions=true
@mustUpdateDescription=true
@confirmed=false
end
def drawCursor(index,rect)
if self.index==index
pbCopyBitmap(self.contents, @selarrow.bitmap,rect.x+175,rect.y)
end
return Rect.new(rect.x+16,rect.y,rect.width-16,rect.height)
end
def dont_draw_item(index)
return index == @options.length
end
end