Faherya

The Knight of the Sad Figure
Veteran
Joined
Jul 25, 2013
Messages
256
Reaction score
590
First Language
Portuguese
Primarily Uses
RMVXA
Locked Commands Fix

Introduction
Ignore misspellings, I do not speak english.
When certain functions of some menus are blocked, the command continues to appear, but darkened. I find it interesting to show these options only when they are useful so this code prevents them from appearing. It is a small explanation, but a small function as well.

Features
- Hides locked options.

Screenshots
As an example, look at the store options window (I'm sorry, the images are in Portuguese):
82NF4bG.png
With the code:
IbeYplv.png

How to Use
Just paste the code into the additional code area (below the other codes and above the main).

Script
Code:
#===============================================================================
#                        Locked Commands Fix
#===============================================================================
# This code removes locked options from several scenes, showing them normally
# when they are released.
#-------------------------------------------------------------------------------
# Continue, on Title.
class Window_TitleCommand
  alias :add_command_Continue :add_command
  def add_command(*args)
    name, symbol = *args
    return if symbol === :continue && !continue_enabled
    add_command_Continue(*args)
  end
end
#-------------------------------------------------------------------------------
# Sell, on Shop.
class Window_ShopCommand
  alias :add_command_Sell :add_command
  def add_command(*args)
    name, symbol = *args
    return if symbol === :sell && @purchase_only
    add_command_Sell(*args)
  end
end
#-------------------------------------------------------------------------------
# Save and Formation, on Menu.
class Window_MenuCommand
  alias :add_command_Save :add_command
  def add_command (*args)
    name, symbol = *args
    return if symbol === :save && !save_enabled
    add_command_Save(*args)
  end
  alias :add_command_Formation :add_command
  def add_command (*args)
    name, symbol = *args
    return if symbol === :formation && !formation_enabled
    add_command_Formation(*args)
  end
end
#-------------------------------------------------------------------------------
# Escape, on Battle.
class Window_PartyCommand
  alias :add_command_Escape :add_command
  def add_command (*args)
    name, symbol = *args
    return if symbol === :escape && !BattleManager.can_escape?
    add_command_Escape(*args)
  end
end
#-------------------------------------------------------------------------------

FAQ
Q: What are the terms of use?
A: Free for commercial and non-commercial projects.

Credit and Thanks
- Faherya
- Special thanks to Alisson, Kyo Panda and MayLeone.

Author's Notes
The changes are ridiculously simple, solves only one detail that bothers me. You do not even have to credit me if you use it. Notice that the only thing I did was to insert the lines of the respective commands into a condition. Therefore, if there are any compatibility problems with codes that change these functions try to do the same. Anyway, that's it.
 
Last edited:

Canini

Veteran
Veteran
Joined
Mar 29, 2016
Messages
1,025
Reaction score
695
First Language
Swedish
Primarily Uses
RMVXA
I too, find it more aesthetically pleasing when non-selectable options are not there at all rather than darkened. Also, you could use it to make it appear to the player as if more options become available as the game progresses. Thanks for sharing!
 

Latest Threads

Latest Posts

Latest Profile Posts

So got my hearing tested to see if it was the cause of my mishearing what people say. Test showed no problems but talked with the doctor about anxiety and ADHD causing hearing issues and she agreed and also added that some people hear things differently. With my anxiety cause I am in fight or flight I pay attention to all the sounds in the area so body knows when react. Can't pay attention to one source.
Welp, people are trying to quit my team because I can't code. Where's the dancing blob emoji when I need it?

Forum statistics

Threads
116,053
Messages
1,095,326
Members
151,407
Latest member
BearsWithHooves
Top