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

Project1

 找回密码
 注册会员
搜索
查看: 1933|回复: 0

[已经过期] 强制关闭窗体提示是否关闭的功能

[复制链接]

Lv1.梦旅人

梦石
0
星屑
173
在线时间
179 小时
注册时间
2011-4-16
帖子
63
发表于 2016-7-15 19:50:56 | 显示全部楼层 |阅读模式

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

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

x
我重写了 exit 的方法,只不过方法内部的其他函数都是照搬 Scene_End 和 Scene_Base 的。
实际测试的时候,提示窗口正常呼出,可以选择,就是按下了没反应。
劳烦诸位帮我看下问题出在哪里。谢谢!
代码如下:


module Kernel
  def exit(*args)
    main
  end
  
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
  def main
    start
    perform_transition
    post_start      
    Input.update         
    loop do
      Graphics.update      
      Input.update         
      update               
#      break if $scene != self   
    end
    Graphics.update
    pre_terminate               
    Graphics.freeze              
    terminate                  
  end
#--------------------------------------------------------------------------
# * Start processing
#--------------------------------------------------------------------------
  def start
    create_menu_background
    create_command_window   
  end
#--------------------------------------------------------------------------
# * Execute Transition
#--------------------------------------------------------------------------
  def perform_transition
    Graphics.transition(10)
  end
#--------------------------------------------------------------------------
# * Post-Start Processing
#--------------------------------------------------------------------------
  def post_start
    open_command_window
  end
#--------------------------------------------------------------------------
# * Return to Original Screen
#--------------------------------------------------------------------------
  def return_scene
    $scene = Scene_Menu.new(5)
  end  
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
  def update
   update_menu_background
    @command_window.update
    if Input.trigger?(Input::B)
      Sound.play_cancel
      return_scene
    elsif Input.trigger?(Input::C)
      case @command_window.index
      when 0
        command_shutdown
      when 1
        command_cancel
      end
    end   
  end
#--------------------------------------------------------------------------
# * Create Command Window
#--------------------------------------------------------------------------  
def create_command_window
    s1 = "      退出"
    s2 = "      取消"
    @command_window = Window_Command.new(172, [s1, s2])
    @command_window.x = (544 - @command_window.width) / 2
    @command_window.y = (416 - @command_window.height) / 2
    @command_window.openness = 0
  end
#--------------------------------------------------------------------------
# * Dispose of Command Window
#--------------------------------------------------------------------------
  def dispose_command_window
    @command_window.dispose
  end
#--------------------------------------------------------------------------
# * Open Command Window
#--------------------------------------------------------------------------
  def open_command_window
    @command_window.open
    begin
      @command_window.update
      Graphics.update
    end until @command_window.openness == 255
  end
#--------------------------------------------------------------------------
# * Close Command Window
#--------------------------------------------------------------------------
  def close_command_window
    @command_window.close
    begin
      @command_window.update
      Graphics.update
    end until @command_window.openness == 0
  end  
#--------------------------------------------------------------------------
# * Pre-termination Processing
#--------------------------------------------------------------------------
  def pre_terminate
    close_command_window
  end
#--------------------------------------------------------------------------
# * Process When Choosing [Shutdown] Command
#--------------------------------------------------------------------------
  def command_shutdown
    Sound.play_decision
    RPG::BGM.fade(800)
    RPG::BGS.fade(800)
    RPG::ME.fade(800)
    $scene = nil
  end
#--------------------------------------------------------------------------
# *  Process When Choosing [Cancel] Command
#--------------------------------------------------------------------------
  def command_cancel
    Sound.play_decision
    return_scene
  end  
#--------------------------------------------------------------------------
# * Termination Processing
#--------------------------------------------------------------------------
  def terminate
    dispose_command_window
    dispose_menu_background   
  end
#--------------------------------------------------------------------------
# * Create Snapshot for Using as Background of Another Screen
#--------------------------------------------------------------------------
  def snapshot_for_background
    $game_temp.background_bitmap.dispose
    $game_temp.background_bitmap = Graphics.snap_to_bitmap
    $game_temp.background_bitmap.blur
  end
#--------------------------------------------------------------------------
# * Create Background for Menu Screen
#--------------------------------------------------------------------------
  def create_menu_background
    @menuback_sprite = Sprite.new
    @menuback_sprite.bitmap = $game_temp.background_bitmap
    @menuback_sprite.color.set(16, 16, 16, 128)
    update_menu_background
  end
#--------------------------------------------------------------------------
# * Dispose of Background for Menu Screen
#--------------------------------------------------------------------------
  def dispose_menu_background
    @menuback_sprite.dispose
  end
#--------------------------------------------------------------------------
# * Update Background for Menu Screen
#--------------------------------------------------------------------------
  def update_menu_background
    @menuback_sprite.tone.set(0, 0, 0, 128)   
  end  
  
end

汉化工作不定期更新中...
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

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

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

GMT+8, 2024-4-18 22:10

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

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