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

Project1

 找回密码
 注册会员
搜索
查看: 39154|回复: 59

[RMVA发布] [PS0]截图存档 v20120216【VX新截图存档移植增强版】

  [复制链接]

Lv2.观梦者

(?????)

梦石
0
星屑
695
在线时间
1327 小时
注册时间
2011-7-18
帖子
3184

贵宾

发表于 2011-12-26 19:04:47 | 显示全部楼层 |阅读模式

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

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

x
本帖最后由 各种压力的猫君 于 2012-2-18 23:02 编辑

移植自 VX新截图存档 By 沉影不器
说是移植……实际上因为RGSS3默认脚本变化太大基本上是重写了……
和沉影大从XP移植到VX时的情况差不多但是RGSS3变化更大 OTL
RUBY 代码复制
  1. #==============================================================================
  2. # [PS0]截图存档
  3. #      Window_SaveFile_Plus
  4. #------------------------------------------------------------------------------
  5. #     一种带有截图的存档,同时可以自定义存档数量。
  6. #==============================================================================
  7. # [核心脚本]
  8. #    - 快速储存Bitmap的Marshal         By 柳之一
  9. #------------------------------------------------------------------------------
  10. # [更新记录]
  11. #    - 2012.02.16 By 各种压力的猫君
  12. #      * 修正地图边缘时截图不完整的错误
  13. #    - 2012.01.28 By 各种压力的猫君
  14. #      * 去掉效率较差的双线性缩放算法;
  15. #      * 新增存档管理功能(F5键,复制/移动/删除存档)
  16. #    - 2011.12.27 By 各种压力的猫君
  17. #      * 补上截图阴影;
  18. #      * 新增“不缩放”截图(推荐使用,尤其是大分辨率);
  19. #      * 修正选择不存在的存档时存档列表窗口卡死以及奇怪的SE;
  20. #      * 新增“存档中”提示窗口、覆盖存档提示、删除存档功能(Z键,对应键盘D)
  21. #    - 2011.12.26 By 各种压力的猫君
  22. #      * 功能齐全的测试版
  23. #    - 2011.12.16 By 各种压力的猫君
  24. #      * 移植至RGSS3,遵循PS0协议;
  25. #      * 丰富自定义选项,整合双线性插值算法精简版
  26. #    - 2008.05.26 By 沉影不器
  27. #      * 蓝本(VX新截图存档)
  28. #------------------------------------------------------------------------------
  29. # [使用方法]
  30. #    - 删除原Scene_File、Window_SaveFile 并将本脚本插入到原Scene_File位置。
  31. #    - 或者直接将本脚本插入到MAIN以上,并确保本脚本位于上述两个脚本以下。
  32. #==============================================================================
  33. $_PS0 = {} if $_PS0 == nil  
  34. $_PS0["Window_SaveFile_Plus"] = 20120216
  35. #==============================================================================
  36. # [PS0] 通用配置模块  
  37. #==============================================================================
  38. module PS0
  39.   module Window_SaveFile_Plus
  40.  
  41.     # 最大存档数(范围正整数)
  42.     MAX_SAVE = 18
  43.  
  44.     # 存档目录(默认值 "Saves/";根目录 "")
  45.     SAVE_DIR = "Saves/"   
  46.  
  47.     # 无存档时显示的文字
  48.     NO_DATA  = "无存档"
  49.  
  50.     # 保存时显示的信息
  51.     SAVE_NOW = "存档中..."
  52.  
  53.     # 复制存档时的帮助文字
  54.     HELP_COPY = "要复制到哪个位置?"
  55.  
  56.     # 移动存档时的帮助文字
  57.     HELP_MOVE = "要移动到哪个位置?"
  58.  
  59.     # 是否显示存档中窗口(true:显示;false:不显示)
  60.     # - 分辨率较大时建议显示
  61.     SHOW_SAVE_NOW = false
  62.  
  63.     # 截图缩放使用的插值算法
  64.     # - "NN" 最邻近(速度最快,质量最差,RM默认算法)
  65.     # - "NZ" 不缩放(速度快,质量好,以主角为中心切边,非全屏)
  66.     Zoom_Type = "NZ"
  67.  
  68.     # 双线性插值能获得更好的截图缩放质量,但所需时间较最邻近插值更长。
  69.     # 缩略图尺寸(范围整数,单位像素)
  70.     # - VA默认分辨率(544×416)推荐使用340×260
  71.     # - VA最大分辨率(640×480)推荐使用425×325
  72.     # - 本脚本兼容分辨率解放,窗口大小将自动计算。
  73.     #   请自行计算截图分辨率,注意要确保宽高比一致,
  74.     #   若使用“不缩放”模式则可以不保持一致。
  75.     Thumbnail_Width  = 340  # 宽度
  76.     Thumbnail_Height = 260  # 高度
  77.  
  78.     # 缩略图位置微调(范围整数,单位像素)
  79.     Thumbnail_ox = -2    # 横向
  80.     Thumbnail_oy = -2-32 # 纵向
  81.  
  82.     # 各窗口切换时的渐变帧数
  83.     TRANS_DURATION = 5
  84.  
  85.   end
  86. end
  87. #==============================================================================
  88. # [核心脚本] 快速储存Bitmap的Marshal By 柳之一
  89. #==============================================================================
  90. class Font
  91.   def marshal_dump
  92.   end
  93.   def marshal_load(obj)
  94.   end
  95. end
  96. class Bitmap
  97.   RtlMoveMemory_pi = Win32API.new('kernel32', 'RtlMoveMemory', 'pii', 'i')
  98.   RtlMoveMemory_ip = Win32API.new('kernel32', 'RtlMoveMemory', 'ipi', 'i')
  99.   def _dump(limit)
  100.     data = "rgba" * width * height
  101.     RtlMoveMemory_pi.call(data, address, data.length)
  102.     [width, height, Zlib::Deflate.deflate(data)].pack("LLa*")
  103.   end
  104.   def self._load(str)
  105.     w, h, zdata = str.unpack("LLa*")
  106.     b = self.new(w, h)
  107.     RtlMoveMemory_ip.call(b.address, Zlib::Inflate.inflate(zdata), w * h * 4)
  108.     return b
  109.   end
  110.   def address
  111.     buffer, ad = "rgba", object_id * 2 + 16
  112.     RtlMoveMemory_pi.call(buffer, ad, 4)
  113.     ad = buffer.unpack("L")[0] + 8
  114.     RtlMoveMemory_pi.call(buffer, ad, 4)
  115.     ad = buffer.unpack("L")[0] + 16
  116.     RtlMoveMemory_pi.call(buffer, ad, 4)
  117.     return buffer.unpack("L")[0]
  118.   end
  119. end
  120. #==============================================================================
  121. # ■ Game_Temp
  122. #==============================================================================
  123. class Game_Temp
  124.   attr_accessor :save_bitmap
  125.   attr_accessor :save_snapshoot
  126.   alias new_initialize initialize
  127.   def initialize
  128.     new_initialize
  129.     @save_bitmap = Bitmap.new(1, 1)
  130.     @save_snapshoot = Bitmap.new(1, 1)
  131.   end
  132. end
  133. #==============================================================================
  134. # ■ SceneManager
  135. #==============================================================================
  136. module SceneManager
  137.   def self.snapshot_for_save
  138.     $game_temp.save_bitmap = Graphics.snap_to_bitmap
  139.     unless FileTest.exist?(PS0::Window_SaveFile_Plus::SAVE_DIR)
  140.       Dir.mkdir(PS0::Window_SaveFile_Plus::SAVE_DIR)
  141.     end
  142.   end
  143. end
  144. #==============================================================================
  145. # ■ Scene_Map
  146. #==============================================================================
  147. class Scene_Map < Scene_Base
  148.   alias save_terminate terminate
  149.   def terminate
  150.     SceneManager.snapshot_for_save
  151.     save_terminate
  152.   end
  153. end
  154. #==============================================================================
  155. # ■ DataManager
  156. #==============================================================================
  157. module DataManager
  158.   def self.save_file_exists?
  159.     !Dir.glob(PS0::Window_SaveFile_Plus::SAVE_DIR + 'Save*.rvdata2').empty?
  160.   end
  161.   def self.make_filename(index)
  162.     sprintf(PS0::Window_SaveFile_Plus::SAVE_DIR + "Save%02d.rvdata2", index + 1)
  163.   end
  164.   #--------------------------------------------------------------------------
  165.   # ● セーブヘッダの作成
  166.   #--------------------------------------------------------------------------
  167.   def self.make_save_header
  168.     d_rect = Rect.new(0, 0, PS0::Window_SaveFile_Plus::Thumbnail_Width,
  169.                             PS0::Window_SaveFile_Plus::Thumbnail_Height)
  170.     case PS0::Window_SaveFile_Plus::Zoom_Type
  171.     when "NN"
  172.       s_rect = $game_temp.save_bitmap.rect
  173.       $game_temp.save_snapshoot = Bitmap.new(d_rect.width, d_rect.height)
  174.       $game_temp.save_snapshoot.stretch_blt(d_rect, $game_temp.save_bitmap, s_rect)
  175.     when "NZ"
  176.       x = [$game_player.screen_x - d_rect.width/2, 0].max
  177.       x = [x, Graphics.width - d_rect.width].min
  178.       y = [$game_player.screen_y - d_rect.height/2, 0].max
  179.       y = [y, Graphics.height - d_rect.height].min
  180.       s_rect = Rect.new(x, y, d_rect.width, d_rect.height)
  181.       $game_temp.save_snapshoot = Bitmap.new(d_rect.width, d_rect.height)
  182.       $game_temp.save_snapshoot.blt(0, 0, $game_temp.save_bitmap, s_rect)
  183.     end
  184.     header = {}
  185.     header[:characters] = $game_party.characters_for_savefile
  186.     header[:playtime_s] = $game_system.playtime_s
  187.     header[:snapshoot]  = $game_temp.save_snapshoot
  188.     header
  189.   end
  190.   #--------------------------------------------------------------------------
  191.   # ● セーブの実行
  192.   #--------------------------------------------------------------------------
  193.   def self.save_game(index)
  194.     saving_window = Window_Saving.new
  195.     Graphics.update
  196.     begin
  197.       save_game_without_rescue(index)
  198.     rescue
  199.        delete_save_file(index)
  200.        false
  201.     end
  202.     saving_window.dispose
  203.     return true
  204.   end
  205. end
  206. #==============================================================================
  207. # ■ Window_Yes_Or_No
  208. #------------------------------------------------------------------------------
  209. #  提供“是”、“否”两个选项的窗口(替换、删除存档用)
  210. #==============================================================================
  211. class Window_Yes_Or_No < Window_HorzCommand
  212.   #--------------------------------------------------------------------------
  213.   # ● オブジェクト初期化
  214.   #--------------------------------------------------------------------------
  215.   def initialize(yes, no)
  216.     @yes = yes
  217.     @no = no
  218.     super(130, 0)
  219.     self.visible = false
  220.     self.active = false
  221.     @index = 0
  222.   end
  223.   #--------------------------------------------------------------------------
  224.   # ● 桁数の取得
  225.   #--------------------------------------------------------------------------
  226.   def col_max
  227.     return 2
  228.   end
  229.   #--------------------------------------------------------------------------
  230.   # ● コマンドリストの作成
  231.   #--------------------------------------------------------------------------
  232.   def make_command_list
  233.     add_command(@yes,   :yes)
  234.     add_command(@no,    :cancel)
  235.   end
  236.   #--------------------------------------------------------------------------
  237.   # ● 決定ボタンが押されたときの処理
  238.   #--------------------------------------------------------------------------
  239.   def process_ok
  240.     Input.update
  241.     call_ok_handler
  242.   end
  243.   #--------------------------------------------------------------------------
  244.   # ● 按下取消键时的处理
  245.   #--------------------------------------------------------------------------
  246.   def process_cancel
  247.     Input.update
  248.     call_cancel_handler
  249.   end
  250.   #--------------------------------------------------------------------------
  251.   # ● 启用窗口
  252.   #--------------------------------------------------------------------------
  253.   def activate
  254.     temp = self.y + self.height - Graphics.height
  255.     if temp > 0
  256.       self.y -= (temp + 12)
  257.     end
  258.     self.active = true
  259.     self
  260.   end
  261. end
  262. #==============================================================================
  263. # ■ Window_Saving
  264. #------------------------------------------------------------------------------
  265. #  显示保存信息的窗口
  266. #==============================================================================
  267. class Window_Saving < Window_Base
  268.   #--------------------------------------------------------------------------
  269.   # ● オブジェクト初期化
  270.   #--------------------------------------------------------------------------
  271.   def initialize
  272.     w = PS0::Window_SaveFile_Plus::SAVE_NOW.length * 16 + 32
  273.     x = (Graphics.width - w)/2
  274.     y = (Graphics.height - fitting_height(1))/2
  275.     super(x, y, w, fitting_height(1))
  276.     self.visible = PS0::Window_SaveFile_Plus::SHOW_SAVE_NOW
  277.     draw_text_ex(4, 0, PS0::Window_SaveFile_Plus::SAVE_NOW)
  278.   end
  279. end
  280. #==============================================================================
  281. # ■ Window_SaveManagerCommand
  282. #------------------------------------------------------------------------------
  283. #  存档管理窗口
  284. #==============================================================================
  285. class Window_SaveManagerCommand < Window_Command
  286.   #--------------------------------------------------------------------------
  287.   # ● 初始化对象
  288.   #--------------------------------------------------------------------------
  289.   def initialize(*args)
  290.     @copy, @move, @delete, @cancel = args[0..3]
  291.     super(130, 0)
  292.     self.visible = false
  293.     self.active = false
  294.     @index = 0
  295.   end
  296.   #--------------------------------------------------------------------------
  297.   # ● 获取窗口的宽度
  298.   #--------------------------------------------------------------------------
  299.   def window_width
  300.     return 100
  301.   end
  302.   #--------------------------------------------------------------------------
  303.   # ● 获取项目数
  304.   #--------------------------------------------------------------------------
  305.   def item_max
  306.     return 4
  307.   end
  308.   #--------------------------------------------------------------------------
  309.   # ● 生成指令列表
  310.   #--------------------------------------------------------------------------
  311.   def make_command_list
  312.     add_command(@copy,   :copy  )
  313.     add_command(@move,   :move  )
  314.     add_command(@delete, :delete)
  315.     add_command(@cancel, :cancel)
  316.   end
  317.   #--------------------------------------------------------------------------
  318.   # ● 按下确定键时的处理
  319.   #--------------------------------------------------------------------------
  320.   def process_ok
  321.     Input.update
  322.     call_ok_handler
  323.   end
  324.   #--------------------------------------------------------------------------
  325.   # ● 启用窗口
  326.   #--------------------------------------------------------------------------
  327.   def activate
  328.     temp = self.y + self.height - Graphics.height
  329.     if temp > 0
  330.       self.y -= (temp + 12)
  331.     end
  332.     self.active = true
  333.     self
  334.   end
  335. end
  336. #==============================================================================
  337. # ■ Window_FileCommand
  338. #------------------------------------------------------------------------------
  339. #  截图存档左侧的选择窗口。
  340. #==============================================================================
  341. class Window_FileCommand < Window_Command
  342.   #--------------------------------------------------------------------------
  343.   # ● オブジェクト初期化
  344.   #--------------------------------------------------------------------------
  345.   def initialize
  346.     super(0, 0)
  347.   end
  348.   #--------------------------------------------------------------------------
  349.   # ● ウィンドウ幅の取得
  350.   #--------------------------------------------------------------------------
  351.   def window_height
  352.     return Graphics.height-fitting_height(1)
  353.   end
  354.   #--------------------------------------------------------------------------
  355.   # ● 表示行数の取得
  356.   #--------------------------------------------------------------------------
  357.   def visible_line_number
  358.     item_max
  359.   end
  360.   #--------------------------------------------------------------------------
  361.   # ● コマンドリストの作成
  362.   #--------------------------------------------------------------------------
  363.   def make_command_list
  364.     add_main_commands
  365.   end
  366.   #--------------------------------------------------------------------------
  367.   # ● 主要コマンドをリストに追加
  368.   #--------------------------------------------------------------------------
  369.   def add_main_commands
  370.     for i in 1..PS0::Window_SaveFile_Plus::MAX_SAVE
  371.       if i < 10
  372.         text = Vocab::File + " 0" + i.to_s
  373.       else
  374.         text = Vocab::File + " " + i.to_s
  375.       end
  376.       add_command(text, :file)
  377.     end
  378.   end
  379.   #--------------------------------------------------------------------------
  380.   # ● 決定ボタンが押されたときの処理
  381.   #--------------------------------------------------------------------------
  382.   def process_ok
  383.   end
  384. end
  385. #==============================================================================
  386. # ■ Window_SaveFile
  387. #------------------------------------------------------------------------------
  388. #  セーブ画面およびロード画面で表示する、セーブファイルのウィンドウです。
  389. #==============================================================================
  390. class Window_SaveFile < Window_Base
  391.   #--------------------------------------------------------------------------
  392.   # ● オブジェクト初期化
  393.   #     index : セーブファイルのインデックス
  394.   #--------------------------------------------------------------------------
  395.   def initialize(index)
  396.     super(160, 0, Graphics.width-160, Graphics.height-fitting_height(1))
  397.     @file_index = index
  398.     @selected = true
  399.     refresh
  400.   end
  401.   #--------------------------------------------------------------------------
  402.   # ● リフレッシュ
  403.   #--------------------------------------------------------------------------
  404.   def refresh
  405.     contents.clear
  406.     change_color(normal_color)
  407.     w = (self.width-PS0::Window_SaveFile_Plus::Thumbnail_Width-16)/2
  408.     h = (self.height-PS0::Window_SaveFile_Plus::Thumbnail_Height-16)/2
  409.     width  = w + PS0::Window_SaveFile_Plus::Thumbnail_ox
  410.     height = h + PS0::Window_SaveFile_Plus::Thumbnail_oy
  411.     draw_shadow(width+5, height+5)
  412.     draw_text((self.width-32-PS0::Window_SaveFile_Plus::NO_DATA.length*16)/2,
  413.               self.height/2-32, PS0::Window_SaveFile_Plus::NO_DATA.length*32,
  414.               line_height, PS0::Window_SaveFile_Plus::NO_DATA)
  415.     draw_party_characters(32, Graphics.height-fitting_height(1)-32)
  416.     draw_playtime(-10, contents.height - line_height-10, contents.width - 4, 2)
  417.     draw_snapshoot(width, height)
  418.   end
  419.   #--------------------------------------------------------------------------
  420.   # ● パーティキャラの描画
  421.   #--------------------------------------------------------------------------
  422.   def draw_party_characters(x, y)
  423.     header = DataManager.load_header(@file_index)
  424.     return unless header
  425.     header[:characters].each_with_index do |data, i|
  426.       draw_character(data[0], data[1], x + i * 48, y)
  427.     end
  428.   end
  429.   #--------------------------------------------------------------------------
  430.   # ● プレイ時間の描画
  431.   #--------------------------------------------------------------------------
  432.   def draw_playtime(x, y, width, align)
  433.     header = DataManager.load_header(@file_index)
  434.     return unless header
  435.     draw_text(x, y, width, line_height, header[:playtime_s], 2)
  436.   end
  437.   #--------------------------------------------------------------------------
  438.   # ● 绘制截图
  439.   #--------------------------------------------------------------------------
  440.   def draw_snapshoot(x, y)
  441.     header = DataManager.load_header(@file_index)
  442.     return unless header
  443.     bitmap = header[:snapshoot]
  444.     contents.blt(x, y, bitmap, bitmap.rect)
  445.     bitmap.dispose
  446.   end
  447.   #--------------------------------------------------------------------------
  448.   # ● 绘制阴影
  449.   #--------------------------------------------------------------------------
  450.   def draw_shadow(x, y)
  451.     header = DataManager.load_header(@file_index)
  452.     return unless header
  453.     contents.fill_rect(x, y, PS0::Window_SaveFile_Plus::Thumbnail_Width,
  454.                              PS0::Window_SaveFile_Plus::Thumbnail_Height, Color.new(0, 0, 0))
  455.     contents.blur
  456.   end
  457. end
  458. #==============================================================================
  459. # ■ Scene_File
  460. #------------------------------------------------------------------------------
  461. #  セーブ画面とロード画面の共通処理を行うクラスです。
  462. #==============================================================================
  463. class Scene_File < Scene_MenuBase
  464.   #--------------------------------------------------------------------------
  465.   # ● 開始処理
  466.   #--------------------------------------------------------------------------
  467.   def start
  468.     super
  469.     create_help_window
  470.     create_savefile_viewport
  471.     create_command_window
  472.     create_savefile_window
  473.     create_manager_window
  474.     create_replace_window
  475.     create_delete_window
  476.   end
  477.   #--------------------------------------------------------------------------
  478.   # ● 終了処理
  479.   #--------------------------------------------------------------------------
  480.   def terminate
  481.     super
  482.     @savefile_viewport.dispose
  483.     @savefile_window.dispose
  484.     @command_window.dispose
  485.     @window_manager.dispose
  486.     @window_replace.dispose
  487.     @window_delete.dispose
  488.   end
  489.   #--------------------------------------------------------------------------
  490.   # ● フレーム更新
  491.   #--------------------------------------------------------------------------
  492.   def update
  493.     super
  494.     update_savefile_selection
  495.   end
  496.   #--------------------------------------------------------------------------
  497.   # ● 创建替换窗口
  498.   #--------------------------------------------------------------------------
  499.   def create_replace_window
  500.     @window_replace = Window_Yes_Or_No.new("替换", "取消")
  501.     @window_replace.set_handler(:yes,    method(:do_replace))
  502.     @window_replace.set_handler(:cancel, method(:do_cancel))
  503.   end
  504.   #--------------------------------------------------------------------------
  505.   # ● 创建删除窗口
  506.   #--------------------------------------------------------------------------
  507.   def create_delete_window
  508.     @window_delete  = Window_Yes_Or_No.new("删除", "取消")
  509.     @window_delete.set_handler(:yes,    method(:do_delete))
  510.     @window_delete.set_handler(:cancel, method(:do_return_manager))
  511.     @window_delete.x += 40
  512.   end
  513.   #--------------------------------------------------------------------------
  514.   # ● 创建管理窗口
  515.   #--------------------------------------------------------------------------
  516.   def create_manager_window
  517.     @window_manager = Window_SaveManagerCommand.new("复制", "移动", "删除", "取消")
  518.     @window_manager.set_handler(:copy  , method(:on_copy?))
  519.     @window_manager.set_handler(:move  , method(:on_move?))
  520.     @window_manager.set_handler(:delete, method(:on_delete?))
  521.     @window_manager.set_handler(:cancel, method(:do_cancel))
  522.   end
  523.   #--------------------------------------------------------------------------
  524.   # ● ヘルプウィンドウの作成
  525.   #--------------------------------------------------------------------------
  526.   def create_help_window
  527.     @help_window = Window_Help.new(1)
  528.     @help_window.set_text(help_window_text)
  529.   end
  530.   #--------------------------------------------------------------------------
  531.   # ● ヘルプウィンドウのテキストを取得
  532.   #--------------------------------------------------------------------------
  533.   def help_window_text
  534.     return ""
  535.   end
  536.   #--------------------------------------------------------------------------
  537.   # ● セーブファイルビューポートの作成
  538.   #--------------------------------------------------------------------------
  539.   def create_savefile_viewport
  540.     @savefile_viewport = Viewport.new
  541.     @savefile_viewport.rect.y = @help_window.height
  542.     @savefile_viewport.rect.height -= @help_window.height
  543.   end
  544.   #--------------------------------------------------------------------------
  545.   # ● セーブファイルウィンドウの作成
  546.   #--------------------------------------------------------------------------
  547.   def create_savefile_window
  548.     @savefile_window = Window_SaveFile.new(@index)
  549.     @savefile_window.viewport = @savefile_viewport
  550.   end
  551.   #--------------------------------------------------------------------------
  552.   # ● 生成存档列表窗口
  553.   #--------------------------------------------------------------------------
  554.   def create_command_window
  555.     @command_window = Window_FileCommand.new
  556.     @command_window.index = first_savefile_index
  557.     @index = @command_window.index
  558.     @command_window.viewport = @savefile_viewport
  559.     @command_window.set_handler(:file,      method(:on_savefile_ok))
  560.   end
  561.   #--------------------------------------------------------------------------
  562.   # ● セーブファイル選択の更新
  563.   #--------------------------------------------------------------------------
  564.   def update_savefile_selection
  565.     if @source_index != nil
  566.       if Input.trigger?(:C)
  567.         if @index == @source_index
  568.           Sound.play_buzzer
  569.         elsif FileTest.exist?(DataManager.make_filename(@index))
  570.           Graphics.freeze
  571.           @command_window.deactivate
  572.           @window_replace.y = 72 + @index * 24
  573.           @window_replace.activate
  574.           @window_replace.visible = true
  575.           @window_replace.refresh
  576.           Sound.play_ok
  577.           Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  578.         else
  579.           return on_copy_ok
  580.         end
  581.       elsif Input.trigger?(:B)
  582.         return do_return_manager
  583.       end
  584.     else
  585.       if Input.trigger?(:C)
  586.         if self.is_a?(Scene_Save) and FileTest.exist?(DataManager.make_filename(@index))
  587.           Graphics.freeze
  588.           @command_window.deactivate
  589.           @window_replace.y = 72 + @index * 24
  590.           @window_replace.activate
  591.           @window_replace.visible = true
  592.           @window_replace.refresh
  593.           Sound.play_ok
  594.           Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  595.         else
  596.           return on_savefile_ok
  597.         end
  598.       elsif Input.trigger?(:B)
  599.         return on_savefile_cancel
  600.       elsif Input.trigger?(:F5)
  601.         unless @window_manager.active == true or
  602.                @window_delete.active == true or
  603.                @window_replace.active == true
  604.           return on_manager?
  605.         end
  606.       end
  607.     end
  608.     @need_refresh = true if @index != @command_window.index
  609.     if @need_refresh
  610.       Graphics.freeze
  611.       @index = @command_window.index
  612.       @savefile_window.dispose
  613.       create_savefile_window
  614.       @need_refresh = false
  615.       Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  616.     end
  617.   end
  618.   #--------------------------------------------------------------------------
  619.   # ● セーブファイル[決定]
  620.   #--------------------------------------------------------------------------
  621.   def on_savefile_ok
  622.   end
  623.   #--------------------------------------------------------------------------
  624.   # ● セーブファイル[キャンセル]
  625.   #--------------------------------------------------------------------------
  626.   def on_savefile_cancel
  627.     Sound.play_cancel
  628.     return_scene
  629.   end
  630.   #--------------------------------------------------------------------------
  631.   # ● セーブファイル[決定]
  632.   #--------------------------------------------------------------------------
  633.   def on_copy_ok
  634.     Graphics.freeze
  635.     source_name = DataManager.make_filename(@source_index)
  636.     new_name    = DataManager.make_filename(@index)
  637.     case @source_type
  638.     when "copy"
  639.       # 复制存档文件(API)
  640.       Win32API.new('kernel32',"CopyFileA",'ppl','').call(source_name,new_name,0)
  641.     when "move"
  642.       # 重命名存档
  643.       File.rename(source_name, new_name)
  644.     end
  645.     # 返回
  646.     @help_window.set_text(help_window_text)
  647.     @source_index = nil
  648.     do_return_savelist
  649.   end
  650.   #--------------------------------------------------------------------------
  651.   # ● セーブファイル[复制]
  652.   #--------------------------------------------------------------------------
  653.   def on_copy?
  654.     Graphics.freeze
  655.     @help_window.set_text(PS0::Window_SaveFile_Plus::HELP_COPY)
  656.     @source_index = @index
  657.     @source_type = "copy"
  658.     do_return_savelist
  659.   end
  660.   #--------------------------------------------------------------------------
  661.   # ● セーブファイル[移动]
  662.   #--------------------------------------------------------------------------
  663.   def on_move?
  664.     Graphics.freeze
  665.     @help_window.set_text(PS0::Window_SaveFile_Plus::HELP_MOVE)
  666.     @source_index = @index
  667.     @source_type = "move"
  668.     do_return_savelist
  669.   end
  670.   #--------------------------------------------------------------------------
  671.   # ● セーブファイル[管理]
  672.   #--------------------------------------------------------------------------
  673.   def on_manager?
  674.     if FileTest.exist?(DataManager.make_filename(@index))
  675.       Graphics.freeze
  676.       @command_window.deactivate
  677.       @window_manager.y = 72 + @index * 24
  678.       @window_manager.activate
  679.       @window_manager.visible = true
  680.       @window_manager.refresh
  681.       Sound.play_ok
  682.       Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  683.     else
  684.       Sound.play_buzzer
  685.     end
  686.   end
  687.   #--------------------------------------------------------------------------
  688.   # ● セーブファイル[删除]
  689.   #--------------------------------------------------------------------------
  690.   def on_delete?
  691.     Graphics.freeze
  692.     @window_manager.deactivate
  693.     @command_window.deactivate
  694.     @window_delete.y = 72 + 72 + @index * 24
  695.     @window_delete.activate
  696.     @window_delete.visible = true
  697.     @window_delete.refresh
  698.     Sound.play_ok
  699.     Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  700.   end
  701.   #--------------------------------------------------------------------------
  702.   # ● 删除
  703.   #--------------------------------------------------------------------------
  704.   def do_delete
  705.     Graphics.freeze
  706.     File.delete(DataManager.make_filename(@index))
  707.     @window_delete.index  = 0
  708.     @window_manager.index = 0
  709.     @window_delete.visible  = false
  710.     @window_manager.visible = false
  711.     @window_delete.deactivate
  712.     @window_manager.deactivate
  713.     @command_window.activate
  714.     @need_refresh = true
  715.     Sound.play_save
  716.     if DataManager.save_file_exists?
  717.       Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  718.     else
  719.       return_scene
  720.     end
  721.   end
  722.   #--------------------------------------------------------------------------
  723.   # ● 替换
  724.   #--------------------------------------------------------------------------
  725.   def do_replace
  726.     Graphics.freeze
  727.     if @source_index != nil
  728.       return on_copy_ok
  729.     else
  730.       return on_savefile_ok
  731.     end
  732.     @window_replace.visible = false
  733.     @window_replace.deactivate
  734.     @need_refresh = true
  735.   end
  736.   #--------------------------------------------------------------------------
  737.   # ● 取消
  738.   #--------------------------------------------------------------------------
  739.   def do_cancel
  740.     Graphics.freeze
  741.     Sound.play_cancel
  742.     @window_delete.index  = 0
  743.     @window_replace.index = 0
  744.     @window_manager.index = 0
  745.     @window_delete.visible  = false
  746.     @window_replace.visible = false
  747.     @window_manager.visible = false
  748.     @window_delete.deactivate
  749.     @window_replace.deactivate
  750.     @window_manager.deactivate
  751.     @command_window.activate
  752.     Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  753.   end
  754.   #--------------------------------------------------------------------------
  755.   # ● 返回管理菜单
  756.   #--------------------------------------------------------------------------
  757.   def do_return_manager
  758.     Graphics.freeze
  759.     @help_window.set_text(help_window_text)
  760.     @command_window.index = @source_index unless @source_index == nil
  761.     @source_index = nil
  762.     @source_type = nil
  763.     @command_window.deactivate
  764.     @window_delete.index  = 0
  765.     @window_replace.index = 0
  766.     @window_delete.visible  = false
  767.     @window_replace.visible = false
  768.     @window_delete.deactivate
  769.     @window_replace.deactivate
  770.     @window_manager.y = 72 + @index * 24
  771.     @window_manager.activate
  772.     @window_manager.visible = true
  773.     @window_manager.refresh
  774.     Sound.play_cancel
  775.     Graphics.transition(PS0::Window_SaveFile_Plus::TRANS_DURATION)
  776.   end
  777.   #--------------------------------------------------------------------------
  778.   # ● 返回文件列表(复制、移动 用)
  779.   #--------------------------------------------------------------------------
  780.   def do_return_savelist
  781.     @window_manager.visible = false
  782.     @window_manager.deactivate
  783.     @command_window.activate
  784.     @need_refresh = true
  785.     Sound.play_ok
  786.   end
  787. end
  788. #==============================================================================
  789. # [PS0] End of Script
  790. #==============================================================================
[PS0]截图存档20120128-1.png
↑ 覆盖提示
[PS0]截图存档20120128-2.png
↑ 存档管理(不用担心菜单会跑出屏幕范围,会自动进行坐标修正)
[PS0]截图存档20120128-3.png
↑ 复制/移动 存档也是有覆盖提示的(如果源文件和目标文件相同则会发出错误提示音
[PS0]截图存档20120128-4.png
↑ 自适应分辨率,就算改了DLL突破分辨率上限也一样兼容(*需要自行更改截图尺寸)

与 VX新截图存档 By 沉影不器 的异同
①自适应分辨率
②自定义选项更丰富
③拥有多种截图算法(推荐使用“不缩放”算法)
④拥有覆盖存档提示、保存中提示
⑤拥有存档管理(复制、移动、删除)功能,删除最后一个存档会自动退会前一场景(Scene)
⑥当然,拥有 VX新截图存档 By 沉影不器 的全部机能

详细使用方法请参看脚本头部注释。

评分

参与人数 10星屑 +358 +3 收起 理由
Proradianten + 1 塞糖
RCP + 1 塞糖
whitedewxiao + 1 精品文章
zx890zc + 7 塞糖
水终结者 + 7 塞糖
神秘影子 + 12 我很赞同
Sonic1997 + 132
退屈£无聊 + 60 凑个100 0v0
SOU + 100 =w=
光的圆周率 + 20 塞糖 -w-

查看全部评分

Lv1.梦旅人

梦石
0
星屑
116
在线时间
192 小时
注册时间
2008-5-11
帖子
547
发表于 2011-12-26 19:05:51 | 显示全部楼层
哗~很厉害的脚本,收下了 -w-

点评

好的喵~  发表于 2011-12-26 19:12
QAQ 亲你回的太快了,我刚修正了一处笔误请重新复制  发表于 2011-12-26 19:10
9
回复 支持 反对

使用道具 举报

Lv1.梦旅人

星君

梦石
0
星屑
83
在线时间
2980 小时
注册时间
2011-10-9
帖子
2317

贵宾短篇七萝莉正太组冠军

发表于 2011-12-26 19:14:15 | 显示全部楼层
本帖最后由 皮卡星 于 2011-12-26 19:14 编辑

还是WORA大神的好-w=(众:那是VX的吧,pia

回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
48
在线时间
579 小时
注册时间
2011-5-30
帖子
497
发表于 2011-12-26 19:18:04 | 显示全部楼层
这个我应该很需要 目前还搞不太董VA阿.....
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
308 小时
注册时间
2011-4-9
帖子
84
发表于 2011-12-26 19:38:53 | 显示全部楼层
好,支持!!@各种压力的猫君推荐几个比较火的跟ace有关的站点吧中外文皆可
回复 支持 反对

使用道具 举报

Lv2.观梦者

(?????)

梦石
0
星屑
695
在线时间
1327 小时
注册时间
2011-7-18
帖子
3184

贵宾

 楼主| 发表于 2011-12-26 19:46:19 | 显示全部楼层
lyttmonkey 发表于 2011-12-26 19:38
好,支持!!@各种压力的猫君推荐几个比较火的跟ace有关的站点吧中外文皆可 ...
推荐几个比较火的跟ace有关的站点吧中外文皆可

 我真不知道 = = b 呼叫帮手:@月夜神音


阴影.jpg 阴影搞定……三天后统一更新
回复 支持 反对

使用道具 举报

Lv1.梦旅人

小小的百鬼夜行<

梦石
0
星屑
54
在线时间
579 小时
注册时间
2010-7-29
帖子
2682

贵宾

发表于 2011-12-26 20:02:33 | 显示全部楼层
本帖最后由 退屈£无聊 于 2011-12-26 20:04 编辑

刚才没看懂,现在才明白是移植……
方正喵呜体太萌了>.<
双线性插值这截图方式让我OTL了……

点评

不过我觉得你那机子能跑起来正常机子下运行也应该属于大丈夫的那一类= =(无贬义  发表于 2011-12-26 20:08
呃 = = 效率略悲剧,可以关闭的  发表于 2011-12-26 20:07
某只PHP/HTML小白鼠→退屈の间


Cause I knew you were trouble when you walked in
So shame is on me now
I flow me to place i ve never been
till you put me down oh
Now Im lying on the cold hard ground
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
50
在线时间
86 小时
注册时间
2011-10-7
帖子
41
发表于 2012-1-25 02:25:22 | 显示全部楼层
猫尊载图上字体是什么啊?

点评

7L不是说过了……方正喵呜体  发表于 2012-1-25 03:26
回复 支持 反对

使用道具 举报

Lv1.梦旅人

梦石
0
星屑
56
在线时间
171 小时
注册时间
2011-12-13
帖子
107
发表于 2012-1-26 18:43:47 | 显示全部楼层
诶?怎么删除呢?……

点评

呃,柯南真人版里面演小兰的,叫做忽那汐里.....  发表于 2012-1-26 22:04
头像是谁 太靓了  发表于 2012-1-26 20:14
请看头部注释 - -  发表于 2012-1-26 18:55
不思善,不思恶。
回复 支持 反对

使用道具 举报

Lv2.观梦者

(?????)

梦石
0
星屑
695
在线时间
1327 小时
注册时间
2011-7-18
帖子
3184

贵宾

 楼主| 发表于 2012-1-28 05:03:50 | 显示全部楼层
更新20120128版,一次较大的更新,完善了存档管理功能,稍微顶一下。

@serena718 可以参考下存档管理(这脚本结构写的有点烂 = = b 凑合看吧)
回复 支持 反对

使用道具 举报

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

本版积分规则

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

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

GMT+8, 2024-3-28 21:24

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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