加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
本帖最后由 飞翔的小鸟3 于 2017-10-4 19:49 编辑
之前问过一个帖子,类似问题,原因是我自己释放一次,然后在Scene_Base自动释放一次,导致错误
这次是指向Window_Selectable,他或者他的父类是否有一样的自动释放的代码?我找不到啊。
然后,有一个奇怪的问题,我是按同一个键打开关闭血条,按一两次不会出错,要按多次才会出错。这很奇怪。
第一个问题解决了,图片pass掉
血量窗口:
class Blood_rect < Window_Selectable def initialize super(436,-12,124,49) end def open_rect $blood_rect.opacity = 0 a = Color.new(255,0,0) $blood_rect.contents.clear $blood_rect.contents.fill_rect(0,0,$game_variables[14],25,a) end def close_rect $blood_rect.contents.clear $blood_rect.contents.dispose $blood_rect.dispose end end
class Blood_rect < Window_Selectable
def initialize
super(436,-12,124,49)
end
def open_rect
$blood_rect.opacity = 0
a = Color.new(255,0,0)
$blood_rect.contents.clear
$blood_rect.contents.fill_rect(0,0,$game_variables[14],25,a)
end
def close_rect
$blood_rect.contents.clear
$blood_rect.contents.dispose
$blood_rect.dispose
end
end
这个可以不用管他,用来调出血条的快捷调用窗口
class Window_shortcut < Window_Command def initialize super(0,250) make_command_list command_window activate item_max process_cursor_move end def make_command_list add_command("开启/关闭残血量", :blood_volume) add_command("开启/关闭残弹量", :Bomb_residue) add_command("更换武器", :change_weapon) end def command_window set_handler(:blood_volume, method(:run_blood_volume)) set_handler(:Bomb_residue, method(:run_Bomb_residue)) set_handler(:change_weapon, method(:run_change_weapon)) end def run_blood_volume activate $var2 ||= 0 $var2 = ($var2 == 0 ? 1 : 0 ) if $var2 == 1 $game_switches[38] = true else $var2 == 0 $game_switches[39] = true end end def run_Bomb_residue end def run_change_weapon end def item_max return 3 end def process_cursor_move return unless cursor_movable? last_index = @index cursor_down (Kboard.keyboard(0x32)) if Kboard.keyboard(0x32) cursor_up (Kboard.keyboard(0x31)) if Kboard.keyboard(0x31) Sound.play_cursor if @index != last_index end end
class Window_shortcut < Window_Command
def initialize
super(0,250)
make_command_list
command_window
activate
item_max
process_cursor_move
end
def make_command_list
add_command("开启/关闭残血量", :blood_volume)
add_command("开启/关闭残弹量", :Bomb_residue)
add_command("更换武器", :change_weapon)
end
def command_window
set_handler(:blood_volume, method(:run_blood_volume))
set_handler(:Bomb_residue, method(:run_Bomb_residue))
set_handler(:change_weapon, method(:run_change_weapon))
end
def run_blood_volume
activate
$var2 ||= 0
$var2 = ($var2 == 0 ? 1 : 0 )
if $var2 == 1
$game_switches[38] = true
else $var2 == 0
$game_switches[39] = true
end
end
def run_Bomb_residue
end
def run_change_weapon
end
def item_max
return 3
end
def process_cursor_move
return unless cursor_movable?
last_index = @index
cursor_down (Kboard.keyboard(0x32)) if Kboard.keyboard(0x32)
cursor_up (Kboard.keyboard(0x31)) if Kboard.keyboard(0x31)
Sound.play_cursor if @index != last_index
end
end
|