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

Project1

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

[已经解决] 关于喵呜喵5的通关存档脚本与YanFly的Save Engine混用问题

[复制链接]

Lv1.梦旅人

梦石
0
星屑
50
在线时间
110 小时
注册时间
2013-9-4
帖子
43
跳转到指定楼层
1
发表于 2014-9-7 14:53:52 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

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

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

x
个人存档画面用的Yanfly Engine Ace - Ace Save Engine v1.03,而又喜欢喵呜喵5大大的:通关存档脚本,想将二者结合起来(就是把通关过后的存档改为其他符号显示),不知道如何修改YEA的脚本达到期待的效果呢(直接插脚本没用,我Ruby目前只是初学阶段,改了老半天不是出错就是达不到想要的效果。。。)?

Yanfly Engine Ace - Ace Save Engine v1.03
RUBY 代码复制
  1. #==============================================================================
  2. #
  3. # ?\ Yanfly Engine Ace - Ace Save Engine v1.03
  4. # -- Last Updated: 2012.07.22
  5. # -- Level: Normal
  6. # -- Requires: n/a
  7. #
  8. #==============================================================================
  9.  
  10. $imported = {} if $imported.nil?
  11. $imported["YEA-SaveEngine"] = true
  12.  
  13. #==============================================================================
  14. # ?\ Updates
  15. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  16. # 2012.07.22 - Fixed: Location Drawing.
  17. # 2012.01.23 - Anti-crash method added for removed maps.
  18. # 2011.12.26 - Compatibility Update: New Game+
  19. # 2011.12.26 - Started Script and Finished.
  20. #
  21. #==============================================================================
  22. # ?\ Introduction
  23. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  24. # This script provides a new save interface for the player. Along with a new
  25. # interface, the player can also load and delete saves straight from the menu
  26. # itself. This will in turn make the save command from the Main Menu always
  27. # available, but the save option within the new save menu will be enabled
  28. # depending on whether or not it is allowed or disallowed. From the interface,
  29. # the player is given more information regarding the save file including the
  30. # the location the player saved at, the amount of gold available, and any
  31. # variables that you want to show the player as well.
  32. #
  33. #==============================================================================
  34. # ?\ Instructions
  35. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  36. # To install this script, open up your script editor and copy/paste this script
  37. # to an open slot below ?\ Materials/ef?T but above ?\ Main. Remember to save.
  38. #
  39. # For first time installers, be warned that loading this script the first time
  40. # may not display all information in the status window for save files made
  41. # before the installation of this script. To remedy this, just load up the save
  42. # and save the file again.
  43. #
  44. #==============================================================================
  45. # ?\ Compatibility
  46. # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  47. # This script is made strictly for RPG Maker VX Ace. It is highly unlikely that
  48. # it will run with RPG Maker VX without adjusting.
  49. #
  50. #==============================================================================
  51.  
  52. module YEA
  53.   module SAVE
  54.  
  55.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  56.     # - Slot Window Settings -
  57.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  58.     # This section adjusts how the slot window appears on the left side of the
  59.     # screen. This also adjusts the maximum number of saves a player can make,
  60.     # the way the slot names appear, and the icons used.
  61.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  62.     MAX_FILES = 24         # Maximum saves a player can make. Default: 16
  63.     SLOT_NAME = "NO.%s"  # How the file slots will be named.
  64.  
  65.     # These are the icons
  66.     SAVE_ICON  = 368       # Icon used to indicate a save is present.
  67.     EMPTY_ICON = 375       # Icon used to indicate an empty file.
  68.  
  69.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  70.     # - Action Window Settings -
  71.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  72.     # This section adjusts how the action window appears, the sound effect
  73.     # played when deleting files, and what appears in the help window above.
  74.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  75.     ACTION_LOAD   = "读取"           # Text used for loading games.
  76.     ACTION_SAVE   = "存储"           # Text used for saving games.
  77.     ACTION_DELETE = "删除"         # Text used for deleting games.
  78.     DELETE_SOUND  = RPG::SE.new("Collapse3", 100, 100) # Sound for deleting.
  79.  
  80.     # These text settings adjust what displays in the help window.
  81.     SELECT_HELP = "请选择一个存档。"
  82.     LOAD_HELP   = "读取已存存档。"
  83.     SAVE_HELP   = "存储当前存档。"
  84.     DELETE_HELP = "删除此存档所有数据。"
  85.  
  86.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  87.     # - Status Window Settings -
  88.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  89.     # This section adjusts how the status window appears in the middle of the
  90.     # screen (that displays the game's data) such as the total playtime, total
  91.     # times saved, total gold, the party's current location, and the variables
  92.     # to be displayed.
  93.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  94.     EMPTY_TEXT = "空存档"      # Text used when no save data is present.
  95.     PLAYTIME   = "时间: "          # Text used for total playtime.
  96.     TOTAL_SAVE = "存档次数: "     # Text used to indicate total saves.
  97.     TOTAL_GOLD = "金钱: "      # Text used to indicate total gold.
  98.     LOCATION   = "地点: "        # Text used to indicate current location.
  99.  
  100.     # These variables will be shown in each of the two columns for those who
  101.     # would want to display more information than just what's shown. Input the
  102.     # variables into the arrays below to designate what data will be shown.
  103.     COLUMN1_VARIABLES = [1,3]#[1, 2, 3]
  104.     COLUMN2_VARIABLES = [2]#[4, 5, 6]
  105.  
  106.   end # SAVE
  107. end # YEA
  108.  
  109. #==============================================================================
  110. # ?\ Editting anything past this point may potentially result in causing
  111. # computer damage, incontinence, explosion of user's head, coma, death, and/or
  112. # halitosis so edit at your own risk.
  113. #==============================================================================
  114.  
  115. #==============================================================================
  116. # ?! Icon
  117. #==============================================================================
  118.  
  119. module Icon
  120.  
  121.   #--------------------------------------------------------------------------
  122.   # self.save_icon
  123.   #--------------------------------------------------------------------------
  124.   def self.save_icon; return YEA::SAVE::SAVE_ICON; end
  125.  
  126.   #--------------------------------------------------------------------------
  127.   # self.empty_icon
  128.   #--------------------------------------------------------------------------
  129.   def self.empty_icon; return YEA::SAVE::EMPTY_ICON; end
  130.  
  131. end # Icon
  132.  
  133. #==============================================================================
  134. # ?! Numeric
  135. #==============================================================================
  136.  
  137. class Numeric
  138.  
  139.   #--------------------------------------------------------------------------
  140.   # new method: group_digits
  141.   #--------------------------------------------------------------------------
  142.   unless $imported["YEA-CoreEngine"]
  143.   def group; return self.to_s; end
  144.   end # $imported["YEA-CoreEngine"]
  145.  
  146. end # Numeric
  147.  
  148. #==============================================================================
  149. # ?! DataManager
  150. #==============================================================================
  151.  
  152. module DataManager
  153.  
  154.   #--------------------------------------------------------------------------
  155.   # overwrite method: savefile_max
  156.   #--------------------------------------------------------------------------
  157.   def self.savefile_max
  158.     return YEA::SAVE::MAX_FILES
  159.   end
  160.  
  161.   #--------------------------------------------------------------------------
  162.   # overwrite method: self.make_save_header
  163.   #--------------------------------------------------------------------------
  164.   def self.make_save_header
  165.     header = {}
  166.     header[:characters]    = $game_party.characters_for_savefile
  167.     header[:playtime_s]    = $game_system.playtime_s
  168.     header[:system]        = Marshal.load(Marshal.dump($game_system))
  169.     header[:timer]         = Marshal.load(Marshal.dump($game_timer))
  170.     header[:message]       = Marshal.load(Marshal.dump($game_message))
  171.     header[:switches]      = Marshal.load(Marshal.dump($game_switches))
  172.     header[:variables]     = Marshal.load(Marshal.dump($game_variables))
  173.     header[:self_switches] = Marshal.load(Marshal.dump($game_self_switches))
  174.     header[:actors]        = Marshal.load(Marshal.dump($game_actors))
  175.     header[:party]         = Marshal.load(Marshal.dump($game_party))
  176.     header[:troop]         = Marshal.load(Marshal.dump($game_troop))
  177.     header[:map]           = Marshal.load(Marshal.dump($game_map))
  178.     header[:player]        = Marshal.load(Marshal.dump($game_player))
  179.     header
  180.   end
  181.  
  182. end # DataManager
  183.  
  184. #==============================================================================
  185. # ?! Window_MenuCommand
  186. #==============================================================================
  187.  
  188. class Window_MenuCommand < Window_Command
  189.  
  190.   #--------------------------------------------------------------------------
  191.   # overwrite method: save_enabled
  192.   #--------------------------------------------------------------------------
  193.   def save_enabled; return true; end
  194.  
  195. end # Window_MenuCommand
  196.  
  197. #==============================================================================
  198. # ?! Window_FileList
  199. #==============================================================================
  200.  
  201. class Window_FileList < Window_Selectable
  202.  
  203.   #--------------------------------------------------------------------------
  204.   # initialize
  205.   #--------------------------------------------------------------------------
  206.   def initialize(dx, dy)
  207.     super(dx, dy, 128, Graphics.height - dy)
  208.     refresh
  209.     activate
  210.     select(SceneManager.scene.first_savefile_index)
  211.   end
  212.  
  213.   #--------------------------------------------------------------------------
  214.   # item_max
  215.   #--------------------------------------------------------------------------
  216.   def item_max; return DataManager.savefile_max; end
  217.  
  218.   #--------------------------------------------------------------------------
  219.   # current_item_enabled?
  220.   #--------------------------------------------------------------------------
  221.   def current_item_enabled?
  222.     header = DataManager.load_header(index)
  223.     return false if header.nil? && SceneManager.scene_is?(Scene_Load)
  224.     return true
  225.   end
  226.  
  227.   #--------------------------------------------------------------------------
  228.   # refresh
  229.   #--------------------------------------------------------------------------
  230.   def refresh
  231.     create_contents
  232.     draw_all_items
  233.   end
  234.  
  235.   #--------------------------------------------------------------------------
  236.   # draw_item
  237.   #--------------------------------------------------------------------------
  238.   def draw_item(index)
  239.     header = DataManager.load_header(index)
  240.     enabled = !header.nil?
  241.     rect = item_rect(index)
  242.     rect.width -= 4
  243.     draw_icon(save_icon?(header), rect.x, rect.y, enabled)
  244.     change_color(normal_color, enabled)
  245.     text = sprintf(YEA::SAVE::SLOT_NAME, (index + 1).group)
  246.     draw_text(rect.x+24, rect.y, rect.width-24, line_height, text)
  247.   end
  248.  
  249.   #--------------------------------------------------------------------------
  250.   # save_icon?
  251.   #--------------------------------------------------------------------------
  252.   def save_icon?(header)
  253.     return Icon.empty_icon if header.nil?
  254.     return Icon.save_icon
  255.   end
  256.  
  257. end # Window_FileList
  258.  
  259. #==============================================================================
  260. # ?! Window_FileStatus
  261. #==============================================================================
  262.  
  263. class Window_FileStatus < Window_Base
  264.  
  265.   #--------------------------------------------------------------------------
  266.   # initialize
  267.   #--------------------------------------------------------------------------
  268.   def initialize(dx, dy, file_window)
  269.     super(dx, dy, Graphics.width - dx, Graphics.height - dy)
  270.     @file_window = file_window
  271.     @current_index = @file_window.index
  272.     refresh
  273.   end
  274.  
  275.   #--------------------------------------------------------------------------
  276.   # update
  277.   #--------------------------------------------------------------------------
  278.   def update
  279.     super
  280.     return if @file_window.index < 0
  281.     return if @current_index == @file_window.index
  282.     @current_index = @file_window.index
  283.     refresh
  284.   end
  285.  
  286.   #--------------------------------------------------------------------------
  287.   # refresh
  288.   #--------------------------------------------------------------------------
  289.   def refresh
  290.     contents.clear
  291.     reset_font_settings
  292.     @header = DataManager.load_header(@file_window.index)
  293.     if @header.nil?
  294.       draw_empty
  295.     else
  296.       draw_save_contents
  297.     end
  298.   end
  299.  
  300.   #--------------------------------------------------------------------------
  301.   # draw_empty
  302.   #--------------------------------------------------------------------------
  303.   def draw_empty
  304.     colour = Color.new(0, 0, 0, translucent_alpha/2)
  305.     rect = Rect.new(0, 0, contents.width, contents.height)
  306.     contents.fill_rect(rect, colour)
  307.     text = YEA::SAVE::EMPTY_TEXT
  308.     change_color(system_color)
  309.     draw_text(rect, text, 1)
  310.   end
  311.  
  312.   #--------------------------------------------------------------------------
  313.   # draw_save_slot
  314.   #--------------------------------------------------------------------------
  315.   def draw_save_slot(dx, dy, dw)
  316.     reset_font_settings
  317.     change_color(system_color)
  318.     text = sprintf(YEA::SAVE::SLOT_NAME, "")
  319.     draw_text(dx, dy, dw, line_height, text)
  320.     cx = text_size(text).width
  321.     change_color(normal_color)
  322.     draw_text(dx+cx, dy, dw-cx, line_height, (@file_window.index+1).group)
  323.   end
  324.  
  325.   #--------------------------------------------------------------------------
  326.   # draw_save_playtime
  327.   #--------------------------------------------------------------------------
  328.   def draw_save_playtime(dx, dy, dw)
  329.     return if @header[:playtime_s].nil?
  330.     reset_font_settings
  331.     change_color(system_color)
  332.     draw_text(dx, dy, dw, line_height, YEA::SAVE::PLAYTIME, 0)
  333.     change_color(normal_color)
  334.     draw_text(dx, dy, dw, line_height, @header[:playtime_s], 2)
  335.   end
  336.  
  337.   #--------------------------------------------------------------------------
  338.   # draw_save_total_saves
  339.   #--------------------------------------------------------------------------
  340.   def draw_save_total_saves(dx, dy, dw)
  341.     return if @header[:system].nil?
  342.     reset_font_settings
  343.     change_color(system_color)
  344.     text = YEA::SAVE::TOTAL_SAVE
  345.     draw_text(dx, dy, dw, line_height, text)
  346.     cx = text_size(text).width
  347.     change_color(normal_color)
  348.     draw_text(dx+cx, dy, dw-cx, line_height, @header[:system].save_count.group)
  349.   end
  350.  
  351.   #--------------------------------------------------------------------------
  352.   # draw_save_gold
  353.   #--------------------------------------------------------------------------
  354.   def draw_save_gold(dx, dy, dw)
  355.     return if @header[:party].nil?
  356.     reset_font_settings
  357.     change_color(system_color)
  358.     draw_text(dx, dy, dw, line_height, YEA::SAVE::TOTAL_GOLD)
  359.     text = Vocab::currency_unit
  360.     draw_text(dx, dy, dw, line_height, text, 2)
  361.     cx = text_size(text).width
  362.     change_color(normal_color)
  363.     text = @header[:party].gold.group
  364.     draw_text(dx, dy, dw-cx, line_height, text, 2)
  365.   end
  366.  
  367.   #--------------------------------------------------------------------------
  368.   # draw_save_location
  369.   #--------------------------------------------------------------------------
  370.   def draw_save_location(dx, dy, dw)
  371.     return if @header[:map].nil?
  372.     reset_font_settings
  373.     change_color(system_color)
  374.     draw_text(dx, dy, dw, line_height, YEA::SAVE::LOCATION)
  375.     change_color(normal_color)
  376.     cx = text_size(YEA::SAVE::LOCATION).width
  377.     return if $data_mapinfos[@header[:map].map_id].nil?
  378.     text = @header[:map].display_name
  379.     text = $data_mapinfos[@header[:map].map_id].name if text == ""
  380.     draw_text(dx+cx, dy, dw-cx, line_height, text)
  381.   end
  382.  
  383.   #--------------------------------------------------------------------------
  384.   # draw_save_characters
  385.   #--------------------------------------------------------------------------
  386.   def draw_save_characters(dx, dy)
  387.     return if @header[:party].nil?
  388.     reset_font_settings
  389.     make_font_smaller
  390.     dw = (contents.width - dx) / @header[:party].max_battle_members
  391.     dx += dw/2
  392.     for member in @header[:party].battle_members
  393.       next if member.nil?
  394.       member = @header[:actors][member.id]
  395.       change_color(normal_color)
  396.       draw_actor_graphic(member, dx, dy)
  397.       text = member.name
  398.       draw_text(dx-dw/2, dy, dw, line_height, text, 1)
  399.       text = member.level.group
  400.       draw_text(dx-dw/2, dy-line_height, dw-4, line_height, text, 2)
  401.       cx = text_size(text).width
  402.       change_color(system_color)
  403.       text = Vocab::level_a
  404.       draw_text(dx-dw/2, dy-line_height, dw-cx-4, line_height, text, 2)
  405.       dx += dw
  406.     end
  407.   end
  408.  
  409.   #--------------------------------------------------------------------------
  410.   # draw_save_column1
  411.   #--------------------------------------------------------------------------
  412.   def draw_save_column1(dx, dy, dw)
  413.     data = YEA::SAVE::COLUMN1_VARIABLES
  414.     draw_column_data(data, dx, dy, dw)
  415.   end
  416.  
  417.   #--------------------------------------------------------------------------
  418.   # draw_save_column2
  419.   #--------------------------------------------------------------------------
  420.   def draw_save_column2(dx, dy, dw)
  421.     data = YEA::SAVE::COLUMN2_VARIABLES
  422.     draw_column_data(data, dx, dy, dw)
  423.   end
  424.  
  425.   #--------------------------------------------------------------------------
  426.   # draw_column_data
  427.   #--------------------------------------------------------------------------
  428.   def draw_column_data(data, dx, dy, dw)
  429.     return if @header[:variables].nil?
  430.     reset_font_settings
  431.     for variable_id in data
  432.       next if $data_system.variables[variable_id].nil?
  433.       change_color(system_color)
  434.       name = $data_system.variables[variable_id]
  435.       draw_text(dx, dy, dw, line_height, name, 0)
  436.       value = @header[:variables][variable_id].group
  437.       change_color(normal_color)
  438.       draw_text(dx, dy, dw, line_height, value, 2)
  439.       dy += line_height
  440.     end
  441.   end
  442.  
  443.   #--------------------------------------------------------------------------
  444.   # draw_save_contents
  445.   #--------------------------------------------------------------------------
  446.   def draw_save_contents
  447.     draw_save_slot(4, 0, contents.width/2-8)
  448.     draw_save_playtime(contents.width/2+4, 0, contents.width/2-8)
  449.     draw_save_total_saves(4, line_height, contents.width/2-8)
  450.     draw_save_gold(contents.width/2+4, line_height, contents.width/2-8)
  451.     draw_save_location(4, line_height*2, contents.width-8)
  452.     draw_save_characters(0, line_height*5 + line_height/3)
  453.     draw_save_column1(16, line_height*7, contents.width/2-48)
  454.     draw_save_column2(contents.width/2+16, line_height*7, contents.width/2-48)
  455.   end
  456.  
  457. end # Window_FileStatus
  458.  
  459. #==============================================================================
  460. # ?! Window_FileAction
  461. #==============================================================================
  462.  
  463. class Window_FileAction < Window_HorzCommand
  464.  
  465.   #--------------------------------------------------------------------------
  466.   # initialize
  467.   #--------------------------------------------------------------------------
  468.   def initialize(dx, dy, file_window)
  469.     @file_window = file_window
  470.     super(dx, dy)
  471.     deactivate
  472.     unselect
  473.   end
  474.  
  475.   #--------------------------------------------------------------------------
  476.   # window_width
  477.   #--------------------------------------------------------------------------
  478.   def window_width; Graphics.width - 128; end
  479.  
  480.   #--------------------------------------------------------------------------
  481.   # col_max
  482.   #--------------------------------------------------------------------------
  483.   def col_max; return 3; end
  484.  
  485.   #--------------------------------------------------------------------------
  486.   # update
  487.   #--------------------------------------------------------------------------
  488.   def update
  489.     super
  490.     return if @file_window.index < 0
  491.     return if @current_index == @file_window.index
  492.     @current_index = @file_window.index
  493.     refresh
  494.   end
  495.  
  496.   #--------------------------------------------------------------------------
  497.   # make_command_list
  498.   #--------------------------------------------------------------------------
  499.   def make_command_list
  500.     @header = DataManager.load_header(@file_window.index)
  501.     add_load_command
  502.     add_save_command
  503.     add_delete_command
  504.   end
  505.  
  506.   #--------------------------------------------------------------------------
  507.   # add_load_command
  508.   #--------------------------------------------------------------------------
  509.   def add_load_command
  510.     add_command(YEA::SAVE::ACTION_LOAD, :load, load_enabled?)
  511.   end
  512.  
  513.   #--------------------------------------------------------------------------
  514.   # load_enabled?
  515.   #--------------------------------------------------------------------------
  516.   def load_enabled?
  517.     return false if @header.nil?
  518.     return true
  519.   end
  520.  
  521.   #--------------------------------------------------------------------------
  522.   # add_save_command
  523.   #--------------------------------------------------------------------------
  524.   def add_save_command
  525.     add_command(YEA::SAVE::ACTION_SAVE, :save, save_enabled?)
  526.   end
  527.  
  528.   #--------------------------------------------------------------------------
  529.   # save_enabled?
  530.   #--------------------------------------------------------------------------
  531.   def save_enabled?
  532.     return false if @header.nil? && SceneManager.scene_is?(Scene_Load)
  533.     return false if SceneManager.scene_is?(Scene_Load)
  534.     return false if $game_system.save_disabled
  535.     return true
  536.   end
  537.  
  538.   #--------------------------------------------------------------------------
  539.   # add_delete_command
  540.   #--------------------------------------------------------------------------
  541.   def add_delete_command
  542.     add_command(YEA::SAVE::ACTION_DELETE, :delete, delete_enabled?)
  543.   end
  544.  
  545.   #--------------------------------------------------------------------------
  546.   # delete_enabled?
  547.   #--------------------------------------------------------------------------
  548.   def delete_enabled?
  549.     return false if @header.nil?
  550.     return true
  551.   end
  552.  
  553.   #--------------------------------------------------------------------------
  554.   # update_help
  555.   #--------------------------------------------------------------------------
  556.   def update_help
  557.     case current_symbol
  558.     when :load; @help_window.set_text(YEA::SAVE::LOAD_HELP)
  559.     when :save; @help_window.set_text(YEA::SAVE::SAVE_HELP)
  560.     when :delete; @help_window.set_text(YEA::SAVE::DELETE_HELP)
  561.     end
  562.   end
  563.  
  564. end # Window_FileAction
  565.  
  566. #==============================================================================
  567. # ?! Scene_File
  568. #==============================================================================
  569.  
  570. class Scene_File < Scene_MenuBase
  571.  
  572.   #--------------------------------------------------------------------------
  573.   # overwrite method: start
  574.   #--------------------------------------------------------------------------
  575.   def start
  576.     super
  577.     create_all_windows
  578.   end
  579.  
  580.   #--------------------------------------------------------------------------
  581.   # overwrite method: terminate
  582.   #--------------------------------------------------------------------------
  583.   def terminate
  584.     super
  585.   end
  586.  
  587.   #--------------------------------------------------------------------------
  588.   # overwrite method: update
  589.   #--------------------------------------------------------------------------
  590.   def update
  591.     super
  592.   end
  593.  
  594.   #--------------------------------------------------------------------------
  595.   # new method: create_all_windows
  596.   #--------------------------------------------------------------------------
  597.   def create_all_windows
  598.     create_help_window
  599.     create_file_window
  600.     create_action_window
  601.     create_status_window
  602.   end
  603.  
  604.   #--------------------------------------------------------------------------
  605.   # overwrite method: create_help_window
  606.   #--------------------------------------------------------------------------
  607.   def create_help_window
  608.     @help_window = Window_Help.new
  609.     @help_window.set_text(YEA::SAVE::SELECT_HELP)
  610.   end
  611.  
  612.   #--------------------------------------------------------------------------
  613.   # new method: create_file_window
  614.   #--------------------------------------------------------------------------
  615.   def create_file_window
  616.     wy = @help_window.height
  617.     @file_window = Window_FileList.new(0, wy)
  618.     @file_window.set_handler(:ok, method(:on_file_ok))
  619.     @file_window.set_handler(:cancel, method(:return_scene))
  620.   end
  621.  
  622.   #--------------------------------------------------------------------------
  623.   # new method: create_action_window
  624.   #--------------------------------------------------------------------------
  625.   def create_action_window
  626.     wx = @file_window.width
  627.     wy = @help_window.height
  628.     @action_window = Window_FileAction.new(wx, wy, @file_window)
  629.     @action_window.help_window = @help_window
  630.     @action_window.set_handler(:cancel, method(:on_action_cancel))
  631.     @action_window.set_handler(:load, method(:on_action_load))
  632.     @action_window.set_handler(:save, method(:on_action_save))
  633.     @action_window.set_handler(:delete, method(:on_action_delete))
  634.   end
  635.  
  636.   #--------------------------------------------------------------------------
  637.   # new method: create_status_window
  638.   #--------------------------------------------------------------------------
  639.   def create_status_window
  640.     wx = @action_window.x
  641.     wy = @action_window.y + @action_window.height
  642.     @status_window = Window_FileStatus.new(wx, wy, @file_window)
  643.   end
  644.  
  645.   #--------------------------------------------------------------------------
  646.   # new method: on_file_ok
  647.   #--------------------------------------------------------------------------
  648.   def on_file_ok
  649.     @action_window.activate
  650.     index = SceneManager.scene_is?(Scene_Load) ? 0 : 1
  651.     @action_window.select(index)
  652.   end
  653.  
  654.   #--------------------------------------------------------------------------
  655.   # new method: on_action_cancel
  656.   #--------------------------------------------------------------------------
  657.   def on_action_cancel
  658.     @action_window.unselect
  659.     @file_window.activate
  660.     @help_window.set_text(YEA::SAVE::SELECT_HELP)
  661.   end
  662.  
  663.   #--------------------------------------------------------------------------
  664.   # new method: on_action_load
  665.   #--------------------------------------------------------------------------
  666.   def on_action_load
  667.     if DataManager.load_game(@file_window.index)
  668.       on_load_success
  669.     else
  670.       Sound.play_buzzer
  671.     end
  672.   end
  673.  
  674.   #--------------------------------------------------------------------------
  675.   # overwrite method: on_load_success
  676.   #--------------------------------------------------------------------------
  677.   def on_load_success
  678.     Sound.play_load
  679.     fadeout_all
  680.     $game_system.on_after_load
  681.     SceneManager.goto(Scene_Map)
  682.   end
  683.  
  684.   #--------------------------------------------------------------------------
  685.   # new method: on_action_save
  686.   #--------------------------------------------------------------------------
  687.   def on_action_save
  688.     @action_window.activate
  689.     if DataManager.save_game(@file_window.index)
  690.       on_save_success
  691.       refresh_windows
  692.     else
  693.       Sound.play_buzzer
  694.     end
  695.   end
  696.  
  697.   #--------------------------------------------------------------------------
  698.   # overwrite method: on_save_success
  699.   #--------------------------------------------------------------------------
  700.   def on_save_success; Sound.play_save; end
  701.  
  702.   #--------------------------------------------------------------------------
  703.   # new method: on_action_delete
  704.   #--------------------------------------------------------------------------
  705.   def on_action_delete
  706.     @action_window.activate
  707.     DataManager.delete_save_file(@file_window.index)
  708.     on_delete_success
  709.     refresh_windows
  710.   end
  711.  
  712.   #--------------------------------------------------------------------------
  713.   # new method: on_delete_success
  714.   #--------------------------------------------------------------------------
  715.   def on_delete_success
  716.     YEA::SAVE::DELETE_SOUND.play
  717.   end
  718.  
  719.   #--------------------------------------------------------------------------
  720.   # new method: refresh_windows
  721.   #--------------------------------------------------------------------------
  722.   def refresh_windows
  723.     @file_window.refresh
  724.     @action_window.refresh
  725.     @status_window.refresh
  726.   end
  727.  
  728. end # Scene_File
  729.  
  730. #==============================================================================
  731. # ?! Scene_Save
  732. #==============================================================================
  733.  
  734. class Scene_Save < Scene_File
  735.  
  736.   #--------------------------------------------------------------------------
  737.   # overwrite method: on_savefile_ok
  738.   #--------------------------------------------------------------------------
  739.   def on_savefile_ok; super; end
  740.  
  741.   #--------------------------------------------------------------------------
  742.   # overwrite method: on_save_success
  743.   #--------------------------------------------------------------------------
  744.   def on_save_success; super; end
  745.  
  746. end # help_window_text
  747.  
  748. #==============================================================================
  749. # ?! Scene_Load
  750. #==============================================================================
  751.  
  752. class Scene_Load < Scene_File
  753.  
  754.   #--------------------------------------------------------------------------
  755.   # overwrite method: on_savefile_ok
  756.   #--------------------------------------------------------------------------
  757.   def on_savefile_ok; super; end
  758.  
  759.   #--------------------------------------------------------------------------
  760.   # overwrite method: on_load_success
  761.   #--------------------------------------------------------------------------
  762.   def on_load_success; super; end
  763.  
  764. end # Scene_Load
  765.  
  766.  
  767. #==============================================================================
  768. #
  769. # ?\ End of File
  770. #
  771. #==============================================================================

Lv5.捕梦者 (暗夜天使)

只有笨蛋才会看到

梦石
1
星屑
21616
在线时间
9412 小时
注册时间
2012-6-19
帖子
7118

开拓者短篇九导演组冠军

2
发表于 2014-9-7 15:57:48 | 只看该作者
  1. =begin
  2. ===============================================================================

  3.   通关存档 By喵呜喵5

  4. ===============================================================================

  5. 【说明】

  6. 在存档界面查看存档时,已经通关的存档会在名字后面会显示特殊效果

  7. =end
  8. $m5script ||= {};$m5script["M5Save20140907"] = 20140907
  9. module M5Save20140907
  10. #==============================================================================
  11. #  设定部分
  12. #==============================================================================
  13.   

  14.   SWI = 1 # 这里设置通关后打开的开关,通关以后请打开这个开关
  15.   
  16.   ICO = 104 # 这里设置已经通关的存档在存档名之后显示的图标,不需要的话设置成 0
  17.   
  18.   X_OFF = 8 # 图标在X方向的偏移
  19.   
  20.   Y_OFF = -1 # 图标在Y方向的偏移
  21.   
  22.   WORD = " 已通关!" # 这里设置已经通关的存档在存档名之后显示的文字

  23.   
  24. #==============================================================================
  25. #  设定结束
  26. #==============================================================================
  27. end
  28. class << DataManager
  29.   alias m5_20140907_make_save_header make_save_header
  30.   def make_save_header
  31.     header = m5_20140907_make_save_header   
  32.     header[:m5_clear] = $game_switches[M5Save20140907::SWI]
  33.     header
  34.   end
  35. end
  36. class Window_SaveFile  
  37.   alias m5_20140907_refresh refresh
  38.   def refresh
  39.     m5_20140907_refresh
  40.     header = DataManager.load_header(@file_index)
  41.     if header != nil and header[:m5_clear]
  42.       draw_icon(M5Save20140907::ICO, M5Save20140907::X_OFF + @name_width,\
  43.         M5Save20140907::Y_OFF)
  44.       draw_text(@name_width + \
  45.         (M5Save20140907::ICO == 0 ? 0 : 24 + M5Save20140907::X_OFF),0,\
  46.         Graphics.width, line_height, M5Save20140907::WORD)
  47.     end
  48.   end
  49. end

  50. if $imported && $imported["YEA-SaveEngine"]
  51.   
  52. class Window_FileList  
  53.   alias m5_20140907_draw_item draw_item
  54.   def draw_item(index)
  55.     m5_20140907_draw_item(index)   
  56.     header = DataManager.load_header(index)   
  57.     if header != nil and header[:m5_clear]
  58.       rect = item_rect(index)
  59.       rect.width -= 4
  60.       width = text_size(sprintf(YEA::SAVE::SLOT_NAME, (index + 1).group)).width
  61.       draw_icon(M5Save20140907::ICO, rect.x + width + 24 + \
  62.         M5Save20140907::X_OFF, rect.y + M5Save20140907::Y_OFF)
  63.     end
  64.   end
  65. end
  66. class Window_FileStatus
  67.   alias m5_20140907_draw_save_slot draw_save_slot
  68.   def draw_save_slot(dx, dy, dw)
  69.     m5_20140907_draw_save_slot(dx, dy, dw)
  70.     header = DataManager.load_header(@file_window.index)   
  71.     if header != nil and header[:m5_clear]
  72.       text = sprintf(YEA::SAVE::SLOT_NAME, (@file_window.index+1).group)
  73.       width = text_size(text).width
  74.       draw_icon(M5Save20140907::ICO, dx + width + M5Save20140907::X_OFF,\
  75.         M5Save20140907::Y_OFF + dy)
  76.       draw_text(dx + width + \
  77.         (M5Save20140907::ICO == 0 ? 0 : 24 + M5Save20140907::X_OFF),dy,\
  78.         Graphics.width, line_height, M5Save20140907::WORD)
  79.     end   
  80.   end
  81. end

  82. end # if $imported && $imported["YEA-SaveEngine"]
复制代码

点评

哇哇,大大亲自解决太感谢了!  发表于 2014-9-7 16:03

评分

参与人数 1星屑 +100 梦石 +1 收起 理由
taroxd + 100 + 1 $m5script = 0

查看全部评分

回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-11-14 13:00

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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