PhoenixTilea
Member
Well, I'm slowly developing an understanding of RGSS, but not quite enough to know what the hell I'm doing here.
This class is supposed to create a window that will print a list of the character classes listed in the classes portion of the dtatbase. I've been trying to work off of some of the other windows, but I can't seem to figure this out:
I've tried several different things with line 15, and I can't figure out how to tell it to add the class names to that array and then output them in the draw_class method.
Basically, the output I'm looking for is:
Fighter
Lancer
Warrior
Theif
...
And so forth, unless - of course - I change the class names in the database, then that should reflect the changes...
Can anyone help me with this?
EDIT: Just a note. I'm immitating Window_Skill with the array push thing. It deals with specific actors, so it works differently than this. That's probably why I can't figure it out... I can't find anything in the help contents about $data_classes either.
This class is supposed to create a window that will print a list of the character classes listed in the classes portion of the dtatbase. I've been trying to work off of some of the other windows, but I can't seem to figure this out:
Code:
Â
class Window_Class < Window_Selectable
 def initialize(width, index)
  super(0, 120, 320, 360)
  self.contents = Bitmap.new(width - 32, height - 32)
  @column_max = 1
  self.index = 0
  refresh
 end
Â
 def refresh
  self.contents.clear
  @choices = []
  for i in 0..$data_classes.size
   classes = $data_classes[RPG::Class::id]
   if classes != nil
    @choices.push(classes)
   end
  end
  @item_max = @choices.size
  if @item_max > 0
   for i in 0..@item_max
    draw_class(i)
   end
  end
 end
Â
 def draw_class(index)
  classes = @choices[index]
  self.contents.draw_text(0, index * 32, 200, 32, classes.name)
 end
end
Â
I've tried several different things with line 15, and I can't figure out how to tell it to add the class names to that array and then output them in the draw_class method.
Basically, the output I'm looking for is:
Fighter
Lancer
Warrior
Theif
...
And so forth, unless - of course - I change the class names in the database, then that should reflect the changes...
Can anyone help me with this?
EDIT: Just a note. I'm immitating Window_Skill with the array push thing. It deals with specific actors, so it works differently than this. That's probably why I can't figure it out... I can't find anything in the help contents about $data_classes either.