#============================================================================== # ■ アイテム区分 #------------------------------------------------------------------------------ # アイテムをほかのアイテムと区別させられる: # 1.購入画面で色が他と違う+値段が現れない+買えない # 2.購入画面で選択してもステータス画面は空白 # 3.アイテム画面で選択しても個数は表示されない # 4.装備画面で選択しても装備できない # 5.価格を0にして売れないようにすれば買えない売れないまるで「のろいのあいてむ」 # 使い道:「回復アイテム」、「剣」のようにアイテムを仕分けるアイテムが欲しい時 # ショップ、アイテム画面、装備画面で使えるかと # # *月の下の宿 # URL:http://gekkasou.shiteyattari.com/ #============================================================================== module An_SI #メモ欄に入れる文字列 Str = "*SpecialItem" #変更する色 TColor = 1 end #============================================================================== # ■ Window_Item #============================================================================== class Window_Item < Window_Selectable include An_SI #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- alias an_si_draw_item draw_item def draw_item(index) an_si_draw_item(index) rect = item_rect(index) if @data[index] != nil && @data[index].note.include?(Str) self.contents.clear_rect(rect.x + 172, rect.y, rect.width - 172, WLH) end contents.font.color = normal_color end #-------------------------------------------------------------------------- # ● アイテム名の描画 #-------------------------------------------------------------------------- def draw_item_name(item, x, y, enabled = true) if item != nil self.contents.font.color = normal_color if item.note.include?(Str) self.contents.font.color = text_color(TColor) enabled = true end self.contents.font.color.alpha = enabled ? 255 : 128 draw_icon(item.icon_index, x, y, enabled) self.contents.draw_text(x + 24, y, 172, WLH, item.name) end end end #============================================================================== # ■ Window_ShopBuy #============================================================================== class Window_ShopBuy < Window_Selectable include An_SI #-------------------------------------------------------------------------- # ● 項目の描画 #-------------------------------------------------------------------------- alias an_si_draw_item draw_item def draw_item(index) an_si_draw_item(index) rect = item_rect(index) if @data[index].note.include?(Str) self.contents.clear_rect(172, rect.y, rect.width - 172, WLH) end end #-------------------------------------------------------------------------- # ● アイテム名の描画 #-------------------------------------------------------------------------- def draw_item_name(item, x, y, enabled = true) if item != nil self.contents.font.color = normal_color if item.note.include?(Str) self.contents.font.color = text_color(TColor) enabled = true end self.contents.font.color.alpha = enabled ? 255 : 128 draw_icon(item.icon_index, x, y, enabled) self.contents.draw_text(x + 24, y, 172, WLH, item.name) end end end #============================================================================== # ■ Window_ShopStatus。 #============================================================================== class Window_ShopStatus < Window_Base #-------------------------------------------------------------------------- # ● リフレッシュ #-------------------------------------------------------------------------- alias an_si_refresh refresh def refresh self.contents.clear if @item != nil && @item.note.include?(An_SI::Str) self.cursor_rect.empty return end an_si_refresh end end #============================================================================== # ■ Scene_Equip #============================================================================== class Scene_Equip < Scene_Base #-------------------------------------------------------------------------- # ● ステータスウィンドウの更新 #-------------------------------------------------------------------------- alias an_si_update_status_window update_status_window def update_status_window an_si_update_status_window if @item_window != nil && @item_window.item != nil && @item_window.item.note.include?(An_SI::Str) array = [nil, nil, nil, nil] loop do begin @status_window.set_new_parameters(*array) break rescue array.push(nil) end end @status_window.update return end end #-------------------------------------------------------------------------- # ● アイテム選択の更新 #-------------------------------------------------------------------------- alias an_si_update_item_selection update_item_selection def update_item_selection if Input.trigger?(Input::C) && @item_window.item != nil? && @item_window.item.note.include?(An_SI::Str) Sound.play_buzzer return end an_si_update_item_selection end end #============================================================================== # ■ Scene_Shop #============================================================================== class Scene_Shop < Scene_Base #-------------------------------------------------------------------------- # ● 購入アイテム選択の更新 #-------------------------------------------------------------------------- alias an_si_update_buy_selection update_buy_selection def update_buy_selection if Input.trigger?(Input::C) && @buy_window.item.note.include?(An_SI::Str) Sound.play_buzzer return end an_si_update_buy_selection end #-------------------------------------------------------------------------- # ● フレーム更新 #-------------------------------------------------------------------------- alias an_si_update update def update an_si_update if @buy_window.item != nil && @buy_window.item.note.include?(An_SI::Str) @status_window.cursor_rect.empty end end end #Ver1.01