I'm using this ring menu script and after I've gone through a battle, even if I escape right away, the ring menu stops working. The game crashes and it gives me an error message like "Script 'ringmenu' line 352: RGSSError occurred disposed bitmap."
I'm using a whole bunch of other scripts. But though the process of elimination I've figured out that it's the Sideview Battle System Tankentai XP that's messing it up.
viewtopic.php?f=11&t=60521&start=0&hilit=sideview+enemies
Especially the part that mentions that advanced menus won't work. x.x So I'm asking if anyone can maybe find some fix to the problem? Just in case.
Though now that I think about it it might not have to do with that at all. But still, anyone got any idea?
I'm using a whole bunch of other scripts. But though the process of elimination I've figured out that it's the Sideview Battle System Tankentai XP that's messing it up.
viewtopic.php?f=11&t=60521&start=0&hilit=sideview+enemies
Especially the part that mentions that advanced menus won't work. x.x So I'm asking if anyone can maybe find some fix to the problem? Just in case.
Code:
#------------------------------------------------------------------------------
# Â Ring_Menu
#------------------------------------------------------------------------------
# Â By: Â XRXS, Dubealex, and Hypershadow180
#------------------------------------------------------------------------------
class Scene_Menu
#------------------------------------------------------------------------------
# Â Initialize
#------------------------------------------------------------------------------
 def initialize(menu_index = 0)
  @menu_index = menu_index
  $location_text=[]
  $gold_text=[]
  $window_size=[]
  $ring_menu_text=[]
  $chara_select=[]
  @window_opacity=[]
  @chara_select=[]
  @window_position=[]
  $location_text[0]="Calibri" # Font Type
  $location_text[1]=24 # Font Size
  $location_text[2]=0 # Location Title Color
  $location_text[4]=0 # Map Name Color
  $location_text[3]="Location:" # Text
  $gold_text[0]="Calibri" # Font Type
  $gold_text[1]=20 # Font Size
  $gold_text[2]=0 # Gold Title Color
  $gold_text[3]=0 # Gold Color
  $gold_text[4]="Gold" # Text
  @window_opacity[0]=255 # Border Opacity
  @window_opacity[1]=130 # Background Opacity
  $window_location_skin="001-Blue01" # Location Windowskin
  $window_gold_skin="001-Blue01" # Gold Windowskin
  @window_position[0]=0 # X Axis Position
  @window_position[1]=0 # Location Y Axis Position
  @window_position[2]=384 # Gold Y Axis Position
  $window_size[0]=160 # Length
  $window_size[1]=96 # Height
  $ring_menu_text[0]="Calibri" # Font Type
  $ring_menu_text[7]=0 # Font Color
  $ring_menu_text[8]=20 # Font Size
  $ring_menu_text[1]="Items"
  $ring_menu_text[2]="Skills"
  $ring_menu_text[3]="Equip"
  $ring_menu_text[4]="Stats"
  $ring_menu_text[5]="Save"
  $ring_menu_text[6]="Quit"
  @chara_select[0]=408 # X Axis Position
  @chara_select[1]=0 # Y Axis Position
  $chara_select[0]="Calibri" # Font Type
  $chara_select[1]=0 # Font Color
  $chara_select[5]=24 # Font Size
  $chara_select[2]=255 # Border Opacity
  $chara_select[3]=130 # Background Opacity
  $chara_select[4]="001-Blue01" # Windowskin
 end
#------------------------------------------------------------------------------
# Â Main
#------------------------------------------------------------------------------
 def main
  @window_location = Window_Location.new
  @window_location.x = @window_position[0]
  @window_location.y = @window_position[1]
  @window_location.opacity = @window_opacity[0]
  @window_location.back_opacity = @window_opacity[1]
  @window_gold = Window_MenuGold.new
  @window_gold.x = @window_position[0]
  @window_gold.y = @window_position[2]
  @window_gold.opacity = @window_opacity[0]
  @window_gold.back_opacity = @window_opacity[1]
  @spriteset = Spriteset_Map.new
  px = $game_player.screen_x - 15
  py = $game_player.screen_y - 24
  @command_window = Window_RingMenu.new(px,py)
  @command_window.index = @menu_index
  if $game_party.actors.size == 0
   @command_window.disable_item(0)
   @command_window.disable_item(1)
   @command_window.disable_item(2)
   @command_window.disable_item(3)
  end
  @command_window.z = 100
  if $game_system.save_disabled
   @command_window.disable_item(4)
  end
  @status_window = Window_RingMenuStatus.new
  @status_window.x = @chara_select[0]
  @status_window.y = @chara_select[1]
  @status_window.z = 200
  @status_window.opacity=$chara_select[2]
  @status_window.back_opacity=$chara_select[3]
  @status_window.visible = false
  Graphics.transition
  loop do
   Graphics.update
   Input.update
   update
   if $scene != self
    break
   end
  end
  Graphics.freeze
  @spriteset.dispose
  @window_location.dispose
  @window_gold.dispose
  @command_window.dispose
  @status_window.dispose
 end
#------------------------------------------------------------------------------
# Â Update
#------------------------------------------------------------------------------
 def update
  @window_location.update
  @window_gold.update
  @command_window.update
  @status_window.update
  if @command_window.active
   update_command
   return
  end
  if @status_window.active
   update_status
   return
  end
 end
#------------------------------------------------------------------------------
# Â Update Comman
#------------------------------------------------------------------------------
 def update_command
  if Input.trigger?(Input::B)
   $game_system.se_play($data_system.cancel_se)
   $scene = Scene_Map.new
   return
  end
  if Input.trigger?(Input::C)
   if $game_party.actors.size == 0 and @command_window.index < 4
    $game_system.se_play($data_system.buzzer_se)
    return
   end
  case @command_window.index
  when 0
   $game_system.se_play($data_system.decision_se)
   $scene = Scene_Item.new
  when 1
   $game_system.se_play($data_system.decision_se)
   @command_window.active = false
   @status_window.active = true
   @status_window.visible = true
   @status_window.index = 0
  when 2
   $game_system.se_play($data_system.decision_se)
   @command_window.active = false
   @status_window.active = true
   @status_window.visible = true
   @status_window.index = 0
  when 3
   $game_system.se_play($data_system.decision_se)
   @command_window.active = false
   @status_window.active = true
   @status_window.visible = true
   @status_window.index = 0
  when 4
   if $game_system.save_disabled
    $game_system.se_play($data_system.buzzer_se)
    return
   end
   $game_system.se_play($data_system.decision_se)
   $scene = Scene_Save.new
  when 5
   $game_system.se_play($data_system.decision_se)
   $scene = Scene_End.new
  end
  return
 end
 return if @command_window.animation?
  if Input.press?(Input::UP) or  Input.press?(Input::LEFT)
   $game_system.se_play($data_system.cursor_se)
   @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)
   return
  end
  if Input.press?(Input::DOWN) or  Input.press?(Input::RIGHT)
   $game_system.se_play($data_system.cursor_se)
   @command_window.setup_move_move(Window_RingMenu::MODE_MOVER)
   return
  end
 end
#------------------------------------------------------------------------------
# Â Update Status
#------------------------------------------------------------------------------
 def update_status
  if Input.trigger?(Input::B)
   $game_system.se_play($data_system.cancel_se)
   @command_window.active = true
   @status_window.active = false
   @status_window.visible = false
   @status_window.index = -1
   return
  end
  if Input.trigger?(Input::C)
  case @command_window.index
  when 1
   if $game_party.actors[@status_window.index].restriction >= 2
    $game_system.se_play($data_system.buzzer_se)
    return
   end
   $game_system.se_play($data_system.decision_se)
   $scene = Scene_Skill.new(@status_window.index)
  when 2
   $game_system.se_play($data_system.decision_se)
   $scene = Scene_Equip.new(@status_window.index)
  when 3
   $game_system.se_play($data_system.decision_se)
   $scene = Scene_Status.new(@status_window.index)
   end
   return
  end
 end
end
#------------------------------------------------------------------------------
# Â Window_RingMenu
#------------------------------------------------------------------------------
class Window_RingMenu < Window_Base
 STARTUP_FRAMES = 20
 MOVING_FRAMES = 5 Â
 RING_R = 64    Â
 ICON_ITEM  = RPG::Cache.icon("034-Item03")
 ICON_SKILL  = RPG::Cache.icon("044-Skill01")
 ICON_EQUIP  = RPG::Cache.icon("001-Weapon01")
 ICON_STATUS = RPG::Cache.icon("050-Skill07")
 ICON_SAVE  = RPG::Cache.icon("038-Item07")
 ICON_EXIT  = RPG::Cache.icon("046-Skill03")
 ICON_DISABLE= RPG::Cache.icon("")
 SE_STARTUP = "056-Right02"
 MODE_START = 1
 MODE_WAIT  = 2
 MODE_MOVER = 3
 MODE_MOVEL = 4
 attr_accessor :index
#------------------------------------------------------------------------------
# Â Initialize
#------------------------------------------------------------------------------
 def initialize( center_x, center_y )
  super(0, 0, 640, 480)
  self.contents = Bitmap.new(width-32, height-32)
  self.contents.font.name = $ring_menu_text[0]
  self.contents.font.color = text_color($ring_menu_text[7])
  self.contents.font.size = $ring_menu_text[8]
  self.opacity = 0
  self.back_opacity = 0
  s1 = $ring_menu_text[1]
  s2 = $ring_menu_text[2]
  s3 = $ring_menu_text[3]
  s4 = $ring_menu_text[4]
  s5 = $ring_menu_text[5]
  s6 = $ring_menu_text[6]
  @commands = [ s1, s2, s3, s4, s5, s6 ]
  @item_max = 6
  @index = 0
  @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ]
  @disabled = [ false, false, false, false, false, false ]
  @cx = center_x - 16
  @cy = center_y - 16
  setup_move_start
  refresh
 end
#------------------------------------------------------------------------------
# Â Update
#------------------------------------------------------------------------------
 def update
  super
  refresh
 end
#------------------------------------------------------------------------------
# Â Refresh
#------------------------------------------------------------------------------
 def refresh
  self.contents.clear
  case @mode
  when MODE_START
   refresh_start
  when MODE_WAIT
   refresh_wait
  when MODE_MOVER
   refresh_move(1)
  when MODE_MOVEL
   refresh_move(0)
  end
  rect = Rect.new(@cx - 272, @cy + 24, self.contents.width-32, 32)
  self.contents.draw_text(rect, @commands[@index],1)
 end
#------------------------------------------------------------------------------
# Â Refresh Start
#------------------------------------------------------------------------------
 def refresh_start
  d1 = 2.0 * Math::PI / @item_max
  d2 = 1.0 * Math::PI / STARTUP_FRAMES
  r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES
  for i in 0...@item_max
   j = i - @index
   d = d1 * j + d2 * @steps
   x = @cx + ( r * Math.sin( d ) ).to_i
   y = @cy - ( r * Math.cos( d ) ).to_i
   draw_item(x, y, i)
  end
  @steps -= 1
  if @steps < 1
   @mode = MODE_WAIT
  end
 end
#------------------------------------------------------------------------------
# Â Refresh Wait
#------------------------------------------------------------------------------
 def refresh_wait
  d = 2.0 * Math::PI / @item_max
  for i in 0...@item_max
   j = i - @index
   x = @cx + ( RING_R * Math.sin( d * j ) ).to_i
   y = @cy - ( RING_R * Math.cos( d * j ) ).to_i
   draw_item(x, y, i)
  end
 end
#------------------------------------------------------------------------------
# Â Refresh Move
#------------------------------------------------------------------------------
 def refresh_move( mode )
  d1 = 2.0 * Math::PI / @item_max
  d2 = d1 / MOVING_FRAMES
  d2 *= -1 if mode != 0
  for i in 0...@item_max
   j = i - @index
   d = d1 * j + d2 * @steps
   x = @cx + ( RING_R * Math.sin( d ) ).to_i
   y = @cy - ( RING_R * Math.cos( d ) ).to_i
   draw_item(x, y, i)
  end
  @steps -= 1
  if @steps < 1
   @mode = MODE_WAIT
  end
 end
#------------------------------------------------------------------------------
# Â Draw Item
#------------------------------------------------------------------------------
 def draw_item(x, y, i)
  rect = Rect.new(0, 0, @items[i].width, @items[i].height)
  if @index == i
   self.contents.blt( x, y, @items[i], rect )
   if @disabled[@index]
    self.contents.blt( x, y, ICON_DISABLE, rect )
   end
  else
   self.contents.blt( x, y, @items[i], rect, 128 )
   if @disabled[@index]
    self.contents.blt( x, y, ICON_DISABLE, rect, 128 )
   end
  end
 end
#------------------------------------------------------------------------------
# Â Disable Item
#------------------------------------------------------------------------------
 def disable_item(index)
  @disabled[index] = true
 end
#------------------------------------------------------------------------------
# Â Setup Move Start
#------------------------------------------------------------------------------
 def setup_move_start
  @mode = MODE_START
  @steps = STARTUP_FRAMES
  if  SE_STARTUP != nil and SE_STARTUP != ""
   Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)
  end
 end
#------------------------------------------------------------------------------
# Â Setup Move Move
#------------------------------------------------------------------------------
 def setup_move_move(mode)
  if mode == MODE_MOVER
   @index -= 1
   @index = @items.size - 1 if @index < 0
  elsif mode == MODE_MOVEL
   @index += 1
   @index = 0 if @index >= @items.size
  else
   return
  end
  @mode = mode
  @steps = MOVING_FRAMES
 end
#------------------------------------------------------------------------------
# Â Animation
#------------------------------------------------------------------------------
 def animation?
  return @mode != MODE_WAIT
 end
end
#------------------------------------------------------------------------------
# Â Window_RingMenuStatus
#------------------------------------------------------------------------------
class Window_RingMenuStatus < Window_Selectable
#------------------------------------------------------------------------------
# Â Initialize
#------------------------------------------------------------------------------
 def initialize
  super(204, 64, 232, 352)
  self.contents = Bitmap.new(width - 32, height - 32)
  self.contents.font.size = $chara_select[5]
  refresh
  self.active = false
  self.index = -1
 end
#------------------------------------------------------------------------------
# Â Refresh
#------------------------------------------------------------------------------
 def refresh
  self.contents.clear
  self.windowskin = RPG::Cache.windowskin($chara_select[4])
  self.contents.font.name = $chara_select[0]
  self.contents.font.color = text_color($chara_select[1])
  @item_max = $game_party.actors.size
  for i in 0...$game_party.actors.size
   x = 80
   y = 80 * i
   actor = $game_party.actors[i]
   draw_actor_graphic(actor, x - 60, y + 65)
   draw_actor_name(actor, x, y + 2)
   draw_actor_hp(actor, x - 40, y + 26)
   draw_actor_sp(actor, x - 40, y + 50)
  end
 end
#------------------------------------------------------------------------------
# Â Update Cursor Rect
#------------------------------------------------------------------------------
 def update_cursor_rect
  if @index < 0
   self.cursor_rect.empty
  else
   self.cursor_rect.set(0, @index * 80, self.width - 32, 80)
  end
 end
end
#------------------------------------------------------------------------------
# Â Game_Map
#------------------------------------------------------------------------------
class Game_Map
#------------------------------------------------------------------------------
# Â Name
#------------------------------------------------------------------------------
 def name
  $map_infos[@map_id]
 end
end
#------------------------------------------------------------------------------
# Â Scene_Title
#------------------------------------------------------------------------------
class Scene_Title
 $map_infos = load_data("Data/MapInfos.rxdata")
 for key in $map_infos.keys
  $map_infos[key] = $map_infos[key].name
 end
end
#------------------------------------------------------------------------------
# Â Window_Location
#------------------------------------------------------------------------------
class Window_Location < Window_Base
#------------------------------------------------------------------------------
# Â Initialize
#------------------------------------------------------------------------------
 def initialize
  super(0, 0, $window_size[0], $window_size[1])
  self.contents = Bitmap.new(width - 32, height - 32)
  self.contents.font.name = $location_text[0]
  self.contents.font.size = $location_text[1]
  refresh
 end
#------------------------------------------------------------------------------
# Â Refresh
#------------------------------------------------------------------------------
 def refresh
  self.contents.clear
  self.windowskin = RPG::Cache.windowskin($window_location_skin)
  self.contents.font.color = text_color($location_text[2])
  self.contents.draw_text(4, 0, 120, 32, $location_text[3])
  self.contents.font.color = text_color($location_text[4])
  self.contents.draw_text(4, 32, 120, 32, $game_map.name, 2)
 end
end
#------------------------------------------------------------------------------
# Â Window_MenuGold
#------------------------------------------------------------------------------
class Window_MenuGold < Window_Base
#------------------------------------------------------------------------------
# Â Initialize
#------------------------------------------------------------------------------
 def initialize
  super(0, 0, $window_size[0], $window_size[1])
  self.contents = Bitmap.new(width - 32, height - 32)
  self.contents.font.name = $gold_text[0]
  self.contents.font.size = $gold_text[1]
  refresh
 end
#------------------------------------------------------------------------------
# Â Refresh
#------------------------------------------------------------------------------
 def refresh
  self.contents.clear
  self.windowskin = RPG::Cache.windowskin($window_gold_skin)
  self.contents.font.color = text_color($gold_text[2])
  self.contents.draw_text(4, 0, 120, 32, $gold_text[4])
  self.contents.font.color = text_color($gold_text[3])
  self.contents.draw_text(4, 32, 120, 32, $game_party.gold.to_s, 2)
 end
end
Code:
#==============================================================================
# Special Equipment System
#==============================================================================
# To make up for some losses of the SBS, about multi-slot equiping systems,
# I've made this section of the script.
#
# This section activate some special feature of the system:
# - 2 Weapon System
# - 2 Handed Weapons
# - Extras Accessories slots (uo to 3 extra slots)
#
# But unfortunately, this system isn't perfect.
# Any script that changes one of theses scripts:
# Scene_Equip, o Window_Equip_Right, o Window_Equip_Left, o Window_Status
# may cause compatiblity problems.
#
# In other words: Complex Menu scripts (Eg.: Moghunter's Menus), and others
# equip based systems will not work properly with the Special Equipment System.
#
# So you must choose: use the Special Equipment System, or use the incompatible script
# Except if you have some knowledge to make both compatible.
#
# If you choose to not use the Special Equipment System, just delete this
# whole section. It won't cause any crashes in the main system.
#
#==============================================================================
Â
class Window_Base < Window
 #--------------------------------------------------------------------------
 include N01
 #--------------------------------------------------------------------------
 def draw_actor_parameter(actor, x, y, type)
  case type
  when 0
   parameter_name = $data_system.words.atk
   parameter_value = actor.atk
  when 1
   parameter_name = $data_system.words.pdef
   parameter_value = actor.pdef
  when 2
   parameter_name = $data_system.words.mdef
   parameter_value = actor.mdef
  when 3
   parameter_name = $data_system.words.str
   parameter_value = actor.str
  when 4
   parameter_name = (DAMAGE_ALOGARITHM_TYPE == 0 ? STAT_VIT : $data_system.words.dex)
   parameter_value = actor.dex
  when 5
   parameter_name = $data_system.words.agi
   parameter_value = actor.agi
  when 6
   parameter_name = $data_system.words.int
   parameter_value = actor.int
  when 7
   parameter_name = STAT_EVA
   parameter_value = actor.eva
  end
  self.contents.font.color = system_color
  self.contents.draw_text(x, y, 120, 32, parameter_name)
  self.contents.font.color = normal_color
  self.contents.draw_text(x + 120, y, 64, 32, parameter_value.to_s, 2)
 end
end
Â
#==============================================================================
# â– Window_Status
#==============================================================================
class Window_Status < Window_Base
 #--------------------------------------------------------------------------
 def refresh
  self.contents.clear
  draw_actor_graphic(@actor, 40, 112)
  draw_actor_name(@actor, 4, 0)
  draw_actor_class(@actor, 4 + 144, 0)
  draw_actor_level(@actor, 96, 32)
  draw_actor_state(@actor, 96, 64)
  draw_actor_hp(@actor, 96, 112, 172)
  draw_actor_sp(@actor, 96, 144, 172)
  draw_actor_parameter(@actor, 96, 192, 0)
  draw_actor_parameter(@actor, 96, 224, 1)
  draw_actor_parameter(@actor, 96, 256, 2)
  y_adjust = ( SHOW_EVA ? 0 : 16 )
  draw_actor_parameter(@actor, 96, 288 + y_adjust, 3)
  draw_actor_parameter(@actor, 96, 320 + y_adjust, 4)
  draw_actor_parameter(@actor, 96, 352 + y_adjust, 5)
  draw_actor_parameter(@actor, 96, 384 + y_adjust, 6)
  draw_actor_parameter(@actor, 96, 416, 7) if SHOW_EVA
  self.contents.font.color = system_color
  self.contents.draw_text(320, 48, 80, 32, "EXP")
  self.contents.draw_text(320, 80, 80, 32, "NEXT")
  self.contents.font.color = normal_color
  self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
  self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
  self.contents.font.color = system_color
  y = 50
  y = 44 if EXTRA_ACC > 0
  y = 38 if EXTRA_ACC > 1
  y = 32 if EXTRA_ACC > 2
  self.contents.draw_text(320, 136,128, 32, "Equipment")
  draw_item_name($data_weapons[@actor.weapon_id], 320, 140 + y * 1)
  if TWO_SWORDS_CHARACTERS.include?(@actor.id)
   draw_item_name($data_weapons[@actor.armor1_id], 320, 140 + y * 2)
  else
   draw_item_name($data_armors[@actor.armor1_id], 320, 140 + y * 2)
  end
  draw_item_name($data_armors[@actor.armor2_id], 320, 140 + y * 3)
  draw_item_name($data_armors[@actor.armor3_id], 320, 140 + y * 4)
  draw_item_name($data_armors[@actor.armor4_id], 320, 140 + y * 5)
  draw_item_name($data_armors[@actor.armor5_id], 320, 140 + y * 6) if EXTRA_ACC > 0
  draw_item_name($data_armors[@actor.armor6_id], 320, 140 + y * 7) if EXTRA_ACC > 1
  draw_item_name($data_armors[@actor.armor7_id], 320, 140 + y * 8) if EXTRA_ACC > 2
 end
 def dummy
  self.contents.font.color = system_color
  self.contents.draw_text(320, 112, 96, 32, $data_system.words.weapon)
  self.contents.draw_text(320, 176, 96, 32, $data_system.words.armor1)
  self.contents.draw_text(320, 240, 96, 32, $data_system.words.armor2)
  self.contents.draw_text(320, 304, 96, 32, $data_system.words.armor3)
  self.contents.draw_text(320, 368, 96, 32, $data_system.words.armor4)
  self.contents.draw_text(320, 432, 96, 32, $data_system.words.armor4)
  self.contents.draw_text(320, 496, 96, 32, $data_system.words.armor4)
  self.contents.draw_text(320, 560, 96, 32, $data_system.words.armor4)
  draw_item_name($data_weapons[@actor.weapon_id], 320 + 24, 144)
  draw_item_name($data_armors[@actor.armor1_id], 320 + 24, 208)
  draw_item_name($data_armors[@actor.armor2_id], 320 + 24, 272)
  draw_item_name($data_armors[@actor.armor3_id], 320 + 24, 336)
  draw_item_name($data_armors[@actor.armor4_id], 320 + 24, 400)
  draw_item_name($data_armors[@actor.armor5_id], 320 + 24, 464)
  draw_item_name($data_armors[@actor.armor6_id], 320 + 24, 528)
  draw_item_name($data_armors[@actor.armor7_id], 320 + 24, 592)
 end
end
Â
#==============================================================================
# â– Window_Selectable_Equip
#==============================================================================
class Window_Selectable_Equip < Window_Base
 #--------------------------------------------------------------------------
 attr_reader  :index
 attr_reader  :help_window
 #--------------------------------------------------------------------------
 def initialize(x, y, width, height)
  super(x, y, width, height)
  @item_max = 1
  @column_max = 1
  @index = -1
 end
 #--------------------------------------------------------------------------
 def index=(index)
  @index = index
  if self.active and @help_window != nil
   update_help
  end
  update_cursor_rect
 end
 #--------------------------------------------------------------------------
 def row_max
  return (@item_max + @column_max - 1) / @column_max
 end
 #--------------------------------------------------------------------------
 def top_row
  return self.oy / 32
 end
 #--------------------------------------------------------------------------
 def top_row=(row)
  if row < 0
   row = 0
  end
  if row > row_max - 1
   row = row_max - 1
  end
  self.oy = row * 32
 end
 #--------------------------------------------------------------------------
 def page_row_max
  return (self.height - 64) / 32
 end
 #--------------------------------------------------------------------------
 def page_item_max
  return page_row_max * @column_max
 end
 #---------------------------------------------------------------------------
 def help_window=(help_window)
  @help_window = help_window
  if self.active and @help_window != nil
   update_help
  end
 end
 #---------------------------------------------------------------------------
 def update_cursor_rect
  if @index < 0
   self.cursor_rect.empty
   return
  end
  row = @index / @column_max
  if row < self.top_row
   self.top_row = row
  end
  if row > self.top_row + (self.page_row_max - 1)
   self.top_row = row - (self.page_row_max - 1)
  end
  cursor_width = self.width / @column_max - 32
  x = @index % @column_max * (cursor_width + 32)
  y = @index / @column_max * 32 - self.oy
  self.cursor_rect.set(x, y + 32, cursor_width, 32)
 end
 #---------------------------------------------------------------------------
 def update
  super
  if self.active and @item_max > 0 and @index >= 0
   if Input.repeat?(Input::DOWN)
    if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
      @index < @item_max - @column_max
     $game_system.se_play($data_system.cursor_se)
     @index = (@index + @column_max) % @item_max
    end
   end
   if Input.repeat?(Input::UP)
    if (@column_max == 1 and Input.trigger?(Input::UP)) or
      @index >= @column_max
     $game_system.se_play($data_system.cursor_se)
     @index = (@index - @column_max + @item_max) % @item_max
    end
   end
   if Input.repeat?(Input::RIGHT)
    if @column_max >= 2 and @index < @item_max - 1
     $game_system.se_play($data_system.cursor_se)
     @index += 1
    end
   end
   if Input.repeat?(Input::LEFT)
    if @column_max >= 2 and @index > 0
     $game_system.se_play($data_system.cursor_se)
     @index -= 1
    end
   end
  end
  if self.active and @help_window != nil
   update_help
  end
  update_cursor_rect
 end
end
Â
#==============================================================================
# â– Window_EquipRight
#==============================================================================
class Window_EquipRight < Window_Selectable_Equip
 #-------------------------------------------------------------------------- Â
 include N01
 #-------------------------------------------------------------------------- Â
 def initialize(actor)
  super(272, 64, 368, 224)
  self.contents = Bitmap.new(width - 32, height - 32 + (EXTRA_ACC * 32))
  @actor = actor
  refresh
  self.index = 0
 end
 #--------------------------------------------------------------------------
 def item
  return @data[self.index]
 end
 #-------------------------------------------------------------------------- Â
 def refresh
  self.contents.clear
  draw_actor_name(@actor, 4, 0)
  draw_actor_level(@actor, 160, 0)
  @data = []
  @data.push($data_weapons[@actor.weapon_id])
  if TWO_SWORDS_CHARACTERS.include?(@actor.id)
   @data.push($data_weapons[@actor.armor1_id])
  else
   @data.push($data_armors[@actor.armor1_id])
  end
  @data.push($data_armors[@actor.armor2_id])
  @data.push($data_armors[@actor.armor3_id])
  @data.push($data_armors[@actor.armor4_id])
  @data.push($data_armors[@actor.armor5_id]) if EXTRA_ACC > 0
  @data.push($data_armors[@actor.armor6_id]) if EXTRA_ACC > 1
  @data.push($data_armors[@actor.armor7_id]) if EXTRA_ACC > 2
  @item_max = @data.size
  self.contents.font.color = system_color
  self.contents.draw_text(4, 32 * 1, 92, 32, $data_system.words.weapon)
  if TWO_SWORDS_CHARACTERS.include?(@actor.id)
   self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.weapon)
  else
   self.contents.draw_text(4, 32 * 2, 92, 32, $data_system.words.armor1)
  end
  self.contents.draw_text(4, 32 * 3, 92, 32, $data_system.words.armor2)
  self.contents.draw_text(4, 32 * 4, 92, 32, $data_system.words.armor3)
  self.contents.draw_text(4, 32 * 5, 92, 32, $data_system.words.armor4)
  self.contents.draw_text(4, 32 * 6, 92, 32, $data_system.words.armor4)
  self.contents.draw_text(4, 32 * 7, 92, 32, $data_system.words.armor4)
  self.contents.draw_text(4, 32 * 8, 92, 32, $data_system.words.armor4)
  draw_item_name(@data[0], 92, 32 * 1)
  draw_item_name(@data[1], 92, 32 * 2)
  draw_item_name(@data[2], 92, 32 * 3)
  draw_item_name(@data[3], 92, 32 * 4)
  draw_item_name(@data[4], 92, 32 * 5)
  draw_item_name(@data[5], 92, 32 * 6)
  draw_item_name(@data[6], 92, 32 * 7)
  draw_item_name(@data[7], 92, 32 * 8)
 end
 #--------------------------------------------------------------------------
 def update_help
  @help_window.set_text(self.item == nil ? "" : self.item.description)
 end
end
Â
#==============================================================================
# â– Window_EquipLeft
#==============================================================================
class Window_EquipLeft < Window_Selectable
 #--------------------------------------------------------------------------
 include N01
 #--------------------------------------------------------------------------
 attr_accessor :new_equip
 attr_accessor :last_atk
 attr_accessor :last_pdef
 attr_accessor :last_mdef
 attr_accessor :last_str
 attr_accessor :last_dex
 attr_accessor :last_agi
 attr_accessor :last_int
 #--------------------------------------------------------------------------
 def initialize(actor)
  super(0, 64, 272,224)
  self.contents = Bitmap.new(width - 32, height - 32)
  @actor = actor
  @new_equip, @last_equip = nil, nil
  @last_atk = @actor.atk
  @last_pdef = @actor.pdef
  @last_mdef = @actor.mdef
  @last_str = @actor.str
  @last_dex = @actor.dex
  @last_agi = @actor.agi
  @last_int = @actor.int
  refresh
 end
 #--------------------------------------------------------------------------
 def refresh
  self.contents.clear
  self.contents.font.color = system_color
  self.contents.draw_text(0,-8 + 0 * 28,128, 32, $data_system.words.atk)
  self.contents.draw_text(0,-8 + 1 * 28,128, 32, $data_system.words.pdef)
  self.contents.draw_text(0,-8 + 2 * 28,128, 32, $data_system.words.mdef)
  self.contents.draw_text(0,-8 + 3 * 28,128, 32, $data_system.words.str)
  self.contents.draw_text(0,-8 + 4 * 28,128, 32, STAT_VIT)
  self.contents.draw_text(0,-8 + 5 * 28,128, 32, $data_system.words.int)
  self.contents.draw_text(0,-8 + 6 * 28,128, 32, $data_system.words.agi)
  self.contents.font.color = normal_color
  self.contents.draw_text(128,-8 + 0 * 28, 48, 32, @actor.atk.to_s, 2)
  self.contents.draw_text(128,-8 + 1 * 28, 48, 32, @actor.pdef.to_s, 2)
  self.contents.draw_text(128,-8 + 2 * 28, 48, 32, @actor.mdef.to_s, 2)
  self.contents.draw_text(128,-8 + 3 * 28, 48, 32, @actor.str.to_s, 2)
  self.contents.draw_text(128,-8 + 4 * 28, 48, 32, @actor.dex.to_s, 2)
  self.contents.draw_text(128,-8 + 5 * 28, 48, 32, @actor.int.to_s, 2)
  self.contents.draw_text(128,-8 + 6 * 28, 48, 32, @actor.agi.to_s, 2)
  if @new_atk != nil
   self.contents.font.color = system_color
   @val_atk = @actor.atk
   if @val_atk == @new_atk
    self.contents.font.color = text_color(7)   Â
    self.contents.draw_text(168,-8 + 0 * 28, 40, 32, STAT_NIL, 1)
    self.contents.font.color = normal_color
   elsif @val_atk < @new_atk
    self.contents.font.color = text_color(4)   Â
    self.contents.draw_text(168,-8 + 0 * 28, 40, 32, STAT_UP, 1)
    self.contents.font.color = text_color(3)
   elsif @val_atk > @new_atk
    self.contents.font.color = text_color(6)   Â
    self.contents.draw_text(168,-8 + 0 * 28, 40, 32, STAT_DOWN, 1)
    self.contents.font.color = text_color(2)
   end
   self.contents.draw_text(192,-8 + 0 * 28, 48, 32, @new_atk.to_s, 2)
  end
  if @new_pdef != nil
   self.contents.font.color = system_color
   @val_pdef = @actor.pdef
   if @val_pdef == @new_pdef
    self.contents.font.color = text_color(7)   Â
    self.contents.draw_text(168,-8 + 1 * 28, 40, 32, STAT_NIL, 1)
    self.contents.font.color = normal_color
   elsif @val_pdef < @new_pdef
    self.contents.font.color = text_color(4)   Â
    self.contents.draw_text(168,-8 + 1 * 28, 40, 32, STAT_UP, 1)
    self.contents.font.color = text_color(3)
   elsif @val_pdef > @new_pdef
    self.contents.font.color = text_color(6)   Â
    self.contents.draw_text(168,-8 + 1 * 28, 40, 32, STAT_DOWN, 1)
    self.contents.font.color = text_color(2)
   end
   self.contents.draw_text(192,-8 + 1 * 28, 48, 32, @new_pdef.to_s, 2)
  end
  if @new_mdef != nil
   self.contents.font.color = system_color
   @val_mdef = @actor.mdef
   if @val_mdef == @new_mdef
    self.contents.font.color = text_color(7)   Â
    self.contents.draw_text(168,-8 + 2 * 28, 40, 32, STAT_NIL, 1)
    self.contents.font.color = normal_color
   elsif @val_mdef < @new_mdef
    self.contents.font.color = text_color(4)   Â
    self.contents.draw_text(168,-8 + 2 * 28, 40, 32, STAT_UP, 1)
    self.contents.font.color = text_color(3)
   elsif @val_mdef > @new_mdef
    self.contents.font.color = text_color(6)   Â
    self.contents.draw_text(168,-8 + 2 * 28, 40, 32, STAT_DOWN, 1)
    self.contents.font.color = text_color(2)
   end
   self.contents.draw_text(192,-8 + 2 * 28, 48, 32, @new_mdef.to_s, 2)
  end
  if @new_str != nil
   self.contents.font.color = system_color
   @val_str = @actor.str
   if @val_str == @new_str
    self.contents.font.color = text_color(7)   Â
    self.contents.draw_text(168,-8 + 3 * 28, 40, 32, STAT_NIL, 1)
    self.contents.font.color = normal_color
   elsif @val_str < @new_str
    self.contents.font.color = text_color(4)   Â
    self.contents.draw_text(168,-8 + 3 * 28, 40, 32, STAT_UP, 1)
    self.contents.font.color = text_color(3)
   elsif @val_str > @new_str
    self.contents.font.color = text_color(6)   Â
    self.contents.draw_text(168,-8 + 3 * 28, 40, 32, STAT_DOWN, 1)
    self.contents.font.color = text_color(2)
   end
   self.contents.draw_text(192,-8 + 3 * 28, 48, 32, @new_str.to_s, 2)
  end
  if @new_dex != nil
   self.contents.font.color = system_color
   @val_dex = @actor.dex
   if @val_dex == @new_dex
    self.contents.font.color = text_color(7)   Â
    self.contents.draw_text(168,-8 + 4 * 28, 40, 32, STAT_NIL, 1)
    self.contents.font.color = normal_color
   elsif @val_dex < @new_dex
    self.contents.font.color = text_color(4)   Â
    self.contents.draw_text(168,-8 + 4 * 28, 40, 32, STAT_UP, 1)
    self.contents.font.color = text_color(3)
   elsif @val_dex > @new_dex
    self.contents.font.color = text_color(6)   Â
    self.contents.draw_text(168,-8 + 4 * 28, 40, 32, STAT_DOWN, 1)
    self.contents.font.color = text_color(2)
   end
   self.contents.draw_text(192,-8 + 4 * 28, 48, 32, @new_dex.to_s, 2)
  end
  if @new_int != nil
   self.contents.font.color = system_color
   @val_int = @actor.int
   if @val_int == @new_int
    self.contents.font.color = text_color(7)   Â
    self.contents.draw_text(168,-8 + 5 * 28, 40, 32, STAT_NIL, 1)
    self.contents.font.color = normal_color
   elsif @val_int < @new_int
    self.contents.font.color = text_color(4)   Â
    self.contents.draw_text(168,-8 + 5 * 28, 40, 32, STAT_UP, 1)
    self.contents.font.color = text_color(3)
   elsif @val_int > @new_int
    self.contents.font.color = text_color(6)   Â
    self.contents.draw_text(168,-8 + 5 * 28, 40, 32, STAT_DOWN, 1)
    self.contents.font.color = text_color(2)
   end
   self.contents.draw_text(192,-8 + 5 * 28, 48, 32, @new_int.to_s, 2)
  end
  if @new_agi != nil
   self.contents.font.color = system_color
   @val_agi = @actor.agi
   if @val_agi == @new_agi
    self.contents.font.color = text_color(7)   Â
    self.contents.draw_text(168,-8 + 6 * 28, 40, 32, STAT_NIL, 1)
    self.contents.font.color = normal_color
   elsif @val_agi < @new_agi
    self.contents.font.color = text_color(4)   Â
    self.contents.draw_text(168,-8 + 6 * 28, 40, 32, STAT_UP, 1)
    self.contents.font.color = text_color(3)
   elsif @val_agi > @new_agi
    self.contents.font.color = text_color(6)   Â
    self.contents.draw_text(168,-8 + 6 * 28, 40, 32, STAT_DOWN, 1)
    self.contents.font.color = text_color(2)
   end
   self.contents.draw_text(192,-8 + 6 * 28, 48, 32, @new_agi.to_s, 2)
  end
 end
 #--------------------------------------------------------------------------
 def set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
  if @new_str != new_str or @new_dex != new_dex or @new_agi != new_agi or
   @new_int != new_int or @new_atk != new_atk or @new_pdef != new_pdef or @new_mdef != new_mdef
   @last_equip = @new_equip
   @new_atk = new_atk
   @new_pdef = new_pdef
   @new_mdef = new_mdef
   @new_str = new_str
   @new_dex = new_dex
   @new_agi = new_agi
   @new_int = new_int
   refresh
  end
 end
end
Â
#==============================================================================
# â– Window_EquipItem
#==============================================================================
class Window_EquipItem < Window_Selectable
 #--------------------------------------------------------------------------
 def initialize(actor, equip_type)
  super(0, 288, 640, 192)
  @actor = actor
  @equip_type = equip_type
  @column_max = 2
  refresh
  self.active = false
  self.index = -1
 end
end
Â
#==============================================================================
# â– Scene_Equip
#==============================================================================
class Scene_Equip
 #--------------------------------------------------------------------------
 include N01
 #--------------------------------------------------------------------------
 def main
  @actor = $game_party.actors[@actor_index]
  @help_window = Window_Help.new
  @left_window = Window_EquipLeft.new(@actor)
  @right_window = Window_EquipRight.new(@actor)
  item_window_update
  @right_window.help_window = @help_window
  @item_window1.help_window = @help_window
  @item_window2.help_window = @help_window
  @item_window3.help_window = @help_window
  @item_window4.help_window = @help_window
  @item_window5.help_window = @help_window
  @item_window6.help_window = @help_window if EXTRA_ACC > 0
  @item_window7.help_window = @help_window if EXTRA_ACC > 1
  @item_window8.help_window = @help_window if EXTRA_ACC > 2
  @right_window.index = @equip_index
  refresh
  Graphics.transition
  loop do
   Graphics.update
   Input.update
   update
   if $scene != self
    break
   end
  end
  Graphics.freeze
  @help_window.dispose
  @left_window.dispose
  @right_window.dispose
  item_window_dispose Â
 end
 #--------------------------------------------------------------------------
 def refresh
  @item_window1.visible = (@right_window.index == 0)
  @item_window2.visible = (@right_window.index == 1)
  @item_window3.visible = (@right_window.index == 2)
  @item_window4.visible = (@right_window.index == 3)
  @item_window5.visible = (@right_window.index == 4)
  @item_window6.visible = (@right_window.index == 5) if EXTRA_ACC > 0
  @item_window7.visible = (@right_window.index == 6) if EXTRA_ACC > 1
  @item_window8.visible = (@right_window.index == 7) if EXTRA_ACC > 2
  item1 = @right_window.item
  case @right_window.index
  when 0
   @item_window = @item_window1
  when 1
   @item_window = @item_window2
  when 2
   @item_window = @item_window3
  when 3
   @item_window = @item_window4
  when 4
   @item_window = @item_window5
  when 5
   @item_window = @item_window6
  when 6
   @item_window = @item_window7
  when 7
   @item_window = @item_window8
  end
  if @right_window.active
   @left_window.set_new_parameters(nil, nil, nil, nil, nil, nil, nil)
  end
  if @item_window.active
   @item2 = @item_window.item
   last_hp = @actor.hp
   last_sp = @actor.sp
   @actor.equip(@right_window.index, @item2 == nil ? 0 : @item2.id)
   if @right_window.index == 0 and TWO_HANDED_WEAPONS.include?(@actor.weapon_id)
    weapon_to_equip_1 = @actor.armor1_id
    @actor.equip(1, 0)
   elsif @right_window.index == 1 and TWO_HANDED_WEAPONS.include?(@actor.weapon_id) and @item2 != nil
    weapon_to_equip_2 = @actor.weapon_id
    @actor.equip(0, 0)
   elsif @right_window.index == 1 and TWO_SWORDS_CHARACTERS.include?(@actor.id) and TWO_HANDED_WEAPONS.include?(@actor.armor1_id)
    weapon_to_equip_3 = @actor.weapon_id
    @actor.equip(0, 0)
   end
   if @right_window.index == 1 and TWO_HANDED_WEAPONS.include?(@actor.weapon_id) and @item2 == nil
    @actor.equip(0, weapon_to_equip_2)
    weapon_to_equip_2 = nil
   end
   new_atk = @actor.atk
   new_pdef = @actor.pdef
   new_mdef = @actor.mdef
   new_str = @actor.str
   new_dex = @actor.dex
   new_agi = @actor.agi
   new_int = @actor.int
   @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)
   if @right_window.index == 0 and weapon_to_equip_1 != nil
    @actor.equip(1, weapon_to_equip_1)
   elsif @right_window.index == 1 and weapon_to_equip_2 != nil
    @actor.equip(0, weapon_to_equip_2)
   elsif @right_window.index == 1 and weapon_to_equip_3 != nil
    @actor.equip(0, weapon_to_equip_3)
   end
   @actor.hp = last_hp
   @actor.sp = last_sp
   @left_window.set_new_parameters(new_atk, new_pdef, new_mdef, new_str, new_dex, new_agi, new_int)
  end
 end
 #--------------------------------------------------------------------------
 def item_window_update
  @item_window1 = Window_EquipItem.new(@actor, 0)
  if TWO_SWORDS_CHARACTERS.include?(@actor.id)
   @item_window2 = Window_EquipItem.new(@actor, 0)
  else
   @item_window2 = Window_EquipItem.new(@actor, 1)
  end
  @item_window3 = Window_EquipItem.new(@actor, 2)
  @item_window4 = Window_EquipItem.new(@actor, 3)
  @item_window5 = Window_EquipItem.new(@actor, 4)
  @item_window6 = Window_EquipItem.new(@actor, 4) if EXTRA_ACC > 0
  @item_window7 = Window_EquipItem.new(@actor, 4) if EXTRA_ACC > 1
  @item_window8 = Window_EquipItem.new(@actor, 4) if EXTRA_ACC > 2
  refresh
 end
 #--------------------------------------------------------------------------
 def item_window_dispose
  @item_window1.dispose
  @item_window2.dispose
  @item_window3.dispose
  @item_window4.dispose
  @item_window5.dispose
  @item_window6.dispose if EXTRA_ACC > 0
  @item_window7.dispose if EXTRA_ACC > 1
  @item_window8.dispose if EXTRA_ACC > 2
 end
 #--------------------------------------------------------------------------
 def update_item
  if Input.trigger?(Input::B)
   $game_system.se_play($data_system.cancel_se)
   @right_window.active = true
   @item_window.active = false
   @item_window.index = -1
   return
  end
  if Input.trigger?(Input::C)
   $game_system.se_play($data_system.equip_se)
   item = @item_window.item
   @actor.equip(@right_window.index, item == nil ? 0 : item.id)
   @right_window.active = true
   @item_window.active = false
   @item_window.index = -1
   update_r_hand if @right_window.index == 0
   update_l_hand if @right_window.index == 1
   @right_window.refresh
   @item_window.refresh
   item_window_dispose
   item_window_update
   return
  end
 end
 #--------------------------------------------------------------------------
 def update_right
  if Input.trigger?(Input::B)
   $game_system.se_play($data_system.cancel_se)
   $scene = Scene_Menu.new(2)
   return
  end
  if Input.trigger?(Input::C)
   if @actor.equip_fix?(@right_window.index)
    $game_system.se_play($data_system.buzzer_se)
    return
   end
   $game_system.se_play($data_system.decision_se)
   @right_window.active = false
   @item_window.active = true
   @item_window.index = 0
   return
  end
  if Input.trigger?(Input::R)
   $game_system.se_play($data_system.cursor_se)
   @actor_index += $game_party.actors.size + 1
   @actor_index %= $game_party.actors.size
   $scene = Scene_Equip.new(@actor_index, @right_window.index)
   return
  end
  if Input.trigger?(Input::L)
   $game_system.se_play($data_system.cursor_se)
   @actor_index += $game_party.actors.size - 1
   @actor_index %= $game_party.actors.size
   $scene = Scene_Equip.new(@actor_index, @right_window.index)
   return
  end
 end
 #--------------------------------------------------------------------------
 def update_r_hand
  @actor.equip(1, 0) if @actor.weapons[0] != nil and TWO_HANDED_WEAPONS.include?(@actor.weapon_id)
 end
 #--------------------------------------------------------------------------
 def update_l_hand
  @actor.equip(0, 0) if @actor.weapons[0] != nil and TWO_HANDED_WEAPONS.include?(@actor.weapon_id) and @item2 != nil
  if @actor.weapons[1] != nil
   return unless TWO_SWORDS_CHARACTERS.include?(@actor.id) and TWO_HANDED_WEAPONS.include?(@actor.armor1_id)
   weapon_to_equip = @actor.armor1_id
   @actor.equip(1, 0)
   @actor.equip(0, weapon_to_equip)
  end
 end
end
Â
#==============================================================================
# â– Window_ShopStatus
#==============================================================================
class Window_ShopStatus < Window_Base
 #--------------------------------------------------------------------------
 def refresh
  self.contents.clear
  if @item == nil
   return
  end
  case @item
  when RPG::Item
   number = $game_party.item_number(@item.id)
  when RPG::Weapon
   number = $game_party.weapon_number(@item.id)
  when RPG::Armor
   number = $game_party.armor_number(@item.id)
  end
  self.contents.font.color = system_color
  self.contents.draw_text(4, 0, 200, 32, "number in possession")
  self.contents.font.color = normal_color
  self.contents.draw_text(204, 0, 32, 32, number.to_s, 2)
  if @item.is_a?(RPG::Item)
   return
  end
  for i in 0...$game_party.actors.size
   actor = $game_party.actors[i]
   if actor.equippable?(@item)
    self.contents.font.color = normal_color
   else
    self.contents.font.color = disabled_color
   end
   self.contents.draw_text(4, 64 + 64 * i, 120, 32, actor.name)
   if @item.is_a?(RPG::Weapon)
    item1 = $data_weapons[actor.weapon_id]
   elsif @item.kind == 0
    item1 = $data_armors[actor.armor1_id]
   elsif @item.kind == 1
    item1 = $data_armors[actor.armor2_id]
   elsif @item.kind == 2
    item1 = $data_armors[actor.armor3_id]
   else
    item1 = $data_armors[actor.armor4_id]
   end
   if actor.equippable?(@item)
    change = 0
    if @item.is_a?(RPG::Weapon)
     atk1 = item1 != nil ? item1.atk : 0
     atk2 = @item != nil ? @item.atk : 0
     change = atk2 - atk1
    elsif @item.is_a?(RPG::Armor) && @item.kind <= 2
     pdef1 = item1 != nil ? item1.pdef : 0
     mdef1 = item1 != nil ? item1.mdef : 0
     pdef2 = @item != nil ? @item.pdef : 0
     mdef2 = @item != nil ? @item.mdef : 0
     change = pdef2 - pdef1 + mdef2 - mdef1
    elsif @item.is_a?(RPG::Armor) &&  @item.kind > 2
     change = 0
     item1 = nil
    end
    if change > 0 and actor.equippable?(@item)
     self.contents.font.color = text_color(3)
    elsif change < 0 and actor.equippable?(@item)
     self.contents.font.color = text_color(2)
    end
    self.contents.draw_text(124, 64 + 64 * i, 112, 32,sprintf("%+d", change), 2)
    self.contents.font.color = normal_color
   end
   if item1 != nil
    x = 4
    y = 64 + 64 * i + 32
    bitmap = RPG::Cache.icon(item1.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item1.name)
   end
  end
 end
 #--------------------------------------------------------------------------
 def item=(item)
  if @item != item
   @item = item
   refresh
  end
 end
end
Though now that I think about it it might not have to do with that at all. But still, anyone got any idea?