c-u-nitro-nil/Scripts/_.15.rb
2024-02-07 10:17:27 -06:00

68 lines
No EOL
2.4 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.

#----------------------------------------------------------------------------
#
# ■タイマーの表示・非表示切り替えスクリプト for RGSS3
#
# 【適用方法】
# スクリプトエディタの「▼ 素材」セクションの下側に
#  全文をコピー&ペーストしてください。
#
# 【使用方法】
#  イベントコマンド「ラベル」にて以下の()で括った部分の文章を
#  書き込んでください。
#
# (タイマーの操作:非表示):タイマーを非表示状態にします。
# (タイマーの操作:表示) :タイマーを表示状態にします。
#
# 【仕様】
#  ・「タイマーの操作」で停止させると、自動的に表示状態に戻します。
#
#----------------------------------------------------------------------------
class Game_Timer
#--------------------------------------------------------------------------
# ● 公開インスタンス変数
#--------------------------------------------------------------------------
attr_accessor :timer_visible
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias uma_initialize initialize
def initialize
uma_initialize
@timer_visible = true
end
#--------------------------------------------------------------------------
# ● 停止
#--------------------------------------------------------------------------
alias uma_stop stop
def stop
uma_stop
@timer_visible = true
end
end
class Game_Interpreter
#--------------------------------------------------------------------------
# ● ラベル
#--------------------------------------------------------------------------
alias uma_command_118 command_118
def command_118
case @params[0]
when /タイマーの操作:非表示/
$game_timer.timer_visible = false
when /タイマーの操作:表示/
$game_timer.timer_visible = true
else
uma_command_118
end
end
end
class Sprite_Timer < Sprite
#--------------------------------------------------------------------------
# ● 可視状態の更新(再定義)
#--------------------------------------------------------------------------
def update_visibility
self.visible = $game_timer.working? && $game_timer.timer_visible
end
end