#==============================================================================# ¡ Window_EquipLearning#==============================================================================class Window_EquipLearning < Window_Selectable #-------------------------------------------------------------------------- # initialize #-------------------------------------------------------------------------- def initialize(x, y, width, height) super(x, y, width, height) self.opacity = 0 end #-------------------------------------------------------------------------- # ap_gauge_color1 #-------------------------------------------------------------------------- def ap_gauge_color1 text_color(YES::EQUIPMENT_LEARNING::COLOR_GAUGE[:color1]) end #-------------------------------------------------------------------------- # ap_gauge_color2 #-------------------------------------------------------------------------- def ap_gauge_color2 text_color(YES::EQUIPMENT_LEARNING::COLOR_GAUGE[:color2]) end #-------------------------------------------------------------------------- # item_max #-------------------------------------------------------------------------- def item_max @data.nil? ? 1 : @data.size end #-------------------------------------------------------------------------- # current_item_enabled? #-------------------------------------------------------------------------- def current_item_enabled? false end #-------------------------------------------------------------------------- # enable? #-------------------------------------------------------------------------- def enable?(skill) true end #-------------------------------------------------------------------------- # equip= #-------------------------------------------------------------------------- def equip=(equip) contents.clear @equip = equip return unless @equip @data = @equip.el_skills.collect { |i| $data_skills[i] } refresh end #-------------------------------------------------------------------------- # actor= #-------------------------------------------------------------------------- def actor=(actor) @actor = actor end #-------------------------------------------------------------------------- # item #-------------------------------------------------------------------------- def item @data.nil? ? nil : @data[index] end #-------------------------------------------------------------------------- # draw_item #-------------------------------------------------------------------------- def draw_item(index) skill = @data[index] if skill rect = item_rect(index) rect.width -= 4 draw_ap(skill, rect.x + 2, rect.y, rect.width, enable?(skill)) draw_item_name(skill, rect.x, rect.y, enable?(skill)) end end #-------------------------------------------------------------------------- # draw_ap #-------------------------------------------------------------------------- def draw_ap(item, x, y, width, enable = true) if @actor draw_gauge(x, y, width - 4, @actor.per_elp(item.id), ap_gauge_color1, ap_gauge_color2) draw_current_and_max_values(x, y, width - 4, @actor.cur_elp(item.id), @actor.req_elp(item.id), normal_color, normal_color) else draw_gauge(x, y, width - 4, 0, ap_gauge_color1, ap_gauge_color2) draw_current_and_max_values(x, y, width - 4, 0, item.el_require, normal_color, normal_color) end end #-------------------------------------------------------------------------- # update_help #-------------------------------------------------------------------------- def update_help @help_window.set_item(item) end #-------------------------------------------------------------------------- # activate #-------------------------------------------------------------------------- def activate self.index = 0 super end end # Window_EquipLearning