basic ui for new fusion move selection menu

This commit is contained in:
infinitefusion
2022-06-22 21:45:48 -04:00
parent 94ef983ba8
commit 3606af7cd4
19 changed files with 212 additions and 20 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -184,6 +184,7 @@ end
class Window_PokemonOption < Window_DrawableCommand
attr_reader :mustUpdateOptions
attr_reader :mustUpdateDescription
attr_reader :selected_position
def initialize(options, x, y, width, height)
@previous_Index=0
@@ -195,6 +196,7 @@ class Window_PokemonOption < Window_DrawableCommand
@optvalues = []
@mustUpdateOptions = false
@mustUpdateDescription = false
@selected_position=0
for i in 0...@options.length
@optvalues[i] = 0
end
@@ -300,12 +302,16 @@ class Window_PokemonOption < Window_DrawableCommand
if self.active && self.index < @options.length
if Input.repeat?(Input::LEFT)
self[self.index] = @options[self.index].prev(self[self.index])
dorefresh = true
dorefresh =
@selected_position=self[self.index]
@mustUpdateOptions = true
@mustUpdateDescription=true
elsif Input.repeat?(Input::RIGHT)
self[self.index] = @options[self.index].next(self[self.index])
dorefresh = true
@selected_position=self[self.index]
@mustUpdateOptions = true
@mustUpdateDescription=true
end
end
refresh if dorefresh
@@ -359,10 +365,23 @@ class PokemonOption_Scene
pbDeactivateWindows(@sprites)
pbFadeInAndShow(@sprites) { pbUpdate }
end
def updateDescription(index)
index=0 if !index
begin
new_description = @PokemonOptions[index].description
horizontal_position = @sprites["option"].selected_position
optionDescription = @PokemonOptions[index].description
if optionDescription.is_a?(Array)
if horizontal_position < optionDescription.size
new_description = optionDescription[horizontal_position]
else
new_description = getDefaultDescription
end
else
new_description = optionDescription
end
new_description = getDefaultDescription if new_description == ""
@sprites["textbox"].text = _INTL(new_description)
rescue
@@ -459,13 +478,15 @@ class PokemonOption_Scene
options << EnumOption.new(_INTL("Battle Style"), [_INTL("Switch"), _INTL("Set")],
proc { $PokemonSystem.battlestyle },
proc { |value| $PokemonSystem.battlestyle = value },
"Prompts to switch Pokémon before the opponent sends out the next one"
["Prompts to switch Pokémon before the opponent sends out the next one",
"No prompt to switch Pokémon before the opponent sends the next one"]
)
options << EnumOption.new(_INTL("Default Movement"), [_INTL("Walking"), _INTL("Running")],
proc { $PokemonSystem.runstyle },
proc { |value| $PokemonSystem.runstyle = value },
"Sets the movements when not holding the Run key"
["Default to walking when not holding the Run key",
"Default to running when not holding the Run key"]
)
options << NumberOption.new(_INTL("Speech Frame"), 1, Settings::SPEECH_WINDOWSKINS.length,
@@ -485,7 +506,8 @@ class PokemonOption_Scene
options << EnumOption.new(_INTL("Text Entry"), [_INTL("Cursor"), _INTL("Keyboard")],
proc { $PokemonSystem.textinput },
proc { |value| $PokemonSystem.textinput = value },
"Enter text by selecting letters or by typing on the keyboard"
["Enter text by selecting letters on the screen",
"Enter text by typing on the keyboard"]
)
EnumOption.new(_INTL("Screen Size"), [_INTL("S"), _INTL("M"), _INTL("L"), _INTL("XL"), _INTL("Full")],
proc { [$PokemonSystem.screensize, 4].min },

View File

@@ -0,0 +1,164 @@
class FusionMovesOptionsScene < PokemonOption_Scene
def initialize(poke1, poke2)
@poke1 = poke1
@poke2 = poke2
@move1 = nil
@move2 = nil
@move3 = nil
@move4 = nil
end
def pbStartScene(inloadscreen = false)
super
@typebitmap = AnimatedBitmap.new(_INTL("Graphics/Pictures/types"))
@sprites["overlay"] = BitmapSprite.new(Graphics.width, Graphics.height, @viewport)
@sprites["overlay"].z = 9999
pbSetSystemFont(@sprites["overlay"].bitmap)
@sprites["option"].nameBaseColor = Color.new(35, 130, 200)
@sprites["option"].nameShadowColor = Color.new(20, 75, 115)
@changedColor = true
for i in 0...@PokemonOptions.length
@sprites["option"][i] = (@PokemonOptions[i].get || 0)
end
@sprites["title"] = Window_UnformattedTextPokemon.newWithSize(
_INTL("Select moves"), 0, 0, Graphics.width, 64, @viewport)
@sprites["textbox"].text = _INTL("Select moves")
pbFadeInAndShow(@sprites) { pbUpdate }
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)
label_base_color = Color.new(248, 248, 248)
label_shadow_color = Color.new(104, 104, 104)
value_base_color = Color.new(248, 248, 248)
value_shadow_color = Color.new(104, 104, 104)
@sprites["title"].text = _INTL("{1}", move.real_name)
damage = move.base_damage == 0 ? "-" : move.base_damage.to_s
accuracy = move.accuracy == 0 ? "100" : move.accuracy.to_s
textpos = [
[_INTL("Type"), 20, 84, 0, label_base_color, label_shadow_color],
[_INTL("Category"), 20, 116, 0, label_base_color, label_shadow_color],
[_INTL("Power"), 20, 148, 0, label_base_color, label_shadow_color],
[_INTL("{1}", damage), 140, 148, 0, value_base_color, value_shadow_color],
[_INTL("Accuracy"), 20, 180, 0, label_base_color, label_shadow_color],
[_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
]
imagepos = []
yPos = 90
type_number = GameData::Type.get(move.type).id_number
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])
@sprites["overlay"].bitmap.clear
pbDrawTextPositions(@sprites["overlay"].bitmap, textpos)
pbDrawImagePositions(@sprites["overlay"].bitmap, imagepos)
end
def draw_pokemon_type
type1_number = GameData::Type.get(@poke1.type1).id_number
type2_number = GameData::Type.get(@poke1.type2).id_number
type1rect = Rect.new(0, type1_number * 28, 64, 28)
type2rect = Rect.new(0, type2_number * 28, 64, 28)
if @poke1.type1 == @poke1.type2
overlay.blt(130, 78, @typebitmap.bitmap, type1rect)
else
overlay.blt(96, 78, @typebitmap.bitmap, type1rect)
overlay.blt(166, 78, @typebitmap.bitmap, type2rect)
end
end
def updateDescription(index)
index = 0 if !index
begin
move = getMoveForIndex(index)
draw_move_info(move)
new_description = getMoveDescription(move)
@sprites["textbox"].text = _INTL(new_description)
rescue
@sprites["textbox"].text = getDefaultDescription
end
end
def getMoveForIndex(index)
case index
when 0
return @move1
when 1
return @move2
when 2
return @move3
when 3
return @move4
end
return nil
end
def pbFadeInAndShow(sprites, visiblesprites = nil)
return if !@changedColor
super
end
def getMoveName(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
move = @poke1.moves[@sprites["option"].index] if !move
return GameData::Move.get(move.id).real_description
end
def pbGetOptions(inloadscreen = false)
options = [
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]
}, [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]
}, [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]
}, [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]
}, [getMoveDescription(@poke1.moves[3]), getMoveDescription(@poke2.moves[3])]
)
]
return options
end
end

View File

@@ -747,21 +747,27 @@ class PokemonFusionScene
end
def setFusionMoves(fusedPoke, poke2)
choice = Kernel.pbMessage("What to do with the moveset?", [_INTL("Learn moves"), _INTL("Keep {1}'s moveset", fusedPoke.name), _INTL("Keep {1}'s moveset", poke2.name)], 0)
if choice == 1
return
elsif choice == 2
fusedPoke.moves = poke2.moves
return
else
#Learn moves
movelist = poke2.moves
for move in movelist
if move.id != 0
pbLearnMove(fusedPoke, move.id, true, false, true)
end
end
end
pbFadeOutIn {
scene = FusionMovesOptionsScene.new(fusedPoke,poke2)
screen = PokemonOptionScreen.new(scene)
screen.pbStartScreen
}
# choice = Kernel.pbMessage("What to do with the moveset?", [_INTL("Learn moves"), _INTL("Keep {1}'s moveset", fusedPoke.name), _INTL("Keep {1}'s moveset", poke2.name)], 0)
# if choice == 1
# return
# elsif choice == 2
# fusedPoke.moves = poke2.moves
# return
# else
# #Learn moves
# movelist = poke2.moves
# for move in movelist
# if move.id != 0
# pbLearnMove(fusedPoke, move.id, true, false, true)
# end
# end
# end
end
def setPokemonLevel(pokemon1, pokemon2, superSplicers)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.