Need help on a equipment script please

Hello,

I need help with an equipment menu script. I took the script from the demo: EvilEagles Ys.

Here is an example of what I'm doing:
menu_equipement_bug01.png


But if I select another location, the menu keeps part of the old image :
menu_equipement_bug02.png

 
The script :

Spoiler
Code:
#==============================================================================# ■ MenuLuna#==============================================================================module MenuLuna  module EquipMenu            # -----------------------------------------------------------------    # This method allows you to modify the Categories Window    # -----------------------------------------------------------------    def self.user_command_text(index, contents, item_rect, enable, select)		# Do your magic here!    end    # -----------------------------------------------------------------    # This method allows you to modify the Item List Window    # -----------------------------------------------------------------    def self.user_item_text(item, contents, item_rect, enable, select)		# Do your magic here!    end    # -----------------------------------------------------------------    # This method allows you to modify Window Slot    # -----------------------------------------------------------------    def self.user_slot_text(index, item, contents, item_rect, enable, select)		# Do your magic here!    end    # -----------------------------------------------------------------    # This method allows you to modify Window_Status    # -----------------------------------------------------------------    def self.user_status_text(actor, temp_actor, contents)		# Do your magic here!    end    # -----------------------------------------------------------------    # This method allows you to modify the Window_Description    # -----------------------------------------------------------------    def self.user_description_text(item, contents)		# Do your magic here!    end                    # return array contains text/bitmap data          # result = [    #  [Text, [X, Y], [FontName, FontSize, FontBold, FontItalic], [R, G, B(, A)]],    # ]        # replace text with $bitmap[Folder, Filename] for draw bitmap    # Folder must be in Graphics and Filename must be in Folder    # For example: $bitmap[System, GoldIcon] for Graphics/System/GoldIcon.png    # Bitmap doesn't need [FontName, FontSize, FontBold, FontItalic] & [R, G, B(, A)]    # & [Width, Align] but take an opacity option    # For source rect, use bw for bitmap width, bh for bitmap height    # If Opacity and/or Src_rect, it will take opacity of 255 and bitmap original    # rect as values.    # ["$bitmap[Folder, FileName]", [X, Y], Opacity, Src_rect]    # ["$bitmap[System, GoldIcon]", [128, 0], 255, [0, 0, "bw * 0.5", "bh"]]    # ["$bitmap[System, GoldIcon]", [128, 0], 255, [0, 0, 128, 42]]                  # replace $bitmap[Folder, "Filename"] with $color[R, G, B]    # for solid color background              # replace $bitmap[Folder, "Filename"] with $horgrad[R1, G1, B1, R2, G2, B2]    # for gradient color background horizontal              # replace $bitmap[Folder, "Filename"] with $vergrad[R1, G1, B1, R2, G2, B2]    # for gradient color background vertical        # replace text with $icon[index] for draw icon    # icon doesn't need [FontName, FontSize, FontBold, FontItalic] & [R, G, B(, A)]    # & [Width, Align] but take an opacity option    # ["$icon[Index]", [X, Y], Opacity]    # ["$icon[10]", [128, 0], 255]        # [X, Y] will be offsets base on item_rect        # use item as a reference for current drawing item.        # contents refers to window's contents bitmap        def self.user_command_text(index, contents, item_rect, enable, select)    end    def self.user_item_text(item, contents, item_rect, enable, select)       Return result      if item        result = [          ["$bitmap[System, SkillBoard]", [item_rect.x+2, item_rect.y+2], 255, [0, 0, "bw", "bh"]],          ["$icon[#{item.icon_index}]", [item_rect.x+2, item_rect.y+2], 255],          ["#{item.name}", [item_rect.x+27, item_rect.y+5], [item_rect.width-64, 0], [255, 255, 255], ["Visitor TT2 BRK", 18, false, false], [255, 255, 255, 0]],        ]      end      result    end        def self.user_slot_text(index, item, contents, item_rect, enable, select)      case index        when 0; img = select ? "EquipWeapon" : "Equip_Inactive"        when 1; img = select ? "EquipShield" : "Equip_Inactive"        when 2; img = select ? "EquipOcc"  : "Equip_Inactive"        when 3; img = select ? "EquipArmor"    : "Equip_Inactive"        when 4; img = select ? "EquipAcc"    : "Equip_Inactive"      end           bg = select ? "ItemSlot_Selected" : "ItemSlot_Normal"            result = [        ["$bitmap[System, #{img}]", [- 220, -12], 255, [0, 0, "bw", "bh"]],        ["$bitmap[System, #{bg}]", [item_rect.x + 145, item_rect.y + 2 + 2 * index], 255, [0, 0, "bw", "bh"]],]      [item_rect.x, item_rect.y + 12 + 2 * index]      [item_rect.x + 145, item_rect.y + 2 + 2 * index]      if item        result.push(["$bitmap[Icons, #{item.name}]", [item_rect.x + 145, item_rect.y + 2 + 2 * index], 255, [0, 0, "bw", "bh"]],)      end            result    end        def self.user_status_text(actor, temp_actor, contents)      if actor               result = [          ["$bitmap[Faces, SecondStatus_#{actor.actor.id}]", [0, 0], 255, [0, 0, "bw", "bh"]],        ]        6.times { |i|          result.push(          ["#{Vocab.param(i+2)}", [28, 136 + i * 30], [contents.width, 0], [229,220,145], ["Visitor TT2 BRK", 18, false, false], [255, 255, 255, 0]],          ["#{actor.param(i+2)}", [96, 136 + i * 30], [contents.width, 0], [255,255,255], ["Visitor TT2 BRK", 18, false, false], [255, 255, 255, 0]],          )        }      end            if temp_actor        6.times { |i|          if temp_actor.param(i+2) > actor.param(i+2)             color = [0,183,229]          elsif temp_actor.param(i+2) == actor.param(i+2)            color = [255, 255, 255]          else            color = [255,107,79]          end          result.push(          ["> #{temp_actor.param(i+2)}", [136, 136 + i * 30], [contents.width, 0], color, ["Visitor TT2 BRK", 18, false, false], [255, 255, 255, 0]],          )        }      end            result ||= []      result    end        # Text for Description Window    def self.user_description_text(item, contents)      if item        result = [                   ["#{item.name}",               [12, 6], [520, 0], [255, 255, 255, 255], ["Visitor TT2 BRK", 16, false, false], [255, 255, 255, 0]],        ]        item.description.split(/[\r\n]+/).each_with_index { |line, i|          result.push(["#{line}",               [12, i * 24 + 32], [520, 0], [255, 255, 255], ["Visitor TT2 BRK", 14, false, false], [255, 255, 255, 0]],          )        }        return result      else        return []      end    end  endend
I hope my English is correct. Thank you in advance for your answers.

Original thread: https://forums.rpgmakerweb.com/threads/need-help-on-a-equipment-script-please.44214/