查看: 4035|回复: 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键截图,自己可以改嗯


[pre lang="ruby" line="1"]#encoding:utf-8
#==============================================================================
# ■ VA - Screenshot by LBQ
#         - based on Bitmap2PNG by Dant
#------------------------------------------------------------------------------
# Bitmap2PNG is Required: http://rpg.blue/thread-224347-1-1.html
#==============================================================================
# Almost all the hard work has been done by Dant.
#------------------------------------------------------------------------------
# Usage: Press Screenshot Key (Default: D) to Take Screenshot
#       - Default saved in Screenshots Directory
#==============================================================================
module LBQ
  module Screenshot
    $imported ||= {}
    $imported[:lbq_screenshot] = '0.9'
   
    #   :Button    Default Keyboard Button
    #      :L        Q
    #      :R        W
    #      :X        A
    #      :Y        S
    #      :Z        D
    KEY     = :Z # Default: Z which is D on keyboard
    MSGBOX  = true # Weather to play a sound or not
    FOLDER  = "Screenshots"
   
   
    #if only time is enabled, the filename will only be composed of the time
    ONLY_TIME = false
    MSG = proc do
      Sound.play_shop
      puts "SCREENSHOT SAVED"
    end # proc
  end
end





class << LBQ::Screenshot
  def check_screenshot
    if Bitmap.instance_methods.include?(:save_png)
        puts "LBQ - Screenshot: Found :save_png Method"
    else
        msgbox <<-INFO
        LBQ - Screenshot Cannot Find :save_png Method for Bitmap
        Please Make Sure that You Have Bitmap2PNG by Dant
        You can find the download link for Bitmap2PNG in the Comments
        of the scripts
        INFO
    end
  end
   
  
  def take_screenshot
    check_screenshot
    Dir.mkdir(LBQ::Screenshot::FOLDER) unless Dir.exist?(LBQ::Screenshot::FOLDER)
    File.new get_filename, "w"
    Graphics.snap_to_bitmap.save_png(get_filename)
    LBQ::Screenshot::MSG.call if LBQ::Screenshot::MSGBOX
  end # def take_screenshot
  
  def get_filename
    return "#{LBQ::Screenshot::FOLDER}/Screenshot-#{Time.now.strftime("%I_%M_%S")}.png" if LBQ::Screenshot::ONLY_TIME
    if SceneManager.scene_is?(Scene_Map)
      n = "Map - #{$game_map.display_name}"
    elsif SceneManager.scene_is?(Scene_Battle)
      n = "Battle - #{$game_troop.troop.name}"
    elsif SceneManager.scene_is?(Scene_Shop)
      n = "Shop"
    else
      n = SceneManager.scene.class.name
    end # SceneMap
    n.gsub!(/[\x00\/\\:\*\?\"<>\|]/, '_')
    return "#{LBQ::Screenshot::FOLDER}/#{n}-#{Time.now.strftime("%I_%M_%S")}.png"
  end # def get_filename
end


class Scene_Base
  alias :lbq_screenshot_scene_base_update :update
  def update
    lbq_screenshot_scene_base_update
    LBQ::Screenshot.take_screenshot if Input.trigger?(LBQ::Screenshot::KEY)
  end
end[/pre]
『我只是一个正在潜心修炼的渣乐师罢了』
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.

在本版发帖返回顶部