把*Plugin_BattleCommand改成
#============================================================================== class Window_BattleCommand < Window_Selectable #-------------------------------------------------------------------------- def initialize super(0, 0, 180, 60) self.contents = Bitmap.new(width - 32, height - 32) self.back_opacity = 160 @commands = ["攻","技","防","物","逃"] @item_max = 5 @column_max = 5 refresh self.active = false self.visible = false self.index = 0 end #--------------------------------------------------------------------------- def refresh self.contents.clear for i in 0...@item_max if i == 5#如果你把"逃"和"撤退"合并了就在后面添一个"-1" unless $game_temp.battle_can_escape disable_item(i) end else draw_item(i) end end end #-------------------------------------------------------------------------- def draw_item(index,color=normal_color) x = index % 5 * 30 y = index / 5 * 30 self.contents.font.color = color#Color.new(255, 255, 255, 128)#normal_color self.contents.draw_text(x, y, 30, 30, @commands[index], 1) end #-------------------------------------------------------------------------- def update_cursor_rect x = index % 5 * 30 y = index / 5 * 30 self.cursor_rect.set(x, y, 30, 30) end #-------------------------------------------------------------------------- # 卐 项目无效化 # index : 项目编号 #-------------------------------------------------------------------------- def disable_item(index) draw_item(index,disabled_color) end end #===============================================================================
#==============================================================================
class Window_BattleCommand < Window_Selectable
#--------------------------------------------------------------------------
def initialize
super(0, 0, 180, 60)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 160
@commands = ["攻","技","防","物","逃"]
@item_max = 5
@column_max = 5
refresh
self.active = false
self.visible = false
self.index = 0
end
#---------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...@item_max
if i == 5#如果你把"逃"和"撤退"合并了就在后面添一个"-1"
unless $game_temp.battle_can_escape
disable_item(i)
end
else
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
def draw_item(index,color=normal_color)
x = index % 5 * 30
y = index / 5 * 30
self.contents.font.color = color#Color.new(255, 255, 255, 128)#normal_color
self.contents.draw_text(x, y, 30, 30, @commands[index], 1)
end
#--------------------------------------------------------------------------
def update_cursor_rect
x = index % 5 * 30
y = index / 5 * 30
self.cursor_rect.set(x, y, 30, 30)
end
#--------------------------------------------------------------------------
# 卐 项目无效化
# index : 项目编号
#--------------------------------------------------------------------------
def disable_item(index)
draw_item(index,disabled_color)
end
end
#===============================================================================
|