=begin
#==============================================================================#
# AMN Simple Skill Scene
# Version 1.01
# Author: AMoonlessNight
# Date: 23 Feb 2020
# Latest: 23 Feb 2020
#==============================================================================#
# UPDATE LOG
#------------------------------------------------------------------------------#
# 23 Feb 2020 - created the script
#==============================================================================#
# TERMS OF USE
#------------------------------------------------------------------------------#
# - Please credit AMoonlessNight or A-Moonless-Night
# - Free for non-commercial use; contact for commercial use
# - If you would like to edit/adjust this script, please make edits as a new
# script (do not edit this script directly) and provide proper credit
# - I'd love to see your game if you end up using one of my scripts
#==============================================================================#
Requested by Tw0Face
This script makes the skill scene look more like the item scene. You can also
set text for the help window to explain about each skill type.
=end
module AMN_SkillWindow
HELP_TEXT = {
#==============================================================================
# ** EDITABLE REGION BELOW
#------------------------------------------------------------------------------
# Change the values in the area below to suit your needs.
#==============================================================================
# Skill Type ID => "Help window text",
1 => "These are the special skills.",
2 => "These are the magical skills.",
#==============================================================================
# ** END OF EDITABLE REGION
#------------------------------------------------------------------------------
# Please do not edit below this point unless you know what you are doing.
#==============================================================================
}
end
class Window_SkillHorzCommand < Window_HorzCommand
include AMN_SkillWindow
attr_reader :skill_window
def initialize(x, y)
super(x, y)
@actor = nil
end
def window_width; Graphics.width; end
def col_max; [[@list.size,1].max, 4].min; end
def actor=(actor)
return if @actor == actor
@actor = actor
refresh
select_last
end
def make_command_list
return unless @actor
@actor.added_skill_types.sort.each do |stype_id|
name = $data_system.skill_types[stype_id]
add_command(name, :skill, true, stype_id)
end
end
def update
super
@skill_window.stype_id = current_ext if @skill_window
end
def skill_window=(skill_window)
@skill_window = skill_window
update
end
def select_last
skill = @actor.last_skill.object
if skill
select_ext(skill.stype_id)
else
select(0)
end
end
def update_help
text = HELP_TEXT.key?(current_ext) ? HELP_TEXT[current_ext] : ""
@help_window.set_text(text)
end
end
class Scene_Skill < Scene_ItemBase
def create_command_window
wy = @help_window.height
@command_window = Window_SkillHorzCommand.new(0, wy)
@command_window.viewport = @viewport
@command_window.help_window = @help_window
@command_window.actor = @actor
@command_window.set_handler(:skill, method(:command_skill))
@command_window.set_handler(:cancel, method(:return_scene))
@command_window.set_handler(:pagedown, method(:next_actor))
@command_window.set_handler(:pageup, method(:prev_actor))
end
def create_item_window
wx = 0
wy = @command_window.y + @command_window.height
ww = Graphics.width
wh = Graphics.height - wy
@item_window = Window_SkillList.new(wx, wy, ww, wh)
@item_window.actor = @actor
@item_window.viewport = @viewport
@item_window.help_window = @help_window
@item_window.set_handler(:ok, method(:on_item_ok))
@item_window.set_handler(:cancel, method(:on_item_cancel))
@command_window.skill_window = @item_window
end
end