#============================================================================== # □ ステート表示拡張 (for VX Ace) #------------------------------------------------------------------------------ # Version : 1_20120112 # by サリサ・タイクーン # http://www.tycoon812.com/rgss/ #============================================================================== #============================================================================== # □ 素材スイッチ #============================================================================== $rgsslab = {} if $rgsslab == nil $rgsslab["ステート表示拡張"] = true if $rgsslab["ステート表示拡張"] #============================================================================== # □ カスタマイズポイント #============================================================================== module RGSSLAB end module RGSSLAB::State_Display_Extension #-------------------------------------------------------------------------- # ○ ステート描画設定 # 0 : デフォルト(アイコン表示) # 1 : テキスト表示(RPGツクールXP式) # # 上記以外の値は、全て0扱いとなります。 # # ・イベントコマンドのスクリプトでの変更方法 # $game_system.rgsslab014.display_type = 値 #-------------------------------------------------------------------------- DISPLAY_TYPE = 1 end # カスタマイズポイントは、ここまで #============================================================================== # □ RGSSLAB::State_Display_Extension [module] #============================================================================== module RGSSLAB::State_Display_Extension #-------------------------------------------------------------------------- # ○ 素材設定用の定数定義 #-------------------------------------------------------------------------- MATERIAL_NAME = "ステート表示拡張" VERSION = 1 RELEASE = 20120112 end #============================================================================== # ■ Game_System [class] #============================================================================== class Game_System #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :rgsslab014 #-------------------------------------------------------------------------- # ● オブジェクト初期化 [エイリアス] #-------------------------------------------------------------------------- alias state_display_extension_initialize initialize def initialize state_display_extension_initialize @rgsslab014 = RgssLab_014.new end end #============================================================================== # □ RgssLab_014 [class] #============================================================================== class RgssLab_014 #-------------------------------------------------------------------------- # ○ モジュールの設定 #-------------------------------------------------------------------------- RGSSLAB_014 = RGSSLAB::State_Display_Extension #-------------------------------------------------------------------------- # ● 公開インスタンス変数 #-------------------------------------------------------------------------- attr_accessor :display_type #-------------------------------------------------------------------------- # ○ オブジェクト初期化 #-------------------------------------------------------------------------- def initialize @display_type = RGSSLAB_014::DISPLAY_TYPE end end #============================================================================== # ■ Window_BattleStatus [class] #============================================================================== class Window_BattleStatus < Window_Selectable #-------------------------------------------------------------------------- # ○ ステートおよび強化/弱体のアイコンを描画 [オーバーライド] #-------------------------------------------------------------------------- def draw_actor_icons(actor, x, y, width = 96) case $game_system.rgsslab014.display_type when 1 text = make_battler_state_text(actor, width) contents.font.color = actor.hp == 0 ? knockout_color : normal_color contents.draw_text(x, y, width, line_height, text) else return super end end #-------------------------------------------------------------------------- # ○ 描画用のステート文字列作成 # actor : アクター # width : 描画先の幅 #-------------------------------------------------------------------------- def make_battler_state_text(battler, width) brackets_width = contents.text_size("[]").width text = "" for i in battler.states if i.priority >= 1 if text == "" text = i.name else new_text = text + "/" + i.name text_width = self.contents.text_size(new_text).width if text_width > width - brackets_width break end text = new_text end end end if text == "" text = "[正常]" else text = "[" + text + "]" end return text end end end