Notice: fwrite(): Write of 483 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 59 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 1714 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96

Notice: fwrite(): Write of 8192 bytes failed with errno=28 No space left on device in /home/rmrk/domains/rmrk.net/public_html/Sources/Cache/APIs/FileBased.php on line 96
Print Page - Menu Window not properly modified [solved]

The RPG Maker Resource Kit

RMRK RPG Maker Creation => RPG Maker General => General Scripting => Topic started by: Michus on July 25, 2012, 03:27:26 PM

Title: Menu Window not properly modified [solved]
Post by: Michus on July 25, 2012, 03:27:26 PM
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!
Title: Re: Menu Window not properly modified by $game_switches
Post by: DoctorTodd on July 25, 2012, 03:40:16 PM
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.
Title: Re: Menu Window not properly modified by $game_switches
Post by: Michus on July 25, 2012, 03:43:38 PM
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.