赞 | 0 |
VIP | 1 |
好人卡 | 0 |
积分 | 1 |
经验 | 6986 |
最后登录 | 2013-3-15 |
在线时间 | 55 小时 |
Lv1.梦旅人 v
- 梦石
- 0
- 星屑
- 50
- 在线时间
- 55 小时
- 注册时间
- 2007-12-19
- 帖子
- 99
|
订造系统的话,悬赏积分会更加有干劲哦,不过反正我今天比较有干劲也就做了 =v=
由于增加了菜单选项,Window_Command描绘项目那里需要修改,Scene_Menu那里也加个选项就好了
替换Window_Command:- #==============================================================================
- # ■ Window_Command
- #------------------------------------------------------------------------------
- # 一般的命令选择行窗口。
- #==============================================================================
- class Window_Command < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 初始化对像
- # width : 窗口的宽
- # commands : 命令字符串序列
- #--------------------------------------------------------------------------
- def initialize(width, commands)
- # 由命令的个数计算出窗口的高
- super(0, 0, width, commands.size * 32 + 32)
- @item_max = commands.size
- @commands = commands
- if $scene.is_a?(Scene_Menu)
- #@column_max = 6
- @column_max = @item_max
- end
- self.contents = Bitmap.new(width - 32, @item_max * 32)
- refresh
- self.index = 0
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...@item_max
- draw_item(i, normal_color)
- end
- end
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- # color : 文字色
- #--------------------------------------------------------------------------
- def draw_item(index, color)
- self.contents.font.color = color
- #rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
- if $scene.is_a?(Scene_Menu)
- #rect = Rect.new(107 * index+13, 0, 107, 32) #这行改成你自己的描绘项目规则
- cursor_width = self.width / @column_max - 32
- x = index % @column_max * (cursor_width + 32)
- rect = Rect.new(x, 0, cursor_width, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- self.contents.draw_text(rect, @commands[index], 1)
- else
- rect = Rect.new(4, 32 * index, self.contents.width - 8, 32)
- self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- self.contents.draw_text(rect, @commands[index])
- end
- #self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
- #self.contents.draw_text(rect, @commands[index])
- end
- #--------------------------------------------------------------------------
- # ● 项目无效化
- # index : 项目编号
- #--------------------------------------------------------------------------
- def disable_item(index)
- draw_item(index, disabled_color)
- end
- end
复制代码 替换Scene_Menu: 系统信息:本贴由楼主认可为正确答案,66RPG感谢您的热情解答~ |
|