rebf-gaiden/Scripts/_ver1.rb
2025-04-26 17:06:34 -05:00

53 lines
No EOL
1.7 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.

=begin
トリス バトラー画像代用 ver1
Battlersフォルダの画像が存在しなかった場合、
初回だけメッセージを表示し、別の画像で代用してゲームを進めます。
戦闘以外のBattlersフォルダ読み込み魔物図鑑でも、この機能は発動します。
=end
#==============================================================================
# ■ Cache
#==============================================================================
module Cache
# テストプレイ中でここがtrueだとエラーメッセージを表示しない
NO_MESSAGE = false
# 「存在しない画像」の代わりに表示する画像 何も表示しないなら""
ERROR_FILE = ""
# エラーメッセージの内容 「\n」が改行、「%s」が画像パスに置き換わる
ERROR_MESSAGE = " ファイルが見つかりません
代用画像でゲームを進行します
見つからなかったファイル:\n %s"
#--------------------------------------------------------------------------
# ● 通常のビットマップを作成/取得
#--------------------------------------------------------------------------
def self.normal_bitmap(path)
unless include?(path)
if not path.include?("Graphics/Battlers/")
@cache[path] = Bitmap.new(path)
else
begin
@cache[path] = Bitmap.new(path)
rescue
puts ""
puts sprintf(ERROR_MESSAGE, path)
puts ""
msgbox sprintf(ERROR_MESSAGE, path) unless ($TEST && NO_MESSAGE)
@cache[path] = load_bitmap("", ERROR_FILE)
end
end
end
@cache[path]
end
end