#============================================================================== # ■ RGSS3 使用不可キャラクターフェイス半透明化&テキスト表示 Ver1.00 by 星潟 #------------------------------------------------------------------------------ # アイテム画面とスキル画面で使用しても効果のないキャラクターは # 顔グラフィックが半透明になり # 使用不可能な事を示すテキストを表示するように仕様を変更します。 # 基本的にデフォルト仕様しか対応していません。 #============================================================================== module T_UNUSE_ITEM #使用できないキャラクターの顔グラフィック上に表示する #テキストを設定します。 WORD = "-DISABLE-" #テキストのY座標表示位置を調整します。 #0〜3までの値が適正範囲です。(小数点設定可) LINE = 3 end class Game_Temp attr_accessor :temp_unuse_item attr_accessor :temp_unuse_actor end class Window_Base < Window #-------------------------------------------------------------------------- # 顔グラフィック描写 #-------------------------------------------------------------------------- alias draw_actor_face_unuse_inv_face draw_actor_face def draw_actor_face(actor, x, y, enabled = true) #使用不可メッセージの表示フラグを設定 flag = false #本来の表示フラグが有効であり #なおかつ、使用者情報及びアイテム情報が存在する場合は #アイテム情報にあるアイテムの使用可否を以て #使用不可メッセージと顔グラフィックの表示フラグを変更する。 if $game_temp.temp_unuse_item != nil && !actor.item_test($game_temp.temp_unuse_actor, $game_temp.temp_unuse_item) enabled = false flag = true end #本来の処理を実行する。 draw_actor_face_unuse_inv_face(actor, x, y, enabled) #使用不可メッセージを描写。 draw_text(x, y + line_height * T_UNUSE_ITEM::LINE, 96, line_height, T_UNUSE_ITEM::WORD, 1) if flag end end class Scene_Base #-------------------------------------------------------------------------- # 終了 #-------------------------------------------------------------------------- alias terminate_unuse_inv_face terminate def terminate #アイテムの情報を消去する。 $game_temp.temp_unuse_item = nil #使用者の情報を消去する。 $game_temp.temp_unuse_actor = nil #本来の処理を実行する。 terminate_unuse_inv_face end end class Scene_ItemBase < Scene_MenuBase #-------------------------------------------------------------------------- # アイテムの決定 #-------------------------------------------------------------------------- alias determine_item_unuse_inv_face determine_item def determine_item #アイテムの情報を記録する。 $game_temp.temp_unuse_item = item #使用者の情報を記録する。 $game_temp.temp_unuse_actor = user #本来の処理を実行する。 determine_item_unuse_inv_face end #-------------------------------------------------------------------------- # サブウィンドウの表示 #-------------------------------------------------------------------------- alias show_sub_window_unuse_inv_face show_sub_window def show_sub_window(window) #サブウィンドウをリフレッシュし、顔グラフィックを変更しておく。 window.refresh #本来の処理を実行する。 show_sub_window_unuse_inv_face(window) end end