pros-plan-for-elves/Scripts/_.38.rb
2023-07-05 00:17:15 -05:00

67 lines
No EOL
2.5 KiB
Ruby
Raw 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.

=begin
RGSS3
★ ロードメニュー ★
メニューにセーブデータのロードを行える項目を追加します。
● 仕様 ●==========================================================
セーブが一つも存在しない場合は、コマンドを選択することはできません。
====================================================================
ver1.00
Last Update : 2011/12/25
12/25 : 新規
ろかん   http://kaisou-ryouiki.sakura.ne.jp/
=end
$rsi ||= {}
$rsi["ロードメニュー"] = true
class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# ● コマンドリストの作成
#--------------------------------------------------------------------------
alias _make_command_list_with_load_command make_command_list
def make_command_list
_make_command_list_with_load_command
add_load_command
end
#--------------------------------------------------------------------------
# ● インデックスを指定したコマンドの追加
#--------------------------------------------------------------------------
def add_command_with_index(name, symbol, index, enabled = true, ext = nil)
@list[index, 0] = {:name=>name, :symbol=>symbol, :enabled=>enabled, :ext=>ext}
end
#--------------------------------------------------------------------------
# ● ロードコマンドの追加
#--------------------------------------------------------------------------
def add_load_command
@list.each_with_index{|data, index|
if data[:symbol] == :save
add_command_with_index("Load", :load, index.next, DataManager.save_file_exists?)
return
end
}
add_command("Load", :load, DataManager.save_file_exists?)
end
end
class Scene_Menu < Scene_MenuBase
#--------------------------------------------------------------------------
# ● コマンドウィンドウの作成
#--------------------------------------------------------------------------
alias _create_load_command create_command_window
def create_command_window
_create_load_command
@command_window.set_handler(:load, method(:command_load))
end
#--------------------------------------------------------------------------
# ● コマンド[ロード]
#--------------------------------------------------------------------------
def command_load
SceneManager.call(Scene_Load)
end
end