a-story-about-stolen-lover/Scripts/_.4.rb
2024-02-03 15:51:02 -06:00

60 lines
No EOL
2.2 KiB
Ruby
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#******************************************************************************
#
# メッセージ自動置換
#
# for RGSS3
#
# Ver 1.00 2014.11.04
#
# 提供者睡工房 http://hime.be/
#
#******************************************************************************
=begin
機能
制御タグを使えるテキスト(メッセージやスクロール、ヘルプ等)に対し、
事前に登録したワードを別のワードに自動的に置き換えます。
使い方
 コンフィグ項目に対し、検索ワードと置換ワードを登録してください。
 表示するテキスト中に検索ワードを発見した場合、置換ワードに自動的に
 置き換えられます。
使用例
 ・アクター名の色づけタグの省略
 ・アクターの名前を変えてしまった…すべてのイベントの修正が面倒だ!
 ・アイテム名も変えてしまった…宝箱のメッセージが…
 ・変数やスイッチの番号を覚えにくい。変数名を付けたい。
 ・他にもアイデアしだいで便利な機能です。
=end
#==============================================================================
# コンフィグ項目
#==============================================================================
module SUI
module REPLACE
WORDS = {
# '検索ワード' => '置換ワード'
'バウザー' => 'ザウバー',
'ノエル' => 'クロエ',
}
end
end
#==============================================================================
# 設定完了
#==============================================================================
class Window_Base < Window
include SUI::REPLACE
#--------------------------------------------------------------------------
# ● 制御文字の事前変換
#--------------------------------------------------------------------------
alias sui_replace_convert_escape_characters convert_escape_characters
def convert_escape_characters(text)
result = text.to_s.clone
WORDS.each {|key, value| result.gsub!(key) { value } }
sui_replace_convert_escape_characters(result)
end
end