Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

> VX's Window_Command bug
PK8
post Sep 12 2012, 09:42 AM
Post #1


I walk the long road to redemption.
Group Icon

Group: Local Mod
Posts: 179
Type: Scripter
RM Skill: Advanced
Rev Points: 40






A few years ago, I was working on my first ever menu script (which I never ever released), I came across a bug with VX's Window_Command window. I was setting up a window that had its column_max set to 1 and its row_max (the window would allow scrolling if my menu had more choices than I specified) set to 6.


I took this from an old YouTube video of mine. The text for the choices after number 6 weren't drawn.


The problem stemmed from the refresh method of the Window_Command class. Here's how the code looked:
CODE
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    for i in 0...@item_max
      draw_item(i)
    end
  end


I added create_contents in a new line in between self.contents.clear and for i in 0...@item_max. The refresh method should look like this:
CODE
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    create_contents
    for i in 0...@item_max
      draw_item(i)
    end
  end


And it fixed my problem:


__________________________
Go to the top of the page
 
+Quote Post
   

Posts in this topic
- PK8   VX's Window_Command bug   Sep 12 2012, 09:42 AM


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: 19th June 2013 - 10:49 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker