Author Topic: [XP][VX][VXA] Item Art Color  (Read 9778 times)

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
[XP][VX][VXA] Item Art Color
« on: February 02, 2011, 03:51:44 AM »
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 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

  • Screenshot will explain

Screenshots

(click to show/hide)

Demo

---

Script

Here

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

  • LiTTleDRAgo
  • game_guy
  • mroedesigns
  • Leongon

Author's Notes

Enjoy ~
« Last Edit: September 23, 2013, 08:04:56 PM by LiTTleDRAgo »

Offline SBR*

  • Chaos User
  • ******
  • Posts: 1195
  • LV: -7
  • Gender: Male
    • View Profile
Re: [Xp] Item Art Color
« Reply #1 on: February 02, 2011, 12:11:48 PM »
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.
« Last Edit: February 02, 2011, 09:41:58 PM by SBR* »

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [Xp] Item Art Color
« Reply #2 on: February 02, 2011, 02:59:40 PM »
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

Offline Taiine

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 14
  • Gender: Female
    • View Profile
Re: [Xp] Item Art Color
« Reply #3 on: February 06, 2011, 05:22:19 AM »
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.


Offline Storm

  • Awakened Visionist
  • **
  • Posts: 62
  • LV: 0
  • THE ORION ROCKS!
    • View Profile
    • The Orion Forum
Re: [Xp] Item Art Color
« Reply #4 on: February 06, 2011, 05:52:29 AM »
Nice idea Dragon! :haha:

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.



Try this one out:
Code: [Select]
#:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=:=
# 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
#--------------------------------------------------------------------------
I was working on the game called The Orion.
It would be nice if you can join our small community by sharing a little by little scripts/ideas at The Orion Forum

I am: RPG Maker XP Scripter
Project Working On: The Orion MMORPG Game, visit The Orion Forum for more information!
Visit my: Deviantart

LEVEL ME UP OR ELSE LEVEL ME DOWN, IT'S EASY! XD


Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [Xp] Item Art Color
« Reply #5 on: February 06, 2011, 07:44:12 AM »
my bad, now it's fixed

@storm : that edit still wrong, but thanks anyway

Offline Taiine

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 14
  • Gender: Female
    • View Profile
Re: [Xp] Item Art Color
« Reply #6 on: February 06, 2011, 09: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

Offline G_G

  • Green Gmod Game_Guy AKA G4 AKA hyper-G AKA G-force
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 6585
  • LV: 407
  • Gender: Male
    • View Profile
Re: [Xp] Item Art Color
« Reply #7 on: February 06, 2011, 05:48:36 PM »
Waaaay too much configuration. Its nice but its really not worth all the configuration.

Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5131
  • LV: 197
  • Gender: Male
  • Wants to write a compiler for fun
    • View Profile
Re: [Xp] Item Art Color
« Reply #8 on: February 07, 2011, 05:41:55 AM »
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.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline Starrodkirby86

  • Kirby de Varita Estelar
  • Guardian of Chaos
  • ********
  • Posts: 3282
  • LV: 194
  • Gender: Male
  • ~!
    • View Profile
    • The Archive of Starrodkirby86
Re: [Xp] Item Art Color
« Reply #9 on: February 07, 2011, 06:57:50 AM »
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.

What's osu!? It's a rhythm game. Thought I should have a signature with a working rank. ;P It's now clickable!
Still Aqua's biggest fan (Or am I?).



Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Item Art Color
« Reply #10 on: February 07, 2011, 07:12:12 AM »
@^ it is not case sensitive because it's appear in the database

grouping...
like this?

Code: [Select]
when 2,4,5,9  then return Type('common')

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19929
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [Xp] Item Art Color
« Reply #11 on: February 07, 2011, 09:23:12 AM »
Was the [XP]/[VX] Tag case sensitive?

Yes.

@^ it is not case sensitive because it's appear in the database

That's because the case has been fixed already.

grouping...
like this?

Code: [Select]
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.
« Last Edit: February 07, 2011, 09:24:52 AM by Blizzard »
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.

Offline Storm

  • Awakened Visionist
  • **
  • Posts: 62
  • LV: 0
  • THE ORION ROCKS!
    • View Profile
    • The Orion Forum
Re: [Xp] Item Art Color
« Reply #12 on: February 07, 2011, 10:31:43 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
I was working on the game called The Orion.
It would be nice if you can join our small community by sharing a little by little scripts/ideas at The Orion Forum

I am: RPG Maker XP Scripter
Project Working On: The Orion MMORPG Game, visit The Orion Forum for more information!
Visit my: Deviantart

LEVEL ME UP OR ELSE LEVEL ME DOWN, IT'S EASY! XD


Offline Taiine

  • Ethereal Devastator
  • ****
  • Posts: 311
  • LV: 14
  • Gender: Female
    • View Profile
Re: [XP] Item Art Color
« Reply #13 on: February 07, 2011, 10: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.

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [Xp] Item Art Color
« Reply #14 on: February 08, 2011, 12:24:18 PM »
Was the [XP]/[VX] Tag case sensitive?

Yes.

@^ 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 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
« Last Edit: February 08, 2011, 12:26:05 PM by LiTTleDRAgo »

Offline SBR*

  • Chaos User
  • ******
  • Posts: 1195
  • LV: -7
  • Gender: Male
    • View Profile
Re: [XP] Item Art Color
« Reply #15 on: February 08, 2011, 10:45:11 PM »
Okay, I will level you up as promised :D! *level up*

Cya :urgh:!

Offline Ryex

  • Arctic Bird of Programming
  • Global Moderator
  • Chaos Ultimate
  • ****
  • Posts: 5131
  • LV: 197
  • Gender: Male
  • Wants to write a compiler for fun
    • View Profile
Re: [Xp] Item Art Color
« Reply #16 on: February 09, 2011, 12:59:40 AM »
Was the [XP]/[VX] Tag case sensitive?

Yes.

@^ 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

fix the tag please
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.

DropBox, the best free file syncing service there is.
(click to show/hide)

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Item Art Color
« Reply #17 on: February 09, 2011, 05:21:13 AM »
fixed

Offline Dweller

  • Ethereal Devastator
  • ****
  • Posts: 334
  • LV: 44
  • Gender: Male
    • View Profile
    • Subir de Nivel
Re: [XP] Item Art Color
« Reply #18 on: April 16, 2012, 02:04:56 PM »
Littledragon will be posible that your Item Art Color script works with MOG_Scene_Shop?

(click to show/hide)

I´m using both scripts with no errors but on Mog shop windows all items are in white color.
Dwellercoc
(click to show/hide)

Offline LiTTleDRAgo

  • Astral Trancist
  • *****
  • Posts: 841
  • LV: 514
  • Gender: Male
    • View Profile
    • ~
Re: [XP] Item Art Color
« Reply #19 on: April 17, 2012, 10:00:57 AM »
try replace mog scene shop and place it below item art color script

(click to show/hide)

I didn't have rmxp right now, so I'll look at it later