| 赞 | 0 |
| VIP | |
| 好人卡 | |
| 积分 | 1 |
| 经验 | |
| 最后登录 | 2017-6-22 |
| 在线时间 | 57 小时 |
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 57 小时
- 注册时间
- 2014-9-16
- 回帖
- 24
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有账号?注册会员
×
本帖最后由 月歌子 于 2015-11-11 21:48 编辑
關於音量音效的控制,網路上有找到不少VX的腳本,但是ACE卻比較少
這邊有在睡工房找到介面和功能比較符合需求的系統設定腳本
目前的問題是,網站提供的腳本有五個:音量,聲音,聲音開關,文字,自動模式
想要將聲音開關用音效取代,但是最多只能做到介面OK,可是想要調整音量就出現錯誤了
一直無法順利調整音效
下面附上目前修改的腳本和出現的錯誤訊息
跪求各位幫幫忙,感激不盡>_<
共通セーブファイル
[pre lang="ruby" line="1"]#******************************************************************************
#
# * 共通セーブファイル *
#
# for RGSS3
#
# Ver 1.01 2013.08.24
#
# ◆使い方
# 数字でも文字でも、お好きな名前(ID)への値の保存/読込が出来ます。
# 1.True/Falseの値の場合
# 例)保存:$savec.set("id", True)
# 読込:$savec.check("id")
# ※idが存在しない場合、Falseが返されます。
#
# 2.数字の場合
# 例)保存:$savec.set_num("id", 100)
# 読込:$savec.get_num("id")
# ※idが存在しない場合、-1が返されます。
#
# 提供者:睡工房 http://hime.be/
#
#******************************************************************************
#==============================================================================
# コンフィグ項目
#==============================================================================
module SUI
module COMMON_SAVE
# 共通セーブファイル名
COMMON_FILE = "savec.rvdata"
end
end
#==============================================================================
# 設定完了
#==============================================================================
class Common_Save
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
@data = {}
load if FileTest.exist?(SUI::COMMON_SAVE::COMMON_FILE)
end
#--------------------------------------------------------------------------
# ● フラグチェック
#--------------------------------------------------------------------------
def check(id)
@data.include?(id)? @data[id] : false
end
#--------------------------------------------------------------------------
# ● フラグセット
#--------------------------------------------------------------------------
def set(id, flg = false)
unless check(id) == flg
@data[id] = flg
save
end
end
#--------------------------------------------------------------------------
# ● 数値取得
#--------------------------------------------------------------------------
def get_num(id)
@data.include?(id)? @data[id] : -1
end
#--------------------------------------------------------------------------
# ● 数値セット
#--------------------------------------------------------------------------
def set_num(id, num = -1)
unless get_num(id) == num
@data[id] = num
save
end
end
#--------------------------------------------------------------------------
# ● ファイルセーブ
#--------------------------------------------------------------------------
def save
save_data(@data, SUI::COMMON_SAVE::COMMON_FILE)
end
#--------------------------------------------------------------------------
# ● ファイルロード
#--------------------------------------------------------------------------
def load
@data = load_data(SUI::COMMON_SAVE::COMMON_FILE)
end
end
class << DataManager
#--------------------------------------------------------------------------
# ● モジュール初期化
#--------------------------------------------------------------------------
alias sui_init init
def init
$savec = Common_Save.new
sui_init
end
end[/pre]
メッセージ拡張機能
[pre lang="ruby" line="1"]#******************************************************************************
#
# * メッセージ機能拡張 *
#
# for RGSS3
#
# Ver 1.00 2012.09.16
# Ver 1.01 2014.01.06 自動モードの不具合修正
#
# ◆注意事項
# ※この素材は「共通セーブファイル」スクリプトが必要になります。
#
#
# ◆機能説明
#
# 1.追加された制御文字で、立ち絵を左・中央・右に表示できます。
#
# 2.追加された制御文字で、音声を再生できます。
#
# 3.追加された制御文字で、SEを再生できます。
#
# 4.追加された制御文字でCGの表示ができます。
#
# 5.上記機能をスクリプトからも実行できます。
#
# 6.コンフィグ項目で指定したボタンで、メッセージ枠を一時消去できます。
#
# 7.コンフィグ項目で指定したボタンで、自動改ページモードに移行できます。
#
# 8.シーンスキップに設定したゲームスイッチをオンにすると、コンフィグ
# 項目で設定したボタンを押すことでスキップ先ラベルまでスキップできます。
#
#
# ◆使い方
# http://hime.be/rgss3/sozai/message_manual.txt をご覧ください。
#
#
# 提供者:睡工房 http://hime.be/
#
#******************************************************************************
#==============================================================================
# コンフィグ項目
#==============================================================================
module SUI
module MESSAGE
# 左側・中央・右側に表示する立ち絵のX座標(絵の左上を基準とします)
LEFT_X = 0 # 左側
CENTER_X = 180 # 中央
RIGHT_X = 360 # 右側
# 立ち絵の表示に使用するピクチャ番号
LEFT_PIC = 5 # 左側
CENTER_PIC = 6 # 中央
RIGHT_PIC = 7 # 右側
# CGの表示に使用するピクチャ番号
CG_PIC = 8
# メッセージウィンドウの消去に割り当てるボタンを設定
# Input::A の形式で指定
BTN_HIDE = :A
# シーンスキップのボタンを設定
# Input::X の形式で指定
BTN_RETURN = :X
# 自動改ページのボタンを設定
# Input::Y の形式で指定
BTN_AUTO_MODE = :Y
# 立ち絵の保存場所("Graphics/Pictures/"からの相対パスを指定")
#SURFACE_DIR = "Surface/"
SURFACE_DIR = ""
# CGファイルの保存場所("Graphics/Pictures/"からの相対パスを指定")
#CG_DIR = "CG/"
CG_DIR = ""
# ボイスファイルの保存場所
#VOICE_DIR = "Audio/SE/Voice/"
VOICE_DIR = "Audio/SE/"
# イベントスキップのフラグ(ゲームスイッチの番号指定)
# このゲームスイッチがオンの時、直近のスキップ先ラベルまでスキップします。
SW_SKIP_ON = 51
# イベントスキップ先として認識するラベル名
SKIP_LABEL = "イベントスキップ先"
# 自動改ページの待ち時間(フレーム数を指定)
# 左から「遅い」,「普通」,「速い」の順に設定します。
# ※オプション画面スクリプトが未導入の場合、「普通」のみ有効になります。
AUTO_WAIT = [180, 120, 60]
end
end
#==============================================================================
# 設定完了
#==============================================================================
class Window_Message < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
alias sui_message_initialize initialize
def initialize
sui_message_initialize
@hide_mode = false # ウィンドウ消去モード
@auto_mode = false # 自動改ページモード
@auto_count = 0
create_auto_message
SUI::MESSAGE::SKIP["skip"] = false
end
#--------------------------------------------------------------------------
# ● 解放
#--------------------------------------------------------------------------
alias sui_message_dispose dispose
def dispose
sui_message_dispose
@auto_message.bitmap.dispose
@auto_message.dispose
end
#--------------------------------------------------------------------------
# ● オートモードの通知メッセージ作成
#--------------------------------------------------------------------------
def create_auto_message
@auto_message = Sprite.new
@auto_message.x = Graphics.width
@auto_message.y = 3
@auto_message.bitmap = Bitmap.new(140, 15)
@auto_message.bitmap.font.size = 15
@auto_message.bitmap.gradient_fill_rect(0, 6, 140, 9, Color.new(128, 128, 128, 0), Color.new(128, 128, 128, 180), true)
@auto_message.bitmap.draw_text(0, 0, @auto_message.bitmap.width, 15, "自動改ページモード", 1)
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
alias sui_message_update update
def update
if @auto_mode and (Input::trigger?(SUI::MESSAGE::BTN_AUTO_MODE) || Input.trigger?(:B) || Input.trigger?(:C))
@auto_mode = false
Input.update
end
@auto_message.x += 10 if !@auto_mode and @auto_message.x < Graphics.width
sui_message_update unless update_hide_auto
end
#--------------------------------------------------------------------------
# ● 入力処理
#--------------------------------------------------------------------------
def update_hide_auto
if $game_message.choice?
return update_hide([self, @choice_window])
elsif $game_message.num_input?
return update_hide([self, @number_window])
elsif $game_message.item_choice?
return update_hide([self, @item_window])
else
return update_hide([self]) unless @pause_skip
end
end
#--------------------------------------------------------------------------
# ● ウィンドウ消去モードの更新
#--------------------------------------------------------------------------
def update_hide(windows)
if @hide_mode
if Input.trigger?(:C) or Input.trigger?(SUI::MESSAGE::BTN_HIDE)
@hide_mode = false
windows.each do |window|
window.visible = true
end
end
return true
else
if Input.trigger?(SUI::MESSAGE::BTN_HIDE)
@hide_mode =true
windows.each do |window|
window.visible = false
end
return true
end
return false
end
end
#--------------------------------------------------------------------------
# ● 入力待ち処理 ※再定義
#--------------------------------------------------------------------------
def input_pause
self.pause = true
wait(10)
Fiber.yield until auto_mode || Input.trigger?(:B) || Input.trigger?(:C)
Input.update
self.pause = false
end
#--------------------------------------------------------------------------
# ● メッセージ自動送り&スキップ確認
#--------------------------------------------------------------------------
def auto_mode
if @auto_mode
@auto_count = SUI::MESSAGE::AUTO_WAIT[SUI::OPTION.auto_wait] if @auto_count == 0
@auto_count -= 1
@auto_message.x -= 10 if @auto_message.x > Graphics.width - @auto_message.width
return true if Input::trigger?(SUI::MESSAGE::BTN_AUTO_MODE)
return true if @auto_count == 0
return false
else
@auto_mode = true if Input::trigger?(SUI::MESSAGE::BTN_AUTO_MODE)
if $game_switches[SUI::MESSAGE::SW_SKIP_ON] && Input.trigger?(SUI::MESSAGE::BTN_RETURN)
SUI::MESSAGE::SKIP["skip"] = true
return true
end
return false
end
end
#--------------------------------------------------------------------------
# ● 一文字出力後のウェイト
#--------------------------------------------------------------------------
alias sui_message_wait_for_one_character wait_for_one_character
def wait_for_one_character
case SUI::OPTION.message_speed
when 0
wait(1) unless @show_fast or @line_show_fast
@spd = false
when 1
@spd = false
when 2
@spd = !@spd
end
return unless @show_fast or @line_show_fast or !@spd
sui_message_wait_for_one_character
end
#--------------------------------------------------------------------------
# ● 制御文字の処理
# code : 制御文字の本体部分(「\C[1]」なら「C」)
#--------------------------------------------------------------------------
alias sui_process_escape_character process_escape_character
def process_escape_character(code, text, pos)
sui_process_escape_character(code, text, pos)
case code
when 'l', 'c', 'r'
text.sub!(/\[(.{1,8})\]/, "")
if $1 == "off"
Message.set_tone(code, Tone.new(-40, -40, -40, 0))
elsif $1 == "on"
Message.set_tone(code, Tone.new(0, 0, 0, 0))
for i in Message.get_array(code)
Message.set_tone(i, Tone.new(-40, -40, -40, 0))
end
elsif $1 =="del"
Message.del_picture(code)
else
Message.set_picture(code, $1)
Message.set_tone(code, Tone.new(0, 0, 0, 0))
for i in Message.get_array(code)
Message.set_tone(i, Tone.new(-40, -40, -40, 0))
end
end
wait(16)
when 's'
text.sub!(/\[(\w+)(,(\d+))?(,(\d+))?\]/, "")
Audio.se_play("Audio/SE/#{$1}", ($3 ? $3.to_i : 100), ($5 ? $5.to_i : 100))
when 'v'
text.sub!(/\[([0-9a-zA-Z_\/]+)\]/, "")
Message.play_voice($1)
when 'p'
text.sub!(/\[(.+)\]/, "")
if $1 == "del"
Message.del_cg
else
Message.set_cg($1)
end
end
end
#--------------------------------------------------------------------------
# ● 指定の位置を除いた配列を取得
#--------------------------------------------------------------------------
def self.get_array(pos)
tmp = ["l", "c", "r"]
tmp.delete(pos)
return tmp
end
#--------------------------------------------------------------------------
# ● CGの表示
#--------------------------------------------------------------------------
def self.set_cg(file)
name = SUI::MESSAGE::CG_DIR + file
zoom_x = 100.0
zoom_y = 100.0
opacity = 255.0
blend_type = 0
origin = 0
x = 0
y = 0
$game_map.screen.pictures[SUI::MESSAGE::CG_PIC].show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
end
#--------------------------------------------------------------------------
# ● CGの消去
#--------------------------------------------------------------------------
def self.del_cg
$game_map.screen.pictures[SUI::MESSAGE::CG_PIC].erase
end
#--------------------------------------------------------------------------
# ● 立ち絵の表示
#--------------------------------------------------------------------------
def self.set_picture(pos, file, flg = true)
name = SUI::MESSAGE::SURFACE_DIR + file
zoom_x = 100.0
zoom_y = 100.0
opacity = 255.0
blend_type = 0
origin = 0
y = 0
if pos == "l"
x = SUI::MESSAGE::LEFT_X
p = SUI::MESSAGE::LEFT_PIC
elsif pos == "c"
x = SUI::MESSAGE::CENTER_X
p = SUI::MESSAGE::CENTER_PIC
elsif pos == "r"
x = SUI::MESSAGE::RIGHT_X
p = SUI::MESSAGE::RIGHT_PIC
end
$game_map.screen.pictures[p].show(name, origin, x, y, zoom_x, zoom_y, opacity, blend_type)
set_tone(pos, Tone.new(-40, -40, -40, 0)) unless flg
end
#--------------------------------------------------------------------------
# ● 立ち絵の消去
#--------------------------------------------------------------------------
def self.del_picture(pos)
if pos == "l"
p = SUI::MESSAGE::LEFT_PIC
elsif pos == "c"
p = SUI::MESSAGE::CENTER_PIC
elsif pos == "r"
p = SUI::MESSAGE::RIGHT_PIC
end
$game_map.screen.pictures[p].erase
end
#--------------------------------------------------------------------------
# ● トーンの設定
#--------------------------------------------------------------------------
def self.set_tone(pos, tone)
if pos == "l"
p = SUI::MESSAGE::LEFT_PIC
elsif pos == "c"
p = SUI::MESSAGE::CENTER_PIC
elsif pos == "r"
p = SUI::MESSAGE::RIGHT_PIC
end
$game_map.screen.pictures[p].start_tone_change(tone, 0)
end
#--------------------------------------------------------------------------
# ● ボイスの再生
#--------------------------------------------------------------------------
def self.play_voice(file)
unless $savec.check("voice")
Audio.se_stop
vol = SUI::OPTION.voice_volume
Audio.se_play("#{SUI::MESSAGE::VOICE_DIR}#{file}", 100 * vol, 100)
end
end
end
Message = Window_Message
module SuiScript
#--------------------------------------------------------------------------
# ● CGの表示
#--------------------------------------------------------------------------
def self.set_cg(file)
if file == "del"
Message.del_cg
else
Message.set_cg(file)
end
end
#--------------------------------------------------------------------------
# ● 立ち絵の表示
#--------------------------------------------------------------------------
def self.set_picture(pos, file, flg = true)
if file == "off"
Message.set_tone(pos, Tone.new(-40, -40, -40, 0))
elsif file == "on"
Message.set_tone(pos, Tone.new(0, 0, 0, 0))
for i in Message.get_array(pos)
Message.set_tone(i, Tone.new(-40, -40, -40, 0))
end
elsif file =="del"
Message.del_picture(pos)
else
Message.set_picture(pos, file, flg)
return unless flg
Message.set_tone(pos, Tone.new(0, 0, 0, 0))
for i in Message.get_array(pos)
Message.set_tone(i, Tone.new(-40, -40, -40, 0))
end
end
end
#--------------------------------------------------------------------------
# ● SEの再生
#--------------------------------------------------------------------------
def self.play_se(file, vol = 100, pitch = 100)
Audio.se_play("Audio/SE/#{file}", vol, pitch)
end
#--------------------------------------------------------------------------
# ● ボイスの再生
#--------------------------------------------------------------------------
def self.play_voice(file)
Message.play_voice(file)
end
end
class Game_Interpreter
#--------------------------------------------------------------------------
# ● イベントコマンドの実行
#--------------------------------------------------------------------------
alias sui_interpreter_execute_command execute_command
def execute_command
if SUI::MESSAGE::SKIP["skip"]
SUI::MESSAGE::SKIP["skip"] = false
$game_switches[SUI::MESSAGE::SW_SKIP_ON] = false
return if label_jump
end
sui_interpreter_execute_command
end
#--------------------------------------------------------------------------
# ● ラベルジャンプ
#--------------------------------------------------------------------------
def label_jump
label_name = SUI::MESSAGE::SKIP_LABEL
@list.size.times do |i|
if @list.code == 118 && @list.parameters[0] == label_name
@index = i
return true
end
end
return false
end
end
module SUI::MESSAGE
SKIP = {}
end
module SUI::OPTION
def self.bgm_volume
vol = $savec.get_num("bgm_vol")
vol = 70 if vol < 10
vol /= 100.0
return vol
end
def self.se_volume
vol = $savec.get_num("se_vol")
vol = 70 if vol < 10
vol /= 100.0
return vol
end
def self.voice_volume
vol = $savec.get_num("voice_vol")
vol = 70 if vol < 10
vol /= 100.0
return vol
end
def self.message_speed
spd = $savec.get_num("speed")
spd = 1 if spd == -1
return spd
end
def self.auto_wait
spd = $savec.get_num("auto_wait")
spd = 1 if spd == -1
return spd
end
end[/pre]
オプション画面
[pre lang="ruby" line="1"]#******************************************************************************
#
# * オプション画面 *
#
# for RGSS3
#
# Ver 1.01 2014.07.13
#
# ◆注意事項
# ※この素材は「共通セーブファイル」スクリプトが必要になります。
# ※この素材は睡工房の素材をカスタマイズするものです。
# メッセージ機能拡張スクリプトを導入しない場合、機能2~5は無効となります。
#
#
# ◆機能説明
#
# 1.BGMの再生ボリュームを変更できます。
#
# 2.ボイスの再生ボリュームを変更できます。
#
# 3.ボイス再生のオン/オフ切り替えができます。
#
# 4.文字表示速度の変更ができます。
#
# 5.自動改ページの待ち時間を変更できます。
#
#
# ◆使い方
# スクリプトで「Scene_Option.start」を実行すると、
# オプション画面が開きます。
#
# メニュー画面をカスタマイズしたい場合は、以下のURLを参考にしてください。
# http://hime.be/rgss3/option.html
#
#
# 提供者:睡工房 http://hime.be/
#
#******************************************************************************
#==============================================================================
# コンフィグ項目
#==============================================================================
module SUI
module OPTION
# ボイス再生ボリューム変更時のサンプルボイス
# 指定したボイスからランダムで1つ、新しいボリュームで再生されます。
# サンプルボイスがいらない場合は空にしてください。
SAMPLE = [
#ファイル名
# "sample_voice01",
# "sample_voice02",
"Cat",
"Crow",
"Dog",
]
# ボイスファイルの保存場所
#VOICE_DIR = "Audio/SE/Voice/"
VOICE_DIR = "Audio/SE/"
end
end
#==============================================================================
# 設定完了
#==============================================================================
class Window_Option < Window_Base
#--------------------------------------------------------------------------
# ● オブジェクト初期化
#--------------------------------------------------------------------------
def initialize
super(0, 0, 430, 330)
self.openness = 0
self.x = Graphics.width / 2 - self.width / 2
self.y = Graphics.height / 2 - self.height / 2 + line_height / 2 + padding
self.z = 160
@line = 0
set_index
refresh
update_cursor
end
#--------------------------------------------------------------------------
# ● リフレッシュ
#--------------------------------------------------------------------------
def refresh
self.contents.clear
contents.font.color = normal_color
contents.draw_text(0, 0 * rows_height, contents.width, line_height, "音樂")
contents.draw_text(0, 1 * rows_height, contents.width, line_height, "聲音")
contents.draw_text(0, 2 * rows_height, contents.width, line_height, "音效")
#contents.draw_text(0, 2 * rows_height, contents.width, line_height, "キャラクターボイス")
contents.draw_text(0, 3 * rows_height, contents.width, line_height, "文字")
contents.draw_text(0, 4 * rows_height, contents.width, line_height, "自動模式")
draw_command_10(0)
draw_command_10(1)
draw_command_10(2)
#draw_command_2(2)
draw_command_3(3)
draw_command_3(4)
end
#--------------------------------------------------------------------------
# ● 行の高さ(2行分)
#--------------------------------------------------------------------------
def rows_height
60
end
#--------------------------------------------------------------------------
# ● 文字の描画
#--------------------------------------------------------------------------
def draw_text2(x, y, w, text, blue = false)
contents.font.color = blue ? system_color : normal_color
contents.font.color.alpha = blue ? 255 : 128
draw_text(x, y, w, line_height, text)
end
#--------------------------------------------------------------------------
# ● 10コマンドの描画
#--------------------------------------------------------------------------
def draw_command_10(row)
y = rows_height * row + line_height
10.times do |i|
x = 30 + 36 * i - ((i == 9) ? 2 : 0)
draw_text2(x, y, 30, ((i + 1) * 10).to_s, (i == @index[row]))
end
end
#--------------------------------------------------------------------------
# ● 10コマンドの矩形を取得
#--------------------------------------------------------------------------
def item_rect_10
rect = Rect.new
rect.x = 30 - 9 + 36 * @index[@line]
rect.y = rows_height * @line + line_height
rect.width = 30 + 8
rect.height = line_height
rect
end
#--------------------------------------------------------------------------
# ● 2コマンドの描画
#--------------------------------------------------------------------------
def draw_command_2(row)
y = rows_height * row + line_height
list = ["オン", "オフ"]
2.times do |i|
x = 30 + 100 * i
draw_text2(x, y, 40, list, (i == @index[row]))
end
end
#--------------------------------------------------------------------------
# ● 2コマンドの矩形を取得
#--------------------------------------------------------------------------
def item_rect_2
rect = Rect.new
rect.x = 30 - 11+ 100 * @index[@line]
rect.y = rows_height * @line + line_height
rect.width = 50 + 8
rect.height = line_height
rect
end
#--------------------------------------------------------------------------
# ● 3コマンドの描画
#--------------------------------------------------------------------------
def draw_command_3(row)
y = rows_height * row + line_height
list = ["慢", "普通", "快"]
3.times do |i|
x = 30 + 80 * i
draw_text2(x, y, 40, list, (i == @index[row]))
end
end
#--------------------------------------------------------------------------
# ● 3コマンドの矩形を取得
#--------------------------------------------------------------------------
def item_rect_3
rect = Rect.new
rect.x = 30 - 11 + 80 * @index[@line]
rect.y = rows_height * @line + line_height
rect.width = 50 + 8
rect.height = line_height
rect
end
#--------------------------------------------------------------------------
# ● カーソルの更新
#--------------------------------------------------------------------------
def update_cursor
case @line
when 0, 1, 2
cursor_rect.set(item_rect_10)
#when 2
#cursor_rect.set(item_rect_2)
when 3, 4
cursor_rect.set(item_rect_3)
end
Sound.play_cursor
end
#--------------------------------------------------------------------------
# ● 行の設定
#--------------------------------------------------------------------------
def line=(row)
old = @line
@line = [[@line + row, 0].max, 4].min
update_cursor if old != @line
end
#--------------------------------------------------------------------------
# ● 行の設定
#--------------------------------------------------------------------------
def index=(i)
max = 9 if( @line == 0 || @line == 1 || @line == 2)
#max = 1 if( @line == 2)
max = 2 if( @line == 3 || @line == 4)
old = @index[@line]
@index[@line] = [[@index[@line] + i, 0].max, max].min
update_cursor if old != @index[@line]
end
#--------------------------------------------------------------------------
# ● フレーム更新
#--------------------------------------------------------------------------
def update
super
return unless self.openness == 255
self.line = +1 if Input.repeat?(:DOWN)
self.line = -1 if Input.repeat?(:UP)
self.index = +1 if Input.repeat?(:RIGHT)
self.index = -1 if Input.repeat?(:LEFT)
if Input.trigger?(:C)
Sound.play_use_item
case @line
when 0
$savec.set_num("bgm_vol", (@index[@line] + 1) * 10)
refresh
RPG::BGM::last.play
when 1
$savec.set_num("voice_vol", (@index[@line] + 1) * 10)
refresh
Audio.se_stop
vol = SUI::OPTION.voice_volume
return if SUI::OPTION::SAMPLE.length == 0
r = SUI::OPTION::SAMPLE[rand(SUI::OPTION::SAMPLE.length)]
Audio.se_play("#{SUI::OPTION::VOICE_DIR}#{r}", 100 * vol)
when 2
#$savec.set("voice", @index[@line] == 1)
#refresh
$savec.set_num("se_vol", (@index[@line] + 1) * 10)
refresh
Audio.se_stop
RPG::SE::last.play
when 3
$savec.set_num("speed", @index[@line])
refresh
when 4
$savec.set_num("auto_wait", @index[@line])
refresh
end
end
end
#--------------------------------------------------------------------------
# ● アクティブ設定
#--------------------------------------------------------------------------
def set_index
@index = []
res = $savec.get_num("bgm_vol")
res = 70 if res < 10
@index[0] = (res / 10) - 1
res = $savec.get_num("voice_vol")
res = 70 if res < 10
@index[1] = (res / 10) - 1
res = $savec.get_num("se_vol")
res = 70 if res < 10
@index[2] = (res / 10) - 1
#@index[2] = $savec.check("voice") ? 1 : 0
@index[3] = $savec.get_num("speed")
@index[3] = 1 if @index[3] == -1
@index[4] = $savec.get_num("auto_wait")
@index[4] = 1 if @index[4] == -1
end
end
class Scene_Option < Scene_Base
#--------------------------------------------------------------------------
# ● クラス変数初期化
#--------------------------------------------------------------------------
@@start = false # オプション画面の開始フラグ
#--------------------------------------------------------------------------
# ● 開始処理
#--------------------------------------------------------------------------
def start
super
@@start = false
@config_seq = 0
create_background
create_option_window
@option_window.open
@option_title.open
end
#--------------------------------------------------------------------------
# ● 終了処理
#--------------------------------------------------------------------------
def terminate
super
dispose_background
end
#--------------------------------------------------------------------------
# ● オプションウィンドウの作成
#--------------------------------------------------------------------------
def create_option_window
@option_window = Window_Option.new
@option_title = Window_Help.new(1)
@option_title.x = @option_window.x
@option_title.width = @option_window.width
@option_title.y = @option_window.y - @option_title.height
@option_title.z = @option_window.z
@option_title.create_contents
@option_title.openness = 0
@option_title.contents.draw_text(0, -2, @option_title.contents.width,@option_title.contents.height, "* 系統設定 *", 1)
end
#--------------------------------------------------------------------------
# ● 背景の作成
#--------------------------------------------------------------------------
def create_background
@background_sprite = Sprite.new
@background_sprite.bitmap = SceneManager.background_bitmap
@background_sprite.color.set(16, 16, 16, 128)
end
#--------------------------------------------------------------------------
# ● 背景の解放
#--------------------------------------------------------------------------
def dispose_background
@background_sprite.dispose
end
#--------------------------------------------------------------------------
# ● 更新処理
#--------------------------------------------------------------------------
def update
super
if Input.trigger?(:B)
Sound.play_cancel
@option_window.close
@option_title.close
end
if @option_window.openness == 0
SceneManager.return
end
end
#--------------------------------------------------------------------------
# ● オプション画面スタート処理
#--------------------------------------------------------------------------
def self.start
@@start = true
end
#--------------------------------------------------------------------------
# ● オプション画面が開始しているか?
#--------------------------------------------------------------------------
def self.start?
return @@start
end
end
module RPG
class BGM < AudioFile
#--------------------------------------------------------------------------
# ● BGMの再生 ※再定義
#--------------------------------------------------------------------------
def play(pos = 0)
if @name.empty?
Audio.bgm_stop
@@last = RPG::BGM.new
else
vol = SUI::OPTION::bgm_volume * 1.05
vol = [@volume * vol, 100].min # Ver 1.01
Audio.bgm_play("Audio/BGM/" + @name, vol, @pitch, pos) # Ver 1.01
#~ Audio.bgm_play("Audio/BGM/" + @name, @volume * vol, @pitch, pos)
@@last = self.clone
end
end
end
class SE < AudioFile
#--------------------------------------------------------------------------
# ● BGMの再生 ※再定義
#--------------------------------------------------------------------------
def play(pos = 0)
if @name.empty?
Audio.se_stop
@@last = RPG::SE.new
else
vol = SUI::OPTION::se_volume * 1.05
vol = [@volume * vol, 100].min # Ver 1.01
Audio.se_play("Audio/SE/" + name)
@@last = self.clone
end
end
end
end
class Scene_Map
#--------------------------------------------------------------------------
# ● オプション画面への移行
#--------------------------------------------------------------------------
alias sui_option_update_scene update_scene
def update_scene
sui_option_update_scene
SceneManager.call(Scene_Option) if !scene_changing? && Scene_Option.start?
end
end[/pre] |
|