#============================================================================== # ■ 二人パーティ用メニュー変更 ver 1.02 #------------------------------------------------------------------------------ #  配布元: # 白の魔 http://izumiwhite.web.fc2.com/ # #  利用規約: # RPGツクールVXの正規の登録者のみご利用になれます。 # 利用報告・著作権表示とかは必要ありません。 # 改造もご自由にどうぞ。 # 何か問題が発生しても責任は持ちません。 #============================================================================== #-------------------------------------------------------------------------- # ★ 初期設定。 # 立ち絵の表示優先度と位置をズラします。 # このままでも大抵は問題無いハズ…。 # ここをいじっても駄目な場合は画像グラフィックそのものを加工しましょう。 #-------------------------------------------------------------------------- module WD_2actormenu_ini Main_priority = 0 #メインメニューの立ち絵の表示優先度 #1にすると2人目の立ち絵が前方にきます Main_picture_x1 = 0 #メインメニューの1人目の立ち絵のx座標のバイアス Main_picture_y1 = 0 #メインメニューの1人目の立ち絵のy座標のバイアス Main_picture_x2 = 0 #メインメニューの2人目の立ち絵のx座標のバイアス Main_picture_y2 = 0 #メインメニューの2人目の立ち絵のy座標のバイアス Status_picture_x1 = 0 #ステータス画面の立ち絵のx座標のバイアス Status_picture_y1 = 0 #ステータス画面の立ち絵のy座標のバイアス end #-------------------------------------------------------------------------- # ★ 初期設定おわり #-------------------------------------------------------------------------- class Scene_Menu < Scene_Base #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_menu_background @face_window = Window_BackPicture.new(-16, -16) @face_window.opacity = 0 create_command_window @gold_window = Window_Gold.new(0, 360) @status_window = Window_MenuStatus.new(160, 416-128) end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate super dispose_menu_background @command_window.dispose @gold_window.dispose @face_window.dispose @status_window.dispose end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- def update super update_menu_background @command_window.update @gold_window.update @face_window.update @status_window.update if @command_window.active update_command_selection elsif @status_window.active update_actor_selection end end end class Scene_Skill < Scene_Base #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_menu_background @actor = $game_party.members[@actor_index] @viewport = Viewport.new(0, 0, 544, 416) @target_window = Window_MenuStatus.new(160, 416-128) @help_window = Window_Help.new @help_window.viewport = @viewport @status_window = Window_SkillStatus.new(0, 56, @actor) @status_window.viewport = @viewport @skill_window = Window_Skill.new(0, 112, 544, 304, @actor) @skill_window.viewport = @viewport @skill_window.help_window = @help_window hide_target_window end #-------------------------------------------------------------------------- # ● ターゲットウィンドウの表示 # ※右寄せとかしません #-------------------------------------------------------------------------- def show_target_window(right) @skill_window.active = false @target_window.visible = true @target_window.active = true end end class Scene_Item < Scene_Base #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start super create_menu_background @viewport = Viewport.new(0, 0, 544, 416) @target_window = Window_MenuStatus.new(150, 416-128) @help_window = Window_Help.new @help_window.viewport = @viewport @item_window = Window_Item.new(0, 56, 544, 360) @item_window.viewport = @viewport @item_window.help_window = @help_window @item_window.active = false hide_target_window end #-------------------------------------------------------------------------- # ● ターゲットウィンドウの表示 # ※右寄せとかしません #-------------------------------------------------------------------------- def show_target_window(right) @item_window.active = false @target_window.visible = true @target_window.active = true end end #============================================================================== # ■ Window_BackPicture #------------------------------------------------------------------------------ #  立ち絵をバッググラウンドに表示するウィンドウです。 #============================================================================== class Window_BackPicture < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 # x : ウィンドウの X 座標 # y : ウィンドウの Y 座標 #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 600, 500) refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.members.size bitmap = [] rect = [] x = [] y = [] i = 0 for actor in $game_party.members bitmap[i] = Cache.picture(actor.face_name) rect[i] = Rect.new(0, 0, bitmap[i].width, bitmap[i].height) x[i]=176*i+272-(bitmap[i].width)/2 y[i]=416-bitmap[i].height i += 1 end x[0] += WD_2actormenu_ini::Main_picture_x1 x[1] += WD_2actormenu_ini::Main_picture_x2 if $game_party.members.size > 1 y[0] += WD_2actormenu_ini::Main_picture_y1 y[1] += WD_2actormenu_ini::Main_picture_y2 if $game_party.members.size > 1 if WD_2actormenu_ini::Main_priority == 0 self.contents.blt(x[1], y[1], bitmap[1], rect[1]) if $game_party.members.size > 1 self.contents.blt(x[0], y[0], bitmap[0], rect[0]) elsif WD_2actormenu_ini::Main_priority == 1 self.contents.blt(x[0], y[0], bitmap[0], rect[0]) self.contents.blt(x[1], y[1], bitmap[1], rect[1]) if $game_party.members.size > 1 end end end class Window_MenuStatus < Window_Selectable #-------------------------------------------------------------------------- # ● オブジェクト初期化 # x : ウィンドウの X 座標 # y : ウィンドウの Y 座標 #-------------------------------------------------------------------------- def initialize(x, y) super(x, y, 384, 128) @column_max=2 refresh self.active = false self.index = -1 end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear @item_max = $game_party.members.size for actor in $game_party.members x = actor.index * contents.width/2 + 20 y = 0 draw_actor_name(actor, x-16, y) draw_actor_level(actor, x + 88, y ) draw_actor_state(actor, x, y + WLH * 3) draw_actor_hp(actor, x + 12, y + WLH*1) draw_actor_mp(actor, x + 12, y + WLH*2) end end #-------------------------------------------------------------------------- # ● カーソルの更新 #-------------------------------------------------------------------------- def update_cursor if @index < 0 # カーソルなし self.cursor_rect.empty elsif @index < @item_max # 通常 self.cursor_rect.set(@index * contents.width/2, 0, contents.width/2, 96) elsif @index >= 100 # 自分 self.cursor_rect.set((@index - 100) * contents.width/2, 0, contents.width/2, 96) else # 全体 self.cursor_rect.set(0, 0, contents.width, 96) end end #-------------------------------------------------------------------------- # ● 名前の描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_actor_name(actor, x, y) self.contents.font.color = hp_color(actor) self.contents.draw_text(x, y, 98, WLH, actor.name) end end class Window_Status < Window_Base #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear draw_actor_picture draw_actor_name(@actor, 4, 0) draw_actor_class(@actor, 128, 0) draw_basic_info(32, 32) draw_parameters(32, 136) draw_exp_info(288, 0) draw_equipments(32, 236) end #-------------------------------------------------------------------------- # ● 立ち絵の表示 # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_actor_picture bitmap1 = Cache.picture(@actor.face_name) rect1 = Rect.new(0, 0, bitmap1.width, bitmap1.height) x = 360-bitmap1.width/2 + WD_2actormenu_ini::Status_picture_x1 y = 384-bitmap1.height + WD_2actormenu_ini::Status_picture_y1 self.contents.blt(x, y, bitmap1, rect1) end end