70 lines
No EOL
2.3 KiB
Ruby
70 lines
No EOL
2.3 KiB
Ruby
#==========================================================================
|
|
# 追加分 以下の内容を図鑑スクリプトのすぐ下のセクションに追加してください
|
|
#==========================================================================
|
|
|
|
class Window_MonsterDictionaryStatus
|
|
|
|
# 初期化に追加
|
|
alias initialize_alter initialize # 元の初期化メソッドをエイリアスで退避
|
|
def initialize(x, y, width, height)
|
|
init_erase_switch # テキスト消去用の変数初期化を追加
|
|
initialize_alter(x, y, width, height)
|
|
end
|
|
|
|
# テキスト消去用の変数初期化
|
|
def init_erase_switch
|
|
@erase_switch = false
|
|
end
|
|
|
|
# 更新メソッドに決定ボタンの入力判定を追加
|
|
# 追加元は Window_Selectable
|
|
def update
|
|
super
|
|
process_erasetext
|
|
end
|
|
|
|
# 決定ボタンの入力判定
|
|
def process_erasetext
|
|
return erase_text if Input.trigger?(:C)
|
|
end
|
|
|
|
# テキスト消去の処理
|
|
def erase_text
|
|
Sound.play_ok
|
|
Input.update
|
|
switch_erase
|
|
refresh
|
|
end
|
|
|
|
# テキスト描画と消去の切り替え
|
|
def switch_erase
|
|
if @erase_switch == true
|
|
@erase_switch = false
|
|
else
|
|
@erase_switch = true
|
|
end
|
|
end
|
|
|
|
# テキスト消去変数を元にリフレッシュで描画する内容を制御
|
|
alias refresh_alter refresh # 元のリフレッシュをエイリアスで退避
|
|
def refresh
|
|
if @erase_switch == true # 消去判定がtrueならピクチャだけ描画して終了
|
|
contents.clear
|
|
if @print
|
|
if WD_monsterdictionary_layout::M_pic_display
|
|
pic_name = @enemy.battler_name
|
|
pic_hue = @enemy.battler_hue
|
|
x = WD_monsterdictionary_layout::M_pic_display_x
|
|
y = WD_monsterdictionary_layout::M_pic_display_y
|
|
opacity= WD_monsterdictionary_layout::M_pic_display_opacity
|
|
bitmap = Cache.battler(pic_name, pic_hue)
|
|
rect = Rect.new(0, 0, bitmap.width, bitmap.height)
|
|
contents.blt(x - rect.width/2, y - rect.height, bitmap, rect, opacity)
|
|
end
|
|
end
|
|
else # 消去判定がfalseなら元のリフレッシュで全て描画
|
|
refresh_alter
|
|
end
|
|
end
|
|
|
|
end |