########################################## Kaimonkey's Modifed Item/Equip Merge, with Food# For Strangling################USAGE###################### For items to appear in the "Food" tab, put # <is_food># in their note box##############CONFIG########################### Confirm Message:$item_confirm_message = "Have %s equip %s?"# Horizontal Icon Offset # (How many pixels, to the right, to move the icon. Use negitive to# move left)$icon_offset = 10# Item Confirm Width$item_confirm_width = 425#############################################class Window_ItemCategory < Window_HorzCommand def make_command_list add_command(Vocab::item, :item) add_command("Food", :food) add_command(Vocab::weapon, :weapon) end def col_max return 3 endendclass Window_ItemList < Window_Selectable #-------------------------------------------------------------------------- # * Include in Item List? #-------------------------------------------------------------------------- def include?(item) case @category when :item item.is_a?(RPG::Item) && !item.note.include?("<is_food>") when :weapon item.is_a?(RPG::Weapon) when :food item.is_a?(RPG::Item)&& item.note.include?("<is_food>") else false end end def enable?(item) if item.is_a?(RPG::Weapon) return can_equip?(item) else return $game_party.usable?(item) end end def can_equip?(weapon) $game_party.members.any?{|m| m.equippable?(weapon) } end def make_item_list @data = $game_party.all_items.select {|item| include?(item) } @data.push(nil) if include?(nil) @data.sort_by!{|d| enable?(d) ? 0 : 1} endendclass Scene_Item < Scene_ItemBase def start super create_help_window create_category_window create_item_window create_confirm_window end def create_confirm_window @window_confirm = Window_Item_Confirm.new($item_confirm_width,80) @window_confirm.z = 200 @window_confirm.back_opacity = 255 @window_confirm.refresh @window_confirm.visible = false @window_confirm.set_handler(:ok, method(:on_confirm)) @window_confirm.set_handler(:cancel, method(:cancel_confirm)) end def on_confirm if @window_confirm.index == 0 Sound.play_equip @window_confirm.actor.change_equip(0,@window_confirm.item) @window_confirm.deactivate @window_confirm.visible = false @item_window.activate @item_window.refresh else cancel_confirm end end def cancel_confirm Sound.play_cancel @window_confirm.visible = false @window_confirm.deactivate @item_window.activate end def on_item_ok if item.is_a?(RPG::Weapon) @window_confirm.visible = true actor = $game_party.members.find{|m| m.equippable?(item)} @window_confirm.set_args(actor,item) @window_confirm.activate @window_confirm.refresh else $game_party.last_item.object = item determine_item end end endclass Window_Item_Confirm < Window_Selectable attr_accessor :actor attr_accessor :item def initialize(width, height) super((Graphics.width-width)/2,(Graphics.height-height)/2,width,height) @index = 0 end def set_args(actor,item) @item = item @actor = actor end def col_max 2 end def item_max 2 end def item_rect(index) rect = Rect.new rect.width = contents_width/2 rect.height = line_height rect.x = ((contents_width)/2)*index rect.y = contents_height-rect.height rect end def draw_item(index) rect = item_rect(index) if index == 0 text = "Ok" else text = "Cancel" end draw_text(rect.x,rect.y,rect.width,line_height,text,1) end def refresh contents.clear if @actor && @item text = sprintf($item_confirm_message,@actor.name, "<>"[email hidden]) cx = text_size(text.split("<>")[0]).width text = sprintf($item_confirm_message,@actor.name, " "[email hidden]) draw_text_ex(0,0,text) draw_icon(@item.icon_index,cx+$icon_offset,0) end draw_all_items end end