赞 | 0 |
VIP | 0 |
好人卡 | 0 |
积分 | 1 |
经验 | 0 |
最后登录 | 2009-2-6 |
在线时间 | 0 小时 |
Lv1.梦旅人
- 梦石
- 0
- 星屑
- 525
- 在线时间
- 0 小时
- 注册时间
- 2009-2-5
- 帖子
- 2
|
加入我们,或者,欢迎回来。
您需要 登录 才可以下载或查看,没有帐号?注册会员
x
需要加入一个新菜单,比如$scene = Scene_Lvup.new,请问该如何更改?
尝试过2L,3L,4L的方法,都是出现WINDOW_BASE错误
出错内容如下
bitmap = Cache.system("Iconset")
rect = Rect.new(icon_index % 16 * 24, icon_index / 16 * 24, 24, 24)
self.contents.blt(x, y, bitmap, rect, enabled ? 255 : 128)
- #==============================================================================
- # ■ Scene_Menu
- #==============================================================================
- class Scene_Menu < Scene_Base
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # menu_index : 指令光标初期位置
- # show : 是否动态出现菜单
- #--------------------------------------------------------------------------
- def initialize(menu_index = 0, show = false)
- @menu_index = menu_index
- @status_index = 0
- @show = show
- end
- #--------------------------------------------------------------------------
- # ● 开始处理
- #--------------------------------------------------------------------------
- def start
- super
- create_menu_background
- create_command_window
- @gold_window = Window_Gold.new(384, 360)
- @gold_window.opacity = 0
- @gold_window.y = @show ? 416 : 360
- @status_window = Window_MenuTarget.new(64, 144)
- @status_window.visible = false
- @status_window.openness = 0
- @help_window = Window_Help.new
- @help_window.y = @show ? -56 : 0
- @command_window.help_window = @help_window
- end
- #--------------------------------------------------------------------------
- # ● 结束处理
- #--------------------------------------------------------------------------
- def terminate
- super
- dispose_menu_background
- @command_window.dispose
- @gold_window.dispose
- @status_window.dispose
- @help_window.dispose
- end
- #--------------------------------------------------------------------------
- # ● 更新画面
- #--------------------------------------------------------------------------
- def update
- super
- update_menu_background
- @command_window.update
- @gold_window.update
- @status_window.update
- @help_window.update
- loop do
- break if @help_window.y >= 0
- @help_window.y += 8
- @gold_window.y -= 8
- @command_window.y -= 8
- Graphics.update
- end
- @help_window.y = 0
- @command_window.y = 360
- if @command_window.active
- update_command_selection
- if @menu_index != @command_window.index
- @menu_index = @command_window.index
- @command_window.refresh
- end
- elsif @status_window.active
- update_actor_selection
- if @status_index != @status_window.index
- @status_index = @status_window.index
- @status_window.refresh
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● 打开指令窗口
- #--------------------------------------------------------------------------
- def show_status_window
- @status_window.open
- begin
- @status_window.update
- Graphics.update
- end until @status_window.openness == 255
- end
- #--------------------------------------------------------------------------
- # ● 关闭指令窗口
- #--------------------------------------------------------------------------
- def hide_status_window
- @status_window.close
- begin
- @status_window.update
- Graphics.update
- end until @status_window.openness == 0
- end
- #--------------------------------------------------------------------------
- # ● 菜单背景快照
- #--------------------------------------------------------------------------
- def snapshot_for_sub_menu
- $game_temp.sub_menu_bitmap.dispose
- $game_temp.sub_menu_bitmap = Graphics.snap_to_bitmap
- end
- #--------------------------------------------------------------------------
- # ● 生成菜单画面背景
- #--------------------------------------------------------------------------
- def create_menu_background
- @menuback_sprite = Sprite.new
- @menuback_sprite.bitmap = $game_temp.menu_bitmap
- update_menu_background
- end
- #--------------------------------------------------------------------------
- # ● 生成指令窗口
- #--------------------------------------------------------------------------
- def create_command_window
- s1 = Vocab::item
- s2 = Vocab::skill
- s3 = Vocab::equip
- s4 = Vocab::status
- s5 = Vocab::save
- s6 = Vocab::game_end
- @command_window = Window_Menu_Command.new(544, [s1, s2, s3, s4, s5, s6])
- @command_window.y = @show ? 416 : 360
- @command_window.index = @menu_index
- @command_window.refresh
- if $game_party.members.size == 0 # 同伴人数为 0 的情况下
- @command_window.draw_item(0, false) # 物品无效化
- @command_window.draw_item(1, false) # 特技无效化
- @command_window.draw_item(2, false) # 装备无效化
- @command_window.draw_item(3, false) # 状态无效化
- end
- if $game_system.save_disabled # 禁止存档的情况下
- @command_window.draw_item(4, false) # 存档无效化
- end
- end
- #--------------------------------------------------------------------------
- # ● 更新指令选择
- #--------------------------------------------------------------------------
- def update_command_selection
- if Input.trigger?(Input::B)
- loop do
- break if @help_window.y <= -56
- @help_window.y -= 8
- @gold_window.y += 8
- @command_window.y += 8
- Graphics.update
- end
- Sound.play_cancel
- $scene = Scene_Map.new
- elsif Input.trigger?(Input::C)
- if $game_party.members.size == 0 and @command_window.index < 4
- Sound.play_buzzer
- return
- elsif $game_system.save_disabled and @command_window.index == 4
- Sound.play_buzzer
- return
- end
- Sound.play_decision
- case @command_window.index
- when 0 # 物品
- @help_window.set_text("")
- snapshot_for_sub_menu
- $scene = Scene_Item.new
- when 1,2,3 # 特技、装备、状态
- @help_window.set_text("")
- snapshot_for_sub_menu
- start_actor_selection
- when 4 # 存档
- @help_window.set_text("")
- snapshot_for_sub_menu
- $scene = Scene_File.new(true, false, false)
- when 5 # 游戏结束
- @help_window.set_text("")
- snapshot_for_sub_menu
- $scene = Scene_End.new
- end
- end
- end
- #--------------------------------------------------------------------------
- # ● アクター選択の開始
- #--------------------------------------------------------------------------
- def start_actor_selection
- @command_window.active = false
- @status_window.active = true
- @status_window.visible = true
- show_status_window
- if $game_party.last_actor_index < @status_window.item_max
- @status_window.index = $game_party.last_actor_index
- else
- @status_window.index = 0
- end
- end
- #--------------------------------------------------------------------------
- # ● アクター選択の終了
- #--------------------------------------------------------------------------
- def end_actor_selection
- @command_window.active = true
- @status_window.active = false
- hide_status_window
- @status_window.visible = false
- @status_window.index = -1
- end
- #--------------------------------------------------------------------------
- # ● アクター選択の更新
- #--------------------------------------------------------------------------
- def update_actor_selection
- if Input.trigger?(Input::B)
- Sound.play_cancel
- end_actor_selection
- elsif Input.trigger?(Input::C)
- $game_party.last_actor_index = @status_window.index
- Sound.play_decision
- case @command_window.index
- when 1 # スキル
- $scene = Scene_Menu_Skill.new(@status_window.index)
- when 2 # 装備
- $scene = Scene_Equip.new(@status_window.index)
- when 3 # ステータス
- $scene = Scene_Status.new(@status_window.index)
- end
- end
- end
- end
复制代码 此贴于 2009-2-11 23:04:45 被版主八云紫提醒,请楼主看到后对本贴做出回应。 本贴由论坛斑竹八云紫结贴,如楼主认为问题未解决,请重新将此贴编辑为“有事请教”,并回帖叙述疑点即可~ ^-^ |
|