设为首页收藏本站|繁體中文

Project1

 找回密码
 注册会员
搜索

关于RGSS3窗口消除的问题

查看数: 2856 | 评论数: 4 | 收藏 0
关灯 | 提示:支持键盘翻页<-左 右->
    组图打开中,请稍候......
发布时间: 2012-7-11 12:06

正文摘要:

本帖最后由 abc1236762 于 2012-7-11 12:12 编辑 要如何在选择装备、技能选项时或取消选择技能、装备选项时消除Window_MenuStutasBody窗口? RUBY 代码复制#encoding:utf-8#=========== ...

回复

abc1236762 发表于 2012-7-11 18:26:47
出现
Script '◎Windows_Base' line 84:RGSSError occurred
disposed window
这错误窗口
铅笔描绘的思念 发表于 2012-7-11 17:03:04
abc1236762 发表于 2012-7-11 14:39
补了你的代码
  #--------------------------------------------------------------------------
  # ● 个 ...

不会更新的话。。。我木有办法。。找别人吧。。b= =。。其他两个比较容易。。替换Scene_Menu
  1. #encoding:utf-8
  2. #==============================================================================
  3. # ■ Scene_Menu
  4. #------------------------------------------------------------------------------
  5. #  選單畫面
  6. #==============================================================================

  7. class Scene_Menu < Scene_MenuBase
  8.   #-------------------------------------------------------------------------- #
  9.   # ● 開始處理 #
  10.   #-------------------------------------------------------------------------- #
  11.   def start #
  12.     super #
  13.     create_command_window #
  14.     create_information_window #
  15.     create_status_window #
  16.   end #
  17.   #--------------------------------------------------------------------------
  18.   # ● 生成指令視窗
  19.   #--------------------------------------------------------------------------
  20.   def create_command_window
  21.     @command_window = Window_MenuCommand.new
  22.     @command_window.y = 2 #
  23.     @command_window.opacity = 0 #
  24.     @command_window.set_handler(:item,      method(:command_item))
  25.     @command_window.set_handler(:skill,     method(:command_personal))
  26.     @command_window.set_handler(:equip,     method(:command_personal))
  27.     @command_window.set_handler(:status,    method(:command_personal))
  28.     @command_window.set_handler(:formation, method(:command_formation))
  29.     @command_window.set_handler(:save,      method(:command_save))
  30.     @command_window.set_handler(:game_end,  method(:command_game_end))
  31.     @command_window.set_handler(:cancel,    method(:return_scene))
  32.   end
  33.   #-------------------------------------------------------------------------- #
  34.   # ● 生成遊戲資訊視窗 #
  35.   #-------------------------------------------------------------------------- #
  36.   def create_information_window #
  37.     @gold_window = Window_Information.new #
  38.     @gold_window.x = 0 #
  39.     @gold_window.y = Graphics.height - @gold_window.height - 2 #
  40.     @gold_window.opacity = 0 #
  41.   end #
  42.   #--------------------------------------------------------------------------
  43.   # ● 生成狀態視窗
  44.   #--------------------------------------------------------------------------
  45.   def create_status_window
  46.     @status_window = Window_MenuStatus.new(0, @command_window.height - 2 + 2) #@status_window = Window_MenuStatus.new(@command_window.width, 0)
  47.     @status_window.opacity = 0 #
  48.   end  
  49.   #--------------------------------------------------------------------------
  50.   # ● 生成body視窗 @menustutasbody_window.refresh
  51.   #--------------------------------------------------------------------------
  52.   def create_bodystatus_window
  53.     @menustutasbody_window = Window_MenuStutasBody.new(@actor)
  54.     @menustutasbody_window.opacity = 0
  55.   end  
  56.   #--------------------------------------------------------------------------
  57.   # ● 指令“物品”
  58.   #--------------------------------------------------------------------------
  59.   def command_item
  60.     SceneManager.call(Scene_Item)
  61.   end
  62.   #--------------------------------------------------------------------------
  63.   # ● 指令“技能”“裝備”“狀態”
  64.   #--------------------------------------------------------------------------
  65.   def command_personal
  66.     @status_window.select_last
  67.     @status_window.activate
  68.     create_bodystatus_window #
  69.     @status_window.set_handler(:ok,     method(:on_personal_ok))
  70.     @status_window.set_handler(:cancel, method(:on_personal_cancel))
  71.   end
  72.   #--------------------------------------------------------------------------
  73.   # ● 指令“整隊”
  74.   #--------------------------------------------------------------------------
  75.   def command_formation
  76.     @status_window.select_last
  77.     @status_window.activate
  78.     @status_window.set_handler(:ok,     method(:on_formation_ok))
  79.     @status_window.set_handler(:cancel, method(:on_formation_cancel))
  80.   end
  81.   #--------------------------------------------------------------------------
  82.   # ● 指令“存檔”
  83.   #--------------------------------------------------------------------------
  84.   def command_save
  85.     SceneManager.call(Scene_Save)
  86.   end
  87.   #--------------------------------------------------------------------------
  88.   # ● 指令“結束游戲”
  89.   #--------------------------------------------------------------------------
  90.   def command_game_end
  91.     SceneManager.call(Scene_End)
  92.   end
  93.   #--------------------------------------------------------------------------
  94.   # ● 個人指令“確定”
  95.   #--------------------------------------------------------------------------
  96.   def on_personal_ok
  97.     case @command_window.current_symbol
  98.     when :skill
  99.       SceneManager.call(Scene_Skill)
  100.     when :equip
  101.       SceneManager.call(Scene_Equip)
  102.     when :status
  103.       SceneManager.call(Scene_Status)
  104.     end
  105.   end
  106.   #--------------------------------------------------------------------------
  107.   # ● 個人指令“取消”
  108.   #--------------------------------------------------------------------------
  109.   def on_personal_cancel
  110.     @status_window.unselect
  111.     @command_window.activate
  112.     @menustutasbody_window.dispose
  113.   end
  114.   #--------------------------------------------------------------------------
  115.   # ● 整隊“確定”
  116.   #--------------------------------------------------------------------------
  117.   def on_formation_ok
  118.     if @status_window.pending_index >= 0
  119.       $game_party.swap_order(@status_window.index,
  120.                              @status_window.pending_index)
  121.       @status_window.pending_index = -1
  122.       @status_window.redraw_item(@status_window.index)
  123.     else
  124.       @status_window.pending_index = @status_window.index
  125.     end
  126.     @status_window.activate
  127.   end
  128.   #--------------------------------------------------------------------------
  129.   # ● 整隊“取消”
  130.   #--------------------------------------------------------------------------
  131.   def on_formation_cancel
  132.     if @status_window.pending_index >= 0
  133.       @status_window.pending_index = -1
  134.       @status_window.activate
  135.     else
  136.       @status_window.unselect
  137.       @command_window.activate
  138.     end
  139.   end
  140. end
复制代码
铅笔描绘的思念 发表于 2012-7-11 14:04:19
本帖最后由 铅笔描绘的思念 于 2012-7-11 16:41 编辑

@menustutasbody_window.dispose
拿上你的纸笔,建造一个属于你的梦想世界,加入吧。
 注册会员
找回密码

站长信箱:[email protected]|手机版|小黑屋|无图版|Project1游戏制作

GMT+8, 2024-11-23 19:28

Powered by Discuz! X3.1

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表