[VXA] Icon Hues

0 Members and 1 Guest are viewing this topic.

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best Member2012 Best RPG Maker User (Scripting)Secret Santa 2012 ParticipantProject of the Month winner for July 20092011 Favourite Staff Member2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Best Veteran2011 Most Mature Member2010 Most Mature Member2010 Favourite Staff Member
Icon Hues
Version: 1.0b
Author: modern algebra
Date: January 10, 2011

Version History


  • <Version 1.0b> 2012.01.10 - Added compatibility measures for Yanfly's Ace Shop Options and Yanfly's Ace Item Menu.
  • <Version 1.0a> 2011.12.30 - Fixed an error that interfered with ATS compatibility
  • <Version 1.0> 2011.12.18 - Original Release

Description


This script allows you to specify a hue for the icons of individual items, weapons, armors, skills, and states. This way you can use the same icon for various items, only changing the hue. This script also permits you to show icons with shifted hues in any message window.

Features

  • Can set the hue of any icon for use wherever they appear by default
  • Can use a new \ih message code to show an icon with a shifted hue in any message window
  • Can also use new message codes to show the icon of any item, weapon, armor, skill, or state with the shifted hue in any message window
  • Built-in compatibility with YEA Command Window Icons

Screenshots






Instructions

Paste this script into its own slot in the Script Editor, above Main but below Materials. It is recommended that you put it below all other custom scripts. In particular, it must be below YEA Command Window Icons if you want to be able to change the hues of the icons set through that script.

For more details on configuration and use, see the header of this script.

Script


Code: [Select]
#==============================================================================
#    Icon Hues
#    Version: 1.0b
#    Author: modern algebra (rmrk.net)
#    Date: January 10, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Description:
#
#    This script allows you to specify a hue for the icons of individual items,
#   weapons, armors, skills, and states. This way you can use the same icon for
#   various items, only changing the hue. This script also permits you to show
#   icons with shifted hues in any message window.
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    Place this script above Main and below default scripts in the Script
#   Editor. Put it above all other custom scripts.
#
#    To specify a hue for an icon, simply put the following in the note field
#   of an item, weapon, armor, skill, or state:
#     
#        \icon_hue[x]
#          x: the hue you want. It can be any integer between 0 and 359.
#
#    EXAMPLES:
#      \icon_hue[65]
#      \icon_hue[320]
#``````````````````````````````````````````````````````````````````````````````
#    Additionally, this script introduces six new message commands that you can
#   use to display a hue-altered icon in any message window.
#
#        \IH[n, x]
#          n: the index of the icon you want to show. The index of an icon must
#            be an integer and is discernible by looking at the bottom left
#            corner when selecting icons.
#          x: the hue you want - it can be any integer between 0 and 359.
#
#    You can also use the following commands:
#        \II[n] - Draws hue-shifted icon of the item with ID n.
#        \IW[n] - Draws hue-shifted icon of the weapon with ID n.
#        \IA[n] - Draws hue-shifted icon of the armor with ID n.
#        \IS[n] - Draws hue-shifted icon of the skill with ID n.
#        \IT[n] - Draws hue-shifted icon of the state with ID n.
#
#    EXAMPLES:
#        \IH[14, 250] - Draws Icon 14 with a hue change of 250.
#        \IW[4] - Draws the hue-shifted icon of the weapon with ID 4.
#        \IT[64] - Draws the hue-shifted icon of the state with ID 64.
#``````````````````````````````````````````````````````````````````````````````
#  Compatibility with: YEA Command Window Icons
#
#    This script also works with Yanfly's YEA Command Window Icons script,
#   found at the following link:
#
#     http://yanflychannel.wordpress.com/rmvxa/menu-scripts/command-window-icons/
#
#    All you need to do is make sure that the Icon Hue script is below the
#   YEA Command Window Script in the Script List (but still above Main). Then,
#   in the configuration for YEA Command Window Icons, you just need to set the
#   command as an array in the following format:
#      "Command"      => [n, x],
#        n: the index of the icon you want to show.
#        x: the hue of the icon - it can be any integer between 0 and 359.
#   
#    EXAMPLES:
#      "New Game"      => [224, 65],
#
#    To reiterate, the configuration must be done in the YEA Command Window
#   Icons Script, not this one. The configuration section of that script starts
#   at line 55. Also note that if you do not want to set the hue, then you do
#   not need to put it in an array; the default configuration will still work.
#==============================================================================

$imported = {} unless $imported
$imported[:MAIcon_Hue] = true

#==============================================================================
# ** RPG::BaseItem
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    new method - icon_hue
#==============================================================================

class RPG::BaseItem
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Icon Hue
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def icon_hue
    if @icon_hue.nil?
      @icon_hue = self.note[/\\ICON[ _]HUE\[(\d+)\]/i].nil? ? 0 : $1.to_i
    end
    @icon_hue
  end
end

#==============================================================================
# ** Window_Base
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    aliased methods - draw_item_name; draw_actor_icons; draw_icon;
#      convert_escape_character; process_escape_character
#    new method - draw_icon_with_hue
#==============================================================================

class Window_Base
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Item Name
  #     item    : Item (skill, weapon, armor are also possible)
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modra_ichue_dritm_8ik2 draw_item_name
  def draw_item_name(item, *args)
    @maih_icon_hue = item.icon_hue if item != nil
    modra_ichue_dritm_8ik2(item, *args) # Run Original Method
    @maih_icon_hue = nil
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw State
  #    actor : Game_Actor object
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias malg_icnhue_dstat_7uj3 draw_actor_icons
  def draw_actor_icons(actor, *args)
    @maih_icon_hue = []
    for state in actor.states
      @maih_icon_hue.push (state.icon_hue) if state.icon_index != 0
    end
    # Don't need to do buffs since all the same anyway
    malg_icnhue_dstat_7uj3(actor, *args) # Run Original Method
    @maih_icon_hue = nil
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Icon
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias modrn_drwicn_hue_6yh1 draw_icon
  def draw_icon(icon_index, x, y, enabled = true, *args)
    hue = @maih_icon_hue.is_a?(Array) ? @maih_icon_hue.shift : @maih_icon_hue
    if !hue || hue == 0
      # Run Original Method
      modrn_drwicn_hue_6yh1(icon_index, x, y, enabled, *args)
    else
      draw_icon_with_hue(icon_index, hue, x, y, enabled)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Icon With Hue
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_icon_with_hue(icon_index, icon_hue, x, y, enabled = true)
    bitmap = Cache.system("Iconset")
    rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
    # Draw Icon onto small and independent bitmap
    icon_bmp = Bitmap.new(24, 24)
    icon_bmp.blt(0, 0, bitmap, rect)
    icon_bmp.hue_change(icon_hue) # Change hue of icon
    rect.x, rect.y = 0, 0
    self.contents.blt(x, y, icon_bmp, rect, enabled ? 255 : translucent_alpha)
    icon_bmp.dispose # Dispose Icon Bitmap
  end
  #\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
  #  Compatibility with ATS Special Message Codes
  #//////////////////////////////////////////////////////////////////////////
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Convert Escape Characters
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  convesc = $imported[:ATS_SpecialMessageCodes] ? :ma_atssmc_convesc_4rc1 : :convert_escape_characters
  alias_method(:ma_icnhue_convertesc_8ib6, convesc)
  define_method(convesc) do |*args|
    result = ma_icnhue_convertesc_8ib6(*args) # Run Original Method
    result.gsub!(/\eIH\[/i, "\eHI\[") # Change \IH to \HI
    result.gsub!(/\eII\[(\d+)\]/i) { "\eHI\[#{$data_items[$1.to_i].icon_index},#{$data_items[$1.to_i].icon_hue}\]" rescue "" }
    result.gsub!(/\eIW\[(\d+)\]/i) { "\eHI\[#{$data_weapons[$1.to_i].icon_index},#{$data_weapons[$1.to_i].icon_hue}\]" rescue "" }
    result.gsub!(/\eIA\[(\d+)\]/i) { "\eHI\[#{$data_armors[$1.to_i].icon_index},#{$data_armors[$1.to_i].icon_hue}\]" rescue "" }
    result.gsub!(/\eIS\[(\d+)\]/i) { "\eHI\[#{$data_skills[$1.to_i].icon_index},#{$data_skills[$1.to_i].icon_hue}\]" rescue "" }
    result.gsub!(/\eIT\[(\d+)\]/i) { "\eHI\[#{$data_states[$1.to_i].icon_index},#{$data_states[$1.to_i].icon_hue}\]" rescue "" }
    result
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Process Escape Character
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias malg_icnhu_procescchar_5tc1 process_escape_character
  def process_escape_character(code, text, pos, *args, &block)
    if code.upcase == 'HI' # Icon with Hue
      text.slice!(/^\[\s*(\d+)\s*[,:;]?\s*(\d*)\s*\]/)
      @maih_icon_hue = $2.to_i
      process_draw_icon($1.to_i, pos)
      @maih_icon_hue = nil
    else
      malg_icnhu_procescchar_5tc1(code, text, pos, *args, &block) # Run Original Method
    end
  end
end

#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#  Compatibility with YEA - Command Window Icons
#//////////////////////////////////////////////////////////////////////////////

if $imported["YEA-CommandWindowIcons"]
  #============================================================================
  # ** Window_Command
  #++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  #  Summary of Changes:
  #    aliased methods - command_icon; draw_icon_with_text
  #    new method - use_icon_hue?
  #============================================================================

  class Window_Command
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Command Icon
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if self.method_defined?(:command_icon)
      alias ma_ih_cmndicn_6uj7 command_icon
      def command_icon(*args, &block)
        result = ma_ih_cmndicn_6uj7(*args, &block) # Run Original Method
        return result[0] if result.is_a?(Array)
        result
      end
    end
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    # * Draw Icon Text
    #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    if self.method_defined?(:draw_icon_text)
      alias ma_icnh_drwicntext_4rk9 draw_icon_text
      def draw_icon_text(rect, text, *args, &block)
        icn_a = ma_ih_cmndicn_6uj7(text)
        if icn_a.is_a?(Array)
          @maih_icon_hue = icn_a.size > 1 ? icn_a[1] : 0
        end
        result = ma_icnh_drwicntext_4rk9(rect, text, *args, &block) # Run Original Method
        @maih_icon_hue = nil
        result
      end
    end
  end
end

#\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
#  Compatibility with Yanfly's Ace Item Menu 1.02 & Ace Shop Options 1.01
#//////////////////////////////////////////////////////////////////////////////

comp_classes = []
comp_classes.push(Window_ItemStatus) if $imported["YEA-ItemMenu"]
comp_classes.push(Window_ShopData) if  $imported["YEA-ShopOptions"]

unless comp_classes.empty?
#==============================================================================
# *** MAIH_AIMASO_CompPatch
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  This module changes several methods as they would apply in two of Yanfly's
# scripts.
#==============================================================================

module MAIH_AIMASO_CompPatch
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Item Image
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_item_image
    colour = Color.new(0, 0, 0, translucent_alpha/2)
    rect = Rect.new(1, 1, 94, 94)
    contents.fill_rect(rect, colour)
    if @item.image.nil?
      icon_index = @item.icon_index
      bitmap = Cache.system("Iconset")
      rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
      icon_bmp = Bitmap.new(24, 24)
      icon_bmp.blt(0, 0, bitmap, rect)
      icon_bmp.hue_change(@item.icon_hue)
      target = Rect.new(0, 0, 96, 96)
      contents.stretch_blt(target, icon_bmp, icon_bmp.rect)
    else
      bitmap = Cache.picture(@item.image)
      contents.blt(0, 0, bitmap, bitmap.rect, 255)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Applies
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_applies(*args, &block)
    @maih_icon_hue = []
    for effect in @item.effects
      if effect.code == Game_Battler::ADD_STATE
        next unless effect.value1 > 0
        next if $data_states[effect.value1].nil?
        @maih_icon_hue << $data_states[effect.data_id].icon_hue
      end
    end
    super(*args, &block)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Removes
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_removes(*args, &block)
    @maih_icon_hue = []
    for effect in @item.effects
      if effect.code == Game_Battler::EFFECT_REMOVE_STATE
        next unless effect.value1 > 0
        next if $data_states[effect.value1].nil?
        @maih_icon_hue << $data_states[effect.data_id].icon_hue
      end
    end
    super(*args, &block) # Call Original Method
  end
end
# include module in selected classes
comp_classes.each { |class_obj| class_obj.send(:include, MAIH_AIMASO_CompPatch) }
end

Credit


  • modern algebra

Support


Please post in this topic at RMRK for assistance.

Known Compatibility Issues

This script is designed to be compatible with YEA Command Window Icons, meaning that you can change use different hues with the icons in that script. You will need to place this script below that one, and then you can set the hue of any icon in that script simply by using an array in the form: [index, hue]. See the header of this script for details.

Additionally, this script is compatible with Yanfly's Ace Item Menu and Ace Shop Options. This script must, however, be below them in the Script Editor, though still above Main.
« Last Edit: January 11, 2012, 03:14:29 AM by modern algebra »

pokeball joyOfflineFemale
*
Rep:
Level 85
I heard the voice of the salt in the desert
2012 Best RPG Maker User (Mapping)Project of the Month winner for June 20092010 Best RPG Maker User (Creativity)2011 Best RPG Maker User (Mapping)2011 Best RPG Maker User (Creativity)Winner - 2011 Winter Project of the Season2010 Best RPG Maker User (Graphical)2010 Best RPG Maker User (Mapping)2010 Best Artist2014 Best Artist2014 Best RPG Maker User - Graphics2014 Best RPG Maker User - Mapping2013 Best RPG Maker User (Graphical)2013 Best RPG Maker User (Mapping)2010 Most Unsung Member2010 Most Deserving Of A Promotion
Very handy!!

**
Rep: +0/-0Level 72
RMRK Junior
Hello there!!

Thanks for your amazing work.. It is  possible to make it work with the Yanfly Ace Item Menu?

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best Member2012 Best RPG Maker User (Scripting)Secret Santa 2012 ParticipantProject of the Month winner for July 20092011 Favourite Staff Member2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Best Veteran2011 Most Mature Member2010 Most Mature Member2010 Favourite Staff Member
Untested, but try pasting the following into its own slot somewhere below Yanfly Ace Item Menu, but still above Main:

Code: [Select]
#==============================================================================
#  Icon Hues 1.0 & Yanfly's Ace Item Menu v. 1.02
#    Compatibility Patch
#  Version: 1.0
#  Author: modern algebra (rmrk.net)
#  Date: January 8, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    This patch must be pasted into its own slot in the Script Editor, above
#   Main but below Yanfly's Ace Item Menu.
#==============================================================================
if $imported["YEA-ItemMenu"]
$imported[:MA_YAIM_IconHues_Compatibility] = true

#==============================================================================
# ** Window_ItemStatus
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    overwritten method - draw_item_image
#    aliased methods -
#==============================================================================

class Window_ItemStatus
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Item Image
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_item_image
    colour = Color.new(0, 0, 0, translucent_alpha/2)
    rect = Rect.new(1, 1, 94, 94)
    contents.fill_rect(rect, colour)
    if @item.image.nil?
      icon_index = @item.icon_index
      bitmap = Cache.system("Iconset")
      rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
      icon_bmp = Bitmap.new(24, 24)
      icon_bmp.blt(0, 0, bitmap, rect)
      icon_bmp.hue_change(icon_hue)
      target = Rect.new(0, 0, 96, 96)
      contents.stretch_blt(target, icon_bmp, bmp.rect)
    else
      bitmap = Cache.picture(@item.image)
      contents.blt(0, 0, bitmap, bitmap.rect, 255)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Applies
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_yaimihcomp_drwaplis_2gb5 draw_applies
  def draw_applies(*args, &block)
    @maih_icon_hue = []
    for effect in @item.effects
      if effect.code == Game_Battler::ADD_STATE
        next unless effect.value1 > 0
        next if $data_states[effect.value1].nil?
        @maih_icon_hue << $data_states[effect.data_id].icon_hue
      end
    end
    ma_yaimihcomp_drwaplis_2gb5(*args, &block)
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Removes
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_yaimihcomp_draremv_3fh2 draw_removes
  def draw_removes(*args, &block)
    @maih_icon_hue = []
    for effect in @item.effects
      if effect.code == Game_Battler::EFFECT_REMOVE_STATE
        next unless effect.value1 > 0
        next if $data_states[effect.value1].nil?
        @maih_icon_hue << $data_states[effect.data_id].icon_hue
      end
    end
    ma_yaimihcomp_draremv_3fh2(*args, &block) # Call Original Method
  end
end
end

Tell me if it works.

**
Rep: +0/-0Level 72
RMRK Junior
Sorry about that, but it doesn't work.

It's says something about the variable icon_hue is not found...

Thanks for your efforts...

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best Member2012 Best RPG Maker User (Scripting)Secret Santa 2012 ParticipantProject of the Month winner for July 20092011 Favourite Staff Member2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Best Veteran2011 Most Mature Member2010 Most Mature Member2010 Favourite Staff Member
Sorry, it should have been:

Code: [Select]
#==============================================================================
#  Icon Hues 1.0 & Yanfly's Ace Item Menu v. 1.02
#    Compatibility Patch
#  Version: 1.0
#  Author: modern algebra (rmrk.net)
#  Date: January 8, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    This patch must be pasted into its own slot in the Script Editor, above
#   Main but below Yanfly's Ace Item Menu.
#==============================================================================
if $imported["YEA-ItemMenu"]
$imported[:MA_YAIM_IconHues_Compatibility] = true

#==============================================================================
# ** Window_ItemStatus
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    overwritten method - draw_item_image
#    aliased methods -
#==============================================================================

class Window_ItemStatus
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Item Image
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_item_image
    colour = Color.new(0, 0, 0, translucent_alpha/2)
    rect = Rect.new(1, 1, 94, 94)
    contents.fill_rect(rect, colour)
    if @item.image.nil?
      icon_index = @item.icon_index
      bitmap = Cache.system("Iconset")
      rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
      icon_bmp = Bitmap.new(24, 24)
      icon_bmp.blt(0, 0, bitmap, rect)
      icon_bmp.hue_change(@item.icon_hue)
      target = Rect.new(0, 0, 96, 96)
      contents.stretch_blt(target, icon_bmp, bmp.rect)
    else
      bitmap = Cache.picture(@item.image)
      contents.blt(0, 0, bitmap, bitmap.rect, 255)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Applies
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_yaimihcomp_drwaplis_2gb5 draw_applies
  def draw_applies(*args, &block)
    @maih_icon_hue = []
    for effect in @item.effects
      if effect.code == Game_Battler::ADD_STATE
        next unless effect.value1 > 0
        next if $data_states[effect.value1].nil?
        @maih_icon_hue << $data_states[effect.data_id].icon_hue
      end
    end
    ma_yaimihcomp_drwaplis_2gb5(*args, &block)
    @maih_icon_hue = nil
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Removes
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_yaimihcomp_draremv_3fh2 draw_removes
  def draw_removes(*args, &block)
    @maih_icon_hue = []
    for effect in @item.effects
      if effect.code == Game_Battler::EFFECT_REMOVE_STATE
        next unless effect.value1 > 0
        next if $data_states[effect.value1].nil?
        @maih_icon_hue << $data_states[effect.data_id].icon_hue
      end
    end
    ma_yaimihcomp_draremv_3fh2(*args, &block) # Call Original Method
    @maih_icon_hue = nil
  end
end
end
« Last Edit: January 09, 2012, 09:01:48 PM by modern algebra »

**
Rep: +0/-0Level 72
RMRK Junior
Modern Algebra, sorry about that, but I've got another problem, now with the variable or method 'bmp'. XD

In line 40 exactly.

Thanks for yor efforts!

EDIT:

I edit the code to fix it, the variable must be renamed to icon_bmp and it will work as expected. Here you can find the piece of code fixed.

Thank you Modern!

Spoiler for:
Code: [Select]
#==============================================================================
#  Icon Hues 1.0 & Yanfly's Ace Item Menu v. 1.02
#    Compatibility Patch
#  Version: 1.0
#  Author: modern algebra (rmrk.net)
#  Date: January 8, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    This patch must be pasted into its own slot in the Script Editor, above
#   Main but below Yanfly's Ace Item Menu.
#==============================================================================
if $imported["YEA-ItemMenu"]
$imported[:MA_YAIM_IconHues_Compatibility] = true

#==============================================================================
# ** Window_ItemStatus
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    overwritten method - draw_item_image
#    aliased methods -
#==============================================================================

class Window_ItemStatus
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Item Image
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_item_image
    colour = Color.new(0, 0, 0, translucent_alpha/2)
    rect = Rect.new(1, 1, 94, 94)
    contents.fill_rect(rect, colour)
    if @item.image.nil?
      icon_index = @item.icon_index
      bitmap = Cache.system("Iconset")
      rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
      icon_bmp = Bitmap.new(24, 24)
      icon_bmp.blt(0, 0, bitmap, rect)
      icon_bmp.hue_change(@item.icon_hue)
      target = Rect.new(0, 0, 96, 96)
      contents.stretch_blt(target, icon_bmp, icon_bmp.rect)
    else
      bitmap = Cache.picture(@item.image)
      contents.blt(0, 0, bitmap, bitmap.rect, 255)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Applies
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_yaimihcomp_drwaplis_2gb5 draw_applies
  def draw_applies(*args, &block)
    @maih_icon_hue = []
    for effect in @item.effects
      if effect.code == Game_Battler::ADD_STATE
        next unless effect.value1 > 0
        next if $data_states[effect.value1].nil?
        @maih_icon_hue << $data_states[effect.data_id].icon_hue
      end
    end
    ma_yaimihcomp_drwaplis_2gb5(*args, &block)
    @maih_icon_hue = nil
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Removes
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_yaimihcomp_draremv_3fh2 draw_removes
  def draw_removes(*args, &block)
    @maih_icon_hue = []
    for effect in @item.effects
      if effect.code == Game_Battler::EFFECT_REMOVE_STATE
        next unless effect.value1 > 0
        next if $data_states[effect.value1].nil?
        @maih_icon_hue << $data_states[effect.data_id].icon_hue
      end
    end
    ma_yaimihcomp_draremv_3fh2(*args, &block) # Call Original Method
    @maih_icon_hue = nil
  end
end
end

Also, please take note I modified it to make it work also with the Yanfly's Shop Options script.

Here yo will find it.
Code: [Select]
#==============================================================================
#  Icon Hues 1.0 & Yanfly's Ace Item Menu v. 1.02
#    Compatibility Patch
#  Version: 1.0
#  Author: modern algebra (rmrk.net)
#  Date: January 8, 2012
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Instructions:
#
#    This patch must be pasted into its own slot in the Script Editor, above
#   Main but below Yanfly's Ace Item Menu.
#==============================================================================
if $imported["YEA-ItemMenu"]
$imported[:MA_YAIM_IconHues_Compatibility] = true

#==============================================================================
# ** Window_ItemStatus
#++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
#  Summary of Changes:
#    overwritten method - draw_item_image
#    aliased methods -
#==============================================================================

class Window_ItemStatus
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Item Image
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  def draw_item_image
    colour = Color.new(0, 0, 0, translucent_alpha/2)
    rect = Rect.new(1, 1, 94, 94)
    contents.fill_rect(rect, colour)
    if @item.image.nil?
      icon_index = @item.icon_index
      bitmap = Cache.system("Iconset")
      rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
      icon_bmp = Bitmap.new(24, 24)
      icon_bmp.blt(0, 0, bitmap, rect)
      icon_bmp.hue_change(@item.icon_hue)
      target = Rect.new(0, 0, 96, 96)
      contents.stretch_blt(target, icon_bmp, icon_bmp.rect)
    else
      bitmap = Cache.picture(@item.image)
      contents.blt(0, 0, bitmap, bitmap.rect, 255)
    end
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Applies
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_yaimihcomp_drwaplis_2gb5 draw_applies
  def draw_applies(*args, &block)
    @maih_icon_hue = []
    for effect in @item.effects
      if effect.code == Game_Battler::ADD_STATE
        next unless effect.value1 > 0
        next if $data_states[effect.value1].nil?
        @maih_icon_hue << $data_states[effect.data_id].icon_hue
      end
    end
    ma_yaimihcomp_drwaplis_2gb5(*args, &block)
    @maih_icon_hue = nil
  end
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  # * Draw Removes
  #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  alias ma_yaimihcomp_draremv_3fh2 draw_removes
  def draw_removes(*args, &block)
    @maih_icon_hue = []
    for effect in @item.effects
      if effect.code == Game_Battler::EFFECT_REMOVE_STATE
        next unless effect.value1 > 0
        next if $data_states[effect.value1].nil?
        @maih_icon_hue << $data_states[effect.data_id].icon_hue
      end
    end
    ma_yaimihcomp_draremv_3fh2(*args, &block) # Call Original Method
    @maih_icon_hue = nil
  end
end
end

Another time, thank you Modern Algebra.

PD: I didn't rename the aliased methods. Please, rename it if necessary.
« Last Edit: January 10, 2012, 07:06:39 PM by Jhin »

*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best Member2012 Best RPG Maker User (Scripting)Secret Santa 2012 ParticipantProject of the Month winner for July 20092011 Favourite Staff Member2011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Best Veteran2011 Most Mature Member2010 Most Mature Member2010 Favourite Staff Member
I think you might have copied the wrong part for the Shop Options one, as that is just the fix for the Item Menu again.

In any case, I updated the script to 1.0b and it should now be compatible with both Shop Options and Ace Item Menu, so long as it is below both of them.

****
Rep:
Level 69
This adds so much to the game using so little. Not only that, it frees up a lot of my icon space.