Locked Commands Fix
Locked Commands FixIntroduction
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):
Spoiler: Normal Shop Window
https://i.imgur.com/82NF4bG.png
With the code:
Spoiler: Hidden Command
https://i.imgur.com/IbeYplv.png
How to Use
Just paste the code into the additional code area (below the other codes and above the main).
Script
Spoiler: Code 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.
本贴来自国际rpgmaker官方论坛作者:Faherya处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/locked-commands-fix.90760/
页:
[1]