Hide 0 MP Cost
Version: 1.0
Author: JFace
Date: June 19, 2010
Description
This script hides the MP cost of a skill when the cost is 0. This is particularly useful if a character has physical attack type skills, and MP should not be displayed. This cleans up the skill list in both the battle and main menus.
Screenshots
(https://rmrk.net/proxy.php?request=http%3A%2F%2Fimg.photobucket.com%2Falbums%2Fv290%2Fbasman2k%2F0MPCostHide.jpg&hash=66cc1fad6cb3b2f1ab3992814c3a800df8ed94e0)
The skill "Meditate" is a 0 MP skill. The MP cost is not displayed.
Instructions
Follow the instructions at the top of the script.
Script
#===============================================================================
#
# Hide 0 MP Cost - By JFace
# July 19, 2010
#
# This script hides the MP cost of a skill when the cost is 0. This is
# particularly useful if a character has physical attack type skills, and
# MP should not be displayed. This cleans up the skill list in both the battle
# and main menus.
#
#
# Instructions
# -----------------------------------------------------------------------------
# To use this script, place this script anywhere below ? Materials
# but above ? Main. Save your game.
#
# This script has no customizable features.
# ==============================================================================
class Window_Skill
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
skill = @data[index]
if skill != nil
rect.width -= 4
enabled = @actor.skill_can_use?(skill)
draw_item_name(skill, rect.x, rect.y, enabled)
if @actor.calc_mp_cost(skill) != 0
self.contents.draw_text(rect, @actor.calc_mp_cost(skill), 2)
end
end
end
end
It's a neat idea, but there is absolutely no reason to reproduce the entire Window_Skill class.
The following code would do the same thing:
class Window_Skill
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
rect = item_rect(index)
self.contents.clear_rect(rect)
skill = @data[index]
if skill != nil
rect.width -= 4
enabled = @actor.skill_can_use?(skill)
draw_item_name(skill, rect.x, rect.y, enabled)
if @actor.calc_mp_cost(skill) != 0
self.contents.draw_text(rect, @actor.calc_mp_cost(skill), 2)
end
end
end
end
The methods you don't overwrite are kept the same, and for compatibility reasons it's really sloppy to overwrite methods when it's unnecessary.
Otherwise, fairly good work.