[XP] theory's Greater Icons 2.1 [NEW VERSION]

Theory's Greater Icons
Version: 2.1 release

Introduction

This script allows the user to change the size of their item and skill icons to any x and y size.   It also edits the necessary menus to support this.  I've also added the ability to have color-coded items. Icons have a backdrop now- the backdrop and the item name can be recolored by a simple element inclusion.

Features

Custom Icon Size
Larger Icons
Rectangular Icon Support
Menu Edits to Support Custom Icon Size
Item Rarity Highlighting

Screenshots

Screenshots Show
Image
Image


Demo

Download : Click here...

Script

Script Show
  1.  
  2.  
  3. #==============================================================================
  4. # ** Theory's Greater Icons
  5. #------------------------------------------------------------------------------
  6. #   This script allows you to set x and y sizes for your item and skill icons.   
  7. #   Be sure to make the files in your icons folder reflect this- it does not
  8. #   stretch icons. This script was optimized for 50x50 icons, but any dimensions
  9. #   larger than 30x30 and smaller than 200x200 should work.
  10. #   
  11. #   It required a small menu edit for quantity and SP cost locations; and will
  12. #   not be compatible with most CMS's without editing.
  13. #==============================================================================
  14.  
  15. module Theory_Greater_Icons
  16.   Width = 50
  17.   Height = 50
  18.   Background = 'back'
  19.  
  20.   UncommonElement = 18
  21.   UncommonBackground = 'uncommon'
  22.   UncommonColor = Color.new(0, 255, 0, 255)
  23.   UncommonColorDisabled = Color.new(0, 255, 0, 128)
  24.  
  25.   RareElement = 19
  26.   RareBackground = 'rare'
  27.   RareColor = Color.new(0, 200, 255, 255)
  28.   RareColorDisabled = Color.new(0, 200, 255, 128)
  29.  
  30.   LegendaryElement = 20
  31.   LegendaryBackground = 'legendary'
  32.   LegendaryColor = Color.new(255, 255, 0, 255)
  33.   LegendaryColorDisabled = Color.new(255, 255, 0, 128)
  34.  
  35. end
  36.  
  37. #==============================================================================
  38. # ** Window_Selectable
  39. #==============================================================================
  40.  
  41. class Window_Selectable
  42.   #--------------------------------------------------------------------------
  43.   # * Public Instance Variables
  44.   #--------------------------------------------------------------------------
  45.   attr_writer :oh
  46.   #--------------------------------------------------------------------------
  47.   # * Text Cursor Height
  48.   #--------------------------------------------------------------------------
  49.   def oh
  50.      return @oh.nil? ? 32 : @oh
  51.   end
  52.   #--------------------------------------------------------------------------
  53.   # * Get Top Row
  54.   #--------------------------------------------------------------------------
  55.   def top_row
  56.      # Divide y-coordinate of window contents transfer origin by 1 row
  57.      # height of self.oh
  58.      return self.oy / self.oh
  59.   end
  60.   #--------------------------------------------------------------------------
  61.   # * Set Top Row
  62.   #       row : row shown on top
  63.   #--------------------------------------------------------------------------
  64.   def top_row=(row)
  65.      # If row is less than 0, change it to 0
  66.      # If row exceeds row_max - 1, change it to row_max - 1
  67.      row = [[row, 0].max, row_max - 1].min
  68.      # Multiply 1 row height by 32 for y-coordinate of window contents
  69.      # transfer origin
  70.      self.oy = row * self.oh
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # * Get Number of Rows Displayable on 1 Page
  74.   #--------------------------------------------------------------------------
  75.   def page_row_max
  76.      # Subtract a frame height of 32 from the window height, and divide it by
  77.      # 1 row height of self.oh
  78.      return (self.height - 32) / self.oh
  79.   end
  80.   #--------------------------------------------------------------------------
  81.   # * Update Cursor Rectangle
  82.   #--------------------------------------------------------------------------
  83.   def update_cursor_rect
  84.      # If cursor position is less than 0
  85.      if @index < 0
  86.         self.cursor_rect.empty
  87.         return
  88.      end
  89.      # Get current row
  90.      row = @index / @column_max
  91.      # If current row is before top row
  92.      if row < self.top_row
  93.         # Scroll so that current row becomes top row
  94.         self.top_row = row
  95.      end
  96.      # If current row is more to back than back row
  97.      if row > self.top_row + (self.page_row_max - 1)
  98.         # Scroll so that current row becomes back row
  99.         self.top_row = row - (self.page_row_max - 1)
  100.      end
  101.      # Calculate cursor width
  102.      cursor_width = self.width / @column_max - 32
  103.      # Calculate cursor coordinates
  104.      x = @index % @column_max * (cursor_width + 32)
  105.      y = @index / @column_max * self.oh - self.oy
  106.      if self.active == true
  107.         # Update cursor rectangle
  108.         self.cursor_rect.set(x, y, cursor_width, self.oh)
  109.      end
  110.   end
  111. end
  112.  
  113. #==============================================================================
  114. # ** Window_Item
  115. #------------------------------------------------------------------------------
  116. #   This window displays items in possession on the item and battle screens.
  117. #==============================================================================
  118.  
  119. class Window_Item < Window_Selectable
  120.   #--------------------------------------------------------------------------
  121.   # * Object Initialization
  122.   #--------------------------------------------------------------------------
  123.   def initialize
  124.      super(0, 64, 640, 416)
  125.      @column_max = 2
  126.  ##set the parent selectable height
  127.      @oh =   Theory_Greater_Icons::Height
  128.      refresh
  129.      self.index = 0
  130.      # If in battle, move window to center of screen
  131.      # and make it semi-transparent
  132.      if $game_temp.in_battle
  133.         self.y = 64
  134.         self.height = 256
  135.         self.back_opacity = 160
  136.      end
  137.   end
  138.   #--------------------------------------------------------------------------
  139.   # * Get Item
  140.   #--------------------------------------------------------------------------
  141.   def item
  142.      return @data[self.index]
  143.   end
  144.   #--------------------------------------------------------------------------
  145.   # * Refresh
  146.   #--------------------------------------------------------------------------
  147.   def refresh
  148.      if self.contents != nil
  149.         self.contents.dispose
  150.         self.contents = nil
  151.      end
  152.      @data = []
  153.      # Add item
  154.      for i in 1...$data_items.size
  155.         if $game_party.item_number(i) > 0
  156.            @data.push($data_items[i])
  157.         end
  158.      end
  159.      # Also add weapons and items if outside of battle
  160.      unless $game_temp.in_battle
  161.         for i in 1...$data_weapons.size
  162.            if $game_party.weapon_number(i) > 0
  163.               @data.push($data_weapons[i])
  164.            end
  165.         end
  166.         for i in 1...$data_armors.size
  167.            if $game_party.armor_number(i) > 0
  168.               @data.push($data_armors[i])
  169.            end
  170.         end
  171.      end
  172.      # If item count is not 0, make a bit map and draw all items
  173.      @item_max = @data.size
  174.      if @item_max > 0
  175.         self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)
  176.         for i in 0...@item_max
  177.            draw_item(i)
  178.         end
  179.      end
  180.   end
  181.   #--------------------------------------------------------------------------
  182.   # * Draw Item
  183.   #       index : item number
  184.   #--------------------------------------------------------------------------
  185.   def draw_item(index)
  186.      item = @data[index]
  187.      case item
  188.      when RPG::Item
  189.         number = $game_party.item_number(item.id)
  190.      when RPG::Weapon
  191.         number = $game_party.weapon_number(item.id)
  192.      when RPG::Armor
  193.         number = $game_party.armor_number(item.id)
  194.      end
  195.           
  196.      x = 4 + index % 2 * (288 + Theory_Greater_Icons::Width)
  197.      y = index / 2 * Theory_Greater_Icons::Height
  198.      rect = Rect.new(x, y, self.width / @column_max - Theory_Greater_Icons::Width, Theory_Greater_Icons::Height)
  199.      self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  200.      @bitmap = RPG::Cache.icon(item.icon_name)
  201.     
  202.      case item
  203.      when RPG::Weapon
  204.         weapon = $data_weapons[item.id]
  205.         if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  206.            self.contents.font.color = Theory_Greater_Icons::LegendaryColorDisabled
  207.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  208.         elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)
  209.            self.contents.font.color = Theory_Greater_Icons::RareColorDisabled
  210.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  211.         elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)
  212.            self.contents.font.color = Theory_Greater_Icons::UncommonColorDisabled
  213.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  214.         elsif !weapon.element_set.include?(Theory_Greater_Icons::RareElement) and !weapon.element_set.include?(Theory_Greater_Icons::UncommonElement) and !weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  215.            self.contents.font.color = normal_color
  216.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  217.         end
  218.      when RPG::Armor
  219.         armor = $data_armors[item.id]
  220.         if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  221.            self.contents.font.color = Theory_Greater_Icons::LegendaryColorDisabled
  222.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  223.         elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)
  224.            self.contents.font.color = Theory_Greater_Icons::RareColorDisabled
  225.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  226.         elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)
  227.            self.contents.font.color = Theory_Greater_Icons::UncommonColorDisabled
  228.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  229.         elsif !armor.guard_element_set.include?(Theory_Greater_Icons::RareElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  230.            self.contents.font.color = disabled_color
  231.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  232.         end
  233.      when RPG::Item
  234.         itema = $data_items[item.id]
  235.         if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  236.            if $game_party.item_can_use?(item.id)
  237.               self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  238.            else
  239.               self.contents.font.color = Theory_Greater_Icons::LegendaryColorDisabled
  240.            end
  241.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  242.         elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)
  243.            if $game_party.item_can_use?(item.id)
  244.               self.contents.font.color = Theory_Greater_Icons::RareColor
  245.            else
  246.               self.contents.font.color = Theory_Greater_Icons::RareColorDisabled
  247.            end
  248.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  249.         elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)
  250.            if $game_party.item_can_use?(item.id)
  251.               self.contents.font.color = Theory_Greater_Icons::UncommonColor
  252.            else
  253.               self.contents.font.color = Theory_Greater_Icons::UncommonColorDisabled
  254.            end
  255.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  256.         elsif !itema.element_set.include?(Theory_Greater_Icons::RareElement) and !itema.element_set.include?(Theory_Greater_Icons::UncommonElement) and !itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  257.            if $game_party.item_can_use?(item.id)
  258.               self.contents.font.color = normal_color
  259.            else
  260.               self.contents.font.color = disabled_color
  261.            end
  262.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  263.         end
  264.      end
  265.     
  266.      opacity = self.contents.font.color == normal_color ? 255 : 128
  267.      self.contents.draw_text(x + Theory_Greater_Icons::Width + 4, y, 212, Theory_Greater_Icons::Height, item.name, 0)
  268.      tempy = y + Theory_Greater_Icons::Height - 36
  269.      self.contents.draw_text(x - 5, tempy, 24, Theory_Greater_Icons::Height, number.to_s, 2)
  270.   end
  271. end
  272.  
  273.  
  274. #==============================================================================
  275. # ** Window_Status
  276. #------------------------------------------------------------------------------
  277. #   This window displays full status specs on the status screen.
  278. #==============================================================================
  279.  
  280. class Window_Status < Window_Base
  281.   #--------------------------------------------------------------------------
  282.   # * Object Initialization
  283.   #       actor : actor
  284.   #--------------------------------------------------------------------------
  285.   def initialize(actor)
  286.      super(0, 0, 640, 480)
  287.      self.contents = Bitmap.new(width - 32, height - 32)
  288.      @actor = actor
  289.      refresh
  290.   end
  291.   #--------------------------------------------------------------------------
  292.   # * Refresh
  293.   #--------------------------------------------------------------------------
  294.   def refresh
  295.      self.contents.clear
  296.      draw_actor_graphic(@actor, 40, 112)
  297.      draw_actor_name(@actor, 4, 0)
  298.      draw_actor_class(@actor, 4 + 144, 0)
  299.      draw_actor_level(@actor, 96, 32)
  300.      draw_actor_state(@actor, 96, 64)
  301.      draw_actor_hp(@actor, 96, 112, 172)
  302.      draw_actor_sp(@actor, 96, 144, 172)
  303.      draw_actor_parameter(@actor, 96, 192, 0)
  304.      draw_actor_parameter(@actor, 96, 224, 1)
  305.      draw_actor_parameter(@actor, 96, 256, 2)
  306.      draw_actor_parameter(@actor, 96, 304, 3)
  307.      draw_actor_parameter(@actor, 96, 336, 4)
  308.      draw_actor_parameter(@actor, 96, 368, 5)
  309.      draw_actor_parameter(@actor, 96, 400, 6)
  310.      self.contents.font.color = system_color
  311.      self.contents.draw_text(320, 48, 80, 32, "EXP")
  312.      self.contents.draw_text(320, 80, 80, 32, "NEXT")
  313.      self.contents.font.color = normal_color
  314.      self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
  315.      self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
  316.      self.contents.font.color = system_color
  317.      self.contents.draw_text(320, 160, 96, 32, "equipment")
  318.      draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 203)
  319.      draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 251)
  320.      draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 299)
  321.      draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 347)
  322.      draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 395)
  323.   end
  324. end
  325.  
  326.  
  327. #==============================================================================
  328. # ** Window_EquipItem
  329. #------------------------------------------------------------------------------
  330. #   This window displays choices when opting to change equipment on the
  331. #   equipment screen.
  332. #==============================================================================
  333.  
  334. class Window_EquipItem < Window_Selectable
  335.   #--------------------------------------------------------------------------
  336.   # * Object Initialization
  337.   #       actor         : actor
  338.   #       equip_type : equip region (0-3)
  339.   #--------------------------------------------------------------------------
  340.   def initialize(actor, equip_type)
  341.      super(0, 256, 640, 224)
  342.      @oh =   Theory_Greater_Icons::Height
  343.      @actor = actor
  344.      @equip_type = equip_type
  345.      @column_max = 2
  346.      refresh
  347.      self.active = false
  348.      self.index = -1
  349.   end
  350.   #--------------------------------------------------------------------------
  351.   # * Item Acquisition
  352.   #--------------------------------------------------------------------------
  353.   def item
  354.      return @data[self.index]
  355.   end
  356.   #--------------------------------------------------------------------------
  357.   # * Refresh
  358.   #--------------------------------------------------------------------------
  359.   def refresh
  360.      if self.contents != nil
  361.         self.contents.dispose
  362.         self.contents = nil
  363.      end
  364.      @data = []
  365.      # Add equippable weapons
  366.      if @equip_type == 0
  367.         weapon_set = $data_classes[@actor.class_id].weapon_set
  368.         for i in 1...$data_weapons.size
  369.            if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
  370.               @data.push($data_weapons[i])
  371.            end
  372.         end
  373.      end
  374.      # Add equippable armor
  375.      if @equip_type != 0
  376.         armor_set = $data_classes[@actor.class_id].armor_set
  377.         for i in 1...$data_armors.size
  378.            if $game_party.armor_number(i) > 0 and armor_set.include?(i)
  379.               if $data_armors[i].kind == @equip_type-1
  380.                  @data.push($data_armors[i])
  381.               end
  382.            end
  383.         end
  384.      end
  385.      # Add blank page
  386.      @data.push(nil)
  387.      # Make a bit map and draw all items
  388.      @item_max = @data.size
  389.      self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)
  390.      for i in 0...@item_max-1
  391.         draw_item(i)
  392.      end
  393.   end
  394.   #--------------------------------------------------------------------------
  395.   # * Draw Item
  396.   #       index : item number
  397.   #--------------------------------------------------------------------------
  398.   def draw_item(index)
  399.      item = @data[index]
  400.      x = 4 + index % 2 * (288 + 32)
  401.      y = index / 2 * Theory_Greater_Icons::Height + 2
  402.      case item
  403.      when RPG::Weapon
  404.         number = $game_party.weapon_number(item.id)
  405.      when RPG::Armor
  406.         number = $game_party.armor_number(item.id)
  407.      end
  408.      @bitmap = RPG::Cache.icon(item.icon_name)
  409.     
  410.      case item
  411.      when RPG::Weapon
  412.         weapon = @data[index]
  413.         if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  414.            self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  415.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  416.         elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)
  417.            self.contents.font.color = Theory_Greater_Icons::RareColor
  418.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  419.         elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)
  420.            self.contents.font.color = Theory_Greater_Icons::UncommonColor
  421.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  422.         elsif !weapon.element_set.include?(Theory_Greater_Icons::RareElement) and !weapon.element_set.include?(Theory_Greater_Icons::UncommonElement) and !weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  423.            self.contents.font.color = normal_color
  424.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  425.         end
  426.      when RPG::Armor
  427.         armor = @data[index]
  428.         if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  429.            self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  430.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  431.         elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)
  432.            self.contents.font.color = Theory_Greater_Icons::RareColor
  433.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  434.         elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)
  435.            self.contents.font.color = Theory_Greater_Icons::UncommonColor
  436.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  437.         elsif !armor.guard_element_set.include?(Theory_Greater_Icons::RareElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  438.            self.contents.font.color = normal_color
  439.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  440.         end
  441.      end
  442.           
  443.      self.contents.draw_text(x + Theory_Greater_Icons::Width + 3, y, 212, Theory_Greater_Icons::Height, item.name, 0)
  444.      tempy = y + Theory_Greater_Icons::Height - 36
  445.      self.contents.font.color = normal_color
  446.      self.contents.draw_text(x - 5, tempy, 24, Theory_Greater_Icons::Height, number.to_s, 2)
  447.   end
  448.   #--------------------------------------------------------------------------
  449.   # * Help Text Update
  450.   #--------------------------------------------------------------------------
  451.   def update_help
  452.      @help_window.set_text(self.item == nil ? "" : self.item.description)
  453.   end
  454. end
  455.  
  456.  
  457. #==============================================================================
  458. # ** Window_EquipRight
  459. #------------------------------------------------------------------------------
  460. #   This window displays items the actor is currently equipped with on the
  461. #   equipment screen.
  462. #==============================================================================
  463.  
  464. class Window_EquipRight < Window_Selectable
  465.   #--------------------------------------------------------------------------
  466.   # * Object Initialization
  467.   #       actor : actor
  468.   #--------------------------------------------------------------------------
  469.   def initialize(actor)
  470.      super(272, 64, 368, 192)
  471.      @oh = Theory_Greater_Icons::Height
  472.      self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, height + Theory_Greater_Icons::Height + 15)
  473.      @actor = actor
  474.      refresh
  475.      self.index = 0
  476.   end
  477.   #--------------------------------------------------------------------------
  478.   # * Item Acquisition
  479.   #--------------------------------------------------------------------------
  480.   def item
  481.      return @data[self.index]
  482.   end
  483.   #--------------------------------------------------------------------------
  484.   # * Refresh
  485.   #--------------------------------------------------------------------------
  486.   def refresh
  487.      self.contents.clear
  488.      @data = []
  489.      @data.push($data_weapons[@actor.weapon_id])
  490.      @data.push($data_armors[@actor.armor1_id])
  491.      @data.push($data_armors[@actor.armor2_id])
  492.      @data.push($data_armors[@actor.armor3_id])
  493.      @data.push($data_armors[@actor.armor4_id])
  494.      @item_max = @data.size
  495.      self.contents.font.color = system_color
  496.      self.contents.draw_text(4, Theory_Greater_Icons::Height * 0, 92, Theory_Greater_Icons::Height, $data_system.words.weapon)
  497.      self.contents.draw_text(4, Theory_Greater_Icons::Height * 1, 92, Theory_Greater_Icons::Height, $data_system.words.armor1)
  498.      self.contents.draw_text(4, Theory_Greater_Icons::Height * 2, 92, Theory_Greater_Icons::Height, $data_system.words.armor2)
  499.      self.contents.draw_text(4, Theory_Greater_Icons::Height * 3, 92, Theory_Greater_Icons::Height, $data_system.words.armor3)
  500.      self.contents.draw_text(5, Theory_Greater_Icons::Height * 4, 92, Theory_Greater_Icons::Height, $data_system.words.armor4)
  501.      draw_item_name(@data[0], 92, Theory_Greater_Icons::Height * 0)
  502.      draw_item_name(@data[1], 92, Theory_Greater_Icons::Height * 1)
  503.      draw_item_name(@data[2], 92, Theory_Greater_Icons::Height * 2)
  504.      draw_item_name(@data[3], 92, Theory_Greater_Icons::Height * 3)
  505.      draw_item_name(@data[4], 92, Theory_Greater_Icons::Height * 4)
  506.   end
  507.   #--------------------------------------------------------------------------
  508.   # * Help Text Update
  509.   #--------------------------------------------------------------------------
  510.   def update_help
  511.      @help_window.set_text(self.item == nil ? "" : self.item.description)
  512.   end
  513. end
  514.  
  515.  
  516.  
  517. #==============================================================================
  518. # ** Window_Skill
  519. #------------------------------------------------------------------------------
  520. #   This window displays usable skills on the skill and battle screens.
  521. #==============================================================================
  522.  
  523. class Window_Skill < Window_Selectable
  524.   #--------------------------------------------------------------------------
  525.   # * Object Initialization
  526.   #       actor : actor
  527.   #--------------------------------------------------------------------------
  528.   def initialize(actor)
  529.      super(0, 128, 640, 352)
  530.      @oh = Theory_Greater_Icons::Height
  531.      @actor = actor
  532.      @column_max = 2
  533.      refresh
  534.      self.index = 0
  535.      # If in battle, move window to center of screen
  536.      # and make it semi-transparent
  537.      if $game_temp.in_battle
  538.         self.y = 64
  539.         self.height = 256
  540.         self.back_opacity = 160
  541.      end
  542.   end
  543.   #--------------------------------------------------------------------------
  544.   # * Acquiring Skill
  545.   #--------------------------------------------------------------------------
  546.   def skill
  547.      return @data[self.index]
  548.   end
  549.   #--------------------------------------------------------------------------
  550.   # * Refresh
  551.   #--------------------------------------------------------------------------
  552.   def refresh
  553.      if self.contents != nil
  554.         self.contents.dispose
  555.         self.contents = nil
  556.      end
  557.      @data = []
  558.      for i in [email hidden]
  559.         skill = $data_skills[@actor.skills[i]]
  560.         if skill != nil
  561.            @data.push(skill)
  562.         end
  563.      end
  564.      # If item count is not 0, make a bit map and draw all items
  565.      @item_max = @data.size
  566.      if @item_max > 0
  567.         self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)
  568.         for i in 0...@item_max
  569.            draw_item(i)
  570.         end
  571.      end
  572.   end
  573.   #--------------------------------------------------------------------------
  574.   # * Draw Item
  575.   #       index : item number
  576.   #--------------------------------------------------------------------------
  577.   def draw_item(index)
  578.      skill = @data[index]
  579.      x = 4 + index % 2 * (288 + Theory_Greater_Icons::Width)
  580.      y = index / 2 * Theory_Greater_Icons::Height
  581.      rect = Rect.new(x, y, self.width / @column_max - Theory_Greater_Icons::Width, Theory_Greater_Icons::Height)
  582.      self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  583.      @bitmap = RPG::Cache.icon(skill.icon_name)
  584.     
  585.      if skill.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  586.         if @actor.skill_can_use?(skill.id)
  587.            self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  588.         else
  589.            self.contents.font.color = Theory_Greater_Icons::LegendaryColorDisabled
  590.         end
  591.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  592.      elsif skill.element_set.include?(Theory_Greater_Icons::RareElement)
  593.         if @actor.skill_can_use?(skill.id)
  594.            self.contents.font.color = Theory_Greater_Icons::RareColor
  595.         else
  596.            self.contents.font.color = Theory_Greater_Icons::RareColorDisabled
  597.         end
  598.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  599.      elsif skill.element_set.include?(Theory_Greater_Icons::UncommonElement)
  600.         if @actor.skill_can_use?(skill.id)
  601.            self.contents.font.color = Theory_Greater_Icons::UncommonColor
  602.         else
  603.            self.contents.font.color = Theory_Greater_Icons::UncommonColorDisabled
  604.         end
  605.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  606.      elsif !skill.element_set.include?(Theory_Greater_Icons::RareElement) and !skill.element_set.include?(Theory_Greater_Icons::UncommonElement) and !skill.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  607.         if @actor.skill_can_use?(skill.id)
  608.            self.contents.font.color = normal_color
  609.         else
  610.            self.contents.font.color = disabled_color
  611.         end
  612.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  613.      end
  614.      self.contents.draw_text(x + Theory_Greater_Icons::Width + 4, y - 10, 204, Theory_Greater_Icons::Height, skill.name, 0)
  615.      self.contents.draw_text(x + Theory_Greater_Icons::Width + 6, y + 10, 48, Theory_Greater_Icons::Height, skill.sp_cost.to_s, 2)
  616.   end
  617.   #--------------------------------------------------------------------------
  618.   # * Help Text Update
  619.   #--------------------------------------------------------------------------
  620.   def update_help
  621.      @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  622.   end
  623. end
  624.  
  625.  
  626. #==============================================================================
  627. # ** Window_BattleResult
  628. #------------------------------------------------------------------------------
  629. #   This window displays amount of gold and EXP acquired at the end of a battle.
  630. #==============================================================================
  631.  
  632. class Window_BattleResult < Window_Base
  633.   #--------------------------------------------------------------------------
  634.   # * Object Initialization
  635.   #       exp          : EXP
  636.   #       gold         : amount of gold
  637.   #       treasures : treasures
  638.   #--------------------------------------------------------------------------
  639.   def initialize(exp, gold, treasures)
  640.      @exp = exp
  641.      @gold = gold
  642.      @treasures = treasures
  643.      super(160, 0, 320, @treasures.size *   Theory_Greater_Icons::Height + 64)
  644.      self.contents = Bitmap.new(width - 32, height - 32)
  645.      self.y = 160 - height / 2
  646.      self.back_opacity = 160
  647.      self.visible = false
  648.      refresh
  649.   end
  650.   #--------------------------------------------------------------------------
  651.   # * Refresh
  652.   #--------------------------------------------------------------------------
  653.   def refresh
  654.      self.contents.clear
  655.      x = 4
  656.      self.contents.font.color = normal_color
  657.      cx = contents.text_size(@exp.to_s).width
  658.      self.contents.draw_text(x, 0, cx, 32, @exp.to_s)
  659.      x += cx + 4
  660.      self.contents.font.color = system_color
  661.      cx = contents.text_size("EXP").width
  662.      self.contents.draw_text(x, 0, 64, 32, "EXP")
  663.      x += cx + 16
  664.      self.contents.font.color = normal_color
  665.      cx = contents.text_size(@gold.to_s).width
  666.      self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
  667.      x += cx + 4
  668.      self.contents.font.color = system_color
  669.      self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
  670.      y = 32
  671.      for item in @treasures
  672.         draw_item_name(item, 4, y)
  673.         y += Theory_Greater_Icons::Height
  674.      end
  675.   end
  676. end
  677.  
  678.  
  679. #==============================================================================
  680. # ** Window_ShopBuy
  681. #------------------------------------------------------------------------------
  682. #   This window displays buyable goods on the shop screen.
  683. #==============================================================================
  684.  
  685. class Window_ShopBuy < Window_Selectable
  686.   #--------------------------------------------------------------------------
  687.   # * Object Initialization
  688.   #       shop_goods : goods
  689.   #--------------------------------------------------------------------------
  690.   def initialize(shop_goods)
  691.      super(0, 128, 368, 352)
  692.      @oh = Theory_Greater_Icons::Height
  693.      @shop_goods = shop_goods
  694.      refresh
  695.      self.index = 0
  696.   end
  697.   #--------------------------------------------------------------------------
  698.   # * Refresh
  699.   #--------------------------------------------------------------------------
  700.   def refresh
  701.      if self.contents != nil
  702.         self.contents.dispose
  703.         self.contents = nil
  704.      end
  705.      @data = []
  706.      for goods_item in @shop_goods
  707.         case goods_item[0]
  708.         when 0
  709.            item = $data_items[goods_item[1]]
  710.         when 1
  711.            item = $data_weapons[goods_item[1]]
  712.         when 2
  713.            item = $data_armors[goods_item[1]]
  714.         end
  715.         if item != nil
  716.            @data.push(item)
  717.         end
  718.      end
  719.      # If item count is not 0, make a bit map and draw all items
  720.      @item_max = @data.size
  721.      if @item_max > 0
  722.         self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)
  723.         for i in 0...@item_max
  724.            draw_item(i)
  725.         end
  726.      end
  727.   end
  728.  
  729.   #--------------------------------------------------------------------------
  730.   # * Draw Item
  731.   #       index : item number
  732.   #--------------------------------------------------------------------------
  733.   def draw_item(index)
  734.      item = @data[index]
  735.      x = 4
  736.      y = index * Theory_Greater_Icons::Height
  737.      case item
  738.      when RPG::Weapon
  739.         number = $game_party.weapon_number(item.id)
  740.      when RPG::Armor
  741.         number = $game_party.armor_number(item.id)
  742.      end
  743.      @bitmap = RPG::Cache.icon(item.icon_name)
  744.      case item
  745.      when RPG::Item
  746.         number = $game_party.item_number(item.id)
  747.      when RPG::Weapon
  748.         number = $game_party.weapon_number(item.id)
  749.      when RPG::Armor
  750.         number = $game_party.armor_number(item.id)
  751.      end
  752.      case item
  753.      when RPG::Weapon
  754.         weapon = @data[index]
  755.         if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  756.            self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  757.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  758.         elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)
  759.            self.contents.font.color = Theory_Greater_Icons::RareColor
  760.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  761.         elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)
  762.            self.contents.font.color = Theory_Greater_Icons::UncommonColor
  763.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  764.         elsif !weapon.element_set.include?(Theory_Greater_Icons::RareElement) and !weapon.element_set.include?(Theory_Greater_Icons::UncommonElement) and !weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  765.            self.contents.font.color = normal_color
  766.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  767.         end
  768.      when RPG::Armor
  769.         armor = @data[index]
  770.         if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  771.            self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  772.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  773.         elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)
  774.            self.contents.font.color = Theory_Greater_Icons::RareColor
  775.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  776.         elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)
  777.            self.contents.font.color = Theory_Greater_Icons::UncommonColor
  778.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  779.         elsif !armor.guard_element_set.include?(Theory_Greater_Icons::RareElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  780.            self.contents.font.color = normal_color
  781.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  782.         end
  783.      when RPG::Item
  784.         itema = $data_items[item.id]
  785.         if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  786.            self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  787.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  788.         elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)
  789.            self.contents.font.color = Theory_Greater_Icons::RareColor
  790.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  791.         elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)
  792.            self.contents.font.color = Theory_Greater_Icons::UncommonColor
  793.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  794.         elsif !itema.element_set.include?(Theory_Greater_Icons::RareElement) and !itema.element_set.include?(Theory_Greater_Icons::UncommonElement) and !itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  795.            self.contents.font.color = normal_color
  796.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  797.         end
  798.      end
  799.     
  800.      # Get items in possession
  801.      case item
  802.      when RPG::Item
  803.         number = $game_party.item_number(item.id)
  804.      when RPG::Weapon
  805.         number = $game_party.weapon_number(item.id)
  806.      when RPG::Armor
  807.         number = $game_party.armor_number(item.id)
  808.      end
  809.      # If price is less than money in possession, and amount in possession is
  810.      # not 99, then set to normal text color. Otherwise set to disabled color
  811.      if item.price <= $game_party.gold and number < 99
  812.      else
  813.         self.contents.font.color = disabled_color
  814.      end
  815.      pricea = item.price
  816.      self.contents.draw_text(x + Theory_Greater_Icons::Width + 3, y, 212, Theory_Greater_Icons::Height, item.name, 0)
  817.      tempy = y + Theory_Greater_Icons::Height - 36
  818.      self.contents.font.color = normal_color
  819.      self.contents.draw_text(x - 5, tempy, 24, Theory_Greater_Icons::Height, number.to_s, 2)
  820.      self.contents.draw_text(x + 200, y, 16, Theory_Greater_Icons::Height, ":", 1)
  821.      self.contents.draw_text(x + 206, y, 60, Theory_Greater_Icons::Height, pricea.to_s, 2)
  822.   end
  823.  
  824.  
  825.  
  826.  
  827. end
  828.  
  829. #==============================================================================
  830. # ** Window_ShopSell
  831. #------------------------------------------------------------------------------
  832. #   This window displays items in possession for selling on the shop screen.
  833. #==============================================================================
  834.  
  835. class Window_ShopSell < Window_Selectable
  836.  
  837.   #--------------------------------------------------------------------------
  838.   # * Object Initialization
  839.   #--------------------------------------------------------------------------
  840.   def initialize
  841.      super(0, 128, 640, 352)
  842.      @oh = Theory_Greater_Icons::Height
  843.      @column_max = 2
  844.      refresh
  845.      self.index = 0
  846.   end
  847.   #--------------------------------------------------------------------------
  848.   # * Refresh
  849.   #--------------------------------------------------------------------------
  850.   def refresh
  851.      if self.contents != nil
  852.         self.contents.dispose
  853.         self.contents = nil
  854.      end
  855.      @data = []
  856.      for i in 1...$data_items.size
  857.         if $game_party.item_number(i) > 0
  858.            @data.push($data_items[i])
  859.         end
  860.      end
  861.      for i in 1...$data_weapons.size
  862.         if $game_party.weapon_number(i) > 0
  863.            @data.push($data_weapons[i])
  864.         end
  865.      end
  866.      for i in 1...$data_armors.size
  867.         if $game_party.armor_number(i) > 0
  868.            @data.push($data_armors[i])
  869.         end
  870.      end
  871.      # If item count is not 0, make a bitmap and draw all items
  872.      @item_max = @data.size
  873.      if @item_max > 0
  874.         self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)
  875.         for i in 0...@item_max
  876.            draw_item(i)
  877.         end
  878.      end
  879.   end
  880.   #--------------------------------------------------------------------------
  881.   # * Draw Item
  882.   #       index : item number
  883.   #--------------------------------------------------------------------------
  884.   def draw_item(index)
  885.      item = @data[index]
  886.      x = 4 + index % 2 * (288 + 32)
  887.      y = index / 2 * Theory_Greater_Icons::Height
  888.      case item
  889.      when RPG::Weapon
  890.         number = $game_party.weapon_number(item.id)
  891.      when RPG::Armor
  892.         number = $game_party.armor_number(item.id)
  893.      end
  894.      @bitmap = RPG::Cache.icon(item.icon_name)
  895.      case item
  896.      when RPG::Item
  897.         number = $game_party.item_number(item.id)
  898.      when RPG::Weapon
  899.         number = $game_party.weapon_number(item.id)
  900.      when RPG::Armor
  901.         number = $game_party.armor_number(item.id)
  902.      end
  903.      case item
  904.      when RPG::Weapon
  905.         weapon = @data[index]
  906.         if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  907.            self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  908.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  909.         elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)
  910.            self.contents.font.color = Theory_Greater_Icons::RareColor
  911.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  912.         elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)
  913.            self.contents.font.color = Theory_Greater_Icons::UncommonColor
  914.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  915.         elsif !weapon.element_set.include?(Theory_Greater_Icons::RareElement) and !weapon.element_set.include?(Theory_Greater_Icons::UncommonElement) and !weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  916.            self.contents.font.color = normal_color
  917.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  918.         end
  919.      when RPG::Armor
  920.         armor = @data[index]
  921.         if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  922.            self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  923.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  924.         elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)
  925.            self.contents.font.color = Theory_Greater_Icons::RareColor
  926.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  927.         elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)
  928.            self.contents.font.color = Theory_Greater_Icons::UncommonColor
  929.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  930.         elsif !armor.guard_element_set.include?(Theory_Greater_Icons::RareElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  931.            self.contents.font.color = normal_color
  932.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  933.         end
  934.      when RPG::Item
  935.         itema = $data_items[item.id]
  936.         if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  937.            self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  938.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  939.         elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)
  940.            self.contents.font.color = Theory_Greater_Icons::RareColor
  941.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  942.         elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)
  943.            self.contents.font.color = Theory_Greater_Icons::UncommonColor
  944.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  945.         elsif !itema.element_set.include?(Theory_Greater_Icons::RareElement) and !itema.element_set.include?(Theory_Greater_Icons::UncommonElement) and !itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  946.            self.contents.font.color = normal_color
  947.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  948.         end
  949.      end
  950.     
  951.      if item.price <= 0
  952.         self.contents.font.color = disabled_color
  953.      end
  954.      pricea = item.price / 2
  955.      self.contents.draw_text(x + Theory_Greater_Icons::Width + 3, y, 212, Theory_Greater_Icons::Height, item.name, 0)
  956.      tempy = y + Theory_Greater_Icons::Height - 36
  957.      self.contents.font.color = normal_color
  958.      self.contents.draw_text(x - 5, tempy, 24, Theory_Greater_Icons::Height, number.to_s, 2)
  959.      self.contents.draw_text(x + 200, y, 16, Theory_Greater_Icons::Height, ":", 1)
  960.      self.contents.draw_text(x + 206, y, 60, Theory_Greater_Icons::Height, pricea.to_s, 2)
  961.   end
  962. end
  963.  
  964.  
  965.  
  966. class Bitmap
  967.   def draw_icon(x, y, filename, back='')
  968.      backdrop = RPG::Cache.icon(back)
  969.      center_x = Theory_Greater_Icons::Width / 2 + x
  970.      center_y = Theory_Greater_Icons::Height / 2 + y
  971.      left_x = center_x - backdrop.rect.width / 2
  972.      upper_y = center_y - backdrop.rect.height / 2
  973.      self.blt(left_x, upper_y, backdrop, backdrop.rect, 255)
  974.      bitmap = filename
  975.      left_x = center_x - bitmap.rect.width / 2
  976.      upper_y = center_y - bitmap.rect.height / 2
  977.      self.blt(left_x, upper_y - 2, bitmap, bitmap.rect, 255)
  978.   end
  979. end
  980.  
  981. class Window_Base
  982.  
  983.   #--------------------------------------------------------------------------
  984.   # * Draw Item Name
  985.   #       item : item
  986.   #       x      : draw spot x-coordinate
  987.   #       y      : draw spot y-coordinate
  988.   #--------------------------------------------------------------------------
  989.   def draw_item_name(item, x, y)
  990.      if item == nil
  991.         return
  992.      end
  993.      @bitmap = RPG::Cache.icon(item.icon_name)
  994.      case item
  995.      when RPG::Weapon
  996.         weapon = $data_weapons[item.id]
  997.         if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  998.            self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  999.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  1000.         elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)
  1001.            self.contents.font.color = Theory_Greater_Icons::RareColor
  1002.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  1003.         elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)
  1004.            self.contents.font.color = Theory_Greater_Icons::UncommonColor
  1005.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  1006.         elsif !weapon.element_set.include?(Theory_Greater_Icons::RareElement) and !weapon.element_set.include?(Theory_Greater_Icons::UncommonElement) and !weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  1007.            self.contents.font.color = normal_color
  1008.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  1009.         end
  1010.      when RPG::Armor
  1011.         armor = $data_armors[item.id]
  1012.         if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  1013.            self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  1014.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  1015.         elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)
  1016.            self.contents.font.color = Theory_Greater_Icons::RareColor
  1017.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  1018.         elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)
  1019.            self.contents.font.color = Theory_Greater_Icons::UncommonColor
  1020.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  1021.         elsif !armor.guard_element_set.include?(Theory_Greater_Icons::RareElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  1022.            self.contents.font.color = normal_color
  1023.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  1024.         end
  1025.      when RPG::Item
  1026.         itema = $data_items[item.id]
  1027.         if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  1028.            self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  1029.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  1030.         elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)
  1031.            self.contents.font.color = Theory_Greater_Icons::RareColor
  1032.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  1033.         elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)
  1034.            self.contents.font.color = Theory_Greater_Icons::UncommonColor
  1035.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  1036.         elsif !itema.element_set.include?(Theory_Greater_Icons::RareElement) and !itema.element_set.include?(Theory_Greater_Icons::UncommonElement) and !itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  1037.            self.contents.font.color = normal_color
  1038.            self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  1039.         end
  1040.      end
  1041.      self.contents.draw_text(x + Theory_Greater_Icons::Width + 4, y, 212, Theory_Greater_Icons::Width, item.name)
  1042.   end
  1043.  
  1044. end
  1045.  
  1046.  
Expand to see the code.


Compatibility Patches

Weapon Icon Animations Show
Link...
  1.  
  2. module Theory_Greater_Icons
  3.    
  4.     Icon_Changes = {"001-Weapon01" => "Sword001"}
  5.    
  6.  end
  7.    
  8.  class Window_Base
  9.    
  10.     def draw_item_name(item, x, y)
  11.        if item == nil
  12.           return
  13.        end
  14.        icon = item.icon_name
  15.        change = Theory_Greater_Icons::Icon_Changes
  16.        for i in change.keys
  17.           if item.icon_name == i
  18.              icon = change[i]
  19.           end
  20.      end
  21.        @bitmap = RPG::Cache.icon(icon)
  22.        case item
  23.        when RPG::Weapon
  24.           weapon = $data_weapons[item.id]
  25.           if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  26.              self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  27.              self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  28.           elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)
  29.              self.contents.font.color = Theory_Greater_Icons::RareColor
  30.              self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  31.           elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)
  32.              self.contents.font.color = Theory_Greater_Icons::UncommonColor
  33.              self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  34.           elsif !weapon.element_set.include?(Theory_Greater_Icons::RareElement) and !weapon.element_set.include?(Theory_Greater_Icons::UncommonElement) and !weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  35.              self.contents.font.color = normal_color
  36.              self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  37.           end
  38.        when RPG::Armor
  39.           armor = $data_armors[item.id]
  40.           if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  41.              self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  42.              self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  43.           elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)
  44.              self.contents.font.color = Theory_Greater_Icons::RareColor
  45.              self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  46.           elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)
  47.              self.contents.font.color = Theory_Greater_Icons::UncommonColor
  48.              self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  49.           elsif !armor.guard_element_set.include?(Theory_Greater_Icons::RareElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  50.              self.contents.font.color = normal_color
  51.              self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  52.           end
  53.        when RPG::Item
  54.           itema = $data_items[item.id]
  55.           if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  56.              self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  57.              self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  58.           elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)
  59.              self.contents.font.color = Theory_Greater_Icons::RareColor
  60.              self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  61.           elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)
  62.              self.contents.font.color = Theory_Greater_Icons::UncommonColor
  63.              self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  64.           elsif !itema.element_set.include?(Theory_Greater_Icons::RareElement) and !itema.element_set.include?(Theory_Greater_Icons::UncommonElement) and !itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  65.              self.contents.font.color = normal_color
  66.              self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  67.           end
  68.        end
  69.        self.contents.draw_text(x + Theory_Greater_Icons::Width + 4, y, 212, Theory_Greater_Icons::Width, item.name)
  70.     end
  71.    
  72.  end
  73.  
Expand to see the code.


Instructions

Copy and paste the script (or use the demo).   Change the settings at the top to the X and Y size of your icons.   You can also set up the rarity colors and elements here.

Compatibility

This script will probably be incompatible with any CMS that uses draw_icon rather than draw_item_name. If you would like to suggest a compatibility patch, there's a good chance I can make it for you.

Credits and Thanks

Credits to SephirothSpawn and Glitchfinder.

Author's Notes

The new features : : I've added Icon/Text highlighting to support rarity, or anything else you want to do with it. Setup is at the top of the script. The demo shows it best. Also, there were a lot of problems with the old script- everything from the Battle Result window, which I forgot to fix, to the Shop windows, which I completely overlooked. And a couple pixel-off display problems.

These have ALL been addressed. The new functionality doesn't appear to have any bugs. If it does, please PM me immediately so I can take care of it. Enjoy!
You know me, I have to add suggestions. :p

Firstly, I suggest making a module to hold your icon size.
module Theory_Sized_Icons
  Width = 50
  Height = 50
end
Expand to see the code.


No sense on filling up $game_system with instances that should not change.


Secondly, in case someone uses smaller icons, I suggest making a method in the Bitmap class to draw icons, but center them in in your icon area.
class Bitmap
  def draw_icon(x, y, filename)
    center_x = Theory_Sized_Icons::Width / 2 + x
    center_y = Theory_Sized_Icons::Height / 2 + y
    bitmap = RPG::Cache.icon(filename)
    left_x = center_x - bitmap.rect.width / 2
    upper_y = center_y - bitmap.rect.height / 2
    self.blt(left_x, upper_y, bitmap, bitmap.rect)
  end
end
Expand to see the code.


It just finds the center and subtracts half of what the actual icon file size is on the x and y.

----------------------

I wouldn't make a new sub-class for your selectable icon commands. Instead, you can use something like this, that modifies just like you did, but modifies all selectable windows and each can customize with their own oh method.

#==============================================================================
# ** Window_Selectable
#==============================================================================

class Window_Selectable
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_writer :oh
  #--------------------------------------------------------------------------
  # * Text Cursor Height
  #--------------------------------------------------------------------------
  def oh
    return @oh.nil? ? 32 : @oh
  end
  #--------------------------------------------------------------------------
  # * Get Top Row
  #--------------------------------------------------------------------------
  def top_row
    # Divide y-coordinate of window contents transfer origin by 1 row
    # height of self.oh
    return self.oy / self.oh
  end
  #--------------------------------------------------------------------------
  # * Set Top Row
  #     row : row shown on top
  #--------------------------------------------------------------------------
  def top_row=(row)
    # If row is less than 0, change it to 0
    # If row exceeds row_max - 1, change it to row_max - 1
    row = [[row, 0].max, row_max - 1].min
    # Multiply 1 row height by 32 for y-coordinate of window contents
    # transfer origin
    self.oy = row * self.oh
  end
  #--------------------------------------------------------------------------
  # * Get Number of Rows Displayable on 1 Page
  #--------------------------------------------------------------------------
  def page_row_max
    # Subtract a frame height of 32 from the window height, and divide it by
    # 1 row height of self.oh
    return (self.height - 32) / self.oh
  end
  #--------------------------------------------------------------------------
  # * Update Cursor Rectangle
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # If cursor position is less than 0
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    row = @index / @column_max
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end
    # Calculate cursor width
    cursor_width = self.width / @column_max - 32
    # Calculate cursor coordinates
    x = @index % @column_max * (cursor_width + 32)
    y = @index / @column_max * self.oh - self.oy
    if self.active == true
      # Update cursor rectangle
      self.cursor_rect.set(x, y, cursor_width, self.oh)
    end
  end
end
Expand to see the code.


With that, you'll only need to re-write the refresh/draw_item methods in your Window_Item and Window_Skill classes.
   
You're really working hard aren't you? I like this, it fills a request in the requests section, and is actually useful to more people than the requestor. Also, sorry about not clarifying when to use what kind of variables (and where to put them) while I was talking to you. Try looking in Seph's signature for a link to some general rules for Ruby scripting.
Thanks as usual, Seph.  Changes will be made within the hour.

Edit:  What's wrong with Menu_EquipRight ?  It looks good to me, but it doesn't display past the window boundary when you scroll down.  Check the demo to see what I mean.  I'd like to get that fixed before reupload.

Edit 2:  Why is there no documentation available on modules?
Intresting script. I have to give you props!
http://www.ruby-doc.org/core/classes/Module.html

I'll take a look at your demo

Problem seems to be your Window_SelectIcon. Try updating with the selectable mod I gave you.

PS: Might want to check into Window_BattleResult
:shock: Mods? Ya, that would make this a lot easyer. Probubly make the script run faster.
I was looking at the battle_result window earlier.  I'll get it too.  The problem with the selecticon- before I seperated the class I had wasted the time of making a whole f*cking cms where anything I select was 50px (was absolutely horrid).  still had the same problem though.
I can make the window bigger and it works- but for some reason it won't scroll down.

And thanks SOO much for the docs on modules- I had checked the help file, the link in your sig, and google and found nothing.  That helps.

@Necro- stay tuned- I've got a surprise for you with the next update.

I'll try to get everything fixed by tommorow.  Seph, I'm going to need your help with MLA.  I'll send you a PM explaining it.
No problem. You might also want to increase your cursor height by 4, 6 or 8 more than your icon height. Otherwise your icon touches your cursor edges and doesn't look as appealing.
Okay, I've got everything fixed up- this script now works beautifully.
I'm designing an 50px icon pack to show off the true beauty of this script.  I'll have it done in a few minutes.
I've added a couple new features, such as backdrop.  Thanks SephSpawn.  I owe ya one.  Well, more than one by now...

Script update imminent.
Script works great.  I'll probably increase the cursor size tommorow when I get the icon pack done.  Sorry I don't have screenshots of the icon pack- but download it and check it out.  There's also a couple of my smaller scripts included in the demo- such as Load on Menu and Icon Backdrop (patched for Greater Icons).

Let me know what you think.

EDIT : :  I am too tired- I forgot Battle Result.  This will be fixed too.  Next update tommorow afternoon.
Ok. With the Window_Selectable I gave you, you don't have to define your @oh instance. You can just create a method called oh and return a value.

  def oh
  return Theory_Icon_Size::Height
  end
Expand to see the code.


-----------------------------------------

Second, try to over-write as few methods as you can. Like here (which this mod you don't need anymore since you can just create the oh method like instructed above):
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 640, 416)
    @column_max = 2
##set the parent selectable height
    @oh = 50
    refresh
    self.index = 0
    # If in battle, move window to center of screen
    # and make it semi-transparent
    if $game_temp.in_battle
      self.y = 64
      self.height = 256
      self.back_opacity = 160
    end
  end
Expand to see the code.


Unless I am wrong, the only thing you added was the added of setting an instance. When you do this, to make your scripts more compatable, use the alias_method.

class Your_Class
  alias_method :theory_scriptname_classname_methodname, :method_name
  def method_name
    # modifications before original call
    theory_scriptname_classname_methodname
    # modification after original call
  end
end
Expand to see the code.


The users of your scripts will appreciate it.

--------------------------------------

Also, you only need to add modifications to a method. If you are adding to a method, then you need to have it in your script. Like here:
  #--------------------------------------------------------------------------
  # * Get Item
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
Expand to see the code.


That method can be remove. It's actually better to not include it because it could overwrite aliases previous scripts may have added to that method.

---------------------------------

Hope those little tips help you in the future.
lol thanks *again* seph.  I'll make the edits tommorow and upload w/the rest of the icon pack and the screenshots.  I'll get my scripting up to standards eventually.
theory wrote:
lol thanks *again* seph.  I'll make the edits tommorow and upload w/the rest of the icon pack and the screenshots.  I'll get my scripting up to standards eventually.


It takes a while to get up to standards, and some people never make it. On a side note, how'd you get that user bar?
Oh! Been looking for something like this. Does this like just stretch the icons or can you really use larger icon files? Also, is it just for the default battle and menu system or like a "general" edit so you can use this in custom menu's etc?

If it's the last choice from both, I love you. :p

Edit: Forget I asked. Looked into it myself lol. Gotta love my laziness.
Doesn't work with my menu anyway. :(
Nice script nonetheless, will be useful to lots of people. :)
The menus call the method independantly, unfortunately.  If you send me your battle and menu system, I can edit them to support this script.
I just found out that I won't be home today so the rest of the icon pack and the minor script updates will be done tommorow.

To answer the question, it does *not* stretch icons- you specify a maximum (cursor size) size and you can use any icon up to those dimensions.  Smaller icons (thanks to Seph) center themselves in the area, but do not get stretched.  See the demo for examples.

@glitch: I cheated.  figure it out.


EDIT: I am too tired to script anything.  Horrible day today. I'll do it tommorow.
Thank you so much!  I've been waiting on a script like this forever!
Ummm..... e  in the battle, when you get to choose the foe for the skill, the skill window stays open and you can see nothing
Odd- I didn't have this problem.
Are you using a custom battle system?
If so (or even if not), if you'd trust me enough to share your project with me, I could fix it for you.
You can send it to [email hidden] .
If you're not comfortable with this, than I need to know what all scripts you are using, and I can attempt to recreate the problem and make a patch for you.

I still need to fix the Battle_Result window, too.
I've been slammed trying to raise funds for RPGA... I should have more time starting next week and get more scripting done.
Hey Theory,
  Not to add a bunch more onto your plate, but I am having a problem with the equip window and the larger icons. Your demo was based on 50x50 tiles, and I need 60x60. I tried to adapt it to 60x60 but all it did was cause errors. If I start the game test, and go to Aluxes' equip screen, I get an error that crashes the game. It used to actually go there but the slection box was all screwed up and the sizes were messed up too
  Could I send you a copy of my demo so you can see what I'm talking about? I can't even fix it enough to get it to run...    ='(
Of course.
theory @ theorystudios.net
Updated to version 2.1. Adds item rarity features, and fixes the whole slew of bugs I found. If anyone finds any new bugs from the new features (or sees something I missed), let me know.

Updated first post with new script/download/screenies.
Wow, this is very useful. I'm working on a compatibility patch for my icon animations script right now.

Keep it up man^^
I have been looking all over the internet for a script like this. I finally found one but I can't seem to get it running. In your instructions you say to copy and paste the script but to where? I have tried above main and below Scene_Debug (the usual). That has not worked, I really would like to use this script but I really need some help.
Quite obviously, the script has some formatting problems, likely through some form of database shifting in the past history of this board. Now I'm not sure if the A things are the only problem, but in any case, here you go with a quick-fixed version by search&replace:

  1. #==============================================================================
  2. # ** Theory's Greater Icons
  3. #------------------------------------------------------------------------------
  4. # This script allows you to set x and y sizes for your item and skill icons.
  5. # Be sure to make the files in your icons folder reflect this- it does not
  6. # stretch icons. This script was optimized for 50x50 icons, but any dimensions
  7. # larger than 30x30 and smaller than 200x200 should work.
  8. #
  9. # It required a small menu edit for quantity and SP cost locations; and will
  10. # not be compatible with most CMS's without editing.
  11. #==============================================================================
  12.  
  13. module Theory_Greater_Icons
  14.   Width = 50
  15.   Height = 50
  16.   Background = 'back'
  17.  
  18.   UncommonElement = 18
  19.   UncommonBackground = 'uncommon'
  20.   UncommonColor = Color.new(0, 255, 0, 255)
  21.   UncommonColorDisabled = Color.new(0, 255, 0, 128)
  22.  
  23.   RareElement = 19
  24.   RareBackground = 'rare'
  25.   RareColor = Color.new(0, 200, 255, 255)
  26.   RareColorDisabled = Color.new(0, 200, 255, 128)
  27.  
  28.   LegendaryElement = 20
  29.   LegendaryBackground = 'legendary'
  30.   LegendaryColor = Color.new(255, 255, 0, 255)
  31.   LegendaryColorDisabled = Color.new(255, 255, 0, 128)
  32.  
  33. end
  34.  
  35. #==============================================================================
  36. # ** Window_Selectable
  37. #==============================================================================
  38.  
  39. class Window_Selectable
  40.   #--------------------------------------------------------------------------
  41.   # * Public Instance Variables
  42.   #--------------------------------------------------------------------------
  43.   attr_writer :oh
  44.   #--------------------------------------------------------------------------
  45.   # * Text Cursor Height
  46.   #--------------------------------------------------------------------------
  47.   def oh
  48.     return @oh.nil? ? 32 : @oh
  49.   end
  50.   #--------------------------------------------------------------------------
  51.   # * Get Top Row
  52.   #--------------------------------------------------------------------------
  53.   def top_row
  54.     # Divide y-coordinate of window contents transfer origin by 1 row
  55.     # height of self.oh
  56.     return self.oy / self.oh
  57.   end
  58.   #--------------------------------------------------------------------------
  59.   # * Set Top Row
  60.   #     row : row shown on top
  61.   #--------------------------------------------------------------------------
  62.   def top_row=(row)
  63.     # If row is less than 0, change it to 0
  64.     # If row exceeds row_max - 1, change it to row_max - 1
  65.     row = [[row, 0].max, row_max - 1].min
  66.     # Multiply 1 row height by 32 for y-coordinate of window contents
  67.     # transfer origin
  68.     self.oy = row * self.oh
  69.   end
  70.   #--------------------------------------------------------------------------
  71.   # * Get Number of Rows Displayable on 1 Page
  72.   #--------------------------------------------------------------------------
  73.   def page_row_max
  74.     # Subtract a frame height of 32 from the window height, and divide it by
  75.     # 1 row height of self.oh
  76.     return (self.height - 32) / self.oh
  77.   end
  78.   #--------------------------------------------------------------------------
  79.   # * Update Cursor Rectangle
  80.   #--------------------------------------------------------------------------
  81.   def update_cursor_rect
  82.     # If cursor position is less than 0
  83.     if @index < 0
  84.       self.cursor_rect.empty
  85.       return
  86.     end
  87.     # Get current row
  88.     row = @index / @column_max
  89.     # If current row is before top row
  90.     if row < self.top_row
  91.       # Scroll so that current row becomes top row
  92.       self.top_row = row
  93.     end
  94.     # If current row is more to back than back row
  95.     if row > self.top_row + (self.page_row_max - 1)
  96.       # Scroll so that current row becomes back row
  97.       self.top_row = row - (self.page_row_max - 1)
  98.     end
  99.     # Calculate cursor width
  100.     cursor_width = self.width / @column_max - 32
  101.     # Calculate cursor coordinates
  102.     x = @index % @column_max * (cursor_width + 32)
  103.     y = @index / @column_max * self.oh - self.oy
  104.     if self.active == true
  105.       # Update cursor rectangle
  106.       self.cursor_rect.set(x, y, cursor_width, self.oh)
  107.     end
  108.   end
  109. end
  110.  
  111. #==============================================================================
  112. # ** Window_Item
  113. #------------------------------------------------------------------------------
  114. # This window displays items in possession on the item and battle screens.
  115. #==============================================================================
  116.  
  117. class Window_Item < Window_Selectable
  118.   #--------------------------------------------------------------------------
  119.   # * Object Initialization
  120.   #--------------------------------------------------------------------------
  121.   def initialize
  122.     super(0, 64, 640, 416)
  123.     @column_max = 2
  124. ##set the parent selectable height
  125.     @oh = Theory_Greater_Icons::Height
  126.     refresh
  127.     self.index = 0
  128.     # If in battle, move window to center of screen
  129.     # and make it semi-transparent
  130.     if $game_temp.in_battle
  131.       self.y = 64
  132.       self.height = 256
  133.       self.back_opacity = 160
  134.     end
  135.   end
  136.   #--------------------------------------------------------------------------
  137.   # * Get Item
  138.   #--------------------------------------------------------------------------
  139.   def item
  140.     return @data[self.index]
  141.   end
  142.   #--------------------------------------------------------------------------
  143.   # * Refresh
  144.   #--------------------------------------------------------------------------
  145.   def refresh
  146.     if self.contents != nil
  147.       self.contents.dispose
  148.       self.contents = nil
  149.     end
  150.     @data = []
  151.     # Add item
  152.     for i in 1...$data_items.size
  153.       if $game_party.item_number(i) > 0
  154.         @data.push($data_items[i])
  155.       end
  156.     end
  157.     # Also add weapons and items if outside of battle
  158.     unless $game_temp.in_battle
  159.       for i in 1...$data_weapons.size
  160.         if $game_party.weapon_number(i) > 0
  161.           @data.push($data_weapons[i])
  162.         end
  163.       end
  164.       for i in 1...$data_armors.size
  165.         if $game_party.armor_number(i) > 0
  166.           @data.push($data_armors[i])
  167.         end
  168.       end
  169.     end
  170.     # If item count is not 0, make a bit map and draw all items
  171.     @item_max = @data.size
  172.     if @item_max > 0
  173.       self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)
  174.       for i in 0...@item_max
  175.         draw_item(i)
  176.       end
  177.     end
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # * Draw Item
  181.   #     index : item number
  182.   #--------------------------------------------------------------------------
  183.   def draw_item(index)
  184.     item = @data[index]
  185.     case item
  186.     when RPG::Item
  187.       number = $game_party.item_number(item.id)
  188.     when RPG::Weapon
  189.       number = $game_party.weapon_number(item.id)
  190.     when RPG::Armor
  191.       number = $game_party.armor_number(item.id)
  192.     end
  193.      
  194.     x = 4 + index % 2 * (288 + Theory_Greater_Icons::Width)
  195.     y = index / 2 * Theory_Greater_Icons::Height
  196.     rect = Rect.new(x, y, self.width / @column_max - Theory_Greater_Icons::Width, Theory_Greater_Icons::Height)
  197.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  198.     @bitmap = RPG::Cache.icon(item.icon_name)
  199.  
  200.     case item
  201.     when RPG::Weapon
  202.       weapon = $data_weapons[item.id]
  203.       if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  204.         self.contents.font.color = Theory_Greater_Icons::LegendaryColorDisabled
  205.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  206.       elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)
  207.         self.contents.font.color = Theory_Greater_Icons::RareColorDisabled
  208.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  209.       elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)
  210.         self.contents.font.color = Theory_Greater_Icons::UncommonColorDisabled
  211.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  212.       elsif !weapon.element_set.include?(Theory_Greater_Icons::RareElement) and !weapon.element_set.include?(Theory_Greater_Icons::UncommonElement) and !weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  213.         self.contents.font.color = normal_color
  214.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  215.       end
  216.     when RPG::Armor
  217.       armor = $data_armors[item.id]
  218.       if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  219.         self.contents.font.color = Theory_Greater_Icons::LegendaryColorDisabled
  220.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  221.       elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)
  222.         self.contents.font.color = Theory_Greater_Icons::RareColorDisabled
  223.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  224.       elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)
  225.         self.contents.font.color = Theory_Greater_Icons::UncommonColorDisabled
  226.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  227.       elsif !armor.guard_element_set.include?(Theory_Greater_Icons::RareElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  228.         self.contents.font.color = disabled_color
  229.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  230.       end
  231.     when RPG::Item
  232.       itema = $data_items[item.id]
  233.       if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  234.         if $game_party.item_can_use?(item.id)
  235.           self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  236.         else
  237.           self.contents.font.color = Theory_Greater_Icons::LegendaryColorDisabled
  238.         end
  239.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  240.       elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)
  241.         if $game_party.item_can_use?(item.id)
  242.           self.contents.font.color = Theory_Greater_Icons::RareColor
  243.         else
  244.           self.contents.font.color = Theory_Greater_Icons::RareColorDisabled
  245.         end
  246.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  247.       elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)
  248.         if $game_party.item_can_use?(item.id)
  249.           self.contents.font.color = Theory_Greater_Icons::UncommonColor
  250.         else
  251.           self.contents.font.color = Theory_Greater_Icons::UncommonColorDisabled
  252.         end
  253.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  254.       elsif !itema.element_set.include?(Theory_Greater_Icons::RareElement) and !itema.element_set.include?(Theory_Greater_Icons::UncommonElement) and !itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  255.         if $game_party.item_can_use?(item.id)
  256.           self.contents.font.color = normal_color
  257.         else
  258.           self.contents.font.color = disabled_color
  259.         end
  260.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  261.       end
  262.     end
  263.  
  264.     opacity = self.contents.font.color == normal_color ? 255 : 128
  265.     self.contents.draw_text(x + Theory_Greater_Icons::Width + 4, y, 212, Theory_Greater_Icons::Height, item.name, 0)
  266.     tempy = y + Theory_Greater_Icons::Height - 36
  267.     self.contents.draw_text(x - 5, tempy, 24, Theory_Greater_Icons::Height, number.to_s, 2)
  268.   end
  269. end
  270.  
  271.  
  272. #==============================================================================
  273. # ** Window_Status
  274. #------------------------------------------------------------------------------
  275. # This window displays full status specs on the status screen.
  276. #==============================================================================
  277.  
  278. class Window_Status < Window_Base
  279.   #--------------------------------------------------------------------------
  280.   # * Object Initialization
  281.   #     actor : actor
  282.   #--------------------------------------------------------------------------
  283.   def initialize(actor)
  284.     super(0, 0, 640, 480)
  285.     self.contents = Bitmap.new(width - 32, height - 32)
  286.     @actor = actor
  287.     refresh
  288.   end
  289.   #--------------------------------------------------------------------------
  290.   # * Refresh
  291.   #--------------------------------------------------------------------------
  292.   def refresh
  293.     self.contents.clear
  294.     draw_actor_graphic(@actor, 40, 112)
  295.     draw_actor_name(@actor, 4, 0)
  296.     draw_actor_class(@actor, 4 + 144, 0)
  297.     draw_actor_level(@actor, 96, 32)
  298.     draw_actor_state(@actor, 96, 64)
  299.     draw_actor_hp(@actor, 96, 112, 172)
  300.     draw_actor_sp(@actor, 96, 144, 172)
  301.     draw_actor_parameter(@actor, 96, 192, 0)
  302.     draw_actor_parameter(@actor, 96, 224, 1)
  303.     draw_actor_parameter(@actor, 96, 256, 2)
  304.     draw_actor_parameter(@actor, 96, 304, 3)
  305.     draw_actor_parameter(@actor, 96, 336, 4)
  306.     draw_actor_parameter(@actor, 96, 368, 5)
  307.     draw_actor_parameter(@actor, 96, 400, 6)
  308.     self.contents.font.color = system_color
  309.     self.contents.draw_text(320, 48, 80, 32, "EXP")
  310.     self.contents.draw_text(320, 80, 80, 32, "NEXT")
  311.     self.contents.font.color = normal_color
  312.     self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)
  313.     self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)
  314.     self.contents.font.color = system_color
  315.     self.contents.draw_text(320, 160, 96, 32, "equipment")
  316.     draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 203)
  317.     draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 251)
  318.     draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 299)
  319.     draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 347)
  320.     draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 395)
  321.   end
  322. end
  323.  
  324.  
  325. #==============================================================================
  326. # ** Window_EquipItem
  327. #------------------------------------------------------------------------------
  328. # This window displays choices when opting to change equipment on the
  329. # equipment screen.
  330. #==============================================================================
  331.  
  332. class Window_EquipItem < Window_Selectable
  333.   #--------------------------------------------------------------------------
  334.   # * Object Initialization
  335.   #     actor     : actor
  336.   #     equip_type : equip region (0-3)
  337.   #--------------------------------------------------------------------------
  338.   def initialize(actor, equip_type)
  339.     super(0, 256, 640, 224)
  340.     @oh = Theory_Greater_Icons::Height
  341.     @actor = actor
  342.     @equip_type = equip_type
  343.     @column_max = 2
  344.     refresh
  345.     self.active = false
  346.     self.index = -1
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # * Item Acquisition
  350.   #--------------------------------------------------------------------------
  351.   def item
  352.     return @data[self.index]
  353.   end
  354.   #--------------------------------------------------------------------------
  355.   # * Refresh
  356.   #--------------------------------------------------------------------------
  357.   def refresh
  358.     if self.contents != nil
  359.       self.contents.dispose
  360.       self.contents = nil
  361.     end
  362.     @data = []
  363.     # Add equippable weapons
  364.     if @equip_type == 0
  365.       weapon_set = $data_classes[@actor.class_id].weapon_set
  366.       for i in 1...$data_weapons.size
  367.         if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)
  368.           @data.push($data_weapons[i])
  369.         end
  370.       end
  371.     end
  372.     # Add equippable armor
  373.     if @equip_type != 0
  374.       armor_set = $data_classes[@actor.class_id].armor_set
  375.       for i in 1...$data_armors.size
  376.         if $game_party.armor_number(i) > 0 and armor_set.include?(i)
  377.           if $data_armors[i].kind == @equip_type-1
  378.             @data.push($data_armors[i])
  379.           end
  380.         end
  381.       end
  382.     end
  383.     # Add blank page
  384.     @data.push(nil)
  385.     # Make a bit map and draw all items
  386.     @item_max = @data.size
  387.     self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)
  388.     for i in 0...@item_max-1
  389.       draw_item(i)
  390.     end
  391.   end
  392.   #--------------------------------------------------------------------------
  393.   # * Draw Item
  394.   #     index : item number
  395.   #--------------------------------------------------------------------------
  396.   def draw_item(index)
  397.     item = @data[index]
  398.     x = 4 + index % 2 * (288 + 32)
  399.     y = index / 2 * Theory_Greater_Icons::Height + 2
  400.     case item
  401.     when RPG::Weapon
  402.       number = $game_party.weapon_number(item.id)
  403.     when RPG::Armor
  404.       number = $game_party.armor_number(item.id)
  405.     end
  406.     @bitmap = RPG::Cache.icon(item.icon_name)
  407.  
  408.     case item
  409.     when RPG::Weapon
  410.       weapon = @data[index]
  411.       if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  412.         self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  413.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  414.       elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)
  415.         self.contents.font.color = Theory_Greater_Icons::RareColor
  416.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  417.       elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)
  418.         self.contents.font.color = Theory_Greater_Icons::UncommonColor
  419.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  420.       elsif !weapon.element_set.include?(Theory_Greater_Icons::RareElement) and !weapon.element_set.include?(Theory_Greater_Icons::UncommonElement) and !weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  421.         self.contents.font.color = normal_color
  422.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  423.       end
  424.     when RPG::Armor
  425.       armor = @data[index]
  426.       if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  427.         self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  428.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  429.       elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)
  430.         self.contents.font.color = Theory_Greater_Icons::RareColor
  431.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  432.       elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)
  433.         self.contents.font.color = Theory_Greater_Icons::UncommonColor
  434.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  435.       elsif !armor.guard_element_set.include?(Theory_Greater_Icons::RareElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  436.         self.contents.font.color = normal_color
  437.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  438.       end
  439.     end
  440.      
  441.     self.contents.draw_text(x + Theory_Greater_Icons::Width + 3, y, 212, Theory_Greater_Icons::Height, item.name, 0)
  442.     tempy = y + Theory_Greater_Icons::Height - 36
  443.     self.contents.font.color = normal_color
  444.     self.contents.draw_text(x - 5, tempy, 24, Theory_Greater_Icons::Height, number.to_s, 2)
  445.   end
  446.   #--------------------------------------------------------------------------
  447.   # * Help Text Update
  448.   #--------------------------------------------------------------------------
  449.   def update_help
  450.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  451.   end
  452. end
  453.  
  454.  
  455. #==============================================================================
  456. # ** Window_EquipRight
  457. #------------------------------------------------------------------------------
  458. # This window displays items the actor is currently equipped with on the
  459. # equipment screen.
  460. #==============================================================================
  461.  
  462. class Window_EquipRight < Window_Selectable
  463.   #--------------------------------------------------------------------------
  464.   # * Object Initialization
  465.   #     actor : actor
  466.   #--------------------------------------------------------------------------
  467.   def initialize(actor)
  468.     super(272, 64, 368, 192)
  469.     @oh = Theory_Greater_Icons::Height
  470.     self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, height + Theory_Greater_Icons::Height + 15)
  471.     @actor = actor
  472.     refresh
  473.     self.index = 0
  474.   end
  475.   #--------------------------------------------------------------------------
  476.   # * Item Acquisition
  477.   #--------------------------------------------------------------------------
  478.   def item
  479.     return @data[self.index]
  480.   end
  481.   #--------------------------------------------------------------------------
  482.   # * Refresh
  483.   #--------------------------------------------------------------------------
  484.   def refresh
  485.     self.contents.clear
  486.     @data = []
  487.     @data.push($data_weapons[@actor.weapon_id])
  488.     @data.push($data_armors[@actor.armor1_id])
  489.     @data.push($data_armors[@actor.armor2_id])
  490.     @data.push($data_armors[@actor.armor3_id])
  491.     @data.push($data_armors[@actor.armor4_id])
  492.     @item_max = @data.size
  493.     self.contents.font.color = system_color
  494.     self.contents.draw_text(4, Theory_Greater_Icons::Height * 0, 92, Theory_Greater_Icons::Height, $data_system.words.weapon)
  495.     self.contents.draw_text(4, Theory_Greater_Icons::Height * 1, 92, Theory_Greater_Icons::Height, $data_system.words.armor1)
  496.     self.contents.draw_text(4, Theory_Greater_Icons::Height * 2, 92, Theory_Greater_Icons::Height, $data_system.words.armor2)
  497.     self.contents.draw_text(4, Theory_Greater_Icons::Height * 3, 92, Theory_Greater_Icons::Height, $data_system.words.armor3)
  498.     self.contents.draw_text(5, Theory_Greater_Icons::Height * 4, 92, Theory_Greater_Icons::Height, $data_system.words.armor4)
  499.     draw_item_name(@data[0], 92, Theory_Greater_Icons::Height * 0)
  500.     draw_item_name(@data[1], 92, Theory_Greater_Icons::Height * 1)
  501.     draw_item_name(@data[2], 92, Theory_Greater_Icons::Height * 2)
  502.     draw_item_name(@data[3], 92, Theory_Greater_Icons::Height * 3)
  503.     draw_item_name(@data[4], 92, Theory_Greater_Icons::Height * 4)
  504.   end
  505.   #--------------------------------------------------------------------------
  506.   # * Help Text Update
  507.   #--------------------------------------------------------------------------
  508.   def update_help
  509.     @help_window.set_text(self.item == nil ? "" : self.item.description)
  510.   end
  511. end
  512.  
  513.  
  514.  
  515. #==============================================================================
  516. # ** Window_Skill
  517. #------------------------------------------------------------------------------
  518. # This window displays usable skills on the skill and battle screens.
  519. #==============================================================================
  520.  
  521. class Window_Skill < Window_Selectable
  522.   #--------------------------------------------------------------------------
  523.   # * Object Initialization
  524.   #     actor : actor
  525.   #--------------------------------------------------------------------------
  526.   def initialize(actor)
  527.     super(0, 128, 640, 352)
  528.     @oh = Theory_Greater_Icons::Height
  529.     @actor = actor
  530.     @column_max = 2
  531.     refresh
  532.     self.index = 0
  533.     # If in battle, move window to center of screen
  534.     # and make it semi-transparent
  535.     if $game_temp.in_battle
  536.       self.y = 64
  537.       self.height = 256
  538.       self.back_opacity = 160
  539.     end
  540.   end
  541.   #--------------------------------------------------------------------------
  542.   # * Acquiring Skill
  543.   #--------------------------------------------------------------------------
  544.   def skill
  545.     return @data[self.index]
  546.   end
  547.   #--------------------------------------------------------------------------
  548.   # * Refresh
  549.   #--------------------------------------------------------------------------
  550.   def refresh
  551.     if self.contents != nil
  552.       self.contents.dispose
  553.       self.contents = nil
  554.     end
  555.     @data = []
  556.     for i in [email hidden]
  557.       skill = $data_skills[@actor.skills[i]]
  558.       if skill != nil
  559.         @data.push(skill)
  560.       end
  561.     end
  562.     # If item count is not 0, make a bit map and draw all items
  563.     @item_max = @data.size
  564.     if @item_max > 0
  565.       self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)
  566.       for i in 0...@item_max
  567.         draw_item(i)
  568.       end
  569.     end
  570.   end
  571.   #--------------------------------------------------------------------------
  572.   # * Draw Item
  573.   #     index : item number
  574.   #--------------------------------------------------------------------------
  575.   def draw_item(index)
  576.     skill = @data[index]
  577.     x = 4 + index % 2 * (288 + Theory_Greater_Icons::Width)
  578.     y = index / 2 * Theory_Greater_Icons::Height
  579.     rect = Rect.new(x, y, self.width / @column_max - Theory_Greater_Icons::Width, Theory_Greater_Icons::Height)
  580.     self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
  581.     @bitmap = RPG::Cache.icon(skill.icon_name)
  582.  
  583.     if skill.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  584.       if @actor.skill_can_use?(skill.id)
  585.         self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  586.       else
  587.         self.contents.font.color = Theory_Greater_Icons::LegendaryColorDisabled
  588.       end
  589.       self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  590.     elsif skill.element_set.include?(Theory_Greater_Icons::RareElement)
  591.       if @actor.skill_can_use?(skill.id)
  592.         self.contents.font.color = Theory_Greater_Icons::RareColor
  593.       else
  594.         self.contents.font.color = Theory_Greater_Icons::RareColorDisabled
  595.       end
  596.       self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  597.     elsif skill.element_set.include?(Theory_Greater_Icons::UncommonElement)
  598.       if @actor.skill_can_use?(skill.id)
  599.         self.contents.font.color = Theory_Greater_Icons::UncommonColor
  600.       else
  601.         self.contents.font.color = Theory_Greater_Icons::UncommonColorDisabled
  602.       end
  603.       self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  604.     elsif !skill.element_set.include?(Theory_Greater_Icons::RareElement) and !skill.element_set.include?(Theory_Greater_Icons::UncommonElement) and !skill.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  605.       if @actor.skill_can_use?(skill.id)
  606.         self.contents.font.color = normal_color
  607.       else
  608.         self.contents.font.color = disabled_color
  609.       end
  610.       self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  611.     end
  612.     self.contents.draw_text(x + Theory_Greater_Icons::Width + 4, y - 10, 204, Theory_Greater_Icons::Height, skill.name, 0)
  613.     self.contents.draw_text(x + Theory_Greater_Icons::Width + 6, y + 10, 48, Theory_Greater_Icons::Height, skill.sp_cost.to_s, 2)
  614.   end
  615.   #--------------------------------------------------------------------------
  616.   # * Help Text Update
  617.   #--------------------------------------------------------------------------
  618.   def update_help
  619.     @help_window.set_text(self.skill == nil ? "" : self.skill.description)
  620.   end
  621. end
  622.  
  623.  
  624. #==============================================================================
  625. # ** Window_BattleResult
  626. #------------------------------------------------------------------------------
  627. # This window displays amount of gold and EXP acquired at the end of a battle.
  628. #==============================================================================
  629.  
  630. class Window_BattleResult < Window_Base
  631.   #--------------------------------------------------------------------------
  632.   # * Object Initialization
  633.   #     exp       : EXP
  634.   #     gold     : amount of gold
  635.   #     treasures : treasures
  636.   #--------------------------------------------------------------------------
  637.   def initialize(exp, gold, treasures)
  638.     @exp = exp
  639.     @gold = gold
  640.     @treasures = treasures
  641.     super(160, 0, 320, @treasures.size * Theory_Greater_Icons::Height + 64)
  642.     self.contents = Bitmap.new(width - 32, height - 32)
  643.     self.y = 160 - height / 2
  644.     self.back_opacity = 160
  645.     self.visible = false
  646.     refresh
  647.   end
  648.   #--------------------------------------------------------------------------
  649.   # * Refresh
  650.   #--------------------------------------------------------------------------
  651.   def refresh
  652.     self.contents.clear
  653.     x = 4
  654.     self.contents.font.color = normal_color
  655.     cx = contents.text_size(@exp.to_s).width
  656.     self.contents.draw_text(x, 0, cx, 32, @exp.to_s)
  657.     x += cx + 4
  658.     self.contents.font.color = system_color
  659.     cx = contents.text_size("EXP").width
  660.     self.contents.draw_text(x, 0, 64, 32, "EXP")
  661.     x += cx + 16
  662.     self.contents.font.color = normal_color
  663.     cx = contents.text_size(@gold.to_s).width
  664.     self.contents.draw_text(x, 0, cx, 32, @gold.to_s)
  665.     x += cx + 4
  666.     self.contents.font.color = system_color
  667.     self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)
  668.     y = 32
  669.     for item in @treasures
  670.       draw_item_name(item, 4, y)
  671.       y += Theory_Greater_Icons::Height
  672.     end
  673.   end
  674. end
  675.  
  676.  
  677. #==============================================================================
  678. # ** Window_ShopBuy
  679. #------------------------------------------------------------------------------
  680. # This window displays buyable goods on the shop screen.
  681. #==============================================================================
  682.  
  683. class Window_ShopBuy < Window_Selectable
  684.   #--------------------------------------------------------------------------
  685.   # * Object Initialization
  686.   #     shop_goods : goods
  687.   #--------------------------------------------------------------------------
  688.   def initialize(shop_goods)
  689.     super(0, 128, 368, 352)
  690.     @oh = Theory_Greater_Icons::Height
  691.     @shop_goods = shop_goods
  692.     refresh
  693.     self.index = 0
  694.   end
  695.   #--------------------------------------------------------------------------
  696.   # * Refresh
  697.   #--------------------------------------------------------------------------
  698.   def refresh
  699.     if self.contents != nil
  700.       self.contents.dispose
  701.       self.contents = nil
  702.     end
  703.     @data = []
  704.     for goods_item in @shop_goods
  705.       case goods_item[0]
  706.       when 0
  707.         item = $data_items[goods_item[1]]
  708.       when 1
  709.         item = $data_weapons[goods_item[1]]
  710.       when 2
  711.         item = $data_armors[goods_item[1]]
  712.       end
  713.       if item != nil
  714.         @data.push(item)
  715.       end
  716.     end
  717.     # If item count is not 0, make a bit map and draw all items
  718.     @item_max = @data.size
  719.     if @item_max > 0
  720.       self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)
  721.       for i in 0...@item_max
  722.         draw_item(i)
  723.       end
  724.     end
  725.   end
  726.  
  727.   #--------------------------------------------------------------------------
  728.   # * Draw Item
  729.   #     index : item number
  730.   #--------------------------------------------------------------------------
  731.   def draw_item(index)
  732.     item = @data[index]
  733.     x = 4
  734.     y = index * Theory_Greater_Icons::Height
  735.     case item
  736.     when RPG::Weapon
  737.       number = $game_party.weapon_number(item.id)
  738.     when RPG::Armor
  739.       number = $game_party.armor_number(item.id)
  740.     end
  741.     @bitmap = RPG::Cache.icon(item.icon_name)
  742.     case item
  743.     when RPG::Item
  744.       number = $game_party.item_number(item.id)
  745.     when RPG::Weapon
  746.       number = $game_party.weapon_number(item.id)
  747.     when RPG::Armor
  748.       number = $game_party.armor_number(item.id)
  749.     end
  750.     case item
  751.     when RPG::Weapon
  752.       weapon = @data[index]
  753.       if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  754.         self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  755.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  756.       elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)
  757.         self.contents.font.color = Theory_Greater_Icons::RareColor
  758.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  759.       elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)
  760.         self.contents.font.color = Theory_Greater_Icons::UncommonColor
  761.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  762.       elsif !weapon.element_set.include?(Theory_Greater_Icons::RareElement) and !weapon.element_set.include?(Theory_Greater_Icons::UncommonElement) and !weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  763.         self.contents.font.color = normal_color
  764.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  765.       end
  766.     when RPG::Armor
  767.       armor = @data[index]
  768.       if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  769.         self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  770.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  771.       elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)
  772.         self.contents.font.color = Theory_Greater_Icons::RareColor
  773.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  774.       elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)
  775.         self.contents.font.color = Theory_Greater_Icons::UncommonColor
  776.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  777.       elsif !armor.guard_element_set.include?(Theory_Greater_Icons::RareElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  778.         self.contents.font.color = normal_color
  779.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  780.       end
  781.     when RPG::Item
  782.       itema = $data_items[item.id]
  783.       if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  784.         self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  785.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  786.       elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)
  787.         self.contents.font.color = Theory_Greater_Icons::RareColor
  788.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  789.       elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)
  790.         self.contents.font.color = Theory_Greater_Icons::UncommonColor
  791.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  792.       elsif !itema.element_set.include?(Theory_Greater_Icons::RareElement) and !itema.element_set.include?(Theory_Greater_Icons::UncommonElement) and !itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  793.         self.contents.font.color = normal_color
  794.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  795.       end
  796.     end
  797.  
  798.     # Get items in possession
  799.     case item
  800.     when RPG::Item
  801.       number = $game_party.item_number(item.id)
  802.     when RPG::Weapon
  803.       number = $game_party.weapon_number(item.id)
  804.     when RPG::Armor
  805.       number = $game_party.armor_number(item.id)
  806.     end
  807.     # If price is less than money in possession, and amount in possession is
  808.     # not 99, then set to normal text color. Otherwise set to disabled color
  809.     if item.price <= $game_party.gold and number < 99
  810.     else
  811.       self.contents.font.color = disabled_color
  812.     end
  813.     pricea = item.price
  814.     self.contents.draw_text(x + Theory_Greater_Icons::Width + 3, y, 212, Theory_Greater_Icons::Height, item.name, 0)
  815.     tempy = y + Theory_Greater_Icons::Height - 36
  816.     self.contents.font.color = normal_color
  817.     self.contents.draw_text(x - 5, tempy, 24, Theory_Greater_Icons::Height, number.to_s, 2)
  818.     self.contents.draw_text(x + 200, y, 16, Theory_Greater_Icons::Height, ":", 1)
  819.     self.contents.draw_text(x + 206, y, 60, Theory_Greater_Icons::Height, pricea.to_s, 2)
  820.   end
  821.  
  822.  
  823.  
  824.  
  825. end
  826.  
  827. #==============================================================================
  828. # ** Window_ShopSell
  829. #------------------------------------------------------------------------------
  830. # This window displays items in possession for selling on the shop screen.
  831. #==============================================================================
  832.  
  833. class Window_ShopSell < Window_Selectable
  834.  
  835.   #--------------------------------------------------------------------------
  836.   # * Object Initialization
  837.   #--------------------------------------------------------------------------
  838.   def initialize
  839.     super(0, 128, 640, 352)
  840.     @oh = Theory_Greater_Icons::Height
  841.     @column_max = 2
  842.     refresh
  843.     self.index = 0
  844.   end
  845.   #--------------------------------------------------------------------------
  846.   # * Refresh
  847.   #--------------------------------------------------------------------------
  848.   def refresh
  849.     if self.contents != nil
  850.       self.contents.dispose
  851.       self.contents = nil
  852.     end
  853.     @data = []
  854.     for i in 1...$data_items.size
  855.       if $game_party.item_number(i) > 0
  856.         @data.push($data_items[i])
  857.       end
  858.     end
  859.     for i in 1...$data_weapons.size
  860.       if $game_party.weapon_number(i) > 0
  861.         @data.push($data_weapons[i])
  862.       end
  863.     end
  864.     for i in 1...$data_armors.size
  865.       if $game_party.armor_number(i) > 0
  866.         @data.push($data_armors[i])
  867.       end
  868.     end
  869.     # If item count is not 0, make a bitmap and draw all items
  870.     @item_max = @data.size
  871.     if @item_max > 0
  872.       self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)
  873.       for i in 0...@item_max
  874.         draw_item(i)
  875.       end
  876.     end
  877.   end
  878.   #--------------------------------------------------------------------------
  879.   # * Draw Item
  880.   #     index : item number
  881.   #--------------------------------------------------------------------------
  882.   def draw_item(index)
  883.     item = @data[index]
  884.     x = 4 + index % 2 * (288 + 32)
  885.     y = index / 2 * Theory_Greater_Icons::Height
  886.     case item
  887.     when RPG::Weapon
  888.       number = $game_party.weapon_number(item.id)
  889.     when RPG::Armor
  890.       number = $game_party.armor_number(item.id)
  891.     end
  892.     @bitmap = RPG::Cache.icon(item.icon_name)
  893.     case item
  894.     when RPG::Item
  895.       number = $game_party.item_number(item.id)
  896.     when RPG::Weapon
  897.       number = $game_party.weapon_number(item.id)
  898.     when RPG::Armor
  899.       number = $game_party.armor_number(item.id)
  900.     end
  901.     case item
  902.     when RPG::Weapon
  903.       weapon = @data[index]
  904.       if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  905.         self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  906.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  907.       elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)
  908.         self.contents.font.color = Theory_Greater_Icons::RareColor
  909.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  910.       elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)
  911.         self.contents.font.color = Theory_Greater_Icons::UncommonColor
  912.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  913.       elsif !weapon.element_set.include?(Theory_Greater_Icons::RareElement) and !weapon.element_set.include?(Theory_Greater_Icons::UncommonElement) and !weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  914.         self.contents.font.color = normal_color
  915.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  916.       end
  917.     when RPG::Armor
  918.       armor = @data[index]
  919.       if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  920.         self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  921.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  922.       elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)
  923.         self.contents.font.color = Theory_Greater_Icons::RareColor
  924.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  925.       elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)
  926.         self.contents.font.color = Theory_Greater_Icons::UncommonColor
  927.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  928.       elsif !armor.guard_element_set.include?(Theory_Greater_Icons::RareElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  929.         self.contents.font.color = normal_color
  930.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  931.       end
  932.     when RPG::Item
  933.       itema = $data_items[item.id]
  934.       if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  935.         self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  936.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  937.       elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)
  938.         self.contents.font.color = Theory_Greater_Icons::RareColor
  939.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  940.       elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)
  941.         self.contents.font.color = Theory_Greater_Icons::UncommonColor
  942.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  943.       elsif !itema.element_set.include?(Theory_Greater_Icons::RareElement) and !itema.element_set.include?(Theory_Greater_Icons::UncommonElement) and !itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  944.         self.contents.font.color = normal_color
  945.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  946.       end
  947.     end
  948.  
  949.     if item.price <= 0
  950.       self.contents.font.color = disabled_color
  951.     end
  952.     pricea = item.price / 2
  953.     self.contents.draw_text(x + Theory_Greater_Icons::Width + 3, y, 212, Theory_Greater_Icons::Height, item.name, 0)
  954.     tempy = y + Theory_Greater_Icons::Height - 36
  955.     self.contents.font.color = normal_color
  956.     self.contents.draw_text(x - 5, tempy, 24, Theory_Greater_Icons::Height, number.to_s, 2)
  957.     self.contents.draw_text(x + 200, y, 16, Theory_Greater_Icons::Height, ":", 1)
  958.     self.contents.draw_text(x + 206, y, 60, Theory_Greater_Icons::Height, pricea.to_s, 2)
  959.   end
  960. end
  961.  
  962.  
  963.  
  964. class Bitmap
  965.   def draw_icon(x, y, filename, back='')
  966.     backdrop = RPG::Cache.icon(back)
  967.     center_x = Theory_Greater_Icons::Width / 2 + x
  968.     center_y = Theory_Greater_Icons::Height / 2 + y
  969.     left_x = center_x - backdrop.rect.width / 2
  970.     upper_y = center_y - backdrop.rect.height / 2
  971.     self.blt(left_x, upper_y, backdrop, backdrop.rect, 255)
  972.     bitmap = filename
  973.     left_x = center_x - bitmap.rect.width / 2
  974.     upper_y = center_y - bitmap.rect.height / 2
  975.     self.blt(left_x, upper_y - 2, bitmap, bitmap.rect, 255)
  976.   end
  977. end
  978.  
  979. class Window_Base
  980.  
  981.   #--------------------------------------------------------------------------
  982.   # * Draw Item Name
  983.   #     item : item
  984.   #     x   : draw spot x-coordinate
  985.   #     y   : draw spot y-coordinate
  986.   #--------------------------------------------------------------------------
  987.   def draw_item_name(item, x, y)
  988.     if item == nil
  989.       return
  990.     end
  991.     @bitmap = RPG::Cache.icon(item.icon_name)
  992.     case item
  993.     when RPG::Weapon
  994.       weapon = $data_weapons[item.id]
  995.       if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  996.         self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  997.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  998.       elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)
  999.         self.contents.font.color = Theory_Greater_Icons::RareColor
  1000.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  1001.       elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)
  1002.         self.contents.font.color = Theory_Greater_Icons::UncommonColor
  1003.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  1004.       elsif !weapon.element_set.include?(Theory_Greater_Icons::RareElement) and !weapon.element_set.include?(Theory_Greater_Icons::UncommonElement) and !weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  1005.         self.contents.font.color = normal_color
  1006.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  1007.       end
  1008.     when RPG::Armor
  1009.       armor = $data_armors[item.id]
  1010.       if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  1011.         self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  1012.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  1013.       elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)
  1014.         self.contents.font.color = Theory_Greater_Icons::RareColor
  1015.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  1016.       elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)
  1017.         self.contents.font.color = Theory_Greater_Icons::UncommonColor
  1018.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  1019.       elsif !armor.guard_element_set.include?(Theory_Greater_Icons::RareElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement) and !armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)
  1020.         self.contents.font.color = normal_color
  1021.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  1022.       end
  1023.     when RPG::Item
  1024.       itema = $data_items[item.id]
  1025.       if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  1026.         self.contents.font.color = Theory_Greater_Icons::LegendaryColor
  1027.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)
  1028.       elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)
  1029.         self.contents.font.color = Theory_Greater_Icons::RareColor
  1030.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)
  1031.       elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)
  1032.         self.contents.font.color = Theory_Greater_Icons::UncommonColor
  1033.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)
  1034.       elsif !itema.element_set.include?(Theory_Greater_Icons::RareElement) and !itema.element_set.include?(Theory_Greater_Icons::UncommonElement) and !itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)
  1035.         self.contents.font.color = normal_color
  1036.         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)
  1037.       end
  1038.     end
  1039.     self.contents.draw_text(x + Theory_Greater_Icons::Width + 4, y, 212, Theory_Greater_Icons::Width, item.name)
  1040.   end
  1041.  
  1042. end
Expand to see the code.


Of course, remember to disable the line count before you copy, otherwise you will get errors too. That, and try to understand some of the bare essentials of scripting before you mess with custom scripts...
I tried again with your fixed script. I had the same result, rpg maker will only properly display icons that are 24x24. You did not specify any location so I put the script in between main and scene_debug. The reason I want this script so badly is because there are so few icons in rpg maker. I found a amazing icon pack with over 100 icons but they are 34x34 and if I were to resize them there would be a great quality loss.
In that case, telling what exactly doesn't work is definately something required from here on. The only thing I can point you to otherwise is the settings on the top where you actually have to set the size of your graphics.
And yes, the copypaste location is correct as long as you don't have any additional mumbo-jumbo in your project that will mess it up. Did you try it really quick in a new project?
I have no other custom scripts added and yes I am using this for a new project. I'm not sure what is wrong I have no scripting experience what so ever. The problem seems that the script is not functioning at all. When I test the game my 34x icons are cut off, only the top left part of the icon shows. Is it possible that this script is not compatible with a certain version of Rpg Maker XP?

Original thread: https://www.hbgames.org/forums/viewtopic.php?t=57491