public

Rpg Maker Developers Group

Simple enough for a child, powerful enough for a developer

2 Followers

MV [SOLVED] How to make a switchable function

BMM_Archive · July 15, 2026

Preserved forum archive. This topic stores the original first post and locally mirrored RPG Maker Web attachments when available. It is posted by the BMMPlay archive account, not by the original creator.

Original Source

  • Original title: MV [SOLVED] How to make a switchable function
  • Original author: RyanBram
  • Original date: November 4, 2020
  • Source thread: https://forums.rpgmakerweb.com/threads/solved-how-to-make-a-switchable-function.129521/
  • Source forum path: Game Development Engines > RPG Maker Javascript Plugins > Javascript/Plugin Support

Summary

Hi, Yesterday my friend share me the code to change menu when specific Switch was ON. This is the code: I am trying to hide some Menu Commands when switch was on by adding some commented code like this:

Archived First Post

Hi,
Yesterday my friend share me the code to change menu when specific Switch was ON.

This is the code:
https://gist.githubusercontent.com/elleonard/6a658a4cef9c152313340e08539e16de/raw/f0ed8222088932ead6235b33821671555ce6cd1f/MenuDisplayLogicSwitch.js

I am trying to hide some Menu Commands when switch was on by adding some commented code like this:

Code:
Window_MenuCommand.prototype.addFormationCommand = function() {};
Window_MenuCommand.prototype.addMainCommands = function() {
    var enabled = this.areMainCommandsEnabled();
//    if (this.needsCommand('item')) {
//        this.addCommand(TextManager.item, 'item', enabled);
//    }
//    if (this.needsCommand('skill')) {
//        this.addCommand(TextManager.skill, 'skill', enabled);
//    }
//    if (this.needsCommand('equip')) {
//        this.addCommand(TextManager.equip, 'equip', enabled);
//    }
    if (this.needsCommand('status')) {
        this.addCommand("Units", 'status', enabled);
    }
  };

It works, but it doesn't follow the Switch as intended, so the change in menu are permanent instead of switchable.

How to make the code above switchable?

Thanks.

Downloads / Referenced Files

Log in to download

Log in, then follow the RPG Maker Developers Group to see these download links.

Log in to download
Creator Claims / Removal

If you are the original creator and want this listing reassigned, edited, or removed, join BMMPlay and contact the moderators with proof that matches the original RPG Maker Web profile, linked GitHub, itch.io page, or another public creator identity.

#rpg-maker-archive#js-support

Replies (0)

No replies yet.

0 replies 1 view

Log in to reply.

User Avatar