#============================================================================== # ■ XP-RGSS-64 ジョブシステム [ジョブレベル画面] by Claimh #------------------------------------------------------------------------------ # $scene = Scene_JobStatus.new(actor_index, menu_index) # actor_index : アクターIndex(省略時は0) # menu_index : メニューに戻るIndex(省略時はマップに戻る) #============================================================================== #============================================================================== # ■ Window_JobStatus #============================================================================== class Window_JobStatus < Window_Base #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(actor) super(0, 0, 640, 480) self.contents = Bitmap.new(width - 32, height - 32) @column_max = 1 @actor = nil self.actor = actor end #-------------------------------------------------------------------------- # ● アクター変更 #-------------------------------------------------------------------------- def actor=(a) return if @actor == a @actor = a @data = [] for i in 1...$data_classes.size if defined?(JobChange) @data.push($data_classes[i]) if JobChange.enable(@actor.id, i) else @data.push($data_classes[i]) end end refresh end #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- def refresh self.contents.clear return if @actor.nil? # draw_actor_name(@actor, 4, 0) draw_actor_graphic(@actor, 40, 92) #draw_battler_graphic(@actor, 40, 92) draw_actor_class(@actor, 4 + 144, 0) draw_actor_job_level(@actor, 4 + 320, 0) self.contents.font.color = system_color self.contents.draw_text(4 + 100, 48, 80, 32, "EXP") self.contents.draw_text(4 + 400, 48, 80, 32, "NEXT") self.contents.font.color = normal_color self.contents.draw_text(4 + 180, 48, 84, 32, @actor.job.exp_s, 2) self.contents.draw_text(4 + 480, 48, 84, 32, @actor.job.next_rest_exp_s, 2) # self.contents.fill_rect(0, 112, self.contents.width, 2, normal_color) # for i in 0...@data.size d = @data[i] x = 24 + (i % @column_max) * self.contents.width y = 32 * 4 + (i / @column_max) * 32 draw_job_name(d, x, y) draw_actor_job_level_star2(@actor, d.id, x+180, y) draw_actor_job_exp2(@actor, d.id, x+480, y) end end #-------------------------------------------------------------------------- # ● グラフィックの描画 # actor : アクター # x : 描画先 X 座標 # y : 描画先 Y 座標 #-------------------------------------------------------------------------- def draw_battler_graphic(actor, x, y, opacity=255) bitmap = RPG::Cache.battler(actor.battler_name, actor.battler_hue) cw = bitmap.width ch = bitmap.height src_rect = Rect.new(0, 0, cw, ch) self.contents.blt(x, y, bitmap, src_rect, opacity) end end #============================================================================== # ■ Scene_JobStatus #============================================================================== class Scene_JobStatus #-------------------------------------------------------------------------- # ● オブジェクト初期化 #-------------------------------------------------------------------------- def initialize(actor_index=0, index=-1) @actor_index = actor_index @menu_index = index end #-------------------------------------------------------------------------- # ● メイン処理 #-------------------------------------------------------------------------- def main start # 開始処理 Graphics.transition # トランジション実行 loop do Graphics.update # ゲーム画面を更新 Input.update # 入力情報を更新 update # フレーム更新 break if $scene != self # 画面が切り替わったらループを中断 end Graphics.update Graphics.freeze # トランジション準備 terminate # 終了処理 end #-------------------------------------------------------------------------- # ● 開始処理 #-------------------------------------------------------------------------- def start @status_window = Window_JobStatus.new($game_party.actors[@actor_index]) end #-------------------------------------------------------------------------- # ● 終了処理 #-------------------------------------------------------------------------- def terminate @status_window.dispose end #---------------------------------------------------------------------------- # ● シーン終了 #---------------------------------------------------------------------------- def exit_scene $scene = @menu_index < 0 ? Scene_Map.new : Scene_Menu.new(@menu_index) end #---------------------------------------------------------------------------- # ● フレーム更新 #---------------------------------------------------------------------------- def update if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) exit_scene elsif Input.trigger?(Input::R) $game_system.se_play($data_system.cursor_se) @actor_index = (@actor_index + 1) % $game_party.actors.size $scene = Scene_JobStatus.new(@actor_index, @menu_index) elsif Input.trigger?(Input::L) $game_system.se_play($data_system.cursor_se) @actor_index = (@actor_index + $game_party.actors.size - 1) % $game_party.actors.size $scene = Scene_JobStatus.new(@actor_index, @menu_index) end end end