Project1
标题:
很多选择该怎么办
[打印本页]
作者:
暗●乩童
时间:
2008-1-10 18:51
标题:
很多选择该怎么办
遇到某个事件后,会跳出100个选择,不同的选择都会打开一个不同的开关,哪位高手教教我该如何做?对话框的样子,像RM默认的物品浏览窗口,但不需要显示物品图片。 [LINE]1,#dddddd[/LINE]
版务信息:本贴由楼主自主结贴~
作者:
暗●乩童
时间:
2008-1-10 18:51
标题:
很多选择该怎么办
遇到某个事件后,会跳出100个选择,不同的选择都会打开一个不同的开关,哪位高手教教我该如何做?对话框的样子,像RM默认的物品浏览窗口,但不需要显示物品图片。 [LINE]1,#dddddd[/LINE]
版务信息:本贴由楼主自主结贴~
作者:
精灵使者
时间:
2008-1-10 18:53
我记得有一个超级选择项脚本……
作者:
最後一滴淚
时间:
2008-1-10 19:05
class Game_Temp
attr_accessor :need_show_more
attr_accessor :window_pos_y
attr_accessor :choices
alias old_ini initialize
def initialize
old_ini
@need_show_more = false
@window_pos_y = 16
@choices = nil
end
end
class Window_Message < Window_Selectable
alias old_ref refresh
def refresh
if $game_temp.need_show_more
self.y = $game_temp.window_pos_y
self.height = 160 + 32 * ($game_temp.choice_max - 4)
self.contents = Bitmap.new(self.width - 32, self.height - 32)
else
self.height = 160
self.contents = Bitmap.new(self.width - 32, self.height - 32)
end
old_ref
end
#--------------------------------------------------------------------------
# ● 刷新画面
#--------------------------------------------------------------------------
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 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)
$game_variables[100] = $game_temp.choice_cancel_type - 1
$game_temp.need_show_more = false
terminate_message
end
end
# 确定
if Input.trigger?(Input::C)
if $game_temp.choice_max > 0
$game_system.se_play($data_system.decision_se)
$game_variables[100] = self.index
$game_temp.choice_proc.call(self.index)
end
$game_temp.need_show_more = false
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
class Interpreter
def command_102
# 文章已经设置过 message_text 的情况下
if $game_temp.message_text != nil
# 结束
return false
end
# 设置信息结束后待机和返回调用标志
@message_waiting = true
$game_temp.message_proc = Proc.new { @message_waiting = false }
# 设置选择项
$game_temp.message_text = ""
$game_temp.choice_start = 0
if $game_temp.need_show_more
@parameters = [$game_temp.choices, $game_temp.choice_cancel_type]
end
setup_choices(@parameters)
# 继续
return true
end
end
复制代码
http://rpg.blue/web/htm/news371.htm
[LINE]1,#dddddd[/LINE]
系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1