MenuDisabler VX
MenuDisabler VXby Kyonides
Introduction
Do you need to block the player's ability to consume items?
Or do you hate the team and wish to make it suffer by blocking all skills just because?
Or perhaps you should prevent the player from equiping new gear at any specific moment...
If any of those things is true, then this scriptlet is for you!
Just configure the game switch ID's accordingly.
Ruby:
# * MenuDisabler VX * #
# Scripter : Kyonides Arkanthes
# 2023-11-17
# It uses 3 game switches to block items, skills or equipment.
module MenuDisabler
BLOCK_ITEM_SWITCH= 100
BLOCK_SKILL_SWITCH = 150
BLOCK_EQUIP_SWITCH = 200
end
class Window_Command
def change_command(name, enabled)
cmd = @commands.find {|v| v == name }
n = @commands.index(cmd)
draw_item(n, enabled) if n
end
def make_command_indexes
@names = {}
@commands.each_with_index {|c, n| @names = c }
end
def current_name
@names[@index]
end
end
class Scene_Menu
include MenuDisabler
alias :kyon_disable_equip_scn_mn_crt_cmd_win :create_command_window
alias :kyon_disable_equip_scn_mn_cmd_sel :update_command_selection
def create_command_window
kyon_disable_equip_scn_mn_crt_cmd_win
@command_window.make_command_indexes
anybody = $game_party.members.size > 0
@states = {}
@states = (anybody and !$game_switches)
@states = (anybody and !$game_switches)
@states = (anybody and !$game_switches)
@states = anybody
@states = !$game_system.save_disabled
@states = true
@command_window.change_command(Vocab.item, @states)
@command_window.change_command(Vocab.skill, @states)
@command_window.change_command(Vocab.equip, @states)
end
def update_command_selection
if Input.trigger?(Input::C)
name = @command_window.current_name
return Sound.play_cancel unless @states
end
kyon_disable_equip_scn_mn_cmd_sel
end
end
Terms & Conditions
Free for use in ANY game.
Due credit is mandatory.
That's it!
本贴来自国际rpgmaker官方论坛作者:kyonides处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/menudisabler-vx.163037/
页:
[1]