diff --git a/Data/Scripts/001_Technical/002_Files/001_FileTests.rb b/Data/Scripts/001_Technical/002_Files/001_FileTests.rb index 2ad061d9a..e47d86d42 100644 --- a/Data/Scripts/001_Technical/002_Files/001_FileTests.rb +++ b/Data/Scripts/001_Technical/002_Files/001_FileTests.rb @@ -317,7 +317,7 @@ end # NOTE: load_data checks anything added in MKXP's RTP setting, and matching # mount points added through System.mount. def pbRgssOpen(file, mode = nil) - # File.open("debug.txt","ab") { |fw| fw.write([file,mode,Time.now.to_f].inspect+"\r\n") } + # File.open("debug.txt", "ab") { |fw| fw.write([file, mode, Time.now.to_f].inspect + "\r\n") } if !safeExists?("./Game.rgssad") if block_given? File.open(file, mode) { |f| yield f } diff --git a/Data/Scripts/001_Technical/003_Intl_Messages.rb b/Data/Scripts/001_Technical/003_Intl_Messages.rb index 3a8d01416..3583e8c02 100644 --- a/Data/Scripts/001_Technical/003_Intl_Messages.rb +++ b/Data/Scripts/001_Technical/003_Intl_Messages.rb @@ -284,8 +284,8 @@ module Translator f.write(0xEF.chr) f.write(0xBB.chr) f.write(0xBF.chr) - f.write("# To localize this text for a particular language, please\r\n") - f.write("# translate every second line of this file.\r\n") + f.write("# To localize this text for a particular language, please" + "\r\n") + f.write("# translate every second line of this file." + "\r\n") f.write("\#-------------------------------\r\n") if with_line end # Extract the text diff --git a/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb b/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb index a27a34a9a..3861bd6d9 100644 --- a/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb +++ b/Data/Scripts/011_Battle/004_Scene/002_Scene_Initialize.rb @@ -104,24 +104,24 @@ class Battle::Scene messageFilename = @battle.backdrop if time trialName = sprintf("%s_%s", backdropFilename, time) - if pbResolveBitmap(sprintf("Graphics/Battlebacks/" + trialName + "_bg")) + if pbResolveBitmap(sprintf("Graphics/Battlebacks/%s_bg", trialName)) backdropFilename = trialName end trialName = sprintf("%s_%s", baseFilename, time) - if pbResolveBitmap(sprintf("Graphics/Battlebacks/" + trialName + "_base0")) + if pbResolveBitmap(sprintf("Graphics/Battlebacks/%s_base0", trialName)) baseFilename = trialName end trialName = sprintf("%s_%s", messageFilename, time) - if pbResolveBitmap(sprintf("Graphics/Battlebacks/" + trialName + "_message")) + if pbResolveBitmap(sprintf("Graphics/Battlebacks/%s_message", trialName)) messageFilename = trialName end end - if !pbResolveBitmap(sprintf("Graphics/Battlebacks/" + baseFilename + "_base0")) && + if !pbResolveBitmap(sprintf("Graphics/Battlebacks/%s_base0", baseFilename)) && @battle.backdropBase baseFilename = @battle.backdropBase if time trialName = sprintf("%s_%s", baseFilename, time) - if pbResolveBitmap(sprintf("Graphics/Battlebacks/" + trialName + "_base0")) + if pbResolveBitmap(sprintf("Graphics/Battlebacks/%s_base0", trialName)) baseFilename = trialName end end diff --git a/Data/Scripts/011_Battle/007_Other battle types/004_BattleArenaBattle.rb b/Data/Scripts/011_Battle/007_Other battle types/004_BattleArenaBattle.rb index 4d166dfdc..9b4109f64 100644 --- a/Data/Scripts/011_Battle/007_Other battle types/004_BattleArenaBattle.rb +++ b/Data/Scripts/011_Battle/007_Other battle types/004_BattleArenaBattle.rb @@ -241,9 +241,9 @@ class Battle::Scene [_INTL("Mind"), 144, 54, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)], [_INTL("Skill"), 144, 86, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)], [_INTL("Body"), 144, 118, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)], - [sprintf("%d", total1), 64, 166, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)], + [total1.to_s, 64, 166, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)], [_INTL("Judgment"), 144, 166, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)], - [sprintf("%d", total2), 224, 166, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)] + [total2.to_s, 224, 166, 2, Color.new(72, 72, 72), Color.new(208, 208, 200)] ] pbDrawTextPositions(window.contents, textpos) images = [] diff --git a/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb b/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb index 2be66888c..ce2c3c841 100644 --- a/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb +++ b/Data/Scripts/012_Overworld/001_Overworld visuals/003_Overworld_MapTransitionAnims.rb @@ -88,9 +88,11 @@ def pbStartOver(gameover = false) $player.heal_party if $PokemonGlobal.pokecenterMapId && $PokemonGlobal.pokecenterMapId >= 0 if gameover - pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]After the unfortunate defeat, you scurry back to a Pokémon Center.")) + pbMessage("\\w[]\\wm\\c[8]\\l[3]" + + _INTL("After the unfortunate defeat, you scurry back to a Pokémon Center.")) else - pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]You scurry back to a Pokémon Center, protecting your exhausted Pokémon from any further harm...")) + pbMessage("\\w[]\\wm\\c[8]\\l[3]" + + _INTL("You scurry back to a Pokémon Center, protecting your exhausted Pokémon from any further harm...")) end pbCancelVehicles Followers.clear @@ -113,9 +115,11 @@ def pbStartOver(gameover = false) return end if gameover - pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]After the unfortunate defeat, you scurry back home.")) + pbMessage("\\w[]\\wm\\c[8]\\l[3]" + + _INTL("After the unfortunate defeat, you scurry back home.")) else - pbMessage(_INTL("\\w[]\\wm\\c[8]\\l[3]You scurry back home, protecting your exhausted Pokémon from any further harm...")) + pbMessage("\\w[]\\wm\\c[8]\\l[3]" + + _INTL("You scurry back home, protecting your exhausted Pokémon from any further harm...")) end if homedata pbCancelVehicles diff --git a/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb b/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb index cdbea7723..04dc25792 100644 --- a/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb +++ b/Data/Scripts/012_Overworld/005_Overworld_Fishing.rb @@ -56,7 +56,7 @@ def pbFishing(hasEncounter, rodType = 1) if hasEncounter && rand(100) < biteChance $scene.spriteset.addUserAnimation(Settings::EXCLAMATION_ANIMATION_ID, $game_player.x, $game_player.y, true, 3) frames = Graphics.frame_rate - rand(Graphics.frame_rate / 2) # 0.5-1 second - if !pbWaitForInput(msgWindow, message + _INTL("\r\nOh! A bite!"), frames) + if !pbWaitForInput(msgWindow, message + "\r\n" + _INTL("Oh! A bite!"), frames) pbFishingEnd { pbMessageDisplay(msgWindow, _INTL("The Pokémon got away...")) } break end diff --git a/Data/Scripts/013_Items/001_Item_Utilities.rb b/Data/Scripts/013_Items/001_Item_Utilities.rb index df70d1125..8062f7f0e 100644 --- a/Data/Scripts/013_Items/001_Item_Utilities.rb +++ b/Data/Scripts/013_Items/001_Item_Utilities.rb @@ -591,7 +591,7 @@ def pbLearnMove(pkmn, move, ignore_if_known = false, by_machine = false, &block) return false elsif pkmn.numMoves < Pokemon::MAX_MOVES pkmn.learn_move(move) - pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]", pkmn_name, move_name), &block) + pbMessage("\\se[]" + _INTL("{1} learned {2}!\\se[Pkmn move learnt]", pkmn_name, move_name), &block) return true end pbMessage(_INTL("{1} wants to learn {2}, but it already knows {3} moves.\1", @@ -608,7 +608,7 @@ def pbLearnMove(pkmn, move, ignore_if_known = false, by_machine = false, &block) end pbMessage(_INTL("1, 2, and...\\wt[16] ...\\wt[16] ...\\wt[16] Ta-da!\\se[Battle ball drop]\1"), &block) pbMessage(_INTL("{1} forgot how to use {2}.\\nAnd...\1", pkmn_name, old_move_name), &block) - pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]", pkmn_name, move_name), &block) + pbMessage("\\se[]" + _INTL("{1} learned {2}!\\se[Pkmn move learnt]", pkmn_name, move_name), &block) pkmn.changeHappiness("machine") if by_machine return true elsif pbConfirmMessage(_INTL("Give up on learning {1}?", move_name), &block) diff --git a/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb b/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb index 316dacbf3..8c401e24b 100644 --- a/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb +++ b/Data/Scripts/014_Pokemon/001_Pokemon-related/001_FormHandlers.rb @@ -255,7 +255,7 @@ MultipleForms.register(:ROTOM, { pkmn.moves[old_move_index].id = new_move_id new_move_name = pkmn.moves[old_move_index].name pbMessage(_INTL("{1} forgot {2}...\1", pkmn.name, old_move_name)) - pbMessage(_INTL("\\se[]{1} learned {2}!\\se[Pkmn move learnt]\1", pkmn.name, new_move_name)) + pbMessage("\\se[]" + _INTL("{1} learned {2}!\\se[Pkmn move learnt]\1", pkmn.name, new_move_name)) end elsif !new_move_id.nil? # Just learn the new move diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb b/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb index eebf4a48d..c5cce55c4 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/003_UI_EggHatching.rb @@ -99,7 +99,7 @@ class PokemonEggHatch_Scene pbBGMStop pbMEPlay("Evolution success") @pokemon.name = nil - pbMessage(_INTL("\\se[]{1} hatched from the Egg!\\wt[80]", @pokemon.name)) { update } + pbMessage("\\se[]" + _INTL("{1} hatched from the Egg!\\wt[80]", @pokemon.name)) { update } # Record the Pokémon's species as owned in the Pokédex was_owned = $player.owned?(@pokemon.species) $player.pokedex.register(@pokemon) diff --git a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb index 87e2dd73d..0e10ba0e4 100644 --- a/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb +++ b/Data/Scripts/016_UI/001_Non-interactive UI/004_UI_Evolution.rb @@ -591,7 +591,7 @@ class PokemonEvolutionScene pbMEPlay("Evolution success") newspeciesname = GameData::Species.get(@newspecies).name pbMessageDisplay(@sprites["msgwindow"], - _INTL("\\se[]Congratulations! Your {1} evolved into {2}!\\wt[80]", + "\\se[]" + _INTL("Congratulations! Your {1} evolved into {2}!\\wt[80]", @pokemon.name, newspeciesname)) { pbUpdate } @sprites["msgwindow"].text = "" # Check for consumed item and check if Pokémon should be duplicated diff --git a/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb b/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb index 72328430d..1ae27445c 100644 --- a/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb +++ b/Data/Scripts/016_UI/002_UI_Pokedex_Menu.rb @@ -18,9 +18,9 @@ class Window_DexesList < Window_CommandPokemon super(index, count, rect) if index >= 0 && index < @commands2.length pbDrawShadowText(self.contents, rect.x + 254, rect.y, 64, rect.height, - sprintf("%d", @commands2[index][0]), self.baseColor, self.shadowColor, 1) + @commands2[index][0].to_s, self.baseColor, self.shadowColor, 1) pbDrawShadowText(self.contents, rect.x + 350, rect.y, 64, rect.height, - sprintf("%d", @commands2[index][1]), self.baseColor, self.shadowColor, 1) + @commands2[index][1].to_s, self.baseColor, self.shadowColor, 1) allseen = (@commands2[index][0] >= @commands2[index][2]) allown = (@commands2[index][1] >= @commands2[index][2]) pbDrawImagePositions( diff --git a/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb b/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb index 7f9afac2a..397d37a16 100644 --- a/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb +++ b/Data/Scripts/016_UI/004_UI_Pokedex_Entry.rb @@ -376,7 +376,7 @@ class PokemonPokedexInfo_Scene if points.length == 0 pbDrawImagePositions( overlay, - [[sprintf("Graphics/UI/Pokedex/overlay_areanone"), 108, 188]] + [["Graphics/UI/Pokedex/overlay_areanone", 108, 188]] ) textpos.push([_INTL("Area unknown"), Graphics.width / 2, (Graphics.height / 2) + 6, 2, base, shadow]) end diff --git a/Data/Scripts/016_UI/006_UI_Summary.rb b/Data/Scripts/016_UI/006_UI_Summary.rb index 6c79f1fad..f432f50a8 100644 --- a/Data/Scripts/016_UI/006_UI_Summary.rb +++ b/Data/Scripts/016_UI/006_UI_Summary.rb @@ -325,10 +325,10 @@ class PokemonSummary_Scene end # Show Pokérus cured icon if @pokemon.pokerusStage == 2 - imagepos.push([sprintf("Graphics/UI/Summary/icon_pokerus"), 176, 100]) + imagepos.push(["Graphics/UI/Summary/icon_pokerus", 176, 100]) end # Show shininess star - imagepos.push([sprintf("Graphics/UI/shiny"), 2, 134]) if @pokemon.shiny? + imagepos.push(["Graphics/UI/shiny", 2, 134]) if @pokemon.shiny? # Draw all images pbDrawImagePositions(overlay, imagepos) # Write various bits of text @@ -640,15 +640,15 @@ class PokemonSummary_Scene [_INTL("HP"), 292, 82, 2, base, statshadows[:HP]], [sprintf("%d/%d", @pokemon.hp, @pokemon.totalhp), 462, 82, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)], [_INTL("Attack"), 248, 126, 0, base, statshadows[:ATTACK]], - [sprintf("%d", @pokemon.attack), 456, 126, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)], + [@pokemon.attack.to_s, 456, 126, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)], [_INTL("Defense"), 248, 158, 0, base, statshadows[:DEFENSE]], - [sprintf("%d", @pokemon.defense), 456, 158, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)], + [@pokemon.defense.to_s, 456, 158, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)], [_INTL("Sp. Atk"), 248, 190, 0, base, statshadows[:SPECIAL_ATTACK]], - [sprintf("%d", @pokemon.spatk), 456, 190, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)], + [@pokemon.spatk.to_s, 456, 190, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)], [_INTL("Sp. Def"), 248, 222, 0, base, statshadows[:SPECIAL_DEFENSE]], - [sprintf("%d", @pokemon.spdef), 456, 222, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)], + [@pokemon.spdef.to_s, 456, 222, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)], [_INTL("Speed"), 248, 254, 0, base, statshadows[:SPEED]], - [sprintf("%d", @pokemon.speed), 456, 254, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)], + [@pokemon.speed.to_s, 456, 254, 1, Color.new(64, 64, 64), Color.new(176, 176, 176)], [_INTL("Ability"), 224, 290, 0, base, shadow] ] # Draw ability name and description diff --git a/Data/Scripts/016_UI/007_UI_Bag.rb b/Data/Scripts/016_UI/007_UI_Bag.rb index fc3d110c5..9df1b0190 100644 --- a/Data/Scripts/016_UI/007_UI_Bag.rb +++ b/Data/Scripts/016_UI/007_UI_Bag.rb @@ -258,13 +258,13 @@ class PokemonBag_Scene def pbRefresh # Set the background image - @sprites["background"].setBitmap(sprintf("Graphics/UI/Bag/bg_#{@bag.last_viewed_pocket}")) + @sprites["background"].setBitmap(sprintf("Graphics/UI/Bag/bg_%d", @bag.last_viewed_pocket)) # Set the bag sprite - fbagexists = pbResolveBitmap(sprintf("Graphics/UI/Bag/bag_#{@bag.last_viewed_pocket}_f")) + fbagexists = pbResolveBitmap(sprintf("Graphics/UI/Bag/bag_%d_f", @bag.last_viewed_pocket)) if $player.female? && fbagexists - @sprites["bagsprite"].setBitmap("Graphics/UI/Bag/bag_#{@bag.last_viewed_pocket}_f") + @sprites["bagsprite"].setBitmap(sprintf("Graphics/UI/Bag/bag_%d_f", @bag.last_viewed_pocket")) else - @sprites["bagsprite"].setBitmap("Graphics/UI/Bag/bag_#{@bag.last_viewed_pocket}") + @sprites["bagsprite"].setBitmap(sprintf("Graphics/UI/Bag/bag_%d", @bag.last_viewed_pocket)) end # Draw the pocket icons @sprites["pocketicon"].bitmap.clear diff --git a/Data/Scripts/016_UI/008_UI_Pokegear.rb b/Data/Scripts/016_UI/008_UI_Pokegear.rb index 07950eaea..9a6cc5889 100644 --- a/Data/Scripts/016_UI/008_UI_Pokegear.rb +++ b/Data/Scripts/016_UI/008_UI_Pokegear.rb @@ -14,7 +14,7 @@ class PokegearButton < Sprite @image = command[0] @name = command[1] @selected = false - if $player.female? && pbResolveBitmap(sprintf("Graphics/UI/Pokegear/icon_button_f")) + if $player.female? && pbResolveBitmap("Graphics/UI/Pokegear/icon_button_f") @button = AnimatedBitmap.new("Graphics/UI/Pokegear/icon_button_f") else @button = AnimatedBitmap.new("Graphics/UI/Pokegear/icon_button") @@ -49,7 +49,7 @@ class PokegearButton < Sprite ] pbDrawTextPositions(self.bitmap, textpos) imagepos = [ - [sprintf("Graphics/UI/Pokegear/icon_" + @image), 18, 10] + [sprintf("Graphics/UI/Pokegear/icon_%s", @image), 18, 10] ] pbDrawImagePositions(self.bitmap, imagepos) end @@ -73,7 +73,7 @@ class PokemonPokegear_Scene @viewport.z = 99999 @sprites = {} @sprites["background"] = IconSprite.new(0, 0, @viewport) - if $player.female? && pbResolveBitmap(sprintf("Graphics/UI/Pokegear/bg_f")) + if $player.female? && pbResolveBitmap("Graphics/UI/Pokegear/bg_f") @sprites["background"].setBitmap("Graphics/UI/Pokegear/bg_f") else @sprites["background"].setBitmap("Graphics/UI/Pokegear/bg") diff --git a/Data/Scripts/016_UI/012_UI_TrainerCard.rb b/Data/Scripts/016_UI/012_UI_TrainerCard.rb index e06641060..a06e45686 100644 --- a/Data/Scripts/016_UI/012_UI_TrainerCard.rb +++ b/Data/Scripts/016_UI/012_UI_TrainerCard.rb @@ -10,13 +10,13 @@ class PokemonTrainerCard_Scene @viewport = Viewport.new(0, 0, Graphics.width, Graphics.height) @viewport.z = 99999 @sprites = {} - background = pbResolveBitmap(sprintf("Graphics/UI/Trainer Card/bg_f")) + background = pbResolveBitmap("Graphics/UI/Trainer Card/bg_f") if $player.female? && background addBackgroundPlane(@sprites, "bg", "Trainer Card/bg_f", @viewport) else addBackgroundPlane(@sprites, "bg", "Trainer Card/bg", @viewport) end - cardexists = pbResolveBitmap(sprintf("Graphics/UI/Trainer Card/card_f")) + cardexists = pbResolveBitmap("Graphics/UI/Trainer Card/card_f") @sprites["card"] = IconSprite.new(0, 0, @viewport) if $player.female? && cardexists @sprites["card"].setBitmap("Graphics/UI/Trainer Card/card_f") diff --git a/Data/Scripts/016_UI/014_UI_Save.rb b/Data/Scripts/016_UI/014_UI_Save.rb index 38c168f7d..d455efabf 100644 --- a/Data/Scripts/016_UI/014_UI_Save.rb +++ b/Data/Scripts/016_UI/014_UI_Save.rb @@ -15,9 +15,10 @@ def pbEmergencySave end end if Game.save - pbMessage(_INTL("\\se[]The game was saved.\\me[GUI save game] The previous save file has been backed up.\\wtnp[30]")) + pbMessage("\\se[]" + + _INTL("The game was saved.\\me[GUI save game] The previous save file has been backed up.\\wtnp[30]")) else - pbMessage(_INTL("\\se[]Save failed.\\wtnp[30]")) + pbMessage("\\se[]" + _INTL("Save failed.\\wtnp[30]")) end $scene = oldscene end @@ -98,10 +99,10 @@ class PokemonSaveScreen $game_temp.begun_new_game = false pbSEPlay("GUI save choice") if Game.save - pbMessage(_INTL("\\se[]{1} saved the game.\\me[GUI save game]\\wtnp[30]", $player.name)) + pbMessage("\\se[]" +_INTL("{1} saved the game.\\me[GUI save game]\\wtnp[30]", $player.name)) ret = true else - pbMessage(_INTL("\\se[]Save failed.\\wtnp[30]")) + pbMessage("\\se[]" +_INTL("Save failed.\\wtnp[30]")) ret = false end else diff --git a/Data/Scripts/016_UI/015_UI_Options.rb b/Data/Scripts/016_UI/015_UI_Options.rb index 7698e544a..d036ab17d 100644 --- a/Data/Scripts/016_UI/015_UI_Options.rb +++ b/Data/Scripts/016_UI/015_UI_Options.rb @@ -230,7 +230,7 @@ class Window_PokemonOption < Window_DrawableCommand rect.y - 8 + (rect.height / 2), 8, 16, SEL_VALUE_BASE_COLOR ) - value = sprintf("%d", @options[index].lowest_value + self[index]) + value = (@options[index].lowest_value + self[index]).to_s xpos += (rect.width - rect.x - optionwidth) - self.contents.text_size(value).width pbDrawShadowText(self.contents, xpos, rect.y, optionwidth, rect.height, value, SEL_VALUE_BASE_COLOR, SEL_VALUE_SHADOW_COLOR) diff --git a/Data/Scripts/016_UI/022_UI_MoveRelearner.rb b/Data/Scripts/016_UI/022_UI_MoveRelearner.rb index e50a30adb..678aa3ead 100644 --- a/Data/Scripts/016_UI/022_UI_MoveRelearner.rb +++ b/Data/Scripts/016_UI/022_UI_MoveRelearner.rb @@ -89,7 +89,7 @@ class MoveRelearner_Scene accuracy = selMoveData.display_accuracy(@pokemon) textpos.push([_INTL("CATEGORY"), 272, 120, 0, Color.new(248, 248, 248), Color.black]) textpos.push([_INTL("POWER"), 272, 152, 0, Color.new(248, 248, 248), Color.black]) - textpos.push([power <= 1 ? power == 1 ? "???" : "---" : sprintf("%d", power), + textpos.push([power <= 1 ? power == 1 ? "???" : "---" : power.to_s, 468, 152, 2, Color.new(64, 64, 64), Color.new(176, 176, 176)]) textpos.push([_INTL("ACCURACY"), 272, 184, 0, Color.new(248, 248, 248), Color.black]) textpos.push([accuracy == 0 ? "---" : "#{accuracy}%", diff --git a/Data/Scripts/016_UI/024_UI_MysteryGift.rb b/Data/Scripts/016_UI/024_UI_MysteryGift.rb index 2a5432cee..19ad93db2 100644 --- a/Data/Scripts/016_UI/024_UI_MysteryGift.rb +++ b/Data/Scripts/016_UI/024_UI_MysteryGift.rb @@ -154,7 +154,7 @@ def pbManageMysteryGifts command = 0 loop do commands = pbRefreshMGCommands(master, online) - command = pbMessage(_INTL("\\ts[]Manage Mystery Gifts (X=online)."), commands, -1, nil, command) + command = pbMessage("\\ts[]" + _INTL("Manage Mystery Gifts (X=online)."), commands, -1, nil, command) # Gift chosen if command == -1 || command == commands.length - 1 # Cancel break diff --git a/Data/Scripts/016_UI/025_UI_TextEntry.rb b/Data/Scripts/016_UI/025_UI_TextEntry.rb index 4ec0aa715..20f7c35eb 100644 --- a/Data/Scripts/016_UI/025_UI_TextEntry.rb +++ b/Data/Scripts/016_UI/025_UI_TextEntry.rb @@ -376,7 +376,7 @@ class PokemonEntryScene2 # Create bitmaps @bitmaps = [] @@Characters.length.times do |i| - @bitmaps[i] = AnimatedBitmap.new(sprintf("Graphics/UI/Naming/overlay_tab_#{i + 1}")) + @bitmaps[i] = AnimatedBitmap.new(sprintf("Graphics/UI/Naming/overlay_tab_%d", i + 1)) b = @bitmaps[i].bitmap.clone pbSetSystemFont(b) textPos = [] diff --git a/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb b/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb index 8fe14e725..0f04c2e6e 100644 --- a/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb +++ b/Data/Scripts/017_Minigames/003_Minigame_SlotMachine.rb @@ -183,10 +183,10 @@ class SlotMachineScene Input.update update @sprites["window2"].bitmap&.clear - @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/win")) + @sprites["window1"].setBitmap("Graphics/UI/Slot Machine/win") @sprites["window1"].src_rect.set(152 * ((frame / timePerFrame) % 4), 0, 152, 208) if bonus > 0 - @sprites["window2"].setBitmap(sprintf("Graphics/UI/Slot Machine/bonus")) + @sprites["window2"].setBitmap("Graphics/UI/Slot Machine/bonus") @sprites["window2"].src_rect.set(152 * (bonus - 1), 0, 152, 208) end @sprites["light1"].visible = true @@ -231,7 +231,7 @@ class SlotMachineScene Input.update update @sprites["window2"].bitmap&.clear - @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/lose")) + @sprites["window1"].setBitmap("Graphics/UI/Slot Machine/lose") @sprites["window1"].src_rect.set(152 * ((frame / timePerFrame) % 2), 0, 152, 208) frame += 1 end @@ -249,7 +249,7 @@ class SlotMachineScene @sprites["reel3"] = SlotMachineReel.new(224, 112, difficulty) (1..3).each do |i| @sprites["button#{i}"] = IconSprite.new(68 + (80 * (i - 1)), 260, @viewport) - @sprites["button#{i}"].setBitmap(sprintf("Graphics/UI/Slot Machine/button")) + @sprites["button#{i}"].setBitmap("Graphics/UI/Slot Machine/button") @sprites["button#{i}"].visible = false end (1..5).each do |i| @@ -260,14 +260,14 @@ class SlotMachineScene @sprites["row#{i}"].visible = false end @sprites["light1"] = IconSprite.new(16, 32, @viewport) - @sprites["light1"].setBitmap(sprintf("Graphics/UI/Slot Machine/lights")) + @sprites["light1"].setBitmap("Graphics/UI/Slot Machine/lights") @sprites["light1"].visible = false @sprites["light2"] = IconSprite.new(240, 32, @viewport) - @sprites["light2"].setBitmap(sprintf("Graphics/UI/Slot Machine/lights")) + @sprites["light2"].setBitmap("Graphics/UI/Slot Machine/lights") @sprites["light2"].mirror = true @sprites["light2"].visible = false @sprites["window1"] = IconSprite.new(358, 96, @viewport) - @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/insert")) + @sprites["window1"].setBitmap("Graphics/UI/Slot Machine/insert") @sprites["window1"].src_rect.set(0, 0, 152, 208) @sprites["window2"] = IconSprite.new(358, 96, @viewport) @sprites["credit"] = SlotMachineScore.new(360, 66, $player.coins) @@ -294,7 +294,7 @@ class SlotMachineScene pbMessage(_INTL("You've run out of Coins.\nGame over!")) break elsif @gameRunning # Reels are spinning - @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/stop")) + @sprites["window1"].setBitmap("Graphics/UI/Slot Machine/stop") @sprites["window1"].src_rect.set(152 * ((frame / spinFrameTime) % 4), 0, 152, 208) if Input.trigger?(Input::USE) pbSEPlay("Slots stop") @@ -324,10 +324,10 @@ class SlotMachineScene end @gameEnd = false else # Awaiting coins for the next spin - @sprites["window1"].setBitmap(sprintf("Graphics/UI/Slot Machine/insert")) + @sprites["window1"].setBitmap("Graphics/UI/Slot Machine/insert") @sprites["window1"].src_rect.set(152 * ((frame / insertFrameTime) % 2), 0, 152, 208) if @wager > 0 - @sprites["window2"].setBitmap(sprintf("Graphics/UI/Slot Machine/press")) + @sprites["window2"].setBitmap("Graphics/UI/Slot Machine/press") @sprites["window2"].src_rect.set(152 * ((frame / insertFrameTime) % 2), 0, 152, 208) end if Input.trigger?(Input::DOWN) && @wager < 3 && @sprites["credit"].score > 0 diff --git a/Data/Scripts/017_Minigames/006_Minigame_Mining.rb b/Data/Scripts/017_Minigames/006_Minigame_Mining.rb index 94fe573f4..5feadc9f8 100644 --- a/Data/Scripts/017_Minigames/006_Minigame_Mining.rb +++ b/Data/Scripts/017_Minigames/006_Minigame_Mining.rb @@ -250,7 +250,7 @@ class MiningGameScene @sprites["crack"] = MiningGameCounter.new(0, 4) @sprites["cursor"] = MiningGameCursor.new(58, 0) # central position, pick @sprites["tool"] = IconSprite.new(434, 254, @viewport) - @sprites["tool"].setBitmap(sprintf("Graphics/UI/Mining/toolicons")) + @sprites["tool"].setBitmap("Graphics/UI/Mining/toolicons") @sprites["tool"].src_rect.set(0, 0, 68, 100) update pbFadeInAndShow(@sprites) diff --git a/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb b/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb index 748504570..b09ae7337 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/001_EditorScreens.rb @@ -1049,7 +1049,7 @@ def pbRegionalDexEditor(dex) end when 0 if cmd[1] >= 0 # Edit entry - case pbMessage(_INTL("\\ts[]Do what with this entry?"), + case pbMessage("\\ts[]" + _INTL("Do what with this entry?"), [_INTL("Change species"), _INTL("Clear"), _INTL("Insert entry"), _INTL("Delete entry"), _INTL("Cancel")], 5) @@ -1166,7 +1166,7 @@ def pbRegionalDexEditorMain refresh_list = true end elsif cmd[1] > 0 # Edit a Dex - case pbMessage(_INTL("\\ts[]Do what with this Dex?"), + case pbMessage("\\ts[]" + _INTL("Do what with this Dex?"), [_INTL("Edit"), _INTL("Copy"), _INTL("Delete"), _INTL("Cancel")], 4) when 0 # Edit dex_lists[cmd[1] - 1] = pbRegionalDexEditor(dex_lists[cmd[1] - 1]) diff --git a/Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb b/Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb index be667799c..9fd331464 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/002_EditorScreens_TerrainTags.rb @@ -212,7 +212,7 @@ class PokemonTilesetScene cmds.push("#{tag.id_number}: #{tag.real_name}") ids.push(tag.id_number) end - val = pbMessage(_INTL("\\l[1]\\ts[]Set the terrain tag."), cmds, -1, nil, old_idx) + val = pbMessage("\\l[1]\\ts[]" + _INTL("Set the terrain tag."), cmds, -1, nil, old_idx) if val >= 0 && val != old_tag set_terrain_tag_for_tile_ID(selected, ids[val]) draw_overlay diff --git a/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb b/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb index 4542c8a2f..ae9679532 100644 --- a/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb +++ b/Data/Scripts/020_Debug/001_Editor screens/003_EditorScreens_MapConnections.rb @@ -350,12 +350,12 @@ class MapScreenScene end def helpWindow - helptext = _INTL("A: Add map to canvas\r\n") - helptext += _INTL("DEL: Delete map from canvas\r\n") - helptext += _INTL("S: Go to another map\r\n") - helptext += _INTL("Click to select a map\r\n") - helptext += _INTL("Double-click: Edit map's metadata\r\n") - helptext += _INTL("Drag map to move it\r\n") + helptext = _INTL("A: Add map to canvas") + "\r\n" + helptext += _INTL("DEL: Delete map from canvas") + "\r\n" + helptext += _INTL("S: Go to another map") + "\r\n" + helptext += _INTL("Click to select a map") + "\r\n" + helptext += _INTL("Double-click: Edit map's metadata") + "\r\n" + helptext += _INTL("Drag map to move it") + "\r\n" helptext += _INTL("Arrow keys/drag canvas: Move around canvas") title = Window_UnformattedTextPokemon.newWithSize( helptext, 0, 0, Graphics.width * 8 / 10, Graphics.height, @viewport diff --git a/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb b/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb index ba8112029..9622e52ab 100644 --- a/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb +++ b/Data/Scripts/020_Debug/002_Animation editor/005_AnimEditor_Functions.rb @@ -380,9 +380,7 @@ module BattleAnimationEditor cmdEditBG = -1 cmdNewFO = -1 cmdEditFO = -1 - canvas.animation.timing.each do |i| - commands.push(sprintf("%s", i)) - end + canvas.animation.timing.each { |i| commands.push(i.to_s) } commands[cmdNewSound = commands.length] = _INTL("Add: Play Sound...") commands[cmdNewBG = commands.length] = _INTL("Add: Set Background Graphic...") commands[cmdEditBG = commands.length] = _INTL("Add: Edit Background Color/Location...") @@ -413,7 +411,7 @@ module BattleAnimationEditor cmdwin.index != cmdEditFO if framewindow.changed?(1) # Set Frame canvas.animation.timing[cmdwin.index].frame = framewindow.value(0) - 1 - cmdwin.commands[cmdwin.index] = sprintf("%s", canvas.animation.timing[cmdwin.index]) + cmdwin.commands[cmdwin.index] = canvas.animation.timing[cmdwin.index].to_s cmdwin.refresh next end @@ -476,7 +474,7 @@ module BattleAnimationEditor when 2, 4 pbEditBG(canvas, canvas.animation.timing[cmdwin.index]) end - cmdwin.commands[cmdwin.index] = sprintf("%s", canvas.animation.timing[cmdwin.index]) + cmdwin.commands[cmdwin.index] = canvas.animation.timing[cmdwin.index].to_s cmdwin.refresh end if redrawcmds @@ -486,7 +484,7 @@ module BattleAnimationEditor cmdwin.commands[cmdNewFO] = nil if cmdNewFO >= 0 cmdwin.commands[cmdEditFO] = nil if cmdEditFO >= 0 cmdwin.commands.compact! - cmdwin.commands.push(sprintf("%s", canvas.animation.timing[canvas.animation.timing.length - 1])) + cmdwin.commands.push(canvas.animation.timing[canvas.animation.timing.length - 1].to_s) cmdwin.commands[cmdNewSound = cmdwin.commands.length] = _INTL("Add: Play Sound...") cmdwin.commands[cmdNewBG = cmdwin.commands.length] = _INTL("Add: Set Background Graphic...") cmdwin.commands[cmdEditBG = cmdwin.commands.length] = _INTL("Add: Edit Background Color/Location...") diff --git a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb index 96c5f5e7f..5cb08df34 100644 --- a/Data/Scripts/020_Debug/002_Editor_DataTypes.rb +++ b/Data/Scripts/020_Debug/002_Editor_DataTypes.rb @@ -287,7 +287,7 @@ class StringListProperty do_refresh = true end else # Edit value - case pbMessage(_INTL("\\ts[]Do what with this value?"), + case pbMessage("\\ts[]" + _INTL("Do what with this value?"), [_INTL("Edit"), _INTL("Delete"), _INTL("Cancel")], 3) when 0 # Edit new_value = pbMessageFreeText(_INTL("Enter the new value."), @@ -1096,7 +1096,7 @@ class GameDataPoolProperty need_refresh = true end else # Edit existing value - case pbMessage(_INTL("\\ts[]Do what with this value?"), + case pbMessage("\\ts[]" + _INTL("Do what with this value?"), [_INTL("Change value"), _INTL("Delete"), _INTL("Cancel")], 3) when 0 # Change value new_value = pbChooseFromGameDataList(@game_data, entry[0]) @@ -1250,7 +1250,7 @@ module LevelUpMovesProperty end end else # Edit existing move - case pbMessage(_INTL("\\ts[]Do what with this move?"), + case pbMessage("\\ts[]" + _INTL("Do what with this move?"), [_INTL("Change level"), _INTL("Change move"), _INTL("Delete"), _INTL("Cancel")], 4) when 0 # Change level params = ChooseNumberParams.new @@ -1457,7 +1457,7 @@ class EvolutionsProperty end end else # Edit evolution - case pbMessage(_INTL("\\ts[]Do what with this evolution?"), + case pbMessage("\\ts[]" + _INTL("Do what with this evolution?"), [_INTL("Change species"), _INTL("Change method"), _INTL("Change parameter"), _INTL("Delete"), _INTL("Cancel")], 5) when 0 # Change species diff --git a/Data/Scripts/020_Debug/003_Debug menus/004_Debug_BattleCommands.rb b/Data/Scripts/020_Debug/003_Debug menus/004_Debug_BattleCommands.rb index 771b65e4a..a8ab301ec 100644 --- a/Data/Scripts/020_Debug/003_Debug menus/004_Debug_BattleCommands.rb +++ b/Data/Scripts/020_Debug/003_Debug menus/004_Debug_BattleCommands.rb @@ -206,8 +206,8 @@ MenuHandlers.add(:battle_debug_menu, :mega_evolution, { next if !trainers[i] text = (side == 0) ? "Your side:" : "Foe side:" text += sprintf(" %d: %s", i, trainers[i].name) - text += sprintf(" [ABLE]") if value == -1 - text += sprintf(" [UNABLE]") if value == -2 + text += " [ABLE]" if value == -1 + text += " [UNABLE]" if value == -2 commands.push(text) cmds.push([side, i]) end diff --git a/Data/Scripts/021_Compiler/001_Compiler.rb b/Data/Scripts/021_Compiler/001_Compiler.rb index e9f6d99ce..6d9f08cef 100644 --- a/Data/Scripts/021_Compiler/001_Compiler.rb +++ b/Data/Scripts/021_Compiler/001_Compiler.rb @@ -40,12 +40,12 @@ module FileLineData def self.linereport if @section if @key.nil? - return _INTL("File {1}, section {2}\r\n{3}\r\n\r\n", @file, @section, @value) + return _INTL("File {1}, section {2}\r\n{3}", @file, @section, @value) + "\r\n\r\n" else - return _INTL("File {1}, section {2}, key {3}\r\n{4}\r\n\r\n", @file, @section, @key, @value) + return _INTL("File {1}, section {2}, key {3}\r\n{4}", @file, @section, @key, @value) + "\r\n\r\n" end else - return _INTL("File {1}, line {2}\r\n{3}\r\n\r\n", @file, @lineno, @linedata) + return _INTL("File {1}, line {2}\r\n{3}", @file, @lineno, @linedata) + "\r\n\r\n" end end end diff --git a/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb b/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb index e09bc34f3..758d83924 100644 --- a/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb +++ b/Data/Scripts/021_Compiler/003_Compiler_WritePBS.rb @@ -560,7 +560,7 @@ module Compiler else pbWriteCsvRecord(record, f, schema) end - f.write(sprintf("\r\n")) + f.write("\r\n") end end end diff --git a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb index 8408ee9e4..9ee076dcd 100644 --- a/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb +++ b/Data/Scripts/021_Compiler/004_Compiler_MapsAndEvents.rb @@ -574,7 +574,7 @@ module Compiler trainerid = GameData::TrainerType.get(trtype).id filename = GameData::TrainerType.charset_filename_brief(trainerid) if FileTest.image_exist?("Graphics/Characters/" + filename) - firstpage.graphic.character_name = sprintf(filename) + firstpage.graphic.character_name = filename end end # Create strings that will be used repeatedly