attr_accessor :language
attr_accessor :custom
@PokemonOptions=[
EnumOption.new(_INTL("Custom"),[_INTL("On"),_INTL("Off")],
proc { $PokemonSystem.custom},
proc {|value| $PokemonSystem.custom=value }
),
proc { $game_variables[51] },
proc {|value| $game_variables[51]=value }
I tried doing that but it didn't work. I was able to do it with a variable though, so it's kind of the same.
in script PokemonOptions
below
Code:attr_accessor :language
add
Code:attr_accessor :custom
Then under
Code:@PokemonOptions=[
add
Code:EnumOption.new(_INTL("Custom"),[_INTL("On"),_INTL("Off")], proc { $PokemonSystem.custom}, proc {|value| $PokemonSystem.custom=value } ),
Then you can make an event like this
![]()
Or whatever you may need to do with it. If you choose "On" in Options, its value will be 0, and if you select "Off", it will be 1. You can name them whatever you want.
Note that I tried this first:
But it didn't work either.Code:proc { $game_variables[51] }, proc {|value| $game_variables[51]=value }
Hopefully someone with more expertise will post how to do it with a switch if this doesn't work for what you need.
attr_accessor :custom
def initialize
@textspeed = 1 # Text speed (0=slow, 1=mid, 2=fast)
@battlescene = 0 # Battle scene (animations) (0=on, 1=off)
@battlestyle = 0 # Battle style (0=shift, 1=set)
@frame = 0 # Default window frame (see also $TextFrames)
@textskin = 0 # Speech frame
@font = 0 # Font (see also $VersionStyles)
@screensize = (DEFAULTSCREENZOOM.floor).to_i # 0=half size, 1=full size, 2=double size
@language = 0 # Language (see also LANGUAGES in script PokemonSystem)
if $game_variables
@custom = 0
end
EnumOption.new(_INTL("Screen Size"),[_INTL("Small"),_INTL("Medium"),_INTL("Large")],
proc { $PokemonSystem.screensize },
proc {|value|
oldvalue=$PokemonSystem.screensize
$PokemonSystem.screensize=value
$ResizeOffsetX=0
$ResizeOffsetY=0
pbSetResizeFactor([0.5,1.0,2.0][value])
if value!=oldvalue
ObjectSpace.each_object(TilemapLoader){|o| next if o.disposed?; o.updateClass }
end
}
)
# ------------------------------------------------------------------------------
]
if $game_variables
@PokemonOptions.push(EnumOption.new(_INTL("Custom"),[_INTL("Zero"),_INTL("One")],
proc { $PokemonSystem.custom},
proc {|value|
$PokemonSystem.custom=value
$game_variables[XX]=value #XX is your chosen variable number
}
))
end
if value==0
$game_switches[XX]=true
else
$game_switches[XX]=false
end