Project1
标题: 【VX】前辈们帮我看看这个战斗选项图标的问题 [打印本页]
作者: 1341469131 时间: 2011-12-19 23:06
标题: 【VX】前辈们帮我看看这个战斗选项图标的问题
本帖最后由 仲秋启明 于 2011-12-20 15:58 编辑
我是用这个修改图标的脚本的。。但不知道为什么按照方法导入叫本后。。图标却没显示 。。详细看图- #==============================================================================
- # ■ Window_ActorCommand
- #------------------------------------------------------------------------------
- # 战斗画面显示角色指令的窗口。
- #==============================================================================
- class Window_ActorCommand < Window_Selectable
- #--------------------------------------------------------------------------
- # ● 定义实例变量
- #--------------------------------------------------------------------------
- attr_reader :commands # 命令
- #--------------------------------------------------------------------------
- # ● 初始化对象
- # width : 窗口的宽
- # commands : 命令字符串序列
- # column_max : 行数 (2 行以上时选择)
- # row_max : 列数 (0:列数加起来)
- # spacing : 选项横向排列时间隔空白宽度
- #--------------------------------------------------------------------------
- def initialize(width = 150, commands = [], column_max = 1, row_max = 4, spacing = 32)
- if row_max == 0
- row_max = (commands.size + column_max - 1) / column_max
- end
- super(0, 0, width, row_max * WLH + 32, spacing)
- self.active = false
- @commands = []
- @icon_list = [1, 52, 128, 144]
- @item_max = commands.size
- @column_max = column_max
- @remember_index = -1
- self.index = 0
- # refresh
- update
- end
- #--------------------------------------------------------------------------
- # ● 刷新
- #--------------------------------------------------------------------------
- def refresh
- self.contents.clear
- for i in 0...@item_max
- draw_item(i)
- end
- end
- #--------------------------------------------------------------------------
- # ● 设置自定义特技指令名称
- # actor :角色
- #--------------------------------------------------------------------------
- def setup(actor)
- s1 = Vocab::attack
- s2 = Vocab::skill
- s3 = Vocab::guard
- s4 = Vocab::item
- if actor.class.skill_name_valid # 特技指令名称有效?
- s2 = actor.class.skill_name # 替换指令名
- end
- @commands = [s1, s2, s3, s4]
- @item_max = 4
- refresh
- self.index = 0
- end
-
- #--------------------------------------------------------------------------
- # ● 描绘项目
- # index : 项目编号
- # enabled : 有效标记录。是false 的时候半透明绘画
- #--------------------------------------------------------------------------
- def draw_item(index, enabled = true)
- rect = item_rect(index)
- rect.x += 4
- rect.width -= 8
- self.contents.clear_rect(rect)
- draw_icon(@icon_list[index], rect.x, rect.y, true) if index == self.index
- self.contents.font.color = normal_color
- self.contents.font.color.alpha = enabled ? 255 : 128
- rect.x += 26
- self.contents.draw_text(rect, @commands[index])
- end
-
- #--------------------------------------------------------------------------
- # ● 刷新类型
- #--------------------------------------------------------------------------
- def update
- super
- @remember_index = self.index if self.index == -1
- if @remember_index != self.index
- @remember_index = self.index
- refresh
- end
- end
-
- end
复制代码