• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

Modular Menu entry switch

66
Posts
6
Years
    • Seen May 2, 2020
    This is a pretty dumb question but I have Luka S.J's modular menu script and I want to know how you make it so that an entry for the menu only appears once a switch is activated.
    This is my entry that I made:
    Code:
    # Global Trade Station
    MenuHandlers.addEntry(:GTS,"GTS","menuGts",proc{|menu|
      scene = PokemonSave_Scene.new
      screen = PokemonSaveScreen.new(scene)
      menu.pbEndScene
      menu.endscene = false
      if screen.pbSaveScreen
        menu.close = true
        pbBGMPlay("Trade Resort - Brick Bronze OST")
        GTS.open
      else
        menu.pbStartScene
        menu.pbShowMenu
        menu.close = false
      end
    },proc{ return true })
     

    Ego13

    hollow_ego
    311
    Posts
    6
    Years
  • Depending on how the rest of the script looks you could suround that part with an if statement
    example

    Code:
    # Global Trade Station
    if $game_switches[99]
    MenuHandlers.addEntry(:GTS,"GTS","menuGts",proc{|menu|
      scene = PokemonSave_Scene.new
      screen = PokemonSaveScreen.new(scene)
      menu.pbEndScene
      menu.endscene = false
      if screen.pbSaveScreen
        menu.close = true
        pbBGMPlay("Trade Resort - Brick Bronze OST")
        GTS.open
      else
        menu.pbStartScene
        menu.pbShowMenu
        menu.close = false
      end
    },proc{ return true })
    end

    EDIT: Actually nevermind that. i checked the script and there already is a method

    Code:
    MenuHandlers.addEntry(:NAME,"Text displayed","icon name",proc{|menu|
      # your lines of code go here
      # keep in mind that the 'proc{|menu| ' part always has to be like this
      # for every entry in your menu, when you go about defining the actual
      # functionality that is run when the player selects that menu element
      }
    },proc{
      # block of code that checks if the player has access to the menu element
      # MUST ALWAYS return a boolean expression
      # or if you want the player to always be able to trigger this:
      return true
    })
     
    Last edited:
    Back
    Top