Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Quick Window_Status edit. [SOLVED], Empty equipment slots to read "empty"
Wonderjosh
post Mar 28 2012, 05:23 PM
Post #1


Level 3
Group Icon

Group: Member
Posts: 33
Type: Artist
RM Skill: Undisclosed




Just wondering if this would be the right way to go about adjusting the status window, when there's an empty equipment slot for the character, to read "empty". Hopefully that sentence is constructed well enough to make sense, haha.

Anyway, here's what I'm thinking (just using the 4th armor slot as an example):
CODE
      if @actor.armor4_id == nil
      self.contents.font.color = system_color
      self.contents.draw_text(112, 80, 150, 32, "Empty")
      end


Now I HAVE plugged it in, but nothing's showing up, so if this is the right way to write the code then I'm at a loss, haha. But if there's a proper way to script this, any help would be awesome. Thanks!

This post has been edited by Wonderjosh: Mar 29 2012, 08:59 AM
Go to the top of the page
 
+Quote Post
   
The Law G14
post Mar 28 2012, 06:38 PM
Post #2


Scripter FTW
Group Icon

Group: Local Mod
Posts: 1,346
Type: Scripter
RM Skill: Skilled
Rev Points: 5




Hey man smile.gif

First of all you need to find out what you want to edit. We'll go step by step. First of all, the place where the "name" of the weapon/armor is positioned is located in the Window_EquipRight class. If you go down in the refresh method, you'll see it uses a method called draw_item_name to draw the weapon name (and it's icon). So now that we've identified the place where we'll be editing, you need to find this method, which happens to be contained in the Window_Base class. To not make this description overly long, just replace that method with this method and you should be set:

CODE
#--------------------------------------------------------------------------
  # * Draw Item Name
  #     item : item
  #     x    : draw spot x-coordinate
  #     y    : draw spot y-coordinate
  #--------------------------------------------------------------------------
  def draw_item_name(item, x, y)
    if item == nil
      self.contents.font.color = normal_color
      self.contents.draw_text(x + 28, y, 212, 32, "Empty")
    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, 212, 32, item.name) if !outline
    self.contents.draw_outline_text(x + 28, y, 212, 32, item.name) if outline
  end


Hope this helps smile.gif


__________________________

To put in sig, copy this link:
CODE
[url="http://www.rpgrevolution.com/forums/index.php?showtopic=51540"][img]http://img40.imageshack.us/img40/6504/conceptthelawbanner.png[/img][/url]


Sig Stuff


"When you first come, no one knows you. When help them out, they all know you. When you leave, they all love you. When you come back, they've already forgotten you." -- copy into your sig if you think this quote speaks true!

If you are one of the very few teenagers that know what real rap is and don't blindly listen to the hate statements (rap is crap), then put this in your sig. I say this in the name of Common, Mos Def, Lupe Fiasco, 2Pac, Nas, Talib Kweli, Eminem, and many others. -Exiled One

My Project Thread: Gai's Hunters


Go to the top of the page
 
+Quote Post
   
Wonderjosh
post Mar 28 2012, 09:55 PM
Post #3


Level 3
Group Icon

Group: Member
Posts: 33
Type: Artist
RM Skill: Undisclosed




Yeah that works wonderfully! Didn't know I just had to adjust window_base a little wink.gif Thanks a lot, Law!
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 20th May 2013 - 07:13 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker