#============================================================================== # ■ RGSS3 説明文の行数を増やす Ver1.37 by ComtaroRGSS(@ComtaroRgss) #------------------------------------------------------------------------------ # メモ欄を用いることで、RPG::BaseItemに属する全ての要素 # (アクター・スキル・アイテム・武器・防具) # (職業・エネミー・ステートも念のため) # に3行以上の説明文を設定させることができます。 # また、それに伴いステータス画面を改造し、ヘルプウィンドウの行数も # 場面に合わせた最大行数に設定します。 # メモ欄に # # ~ # # と記述することで、説明文を設定させられます。 #============================================================================== #__END__ $imported ||= {} $imported[:cs_description] = true # 設定項目ここから module Comtaro def self.status_scroll_speed # ステータス画面におけるスクロール速度(単位:ピクセル毎フレーム) return 4 end end # 設定項目ここまで class RPG::BaseItem alias cs_description description def description /(?:\r\n)*(.+)<\/Description>/m =~ self.note ? $1 : self.cs_description end end #============================================================================== # ■ Window_Status #------------------------------------------------------------------------------ #  ステータス画面で表示する、フル仕様のステータスウィンドウです。 #============================================================================== class Window_Status < Window_Selectable #-------------------------------------------------------------------------- # ● パーティメンバー内で最大の行数を取得 #-------------------------------------------------------------------------- def max_line @lines = [] $game_party.members.each{|member| @line_num = 0 member.description.each_line{|line|@line_num += 1} @lines.push(@line_num)} @lines.max end #-------------------------------------------------------------------------- # ● 下端パディングの更新 #-------------------------------------------------------------------------- def update_padding_bottom self.padding_bottom = self.padding end #-------------------------------------------------------------------------- # ● ウィンドウ内容の高さを計算 #-------------------------------------------------------------------------- def contents_height (max_line + 14) * line_height end #-------------------------------------------------------------------------- # ● アクターの設定 #-------------------------------------------------------------------------- def actor=(actor) return if @actor == actor @actor = actor self.oy = 0 refresh end #-------------------------------------------------------------------------- # ● カーソルの移動処理 #-------------------------------------------------------------------------- def process_cursor_move self.oy += Comtaro.status_scroll_speed if Input.press?(:DOWN) && self.oy < contents_height + standard_padding * 2 - self.height self.oy -= Comtaro.status_scroll_speed if Input.press?(:UP) && self.oy > 0 end end #============================================================================== # ■ Scene_Item #------------------------------------------------------------------------------ #  アイテム画面の処理を行うクラスです。 #============================================================================== class Scene_Item < Scene_ItemBase #-------------------------------------------------------------------------- # ● 最大の行数を取得 #-------------------------------------------------------------------------- def max_line @lines = [] @items = ($data_items + $data_weapons + $data_armors).flatten @items.each{|item| @line_num = 0 item.description.each_line{|line|@line_num += 1} rescue nil @lines.push(@line_num)} @lines.max end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの作成 #-------------------------------------------------------------------------- def create_help_window @help_window = Window_Help.new(max_line) @help_window.viewport = @viewport end end #============================================================================== # ■ Scene_Skill #------------------------------------------------------------------------------ #  スキル画面の処理を行うクラスです。処理共通化の便宜上、スキルも「アイテム」 # として扱っています。 #============================================================================== class Scene_Skill < Scene_ItemBase #-------------------------------------------------------------------------- # ● 最大の行数を取得 #-------------------------------------------------------------------------- def max_line @lines = [] @items = $data_skills @items.each{|item| @line_num = 0 item.description.each_line{|line|@line_num += 1} rescue nil @lines.push(@line_num)} @lines.max end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの作成 #-------------------------------------------------------------------------- def create_help_window @help_window = Window_Help.new(max_line) @help_window.viewport = @viewport end end #============================================================================== # ■ Scene_Equip #------------------------------------------------------------------------------ #  装備画面の処理を行うクラスです。 #============================================================================== class Scene_Equip < Scene_MenuBase #-------------------------------------------------------------------------- # ● 最大の行数を取得 #-------------------------------------------------------------------------- def max_line @lines = [] @items = ($data_weapons + $data_armors).flatten @items.each{|item| @line_num = 0 item.description.each_line{|line|@line_num += 1} rescue nil @lines.push(@line_num)} @lines.max end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの作成 #-------------------------------------------------------------------------- def create_help_window @help_window = Window_Help.new(max_line) @help_window.viewport = @viewport end end #============================================================================== # ■ Scene_Shop #------------------------------------------------------------------------------ #  ショップ画面の処理を行うクラスです。 #============================================================================== class Scene_Shop < Scene_MenuBase #-------------------------------------------------------------------------- # ● 最大の行数を取得 #-------------------------------------------------------------------------- def max_line @lines = [] @items = ($data_items + $data_weapons + $data_armors).flatten @items.each{|item| @line_num = 0 item.description.each_line{|line|@line_num += 1} rescue nil @lines.push(@line_num)} @lines.max end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの作成 #-------------------------------------------------------------------------- def create_help_window @help_window = Window_Help.new(max_line) @help_window.viewport = @viewport end end #============================================================================== # ■ Scene_Battle #------------------------------------------------------------------------------ #  バトル画面の処理を行うクラスです。 #============================================================================== class Scene_Battle < Scene_Base #-------------------------------------------------------------------------- # ● 最大の行数を取得 #-------------------------------------------------------------------------- def max_line @lines = [] @items = ($data_items + $data_weapons + $data_armors + $data_skills).flatten @items.each do |item| @line_num = 0 item.description.each_line{|line|@line_num += 1} rescue nil @lines.push(@line_num) end if $imported[:cs_battle_command_invisible] @items = Comtaro.help_for_skill.clone @items << Comtaro.help_for_item << Comtaro.help_for_escape << Comtaro.help_for_change << Comtaro.help_for_auto @items.each do |item| @line_num = 0 item.each_line{|line|@line_num += 1} rescue nil @lines.push(@line_num) end end @lines.max end #-------------------------------------------------------------------------- # ● ヘルプウィンドウの作成 #-------------------------------------------------------------------------- def create_help_window @help_window = Window_Help.new(max_line) @help_window.visible = false end end