RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Menu Window not properly modified [solved]

0 Members and 1 Guest are viewing this topic.

**
Rep: +0/-0Level 55
Game Maker
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:

Code: [Select]
#==============================================================================
# ** 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!
« Last Edit: July 25, 2012, 04:07:07 PM by Michus »

****
Rep:
Level 71
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.

**
Rep: +0/-0Level 55
Game Maker
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.