赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 55044 |
最后登录 | 2022-1-4 |
在线时间 | 49 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 95
- 在线时间
- 49 小时
- 注册时间
- 2006-5-7
- 帖子
- 526
|
简单的整合教学,或者说其实是对各种对话强化脚本的依样修改.......
以66增强对话框为例(http://rpg.blue/web/htm/news29.htm)
首先是初始化部分
#--------------------------------------------------------------------------
# ● 初始化状态
#--------------------------------------------------------------------------
def initialize
super(80, 304, 480, 160)
self.contents = Bitmap.new(width - 32, height - 32)
self.visible = false
self.z = 9998
@fade_in = false
@fade_out = false
@contents_showing = false
@cursor_width = 0
self.active = false
self.index = -1
@popchar = -2
@alignment = true
end
此部分与默认对话基本相同,在中间任意处加入对进度条颜色的定义
#★★★★★★★★★★★★★★★★★★★★★★★★★
@color1=Color.new(255,255,255,128)
#★★★★★★★★★★★★★★★★★★★★★★★★★
然后搜索if $game_temp.choice_max > 0,找到对选择项和数值输入的处理部分
- if $game_temp.choice_max > 0
- @item_max = $game_temp.choice_max
- self.active = true
- self.index = 0
- end
- if $game_temp.num_input_variable_id > 0
- digits_max = $game_temp.num_input_digits_max
- number = $game_variables[$game_temp.num_input_variable_id]
- @input_number_window = Window_InputNumber.new(digits_max)
- @input_number_window.number = number
- @input_number_window.x = self.x + 8
- @input_number_window.y = self.y + $game_temp.num_input_start * 32
- end
复制代码
分别加点东西,变成
- if $game_temp.choice_max > 0
- @item_max = $game_temp.choice_max
- self.active = true
- self.index = 0
- #★★★★★★★★★★★★★★★★★★★★★★★★★
- @count=0
- if $game_variables[100]>0
- @sel=true
- end
- #★★★★★★★★★★★★★★★★★★★★★★★★★
- end
- if $game_temp.num_input_variable_id > 0
- digits_max = $game_temp.num_input_digits_max
- number = $game_variables[$game_temp.num_input_variable_id]
- @input_number_window = Window_InputNumber.new(digits_max)
- @input_number_window.number = number
- @input_number_window.x = self.x + 8
- @input_number_window.y = self.y + $game_temp.num_input_start * 32
- #★★★★★★★★★★★★★★★★★★★★★★★★★
- @count=0
- if $game_variables[100]>0
- @inp=true
- end
- #★★★★★★★★★★★★★★★★★★★★★★★★★
- end
复制代码
下面是刷新的部分也就是核心内容,搜索def update
近接着def update加入
- #★★★★★★★★★★★★★★★★★★★★★★★★★
- if @sel
- @count+=1
- self.contents.fill_rect(0, 0, 480*@count/$game_variables[100],2 , @color1)
- # p @count
- if ($game_temp.choice_max > 0 and @count>=$game_variables[100])#即等待的帧数100号变量
- $game_system.se_play($data_system.decision_se)
- $game_temp.choice_proc.call($game_variables[101])#即默认选择项101号变量
- $game_variables[102]=@count
- @count=0
- @sel=false
- terminate_message
- end
- elsif @inp
- @count+=1
- self.contents.fill_rect(0, 0, 480*@count/$game_variables[100],2 , @color1)
- # p @count
- if @count>=$game_variables[100]
- $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
- @count=0
- @inp=false
- terminate_message
- end
-
- 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)
- 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
复制代码
修改
- # 输入数值的情况下
- 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
- #★★★★★★★★★★★★★★★★★★★★★★★★★
- $game_variables[102]=@count
- if @inp
- @count=0
- @inp=false
- end
- #★★★★★★★★★★★★★★★★★★★★★★★★★
- 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)
- 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)
- #★★★★★★★★★★★★★★★★★★★★★★★★★
- $game_variables[102]=@count
- if @sel
- @count=0
- @sel=false
- end
- #★★★★★★★★★★★★★★★★★★★★★★★★★
- end
- terminate_message
复制代码
至此,修改完成! |
|