68 lines
No EOL
2.4 KiB
Ruby
68 lines
No EOL
2.4 KiB
Ruby
#----------------------------------------------------------------------------
|
||
#
|
||
# ■タイマーの表示・非表示切り替えスクリプト 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 |