# # * アクター選択の拡張 # # @author : CACAO # @note : Custom Menu Config 項目処理設定 [:actor_select, 選択数, 識別番号] # 例)[ '並び替え', [:actor_select, 2, 0], false, false ], # class Window_CustomMenuStatus #-------------------------------------------------------------------------- # ● 選択中マークの描画 #-------------------------------------------------------------------------- def draw_mark(index) actor = $game_party.members[index] x = index % @column_max * ULW y = index / @column_max * ULH self.contents.clear_rect(x, y, ULW, ULH) self.contents.fill_rect(x, y, ULW, ULH, Color.new(200, 200, 255, 64)) # 項目を描画 for param in TEXT_PARAMS x = param[1] + index % @column_max * ULW y = param[2] + index / @column_max * ULH draw_base_item(actor, x, y, param) # Window 定義項目 self.contents.draw_item(actor, x, y, param) # Canvas 定義項目 end end end class Scene_Menu #-------------------------------------------------------------------------- # ○ コマンド選択の更新 #-------------------------------------------------------------------------- alias _cao_update_command_selection_cm_select update_command_selection def update_command_selection if Input.trigger?(Input::C) && Commands.is_command_usable(@command_window.index) && CMD_SCENE[@command_window.index].is_a?(Array) && CMD_SCENE[@command_window.index][0] == :actor_select Sound.play_decision @selecting = true # 複数アクター選択のフラグ @select_actors = [] # 選択中アクターの配列 start_actor_selection # アクター選択を開始 else _cao_update_command_selection_cm_select end end #-------------------------------------------------------------------------- # ○ アクター選択の更新 #-------------------------------------------------------------------------- alias _cao_update_actor_selection_cm_select update_actor_selection def update_actor_selection if @selecting if Input.trigger?(Input::C) Sound.play_decision # 識別番号で分岐 (選択処理) case CMD_SCENE[@command_window.index][2] when 0 @select_actors << @status_window.index end # 選択数で分岐 (選択数未満ならマーク) if CMD_SCENE[@command_window.index][1] != @select_actors.size @status_window.draw_mark(@status_window.index) else # 識別番号で分岐 (選択完了時の処理) case CMD_SCENE[@command_window.index][2] when 0 $game_party.swap_member(@select_actors[0], @select_actors[1]) @status_window.refresh end end_actor_selection_cm_select end elsif Input.trigger?(Input::B) if @select_actors.empty? # 選択しているアクターがいないなら end_actor_selection_cm_select # アクター選択を終了 else # そうでないなら @select_actors.pop # 最後に追加したアクターを消す end @status_window.refresh # マークを消すためリフレッシュ end else # 複数アクター選択を行わない場合は、元の処理を呼び出す _cao_update_actor_selection_cm_select end end #-------------------------------------------------------------------------- # ● アクター選択の終了 (拡張) #-------------------------------------------------------------------------- def end_actor_selection_cm_select @selecting = false @select_actors.clear end_actor_selection end end