Project1

标题: 关于截图扩展存档脚本的两个冲突问题 求高手解答 [打印本页]

作者: gkl0510    时间: 2016-1-31 20:26
标题: 关于截图扩展存档脚本的两个冲突问题 求高手解答
本帖最后由 gkl0510 于 2016-1-31 20:30 编辑

在游戏中使用了“截图扩展存档”的脚本替换了原来的脚本,
以增加存档的上限和存档的美观。



但是发生了以下两个问题


1.游戏中调用“呼出存档”指令时,调出的是默认的存档菜单,
无法调出新加入的脚本






2.当读取存档的时候如果按Esc 返回键的话就会和好几个脚本报错






已经苦思冥想了许久不知道如何解决,期待大神解救T-T



截图扩展存档脚本

RUBY 代码复制
  1. ###使用说明
  2. #使用前请复制sceneshot.dll到游戏文件下,并新建文件夹Save
  3. #将此文本插入main前面
  4. #游戏前显示头像的文件名为:人物角色名_f,请自行建立几张做测试,不然找不到图片会报错
  5. #自动存档按钮F5 存入档位0(也就是自动存档那栏)
  6. #使用前,请在菜单脚本:scene_menu里面,
  7. #     when 4 # 存档
  8. #     # 禁止存档的情况下
  9. #     if $game_system.save_disabled
  10. #       # 演奏冻结 SE
  11. #       $game_system.se_play($data_system.buzzer_se)
  12. #       return
  13. #     end
  14. #     # 演奏确定 SE
  15. #     $game_system.se_play($data_system.decision_se)
  16. #     # 切换到存档画面
  17. #     $scene = Scene_Save.new <--这行
  18. #替换为:   $scene = Scene_Loadsave.new
  19. #另,在原scene_title里,48行左右
  20. #    for i in 0..3
  21. #          for i in 0..3
  22. #     if FileTest.exist?("Save#{i+1}.rxdata")
  23. ###################改成if FileTest.exist?("Save/Save#{i+1}.rxdata")
  24. #        @continue_enabled = true
  25. #      end
  26. #    end
  27. #否则继续游戏时会检测不到存档
  28.  
  29. class Window_File < Window_Base
  30. attr_accessor :index
  31. def initialize(index = 0)
  32.    @backsp = Sprite.new
  33.   # @backsp.bitmap = Bitmap.new("Graphics/Pictures/菜单底图.jpg")
  34.    @backsp.z = 100
  35.    super(160,64,480,416)
  36.    #这行可以不用
  37.    self.contents = Bitmap.new(width - 32, height - 32)
  38.    #去框##
  39.    self.opacity=0
  40.    ##
  41.    @index = index
  42.    #这里我要说明一句,之所以用sprite是为了放缩图片
  43.    @sprite = Sprite.new
  44.    @sprite.visible = false
  45.    @sprite.z = 100
  46.    @sp_ch = []
  47.    @sp_ch[0] = Sprite.new
  48.    refresh
  49. end
  50. def refresh
  51.    self.contents.clear
  52.    for i in @sp_ch
  53.      i.visible = false
  54.    end
  55.    @sprite.visible = false
  56.    if FileTest.exist?(DIR+"Save#{@index}.rxdata")
  57.      @sprite.visible = true
  58.      if FileTest.exist?(DIR+"Save#{@index}.jpg")
  59.        @sprite.bitmap = Bitmap.new(DIR+"Save#{@index}.jpg")
  60.      else
  61.        self.contents.draw_text(32,64,400,32,"截图似乎有点问题……您搞什么了您?")
  62.      end
  63.      @sprite.x = 206
  64.      @sprite.y = 94
  65.      @sprite.zoom_x = 0.6
  66.      @sprite.zoom_y = 0.6
  67.      file = File.open(DIR+"Save#{@index}.rxdata", "r")
  68.      @time_stamp = file.mtime
  69.      @characters = Marshal.load(file)
  70.      @frame_count = Marshal.load(file)
  71.      @game_system = Marshal.load(file)
  72.      @game_switches = Marshal.load(file)
  73.      @game_variables = Marshal.load(file)
  74.      @total_sec = @frame_count / Graphics.frame_rate
  75.      file.close
  76.      for i in [email]0...@characters.size[/email]
  77.        bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
  78.        cw = bitmap.rect.width / 4
  79.        ch = bitmap.rect.height / 4
  80.        src_rect = Rect.new(0, 0, cw, ch)
  81.        x = i*100
  82.        y = 320
  83.        self.contents.blt(x, y, bitmap, src_rect)
  84.      end
  85.      # 描绘游戏时间
  86.      hour = @total_sec / 60 / 60
  87.      min = @total_sec / 60 % 60
  88.      sec = @total_sec % 60
  89.      time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  90.      self.contents.font.color = normal_color
  91.      self.contents.draw_text(4, 326, 420, 32, time_string, 2)
  92.      # 描绘时间标记
  93.      self.contents.font.color = normal_color
  94.      time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  95.      self.contents.draw_text(4, 346, 420, 32, time_string, 2)###356
  96.    else
  97.      self.contents.draw_text(32,32,420,32,"这个存档是空的")
  98.    end
  99.  
  100. end
  101. def dispose
  102.    super
  103.    @sprite.dispose
  104.    @backsp.dispose
  105.    for i in @sp_ch
  106.      i.dispose
  107.    end
  108. end
  109. end
  110.  
  111.  
  112. class Window_File2 < Window_Base
  113. attr_accessor :index
  114. def initialize(index = 0)
  115.    @backsp = Sprite.new
  116.   # @backsp.bitmap = Bitmap.new("Graphics/Pictures/菜单底图.jpg")
  117.    @backsp.z = 100
  118.    super(160,0,480,480)
  119.    #这行可以不用
  120.    self.contents = Bitmap.new(width - 32, height - 32)
  121.    #去框##
  122.    self.opacity=0
  123.    ##
  124.    @index = index
  125.    #这里我要说明一句,之所以用sprite是为了放缩图片
  126.    @sprite = Sprite.new
  127.    @sprite.visible = false
  128.    @sprite.z = 100
  129.    @sp_ch = []
  130.    @sp_ch[0] = Sprite.new
  131.    refresh
  132. end
  133. def refresh
  134.    self.contents.clear
  135.    for i in @sp_ch
  136.      i.visible = false
  137.    end
  138.    @sprite.visible = false
  139.    if FileTest.exist?(DIR+"Save#{@index}.rxdata")
  140.      @sprite.visible = true
  141.      if FileTest.exist?(DIR+"Save#{@index}.jpg")
  142.        @sprite.bitmap = Bitmap.new(DIR+"Save#{@index}.jpg")
  143.      else
  144.        self.contents.draw_text(32,64,400,32,"截图似乎有点问题……您搞什么了您?")
  145.      end
  146.      @sprite.x = 176
  147.      @sprite.y = 30
  148.      @sprite.zoom_x = 0.7
  149.      @sprite.zoom_y = 0.7
  150.      file = File.open(DIR+"Save#{@index}.rxdata", "r")
  151.      @time_stamp = file.mtime
  152.      @characters = Marshal.load(file)
  153.      @frame_count = Marshal.load(file)
  154.      @game_system = Marshal.load(file)
  155.      @game_switches = Marshal.load(file)
  156.      @game_variables = Marshal.load(file)
  157.      @total_sec = @frame_count / Graphics.frame_rate
  158.      file.close
  159.      for i in [email]0...@characters.size[/email]
  160.        bitmap = RPG::Cache.character(@characters[i][0], @characters[i][1])
  161.        cw = bitmap.rect.width / 4
  162.        ch = bitmap.rect.height / 4
  163.        src_rect = Rect.new(0, 0, cw, ch)
  164.        x = i*100
  165.        self.contents.blt(x, 440 - ch, bitmap, src_rect)
  166.      end
  167.      # 描绘游戏时间
  168.      hour = @total_sec / 60 / 60
  169.      min = @total_sec / 60 % 60
  170.      sec = @total_sec % 60
  171.      time_string = sprintf("%02d:%02d:%02d", hour, min, sec)
  172.      self.contents.font.color = normal_color
  173.      self.contents.draw_text(4, 390, 420, 32, time_string, 2)
  174.      # 描绘时间标记
  175.      self.contents.font.color = normal_color
  176.      time_string = @time_stamp.strftime("%Y/%m/%d %H:%M")
  177.      self.contents.draw_text(4, 420, 420, 32, time_string, 2)
  178.    else
  179.      self.contents.draw_text(32,32,420,32,"这个存档是空的")
  180.    end
  181.  
  182. end
  183. def dispose
  184.    super
  185.    @sprite.dispose
  186.    @backsp.dispose
  187.    for i in @sp_ch
  188.      i.dispose
  189.    end
  190. end
  191. end
  192.  
  193.  
  194.  
  195. $打开自动存档用的开关编号 = 595
  196. $自动存档位置 = 1
  197. $按下F5之后的自动存档的音效 = "Audio/SE/存档"
  198. $按下F5之后禁止存档时候的音效 = "Audio/Se/错误"
  199. DIR = "Save/"
  200. $打开自动存档开关之后调用的公共事件 = 0 #——默认未定义
  201. $按下F5之后可以存档调用的公共事件 = 0 #——默认未定义
  202. $按下F5之后禁止存档调用的公共事件 = 0 #——默认未定义
  203. class Scene_Map
  204. alias auto_update update
  205. def update
  206. auto_update
  207. #——按下F5的时候自动存档,可以修改为F5,F6,F7,F8,也可以修改成默认按键但是不推荐。
  208. #——注意在不可存档的时候是无效的
  209. if Input.trigger?(Input::F5)
  210.   unless $game_system.map_interpreter.running?
  211.   if $game_system.save_disabled
  212.     Audio.se_play($按下F5之后禁止存档时候的音效)
  213.     $game_temp.common_event_id = $按下F5之后禁止存档调用的公共事件
  214.   else
  215.     Audio.se_play($按下F5之后的自动存档的音效)
  216.     $game_temp.common_event_id = $按下F5之后可以存档调用的公共事件
  217.     auto_save
  218.   end
  219.   end
  220. end
  221. #——当BOSS战之前打开一下定义的开关,即可自动存档
  222. if $game_switches[$打开自动存档用的开关编号] == true
  223.   $game_switches[$打开自动存档用的开关编号] = false
  224.   $game_temp.common_event_id = $打开自动存档开关之后调用的公共事件
  225.   auto_save
  226. end
  227. end
  228. def auto_save
  229. #——这里定义了储存的文件,如果不希望用Save4可以自己修改编号
  230. # 写入存档数据
  231. Screen::shot
  232.     file = File.open( DIR+"Save#{$自动存档位置}.rxdata", "wb")
  233.     auto_save_data(file)
  234.     if FileTest.exist?( DIR+"shot.jpg")
  235.       File.rename( DIR+"shot.jpg", DIR+"Save#{$自动存档位置}.jpg")
  236.     end
  237.     file.close
  238. end
  239. def auto_save_data(file)
  240. #——以下定义内容和Scene_Save的write_save_data(file)完全一样
  241. #——如果你修改过该存档方法,不要忘记用你修改的覆盖这部分内容。
  242. # 生成描绘存档文件用的角色图形
  243. characters = []
  244. for i in 0...$game_party.actors.size
  245.   actor = $game_party.actors[i]
  246.   characters.push([actor.character_name, actor.character_hue, actor])
  247. end
  248. # 写入描绘存档文件用的角色数据
  249. Marshal.dump(characters, file)
  250. # 写入测量游戏时间用画面计数
  251. Marshal.dump(Graphics.frame_count, file)
  252. # 增加 1 次存档次数
  253. $game_system.save_count += 1
  254. # 保存魔法编号
  255. # (将编辑器保存的值以随机值替换)
  256. $game_system.magic_number = $data_system.magic_number
  257. # 写入各种游戏对像
  258. Marshal.dump($game_system, file)
  259. Marshal.dump($game_switches, file)
  260. Marshal.dump($game_variables, file)
  261. Marshal.dump($game_self_switches, file)
  262. Marshal.dump($game_screen, file)
  263. Marshal.dump($game_actors, file)
  264. Marshal.dump($game_party, file)
  265. Marshal.dump($game_troop, file)
  266. Marshal.dump($game_map, file)
  267. Marshal.dump($game_player, file)
  268. end
  269. end
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277. DIR = "Save/"  # 储存文件夹名,请制作游戏时自行建立此文件夹
  278.  
  279.  
  280. module Screen  
  281. @screen = Win32API.new 'screenshot', 'Screenshot', %w(l l l l p l l), ''
  282. @readini = Win32API.new 'kernel32', 'GetPrivateProfileStringA', %w(p p p p l
  283.  
  284. p), 'l'
  285. @findwindow = Win32API.new 'user32', 'FindWindowA', %w(p p), 'l'
  286. module_function
  287. def shot(file = "shot", typ = 1)
  288.    # to add the right extension...
  289.    if typ == 0
  290.      typname = ".bmp"
  291.    elsif typ == 1
  292.      typname = ".jpg"
  293.    elsif typ == 2
  294.      typname = ".png"
  295.    end   
  296.    file_index = 0   
  297.    dir = "Save/"   
  298.    # make the filename....
  299.    file_name = dir + file.to_s + typname.to_s   
  300.    # make the screenshot.... Attention dont change anything from here on....
  301.    @screen.call(0,0,640,480,file_name,handel,typ)
  302. end
  303. # find the game window...
  304. def handel
  305.    game_name = "\0" * 256
  306.    @readini.call('Game','Title','',game_name,255,".\\Game.ini")
  307.    game_name.delete!("\0")
  308.    return @findwindow.call('RGSS Player',game_name)
  309. end
  310. end
  311.  
  312.  
  313. class Scene_Menu
  314. alias shotsave_main main
  315. def main
  316.    if @menu_index == 0
  317.      Screen::shot
  318.    end   
  319.    shotsave_main
  320. end
  321. end
  322.  
  323. class Interpreter
  324. #--------------------------------------------------------------------------
  325. # ● 调用存档画面
  326. #--------------------------------------------------------------------------
  327. def command_352
  328.    # 设置战斗中断标志
  329.    $game_temp.battle_abort = true
  330.    # 设置调用存档标志
  331.    $game_temp.save_calling = true
  332.    # 推进索引
  333.    @index += 1
  334.    # 结束
  335.    Screen::shot
  336.    return false
  337. end
  338. end
  339.  
  340. #==============================================================================
  341. # ■ Scene_Load
  342. #------------------------------------------------------------------------------
  343. #  处理读档画面的类。
  344. #==============================================================================
  345.  
  346. class Scene_Load
  347. #--------------------------------------------------------------------------
  348. # ● 初始化对像
  349. #--------------------------------------------------------------------------
  350. def initialize
  351.    # 再生成临时对像
  352.    $game_temp = Game_Temp.new
  353.    # 选择存档时间最新的文件
  354.    $game_temp.last_file_index = 0
  355.    latest_time = Time.at(0)
  356.    for i in 0..51
  357.      filename = DIR+"Save#{i}.rxdata"
  358.      if FileTest.exist?(filename)
  359.        file = File.open(filename, "r")
  360.        if file.mtime > latest_time
  361.          latest_time = file.mtime
  362.          $game_temp.last_file_index = i
  363.        end
  364.        file.close
  365.      end
  366.    end
  367. end  
  368. def main
  369.    #生成背景#
  370.    ##生成菜单背景##
  371.     @dff_save= Sprite.new
  372.     @dff_save.bitmap = Bitmap.new("Graphics/Pictures/System/load")
  373.    ##
  374.    @command_window = Window_Command.new(160,["  自动存档","  快速存档","  进度二",
  375.    "  进度三","  进度四","  进度五","  进度六","  进度七","  进度八","  进度九","  进度十",
  376.    "  进度十一","  进度十二","  进度十三","  进度十四","  进度十五","  进度十六",
  377.    "  进度十七","  进度十八","  进度十九","  进度二十","  进度二一","  进度二二",
  378.    "  进度二三","  进度二四","  进度二五","  进度二六","  进度二七","  进度二八",
  379.    "  进度二九","  进度三十"])
  380.    @command_window.y = 1
  381.    @command_window.height = 480
  382.    @command_window.index = $game_temp.last_file_index
  383.    @content_window = Window_File2.new($game_temp.last_file_index)
  384.    #去框##
  385.    @command_window.opacity = 0
  386.    ##   
  387.    # 执行过渡
  388.    Graphics.transition
  389.    # 主循环
  390.    loop do
  391.      # 刷新游戏画面
  392.      Graphics.update
  393.      # 刷新输入信息
  394.      Input.update
  395.      # 刷新画面
  396.      update
  397.      # 如果画面被切换的话就中断循环
  398.      if $scene != self
  399.        break
  400.      end
  401.    end
  402.    # 准备过渡
  403.    Graphics.freeze
  404.    @command_window.dispose
  405.    @content_window.dispose
  406.    @dff_save.dispose
  407.    @dff_save.bitmap.dispose
  408. end
  409. def update
  410.    @command_window.update
  411.    if @command_window.index != @content_window.index
  412.      @content_window.index = @command_window.index
  413.      @content_window.refresh
  414.    end   
  415.    #——————下面这一部分是原装脚本——————#
  416.    if Input.trigger?(Input::B)  
  417.    # 演奏取消 SE
  418.    $game_system.se_play($data_system.cancel_se)
  419.    # 切换到标题画面
  420.    #####$scene = Scene_Title.new
  421.    $scene = Scene_Map.new
  422.    end   
  423.    #———————————————————————#   
  424.    if Input.trigger?(Input::C)
  425.      # 文件不存在的情况下
  426.      unless FileTest.exist?(DIR+"Save#{@command_window.index}.rxdata")
  427.        # 演奏冻结 SE
  428.        $game_system.se_play($data_system.buzzer_se)
  429.        return
  430.      end
  431.      # 演奏读档 SE
  432.      $game_system.se_play($data_system.load_se)
  433.      # 写入存档数据
  434.      file = File.open(DIR+"Save#{@command_window.index}.rxdata", "rb")
  435.      read_save_data(file)
  436.      file.close
  437.      # 还原 BGM、BGS
  438.      $game_system.bgm_play($game_system.playing_bgm)
  439.      $game_system.bgs_play($game_system.playing_bgs)
  440.      # 刷新地图 (执行并行事件)
  441.      $game_map.update
  442.      # 切换到地图画面
  443.      $scene = Scene_Map.new
  444.    end
  445.    #———————————————————————#
  446. end
  447. #--------------------------------------------------------------------------
  448. # ● 写入存档数据
  449. #     file : 写入用文件对像 (已经打开)
  450. #--------------------------------------------------------------------------
  451. def read_save_data(file)
  452.    # 读取描绘存档文件用的角色数据
  453.    characters = Marshal.load(file)
  454.    # 读取测量游戏时间用画面计数
  455.    Graphics.frame_count = Marshal.load(file)
  456.    # 读取各种游戏对像
  457.    $game_system        = Marshal.load(file)
  458.    $game_switches      = Marshal.load(file)
  459.    $game_variables     = Marshal.load(file)
  460.    $game_self_switches = Marshal.load(file)
  461.    $game_screen        = Marshal.load(file)
  462.    $game_actors        = Marshal.load(file)
  463.    $game_party         = Marshal.load(file)
  464.    $game_troop         = Marshal.load(file)
  465.    $game_map           = Marshal.load(file)
  466.    $game_player        = Marshal.load(file)
  467.    # 魔法编号与保存时有差异的情况下
  468.    # (加入编辑器的编辑过的数据)
  469.    if $game_system.magic_number != $data_system.magic_number
  470.      # 重新装载地图
  471.      $game_map.setup($game_map.map_id)
  472.      $game_player.center($game_player.x, $game_player.y)
  473.    end
  474.    # 刷新同伴成员
  475.    $game_party.refresh
  476. end
  477. end
  478.  
  479. #==============================================================================
  480. #  Window_LoadCommand
  481. #------------------------------------------------------------------------------
  482. #  存取档画面选择按钮窗口
  483. #==============================================================================
  484.  
  485. class Window_LoadCommand < Window_Selectable
  486. #--------------------------------------------------------------------------
  487. #  初始化对象
  488. #--------------------------------------------------------------------------
  489. def initialize
  490. super(320, 0, 320, 64)
  491. self.contents = Bitmap.new(width - 32, height - 32)
  492. self.contents.font.color = normal_color
  493. #去框#
  494. self.opacity=0
  495. ##
  496. @item_max = 2
  497. @column_max = 2
  498. @commands = ["存储", "读取"]
  499. refresh
  500. self.index = 0
  501. end
  502. #--------------------------------------------------------------------------
  503. #  刷新
  504. #--------------------------------------------------------------------------
  505. def refresh
  506. self.contents.clear
  507. for i in 0...@item_max
  508.    draw_item(i)
  509. end
  510. end
  511. #--------------------------------------------------------------------------
  512. #  描画按钮文字
  513. #--------------------------------------------------------------------------
  514. def draw_item(index)
  515. x = 4 + index * 160
  516. self.contents.draw_text(x, 0, 144, 32, @commands[index])
  517. end
  518. #--------------------------------------------------------------------------
  519. # ● 项目无效化
  520. #     index : 项目编号
  521. #--------------------------------------------------------------------------
  522. def disable_item(index)
  523.    draw_item(index, disabled_color)
  524. end
  525.  
  526. end
  527.  
  528. #==============================================================================
  529. #  Scene_Loadsave
  530. #------------------------------------------------------------------------------
  531. # 处理存取档画面的类。
  532. #==============================================================================
  533.  
  534. class Scene_Loadsave
  535. #--------------------------------------------------------------------------
  536. # ● 初始化对像
  537. #     $last_savefile_index : 记录光标位置
  538. #--------------------------------------------------------------------------
  539. def initialize
  540.    $last_savefile_index = 0 if $last_savefile_index == nil
  541.    # 再生成临时对像
  542.    $game_temp = Game_Temp.new
  543.    # 选择存档时间最新的文件
  544.    $game_temp.last_file_index = 0
  545.    latest_time = Time.at(0)
  546.    for i in 0..51
  547.      filename =  DIR+"Save#{i}.rxdata"
  548.      if FileTest.exist?(filename)
  549.        file = File.open(filename, "r")
  550.        if file.mtime > latest_time
  551.          latest_time = file.mtime
  552.          $game_temp.last_file_index = i
  553.        end
  554.        file.close
  555.      end
  556.    end
  557. end
  558. #--------------------------------------------------------------------------
  559. #  主处理
  560. #--------------------------------------------------------------------------
  561. def main         
  562.    ##生成菜单背景##
  563.     @dff_save= Sprite.new
  564.     @dff_save.bitmap = Bitmap.new("Graphics/Pictures/System/saveload")
  565.    ##
  566.    @savestate = 0
  567.    # 生成窗口
  568.    @help_window = Window_LoadHelp.new
  569.    @help_window.set_text("请选择.")
  570.    @option_window = Window_LoadCommand.new
  571.    @option_window.index = $last_savefile_index
  572.    ########################################################
  573.    @command_window = Window_Command.new(160,["  自动存档","  快速存档","   进度二",
  574.    "   进度三","   进度四","   进度五","   进度六","   进度七","   进度八","   进度九","   进度十",
  575.    "  进度十一","  进度十二","  进度十三","  进度十四","  进度十五","  进度十六",
  576.    "  进度十七","  进度十八","  进度十九","  进度二十","  进度二一","  进度二二",
  577.    "  进度二三","  进度二四","  进度二五","  进度二六","  进度二七","  进度二八",
  578.    "  进度二九","  进度三十"])
  579.      @command_window.y = 64
  580.      @command_window.height = 378
  581.      @command_window.index = $game_temp.last_file_index
  582.      @content_window = Window_File.new($game_temp.last_file_index)
  583.      @command_window.active = false
  584.      #去框##
  585.      @command_window.opacity = 0
  586.      ##
  587.      ###############覆盖存档
  588.        @confirm_window = Window_Base.new(120, 188, 400, 64)
  589.        @confirm_window.contents = Bitmap.new(368, 32)
  590.  
  591.        @confirm_window.contents.font.color = Color.new(255,255,255,255)
  592.  
  593.        string = "确定要覆盖这个进度吗?"
  594.        @confirm_window.contents.font.name = "黑体"
  595.        @confirm_window.contents.font.size = 24
  596.        @confirm_window.contents.draw_text(4, 0, 368, 32, string)
  597.        @yes_no_window = Window_Command.new(100, ["覆盖", "取消"])
  598.        @confirm_window.z = 1500
  599.        @yes_no_window.index = 1
  600.        @yes_no_window.x = 270
  601.        @yes_no_window.y = 252
  602.        @yes_no_window.z = 1500
  603.        @confirm_window.visible = false
  604.        @yes_no_window.visible = false
  605.        @yes_no_window.active = false
  606.  
  607.    # 执行过渡
  608.    Graphics.transition
  609.    # 主循环
  610.    loop do
  611.      # 刷新游戏画面
  612.      Graphics.update
  613.      # 刷新输入信息
  614.      Input.update
  615.      # 刷新画面
  616.      update
  617.      # 如果画面被切换的话就中断循环
  618.      if $scene != self
  619.        break
  620.      end
  621.    end
  622.    # 准备过渡
  623.    Graphics.freeze
  624.    # 释放窗口
  625.    @command_window.dispose
  626.    @content_window.dispose
  627.    @confirm_window.dispose
  628.    @yes_no_window.dispose
  629.    @help_window.dispose
  630.    @option_window.dispose
  631.    @dff_save.dispose
  632.    @dff_save.bitmap.dispose
  633. end
  634.  
  635. #--------------------------------------------------------------------------
  636. #  ● 刷新画面
  637. #--------------------------------------------------------------------------
  638. def update
  639.    # 刷新窗口
  640.    @help_window.update
  641.    @option_window.update
  642. #   @content_window.update
  643.    @command_window.update
  644.    if @yes_no_window.active
  645.        confirm_update
  646.        return
  647.    end
  648.    @content_window.index = @command_window.index
  649.    @content_window.refresh
  650.    case @savestate
  651.    when 0
  652.        if Input.trigger?(Input::B)
  653.        $game_system.se_play($data_system.cancel_se)
  654.        # 返回地图
  655.        if $menu_call == false
  656.        # 切换到地图画面
  657.        $scene = Scene_Map.new
  658.          return
  659.        end
  660.        # 切换到菜单画面
  661.        $menu_call = false
  662.        $scene = Scene_Menu.new(5)
  663.     end
  664.      if Input.trigger?(Input::C)
  665.        case @option_window.index
  666.        when 1
  667.          @command_window.active = true
  668.          @option_window.active = false
  669.          $game_system.se_play($data_system.decision_se)
  670.          @help_window.set_text("请选择一个文件进行读取.")
  671.          @savestate  = 1
  672.          return
  673.        when 0
  674.  
  675.          @command_window.active = true
  676.          @option_window.active = false
  677.          $game_system.se_play($data_system.decision_se)
  678.          @help_window.set_text("请选择一个文件进行存储.")
  679.          @savestate = 2
  680.  
  681.          return
  682.        return
  683.        end
  684.      end
  685.    when 1,2
  686.      if Input.trigger?(Input::C)
  687.        if @savestate == 1
  688.          $menu_call = false
  689.          load_file
  690.          return
  691.        else
  692.          # 禁止存档的情况下
  693.          if $game_system.save_disabled
  694.            @help_window.set_text("抱歉,这里禁止存储.")
  695.            # 演奏冻结 SE
  696.            $game_system.se_play($data_system.buzzer_se)
  697.            return
  698.          end
  699.         $game_system.se_play($data_system.decision_se)
  700.         $last_savefile_index = @option_window.index
  701.  
  702.         save_file
  703.          return
  704.        end
  705.      end
  706.      # 取消
  707.      if Input.trigger?(Input::B)
  708.        $game_system.se_play($data_system.cancel_se)
  709.        @command_window.active = false
  710.        @help_window.set_text("请选择.")
  711.        @savestate = 0
  712.        @option_window.active = true
  713.        return
  714.      end
  715.  
  716.      if Input.trigger?(Input::B)
  717.        $game_system.se_play($data_system.cancel_se)
  718.        @savestate = 2
  719.        @command_window.active = true
  720.  
  721.        return
  722.      end
  723.    end
  724. end
  725. #--------------------------------------------------------------------------
  726. # 建立记录文件索引
  727. #--------------------------------------------------------------------------
  728.  
  729. #--------------------------------------------------------------------------
  730. #  读取记录文件
  731. #     filename  : 被读取文件
  732. #--------------------------------------------------------------------------
  733. def load_file
  734.      # 文件不存在的情况下
  735.      unless FileTest.exist?( DIR+"Save#{@command_window.index}.rxdata")
  736.        # 演奏冻结 SE
  737.        $game_system.se_play($data_system.buzzer_se)
  738.        return
  739.      end
  740.      # 演奏读档 SE
  741.      $game_system.se_play($data_system.load_se)
  742.      # 写入存档数据
  743.      file = File.open( DIR+"Save#{@command_window.index}.rxdata", "rb")
  744.      read_save_data(file)
  745.      file.close
  746.      # 还原 BGM、BGS
  747.      $game_system.bgm_play($game_system.playing_bgm)
  748.      $game_system.bgs_play($game_system.playing_bgs)
  749.      # 刷新地图 (执行并行事件)
  750.      $game_map.update
  751.      # 切换到地图画面
  752.      $scene = Scene_Map.new
  753. end
  754. #--------------------------------------------------------------------------
  755. # ● 读取存档数据
  756. #     file : 读取用文件对像 (已经打开)
  757. #--------------------------------------------------------------------------
  758. def read_save_data(file)
  759.    # 读取描绘存档文件用的角色数据
  760.    characters = Marshal.load(file)
  761.    # 读取测量游戏时间用画面计数
  762.    Graphics.frame_count = Marshal.load(file)
  763.    # 读取各种游戏对像
  764.    $game_system        = Marshal.load(file)
  765.    $game_switches      = Marshal.load(file)
  766.    $game_variables     = Marshal.load(file)
  767.    $game_self_switches = Marshal.load(file)
  768.    $game_screen        = Marshal.load(file)
  769.    $game_actors        = Marshal.load(file)
  770.    $game_party         = Marshal.load(file)
  771.    $game_troop         = Marshal.load(file)
  772.    $game_map           = Marshal.load(file)
  773.    $game_player        = Marshal.load(file)
  774.    # 魔法编号与保存时有差异的情况下
  775.    # (加入编辑器的编辑过的数据)
  776.    if $game_system.magic_number != $data_system.magic_number
  777.      # 重新装载地图
  778.      $game_map.setup($game_map.map_id)
  779.      $game_player.center($game_player.x, $game_player.y)
  780.    end
  781.    # 刷新同伴成员
  782.    $game_party.refresh
  783. end
  784. #--------------------------------------------------------------------------
  785. # ● 写入存档文件
  786. #--------------------------------------------------------------------------
  787. def save_file
  788.    if Input.trigger?(Input::C)
  789.      unless FileTest.exist?( DIR+"Save#{@command_window.index}.rxdata")
  790.        # 演奏冻结 SE
  791.        # 演奏存档 SE
  792.          $game_system.se_play($data_system.save_se)
  793.          # 写入存档数据
  794.          file = File.open( DIR+"Save#{@command_window.index}.rxdata", "wb")
  795.          write_save_data(file)
  796.          if FileTest.exist?( DIR+"shot.jpg")
  797.            File.rename( DIR+"shot.jpg",  DIR+"Save#{@command_window.index}.jpg")
  798.          end
  799.          file.close
  800.          $game_temp.last_file_index = @command_window.index
  801.          # 如果被事件调用
  802.          if $game_temp.save_calling
  803.            # 清除存档调用标志
  804.            $game_temp.save_calling = false
  805.            @confirm_window.dispose
  806.            # 切换到地图画面
  807.            $scene = Scene_Map.new   
  808.            return
  809.          end
  810.        # 切换到菜单画面
  811.          $scene = Scene_Menu.new(5)
  812.      end
  813.      @yes_no_window.active = true
  814.      @command_window.active = false            
  815.    end
  816.    #———————————————————————#     
  817. end
  818. #-------------------------------------------------------------------
  819. def confirm_update
  820.    @command_index = @command_window.index
  821.    @confirm_window.visible = true
  822.    @confirm_window.z = 1500
  823.    @yes_no_window.visible = true
  824.    @yes_no_window.active = true
  825.    @yes_no_window.z = 1500
  826.    @yes_no_window.update
  827.    if Input.trigger?(Input::C)
  828.      if @yes_no_window.index == 0
  829.          #######################################################
  830.          # 演奏存档 SE
  831.          $game_system.se_play($data_system.save_se)
  832.          # 写入存档数据
  833.          file = File.open( DIR+"Save#{@command_window.index}.rxdata", "wb")
  834.          write_save_data(file)
  835.          if FileTest.exist?( DIR+"shot.jpg")
  836.            File.rename( DIR+"shot.jpg",  DIR+"Save#{@command_window.index}.jpg")
  837.          end
  838.          file.close
  839.          $game_temp.last_file_index = @command_window.index
  840.          # 如果被事件调用
  841.          if $game_temp.save_calling
  842.            # 清除存档调用标志
  843.            $game_temp.save_calling = false
  844.            @confirm_window.dispose
  845.            @content_window.dispose
  846.            # 切换到地图画面
  847.            $scene = Scene_Map.new
  848.            return
  849.          end
  850.        # 切换到菜单画面
  851.          $scene = Scene_Menu.new(5)      
  852.        else
  853.        @yes_no_window.visible = false
  854.        @confirm_window.visible = false
  855.        $game_system.se_play($data_system.cancel_se)
  856.        @yes_no_window.active = false
  857.        @command_window.active = true
  858.        end
  859.    end
  860.    if Input.trigger?(Input::B)
  861.      @yes_no_window.visible = false
  862.      @confirm_window.visible = false
  863.      $game_system.se_play($data_system.cancel_se)
  864.      @yes_no_window.active = false
  865.      @command_window.active = true
  866.    end
  867. end
  868. #--------------------------------------------------------------------------
  869. # ● 写入存档数据
  870. #     file : 写入用文件对像 (已经打开)
  871. #--------------------------------------------------------------------------
  872. def write_save_data(file)
  873.    # 生成描绘存档文件用的角色图形
  874.    characters = []
  875.    for i in 0...$game_party.actors.size
  876.      actor = $game_party.actors[i]
  877.      characters.push([actor.character_name, actor.character_hue, actor])
  878.    end
  879.    # 写入描绘存档文件用的角色数据
  880.    Marshal.dump(characters, file)
  881.    # 写入测量游戏时间用画面计数
  882.    Marshal.dump(Graphics.frame_count, file)
  883.    # 增加 1 次存档次数
  884.    $game_system.save_count += 1
  885.    # 保存魔法编号
  886.    # (将编辑器保存的值以随机值替换)
  887.    $game_system.magic_number = $data_system.magic_number
  888.    # 写入各种游戏对像
  889.    Marshal.dump($game_system, file)
  890.    Marshal.dump($game_switches, file)
  891.    Marshal.dump($game_variables, file)
  892.    Marshal.dump($game_self_switches, file)
  893.    Marshal.dump($game_screen, file)
  894.    Marshal.dump($game_actors, file)
  895.    Marshal.dump($game_party, file)
  896.    Marshal.dump($game_troop, file)
  897.    Marshal.dump($game_map, file)
  898.    Marshal.dump($game_player, file)
  899. end
  900. end
  901.  
  902. #==============================================================================
  903. # ■ Window_LoadHelp
  904. #------------------------------------------------------------------------------
  905. #  存取档画面帮助信息的显示窗口。
  906. #==============================================================================
  907.  
  908. class Window_LoadHelp < Window_Base
  909. #--------------------------------------------------------------------------
  910. #  初始化对象
  911. #--------------------------------------------------------------------------
  912. def initialize
  913. super(0, 0, 320, 64)
  914. self.contents = Bitmap.new(width - 32, height - 32)
  915. #去框#
  916. self.opacity=0
  917. ##
  918. end
  919. #--------------------------------------------------------------------------
  920. #  刷新文本
  921. #--------------------------------------------------------------------------
  922. def set_text(text, align = 1)
  923. if text != @text or align != @align
  924.    self.contents.clear
  925.    self.contents.font.color = normal_color
  926.    self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
  927.    @text = text
  928.    @align = align
  929.    @actor = nil
  930. end
  931. self.visible = true
  932. end
  933. end




显示地图名称脚本

RUBY 代码复制
  1. module Sword
  2. #=======================================
  3. #★ 魔劍工舖 - 地圖上顯示地圖名 1.01
  4. # [url]http://blog.yam.com/a870053jjkj/[/url]
  5. #=======================================
  6.   ON, OFF = true, false
  7. #=======================================
  8. #● 使用者自定設置
  9. Sword67_XorY = [-10, 0] # 顯示地圖名稱的窗口位置,分別為 [X座標, Y座標] # 640, 416
  10. Sword67_Align = 0 # 文字的靠邊位置,0為左、1為中、2為右
  11. Sword67_Opacity = 255 # 設定窗口背景的不透明度和淡出上限
  12. Sword67_Adjunct = 80 # 地圖名稱顯示的時間,0為永久顯示(每40約1秒)
  13. Sword67_Switche = 600 # 指定1個開關編號,該開關為ON表示關閉此腳本功能
  14. Sword67_Show = ON  # 是否在起始地圖顯示地圖名
  15. Sword67_Fade = [5, 5] # 設定每幀 [加, 減] 不透明度的淡出淡入效果,0為不使用
  16. #=======================================
  17.   $Sword ? $Sword[67] = true : $Sword = {67=>true} # 腳本使用標誌
  18.   ($Sword_VX = false ; RPG::Weather rescue $Sword_VX = true) if $Sword_VX == nil
  19.   Sword67s1_Fade = [Sword67_Fade[0] > 0 ? Sword67_Opacity / Sword67_Fade[0] : 0,
  20.   Sword67_Fade[1] > 0 ? Sword67_Opacity / Sword67_Fade[1] : 0]
  21.   #-------------------------------------------------------------
  22.   #● 紀錄是否在起始地圖顯示地圖名的標誌
  23.   def self.sword67=(s) ; @sword67 = s ; end
  24.   def self.sword67 ; @sword67 ; end
  25.   self.sword67 = Sword67_Show
  26. end
  27. #=======================================
  28. #■ 處理主角的類
  29. if $Sword_VX
  30. class Game_Player < Game_Character
  31.   attr_reader    :new_map_id # 新地圖的地圖編號
  32. end
  33. end
  34. #=======================================
  35. #■ 地圖名稱的窗口
  36. class WSword_MapName < Window_Base
  37.   include Sword # 連接自定設置
  38.   #-------------------------------------------------------------
  39.   #● 初始化物件
  40.   def initialize(a = 0)
  41.     b = $Sword_VX ? 'v' : 'x'
  42.     @map_name = a == 0 ? load_data("Data/MapInfos.r#{b}data")[$game_map.map_id].name :
  43.     load_data("Data/MapInfos.r#{b}data")[a].name # 獲取地圖名稱
  44.     super(Sword67_XorY[0], Sword67_XorY[1], 33, 33)
  45.     self.contents = Bitmap.new(width - 32, height - 32)
  46.     self.windowskin = RPG::Cache.windowskin("mapname")
  47. #    self.width = contents.text_size(@map_name).width + 40
  48. #    self.height = contents.text_size(@map_name).height + 43
  49.     self.width = 870
  50.     self.height = contents.text_size(@map_name).height + 60
  51.     self.contents = Bitmap.new(width - 32, height - 32)
  52.     refresh
  53.   end
  54.   #-------------------------------------------------------------
  55.   #● 描繪內容
  56.   def refresh
  57.     self.contents.clear ; self.contents.font.color = normal_color ; self.contents.font.size = 24
  58.     case Sword67_Align # 窗口靠邊設定
  59.     when 1 ; self.x -= self.width / 2
  60.     when 2 ; self.x -= self.width
  61.     end
  62.     self.contents.draw_text(4, 0, self.width, 48, @map_name) # 窗口內容
  63.   end
  64. end
  65. #=======================================
  66. #■ 處理地圖畫面的類
  67. class Scene_Map
  68.   include Sword # 連接自定設置
  69.   #-------------------------------------------------------------
  70.   #● 主處理
  71.   alias sword67_main main unless $Sword_VX
  72.   def main
  73.     sword67_map_name ; $Sword_VX ? super : sword67_main
  74.     unless @sword_map_name == nil
  75.       @sword_map_name.dispose
  76.       @sword_map_name = nil
  77.     end
  78.   end
  79.   #-------------------------------------------------------------
  80.   #● 更新
  81.   alias sword67_update update
  82.   def update
  83.     if Sword67_Fade[0] > 0 and @sword_map_name and (not @sword_map_wait == true)
  84.       @sword_map_name.opacity = [@sword_map_name.opacity +
  85.       Sword67_Fade[0], Sword67_Opacity].min
  86.       @sword_map_name.contents_opacity = [@sword_map_name.opacity +
  87.       Sword67_Fade[0], Sword67_Opacity].min
  88.     end
  89.     # 窗口顯示時間計算
  90.     @sword_map_wait = [Graphics.frame_count, Graphics.frame_count +
  91.     Sword67_Adjunct + Sword67s1_Fade[0]] unless @sword_map_wait
  92.     if @sword_map_wait.is_a?(Array) and Sword67_Adjunct != 0
  93.       @sword_map_wait[0] <= @sword_map_wait[1] ? @sword_map_wait[0] += 1 :
  94.       @sword_map_wait = true
  95.     end
  96.     if @sword_map_wait == true ; if @sword_map_name
  97.     if @sword_map_name.opacity == 0 or Sword67_Fade[1] == 0
  98.       @sword_map_name.dispose ; @sword_map_name = nil
  99.       @sword_map_wait = nil
  100.     else
  101.       @sword_map_name.opacity = [@sword_map_name.opacity -
  102.       Sword67_Fade[1], 0].max
  103.       @sword_map_name.contents_opacity = [@sword_map_name.opacity -
  104.       Sword67_Fade[1], 0].max
  105.     end ; end ; end
  106.     sword67_update
  107.   end
  108.   #-------------------------------------------------------------
  109.   #● 主角的場所移動
  110.   if $Sword_VX ; alias sword67_transfer_player update_transfer_player
  111.   else ; alias sword67_transfer_player transfer_player ; end
  112.   def transfer_player
  113.     return unless $game_player.transfer? if $Sword_VX
  114.     $game_switches[Sword67_Switche] ? 0 : @sword_map_wait = false
  115.     # 重新顯示窗口
  116.     unless @sword_map_name == nil
  117.       @sword_map_name.dispose
  118.       @sword_map_name = nil
  119.     end
  120.     Sword.sword67 = true
  121.     sword67_transfer_player
  122.     sword67_map_name
  123.   end
  124.   def update_transfer_player ; transfer_player ; end
  125.   #-------------------------------------------------------------
  126.   #● 顯示地圖名稱窗口的處理
  127.   def sword67_map_name
  128.     if $game_switches[Sword67_Switche] == false and Sword.sword67
  129.       @sword_map_name = WSword_MapName.new($Sword_VX ?
  130.       $game_player.new_map_id : $game_temp.player_new_map_id)
  131. #      @sword_map_name.opacity = Sword67_Fade[0] > 0 ? 0 : Sword67_Opacity
  132.       @sword_map_name.opacity = 0
  133.       #@sword_map_name.contents_opacity = 0 if Sword67_Fade[0] > 0
  134.       @sword_map_name.contents_opacity = 0
  135.       Sword.sword67 = false
  136.     end
  137.   end
  138. end



电梯地图的脚本

RUBY 代码复制
  1. #==============================================================================
  2. # ■ Spriteset_Map
  3. #------------------------------------------------------------------------------
  4. #  處理地圖畫面活動區塊和元件的類別。
  5. #  本類別在 Scene_Map 類別的內部使用。
  6. #==============================================================================
  7.  
  8. class Spriteset_Map
  9.   #--------------------------------------------------------------------------
  10.   # ● 初始化物件
  11.   #--------------------------------------------------------------------------
  12.   def initialize
  13.     # 產生顯示連接埠
  14.     @viewport1 = Viewport.new(0, 0, 640, 480)
  15.     @viewport2 = Viewport.new(0, 0, 640, 480)
  16.     @viewport3 = Viewport.new(0, 0, 640, 480)
  17.     @viewport2.z = 200
  18.     @viewport3.z = 5000
  19.     # 產生元件地圖
  20.     @tilemap = Tilemap.new(@viewport1)
  21.     @tilemap.tileset = RPG::Cache.tileset($game_map.tileset_name)
  22.     for i in 0..6
  23.       autotile_name = $game_map.autotile_names[i]
  24.       @tilemap.autotiles[i] = RPG::Cache.autotile(autotile_name)
  25.     end
  26.     @tilemap.map_data = $game_map.data
  27.     @tilemap.priorities = $game_map.priorities
  28.     # 產生全景平面
  29.     @panorama = Plane.new(@viewport1)
  30.     @panorama.z = -1000
  31.     # 產生霧平面
  32.     @fog = Plane.new(@viewport1)
  33.     @fog.z = 3000
  34.     # 產生角色活動區塊
  35.     @character_sprites = []
  36.     for i in $game_map.events.keys.sort
  37.       sprite = Sprite_Character.new(@viewport1, $game_map.events[i])
  38.       @character_sprites.push(sprite)
  39.     end
  40.     @character_sprites.push(Sprite_Character.new(@viewport1, $game_player))
  41.     # 產生天氣
  42.     @weather = RPG::Weather.new(@viewport1)
  43.     # 產生圖片
  44.     @picture_sprites = []
  45.     for i in 1..50
  46.       @picture_sprites.push(Sprite_Picture.new(@viewport2,
  47.         $game_screen.pictures[i]))
  48.     end
  49.     # 產生計時器區塊
  50.     @timer_sprite = Sprite_Timer.new
  51.     # 更新畫面
  52.     update
  53.   end
  54.   #--------------------------------------------------------------------------
  55.   # ● 釋放
  56.   #--------------------------------------------------------------------------
  57.   def dispose
  58.     # 釋放元件地圖
  59.     @tilemap.tileset.dispose
  60.     for i in 0..6
  61.       @tilemap.autotiles[i].dispose
  62.     end
  63.     @tilemap.dispose
  64.     # 釋放全景平面
  65.     @panorama.dispose
  66.     # 釋放霧平面
  67.     @fog.dispose
  68.     # 釋放角色活動區塊
  69.     for sprite in @character_sprites
  70.       sprite.dispose
  71.     end
  72.     # 釋放天氣
  73.     @weather.dispose
  74.     # 釋放圖片
  75.     for sprite in @picture_sprites
  76.       sprite.dispose
  77.     end
  78.     # 釋放計時器區塊
  79.     @timer_sprite.dispose
  80.     # 釋放顯示連接埠
  81.     @viewport1.dispose
  82.     @viewport2.dispose
  83.     @viewport3.dispose
  84.   end
  85.   #--------------------------------------------------------------------------
  86.   # ● 更新畫面
  87.   #--------------------------------------------------------------------------
  88.   def update
  89.     # 全景與現在的情況有差異發情況下
  90.     if @panorama_name != $game_map.panorama_name or
  91.        @panorama_hue != $game_map.panorama_hue
  92.       @panorama_name = $game_map.panorama_name
  93.       @panorama_hue = $game_map.panorama_hue
  94.       if @panorama.bitmap != nil
  95.         @panorama.bitmap.dispose
  96.         @panorama.bitmap = nil
  97.       end
  98.       if @panorama_name != ""
  99.         @panorama.bitmap = RPG::Cache.panorama(@panorama_name, @panorama_hue)
  100.       end
  101.       Graphics.frame_reset
  102.     end
  103.     # 霧與現在的情況有差異的情況下
  104.     if @fog_name != $game_map.fog_name or @fog_hue != $game_map.fog_hue
  105.       @fog_name = $game_map.fog_name
  106.       @fog_hue = $game_map.fog_hue
  107.       if @fog.bitmap != nil
  108.         @fog.bitmap.dispose
  109.         @fog.bitmap = nil
  110.       end
  111.       if @fog_name != ""
  112.         @fog.bitmap = RPG::Cache.fog(@fog_name, @fog_hue)
  113.       end
  114.       Graphics.frame_reset
  115.     end
  116.     # 更新元件地圖
  117.     @tilemap.ox = $game_map.display_x / 4
  118.     @tilemap.oy = $game_map.display_y / 4
  119.     @tilemap.update
  120.     # 更新全景平面
  121.     @panorama.ox = $game_map.display_x / 8
  122.     @panorama.oy = $game_map.display_y / 8
  123.     # 更新霧平面
  124.     @fog.zoom_x = $game_map.fog_zoom / 100.0
  125.     @fog.zoom_y = $game_map.fog_zoom / 100.0
  126.     @fog.opacity = $game_map.fog_opacity
  127.     @fog.blend_type = $game_map.fog_blend_type
  128.     @fog.ox = $game_map.display_x / 4 + $game_map.fog_ox
  129.     @fog.oy = $game_map.display_y / 4 + $game_map.fog_oy
  130.     @fog.tone = $game_map.fog_tone
  131.     # 更新角色活動區塊
  132.     for sprite in @character_sprites
  133.       sprite.update
  134.     end
  135.     # 更新天候圖形
  136.     @weather.type = $game_screen.weather_type
  137.     @weather.max = $game_screen.weather_max
  138.     @weather.ox = $game_map.display_x / 4
  139.     @weather.oy = $game_map.display_y / 4
  140.     @weather.update
  141.     # 更新圖片
  142.     for sprite in @picture_sprites
  143.       sprite.update
  144.     end
  145.     # 更新計時器區塊
  146.     @timer_sprite.update
  147.     # 設定畫面的色調與震動位置
  148.     @viewport1.tone = $game_screen.tone
  149. #####################################################
  150.     if $game_switches[596] == true
  151.        @viewport1.oy = $game_screen.shake
  152.     else
  153.        @viewport1.ox = $game_screen.shake
  154.     end
  155. #####################################################
  156.     # 設定畫面的閃爍色彩
  157.     @viewport3.color = $game_screen.flash_color
  158.     # 更新顯示連接埠
  159.     @viewport1.update
  160.     @viewport3.update
  161.   end
  162. end





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