[XP] Item Quality

Started by G_G, January 16, 2011, 03:14:01 pm

Previous topic - Next topic

G_G

January 16, 2011, 03:14:01 pm Last Edit: June 10, 2011, 02:53:10 am by game_guy
Item Quality
Authors: game_guy
Version: 1.4
Type: Item Grouping
Key Term: Misc Add-on



Introduction

Changes the color of the items name according to the items quality. e.g. rare, common, etc.


Features


  • Unlimited Qualities
  • Any Color You Want



Screenshots

Spoiler: ShowHide



Demo

Self Extracting Archive (Outdated)
Zip Archive (Outdated)


Script

Spoiler: ShowHide

#===============================================================================
# Item Quality Colors
# Author game_guy
# Version 1.4
#-------------------------------------------------------------------------------
# Intro:
# Changes the color of the items name according to the items quality.
# e.g. rare, common, etc.
#
# Features:
# Unlimited Qualities
# Any Color You Want
#
# Instructions:
# Everything you need to configure for the script is below.
# -Setting the Items Quality:
#  Go into the database, click the items, weapons, or armors tab. Type this into
#  the name box after the name.
#  \qty[quality name]
#  e.g.
#  You have a quality like so
#  Quality['common'] = Color.new(255, 255, 0)
#  You type \qty[common] in the items name
#
# Compatibility:
# Not tested with SDK.
# Most likely will not work with custom menu systems/custom item systems.
# -IF you do use a CMS/CIS
#  -PM me at http://forum.chaos-project.com/index.php?action=profile;u=220
#  -Message me at http://youtube.com/GameGuysProjects
#  -Email me at gameguysprojects@hotmail.com
#   Use as a last resort, I rarely check my email.
# -Then let me know which custom script you're using and send a copy of it
#  and I'll whip up a compatibility patch if I have the time.
# There is some instructions on how to do it yourself in the topic.
#
# Update History:
# v1.0:
#  -Initial release
# v1.1:
#  -Added support for equip scene
# v1.2:
#  -Improved method of getting quality
# v1.3
#  -Added support for default shop scene
# v1.4
#  -Fixed display for equip scene
#  -Rewrote the script to make it more efficient
#
# Credits:
# game_guy ~ Creator of the script.
# mroedesigns ~ Requesting.
# Leongon ~ Original VX version.
#===============================================================================
module GG_QualityColors
 Quality = {}
 #================================================
 # Color used for all other items without a
 # quality or when a quality level does not exist
 #================================================
 Default_Color = Color.new(255, 255, 255)
 #================================================
 # Add a new line under the qualities already
 # given and type
 # Quality['quality name'] = Color.new(r, g, b)
 #  quality name - name of quality in quotes
 #  r - amount of red
 #  g - amount of green
 #  b - amount of blue
 # Examples below.
 #================================================
 Quality['common'] = Color.new(255, 255, 0)
 Quality['rare'] = Color.new(120, 20, 0)
 Quality['epic'] = Color.new(0, 255, 0)
 Quality['awesome'] = Color.new(80, 80, 240)
end
module RPG
 def self.get_item_name(t)
   text = t.clone
   text.gsub!(/\\[Qq][Tt][Yy]\[([0-9A-Za-z_]+)\]/) { "" }
   return text
 end
 def self.get_item_quality(t)
   text = t.clone
   quality = "gg_def"
   text.gsub!(/\\[Qq][Tt][Yy]\[([0-9A-Za-z_]+)\]/) do
     quality = $1.to_s
     ""
   end
   return quality
 end
 class Item
   def name
     return RPG.get_item_name(@name)
   end
   def quality
     return RPG.get_item_quality(@name)
   end
 end
 class Armor
   def name
     return RPG.get_item_name(@name)
   end
   def quality
     return RPG.get_item_quality(@name)
   end
 end
 class Weapon
   def name
     return RPG.get_item_name(@name)
   end
   def quality
     return RPG.get_item_quality(@name)
   end
 end
end
class Window_Item < Window_Selectable
 def draw_item(index)
   use = 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
   if item.is_a?(RPG::Item) and
      $game_party.item_can_use?(item.id)
     use = true
   end
   if item.quality == "gg_def"
     self.contents.font.color = GG_QualityColors::Default_Color
   else
     self.contents.font.color = GG_QualityColors::Quality[item.quality]
   end
   x = 4 + index % 2 * (288 + 32)
   y = index / 2 * 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 = use == true ? 255 : 128
   self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
   self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
   self.contents.font.color = Font.default_color
   self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
   self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
 end
end
class Window_Base < Window
 def draw_item_name(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))
   if item.quality == 'gg_def'
     self.contents.font.color = GG_QualityColors::Default_Color
   else
     self.contents.font.color = GG_QualityColors::Quality[item.quality]
   end
   self.contents.draw_text(x + 28, y, 212, 32, item.name)
   self.contents.font.color = Font.default_color
 end
end

class Window_ShopSell < Window_Selectable
 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
   use = false
   if item.price > 0
     use = true
   end
   if item.quality == 'gg_def'
     self.contents.font.color = GG_QualityColors::Default_Color
   else
     self.contents.font.color = GG_QualityColors::Quality[item.quality]
   end
   x = 4 + index % 2 * (288 + 32)
   y = index / 2 * 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 = use == true ? 255 : 128
   self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
   self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
   self.contents.font.color = Font.default_color
   self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
   self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
 end
end

class Window_ShopBuy < Window_Selectable
 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.quality == 'gg_def'
     self.contents.font.color = GG_QualityColors::Default_Color
   else
     self.contents.font.color = GG_QualityColors::Quality[item.quality]
   end
   use = false
   if item.price <= $game_party.gold and number < 99
     use = true
   end
   x = 4
   y = index * 32
   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 = use == true ? 255 : 128
   self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
   self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
   self.contents.font.color = Font.default_color
   self.contents.font.color = Font.default_color
   self.contents.draw_text(x + 240, y, 88, 32, item.price.to_s, 2)
 end
end

class Window_EquipItem < Window_Selectable
 def draw_item(index)
   item = @data[index]
   x = 4 + index % 2 * (288 + 32)
   y = index / 2 * 32
   case item
   when RPG::Weapon
     number = $game_party.weapon_number(item.id)
   when RPG::Armor
     number = $game_party.armor_number(item.id)
   end
   bitmap = RPG::Cache.icon(item.icon_name)
   self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
   if item.quality == 'gg_def'
     self.contents.font.color = GG_QualityColors::Default_Color
   else
     self.contents.font.color = GG_QualityColors::Quality[item.quality]
   end
   self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
   self.contents.font.color = Font.default_color
   self.contents.draw_text(x + 240, y, 16, 32, ":", 1)
   self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)
 end
end



Instructions

In the script.


Compatibility

Not tested with SDK.
Most likely will not work with custom item/menu systems.
If you are having troubles with the \qty tag not being removed, place this script below all others (but still above main) and then test it.

If you are using a custom item/menu system and the script conflicts with it try and follow these steps:
Spoiler: ShowHide
1. Locate your custom menu system's item window. Usually named Window_Item. CTRL + F - class Window_Item
2. Locate the method named draw_item.
3. Replace the lines as following:
Look for lines similiar to this.
    if item.is_a?(RPG::Item) and
      $game_party.item_can_use?(item.id)
     self.contents.font.color = normal_color
   else
     self.contents.font.color = disabled_color
   end

Replace them with this.
    if item.is_a?(RPG::Item) and
      $game_party.item_can_use?(item.id)
     use = true
   end

Note that you want to keep the same if statement for the replacement. e.g. in Stormtronics CMS the if statement is
if @data[i].is_a?(RPG::Item) && $game_party.item_can_use?(@data[i].id) ||
       @mode == nil

So when you replace the lines, keep the same if statement.
Right below the above code paste this code there.
    if item.quality == 'gg_def'
     self.contents.font.color = GG_QualityColors::Default_Color
   else
     self.contents.font.color = GG_QualityColors::Quality[item.quality]
   end

Then replace this line
opacity = self.contents.font.color == normal_color ? 255 : 128

with
opacity = use == true ? 255 : 128


If you cannot seem to figure out how to do this, post the custom menu system you're using and I'll see if I can whip up a patch if I have time.


Pre-Made patch for STCMS (Place script and patch below STCMS)
Spoiler: ShowHide
class Window_CMSItem < Window_Selectable
 def draw_item(i)
   use = false
   number = case @data[i]
   when RPG::Item then $game_party.item_number(@data[i].id)
   when RPG::Weapon then $game_party.weapon_number(@data[i].id)
   when RPG::Armor then $game_party.armor_number(@data[i].id)
   end
   if @data[i].is_a?(RPG::Item) && $game_party.item_can_use?(@data[i].id) ||
       @mode == nil
     use = true
   end
   if @data[i].quality == 'gg_def'
     self.contents.font.color = GG_QualityColors::Default_Color
   else
     self.contents.font.color = GG_QualityColors::Quality[@data[i].quality]
   end
   self.contents.fill_rect(4, i*32, 352, 32, Color.new(0, 0, 0, 0))
   bitmap = RPG::Cache.icon(@data[i].icon_name)
   opacity = use == true ? 255 : 128
   self.contents.blt(4, i*32 + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
   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


This is a patch made for GUILLAUME777's Multi Slot Script. Place script and patch below Multi Slot.
Spoiler: ShowHide

class Window_EquipRight < Window_Selectable
 def draw_item_name(item, x, y, translucent = false)
   if item == nil
     return
   end
   bitmap = RPG::Cache.icon(item.icon_name)
   if item.cursed
     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
     self.contents.font.color = G7_MS_MOD::CURSED_COLOR
   elsif translucent
     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), 128)
     if item.quality == 'gg_def'
       self.contents.font.color = GG_QualityColors::Default_Color
     else
       self.contents.font.color = GG_QualityColors::Quality[item.quality]
     end
   else
     self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
     self.contents.font.color = normal_color
     if item.quality == 'gg_def'
       self.contents.font.color = GG_QualityColors::Default_Color
     else
       self.contents.font.color = GG_QualityColors::Quality[item.quality]
     end
   end
   self.contents.draw_text(x + 28, y, 212, 32, item.name)
 end
end



Credits and Thanks


  • game_guy ~ Creator of the script.
  • mroedesigns ~ Requesting.
  • Leongon ~ Original VX version.



Author's Notes

Enjoy!

mroedesigns

Thanks a ton GG! Another level for you  :haha:

LiTTleDRAgo

found an error,
I get script error at this line saying something like unknown method

gg_init_qual_colors_lat


did you aliased them wrong?

Quotealias gg_init_qual_colors_itm_lat initialize
    def initialize
      @quality = ""
      gg_init_qual_colors_lat
    end

G_G

Updated the script. Not the demo. What seems to be the problem with the Active Action or whatever? (I read that you said it had problems with it)

LiTTleDRAgo

February 06, 2011, 10:39:40 pm #4 Last Edit: February 06, 2011, 10:52:37 pm by LiTTleDRAgo
actualy not only active action, this script messing up with message system, custom shop screen and many more

Spoiler: ShowHide

Spoiler: ShowHide



NB : It works with SDK (just let you know)

G_G

I'll look into it. Thanks for letting me know. :)

Xuroth

Hey game_guy, awesome script! I remember requesting this feature in your old Item rating and color, but the way this works is closer to what I wanted. Thanks a bunch! However, I am running into an error trying to merge this with scripts. I tried to follow your suggestions for compatibility, but it keeps throwing up an error.

I was able to get Blizz's Window_BattleResult (from Tons) to display colored items correctly, but I cant get the following scripts to work right:

Guillaume777's multi-slot equip 6.2.2
DerVVulfman's Grouping and Details 7.2
Blizzard's Chaos Rage Limit System 6.1b

Ive spent a few hours trying to modify these scripts to show the item's color in all the relevant windows. Most of the time I get an error saying it cant convert NilClass to Color. Do you have any advice or are you able to make a patch for these systems?

G_G

Upload the scripts and link em here. I'll take a look at them.

Xuroth

February 16, 2011, 04:41:55 pm #8 Last Edit: February 23, 2011, 04:22:05 pm by Xuroth
Here is a rar file that has all of the script components (unfortunately, Grouping and Details  & Multi-slot Equip are broken into several scripts, like Tons) they are numbered to show the order they are in the project. Thanks for taking a look game_guy.

Scripts link (.RAR) http://www.filedropper.com/scripts_1

EDIT: I went to DerVVulfman's website and worked with him on this issue. I switched to his multi slot system and he was able to make a patch for it. I looked at CRLS and made a patch (based off of 6.1b, though it should be compatible with 6.2b as well). In case anyone else is using this script and CRLS here is my patch:

Patch for Item Colors compatibility with CRLS: ShowHide

#==============================================================================
# ** Item Quality Colors patch for Chaos Rage Limit System
#------------------------------------------------------------------------------
#    CRLS by Blizzard
#    Item Quality by game_guy
#    patch by Xuroth
#    version 1.0
#    02-23-2011
#    (Had to re-write a method in Window_Base that CRLS added)
#------------------------------------------------------------------------------
#
# * INSTRUCTIONS:
#
#   Paste game_guy's Item Quality Colors below CRLS
#   Paste this patch below both.
#   Follow game_guy's instructions as normal to apply colors
#
#   This patch allows the Soul Rage menu in battle to properly
#   display custom item colors. This patch is plug and play
#   compatible, so just put the scripts in the order described
#   above, and enjoy!
#
#==============================================================================

class Window_Base
  def draw_item_name_srs(item, x, y, color)
    # stop if item doesn't exist
    return if item == nil
    opacity = self.contents.font.color == normal_color ? 255 : 128
       # cache icon
    bitmap = RPG::Cache.icon(item.icon_name)
    # draw icon
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.font.color = normal_color
        if item.quality == 'gg_def'
      self.contents.font.color = GG_QualityColors::Default_Color
    else
      self.contents.font.color = GG_QualityColors::Quality[item.quality]
    end     
    # draw item name
    self.contents.draw_text(x + 28, y, 288, 32, item.name)
  end
end


Thanks for the awesome script game_guy (and thanks so much for CRLS Blizzard!)

Now if I can get his Grouping and Details to work with Item Colors and CRLS...

G_G

Oh crap! Sorry! I completely forgot about this. Glad you got your problem fixed, I still need to find out some issues with it as well.

AliveDrive

How have I not seen this yet?

This will make item combination a snap!
Quote from: Blizzard on September 09, 2011, 02:26:33 am
The permanent solution for your problem would be to stop hanging out with stupid people.

G_G

I think I've fixed it. Not really much time to test it. The problem was that in RPG::Item I was setting quality to a string when it should have been nil.

AliveDrive

Hey so, me = huge fan of this.
Quote from: Blizzard on September 09, 2011, 02:26:33 am
The permanent solution for your problem would be to stop hanging out with stupid people.

Griver03

hey casn you make it compatible with the 777's multislot equipment ?
it works togehter but the color isnt shown at equipment as it was in normal equip scene  :(
that where great dude, thx in advance
My most wanted games...



Dweller

I notice that the different item color's didn´t show on vendors.

Spoiler: ShowHide
Dwellercoc
Spoiler: ShowHide

G_G


Griver03

both ?!
when you fix the colors on shop can you pls make patch for fft shop too?
but 77's multi-equip is more important to me xD
thx in advance
My most wanted games...



G_G

Can I have a link to both of those scripts? It'll make it easier.

Griver03

Multi-Slot Demo
http://www.fileden.com/files/2008/10/3/2126590/Files/RPGMaker/RMXP/Demo/Others%20Western/Multi-Slot.zip

FFT Shop System
http://www.rmxpunlimited.net/resources/scripts/item/final-fantasy-tactics-advance-shop-system

like i said multi-equip is very important to me so pls help ^^
My most wanted games...



G_G

Updated to 1.3. Added default shop support. Added multi slot patch. Working on FFT Shop system now.

Do take note that for the multi slot, cursed weapons will keep the cursed color.

Griver03

May 30, 2011, 02:51:20 pm #20 Last Edit: May 30, 2011, 03:31:06 pm by Griver03
omfg thats  :evil:
great thx and go on like this  :)

edit:
ok i tested it and works good in multi-equip but only in the equip window not in the window at bottom where you select a weapon/armor...
and in fft shop the items are standard white just like before ...
my item quality script is above fft shop is this correct ?!

edit2: sry i dont read correct ^^
you "will" make the patch for fft and its not out yet thats why it doesnt work hahaha
My most wanted games...



Dweller

Quote from: game_guy on May 30, 2011, 02:33:38 pm
Updated to 1.3. Added default shop support. Added multi slot patch. Working on FFT Shop system now.


Working fine, ty for the fix
Dwellercoc
Spoiler: ShowHide

Dweller

*double post

g_g can you fix the script to solve the equip window problem?

Will be difficult to make it run with ccoa UMS?

ty,
Dwellercoc
Spoiler: ShowHide

G_G

I'll fix it, I'll be busy for a couple of days so I can't do it right away. It shouldn't be a problem hopefully. I'm gonna rewrite the script to make it smaller and hopefully more efficient.

Dweller

Quote from: Captain Falcon on June 08, 2011, 05:35:19 am
I'll fix it, I'll be busy for a couple of days so I can't do it right away. It shouldn't be a problem hopefully. I'm gonna rewrite the script to make it smaller and hopefully more efficient.


nice ty ;)
Dwellercoc
Spoiler: ShowHide

G_G

Updated to 1.4. Fixed equip window, rewrote main part of the script, its much much more efficient now.

Dweller

I tried the new version and got a problem:

Spoiler: ShowHide
Dwellercoc
Spoiler: ShowHide

G_G

Any special scripts you're using? Not that it should matter. It seems to be working just fine for me.

Dweller

Quote from: Captain Falcon on June 08, 2011, 08:08:20 pm
Any special scripts you're using? Not that it should matter. It seems to be working just fine for me.


Is working on a new project so is probably messing up with some of the scripts I´m using.
Dwellercoc
Spoiler: ShowHide

G_G

what other scripts are you using?

Dweller

Scripts I´m using right now (in order)

- Universal Message System v1.8.0 by Ccoa
- Item Quality 1.4 by g_g
- Credit script (still looking for autor)
Spoiler: ShowHide
CREDITS_FONT = "Times New Roman"
CREDITS_SIZE = 24
CREDITS_OUTLINE = Color.new(0,0,127, 255)
CREDITS_SHADOW = Color.new(0,0,0, 100)
CREDITS_FILL = Color.new(255,255,255, 255)

#==============================================================================
# ¦ Scene_Credits
#------------------------------------------------------------------------------
#  Scrolls the credits you make below. Original Author unknown. Edited by
#  MiDas Mike so it doesn't play over the Title, but runs by calling the following:
#  $scene = Scene_Credits.new
#==============================================================================

class Scene_Credits

# This next piece of code is the credits.

CREDIT=<<_END_
#Start Editing
Título: 7 Islands

by Dweller

SCRIPTS
---------------
Game Guy (ItemQuality)
Blizzard (Blizz ABS, Visual Equip, Z-Hud)
Winkio (Blizz ABS)
RPGManiac3030 (Weapon Equip Z-HUD)
Ccoa (UMS)

SPRITES
---------------
Dweller
Leirgoth (Custom Art)

MUSIC and SOUND
---------------


MAPPING
---------------
Dweller
Dark_Split

STORYLINE
---------------
Dweller

BETATESTERS
---------------
Dark_Split
Ochiru

Special Thanks
---------------


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



#Stop Editing
_END_
def main
#-------------------------------
# Animated Background Setup
#-------------------------------
@sprite = Sprite.new
#@sprite.bitmap = RPG::Cache.title($data_system.title_name)
@backgroundList = ["credits"] #Edit this to the title screen(s) you wish to show in the background. They do repeat.
@backgroundGameFrameCount = 0
# Number of game frames per background frame.
@backgroundG_BFrameCount = 3.4
@sprite.bitmap = RPG::Cache.title(@backgroundList[0])
#------------------
# Credits Setup
#------------------
credit_lines = CREDIT.split(/\n/)
credit_bitmap = Bitmap.new(640,32 * credit_lines.size)
credit_lines.each_index do |i|
line = credit_lines[i]
credit_bitmap.font.name = CREDITS_FONT
credit_bitmap.font.size = CREDITS_SIZE
x = 0
credit_bitmap.font.color = CREDITS_OUTLINE
credit_bitmap.draw_text(0 + 1,i * 32 + 1,640,32,line,1)
credit_bitmap.draw_text(0 - 1,i * 32 + 1,640,32,line,1)
credit_bitmap.draw_text(0 + 1,i * 32 - 1,640,32,line,1)
credit_bitmap.draw_text(0 - 1,i * 32 - 1,640,32,line,1)
credit_bitmap.font.color = CREDITS_SHADOW
credit_bitmap.draw_text(0,i * 32 + 8,640,32,line,1)
credit_bitmap.font.color = CREDITS_FILL
credit_bitmap.draw_text(0,i * 32,640,32,line,1)
end
@credit_sprite = Sprite.new(Viewport.new(0,50,640,380))
@credit_sprite.bitmap = credit_bitmap
@credit_sprite.z = 9998
@credit_sprite.oy = -430
@frame_index = 0
@last_flag = false
#--------
# Setup
#--------
# ME?BGS ??????
Audio.me_stop
Audio.bgs_stop
Audio.se_stop
# ?????????
Graphics.transition
# ??????
loop do
# ????????
Graphics.update
# ???????
Input.update
# ??????
update
# ????????????????
if $scene != self
break
end
end
# ?????????
Graphics.freeze
@sprite.dispose
@credit_sprite.dispose
end
#Checks if credits bitmap has reached it's ending point
def last?
return (@frame_index >= @credit_sprite.bitmap.height + 480)
end
def last
if not @last_flag
@last_flag = true
@last_count = 0
else
@last_count += 1
end
if @last_count >= 300
$scene = Scene_Map.new
end
end
#Check if the credits should be cancelled
def cancel?
if Input.trigger?(Input::C)
$scene = Scene_Map.new
return true
end
return false
end
#--------------------------------------------------------------------------
# ? ??????
#--------------------------------------------------------------------------
def update
@backgroundGameFrameCount = @backgroundGameFrameCount + 1
if @backgroundGameFrameCount >= @backgroundG_BFrameCount
@backgroundGameFrameCount = 0
# Add current background frame to the end
@backgroundList = @backgroundList << @backgroundList[0]
# and drop it from the first position
@backgroundList.delete_at(0)
@sprite.bitmap = RPG::Cache.title(@backgroundList[0])
end
return if cancel?
last if last?
@credit_sprite.oy += 1
end
end

- Blizz-ABS 2.84 by Blizzard/Winkio
- Visual Equipment for Blizz-ABS by Blizzard
- Z-HUD for Blizz-ABS by Blizzard
- Weapon Equip HUD for Z-HUD by RPGManiac3030

Dwellercoc
Spoiler: ShowHide

G_G

Try placing my script below everyone elses.

Dweller

I placed Item Quality script below the rest of the scripts and is running fine. I made a few more test and the problem is with Blizz-ABS (just over Blizz-ABS scripts fails and just below them is ok).

Ty for you help ;)
Dwellercoc
Spoiler: ShowHide

syldocaine

First at all i want to say that this script is awsome

but i have one problem.

im using the Drago Inventory System
http://forum.chaos-project.com/index.php/topic,11582.0.html

and the only place where the colors not appear is the stat window
im not deep enough into ruby to fix that issue so maybe you could help me with that problem


Moshan

 I can't make it fully compatible with Zer0_CMS. How can I keep the colors in equipment window?
Example (big image):
Spoiler: ShowHide

exile360

Having the same problem with my CMS, but I just left it for now as it's not a huge issue. :P If a solution is found, I'm interested in it as well, though!

KK20

FZer0 created his own Item Window class rather than extending RMXP's default class. As such, he wrote his own draw_item method. Basically all I did was just copy-paste G_G's draw_item rewrite and replaced FZer0's with it.

Around line 2149 in FZer0's CMS script, you should see def draw_item(index). Replace that method with this:
Spoiler: ShowHide

  def draw_item(index)
    use = 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
    if item.is_a?(RPG::Item) and
       $game_party.item_can_use?(item.id)
      use = true
    end
    if item.quality == "gg_def"
      self.contents.font.color = GG_QualityColors::Default_Color
    else
      self.contents.font.color = GG_QualityColors::Quality[item.quality]
    end
    x = 4 + index % 2 * (192 + 32)
    y = index / 2 * 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 = use == true ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 172, 32, item.name, 0)
    self.contents.font.color = Font.default_color
    self.contents.draw_text(x + 144, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 160, y, 24, 32, number.to_s, 2)
  end





   


   
   


   
   

Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!



Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

Moshan


caspa94

January 31, 2018, 12:21:38 pm #38 Last Edit: January 31, 2018, 03:05:07 pm by KK20
Can you tell me how to fix this script? with this script i can create items where i can put for example gems to enhance the item
But if i create a enhanced item the colour of the item turns into white again
Is it possible to fix that?
heres the script
http://save-point.org/thread-2299.html

KK20

Add this below both of the scripts
Spoiler: ShowHide

module RPG
  class Item
    def full_name
      @name
    end
  end
  class Armor
    def full_name
      @name
    end
  end
  class Weapon
    def full_name
      @name
    end
  end
end

class Enhanced_Weapon < RPG::Weapon
  alias get_weapons_full_name initialize
  def initialize(ref_id)
    get_weapons_full_name(ref_id)
    @name = $data_weapons[@ref_id].full_name
  end
end

class Enhanced_Armor < RPG::Armor
  alias get_armors_full_name initialize
  def initialize(ref_id)
    get_armors_full_name(ref_id)
    @name = $data_armors[@ref_id].full_name
  end
end

class Window_Weapons < Window_Selectable 
  def draw_item(index)
    item = @data[index][0]
    x = 4
    y = index * 32

    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    if item.quality == 'gg_def'
      self.contents.font.color = GG_QualityColors::Default_Color
    else
      self.contents.font.color = GG_QualityColors::Quality[item.quality]
    end
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)
    self.contents.font.color = Font.default_color
  end
end

class Window_Enhancements < Window_Selectable
  def draw_item(index)
    item = @data[index]
    x = 4
    y = index * 32
    case item
    when RPG::Weapon
      number = $game_party.weapon_number(item.id)
    when RPG::Armor
      number = $game_party.armor_number(item.id)
    end
    bitmap = RPG::Cache.icon(item.icon_name)
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24))
    if item.quality == 'gg_def'
      self.contents.font.color = GG_QualityColors::Default_Color
    else
      self.contents.font.color = GG_QualityColors::Quality[item.quality]
    end
    self.contents.draw_text(x + 28, y, 84, 32, item.name, 0)
    self.contents.font.color = Font.default_color
    self.contents.draw_text(x + 28 + 80, y, 16, 32, ":", 1)
    self.contents.draw_text(x + 28 + 80 + 16, y, 24, 32, number.to_s, 2)
  end
end

class Window_WeaponInfo < Window_Base
  def refresh
    self.contents.clear
    if @item!=nil
      self.contents.font.size=20
      self.contents.font.bold=true
      aw=self.width - 40
      bitmap = RPG::Cache.icon(item.icon_name)
      self.contents.blt(4, 0, bitmap, Rect.new(0, 0, 24, 24))
      # get actor
      actor_str=(@actor!=nil)?("  ["+@actor.name+"]"):("")
      if @item.quality == 'gg_def'
        self.contents.font.color = GG_QualityColors::Default_Color
      else
        self.contents.font.color = GG_QualityColors::Quality[item.quality]
      end
      self.contents.draw_text(4+32, 0, aw-32, 24, @item.name+actor_str)
      self.contents.font.color = Font.default_color
      self.contents.font.size=18
      self.contents.font.bold=false
      self.contents.draw_text(4, 24, self.width-36, 24, @item.description)
      if @item.is_a?(Enhanced_Weapon)
        self.contents.draw_text(4, 48, aw/4-4, 24, "ATK: "+@item.atk.to_s)
      else
        self.contents.draw_text(4, 48, aw/4-4, 24, "EVA: "+@item.eva.to_s)
      end
      self.contents.draw_text(4+aw/4, 48, aw/4-4, 24, "PDEF: "+@item.pdef.to_s)
      self.contents.draw_text(4+2*aw/4, 48, aw/4-4, 24, "MDEF: "+@item.mdef.to_s)
      self.contents.draw_text(4, 72, aw/4-4, 24, "STR: "+@item.str_plus.to_s)
      self.contents.draw_text(4+aw/4, 72, aw/4-4, 24, "DEX: "+@item.dex_plus.to_s)
      self.contents.draw_text(4+2*aw/4, 72, aw/4-4, 24, "AGI: "+@item.agi_plus.to_s)
      self.contents.draw_text(4+3*aw/4, 72, aw/4-4, 24, "INT: "+@item.int_plus.to_s)
    end
  end
end

class Window_EnhancementInfo < Window_Base
  def refresh
    self.contents.clear
    if @item!=nil
      self.contents.font.size=20
      self.contents.font.bold=true
      aw=self.width - 40
      bitmap = RPG::Cache.icon(item.icon_name)
      self.contents.blt(4, 0, bitmap, Rect.new(0, 0, 24, 24))
      if @item.quality == 'gg_def'
        self.contents.font.color = GG_QualityColors::Default_Color
      else
        self.contents.font.color = GG_QualityColors::Quality[item.quality]
      end
      self.contents.draw_text(4+32, 0, aw-32, 24, @item.name)
      self.contents.font.color = Font.default_color
      self.contents.font.size=18
      self.contents.font.bold=false
      self.contents.draw_text(4, 24, self.width-36, 24, @item.description)
      if @item.is_a?(RPG::Weapon)
        self.contents.draw_text(4, 48, aw/4-4, 24, "ATK " + sprintf("%+d", @item.atk)) unless @item.atk == 0
      else
        self.contents.draw_text(4, 48, aw/4-4, 24, "EVA " + sprintf("%+d", @item.eva)) unless @item.eva == 0
      end
      self.contents.draw_text(4+aw/4, 48, aw/4-4, 24, "PDEF " + sprintf("%+d", @item.pdef)) unless @item.pdef == 0
      self.contents.draw_text(4+2*aw/4, 48, aw/4-4, 24, "MDEF " + sprintf("%+d", @item.mdef)) unless @item.mdef == 0
      self.contents.draw_text(4, 72, aw/4-4, 24, "STR " + sprintf("%+d", @item.str_plus)) unless @item.str_plus == 0
      self.contents.draw_text(4+aw/4, 72, aw/4-4, 24, "DEX " + sprintf("%+d", @item.dex_plus)) unless @item.dex_plus == 0
      self.contents.draw_text(4+2*aw/4, 72, aw/4-4, 24, "AGI " + sprintf("%+d", @item.agi_plus)) unless @item.agi_plus == 0
      self.contents.draw_text(4+3*aw/4, 72, aw/4-4, 24, "INT " + sprintf("%+d", @item.int_plus)) unless @item.int_plus == 0
    end
  end

end





   


   
   


   
   

Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!



Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

caspa94


panzerkunst

Hi.
I have problems running this script with "Dynamic gardening" script and this other:

I really need help :(

KK20

First add this to the Item Qualities script in the configuration:
Quality['gg_def'] = Default_Color


For Dynamic Gardening, replace class Window_Seed#refresh method with this:

  def refresh
    # Clear the bitmap.
    self.contents = self.contents.dispose if self.contents != nil
    # Determine what seeds to display.
    @seeds = Garden::SEED_IDS.collect {|id| $data_items[id] }
    unless Garden::SEED_DISPLAY
      @seeds.reject! {|seed| $game_party.item_number(seed.id) < 1 }
    end
    @item_max = @seeds.size
    # Draw the items on the bitmap.
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, @item_max * 32)
      @seeds.each_index {|i|
        item = @seeds[i]
        number = $game_party.item_number(item.id)
        self.contents.font.color = number > 0 ? GG_QualityColors::Quality[item.quality] : disabled_color
        opacity = number > 0 ? 255 : 128
        # Find icon bitmap and set it to window, and draw the text.
        bitmap = RPG::Cache.icon(item.icon_name)
        self.contents.blt(4, i*32+4, bitmap, Rect.new(0, 0, 24, 24), opacity)
        self.contents.draw_text(32, i*32, 288, 32, item.name)
        self.contents.font.color = number > 0 ? normal_color : disabled_color
        self.contents.draw_text(-32, i*32, 288, 32, ':', 2)
        self.contents.draw_text(-4, i*32, 288, 32, number.to_s, 2)
      }
    end
  end


For the third script, replace with this:
Spoiler: ShowHide


=begin
-----------------------------------------------------------------------------
*** RECIPE CONFIGURATION ****************************************************
-----------------------------------------------------------------------------
INSTRUCTIONS:
This module contains the constant variables used for each recipe
format:
RECIPE[index] = [recipe_id, [product_type, product_id],
                 [material_1_type, material_1_id, material_1_qty], ...]
recipe_id       : this is the ID number in "items" tab of database
product_type    : this is the "type" of item that will be created
                : 0 = item; 1 = weapon; 2 = armor
product_id      : this is the ID number in corresponding "type" tab of database
                : for finished product
material_1_type : first required material "type"
                : 0 = item; 1 = weapon; 2 = armor
material_1_id   : this is the ID number in corresponding "type" tab of database
                : for first material
material_1_qty  : the quantity required of first material to create product
*NOTE:*
This Script supports any number of required materials for each recipe, simply
write in extra materials, following the same format
EX. RECIPE[0] = [1, [0, 25], [0, 15, 5], [0, 12, 2], [0, 5, 1]]
that recipe would be found as the first item in the database, would create
item # 25 in the item database, and requires 5 item#15, 2 item#12 and 1 item#5
=end
module Crafting
  # Menu style, true - draw map and resize windows to fit contents
  # false - draw full windows
  RESIZE_MENU = true
  # Create array to hold recipe data
  RECIPE = []
  # Create recipes below
  # High Potion
  RECIPE[0] = [1, [0, 2], [0, 1, 2], [0, 17, 1]]               
  # Full Potion
  RECIPE[1] = [2, [0, 3], [0, 2, 1], [0, 28, 1]]               
  # High Perfume
  RECIPE[2] = [3, [0, 5], [0, 4, 2], [0, 18, 1]]               
  # Iron Sword
  RECIPE[3] = [4, [1, 2], [1, 1, 1], [0, 13, 5], [0, 23, 5]]
  # Ring of Water
  RECIPE[4] = [37, [2, 32], [2, 26, 1], [2, 30, 1], [2, 29, 1], [0, 14, 1]]
  #Steel Axe
  RECIPE[5] = [33, [1,11], [0, 30, 1], [1, 29, 1]]
end
#============================================================================
# ** Window_Prompt
#----------------------------------------------------------------------------
#   This window asks the user if they would like to create the item
#============================================================================
class Window_Prompt < Window_Command
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     item    : item that will be created
  #--------------------------------------------------------------------------
  def initialize
    super(200, ['Create', 'Cancel'])
    self.x += 16
    self.y += 80
    self.z += 100
  end
end
#============================================================================
# ** Window_Materials
#----------------------------------------------------------------------------
#   This window displays required materials to synthesize recipe
#============================================================================
class Window_Materials < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize(recipe)
    super(320, 64, 320, 416)
    refresh(recipe)
    self.index = -1
    self.active = false
  end
  #--------------------------------------------------------------------------
  # * Current Item
  #--------------------------------------------------------------------------
  def item
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh Contents
  #--------------------------------------------------------------------------
  def refresh(recipe)
    @recipe = recipe
    if self.contents != nil
      self.contents.clear
      self.contents = nil
    end
    # If no recipes are possessed do not draw item
    @data = []
    if @recipe == nil
      self.height = 96 if Crafting::RESIZE_MENU
      self.contents = Bitmap.new(self.width - 32, self.height - 32)
      # Memorize font size
      font_size = self.contents.font.size
      # Draw Header
      self.contents.font.color = system_color
      self.contents.draw_text(4, 0, 212, 32, 'Ingredients')
      self.contents.font.size = 14
      self.contents.draw_text(204, 0, 24, 32, 'need', 2)
      self.contents.draw_text(252, 0, 24, 32, 'held', 2)
      # Restore font size
      self.contents.font.size = font_size
      self.contents.draw_text(228, 0, 16, 32, '/', 1)
      return
    end
    @qty_req = []
    # Add items required
    for i in 2...@recipe.size
      case @recipe[i][0]
      when 0 # Item
        @data.push($data_items[@recipe[i][1]])
      when 1 # Weapon
        @data.push($data_weapons[@recipe[i][1]])
      when 2 # Armor
        @data.push($data_armors[@recipe[i][1]])
      end
      @qty_req.push(@recipe[i][2])
    end
    @item_max = @data.size
    # Resize ingredients list
    if Crafting::RESIZE_MENU
      self.height = @item_max * 32 + 64
      self.height = 416 if self.height > 416
    end
    # Draw items required
    self.contents = Bitmap.new(self.width - 32, @item_max * 32 + 32)
    for i in 0...@item_max
      draw_item(i)
    end
    # Memorize font size
    font_size = self.contents.font.size
    # Draw Header
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 212, 32, 'Ingredients')
    self.contents.font.size = 14
    self.contents.draw_text(204, 0, 24, 32, 'need', 2)
    self.contents.draw_text(252, 0, 24, 32, 'held', 2)
    # Restore font size
    self.contents.font.size = font_size
    self.contents.draw_text(228, 0, 16, 32, '/', 1)
  end
  #-------------------------------------------------------------------------
  # * Draw Ingredients
  #-------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    x = 4
    y = index * 32 + 32
    # get number of items held
    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 = number >= @qty_req[index] ?
                               GG_QualityColors::Quality[item.quality] : disabled_color
    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 = number >= @qty_req[index] ? 255 : 128
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)
    self.contents.draw_text(x + 28, y, 212, 32, item.name)
    self.contents.font.color = number >= @qty_req[index] ?
                               normal_color : disabled_color
    self.contents.draw_text(x + 200, y, 24, 32, @qty_req[index].to_s, 2)
    self.contents.draw_text(x + 224, y, 16, 32, '/', 1)
    self.contents.draw_text(x + 248, y, 24, 32, number.to_s, 2)
  end
  #--------------------------------------------------------------------------
  # * Update Cursor Rectangle
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # If cursor position is less than 0
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    row = @index
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end
    # Calculate cursor width
    cursor_width = self.width - 32
    # Calculate cursor coordinates
    x = 0
    y = @index * 32 - self.oy + 32
    # Update cursor rectangle
    self.cursor_rect.set(x, y, cursor_width, 32)
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_text(self.item == nil ? "" : self.item.description)
  end
end


#============================================================================
# ** Window_Recipe
#----------------------------------------------------------------------------
#   This window displays recipes currently in possesion
#============================================================================
class Window_Recipe < Window_Selectable
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 64, 320, 416)
    refresh
    self.index = 0
    @prev_recipe = nil
  end
  #--------------------------------------------------------------------------
  # * Current Recipe
  #--------------------------------------------------------------------------
  def recipe
    return @data[self.index]
  end
  #--------------------------------------------------------------------------
  # * Refresh Contents
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.clear
      self.contents = nil
    end
    @data = []
    # Add Recipes in possession
    for i in 0...Crafting::RECIPE.size
      recipe_id = Crafting::RECIPE[i][0]
      if $game_party.item_number(recipe_id) > 0
        @data.push(Crafting::RECIPE[i])
      end
    end
    @item_max = @data.size
    # Resize recipe window
    if Crafting::RESIZE_MENU
      self.height = @data[0] == nil ? 96 : @item_max * 32 + 64
      self.height = 416 if self.height > 416
    end
    # If Any recipes are possessed, draw them
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, @item_max * 32 + 32)
      for i in 0...@item_max
        draw_recipes(i)
      end
    else
      self.contents = Bitmap.new(width - 32, height - 32)
    end
    # Draw Header
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 268, 32, 'Recipes Held', 1)
  end
  #-------------------------------------------------------------------------
  # * Draw Recipes
  #-------------------------------------------------------------------------
  def draw_recipes(index)
    recipe = @data[index]
    x = 4
    y = index * 32 + 32
    # check if recipe is can be created
    self.contents.font.color = recipe_can_create?(recipe) ?
                               normal_color : disabled_color
    rect = Rect.new(x, y, self.width - 32, 32)
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
    bitmap = RPG::Cache.icon($data_items[recipe[0]].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)
    item = $data_items[recipe[0]]
    self.contents.font.color = opacity == 255 ?
                               GG_QualityColors::Quality[item.quality] : disabled_color
    self.contents.draw_text(x + 28, y, 212, 32, item.name)
  end
  #--------------------------------------------------------------------------
  # * Can Recipe be Created
  #     recipe    : array with recipe data
  #--------------------------------------------------------------------------
  def recipe_can_create?(recipe)
    return false unless recipe
    for i in 2...recipe.size
      case recipe[i][0]
      when 0 # Item
        unless $game_party.item_number(recipe[i][1]) >= recipe[i][2]
          return false
        end
      when 1 # Weapon
        unless $game_party.weapon_number(recipe[i][1]) >= recipe[i][2]
          return false
        end
      when 2 # Armor
        unless $game_party.armor_number(recipe[i][1]) >= recipe[i][2]
          return false
        end
      end
    end
    return true
  end
  #--------------------------------------------------------------------------
  # * Update Cursor Rectangle
  #--------------------------------------------------------------------------
  def update_cursor_rect
    # If cursor position is less than 0
    if @index < 0
      self.cursor_rect.empty
      return
    end
    # Get current row
    row = @index
    # If current row is before top row
    if row < self.top_row
      # Scroll so that current row becomes top row
      self.top_row = row
    end
    # If current row is more to back than back row
    if row > self.top_row + (self.page_row_max - 1)
      # Scroll so that current row becomes back row
      self.top_row = row - (self.page_row_max - 1)
    end
    # Calculate cursor width
    cursor_width = self.width - 32
    # Calculate cursor coordinates
    x = 0
    y = @index * 32 - self.oy + 32
    # Update cursor rectangle
    self.cursor_rect.set(x, y, cursor_width, 32)
  end
  #--------------------------------------------------------------------------
  # * Help Text Update
  #--------------------------------------------------------------------------
  def update_help
    return if @prev_recipe == self.recipe
    @prev_recipe = self.recipe
   
    if self.recipe == nil
      item = nil
      @help_window.set_text('')
    else
      case self.recipe[1][0]
      when 0 # item
        item = $data_items[self.recipe[1][1]]
      when 1 # weapon
        item = $data_weapons[self.recipe[1][1]]
      when 2 # armor
        item = $data_armors[self.recipe[1][1]]
      end
      if item != nil
        #bitmap = RPG::Cache.icon(item.icon_name)
        @help_window.contents.clear
        @help_window.contents.draw_text(0, 0, 100, 32, 'Creates')
        @help_window.draw_item_name(item, 80, 0)
      end
      #@help_window.set_text('Creates       ' + item.name) if item != nil
      #@help_window.contents.blt(78, 4, bitmap, Rect.new(0, 0, 24, 24)) if item != nil
    end
  end
end
#============================================================================
# ** Scene_Crafting
#----------------------------------------------------------------------------
#    This scene handles the menu used for crafting new items
#============================================================================
class Scene_Crafting
  #--------------------------------------------------------------------------
  # * Main Processing
  #--------------------------------------------------------------------------
  def main
    # Draw map in background
    map = Spriteset_Map.new if Crafting::RESIZE_MENU
    # Create Windows
    @recipe_window = Window_Recipe.new
    @index = 0
    @material_index = 0
    @material_window = Window_Materials.new(@recipe_window.recipe)
    @help_window = Window_Help.new
    # Associate help window
    @material_window.help_window = @help_window
    @recipe_window.help_window = @help_window
    # Execute transition
    Graphics.transition
    # Main loop
    loop do
      # Update Graphics
      Graphics.update
      # Update Input
      Input.update
      # Update Frame
      update
      # If scene has changed
      if $scene != self
        break
      end
    end
    # Dispose windows
    map.dispose if Crafting::RESIZE_MENU
    @recipe_window.dispose
    @material_window.dispose
    @help_window.dispose
  end
  #--------------------------------------------------------------------------
  # * Update Frame
  #--------------------------------------------------------------------------
  def update
    # Update current window
    @help_window.update
    if @recipe_window.active
      @recipe_window.update
      @material_window.refresh(@recipe_window.recipe)
      update_recipe
      return
    else
      @material_window.update
      update_material
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Update Recipe Window
  #--------------------------------------------------------------------------
  def update_recipe
    # if B button is pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Return to main menu
      $scene = Scene_Menu.new(4)
      return
    end
    # if C button is pressed
    if Input.trigger?(Input::C)
      # Get recipe
      recipe = @recipe_window.recipe
      # check if recipe can be created
      if @recipe_window.recipe_can_create?(recipe)
        # Play decision SE
        $game_system.se_play($data_system.decision_se)
        # Prompt player
        create_item_prompt(recipe)
        return
      else
        # Play buzzer SE
        $game_system.se_play($data_system.buzzer_se)
      end
      return
    end
    # if Right button is pressed
    if Input.trigger?(Input::RIGHT)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # Switch to materials window
      @index = @recipe_window.index
      @recipe_window.index = -1
      @recipe_window.active = false
      @material_window.active = true
      @material_window.index = @material_index
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Update Material Window
  #--------------------------------------------------------------------------
  def update_material
    # if B Button is pressed
    if Input.trigger?(Input::B)
      # Play cancel SE
      $game_system.se_play($data_system.cancel_se)
      # Return to main menu
      $scene = Scene_Menu.new
      return
    end
    # if Left button is pressed
    if Input.trigger?(Input::LEFT)
      # Play cursor SE
      $game_system.se_play($data_system.cursor_se)
      # Switch to recipes window
      @material_index = @material_window.index
      @material_window.index = -1
      @material_window.active = false
      @recipe_window.index = @index
      @recipe_window.active = true
      return
    end
  end
  #--------------------------------------------------------------------------
  # * Create Item Prompt
  #--------------------------------------------------------------------------
  def create_item_prompt(recipe)
    # Create item Prompt
    command = Window_Prompt.new
    # Deactivate recipe window
    @recipe_window.active = false
    # Loop until selection is made
    loop do
      # Update Graphics
      Graphics.update
      # Update input
      Input.update
      # Update commands
      command.update
      # if B button is pressed
      if Input.trigger?(Input::B)
        # Play cancel SE
        $game_system.se_play($data_system.cancel_se)
        # Return to recipe window
        break
      end
      # if C button is pressed
      if Input.trigger?(Input::C)
        case command.index
        when 0 # Create
          # Play create SE
          $game_system.se_play($data_system.equip_se)
          # Add item to inventory
          case recipe[1][0]
          when 0 # item
            $game_party.gain_item(recipe[1][1], 1)
          when 1 # weapon
            $game_party.gain_weapon(recipe[1][1], 1)
          when 2 # armor
            $game_party.gain_armor(recipe[1][1], 1)
          end
          # Remove ingredients
          for i in 2...recipe.size
            case recipe[i][0]
            when 0 # item
              # BREWMEISTER's MODIFICATION for consumable/non-consumable items
              if $data_items[recipe[i][1]].consumable   ##BREW
                $game_party.lose_item(recipe[i][1], recipe[i][2])
              end                                       ##BREW
              # END MODIFICATION
            when 1 # weapon
              $game_party.lose_weapon(recipe[i][1], recipe[i][2])
            when 2 # armor
              $game_party.lose_armor(recipe[i][1], recipe[i][2])
            end
          end
          # Refresh recipe window
          @recipe_window.refresh
          break
        when 1 # Cancel
          # Play cancel SE
          $game_system.se_play($data_system.cancel_se)
          # Return to recipe window
          break
        end
      end
    end
    command.dispose
    @recipe_window.active = true
  end
end





   


   
   


   
   

Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!



Nintendo Switch Friend Code: 8310-1917-5318
Discord: KK20 Tyler#8901

Join the CP Discord Server!

panzerkunst

It works !  :haha:
I can't thank you enough!  It's perfect!