181 lines
No EOL
7 KiB
Ruby
181 lines
No EOL
7 KiB
Ruby
#==============================================================================
|
||
# ■ Window_AutoSave
|
||
#------------------------------------------------------------------------------
|
||
# を表示するウィンドウです。
|
||
#==============================================================================
|
||
|
||
class Window_AutoSave < Window_Base
|
||
#--------------------------------------------------------------------------
|
||
# ● オブジェクト初期化
|
||
#--------------------------------------------------------------------------
|
||
def initialize
|
||
super(Graphics.width - window_width, 0, window_width, fitting_height(1))
|
||
self.opacity = 0
|
||
self.contents_opacity = 0
|
||
#self.openness = 0
|
||
@show_count = 0
|
||
@hide_count = 0
|
||
#hide
|
||
refresh
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● ウィンドウ幅の取得
|
||
#--------------------------------------------------------------------------
|
||
def window_width
|
||
return 280
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● リフレッシュ
|
||
#--------------------------------------------------------------------------
|
||
def refresh
|
||
contents.clear
|
||
draw_background(contents.rect)
|
||
draw_text(contents.rect, "システムデータセーブ中", 1)
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● フレーム更新
|
||
#--------------------------------------------------------------------------
|
||
def update
|
||
super
|
||
if @show_count > 0
|
||
@show_count -= 1
|
||
update_fadein
|
||
elsif @show_count <= 0 && @hide_count > 0
|
||
@hide_count -= 1
|
||
update_fadeout
|
||
end
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● フェードアウトの更新
|
||
#--------------------------------------------------------------------------
|
||
def update_fadein
|
||
self.contents_opacity += 26
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● フェードアウトの更新
|
||
#--------------------------------------------------------------------------
|
||
def update_fadeout
|
||
self.contents_opacity -= 5
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● ウィンドウを開く
|
||
#--------------------------------------------------------------------------
|
||
def open
|
||
refresh
|
||
@show_count = 10
|
||
#self.contents_opacity = 255
|
||
self
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● ウィンドウを閉じる
|
||
#--------------------------------------------------------------------------
|
||
def close
|
||
@hide_count = 60
|
||
self
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● 背景の描画
|
||
#--------------------------------------------------------------------------
|
||
def draw_background(rect)
|
||
temp_rect = rect.clone
|
||
temp_rect.width /= 2
|
||
contents.gradient_fill_rect(temp_rect, back_color2, back_color1)
|
||
temp_rect.x = temp_rect.width
|
||
contents.gradient_fill_rect(temp_rect, back_color1, back_color2)
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● 背景色 1 の取得
|
||
#--------------------------------------------------------------------------
|
||
def back_color1
|
||
Color.new(255, 255, 255, 192)
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# ● 背景色 2 の取得
|
||
#--------------------------------------------------------------------------
|
||
def back_color2
|
||
Color.new(255, 255, 255, 0)
|
||
end
|
||
end
|
||
|
||
#==============================================================================
|
||
# ■ Scene_Base
|
||
#------------------------------------------------------------------------------
|
||
# ゲーム中の全てのシーンのスーパークラスです。
|
||
#==============================================================================
|
||
|
||
class Scene_Base
|
||
#--------------------------------------------------------------------------
|
||
# 〇 オートセーブウィンドウの作成
|
||
#--------------------------------------------------------------------------
|
||
def create_autosave_window
|
||
@autosave_window = Window_AutoSave.new
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# 〇 マップウィンドウ表示
|
||
#--------------------------------------------------------------------------
|
||
def autosave_on
|
||
@autosave_window.open
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# 〇 マップウィンドウ表示
|
||
#--------------------------------------------------------------------------
|
||
def autosave_off
|
||
@autosave_window.close
|
||
end
|
||
end
|
||
|
||
#==============================================================================
|
||
# ■ Scene_Map
|
||
#------------------------------------------------------------------------------
|
||
# マップ画面の処理を行うクラスです。
|
||
#==============================================================================
|
||
|
||
class Scene_Map < Scene_Base
|
||
#--------------------------------------------------------------------------
|
||
# ● 全ウィンドウの作成
|
||
#--------------------------------------------------------------------------
|
||
alias autosave_create_all_windows create_all_windows
|
||
def create_all_windows
|
||
autosave_create_all_windows
|
||
create_autosave_window
|
||
end
|
||
end
|
||
|
||
#==============================================================================
|
||
# ■ Scene_Battle
|
||
#------------------------------------------------------------------------------
|
||
# バトル画面の処理を行うクラスです。
|
||
#==============================================================================
|
||
|
||
class Scene_Battle < Scene_Base
|
||
#--------------------------------------------------------------------------
|
||
# ● 全ウィンドウの作成
|
||
#--------------------------------------------------------------------------
|
||
alias autosave_create_all_windows create_all_windows
|
||
def create_all_windows
|
||
autosave_create_all_windows
|
||
create_autosave_window
|
||
end
|
||
end
|
||
|
||
#==============================================================================
|
||
# ■ Game_Interpreter
|
||
#------------------------------------------------------------------------------
|
||
# イベントコマンドを実行するインタプリタです。このクラスは Game_Map クラス、
|
||
# Game_Troop クラス、Game_Event クラスの内部で使用されます。
|
||
#==============================================================================
|
||
|
||
class Game_Interpreter
|
||
#--------------------------------------------------------------------------
|
||
# 〇 オートセーブウィンドウ表示
|
||
#--------------------------------------------------------------------------
|
||
def autosave_on
|
||
SceneManager.scene.autosave_on
|
||
end
|
||
#--------------------------------------------------------------------------
|
||
# 〇 オートセーブウィンドウ消去
|
||
#--------------------------------------------------------------------------
|
||
def autosave_off
|
||
SceneManager.scene.autosave_off
|
||
end
|
||
end |