2. Make a "Windows" folder in your project's "Graphics" folder. Insert the
# window skins you want to use there and adjust the WINDOW_HASH accordingly.
在"Graphics“新建一个“Windows”文件夹来放窗口。在更改WINDOW_HASH
这个脚本ms是我给你的。。哈。。不是完整的。。。等等。。。
[pre lang="ruby" line="1"]#===============================================================================
#
# Yanfly Engine Melody - System Game Options
# Last Date Updated: 2010.06.12
# Level: Normal
#
# System Game Options replaces the "Game End" scene found in the default RPG
# Maker VX with a system options menu. In this menu, the player can readjust
# sound volumes, automatic dashing, and more. This changes one of the unused
# game end scene into something a whole lot more useful.
#
#===============================================================================
# Updates
# -----------------------------------------------------------------------------
# o 2010.06.12 - Bugfix for disposing the skins window.
# o 2010.05.14 - Finished Script.
# o 2010.05.12 - Started Script.
#===============================================================================
# Instructions
# -----------------------------------------------------------------------------
# To install this script, open up your script editor and copy/paste this script
# to an open slot below ? Materials but above ? Main. Remember to save.
#
# 1. Scroll down, adjust the various Switches and Variable values to something
# empty or predetermined.
# 2. Make a "Windows" folder in your project's "Graphics" folder. Insert the
# window skins you want to use there and adjust the WINDOW_HASH accordingly.
#
#===============================================================================
# Compatibility
# -----------------------------------------------------------------------------
# - Replaces ALL of Scene_End. Expect no functionality with any scripts that
# will also replace Scene_End.
# - This script is made to be specifically compatible with Battle Engine Melody.
#===============================================================================
$imported = {} if $imported == nil
$imported["SystemGameOptions"] = true
module YEM
module SYSTEM
# This replaces the Game End title with the following text. And although
# script itself doesn't provide the icon, any script that may potentially
# link towards the System menu will reveal the System icon below.
TITLE = "系统"
ICON = 134
#===========================================================================
# Game System Commands
# --------------------------------------------------------------------------
# The following adjusts the order at which you would like the menu system
# commands to appear. Here is the reference table to their command ID's.
# :blank - Blank Item.
# :volume_bgm - Adjusts BGM volume.
# :volume_bgs - Adjusts BGS volume.
# :volume_sfx - Adjusts SFX volume.
# :animations - Turns on/off battle animations.
# :autocursor - Requires BEM. Memorized cursor position.
# :skill_help - Requires BEM. Display skill help.
# :next_actor - Requires BEM. Automatic Next Actor.
# :atb_active - Requires BEM. Sets ATB type.
# :atb_speed - Requires BEM. Sets ATB speed.
# :auto_dash - Controls if need to hold down dash button to run.
# :instant_text - Whether or not text appears instantly in messages.
# :windowskin - Changes the windowskin.
# :return_title - Return back to the title screen.
# :return_menu - Return back to the menu screen.
#===========================================================================
# This array modifies the order your system menu options appear in from
# top to bottom. Rearrange them as you see fit or remove them if desired.
COMMANDS =[
:windowskin, # Adjusts window skins.
:skill_help, # Requires BEM. Shows skill help.
:atb_active, # Requires BEM. Sets ATB type.
:atb_speeds, # Requires BEM. Sets ATB speed.
:animations, # Turns on/off battle animations.
:autocursor, # Requires BEM. Memory cursor.
:next_actor, # Requires BEM. Automatic Next Actor.
:bgm_volume, # Adjusts BGM volume.
:bgs_volume, # Adjusts BGS volume.
:sfx_volume, # Adjusts SFX volume.
:auto_dash, # Controls need to hold down dash button to run.
:instant_text, # Makes text appear instantly.
:blank, # A blank space.
:return_title, # Return to the title screen.
:return_menu, # Return back to the main menu.
] # Do not remove this.
# The following hash determines what variables and switches are used to
# adjust the system options menu. It's very important that you bind the
# values to the proper variables and switches in order for your game to
# run properly. In addition to adjusting the switches, you also apply
# text descriptions of each of the items here, too.
OPTIONS ={
# Option => Value
:bgm_variable => 190, # Variable used to adjust BGM volume.
:bgm_mute_sw => 201, # Switch used to mute/unmute the BGM.
:bgm_volume => "BGM 音量",
:bgm_des => "设置BGM音量 Z 切换没有和有",
:bgs_variable => 191, # Variable used to adjust BGS volume.
:bgs_mute_sw => 202, # Switch used to mute/unmute the BGS.
:bgs_volume => "BGS 音量",
:bgs_des => "设置BGS音量 Z 切换没有和有",
:sfx_variable => 192, # Variable used to adjust SFX volume.
:sfx_mute_sw => 203, # Switch used to mute/unmute the SFX.
:sfx_volume => "SFX 音量",
:sfx_des => "设置SFX音量 Z 切换没有和有",
:mute => "静音",
:audio => "音量 %d%%",
:atb_avariable => 193, # Variable used for ATB Active Type.
:atb_aname => "ActiveType",
:wait_0 => "Full",
:wait_0_des => "ATB Gauge does not stop with battle menus open.",
:wait_1 => "Semi",
:wait_1_des => "ATB Gauge stops during target selection.",
:wait_2 => "Stop",
:wait_2_des => "ATB Gauge stops with battle menus open.",
:wait_3 => "Wait",
:wait_3_des => "ATB Gauge stops with any member ready for action.",
:atb_svariable => 194, # Variable used for ATB Speeds.
:atb_sname => "Turn Speed",
:atb_s_des => "Adjusts battle speed. Higher values are faster.",
:animation_sw => 295, # Switch used to display/hide animations.
:animations => "动画",
:ani_des => "开/关动画",
:ani_show => "隐藏",
:ani_hide => "显示",
:autocursor_sw => 205, # Switch used for autocursors.
:autocursor => "AutoCursor",
:curmem_des => "Enables/Disables cursor memory for actions.",
:curmem_on => "Memory",
:curmem_off => "Reset",
:next_actor_sw => 206, # Switch used for automatic next actor.
:next_actor => "Next Actor",
:next_des => "Move to next actor after selecting commands",
:next_on => "Auto",
:next_off => "Manual",
:skill_help_sw => 207, # Switch used to enable skill help.
:skill_help => "Skill Help",
:help_des => "Display skill descriptions during battle phase.",
:help_on => "Enabled",
:help_off => "Disable",
:auto_dash_sw => 208, # Switch used to enable auto-dashing.
:auto_dash => "自动跑步",
:dash_des => "不需要按住Shift,角色会自动跑步",
:dash_on => "跑步",
:dash_off => "步行",
:inst_text_sw => 209, # Switch used to control instant text.
:instant_text => "即时文本",
:inst_des => "文字会一次出现,而不是一个一个",
:inst_on => "即时",
:inst_off => "正常",
:return_title => "回到标题",
:retitle_des => "返回到标题菜单,返回前请存档",
:return_menu => "返回到主菜单",
:remenu_des => "返回到主菜单",
:window_var => 195, # Variable used to change windowskins.
:windowskin => "窗口",
:wind_des => "更换游戏窗口",
} # Do not remove this.
# This sets the default fonts used for your windows. Note that in this
# array, if a player doesn't have the font in front, it'll use the next one
# onward until the player does have that font installed.
DEFAULT = ["长城粗圆体"]
WRITING = [""]
#===============================================================================
# Editting anything past this point may potentially result in causing computer
# damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
# Therefore, edit at your own risk.
#===============================================================================
#--------------------------------------------------------------------------
# new method: self.windows
#--------------------------------------------------------------------------
def self.windows(filename); load_bitmap("Graphics/Windows/", filename); end
end # Cache
YEM::SYSTEM::WINDOWSKIN_VARIABLE = YEM::SYSTEM::OPTIONS[:window_var]
#===============================================================================
# RPG::BGM
#===============================================================================
unless $imported["BattleEngineMelody"]
module RPG
class BGM < AudioFile
#--------------------------------------------------------------------------
# overwrite method: play
#--------------------------------------------------------------------------
def play
if @name.empty?
Audio.bgm_stop
@@last = BGM.new
else
vol = @volume
if $game_variables != nil
options = YEM::SYSTEM::OPTIONS
vol = vol * $game_variables[options[:bgm_variable]] / 100
vol = [[vol, 0].max, 100].min
vol = 0 if $game_switches[options[:bgm_mute_sw]]
end
Audio.bgm_play("Audio/BGM/" + @name, vol, @pitch)
@@last = self
end
end
end # BGM
class ME < AudioFile
#--------------------------------------------------------------------------
# overwrite method: play
#--------------------------------------------------------------------------
def play
if @name.empty?
Audio.me_stop
else
vol = @volume
if $game_variables != nil
options = YEM::SYSTEM::OPTIONS
vol = vol * $game_variables[options[:bgm_variable]] / 100
vol = [[vol, 0].max, 100].min
vol = 0 if $game_switches[options[:bgm_mute_sw]]
end
Audio.me_play("Audio/ME/" + @name, vol, @pitch)
end
end
end # ME
class BGS < AudioFile
#--------------------------------------------------------------------------
# overwrite method: play
#--------------------------------------------------------------------------
def play
if @name.empty?
Audio.bgs_stop
@@last = BGS.new
else
vol = @volume
if $game_variables != nil
options = YEM::SYSTEM::OPTIONS
vol = vol * $game_variables[options[:bgs_variable]] / 100
vol = [[vol, 0].max, 100].min
vol = 0 if $game_switches[options[:bgs_mute_sw]]
end
Audio.bgs_play("Audio/BGS/" + @name, vol, @pitch)
@@last = self
end
end
end # BGS
class SE < AudioFile
#--------------------------------------------------------------------------
# overwrite method: play
#--------------------------------------------------------------------------
def play
unless @name.empty?
vol = @volume
if $game_variables != nil
options = YEM::SYSTEM::OPTIONS
vol = vol * $game_variables[options[:sfx_variable]] / 100
vol = [[vol, 0].max, 100].min
vol = 0 if $game_switches[options[:sfx_mute_sw]]
end
Audio.se_play("Audio/SE/" + @name, vol, @pitch)
end
end
end # SE
end # RPG
end # $imported["BattleEngineMelody"]
#===============================================================================
# Game_System
#===============================================================================
#--------------------------------------------------------------------------
# alias method: dash?
#--------------------------------------------------------------------------
alias dash_sgo dash? unless $@
def dash?
if $game_switches[YEM::SYSTEM::OPTIONS[:auto_dash_sw]]
return false if @move_route_forcing
return false if $game_map.disable_dash?
return false if in_vehicle?
return false if Input.press?(Input::A)
return true
else
return dash_sgo
end
end
#--------------------------------------------------------------------------
# alias method: initialize
#--------------------------------------------------------------------------
alias initialize_window_sgo initialize unless $@
def initialize(x, y, width, height)
initialize_window_sgo(x, y, width, height)
self.update_windowskin
end
#--------------------------------------------------------------------------
# alias method: create_contents
#--------------------------------------------------------------------------
alias create_contents_base_sgo create_contents unless $@
def create_contents
create_contents_base_sgo
self.contents.font.color = normal_color
end
#--------------------------------------------------------------------------
# alias method: refresh
#--------------------------------------------------------------------------
alias refresh_savefile_mso refresh unless $@
def refresh
if @file_exist
n = @game_variables[YEM::SYSTEM::WINDOWSKIN_VARIABLE]
if n == 0 or !YEM::SYSTEM::WINDOW_HASH.include?(n)
n = YEM::SYSTEM::DEFAULT_SKIN_VALUE
end
skin = YEM::SYSTEM::WINDOW_HASH[n]
change_settings(skin)
end
refresh_savefile_mso
end
#--------------------------------------------------------------------------
# alias method: update_show_fast
#--------------------------------------------------------------------------
alias update_show_fast_sgo update_show_fast unless $@
def update_show_fast
if $game_switches[YEM::SYSTEM::OPTIONS[:inst_text_sw]]
if self.pause or self.openness < 255
@show_fast = false
else
@show_fast = true
end
if @show_fast and @wait_count > 0
@wait_count -= 1
end
else
update_show_fast_sgo
end
end
#--------------------------------------------------------------------------
# alias method: new_page
#--------------------------------------------------------------------------
alias new_page_sgo new_page unless $@
def new_page
self.update_windowskin
new_page_sgo
end
#--------------------------------------------------------------------------
# initialize
#--------------------------------------------------------------------------
def initialize(help_window)
dy = help_window.height
dh = Graphics.height - dy
super(0, dy, Graphics.width, dh)
self.index = 0
refresh
@help_window = help_window
update_help
end
#--------------------------------------------------------------------------
# item
#--------------------------------------------------------------------------
def item; return @data[self.index]; end
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
@data = []
for command in YEM::SYSTEM::COMMANDS
case command
when :windowskin, :animations, :bgm_volume, :sfx_volume, :bgs_volume,
:auto_dash, :instant_text, :blank, :return_title, :return_menu
when :skill_help, :atb_active, :atb_speeds, :autocursor, :next_actor
next unless $imported["BattleEngineMelody"]
if [:atb_active, :atb_speeds].include?(command)
type = $game_variables[YEM::BATTLE_ENGINE::BATTLE_TYPE_VARIABLE]
next unless type == 2
end
else; next
end
@data.push(command)
end
@item_max = @data.size
create_contents
for i in 0...@item_max; draw_item(i); end
end
#--------------------------------------------------------------------------
# draw_item
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
obj = @data[index]
return if obj == nil
case obj
when :windowskin
draw_window_item(obj, rect.clone)
when :bgm_volume, :sfx_volume, :bgs_volume
draw_volume_item(obj, rect.clone)
when :animations, :autocursor, :next_actor, :skill_help,
:auto_dash, :instant_text
draw_switch_item(obj, rect.clone)
when :atb_active, :atb_speeds
draw_atb_item(obj, rect.clone)
when :return_title, :return_menu
draw_solo_item(obj, rect.clone)
end
end
#--------------------------------------------------------------------------
# draw_solo_item
#--------------------------------------------------------------------------
def draw_solo_item(obj, rect)
options = YEM::SYSTEM::OPTIONS
case obj
when :return_title, :return_menu
text = options[obj]
else; return
end
self.contents.font.color = normal_color
self.contents.draw_text(rect.x, rect.y, rect.width, WLH, text, 1)
end
#--------------------------------------------------------------------------
# update
#--------------------------------------------------------------------------
def update
super
if Input.trigger?(Input::C)
input_case_c
elsif Input.repeat?(Input::LEFT)
input_case_left
elsif Input.repeat?(Input::RIGHT)
input_case_right
end
end
#--------------------------------------------------------------------------
# input_case_c
#--------------------------------------------------------------------------
def input_case_c
options = YEM::SYSTEM::OPTIONS
case item
when :windowskin
Sound.play_decision
$scene.open_skins_window
return
when :bgm_volume; switch = options[:bgm_mute_sw]
when :bgs_volume; switch = options[:bgs_mute_sw]
when :sfx_volume; switch = options[:sfx_mute_sw]
when :animations; switch = options[:animation_sw]
when :autocursor; switch = options[:autocursor_sw]
when :next_actor; switch = options[:next_actor_sw]
when :skill_help; switch = options[:skill_help_sw]
when :cinematics; switch = options[:cinematics_sw]
when :auto_dash; switch = options[:auto_dash_sw]
when :instant_text; switch = options[:inst_text_sw]
when :return_title
$scene.command_to_title
return
when :return_menu
Sound.play_decision
$scene.return_scene
return
else; return
end
$game_switches[switch] = !$game_switches[switch]
Sound.play_decision
RPG::BGM::last.play if item == :bgm_volume
RPG::BGS::last.play if item == :bgs_volume
draw_item(self.index)
end
#--------------------------------------------------------------------------
# input_case_left
#--------------------------------------------------------------------------
def input_case_left
options = YEM::SYSTEM::OPTIONS
ignore = false
case item
when :bgm_volume, :bgs_volume, :sfx_volume
value = Input.press?(Input::SHIFT) ? 10 : 1
case item
when :bgm_volume; variable = options[:bgm_variable]
when :bgs_volume; variable = options[:bgs_variable]
when :sfx_volume; variable = options[:sfx_variable]
end
return if $game_variables[variable] == 0
$game_variables[variable] -= value
$game_variables[variable] = [$game_variables[variable], 0].max
ignore = true
when :atb_active
variable = options[:atb_avariable]
return if $game_variables[variable] == 0
$game_variables[variable] -= 1
$game_variables[variable] = [$game_variables[variable], 0].max
ignore = true
when :atb_speeds
variable = options[:atb_svariable]
return if $game_variables[variable] == 1
$game_variables[variable] -= 1
$game_variables[variable] = [$game_variables[variable], 1].max
ignore = true
when :animations; switch = options[:animation_sw]
when :autocursor; switch = options[:autocursor_sw]
when :next_actor; switch = options[:next_actor_sw]
when :skill_help; switch = options[:skill_help_sw]
when :cinematics; switch = options[:cinematics_sw]
when :auto_dash; switch = options[:auto_dash_sw]
when :instant_text; switch = options[:inst_text_sw]
else; return
end
unless ignore
return if $game_switches[switch]
$game_switches[switch] = true
end
Sound.play_cursor
RPG::BGM::last.play if item == :bgm_volume
RPG::BGS::last.play if item == :bgs_volume
draw_item(self.index)
end
#--------------------------------------------------------------------------
# input_case_right
#--------------------------------------------------------------------------
def input_case_right
options = YEM::SYSTEM::OPTIONS
ignore = false
case item
when :bgm_volume, :bgs_volume, :sfx_volume
value = Input.press?(Input::SHIFT) ? 10 : 1
case item
when :bgm_volume; variable = options[:bgm_variable]
when :bgs_volume; variable = options[:bgs_variable]
when :sfx_volume; variable = options[:sfx_variable]
end
return if $game_variables[variable] == 100
$game_variables[variable] += value
$game_variables[variable] = [$game_variables[variable], 100].min
ignore = true
when :atb_active
variable = options[:atb_avariable]
return if $game_variables[variable] == 3
$game_variables[variable] += 1
$game_variables[variable] = [$game_variables[variable], 3].min
ignore = true
when :atb_speeds
variable = options[:atb_svariable]
return if $game_variables[variable] == 10
$game_variables[variable] += 1
$game_variables[variable] = [$game_variables[variable], 10].min
ignore = true
when :animations; switch = options[:animation_sw]
when :autocursor; switch = options[:autocursor_sw]
when :next_actor; switch = options[:next_actor_sw]
when :skill_help; switch = options[:skill_help_sw]
when :cinematics; switch = options[:cinematics_sw]
when :auto_dash; switch = options[:auto_dash_sw]
when :instant_text; switch = options[:inst_text_sw]
else; return
end
unless ignore
return if !$game_switches[switch]
$game_switches[switch] = false
end
Sound.play_cursor
RPG::BGM::last.play if item == :bgm_volume
RPG::BGS::last.play if item == :bgs_volume
draw_item(self.index)
end
#--------------------------------------------------------------------------
# update_help
#--------------------------------------------------------------------------
def update_help
case item
when :bgm_volume; type = :bgm_des
when :bgs_volume; type = :bgs_des
when :sfx_volume; type = :sfx_des
when :animations; type = :ani_des
when :autocursor; type = :curmem_des
when :next_actor; type = :next_des
when :skill_help; type = :help_des
when :cinematics; type = :cinem_des
when :windowskin; type = :wind_des
when :auto_dash; type = :dash_des
when :instant_text; type = :inst_des
when :return_title; type = :retitle_des
when :return_menu; type = :remenu_des
when :atb_active
case $game_variables[YEM::SYSTEM::OPTIONS[:atb_avariable]]
when 0; type = :wait_0_des
when 1; type = :wait_1_des
when 2; type = :wait_2_des
when 3: type = :wait_3_des
end
when :atb_speeds; type = :atb_s_des
else; type = nil
end
text = YEM::SYSTEM::OPTIONS[type].to_s
@help_window.set_text(text, 1)
end
#--------------------------------------------------------------------------
# overwrite method: post_start
#--------------------------------------------------------------------------
def post_start; super; end
#--------------------------------------------------------------------------
# overwrite method: pre_terminate
#--------------------------------------------------------------------------
def pre_terminate; super; end
#--------------------------------------------------------------------------
# overwrite method: close_command_window
#--------------------------------------------------------------------------
def close_command_window; end
#--------------------------------------------------------------------------
# overwrite method: terminate
#--------------------------------------------------------------------------
def terminate
super
@help_window.dispose
@options_window.dispose
@skins_window.dispose
dispose_menu_background
end
#--------------------------------------------------------------------------
# overwrite method: update
#--------------------------------------------------------------------------
def update
super
@help_window.update
@skins_window.update
update_menu_background
if @options_window.active
update_options_window
elsif @skins_window.active
update_skins_window
end
end
#--------------------------------------------------------------------------
# new method: update_options_window
#--------------------------------------------------------------------------
def update_options_window
@options_window.update
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
end
end