#============================================================================== # ■ XP-RGSS-33 コマンドスキル<コマンド表示> [Ver.1.1.0] by Claimh #------------------------------------------------------------------------------ #  スキル画面、バトル画面で、使用できるスキルの一覧を表示するウィンドウです。 #============================================================================== class Window_Skill < Window_Selectable #-------------------------------------------------------------------------- # ● オブジェクト初期化 # actor : アクター #-------------------------------------------------------------------------- def initialize(actor) super(0, 128, 640, 352) @actor = actor @column_max = 1 # 1列表示 refresh self.index = 0 # 戦闘中の場合はウィンドウを画面中央へ移動し、半透明にする if $game_temp.in_battle self.y = 64 self.height = 256 self.back_opacity = 160 end end #-------------------------------------------------------------------------- # ● 項目の描画 # index : 項目番号 #-------------------------------------------------------------------------- def draw_item(index) skill = @data[index] if @actor.skill_can_use?(skill.id) self.contents.font.color = normal_color else self.contents.font.color = disabled_color end x = 4 + index % @column_max * (288 + 32) y = index / @column_max * 32 rect = Rect.new(x, y, self.width / @column_max - 32, 32) self.contents.fill_rect(rect, Color.new(0, 0, 0, 0)) bitmap = RPG::Cache.icon(skill.icon_name) opacity = self.contents.font.color == normal_color ? 255 : 128 self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity) self.contents.draw_text(x + 28, y, 204, 32, skill.name, 0) self.contents.draw_text(x + 232, y, 48, 32, skill.sp_cost.to_s, 2) # コマンド表示 cmd_list = CommandSkill.get_key_list(skill.id) if cmd_list.nil? self.contents.draw_text(x + 288 + 32, y, 204, 32, "Non Command") else command = "" for i in 0...cmd_list.size command += Input.key_converter(cmd_list[i]) + " " end self.contents.draw_text(x + 288 + 32, y, 204, 32, command) end end end