class Window_Base < Window
alias initialize_old initialize
def initialize(x, y, width, height)
initialize_old(x, y, width, height)
self.back_opacity = Wallpaper::WINDOW_BACK_OPACITY
end
end
class Scene_Wallpaper < Scene_Base
#--------------------------------------------------------------------------
# ● 初始化对象
#--------------------------------------------------------------------------
def initialize(paperstyle = $game_system.wallpaper)
@paperstyle = paperstyle
end
#--------------------------------------------------------------------------
# ● 开始处理
#--------------------------------------------------------------------------
def start
super
paper_show
create_keys_help
end
#--------------------------------------------------------------------------
# ● 结束处理
#--------------------------------------------------------------------------
def terminate
super
@keys_help_sprite.dispose
@papersprite.dispose
end
#--------------------------------------------------------------------------
# ● 返回上级画面
#--------------------------------------------------------------------------
def return_scene
$scene = Scene_Menu.new(5)
end
#--------------------------------------------------------------------------
# ● 下一张预览
#--------------------------------------------------------------------------
def nextpic
@paperstyle += 1
if @paperstyle == Wallpaper::PAPERMAX + 1
@paperstyle = 0
end
$scene = Scene_Wallpaper.new(@paperstyle)
end
#--------------------------------------------------------------------------
# ● 上一张预览
#--------------------------------------------------------------------------
def prevpic
@paperstyle -= 1
if @paperstyle == -1
@paperstyle = Wallpaper::PAPERMAX
end
$scene = Scene_Wallpaper.new(@paperstyle)
end
#--------------------------------------------------------------------------
# ● 更新画面
#--------------------------------------------------------------------------
def update
super
if Input.trigger?(Input::B)
Sound.play_cancel
return_scene
elsif Input.trigger?(Input::C)
$game_system.wallpaper = @paperstyle
Sound.play_decision
return_scene
end
if Input.trigger?(Input::UP) || Input.trigger?(Input::LEFT)
prevpic
elsif Input.trigger?(Input::DOWN) || Input.trigger?(Input::RIGHT)
nextpic
end
end
#--------------------------------------------------------------------------
# ● 生成按键帮助
#--------------------------------------------------------------------------
def create_keys_help
bitmap = Cache.background("crosskey")
@keys_help_sprite = Sprite.new
@keys_help_sprite.bitmap = Bitmap.new(Graphics.width, 32)
@keys_help_sprite.x = 170
@keys_help_sprite.y = Graphics.height - 32
@keys_help_sprite.bitmap.blt(240, 2, bitmap,bitmap.rect)
@keys_help_sprite.bitmap.draw_text(290, 0 ,128, 24, "切换预览")
end
#--------------------------------------------------------------------------
# ● 预览壁纸
#--------------------------------------------------------------------------
def paper_show
if @paperstyle == 0
bitmap = $game_temp.background_bitmap_temp
else
bitmap = Cache.background("#{@paperstyle}")
end
@papersprite = Sprite.new
@papersprite.bitmap = Bitmap.new(Graphics.width, Graphics.height)
@papersprite.bitmap.blt(0, 0, bitmap, bitmap.rect)
end
end
于是脚本Scene_Menu中出现错误,就是那个游戏时间显示问题。
def update
super
update_menu_background
@command_window.update
@gold_window.update
@status_window.update
@Window_PlayTime.update
if @command_window.active
update_command_selection
elsif @status_window.active
update_actor_selection
end
end
显示@Window_PlayTime.update这一句发生错误。
难道要我将显示游戏时间的那些脚本全删掉吗??能不能在上面的脚本上改动一下,加个显示时间什么的而不用改变Scene_Menu里面的东西??
求教~~~脚本我不会啊~~~