赞 | 406 |
VIP | 0 |
好人卡 | 11 |
积分 | 390 |
经验 | 242285 |
最后登录 | 2024-11-15 |
在线时间 | 5717 小时 |
Lv5.捕梦者
- 梦石
- 0
- 星屑
- 39016
- 在线时间
- 5717 小时
- 注册时间
- 2006-11-10
- 帖子
- 6619
|
本帖最后由 灯笼菜刀王 于 2020-7-23 16:00 编辑
- TIME_OUT_SW = 10086 #时间到打开的开关编号
- class Window_Message < Window_Selectable
- def update
- super
- # 渐变的情况下
- if @fade_in
- self.contents_opacity += 24
- if @input_number_window != nil
- @input_number_window.contents_opacity += 24
- end
- if self.contents_opacity == 255
- @fade_in = false
- end
- return
- end
- # 输入数值的情况下
- if @input_number_window != nil
- @input_number_window.update
- if Input.trigger?(Input::C)
- $game_system.se_play($data_system.decision_se)
- $game_variables[$game_temp.num_input_variable_id] =
- @input_number_window.number
- $game_map.need_refresh = true
- @input_number_window.dispose
- @input_number_window = nil
- terminate_message
- end
- return
- end
- if @contents_showing
- if $game_temp.choice_max == 0
- self.pause = true
- end
- if $game_switches[TIME_OUT_SW]
- if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
- $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
- terminate_message
- end
- $game_switches[TIME_OUT_SW] = false
- end
- # 取消
- if Input.trigger?(Input::B)
- if $game_temp.choice_max > 0 and $game_temp.choice_cancel_type > 0
- $game_system.se_play($data_system.cancel_se)
- $game_temp.choice_proc.call($game_temp.choice_cancel_type - 1)
- terminate_message
- end
- end
- # 确定
- if Input.trigger?(Input::C)
- if $game_temp.choice_max > 0
- $game_system.se_play($data_system.decision_se)
- $game_temp.choice_proc.call(self.index)
- end
- terminate_message
- end
- return
- end
- if @fade_out == false and $game_temp.message_text != nil
- @contents_showing = true
- $game_temp.message_window_showing = true
- reset_window
- refresh
- Graphics.frame_reset
- self.visible = true
- self.contents_opacity = 0
- if @input_number_window != nil
- @input_number_window.contents_opacity = 0
- end
- @fade_in = true
- return
- end
- # 没有可以显示的信息、但是窗口为可见的情况下
- if self.visible
- @fade_out = true
- self.opacity -= 48
- if self.opacity == 0
- self.visible = false
- @fade_out = false
- $game_temp.message_window_showing = false
- end
- return
- end
- end
- end
复制代码
把这个塞到MAIN前, 第一行设置好编号, 打开这个开关的时候就会强制执行选择"取消"的选项
然后在选项之前启动一个并行处理, 内容为等待XX帧, 然后打开时间到开关(记得关闭自身,避免一直处于并行处理状态) 就实现了限时回答的功能
至于计时条的UI什么的,用图片一起并行处理显示就好啦 |
评分
-
查看全部评分
|