Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[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

238ss1.png

3421ss2.png

Demo

Download : Click here...

Script

Code:
 

 

#==============================================================================

# ** Theory's Greater Icons

#------------------------------------------------------------------------------

#  This script allows you to set x and y sizes for your item and skill icons.  

#  Be sure to make the files in your icons folder reflect this- it does not 

#  stretch icons. This script was optimized for 50x50 icons, but any dimensions

#  larger than 30x30 and smaller than 200x200 should work.

#  

#  It required a small menu edit for quantity and SP cost locations; and will

#  not be compatible with most CMS's without editing.

#==============================================================================

 

module Theory_Greater_Icons

  Width = 50

  Height = 50

  Background = 'back'

  

  UncommonElement = 18

  UncommonBackground = 'uncommon'

  UncommonColor = Color.new(0, 255, 0, 255)

  UncommonColorDisabled = Color.new(0, 255, 0, 128)

  

  RareElement = 19

  RareBackground = 'rare'

  RareColor = Color.new(0, 200, 255, 255)

  RareColorDisabled = Color.new(0, 200, 255, 128)

 

  LegendaryElement = 20

  LegendaryBackground = 'legendary'

  LegendaryColor = Color.new(255, 255, 0, 255)

  LegendaryColorDisabled = Color.new(255, 255, 0, 128)

  

end

 

#==============================================================================

# ** 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

 

#==============================================================================

# ** Window_Item

#------------------------------------------------------------------------------

#  This window displays items in possession on the item and battle screens.

#==============================================================================

 

class Window_Item < Window_Selectable

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    super(0, 64, 640, 416)

    @column_max = 2

 ##set the parent selectable height

    @oh =  Theory_Greater_Icons::Height

    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

  #--------------------------------------------------------------------------

  # * Get Item

  #--------------------------------------------------------------------------

  def item

    return @data[self.index]

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    if self.contents != nil

      self.contents.dispose

      self.contents = nil

    end

    @data = []

    # Add item

    for i in 1...$data_items.size

      if $game_party.item_number(i) > 0

        @data.push($data_items[i])

      end

    end

    # Also add weapons and items if outside of battle

    unless $game_temp.in_battle

      for i in 1...$data_weapons.size

        if $game_party.weapon_number(i) > 0

          @data.push($data_weapons[i])

        end

      end

      for i in 1...$data_armors.size

        if $game_party.armor_number(i) > 0

          @data.push($data_armors[i])

        end

      end

    end

    # If item count is not 0, make a bit map and draw all items

    @item_max = @data.size

    if @item_max > 0

      self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)

      for i in 0...@item_max

        draw_item(i)

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Draw Item

  #     index : item number

  #--------------------------------------------------------------------------

  def draw_item(index)

    item = @data[index]

    case item

    when RPG::Item

      number = $game_party.item_number(item.id)

    when RPG::Weapon

      number = $game_party.weapon_number(item.id)

    when RPG::Armor

      number = $game_party.armor_number(item.id)

    end

        

    x = 4 + index % 2 * (288 + Theory_Greater_Icons::Width)

    y = index / 2 * Theory_Greater_Icons::Height

    rect = Rect.new(x, y, self.width / @column_max - Theory_Greater_Icons::Width, Theory_Greater_Icons::Height)

    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))

    @bitmap = RPG::Cache.icon(item.icon_name)

    

    case item

    when RPG::Weapon

      weapon = $data_weapons[item.id]

      if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColorDisabled

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)

        self.contents.font.color = Theory_Greater_Icons::RareColorDisabled

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)

        self.contents.font.color = Theory_Greater_Icons::UncommonColorDisabled

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        self.contents.font.color = normal_color

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    when RPG::Armor

      armor = $data_armors[item.id]

      if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColorDisabled

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)

        self.contents.font.color = Theory_Greater_Icons::RareColorDisabled

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)

        self.contents.font.color = Theory_Greater_Icons::UncommonColorDisabled

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        self.contents.font.color = disabled_color

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    when RPG::Item

      itema = $data_items[item.id]

      if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)

        if $game_party.item_can_use?(item.id)

          self.contents.font.color = Theory_Greater_Icons::LegendaryColor

        else

          self.contents.font.color = Theory_Greater_Icons::LegendaryColorDisabled

        end

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)

        if $game_party.item_can_use?(item.id)

          self.contents.font.color = Theory_Greater_Icons::RareColor

        else

          self.contents.font.color = Theory_Greater_Icons::RareColorDisabled

        end

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)

        if $game_party.item_can_use?(item.id)

          self.contents.font.color = Theory_Greater_Icons::UncommonColor

        else

          self.contents.font.color = Theory_Greater_Icons::UncommonColorDisabled

        end

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        if $game_party.item_can_use?(item.id)

          self.contents.font.color = normal_color

        else

          self.contents.font.color = disabled_color

        end

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    end

    

    opacity = self.contents.font.color == normal_color ? 255 : 128

    self.contents.draw_text(x + Theory_Greater_Icons::Width + 4, y, 212, Theory_Greater_Icons::Height, item.name, 0)

    tempy = y + Theory_Greater_Icons::Height - 36

    self.contents.draw_text(x - 5, tempy, 24, Theory_Greater_Icons::Height, number.to_s, 2)

  end

end

 

 

#==============================================================================

# ** Window_Status

#------------------------------------------------------------------------------

#  This window displays full status specs on the status screen.

#==============================================================================

 

class Window_Status < Window_Base

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     actor : actor

  #--------------------------------------------------------------------------

  def initialize(actor)

    super(0, 0, 640, 480)

    self.contents = Bitmap.new(width - 32, height - 32)

    @actor = actor

    refresh

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    self.contents.clear

    draw_actor_graphic(@actor, 40, 112)

    draw_actor_name(@actor, 4, 0)

    draw_actor_class(@actor, 4 + 144, 0)

    draw_actor_level(@actor, 96, 32)

    draw_actor_state(@actor, 96, 64)

    draw_actor_hp(@actor, 96, 112, 172)

    draw_actor_sp(@actor, 96, 144, 172)

    draw_actor_parameter(@actor, 96, 192, 0)

    draw_actor_parameter(@actor, 96, 224, 1)

    draw_actor_parameter(@actor, 96, 256, 2)

    draw_actor_parameter(@actor, 96, 304, 3)

    draw_actor_parameter(@actor, 96, 336, 4)

    draw_actor_parameter(@actor, 96, 368, 5)

    draw_actor_parameter(@actor, 96, 400, 6)

    self.contents.font.color = system_color

    self.contents.draw_text(320, 48, 80, 32, "EXP")

    self.contents.draw_text(320, 80, 80, 32, "NEXT")

    self.contents.font.color = normal_color

    self.contents.draw_text(320 + 80, 48, 84, 32, @actor.exp_s, 2)

    self.contents.draw_text(320 + 80, 80, 84, 32, @actor.next_rest_exp_s, 2)

    self.contents.font.color = system_color

    self.contents.draw_text(320, 160, 96, 32, "equipment")

    draw_item_name($data_weapons[@actor.weapon_id], 320 + 16, 203)

    draw_item_name($data_armors[@actor.armor1_id], 320 + 16, 251)

    draw_item_name($data_armors[@actor.armor2_id], 320 + 16, 299)

    draw_item_name($data_armors[@actor.armor3_id], 320 + 16, 347)

    draw_item_name($data_armors[@actor.armor4_id], 320 + 16, 395)

  end

end

 

 

#==============================================================================

# ** Window_EquipItem

#------------------------------------------------------------------------------

#  This window displays choices when opting to change equipment on the

#  equipment screen.

#==============================================================================

 

class Window_EquipItem < Window_Selectable

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     actor      : actor

  #     equip_type : equip region (0-3)

  #--------------------------------------------------------------------------

  def initialize(actor, equip_type)

    super(0, 256, 640, 224)

    @oh =  Theory_Greater_Icons::Height

    @actor = actor

    @equip_type = equip_type

    @column_max = 2

    refresh

    self.active = false

    self.index = -1

  end

  #--------------------------------------------------------------------------

  # * Item Acquisition

  #--------------------------------------------------------------------------

  def item

    return @data[self.index]

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    if self.contents != nil

      self.contents.dispose

      self.contents = nil

    end

    @data = []

    # Add equippable weapons

    if @equip_type == 0

      weapon_set = $data_classes[@actor.class_id].weapon_set

      for i in 1...$data_weapons.size

        if $game_party.weapon_number(i) > 0 and weapon_set.include?(i)

          @data.push($data_weapons[i])

        end

      end

    end

    # Add equippable armor

    if @equip_type != 0

      armor_set = $data_classes[@actor.class_id].armor_set

      for i in 1...$data_armors.size

        if $game_party.armor_number(i) > 0 and armor_set.include?(i)

          if $data_armors[i].kind == @equip_type-1

            @data.push($data_armors[i])

          end

        end

      end

    end

    # Add blank page

    @data.push(nil)

    # Make a bit map and draw all items

    @item_max = @data.size

    self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)

    for i in 0...@item_max-1

      draw_item(i)

    end

  end

  #--------------------------------------------------------------------------

  # * Draw Item

  #     index : item number

  #--------------------------------------------------------------------------

  def draw_item(index)

    item = @data[index]

    x = 4 + index % 2 * (288 + 32)

    y = index / 2 * Theory_Greater_Icons::Height + 2

    case item

    when RPG::Weapon

      number = $game_party.weapon_number(item.id)

    when RPG::Armor

      number = $game_party.armor_number(item.id)

    end

    @bitmap = RPG::Cache.icon(item.icon_name)

    

    case item

    when RPG::Weapon

      weapon = @data[index]

      if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)

        self.contents.font.color = Theory_Greater_Icons::RareColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)

        self.contents.font.color = Theory_Greater_Icons::UncommonColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        self.contents.font.color = normal_color

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    when RPG::Armor

      armor = @data[index]

      if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)

        self.contents.font.color = Theory_Greater_Icons::RareColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)

        self.contents.font.color = Theory_Greater_Icons::UncommonColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        self.contents.font.color = normal_color

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    end

        

    self.contents.draw_text(x + Theory_Greater_Icons::Width + 3, y, 212, Theory_Greater_Icons::Height, item.name, 0)

    tempy = y + Theory_Greater_Icons::Height - 36

    self.contents.font.color = normal_color

    self.contents.draw_text(x - 5, tempy, 24, Theory_Greater_Icons::Height, number.to_s, 2)

  end

  #--------------------------------------------------------------------------

  # * Help Text Update

  #--------------------------------------------------------------------------

  def update_help

    @help_window.set_text(self.item == nil ? "" : self.item.description)

  end

end

 

 

#==============================================================================

# ** Window_EquipRight

#------------------------------------------------------------------------------

#  This window displays items the actor is currently equipped with on the

#  equipment screen.

#==============================================================================

 

class Window_EquipRight < Window_Selectable

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     actor : actor

  #--------------------------------------------------------------------------

  def initialize(actor)

    super(272, 64, 368, 192)

    @oh = Theory_Greater_Icons::Height

    self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, height + Theory_Greater_Icons::Height + 15)

    @actor = actor

    refresh

    self.index = 0

  end

  #--------------------------------------------------------------------------

  # * Item Acquisition

  #--------------------------------------------------------------------------

  def item

    return @data[self.index]

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    self.contents.clear

    @data = []

    @data.push($data_weapons[@actor.weapon_id])

    @data.push($data_armors[@actor.armor1_id])

    @data.push($data_armors[@actor.armor2_id])

    @data.push($data_armors[@actor.armor3_id])

    @data.push($data_armors[@actor.armor4_id])

    @item_max = @data.size

    self.contents.font.color = system_color

    self.contents.draw_text(4, Theory_Greater_Icons::Height * 0, 92, Theory_Greater_Icons::Height, $data_system.words.weapon)

    self.contents.draw_text(4, Theory_Greater_Icons::Height * 1, 92, Theory_Greater_Icons::Height, $data_system.words.armor1)

    self.contents.draw_text(4, Theory_Greater_Icons::Height * 2, 92, Theory_Greater_Icons::Height, $data_system.words.armor2)

    self.contents.draw_text(4, Theory_Greater_Icons::Height * 3, 92, Theory_Greater_Icons::Height, $data_system.words.armor3)

    self.contents.draw_text(5, Theory_Greater_Icons::Height * 4, 92, Theory_Greater_Icons::Height, $data_system.words.armor4)

    draw_item_name(@data[0], 92, Theory_Greater_Icons::Height * 0)

    draw_item_name(@data[1], 92, Theory_Greater_Icons::Height * 1)

    draw_item_name(@data[2], 92, Theory_Greater_Icons::Height * 2)

    draw_item_name(@data[3], 92, Theory_Greater_Icons::Height * 3)

    draw_item_name(@data[4], 92, Theory_Greater_Icons::Height * 4)

  end

  #--------------------------------------------------------------------------

  # * Help Text Update

  #--------------------------------------------------------------------------

  def update_help

    @help_window.set_text(self.item == nil ? "" : self.item.description)

  end

end

 

 

 

#==============================================================================

# ** Window_Skill

#------------------------------------------------------------------------------

#  This window displays usable skills on the skill and battle screens.

#==============================================================================

 

class Window_Skill < Window_Selectable

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     actor : actor

  #--------------------------------------------------------------------------

  def initialize(actor)

    super(0, 128, 640, 352)

    @oh = Theory_Greater_Icons::Height

    @actor = actor

    @column_max = 2

    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

  #--------------------------------------------------------------------------

  # * Acquiring Skill

  #--------------------------------------------------------------------------

  def skill

    return @data[self.index]

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    if self.contents != nil

      self.contents.dispose

      self.contents = nil

    end

    @data = []

    for i in [email=0...@actor.skills.size]0...@actor.skills.size[/email]

      skill = $data_skills[@actor.skills[i]]

      if skill != nil

        @data.push(skill)

      end

    end

    # If item count is not 0, make a bit map and draw all items

    @item_max = @data.size

    if @item_max > 0

      self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)

      for i in 0...@item_max

        draw_item(i)

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Draw Item

  #     index : item number

  #--------------------------------------------------------------------------

  def draw_item(index)

    skill = @data[index]

    x = 4 + index % 2 * (288 + Theory_Greater_Icons::Width)

    y = index / 2 * Theory_Greater_Icons::Height

    rect = Rect.new(x, y, self.width / @column_max - Theory_Greater_Icons::Width, Theory_Greater_Icons::Height)

    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))

    @bitmap = RPG::Cache.icon(skill.icon_name)

    

    if skill.element_set.include?(Theory_Greater_Icons::LegendaryElement)

      if @actor.skill_can_use?(skill.id)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColor

      else

        self.contents.font.color = Theory_Greater_Icons::LegendaryColorDisabled

      end

      self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

    elsif skill.element_set.include?(Theory_Greater_Icons::RareElement)

      if @actor.skill_can_use?(skill.id)

        self.contents.font.color = Theory_Greater_Icons::RareColor

      else

        self.contents.font.color = Theory_Greater_Icons::RareColorDisabled

      end

      self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

    elsif skill.element_set.include?(Theory_Greater_Icons::UncommonElement)

      if @actor.skill_can_use?(skill.id)

        self.contents.font.color = Theory_Greater_Icons::UncommonColor

      else

        self.contents.font.color = Theory_Greater_Icons::UncommonColorDisabled

      end

      self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

    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)

      if @actor.skill_can_use?(skill.id)

        self.contents.font.color = normal_color

      else

        self.contents.font.color = disabled_color

      end

      self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

    end

    self.contents.draw_text(x + Theory_Greater_Icons::Width + 4, y - 10, 204, Theory_Greater_Icons::Height, skill.name, 0)

    self.contents.draw_text(x + Theory_Greater_Icons::Width + 6, y + 10, 48, Theory_Greater_Icons::Height, skill.sp_cost.to_s, 2)

  end

  #--------------------------------------------------------------------------

  # * Help Text Update

  #--------------------------------------------------------------------------

  def update_help

    @help_window.set_text(self.skill == nil ? "" : self.skill.description)

  end

end

 

 

#==============================================================================

# ** Window_BattleResult

#------------------------------------------------------------------------------

#  This window displays amount of gold and EXP acquired at the end of a battle.

#==============================================================================

 

class Window_BattleResult < Window_Base

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     exp       : EXP

  #     gold      : amount of gold

  #     treasures : treasures

  #--------------------------------------------------------------------------

  def initialize(exp, gold, treasures)

    @exp = exp

    @gold = gold

    @treasures = treasures

    super(160, 0, 320, @treasures.size *  Theory_Greater_Icons::Height + 64)

    self.contents = Bitmap.new(width - 32, height - 32)

    self.y = 160 - height / 2

    self.back_opacity = 160

    self.visible = false

    refresh

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    self.contents.clear

    x = 4

    self.contents.font.color = normal_color

    cx = contents.text_size(@exp.to_s).width

    self.contents.draw_text(x, 0, cx, 32, @exp.to_s)

    x += cx + 4

    self.contents.font.color = system_color

    cx = contents.text_size("EXP").width

    self.contents.draw_text(x, 0, 64, 32, "EXP")

    x += cx + 16

    self.contents.font.color = normal_color

    cx = contents.text_size(@gold.to_s).width

    self.contents.draw_text(x, 0, cx, 32, @gold.to_s)

    x += cx + 4

    self.contents.font.color = system_color

    self.contents.draw_text(x, 0, 128, 32, $data_system.words.gold)

    y = 32

    for item in @treasures

      draw_item_name(item, 4, y)

      y += Theory_Greater_Icons::Height

    end

  end

end

 

 

#==============================================================================

# ** Window_ShopBuy

#------------------------------------------------------------------------------

#  This window displays buyable goods on the shop screen.

#==============================================================================

 

class Window_ShopBuy < Window_Selectable

  #--------------------------------------------------------------------------

  # * Object Initialization

  #     shop_goods : goods

  #--------------------------------------------------------------------------

  def initialize(shop_goods)

    super(0, 128, 368, 352)

    @oh = Theory_Greater_Icons::Height

    @shop_goods = shop_goods

    refresh

    self.index = 0

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    if self.contents != nil

      self.contents.dispose

      self.contents = nil

    end

    @data = []

    for goods_item in @shop_goods

      case goods_item[0]

      when 0

        item = $data_items[goods_item[1]]

      when 1

        item = $data_weapons[goods_item[1]]

      when 2

        item = $data_armors[goods_item[1]]

      end

      if item != nil

        @data.push(item)

      end

    end

    # If item count is not 0, make a bit map and draw all items

    @item_max = @data.size

    if @item_max > 0

      self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)

      for i in 0...@item_max

        draw_item(i)

      end

    end

  end

  

  #--------------------------------------------------------------------------

  # * Draw Item

  #     index : item number

  #--------------------------------------------------------------------------

  def draw_item(index)

    item = @data[index]

    x = 4

    y = index * Theory_Greater_Icons::Height

    case item

    when RPG::Weapon

      number = $game_party.weapon_number(item.id)

    when RPG::Armor

      number = $game_party.armor_number(item.id)

    end

    @bitmap = RPG::Cache.icon(item.icon_name)

    case item

    when RPG::Item

      number = $game_party.item_number(item.id)

    when RPG::Weapon

      number = $game_party.weapon_number(item.id)

    when RPG::Armor

      number = $game_party.armor_number(item.id)

    end

    case item

    when RPG::Weapon

      weapon = @data[index]

      if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)

        self.contents.font.color = Theory_Greater_Icons::RareColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)

        self.contents.font.color = Theory_Greater_Icons::UncommonColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        self.contents.font.color = normal_color

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    when RPG::Armor

      armor = @data[index]

      if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)

        self.contents.font.color = Theory_Greater_Icons::RareColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)

        self.contents.font.color = Theory_Greater_Icons::UncommonColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        self.contents.font.color = normal_color

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    when RPG::Item

      itema = $data_items[item.id]

      if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)

        self.contents.font.color = Theory_Greater_Icons::RareColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)

        self.contents.font.color = Theory_Greater_Icons::UncommonColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        self.contents.font.color = normal_color

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    end

    

    # Get items in possession

    case item

    when RPG::Item

      number = $game_party.item_number(item.id)

    when RPG::Weapon

      number = $game_party.weapon_number(item.id)

    when RPG::Armor

      number = $game_party.armor_number(item.id)

    end

    # If price is less than money in possession, and amount in possession is

    # not 99, then set to normal text color. Otherwise set to disabled color

    if item.price <= $game_party.gold and number < 99

    else

      self.contents.font.color = disabled_color

    end

    pricea = item.price

    self.contents.draw_text(x + Theory_Greater_Icons::Width + 3, y, 212, Theory_Greater_Icons::Height, item.name, 0)

    tempy = y + Theory_Greater_Icons::Height - 36

    self.contents.font.color = normal_color

    self.contents.draw_text(x - 5, tempy, 24, Theory_Greater_Icons::Height, number.to_s, 2)

    self.contents.draw_text(x + 200, y, 16, Theory_Greater_Icons::Height, ":", 1)

    self.contents.draw_text(x + 206, y, 60, Theory_Greater_Icons::Height, pricea.to_s, 2)

  end

  

  

  

  

end

 

#==============================================================================

# ** Window_ShopSell

#------------------------------------------------------------------------------

#  This window displays items in possession for selling on the shop screen.

#==============================================================================

 

class Window_ShopSell < Window_Selectable

 

  #--------------------------------------------------------------------------

  # * Object Initialization

  #--------------------------------------------------------------------------

  def initialize

    super(0, 128, 640, 352)

    @oh = Theory_Greater_Icons::Height

    @column_max = 2

    refresh

    self.index = 0

  end

  #--------------------------------------------------------------------------

  # * Refresh

  #--------------------------------------------------------------------------

  def refresh

    if self.contents != nil

      self.contents.dispose

      self.contents = nil

    end

    @data = []

    for i in 1...$data_items.size

      if $game_party.item_number(i) > 0

        @data.push($data_items[i])

      end

    end

    for i in 1...$data_weapons.size

      if $game_party.weapon_number(i) > 0

        @data.push($data_weapons[i])

      end

    end

    for i in 1...$data_armors.size

      if $game_party.armor_number(i) > 0

        @data.push($data_armors[i])

      end

    end

    # If item count is not 0, make a bitmap and draw all items

    @item_max = @data.size

    if @item_max > 0

      self.contents = Bitmap.new(width - Theory_Greater_Icons::Width, row_max * Theory_Greater_Icons::Height)

      for i in 0...@item_max

        draw_item(i)

      end

    end

  end

  #--------------------------------------------------------------------------

  # * Draw Item

  #     index : item number

  #--------------------------------------------------------------------------

  def draw_item(index)

    item = @data[index]

    x = 4 + index % 2 * (288 + 32)

    y = index / 2 * Theory_Greater_Icons::Height

    case item

    when RPG::Weapon

      number = $game_party.weapon_number(item.id)

    when RPG::Armor

      number = $game_party.armor_number(item.id)

    end

    @bitmap = RPG::Cache.icon(item.icon_name)

    case item

    when RPG::Item

      number = $game_party.item_number(item.id)

    when RPG::Weapon

      number = $game_party.weapon_number(item.id)

    when RPG::Armor

      number = $game_party.armor_number(item.id)

    end

    case item

    when RPG::Weapon

      weapon = @data[index]

      if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)

        self.contents.font.color = Theory_Greater_Icons::RareColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)

        self.contents.font.color = Theory_Greater_Icons::UncommonColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        self.contents.font.color = normal_color

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    when RPG::Armor

      armor = @data[index]

      if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)

        self.contents.font.color = Theory_Greater_Icons::RareColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)

        self.contents.font.color = Theory_Greater_Icons::UncommonColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        self.contents.font.color = normal_color

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    when RPG::Item

      itema = $data_items[item.id]

      if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)

        self.contents.font.color = Theory_Greater_Icons::RareColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)

        self.contents.font.color = Theory_Greater_Icons::UncommonColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        self.contents.font.color = normal_color

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    end

    

    if item.price <= 0

      self.contents.font.color = disabled_color

    end

    pricea = item.price / 2

    self.contents.draw_text(x + Theory_Greater_Icons::Width + 3, y, 212, Theory_Greater_Icons::Height, item.name, 0)

    tempy = y + Theory_Greater_Icons::Height - 36

    self.contents.font.color = normal_color

    self.contents.draw_text(x - 5, tempy, 24, Theory_Greater_Icons::Height, number.to_s, 2)

    self.contents.draw_text(x + 200, y, 16, Theory_Greater_Icons::Height, ":", 1)

    self.contents.draw_text(x + 206, y, 60, Theory_Greater_Icons::Height, pricea.to_s, 2)

  end

end

 

 

 

class Bitmap

  def draw_icon(x, y, filename, back='')

    backdrop = RPG::Cache.icon(back)

    center_x = Theory_Greater_Icons::Width / 2 + x

    center_y = Theory_Greater_Icons::Height / 2 + y

    left_x = center_x - backdrop.rect.width / 2

    upper_y = center_y - backdrop.rect.height / 2

    self.blt(left_x, upper_y, backdrop, backdrop.rect, 255)

    bitmap = filename

    left_x = center_x - bitmap.rect.width / 2

    upper_y = center_y - bitmap.rect.height / 2

    self.blt(left_x, upper_y - 2, bitmap, bitmap.rect, 255)

  end

end

 

class Window_Base

 

  #--------------------------------------------------------------------------

  # * Draw Item Name

  #     item : item

  #     x    : draw spot x-coordinate

  #     y    : draw spot y-coordinate

  #--------------------------------------------------------------------------

  def draw_item_name(item, x, y)

    if item == nil

      return

    end

    @bitmap = RPG::Cache.icon(item.icon_name)

    case item

    when RPG::Weapon

      weapon = $data_weapons[item.id]

      if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)

        self.contents.font.color = Theory_Greater_Icons::RareColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)

        self.contents.font.color = Theory_Greater_Icons::UncommonColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        self.contents.font.color = normal_color

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    when RPG::Armor

      armor = $data_armors[item.id]

      if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)

        self.contents.font.color = Theory_Greater_Icons::RareColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)

        self.contents.font.color = Theory_Greater_Icons::UncommonColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        self.contents.font.color = normal_color

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    when RPG::Item

      itema = $data_items[item.id]

      if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)

        self.contents.font.color = Theory_Greater_Icons::LegendaryColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

      elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)

        self.contents.font.color = Theory_Greater_Icons::RareColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

      elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)

        self.contents.font.color = Theory_Greater_Icons::UncommonColor

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

      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)

        self.contents.font.color = normal_color

        self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

      end

    end

    self.contents.draw_text(x + Theory_Greater_Icons::Width + 4, y, 212, Theory_Greater_Icons::Width, item.name)

  end

  

end

 

 

Compatibility Patches

Link...
Code:
 

module Theory_Greater_Icons

  

   Icon_Changes = {"001-Weapon01" => "Sword001"}

  

 end

  

 class Window_Base

  

   def draw_item_name(item, x, y)

     if item == nil

       return

     end

     icon = item.icon_name

     change = Theory_Greater_Icons::Icon_Changes

     for i in change.keys

       if item.icon_name == i

         icon = change[i]

       end

    end

     @bitmap = RPG::Cache.icon(icon)

     case item

     when RPG::Weapon

       weapon = $data_weapons[item.id]

       if weapon.element_set.include?(Theory_Greater_Icons::LegendaryElement)

         self.contents.font.color = Theory_Greater_Icons::LegendaryColor

         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

       elsif weapon.element_set.include?(Theory_Greater_Icons::RareElement)

         self.contents.font.color = Theory_Greater_Icons::RareColor

         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

       elsif weapon.element_set.include?(Theory_Greater_Icons::UncommonElement)

         self.contents.font.color = Theory_Greater_Icons::UncommonColor

         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

       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)

         self.contents.font.color = normal_color

         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

       end

     when RPG::Armor

       armor = $data_armors[item.id]

       if armor.guard_element_set.include?(Theory_Greater_Icons::LegendaryElement)

         self.contents.font.color = Theory_Greater_Icons::LegendaryColor

         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

       elsif armor.guard_element_set.include?(Theory_Greater_Icons::RareElement)

         self.contents.font.color = Theory_Greater_Icons::RareColor

         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

       elsif armor.guard_element_set.include?(Theory_Greater_Icons::UncommonElement)

         self.contents.font.color = Theory_Greater_Icons::UncommonColor

         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

       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)

         self.contents.font.color = normal_color

         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

       end

     when RPG::Item

       itema = $data_items[item.id]

       if itema.element_set.include?(Theory_Greater_Icons::LegendaryElement)

         self.contents.font.color = Theory_Greater_Icons::LegendaryColor

         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::LegendaryBackground)

       elsif itema.element_set.include?(Theory_Greater_Icons::RareElement)

         self.contents.font.color = Theory_Greater_Icons::RareColor

         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::RareBackground)

       elsif itema.element_set.include?(Theory_Greater_Icons::UncommonElement)

         self.contents.font.color = Theory_Greater_Icons::UncommonColor

         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::UncommonBackground)

       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)

         self.contents.font.color = normal_color

         self.contents.draw_icon(x, y, @bitmap, Theory_Greater_Icons::Background)

       end

     end

     self.contents.draw_text(x + Theory_Greater_Icons::Width + 4, y, 212, Theory_Greater_Icons::Width, item.name)

   end

  

 end

 

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.
Code:
module Theory_Sized_Icons
  Width = 50
  Height = 50
end

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.
Code:
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

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.

Code:
#==============================================================================
# ** 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

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?
 
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.

Code:
  def oh
  return Theory_Icon_Size::Height
  end

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

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):
Code:
  #--------------------------------------------------------------------------
  # * 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

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.

Code:
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

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:
Code:
  #--------------------------------------------------------------------------
  # * Get Item
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end

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":1lcs8dny said:
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.
 
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 theory@theorystudios.net .
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...    ='(
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top