Moved all settings into module Settings

This commit is contained in:
Maruno17
2021-02-01 21:03:58 +00:00
parent 923844fdc7
commit 1209b804e9
88 changed files with 848 additions and 839 deletions

View File

@@ -449,7 +449,7 @@ DebugMenuCommands.register("additem", {
pbListScreenBlock(_INTL("ADD ITEM"), ItemLister.new) { |button, item|
if button == Input::C && item
params = ChooseNumberParams.new
params.setRange(1, BAG_MAX_PER_SLOT)
params.setRange(1, Settings::BAG_MAX_PER_SLOT)
params.setInitialValue(1)
params.setCancelValue(0)
qty = pbMessageChooseNumber(_INTL("Add how many {1}?",
@@ -469,7 +469,7 @@ DebugMenuCommands.register("fillbag", {
"description" => _INTL("Add a certain number of every item to the Bag."),
"effect" => proc {
params = ChooseNumberParams.new
params.setRange(1, BAG_MAX_PER_SLOT)
params.setRange(1, Settings::BAG_MAX_PER_SLOT)
params.setInitialValue(1)
params.setCancelValue(0)
qty = pbMessageChooseNumber(_INTL("Choose the number of items."), params)
@@ -613,7 +613,7 @@ DebugMenuCommands.register("fillboxes", {
end
# Add Pokémon (if form 0)
next if f != 0
if added >= NUM_STORAGE_BOXES * box_qty
if added >= Settings::NUM_STORAGE_BOXES * box_qty
completed = false
next
end
@@ -622,7 +622,8 @@ DebugMenuCommands.register("fillboxes", {
end
pbMessage(_INTL("Storage boxes were filled with one Pokémon of each species."))
if !completed
pbMessage(_INTL("Note: The number of storage spaces ({1} boxes of {2}) is less than the number of species.", NUM_STORAGE_BOXES, box_qty))
pbMessage(_INTL("Note: The number of storage spaces ({1} boxes of {2}) is less than the number of species.",
Settings::NUM_STORAGE_BOXES, box_qty))
end
}
})
@@ -695,7 +696,7 @@ DebugMenuCommands.register("setmoney", {
"description" => _INTL("Edit how much money you have."),
"effect" => proc {
params = ChooseNumberParams.new
params.setRange(0, MAX_MONEY)
params.setRange(0, Settings::MAX_MONEY)
params.setDefaultValue($Trainer.money)
$Trainer.money = pbMessageChooseNumber(_INTL("Set the player's money."), params)
pbMessage(_INTL("You now have ${1}.", $Trainer.money.to_s_formatted))
@@ -708,7 +709,7 @@ DebugMenuCommands.register("setcoins", {
"description" => _INTL("Edit how many Game Corner Coins you have."),
"effect" => proc {
params = ChooseNumberParams.new
params.setRange(0, MAX_COINS)
params.setRange(0, Settings::MAX_COINS)
params.setDefaultValue($PokemonGlobal.coins)
$PokemonGlobal.coins = pbMessageChooseNumber(_INTL("Set the player's Coin amount."), params)
pbMessage(_INTL("You now have {1} Coins.", $PokemonGlobal.coins.to_s_formatted))
@@ -746,7 +747,7 @@ DebugMenuCommands.register("dexlists", {
loop do
dexescmds = []
dexescmds.push(_INTL("Have Pokédex: {1}", $Trainer.pokedex ? "[YES]" : "[NO]"))
d = pbDexNames
d = Settings.pokedex_names
for i in 0...d.length
name = d[i]
name = name[0] if name.is_a?(Array)
@@ -816,7 +817,7 @@ DebugMenuCommands.register("renameplayer", {
"name" => _INTL("Set Player Name"),
"description" => _INTL("Rename the player."),
"effect" => proc {
trname = pbEnterPlayerName("Your name?", 0, MAX_PLAYER_NAME_SIZE, $Trainer.name)
trname = pbEnterPlayerName("Your name?", 0, Settings::MAX_PLAYER_NAME_SIZE, $Trainer.name)
if trname == "" && pbConfirmMessage(_INTL("Give yourself a default name?"))
trainertype = $Trainer.trainer_type
gender = pbGetTrainerTypeGender(trainertype)

View File

@@ -373,7 +373,7 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand
end
def roamerCount
return ROAMING_SPECIES.length
return Settings::ROAMING_SPECIES.length
end
def itemCount
@@ -405,7 +405,7 @@ class SpriteWindow_DebugRoamers < Window_DrawableCommand
# Advance roaming
self.shadowtext(_INTL("[Clear all current roamer locations]"),rect.x,text_y,nameWidth,rect.height)
else
pkmn = ROAMING_SPECIES[index]
pkmn = Settings::ROAMING_SPECIES[index]
name = GameData::Species.get(pkmn[0]).name + " (Lv. #{pkmn[1]})"
status = ""
statuscolor = 0
@@ -480,7 +480,7 @@ def pbDebugRoamers
if cmdwindow.index<cmdwindow.roamerCount
pbPlayDecisionSE
# Toggle through roaming, not roaming, defeated
pkmn = ROAMING_SPECIES[cmdwindow.index]
pkmn = Settings::ROAMING_SPECIES[cmdwindow.index]
if pkmn[2]>0 && !$game_switches[pkmn[2]]
# not roaming -> roaming
$game_switches[pkmn[2]] = true
@@ -500,7 +500,7 @@ def pbDebugRoamers
end
cmdwindow.refresh
elsif cmdwindow.index==cmdwindow.itemCount-2 # All roam
if ROAMING_SPECIES.length==0
if Settings::ROAMING_SPECIES.length==0
pbPlayBuzzerSE
else
pbPlayDecisionSE
@@ -509,11 +509,11 @@ def pbDebugRoamers
cmdwindow.refresh
end
else # Clear all roaming locations
if ROAMING_SPECIES.length==0
if Settings::ROAMING_SPECIES.length==0
pbPlayBuzzerSE
else
pbPlayDecisionSE
for i in 0...ROAMING_SPECIES.length
for i in 0...Settings::ROAMING_SPECIES.length
$PokemonGlobal.roamPosition[i] = nil
end
$PokemonGlobal.roamedAlready = false
@@ -638,7 +638,7 @@ def pbCompileTextUI
begin
pbCompileText
pbMessageDisplay(msgwindow,_INTL("Successfully compiled text and saved it to intl.dat.\1"))
pbMessageDisplay(msgwindow,_INTL("To use the file in a game, place the file in the Data folder under a different name, and edit the LANGUAGES array in the Settings script."))
pbMessageDisplay(msgwindow,_INTL("To use the file in a game, place the file in the Data folder under a different name, and edit the Settings::LANGUAGES array in the scripts."))
rescue RuntimeError
pbMessageDisplay(msgwindow,_INTL("Failed to compile text: {1}",$!.message))
end

View File

@@ -918,7 +918,7 @@ PokemonDebugMenuCommands.register("ownership", {
when 0 # Make player's
pkmn.owner = Pokemon::Owner.new_from_trainer($Trainer)
when 1 # Set OT's name
pkmn.owner.name = pbEnterPlayerName(_INTL("{1}'s OT's name?", pkmn.name), 1, MAX_PLAYER_NAME_SIZE)
pkmn.owner.name = pbEnterPlayerName(_INTL("{1}'s OT's name?", pkmn.name), 1, Settings::MAX_PLAYER_NAME_SIZE)
when 2 # Set OT's gender
cmd2 = screen.pbShowCommands(_INTL("Set OT's gender."),
[_INTL("Male"), _INTL("Female"), _INTL("Unknown")], pkmn.owner.gender)
@@ -958,7 +958,7 @@ PokemonDebugMenuCommands.register("setegg", {
when 0 # Make egg
if !pkmn.egg? && (pbHasEgg?(pkmn.species) ||
screen.pbConfirm(_INTL("{1} cannot legally be an egg. Make egg anyway?", pkmn.speciesName)))
pkmn.level = EGG_LEVEL
pkmn.level = Settings::EGG_LEVEL
pkmn.calcStats
pkmn.name = _INTL("Egg")
pkmn.steps_to_hatch = pkmn.species_data.hatch_steps