Files
infinitefusion-e18/Data/Scripts/052_InfiniteFusion/System/Game Options/SystemOptions.rb
T
2026-07-10 15:42:06 -04:00

130 lines
5.9 KiB
Ruby

class SystemOptionsScene < PokemonOption_Scene
def initialize
@changedColor = false
end
def pbStartScene(inloadscreen = false)
super
@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("System & Audio Options"), 0, 0, Graphics.width, 64, @viewport)
@sprites["textbox"].text = _INTL("System & Audio options")
pbFadeInAndShow(@sprites) { pbUpdate }
end
def pbFadeInAndShow(sprites, visiblesprites = nil)
return if !@changedColor
super
end
def pbGetOptions(inloadscreen = false)
options = []
options << EnumOption.new(_INTL("Text Entry"), [_INTL("Cursor"), _INTL("Keyboard")],
proc { $PokemonSystem.textinput },
proc { |value| $PokemonSystem.textinput = value },
[_INTL("Enter text by selecting letters on the screen"),
_INTL("Enter text by typing on the keyboard")]
)
options << SliderOption.new(_INTL("Music Volume"), 0, 100, 1,
proc { $PokemonSystem.bgmvolume },
proc { |value|
if $PokemonSystem.bgmvolume != value
$PokemonSystem.bgmvolume = value
if $game_system.playing_bgm != nil# && !inloadscreen
playingBGM = $game_system.getPlayingBGM
$game_system.bgm_pause
$game_system.bgm_resume(playingBGM)
end
end
}, _INTL("Sets the volume for background music")
)
options << SliderOption.new(_INTL("SE Volume"), 0, 100, 1,
proc { $PokemonSystem.sevolume },
proc { |value|
if $PokemonSystem.sevolume != value
$PokemonSystem.sevolume = value
if $game_system.playing_bgs != nil
$game_system.playing_bgs.volume = value
playingBGS = $game_system.getPlayingBGS
$game_system.bgs_pause
$game_system.bgs_resume(playingBGS)
end
pbPlayCursorSE
end
}, _INTL("Sets the volume for sound effects")
)
options << EnumOption.new(_INTL("Text Speed"), [_INTL("Normal"), _INTL("Fast")],
proc { $PokemonSystem.textspeed },
proc { |value|
$PokemonSystem.textspeed = value
MessageConfig.pbSetTextSpeed(MessageConfig.pbSettingToTextSpeed(value))
}, _INTL("Sets the speed at which the text is displayed")
)
options << NumberOption.new(_INTL("Speech Frame"), 1, Settings::SPEECH_WINDOWSKINS.length,
proc { $PokemonSystem.textskin },
proc { |value|
$PokemonSystem.textskin = value
MessageConfig.pbSetSpeechFrame("Graphics/Windowskins/" + Settings::SPEECH_WINDOWSKINS[value])
}
)
options << EnumOption.new(_INTL("Screen Size"), [_INTL("S"), _INTL("M"), _INTL("L"), _INTL("XL"), _INTL("Full")],
proc { [$PokemonSystem.screensize, 4].min },
proc { |value|
if $PokemonSystem.screensize != value
$PokemonSystem.screensize = value
pbSetResizeFactor($PokemonSystem.screensize)
echoln $PokemonSystem.screensize
end
}, _INTL("Sets the size of the screen")
)
if $game_switches
options <<
EnumOption.new(_INTL("Autosave"), [_INTL("On"), _INTL("Off")],
proc { $game_switches[AUTOSAVE_ENABLED_SWITCH] ? 0 : 1 },
proc { |value|
if !$game_switches[AUTOSAVE_ENABLED_SWITCH] && value == 0
@autosave_menu = true
openAutosaveMenu()
end
$game_switches[AUTOSAVE_ENABLED_SWITCH] = value == 0
},
_INTL("Automatically saves when healing at Pokémon centers")
)
end
options <<
EnumOption.new(_INTL("Download data"), [_INTL("On"), _INTL("Off")],
proc { $PokemonSystem.download_sprites },
proc { |value|
$PokemonSystem.download_sprites = value
},
_INTL("Automatically download missing custom sprites and Pokédex entries from the internet")
)
device_option_selected = $PokemonSystem.on_mobile ? 1 : 0
options << EnumOption.new(_INTL("Device"), [_INTL("PC"), _INTL("Mobile")],
proc { device_option_selected },
proc { |value| $PokemonSystem.on_mobile = value == 1 },
[_INTL("The intended device on which to play the game."),
_INTL("Disables some options that aren't supported when playing on mobile.")]
)
return options
end
end