[fold=脚本戳我]
[pre lang="ruby" line="1"]module Chd114 end
module Chd114::Text
#每一个before都对应了after,则符合before[1]的文字内容会被转换成after[1]的文字内容
TEXT = {
before: {#在这里设定要被转换掉的文字
1=>"我爱你",
2=>"生存还是毁灭,这是一个值得思考的问题"
},
after: {#在这里设定转换后的文字
1=>"I Love You",
2=>"To be, or not to be- that is the question"
},
}
end[/pre]
class Window_Base < Window
#--------------------------------------------------------------------------
# * Preconvert Control Characters
# As a rule, replace only what will be changed into text strings before
# starting actual drawing. The character "\" is replaced with the escape
# character (\e).
#--------------------------------------------------------------------------
def convert_escape_characters(text)
result = text.to_s.clone
result.gsub!(/\\/) { "\e" }
result.gsub!(/\e\e/) { "\\" }