赞 | 0 |
VIP | 0 |
好人卡 | 9 |
积分 | 1 |
经验 | 13328 |
最后登录 | 2023-2-12 |
在线时间 | 278 小时 |
Lv1.梦旅人 尽头
- 梦石
- 0
- 星屑
- 119
- 在线时间
- 278 小时
- 注册时间
- 2010-6-20
- 帖子
- 1280
|
这不是我的BAS吗= =……
退出询问是修改了Kernel模块的exit方法……
以下是现场写的……未测试
- module Kernel
- alias exit_ask exit
- def exit(*arg)
- # 创建退出询问窗口
- create_exit_ask_window
- # 循环刷新
- loop do
- Graphics.update
- Input.update
- # 刷新退出询问窗口
- # 并返回选项命令
- case update_exit_ask_window
- when 0
- # 退出
- exit_ask(*arg)
- when 1
- # 释放退出询问窗口
- dispose_exit_ask_window
- # 返回
- break
- end
- end
- end
-
- # 创建退出询问窗口
- def create_exit_ask_window
- # 窗口大小
- width = 400
- height = 128
- @window = Window_Base.new(0, 0, width, height)
- @window.contents = Bitmap.new(width - 32, height - 32)
- @window.x = 320 - width / 2
- @window.y = 240 - height / 2 - 64
- @window.z = 1000
- # 提示内容
- string =
- "退出游戏前请确定保存没有哦~亲"
- @window.contents.draw_text(0, 0, width - 32, height - 32, string, 1)
-
- # 选项内容
- array =
- [
- "确定退出",
- "返回"
- ]
- @command = Window_Command.new(width, array)
- @command.x = 320 - width / 2
- @command.y = 240 - height / 2 + 64
- @command.z = 1000
- end
- # 刷新退出询问窗口
- def update_exit_ask_window
- @window.update
- @command.update
- # 按下确定键
- if Input.trigger?(Input::C)
- return @command.index
- end
- return nil
- end
- # 释放退出询问窗口
- def dispose_exit_ask_window
- @window.dispose
- @command.dispose
- end
- end
复制代码 |
评分
-
查看全部评分
|