Chaos Project

RPG Maker => RPG Maker Scripts => RMXP Script Database => Topic started by: LiTTleDRAgo on February 01, 2011, 08:51:44 pm

Title: [XP][VX][VXA] Item Art Color
Post by: LiTTleDRAgo on February 01, 2011, 08:51:44 pm
Item Art Color
Authors: LiTTleDRAgo
Version: 1.20
Type: Item Grouping
Key Term: Custom Item System



Introduction

I create this because Game_Guy's Item QC (http://forum.chaos-project.com/index.php/topic,8276.0.html) messing up with some of my script (like Active Action) ~sorry G_G
The Features are same, except the configuration is all in the script, not renaming all the items


Features




Screenshots

Spoiler: ShowHide
(http://img213.imageshack.us/img213/4653/58954878.jpg)



Demo

---


Script

Here (http://littledrago.blogspot.com/2011/09/rgss-item-art-color.html)

Place below Scene_Debug, below STCMS if present


Instructions

Config are in the script


Compatibility

Works with / without SDK, probably messing up with some CMS but it's very unlikely
untested in VX-A, but I think it should work


Credits and Thanks




Author's Notes

Enjoy ~
Title: Re: [Xp] Item Art Color
Post by: SBR* on February 02, 2011, 05:11:48 am
It looks nice :D! I haven't tested it, nor really looked at the script. If somebody would like to test it and tell me it's bug-less, I'll level LittleDrago up!

Cya :urgh:!

EDIT: Changed two words.
Title: Re: [Xp] Item Art Color
Post by: LiTTleDRAgo on February 02, 2011, 07:59:40 am
I'm not a god at scripting, so the bug is possible to exist
But, as far as now, I didn't found any bug
Title: Re: [Xp] Item Art Color
Post by: Taiine on February 05, 2011, 10:22:19 pm
Tried to test this out.
Made a new project, popped this in with no changes, added an event to add items to my invitatory.
when I check my items.
(http://images.devs-on.net/Image/ZmVjWhgl972ERAA-ItemTextColor.png)
Title: Re: [Xp] Item Art Color
Post by: Storm on February 05, 2011, 10:52:29 pm
Nice idea Dragon! :haha:

Quote from: Taiine on February 05, 2011, 10:22:19 pm
Tried to test this out.
Made a new project, popped this in with no changes, added an event to add items to my invitatory.
when I check my items.
(http://images.devs-on.net/Image/ZmVjWhgl972ERAA-ItemTextColor.png)



Try this one out:

#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# Item Art Color
# Version: 1.00
# Author : LiTTleDRAgo
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=



module LiTTleDRAgo
#------------------------------------------------------------------------------     
# Config Item Color
#         when (ID Item) then return (Type)
# or
#         when (ID Item) then return (Color)
#------------------------------------------------------------------------------     
  def self.ItemColor(i)
      case i
      when 2  then return Type('common')
      when 3  then return Type('epic')
      when 4  then return Type('common')
      when 5  then return Type('common')
      when 6  then return Color.new(119, 255, 0, 255)
      when 7  then return Color.new(120, 20 , 0, 255)
      when 8  then return Color.new(120, 20 , 0  , 255)
      when 9  then return Color.new(255, 255, 0  , 255)
      end
      return Color.normal_color
    end
#------------------------------------------------------------------------------     
# CONFIG END
#------------------------------------------------------------------------------     

#------------------------------------------------------------------------------     
# Config Weapon Color
#       when (ID Weapon) then return (Name Type)
# or
#       when (ID Weapon) then return (Color)
#------------------------------------------------------------------------------     
  def self.WeaponColor(i)
      case i
      when 2 then return Type('common')
      when 4 then return Type('rare')
      end
      return Color.normal_color
  end
#------------------------------------------------------------------------------     
# CONFIG END
#------------------------------------------------------------------------------     

#------------------------------------------------------------------------------     
# Config Armor Color
#       when (ID Armor) then return (Name Type)
# or
#       when (ID Armor) then return (Color)
#------------------------------------------------------------------------------     
  def self.ArmorColor(i)
      case i
      when 1 then return Type('fire')
      when 2 then return Type('common')
      when 3 then return Type('wind')
      when 6 then return Type('epic')
      when 7 then return Type('epic')
      end
      return Color.normal_color
  end
#------------------------------------------------------------------------------     
# CONFIG END
#------------------------------------------------------------------------------     

#------------------------------------------------------------------------------     
# Config Type Color
# when (Name Type) then return (Color)
#------------------------------------------------------------------------------     
  def self.Type(x)
    case x
    when 'common'  then return Color.new(255, 255, 0  , 255)
    when 'rare'    then return Color.new(120, 20 , 0  , 255)
    when 'epic'    then return Color.new(119, 255, 0  , 255)
    when 'awesome' then return Color.new(80 , 80 , 240, 255)
#------------------------------------------------------------------------------     
    when 'fire'    then return Color.red
    when 'ice'     then return Color.cyan
    when 'thunder' then return Color.purple
    when 'wind'    then return Color.green
    when 'earth'   then return Color.magenta
    when 'light'   then return Color.light_gray
    when 'dark'    then return Color.dark_gray
#------------------------------------------------------------------------------     
    end
    return Color.new(255, 255, 255, 255)
  end
 
end

#------------------------------------------------------------------------------     
# CONFIG END, DON'T EDIT BELOW UNLESS YOU KNOW WHAT YOU DO
#------------------------------------------------------------------------------     

#------------------------------------------------------------------------------
# SDK Check (This script will work with/without SDK)
#------------------------------------------------------------------------------
if Object.const_defined?('SDK')
SDK.log('Item Art Color', 'LiTTleDRAgo', 4, '01.02.11')
@drago_artcolors_disabled = true if !SDK.enabled?('Item Art Color')
end

if !@drago_artcolors_disabled
#------------------------------------------------------------------------------     
# THE SCRIPT START HERE
#------------------------------------------------------------------------------     
class Window_Base
alias_method :drago_drawitemname, :draw_item_name
def drago_item_colors(item,type = 0)
  return normal_color if item == nil
  @item_colored = true
  case item
  when RPG::Item   then return LiTTleDRAgo.ItemColor  (item.id)
  when RPG::Weapon then return LiTTleDRAgo.WeaponColor(item.id)
  when RPG::Armor  then return LiTTleDRAgo.ArmorColor (item.id)
  end
  @item_colored = nil
  return disabled_color
end

def draw_item_name(item, x, y)
  drago_drawitemname(item, x, y)
  return if item == nil
  self.contents.font.color = drago_item_colors(item)
  self.contents.draw_text(x + 28, y, 212, 32, item.name) if @item_colored
end
end

class Window_ShopBuy < Window_Selectable
alias_method :drago_itemcolors_drawitem, :draw_item
def draw_item(index)
   drago_itemcolors_drawitem(index)
   self.contents.font.color = drago_item_colors(@data[index])
   if @item_colored
     self.contents.draw_text(32,index * 32, 212, 32, @data[index].name, 0)
   end
end
end

class Window_ShopSell < Window_Selectable
alias_method :drago_itemcolors_drawitem, :draw_item
def draw_item(index)
   drago_itemcolors_drawitem(index)
   self.contents.font.color = drago_item_colors(@data[index])
   if @item_colored
     x = 4 + index % 2 * (288 + 32)
     y = index / 2 * 32
     self.contents.draw_text(x + 28, y, 212, 32, @data[index].name)
   end
end
end

class Window_EquipItem < Window_Selectable
alias_method :drago_itemcolors_drawitem, :draw_item
def draw_item(index)
   drago_itemcolors_drawitem(index)
   self.contents.font.color = drago_item_colors(@data[index])
   if @item_colored
     x = 4 + index % 2 * (288 + 32)
     y = index / 2 * 32
     self.contents.draw_text(x + 28, y, 212, 32, @data[index].name)
   end
end
end 

class Window_Item < Window_Selectable
alias_method :drago_itemcolors_drawitem, :draw_item
def draw_item(index)
   drago_itemcolors_drawitem(index)
   self.contents.font.color = drago_item_colors(@data[index])
   if @item_colored
     x = 4 + index % 2 * (288 + 32)
     y = index / 2 * 32
     self.contents.draw_text(x + 28, y, 212, 32, @data[index].name)
   end
end
end

class Color
  def Color.white(a = 255)
    return Color.new(255, 255, 255, a)
  end
  def Color.black(a = 255)
    return Color.new(0, 0, 0, a)
  end
  def Color.red(a = 255)
    return Color.new(255, 0, 0, a)
  end
  def Color.green(a = 255)
    return Color.new(0, 255, 0, a)
  end
  def Color.blue(a = 255)
    return Color.new(0, 0, 255, a)
  end
  def Color.purple(a = 255)
    return Color.new(255, 0, 255, a)
  end
  def Color.yellow(a = 255)
    return Color.new(255, 255, 0, a)
  end
  def Color.cyan(a = 255)
    return Color.new(0, 255, 255, a)
  end
  def Color.magenta(a = 255)
    return Color.new(255, 255, 0, a)
  end
  def Color.light_gray(a = 255)
    return Color.new(192, 192, 192, a)
  end
  def Color.gray(a = 255)
    return Color.new(128, 128, 128, a)
  end
  def Color.dark_gray(a = 255)
    return Color.new(64, 64, 64, a)
  end
  def Color.pink(a = 255)
    return Color.new(255, 175, 175, a)
  end
  def Color.orange(a = 255)
    return Color.new(255, 200, 0, a)
  end
end
#--------------------------------------------------------------------------
# FOR STCMS
#--------------------------------------------------------------------------
if $stormtronics_cms
  class Window_CMSItem < Window_Selectable
   alias_method :drago_itemcolors_drawitem, :draw_item
    def draw_item(i)
      drago_itemcolors_drawitem(i)
      if @data[i].is_a?(RPG::Item) || @mode == nil
        number = $game_party.item_number(@data[i].id)
        self.contents.font.color = LiTTleDRAgo.ItemColor(@data[i].id)
        if !$game_party.item_can_use?(@data[i].id)
          self.contents.font.color.alpha = 128
        end
      elsif @data[i].is_a?(RPG::Weapon)
        number = $game_party.weapon_number(@data[i].id)
        self.contents.font.color = LiTTleDRAgo.WeaponColor(@data[i].id)
        self.contents.font.color.alpha = 128
      elsif @data[i].is_a?(RPG::Armor)
        number = $game_party.armor_number(@data[i].id)
        self.contents.font.color = LiTTleDRAgo.ArmorColor(@data[i].id)
        self.contents.font.color.alpha = 128
      end
      self.contents.draw_text(32, i*32, 212, 32, @data[i].name, 0)
      self.contents.draw_text(308, i*32, 16, 32, ':', 1)
      self.contents.draw_text(324, i*32, 24, 32, number.to_s, 2)
    end
  end
 
  class Window_EquipmentItem < Window_CMSItem
    alias_method :drago_itemcolors_drawitem, :draw_item
    def draw_item(i)
      drago_itemcolors_drawitem(i)
      case @data[i]
      when RPG::Weapon
        self.contents.font.color = LiTTleDRAgo.WeaponColor(@data[i].id)
        if !@actor.equippable?($data_weapons[@data[i].id])
          self.contents.font.color.alpha = 128
        end
        number = $game_party.weapon_number(@data[i].id)
      when RPG::Armor
        self.contents.font.color = LiTTleDRAgo.ArmorColor(@data[i].id)
        if !@actor.equippable?($data_armors[@data[i].id])
          self.contents.font.color.alpha = 128
        end
        number = $game_party.armor_number(@data[i].id)
      end
      self.contents.draw_text(32, i*32, 212, 32, @data[i].name, 0)
      self.contents.draw_text(308, i*32, 16, 32, ':', 1)
      self.contents.draw_text(324, i*32, 24, 32, number.to_s, 2)
    end
  end
 
  class Window_CMSEquipItem < Window_Selectable
    alias_method :drago_itemcolors_drawitem, :draw_item
    def draw_item(i)
     drago_itemcolors_drawitem(i)
      case @data[i]
      when RPG::Weapon
        number = $game_party.weapon_number(@data[i].id)
        self.contents.font.color = LiTTleDRAgo.WeaponColor(@data[i].id)
      when RPG::Armor
        number = $game_party.armor_number(@data[i].id)
        self.contents.font.color = LiTTleDRAgo.ArmorColor(@data[i].id)
      end
      self.contents.draw_text(32, i*32, 212, 32, @data[i].name, 0)
      self.contents.draw_text(212, i*32, 16, 32, ':', 1)
      self.contents.draw_text(228, i*32, 24, 32, number.to_s, 2)
    end
  end
end
#--------------------------------------------------------------------------
# SDK Check End
#--------------------------------------------------------------------------
end
#--------------------------------------------------------------------------
# END OF SCRIPT
#--------------------------------------------------------------------------
Title: Re: [Xp] Item Art Color
Post by: LiTTleDRAgo on February 06, 2011, 12:44:12 am
my bad, now it's fixed

@storm : that edit still wrong, but thanks anyway
Title: Re: [Xp] Item Art Color
Post by: Taiine on February 06, 2011, 02:39:44 am
Yep, now it looks to work alright :3 Later on I'll dump it on my test game of OMGTHATSALOTOFSCRIPS to test computability issues :3
Title: Re: [Xp] Item Art Color
Post by: G_G on February 06, 2011, 10:48:36 am
Waaaay too much configuration. Its nice but its really not worth all the configuration.
Title: Re: [Xp] Item Art Color
Post by: Ryex on February 06, 2011, 10:41:55 pm
hmm, interesting so you only did this for that alternate configuration method because the other messed with your other scripts....  well in any case it looks complete and the template is good so moaveage for you.
Title: Re: [Xp] Item Art Color
Post by: Starrodkirby86 on February 06, 2011, 11:57:50 pm
Quote from: Ryex on February 06, 2011, 10:41:55 pm
hmm, interesting so you only did this for that alternate configuration method because the other messed with your other scripts....  well in any case it looks complete and the template is good so moaveage for you.




Was the [XP]/[VX] Tag case sensitive?

Well, regardless of that, I just edited it to make it all caps for consistency's sake. :)

The list is going to turn ridiculously long for coloring items. I wonder if grouping them would be possible. o:?

Anyway, wonderful work.
Title: Re: [XP] Item Art Color
Post by: LiTTleDRAgo on February 07, 2011, 12:12:12 am
@^ it is not case sensitive because it's appear in the database

grouping...
like this?

when 2,4,5,9  then return Type('common')
Title: Re: [Xp] Item Art Color
Post by: Blizzard on February 07, 2011, 02:23:12 am
Quote from: Starrodkirby86 on February 06, 2011, 11:57:50 pm
Was the [XP]/[VX] Tag case sensitive?


Yes.

Quote from: LiTTleDRAgo on February 07, 2011, 12:12:12 am
@^ it is not case sensitive because it's appear in the database


That's because the case has been fixed already.

Quote from: LiTTleDRAgo on February 07, 2011, 12:12:12 am
grouping...
like this?

when 2,4,5,9  then return Type('common')



Yes, that works. It will trigger that branch in case of 2, 4, 5 or 9.
Title: Re: [Xp] Item Art Color
Post by: Storm on February 07, 2011, 03:31:43 am
Quote from: LiTTleDRAgo on February 06, 2011, 12:44:12 am
my bad, now it's fixed

@storm : that edit still wrong, but thanks anyway


Sorry, I was only replaced a word by searching a keyword.
I didn't tested it either. :P
Title: Re: [XP] Item Art Color
Post by: Taiine on February 07, 2011, 03:03:15 pm
The grouping would be useful.

By the way. I added this to my OMGTHATSALOTOFSCRIPTS test project and there's no conflicts I've found even with other CMS's that edit the item screen.

I doubted there would be, but never know.
Title: Re: [Xp] Item Art Color
Post by: LiTTleDRAgo on February 08, 2011, 05:24:18 am
Quote from: Blizzard on February 07, 2011, 02:23:12 am
Quote from: Starrodkirby86 on February 06, 2011, 11:57:50 pm
Was the [XP]/[VX] Tag case sensitive?


Yes.

Quote from: LiTTleDRAgo on February 07, 2011, 12:12:12 am
@^ it is not case sensitive because it's appear in the database


That's because the case has been fixed already.


this topic : http://forum.chaos-project.com/index.php/topic,8214.0.html
that script appear in the database but the tag is [Xp] (not [XP])  :???:

Quote from: Taiine on February 07, 2011, 03:03:15 pm
The grouping would be useful.

By the way. I added this to my OMGTHATSALOTOFSCRIPTS test project and there's no conflicts I've found even with other CMS's that edit the item screen.

I doubted there would be, but never know.


glad to hear that :D
Title: Re: [XP] Item Art Color
Post by: SBR* on February 08, 2011, 03:45:11 pm
Okay, I will level you up as promised :D! *level up*

Cya :urgh:!
Title: Re: [Xp] Item Art Color
Post by: Ryex on February 08, 2011, 05:59:40 pm
Quote from: LiTTleDRAgo on February 08, 2011, 05:24:18 am
Quote from: Blizzard on February 07, 2011, 02:23:12 am
Quote from: Starrodkirby86 on February 06, 2011, 11:57:50 pm
Was the [XP]/[VX] Tag case sensitive?


Yes.

Quote from: LiTTleDRAgo on February 07, 2011, 12:12:12 am
@^ it is not case sensitive because it's appear in the database


That's because the case has been fixed already.


this topic : http://forum.chaos-project.com/index.php/topic,8214.0.html
that script appear in the database but the tag is [Xp] (not [XP])  :???:


the script appears in the forum but not in the generated listings
http://www.chaos-project.com/index.php?option=com_scriptdatabase&view=scriptdatabase&Itemid=29 (http://www.chaos-project.com/index.php?option=com_scriptdatabase&view=scriptdatabase&Itemid=29)

fix the tag please
Title: Re: [XP] Item Art Color
Post by: LiTTleDRAgo on February 08, 2011, 10:21:13 pm
fixed
Title: Re: [XP] Item Art Color
Post by: Dweller on April 16, 2012, 08:04:56 am
Littledragon will be posible that your Item Art Color script works with MOG_Scene_Shop?

Spoiler: ShowHide
#_______________________________________________________________________________
# MOG_Scene_Shop  V1.7           
#_______________________________________________________________________________
# By Moghunter   
# http://www.atelier-rgss.com
#_______________________________________________________________________________
module MOG
  #Transition Time.
  MNSHPT= 30
  #Transition Type (Name)
  MNSHPTT= "020-Flat01"
  $Zonadetienda=""

end

#===============================================================================
# Window_Base
#===============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# Draw_item_Name_Ex
#-------------------------------------------------------------------------- 
  def draw_item_name_ex(item, x, y)
    if item == nil
      return
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 28, y, 150, 32, item.name)
   
  end
#--------------------------------------------------------------------------
# Nada
#--------------------------------------------------------------------------
  def nada
    face = RPG::Cache.picture("")
  end
#--------------------------------------------------------------------------
# Drw_face
#--------------------------------------------------------------------------
  def drw_face(actor,x,y)
    face = RPG::Cache.picture(actor.name + "_fc") rescue nada
    cw = face.width
    ch = face.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x , y - ch, face, src_rect)   
  end     
end

#===============================================================================
# Game_Actor
#===============================================================================
class Win_Shop_Sel < Window_Base
  attr_reader   :index                   
#--------------------------------------------------------------------------
# Initialize
#-------------------------------------------------------------------------- 
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @item_max = 1
    @column_max = 1
    @index = -1
  end
#--------------------------------------------------------------------------
# Index
#-------------------------------------------------------------------------- 
  def index=(index)
    @index = index
    update_cursor_rect
  end
#--------------------------------------------------------------------------
# row_max
#-------------------------------------------------------------------------- 
  def row_max
    return (@item_max + @column_max - 1) / @column_max
  end
#--------------------------------------------------------------------------
# Top_Row
#-------------------------------------------------------------------------- 
  def top_row
    return self.oy / 32
  end
#--------------------------------------------------------------------------
# Top_Row(Row)
#-------------------------------------------------------------------------- 
  def top_row=(row)
    if row < 0
      row = 0
    end
    if row > row_max - 1
      row = row_max - 1
    end
    self.oy = row * 32
  end
#--------------------------------------------------------------------------
# Page_Row_Max
#-------------------------------------------------------------------------- 
  def page_row_max
    return (self.height - 32) / 32
  end
#--------------------------------------------------------------------------
# Page_Item_Max
#-------------------------------------------------------------------------- 
  def page_item_max
    return page_row_max * @column_max
  end
#--------------------------------------------------------------------------
# Update_Cursor_Rect
#-------------------------------------------------------------------------- 
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
      return
    end
    row = @index / @column_max
    if row < self.top_row
      self.top_row = row
    end
    if row > self.top_row + (self.page_row_max - 1)
      self.top_row = row - (self.page_row_max - 1)
    end
    cursor_width = self.width / @column_max - 32
    x = @index % @column_max * 80
    y = @index / @column_max * 32 - self.oy
    self.cursor_rect.set(x, y, 32, 32)
  end
#--------------------------------------------------------------------------
# Update
#-------------------------------------------------------------------------- 
  def update
    super
    if self.active and @item_max > 0 and @index >= 0
      if Input.repeat?(Input::RIGHT)
        if @column_max >= 2 and @index < @item_max - 1
          $game_system.se_play($data_system.cursor_se)
          @index += 1
        end
      end
      if Input.repeat?(Input::LEFT)
        if @column_max >= 2 and @index > 0
          $game_system.se_play($data_system.cursor_se)
          @index -= 1
        end
      end     
    end
    update_cursor_rect
  end
end

#===============================================================================
# Window_ShopCommand
#===============================================================================
class Window_ShopCommand < Win_Shop_Sel
#--------------------------------------------------------------------------
# Initialize
#-------------------------------------------------------------------------- 
  def initialize
    super(58, 68, 230, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item_max = 3
    @column_max = 3
    @commands = ["", "", ""]
    self.index = 0
  end
end

#===============================================================================
# Window_ShopBuy
#===============================================================================
class Window_ShopBuy < Window_Selectable
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------   
  def initialize(shop_goods)
    super(-10, 180, 310, 225)
    @shop_goods = shop_goods
    refresh
    self.index = 0
  end
#--------------------------------------------------------------------------
# Ite
#--------------------------------------------------------------------------   
  def item
    return @data[self.index]
  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
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
#--------------------------------------------------------------------------
# Draw_Item
#--------------------------------------------------------------------------   
  def draw_item(index)
    self.contents.font.name = "Georgia"   
    self.contents.font.bold = false   
    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
    y = index * 32   
    if item.price <= $game_party.gold and number < 99
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end   
    rect = Rect.new(x, y, self.width - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 150, 32, item.name, 0)
    self.contents.font.color = Color.new(50,250,150,255)
    self.contents.draw_text(x + 150, y, 88, 32, "G", 1) 
    if item.price <= $game_party.gold
    if number < 99
    self.contents.font.color = Color.new(200,200,50,255)
    else
    self.contents.font.color = disabled_color
    end 
    else
    self.contents.font.color = Color.new(250,100,50,255)
    end       
    self.contents.draw_text(x + 180, y, 88, 32, item.price.to_s, 2)
  end
#--------------------------------------------------------------------------
# Update_Help
#--------------------------------------------------------------------------   
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end

#===============================================================================
# Window_ShopSell
#===============================================================================
class Window_ShopSell < Window_Selectable
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------     
  def initialize
    super(-10, 180, 305, 225)
    @column_max = 1
    refresh
    self.index = 0
  end
#--------------------------------------------------------------------------
# Item
#--------------------------------------------------------------------------     
  def item
    return @data[self.index]
  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
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
#--------------------------------------------------------------------------
# Draw_item
#--------------------------------------------------------------------------     
  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
    if item.price > 0
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    self.contents.font.name = "Georgia"
    x = 4 + index % 1 * (288 + 32)
    y = index / 1 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 150, 32, item.name, 0)
   
    self.contents.draw_text(x + 230, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 240, y, 24, 32, number.to_s, 2)
  end
#--------------------------------------------------------------------------
# Update_Help
#--------------------------------------------------------------------------     
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end

#===============================================================================
# Window_ShopNumber
#===============================================================================
class Window_ShopNumber < Window_Base
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------       
  def initialize
    super(-10, 180, 310, 225)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item = nil
    @max = 1
    @price = 0
    @number = 1
  end
#--------------------------------------------------------------------------
# Set
#--------------------------------------------------------------------------       
  def set(item, max, price)
    @item = item
    @max = max
    @price = price
    @number = 1
    refresh
  end
#--------------------------------------------------------------------------
# Number
#--------------------------------------------------------------------------       
  def number
    return @number
  end
#--------------------------------------------------------------------------
# Refresh
#--------------------------------------------------------------------------       
  def refresh
    self.contents.clear
    self.contents.font.name = "Georgia"
    self.contents.font.bold = true   
    draw_item_name_ex(@item, 4, 66)
    self.contents.font.color = Color.new(50,150,250,255)   
    self.contents.draw_text(185, 66, 32, 32, "x")
    self.contents.font.color = normal_color   
    self.contents.draw_text(208, 66, 24, 32, @number.to_s, 2)
    self.cursor_rect.set(304, 66, 32, 32)
    total_price = @price * @number
    cx = contents.text_size("G").width   
    self.contents.font.color = Color.new(200,200,50,255)
    self.contents.draw_text(4, 160, 228-2, 32, total_price.to_s, 2)
    self.contents.font.color = Color.new(50,250,150,255)
    self.contents.draw_text(90, 160, 88, 32, "G", 1)
   
  end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------       
  def update
    super
    if self.active
      if Input.repeat?(Input::RIGHT) and @number < @max
        $game_system.se_play($data_system.cursor_se)
        @number += 1
        refresh
      end
      if Input.repeat?(Input::LEFT) and @number > 1
        $game_system.se_play($data_system.cursor_se)
        @number -= 1
        refresh
      end
      if Input.repeat?(Input::UP) and @number < @max
        $game_system.se_play($data_system.cursor_se)
        @number = [@number + 10, @max].min
        refresh
      end
      if Input.repeat?(Input::DOWN) and @number > 1
        $game_system.se_play($data_system.cursor_se)
        @number = [@number - 10, 1].max
        refresh
      end
    end
  end
end

#===============================================================================
# Window_ShopStatus
#===============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------         
  def initialize
    super(300, 128, 350, 300)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item = nil
    refresh
  end
#--------------------------------------------------------------------------
# Refresh
#--------------------------------------------------------------------------         
  def refresh
    self.contents.clear
    self.contents.font.name = "Georgia"
    if @item == nil
      return
    end
    if $mog_rgss_Item_Limit != nil
      case @item
        when RPG::Item
          number = $game_party.item_number(@item.id)
          item_max = MOG::ITEM_LIMIT[@item.id]
        when RPG::Weapon
          number = $game_party.weapon_number(@item.id)
          item_max = MOG::WEAPON_LIMIT[@item.id] 
        when RPG::Armor
          number = $game_party.armor_number(@item.id)
          item_max = MOG::ARMOR_LIMIT[@item.id]
    end
    self.contents.font.color = system_color
    self.contents.draw_text(190, 0, 200, 32, "Stock")
    self.contents.font.color = normal_color
    if item_max != nil
      self.contents.draw_text(230, 0, 80, 32, number.to_s + " / " + item_max.to_s, 2)
    else
      max_limit = MOG::DEFAULT_LIMIT
      self.contents.draw_text(230, 0, 80, 32, number.to_s + " / " + max_limit.to_s, 2)
    end     
    else
    case @item
    when RPG::Item
      number = $game_party.item_number(@item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(@item.id)
    when RPG::Armor
      number = $game_party.armor_number(@item.id)
    end
    self.contents.font.color = system_color
    self.contents.draw_text(210, 0, 200, 32, "Stock")
    self.contents.font.color = normal_color
    self.contents.draw_text(245, 0, 32, 32, number.to_s, 2)
    end
    if @item.is_a?(RPG::Item)
      return
    end
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.equippable?(@item)
        self.contents.font.color = normal_color
      else
        self.contents.font.color = disabled_color
      end
      self.contents.draw_text(65, 0, 100, 32, "Equipped", 2)         
      drw_face(actor,0 ,80 + 64 * i)
      if @item.is_a?(RPG::Weapon)
        item1 = $data_weapons[actor.weapon_id]
      elsif @item.kind == 0
        item1 = $data_armors[actor.armor1_id]
      elsif @item.kind == 1
        item1 = $data_armors[actor.armor2_id]
      elsif @item.kind == 2
        item1 = $data_armors[actor.armor3_id]
      else
        item1 = $data_armors[actor.armor4_id]
      end
      if actor.equippable?(@item)
        if @item.is_a?(RPG::Weapon)
          atk1 = item1 != nil ? item1.atk : 0
          atk2 = @item != nil ? @item.atk : 0
          pdef1 = item1 != nil ? item1.pdef : 0
          mdef1 = item1 != nil ? item1.mdef : 0
          pdef2 = @item != nil ? @item.pdef : 0
          mdef2 = @item != nil ? @item.mdef : 0         
        self.contents.draw_text(-20, 50 + 64 * i, 112, 32,"Atk", 2)   
        self.contents.draw_text(70, 50 + 64 * i, 112, 32,"Pdef", 2)   
        self.contents.draw_text(160, 50 + 64 * i, 112, 32,"Mdef", 2)           
        change = atk2 - atk1
        change2 = pdef2 - pdef1
        change3 = mdef2 - mdef1
      if atk2 > atk1
        self.contents.font.color = Color.new(50,250,150,255) 
      elsif atk2 == atk1
        self.contents.font.color = disabled_color
      else
        self.contents.font.color = Color.new(250,100,50,255)   
      end       
      self.contents.draw_text(20, 50 + 64 * i, 112, 32,sprintf("%d", change), 2)   
      if pdef2 > pdef1
        self.contents.font.color = Color.new(50,250,150,255) 
      elsif pdef2 == pdef1
        self.contents.font.color = disabled_color
      else
        self.contents.font.color = Color.new(250,100,50,255)   
      end           
      self.contents.draw_text(110, 50 + 64 * i, 112, 32,sprintf("%d", change2), 2)   
      if mdef2 > mdef1
        self.contents.font.color = Color.new(50,250,150,255) 
      elsif mdef2 == mdef1
        self.contents.font.color = disabled_color
      else
        self.contents.font.color = Color.new(250,100,50,255)   
      end           
      self.contents.draw_text(200, 50 + 64 * i, 112, 32,sprintf("%d", change3), 2)   
      end
      if @item.is_a?(RPG::Armor)
          pdef1 = item1 != nil ? item1.pdef : 0
          mdef1 = item1 != nil ? item1.mdef : 0
          eva1 = item1 != nil ? item1.eva : 0         
          pdef2 = @item != nil ? @item.pdef : 0
          mdef2 = @item != nil ? @item.mdef : 0
          eva2 = @item != nil ? @item.eva : 0         
          change = pdef2 - pdef1
          change2 = mdef2 - mdef1
          change3 = eva2 - eva1         
        self.contents.draw_text(-20, 50 + 64 * i, 112, 32,"Pdef", 2)   
        self.contents.draw_text(70, 50 + 64 * i, 112, 32,"Mdef", 2)   
        self.contents.draw_text(160, 50 + 64 * i, 112, 32,"Eva", 2) 
      if pdef2 > pdef1
        self.contents.font.color = Color.new(50,250,150,255) 
      elsif pdef2 == pdef1
        self.contents.font.color = disabled_color
      else
        self.contents.font.color = Color.new(250,100,50,255)   
      end     
      self.contents.draw_text(20, 50 + 64 * i, 112, 32,sprintf("%d", change), 2)   
      if mdef2 > mdef1
        self.contents.font.color = Color.new(50,250,150,255) 
      elsif mdef2 == mdef1
        self.contents.font.color = disabled_color
      else
        self.contents.font.color = Color.new(250,100,50,255)   
      end           
        self.contents.draw_text(110, 50 + 64 * i, 112, 32,sprintf("%d", change2), 2)         
      if eva2 > eva1
        self.contents.font.color = Color.new(50,250,150,255) 
      elsif eva2 == eva1
        self.contents.font.color = disabled_color
      else
        self.contents.font.color = Color.new(250,100,50,255)   
      end           
        self.contents.draw_text(200, 50 + 64 * i, 112, 32,sprintf("%d", change3), 2)   
      end
      end
      if item1 != nil
      if actor.equippable?(@item)
        self.contents.font.color = normal_color
      else
        self.contents.font.color = disabled_color
      end
        x = 4
        y = 64 + 64 * i
        bitmap = RPG::Cache.icon(item1.icon_name)
        opacity = self.contents.font.color == normal_color ? 255 : 128
        self.contents.blt(x + 50, y - 35, bitmap, Rect.new(0, 0, 24, 24), opacity)
        self.contents.draw_text(x + 75, y - 40, 212, 32, item1.name)
      end
    end
  end
  def item=(item)
    if @item != item
      @item = item
      refresh
    end
  end
end

########################################################################
## DWELLER EDIT TO SHOW ZONE (call $Zonadetienda ="nombre de tienda") ##
########################################################################

class Window_Dweller1 < Window_Base
 
  def initialize
    super(0, 0, 250, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.size = 14
    self.contents.draw_text(65, 17, 250, 32, "Zone: ")
      self.contents.font.color = Color.new(50,250,150,255)
    self.contents.draw_text(95, 17, 250, 32, $Zonadetienda)
     self.contents.font.color = normal_color
  end
 
  def update
    super
   
    refresh
  end
 
end

#===============================================================================
# Scene_Shop
#===============================================================================
class Scene_Shop
#--------------------------------------------------------------------------
# Main
#--------------------------------------------------------------------------       
  def main
    @mshop_zona = Window_Dweller1.new
    @mshop_zona.x = 15
    @mshop_zona.y = 15
    @mshop_zona.opacity=0
    @mshop_zona.visible=true
    @mshop_back = Plane.new
    @mshop_back.bitmap = RPG::Cache.picture("MN_BK2")
    @mshop_back.z = 10
    @mshop_lay = Sprite.new
    @mshop_lay.bitmap = RPG::Cache.picture("Shop_Lay")
    @mshop_lay.z = 15
    @mshop_com = Sprite.new
    @mshop_com.bitmap = RPG::Cache.picture("Shop_Com01")
    @mshop_com.z = 20
    @help_window = Window_Help.new
    @help_window.contents.font.name = "Georgia"
    @help_window.y = 413
    @command_window = Window_ShopCommand.new
    @command_window.visible = false
    @gold_window = Window_Gold.new
    @gold_window.x = 460
    @gold_window.y = -5
    @dummy_window = Window_Base.new(0, 128, 640, 352)
    @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
    @buy_window.active = false
    @buy_window.visible = false
    @buy_window.help_window = @help_window
    @sell_window = Window_ShopSell.new
    @sell_window.active = false
    @sell_window.visible = false
    @sell_window.help_window = @help_window
    @number_window = Window_ShopNumber.new
    @number_window.active = false
    @number_window.visible = false
    @status_window = Window_ShopStatus.new
    @status_window.visible = false
    @help_window.opacity = 0
    @status_window.opacity = 0
    @sell_window.opacity = 0
    @buy_window.opacity = 0
    @gold_window.opacity = 0
    @command_window.opacity = 0
    @number_window.opacity = 0
    @dummy_window.opacity = 0
    Graphics.transition(MOG::MNSHPT, "Graphics/Transitions/" + MOG::MNSHPTT)
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    for i in 0..30
     
      @mshop_back.ox += 1
      @help_window.x -= 15     
      @gold_window.x += 15
      @mshop_lay.zoom_x += 0.1
      @mshop_lay.opacity -= 10
      @command_window.x -= 15
      @mshop_com.x -= 15
      @buy_window.x -= 20
      @sell_window.x -= 20
      Graphics.update 
    end 
    Graphics.freeze
    @mshop_zona.dispose
    @help_window.dispose
    @command_window.dispose
    @gold_window.dispose
    @dummy_window.dispose
    @buy_window.dispose
    @sell_window.dispose
    @number_window.dispose
    @status_window.dispose
    @mshop_back.dispose   
    @mshop_lay.dispose
    @mshop_com.dispose
  end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------         
  def update
    @mshop_back.ox += 1
    if @help_window.x < 0
       @help_window.x += 10
       @help_window.contents_opacity += 10
    elsif @help_window.x >= 0 
      @help_window.x = 0
      @help_window.contents_opacity = 255     
    end 
    if @sell_window.active == true
       @sell_window.visible = true
    if @sell_window.x < -10
       @sell_window.x += 15
       @sell_window.contents_opacity += 10
    elsif @sell_window.x >= -10 
       @sell_window.x = -10
       @sell_window.contents_opacity = 255     
    end 
    else
    if @sell_window.x > -300
       @sell_window.x -= 15
       @sell_window.contents_opacity -= 10
    elsif @sell_window.x <= -300 
       @sell_window.x = -300
       @sell_window.contents_opacity = 0
       @sell_window.visible = false
    end     
    end 
    if @buy_window.active == true
       @buy_window.visible = true
    if @buy_window.x < -10
       @buy_window.x += 15
       @buy_window.contents_opacity += 10
    elsif @buy_window.x >= -10 
       @buy_window.x = -10
       @buy_window.contents_opacity = 255     
    end 
    else
    if @buy_window.x > -300
       @buy_window.x -= 15
       @buy_window.contents_opacity -= 10
    elsif @buy_window.x <= -300 
       @buy_window.x = -300
       @buy_window.contents_opacity = 0
       @buy_window.visible = false
    end     
    end 
    if @number_window.active == true
       @number_window.visible = true
    if @number_window.x < -10
       @number_window.x += 15
       @number_window.contents_opacity += 10
    elsif @number_window.x >= -10 
       @number_window.x = -10
       @number_window.contents_opacity = 255     
    end 
    else
    if @number_window.x > -300
       @number_window.x -= 15
       @number_window.contents_opacity -= 10
    elsif @number_window.x <= -300 
       @number_window.x = -300
       @number_window.contents_opacity = 0
       @number_window.visible = false
    end     
    end 
    if @number_window.active == false
      if Input.trigger?(Input.dir4) or Input.trigger?(Input::C) or
         Input.trigger?(Input::L) or Input.trigger?(Input::R)     
        @help_window.x = -200
        @help_window.contents_opacity = 0
      end
    end
    @help_window.update
    @command_window.update
    @gold_window.update
    @dummy_window.update
    @buy_window.update
    @sell_window.update
    @number_window.update
    @status_window.update
    case @command_window.index
    when 0
      @mshop_com.bitmap = RPG::Cache.picture("Shop_Com01")
    when 1
      @mshop_com.bitmap = RPG::Cache.picture("Shop_Com02")
    when 2
      @mshop_com.bitmap = RPG::Cache.picture("Shop_Com03")
    end
    if @command_window.active
      update_command
      return
    end
    if @buy_window.active
      update_buy
      return
    end
    if @sell_window.active
      update_sell
      return
    end
    if @number_window.active
      update_number
      return
    end
  end
#--------------------------------------------------------------------------
# Update_Command
#--------------------------------------------------------------------------         
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0 
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @dummy_window.visible = false
        @buy_window.active = true
        @buy_window.refresh
        @status_window.visible = true
      when 1
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @dummy_window.visible = false
        @sell_window.active = true
        @sell_window.refresh
      when 2 
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Map.new
      end
      return
    end
  end
#--------------------------------------------------------------------------
# Update Buy
#--------------------------------------------------------------------------         
  def update_buy
    @status_window.item = @buy_window.item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = true
      @dummy_window.visible = true
      @buy_window.active = false
      @status_window.visible = false
      @status_window.item = nil
      @help_window.set_text("")
      return
    end
    if Input.trigger?(Input::C)
      @item = @buy_window.item
      if @item == nil or @item.price > $game_party.gold
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @item
      when RPG::Item
        number = $game_party.item_number(@item.id)
      when RPG::Weapon
        number = $game_party.weapon_number(@item.id)
      when RPG::Armor
        number = $game_party.armor_number(@item.id)
      end
      if number == 99
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      max = @item.price == 0 ? 99 : $game_party.gold / @item.price
      max = [max, 99 - number].min
      @buy_window.active = false
      @number_window.set(@item, max, @item.price)
      @number_window.active = true
    end
  end
#--------------------------------------------------------------------------
# Update Sell
#--------------------------------------------------------------------------         
  def update_sell
    @status_window.item = @sell_window.item
     @status_window.visible = true
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = true
      @dummy_window.visible = true
      @sell_window.active = false
      @status_window.item = nil
      @help_window.set_text("")
      return
    end
    if Input.trigger?(Input::C)
      @item = @sell_window.item
      @status_window.item = @item
      if @item == nil or @item.price == 0
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      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
      max = number
      @sell_window.active = false
      @number_window.set(@item, max, @item.price / 2)
      @number_window.active = true
      @status_window.visible = true
    end
  end
#--------------------------------------------------------------------------
# Update Number
#--------------------------------------------------------------------------         
  def update_number
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @number_window.active = false
      case @command_window.index
      when 0 
        @buy_window.active = true
      when 1
        @sell_window.active = true
        @status_window.visible = false
      end
      return
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.shop_se)
      @number_window.active = false
      case @command_window.index
      when 0
        $game_party.lose_gold(@number_window.number * @item.price)
        case @item
        when RPG::Item
          $game_party.gain_item(@item.id, @number_window.number)
        when RPG::Weapon
          $game_party.gain_weapon(@item.id, @number_window.number)
        when RPG::Armor
          $game_party.gain_armor(@item.id, @number_window.number)
        end
        @gold_window.refresh
        @buy_window.refresh
        @status_window.refresh
        @buy_window.active = true
      when 1
        $game_party.gain_gold(@number_window.number * (@item.price / 2))
        case @item
        when RPG::Item
          $game_party.lose_item(@item.id, @number_window.number)
        when RPG::Weapon
          $game_party.lose_weapon(@item.id, @number_window.number)
        when RPG::Armor
          $game_party.lose_armor(@item.id, @number_window.number)
        end
        @gold_window.refresh
        @sell_window.refresh
        @status_window.refresh
        @sell_window.active = true
        @status_window.visible = false
      end
      return
    end
  end
end

$mog_rgss_Scene_Shop = true


I´m using both scripts with no errors but on Mog shop windows all items are in white color.
Title: Re: [XP] Item Art Color
Post by: LiTTleDRAgo on April 17, 2012, 04:00:57 am
try replace mog scene shop and place it below item art color script

Spoiler: ShowHide
#_______________________________________________________________________________
# MOG_Scene_Shop  V1.7           
#_______________________________________________________________________________
# By Moghunter   
# http://www.atelier-rgss.com
#_______________________________________________________________________________
module MOG
  #Transition Time.
  MNSHPT= 30
  #Transition Type (Name)
  MNSHPTT= "020-Flat01"
  $Zonadetienda=""

end

#===============================================================================
# Window_Base
#===============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# Draw_item_Name_Ex
#-------------------------------------------------------------------------- 
  def draw_item_name_ex(item, x, y)
    if item == nil
      return
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    self.contents.font.color = normal_color
    self.contents.draw_text(x + 28, y, 150, 32, item.name)
   
  end
#--------------------------------------------------------------------------
# Nada
#--------------------------------------------------------------------------
  def nada
    face = RPG::Cache.picture("")
  end
#--------------------------------------------------------------------------
# Drw_face
#--------------------------------------------------------------------------
  def drw_face(actor,x,y)
    face = RPG::Cache.picture(actor.name + "_fc") rescue nada
    cw = face.width
    ch = face.height
    src_rect = Rect.new(0, 0, cw, ch)
    self.contents.blt(x , y - ch, face, src_rect)   
  end     
end

#===============================================================================
# Game_Actor
#===============================================================================
class Win_Shop_Sel < Window_Base
  attr_reader   :index                   
#--------------------------------------------------------------------------
# Initialize
#-------------------------------------------------------------------------- 
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @item_max = 1
    @column_max = 1
    @index = -1
  end
#--------------------------------------------------------------------------
# Index
#-------------------------------------------------------------------------- 
  def index=(index)
    @index = index
    update_cursor_rect
  end
#--------------------------------------------------------------------------
# row_max
#-------------------------------------------------------------------------- 
  def row_max
    return (@item_max + @column_max - 1) / @column_max
  end
#--------------------------------------------------------------------------
# Top_Row
#-------------------------------------------------------------------------- 
  def top_row
    return self.oy / 32
  end
#--------------------------------------------------------------------------
# Top_Row(Row)
#-------------------------------------------------------------------------- 
  def top_row=(row)
    if row < 0
      row = 0
    end
    if row > row_max - 1
      row = row_max - 1
    end
    self.oy = row * 32
  end
#--------------------------------------------------------------------------
# Page_Row_Max
#-------------------------------------------------------------------------- 
  def page_row_max
    return (self.height - 32) / 32
  end
#--------------------------------------------------------------------------
# Page_Item_Max
#-------------------------------------------------------------------------- 
  def page_item_max
    return page_row_max * @column_max
  end
#--------------------------------------------------------------------------
# Update_Cursor_Rect
#-------------------------------------------------------------------------- 
  def update_cursor_rect
    if @index < 0
      self.cursor_rect.empty
      return
    end
    row = @index / @column_max
    if row < self.top_row
      self.top_row = row
    end
    if row > self.top_row + (self.page_row_max - 1)
      self.top_row = row - (self.page_row_max - 1)
    end
    cursor_width = self.width / @column_max - 32
    x = @index % @column_max * 80
    y = @index / @column_max * 32 - self.oy
    self.cursor_rect.set(x, y, 32, 32)
  end
#--------------------------------------------------------------------------
# Update
#-------------------------------------------------------------------------- 
  def update
    super
    if self.active and @item_max > 0 and @index >= 0
      if Input.repeat?(Input::RIGHT)
        if @column_max >= 2 and @index < @item_max - 1
          $game_system.se_play($data_system.cursor_se)
          @index += 1
        end
      end
      if Input.repeat?(Input::LEFT)
        if @column_max >= 2 and @index > 0
          $game_system.se_play($data_system.cursor_se)
          @index -= 1
        end
      end     
    end
    update_cursor_rect
  end
end

#===============================================================================
# Window_ShopCommand
#===============================================================================
class Window_ShopCommand < Win_Shop_Sel
#--------------------------------------------------------------------------
# Initialize
#-------------------------------------------------------------------------- 
  def initialize
    super(58, 68, 230, 64)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item_max = 3
    @column_max = 3
    @commands = ["", "", ""]
    self.index = 0
  end
end

#===============================================================================
# Window_ShopBuy
#===============================================================================
class Window_ShopBuy < Window_Selectable
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------   
  def initialize(shop_goods)
    super(-10, 180, 310, 225)
    @shop_goods = shop_goods
    refresh
    self.index = 0
  end
#--------------------------------------------------------------------------
# Ite
#--------------------------------------------------------------------------   
  def item
    return @data[self.index]
  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
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
#--------------------------------------------------------------------------
# Draw_Item
#--------------------------------------------------------------------------   
  def draw_item(index)
    self.contents.font.name = "Georgia"   
    self.contents.font.bold = false   
    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
    y = index * 32   
    if item.price <= $game_party.gold and number < 99
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end   
    rect = Rect.new(x, y, self.width - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.font.color = drago_item_colors(@data[index])
    self.contents.draw_text(x + 28, y, 150, 32, item.name, 0)
    self.contents.font.color = Color.new(50,250,150,255)
    self.contents.draw_text(x + 150, y, 88, 32, "G", 1) 
    if item.price <= $game_party.gold
    if number < 99
    self.contents.font.color = Color.new(200,200,50,255)
    else
    self.contents.font.color = disabled_color
    end 
    else
    self.contents.font.color = Color.new(250,100,50,255)
    end       
    self.contents.draw_text(x + 180, y, 88, 32, item.price.to_s, 2)
  end
#--------------------------------------------------------------------------
# Update_Help
#--------------------------------------------------------------------------   
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end

#===============================================================================
# Window_ShopSell
#===============================================================================
class Window_ShopSell < Window_Selectable
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------     
  def initialize
    super(-10, 180, 305, 225)
    @column_max = 1
    refresh
    self.index = 0
  end
#--------------------------------------------------------------------------
# Item
#--------------------------------------------------------------------------     
  def item
    return @data[self.index]
  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
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
#--------------------------------------------------------------------------
# Draw_item
#--------------------------------------------------------------------------     
  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
    if item.price > 0
      self.contents.font.color = normal_color
    else
      self.contents.font.color = disabled_color
    end
    self.contents.font.name = "Georgia"
    x = 4 + index % 1 * (288 + 32)
    y = index / 1 * 32
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon(item.icon_name)
    opacity = self.contents.font.color == normal_color ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
   
    self.contents.draw_text(x + 230, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 240, y, 24, 32, number.to_s, 2)
   self.contents.font.color = drago_item_colors(@data[index])
    self.contents.draw_text(x + 28, y, 150, 32, item.name, 0)
  end
#--------------------------------------------------------------------------
# Update_Help
#--------------------------------------------------------------------------     
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end

#===============================================================================
# Window_ShopNumber
#===============================================================================
class Window_ShopNumber < Window_Base
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------       
  def initialize
    super(-10, 180, 310, 225)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item = nil
    @max = 1
    @price = 0
    @number = 1
  end
#--------------------------------------------------------------------------
# Set
#--------------------------------------------------------------------------       
  def set(item, max, price)
    @item = item
    @max = max
    @price = price
    @number = 1
    refresh
  end
#--------------------------------------------------------------------------
# Number
#--------------------------------------------------------------------------       
  def number
    return @number
  end
#--------------------------------------------------------------------------
# Refresh
#--------------------------------------------------------------------------       
  def refresh
    self.contents.clear
    self.contents.font.name = "Georgia"
    self.contents.font.bold = true   
    draw_item_name_ex(@item, 4, 66)
    self.contents.font.color = Color.new(50,150,250,255)   
    self.contents.draw_text(185, 66, 32, 32, "x")
    self.contents.font.color = normal_color   
    self.contents.draw_text(208, 66, 24, 32, @number.to_s, 2)
    self.cursor_rect.set(304, 66, 32, 32)
    total_price = @price * @number
    cx = contents.text_size("G").width   
    self.contents.font.color = Color.new(200,200,50,255)
    self.contents.draw_text(4, 160, 228-2, 32, total_price.to_s, 2)
    self.contents.font.color = Color.new(50,250,150,255)
    self.contents.draw_text(90, 160, 88, 32, "G", 1)
   
  end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------       
  def update
    super
    if self.active
      if Input.repeat?(Input::RIGHT) and @number < @max
        $game_system.se_play($data_system.cursor_se)
        @number += 1
        refresh
      end
      if Input.repeat?(Input::LEFT) and @number > 1
        $game_system.se_play($data_system.cursor_se)
        @number -= 1
        refresh
      end
      if Input.repeat?(Input::UP) and @number < @max
        $game_system.se_play($data_system.cursor_se)
        @number = [@number + 10, @max].min
        refresh
      end
      if Input.repeat?(Input::DOWN) and @number > 1
        $game_system.se_play($data_system.cursor_se)
        @number = [@number - 10, 1].max
        refresh
      end
    end
  end
end

#===============================================================================
# Window_ShopStatus
#===============================================================================
class Window_ShopStatus < Window_Base
#--------------------------------------------------------------------------
# Initialize
#--------------------------------------------------------------------------         
  def initialize
    super(300, 128, 350, 300)
    self.contents = Bitmap.new(width - 32, height - 32)
    @item = nil
    refresh
  end
#--------------------------------------------------------------------------
# Refresh
#--------------------------------------------------------------------------         
  def refresh
    self.contents.clear
    self.contents.font.name = "Georgia"
    if @item == nil
      return
    end
    if $mog_rgss_Item_Limit != nil
      case @item
        when RPG::Item
          number = $game_party.item_number(@item.id)
          item_max = MOG::ITEM_LIMIT[@item.id]
        when RPG::Weapon
          number = $game_party.weapon_number(@item.id)
          item_max = MOG::WEAPON_LIMIT[@item.id] 
        when RPG::Armor
          number = $game_party.armor_number(@item.id)
          item_max = MOG::ARMOR_LIMIT[@item.id]
    end
    self.contents.font.color = system_color
    self.contents.draw_text(190, 0, 200, 32, "Stock")
    self.contents.font.color = normal_color
    if item_max != nil
      self.contents.draw_text(230, 0, 80, 32, number.to_s + " / " + item_max.to_s, 2)
    else
      max_limit = MOG::DEFAULT_LIMIT
      self.contents.draw_text(230, 0, 80, 32, number.to_s + " / " + max_limit.to_s, 2)
    end     
    else
    case @item
    when RPG::Item
      number = $game_party.item_number(@item.id)
    when RPG::Weapon
      number = $game_party.weapon_number(@item.id)
    when RPG::Armor
      number = $game_party.armor_number(@item.id)
    end
    self.contents.font.color = system_color
    self.contents.draw_text(210, 0, 200, 32, "Stock")
    self.contents.font.color = normal_color
    self.contents.draw_text(245, 0, 32, 32, number.to_s, 2)
    end
    if @item.is_a?(RPG::Item)
      return
    end
    for i in 0...$game_party.actors.size
      actor = $game_party.actors[i]
      if actor.equippable?(@item)
        self.contents.font.color = normal_color
      else
        self.contents.font.color = disabled_color
      end
      self.contents.draw_text(65, 0, 100, 32, "Equipped", 2)         
      drw_face(actor,0 ,80 + 64 * i)
      if @item.is_a?(RPG::Weapon)
        item1 = $data_weapons[actor.weapon_id]
      elsif @item.kind == 0
        item1 = $data_armors[actor.armor1_id]
      elsif @item.kind == 1
        item1 = $data_armors[actor.armor2_id]
      elsif @item.kind == 2
        item1 = $data_armors[actor.armor3_id]
      else
        item1 = $data_armors[actor.armor4_id]
      end
      if actor.equippable?(@item)
        if @item.is_a?(RPG::Weapon)
          atk1 = item1 != nil ? item1.atk : 0
          atk2 = @item != nil ? @item.atk : 0
          pdef1 = item1 != nil ? item1.pdef : 0
          mdef1 = item1 != nil ? item1.mdef : 0
          pdef2 = @item != nil ? @item.pdef : 0
          mdef2 = @item != nil ? @item.mdef : 0         
        self.contents.draw_text(-20, 50 + 64 * i, 112, 32,"Atk", 2)   
        self.contents.draw_text(70, 50 + 64 * i, 112, 32,"Pdef", 2)   
        self.contents.draw_text(160, 50 + 64 * i, 112, 32,"Mdef", 2)           
        change = atk2 - atk1
        change2 = pdef2 - pdef1
        change3 = mdef2 - mdef1
      if atk2 > atk1
        self.contents.font.color = Color.new(50,250,150,255) 
      elsif atk2 == atk1
        self.contents.font.color = disabled_color
      else
        self.contents.font.color = Color.new(250,100,50,255)   
      end       
      self.contents.draw_text(20, 50 + 64 * i, 112, 32,sprintf("%d", change), 2)   
      if pdef2 > pdef1
        self.contents.font.color = Color.new(50,250,150,255) 
      elsif pdef2 == pdef1
        self.contents.font.color = disabled_color
      else
        self.contents.font.color = Color.new(250,100,50,255)   
      end           
      self.contents.draw_text(110, 50 + 64 * i, 112, 32,sprintf("%d", change2), 2)   
      if mdef2 > mdef1
        self.contents.font.color = Color.new(50,250,150,255) 
      elsif mdef2 == mdef1
        self.contents.font.color = disabled_color
      else
        self.contents.font.color = Color.new(250,100,50,255)   
      end           
      self.contents.draw_text(200, 50 + 64 * i, 112, 32,sprintf("%d", change3), 2)   
      end
      if @item.is_a?(RPG::Armor)
          pdef1 = item1 != nil ? item1.pdef : 0
          mdef1 = item1 != nil ? item1.mdef : 0
          eva1 = item1 != nil ? item1.eva : 0         
          pdef2 = @item != nil ? @item.pdef : 0
          mdef2 = @item != nil ? @item.mdef : 0
          eva2 = @item != nil ? @item.eva : 0         
          change = pdef2 - pdef1
          change2 = mdef2 - mdef1
          change3 = eva2 - eva1         
        self.contents.draw_text(-20, 50 + 64 * i, 112, 32,"Pdef", 2)   
        self.contents.draw_text(70, 50 + 64 * i, 112, 32,"Mdef", 2)   
        self.contents.draw_text(160, 50 + 64 * i, 112, 32,"Eva", 2) 
      if pdef2 > pdef1
        self.contents.font.color = Color.new(50,250,150,255) 
      elsif pdef2 == pdef1
        self.contents.font.color = disabled_color
      else
        self.contents.font.color = Color.new(250,100,50,255)   
      end     
      self.contents.draw_text(20, 50 + 64 * i, 112, 32,sprintf("%d", change), 2)   
      if mdef2 > mdef1
        self.contents.font.color = Color.new(50,250,150,255) 
      elsif mdef2 == mdef1
        self.contents.font.color = disabled_color
      else
        self.contents.font.color = Color.new(250,100,50,255)   
      end           
        self.contents.draw_text(110, 50 + 64 * i, 112, 32,sprintf("%d", change2), 2)         
      if eva2 > eva1
        self.contents.font.color = Color.new(50,250,150,255) 
      elsif eva2 == eva1
        self.contents.font.color = disabled_color
      else
        self.contents.font.color = Color.new(250,100,50,255)   
      end           
        self.contents.draw_text(200, 50 + 64 * i, 112, 32,sprintf("%d", change3), 2)   
      end
      end
      if item1 != nil
      if actor.equippable?(@item)
        self.contents.font.color = normal_color
      else
        self.contents.font.color = disabled_color
      end
        x = 4
        y = 64 + 64 * i
        bitmap = RPG::Cache.icon(item1.icon_name)
        opacity = self.contents.font.color == normal_color ? 255 : 128
        self.contents.blt(x + 50, y - 35, bitmap, Rect.new(0, 0, 24, 24), opacity)
       self.contents.font.color = drago_item_colors(item1)
        self.contents.draw_text(x + 75, y - 40, 212, 32, item1.name)
      end
    end
  end
  def item=(item)
    if @item != item
      @item = item
      refresh
    end
  end
end

########################################################################
## DWELLER EDIT TO SHOW ZONE (call $Zonadetienda ="nombre de tienda") ##
########################################################################

class Window_Dweller1 < Window_Base
 
  def initialize
    super(0, 0, 250, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
 
  def refresh
    self.contents.clear
    self.contents.font.color = normal_color
    self.contents.font.size = 14
    self.contents.draw_text(65, 17, 250, 32, "Zone: ")
      self.contents.font.color = Color.new(50,250,150,255)
    self.contents.draw_text(95, 17, 250, 32, $Zonadetienda)
     self.contents.font.color = normal_color
  end
 
  def update
    super
   
    refresh
  end
 
end

#===============================================================================
# Scene_Shop
#===============================================================================
class Scene_Shop
#--------------------------------------------------------------------------
# Main
#--------------------------------------------------------------------------       
  def main
    @mshop_zona = Window_Dweller1.new
    @mshop_zona.x = 15
    @mshop_zona.y = 15
    @mshop_zona.opacity=0
    @mshop_zona.visible=true
    @mshop_back = Plane.new
    @mshop_back.bitmap = RPG::Cache.picture("MN_BK2")
    @mshop_back.z = 10
    @mshop_lay = Sprite.new
    @mshop_lay.bitmap = RPG::Cache.picture("Shop_Lay")
    @mshop_lay.z = 15
    @mshop_com = Sprite.new
    @mshop_com.bitmap = RPG::Cache.picture("Shop_Com01")
    @mshop_com.z = 20
    @help_window = Window_Help.new
    @help_window.contents.font.name = "Georgia"
    @help_window.y = 413
    @command_window = Window_ShopCommand.new
    @command_window.visible = false
    @gold_window = Window_Gold.new
    @gold_window.x = 460
    @gold_window.y = -5
    @dummy_window = Window_Base.new(0, 128, 640, 352)
    @buy_window = Window_ShopBuy.new($game_temp.shop_goods)
    @buy_window.active = false
    @buy_window.visible = false
    @buy_window.help_window = @help_window
    @sell_window = Window_ShopSell.new
    @sell_window.active = false
    @sell_window.visible = false
    @sell_window.help_window = @help_window
    @number_window = Window_ShopNumber.new
    @number_window.active = false
    @number_window.visible = false
    @status_window = Window_ShopStatus.new
    @status_window.visible = false
    @help_window.opacity = 0
    @status_window.opacity = 0
    @sell_window.opacity = 0
    @buy_window.opacity = 0
    @gold_window.opacity = 0
    @command_window.opacity = 0
    @number_window.opacity = 0
    @dummy_window.opacity = 0
    Graphics.transition(MOG::MNSHPT, "Graphics/Transitions/" + MOG::MNSHPTT)
    loop do
      Graphics.update
      Input.update
      update
      if $scene != self
        break
      end
    end
    for i in 0..30
     
      @mshop_back.ox += 1
      @help_window.x -= 15     
      @gold_window.x += 15
      @mshop_lay.zoom_x += 0.1
      @mshop_lay.opacity -= 10
      @command_window.x -= 15
      @mshop_com.x -= 15
      @buy_window.x -= 20
      @sell_window.x -= 20
      Graphics.update 
    end 
    Graphics.freeze
    @mshop_zona.dispose
    @help_window.dispose
    @command_window.dispose
    @gold_window.dispose
    @dummy_window.dispose
    @buy_window.dispose
    @sell_window.dispose
    @number_window.dispose
    @status_window.dispose
    @mshop_back.dispose   
    @mshop_lay.dispose
    @mshop_com.dispose
  end
#--------------------------------------------------------------------------
# Update
#--------------------------------------------------------------------------         
  def update
    @mshop_back.ox += 1
    if @help_window.x < 0
       @help_window.x += 10
       @help_window.contents_opacity += 10
    elsif @help_window.x >= 0 
      @help_window.x = 0
      @help_window.contents_opacity = 255     
    end 
    if @sell_window.active == true
       @sell_window.visible = true
    if @sell_window.x < -10
       @sell_window.x += 15
       @sell_window.contents_opacity += 10
    elsif @sell_window.x >= -10 
       @sell_window.x = -10
       @sell_window.contents_opacity = 255     
    end 
    else
    if @sell_window.x > -300
       @sell_window.x -= 15
       @sell_window.contents_opacity -= 10
    elsif @sell_window.x <= -300 
       @sell_window.x = -300
       @sell_window.contents_opacity = 0
       @sell_window.visible = false
    end     
    end 
    if @buy_window.active == true
       @buy_window.visible = true
    if @buy_window.x < -10
       @buy_window.x += 15
       @buy_window.contents_opacity += 10
    elsif @buy_window.x >= -10 
       @buy_window.x = -10
       @buy_window.contents_opacity = 255     
    end 
    else
    if @buy_window.x > -300
       @buy_window.x -= 15
       @buy_window.contents_opacity -= 10
    elsif @buy_window.x <= -300 
       @buy_window.x = -300
       @buy_window.contents_opacity = 0
       @buy_window.visible = false
    end     
    end 
    if @number_window.active == true
       @number_window.visible = true
    if @number_window.x < -10
       @number_window.x += 15
       @number_window.contents_opacity += 10
    elsif @number_window.x >= -10 
       @number_window.x = -10
       @number_window.contents_opacity = 255     
    end 
    else
    if @number_window.x > -300
       @number_window.x -= 15
       @number_window.contents_opacity -= 10
    elsif @number_window.x <= -300 
       @number_window.x = -300
       @number_window.contents_opacity = 0
       @number_window.visible = false
    end     
    end 
    if @number_window.active == false
      if Input.trigger?(Input.dir4) or Input.trigger?(Input::C) or
         Input.trigger?(Input::L) or Input.trigger?(Input::R)     
        @help_window.x = -200
        @help_window.contents_opacity = 0
      end
    end
    @help_window.update
    @command_window.update
    @gold_window.update
    @dummy_window.update
    @buy_window.update
    @sell_window.update
    @number_window.update
    @status_window.update
    case @command_window.index
    when 0
      @mshop_com.bitmap = RPG::Cache.picture("Shop_Com01")
    when 1
      @mshop_com.bitmap = RPG::Cache.picture("Shop_Com02")
    when 2
      @mshop_com.bitmap = RPG::Cache.picture("Shop_Com03")
    end
    if @command_window.active
      update_command
      return
    end
    if @buy_window.active
      update_buy
      return
    end
    if @sell_window.active
      update_sell
      return
    end
    if @number_window.active
      update_number
      return
    end
  end
#--------------------------------------------------------------------------
# Update_Command
#--------------------------------------------------------------------------         
  def update_command
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      $scene = Scene_Map.new
      return
    end
    if Input.trigger?(Input::C)
      case @command_window.index
      when 0 
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @dummy_window.visible = false
        @buy_window.active = true
        @buy_window.refresh
        @status_window.visible = true
      when 1
        $game_system.se_play($data_system.decision_se)
        @command_window.active = false
        @dummy_window.visible = false
        @sell_window.active = true
        @sell_window.refresh
      when 2 
        $game_system.se_play($data_system.decision_se)
        $scene = Scene_Map.new
      end
      return
    end
  end
#--------------------------------------------------------------------------
# Update Buy
#--------------------------------------------------------------------------         
  def update_buy
    @status_window.item = @buy_window.item
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = true
      @dummy_window.visible = true
      @buy_window.active = false
      @status_window.visible = false
      @status_window.item = nil
      @help_window.set_text("")
      return
    end
    if Input.trigger?(Input::C)
      @item = @buy_window.item
      if @item == nil or @item.price > $game_party.gold
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      case @item
      when RPG::Item
        number = $game_party.item_number(@item.id)
      when RPG::Weapon
        number = $game_party.weapon_number(@item.id)
      when RPG::Armor
        number = $game_party.armor_number(@item.id)
      end
      if number == 99
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      max = @item.price == 0 ? 99 : $game_party.gold / @item.price
      max = [max, 99 - number].min
      @buy_window.active = false
      @number_window.set(@item, max, @item.price)
      @number_window.active = true
    end
  end
#--------------------------------------------------------------------------
# Update Sell
#--------------------------------------------------------------------------         
  def update_sell
    @status_window.item = @sell_window.item
     @status_window.visible = true
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @command_window.active = true
      @dummy_window.visible = true
      @sell_window.active = false
      @status_window.item = nil
      @help_window.set_text("")
      return
    end
    if Input.trigger?(Input::C)
      @item = @sell_window.item
      @status_window.item = @item
      if @item == nil or @item.price == 0
        $game_system.se_play($data_system.buzzer_se)
        return
      end
      $game_system.se_play($data_system.decision_se)
      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
      max = number
      @sell_window.active = false
      @number_window.set(@item, max, @item.price / 2)
      @number_window.active = true
      @status_window.visible = true
    end
  end
#--------------------------------------------------------------------------
# Update Number
#--------------------------------------------------------------------------         
  def update_number
    if Input.trigger?(Input::B)
      $game_system.se_play($data_system.cancel_se)
      @number_window.active = false
      case @command_window.index
      when 0 
        @buy_window.active = true
      when 1
        @sell_window.active = true
        @status_window.visible = false
      end
      return
    end
    if Input.trigger?(Input::C)
      $game_system.se_play($data_system.shop_se)
      @number_window.active = false
      case @command_window.index
      when 0
        $game_party.lose_gold(@number_window.number * @item.price)
        case @item
        when RPG::Item
          $game_party.gain_item(@item.id, @number_window.number)
        when RPG::Weapon
          $game_party.gain_weapon(@item.id, @number_window.number)
        when RPG::Armor
          $game_party.gain_armor(@item.id, @number_window.number)
        end
        @gold_window.refresh
        @buy_window.refresh
        @status_window.refresh
        @buy_window.active = true
      when 1
        $game_party.gain_gold(@number_window.number * (@item.price / 2))
        case @item
        when RPG::Item
          $game_party.lose_item(@item.id, @number_window.number)
        when RPG::Weapon
          $game_party.lose_weapon(@item.id, @number_window.number)
        when RPG::Armor
          $game_party.lose_armor(@item.id, @number_window.number)
        end
        @gold_window.refresh
        @sell_window.refresh
        @status_window.refresh
        @sell_window.active = true
        @status_window.visible = false
      end
      return
    end
  end
end

$mog_rgss_Scene_Shop = true


I didn't have rmxp right now, so I'll look at it later
Title: Re: [XP] Item Art Color
Post by: Dweller on April 17, 2012, 06:13:47 am
Solved thanks, just was the script order ;)
Title: Re: [XP] Item Art Color
Post by: LiTTleDRAgo on April 17, 2012, 11:51:14 am
update to 1.20

compacting the script~
Title: Re: [XP][VX][VXA] Item Art Color
Post by: Kiwa on March 17, 2013, 08:28:43 am
I tried this one out just for kicks. i had game guys color system but it didn't color names in your item system.
I like both a lot.. but anyway here is what i found.

on line 92
   drago_drawitemname(item, x, y,enabled)

"Wrong number of arguments(4 of 3)"

Shops are ok but the equip and status are not is not.

i made the line a #comment and it solved the error.
but it no longer drew the icons in the equip and status pages.
Title: Re: [XP][VX][VXA] Item Art Color
Post by: LiTTleDRAgo on March 17, 2013, 09:18:09 am
script updated