#============================================================================== # ■ リネームコマンド ver 1.01 #------------------------------------------------------------------------------ #  配布元: # 白の魔 http://izumiwhite.web.fc2.com/ # #  利用規約: # RPGツクールVXの正規の登録者のみご利用になれます。 # 利用報告・著作権表示とかは必要ありません。 # 改造もご自由にどうぞ。 # 何か問題が発生しても責任は持ちません。 #============================================================================== #-------------------------------------------------------------------------- # ★ 初期設定。 # 各余白のセル数の設定。 #-------------------------------------------------------------------------- module WD_renamecommand_ini Rename_command = "名前変更" #コマンド名 Rename_Length = 6 #リネームの最大文字数 end #-------------------------------------------------------------------------- # ★ 初期設定おわり #-------------------------------------------------------------------------- class Scene_Name < Scene_Base def initialize(actor_index = -1) @actor_index = actor_index end #-------------------------------------------------------------------------- # ● 開始処理(再定義) #-------------------------------------------------------------------------- def start super create_menu_background if @actor_index == -1 @actor = $game_actors[$game_temp.name_actor_id] @edit_window = Window_NameEdit.new(@actor, $game_temp.name_max_char) else @actor = $game_party.members[@actor_index] @edit_window = Window_NameEdit.new(@actor, WD_renamecommand_ini::Rename_Length) end @input_window = Window_NameInput.new end #-------------------------------------------------------------------------- # ● 元の画面へ戻る(再定義) #-------------------------------------------------------------------------- def return_scene if @actor_index == -1 $scene = Scene_Map.new else $scene = Scene_Menu.new(4) end end #-------------------------------------------------------------------------- # ● フレーム更新(再定義) #-------------------------------------------------------------------------- def update super update_menu_background @edit_window.update @input_window.update if Input.repeat?(Input::B) if @edit_window.index > 0 # 文字位置が左端ではない Sound.play_cancel @edit_window.back else if @actor_index != -1 Sound.play_cancel return_scene end end elsif Input.trigger?(Input::C) if @input_window.is_decision # カーソル位置が [決定] の場合 if @edit_window.name == "" # 名前が空の場合 @edit_window.restore_default # デフォルトの名前に戻す if @edit_window.name == "" Sound.play_buzzer else Sound.play_decision end else Sound.play_decision @actor.name = @edit_window.name # アクターの名前を変更 return_scene end elsif @input_window.character != "" # 文字が空ではない場合 if @edit_window.index == @edit_window.max_char # 文字位置が右端 Sound.play_buzzer else Sound.play_decision @edit_window.add(@input_window.character) # 文字を追加 end end end end end class Scene_Menu < Scene_Base #-------------------------------------------------------------------------- # ● コマンドウィンドウの作成(再定義) #-------------------------------------------------------------------------- def create_command_window s1 = Vocab::item s2 = Vocab::skill s3 = Vocab::equip s4 = Vocab::status s5 = Vocab::save s6 = Vocab::game_end s7 = WD_renamecommand_ini::Rename_command @command_window = Window_Command.new(160, [s1, s2, s3, s4, s7, s5, s6]) @command_window.index = @menu_index if $game_party.members.size == 0 # パーティ人数が 0 人の場合 @command_window.draw_item(0, false) # アイテムを無効化 @command_window.draw_item(1, false) # スキルを無効化 @command_window.draw_item(2, false) # 装備を無効化 @command_window.draw_item(3, false) # ステータスを無効化 end if $game_system.save_disabled # セーブ禁止の場合 @command_window.draw_item(5, false) # セーブを無効化 end end #-------------------------------------------------------------------------- # ● コマンド選択の更新(再定義) #-------------------------------------------------------------------------- def update_command_selection if Input.trigger?(Input::B) Sound.play_cancel $scene = Scene_Map.new elsif Input.trigger?(Input::C) if $game_party.members.size == 0 and @command_window.index < 5 Sound.play_buzzer return elsif $game_system.save_disabled and @command_window.index == 5 Sound.play_buzzer return end Sound.play_decision case @command_window.index when 0 # アイテム $scene = Scene_Item.new when 1,2,3,4 # スキル、装備、ステータス、リネーム start_actor_selection when 5 # セーブ $scene = Scene_File.new(true, false, false) when 6 # ゲーム終了 $scene = Scene_End.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 1 # スキル $scene = Scene_Skill.new(@status_window.index) when 2 # 装備 $scene = Scene_Equip.new(@status_window.index) when 3 # ステータス $scene = Scene_Status.new(@status_window.index) when 4 # $scene = Scene_Name.new(@status_window.index) end end end end class Scene_File < Scene_Base #-------------------------------------------------------------------------- # ● 元の画面へ戻る(再定義) #-------------------------------------------------------------------------- def return_scene if @from_title $scene = Scene_Title.new elsif @from_event $scene = Scene_Map.new else $scene = Scene_Menu.new(5) end end end class Scene_End < Scene_Base #-------------------------------------------------------------------------- # ● 元の画面へ戻る(再定義) #-------------------------------------------------------------------------- def return_scene $scene = Scene_Menu.new(6) end end