mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-07 13:15:01 +00:00
Overhauled text translations
This commit is contained in:
@@ -372,12 +372,14 @@ module Settings
|
||||
|
||||
#=============================================================================
|
||||
|
||||
# An array of available languages in the game, and their corresponding message
|
||||
# file in the Data folder. Edit only if you have 2 or more languages to choose
|
||||
# from.
|
||||
# An array of available languages in the game, and their corresponding
|
||||
# filename. Text files for a language are extracted to a folder called
|
||||
# "Text_filename_core" or "Text_filename_game", and are recompiled into files
|
||||
# in the Data folder called "messages_filename_core.dat" or
|
||||
# "messages_filename_game.dat".
|
||||
LANGUAGES = [
|
||||
# ["English", "english.dat"],
|
||||
# ["Deutsch", "deutsch.dat"]
|
||||
# ["English", "english"],
|
||||
# ["Deutsch", "deutsch"]
|
||||
]
|
||||
|
||||
#=============================================================================
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -30,7 +30,7 @@ module Game
|
||||
# Set language (and choose language if there is no save file)
|
||||
if Settings::LANGUAGES.length >= 2
|
||||
$PokemonSystem.language = pbChooseLanguage if save_data.empty?
|
||||
pbLoadMessages("Data/" + Settings::LANGUAGES[$PokemonSystem.language][1])
|
||||
MessageTypes.load_message_files(Settings::LANGUAGES[$PokemonSystem.language][1])
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -260,9 +260,11 @@ def pbGetBasicMapNameFromId(id)
|
||||
end
|
||||
|
||||
def pbGetMapNameFromId(id)
|
||||
name = pbGetMessage(MessageTypes::MapNames, id)
|
||||
name = pbGetBasicMapNameFromId(id) if nil_or_empty?(name)
|
||||
name.gsub!(/\\PN/, $player.name) if $player
|
||||
name = GameData::MapMetadata.get(id)&.name
|
||||
if nil_or_empty?(name)
|
||||
name = pbGetBasicMapNameFromId(id)
|
||||
name.gsub!(/\\PN/, $player.name) if $player
|
||||
end
|
||||
return name
|
||||
end
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ module GameData
|
||||
"SectionName" => [:id, "u"],
|
||||
"Name" => [:real_name, "s"],
|
||||
"Filename" => [:filename, "s"],
|
||||
"Point" => [:point, "^uussUUUU"],
|
||||
"Point" => [:point, "^uusSUUUU"],
|
||||
"Flags" => [:flags, "*s"]
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ module GameData
|
||||
|
||||
# @return [String] the translated name of this region
|
||||
def name
|
||||
return pbGetMessage(MessageTypes::RegionNames, @id)
|
||||
return pbGetMessageFromHash(MessageTypes::Regions, @real_name)
|
||||
end
|
||||
|
||||
def has_flag?(flag)
|
||||
|
||||
@@ -35,7 +35,7 @@ module GameData
|
||||
|
||||
# @return [String] the translated description of this ability
|
||||
def description
|
||||
return pbGetMessageFromHash(MessageTypes::AbilityDescs, @real_description)
|
||||
return pbGetMessageFromHash(MessageTypes::AbilityDescriptions, @real_description)
|
||||
end
|
||||
|
||||
def has_flag?(flag)
|
||||
|
||||
@@ -143,13 +143,13 @@ module GameData
|
||||
|
||||
# @return [String] the translated portion name of this item
|
||||
def portion_name
|
||||
return pbGetMessageFromHash(MessageTypes::ItemPortionNames, @real_portion_name) if @real_portion_name
|
||||
return pbGetMessageFromHash(MessageTypes::ItemPortions, @real_portion_name) if @real_portion_name
|
||||
return name
|
||||
end
|
||||
|
||||
# @return [String] the translated plural version of the portion name of this item
|
||||
def portion_name_plural
|
||||
return pbGetMessageFromHash(MessageTypes::ItemPortionNamePlurals, @real_portion_name_plural) if @real_portion_name_plural
|
||||
return pbGetMessageFromHash(MessageTypes::ItemPortionPlurals, @real_portion_name_plural) if @real_portion_name_plural
|
||||
return name_plural
|
||||
end
|
||||
|
||||
|
||||
@@ -225,17 +225,17 @@ module GameData
|
||||
|
||||
# @return [String] the translated name of this form of this species
|
||||
def form_name
|
||||
return pbGetMessageFromHash(MessageTypes::FormNames, @real_form_name)
|
||||
return pbGetMessageFromHash(MessageTypes::SpeciesForms, @real_form_name)
|
||||
end
|
||||
|
||||
# @return [String] the translated Pokédex category of this species
|
||||
def category
|
||||
return pbGetMessageFromHash(MessageTypes::Kinds, @real_category)
|
||||
return pbGetMessageFromHash(MessageTypes::SpeciesCategories, @real_category)
|
||||
end
|
||||
|
||||
# @return [String] the translated Pokédex entry of this species
|
||||
def pokedex_entry
|
||||
return pbGetMessageFromHash(MessageTypes::Entries, @real_pokedex_entry)
|
||||
return pbGetMessageFromHash(MessageTypes::PokedexEntries, @real_pokedex_entry)
|
||||
end
|
||||
|
||||
def default_form
|
||||
|
||||
@@ -107,7 +107,7 @@ module GameData
|
||||
|
||||
# @return [String] the translated in-battle lose message of this trainer
|
||||
def lose_text
|
||||
return pbGetMessageFromHash(MessageTypes::TrainerLoseText, @real_lose_text)
|
||||
return pbGetMessageFromHash(MessageTypes::TrainerLoseTexts, @real_lose_text)
|
||||
end
|
||||
|
||||
# Creates a battle-ready version of a trainer's data.
|
||||
|
||||
@@ -115,7 +115,10 @@ module GameData
|
||||
|
||||
# @return [String] the translated name of this map
|
||||
def name
|
||||
return pbGetMapNameFromId(@id)
|
||||
ret = pbGetMessageFromHash(MessageTypes::MapNames, @real_name)
|
||||
ret = pbGetBasicMapNameFromId(@id) if nil_or_empty?(ret)
|
||||
ret.gsub!(/\\PN/, $player.name) if $player
|
||||
return ret
|
||||
end
|
||||
|
||||
def has_flag?(flag)
|
||||
|
||||
@@ -7,7 +7,7 @@ class PokemonGlobalMetadata
|
||||
attr_accessor :bicycle
|
||||
attr_accessor :surfing
|
||||
attr_accessor :diving
|
||||
attr_accessor :sliding
|
||||
attr_accessor :ice_sliding
|
||||
attr_accessor :fishing
|
||||
# Player data
|
||||
attr_accessor :startTime
|
||||
@@ -58,7 +58,7 @@ class PokemonGlobalMetadata
|
||||
@bicycle = false
|
||||
@surfing = false
|
||||
@diving = false
|
||||
@sliding = false
|
||||
@ice_sliding = false
|
||||
@fishing = false
|
||||
# Player data
|
||||
@startTime = Time.now
|
||||
|
||||
@@ -185,7 +185,7 @@ class PokemonRegionMap_Scene
|
||||
@map.point.each do |point|
|
||||
next if point[0] != x || point[1] != y
|
||||
return "" if point[7] && (@wallmap || point[7] <= 0 || !$game_switches[point[7]])
|
||||
name = pbGetMessageFromHash(MessageTypes::PlaceNames, point[2])
|
||||
name = pbGetMessageFromHash(MessageTypes::RegionLocations, point[2])
|
||||
return (@editor) ? point[2] : name
|
||||
end
|
||||
return ""
|
||||
@@ -213,7 +213,8 @@ class PokemonRegionMap_Scene
|
||||
@map.point.each do |point|
|
||||
next if point[0] != x || point[1] != y
|
||||
return "" if point[7] && (@wallmap || point[7] <= 0 || !$game_switches[point[7]])
|
||||
mapdesc = pbGetMessageFromHash(MessageTypes::PlaceDescriptions, point[3])
|
||||
return "" if !point[3]
|
||||
mapdesc = pbGetMessageFromHash(MessageTypes::RegionDescriptions, point[3])
|
||||
return (@editor) ? point[3] : mapdesc
|
||||
end
|
||||
return ""
|
||||
|
||||
@@ -95,7 +95,7 @@ class PokemonPhone_Scene
|
||||
end
|
||||
# Set info text
|
||||
infotext = _INTL("Registered<br>")
|
||||
infotext += _INTL(" <r>{1}<br>", @sprites["list"].commands.length)
|
||||
infotext += _INTL("<r>{1}<br>", @sprites["list"].commands.length)
|
||||
infotext += _INTL("Waiting for a rematch<r>{1}", rematch_count)
|
||||
@sprites["info"].text = infotext
|
||||
pbRefreshScreen
|
||||
|
||||
@@ -325,7 +325,7 @@ class PokemonLoadScreen
|
||||
when cmd_language
|
||||
@scene.pbEndScene
|
||||
$PokemonSystem.language = pbChooseLanguage
|
||||
pbLoadMessages("Data/" + Settings::LANGUAGES[$PokemonSystem.language][1])
|
||||
MessageTypes.load_message_files(Settings::LANGUAGES[$PokemonSystem.language][1])
|
||||
if show_continue
|
||||
@save_data[:pokemon_system] = $PokemonSystem
|
||||
File.open(SaveData::FILE_PATH, "wb") { |file| Marshal.dump(@save_data, file) }
|
||||
|
||||
@@ -98,8 +98,8 @@ class BattleChallenge
|
||||
opponent = pbGenerateBattleTrainer(self.nextTrainer, self.rules)
|
||||
bttrainers = pbGetBTTrainers(@id)
|
||||
trainerdata = bttrainers[self.nextTrainer]
|
||||
opponent.lose_text = pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4])
|
||||
opponent.win_text = pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3])
|
||||
opponent.lose_text = pbGetMessageFromHash(MessageTypes::FrontierEndSpeechesLose, trainerdata[4])
|
||||
opponent.win_text = pbGetMessageFromHash(MessageTypes::FrontierEndSpeechesWin, trainerdata[3])
|
||||
ret = pbOrganizedBattleEx(opponent, self.rules)
|
||||
return ret
|
||||
end
|
||||
@@ -376,8 +376,8 @@ class BattleFactoryData
|
||||
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
|
||||
trainerdata[0]
|
||||
)
|
||||
@opponent.lose_text = pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4])
|
||||
@opponent.win_text = pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3])
|
||||
@opponent.lose_text = pbGetMessageFromHash(MessageTypes::FrontierEndSpeechesLose, trainerdata[4])
|
||||
@opponent.win_text = pbGetMessageFromHash(MessageTypes::FrontierEndSpeechesWin, trainerdata[3])
|
||||
opponentPkmn = pbBattleFactoryPokemon(pbBattleChallenge.rules, @bcdata.wins, @bcdata.swaps, @rentals)
|
||||
@opponent.party = opponentPkmn.sample(3)
|
||||
end
|
||||
@@ -401,8 +401,8 @@ class BattleFactoryData
|
||||
pbGetMessageFromHash(MessageTypes::TrainerNames, trainerdata[1]),
|
||||
trainerdata[0]
|
||||
)
|
||||
@opponent.lose_text = pbGetMessageFromHash(MessageTypes::EndSpeechLose, trainerdata[4])
|
||||
@opponent.win_text = pbGetMessageFromHash(MessageTypes::EndSpeechWin, trainerdata[3])
|
||||
@opponent.lose_text = pbGetMessageFromHash(MessageTypes::FrontierEndSpeechesLose, trainerdata[4])
|
||||
@opponent.win_text = pbGetMessageFromHash(MessageTypes::FrontierEndSpeechesWin, trainerdata[3])
|
||||
opponentPkmn = pbBattleFactoryPokemon(pbBattleChallenge.rules, @bcdata.wins, @bcdata.swaps,
|
||||
[].concat(@rentals).concat(@oldopponent))
|
||||
@opponent.party = opponentPkmn.sample(3)
|
||||
|
||||
@@ -92,7 +92,7 @@ def pbBattleChallengeBeginSpeech
|
||||
return "..." if !pbBattleChallenge.pbInProgress?
|
||||
bttrainers = pbGetBTTrainers(pbBattleChallenge.currentChallenge)
|
||||
tr = bttrainers[pbBattleChallenge.nextTrainer]
|
||||
return (tr) ? pbGetMessageFromHash(MessageTypes::BeginSpeech, tr[2]) : "..."
|
||||
return (tr) ? pbGetMessageFromHash(MessageTypes::FrontierIntroSpeeches, tr[2]) : "..."
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
|
||||
@@ -134,12 +134,13 @@ def getID(mod, constant)
|
||||
return constant
|
||||
end
|
||||
|
||||
def getConstantName(mod, value)
|
||||
def getConstantName(mod, value, raise_if_none = true)
|
||||
mod = Object.const_get(mod) if mod.is_a?(Symbol)
|
||||
mod.constants.each do |c|
|
||||
return c.to_s if mod.const_get(c.to_sym) == value
|
||||
end
|
||||
raise _INTL("Value {1} not defined by a constant in {2}", value, mod.name)
|
||||
raise _INTL("Value {1} not defined by a constant in {2}", value, mod.name) if raise_if_none
|
||||
return nil
|
||||
end
|
||||
|
||||
def getConstantNameOrValue(mod, value)
|
||||
|
||||
@@ -432,13 +432,13 @@ class Slider < UIControl
|
||||
color = Color.new(120, 120, 120)
|
||||
bitmap.fill_rect(x, y, width, height, Color.new(0, 0, 0, 0))
|
||||
size = bitmap.text_size(self.label).width
|
||||
leftarrows = bitmap.text_size(_INTL(" << "))
|
||||
leftarrows = bitmap.text_size(_INTL("<<"))
|
||||
numbers = bitmap.text_size(" XXXX ").width
|
||||
rightarrows = bitmap.text_size(_INTL(" >> "))
|
||||
rightarrows = bitmap.text_size(_INTL(">>"))
|
||||
bitmap.font.color = color
|
||||
shadowtext(bitmap, x, y, size, height, self.label)
|
||||
x += size
|
||||
shadowtext(bitmap, x, y, leftarrows.width, height, _INTL(" << "),
|
||||
shadowtext(bitmap, x, y, leftarrows.width, height, _INTL("<<"),
|
||||
self.disabled || self.curvalue == self.minvalue)
|
||||
@leftarrow = Rect.new(x, y, leftarrows.width, height)
|
||||
x += leftarrows.width
|
||||
@@ -447,7 +447,7 @@ class Slider < UIControl
|
||||
shadowtext(bitmap, x, y, numbers, height, " #{self.curvalue} ", false, 1)
|
||||
end
|
||||
x += numbers
|
||||
shadowtext(bitmap, x, y, rightarrows.width, height, _INTL(" >> "),
|
||||
shadowtext(bitmap, x, y, rightarrows.width, height, _INTL(">>"),
|
||||
self.disabled || self.curvalue == self.maxvalue)
|
||||
@rightarrow = Rect.new(x, y, rightarrows.width, height)
|
||||
end
|
||||
@@ -681,12 +681,12 @@ class TextSlider < UIControl
|
||||
color = Color.new(120, 120, 120)
|
||||
bitmap.fill_rect(x, y, width, height, Color.new(0, 0, 0, 0))
|
||||
size = bitmap.text_size(self.label).width
|
||||
leftarrows = bitmap.text_size(_INTL(" << "))
|
||||
rightarrows = bitmap.text_size(_INTL(" >> "))
|
||||
leftarrows = bitmap.text_size(_INTL("<<"))
|
||||
rightarrows = bitmap.text_size(_INTL(">>"))
|
||||
bitmap.font.color = color
|
||||
shadowtext(bitmap, x, y, size, height, self.label)
|
||||
x += size
|
||||
shadowtext(bitmap, x, y, leftarrows.width, height, _INTL(" << "),
|
||||
shadowtext(bitmap, x, y, leftarrows.width, height, _INTL("<<"),
|
||||
self.disabled || self.curvalue == self.minvalue)
|
||||
@leftarrow = Rect.new(x, y, leftarrows.width, height)
|
||||
x += leftarrows.width
|
||||
@@ -695,7 +695,7 @@ class TextSlider < UIControl
|
||||
shadowtext(bitmap, x, y, @maxoptionwidth, height, " #{@options[self.curvalue]} ", false, 1)
|
||||
end
|
||||
x += @maxoptionwidth
|
||||
shadowtext(bitmap, x, y, rightarrows.width, height, _INTL(" >> "),
|
||||
shadowtext(bitmap, x, y, rightarrows.width, height, _INTL(">>"),
|
||||
self.disabled || self.curvalue == self.maxvalue)
|
||||
@rightarrow = Rect.new(x, y, rightarrows.width, height)
|
||||
end
|
||||
|
||||
@@ -1088,20 +1088,58 @@ MenuHandlers.add(:debug_menu, :mystery_gift, {
|
||||
})
|
||||
|
||||
MenuHandlers.add(:debug_menu, :extract_text, {
|
||||
"name" => _INTL("Extract Text"),
|
||||
"name" => _INTL("Extract Text For Translation"),
|
||||
"parent" => :other_menu,
|
||||
"description" => _INTL("Extract all text in the game to a single file for translating."),
|
||||
"description" => _INTL("Extract all text in the game to text files for translating."),
|
||||
"effect" => proc {
|
||||
pbExtractText
|
||||
if Settings::LANGUAGES.length == 0
|
||||
pbMessage(_INTL("No languages are defined in the LANGUAGES array in Settings."))
|
||||
pbMessage(_INTL("You need to add at least one language to LANGUAGES first, to choose which one to extract text for."))
|
||||
next
|
||||
end
|
||||
# Choose a language from Settings to name the extraction folder after
|
||||
cmds = []
|
||||
Settings::LANGUAGES.each { |val| cmds.push(val[0]) }
|
||||
cmds.push(_INTL("Cancel"))
|
||||
language_index = pbMessage(_INTL("Choose a language to extract text for."), cmds, cmds.length)
|
||||
next if language_index == cmds.length - 1
|
||||
language_name = Settings::LANGUAGES[language_index][1]
|
||||
# Choose whether to extract core text or game text
|
||||
text_type = pbMessage(_INTL("Choose a language to extract text for."),
|
||||
[_INTL("Game-specific text"), _INTL("Core text"), _INTL("Cancel")], 3)
|
||||
next if text_type == 2
|
||||
# If game text, choose whether to extract map texts to map-specific files or
|
||||
# to one big file
|
||||
map_files = 0
|
||||
if text_type == 0
|
||||
map_files = pbMessage(_INTL("How many text files should map event texts be extracted to?"),
|
||||
[_INTL("One big file"), _INTL("One file per map"), _INTL("Cancel")], 3)
|
||||
next if map_files == 2
|
||||
end
|
||||
# Extract the chosen set of text for the chosen language
|
||||
Translator.extract_text(language_name, text_type == 1, map_files == 1)
|
||||
}
|
||||
})
|
||||
|
||||
MenuHandlers.add(:debug_menu, :compile_text, {
|
||||
"name" => _INTL("Compile Text"),
|
||||
"name" => _INTL("Compile Translated Text"),
|
||||
"parent" => :other_menu,
|
||||
"description" => _INTL("Import text and converts it into a language file."),
|
||||
"description" => _INTL("Import text files and convert them into a language file."),
|
||||
"effect" => proc {
|
||||
pbCompileTextUI
|
||||
# Find all folders with a particular naming convention
|
||||
cmds = Dir.glob("Text_*_*")
|
||||
if cmds.length == 0
|
||||
pbMessage(_INTL("No language folders found to compile."))
|
||||
pbMessage(_INTL("Language folders must be named \"Text_SOMETHING_core\" or \"Text_SOMETHING_game\" and be in the root folder."))
|
||||
next
|
||||
end
|
||||
cmds.push(_INTL("Cancel"))
|
||||
# Ask which folder to compile into a .dat file
|
||||
folder_index = pbMessage(_INTL("Choose a language folder to compile."), cmds, cmds.length)
|
||||
next if folder_index == cmds.length - 1
|
||||
# Compile the text files in the chosen folder
|
||||
dat_filename = cmds[folder_index].gsub!(/^Text_/, "")
|
||||
Translator.compile_text(cmds[folder_index], dat_filename)
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
@@ -546,37 +546,6 @@ end
|
||||
|
||||
|
||||
|
||||
#===============================================================================
|
||||
# Text import/export for localisation
|
||||
#===============================================================================
|
||||
def pbExtractText
|
||||
msgwindow = pbCreateMessageWindow
|
||||
if safeExists?("intl.txt") &&
|
||||
!pbConfirmMessageSerious(_INTL("intl.txt already exists. Overwrite it?"))
|
||||
pbDisposeMessageWindow(msgwindow)
|
||||
return
|
||||
end
|
||||
pbMessageDisplay(msgwindow, _INTL("Please wait.\\wtnp[0]"))
|
||||
MessageTypes.extract("intl.txt")
|
||||
pbMessageDisplay(msgwindow, _INTL("All text in the game was extracted and saved to intl.txt.\1"))
|
||||
pbMessageDisplay(msgwindow, _INTL("To localize the text for a particular language, translate every second line in the file.\1"))
|
||||
pbMessageDisplay(msgwindow, _INTL("After translating, choose \"Compile Text.\""))
|
||||
pbDisposeMessageWindow(msgwindow)
|
||||
end
|
||||
|
||||
def pbCompileTextUI
|
||||
msgwindow = pbCreateMessageWindow
|
||||
pbMessageDisplay(msgwindow, _INTL("Please wait.\\wtnp[0]"))
|
||||
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 Settings::LANGUAGES array in the scripts."))
|
||||
rescue RuntimeError
|
||||
pbMessageDisplay(msgwindow, _INTL("Failed to compile text: {1}", $!.message))
|
||||
end
|
||||
pbDisposeMessageWindow(msgwindow)
|
||||
end
|
||||
|
||||
#===============================================================================
|
||||
# Battle animations import/export
|
||||
#===============================================================================
|
||||
|
||||
@@ -151,7 +151,7 @@ module Compiler
|
||||
}
|
||||
end
|
||||
|
||||
# Unused
|
||||
# Used by translated text compiler
|
||||
def pbEachSection(f)
|
||||
lineno = 1
|
||||
havesection = false
|
||||
@@ -164,21 +164,21 @@ module Compiler
|
||||
line.force_encoding(Encoding::UTF_8)
|
||||
if !line[/^\#/] && !line[/^\s*$/]
|
||||
if line[/^\s*\[\s*(.+?)\s*\]\s*$/]
|
||||
yield lastsection, sectionname if havesection
|
||||
yield lastsection, sectionname if havesection
|
||||
lastsection.clear
|
||||
sectionname = $~[1]
|
||||
lastsection = []
|
||||
havesection = true
|
||||
else
|
||||
if sectionname.nil?
|
||||
raise _INTL("Expected a section at the beginning of the file (line {1}). Sections begin with '[name of section]'", lineno)
|
||||
raise _INTL("Expected a section at the beginning of the file (line {1}). Sections begin with '[name of section]'.", lineno)
|
||||
end
|
||||
lastsection.push(line.gsub(/^\s+/, "").gsub(/\s+$/, ""))
|
||||
lastsection.push(line.strip)
|
||||
end
|
||||
end
|
||||
lineno += 1
|
||||
Graphics.update if lineno % 500 == 0
|
||||
}
|
||||
yield lastsection, sectionname if havesection
|
||||
yield lastsection, sectionname if havesection
|
||||
end
|
||||
|
||||
# Unused
|
||||
@@ -845,9 +845,9 @@ module Compiler
|
||||
compile_animations
|
||||
compile_trainer_events(mustCompile)
|
||||
Console.echo_li(_INTL("Saving messages..."))
|
||||
pbSetTextMessages
|
||||
MessageTypes.saveMessages
|
||||
MessageTypes.loadMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat")
|
||||
Translator.gather_script_and_event_texts
|
||||
MessageTypes.save_default_messages
|
||||
MessageTypes.load_default_messages if safeExists?("Data/messages_core.dat")
|
||||
Console.echo_done(true)
|
||||
Console.echo_li(_INTL("Reloading cache..."))
|
||||
System.reload_cache
|
||||
|
||||
@@ -90,9 +90,9 @@ module Compiler
|
||||
end
|
||||
point_names.uniq!
|
||||
interest_names.uniq!
|
||||
MessageTypes.setMessages(MessageTypes::RegionNames, region_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::PlaceNames, point_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::PlaceDescriptions, interest_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::Regions, region_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::RegionLocations, point_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::RegionDescriptions, interest_names)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -199,7 +199,7 @@ module Compiler
|
||||
ability_descriptions.push(ability.real_description)
|
||||
end
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::Abilities, ability_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::AbilityDescs, ability_descriptions)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::AbilityDescriptions, ability_descriptions)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -262,8 +262,8 @@ module Compiler
|
||||
end
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::Items, item_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ItemPlurals, item_names_plural)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ItemPortionNames, item_portion_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ItemPortionNamePlurals, item_portion_names_plural)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ItemPortions, item_portion_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ItemPortionPlurals, item_portion_names_plural)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::ItemDescriptions, item_descriptions)
|
||||
end
|
||||
|
||||
@@ -370,9 +370,9 @@ module Compiler
|
||||
species_pokedex_entries.push(species.real_pokedex_entry)
|
||||
end
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::Species, species_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::FormNames, species_form_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::Kinds, species_categories)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::Entries, species_pokedex_entries)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::SpeciesForms, species_form_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::SpeciesCategories, species_categories)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::PokedexEntries, species_pokedex_entries)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -508,9 +508,9 @@ module Compiler
|
||||
species_categories.push(species.real_category)
|
||||
species_pokedex_entries.push(species.real_pokedex_entry)
|
||||
end
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::FormNames, species_form_names)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::Kinds, species_categories)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::Entries, species_pokedex_entries)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::SpeciesForms, species_form_names)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::SpeciesCategories, species_categories)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::PokedexEntries, species_pokedex_entries)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -908,7 +908,7 @@ module Compiler
|
||||
lose_texts.push(trainer.real_lose_text)
|
||||
end
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::TrainerNames, trainer_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::TrainerLoseText, lose_texts)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::TrainerLoseTexts, lose_texts)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
@@ -932,9 +932,9 @@ module Compiler
|
||||
}
|
||||
end
|
||||
sections = []
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::BeginSpeech, [])
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::EndSpeechWin, [])
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::EndSpeechLose, [])
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::FrontierIntroSpeeches, [])
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::FrontierEndSpeechesWin, [])
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::FrontierEndSpeechesLose, [])
|
||||
File.open(path, "rb") { |f|
|
||||
FileLineData.file = path
|
||||
idx = 0
|
||||
@@ -1022,9 +1022,9 @@ module Compiler
|
||||
}
|
||||
end
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::TrainerNames, trainernames)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::BeginSpeech, beginspeech)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::EndSpeechWin, endspeechwin)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::EndSpeechLose, endspeechlose)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::FrontierIntroSpeeches, beginspeech)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::FrontierEndSpeechesWin, endspeechwin)
|
||||
MessageTypes.addMessagesAsHash(MessageTypes::FrontierEndSpeechesLose, endspeechlose)
|
||||
return sections
|
||||
end
|
||||
|
||||
@@ -1153,7 +1153,7 @@ module Compiler
|
||||
# Get map names for translating
|
||||
map_names = []
|
||||
GameData::MapMetadata.each { |map| map_names[map.id] = map.real_name }
|
||||
MessageTypes.setMessages(MessageTypes::MapNames, map_names)
|
||||
MessageTypes.setMessagesAsHash(MessageTypes::MapNames, map_names)
|
||||
end
|
||||
|
||||
#=============================================================================
|
||||
|
||||
@@ -24,7 +24,7 @@ end
|
||||
|
||||
def mainFunctionDebug
|
||||
begin
|
||||
MessageTypes.loadMessageFile("Data/messages.dat") if safeExists?("Data/messages.dat")
|
||||
MessageTypes.load_default_messages if safeExists?("Data/messages_core.dat")
|
||||
PluginManager.runPlugins
|
||||
Compiler.main
|
||||
Game.initialize
|
||||
|
||||
Reference in New Issue
Block a user