#============================================================================== # ■ KGC Software様 「カスタムメニューコマンド」対応スクリプト ver 1.03 #------------------------------------------------------------------------------ #  配布元: # 白の魔 http://izumiwhite.web.fc2.com/ # #  利用規約: # RPGツクールVXの正規の登録者のみご利用になれます。 # 利用報告・著作権表示とかは必要ありません。 # KGC Software様には、ご迷惑のかからないようにご利用下さい。 #============================================================================== module KGC module CustomMenuCommand # ◆ メニューコマンド一覧 # メニュー画面に表示するコマンドを「表示したい順」に記述してください。 # 使用しないコマンドは書かなくても構いません。 # ** 対応表 ** # 0..アイテム 1..スキル 2..装備 3..ステータス 4..セーブ 5..ゲーム終了 # # ** 以下は、該当する機能を導入しないと使えません。 # 10..パーティ編成 (多人数パーティ:KGC Software) # 11..AP ビューア (スキル習得装備:KGC Software) # 12..スキル設定 (スキルCP制:KGC Software) # 13..難易度設定 (戦闘難易度:KGC Software) # 14..パラメータ振り分け (パラメータ振り分け:KGC Software) # 15..モンスター図鑑 (モンスター図鑑:KGC Software) # # ** 以下、白の魔で公開中のスクリプト用です。 # # 41..SP 振り分け (スキルポイント振り分けシステム:白の魔) # 42..入れ替え (パーティ入れ替え改:白の魔) # 43..アイテム図鑑 (アイテム図鑑2 or アイテム図鑑3:白の魔) # 44..魔物図鑑 (魔物図鑑:白の魔) # 45..名前変更 (リネームコマンド:白の魔) # # ** 以下は、「レクトールと黒獅子の紋章」おまけスクリプト # ** [ExMenu_CustomCommand] 用です。 # ** 「あらすじ」などを追加する場合に使用してください。 # 100..コマンド 1 個目 # 101..コマンド 2 個目 # 102..コマンド 3 個目 # (以降 199 まで使用可能) MENU_COMMANDS = [0, 1, 2, 3, 43, 45, 4, 5] # ◆ メニューコマンドの最大行数 ROW_MAX = 11 #白の魔 アイテム図鑑の種類 ITEM_DIC_NUM = 3 # 2 or 3 (2でアイテム図鑑2 3でアイテム図鑑3) end end #============================================================================== # ■ Scene_Menu #============================================================================== class Scene_Menu < Scene_Base #-------------------------------------------------------------------------- # ○ コマンド一覧の作成 # コマンド名の一覧を返す。 #-------------------------------------------------------------------------- def create_command_list commands = [] index_list = {} @exmenu_command_scene = {} @disabled_command_index = [] KGC::CustomMenuCommand::MENU_COMMANDS.each_with_index { |c, i| case c when 0 # アイテム index_list[:item] = commands.size commands << Vocab.item when 1 # スキル index_list[:skill] = commands.size commands << Vocab.skill when 2 # 装備 index_list[:equip] = commands.size commands << Vocab.equip when 3 # ステータス index_list[:status] = commands.size commands << Vocab.status when 4 # セーブ index_list[:save] = commands.size commands << Vocab.save when 5 # ゲーム終了 index_list[:game_end] = commands.size commands << Vocab.game_end when 10 # パーティ編成 next unless $imported["LargeParty"] index_list[:partyform] = commands.size @__command_partyform_index = commands.size commands << Vocab.partyform when 11 # AP ビューア next unless $imported["EquipLearnSkill"] index_list[:ap_viewer] = commands.size @__command_ap_viewer_index = commands.size commands << Vocab.ap_viewer when 12 # スキル設定 next unless $imported["SkillCPSystem"] index_list[:set_battle_skill] = commands.size @__command_set_battle_skill_index = commands.size commands << Vocab.set_battle_skill when 13 # 戦闘難易度 next unless $imported["BattleDifficulty"] index_list[:set_difficulty] = commands.size @__command_set_difficulty_index = commands.size commands << KGC::BattleDifficulty.get[:name] when 14 # パラメータ振り分け next unless $imported["DistributeParameter"] index_list[:distribute_parameter] = commands.size @__command_distribute_parameter_index = commands.size commands << Vocab.distribute_parameter when 15 # モンスター図鑑 next unless $imported["EnemyGuide"] index_list[:enemy_guide] = commands.size @__command_enemy_guide_index = commands.size commands << Vocab.enemy_guide when 41 # SP振り分け index_list[:sp_divide] = commands.size @__command_sp_divide_index = commands.size commands << WD_skilldivide_ini::Sp_command when 42 # 入れ替え index_list[:member_change] = commands.size @__command_member_change_index = commands.size commands << "入れ替え" when 43 # アイテム図鑑 index_list[:item_dictionary] = commands.size @__item_dictionary_index = commands.size commands << "アイテム図鑑" when 44 # 魔物図鑑 index_list[:monster_dictionary] = commands.size @__monster_dictionary_index = commands.size commands << "魔物図鑑" when 45 # リネーム index_list[:rename_command] = commands.size @__rename_command_index = commands.size commands << WD_renamecommand_ini::Rename_command when 100..199 # ExMenu_CustomCommand next unless KGC::CustomMenuCommand::EXMNU_CTCMD_OK # 使用不可なら次へ excommand = EXMNU_CTCMD_COMMANDS[c - 100] # コマンドindex取得 unless command_visible?(excommand) || command_inputable?(excommand) next # 不可視なら次へ end index_list[excommand[2]] = commands.size commands << excommand[2] @exmenu_command_scene[excommand[2]] = excommand[3] end } $game_temp.menu_command_index = index_list return commands end #-------------------------------------------------------------------------- # ● コマンド選択の更新 #-------------------------------------------------------------------------- def update_command_selection if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::C) index = @command_window.index unless command_enabled?(index) # コマンドが無効 Sound.play_buzzer return end Sound.play_decision # [ExMenu_CustomCommand] excommand = nil if KGC::CustomMenuCommand::EXMNU_CTCMD_OK excommand = @command_window.commands[index] end # 遷移シーン判定 case index when $game_temp.menu_command_index[:item] # アイテム $scene = Scene_Item.new when $game_temp.menu_command_index[:skill], # スキル、装備、ステータス $game_temp.menu_command_index[:equip], $game_temp.menu_command_index[:status] start_actor_selection when $game_temp.menu_command_index[:save] # セーブ $scene = Scene_File.new(true, false, false) when $game_temp.menu_command_index[:game_end] # ゲーム終了 $scene = Scene_End.new when $game_temp.menu_command_index[:sp_divide] # SP振り分け start_actor_selection when $game_temp.menu_command_index[:member_change] # PT入れ替え $scene = Scene_MemberChange.new(1) when $game_temp.menu_command_index[:item_dictionary] # アイテム図鑑 $scene = Scene_TotalDictionary.new(1) when $game_temp.menu_command_index[:monster_dictionary] # 魔物図鑑 $scene = Scene_MonsterDictionary.new(1) when $game_temp.menu_command_index[:rename_command] # 名前変更 start_actor_selection when $game_temp.menu_command_index[excommand] # [ExMenu_CustomCommand] $game_party.last_menu_index = index $scene = eval("#{@exmenu_command_scene[excommand]}.new") end end end #-------------------------------------------------------------------------- # ● アクター選択の更新 #-------------------------------------------------------------------------- def update_actor_selection if Input.trigger?(Input::B) Sound.play_cancel end_actor_selection elsif Input.trigger?(Input::C) $game_party.last_actor_index = @status_window.index Sound.play_decision case @command_window.index when $game_temp.menu_command_index[:skill] # スキル $scene = Scene_Skill.new(@status_window.index) when $game_temp.menu_command_index[:equip] # 装備 $scene = Scene_Equip.new(@status_window.index) when $game_temp.menu_command_index[:status] # ステータス $scene = Scene_Status.new(@status_window.index) when $game_temp.menu_command_index[:sp_divide] # SP振り分け $scene = Scene_SkillPoint.new(@status_window.index) when $game_temp.menu_command_index[:rename_command] # 名前変更 $scene = Scene_Name.new(@status_window.index) end end end end class Scene_SkillPoint < Scene_Base #-------------------------------------------------------------------------- # ● 元の画面へ戻る #-------------------------------------------------------------------------- def return_scene if $game_temp.menu_command_index.has_key?(:sp_divide) $scene = Scene_Menu.new($game_temp.menu_command_index[:sp_divide]) else $scene = Scene_Map.new end end end class Scene_MemberChange < Scene_Base #-------------------------------------------------------------------------- # ● 初期化 #-------------------------------------------------------------------------- def initialize(from = 0) @from = from end #-------------------------------------------------------------------------- # ● 元の画面へ戻る #-------------------------------------------------------------------------- def return_scene if @from == 0 $scene = Scene_Map.new else if $game_temp.menu_command_index.has_key?(:member_change) $scene = Scene_Menu.new($game_temp.menu_command_index[:member_change]) else $scene = Scene_Map.new end end end end class Scene_TotalDictionary < Scene_Base #-------------------------------------------------------------------------- # ● 初期化 #-------------------------------------------------------------------------- def initialize(from = 0) @from = from if KGC::CustomMenuCommand::ITEM_DIC_NUM == 2 @dic_index1 = -1 @dic_index2 = -1 @dic_index3 = -1 elsif KGC::CustomMenuCommand::ITEM_DIC_NUM == 3 @dic_index = [] for i in 0...WD_itemdictionary_ini::C_kind_display_text1.size @dic_index[i] = -1 end end end #-------------------------------------------------------------------------- # ● 元の画面へ戻る #-------------------------------------------------------------------------- def return_scene if @from == 0 $scene = Scene_Map.new else if $game_temp.menu_command_index.has_key?(:item_dictionary) $scene = Scene_Menu.new($game_temp.menu_command_index[:item_dictionary]) else $scene = Scene_Map.new end end end end class Scene_MonsterDictionary < Scene_Base #-------------------------------------------------------------------------- # ● 初期化 #-------------------------------------------------------------------------- def initialize(from = 0) @from = from @dic_index = -1 @page = 1 @last_page = 1 end #-------------------------------------------------------------------------- # ● 元の画面へ戻る #-------------------------------------------------------------------------- def return_scene if @from == 0 $scene = Scene_Map.new else if $game_temp.menu_command_index.has_key?(:monster_dictionary) $scene = Scene_Menu.new($game_temp.menu_command_index[:monster_dictionary]) else $scene = Scene_Map.new end end end end class Scene_Name < Scene_Base def initialize(actor_index = -1) @actor_index = actor_index end #-------------------------------------------------------------------------- # ● 元の画面へ戻る #-------------------------------------------------------------------------- def return_scene if @actor_index == -1 $scene = Scene_Map.new else $scene = Scene_Menu.new($game_temp.menu_command_index[:rename_command]) end end end