Project1

标题: 求vx增加存档个数的脚本 [打印本页]

作者: 莹的赎生    时间: 2010-12-21 13:07
标题: 求vx增加存档个数的脚本
求vx增加存档个数的脚本   希望知道的能发一下………………  至少增加到十个存档个数吧…………  默认的4个太少了额
作者: 雪流星    时间: 2010-12-21 13:16
http://rpg.blue/search.php?mod=f ... mp;searchsubmit=yes
作者: cangyu2004    时间: 2010-12-23 23:48
本帖最后由 雪流星 于 2010-12-23 09:56 编辑

  1. #==========================================================================
  2. # �—� [VX] �—� Neo Save System V �—� �–�
  3. #---------------------------------------------------------------------------
  4. # �—� Author: Woratana [[email][email protected][/email]]
  5. # �—� Thaiware RPG Maker Community
  6. # �—� Last Updated:
  7. # �—� Version: 3.0 -> 5.0
  8. # �—� Continued support by Helladen
  9. # �—� (Screen Shot credit Wortana, Andreas21, and Cybersam)
  10. #---------------------------------------------------------------------------
  11. # �—� Log V:
  12. # - Screenshot support for those who want tone/weather/sprites and
  13. #   unlike NSS 1.0 the screen is now centered.
  14. # - Added an option to stay in save screen after you save the game
  15. #---------------------------------------------------------------------------
  16. # �—� Log IV:
  17. # - New addition for hiding map names. You can control the switch to
  18. #   allow MAP_NO_NAME_LIST to work or not.
  19. # - Revised some of the settings and script organization.
  20. # - Added an option to disable the vocab::Gold text right of the number.
  21. # - Added an option to use default opacity or not.
  22. # - Swap tile compatibility support.
  23. #---------------------------------------------------------------------------
  24. # �—� Log III:
  25. # - Change back to draw tile map as screenshot. Don't need any image.
  26. # - For drawing tile map, the characters won't show on the tile map.
  27. #---------------------------------------------------------------------------
  28. # �—� Log II:
  29. # - Screenshot DLL is not work with Vista Aero, so I remove it
  30. #   and use image for each map instead of screenshot.
  31. # - Actor's level in last version (V.1) is incorrect.
  32. #---------------------------------------------------------------------------
  33. # �—� Features:
  34. # - Unlimited save slots, you can choose max save slot
  35. # - Many configuration options
  36. # - Swap tile support
  37. # - You can use image for scene's background
  38. # - Choose your save file's name, and folder to store save files
  39. # - Choose to show only information you want
  40. # - Editable text for information's title
  41. # - Draw tile map for map that player is currently on.
  42. # - Remove text you don't want from map's name (e.g. tags for special script)
  43. # - Choose map that you don't want to show the name on
  44. # - Include save confirmation window before overwrite old save
  45. #===========================================================================

  46. module Wora_NSS Wora_NSS
  47.   #==========================================================================
  48.   # * START NEO SAVE SYSTEM - SETUP
  49.   #--------------------------------------------------------------------------
  50.   OPACITY_DEFAULT = true # This will use the default opacity for windows
  51.                          # Please note that this will affect both opacitys below
  52.   NSS_WINDOW_OPACITY = 255 # All windows' opacity (Lowest 0 - 255 Highest)
  53.   # You can change this to 0 in case you want to use image for background
  54.   NSS_IMAGE_BG = '' # Background image file name, it must be in folder Picture
  55.   #                   use '' for no background
  56.   NSS_IMAGE_BG_OPACITY = 255 # Opacity for background image
  57.   
  58.   # If you use the screen shot method this does not matter
  59.   SWAP_TILE = false # Make this false if you don't use the swap_tile script
  60.   SWAP_TILE_SWITCH = 84 # The switch needs to be the same as your swap tile
  61.   #                       switch, but if SWAP_TILE is false it does not matter
  62.   
  63.   # If this is true it will screen shot the map, if false it will draw it
  64.   SCREENSHOT_IMAGE = true # Drawing the map is good because it doesn't require
  65.   # a .DLL or images for the screen shot, but it has sprites, tone, and
  66.   # weather. You need to turn on swap tile if you have this as false.
  67.   
  68.   IMAGE_FILETYPE = '.png' # Image type for screenshot
  69.   # '.bmp', or '.jpg', or '.png'
  70.   
  71.   # If this is true then the scene will not change when you save the game
  72.   SCENE_CHANGE = true  # Changes Scene to map if true

  73.   MAX_SAVE_SLOT = 20 # Max save slots
  74.   SLOT_NAME = 'SLOT {id}'
  75.   # Name of the slot (show in save slots list), use {id} for slot ID
  76.   SAVE_FILE_NAME = 'Save {id}.rvdata'
  77.   # Save file name, you can also change its file type from .rvdata to other
  78.   
  79.   # Use {id} for save slot ID
  80.   SAVE_PATH = '' # Path to store save file, e.g. 'Save/' or '' (for game folder)
  81.   SAVED_SLOT_ICON = 133 # Icon Index for saved slot
  82.   
  83.   EMPTY_SLOT_ICON = 141 # Icon Index for empty slot
  84.   EMPTY_SLOT_TEXT = 'Empty' # Text to show for empty slot's data
  85.   
  86.   DRAW_GOLD = true # Draw Gold
  87.   DRAW_PLAYTIME = true # Draw Playtime
  88.   DRAW_LOCATION = true # Draw location
  89.   DRAW_FACE = true # Draw Actor's face
  90.   DRAW_LEVEL = true # Draw Actor's level
  91.   DRAW_NAME = true # Draw Actor's name
  92.   DRAW_TEXT_GOLD = true # Draw the vocab::Gold text to the right of the number
  93.   
  94.   PLAYTIME_TEXT = '游戏时间: '
  95.   GOLD_TEXT = '银两: '
  96.   LOCATION_TEXT = '位置: '
  97.   LV_TEXT = '等级. '
  98.   
  99.   MAP_NAME_TEXT_SUB = %w{}
  100.   # Text that you want to remove from map name,
  101.   # e.g. %w{[LN] [DA]} will remove text '[LN]' and '[DA]' from map name
  102.   MAP_NO_NAME_LIST = [2] # ID of Map that will not show map name, e.g. [1,2,3]
  103.   MAP_NO_NAME = '???' # What you will use to call the map in the no name list

  104.   # This is a switch that can activate or deactivate maps from being displayed as
  105.   # MAP_NO_NAME. If it is off then maps will return back to normal.
  106.   MAP_NO_NAME_SWITCH = 95 # This switch has to be on for MAP_NO_NAME_LIST to work
  107.   
  108.   MAP_BORDER = Color.new(0,0,0,200) # Map image border color (R,G,B,Opacity)
  109.   FACE_BORDER = Color.new(0,0,0,200) # Face border color
  110.   
  111.   # Save confirmation window
  112.   SFC_Text_Confirm = '确定保存' # Text to confirm to save file
  113.   SFC_Text_Cancel = '取消' # Text to cancel to save
  114.   SFC_Window_Width = 200 # Width of Confirmation Window
  115.   SFC_Window_X_Offset = 0 # Move Confirmation Window horizontally
  116.   SFC_Window_Y_Offset = 0 # Move Confirmation Window vertically
  117.   
  118.   #-------------------------------------------------------------------------
  119.   # END NEO SAVE SYSTEM - SETUP (Edit below at your own risk)
  120.   #=========================================================================
  121.   
  122.   #-------------------------------------------------------------
  123.   # Screenshot V2 by Andreas21 and Cybersam
  124.   #-------------------------------------------------------------
  125.   @screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
  126.   @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l p), 'l'
  127.   @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
  128.   module_function
  129.   def self.shot(file_name)
  130.     case IMAGE_FILETYPE
  131.     when '.bmp'; typid = 0
  132.     when '.jpg'; typid = 1
  133.     when '.png'; typid = 2
  134.     end
  135.     # Get Screenshot
  136.     filename = file_name + IMAGE_FILETYPE
  137.     @screen.call(0, 0, Graphics.width, Graphics.height, filename, self.handel,
  138.     typid)
  139.   end
  140.   def self.handel
  141.     game_name = "\0" * 256
  142.     @readini.call('Game','Title','',game_name,255,".\\Game.ini")
  143.     game_name.delete!("\0")
  144.     return @findwindow.call('RGSS Player',game_name)
  145.   end
  146.   
  147. end

  148. class Scene_File < Scene_Base
  149.   include Wora_NSS
  150.   attr_reader :window_slotdetail
  151.   #-------------------------------------------------------------------------
  152.   # * Start processing
  153.   #-------------------------------------------------------------------------
  154.   def start
  155.     super
  156.     create_menu_background
  157.     if NSS_IMAGE_BG != ''
  158.       @bg = Sprite.new
  159.       @bg.bitmap = Cache.picture(NSS_IMAGE_BG)
  160.       @bg.opacity = NSS_IMAGE_BG_OPACITY
  161.     end
  162.     @help_window = Window_Help.new
  163.     command = []
  164.     (1..MAX_SAVE_SLOT).each do |i|
  165.       command << SLOT_NAME.clone.gsub!(/\{ID\}/i) { i.to_s }
  166.     end
  167.     @window_slotdetail = Window_NSS_SlotDetail.new
  168.     @window_slotlist = Window_SlotList.new(160, command)
  169.     @window_slotlist.y = @help_window.height
  170.     @window_slotlist.height = Graphics.height - @help_window.height
  171.     if OPACITY_DEFAULT == false
  172.     @help_window.opacity = NSS_WINDOW_OPACITY
  173.     @window_slotdetail.opacity = @window_slotlist.opacity = NSS_WINDOW_OPACITY
  174.     end

  175.   # Create Folder for Save file
  176.   if SAVE_PATH != ''
  177.     Dir.mkdir(SAVE_PATH) if !FileTest.directory?(SAVE_PATH)
  178.   end
  179.     if @saving
  180.       @index = $game_temp.last_file_index
  181.       @help_window.set_text(Vocab::SaveMessage)
  182.     else
  183.       @index = self.latest_file_index
  184.       @help_window.set_text(Vocab::LoadMessage)
  185.       (1..MAX_SAVE_SLOT).each do |i|
  186.         @window_slotlist.draw_item(i-1, false) if !@window_slotdetail.file_exist?(i)
  187.      end
  188.     end
  189.     @window_slotlist.index = @index
  190.     # Draw Information
  191.     @last_slot_index = @window_slotlist.index
  192.     @window_slotdetail.draw_data(@last_slot_index + 1)
  193.   end
  194.   #--------------------------------------------------------------------------  
  195.   # * Termination Processing
  196.   #--------------------------------------------------------------------------
  197.   def terminate
  198.     super
  199.     dispose_menu_background
  200.     unless @bg.nil?
  201.       @bg.bitmap.dispose
  202.       @bg.dispose
  203.     end
  204.     @window_slotlist.dispose
  205.     @window_slotdetail.dispose
  206.     @help_window.dispose
  207.   end
  208.   #--------------------------------------------------------------------------
  209.   # * Frame Update
  210.   #--------------------------------------------------------------------------
  211.   def update
  212.     super
  213.     if !@confirm_window.nil?
  214.       @confirm_window.update
  215.       if Input.trigger?(Input::C)
  216.         if @confirm_window.index == 0
  217.           determine_savefile
  218.           @confirm_window.dispose
  219.           @confirm_window = nil
  220.         else
  221.           Sound.play_cancel
  222.           @confirm_window.dispose
  223.           @confirm_window = nil
  224.         end
  225.       elsif Input.trigger?(Input::B)
  226.       Sound.play_cancel
  227.       @confirm_window.dispose
  228.       @confirm_window = nil
  229.       end
  230.     else
  231.       update_menu_background
  232.       @window_slotlist.update
  233.       if @window_slotlist.index != @last_slot_index
  234.         @last_slot_index = @window_slotlist.index
  235.         @window_slotdetail.draw_data(@last_slot_index + 1)
  236.       end
  237.       @help_window.update
  238.       update_savefile_selection
  239.     end
  240.   end
  241.   #--------------------------------------------------------------------------
  242.   # * Update Save File Selection
  243.   #--------------------------------------------------------------------------
  244.   def update_savefile_selection
  245.     if Input.trigger?(Input::C)
  246.       if @saving and @window_slotdetail.file_exist?(@last_slot_index + 1)
  247.         Sound.play_decision
  248.         text1 = SFC_Text_Confirm
  249.         text2 = SFC_Text_Cancel
  250.         @confirm_window = Window_Command.new(SFC_Window_Width,[text1,text2])
  251.         @confirm_window.x = ((544 - @confirm_window.width) / 2) + SFC_Window_X_Offset
  252.         @confirm_window.y = ((416 - @confirm_window.height) / 2) + SFC_Window_Y_Offset
  253.       else
  254.         determine_savefile
  255.       end
  256.     elsif Input.trigger?(Input::B)
  257.       Sound.play_cancel
  258.       return_scene
  259.     end
  260.   end
  261.   
  262.   #--------------------------------------------------------------------------
  263.   # * Execute Save
  264.   #--------------------------------------------------------------------------
  265.   def do_save
  266.     if SCREENSHOT_IMAGE
  267.     File.rename(SAVE_PATH + 'temp' + IMAGE_FILETYPE,
  268.     make_filename(@last_slot_index).gsub(/\..*$/){ '_ss' } + IMAGE_FILETYPE)  
  269.     end  
  270.     file = File.open(make_filename(@last_slot_index), "wb")
  271.     write_save_data(file)
  272.     file.close   
  273.     if SCENE_CHANGE
  274.     $scene = Scene_Map.new
  275.     else
  276.     $scene = Scene_File.new(true, false, false)
  277.     end
  278.   end
  279.   #--------------------------------------------------------------------------
  280.   # * Execute Load
  281.   #--------------------------------------------------------------------------
  282.   def do_load
  283.     file = File.open(make_filename(@last_slot_index), "rb")
  284.     read_save_data(file)
  285.     file.close
  286.     $scene = Scene_Map.new
  287.     RPG::BGM.fade(1500)
  288.     Graphics.fadeout(60)
  289.     Graphics.wait(40)
  290.     @last_bgm.play
  291.     @last_bgs.play
  292.   end
  293.   #--------------------------------------------------------------------------
  294.   # * Confirm Save File
  295.   #--------------------------------------------------------------------------
  296.   def determine_savefile
  297.     if @saving
  298.       Sound.play_save
  299.       do_save
  300.     else
  301.       if @window_slotdetail.file_exist?(@last_slot_index + 1)
  302.         Sound.play_load
  303.         do_load
  304.       else
  305.         Sound.play_buzzer
  306.         return
  307.       end
  308.     end
  309.     $game_temp.last_file_index = @last_slot_index
  310.   end
  311.   #--------------------------------------------------------------------------
  312.   # * Create Filename
  313.   #     file_index : save file index (0-3)
  314.   #--------------------------------------------------------------------------
  315.   def make_filename(file_index)
  316.     return SAVE_PATH + SAVE_FILE_NAME.gsub(/\{ID\}/i) { (file_index + 1).to_s }
  317.   end
  318.   #--------------------------------------------------------------------------
  319.   # * Select File With Newest Timestamp
  320.   #--------------------------------------------------------------------------
  321.   def latest_file_index
  322.     latest_index = 0
  323.     latest_time = Time.at(0)
  324.     (1..MAX_SAVE_SLOT).each do |i|
  325.       file_name = make_filename(i - 1)
  326.       next if !@window_slotdetail.file_exist?(i)
  327.       file_time = File.mtime(file_name)
  328.       if file_time > latest_time
  329.         latest_time = file_time
  330.         latest_index = i - 1
  331.       end
  332.     end
  333.     return latest_index
  334.   end

  335. class Window_SlotList < Window_Command
  336.   #--------------------------------------------------------------------------
  337.   # * Draw Item
  338.   #--------------------------------------------------------------------------
  339.   def draw_item(index, enabled = true)
  340.     rect = item_rect(index)
  341.     rect.x += 4
  342.     rect.width -= 8
  343.     icon_index = 0
  344.     self.contents.clear_rect(rect)
  345.     if $scene.window_slotdetail.file_exist?(index + 1)
  346.       icon_index = Wora_NSS::SAVED_SLOT_ICON
  347.     else
  348.       icon_index = Wora_NSS::EMPTY_SLOT_ICON
  349.     end
  350.     if !icon_index.nil?
  351.       rect.x -= 4
  352.       draw_icon(icon_index, rect.x, rect.y, enabled) # Draw Icon
  353.       rect.x += 26
  354.       rect.width -= 20
  355.     end
  356.     self.contents.clear_rect(rect)
  357.     self.contents.font.color = normal_color
  358.     self.contents.font.color.alpha = enabled ? 255 : 128
  359.     self.contents.draw_text(rect, @commands[index])
  360.   end
  361.   
  362.   def cursor_down(wrap = false)
  363.     if @index < @item_max - 1 or wrap
  364.       @index = (@index + 1) % @item_max
  365.     end
  366.   end

  367.   def cursor_up(wrap = false)
  368.     if @index > 0 or wrap
  369.       @index = (@index - 1 + @item_max) % @item_max
  370.     end
  371.   end
  372. end

  373. class Window_NSS_SlotDetail < Window_Base
  374.   include Wora_NSS
  375.   def initialize

  376.     super(160, 56, 480, 424)
  377.     @data = []
  378.     @exist_list = []
  379.     @bitmap_list = {}
  380.     @map_name = []
  381.   end
  382.   
  383.   def dispose
  384.     dispose_tilemap
  385.     super
  386.   end

  387.   def draw_data(slot_id)
  388.     contents.clear # 352, 328
  389.     dispose_tilemap
  390.     load_save_data(slot_id) if @data[slot_id].nil?
  391.     if @exist_list[slot_id]
  392.       save_data = @data[slot_id]
  393.       # DRAW SCREENSHOT
  394.      contents.fill_rect(0,30,352,160, MAP_BORDER)
  395.      if SCREENSHOT_IMAGE
  396.       if save_data['ss']
  397.         bitmap = get_bitmap(save_data['ss_path'])
  398.         rect = Rect.new((Graphics.width-348)/2,(Graphics.height-156)/2,348,156)
  399.         contents.blt(2,32,bitmap,rect)
  400.       end
  401.      else
  402.       if SWAP_TILE and $game_switches[SWAP_TILE_SWITCH]
  403.       create_swaptilemap(save_data['gamemap'].data, save_data['gamemap'].display_x,
  404.       save_data['gamemap'].display_y)
  405.       else
  406.       create_tilemap(save_data['gamemap'].data, save_data['gamemap'].display_x,
  407.       save_data['gamemap'].display_y)
  408.       end
  409.      end
  410.       if DRAW_GOLD
  411.         # DRAW GOLD
  412.         gold_textsize = contents.text_size(save_data['gamepar'].gold).width
  413.         goldt_textsize = contents.text_size(GOLD_TEXT).width  
  414.         contents.font.color = system_color
  415.         contents.draw_text(0, 0, goldt_textsize, WLH, GOLD_TEXT)
  416.         contents.font.color = normal_color
  417.         contents.draw_text(goldt_textsize, 0, gold_textsize, WLH, save_data['gamepar'].gold)  
  418.        if DRAW_TEXT_GOLD == false
  419.         gold_textsize = 0
  420.         goldt_textsize = 0   
  421.        else
  422.         contents.draw_text(goldt_textsize + gold_textsize, 0, 200, WLH, Vocab::gold)
  423.        end
  424.       end
  425.       if DRAW_PLAYTIME
  426.         # DRAW PLAYTIME
  427.         hour = save_data['total_sec'] / 60 / 60
  428.         min = save_data['total_sec'] / 60 % 60
  429.         sec = save_data['total_sec'] % 60
  430.         time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  431.         pt_textsize = contents.text_size(PLAYTIME_TEXT).width
  432.         ts_textsize = contents.text_size(time_string).width
  433.         contents.font.color = system_color
  434.         contents.draw_text(contents.width - ts_textsize - pt_textsize, 0,
  435.         pt_textsize, WLH, PLAYTIME_TEXT)
  436.         contents.draw_text(goldt_textsize + gold_textsize,0,200,WLH, Vocab::gold)
  437.         contents.font.color = normal_color
  438.         contents.draw_text(0, 0, contents.width, WLH, time_string, 2)
  439.       end
  440.       if DRAW_LOCATION
  441.         # DRAW LOCATION
  442.         lc_textsize = contents.text_size(LOCATION_TEXT).width
  443.         mn_textsize = contents.text_size(save_data['map_name']).width
  444.         contents.font.color = system_color
  445.         contents.draw_text(0, 190, contents.width, WLH, LOCATION_TEXT)
  446.         contents.font.color = normal_color
  447.         contents.draw_text(lc_textsize, 190, contents.width, WLH, save_data['map_name'])
  448.       end
  449.         # DRAW FACE & Level & Name
  450.         save_data['gamepar'].members.each_index do |i|
  451.           actor = save_data['gameactor'][save_data['gamepar'].members[i].id]
  452.           face_x_base = (i*80) + (i*8)
  453.           face_y_base = 216
  454.           lvn_y_plus = 10
  455.           lv_textsize = contents.text_size(actor.level).width
  456.           lvt_textsize = contents.text_size(LV_TEXT).width
  457.         if DRAW_FACE
  458.           # Draw Face
  459.           contents.fill_rect(face_x_base, face_y_base, 84, 84, FACE_BORDER)
  460.           draw_face(actor.face_name, actor.face_index, face_x_base + 2,
  461.           face_y_base + 2, 80)
  462.         end
  463.         if DRAW_LEVEL
  464.           # Draw Level
  465.           contents.font.color = system_color
  466.           contents.draw_text(face_x_base + 2 + 80 - lv_textsize - lvt_textsize,
  467.           face_y_base + 2 + 80 - WLH + lvn_y_plus, lvt_textsize, WLH, LV_TEXT)
  468.           contents.font.color = normal_color
  469.           contents.draw_text(face_x_base + 2 + 80 - lv_textsize,
  470.           face_y_base + 2 + 80 - WLH + lvn_y_plus, lv_textsize, WLH, actor.level)
  471.         end
  472.         if DRAW_NAME
  473.           # Draw Name
  474.           contents.draw_text(face_x_base, face_y_base + 2 + 80 + lvn_y_plus - 6, 84,
  475.           WLH, actor.name, 1)
  476.         end
  477.       end
  478.     else
  479.       contents.draw_text(0,0, contents.width, contents.height - WLH, EMPTY_SLOT_TEXT, 1)
  480.    end
  481.   end
  482.   
  483.   def load_save_data(slot_id)
  484.     file_name = make_filename(slot_id)
  485.     if file_exist?(slot_id) or FileTest.exist?(file_name)
  486.       @exist_list[slot_id] = true
  487.       @data[slot_id] = {}
  488.       # Start load data
  489.       file = File.open(file_name, "r")
  490.       @data[slot_id]['time'] = file.mtime
  491.       @data[slot_id]['char'] = Marshal.load(file)
  492.       @data[slot_id]['frame'] = Marshal.load(file)
  493.       @data[slot_id]['last_bgm'] = Marshal.load(file)
  494.       @data[slot_id]['last_bgs'] = Marshal.load(file)
  495.       @data[slot_id]['gamesys'] = Marshal.load(file)
  496.       @data[slot_id]['gamemes'] = Marshal.load(file)
  497.       @data[slot_id]['gameswi'] = Marshal.load(file)
  498.       @data[slot_id]['gamevar'] = Marshal.load(file)
  499.       @data[slot_id]['gameselfvar'] = Marshal.load(file)
  500.       @data[slot_id]['gameactor'] = Marshal.load(file)
  501.       @data[slot_id]['gamepar'] = Marshal.load(file)
  502.       @data[slot_id]['gametro'] = Marshal.load(file)
  503.       @data[slot_id]['gamemap'] = Marshal.load(file)
  504.       @data[slot_id]['total_sec'] = @data[slot_id]['frame'] / Graphics.frame_rate
  505.       if SCREENSHOT_IMAGE
  506.       @data[slot_id]['ss_path'] = file_name.gsub(/\..*$/){'_ss'} + IMAGE_FILETYPE
  507.       @data[slot_id]['ss'] = FileTest.exist?(@data[slot_id]['ss_path'])
  508.       end
  509.       @data[slot_id]['map_name'] = get_mapname(@data[slot_id]['gamemap'].map_id)
  510.       file.close
  511.     else
  512.       @exist_list[slot_id] = false
  513.       @data[slot_id] = -1
  514.     end
  515.   end

  516.   def make_filename(file_index)
  517.     return SAVE_PATH + SAVE_FILE_NAME.gsub(/\{ID\}/i) { (file_index).to_s }
  518.   end
  519.   
  520.   def file_exist?(slot_id)
  521.     return @exist_list[slot_id] if !@exist_list[slot_id].nil?
  522.     @exist_list[slot_id] = FileTest.exist?(make_filename(slot_id))
  523.     return @exist_list[slot_id]
  524.   end
  525.   
  526.   def get_bitmap(path)
  527.     if !@bitmap_list.include?(path)
  528.       @bitmap_list[path] = Bitmap.new(path)
  529.     end
  530.   return @bitmap_list[path]
  531.   end
  532.   
  533. def get_mapname(map_id)
  534.     if @map_data.nil?
  535.       @map_data = load_data("Data/MapInfos.rvdata")
  536.     end
  537.    if @map_name[map_id].nil?
  538.      if MAP_NO_NAME_LIST.include?(map_id) and $game_switches[MAP_NO_NAME_SWITCH]
  539.        @map_name[map_id] = MAP_NO_NAME
  540.      else
  541.        @map_name[map_id] = @map_data[map_id].name
  542.      end  
  543.        MAP_NAME_TEXT_SUB.each_index do |i|
  544.        @map_name[map_id].sub!(MAP_NAME_TEXT_SUB[i], '')
  545.        @mapname = @map_name[map_id]
  546.      end
  547.    end
  548.     return @map_name[map_id]
  549. end  
  550.   
  551.   def create_tilemap(map_data, ox, oy)
  552.     @viewport = Viewport.new(self.x + 2 + 16, self.y + 32 + 16, 348,156)
  553.     @viewport.z = self.z
  554.     @tilemap = Tilemap.new(@viewport)
  555.     @tilemap.bitmaps[0] = Cache.system("TileA1")
  556.     @tilemap.bitmaps[1] = Cache.system("TileA2")
  557.     @tilemap.bitmaps[2] = Cache.system("TileA3")
  558.     @tilemap.bitmaps[3] = Cache.system("TileA4")
  559.     @tilemap.bitmaps[4] = Cache.system("TileA5")
  560.     @tilemap.bitmaps[5] = Cache.system("TileB")
  561.     @tilemap.bitmaps[6] = Cache.system("TileC")
  562.     @tilemap.bitmaps[7] = Cache.system("TileD")
  563.     @tilemap.bitmaps[8] = Cache.system("TileE")
  564.     @tilemap.map_data = map_data
  565.     @tilemap.ox = ox / 8 + 99
  566.     @tilemap.oy = oy / 8 + 90
  567.   end
  568.   
  569.     def create_swaptilemap(map_data, ox, oy)
  570.     @viewport = Viewport.new(self.x + 2 + 16, self.y + 32 + 16, 348,156)
  571.     @viewport.z = self.z
  572.     @tilemap = Tilemap.new(@viewport)
  573.    
  574.     tile1 = Cache_Swap_Tiles.swap($tileA1 + ".png") rescue nil
  575.     tile2 = Cache_Swap_Tiles.swap($tileA2 + ".png") rescue nil
  576.     tile3 = Cache_Swap_Tiles.swap($tileA3 + ".png") rescue nil
  577.     tile4 = Cache_Swap_Tiles.swap($tileA4 + ".png") rescue nil
  578.     tile5 = Cache_Swap_Tiles.swap($tileA5 + ".png") rescue nil
  579.     tile6 = Cache_Swap_Tiles.swap($tileB + ".png") rescue nil
  580.     tile7 = Cache_Swap_Tiles.swap($tileC + ".png") rescue nil
  581.     tile8 = Cache_Swap_Tiles.swap($tileD + ".png") rescue nil
  582.     tile9 = Cache_Swap_Tiles.swap($tileE + ".png") rescue nil
  583.    
  584. if $tileA1 != nil
  585. @tilemap.bitmaps[0] = tile1
  586. else
  587. @tilemap.bitmaps[0] = Cache.system("TileA1")
  588. end

  589. if $tileA2 != nil
  590. @tilemap.bitmaps[1] = tile2
  591. else
  592. @tilemap.bitmaps[1] = Cache.system("TileA2")
  593. end

  594. if $tileA3 != nil
  595. @tilemap.bitmaps[2] = tile3  
  596. else
  597. @tilemap.bitmaps[2] = Cache.system("TileA3")
  598. end  

  599. if $tileA4 != nil
  600. @tilemap.bitmaps[3] = tile4
  601. else
  602. @tilemap.bitmaps[3] = Cache.system("TileA4")
  603. end

  604. if $tileA5 != nil
  605. @tilemap.bitmaps[4] = tile5  
  606. else
  607. @tilemap.bitmaps[4] = Cache.system("TileA5")
  608. end

  609. if $tileB != nil
  610. @tilemap.bitmaps[5] = tile6
  611. else
  612. @tilemap.bitmaps[5] = Cache.system("TileB")  
  613. end  

  614. if $tileC != nil
  615. @tilemap.bitmaps[6] = tile7
  616. else
  617. @tilemap.bitmaps[6] = Cache.system("TileC")
  618. end  

  619. if $tileD != nil
  620. @tilemap.bitmaps[7] = tile8
  621. else
  622. @tilemap.bitmaps[7] = Cache.system("TileD")  
  623. end

  624. if $tileE != nil
  625. @tilemap.bitmaps[8] = tile9
  626. else
  627. @tilemap.bitmaps[8] = Cache.system("TileE")  
  628. end
  629.   
  630.     @tilemap.map_data = map_data
  631.     @tilemap.ox = ox / 8 + 99
  632.     @tilemap.oy = oy / 8 + 90
  633. end
  634.   
  635.   def dispose_tilemap
  636.     unless @tilemap.nil?
  637.       @tilemap.dispose
  638.       @tilemap = nil
  639.     end
  640.   end
  641. end
  642. end

  643. class Scene_Title < Scene_Base
  644.   def check_continue
  645.     file_name = Wora_NSS::SAVE_PATH + Wora_NSS::SAVE_FILE_NAME.gsub(/\{ID\}/i) { '*' }
  646.     @continue_enabled = (Dir.glob(file_name).size > 0)
  647.   end
  648. end

  649. class Scene_Map < Scene_Base
  650.   alias wora_nss_scemap_ter terminate
  651.   def terminate
  652.     Wora_NSS.shot(Wora_NSS::SAVE_PATH + 'temp')
  653.     wora_nss_scemap_ter
  654.   end
  655. end
  656. #======================================================================
  657. # END - NEO SAVE SYSTEM by Woratana
  658. #======================================================================
复制代码

作者: fux2    时间: 2010-12-24 07:33
回复 莹的赎生 的帖子

插入以下脚本
  1. # 存档容量扩大 by fux2


  2. class Window_SaveFile < Window_Base
  3.   
  4.   def initialize(file_index, filename)
  5.     super(0, 56 + file_index % 10 * 90, 544, 90)
  6.     @file_index = file_index
  7.     @filename = filename
  8.     load_gamedata
  9.     refresh
  10.     @selected = false
  11.   end

  12.   def file_index=(i)
  13.     @file_index = i
  14.   end
  15.    
  16. end

  17. class Scene_File < Scene_Base

  18.   def create_savefile_windows
  19.     @savefile_windows = []
  20.     for i in 0..9
  21.       @savefile_windows.push(Window_SaveFile.new(i, make_filename(i)))
  22.     end
  23.     @item_max = 10
  24.   end

  25.   def cursor_down(wrap)
  26.     if @index < @item_max - 1 or wrap
  27.       @index = (@index + 1 + @item_max) % @item_max
  28.     end
  29.     for i in 0..9
  30.       @savefile_windows[i].y = (i - @index) * 90 + 56
  31.       if @savefile_windows[i].y < 56
  32.         @savefile_windows[i].opacity = 0
  33.         @savefile_windows[i].contents.clear
  34.       else
  35.         @savefile_windows[i].opacity = 255
  36.         @savefile_windows[i].refresh
  37.       end
  38.     end
  39.   end
  40.   
  41.   def cursor_up(wrap)
  42.     if @index > 0 or wrap
  43.       @index = (@index - 1 + @item_max) % @item_max
  44.     end
  45.     for i in 0..9
  46.       @savefile_windows[i].y = (i - @index) * 90 + 56
  47.       if @savefile_windows[i].y < 56
  48.         @savefile_windows[i].opacity = 0
  49.         @savefile_windows[i].contents.clear
  50.       else
  51.         @savefile_windows[i].opacity = 255
  52.         @savefile_windows[i].refresh
  53.       end
  54.     end
  55.   end
  56.   
  57. end
复制代码





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