查看: 4092|回复: 3

[RMVA发布] 【向Dant致敬】简易截图脚本

[复制链接]

唯一的信徒

梦石
0
星屑
1697
在线时间
1359 小时
注册时间
2013-1-29
回帖
1537
发表于 2014-2-22 04:39:29 | 显示全部楼层 |阅读模式

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

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

×
于是我又去偷大触的革命成果了>_<
好了于是看到Dant大大的bitmap -> PNG果然顺手就写了这个_(:з」∠)_

必须要先安装Dant大大的Bitmap -> PNG:http://rpg.blue/thread-224347-1-1.html
默认是按D键截图,自己可以改嗯


  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ VA - Screenshot by LBQ
  4. #         - based on Bitmap2PNG by Dant
  5. #------------------------------------------------------------------------------
  6. # Bitmap2PNG is Required: http://rpg.blue/thread-224347-1-1.html
  7. #==============================================================================
  8. # Almost all the hard work has been done by Dant.
  9. #------------------------------------------------------------------------------
  10. # Usage: Press Screenshot Key (Default: D) to Take Screenshot
  11. #       - Default saved in Screenshots Directory
  12. #==============================================================================
  13. module LBQ
  14.   module Screenshot
  15.     $imported ||= {}
  16.     $imported[:lbq_screenshot] = '0.9'
  17.    
  18.     #   :Button    Default Keyboard Button
  19.     #      :L        Q
  20.     #      :R        W
  21.     #      :X        A
  22.     #      :Y        S
  23.     #      :Z        D
  24.     KEY     = :Z # Default: Z which is D on keyboard
  25.     MSGBOX  = true # Weather to play a sound or not
  26.     FOLDER  = "Screenshots"
  27.    
  28.    
  29.     #if only time is enabled, the filename will only be composed of the time
  30.     ONLY_TIME = false
  31.     MSG = proc do
  32.       Sound.play_shop
  33.       puts "SCREENSHOT SAVED"
  34.     end # proc
  35.   end
  36. end





  37. class << LBQ::Screenshot
  38.   def check_screenshot
  39.     if Bitmap.instance_methods.include?(:save_png)
  40.         puts "LBQ - Screenshot: Found :save_png Method"
  41.     else
  42.         msgbox <<-INFO
  43.         LBQ - Screenshot Cannot Find :save_png Method for Bitmap
  44.         Please Make Sure that You Have Bitmap2PNG by Dant
  45.         You can find the download link for Bitmap2PNG in the Comments
  46.         of the scripts
  47.         INFO
  48.     end
  49.   end
  50.    
  51.   
  52.   def take_screenshot
  53.     check_screenshot
  54.     Dir.mkdir(LBQ::Screenshot::FOLDER) unless Dir.exist?(LBQ::Screenshot::FOLDER)
  55.     File.new get_filename, "w"
  56.     Graphics.snap_to_bitmap.save_png(get_filename)
  57.     LBQ::Screenshot::MSG.call if LBQ::Screenshot::MSGBOX
  58.   end # def take_screenshot
  59.   
  60.   def get_filename
  61.     return "#{LBQ::Screenshot::FOLDER}/Screenshot-#{Time.now.strftime("%I_%M_%S")}.png" if LBQ::Screenshot::ONLY_TIME
  62.     if SceneManager.scene_is?(Scene_Map)
  63.       n = "Map - #{$game_map.display_name}"
  64.     elsif SceneManager.scene_is?(Scene_Battle)
  65.       n = "Battle - #{$game_troop.troop.name}"
  66.     elsif SceneManager.scene_is?(Scene_Shop)
  67.       n = "Shop"
  68.     else
  69.       n = SceneManager.scene.class.name
  70.     end # SceneMap
  71.     n.gsub!(/[\x00\/\\:\*\?"<>\|]/, '_')
  72.     return "#{LBQ::Screenshot::FOLDER}/#{n}-#{Time.now.strftime("%I_%M_%S")}.png"
  73.   end # def get_filename
  74. end


  75. class Scene_Base
  76.   alias :lbq_screenshot_scene_base_update :update
  77.   def update
  78.     lbq_screenshot_scene_base_update
  79.     LBQ::Screenshot.take_screenshot if Input.trigger?(LBQ::Screenshot::KEY)
  80.   end
  81. end
复制代码
『我只是一个正在潜心修炼的渣乐师罢了』
Dear Time\(^o^)/~


假如上面的图片挂了的话麻烦各位去发个帖 @ 一下 orzFly 让他修复 deartime
david_ng223 该用户已被删除
发表于 2014-2-22 04:57:40 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

梦石
0
星屑
65
在线时间
126 小时
注册时间
2015-6-26
回帖
96
发表于 2015-7-21 11:49:03 | 显示全部楼层
请问大神,截图的声音怎么修改,看了半天啥也没看懂啊
回复

使用道具 举报

唯一的信徒

梦石
0
星屑
1697
在线时间
1359 小时
注册时间
2013-1-29
回帖
1537
 楼主| 发表于 2015-7-21 13:12:21 | 显示全部楼层
0936zz 发表于 2015-7-21 11:49
请问大神,截图的声音怎么修改,看了半天啥也没看懂啊

第32行:
  1. Sound.play_shop
复制代码
代表了播放SE。
改掉这一行成为Sound的其他方法即可。

删掉这一行就没有音效了。

这个脚本主要用途是给自己用的,所以我当时也没有考虑到要改音效这种问题OTL。
『我只是一个正在潜心修炼的渣乐师罢了』
Dear Time\(^o^)/~


假如上面的图片挂了的话麻烦各位去发个帖 @ 一下 orzFly 让他修复 deartime
回复

使用道具 举报

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

本版积分规则

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部