Help - Search - Members - Calendar
Full Version: Quick Window_Status edit. [SOLVED]
RPG RPG Revolution Forums > Scripting > Script Development and Support
Wonderjosh
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!
The Law G14
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
Wonderjosh
Yeah that works wonderfully! Didn't know I just had to adjust window_base a little wink.gif Thanks a lot, Law!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.