设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索
查看: 2910|回复: 6
打印 上一主题 下一主题

[已经解决] 有没有音量设置的脚本?...

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
46 小时
注册时间
2015-7-13
帖子
89
跳转到指定楼层
1
发表于 2015-7-15 15:31:25 | 只看该作者 |只看大图 回帖奖励 |倒序浏览 |阅读模式

加入我们,或者,欢迎回来。

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
我一直觉得RM系列的默认音量特别大...有没有在游戏中设置音量的脚本系统的?
(ノ゚∀゚)ノ脚本渣求教

Lv1.梦旅人

梦石
0
星屑
70
在线时间
1083 小时
注册时间
2013-3-29
帖子
2394
2
发表于 2015-7-15 15:37:40 | 只看该作者
  1. #==============================================================================
  2. #
  3. # ▼ Yanfly Engine Ace - System Options v1.00
  4. # -- Last Updated: 2012.01.01
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================

  9. $imported = {} if $imported.nil?
  10. $imported["YEA-SystemOptions"] = true

  11. #==============================================================================
  12. # ▼ Updates
  13. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  14. # 2012.01.01 - Started Script and Finished.
  15. #
  16. #==============================================================================
  17. # ▼ Introduction
  18. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  19. # This script replaces the "Game End" option in the Main Menu with a "System"
  20. # menu where the player can adjust various settings in the game. Of them, the
  21. # player can change the window colour, the volume for BGM, BGS, SFX, set
  22. # automatic dashing, message text to display instantly, and speed up battles by
  23. # hiding battle animations.
  24. #
  25. #==============================================================================
  26. # ▼ Instructions
  27. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  28. # To install this script, open up your script editor and copy/paste this script
  29. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  30. #
  31. # -----------------------------------------------------------------------------
  32. # Script Calls - These commands are used with script calls.
  33. # -----------------------------------------------------------------------------
  34. # $game_system.volume_change(:bgm, x)
  35. # $game_system.volume_change(:bgs, x)
  36. # $game_system.volume_change(:sfx, x)
  37. # Unlike the previous Yanfly Engines, this version does not bind volume to a
  38. # variable. Use the script call to change the bgm, bgs, or sfx sound rate by
  39. # x increment. Use a negative value to lower the volume.
  40. #
  41. # $game_system.set_autodash(true)
  42. # $game_system.set_autodash(false)
  43. # Turns autodash on (true) or off (false).
  44. #
  45. # $game_system.set_instantmsg(true)
  46. # $game_system.set_instantmsg(false)
  47. # Turns instant messages on (true) or off (false).
  48. #
  49. # $game_system.set_animations(true)
  50. # $game_system.set_animations(false)
  51. # Turns battle animations on (true) or off (false).
  52. #
  53. #==============================================================================
  54. # ▼ Compatibility
  55. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  56. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  57. # it will run with RPG Maker VX without adjusting.
  58. #
  59. #==============================================================================

  60. module YEA
  61.   module SYSTEM
  62.    
  63.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  64.     # - General Setting -
  65.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  66.     # These are the general settings that govern the System settings. This will
  67.     # change the "Game End" vocab, and disable or enable autodash, instant
  68.     # messages, or animations by default.
  69.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  70.     COMMAND_NAME = "System"      # Command name used to replace Game End.
  71.     DEFAULT_AUTODASH   = true    # Enable automatic dashing by default?
  72.     DEFAULT_INSTANTMSG = false   # Enable instant message text by default?
  73.     DEFAULT_ANIMATIONS = true    # Enable battle animations by default?
  74.    
  75.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  76.     # - Command Settings -
  77.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  78.     # These settings adjust the commands shown in the command list. Add, remove
  79.     # or rearrange the commands as you see fit. Here's a list of which commands
  80.     # do what:
  81.     #
  82.     # -------------------------------------------------------------------------
  83.     # :command         Description
  84.     # -------------------------------------------------------------------------
  85.     # :blank           Inserts an empty blank space.
  86.     #
  87.     # :window_red      Changes the red tone for all windows.
  88.     # :window_grn      Changes the green tone for all windows.
  89.     # :window_blu      Changes the blue tone for all windows.
  90.     #
  91.     # :volume_bgm      Changes the BGM volume used.
  92.     # :volume_bgs      Changes the BGS volume used.
  93.     # :volume_sfx      Changes the SFX volume used.
  94.     #
  95.     # :autodash        Sets the player to automatically dash.
  96.     # :instantmsg      Sets message text to appear instantly.
  97.     # :animations      Enables battle animations or disables them.
  98.     #
  99.     # :to_title        Returns to the title screen.
  100.     # :shutdown        Shuts down the game.
  101.     #
  102.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  103.     COMMANDS =[
  104.       :window_red,   # Changes the red tone for all windows.
  105.       :window_grn,   # Changes the green tone for all windows.
  106.       :window_blu,   # Changes the blue tone for all windows.
  107.       :volume_bgm,   # Changes the BGM volume used.
  108.       :volume_bgs,   # Changes the BGS volume used.
  109.       :volume_sfx,   # Changes the SFX volume used.
  110.       :blank,
  111.       :autodash,     # Sets the player to automatically dash.
  112.       :instantmsg,   # Sets message text to appear instantly.
  113.       :animations,   # Enables battle animations or disables them.
  114.     # :switch_1,     # Custom Switch 1. Adjust settings below.
  115.     # :switch_2,     # Custom Switch 2. Adjust settings below.
  116.     # :variable_1,   # Custom Variable 1. Adjust settings below.
  117.     # :variable_2,   # Custom Variable 2. Adjust settings below.
  118.       :blank,
  119.       :to_title,     # Returns to the title screen.
  120.       :shutdown,     # Shuts down the game.
  121.     ] # Do not remove this.
  122.    
  123.     #--------------------------------------------------------------------------
  124.     # - Custom Switches -
  125.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  126.     # If you want your game to have system options other than just the ones
  127.     # listed above, you can insert custom switches here to produce such an
  128.     # effect. Adjust the settings here as you see fit.
  129.     #--------------------------------------------------------------------------
  130.     CUSTOM_SWITCHES ={
  131.     # -------------------------------------------------------------------------
  132.     # :switch    => [Switch, Name, Off Text, On Text,
  133.     #                Help Window Description
  134.     #               ], # Do not remove this.
  135.     # -------------------------------------------------------------------------
  136.       :switch_1  => [ 1, "Custom Switch 1", "OFF", "ON",
  137.                      "Help description used for custom switch 1."
  138.                     ],
  139.     # -------------------------------------------------------------------------
  140.       :switch_2  => [ 2, "Custom Switch 2", "OFF", "ON",
  141.                      "Help description used for custom switch 2."
  142.                     ],
  143.     # -------------------------------------------------------------------------
  144.     } # Do not remove this.
  145.    
  146.     #--------------------------------------------------------------------------
  147.     # - Custom Variables -
  148.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  149.     # If you want your game to have system options other than just the ones
  150.     # listed above, you can insert custom variables here to produce such an
  151.     # effect. Adjust the settings here as you see fit.
  152.     #--------------------------------------------------------------------------
  153.     CUSTOM_VARIABLES ={
  154.     # -------------------------------------------------------------------------
  155.     # :variable   => [Switch, Name, Colour1, Colour2, Min, Max,
  156.     #                 Help Window Description
  157.     #                ], # Do not remove this.
  158.     # -------------------------------------------------------------------------
  159.       :variable_1 => [ 1, "Custom Variable 1", 9, 1, -100, 100,
  160.                       "Help description used for custom variable 1."
  161.                      ],
  162.     # -------------------------------------------------------------------------
  163.       :variable_2 => [ 2, "Custom Variable 2", 10, 2, -10, 10,
  164.                       "Help description used for custom variable 2."
  165.                      ],
  166.     # -------------------------------------------------------------------------
  167.     } # Do not remove this.
  168.    
  169.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  170.     # - Vocab Settings -
  171.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  172.     # This hash adjusts the vocab used for both the commands and the help
  173.     # description that appears above the command window. Note that for the
  174.     # command help descriptions, you may use text codes. Use \n to linebreak.
  175.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  176.     COMMAND_VOCAB ={
  177.     # -------------------------------------------------------------------------
  178.     # :command    => [Command Name, Option1, Option2
  179.     #                 Help Window Description,
  180.     #                ], # Do not remove this.
  181.     # -------------------------------------------------------------------------
  182.       :blank      => ["", "None", "None",
  183.                       ""
  184.                      ], # Do not remove this.
  185.     # -------------------------------------------------------------------------
  186.       :window_red => ["Window Red", "None", "None",
  187.                       "Change the red colour tone for windows.\n" +
  188.                       "Hold SHIFT to change increment by 10."
  189.                      ], # Do not remove this.
  190.     # -------------------------------------------------------------------------
  191.       :window_grn => ["Window Green", "None", "None",
  192.                       "Change the green colour tone for windows.\n" +
  193.                       "Hold SHIFT to change increment by 10."
  194.                      ], # Do not remove this.
  195.     # -------------------------------------------------------------------------
  196.       :window_blu => ["Window Blue", "None", "None",
  197.                       "Change the blue colour tone for windows.\n" +
  198.                       "Hold SHIFT to change increment by 10."
  199.                      ], # Do not remove this.
  200.     # -------------------------------------------------------------------------
  201.       :volume_bgm => ["BGM Volume", 12, 4, # Options 1 & 2 are Gauge Colours.
  202.                       "Change the volume used for background music.\n" +
  203.                       "Hold SHIFT to change increment by 10."
  204.                      ], # Do not remove this.
  205.     # -------------------------------------------------------------------------
  206.       :volume_bgs => ["BGS Volume", 13, 5, # Options 1 & 2 are Gauge Colours.
  207.                       "Change the volume used for background sound.\n" +
  208.                       "Hold SHIFT to change increment by 10."
  209.                      ], # Do not remove this.
  210.     # -------------------------------------------------------------------------
  211.       :volume_sfx => ["SFX Volume", 14, 6, # Options 1 & 2 are Gauge Colours.
  212.                       "Change the volume used for sound effects.\n" +
  213.                       "Hold SHIFT to change increment by 10."
  214.                      ], # Do not remove this.
  215.     # -------------------------------------------------------------------------
  216.       :autodash   => ["Auto-Dash", "Walk", "Dash",
  217.                       "Automatically dash without holding the run button."
  218.                      ], # Do not remove this.
  219.     # -------------------------------------------------------------------------
  220.       :instantmsg => ["Instant Text", "Normal", "Instant",
  221.                       "Set message text to appear one-by-one or instantly."
  222.                      ], # Do not remove this.
  223.     # -------------------------------------------------------------------------
  224.       :animations => ["Battle Animations", "Hide", "Show",
  225.                       "Hide animations during battle to speed up battles?"
  226.                      ], # Do not remove this.
  227.     # -------------------------------------------------------------------------
  228.       :to_title   => ["Return to Title Screen", "None", "None",
  229.                       "Go back to the title screen."
  230.                      ], # Do not remove this.
  231.     # -------------------------------------------------------------------------
  232.       :shutdown   => ["Shutdown Game", "None", "None",
  233.                       "Turns off the game."
  234.                      ], # Do not remove this.
  235.     # -------------------------------------------------------------------------
  236.     } # Do not remove this.
  237.    
  238.   end # SYSTEM
  239. end # YEA

  240. #==============================================================================
  241. # ▼ Editting anything past this point may potentially result in causing
  242. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  243. # halitosis so edit at your own risk.
  244. #==============================================================================

  245. #==============================================================================
  246. # ■ Vocab
  247. #==============================================================================

  248. module Vocab
  249.   
  250.   #--------------------------------------------------------------------------
  251.   # overwrite method: self.game_end
  252.   #--------------------------------------------------------------------------
  253.   def self.game_end
  254.     return YEA::SYSTEM::COMMAND_NAME
  255.   end
  256.   
  257. end # Vocab

  258. #==============================================================================
  259. # ■ RPG::BGM
  260. #==============================================================================

  261. class RPG::BGM < RPG::AudioFile
  262.   
  263.   #--------------------------------------------------------------------------
  264.   # overwrite method: play
  265.   #--------------------------------------------------------------------------
  266.   def play(pos = 0)
  267.     if @name.empty?
  268.       Audio.bgm_stop
  269.       @@last = RPG::BGM.new
  270.     else
  271.       volume = @volume
  272.       volume *= $game_system.volume(:bgm) * 0.01 unless $game_system.nil?
  273.       Audio.bgm_play('Audio/BGM/' + @name, volume, @pitch, pos)
  274.       @@last = self.clone
  275.     end
  276.   end
  277.   
  278. end # RPG::BGM

  279. #==============================================================================
  280. # ■ RPG::ME
  281. #==============================================================================

  282. class RPG::ME < RPG::AudioFile
  283.   
  284.   #--------------------------------------------------------------------------
  285.   # overwrite method: play
  286.   #--------------------------------------------------------------------------
  287.   def play
  288.     if @name.empty?
  289.       Audio.me_stop
  290.     else
  291.       volume = @volume
  292.       volume *= $game_system.volume(:bgm) * 0.01 unless $game_system.nil?
  293.       Audio.me_play('Audio/ME/' + @name, volume, @pitch)
  294.     end
  295.   end
  296.   
  297. end # RPG::ME

  298. #==============================================================================
  299. # ■ RPG::BGS
  300. #==============================================================================

  301. class RPG::BGS < RPG::AudioFile
  302.   
  303.   #--------------------------------------------------------------------------
  304.   # overwrite method: play
  305.   #--------------------------------------------------------------------------
  306.   def play(pos = 0)
  307.     if @name.empty?
  308.       Audio.bgs_stop
  309.       @@last = RPG::BGS.new
  310.     else
  311.       volume = @volume
  312.       volume *= $game_system.volume(:bgs) * 0.01 unless $game_system.nil?
  313.       Audio.bgs_play('Audio/BGS/' + @name, volume, @pitch, pos)
  314.       @@last = self.clone
  315.     end
  316.   end
  317.   
  318. end # RPG::BGS

  319. #==============================================================================
  320. # ■ RPG::SE
  321. #==============================================================================

  322. class RPG::SE < RPG::AudioFile
  323.   
  324.   #--------------------------------------------------------------------------
  325.   # overwrite method: play
  326.   #--------------------------------------------------------------------------
  327.   def play
  328.     unless @name.empty?
  329.       volume = @volume
  330.       volume *= $game_system.volume(:sfx) * 0.01 unless $game_system.nil?
  331.       Audio.se_play('Audio/SE/' + @name, volume, @pitch)
  332.     end
  333.   end
  334.   
  335. end # RPG::SE

  336. #==============================================================================
  337. # ■ Game_System
  338. #==============================================================================

  339. class Game_System
  340.   
  341.   #--------------------------------------------------------------------------
  342.   # alias method: initialize
  343.   #--------------------------------------------------------------------------
  344.   alias game_system_initialize_so initialize
  345.   def initialize
  346.     game_system_initialize_so
  347.     init_volume_control
  348.     init_autodash
  349.     init_instantmsg
  350.     init_animations
  351.   end
  352.   
  353.   #--------------------------------------------------------------------------
  354.   # new method: init_volume_control
  355.   #--------------------------------------------------------------------------
  356.   def init_volume_control
  357.     @volume = {}
  358.     @volume[:bgm] = 100
  359.     @volume[:bgs] = 100
  360.     @volume[:sfx] = 100
  361.   end
  362.   
  363.   #--------------------------------------------------------------------------
  364.   # new method: volume
  365.   #--------------------------------------------------------------------------
  366.   def volume(type)
  367.     init_volume_control if @volume.nil?
  368.     return [[@volume[type], 0].max, 100].min
  369.   end
  370.   
  371.   #--------------------------------------------------------------------------
  372.   # new method: volume_change
  373.   #--------------------------------------------------------------------------
  374.   def volume_change(type, increment)
  375.     init_volume_control if @volume.nil?
  376.     @volume[type] += increment
  377.     @volume[type] = [[@volume[type], 0].max, 100].min
  378.   end
  379.   
  380.   #--------------------------------------------------------------------------
  381.   # new method: init_autodash
  382.   #--------------------------------------------------------------------------
  383.   def init_autodash
  384.     @autodash = YEA::SYSTEM::DEFAULT_AUTODASH
  385.   end
  386.   
  387.   #--------------------------------------------------------------------------
  388.   # new method: autodash?
  389.   #--------------------------------------------------------------------------
  390.   def autodash?
  391.     init_autodash if @autodash.nil?
  392.     return @autodash
  393.   end
  394.   
  395.   #--------------------------------------------------------------------------
  396.   # new method: set_autodash
  397.   #--------------------------------------------------------------------------
  398.   def set_autodash(value)
  399.     @autodash = value
  400.   end
  401.   
  402.   #--------------------------------------------------------------------------
  403.   # new method: init_instantmsg
  404.   #--------------------------------------------------------------------------
  405.   def init_instantmsg
  406.     @instantmsg = YEA::SYSTEM::DEFAULT_INSTANTMSG
  407.   end
  408.   
  409.   #--------------------------------------------------------------------------
  410.   # new method: instantmsg?
  411.   #--------------------------------------------------------------------------
  412.   def instantmsg?
  413.     init_instantmsg if @instantmsg.nil?
  414.     return @instantmsg
  415.   end
  416.   
  417.   #--------------------------------------------------------------------------
  418.   # new method: set_instantmsg
  419.   #--------------------------------------------------------------------------
  420.   def set_instantmsg(value)
  421.     @instantmsg = value
  422.   end
  423.   
  424.   #--------------------------------------------------------------------------
  425.   # new method: init_animations
  426.   #--------------------------------------------------------------------------
  427.   def init_animations
  428.     @animations = YEA::SYSTEM::DEFAULT_ANIMATIONS
  429.   end
  430.   
  431.   #--------------------------------------------------------------------------
  432.   # new method: animations?
  433.   #--------------------------------------------------------------------------
  434.   def animations?
  435.     init_animations if @animations.nil?
  436.     return @animations
  437.   end
  438.   
  439.   #--------------------------------------------------------------------------
  440.   # new method: set_animations
  441.   #--------------------------------------------------------------------------
  442.   def set_animations(value)
  443.     @animations = value
  444.   end
  445.   
  446. end # Game_System

  447. #==============================================================================
  448. # ■ Game_Player
  449. #==============================================================================

  450. class Game_Player < Game_Character
  451.   
  452.   #--------------------------------------------------------------------------
  453.   # alias method: dash?
  454.   #--------------------------------------------------------------------------
  455.   alias game_player_dash_so dash?
  456.   def dash?
  457.     if $game_system.autodash?
  458.       return false if @move_route_forcing
  459.       return false if $game_map.disable_dash?
  460.       return false if vehicle
  461.       return !Input.press?(:A)
  462.     else
  463.       return game_player_dash_so
  464.     end
  465.   end
  466.   
  467. end # Game_Player

  468. #==============================================================================
  469. # ■ Scene_Battle
  470. #==============================================================================

  471. class Scene_Battle < Scene_Base
  472.   
  473.   #--------------------------------------------------------------------------
  474.   # alias method: show_fast?
  475.   #--------------------------------------------------------------------------
  476.   alias scene_battle_show_fast_so show_fast?
  477.   def show_fast?
  478.     return true unless $game_system.animations?
  479.     return scene_battle_show_fast_so
  480.   end
  481.   
  482.   #--------------------------------------------------------------------------
  483.   # alias method: show_normal_animation
  484.   #--------------------------------------------------------------------------
  485.   alias scene_battle_show_normal_animation_so show_normal_animation
  486.   def show_normal_animation(targets, animation_id, mirror = false)
  487.     return unless $game_system.animations?
  488.     scene_battle_show_normal_animation_so(targets, animation_id, mirror)
  489.   end
  490.   
  491. end # Scene_Battle

  492. #==============================================================================
  493. # ■ Window_Message
  494. #==============================================================================

  495. class Window_Message < Window_Base
  496.   
  497.   #--------------------------------------------------------------------------
  498.   # alias method: clear_flags
  499.   #--------------------------------------------------------------------------
  500.   alias window_message_clear_flags_so clear_flags
  501.   def clear_flags
  502.     window_message_clear_flags_so
  503.     @show_fast = true if $game_system.instantmsg?
  504.   end
  505.   
  506. end # Window_Message

  507. #==============================================================================
  508. # ■ Window_SystemOptions
  509. #==============================================================================

  510. class Window_SystemOptions < Window_Command
  511.   
  512.   #--------------------------------------------------------------------------
  513.   # initialize
  514.   #--------------------------------------------------------------------------
  515.   def initialize(help_window)
  516.     @help_window = help_window
  517.     super(0, @help_window.height)
  518.     refresh
  519.   end
  520.   
  521.   #--------------------------------------------------------------------------
  522.   # window_width
  523.   #--------------------------------------------------------------------------
  524.   def window_width; return Graphics.width; end
  525.   
  526.   #--------------------------------------------------------------------------
  527.   # window_height
  528.   #--------------------------------------------------------------------------
  529.   def window_height; return Graphics.height - @help_window.height; end
  530.   
  531.   #--------------------------------------------------------------------------
  532.   # update_help
  533.   #--------------------------------------------------------------------------
  534.   def update_help
  535.     if current_symbol == :custom_switch || current_symbol == :custom_variable
  536.       text = @help_descriptions[current_ext]
  537.     else
  538.       text = @help_descriptions[current_symbol]
  539.     end
  540.     text = "" if text.nil?
  541.     @help_window.set_text(text)
  542.   end
  543.   
  544.   #--------------------------------------------------------------------------
  545.   # ok_enabled?
  546.   #--------------------------------------------------------------------------
  547.   def ok_enabled?
  548.     return true if [:to_title, :shutdown].include?(current_symbol)
  549.     return false
  550.   end
  551.   
  552.   #--------------------------------------------------------------------------
  553.   # make_command_list
  554.   #--------------------------------------------------------------------------
  555.   def make_command_list
  556.     @help_descriptions = {}
  557.     for command in YEA::SYSTEM::COMMANDS
  558.       case command
  559.       when :blank
  560.         add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command)
  561.         @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3]
  562.       when :window_red, :window_grn, :window_blu
  563.         add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command)
  564.         @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3]
  565.       when :volume_bgm, :volume_bgs, :volume_sfx
  566.         add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command)
  567.         @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3]
  568.       when :autodash, :instantmsg, :animations
  569.         add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command)
  570.         @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3]
  571.       when :to_title, :shutdown
  572.         add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command)
  573.         @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3]
  574.       else
  575.         process_custom_switch(command)
  576.         process_custom_variable(command)
  577.       end
  578.     end
  579.   end
  580.   
  581.   #--------------------------------------------------------------------------
  582.   # process_custom_switch
  583.   #--------------------------------------------------------------------------
  584.   def process_custom_switch(command)
  585.     return unless YEA::SYSTEM::CUSTOM_SWITCHES.include?(command)
  586.     name = YEA::SYSTEM::CUSTOM_SWITCHES[command][1]
  587.     add_command(name, :custom_switch, true, command)
  588.     @help_descriptions[command] = YEA::SYSTEM::CUSTOM_SWITCHES[command][4]
  589.   end
  590.   
  591.   #--------------------------------------------------------------------------
  592.   # process_custom_variable
  593.   #--------------------------------------------------------------------------
  594.   def process_custom_variable(command)
  595.     return unless YEA::SYSTEM::CUSTOM_VARIABLES.include?(command)
  596.     name = YEA::SYSTEM::CUSTOM_VARIABLES[command][1]
  597.     add_command(name, :custom_variable, true, command)
  598.     @help_descriptions[command] = YEA::SYSTEM::CUSTOM_VARIABLES[command][6]
  599.   end
  600.   
  601.   #--------------------------------------------------------------------------
  602.   # draw_item
  603.   #--------------------------------------------------------------------------
  604.   def draw_item(index)
  605.     reset_font_settings
  606.     rect = item_rect(index)
  607.     contents.clear_rect(rect)
  608.     case @list[index][:symbol]
  609.     when :window_red, :window_grn, :window_blu
  610.       draw_window_tone(rect, index, @list[index][:symbol])
  611.     when :volume_bgm, :volume_bgs, :volume_sfx
  612.       draw_volume(rect, index, @list[index][:symbol])
  613.     when :autodash, :instantmsg, :animations
  614.       draw_toggle(rect, index, @list[index][:symbol])
  615.     when :to_title, :shutdown
  616.       draw_text(item_rect_for_text(index), command_name(index), 1)
  617.     when :custom_switch
  618.       draw_custom_switch(rect, index, @list[index][:ext])
  619.     when :custom_variable
  620.       draw_custom_variable(rect, index, @list[index][:ext])
  621.     end
  622.   end
  623.   
  624.   #--------------------------------------------------------------------------
  625.   # draw_window_tone
  626.   #--------------------------------------------------------------------------
  627.   def draw_window_tone(rect, index, symbol)
  628.     name = @list[index][:name]
  629.     draw_text(0, rect.y, contents.width/2, line_height, name, 1)
  630.     #---
  631.     dx = contents.width / 2
  632.     tone = $game_system.window_tone
  633.     case symbol
  634.     when :window_red
  635.       rate = (tone.red + 255.0) / 510.0
  636.       colour1 = Color.new(128, 0, 0)
  637.       colour2 = Color.new(255, 0, 0)
  638.       value = tone.red.to_i
  639.     when :window_grn
  640.       rate = (tone.green + 255.0) / 510.0
  641.       colour1 = Color.new(0, 128, 0)
  642.       colour2 = Color.new(0, 255, 0)
  643.       value = tone.green.to_i
  644.     when :window_blu
  645.       rate = (tone.blue + 255.0) / 510.0
  646.       colour1 = Color.new(0, 0, 128)
  647.       colour2 = Color.new(0, 0, 255)
  648.       value = tone.blue.to_i
  649.     end
  650.     draw_gauge(dx, rect.y, contents.width - dx - 48, rate, colour1, colour2)
  651.     draw_text(dx, rect.y, contents.width - dx - 48, line_height, value, 2)
  652.   end
  653.   
  654.   #--------------------------------------------------------------------------
  655.   # draw_volume
  656.   #--------------------------------------------------------------------------
  657.   def draw_volume(rect, index, symbol)
  658.     name = @list[index][:name]
  659.     draw_text(0, rect.y, contents.width/2, line_height, name, 1)
  660.     #---
  661.     dx = contents.width / 2
  662.     case symbol
  663.     when :volume_bgm
  664.       rate = $game_system.volume(:bgm)
  665.     when :volume_bgs
  666.       rate = $game_system.volume(:bgs)
  667.     when :volume_sfx
  668.       rate = $game_system.volume(:sfx)
  669.     end
  670.     colour1 = text_color(YEA::SYSTEM::COMMAND_VOCAB[symbol][1])
  671.     colour2 = text_color(YEA::SYSTEM::COMMAND_VOCAB[symbol][2])
  672.     value = sprintf("%d%%", rate)
  673.     rate *= 0.01
  674.     draw_gauge(dx, rect.y, contents.width - dx - 48, rate, colour1, colour2)
  675.     draw_text(dx, rect.y, contents.width - dx - 48, line_height, value, 2)
  676.   end
  677.   
  678.   #--------------------------------------------------------------------------
  679.   # draw_toggle
  680.   #--------------------------------------------------------------------------
  681.   def draw_toggle(rect, index, symbol)
  682.     name = @list[index][:name]
  683.     draw_text(0, rect.y, contents.width/2, line_height, name, 1)
  684.     #---
  685.     dx = contents.width / 2
  686.     case symbol
  687.     when :autodash
  688.       enabled = $game_system.autodash?
  689.     when :instantmsg
  690.       enabled = $game_system.instantmsg?
  691.     when :animations
  692.       enabled = $game_system.animations?
  693.     end
  694.     dx = contents.width/2
  695.     change_color(normal_color, !enabled)
  696.     option1 = YEA::SYSTEM::COMMAND_VOCAB[symbol][1]
  697.     draw_text(dx, rect.y, contents.width/4, line_height, option1, 1)
  698.     dx += contents.width/4
  699.     change_color(normal_color, enabled)
  700.     option2 = YEA::SYSTEM::COMMAND_VOCAB[symbol][2]
  701.     draw_text(dx, rect.y, contents.width/4, line_height, option2, 1)
  702.   end
  703.   
  704.   #--------------------------------------------------------------------------
  705.   # cursor_right
  706.   #--------------------------------------------------------------------------
  707.   def draw_custom_switch(rect, index, ext)
  708.     name = @list[index][:name]
  709.     draw_text(0, rect.y, contents.width/2, line_height, name, 1)
  710.     #---
  711.     dx = contents.width / 2
  712.     enabled = $game_switches[YEA::SYSTEM::CUSTOM_SWITCHES[ext][0]]
  713.     dx = contents.width/2
  714.     change_color(normal_color, !enabled)
  715.     option1 = YEA::SYSTEM::CUSTOM_SWITCHES[ext][2]
  716.     draw_text(dx, rect.y, contents.width/4, line_height, option1, 1)
  717.     dx += contents.width/4
  718.     change_color(normal_color, enabled)
  719.     option2 = YEA::SYSTEM::CUSTOM_SWITCHES[ext][3]
  720.     draw_text(dx, rect.y, contents.width/4, line_height, option2, 1)
  721.   end
  722.   
  723.   #--------------------------------------------------------------------------
  724.   # draw_custom_variable
  725.   #--------------------------------------------------------------------------
  726.   def draw_custom_variable(rect, index, ext)
  727.     name = @list[index][:name]
  728.     draw_text(0, rect.y, contents.width/2, line_height, name, 1)
  729.     #---
  730.     dx = contents.width / 2
  731.     value = $game_variables[YEA::SYSTEM::CUSTOM_VARIABLES[ext][0]]
  732.     colour1 = text_color(YEA::SYSTEM::CUSTOM_VARIABLES[ext][2])
  733.     colour2 = text_color(YEA::SYSTEM::CUSTOM_VARIABLES[ext][3])
  734.     minimum = YEA::SYSTEM::CUSTOM_VARIABLES[ext][4]
  735.     maximum = YEA::SYSTEM::CUSTOM_VARIABLES[ext][5]
  736.     rate = (value - minimum).to_f / [(maximum - minimum).to_f, 0.01].max
  737.     dx = contents.width/2
  738.     draw_gauge(dx, rect.y, contents.width - dx - 48, rate, colour1, colour2)
  739.     draw_text(dx, rect.y, contents.width - dx - 48, line_height, value, 2)
  740.   end
  741.   
  742.   #--------------------------------------------------------------------------
  743.   # cursor_right
  744.   #--------------------------------------------------------------------------
  745.   def cursor_right(wrap = false)
  746.     cursor_change(:right)
  747.     super(wrap)
  748.   end
  749.   
  750.   #--------------------------------------------------------------------------
  751.   # cursor_left
  752.   #--------------------------------------------------------------------------
  753.   def cursor_left(wrap = false)
  754.     cursor_change(:left)
  755.     super(wrap)
  756.   end
  757.   
  758.   #--------------------------------------------------------------------------
  759.   # cursor_change
  760.   #--------------------------------------------------------------------------
  761.   def cursor_change(direction)
  762.     case current_symbol
  763.     when :window_red, :window_blu, :window_grn
  764.       change_window_tone(direction)
  765.     when :volume_bgm, :volume_bgs, :volume_sfx
  766.       change_volume(direction)
  767.     when :autodash, :instantmsg, :animations
  768.       change_toggle(direction)
  769.     when :custom_switch
  770.       change_custom_switch(direction)
  771.     when :custom_variable
  772.       change_custom_variables(direction)
  773.     end
  774.   end
  775.   
  776.   #--------------------------------------------------------------------------
  777.   # change_window_tone
  778.   #--------------------------------------------------------------------------
  779.   def change_window_tone(direction)
  780.     Sound.play_cursor
  781.     value = direction == :left ? -1 : 1
  782.     value *= 10 if Input.press?(:A)
  783.     tone = $game_system.window_tone.clone
  784.     case current_symbol
  785.     when :window_red; tone.red += value
  786.     when :window_grn; tone.green += value
  787.     when :window_blu; tone.blue += value
  788.     end
  789.     $game_system.window_tone = tone
  790.     draw_item(index)
  791.   end
  792.   
  793.   #--------------------------------------------------------------------------
  794.   # change_window_tone
  795.   #--------------------------------------------------------------------------
  796.   def change_volume(direction)
  797.     Sound.play_cursor
  798.     value = direction == :left ? -1 : 1
  799.     value *= 10 if Input.press?(:A)
  800.     case current_symbol
  801.     when :volume_bgm
  802.       $game_system.volume_change(:bgm, value)
  803.       RPG::BGM::last.play
  804.     when :volume_bgs
  805.       $game_system.volume_change(:bgs, value)
  806.       RPG::BGS::last.play
  807.     when :volume_sfx
  808.       $game_system.volume_change(:sfx, value)
  809.     end
  810.     draw_item(index)
  811.   end
  812.   
  813.   #--------------------------------------------------------------------------
  814.   # change_toggle
  815.   #--------------------------------------------------------------------------
  816.   def change_toggle(direction)
  817.     value = direction == :left ? false : true
  818.     case current_symbol
  819.     when :autodash
  820.       current_case = $game_system.autodash?
  821.       $game_system.set_autodash(value)
  822.     when :instantmsg
  823.       current_case = $game_system.instantmsg?
  824.       $game_system.set_instantmsg(value)
  825.     when :animations
  826.       current_case = $game_system.animations?
  827.       $game_system.set_animations(value)
  828.     end
  829.     Sound.play_cursor if value != current_case
  830.     draw_item(index)
  831.   end
  832.   
  833.   #--------------------------------------------------------------------------
  834.   # change_custom_switch
  835.   #--------------------------------------------------------------------------
  836.   def change_custom_switch(direction)
  837.     value = direction == :left ? false : true
  838.     ext = current_ext
  839.     current_case = $game_switches[YEA::SYSTEM::CUSTOM_SWITCHES[ext][0]]
  840.     $game_switches[YEA::SYSTEM::CUSTOM_SWITCHES[ext][0]] = value
  841.     Sound.play_cursor if value != current_case
  842.     draw_item(index)
  843.   end
  844.   
  845.   #--------------------------------------------------------------------------
  846.   # change_custom_variables
  847.   #--------------------------------------------------------------------------
  848.   def change_custom_variables(direction)
  849.     Sound.play_cursor
  850.     value = direction == :left ? -1 : 1
  851.     value *= 10 if Input.press?(:A)
  852.     ext = current_ext
  853.     var = YEA::SYSTEM::CUSTOM_VARIABLES[ext][0]
  854.     minimum = YEA::SYSTEM::CUSTOM_VARIABLES[ext][4]
  855.     maximum = YEA::SYSTEM::CUSTOM_VARIABLES[ext][5]
  856.     $game_variables[var] += value
  857.     $game_variables[var] = [[$game_variables[var], minimum].max, maximum].min
  858.     draw_item(index)
  859.   end
  860.   
  861. end # Window_SystemOptions

  862. #==============================================================================
  863. # ■ Scene_Menu
  864. #==============================================================================

  865. class Scene_Menu < Scene_MenuBase
  866.   
  867.   #--------------------------------------------------------------------------
  868.   # overwrite method: command_game_end
  869.   #--------------------------------------------------------------------------
  870.   def command_game_end
  871.     SceneManager.call(Scene_System)
  872.   end
  873.   
  874. end # Scene_Menu

  875. #==============================================================================
  876. # ■ Scene_System
  877. #==============================================================================

  878. class Scene_System < Scene_MenuBase
  879.   
  880.   #--------------------------------------------------------------------------
  881.   # start
  882.   #--------------------------------------------------------------------------
  883.   def start
  884.     super
  885.     create_help_window
  886.     create_command_window
  887.   end
  888.   
  889.   #--------------------------------------------------------------------------
  890.   # create_command_window
  891.   #--------------------------------------------------------------------------
  892.   def create_command_window
  893.     @command_window = Window_SystemOptions.new(@help_window)
  894.     @command_window.set_handler(:cancel, method(:return_scene))
  895.     @command_window.set_handler(:to_title, method(:command_to_title))
  896.     @command_window.set_handler(:shutdown, method(:command_shutdown))
  897.   end
  898.   
  899.   #--------------------------------------------------------------------------
  900.   # command_to_title
  901.   #--------------------------------------------------------------------------
  902.   def command_to_title
  903.     fadeout_all
  904.     SceneManager.goto(Scene_Title)
  905.   end
  906.   
  907.   #--------------------------------------------------------------------------
  908.   # command_shutdown
  909.   #--------------------------------------------------------------------------
  910.   def command_shutdown
  911.     fadeout_all
  912.     SceneManager.exit
  913.   end
  914.   
  915. end # Scene_System

  916. #==============================================================================
  917. #
  918. # ▼ End of File
  919. #
  920. #==============================================================================
复制代码

点评

还是这个比较简单易懂....不过要怎么在标题画面加入这个设置选项...我脚本姿势为零...  发表于 2015-7-16 03:35

坑的进度如上                                                                                                        点击↑
回复 支持 反对

使用道具 举报

Lv5.捕梦者

梦石
0
星屑
22953
在线时间
8638 小时
注册时间
2011-12-31
帖子
3367
3
发表于 2015-7-15 15:55:21 | 只看该作者
太多了
1:

http://yunpan.cn/cQvyfCwgnJ3P3  访问密码 5180
2:
サウンドコンフィグ


评分

参与人数 1星屑 +200 收起 理由
taroxd + 200 认可答案

查看全部评分

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
46 小时
注册时间
2015-7-13
帖子
89
4
 楼主| 发表于 2015-7-15 23:46:11 | 只看该作者
本帖最后由 magimagi 于 2015-7-16 03:34 编辑
tseyik 发表于 2015-7-15 15:55
太多了
1:


(ノ゚∀゚)ノ太感谢了~~我真是一直都觉得RM系列的默认音量特别高..
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
46 小时
注册时间
2015-7-13
帖子
89
5
 楼主| 发表于 2015-7-15 23:58:58 | 只看该作者
tseyik 发表于 2015-7-15 15:55
太多了
1:

这个范例系统强化好凶残..尽管卡了...但依然吓得我都连贴了...(´゚Д゚`)
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
70
在线时间
1083 小时
注册时间
2013-3-29
帖子
2394
6
发表于 2015-7-16 09:37:51 | 只看该作者
黄濑凉太 发表于 2015-7-15 11:37

在Main上再插入这一段代码:
  1. class Window_TitleCommand < Window_Command
  2.   def make_command_list
  3.     add_command(Vocab::new_game, :new_game)
  4.     add_command(Vocab::continue, :continue, continue_enabled)
  5.     add_command(Vocab::shutdown, :shutdown)
  6.     add_command("设置", :system)
  7.   end
  8. end
  9. class Scene_Title < Scene_Base
  10.   def create_command_window
  11.     @command_window = Window_TitleCommand.new
  12.     @command_window.set_handler(:new_game, method(:command_new_game))
  13.     @command_window.set_handler(:continue, method(:command_continue))
  14.     @command_window.set_handler(:shutdown, method(:command_shutdown))
  15.     @command_window.set_handler(:system, method(:command_system))
  16.   end
  17.   def command_system
  18.     close_command_window
  19.     SceneManager.call(Scene_System)
  20.   end
  21. end
复制代码

点评

非常感谢~ 那几个自定义按钮是预留用来加入自设功能的么?  发表于 2015-7-16 11:40

坑的进度如上                                                                                                        点击↑
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
46 小时
注册时间
2015-7-13
帖子
89
7
 楼主| 发表于 2015-7-16 12:45:17 | 只看该作者
黄濑凉太 发表于 2015-7-16 09:37
在Main上再插入这一段代码:

我用的横版战斗系统貌似不能使用那个跳过战斗画面的功能..是不是把
116行[:animations,   # Enables battle animations or disables them.]

227行:animations => ["战斗动画", "跳过", "显示",
~~230行 ], # Do not remove this.

前面加 # 屏蔽掉就可以了?(ノ゚∀゚)ノ
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-16 08:50

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表