Main Menu
  • Welcome to The RPG Maker Resource Kit.

Menu Window not properly modified [solved]

Started by Michus, July 25, 2012, 03:27:26 PM

0 Members and 1 Guest are viewing this topic.

Michus

So I have struggled through the fundamentals of this and almost have it working.

Basically what I've done is replaced the 'steps taken' window on the menu with one of my own creation and tweaking.  I've put in the necessary information in Scene_Menu to get it to display on the menu and in the right location and be disposed of properly but I can't get the window to update with the correct information as the $game_switches changes over the course of the game.  It might be a problem with how I am getting the information to update onto scene_menu but I am not sure, that part looks like it's working fine.

Here is the code:

#==============================================================================
# ** Window_Sex
#------------------------------------------------------------------------------
#  This window displays gender
#==============================================================================

class Window_Sex < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
 
  def pink
    return Color.new(255, 0, 153)
  end
 
  def purple
    return Color.new(205, 0, 255)
  end
 
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    self.contents.clear
    if
      $game_switches[80] = true
      then
      self.contents.font.color = pink
      self.contents.draw_text(0, 0, 160, 32, "Female")
    elsif
      $game_switches[80] = false
      then
      self.contents.font.color = purple
      self.contents.draw_text(0, 0, 160, 32, "Male")
    else
    end
  end
 
end


The window is created and torn down properly and it has the 'Female' information in it with the correct colour but it does not update the male information even when I change the switch in game.

Your help is appreciated!

DoctorTodd

Game switches needs to be on the same line as if and you need a second equal sign. There is also no need for then.

Michus

AhAHaha IT WORKS!

Thank you, I knew it was something stupidly obvious.   ;D

An hour bashing my head in and some clever git shows me the right way to do it in 5 minutes, bless this forum.