Neo Menu System
Versión: 1.04
Rpg Maker VX Ace
Creditos: Zetu
Personaliza los objetos del menú fácilmente, agrega o quita opciones al menú.
Script Principal
Código:
#======================#
# Z-Systems by: Zetu #
#===========================#======================#===========================#
# * * * Z01 Neo Menu System v1.04 * * * #
#=#==========================================================================#=#
# Insert ALL menu commands, each menu item array will contain... #
# [0] Name of Command (String) #
# [1] If command is enabled (Boolean or String) #
# [2] Requires Selection (Boolean) #
# [3] Command to Run #
# [4] (Only if [3]==:command_custom) Scene to go to #
#--------------------------------------------------------------------------#
# Tip on finding the code within a script: #
# Use Ctrl+F '$scene ='. This should be able to locate the call method #
# used in most every script. #
#==========================================================================#
module Z01
def self.menucommandlist
return [
# (Convert) | (Convert) When to |Require | Scene or
# Item Name | Enable this command |Selection?| Command
[Vocab::item, "main_commands_enabled", false, Scene_Item],
[Vocab::skill, "main_commands_enabled", true, Scene_Skill],
[Vocab::equip, "main_commands_enabled", true, Scene_Equip],
[Vocab::status,"main_commands_enabled", true, Scene_Status],
[Vocab::formation, "formation_enabled", false, :command_formation],
[Vocab::save, "save_enabled", false, Scene_Save],
[Vocab::game_end, true, false, Scene_End],
# Example of Custom Menu Item!
# ["Quest Log", true, false, :command_custom, Scene_QuestLog]
]
end
#========#======================#====#================================#========#
#--------# #----# DO NOT EDIT PAST THIS POINT!!! #--------#
#--------# End of Customization #----# Editing will cause death by #--------#
#--------# #----# brain asplosions. #--------#
#========#======================#====#================================#========#
end
class Window_MenuCommand < Window_Command
def make_command_list
i = 0
for command in Z01::menucommandlist
symbol = eval(":s#{i}")
add_command(tryconvert(command[0]), symbol, tryconvert(command[1]),
command[3])
i += 1
end
end
end
class Scene_Menu < Scene_MenuBase
def create_command_window
@command_window = Window_MenuCommand.new
i = 0
for command in Z01::menucommandlist
symbol = eval(":s#{i}")
if !command[2]
@command_window.set_handler(symbol, getmethod(command[3]))
else
@command_window.set_handler(symbol, method(:command_personal))
end
i += 1
end
@command_window.set_handler(:cancel, method(:return_scene))
end
def getmethod(item)
if item.is_a?(Symbol)
return method(item)
else
return method(:command_custom)
end
end
def on_personal_ok
getmethod(@command_window.current_ext).call
end
def command_custom
print " - "
print @command_window.current_ext
print " -\n"
SceneManager.call(@command_window.current_ext)
end
end
Núcleo (Necesario para que funcione).
Código:
#======================#
# Z-Systems by: Zetu #
#===========================#======================#===========================#
# * * * CORE v1.01 * * * #
#=#==========================================================================#=#
# For Z01 to Z07+ #
# * Make sure ALL Z items are in order and adjacent to each other, with #
# this script preceeding them. #
#--------------------------------------------------------------------------#
# General Methods : #
# Object #
# rand_range(min, max) #
# Give a random value between the two given values. #
# Array #
# random #
# Returns a random item in an array. #
# random! #
# Returns a random item in array and deletes it. #
# sum #
# Returns sum of all values in an array. #
# mean #
# Returns the average of all values in an array #
#--------------------------------------------------------------------------#
# Handled Methods (RGSS3) #
# Window_BattleLog #
# display_action_results #
#==========================================================================#
($imported||={})[:zcore] = true
module Z
def self.display_command_symbols
symbols = []
symbols.push(:critical)
symbols.push(:hpdamage)
symbols.push(:ampxdamage) if $imported[:z02]
symbols.push(:mpdamage) unless $imported[:z02]
symbols.push(:tpdamage)
symbols.push(:miss)
symbols.push(:evasion)
symbols.push(:steal) if $imported[:z05]
symbols.push(:states)
end
end
#========#======================#====#================================#========#
#--------# #----# DO NOT EDIT PAST THIS POINT!!! #--------#
#--------# End of Customization #----# Editing will cause death by #--------#
#--------# #----# brain asplosions. #--------#
#========#======================#====#================================#========#
class Window_BattleLog < Window_Selectable
#--------------------------------------------------------------------------
# ● Overwrite method: display_action_results
#--------------------------------------------------------------------------
def display_action_results(target, item)
if target.result.used
last_line_number = line_number
for symbol in Z::display_command_symbols
case symbol
when :critical; display_critical(target, item)
when :damage; display_damage(target, item)
when :hpdamage, :mpdamage, :tpdamage, :ampxdamage
if !target.result.missed and !target.result.evaded
case symbol
when :hpdamage; display_hp_damage(target, item)
when :mpdamage; display_mp_damage(target, item)
when :tpdamage; display_tp_damage(target, item)
when :ampxdamage; display_ampx_damage(target, item)
end
end
when :states; display_affected_status(target, item)
when :steal; display_steal(target, item)
end
end
display_failure(target, item)
wait if line_number > last_line_number
back_to(last_line_number)
target.reset_steal_item if $imported[:z05] unless target.actor?
end
end
alias :zdf :display_failure
def display_failure(target, item)
return unless target.result.steal.nil?
zdf(target, item)
end
#--------------------------------------------------------------------------
# ● New method: display_steal (Z05)
#--------------------------------------------------------------------------
def display_steal(target, skill)
return unless skill.steal?
item = target.last_stolen_item
result = target.result.steal
case result
when :success
if item.is_a?(Integer)
add_text(sprintf(Z05::STEAL_GOLD, item, target.name))
else
add_text(sprintf(Z05::STEAL_ITEM, item.name, target.name))
end
when :nosteal
add_text(sprintf(Z05::NO_STEALS, target.name))
when :fail
add_text(Z05::STEAL_FAIL)
end
end
#--------------------------------------------------------------------------
# ● New method: display_ampx_damage (Z02)
#--------------------------------------------------------------------------
def display_ampx_damage(target, item)
return if target.dead? || target.result.mp_damage == 0
return if (resource = target.resource(item)).nil?
Sound.play_recovery if target.result.mp_damage < 0
add_text(target.result.ampx_damage_text(resource.name))
wait
end
end
module DataManager
#--------------------------------------------------------------------------
# ● Overwrite method: make_save_contents
#--------------------------------------------------------------------------
def self.make_save_contents
contents = {}
contents[:system] = $game_system
contents[:timer] = $game_timer
contents[:message] = $game_message
contents[:switches] = $game_switches
contents[:variables] = $game_variables
contents[:self_switches] = $game_self_switches
contents[:actors] = $game_actors
contents[:party] = $game_party
contents[:troop] = $game_troop
contents[:map] = $game_map
contents[:player] = $game_player
#------------------------=
contents[:quest] = QuestLog.questlist if $imported[:z07]
#------------------------=
contents
end
#--------------------------------------------------------------------------
# ● Overwrite method: extract_save_contents
#--------------------------------------------------------------------------
def self.extract_save_contents(contents)
$game_system = contents[:system]
$game_timer = contents[:timer]
$game_message = contents[:message]
$game_switches = contents[:switches]
$game_variables = contents[:variables]
$game_self_switches = contents[:self_switches]
$game_actors = contents[:actors]
$game_party = contents[:party]
$game_troop = contents[:troop]
$game_map = contents[:map]
$game_player = contents[:player]
#-------------------=
QuestList.loadquestlist(contents[:quest]) if $imported[:z07]
#-------------------=
end
end
class Object
#--------------------------------------------------------------------------
# ● New method: rand_range
#--------------------------------------------------------------------------
def rand_range(min, max)
rand(max - min + 1) + min
end
end
class Array
#--------------------------------------------------------------------------
# ● New method: random
#--------------------------------------------------------------------------
def random
self[rand(size)]
end
#--------------------------------------------------------------------------
# ● New method: random!
#--------------------------------------------------------------------------
def random!
self.delete_at(rand(size))
end
#--------------------------------------------------------------------------
# ● New method: sum
#--------------------------------------------------------------------------
def sum
self.inject{|sum,x| sum + x }
end
#--------------------------------------------------------------------------
# ● New method: mean
#--------------------------------------------------------------------------
def mean
sum.to_f / size
end
end
class Object
def tryconvert(value)
begin
return eval(value)
rescue
return value
end
end
end