#=============================================================================== # # Yanfly Engine RD - Shown Skills Fix # Last Date Updated: 2009.05.12 # Level: Easy # # This script fix hides the skills that aren't usable in battle. Any skill with # the ocassion set as "Menu-Only" or "Never" will not take up a skill slot. But # all skills will be shown when accessed from the menu outside of battle. If you # wish to hide skills completely, there's a tag that will accomplish that. # #=============================================================================== # Updates: # ---------------------------------------------------------------------------- # o 2009.05.12 - Started script and finished. #=============================================================================== # Instructions #=============================================================================== # # To hide a skill permanently from the skill windows, use the tag. # Note that the skill will still show up in other skill windows that do not use # the class Window_Skill. # # # #=============================================================================== # # Compatibility # - Overwrites: Window_Skill: refresh # #=============================================================================== $imported = {} if $imported == nil $imported["ShownSkillsFix"] = true #=============================================================================== # Editting anything past this point may potentially result in causing computer # damage, incontinence, explosion of user's head, coma, death, and/or halitosis. # Therefore, edit at your own risk. #=============================================================================== module YE module REGEXP module BASEITEM HIDE_SKILL = /<(?:HIDE_SKILL|hide skill)>/i end end end #=============================================================================== # RPG::BaseItem #=============================================================================== class RPG::BaseItem #-------------------------------------------------------------------------- # Hide Skill #-------------------------------------------------------------------------- def hide_skill? if @hide_skill == nil self.note.split(/[\r\n]+/).each { |line| case line when YE::REGEXP::BASEITEM::HIDE_SKILL @hide_skill = true end } end return @hide_skill end end #============================================================================== # Window_Skill #============================================================================== class Window_Skill < Window_Selectable #-------------------------------------------------------------------------- # Overwrite Refresh #-------------------------------------------------------------------------- def refresh @data = [] for skill in @actor.skills next unless include?(skill) @data.push(skill) if skill.id == @actor.last_skill_id self.index = @data.size - 1 end end @item_max = @data.size create_contents for i in 0...@item_max draw_item(i) end end #-------------------------------------------------------------------------- # Include? #-------------------------------------------------------------------------- def include?(skill) if skill.hide_skill? return false elsif $game_temp.in_battle and !skill.battle_ok? return false else return true end end end #=============================================================================== # # END OF FILE # #===============================================================================