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

Project1

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

[已经解决] 这个脚本怎么弄才可以在游戏中更改窗体

[复制链接]

Lv1.梦旅人

梦石
0
星屑
49
在线时间
3 小时
注册时间
2012-5-4
帖子
284
跳转到指定楼层
1
发表于 2012-6-29 18:30:59 | 只看该作者 |只看大图 回帖奖励 |正序浏览 |阅读模式
  1. #===============================================================================
  2. #
  3. # Yanfly Engine Melody - System Game Options
  4. # Last Date Updated: 2010.06.12
  5. # Level: Normal
  6. #
  7. # System Game Options replaces the "Game End" scene found in the default RPG
  8. # Maker VX with a system options menu. In this menu, the player can readjust
  9. # sound volumes, automatic dashing, and more. This changes one of the unused
  10. # game end scene into something a whole lot more useful.
  11. #
  12. #===============================================================================
  13. # Updates
  14. # -----------------------------------------------------------------------------
  15. # o 2010.06.12 - Bugfix for disposing the skins window.
  16. # o 2010.05.14 - Finished Script.
  17. # o 2010.05.12 - Started Script.
  18. #===============================================================================
  19. # Instructions
  20. # -----------------------------------------------------------------------------
  21. # To install this script, open up your script editor and copy/paste this script
  22. # to an open slot below ? Materials but above ? Main. Remember to save.
  23. #
  24. # 1. Scroll down, adjust the various Switches and Variable values to something
  25. #    empty or predetermined.
  26. # 2. Make a "Windows" folder in your project's "Graphics" folder. Insert the
  27. #    window skins you want to use there and adjust the WINDOW_HASH accordingly.
  28. #
  29. #===============================================================================
  30. # Compatibility
  31. # -----------------------------------------------------------------------------
  32. # - Replaces ALL of Scene_End. Expect no functionality with any scripts that
  33. #   will also replace Scene_End.
  34. # - This script is made to be specifically compatible with Battle Engine Melody.
  35. #===============================================================================

  36. $imported = {} if $imported == nil
  37. $imported["SystemGameOptions"] = true

  38. module YEM
  39.   module SYSTEM
  40.    
  41.     # This replaces the Game End title with the following text. And although
  42.     # script itself doesn't provide the icon, any script that may potentially
  43.     # link towards the System menu will reveal the System icon below.
  44.     TITLE = "系统"
  45.     ICON  = 134
  46.    
  47.     #===========================================================================
  48.     # Game System Commands
  49.     # --------------------------------------------------------------------------
  50.     # The following adjusts the order at which you would like the menu system
  51.     # commands to appear. Here is the reference table to their command ID's.
  52.     #      :blank        - Blank Item.
  53.     #      :volume_bgm   - Adjusts BGM volume.
  54.     #      :volume_bgs   - Adjusts BGS volume.
  55.     #      :volume_sfx   - Adjusts SFX volume.
  56.     #      :animations   - Turns on/off battle animations.
  57.     #      :autocursor   - Requires BEM. Memorized cursor position.
  58.     #      :skill_help   - Requires BEM. Display skill help.
  59.     #      :next_actor   - Requires BEM. Automatic Next Actor.
  60.     #      :atb_active   - Requires BEM. Sets ATB type.
  61.     #      :atb_speed    - Requires BEM. Sets ATB speed.
  62.     #      :auto_dash    - Controls if need to hold down dash button to run.
  63.     #      :instant_text - Whether or not text appears instantly in messages.
  64.     #      :windowskin   - Changes the windowskin.
  65.     #      :return_title - Return back to the title screen.
  66.     #      :return_menu  - Return back to the menu screen.
  67.     #===========================================================================
  68.    
  69.     # This array modifies the order your system menu options appear in from
  70.     # top to bottom. Rearrange them as you see fit or remove them if desired.
  71.     COMMANDS =[
  72.        :windowskin,   # Adjusts window skins.
  73.        :skill_help,   # Requires BEM. Shows skill help.
  74.        :atb_active,   # Requires BEM. Sets ATB type.
  75.        :atb_speeds,   # Requires BEM. Sets ATB speed.
  76.        :animations,   # Turns on/off battle animations.
  77.       :autocursor,   # Requires BEM. Memory cursor.
  78.       :next_actor,   # Requires BEM. Automatic Next Actor.
  79.       :bgm_volume,   # Adjusts BGM volume.
  80.       :bgs_volume,   # Adjusts BGS volume.
  81.       :sfx_volume,   # Adjusts SFX volume.
  82.       :auto_dash,    # Controls need to hold down dash button to run.
  83.       :instant_text, # Makes text appear instantly.
  84.       :blank,        # A blank space.
  85.       :return_title, # Return to the title screen.
  86.       :return_menu,  # Return back to the main menu.
  87.     ] # Do not remove this.
  88.    
  89.     # The following hash determines what variables and switches are used to
  90.     # adjust the system options menu. It's very important that you bind the
  91.     # values to the proper variables and switches in order for your game to
  92.     # run properly. In addition to adjusting the switches, you also apply
  93.     # text descriptions of each of the items here, too.
  94.      OPTIONS ={
  95.     # Option => Value
  96.       :bgm_variable  => 190,  # Variable used to adjust BGM volume.
  97.       :bgm_mute_sw   => 201,  # Switch used to mute/unmute the BGM.
  98.         :bgm_volume  => "BGM 音量",
  99.         :bgm_des     => "设置BGM音量 Z 切换没有和有",
  100.       :bgs_variable  => 191,  # Variable used to adjust BGS volume.
  101.       :bgs_mute_sw   => 202,  # Switch used to mute/unmute the BGS.
  102.         :bgs_volume  => "BGS 音量",
  103.         :bgs_des     => "设置BGS音量 Z 切换没有和有",
  104.       :sfx_variable  => 192,  # Variable used to adjust SFX volume.
  105.       :sfx_mute_sw   => 203,  # Switch used to mute/unmute the SFX.
  106.         :sfx_volume  => "SFX 音量",
  107.         :sfx_des     => "设置SFX音量 Z 切换没有和有",
  108.         :mute        => "静音",
  109.         :audio       => "音量 %d%%",
  110.       :atb_avariable => 193,  # Variable used for ATB Active Type.
  111.         :atb_aname   => "ActiveType",
  112.         :wait_0      => "Full",
  113.         :wait_0_des  => "ATB Gauge does not stop with battle menus open.",
  114.         :wait_1      => "Semi",
  115.         :wait_1_des  => "ATB Gauge stops during target selection.",
  116.         :wait_2      => "Stop",
  117.         :wait_2_des  => "ATB Gauge stops with battle menus open.",
  118.         :wait_3      => "Wait",
  119.         :wait_3_des  => "ATB Gauge stops with any member ready for action.",
  120.       :atb_svariable => 194,  # Variable used for ATB Speeds.
  121.         :atb_sname   => "Turn Speed",
  122.         :atb_s_des   => "Adjusts battle speed. Higher values are faster.",
  123.       :animation_sw  => 204,  # Switch used to display/hide animations.
  124.         :animations  => "动画",
  125.         :ani_des     => "开/关动画",
  126.         :ani_show    => "显示",
  127.         :ani_hide    => "隐藏",
  128.       :autocursor_sw => 205,  # Switch used for autocursors.
  129.         :autocursor  => "AutoCursor",
  130.         :curmem_des  => "Enables/Disables cursor memory for actions.",
  131.         :curmem_on   => "Memory",
  132.         :curmem_off  => "Reset",
  133.       :next_actor_sw => 206,  # Switch used for automatic next actor.
  134.         :next_actor  => "Next Actor",
  135.         :next_des    => "Move to next actor after selecting commands",
  136.         :next_on     => "Auto",
  137.         :next_off    => "Manual",
  138.       :skill_help_sw => 207,  # Switch used to enable skill help.
  139.         :skill_help  => "Skill Help",
  140.         :help_des    => "Display skill descriptions during battle phase.",
  141.         :help_on     => "Enabled",
  142.         :help_off    => "Disable",
  143.       :auto_dash_sw  => 208,  # Switch used to enable auto-dashing.
  144.         :auto_dash   => "自动跑步",
  145.         :dash_des    => "不需要按住Shift,角色会自动跑步",
  146.         :dash_on     => "跑步",
  147.         :dash_off    => "步行",
  148.       :inst_text_sw  => 209,  # Switch used to control instant text.
  149.         :instant_text => "即时文本",
  150.         :inst_des    => "文字会一次出现,而不是一个一个",
  151.         :inst_on     => "即时",
  152.         :inst_off    => "正常",
  153.       :return_title  => "回到标题",
  154.         :retitle_des => "返回到标题菜单,返回前请存档",
  155.       :return_menu   => "返回到主菜单",
  156.         :remenu_des  => "返回到主菜单",
  157.       :window_var    => 195,  # Variable used to change windowskins.
  158.         :windowskin  => "窗口",
  159.         :wind_des    => "更换游戏窗口",
  160.     } # Do not remove this.
  161.         
  162.     # This sets the default fonts used for your windows. Note that in this
  163.     # array, if a player doesn't have the font in front, it'll use the next one
  164.     # onward until the player does have that font installed.
  165.     DEFAULT = ["长城粗圆体"]
  166.     WRITING = [""]
  167.    

  168.    # The following adjusts the window skins used for your game. Match the
  169.     # Window skins with the names accordingly. Within the windowskin hash,
  170.     # the following settings are adjusted as such:
  171.     #     Name - File Name
  172.     #     Opac - Back Opacity
  173.     #     Bold - Bold font?
  174.     #   Italic - Italic font?
  175.     #   Shadow - Use shadows?
  176.     #     Size - Font Size
  177.     #     Font - Font Set
  178.     DEFAULT_SKIN_VALUE  = 1
  179.     WINDOW_HASH ={
  180.     # Window ID => [      Name, Opac,      Bold, Italic, Shadow, Size,    Font],
  181.           1 => [  "Window",     200, false,  false,   true,   20, DEFAULT],
  182.     } # Do not remove this.
  183.    
  184.   end # SYSTEM
  185. end # YEM

  186. #===============================================================================
  187. # Editting anything past this point may potentially result in causing computer
  188. # damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
  189. # Therefore, edit at your own risk.
  190. #===============================================================================

  191. #===============================================================================
  192. # Vocab
  193. #===============================================================================

  194. module Vocab

  195.   #--------------------------------------------------------------------------
  196.   # overwrite method: self.game_end
  197.   #--------------------------------------------------------------------------
  198.   def self.game_end
  199.     return YEM::SYSTEM::TITLE
  200.   end
  201.   
  202. end # Vocab

  203. #===============================================================================
  204. # module Icon
  205. #===============================================================================

  206. module Icon
  207.   
  208.   #--------------------------------------------------------------------------
  209.   # new method: self.system
  210.   #--------------------------------------------------------------------------
  211.   def self.system
  212.     return YEM::SYSTEM::ICON
  213.   end
  214.   
  215. end # Icon

  216. #===============================================================================
  217. # module Cache
  218. #===============================================================================

  219. module Cache
  220.   
  221.   #--------------------------------------------------------------------------
  222.   # new method: self.windows
  223.   #--------------------------------------------------------------------------
  224.   def self.windows(filename); load_bitmap("Graphics/Windows/", filename); end
  225.   
  226. end # Cache
  227. YEM::SYSTEM::WINDOWSKIN_VARIABLE = YEM::SYSTEM::OPTIONS[:window_var]
  228. #===============================================================================
  229. # RPG::BGM
  230. #===============================================================================
  231. unless $imported["BattleEngineMelody"]
  232. module RPG
  233. class BGM < AudioFile
  234.   
  235.   #--------------------------------------------------------------------------
  236.   # overwrite method: play
  237.   #--------------------------------------------------------------------------
  238.   def play
  239.     if @name.empty?
  240.       Audio.bgm_stop
  241.       @@last = BGM.new
  242.     else
  243.       vol = @volume
  244.       if $game_variables != nil
  245.         options = YEM::SYSTEM::OPTIONS
  246.         vol = vol * $game_variables[options[:bgm_variable]] / 100
  247.         vol = [[vol, 0].max, 100].min
  248.         vol = 0 if $game_switches[options[:bgm_mute_sw]]
  249.       end
  250.       Audio.bgm_play("Audio/BGM/" + @name, vol, @pitch)
  251.       @@last = self
  252.     end
  253.   end
  254.   
  255. end # BGM
  256. class ME < AudioFile
  257.   
  258.   #--------------------------------------------------------------------------
  259.   # overwrite method: play
  260.   #--------------------------------------------------------------------------
  261.   def play
  262.     if @name.empty?
  263.       Audio.me_stop
  264.     else
  265.       vol = @volume
  266.       if $game_variables != nil
  267.         options = YEM::SYSTEM::OPTIONS
  268.         vol = vol * $game_variables[options[:bgm_variable]] / 100
  269.         vol = [[vol, 0].max, 100].min
  270.         vol = 0 if $game_switches[options[:bgm_mute_sw]]
  271.       end
  272.       Audio.me_play("Audio/ME/" + @name, vol, @pitch)
  273.     end
  274.   end
  275.   
  276. end # ME
  277. class BGS < AudioFile
  278.   
  279.   #--------------------------------------------------------------------------
  280.   # overwrite method: play
  281.   #--------------------------------------------------------------------------
  282.   def play
  283.     if @name.empty?
  284.       Audio.bgs_stop
  285.       @@last = BGS.new
  286.     else
  287.       vol = @volume
  288.       if $game_variables != nil
  289.         options = YEM::SYSTEM::OPTIONS
  290.         vol = vol * $game_variables[options[:bgs_variable]] / 100
  291.         vol = [[vol, 0].max, 100].min
  292.         vol = 0 if $game_switches[options[:bgs_mute_sw]]
  293.       end
  294.       Audio.bgs_play("Audio/BGS/" + @name, vol, @pitch)
  295.       @@last = self
  296.     end
  297.   end
  298.   
  299. end # BGS
  300. class SE < AudioFile
  301.   
  302.   #--------------------------------------------------------------------------
  303.   # overwrite method: play
  304.   #--------------------------------------------------------------------------
  305.   def play
  306.     unless @name.empty?
  307.       vol = @volume
  308.       if $game_variables != nil
  309.         options = YEM::SYSTEM::OPTIONS
  310.         vol = vol * $game_variables[options[:sfx_variable]] / 100
  311.         vol = [[vol, 0].max, 100].min
  312.         vol = 0 if $game_switches[options[:sfx_mute_sw]]
  313.       end
  314.       Audio.se_play("Audio/SE/" + @name, vol, @pitch)
  315.     end
  316.   end
  317.   
  318. end # SE
  319. end # RPG
  320. end # $imported["BattleEngineMelody"]
  321. #===============================================================================
  322. # Game_System
  323. #===============================================================================

  324. class Game_System
  325.   
  326.   #--------------------------------------------------------------------------
  327.   # new method: create_system_options
  328.   #--------------------------------------------------------------------------
  329.   def create_system_options
  330.     return if @created_system_options
  331.     @created_system_options = true
  332.     options = YEM::SYSTEM::OPTIONS
  333.     $game_variables[options[:bgm_variable]] = 100
  334.     $game_variables[options[:bgs_variable]] = 100
  335.     $game_variables[options[:sfx_variable]] = 100
  336.     $game_switches[options[:bgm_mute_sw]] = false
  337.     $game_switches[options[:bgs_mute_sw]] = false
  338.     $game_switches[options[:sfx_mute_sw]] = false
  339.     $game_switches[options[:animation_sw]] = true
  340.     $game_switches[options[:autocursor_sw]] = true
  341.     $game_switches[options[:next_actor_sw]] = true
  342.     $game_switches[options[:skill_help_sw]] = false
  343.     $game_switches[options[:auto_dash_sw]] = false
  344.     $game_switches[options[:inst_text_sw]] = false
  345.     $game_variables[YEM::SYSTEM::WINDOWSKIN_VARIABLE] =
  346.       YEM::SYSTEM::DEFAULT_SKIN_VALUE
  347.   end
  348.   
  349. end # Game_System

  350. #===============================================================================
  351. # Game_Player
  352. #===============================================================================

  353. class Game_Player < Game_Character
  354.   
  355.   #--------------------------------------------------------------------------
  356.   # alias method: dash?
  357.   #--------------------------------------------------------------------------
  358.   alias dash_sgo dash? unless $@
  359.   def dash?
  360.     if $game_switches[YEM::SYSTEM::OPTIONS[:auto_dash_sw]]
  361.       return false if @move_route_forcing
  362.       return false if $game_map.disable_dash?
  363.       return false if in_vehicle?
  364.       return false if Input.press?(Input::A)
  365.       return true
  366.     else
  367.       return dash_sgo
  368.     end
  369.   end
  370.   
  371. end # Game_Player



  372. #===============================================================================
  373. # Window_Base
  374. #===============================================================================

  375. class Window_Base < Window
  376.   
  377.   #--------------------------------------------------------------------------
  378.   # alias method: initialize
  379.   #--------------------------------------------------------------------------
  380.   alias initialize_window_sgo initialize unless $@
  381.   def initialize(x, y, width, height)
  382.     initialize_window_sgo(x, y, width, height)

  383.   end
  384.   
  385.   #--------------------------------------------------------------------------
  386.   # alias method: create_contents
  387.   #--------------------------------------------------------------------------
  388.   alias create_contents_base_sgo create_contents unless $@
  389.   def create_contents
  390.     create_contents_base_sgo
  391.     self.contents.font.color = normal_color
  392.   end
  393.   
  394. end # Window_Base

  395. #===============================================================================
  396. # Window_Selectable
  397. #===============================================================================

  398. class Window_Selectable < Window_Base
  399.   
  400.   #--------------------------------------------------------------------------
  401.   # alias method: create_contents
  402.   #--------------------------------------------------------------------------
  403.   alias create_contents_selectable_sgo create_contents unless $@
  404.   def create_contents
  405.     create_contents_selectable_sgo
  406.     self.contents.font.color = normal_color
  407.   end
  408.   
  409. end # Window_Selectable

  410. #===============================================================================
  411. # Window_SaveFile
  412. #===============================================================================

  413. class Window_SaveFile < Window_Base
  414.   
  415.   #--------------------------------------------------------------------------
  416.   # alias method: refresh
  417.   #--------------------------------------------------------------------------
  418.   alias refresh_savefile_mso refresh unless $@
  419.   def refresh
  420.     if @file_exist
  421.       n = @game_variables[YEM::SYSTEM::WINDOWSKIN_VARIABLE]
  422.       if n == 0 or !YEM::SYSTEM::WINDOW_HASH.include?(n)
  423.         n = YEM::SYSTEM::DEFAULT_SKIN_VALUE
  424.       end
  425.       skin = YEM::SYSTEM::WINDOW_HASH[n]

  426.     end
  427.     refresh_savefile_mso
  428.   end
  429.   
  430. end # Window_SaveFile

  431. #===============================================================================
  432. # Window_Message
  433. #===============================================================================

  434. class Window_Message < Window_Selectable
  435.   
  436.   #--------------------------------------------------------------------------
  437.   # alias method: update_show_fast
  438.   #--------------------------------------------------------------------------
  439.   alias update_show_fast_sgo update_show_fast unless $@
  440.   def update_show_fast
  441.     if $game_switches[YEM::SYSTEM::OPTIONS[:inst_text_sw]]
  442.       if self.pause or self.openness < 255
  443.         @show_fast = false
  444.       else
  445.         @show_fast = true
  446.       end
  447.       if @show_fast and @wait_count > 0
  448.         @wait_count -= 1
  449.       end
  450.     else
  451.       update_show_fast_sgo
  452.     end
  453.   end
  454.   
  455.   #--------------------------------------------------------------------------
  456.   # alias method: new_page
  457.   #--------------------------------------------------------------------------
  458.   alias new_page_sgo new_page unless $@
  459.   def new_page
  460.     new_page_sgo
  461.   end
  462.   
  463. end # Window_Message

  464. #===============================================================================
  465. # Window_SystemOptions
  466. #===============================================================================

  467. class Window_SystemOptions < Window_Selectable
  468.   
  469.   #--------------------------------------------------------------------------
  470.   # initialize
  471.   #--------------------------------------------------------------------------
  472.   def initialize(help_window)
  473.     dy = help_window.height
  474.     dh = Graphics.height - dy
  475.     super(0, dy, Graphics.width, dh)
  476.     self.index = 0
  477.     refresh
  478.     @help_window = help_window
  479.     update_help
  480.   end
  481.   
  482.   #--------------------------------------------------------------------------
  483.   # item
  484.   #--------------------------------------------------------------------------
  485.   def item; return @data[self.index]; end
  486.   
  487.   #--------------------------------------------------------------------------
  488.   # refresh
  489.   #--------------------------------------------------------------------------
  490.   def refresh
  491.     @data = []
  492.     for command in YEM::SYSTEM::COMMANDS
  493.       case command
  494.       when :windowskin, :animations, :bgm_volume, :sfx_volume, :bgs_volume,
  495.       :auto_dash, :instant_text, :blank, :return_title, :return_menu
  496.       when :skill_help, :atb_active, :atb_speeds, :autocursor, :next_actor
  497.         next unless $imported["BattleEngineMelody"]
  498.         if [:atb_active, :atb_speeds].include?(command)
  499.           type = $game_variables[YEM::BATTLE_ENGINE::BATTLE_TYPE_VARIABLE]
  500.           next unless type == 2
  501.         end
  502.       else; next
  503.       end
  504.       @data.push(command)
  505.     end
  506.     @item_max = @data.size
  507.     create_contents
  508.     for i in 0...@item_max; draw_item(i); end
  509.   end
  510.   
  511.   #--------------------------------------------------------------------------
  512.   # draw_item
  513.   #--------------------------------------------------------------------------
  514.   def draw_item(index)
  515.     rect = item_rect(index)
  516.     self.contents.clear_rect(rect)
  517.     obj = @data[index]
  518.     return if obj == nil
  519.     case obj
  520.     when :windowskin
  521.       draw_window_item(obj, rect.clone)
  522.     when :bgm_volume, :sfx_volume, :bgs_volume
  523.       draw_volume_item(obj, rect.clone)
  524.     when :animations, :autocursor, :next_actor, :skill_help,
  525.     :auto_dash, :instant_text
  526.       draw_switch_item(obj, rect.clone)
  527.     when :atb_active, :atb_speeds
  528.       draw_atb_item(obj, rect.clone)
  529.     when :return_title, :return_menu
  530.       draw_solo_item(obj, rect.clone)
  531.     end
  532.   end
  533.   
  534.   #--------------------------------------------------------------------------
  535.   # draw_window_item
  536.   #--------------------------------------------------------------------------
  537.   def draw_window_item(obj, rect)
  538.     title = YEM::SYSTEM::OPTIONS[:windowskin]
  539.     self.contents.font.color = normal_color
  540.     self.contents.draw_text(rect.x, rect.y, rect.width/2, WLH, title, 1)
  541.     dx = rect.x + rect.width/2
  542.     skin_id = $game_variables[YEM::SYSTEM::WINDOWSKIN_VARIABLE]
  543.     skin_name = YEM::SYSTEM::WINDOW_HASH[skin_id][0]
  544.     dx = rect.x + rect.width/2
  545.     self.contents.draw_text(dx, rect.y, rect.width/2, WLH, skin_name, 1)
  546.   end
  547.   
  548.   #--------------------------------------------------------------------------
  549.   # draw_volume_item
  550.   #--------------------------------------------------------------------------
  551.   def draw_volume_item(obj, rect)
  552.     options = YEM::SYSTEM::OPTIONS
  553.     case obj
  554.     when :bgm_volume
  555.       title = options[:bgm_volume]
  556.       value = $game_variables[options[:bgm_variable]]
  557.       mute  = $game_switches[options[:bgm_mute_sw]]
  558.     when :bgs_volume
  559.       title = options[:bgs_volume]
  560.       value = $game_variables[options[:bgs_variable]]
  561.       mute  = $game_switches[options[:bgs_mute_sw]]
  562.     when :sfx_volume
  563.       title = options[:sfx_volume]
  564.       value = $game_variables[options[:sfx_variable]]
  565.       mute  = $game_switches[options[:sfx_mute_sw]]
  566.     else; return
  567.     end
  568.     value = sprintf(options[:audio], value)
  569.     self.contents.font.color = normal_color
  570.     self.contents.draw_text(rect.x, rect.y, rect.width/2, WLH, title, 1)
  571.     self.contents.font.color.alpha = mute ? 128 : 255
  572.     dx = rect.x + rect.width/2
  573.     self.contents.draw_text(dx, rect.y, rect.width/4, WLH, value, 1)
  574.     self.contents.font.color.alpha = mute ? 255 : 128
  575.     dx = rect.x + rect.width*3/4
  576.     self.contents.draw_text(dx, rect.y, rect.width/4, WLH, options[:mute], 1)
  577.   end
  578.   
  579.   #--------------------------------------------------------------------------
  580.   # draw_switch_item
  581.   #--------------------------------------------------------------------------
  582.   def draw_switch_item(obj, rect)
  583.     options = YEM::SYSTEM::OPTIONS
  584.     title = options[obj]
  585.     case obj
  586.     when :animations
  587.       name1 = options[:ani_show]
  588.       name2 = options[:ani_hide]
  589.       toggle = $game_switches[options[:animation_sw]]
  590.     when :autocursor
  591.       name1 = options[:curmem_on]
  592.       name2 = options[:curmem_off]
  593.       toggle = $game_switches[options[:autocursor_sw]]
  594.     when :next_actor
  595.       name1 = options[:next_on]
  596.       name2 = options[:next_off]
  597.       toggle = $game_switches[options[:next_actor_sw]]
  598.     when :skill_help
  599.       name1 = options[:help_on]
  600.       name2 = options[:help_off]
  601.       toggle = $game_switches[options[:skill_help_sw]]
  602.     when :cinematics
  603.       name1 = options[:cinem_on]
  604.       name2 = options[:cinem_off]
  605.       toggle = $game_switches[options[:cinematics_sw]]
  606.     when :auto_dash
  607.       name1 = options[:dash_on]
  608.       name2 = options[:dash_off]
  609.       toggle = $game_switches[options[:auto_dash_sw]]
  610.     when :instant_text
  611.       name1 = options[:inst_on]
  612.       name2 = options[:inst_off]
  613.       toggle = $game_switches[options[:inst_text_sw]]
  614.     else; return
  615.     end
  616.     self.contents.font.color = normal_color
  617.     self.contents.draw_text(rect.x, rect.y, rect.width/2, WLH, title, 1)
  618.     self.contents.font.color.alpha = toggle ? 255 : 128
  619.     dx = rect.x + rect.width/2
  620.     self.contents.draw_text(dx, rect.y, rect.width/4, WLH, name1, 1)
  621.     self.contents.font.color.alpha = toggle ? 128 : 255
  622.     dx = rect.x + rect.width*3/4
  623.     self.contents.draw_text(dx, rect.y, rect.width/4, WLH, name2, 1)
  624.   end
  625.   
  626.   #--------------------------------------------------------------------------
  627.   # draw_atb_item
  628.   #--------------------------------------------------------------------------
  629.   def draw_atb_item(obj, rect)
  630.     options = YEM::SYSTEM::OPTIONS
  631.     case obj
  632.     when :atb_active
  633.       title = options[:atb_aname]
  634.       value = $game_variables[options[:atb_avariable]]
  635.       #---
  636.       self.contents.font.color = normal_color
  637.       name1 = options[:wait_0]
  638.       dx = rect.x + rect.width/2
  639.       self.contents.font.color.alpha = (value == 0) ? 255 : 128
  640.       self.contents.draw_text(dx, rect.y, rect.width/8, WLH, name1, 1)
  641.       name2 = options[:wait_1]
  642.       dx = rect.x + rect.width*5/8
  643.       self.contents.font.color.alpha = (value == 1) ? 255 : 128
  644.       self.contents.draw_text(dx, rect.y, rect.width/8, WLH, name2, 1)
  645.       name3 = options[:wait_2]
  646.       dx = rect.x + rect.width*6/8
  647.       self.contents.font.color.alpha = (value == 2) ? 255 : 128
  648.       self.contents.draw_text(dx, rect.y, rect.width/8, WLH, name3, 1)
  649.       name4 = options[:wait_3]
  650.       dx = rect.x + rect.width*7/8
  651.       self.contents.font.color.alpha = (value == 3) ? 255 : 128
  652.       self.contents.draw_text(dx, rect.y, rect.width/8, WLH, name4, 1)
  653.       #---
  654.     when :atb_speeds
  655.       title = options[:atb_sname]
  656.       value = $game_variables[options[:atb_svariable]] - 1
  657.       #---
  658.       for i in 0...10
  659.         self.contents.font.color = normal_color
  660.         name = (i + 1).to_s
  661.         dx = rect.x + rect.width * (10 + i)/20
  662.         self.contents.font.color.alpha = (value == i) ? 255 : 128
  663.         self.contents.draw_text(dx, rect.y, rect.width/20, WLH, name, 1)
  664.       end
  665.       #---
  666.     else; return
  667.     end
  668.     self.contents.font.color = normal_color
  669.     self.contents.draw_text(rect.x, rect.y, rect.width/2, WLH, title, 1)
  670.   end
  671.   
  672.   #--------------------------------------------------------------------------
  673.   # draw_solo_item
  674.   #--------------------------------------------------------------------------
  675.   def draw_solo_item(obj, rect)
  676.     options = YEM::SYSTEM::OPTIONS
  677.     case obj
  678.     when :return_title, :return_menu
  679.       text = options[obj]
  680.     else; return
  681.     end
  682.     self.contents.font.color = normal_color
  683.     self.contents.draw_text(rect.x, rect.y, rect.width, WLH, text, 1)
  684.   end
  685.   
  686.   #--------------------------------------------------------------------------
  687.   # update
  688.   #--------------------------------------------------------------------------
  689.   def update
  690.     super
  691.     if Input.trigger?(Input::C)
  692.       input_case_c
  693.     elsif Input.repeat?(Input::LEFT)
  694.       input_case_left
  695.     elsif Input.repeat?(Input::RIGHT)
  696.       input_case_right
  697.     end
  698.   end
  699.   
  700.   #--------------------------------------------------------------------------
  701.   # input_case_c
  702.   #--------------------------------------------------------------------------
  703.   def input_case_c
  704.     options = YEM::SYSTEM::OPTIONS
  705.     case item
  706.     when :windowskin
  707.       Sound.play_decision
  708.       $scene.open_skins_window
  709.       return
  710.     when :bgm_volume; switch = options[:bgm_mute_sw]
  711.     when :bgs_volume; switch = options[:bgs_mute_sw]
  712.     when :sfx_volume; switch = options[:sfx_mute_sw]
  713.     when :animations; switch = options[:animation_sw]
  714.     when :autocursor; switch = options[:autocursor_sw]
  715.     when :next_actor; switch = options[:next_actor_sw]
  716.     when :skill_help; switch = options[:skill_help_sw]
  717.     when :cinematics; switch = options[:cinematics_sw]
  718.     when :auto_dash;  switch = options[:auto_dash_sw]
  719.     when :instant_text; switch = options[:inst_text_sw]
  720.     when :return_title
  721.       $scene.command_to_title
  722.       return
  723.     when :return_menu
  724.       Sound.play_decision
  725.       $scene.return_scene
  726.       return
  727.     else; return
  728.     end
  729.     $game_switches[switch] = !$game_switches[switch]
  730.     Sound.play_decision
  731.     RPG::BGM::last.play if item == :bgm_volume
  732.     RPG::BGS::last.play if item == :bgs_volume
  733.     draw_item(self.index)
  734.   end
  735.   
  736.   #--------------------------------------------------------------------------
  737.   # input_case_left
  738.   #--------------------------------------------------------------------------
  739.   def input_case_left
  740.     options = YEM::SYSTEM::OPTIONS
  741.     ignore = false
  742.     case item
  743.     when :bgm_volume, :bgs_volume, :sfx_volume
  744.       value = Input.press?(Input::SHIFT) ? 10 : 1
  745.       case item
  746.       when :bgm_volume; variable = options[:bgm_variable]
  747.       when :bgs_volume; variable = options[:bgs_variable]
  748.       when :sfx_volume; variable = options[:sfx_variable]
  749.       end
  750.       return if $game_variables[variable] == 0
  751.       $game_variables[variable] -= value
  752.       $game_variables[variable] = [$game_variables[variable], 0].max
  753.       ignore = true
  754.     when :atb_active
  755.       variable = options[:atb_avariable]
  756.       return if $game_variables[variable] == 0
  757.       $game_variables[variable] -= 1
  758.       $game_variables[variable] = [$game_variables[variable], 0].max
  759.       ignore = true
  760.     when :atb_speeds
  761.       variable = options[:atb_svariable]
  762.       return if $game_variables[variable] == 1
  763.       $game_variables[variable] -= 1
  764.       $game_variables[variable] = [$game_variables[variable], 1].max
  765.       ignore = true
  766.     when :animations; switch = options[:animation_sw]
  767.     when :autocursor; switch = options[:autocursor_sw]
  768.     when :next_actor; switch = options[:next_actor_sw]
  769.     when :skill_help; switch = options[:skill_help_sw]
  770.     when :cinematics; switch = options[:cinematics_sw]
  771.     when :auto_dash;  switch = options[:auto_dash_sw]
  772.     when :instant_text; switch = options[:inst_text_sw]
  773.     else; return
  774.     end
  775.     unless ignore
  776.       return if $game_switches[switch]
  777.       $game_switches[switch] = true
  778.     end
  779.     Sound.play_cursor
  780.     RPG::BGM::last.play if item == :bgm_volume
  781.     RPG::BGS::last.play if item == :bgs_volume
  782.     draw_item(self.index)
  783.   end
  784.   
  785.   #--------------------------------------------------------------------------
  786.   # input_case_right
  787.   #--------------------------------------------------------------------------
  788.   def input_case_right
  789.     options = YEM::SYSTEM::OPTIONS
  790.     ignore = false
  791.     case item
  792.     when :bgm_volume, :bgs_volume, :sfx_volume
  793.       value = Input.press?(Input::SHIFT) ? 10 : 1
  794.       case item
  795.       when :bgm_volume; variable = options[:bgm_variable]
  796.       when :bgs_volume; variable = options[:bgs_variable]
  797.       when :sfx_volume; variable = options[:sfx_variable]
  798.       end
  799.       return if $game_variables[variable] == 100
  800.       $game_variables[variable] += value
  801.       $game_variables[variable] = [$game_variables[variable], 100].min
  802.       ignore = true
  803.     when :atb_active
  804.       variable = options[:atb_avariable]
  805.       return if $game_variables[variable] == 3
  806.       $game_variables[variable] += 1
  807.       $game_variables[variable] = [$game_variables[variable], 3].min
  808.       ignore = true
  809.     when :atb_speeds
  810.       variable = options[:atb_svariable]
  811.       return if $game_variables[variable] == 10
  812.       $game_variables[variable] += 1
  813.       $game_variables[variable] = [$game_variables[variable], 10].min
  814.       ignore = true
  815.     when :animations; switch = options[:animation_sw]
  816.     when :autocursor; switch = options[:autocursor_sw]
  817.     when :next_actor; switch = options[:next_actor_sw]
  818.     when :skill_help; switch = options[:skill_help_sw]
  819.     when :cinematics; switch = options[:cinematics_sw]
  820.     when :auto_dash;  switch = options[:auto_dash_sw]
  821.     when :instant_text; switch = options[:inst_text_sw]
  822.     else; return
  823.     end
  824.     unless ignore
  825.       return if !$game_switches[switch]
  826.       $game_switches[switch] = false
  827.     end
  828.     Sound.play_cursor
  829.     RPG::BGM::last.play if item == :bgm_volume
  830.     RPG::BGS::last.play if item == :bgs_volume
  831.     draw_item(self.index)
  832.   end
  833.   
  834.   #--------------------------------------------------------------------------
  835.   # update_help
  836.   #--------------------------------------------------------------------------
  837.   def update_help
  838.     case item
  839.     when :bgm_volume; type = :bgm_des
  840.     when :bgs_volume; type = :bgs_des
  841.     when :sfx_volume; type = :sfx_des
  842.     when :animations; type = :ani_des
  843.     when :autocursor; type = :curmem_des
  844.     when :next_actor; type = :next_des
  845.     when :skill_help; type = :help_des
  846.     when :cinematics; type = :cinem_des
  847.     when :windowskin; type = :wind_des
  848.     when :auto_dash;  type = :dash_des
  849.     when :instant_text; type = :inst_des
  850.     when :return_title; type = :retitle_des
  851.     when :return_menu;  type = :remenu_des
  852.     when :atb_active
  853.       case $game_variables[YEM::SYSTEM::OPTIONS[:atb_avariable]]
  854.       when 0; type = :wait_0_des
  855.       when 1; type = :wait_1_des
  856.       when 2; type = :wait_2_des
  857.       when 3: type = :wait_3_des
  858.       end
  859.     when :atb_speeds; type = :atb_s_des
  860.     else; type = nil
  861.     end
  862.     text = YEM::SYSTEM::OPTIONS[type].to_s
  863.     @help_window.set_text(text, 1)
  864.   end
  865.   
  866. end # Window_SystemOptions

  867. #===============================================================================
  868. # Window_Skins
  869. #===============================================================================

  870. class Window_Skins < Window_Selectable
  871.   
  872.   #--------------------------------------------------------------------------
  873.   # initialize
  874.   #--------------------------------------------------------------------------
  875.   def initialize
  876.     dx = Graphics.width/4
  877.     dw = Graphics.width/2
  878.     dh = Graphics.height - 112
  879.     super(dx, 56, dw, dh)
  880.     @column_max = 1
  881.     self.index = 0
  882.     self.back_opacity = 255
  883.     self.openness = 0
  884.     self.active = false
  885.     refresh
  886.   end
  887.   
  888.   #--------------------------------------------------------------------------
  889.   # refresh
  890.   #--------------------------------------------------------------------------
  891.   def refresh
  892.     @data = []
  893.     variable = $game_variables[YEM::SYSTEM::WINDOWSKIN_VARIABLE]
  894.     hash = YEM::SYSTEM::WINDOW_HASH.sort{ |a,b| a[0] <=> b[0] }
  895.     for key in hash
  896.       @data.push(key[0])
  897.       self.index = key[0] - 1 if key[0] == $game_variables[variable]
  898.     end
  899.     @item_max = @data.size
  900.     create_contents
  901.     for i in 0...@item_max
  902.       draw_item(i)
  903.     end
  904.   end
  905.   
  906.   #--------------------------------------------------------------------------
  907.   # draw_item
  908.   #--------------------------------------------------------------------------
  909.   def draw_item(index)
  910.     rect = item_rect(index)
  911.     self.contents.clear_rect(rect)
  912.     rect.width -= 4
  913.     text = YEM::SYSTEM::WINDOW_HASH[@data[index]][0]
  914.     self.contents.draw_text(rect, text, 1)
  915.   end
  916.   
  917. end # Window_Skins

  918. #===============================================================================
  919. # Scene_Title
  920. #===============================================================================

  921. class Scene_Title < Scene_Base
  922.   
  923.   #--------------------------------------------------------------------------
  924.   # alias method: create_game_objects
  925.   #--------------------------------------------------------------------------
  926.   alias create_game_objects_sgo create_game_objects unless $@
  927.   def create_game_objects
  928.     create_game_objects_sgo
  929.     $game_system.create_system_options
  930.   end
  931.   
  932. end # Scene_Title

  933. #===============================================================================
  934. # Scene_Map
  935. #===============================================================================

  936. class Scene_Map < Scene_Base
  937.   
  938.   #--------------------------------------------------------------------------
  939.   # alias method: start
  940.   #--------------------------------------------------------------------------
  941.   alias start_sgo start unless $@
  942.   def start
  943.     $game_system.create_system_options
  944.     start_sgo
  945.   end
  946.   
  947. end # Scene_Map

  948. #===============================================================================
  949. # Scene_Battle
  950. #===============================================================================

  951. class Scene_Battle < Scene_Base
  952.   
  953.   #--------------------------------------------------------------------------
  954.   # alias method: display_normal_animation
  955.   #--------------------------------------------------------------------------
  956.   unless $imported["BattleEngineMelody"]
  957.   alias display_normal_animation_sgo display_normal_animation unless $@
  958.   def display_normal_animation(targets, animation_id, mirror = false)
  959.     return if $game_switches[YEM::SYSTEM::OPTIONS[:animation_sw]]
  960.     display_normal_animation_sgo(targets, animation_id, mirror)
  961.   end
  962.   end # $imported["BattleEngineMelody"]
  963.   
  964. end # Scene_Battle

  965. #===============================================================================
  966. # Scene_End
  967. #===============================================================================

  968. class Scene_End < Scene_Base
  969.   
  970.   #--------------------------------------------------------------------------
  971.   # public instance variables
  972.   #--------------------------------------------------------------------------
  973.   attr_accessor :window_var
  974.   
  975.   #--------------------------------------------------------------------------
  976.   # overwrite method: start
  977.   #--------------------------------------------------------------------------
  978.   def start
  979.     super
  980.     create_menu_background
  981.     @window_var = YEM::SYSTEM::WINDOWSKIN_VARIABLE
  982.     @help_window = Window_Help.new
  983.     @options_window = Window_SystemOptions.new(@help_window)
  984.     @skins_window = Window_Skins.new
  985.   end
  986.   
  987.   #--------------------------------------------------------------------------
  988.   # overwrite method: post_start
  989.   #--------------------------------------------------------------------------
  990.   def post_start; super; end
  991.   
  992.   #--------------------------------------------------------------------------
  993.   # overwrite method: pre_terminate
  994.   #--------------------------------------------------------------------------
  995.   def pre_terminate; super; end
  996.    
  997.   #--------------------------------------------------------------------------
  998.   # overwrite method: close_command_window
  999.   #--------------------------------------------------------------------------
  1000.   def close_command_window; end
  1001.   
  1002.   #--------------------------------------------------------------------------
  1003.   # overwrite method: terminate
  1004.   #--------------------------------------------------------------------------
  1005.   def terminate
  1006.     super
  1007.     @help_window.dispose
  1008.     @options_window.dispose
  1009.     @skins_window.dispose
  1010.     dispose_menu_background
  1011.   end
  1012.   
  1013.   #--------------------------------------------------------------------------
  1014.   # overwrite method: update
  1015.   #--------------------------------------------------------------------------
  1016.   def update
  1017.     super
  1018.     @help_window.update
  1019.     @skins_window.update
  1020.     update_menu_background
  1021.     if @options_window.active
  1022.       update_options_window
  1023.     elsif @skins_window.active
  1024.       update_skins_window
  1025.     end
  1026.   end
  1027.   
  1028.   #--------------------------------------------------------------------------
  1029.   # new method: update_options_window
  1030.   #--------------------------------------------------------------------------
  1031.   def update_options_window
  1032.     @options_window.update
  1033.     if Input.trigger?(Input::B)
  1034.       Sound.play_cancel
  1035.       return_scene
  1036.     end
  1037.   end
  1038.   
  1039.   #--------------------------------------------------------------------------
  1040.   # new method: open_skins_window
  1041.   #--------------------------------------------------------------------------
  1042.   def open_skins_window
  1043.     @skins_window.open
  1044.     @skins_window.index = $game_variables[YEM::SYSTEM::WINDOWSKIN_VARIABLE] - 1
  1045.     @skins_window.active = true
  1046.     @options_window.active = false
  1047.   end
  1048.   
  1049.   #--------------------------------------------------------------------------
  1050.   # new method: update_skins_window
  1051.   #--------------------------------------------------------------------------
  1052.   def update_skins_window
  1053.     if @last_index != @skins_window.index
  1054.       @last_index = @skins_window.index
  1055.       update_skins
  1056.     end
  1057.     if Input.trigger?(Input::B)
  1058.       Sound.play_cancel
  1059.       @skins_window.close
  1060.       @skins_window.active = false
  1061.       @options_window.active = true
  1062.     elsif Input.trigger?(Input::C)
  1063.       Sound.play_decision
  1064.       @skins_window.close
  1065.       @skins_window.active = false
  1066.       @options_window.active = true
  1067.     end
  1068.   end
  1069.   
  1070.   #--------------------------------------------------------------------------
  1071.   # new method: update_skins
  1072.   #--------------------------------------------------------------------------
  1073.   def update_skins
  1074.     $game_variables[@window_var] = @skins_window.index + 1

  1075.     @options_window.refresh

  1076.     @help_window.set_text("")
  1077.     @options_window.update_help

  1078.     @skins_window.back_opacity = 255
  1079.     @skins_window.refresh
  1080.     @options_window.draw_item(@options_window.index)
  1081.   end
  1082.   
  1083. end # Scene_End

  1084. #===============================================================================
  1085. #
  1086. # END OF FILE
  1087. #
  1088. #===============================================================================
复制代码

Lv1.梦旅人

梦石
0
星屑
49
在线时间
3 小时
注册时间
2012-5-4
帖子
284
4
 楼主| 发表于 2012-6-29 18:51:03 | 只看该作者
@铅笔描绘的思念
在运行游戏里无法更改游戏窗体
怎么设置




点评

板凳。。  发表于 2012-6-29 18:53
回复

使用道具 举报

Lv3.寻梦者

梦石
0
星屑
1409
在线时间
962 小时
注册时间
2012-4-30
帖子
1475

开拓者

3
发表于 2012-6-29 18:49:40 | 只看该作者
本帖最后由 铅笔描绘的思念 于 2012-6-29 18:52 编辑

好吧。。我懂了。。
2. Make a "Windows" folder in your project's "Graphics" folder. Insert the
#    window skins you want to use there and adjust the WINDOW_HASH accordingly.

在"Graphics“新建一个“Windows”文件夹来放窗口。在更改WINDOW_HASH


这个脚本ms是我给你的。。哈。。不是完整的。。。等等。。。
RUBY 代码复制
  1. #===============================================================================
  2. #
  3. # Yanfly Engine Melody - System Game Options
  4. # Last Date Updated: 2010.06.12
  5. # Level: Normal
  6. #
  7. # System Game Options replaces the "Game End" scene found in the default RPG
  8. # Maker VX with a system options menu. In this menu, the player can readjust
  9. # sound volumes, automatic dashing, and more. This changes one of the unused
  10. # game end scene into something a whole lot more useful.
  11. #
  12. #===============================================================================
  13. # Updates
  14. # -----------------------------------------------------------------------------
  15. # o 2010.06.12 - Bugfix for disposing the skins window.
  16. # o 2010.05.14 - Finished Script.
  17. # o 2010.05.12 - Started Script.
  18. #===============================================================================
  19. # Instructions
  20. # -----------------------------------------------------------------------------
  21. # To install this script, open up your script editor and copy/paste this script
  22. # to an open slot below ? Materials but above ? Main. Remember to save.
  23. #
  24. # 1. Scroll down, adjust the various Switches and Variable values to something
  25. #    empty or predetermined.
  26. # 2. Make a "Windows" folder in your project's "Graphics" folder. Insert the
  27. #    window skins you want to use there and adjust the WINDOW_HASH accordingly.
  28. #
  29. #===============================================================================
  30. # Compatibility
  31. # -----------------------------------------------------------------------------
  32. # - Replaces ALL of Scene_End. Expect no functionality with any scripts that
  33. #   will also replace Scene_End.
  34. # - This script is made to be specifically compatible with Battle Engine Melody.
  35. #===============================================================================
  36.  
  37. $imported = {} if $imported == nil
  38. $imported["SystemGameOptions"] = true
  39.  
  40. module YEM
  41.   module SYSTEM
  42.  
  43.     # This replaces the Game End title with the following text. And although
  44.     # script itself doesn't provide the icon, any script that may potentially
  45.     # link towards the System menu will reveal the System icon below.
  46.     TITLE = "系统"
  47.     ICON  = 134
  48.  
  49.     #===========================================================================
  50.     # Game System Commands
  51.     # --------------------------------------------------------------------------
  52.     # The following adjusts the order at which you would like the menu system
  53.     # commands to appear. Here is the reference table to their command ID's.
  54.     #      :blank        - Blank Item.
  55.     #      :volume_bgm   - Adjusts BGM volume.
  56.     #      :volume_bgs   - Adjusts BGS volume.
  57.     #      :volume_sfx   - Adjusts SFX volume.
  58.     #      :animations   - Turns on/off battle animations.
  59.     #      :autocursor   - Requires BEM. Memorized cursor position.
  60.     #      :skill_help   - Requires BEM. Display skill help.
  61.     #      :next_actor   - Requires BEM. Automatic Next Actor.
  62.     #      :atb_active   - Requires BEM. Sets ATB type.
  63.     #      :atb_speed    - Requires BEM. Sets ATB speed.
  64.     #      :auto_dash    - Controls if need to hold down dash button to run.
  65.     #      :instant_text - Whether or not text appears instantly in messages.
  66.     #      :windowskin   - Changes the windowskin.
  67.     #      :return_title - Return back to the title screen.
  68.     #      :return_menu  - Return back to the menu screen.
  69.     #===========================================================================
  70.  
  71.     # This array modifies the order your system menu options appear in from
  72.     # top to bottom. Rearrange them as you see fit or remove them if desired.
  73.     COMMANDS =[
  74.       :windowskin,   # Adjusts window skins.
  75.       :skill_help,   # Requires BEM. Shows skill help.
  76.       :atb_active,   # Requires BEM. Sets ATB type.
  77.       :atb_speeds,   # Requires BEM. Sets ATB speed.
  78.       :animations,   # Turns on/off battle animations.
  79.       :autocursor,   # Requires BEM. Memory cursor.
  80.       :next_actor,   # Requires BEM. Automatic Next Actor.
  81.       :bgm_volume,   # Adjusts BGM volume.
  82.       :bgs_volume,   # Adjusts BGS volume.
  83.       :sfx_volume,   # Adjusts SFX volume.
  84.       :auto_dash,    # Controls need to hold down dash button to run.
  85.       :instant_text, # Makes text appear instantly.
  86.       :blank,        # A blank space.
  87.       :return_title, # Return to the title screen.
  88.       :return_menu,  # Return back to the main menu.
  89.     ] # Do not remove this.
  90.  
  91.     # The following hash determines what variables and switches are used to
  92.     # adjust the system options menu. It's very important that you bind the
  93.     # values to the proper variables and switches in order for your game to
  94.     # run properly. In addition to adjusting the switches, you also apply
  95.     # text descriptions of each of the items here, too.
  96.      OPTIONS ={
  97.     # Option => Value
  98.       :bgm_variable  => 190,  # Variable used to adjust BGM volume.
  99.       :bgm_mute_sw   => 201,  # Switch used to mute/unmute the BGM.
  100.         :bgm_volume  => "BGM 音量",
  101.         :bgm_des     => "设置BGM音量 Z 切换没有和有",
  102.       :bgs_variable  => 191,  # Variable used to adjust BGS volume.
  103.       :bgs_mute_sw   => 202,  # Switch used to mute/unmute the BGS.
  104.         :bgs_volume  => "BGS 音量",
  105.         :bgs_des     => "设置BGS音量 Z 切换没有和有",
  106.       :sfx_variable  => 192,  # Variable used to adjust SFX volume.
  107.       :sfx_mute_sw   => 203,  # Switch used to mute/unmute the SFX.
  108.         :sfx_volume  => "SFX 音量",
  109.         :sfx_des     => "设置SFX音量 Z 切换没有和有",
  110.         :mute        => "静音",
  111.         :audio       => "音量 %d%%",
  112.       :atb_avariable => 193,  # Variable used for ATB Active Type.
  113.         :atb_aname   => "ActiveType",
  114.         :wait_0      => "Full",
  115.         :wait_0_des  => "ATB Gauge does not stop with battle menus open.",
  116.         :wait_1      => "Semi",
  117.         :wait_1_des  => "ATB Gauge stops during target selection.",
  118.         :wait_2      => "Stop",
  119.         :wait_2_des  => "ATB Gauge stops with battle menus open.",
  120.         :wait_3      => "Wait",
  121.         :wait_3_des  => "ATB Gauge stops with any member ready for action.",
  122.       :atb_svariable => 194,  # Variable used for ATB Speeds.
  123.         :atb_sname   => "Turn Speed",
  124.         :atb_s_des   => "Adjusts battle speed. Higher values are faster.",
  125.       :animation_sw  => 295,  # Switch used to display/hide animations.
  126.         :animations  => "动画",
  127.         :ani_des     => "开/关动画",
  128.         :ani_show    => "隐藏",
  129.         :ani_hide    => "显示",
  130.       :autocursor_sw => 205,  # Switch used for autocursors.
  131.         :autocursor  => "AutoCursor",
  132.         :curmem_des  => "Enables/Disables cursor memory for actions.",
  133.         :curmem_on   => "Memory",
  134.         :curmem_off  => "Reset",
  135.       :next_actor_sw => 206,  # Switch used for automatic next actor.
  136.         :next_actor  => "Next Actor",
  137.         :next_des    => "Move to next actor after selecting commands",
  138.         :next_on     => "Auto",
  139.         :next_off    => "Manual",
  140.       :skill_help_sw => 207,  # Switch used to enable skill help.
  141.         :skill_help  => "Skill Help",
  142.         :help_des    => "Display skill descriptions during battle phase.",
  143.         :help_on     => "Enabled",
  144.         :help_off    => "Disable",
  145.       :auto_dash_sw  => 208,  # Switch used to enable auto-dashing.
  146.         :auto_dash   => "自动跑步",
  147.         :dash_des    => "不需要按住Shift,角色会自动跑步",
  148.         :dash_on     => "跑步",
  149.         :dash_off    => "步行",
  150.       :inst_text_sw  => 209,  # Switch used to control instant text.
  151.         :instant_text => "即时文本",
  152.         :inst_des    => "文字会一次出现,而不是一个一个",
  153.         :inst_on     => "即时",
  154.         :inst_off    => "正常",
  155.       :return_title  => "回到标题",
  156.         :retitle_des => "返回到标题菜单,返回前请存档",
  157.       :return_menu   => "返回到主菜单",
  158.         :remenu_des  => "返回到主菜单",
  159.       :window_var    => 195,  # Variable used to change windowskins.
  160.         :windowskin  => "窗口",
  161.         :wind_des    => "更换游戏窗口",
  162.     } # Do not remove this.
  163.  
  164.     # This sets the default fonts used for your windows. Note that in this
  165.     # array, if a player doesn't have the font in front, it'll use the next one
  166.     # onward until the player does have that font installed.
  167.     DEFAULT = ["长城粗圆体"]
  168.     WRITING = [""]
  169.  
  170.  
  171.     # The following adjusts the window skins used for your game. Match the
  172.     # Window skins with the names accordingly. Within the windowskin hash,
  173.     # the following settings are adjusted as such:
  174.     #     Name - File Name
  175.     #     Opac - Back Opacity
  176.     #     Bold - Bold font?
  177.     #   Italic - Italic font?
  178.     #   Shadow - Use shadows?
  179.     #     Size - Font Size
  180.     #     Font - Font Set
  181.     DEFAULT_SKIN_VALUE  = 17
  182.     WINDOW_HASH ={
  183.     # Window ID => [      Name, Opac,      Bold, Italic, Shadow, Size,    Font],
  184.       1 => [  "Advanced Black",     200, false,  false,   true,   20, DEFAULT],
  185.       2 => [  "Advanced Blue",      200, false,  false,   true,   20, DEFAULT],
  186.       3 => [  "Advanced Cyan",      200, false,  false,   true,   20, DEFAULT],
  187.       4 => [  "Advanced Gradiant",  200, false,  false,   true,   20, DEFAULT],
  188.       5 => [  "Advanced Green",     200, false,  false,   true,   20, DEFAULT],
  189.       6 => [  "Advanced Indigo",    200, false,  false,   true,   20, DEFAULT],
  190.       7 => [  "Advanced Red",       200, false,  false,   true,   20, DEFAULT],
  191.       8 => [  "Advanced Rhinestone",200, false,  false,   true,   20, DEFAULT],
  192.       9 => [  "Advanced Tan",       200, false,  false,   true,   20, DEFAULT],
  193.       10 => [  "Advanced White",     200, false,  false,   true,   20, DEFAULT],
  194.       11 => [  "Arcade Red",         200, false,  false,   true,   20, DEFAULT],
  195.       12 => [  "Fade Black",         200, false,  false,   true,   20, DEFAULT],
  196.       13 => [  "Fade Red",           255, false,  false,  false,   20, DEFAULT],
  197.       14 => [  "Gradient Blue",      200, false,  false,   true,   20, DEFAULT],
  198.       15 => [  "Gradient Brown",     200, false,  false,   true,   20, DEFAULT],
  199.       16 => [  "Gradient Black",     200, false,  false,   true,   20, DEFAULT],
  200.       17 => [  "Gradient Cyan",      200, false,  false,   true,   20, DEFAULT],
  201.       18 => [  "Gradient Green",     200, false,  false,   true,   20, DEFAULT],
  202.       19 => [  "Gradient Purple",    200, false,  false,   true,   20, DEFAULT],
  203.       20 => [  "Gradient Red",       200, false,  false,   true,   20, DEFAULT],
  204.       21 => [  "Indigo",             200, false,  false,   true,   20, DEFAULT],
  205.       22 => [  "Onyx Blue",          200, false,  false,   true,   20, DEFAULT],
  206.       23 => [  "Onyx Red",           200, false,  false,   true,   20, DEFAULT],
  207.       24 => [  "Red Gloss",          200, false,  false,   true,   20, DEFAULT],
  208.       25 => [  "Romantic Gold",      200, false,  false,   true,   20, DEFAULT],
  209.       26 => [  "Romantic Silver",    255, false,  false,  false,   20, DEFAULT],
  210.       27 => [  "Wooden",             255, false,  false,  false,   20, DEFAULT],
  211.       28 => [     "Red",             200, false,  false,   true,   20, DEFAULT],
  212.       29 => [  "Orange",             200, false,  false,   true,   20, DEFAULT],
  213.       30 => [  "Yellow",             200, false,  false,   true,   20, DEFAULT],
  214.       31 => [   "Green",             200, false,  false,   true,   20, DEFAULT],
  215.       32 => [    "Cyan",             200, false,  false,   true,   20, DEFAULT],
  216.       33 => [    "Navy",             200, false,  false,   true,   20, DEFAULT],
  217.       34 => [    "Blue",             200, false,  false,   true,   20, DEFAULT],
  218.       35 => [  "Violet",             200, false,  false,   true,   20, DEFAULT],
  219.       36 => [  "Purple",             200, false,  false,   true,   20, DEFAULT],
  220.       37 => [    "Pink",             200, false,  false,   true,   20, DEFAULT],
  221.       38 => [    "Grey",             200, false,  false,   true,   20, DEFAULT],
  222.       39 => [   "Black",             200, false,  false,   true,   20, DEFAULT],
  223.       40 => [   "White",             255, false,  false,  false,   20, DEFAULT],
  224.     } # Do not remove this.
  225.  
  226.   end # SYSTEM
  227. end # YEM
  228.  
  229. #===============================================================================
  230. # Editting anything past this point may potentially result in causing computer
  231. # damage, incontinence, explosion of user's head, coma, death, and/or halitosis.
  232. # Therefore, edit at your own risk.
  233. #===============================================================================
  234.  
  235. #===============================================================================
  236. # Vocab
  237. #===============================================================================
  238.  
  239. module Vocab
  240.  
  241.   #--------------------------------------------------------------------------
  242.   # overwrite method: self.game_end
  243.   #--------------------------------------------------------------------------
  244.   def self.game_end
  245.     return YEM::SYSTEM::TITLE
  246.   end
  247.  
  248. end # Vocab
  249.  
  250. #===============================================================================
  251. # module Icon
  252. #===============================================================================
  253.  
  254. module Icon
  255.  
  256.   #--------------------------------------------------------------------------
  257.   # new method: self.system
  258.   #--------------------------------------------------------------------------
  259.   def self.system
  260.     return YEM::SYSTEM::ICON
  261.   end
  262.  
  263. end # Icon
  264.  
  265. #===============================================================================
  266. # module Cache
  267. #===============================================================================
  268.  
  269. module Cache
  270.  
  271.   #--------------------------------------------------------------------------
  272.   # new method: self.windows
  273.   #--------------------------------------------------------------------------
  274.   def self.windows(filename); load_bitmap("Graphics/Windows/", filename); end
  275.  
  276. end # Cache
  277. YEM::SYSTEM::WINDOWSKIN_VARIABLE = YEM::SYSTEM::OPTIONS[:window_var]
  278. #===============================================================================
  279. # RPG::BGM
  280. #===============================================================================
  281. unless $imported["BattleEngineMelody"]
  282. module RPG
  283. class BGM < AudioFile
  284.  
  285.   #--------------------------------------------------------------------------
  286.   # overwrite method: play
  287.   #--------------------------------------------------------------------------
  288.   def play
  289.     if @name.empty?
  290.       Audio.bgm_stop
  291.       @@last = BGM.new
  292.     else
  293.       vol = @volume
  294.       if $game_variables != nil
  295.         options = YEM::SYSTEM::OPTIONS
  296.         vol = vol * $game_variables[options[:bgm_variable]] / 100
  297.         vol = [[vol, 0].max, 100].min
  298.         vol = 0 if $game_switches[options[:bgm_mute_sw]]
  299.       end
  300.       Audio.bgm_play("Audio/BGM/" + @name, vol, @pitch)
  301.       @@last = self
  302.     end
  303.   end
  304.  
  305. end # BGM
  306. class ME < AudioFile
  307.  
  308.   #--------------------------------------------------------------------------
  309.   # overwrite method: play
  310.   #--------------------------------------------------------------------------
  311.   def play
  312.     if @name.empty?
  313.       Audio.me_stop
  314.     else
  315.       vol = @volume
  316.       if $game_variables != nil
  317.         options = YEM::SYSTEM::OPTIONS
  318.         vol = vol * $game_variables[options[:bgm_variable]] / 100
  319.         vol = [[vol, 0].max, 100].min
  320.         vol = 0 if $game_switches[options[:bgm_mute_sw]]
  321.       end
  322.       Audio.me_play("Audio/ME/" + @name, vol, @pitch)
  323.     end
  324.   end
  325.  
  326. end # ME
  327. class BGS < AudioFile
  328.  
  329.   #--------------------------------------------------------------------------
  330.   # overwrite method: play
  331.   #--------------------------------------------------------------------------
  332.   def play
  333.     if @name.empty?
  334.       Audio.bgs_stop
  335.       @@last = BGS.new
  336.     else
  337.       vol = @volume
  338.       if $game_variables != nil
  339.         options = YEM::SYSTEM::OPTIONS
  340.         vol = vol * $game_variables[options[:bgs_variable]] / 100
  341.         vol = [[vol, 0].max, 100].min
  342.         vol = 0 if $game_switches[options[:bgs_mute_sw]]
  343.       end
  344.       Audio.bgs_play("Audio/BGS/" + @name, vol, @pitch)
  345.       @@last = self
  346.     end
  347.   end
  348.  
  349. end # BGS
  350. class SE < AudioFile
  351.  
  352.   #--------------------------------------------------------------------------
  353.   # overwrite method: play
  354.   #--------------------------------------------------------------------------
  355.   def play
  356.     unless @name.empty?
  357.       vol = @volume
  358.       if $game_variables != nil
  359.         options = YEM::SYSTEM::OPTIONS
  360.         vol = vol * $game_variables[options[:sfx_variable]] / 100
  361.         vol = [[vol, 0].max, 100].min
  362.         vol = 0 if $game_switches[options[:sfx_mute_sw]]
  363.       end
  364.       Audio.se_play("Audio/SE/" + @name, vol, @pitch)
  365.     end
  366.   end
  367.  
  368. end # SE
  369. end # RPG
  370. end # $imported["BattleEngineMelody"]
  371. #===============================================================================
  372. # Game_System
  373. #===============================================================================
  374.  
  375. class Game_System
  376.  
  377.   #--------------------------------------------------------------------------
  378.   # new method: create_system_options
  379.   #--------------------------------------------------------------------------
  380.   def create_system_options
  381.     return if @created_system_options
  382.     @created_system_options = true
  383.     options = YEM::SYSTEM::OPTIONS
  384.     $game_variables[options[:bgm_variable]] = 100
  385.     $game_variables[options[:bgs_variable]] = 100
  386.     $game_variables[options[:sfx_variable]] = 100
  387.     $game_switches[options[:bgm_mute_sw]] = false
  388.     $game_switches[options[:bgs_mute_sw]] = false
  389.     $game_switches[options[:sfx_mute_sw]] = false
  390.     $game_switches[options[:animation_sw]] = true
  391.     $game_switches[options[:autocursor_sw]] = true
  392.     $game_switches[options[:next_actor_sw]] = true
  393.     $game_switches[options[:skill_help_sw]] = false
  394.     $game_switches[options[:auto_dash_sw]] = false
  395.     $game_switches[options[:inst_text_sw]] = false
  396.     $game_variables[YEM::SYSTEM::WINDOWSKIN_VARIABLE] =
  397.       YEM::SYSTEM::DEFAULT_SKIN_VALUE
  398.   end
  399.  
  400. end # Game_System
  401.  
  402. #===============================================================================
  403. # Game_Player
  404. #===============================================================================
  405.  
  406. class Game_Player < Game_Character
  407.  
  408.   #--------------------------------------------------------------------------
  409.   # alias method: dash?
  410.   #--------------------------------------------------------------------------
  411.   alias dash_sgo dash? unless $@
  412.   def dash?
  413.     if $game_switches[YEM::SYSTEM::OPTIONS[:auto_dash_sw]]
  414.       return false if @move_route_forcing
  415.       return false if $game_map.disable_dash?
  416.       return false if in_vehicle?
  417.       return false if Input.press?(Input::A)
  418.       return true
  419.     else
  420.       return dash_sgo
  421.     end
  422.   end
  423.  
  424. end # Game_Player
  425.  
  426. #===============================================================================
  427. # Window
  428. #===============================================================================
  429.  
  430. class Window
  431.  
  432.   #--------------------------------------------------------------------------
  433.   # update windowskin
  434.   #--------------------------------------------------------------------------
  435.   def update_windowskin
  436.     return if $game_variables == nil
  437.     variable = YEM::SYSTEM::WINDOWSKIN_VARIABLE
  438.     if $game_variables[variable] == 0
  439.       $game_variables[variable] = YEM::SYSTEM::DEFAULT_SKIN_VALUE
  440.     elsif !YEM::SYSTEM::WINDOW_HASH.include?($game_variables[variable])
  441.       $game_variables[variable] = YEM::SYSTEM::DEFAULT_SKIN_VALUE
  442.     end
  443.     skin = YEM::SYSTEM::WINDOW_HASH[$game_variables[variable]]
  444.     change_settings(skin)
  445.   end
  446.  
  447.   #--------------------------------------------------------------------------
  448.   # change_settings
  449.   #--------------------------------------------------------------------------
  450.   def change_settings(skin)
  451.     self.windowskin = Cache.windows(skin[0])
  452.     self.back_opacity = skin[1]
  453.     self.contents.font.bold = Font.default_bold = skin[2]
  454.     self.contents.font.italic = Font.default_italic = skin[3]
  455.     self.contents.font.shadow = Font.default_shadow = skin[4]
  456.     self.contents.font.size = Font.default_size = skin[5]
  457.     self.contents.font.name = Font.default_name = skin[6]
  458.     self.contents.font.color = normal_color
  459.   end
  460.  
  461. end # Window
  462.  
  463. #===============================================================================
  464. # Window_Base
  465. #===============================================================================
  466.  
  467. class Window_Base < Window
  468.  
  469.   #--------------------------------------------------------------------------
  470.   # alias method: initialize
  471.   #--------------------------------------------------------------------------
  472.   alias initialize_window_sgo initialize unless $@
  473.   def initialize(x, y, width, height)
  474.     initialize_window_sgo(x, y, width, height)
  475.     self.update_windowskin
  476.   end
  477.  
  478.   #--------------------------------------------------------------------------
  479.   # alias method: create_contents
  480.   #--------------------------------------------------------------------------
  481.   alias create_contents_base_sgo create_contents unless $@
  482.   def create_contents
  483.     create_contents_base_sgo
  484.     self.contents.font.color = normal_color
  485.   end
  486.  
  487. end # Window_Base
  488.  
  489. #===============================================================================
  490. # Window_Selectable
  491. #===============================================================================
  492.  
  493. class Window_Selectable < Window_Base
  494.  
  495.   #--------------------------------------------------------------------------
  496.   # alias method: create_contents
  497.   #--------------------------------------------------------------------------
  498.   alias create_contents_selectable_sgo create_contents unless $@
  499.   def create_contents
  500.     create_contents_selectable_sgo
  501.     self.contents.font.color = normal_color
  502.   end
  503.  
  504. end # Window_Selectable
  505.  
  506. #===============================================================================
  507. # Window_SaveFile
  508. #===============================================================================
  509.  
  510. class Window_SaveFile < Window_Base
  511.  
  512.   #--------------------------------------------------------------------------
  513.   # alias method: refresh
  514.   #--------------------------------------------------------------------------
  515.   alias refresh_savefile_mso refresh unless $@
  516.   def refresh
  517.     if @file_exist
  518.       n = @game_variables[YEM::SYSTEM::WINDOWSKIN_VARIABLE]
  519.       if n == 0 or !YEM::SYSTEM::WINDOW_HASH.include?(n)
  520.         n = YEM::SYSTEM::DEFAULT_SKIN_VALUE
  521.       end
  522.       skin = YEM::SYSTEM::WINDOW_HASH[n]
  523.       change_settings(skin)
  524.     end
  525.     refresh_savefile_mso
  526.   end
  527.  
  528. end # Window_SaveFile
  529.  
  530. #===============================================================================
  531. # Window_Message
  532. #===============================================================================
  533.  
  534. class Window_Message < Window_Selectable
  535.  
  536.   #--------------------------------------------------------------------------
  537.   # alias method: update_show_fast
  538.   #--------------------------------------------------------------------------
  539.   alias update_show_fast_sgo update_show_fast unless $@
  540.   def update_show_fast
  541.     if $game_switches[YEM::SYSTEM::OPTIONS[:inst_text_sw]]
  542.       if self.pause or self.openness < 255
  543.         @show_fast = false
  544.       else
  545.         @show_fast = true
  546.       end
  547.       if @show_fast and @wait_count > 0
  548.         @wait_count -= 1
  549.       end
  550.     else
  551.       update_show_fast_sgo
  552.     end
  553.   end
  554.  
  555.   #--------------------------------------------------------------------------
  556.   # alias method: new_page
  557.   #--------------------------------------------------------------------------
  558.   alias new_page_sgo new_page unless $@
  559.   def new_page
  560.     self.update_windowskin
  561.     new_page_sgo
  562.   end
  563.  
  564. end # Window_Message
  565.  
  566. #===============================================================================
  567. # Window_SystemOptions
  568. #===============================================================================
  569.  
  570. class Window_SystemOptions < Window_Selectable
  571.  
  572.   #--------------------------------------------------------------------------
  573.   # initialize
  574.   #--------------------------------------------------------------------------
  575.   def initialize(help_window)
  576.     dy = help_window.height
  577.     dh = Graphics.height - dy
  578.     super(0, dy, Graphics.width, dh)
  579.     self.index = 0
  580.     refresh
  581.     @help_window = help_window
  582.     update_help
  583.   end
  584.  
  585.   #--------------------------------------------------------------------------
  586.   # item
  587.   #--------------------------------------------------------------------------
  588.   def item; return @data[self.index]; end
  589.  
  590.   #--------------------------------------------------------------------------
  591.   # refresh
  592.   #--------------------------------------------------------------------------
  593.   def refresh
  594.     @data = []
  595.     for command in YEM::SYSTEM::COMMANDS
  596.       case command
  597.       when :windowskin, :animations, :bgm_volume, :sfx_volume, :bgs_volume,
  598.       :auto_dash, :instant_text, :blank, :return_title, :return_menu
  599.       when :skill_help, :atb_active, :atb_speeds, :autocursor, :next_actor
  600.         next unless $imported["BattleEngineMelody"]
  601.         if [:atb_active, :atb_speeds].include?(command)
  602.           type = $game_variables[YEM::BATTLE_ENGINE::BATTLE_TYPE_VARIABLE]
  603.           next unless type == 2
  604.         end
  605.       else; next
  606.       end
  607.       @data.push(command)
  608.     end
  609.     @item_max = @data.size
  610.     create_contents
  611.     for i in 0...@item_max; draw_item(i); end
  612.   end
  613.  
  614.   #--------------------------------------------------------------------------
  615.   # draw_item
  616.   #--------------------------------------------------------------------------
  617.   def draw_item(index)
  618.     rect = item_rect(index)
  619.     self.contents.clear_rect(rect)
  620.     obj = @data[index]
  621.     return if obj == nil
  622.     case obj
  623.     when :windowskin
  624.       draw_window_item(obj, rect.clone)
  625.     when :bgm_volume, :sfx_volume, :bgs_volume
  626.       draw_volume_item(obj, rect.clone)
  627.     when :animations, :autocursor, :next_actor, :skill_help,
  628.     :auto_dash, :instant_text
  629.       draw_switch_item(obj, rect.clone)
  630.     when :atb_active, :atb_speeds
  631.       draw_atb_item(obj, rect.clone)
  632.     when :return_title, :return_menu
  633.       draw_solo_item(obj, rect.clone)
  634.     end
  635.   end
  636.  
  637.   #--------------------------------------------------------------------------
  638.   # draw_window_item
  639.   #--------------------------------------------------------------------------
  640.   def draw_window_item(obj, rect)
  641.     title = YEM::SYSTEM::OPTIONS[:windowskin]
  642.     self.contents.font.color = normal_color
  643.     self.contents.draw_text(rect.x, rect.y, rect.width/2, WLH, title, 1)
  644.     dx = rect.x + rect.width/2
  645.     skin_id = $game_variables[YEM::SYSTEM::WINDOWSKIN_VARIABLE]
  646.     skin_name = YEM::SYSTEM::WINDOW_HASH[skin_id][0]
  647.     dx = rect.x + rect.width/2
  648.     self.contents.draw_text(dx, rect.y, rect.width/2, WLH, skin_name, 1)
  649.   end
  650.  
  651.   #--------------------------------------------------------------------------
  652.   # draw_volume_item
  653.   #--------------------------------------------------------------------------
  654.   def draw_volume_item(obj, rect)
  655.     options = YEM::SYSTEM::OPTIONS
  656.     case obj
  657.     when :bgm_volume
  658.       title = options[:bgm_volume]
  659.       value = $game_variables[options[:bgm_variable]]
  660.       mute  = $game_switches[options[:bgm_mute_sw]]
  661.     when :bgs_volume
  662.       title = options[:bgs_volume]
  663.       value = $game_variables[options[:bgs_variable]]
  664.       mute  = $game_switches[options[:bgs_mute_sw]]
  665.     when :sfx_volume
  666.       title = options[:sfx_volume]
  667.       value = $game_variables[options[:sfx_variable]]
  668.       mute  = $game_switches[options[:sfx_mute_sw]]
  669.     else; return
  670.     end
  671.     value = sprintf(options[:audio], value)
  672.     self.contents.font.color = normal_color
  673.     self.contents.draw_text(rect.x, rect.y, rect.width/2, WLH, title, 1)
  674.     self.contents.font.color.alpha = mute ? 128 : 255
  675.     dx = rect.x + rect.width/2
  676.     self.contents.draw_text(dx, rect.y, rect.width/4, WLH, value, 1)
  677.     self.contents.font.color.alpha = mute ? 255 : 128
  678.     dx = rect.x + rect.width*3/4
  679.     self.contents.draw_text(dx, rect.y, rect.width/4, WLH, options[:mute], 1)
  680.   end
  681.  
  682.   #--------------------------------------------------------------------------
  683.   # draw_switch_item
  684.   #--------------------------------------------------------------------------
  685.   def draw_switch_item(obj, rect)
  686.     options = YEM::SYSTEM::OPTIONS
  687.     title = options[obj]
  688.     case obj
  689.     when :animations
  690.       name1 = options[:ani_show]
  691.       name2 = options[:ani_hide]
  692.       toggle = $game_switches[options[:animation_sw]]
  693.     when :autocursor
  694.       name1 = options[:curmem_on]
  695.       name2 = options[:curmem_off]
  696.       toggle = $game_switches[options[:autocursor_sw]]
  697.     when :next_actor
  698.       name1 = options[:next_on]
  699.       name2 = options[:next_off]
  700.       toggle = $game_switches[options[:next_actor_sw]]
  701.     when :skill_help
  702.       name1 = options[:help_on]
  703.       name2 = options[:help_off]
  704.       toggle = $game_switches[options[:skill_help_sw]]
  705.     when :cinematics
  706.       name1 = options[:cinem_on]
  707.       name2 = options[:cinem_off]
  708.       toggle = $game_switches[options[:cinematics_sw]]
  709.     when :auto_dash
  710.       name1 = options[:dash_on]
  711.       name2 = options[:dash_off]
  712.       toggle = $game_switches[options[:auto_dash_sw]]
  713.     when :instant_text
  714.       name1 = options[:inst_on]
  715.       name2 = options[:inst_off]
  716.       toggle = $game_switches[options[:inst_text_sw]]
  717.     else; return
  718.     end
  719.     self.contents.font.color = normal_color
  720.     self.contents.draw_text(rect.x, rect.y, rect.width/2, WLH, title, 1)
  721.     self.contents.font.color.alpha = toggle ? 255 : 128
  722.     dx = rect.x + rect.width/2
  723.     self.contents.draw_text(dx, rect.y, rect.width/4, WLH, name1, 1)
  724.     self.contents.font.color.alpha = toggle ? 128 : 255
  725.     dx = rect.x + rect.width*3/4
  726.     self.contents.draw_text(dx, rect.y, rect.width/4, WLH, name2, 1)
  727.   end
  728.  
  729.   #--------------------------------------------------------------------------
  730.   # draw_atb_item
  731.   #--------------------------------------------------------------------------
  732.   def draw_atb_item(obj, rect)
  733.     options = YEM::SYSTEM::OPTIONS
  734.     case obj
  735.     when :atb_active
  736.       title = options[:atb_aname]
  737.       value = $game_variables[options[:atb_avariable]]
  738.       #---
  739.       self.contents.font.color = normal_color
  740.       name1 = options[:wait_0]
  741.       dx = rect.x + rect.width/2
  742.       self.contents.font.color.alpha = (value == 0) ? 255 : 128
  743.       self.contents.draw_text(dx, rect.y, rect.width/8, WLH, name1, 1)
  744.       name2 = options[:wait_1]
  745.       dx = rect.x + rect.width*5/8
  746.       self.contents.font.color.alpha = (value == 1) ? 255 : 128
  747.       self.contents.draw_text(dx, rect.y, rect.width/8, WLH, name2, 1)
  748.       name3 = options[:wait_2]
  749.       dx = rect.x + rect.width*6/8
  750.       self.contents.font.color.alpha = (value == 2) ? 255 : 128
  751.       self.contents.draw_text(dx, rect.y, rect.width/8, WLH, name3, 1)
  752.       name4 = options[:wait_3]
  753.       dx = rect.x + rect.width*7/8
  754.       self.contents.font.color.alpha = (value == 3) ? 255 : 128
  755.       self.contents.draw_text(dx, rect.y, rect.width/8, WLH, name4, 1)
  756.       #---
  757.     when :atb_speeds
  758.       title = options[:atb_sname]
  759.       value = $game_variables[options[:atb_svariable]] - 1
  760.       #---
  761.       for i in 0...10
  762.         self.contents.font.color = normal_color
  763.         name = (i + 1).to_s
  764.         dx = rect.x + rect.width * (10 + i)/20
  765.         self.contents.font.color.alpha = (value == i) ? 255 : 128
  766.         self.contents.draw_text(dx, rect.y, rect.width/20, WLH, name, 1)
  767.       end
  768.       #---
  769.     else; return
  770.     end
  771.     self.contents.font.color = normal_color
  772.     self.contents.draw_text(rect.x, rect.y, rect.width/2, WLH, title, 1)
  773.   end
  774.  
  775.   #--------------------------------------------------------------------------
  776.   # draw_solo_item
  777.   #--------------------------------------------------------------------------
  778.   def draw_solo_item(obj, rect)
  779.     options = YEM::SYSTEM::OPTIONS
  780.     case obj
  781.     when :return_title, :return_menu
  782.       text = options[obj]
  783.     else; return
  784.     end
  785.     self.contents.font.color = normal_color
  786.     self.contents.draw_text(rect.x, rect.y, rect.width, WLH, text, 1)
  787.   end
  788.  
  789.   #--------------------------------------------------------------------------
  790.   # update
  791.   #--------------------------------------------------------------------------
  792.   def update
  793.     super
  794.     if Input.trigger?(Input::C)
  795.       input_case_c
  796.     elsif Input.repeat?(Input::LEFT)
  797.       input_case_left
  798.     elsif Input.repeat?(Input::RIGHT)
  799.       input_case_right
  800.     end
  801.   end
  802.  
  803.   #--------------------------------------------------------------------------
  804.   # input_case_c
  805.   #--------------------------------------------------------------------------
  806.   def input_case_c
  807.     options = YEM::SYSTEM::OPTIONS
  808.     case item
  809.     when :windowskin
  810.       Sound.play_decision
  811.       $scene.open_skins_window
  812.       return
  813.     when :bgm_volume; switch = options[:bgm_mute_sw]
  814.     when :bgs_volume; switch = options[:bgs_mute_sw]
  815.     when :sfx_volume; switch = options[:sfx_mute_sw]
  816.     when :animations; switch = options[:animation_sw]
  817.     when :autocursor; switch = options[:autocursor_sw]
  818.     when :next_actor; switch = options[:next_actor_sw]
  819.     when :skill_help; switch = options[:skill_help_sw]
  820.     when :cinematics; switch = options[:cinematics_sw]
  821.     when :auto_dash;  switch = options[:auto_dash_sw]
  822.     when :instant_text; switch = options[:inst_text_sw]
  823.     when :return_title
  824.       $scene.command_to_title
  825.       return
  826.     when :return_menu
  827.       Sound.play_decision
  828.       $scene.return_scene
  829.       return
  830.     else; return
  831.     end
  832.     $game_switches[switch] = !$game_switches[switch]
  833.     Sound.play_decision
  834.     RPG::BGM::last.play if item == :bgm_volume
  835.     RPG::BGS::last.play if item == :bgs_volume
  836.     draw_item(self.index)
  837.   end
  838.  
  839.   #--------------------------------------------------------------------------
  840.   # input_case_left
  841.   #--------------------------------------------------------------------------
  842.   def input_case_left
  843.     options = YEM::SYSTEM::OPTIONS
  844.     ignore = false
  845.     case item
  846.     when :bgm_volume, :bgs_volume, :sfx_volume
  847.       value = Input.press?(Input::SHIFT) ? 10 : 1
  848.       case item
  849.       when :bgm_volume; variable = options[:bgm_variable]
  850.       when :bgs_volume; variable = options[:bgs_variable]
  851.       when :sfx_volume; variable = options[:sfx_variable]
  852.       end
  853.       return if $game_variables[variable] == 0
  854.       $game_variables[variable] -= value
  855.       $game_variables[variable] = [$game_variables[variable], 0].max
  856.       ignore = true
  857.     when :atb_active
  858.       variable = options[:atb_avariable]
  859.       return if $game_variables[variable] == 0
  860.       $game_variables[variable] -= 1
  861.       $game_variables[variable] = [$game_variables[variable], 0].max
  862.       ignore = true
  863.     when :atb_speeds
  864.       variable = options[:atb_svariable]
  865.       return if $game_variables[variable] == 1
  866.       $game_variables[variable] -= 1
  867.       $game_variables[variable] = [$game_variables[variable], 1].max
  868.       ignore = true
  869.     when :animations; switch = options[:animation_sw]
  870.     when :autocursor; switch = options[:autocursor_sw]
  871.     when :next_actor; switch = options[:next_actor_sw]
  872.     when :skill_help; switch = options[:skill_help_sw]
  873.     when :cinematics; switch = options[:cinematics_sw]
  874.     when :auto_dash;  switch = options[:auto_dash_sw]
  875.     when :instant_text; switch = options[:inst_text_sw]
  876.     else; return
  877.     end
  878.     unless ignore
  879.       return if $game_switches[switch]
  880.       $game_switches[switch] = true
  881.     end
  882.     Sound.play_cursor
  883.     RPG::BGM::last.play if item == :bgm_volume
  884.     RPG::BGS::last.play if item == :bgs_volume
  885.     draw_item(self.index)
  886.   end
  887.  
  888.   #--------------------------------------------------------------------------
  889.   # input_case_right
  890.   #--------------------------------------------------------------------------
  891.   def input_case_right
  892.     options = YEM::SYSTEM::OPTIONS
  893.     ignore = false
  894.     case item
  895.     when :bgm_volume, :bgs_volume, :sfx_volume
  896.       value = Input.press?(Input::SHIFT) ? 10 : 1
  897.       case item
  898.       when :bgm_volume; variable = options[:bgm_variable]
  899.       when :bgs_volume; variable = options[:bgs_variable]
  900.       when :sfx_volume; variable = options[:sfx_variable]
  901.       end
  902.       return if $game_variables[variable] == 100
  903.       $game_variables[variable] += value
  904.       $game_variables[variable] = [$game_variables[variable], 100].min
  905.       ignore = true
  906.     when :atb_active
  907.       variable = options[:atb_avariable]
  908.       return if $game_variables[variable] == 3
  909.       $game_variables[variable] += 1
  910.       $game_variables[variable] = [$game_variables[variable], 3].min
  911.       ignore = true
  912.     when :atb_speeds
  913.       variable = options[:atb_svariable]
  914.       return if $game_variables[variable] == 10
  915.       $game_variables[variable] += 1
  916.       $game_variables[variable] = [$game_variables[variable], 10].min
  917.       ignore = true
  918.     when :animations; switch = options[:animation_sw]
  919.     when :autocursor; switch = options[:autocursor_sw]
  920.     when :next_actor; switch = options[:next_actor_sw]
  921.     when :skill_help; switch = options[:skill_help_sw]
  922.     when :cinematics; switch = options[:cinematics_sw]
  923.     when :auto_dash;  switch = options[:auto_dash_sw]
  924.     when :instant_text; switch = options[:inst_text_sw]
  925.     else; return
  926.     end
  927.     unless ignore
  928.       return if !$game_switches[switch]
  929.       $game_switches[switch] = false
  930.     end
  931.     Sound.play_cursor
  932.     RPG::BGM::last.play if item == :bgm_volume
  933.     RPG::BGS::last.play if item == :bgs_volume
  934.     draw_item(self.index)
  935.   end
  936.  
  937.   #--------------------------------------------------------------------------
  938.   # update_help
  939.   #--------------------------------------------------------------------------
  940.   def update_help
  941.     case item
  942.     when :bgm_volume; type = :bgm_des
  943.     when :bgs_volume; type = :bgs_des
  944.     when :sfx_volume; type = :sfx_des
  945.     when :animations; type = :ani_des
  946.     when :autocursor; type = :curmem_des
  947.     when :next_actor; type = :next_des
  948.     when :skill_help; type = :help_des
  949.     when :cinematics; type = :cinem_des
  950.     when :windowskin; type = :wind_des
  951.     when :auto_dash;  type = :dash_des
  952.     when :instant_text; type = :inst_des
  953.     when :return_title; type = :retitle_des
  954.     when :return_menu;  type = :remenu_des
  955.     when :atb_active
  956.       case $game_variables[YEM::SYSTEM::OPTIONS[:atb_avariable]]
  957.       when 0; type = :wait_0_des
  958.       when 1; type = :wait_1_des
  959.       when 2; type = :wait_2_des
  960.       when 3: type = :wait_3_des
  961.       end
  962.     when :atb_speeds; type = :atb_s_des
  963.     else; type = nil
  964.     end
  965.     text = YEM::SYSTEM::OPTIONS[type].to_s
  966.     @help_window.set_text(text, 1)
  967.   end
  968.  
  969. end # Window_SystemOptions
  970.  
  971. #===============================================================================
  972. # Window_Skins
  973. #===============================================================================
  974.  
  975. class Window_Skins < Window_Selectable
  976.  
  977.   #--------------------------------------------------------------------------
  978.   # initialize
  979.   #--------------------------------------------------------------------------
  980.   def initialize
  981.     dx = Graphics.width/4
  982.     dw = Graphics.width/2
  983.     dh = Graphics.height - 112
  984.     super(dx, 56, dw, dh)
  985.     @column_max = 1
  986.     self.index = 0
  987.     self.back_opacity = 255
  988.     self.openness = 0
  989.     self.active = false
  990.     refresh
  991.   end
  992.  
  993.   #--------------------------------------------------------------------------
  994.   # refresh
  995.   #--------------------------------------------------------------------------
  996.   def refresh
  997.     @data = []
  998.     variable = $game_variables[YEM::SYSTEM::WINDOWSKIN_VARIABLE]
  999.     hash = YEM::SYSTEM::WINDOW_HASH.sort{ |a,b| a[0] <=> b[0] }
  1000.     for key in hash
  1001.       @data.push(key[0])
  1002.       self.index = key[0] - 1 if key[0] == $game_variables[variable]
  1003.     end
  1004.     @item_max = @data.size
  1005.     create_contents
  1006.     for i in 0...@item_max
  1007.       draw_item(i)
  1008.     end
  1009.   end
  1010.  
  1011.   #--------------------------------------------------------------------------
  1012.   # draw_item
  1013.   #--------------------------------------------------------------------------
  1014.   def draw_item(index)
  1015.     rect = item_rect(index)
  1016.     self.contents.clear_rect(rect)
  1017.     rect.width -= 4
  1018.     text = YEM::SYSTEM::WINDOW_HASH[@data[index]][0]
  1019.     self.contents.draw_text(rect, text, 1)
  1020.   end
  1021.  
  1022. end # Window_Skins
  1023.  
  1024. #===============================================================================
  1025. # Scene_Title
  1026. #===============================================================================
  1027.  
  1028. class Scene_Title < Scene_Base
  1029.  
  1030.   #--------------------------------------------------------------------------
  1031.   # alias method: create_game_objects
  1032.   #--------------------------------------------------------------------------
  1033.   alias create_game_objects_sgo create_game_objects unless $@
  1034.   def create_game_objects
  1035.     create_game_objects_sgo
  1036.     $game_system.create_system_options
  1037.   end
  1038.  
  1039. end # Scene_Title
  1040.  
  1041. #===============================================================================
  1042. # Scene_Map
  1043. #===============================================================================
  1044.  
  1045. class Scene_Map < Scene_Base
  1046.  
  1047.   #--------------------------------------------------------------------------
  1048.   # alias method: start
  1049.   #--------------------------------------------------------------------------
  1050.   alias start_sgo start unless $@
  1051.   def start
  1052.     $game_system.create_system_options
  1053.     start_sgo
  1054.   end
  1055.  
  1056. end # Scene_Map
  1057.  
  1058. #===============================================================================
  1059. # Scene_Battle
  1060. #===============================================================================
  1061.  
  1062. class Scene_Battle < Scene_Base
  1063.  
  1064.   #--------------------------------------------------------------------------
  1065.   # alias method: display_normal_animation
  1066.   #--------------------------------------------------------------------------
  1067.   unless $imported["BattleEngineMelody"]
  1068.   alias display_normal_animation_sgo display_normal_animation unless $@
  1069.   def display_normal_animation(targets, animation_id, mirror = false)
  1070.     return if $game_switches[YEM::SYSTEM::OPTIONS[:animation_sw]]
  1071.     display_normal_animation_sgo(targets, animation_id, mirror)
  1072.   end
  1073.   end # $imported["BattleEngineMelody"]
  1074.  
  1075. end # Scene_Battle
  1076.  
  1077. #===============================================================================
  1078. # Scene_End
  1079. #===============================================================================
  1080.  
  1081. class Scene_End < Scene_Base
  1082.  
  1083.   #--------------------------------------------------------------------------
  1084.   # public instance variables
  1085.   #--------------------------------------------------------------------------
  1086.   attr_accessor :window_var
  1087.  
  1088.   #--------------------------------------------------------------------------
  1089.   # overwrite method: start
  1090.   #--------------------------------------------------------------------------
  1091.   def start
  1092.     super
  1093.     create_menu_background
  1094.     @window_var = YEM::SYSTEM::WINDOWSKIN_VARIABLE
  1095.     @help_window = Window_Help.new
  1096.     @options_window = Window_SystemOptions.new(@help_window)
  1097.     @skins_window = Window_Skins.new
  1098.   end
  1099.  
  1100.   #--------------------------------------------------------------------------
  1101.   # overwrite method: post_start
  1102.   #--------------------------------------------------------------------------
  1103.   def post_start; super; end
  1104.  
  1105.   #--------------------------------------------------------------------------
  1106.   # overwrite method: pre_terminate
  1107.   #--------------------------------------------------------------------------
  1108.   def pre_terminate; super; end
  1109.  
  1110.   #--------------------------------------------------------------------------
  1111.   # overwrite method: close_command_window
  1112.   #--------------------------------------------------------------------------
  1113.   def close_command_window; end
  1114.  
  1115.   #--------------------------------------------------------------------------
  1116.   # overwrite method: terminate
  1117.   #--------------------------------------------------------------------------
  1118.   def terminate
  1119.     super
  1120.     @help_window.dispose
  1121.     @options_window.dispose
  1122.     @skins_window.dispose
  1123.     dispose_menu_background
  1124.   end
  1125.  
  1126.   #--------------------------------------------------------------------------
  1127.   # overwrite method: update
  1128.   #--------------------------------------------------------------------------
  1129.   def update
  1130.     super
  1131.     @help_window.update
  1132.     @skins_window.update
  1133.     update_menu_background
  1134.     if @options_window.active
  1135.       update_options_window
  1136.     elsif @skins_window.active
  1137.       update_skins_window
  1138.     end
  1139.   end
  1140.  
  1141.   #--------------------------------------------------------------------------
  1142.   # new method: update_options_window
  1143.   #--------------------------------------------------------------------------
  1144.   def update_options_window
  1145.     @options_window.update
  1146.     if Input.trigger?(Input::B)
  1147.       Sound.play_cancel
  1148.       return_scene
  1149.     end
  1150.   end
  1151.  
  1152.   #--------------------------------------------------------------------------
  1153.   # new method: open_skins_window
  1154.   #--------------------------------------------------------------------------
  1155.   def open_skins_window
  1156.     @skins_window.open
  1157.     @skins_window.index = $game_variables[YEM::SYSTEM::WINDOWSKIN_VARIABLE] - 1
  1158.     @skins_window.active = true
  1159.     @options_window.active = false
  1160.   end
  1161.  
  1162.   #--------------------------------------------------------------------------
  1163.   # new method: update_skins_window
  1164.   #--------------------------------------------------------------------------
  1165.   def update_skins_window
  1166.     if @last_index != @skins_window.index
  1167.       @last_index = @skins_window.index
  1168.       update_skins
  1169.     end
  1170.     if Input.trigger?(Input::B)
  1171.       Sound.play_cancel
  1172.       @skins_window.close
  1173.       @skins_window.active = false
  1174.       @options_window.active = true
  1175.     elsif Input.trigger?(Input::C)
  1176.       Sound.play_decision
  1177.       @skins_window.close
  1178.       @skins_window.active = false
  1179.       @options_window.active = true
  1180.     end
  1181.   end
  1182.  
  1183.   #--------------------------------------------------------------------------
  1184.   # new method: update_skins
  1185.   #--------------------------------------------------------------------------
  1186.   def update_skins
  1187.     $game_variables[@window_var] = @skins_window.index + 1
  1188.     @options_window.update_windowskin
  1189.     @options_window.refresh
  1190.     @help_window.update_windowskin
  1191.     @help_window.set_text("")
  1192.     @options_window.update_help
  1193.     @skins_window.update_windowskin
  1194.     @skins_window.back_opacity = 255
  1195.     @skins_window.refresh
  1196.     @options_window.draw_item(@options_window.index)
  1197.   end
  1198.  
  1199. end # Scene_End
  1200.  
  1201. #===============================================================================
  1202. #
  1203. # END OF FILE
  1204. #
  1205. #===============================================================================

点评

序号 => [ "window里的文件名", 透明度, 字体粗体, 字体斜体, 字体阴影, 字体大小, ”字体名称“#(不变就DEFAULT)],  发表于 2012-6-29 18:55
回复

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
49
在线时间
3 小时
注册时间
2012-5-4
帖子
284
2
 楼主| 发表于 2012-6-29 18:34:50 | 只看该作者

点评

问题描述清楚  发表于 2012-6-29 18:44
回复

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-12-23 08:15

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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