Nickname in fusion menu

This commit is contained in:
infinitefusion
2022-11-05 22:54:43 -04:00
parent e59254af3c
commit 55786e28fa
6 changed files with 65 additions and 25 deletions

View File

@@ -1,9 +1,11 @@
class FusionSelectOptionsScene < PokemonOption_Scene
attr_accessor :selectedAbility
attr_accessor :selectedNature
attr_accessor :hasNickname
attr_accessor :nickname
def initialize(abilityList,natureList)
def initialize(abilityList,natureList, pokemon1, pokemon2)
@abilityList = abilityList
@natureList = natureList
@selectedAbility=nil
@@ -11,6 +13,11 @@ class FusionSelectOptionsScene < PokemonOption_Scene
@selBaseColor = Color.new(48,96,216)
@selShadowColor = Color.new(32,32,32)
@show_frame=false
@hasNickname = false
@nickname = nil
@pokemon1=pokemon1
@pokemon2=pokemon2
end
@@ -49,23 +56,54 @@ class FusionSelectOptionsScene < PokemonOption_Scene
return _INTL("+ {1}\n- {2}",GameData::Stat.get(positiveChange[0]).name,GameData::Stat.get(negativeChange[0]).name)
end
def pbGetOptions(inloadscreen = false)
options = [
def shouldSelectNickname
if @pokemon1.nicknamed? && @pokemon2.nicknamed?
@hasNickname=true
return true
end
if @pokemon1.nicknamed? && !@pokemon2.nicknamed?
@hasNickname=true
@nickname = @pokemon1.name
return false
end
if !@pokemon1.nicknamed? && @pokemon2.nicknamed?
@hasNickname=true
@nickname = @pokemon2.name
return false
end
@hasNickname=false
return false
end
EnumOption.new(_INTL("Ability"), [_INTL(getAbilityName(@abilityList[0])), _INTL(getAbilityName(@abilityList[1]))],
def pbGetOptions(inloadscreen = false)
options = []
if shouldSelectNickname
options << EnumOption.new(_INTL("Nickname"), [_INTL(@pokemon1.name), _INTL(@pokemon2.name)],
proc { 0 },
proc { |value|
if value ==0
@nickname = @pokemon1.name
else
@nickname = @pokemon2.name
end
}, "Select the Pokémon's nickname")
end
options << EnumOption.new(_INTL("Ability"), [_INTL(getAbilityName(@abilityList[0])), _INTL(getAbilityName(@abilityList[1]))],
proc { 0 },
proc { |value|
@selectedAbility=@abilityList[value]
}, [getAbilityDescription(@abilityList[0]), getAbilityDescription(@abilityList[1])]
),
EnumOption.new(_INTL("Nature"), [_INTL(getNatureName(@natureList[0])), _INTL(getNatureName(@natureList[1]))],
)
options << EnumOption.new(_INTL("Nature"), [_INTL(getNatureName(@natureList[0])), _INTL(getNatureName(@natureList[1]))],
proc { 0 },
proc { |value|
@selectedNature=@natureList[value]
}, [getNatureDescription(@natureList[0]), getNatureDescription(@natureList[1])]
)
]
return options
end