Project1

标题: 关于菜单的问题 [打印本页]

作者: 希尔密璘    时间: 2014-6-22 00:45
标题: 关于菜单的问题
小的想向各位请教,怎么弄个类似口袋妖怪菜单里的“设置”?我只找到XP的,找不到ACE版。。。
作者: 子弹君    时间: 2014-6-22 12:37
你设置里面想要什么功能你都没说清楚
作者: 子弹君    时间: 2014-6-22 12:40
本帖最后由 熊喵酱 于 2014-6-21 21:42 编辑

设置脚本倒是有一个,不知道你满不满意,需要一张界面UI,具体设置看脚本
RUBY 代码复制
  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.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-SystemOptions"] = true
  12.  
  13. #==============================================================================
  14. # ▼ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.01.01 - Started Script and Finished.
  17. #
  18. #==============================================================================
  19. # ▼ Introduction
  20. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  21. # This script replaces the "Game End" option in the Main Menu with a "System"
  22. # menu where the player can adjust various settings in the game. Of them, the
  23. # player can change the window colour, the volume for BGM, BGS, SFX, set
  24. # automatic dashing, message text to display instantly, and speed up battles by
  25. # hiding battle animations.
  26. #
  27. #==============================================================================
  28. # ▼ Instructions
  29. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  30. # To install this script, open up your script editor and copy/paste this script
  31. # to an open slot below ▼ Materials/素材 but above ▼ Main. Remember to save.
  32. #
  33. # -----------------------------------------------------------------------------
  34. # Script Calls - These commands are used with script calls.
  35. # -----------------------------------------------------------------------------
  36. # $game_system.volume_change(:bgm, x)
  37. # $game_system.volume_change(:bgs, x)
  38. # $game_system.volume_change(:sfx, x)
  39. # Unlike the previous Yanfly Engines, this version does not bind volume to a
  40. # variable. Use the script call to change the bgm, bgs, or sfx sound rate by
  41. # x increment. Use a negative value to lower the volume.
  42. #
  43. # $game_system.set_autodash(true)
  44. # $game_system.set_autodash(false)
  45. # Turns autodash on (true) or off (false).
  46. #
  47. # $game_system.set_instantmsg(true)
  48. # $game_system.set_instantmsg(false)
  49. # Turns instant messages on (true) or off (false).
  50. #
  51. # $game_system.set_animations(true)
  52. # $game_system.set_animations(false)
  53. # Turns battle animations on (true) or off (false).
  54. #
  55. #==============================================================================
  56. # ▼ Compatibility
  57. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  58. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  59. # it will run with RPG Maker VX without adjusting.
  60. #
  61. #==============================================================================
  62.  
  63. module YEA
  64.   module SYSTEM
  65.  
  66.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  67.     # - General Setting -
  68.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  69.     # These are the general settings that govern the System settings. This will
  70.     # change the "Game End" vocab, and disable or enable autodash, instant
  71.     # messages, or animations by default.
  72.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  73.     COMMAND_NAME = "系统"      # Command name used to replace Game End.
  74.     DEFAULT_AUTODASH   = true    # Enable automatic dashing by default?
  75.     DEFAULT_INSTANTMSG = false   # Enable instant message text by default?
  76.     DEFAULT_ANIMATIONS = true    # Enable battle animations by default?
  77.  
  78.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  79.     # - Command Settings -
  80.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  81.     # These settings adjust the commands shown in the command list. Add, remove
  82.     # or rearrange the commands as you see fit. Here's a list of which commands
  83.     # do what:
  84.     #
  85.     # -------------------------------------------------------------------------
  86.     # :command         Description
  87.     # -------------------------------------------------------------------------
  88.     # :blank           Inserts an empty blank space.
  89.     #
  90.     # :window_red      Changes the red tone for all windows.
  91.     # :window_grn      Changes the green tone for all windows.
  92.     # :window_blu      Changes the blue tone for all windows.
  93.     #
  94.     # :volume_bgm      Changes the BGM volume used.
  95.     # :volume_bgs      Changes the BGS volume used.
  96.     # :volume_sfx      Changes the SFX volume used.
  97.     #
  98.     # :autodash        Sets the player to automatically dash.
  99.     # :instantmsg      Sets message text to appear instantly.
  100.     # :animations      Enables battle animations or disables them.
  101.     #
  102.     # :to_title        Returns to the title screen.
  103.     # :shutdown        Shuts down the game.
  104.     #
  105.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  106.     COMMANDS =[
  107.       :window_red,   # Changes the red tone for all windows.
  108.       :window_grn,   # Changes the green tone for all windows.
  109.       :window_blu,   # Changes the blue tone for all windows.
  110.       :volume_bgm,   # Changes the BGM volume used.
  111.       :volume_bgs,   # Changes the BGS volume used.
  112.       :volume_sfx,   # Changes the SFX volume used.
  113.       :blank,
  114.       :autodash,     # Sets the player to automatically dash.
  115.       :instantmsg,   # Sets message text to appear instantly.
  116.       :animations,   # Enables battle animations or disables them.
  117.     # :switch_1,     # Custom Switch 1. Adjust settings below.
  118.     # :switch_2,     # Custom Switch 2. Adjust settings below.
  119.     # :variable_1,   # Custom Variable 1. Adjust settings below.
  120.     # :variable_2,   # Custom Variable 2. Adjust settings below.
  121.       :blank,
  122.       :to_title,     # Returns to the title screen.
  123.       :shutdown,     # Shuts down the game.
  124.     ] # Do not remove this.
  125.  
  126.     #--------------------------------------------------------------------------
  127.     # - Custom Switches -
  128.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  129.     # If you want your game to have system options other than just the ones
  130.     # listed above, you can insert custom switches here to produce such an
  131.     # effect. Adjust the settings here as you see fit.
  132.     #--------------------------------------------------------------------------
  133.     CUSTOM_SWITCHES ={
  134.     # -------------------------------------------------------------------------
  135.     # :switch    => [Switch, Name, Off Text, On Text,
  136.     #                Help Window Description
  137.     #               ], # Do not remove this.
  138.     # -------------------------------------------------------------------------
  139.       :switch_1  => [ 1, "Custom Switch 1", "OFF", "ON",
  140.                      "Help description used for custom switch 1."
  141.                     ],
  142.     # -------------------------------------------------------------------------
  143.       :switch_2  => [ 2, "Custom Switch 2", "OFF", "ON",
  144.                      "Help description used for custom switch 2."
  145.                     ],
  146.     # -------------------------------------------------------------------------
  147.     } # Do not remove this.
  148.  
  149.     #--------------------------------------------------------------------------
  150.     # - Custom Variables -
  151.     # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  152.     # If you want your game to have system options other than just the ones
  153.     # listed above, you can insert custom variables here to produce such an
  154.     # effect. Adjust the settings here as you see fit.
  155.     #--------------------------------------------------------------------------
  156.     CUSTOM_VARIABLES ={
  157.     # -------------------------------------------------------------------------
  158.     # :variable   => [Switch, Name, Colour1, Colour2, Min, Max,
  159.     #                 Help Window Description
  160.     #                ], # Do not remove this.
  161.     # -------------------------------------------------------------------------
  162.       :variable_1 => [ 1, "Custom Variable 1", 9, 1, -100, 100,
  163.                       "Help description used for custom variable 1."
  164.                      ],
  165.     # -------------------------------------------------------------------------
  166.       :variable_2 => [ 2, "Custom Variable 2", 10, 2, -10, 10,
  167.                       "Help description used for custom variable 2."
  168.                      ],
  169.     # -------------------------------------------------------------------------
  170.     } # Do not remove this.
  171.  
  172.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  173.     # - Vocab Settings -
  174.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  175.     # This hash adjusts the vocab used for both the commands and the help
  176.     # description that appears above the command window. Note that for the
  177.     # command help descriptions, you may use text codes. Use \n to linebreak.
  178.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  179.     COMMAND_VOCAB ={
  180.     # -------------------------------------------------------------------------
  181.     # :command    => [Command Name, Option1, Option2
  182.     #                 Help Window Description,
  183.     #                ], # Do not remove this.
  184.     # -------------------------------------------------------------------------
  185.       :blank      => ["", "None", "None",
  186.                       ""
  187.                      ], # Do not remove this.
  188.     # -------------------------------------------------------------------------
  189.       :window_red => ["窗口红色", "None", "None",
  190.                       "调整窗口颜色.\n" +
  191.                       "按住shift可增加10."
  192.                      ], # Do not remove this.
  193.     # -------------------------------------------------------------------------
  194.       :window_grn => ["窗口青色", "None", "None",
  195.                       "调整窗口颜色.\n" +
  196.                       "按住shift可增加10."
  197.                      ], # Do not remove this.
  198.     # -------------------------------------------------------------------------
  199.       :window_blu => ["窗口蓝色", "None", "None",
  200.                       "调整窗口颜色.\n" +
  201.                       "按住shift可增加10."
  202.                      ], # Do not remove this.
  203.     # -------------------------------------------------------------------------
  204.       :volume_bgm => ["背景音乐", 12, 4, # Options 1 & 2 are Gauge Colours.
  205.                       "调整背景音乐.\n" +
  206.                       "按住shift可增加10."
  207.                      ], # Do not remove this.
  208.     # -------------------------------------------------------------------------
  209.       :volume_bgs => ["音效", 13, 5, # Options 1 & 2 are Gauge Colours.
  210.                       "调整音效大小.\n" +
  211.                       "按住shift可增加10."
  212.                      ], # Do not remove this.
  213.     # -------------------------------------------------------------------------
  214.       :volume_sfx => ["声效", 14, 6, # Options 1 & 2 are Gauge Colours.
  215.                       "调整声效大小.\n" +
  216.                       "按住shift可增加10."
  217.                      ], # Do not remove this.
  218.     # -------------------------------------------------------------------------
  219.       :autodash   => ["自动加速", "减速", "加速",
  220.                       "不用按加速移动键就自动加速移动."
  221.                      ], # Do not remove this.
  222.     # -------------------------------------------------------------------------
  223.       :instantmsg => ["文章显示", "普通显示", "快速显示",
  224.                       "调整文章显示类型."
  225.                      ], # Do not remove this.
  226.     # -------------------------------------------------------------------------
  227.       :to_title   => ["回到标题", "None", "None",
  228.                       "回到标题画面."
  229.                      ], # Do not remove this.
  230.     # -------------------------------------------------------------------------
  231.       :shutdown   => ["离开游戏", "None", "None",
  232.                       "关闭游戏."
  233.                      ], # Do not remove this.
  234.     # -------------------------------------------------------------------------
  235.     } # Do not remove this.
  236.  
  237.   end # SYSTEM
  238. end # YEA
  239.  
  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. #==============================================================================
  247. # ■ Vocab
  248. #==============================================================================
  249.  
  250. module Vocab
  251.  
  252.   #--------------------------------------------------------------------------
  253.   # overwrite method: self.game_end
  254.   #--------------------------------------------------------------------------
  255.   def self.game_end
  256.     return YEA::SYSTEM::COMMAND_NAME
  257.   end
  258.  
  259. end # Vocab
  260.  
  261. #==============================================================================
  262. # ■ RPG::BGM
  263. #==============================================================================
  264.  
  265. class RPG::BGM < RPG::AudioFile
  266.  
  267.   #--------------------------------------------------------------------------
  268.   # overwrite method: play
  269.   #--------------------------------------------------------------------------
  270.   def play(pos = 0)
  271.     if @name.empty?
  272.       Audio.bgm_stop
  273.       @@last = RPG::BGM.new
  274.     else
  275.       volume = @volume
  276.       volume *= $game_system.volume(:bgm) * 0.01 unless $game_system.nil?
  277.       Audio.bgm_play('Audio/BGM/' + @name, volume, @pitch, pos)
  278.       @@last = self.clone
  279.     end
  280.   end
  281.  
  282. end # RPG::BGM
  283.  
  284. #==============================================================================
  285. # ■ RPG::ME
  286. #==============================================================================
  287.  
  288. class RPG::ME < RPG::AudioFile
  289.  
  290.   #--------------------------------------------------------------------------
  291.   # overwrite method: play
  292.   #--------------------------------------------------------------------------
  293.   def play
  294.     if @name.empty?
  295.       Audio.me_stop
  296.     else
  297.       volume = @volume
  298.       volume *= $game_system.volume(:bgm) * 0.01 unless $game_system.nil?
  299.       Audio.me_play('Audio/ME/' + @name, volume, @pitch)
  300.     end
  301.   end
  302.  
  303. end # RPG::ME
  304.  
  305. #==============================================================================
  306. # ■ RPG::BGS
  307. #==============================================================================
  308.  
  309. class RPG::BGS < RPG::AudioFile
  310.  
  311.   #--------------------------------------------------------------------------
  312.   # overwrite method: play
  313.   #--------------------------------------------------------------------------
  314.   def play(pos = 0)
  315.     if @name.empty?
  316.       Audio.bgs_stop
  317.       @@last = RPG::BGS.new
  318.     else
  319.       volume = @volume
  320.       volume *= $game_system.volume(:bgs) * 0.01 unless $game_system.nil?
  321.       Audio.bgs_play('Audio/BGS/' + @name, volume, @pitch, pos)
  322.       @@last = self.clone
  323.     end
  324.   end
  325.  
  326. end # RPG::BGS
  327.  
  328. #==============================================================================
  329. # ■ RPG::SE
  330. #==============================================================================
  331.  
  332. class RPG::SE < RPG::AudioFile
  333.  
  334.   #--------------------------------------------------------------------------
  335.   # overwrite method: play
  336.   #--------------------------------------------------------------------------
  337.   def play
  338.     unless @name.empty?
  339.       volume = @volume
  340.       volume *= $game_system.volume(:sfx) * 0.01 unless $game_system.nil?
  341.       Audio.se_play('Audio/SE/' + @name, volume, @pitch)
  342.     end
  343.   end
  344.  
  345. end # RPG::SE
  346.  
  347. #==============================================================================
  348. # ■ Game_System
  349. #==============================================================================
  350.  
  351. class Game_System
  352.  
  353.   #--------------------------------------------------------------------------
  354.   # alias method: initialize
  355.   #--------------------------------------------------------------------------
  356.   alias game_system_initialize_so initialize
  357.   def initialize
  358.     game_system_initialize_so
  359.     init_volume_control
  360.     init_autodash
  361.     init_instantmsg
  362.     init_animations
  363.   end
  364.  
  365.   #--------------------------------------------------------------------------
  366.   # new method: init_volume_control
  367.   #--------------------------------------------------------------------------
  368.   def init_volume_control
  369.     @volume = {}
  370.     @volume[:bgm] = 100
  371.     @volume[:bgs] = 100
  372.     @volume[:sfx] = 100
  373.   end
  374.  
  375.   #--------------------------------------------------------------------------
  376.   # new method: volume
  377.   #--------------------------------------------------------------------------
  378.   def volume(type)
  379.     init_volume_control if @volume.nil?
  380.     return [[@volume[type], 0].max, 100].min
  381.   end
  382.  
  383.   #--------------------------------------------------------------------------
  384.   # new method: volume_change
  385.   #--------------------------------------------------------------------------
  386.   def volume_change(type, increment)
  387.     init_volume_control if @volume.nil?
  388.     @volume[type] += increment
  389.     @volume[type] = [[@volume[type], 0].max, 100].min
  390.   end
  391.  
  392.   #--------------------------------------------------------------------------
  393.   # new method: init_autodash
  394.   #--------------------------------------------------------------------------
  395.   def init_autodash
  396.     @autodash = YEA::SYSTEM::DEFAULT_AUTODASH
  397.   end
  398.  
  399.   #--------------------------------------------------------------------------
  400.   # new method: autodash?
  401.   #--------------------------------------------------------------------------
  402.   def autodash?
  403.     init_autodash if @autodash.nil?
  404.     return @autodash
  405.   end
  406.  
  407.   #--------------------------------------------------------------------------
  408.   # new method: set_autodash
  409.   #--------------------------------------------------------------------------
  410.   def set_autodash(value)
  411.     @autodash = value
  412.   end
  413.  
  414.   #--------------------------------------------------------------------------
  415.   # new method: init_instantmsg
  416.   #--------------------------------------------------------------------------
  417.   def init_instantmsg
  418.     @instantmsg = YEA::SYSTEM::DEFAULT_INSTANTMSG
  419.   end
  420.  
  421.   #--------------------------------------------------------------------------
  422.   # new method: instantmsg?
  423.   #--------------------------------------------------------------------------
  424.   def instantmsg?
  425.     init_instantmsg if @instantmsg.nil?
  426.     return @instantmsg
  427.   end
  428.  
  429.   #--------------------------------------------------------------------------
  430.   # new method: set_instantmsg
  431.   #--------------------------------------------------------------------------
  432.   def set_instantmsg(value)
  433.     @instantmsg = value
  434.   end
  435.  
  436.   #--------------------------------------------------------------------------
  437.   # new method: init_animations
  438.   #--------------------------------------------------------------------------
  439.   def init_animations
  440.     @animations = YEA::SYSTEM::DEFAULT_ANIMATIONS
  441.   end
  442.  
  443.   #--------------------------------------------------------------------------
  444.   # new method: animations?
  445.   #--------------------------------------------------------------------------
  446.   def animations?
  447.     init_animations if @animations.nil?
  448.     return @animations
  449.   end
  450.  
  451.   #--------------------------------------------------------------------------
  452.   # new method: set_animations
  453.   #--------------------------------------------------------------------------
  454.   def set_animations(value)
  455.     @animations = value
  456.   end
  457.  
  458. end # Game_System
  459.  
  460. #==============================================================================
  461. # ■ Game_Player
  462. #==============================================================================
  463.  
  464. class Game_Player < Game_Character
  465.  
  466.   #--------------------------------------------------------------------------
  467.   # alias method: dash?
  468.   #--------------------------------------------------------------------------
  469.   alias game_player_dash_so dash?
  470.   def dash?
  471.     if $game_system.autodash?
  472.       return false if @move_route_forcing
  473.       return false if $game_map.disable_dash?
  474.       return false if vehicle
  475.       return !Input.press?(:A)
  476.     else
  477.       return game_player_dash_so
  478.     end
  479.   end
  480.  
  481. end # Game_Player
  482.  
  483. #==============================================================================
  484. # ■ Scene_Battle
  485. #==============================================================================
  486.  
  487. class Scene_Battle < Scene_Base
  488.  
  489.   #--------------------------------------------------------------------------
  490.   # alias method: show_fast?
  491.   #--------------------------------------------------------------------------
  492.   alias scene_battle_show_fast_so show_fast?
  493.   def show_fast?
  494.     return true unless $game_system.animations?
  495.     return scene_battle_show_fast_so
  496.   end
  497.  
  498.   #--------------------------------------------------------------------------
  499.   # alias method: show_normal_animation
  500.   #--------------------------------------------------------------------------
  501.   alias scene_battle_show_normal_animation_so show_normal_animation
  502.   def show_normal_animation(targets, animation_id, mirror = false)
  503.     return unless $game_system.animations?
  504.     scene_battle_show_normal_animation_so(targets, animation_id, mirror)
  505.   end
  506.  
  507. end # Scene_Battle
  508.  
  509. #==============================================================================
  510. # ■ Window_Message
  511. #==============================================================================
  512.  
  513. class Window_Message < Window_Base
  514.  
  515.   #--------------------------------------------------------------------------
  516.   # alias method: clear_flags
  517.   #--------------------------------------------------------------------------
  518.   alias window_message_clear_flags_so clear_flags
  519.   def clear_flags
  520.     window_message_clear_flags_so
  521.     @show_fast = true if $game_system.instantmsg?
  522.   end
  523.  
  524. end # Window_Message
  525.  
  526. #==============================================================================
  527. # ■ Window_SystemOptions
  528. #==============================================================================
  529.  
  530. class Window_SystemOptions < Window_Command
  531.  
  532.   #--------------------------------------------------------------------------
  533.   # initialize
  534.   #--------------------------------------------------------------------------
  535.   def initialize(help_window)
  536.     @help_window = help_window
  537.     super(0, @help_window.height)
  538.     refresh
  539.   end
  540.  
  541.   #--------------------------------------------------------------------------
  542.   # window_width
  543.   #--------------------------------------------------------------------------
  544.   def window_width; return Graphics.width; end
  545.  
  546.   #--------------------------------------------------------------------------
  547.   # window_height
  548.   #--------------------------------------------------------------------------
  549.   def window_height; return Graphics.height - @help_window.height; end
  550.  
  551.   #--------------------------------------------------------------------------
  552.   # update_help
  553.   #--------------------------------------------------------------------------
  554.   def update_help
  555.     if current_symbol == :custom_switch || current_symbol == :custom_variable
  556.       text = @help_descriptions[current_ext]
  557.     else
  558.       text = @help_descriptions[current_symbol]
  559.     end
  560.     text = "" if text.nil?
  561.     @help_window.set_text(text)
  562.   end
  563.  
  564.   #--------------------------------------------------------------------------
  565.   # ok_enabled?
  566.   #--------------------------------------------------------------------------
  567.   def ok_enabled?
  568.     return true if [:to_title, :shutdown].include?(current_symbol)
  569.     return false
  570.   end
  571.  
  572.   #--------------------------------------------------------------------------
  573.   # make_command_list
  574.   #--------------------------------------------------------------------------
  575.   def make_command_list
  576.     @help_descriptions = {}
  577.     for command in YEA::SYSTEM::COMMANDS
  578.       case command
  579.       when :blank
  580.         add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command)
  581.         @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3]
  582.       when :window_red, :window_grn, :window_blu
  583.         add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command)
  584.         @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3]
  585.       when :volume_bgm, :volume_bgs, :volume_sfx
  586.         add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command)
  587.         @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3]
  588.       when :autodash, :instantmsg
  589.         add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command)
  590.         @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3]
  591.       when :to_title, :shutdown
  592.         add_command(YEA::SYSTEM::COMMAND_VOCAB[command][0], command)
  593.         @help_descriptions[command] = YEA::SYSTEM::COMMAND_VOCAB[command][3]
  594.       else
  595.         process_custom_switch(command)
  596.         process_custom_variable(command)
  597.       end
  598.     end
  599.   end
  600.  
  601.   #--------------------------------------------------------------------------
  602.   # process_custom_switch
  603.   #--------------------------------------------------------------------------
  604.   def process_custom_switch(command)
  605.     return unless YEA::SYSTEM::CUSTOM_SWITCHES.include?(command)
  606.     name = YEA::SYSTEM::CUSTOM_SWITCHES[command][1]
  607.     add_command(name, :custom_switch, true, command)
  608.     @help_descriptions[command] = YEA::SYSTEM::CUSTOM_SWITCHES[command][4]
  609.   end
  610.  
  611.   #--------------------------------------------------------------------------
  612.   # process_custom_variable
  613.   #--------------------------------------------------------------------------
  614.   def process_custom_variable(command)
  615.     return unless YEA::SYSTEM::CUSTOM_VARIABLES.include?(command)
  616.     name = YEA::SYSTEM::CUSTOM_VARIABLES[command][1]
  617.     add_command(name, :custom_variable, true, command)
  618.     @help_descriptions[command] = YEA::SYSTEM::CUSTOM_VARIABLES[command][6]
  619.   end
  620.  
  621.   #--------------------------------------------------------------------------
  622.   # draw_item
  623.   #--------------------------------------------------------------------------
  624.   def draw_item(index)
  625.     reset_font_settings
  626.     rect = item_rect(index)
  627.     contents.clear_rect(rect)
  628.     case @list[index][:symbol]
  629.     when :window_red, :window_grn, :window_blu
  630.       draw_window_tone(rect, index, @list[index][:symbol])
  631.     when :volume_bgm, :volume_bgs, :volume_sfx
  632.       draw_volume(rect, index, @list[index][:symbol])
  633.     when :autodash, :instantmsg, :animations
  634.       draw_toggle(rect, index, @list[index][:symbol])
  635.     when :to_title, :shutdown
  636.       draw_text(item_rect_for_text(index), command_name(index), 1)
  637.     when :custom_switch
  638.       draw_custom_switch(rect, index, @list[index][:ext])
  639.     when :custom_variable
  640.       draw_custom_variable(rect, index, @list[index][:ext])
  641.     end
  642.   end
  643.  
  644.   #--------------------------------------------------------------------------
  645.   # draw_window_tone
  646.   #--------------------------------------------------------------------------
  647.   def draw_window_tone(rect, index, symbol)
  648.     name = @list[index][:name]
  649.     draw_text(0, rect.y, contents.width/2, line_height, name, 1)
  650.     #---
  651.     dx = contents.width / 2
  652.     tone = $game_system.window_tone
  653.     case symbol
  654.     when :window_red
  655.       rate = (tone.red + 255.0) / 510.0
  656.       colour1 = Color.new(128, 0, 0)
  657.       colour2 = Color.new(255, 0, 0)
  658.       value = tone.red.to_i
  659.     when :window_grn
  660.       rate = (tone.green + 255.0) / 510.0
  661.       colour1 = Color.new(0, 128, 0)
  662.       colour2 = Color.new(0, 255, 0)
  663.       value = tone.green.to_i
  664.     when :window_blu
  665.       rate = (tone.blue + 255.0) / 510.0
  666.       colour1 = Color.new(0, 0, 128)
  667.       colour2 = Color.new(0, 0, 255)
  668.       value = tone.blue.to_i
  669.     end
  670.     draw_gauge(dx, rect.y, contents.width - dx - 48, rate, colour1, colour2)
  671.     draw_text(dx, rect.y, contents.width - dx - 48, line_height, value, 2)
  672.   end
  673.  
  674.   #--------------------------------------------------------------------------
  675.   # draw_volume
  676.   #--------------------------------------------------------------------------
  677.   def draw_volume(rect, index, symbol)
  678.     name = @list[index][:name]
  679.     draw_text(0, rect.y, contents.width/2, line_height, name, 1)
  680.     #---
  681.     dx = contents.width / 2
  682.     case symbol
  683.     when :volume_bgm
  684.       rate = $game_system.volume(:bgm)
  685.     when :volume_bgs
  686.       rate = $game_system.volume(:bgs)
  687.     when :volume_sfx
  688.       rate = $game_system.volume(:sfx)
  689.     end
  690.     colour1 = text_color(YEA::SYSTEM::COMMAND_VOCAB[symbol][1])
  691.     colour2 = text_color(YEA::SYSTEM::COMMAND_VOCAB[symbol][2])
  692.     value = sprintf("%d%%", rate)
  693.     rate *= 0.01
  694.     draw_gauge(dx, rect.y, contents.width - dx - 48, rate, colour1, colour2)
  695.     draw_text(dx, rect.y, contents.width - dx - 48, line_height, value, 2)
  696.   end
  697.  
  698.   #--------------------------------------------------------------------------
  699.   # draw_toggle
  700.   #--------------------------------------------------------------------------
  701.   def draw_toggle(rect, index, symbol)
  702.     name = @list[index][:name]
  703.     draw_text(0, rect.y, contents.width/2, line_height, name, 1)
  704.     #---
  705.     dx = contents.width / 2
  706.     case symbol
  707.     when :autodash
  708.       enabled = $game_system.autodash?
  709.     when :instantmsg
  710.       enabled = $game_system.instantmsg?
  711.     when :animations
  712.       enabled = $game_system.animations?
  713.     end
  714.     dx = contents.width/2
  715.     change_color(normal_color, !enabled)
  716.     option1 = YEA::SYSTEM::COMMAND_VOCAB[symbol][1]
  717.     draw_text(dx, rect.y, contents.width/4, line_height, option1, 1)
  718.     dx += contents.width/4
  719.     change_color(normal_color, enabled)
  720.     option2 = YEA::SYSTEM::COMMAND_VOCAB[symbol][2]
  721.     draw_text(dx, rect.y, contents.width/4, line_height, option2, 1)
  722.   end
  723.  
  724.   #--------------------------------------------------------------------------
  725.   # cursor_right
  726.   #--------------------------------------------------------------------------
  727.   def draw_custom_switch(rect, index, ext)
  728.     name = @list[index][:name]
  729.     draw_text(0, rect.y, contents.width/2, line_height, name, 1)
  730.     #---
  731.     dx = contents.width / 2
  732.     enabled = $game_switches[YEA::SYSTEM::CUSTOM_SWITCHES[ext][0]]
  733.     dx = contents.width/2
  734.     change_color(normal_color, !enabled)
  735.     option1 = YEA::SYSTEM::CUSTOM_SWITCHES[ext][2]
  736.     draw_text(dx, rect.y, contents.width/4, line_height, option1, 1)
  737.     dx += contents.width/4
  738.     change_color(normal_color, enabled)
  739.     option2 = YEA::SYSTEM::CUSTOM_SWITCHES[ext][3]
  740.     draw_text(dx, rect.y, contents.width/4, line_height, option2, 1)
  741.   end
  742.  
  743.   #--------------------------------------------------------------------------
  744.   # draw_custom_variable
  745.   #--------------------------------------------------------------------------
  746.   def draw_custom_variable(rect, index, ext)
  747.     name = @list[index][:name]
  748.     draw_text(0, rect.y, contents.width/2, line_height, name, 1)
  749.     #---
  750.     dx = contents.width / 2
  751.     value = $game_variables[YEA::SYSTEM::CUSTOM_VARIABLES[ext][0]]
  752.     colour1 = text_color(YEA::SYSTEM::CUSTOM_VARIABLES[ext][2])
  753.     colour2 = text_color(YEA::SYSTEM::CUSTOM_VARIABLES[ext][3])
  754.     minimum = YEA::SYSTEM::CUSTOM_VARIABLES[ext][4]
  755.     maximum = YEA::SYSTEM::CUSTOM_VARIABLES[ext][5]
  756.     rate = (value - minimum).to_f / [(maximum - minimum).to_f, 0.01].max
  757.     dx = contents.width/2
  758.     draw_gauge(dx, rect.y, contents.width - dx - 48, rate, colour1, colour2)
  759.     draw_text(dx, rect.y, contents.width - dx - 48, line_height, value, 2)
  760.   end
  761.  
  762.   #--------------------------------------------------------------------------
  763.   # cursor_right
  764.   #--------------------------------------------------------------------------
  765.   def cursor_right(wrap = false)
  766.     cursor_change(:right)
  767.     super(wrap)
  768.   end
  769.  
  770.   #--------------------------------------------------------------------------
  771.   # cursor_left
  772.   #--------------------------------------------------------------------------
  773.   def cursor_left(wrap = false)
  774.     cursor_change(:left)
  775.     super(wrap)
  776.   end
  777.  
  778.   #--------------------------------------------------------------------------
  779.   # cursor_change
  780.   #--------------------------------------------------------------------------
  781.   def cursor_change(direction)
  782.     case current_symbol
  783.     when :window_red, :window_blu, :window_grn
  784.       change_window_tone(direction)
  785.     when :volume_bgm, :volume_bgs, :volume_sfx
  786.       change_volume(direction)
  787.     when :autodash, :instantmsg, :animations
  788.       change_toggle(direction)
  789.     when :custom_switch
  790.       change_custom_switch(direction)
  791.     when :custom_variable
  792.       change_custom_variables(direction)
  793.     end
  794.   end
  795.  
  796.   #--------------------------------------------------------------------------
  797.   # change_window_tone
  798.   #--------------------------------------------------------------------------
  799.   def change_window_tone(direction)
  800.     Sound.play_cursor
  801.     value = direction == :left ? -1 : 1
  802.     value *= 10 if Input.press?(:A)
  803.     tone = $game_system.window_tone.clone
  804.     case current_symbol
  805.     when :window_red; tone.red += value
  806.     when :window_grn; tone.green += value
  807.     when :window_blu; tone.blue += value
  808.     end
  809.     $game_system.window_tone = tone
  810.     draw_item(index)
  811.   end
  812.  
  813.   #--------------------------------------------------------------------------
  814.   # change_window_tone
  815.   #--------------------------------------------------------------------------
  816.   def change_volume(direction)
  817.     Sound.play_cursor
  818.     value = direction == :left ? -1 : 1
  819.     value *= 10 if Input.press?(:A)
  820.     case current_symbol
  821.     when :volume_bgm
  822.       $game_system.volume_change(:bgm, value)
  823.       RPG::BGM::last.play
  824.     when :volume_bgs
  825.       $game_system.volume_change(:bgs, value)
  826.       RPG::BGS::last.play
  827.     when :volume_sfx
  828.       $game_system.volume_change(:sfx, value)
  829.     end
  830.     draw_item(index)
  831.   end
  832.  
  833.   #--------------------------------------------------------------------------
  834.   # change_toggle
  835.   #--------------------------------------------------------------------------
  836.   def change_toggle(direction)
  837.     value = direction == :left ? false : true
  838.     case current_symbol
  839.     when :autodash
  840.       current_case = $game_system.autodash?
  841.       $game_system.set_autodash(value)
  842.     when :instantmsg
  843.       current_case = $game_system.instantmsg?
  844.       $game_system.set_instantmsg(value)
  845.     when :animations
  846.       current_case = $game_system.animations?
  847.       $game_system.set_animations(value)
  848.     end
  849.     Sound.play_cursor if value != current_case
  850.     draw_item(index)
  851.   end
  852.  
  853.   #--------------------------------------------------------------------------
  854.   # change_custom_switch
  855.   #--------------------------------------------------------------------------
  856.   def change_custom_switch(direction)
  857.     value = direction == :left ? false : true
  858.     ext = current_ext
  859.     current_case = $game_switches[YEA::SYSTEM::CUSTOM_SWITCHES[ext][0]]
  860.     $game_switches[YEA::SYSTEM::CUSTOM_SWITCHES[ext][0]] = value
  861.     Sound.play_cursor if value != current_case
  862.     draw_item(index)
  863.   end
  864.  
  865.   #--------------------------------------------------------------------------
  866.   # change_custom_variables
  867.   #--------------------------------------------------------------------------
  868.   def change_custom_variables(direction)
  869.     Sound.play_cursor
  870.     value = direction == :left ? -1 : 1
  871.     value *= 10 if Input.press?(:A)
  872.     ext = current_ext
  873.     var = YEA::SYSTEM::CUSTOM_VARIABLES[ext][0]
  874.     minimum = YEA::SYSTEM::CUSTOM_VARIABLES[ext][4]
  875.     maximum = YEA::SYSTEM::CUSTOM_VARIABLES[ext][5]
  876.     $game_variables[var] += value
  877.     $game_variables[var] = [[$game_variables[var], minimum].max, maximum].min
  878.     draw_item(index)
  879.   end
  880.  
  881. end # Window_SystemOptions
  882.  
  883. #==============================================================================
  884. # ■ Scene_Menu
  885. #==============================================================================
  886.  
  887. class Scene_Menu < Scene_MenuBase
  888.  
  889.   #--------------------------------------------------------------------------
  890.   # overwrite method: command_game_end
  891.   #--------------------------------------------------------------------------
  892.   def command_game_end
  893.     SceneManager.call(Scene_System)
  894.   end
  895.  
  896. end # Scene_Menu
  897.  
  898. #==============================================================================
  899. # ■ Scene_System
  900. #==============================================================================
  901.  
  902. class Scene_System < Scene_MenuBase
  903.  
  904.   #--------------------------------------------------------------------------
  905.   # start
  906.   #--------------------------------------------------------------------------
  907.   def start
  908.     super
  909.     [url=home.php?mod=space&uid=34015]@system[/url] = Sprite.new
  910.     @system.bitmap = Cache.system("系统")
  911.     create_help_window
  912.     create_command_window
  913.     @help_window.opacity = 0
  914.   end
  915.  
  916.   #--------------------------------------------------------------------------
  917.   # create_command_window
  918.   #--------------------------------------------------------------------------
  919.   def create_command_window
  920.     @command_window = Window_SystemOptions.new(@help_window)
  921.     @command_window.set_handler(:cancel, method(:return_scene))
  922.     @command_window.set_handler(:to_title, method(:command_to_title))
  923.     @command_window.set_handler(:shutdown, method(:command_shutdown))
  924.     @command_window.opacity = 0
  925.   end
  926.  
  927.   #--------------------------------------------------------------------------
  928.   # command_to_title
  929.   #--------------------------------------------------------------------------
  930.   def command_to_title
  931.     fadeout_all
  932.     SceneManager.goto(Scene_Title)
  933.   end
  934.  
  935.   #--------------------------------------------------------------------------
  936.   # command_shutdown
  937.   #--------------------------------------------------------------------------
  938.   def command_shutdown
  939.     fadeout_all
  940.     SceneManager.exit
  941.   end
  942.   def terminate
  943.     super
  944.     @system.bitmap.dispose
  945.     @system.dispose
  946.   end
  947.  
  948. end # Scene_System
  949.  
  950. #==============================================================================
  951. #
  952. # ▼ End of File
  953. #
  954. #==============================================================================

作者: 希尔密璘    时间: 2014-6-22 13:32
本帖最后由 希尔密璘 于 2014-6-22 15:45 编辑
子弹君 发表于 2014-6-22 12:40
设置脚本倒是有一个,不知道你满不满意,需要一张界面UI,具体设置看脚本#=============================== ...


请问,那个设置里怎么加全屏设置?




欢迎光临 Project1 (https://rpg.blue/) Powered by Discuz! X3.1