class Scene_Training < Scene_TrainingBase #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_help_window create_command_window create_status_window create_item_window end #-------------------------------------------------------------------------- # ● コマンドウィンドウの作成 #-------------------------------------------------------------------------- def create_command_window wy = @help_window.height @command_window = Window_TrainingCommand.new(0, wy) @command_window.viewport = @viewport @command_window.help_window = @help_window @command_window.actor = @actor @command_window.set_handler(:training, method(:command_training)) @command_window.set_handler(:trainingSp, method(:command_training)) @command_window.set_handler(:cancel, method(:return_scene)) @command_window.set_handler(:pagedown, method(:next_actor)) @command_window.set_handler(:pageup, method(:prev_actor)) end #-------------------------------------------------------------------------- # ● ステータスウィンドウの作成 #-------------------------------------------------------------------------- def create_status_window y = @help_window.height @status_window = Window_SkillStatus.new(@command_window.width, y) @status_window.viewport = @viewport @status_window.actor = @actor end #-------------------------------------------------------------------------- # ● アイテムウィンドウの作成 #-------------------------------------------------------------------------- def create_item_window wx = 0 wy = @status_window.y + @status_window.height ww = Graphics.width wh = Graphics.height - wy @training_window = Window_TrainingList.new(wx, wy, ww, wh) @training_window.actor = @actor @training_window.viewport = @viewport @training_window.help_window = @help_window @training_window.set_handler(:ok, method(:use_training)) @training_window.set_handler(:cancel, method(:on_item_cancel)) @command_window.training_window = @training_window end #-------------------------------------------------------------------------- # ● スキルの使用者を取得 #-------------------------------------------------------------------------- def user @actor end #-------------------------------------------------------------------------- # ● コマンド[訓練] #-------------------------------------------------------------------------- def command_training @training_window.activate @training_window.select_last end #-------------------------------------------------------------------------- # ● アイテム[決定] #-------------------------------------------------------------------------- def on_item_ok @actor.last_skill.object = item determine_item end #-------------------------------------------------------------------------- # ● アイテム[キャンセル] #-------------------------------------------------------------------------- def on_item_cancel @training_window.unselect @command_window.activate end #-------------------------------------------------------------------------- # ● アイテム使用時の SE 演奏 #-------------------------------------------------------------------------- def play_se_for_item Sound.play_use_skill end #-------------------------------------------------------------------------- # ● トレーニングセット #-------------------------------------------------------------------------- def use_training super @status_window.refresh @training_window.refresh activate_item_window end #-------------------------------------------------------------------------- # ● アクターの切り替え #-------------------------------------------------------------------------- def on_actor_change @command_window.actor = @actor @status_window.actor = @actor @training_window.actor = @actor @command_window.activate end end