Jump to content
Sign in to follow this  
lukems

Feature Status Window

Recommended Posts

Feature Status Window

 

This script provides a window with detailed information on items and actors features (using Mr. Bubble's Reader Functions and Info Pages Window). It is based on Mr. Bubble's crafting system's windows and scene, as it already provided most of the interactions and calls for those scripts.

 

The purpose of this script was simply to provide an easy and detailed interface that could show in-game features, thus allowing the user to easily check actor's and item's advanced info. While developing a game I'm currently working on, I've noticed the pain it was to get to that kind of thing, and couldn't find a script that would provide a solution for that issue.

 

Having used Mr. Bubble's "Tactics Ogre PSP Crafting System" before, it inspired me to use the great amount of quality info it provided during the crafting process to another more generic purpose, a regular item/actor feature status windows (considering that "features" have an identical structure, wether item's features or actor's features).

 

Should it be useful to somebody, the script is free to use, just give proper credits (mostly to Mr. Bubble, actually) and, if possible, send me a word about it. As a newbie to RPG Maker and scripting, any feedback will be appreciated.

 

How to use the script:

  1. The scripts "Info Pages Window" and "Reader Functions", both from Mr. Bubble ( http://mrbubblewand.wordpress.com/ ) are required.
  2. Put this script below Mr. Bubble's scripts, somewhere between Materials and Main Process.

Screenshots:

 

Category Selection

You can chose to get features status from actors or items (includes items, weapons and armors in a single screen, will have subcategories soon).

 

 

Category_selection_zpsonriklov.png

 

 

 

  • Actor Features

Selecting "Actors" as category will take you to a window where u can chose an actor from the current party members.

 

Actor Info Page 1

 

 

Actor_info00_zpsobm4yhzu.png

 

 

 

 

Actor Info Page 2

 

 

Actor_info01_zpslqbfbo2u.png

 

 

 

Actor Info Page 3

 

 

Actor_info02_zpsxwklmpqn.png

 

 

 

 

Actor Info Page 4

 

 

Actor_info03_zps1ht5fdab.png

 

 

 

 

Actor Info Page 5

 

 

Actor_info04_zpsxdkkpxtj.png

 

 

 

Actor Info Page 6

 

 

Actor_info05_zpsj0v4tlhv.png

 

 

 

Same sample actor's features on RPG Maker database

 

 

Actor_features00_zpsvylq0rp8.png

 

 

 

  • Item Features

Selecting "Items" as category will take you to a window where u can chose an item from the inventory.

 

Item(Weapon) Info Page 1

 

 

Weapon_info00_zpsjrfzej6r.png

 

 

 

Item(Weapon) Info Page 2

 

 

Weapon_info01_zpsrkyi8wju.png

 

 

 

Item(Weapon) Info Page 3

 

 

Weapon_info02_zpsx6u5nggz.png

 

 

 

Item(Weapon) Info Page 4

 

 

Weapon_info03_zps768yehlw.png

 

 

 

Item(Weapon) Info Page 5

 

 

Weapon_info04_zpsgqh6usos.png

 

 

 

Same sample weapon's features on RPG Maker database

 

 

Weapon_features00_zpsj8157n0n.png

 

 

 

Base Menu

The Feature Status Window can be accessed from the base menu:

 

 

Menu_zpsymootti8.png

 

 

 

 

 

 

 

Code:

 

 

# â•”â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•¤â•â•â•â•â•â•â•¤â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•—
# ║ Feature Status Window                              │ v1.0 │ April 16, 2015 ║
# â•šâ•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•§â•â•â•â•â•â•â•§â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•â•
# Script by:
#     LucasMS
#     ( lucas.morais.siqueira@gmail.com )
#
# Thanks:
#     Mr. Bubble for his great and well documented scripts.
#
# (Based on Mr. Bubble's "Tactics Ogre PSP Crafting System" and "Info Pages
#  Window").
#
#--------------------------------------------------------------------------
# This script provides a window with detailed information on items and actors
# features (using Mr. Bubble's Reader Functions and Info Pages Window, based on
# his crafting system's windows and scene).
#
# The purpose of this script was simply to provide an easy and detailed interface
# that shows in-game features (used on a game that I've been developing, to check
# dynamic feature changes).
#
# Should it be helpful to anybody, the script is free to use in any way.
#
# As a newbie to RPG Maker and scripting, any feedback will be appreciated.
#
# ******************
#  The scripts "Info Pages Window" and "Reader Functions", both from Mr. Bubble
# ( http://mrbubblewand.wordpress.com/ ) are required.
# ******************
#
# PS.: English is not my native language, so I apologize for any spelling
# mistakes. Feedback on that will also be appreciated :-)
#
#==========================================================================
# ++ START OF USER CUSTOMIZATION MODULE ++
#==========================================================================
module LucasMS
  #==========================================================================
  # ++ Feature_Status Settings
  #==========================================================================
  module Feature_Status
  
  #--------------------------------------------------------------------------
  #   Info Page Footer Text
  #--------------------------------------------------------------------------
  # Recommend length: 22 characters   "                      "
  NORMAL_FOOTER_TEXT                = "↠                   →"

  #--------------------------------------------------------------------------
  #   Item Info Pages
  #--------------------------------------------------------------------------
  # This setting determines the order of info pages for usable items. 
  # Each kind of info page is represented by a symbol. Possible symbols
  # include:
  #
  #   :item_info      # Requires "Reader Functions for Features/Effects"
  ITEM_INFO_PAGES = [:item_info]
                    
  #--------------------------------------------------------------------------
  #   Equip Info Page List
  #--------------------------------------------------------------------------
  # This setting determines the order of info pages for equippable items. 
  # Each kind of info page is represented by a symbol. Possible symbols
  # include:
  #
  #   :param_info     # Requires "Reader Functions for Features/Effects"
  #   :attack_info    # Requires "Reader Functions for Features/Effects"
  #   :element_info   # Requires "Reader Functions for Features/Effects"
  #   :state_info     # Requires "Reader Functions for Features/Effects"
  EQUIP_INFO_PAGES = [:param_info,   # Page 2
                      :attack_info,  # Page 3
                      :element_info, # Page 4
                      :state_info,   # Page 5
                      :xparam_info,   # Page 6
                      :sparam_info,   # Page 7
                     ] # <- Do not delete.
                     
  #--------------------------------------------------------------------------
  #   Info Page Header Text
  #--------------------------------------------------------------------------
  INFO_PAGE_HEADER_TEXT = {
    # General
    :main_header      => "Information",
    # Weapons and Armor
    :atk_elements     => "Attack Elements",
    :atk_speed        => "Attack Speed",
    :atk_times_add    => "Number of Attacks",
    :atk_states       => "Attack States",
    :element_rate     => "Element Resistances",
    :state_rate       => "State Resistances",
    :state_resist_set => "State Immunity",
    # Items
    :hp_recovery      => "HP Recovery",
    :mp_recovery      => "MP Recovery",
    :tp_recovery      => "TP Recovery",
    :add_states       => "Adds",
    :remove_states    => "Removes",
  } # <- Do not delete.
  
  #--------------------------------------------------------------------------
  #   Element Icon Index Numbers
  #--------------------------------------------------------------------------
  # This setting lets you define the icon index number that represents
  # an element in info pages
  #
  # Requires "Reader Functions for Features/Effects" to see effects.
  ELEMENT_ICONS = {
    1 => 116, # Physical
    2 => 113, # Absorb
    3 =>  96, # Fire
    4 =>  97, # Ice
    5 =>  98, # Thunder
    6 =>  99, # Water
    7 => 100, # Earth
    8 => 101, # Wind
    9 => 102, # Light
   10 => 103, # Dark
  } # <- Do not delete.
  
  #--------------------------------------------------------------------------
  #   Element ID List for Info Page
  #--------------------------------------------------------------------------
  # This setting determines which elements are seen in an item's element
  # info page where each number in the array is an Element ID number from
  # your database.
  #
  # Requires "Reader Functions for Features/Effects" to see effects.
  DISPLAYED_ELEMENT_RESISTS = [1,2,3,4,5,6,7,8,9,10]
  
  #--------------------------------------------------------------------------
  #   State ID List for Info Page
  #--------------------------------------------------------------------------
  # This setting determines which states are seen in an item's state
  # info page where each number in the array is a State ID number from
  # your database.
  #
  # Requires "Reader Functions for Features/Effects" to see effects.
  DISPLAYED_STATE_RESISTS   = [1,2,3,4,5,6,7,8]
  
  #--------------------------------------------------------------------------
  #   Change Info Page Buttons
  #--------------------------------------------------------------------------
  # These settings determine which gamepad buttons change the info
  # window page. Possible buttons include :LEFT, :RIGHT, :UP, :DOWN,
  # :A, :B, :C, :X, :Y, :Z, :L, :R
  PREV_PAGE_BUTTON = :LEFT
  NEXT_PAGE_BUTTON = :RIGHT
  
  #--------------------------------------------------------------------------
  #   Page Change Sound Effect
  #--------------------------------------------------------------------------
  # Filename : SE filename in Audio/SE/ folder
  # Volume   : Between 0~100
  # Pitch    : Between 50~150
  #
  #                  Filename, Volume, Pitch
  PAGE_CHANGE_SE = ["Cursor1",     80,   100]
  
  end #  Feature_Status (module)
end # LucasMS (module)

#==========================================================================
# ++ END OF USER CUSTOMIZATION MODULE ++
#==========================================================================

###////////////////////////////////////////////////////////////////////////////

#==============================================================================
# ++ Sound module
#==============================================================================
module Sound
  #--------------------------------------------------------------------------
  # new method : play_page_change
  #--------------------------------------------------------------------------
  def self.play_page_change
    filename = LucasMS::Feature_Status::PAGE_CHANGE_SE[0]
    volume   = LucasMS::Feature_Status::PAGE_CHANGE_SE[1]
    pitch    = LucasMS::Feature_Status::PAGE_CHANGE_SE[2]
    Audio.se_play("/Audio/SE/" + filename, volume, pitch) 
  end # play_page_change (method)
end # Sound (module)

###////////////////////////////////////////////////////////////////////////////

#==============================================================================
# ++ Features Scene_
#==============================================================================
class Scene_Features < Scene_MenuBase
  #--------------------------------------------------------------------------
  # start, create windows
  #--------------------------------------------------------------------------
  def start
    super
    create_help_window
    create_info_page_window
    create_feature_object_list_window
    create_feature_object_category_window    
  end #  start
  
  #--------------------------------------------------------------------------
  # create_feature_object_category_window
  #--------------------------------------------------------------------------
  def create_feature_object_category_window
    @category_window = Feature_Object_Category_Window.new
    @category_window.viewport = @viewport
    @category_window.y = 0
    @category_window.height = 72
    @category_window.set_handler(:ok,     method(:on_feature_category_ok))
    @category_window.set_handler(:cancel, method(:return_scene))
    @help_window.hide if @help_window
    @category_window.show.activate
  end #  create_feature_object_category_window
  
  #--------------------------------------------------------------------------
  # on_feature_category_ok
  #--------------------------------------------------------------------------
  def on_feature_category_ok
    @category_window.hide
    @help_window.show
    @info_page_window.openness = 0
    @info_page_window.opening_proc
    @feature_object_list_window.feature_category(@category_window.select_feature_category)
    @info_page_window.feature_category(@category_window.select_feature_category)
    @feature_object_list_window.refresh
    @feature_object_list_window.update_help
    @feature_object_list_window.opacity = 255
    @feature_object_list_window.contents_opacity  = 255
    @feature_object_list_window.back_opacity  = 192    
    @feature_object_list_window.show.activate
  end # on_feature_category_ok
  
  #--------------------------------------------------------------------------
  # create_feature_object_list_window
  #--------------------------------------------------------------------------
  def create_feature_object_list_window
    wx = 0
    wy = @help_window.height
    wh = Graphics.height - wy
    @feature_object_list_window = Window_Feature_Object_List.new(wx, wy, wh)
    @feature_object_list_window.viewport = @viewport
    @feature_object_list_window.help_window = @help_window
    @feature_object_list_window.info_window = @info_window
    @feature_object_list_window.header_window = @itemlist_header_window
    @feature_object_list_window.cover_window = @info_page_window
    @feature_object_list_window.set_handler(:cancel, method(:on_feature_object_list_cancel))
    @feature_object_list_window.refresh
    @feature_object_list_window.opacity = 80
    @feature_object_list_window.contents_opacity  = 80
    @feature_object_list_window.back_opacity  = 80    
  end # create_feature_object_list_window
  
  #--------------------------------------------------------------------------
  # on_feature_object_list_cancel
  #--------------------------------------------------------------------------
  def on_feature_object_list_cancel
    refresh
    @help_window.hide if @help_window
    @category_window.show.activate
    @feature_object_list_window.opacity = 80
    @feature_object_list_window.contents_opacity  = 80
    @feature_object_list_window.back_opacity  = 80    
    @info_page_window.openness = 255
    @info_page_window.closing_proc
  end # on_feature_object_list_cancel
  
  #--------------------------------------------------------------------------
  # create_info_page_window
  #--------------------------------------------------------------------------
  def create_info_page_window
    wx = Graphics.width / 2
    wy = @help_window.height
    wh = Graphics.height - @help_window.height
    ww = Graphics.width - wx
    @info_page_window = Window_Info_Page.new(wx, wy, ww, wh)
    @info_page_window.viewport = @viewport
    @info_page_window.refresh
    @info_page_window.show
    @info_page_window.openness = 0
  end # create_info_page_window
  
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    @category_window.refresh
    @help_window.refresh    
    @feature_object_list_window.refresh
  end # refresh (metod)
end # Scene_Features (class)

###////////////////////////////////////////////////////////////////////////////

#==============================================================================
# ** Window_ItemCategory
#------------------------------------------------------------------------------
#  This window is for selecting a category of normal items and equipment
# on the item screen or shop screen.
#==============================================================================

class Feature_Object_Category_Window < Window_HorzCommand
  #--------------------------------------------------------------------------
  # * Public Instance Variables
  #--------------------------------------------------------------------------
  attr_reader   :recipelist_window

  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0)
  end #initialize
  #--------------------------------------------------------------------------
  # * Get Window Width
  #--------------------------------------------------------------------------
  def window_width
    Graphics.width
  end #window_width
  #--------------------------------------------------------------------------
  # * Get Digit Count
  #--------------------------------------------------------------------------
  def col_max
    return 4
  end #col_max
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def make_command_list
    add_command("Items",     :item_features)
    add_command("Actors",   :actor_features)
  end #make_command_list
  
  #--------------------------------------------------------------------------
  # * Create Command List
  #--------------------------------------------------------------------------
  def select_feature_category
    return current_symbol
  end #select_feature_category
end # Feature_Object_Category_Window (class)

###///////////////////////////////////////////////////////////////////////////

#==============================================================================
# ++ Window_Feature_Object_List
#==============================================================================
class Window_Feature_Object_List < Window_ItemList
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_reader :info_window
  attr_reader :header_window
  attr_reader :cover_window
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(x, y, height)
    super(x, y, window_width, height)
    @category = :none
  end #initialize
  #--------------------------------------------------------------------------
  # window_width
  #--------------------------------------------------------------------------
  def window_width
    Graphics.width / 2
  end #window_width
  
  #--------------------------------------------------------------------------
  # current_item_enabled?           # Get Activation State of Selection Item
  #--------------------------------------------------------------------------
  def current_item_enabled?
    enable?(@data[index])
  end #current_item_enabled?
  
  #--------------------------------------------------------------------------
  # enable?                               # Display in Enabled State?
  #--------------------------------------------------------------------------
  def enable?(item)
    return false if item.nil?
    return true
  end #enable?
  
  #--------------------------------------------------------------------------
  # col_max
  #--------------------------------------------------------------------------
  def col_max
    return 1
  end #col_max
  
  #--------------------------------------------------------------------------
  # * Get Item
  #--------------------------------------------------------------------------
  def item
    case @category    
    when :item_features
      super
    when :actor_features
      @data && index >= 0 ? $game_party.members[index] : nil
    end # case
  end #item

  #--------------------------------------------------------------------------
  # * Draw All Items
  #--------------------------------------------------------------------------
  def draw_all_items
    case @category    
    when :item_features
      super
    when :actor_features
      $game_party.members.size.times {|i| draw_item(i) }
    end # case
  end # draw_all_items

  #--------------------------------------------------------------------------
  # * Calculate Height of Window Contents
  #--------------------------------------------------------------------------
  def contents_height
    return self.height
  end #contents_height

  #--------------------------------------------------------------------------
  # * Get Number of Items
  #--------------------------------------------------------------------------
  def item_max
    case @category    
    when :item_features
      super
    when :actor_features
      @data ? $game_party.members.size : 1
    end #case
  end #item_max
  
  #--------------------------------------------------------------------------
  # * Create Item List
  #--------------------------------------------------------------------------
  def make_item_list
    case @category    
    when :item_features
      super
    when :actor_features
      @data = $game_party.members[index]
    end # case
  end # make_item_list

  #--------------------------------------------------------------------------
  # include?                              # Include in Item List?
  #--------------------------------------------------------------------------
  def include?(item)
    @include = false
    case @category    
    when :item_features
      @include = true if item.is_a?(RPG::Item)    # allow Item
      @include = true if item.is_a?(RPG::Weapon)  # allow Weapon
      @include = true if item.is_a?(RPG::Armor)   # allow Armor
    when :actor_features
      @include = true
    end #case
    return @include
  end #include?
  
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    case @category    
    when :item_features
      item = @data[index]
      if item
        rect = item_rect(index)
        rect.width -= 4
        draw_item_name(item, rect.x, rect.y, enable?(item), rect.width - 24)
      end # if
    when :actor_features
      item = $game_party.members[index]
      if item
        rect = item_rect(index)
        rect.width -= 4
        draw_item_name(item, rect.x, rect.y, enable?(item), rect.width - 24)
      end # if
    end # case
  end # draw_item
  
  #--------------------------------------------------------------------------
  # info_window=
  #--------------------------------------------------------------------------
  def info_window=(info_window)
    @info_window = info_window
    call_update_help
  end #info_window
  
  #--------------------------------------------------------------------------
  # header_window=
  #--------------------------------------------------------------------------
  def header_window=(header_window)
    @header_window = header_window
  end #header_window
  
  #--------------------------------------------------------------------------
  # cover_window=
  #--------------------------------------------------------------------------
  def cover_window=(cover_window)
    @cover_window = cover_window
  end #cover_window
  
  #--------------------------------------------------------------------------
  # update_help
  #--------------------------------------------------------------------------
  def update_help
    @help_window.set_item(item) if @help_window
    @info_window.item = item if @info_window
    @header_window.item = item if @header_window
    @cover_window.item = item if @cover_window
  end #update_help
  
  #--------------------------------------------------------------------------
  # feature_category
  #--------------------------------------------------------------------------
  def feature_category(feature_category)
    @category = feature_category
    @data = $game_party.members if @category == :actor_features
    self.select(0)
  end #feature_category (method)
end # Window_Feature_Object_List (class)

###////////////////////////////////////////////////////////////////////////////

#==============================================================================
# ++ Window_Info_Page
#==============================================================================
class Window_Info_Page < Window_Base
  
  #--------------------------------------------------------------------------
  # Constants (Starting Number of Buff/Debuff Icons)
  #--------------------------------------------------------------------------
  ICON_BUFF_START       = 64              # buff (16 icons)
  ICON_DEBUFF_START     = 80              # debuff (16 icons)
  
  #--------------------------------------------------------------------------
  # public instance variables
  #--------------------------------------------------------------------------
  attr_accessor :number
  attr_accessor :page_change
  attr_accessor :page_index
  attr_reader   :ingredients
  
  #--------------------------------------------------------------------------
  # initialize
  #--------------------------------------------------------------------------
  def initialize(x, y, width, height)
    super(x, y, width, height)
    @item = nil
    @number = 1
    @page_change = true
    @page_index = 0
    @ingredients = []
    set_page_keys
  end # initialize
  
  #--------------------------------------------------------------------------
  # set_page_keys
  #--------------------------------------------------------------------------
  def set_page_keys
    @usableitem_pages = LucasMS::Feature_Status::ITEM_INFO_PAGES.clone
    @equipitem_pages  = LucasMS::Feature_Status::EQUIP_INFO_PAGES.clone
    refresh
  end #set_page_keys
  
  #--------------------------------------------------------------------------
  # draw_page_contents
  #--------------------------------------------------------------------------
  def draw_page_contents(item)
    
    if item.is_a?(RPG::Item)      
      case @usableitem_pages[0]      
      when :item_info
        return feature_reader_text(4, 0) unless $imported["BubsFeaturesReader"]
        draw_usableitem_info(item, 4, line_height * 2)
        draw_info_header_text(4, 0)
        draw_info_footer_text(4, 0)
        draw_horz_line(line_height * 1)
      end #case
      
    if item.is_a?(RPG::EquipItem)
      case @equipitem_pages[0]
      when :param_info
        return feature_reader_text(4, 0) unless $imported["BubsFeaturesReader"]
        draw_param_info(item, 4, line_height * 2)
        draw_info_header_text(4, 0)
        draw_info_footer_text(4, 0)
        draw_horz_line(line_height * 1)
      when :xparam_info
        return feature_reader_text(4, 0) unless $imported["BubsFeaturesReader"]
        draw_xparam_info(item, 4, line_height * 2)
        draw_info_header_text(4, 0)
        draw_info_footer_text(4, 0)
        draw_horz_line(line_height * 1)
      when :sparam_info
        return feature_reader_text(4, 0) unless $imported["BubsFeaturesReader"]
        draw_sparam_info(item, 4, line_height * 2)
        draw_info_header_text(4, 0)
        draw_info_footer_text(4, 0)
        draw_horz_line(line_height * 1)
      when :attack_info
        return feature_reader_text(4, 0) unless $imported["BubsFeaturesReader"]
        draw_attack_info(item, 4, line_height * 2)
        draw_info_header_text(4, 0)
        draw_info_footer_text(4, 0)
        draw_horz_line(line_height * 1)
      when :element_info
        return feature_reader_text(4, 0) unless $imported["BubsFeaturesReader"]
        draw_element_resists_info(item, 4, line_height * 2)
        draw_info_header_text(4, 0)
        draw_info_footer_text(4, 0)
        draw_horz_line(line_height * 1)
      when :state_info
        return feature_reader_text(4, 0) unless $imported["BubsFeaturesReader"]
        draw_state_resists_info(item, 4, line_height * 2)
        draw_info_header_text(4, 0)
        draw_info_footer_text(4, 0)
        draw_horz_line(line_height * 1)
      end # case
    end # if
    
    else #used for actors as items
      case @equipitem_pages[0]
      when :param_info
        return feature_reader_text(4, 0) unless $imported["BubsFeaturesReader"]
        draw_param_info(item, 4, line_height * 2)
        draw_info_header_text(4, 0)
        draw_info_footer_text(4, 0)
        draw_horz_line(line_height * 1)
      when :xparam_info        
        return feature_reader_text(4, 0) unless $imported["BubsFeaturesReader"]
        next_info_page  unless xparam_changes?(item) 
        draw_xparam_info(item, 4, line_height * 2)#
        draw_info_header_text(4, 0)
        draw_info_footer_text(4, 0)
        draw_horz_line(line_height * 1)
      when :sparam_info
        return feature_reader_text(4, 0) unless $imported["BubsFeaturesReader"]
        next_info_page unless sparam_changes?(item)
        draw_sparam_info(item, 4, line_height * 2)#
        draw_info_header_text(4, 0)
        draw_info_footer_text(4, 0)
        draw_horz_line(line_height * 1)
      when :attack_info
        return feature_reader_text(4, 0) unless $imported["BubsFeaturesReader"]
        draw_attack_info(item, 4, line_height * 2)
        draw_info_header_text(4, 0)
        draw_info_footer_text(4, 0)
        draw_horz_line(line_height * 1)
      when :element_info
        return feature_reader_text(4, 0) unless $imported["BubsFeaturesReader"]
        draw_element_resists_info(item, 4, line_height * 2)
        draw_info_header_text(4, 0)
        draw_info_footer_text(4, 0)
        draw_horz_line(line_height * 1)
      when :state_info
        return feature_reader_text(4, 0) unless $imported["BubsFeaturesReader"]
        draw_state_resists_info(item, 4, line_height * 2)
        draw_info_header_text(4, 0)
        draw_info_footer_text(4, 0)
        draw_horz_line(line_height * 1)
      end # case
    end # else
  end # draw_page_contents
  
  #--------------------------------------------------------------------------
  # feature_reader_text
  #--------------------------------------------------------------------------
  def feature_reader_text(x, y)
    change_color(normal_color)
    rect = Rect.new(x, y, contents.width - 4 - x, line_height)
    text = "This page requires"
    rect.y = line_height * 3
    draw_text(rect, text, 1)
    text = "the script"
    rect.y = line_height * 4
    draw_text(rect, text, 1)
    text = "\"Reader Functions for "
    rect.y = line_height * 5
    draw_text(rect, text, 1)
    text = "Features\/Effects\""
    rect.y = line_height * 6
    draw_text(rect, text, 1)
    text = "to be properly viewed."
    rect.y = line_height * 7
    draw_text(rect, text, 1)
  end #feature_reader_text
  
  #--------------------------------------------------------------------------
  # update
  #--------------------------------------------------------------------------
  def update
    super
    update_page
    @opening = false if open? || @closing_proc
    self.openness += 12 if @opening_proc
    @closing = false if close? || @opening_proc
    self.openness -= 12 if @closing_proc
  end #update
  
  #--------------------------------------------------------------------------
  # update_page
  #--------------------------------------------------------------------------
  def update_page
    if visible
      next_info_page if Input.trigger?(next_page_button) && @page_change
      prev_info_page if Input.trigger?(prev_page_button) && @page_change
    end #if
  end #update_page
  
  #--------------------------------------------------------------------------
  # prev_page_button
  #--------------------------------------------------------------------------
  def prev_page_button
    LucasMS::Feature_Status::PREV_PAGE_BUTTON
  end
  
  #--------------------------------------------------------------------------
  # next_page_button
  #--------------------------------------------------------------------------
  def next_page_button
    LucasMS::Feature_Status::NEXT_PAGE_BUTTON
  end
  
  #--------------------------------------------------------------------------
  # normal_footer_text
  #--------------------------------------------------------------------------
  def normal_footer_text
    LucasMS::Feature_Status::NORMAL_FOOTER_TEXT
  end
  
  #--------------------------------------------------------------------------
  # draw_info_footer_text(4, 0)
  #--------------------------------------------------------------------------
  def draw_info_footer_text(x, y)
    y = y + line_height * (contents.height / line_height - 1)
    rect = standard_rect(x, y)
    change_color(normal_color)
    draw_text(rect, normal_footer_text, 1)
  end #draw_info_footer_text
  
  #--------------------------------------------------------------------------
  # next_info_page
  #--------------------------------------------------------------------------
  def next_info_page
    Sound.play_page_change
    if @item.is_a?(RPG::EquipItem) || @category == :actor_features
      @equipitem_pages.rotate!
      @equipitem_pages.rotate! if @equipitem_pages[0] == :xparam_info && xparam_changes?(@item) == false
      @equipitem_pages.rotate! if @equipitem_pages[0] == :sparam_info && sparam_changes?(@item) == false
    end #if
    @usableitem_pages.rotate! if @item.is_a?(RPG::UsableItem)
    refresh
  end #next_info_page
  
  #--------------------------------------------------------------------------
  # prev_info_page
  #--------------------------------------------------------------------------
  def prev_info_page
    Sound.play_page_change
    if @item.is_a?(RPG::EquipItem) || @category == :actor_features
      @equipitem_pages.rotate!(-1)
      @equipitem_pages.rotate!(-1) if @equipitem_pages[0] == :sparam_info && sparam_changes?(@item) == false
      @equipitem_pages.rotate!(-1) if @equipitem_pages[0] == :xparam_info && xparam_changes?(@item) == false
    end #if
    @usableitem_pages.rotate!(-1) if @item.is_a?(RPG::UsableItem)
    refresh
  end #prev_info_page
  
  #--------------------------------------------------------------------------
  # refresh
  #--------------------------------------------------------------------------
  def refresh
    contents.clear
    return unless @item
    draw_page_contents(@item)
  end #refresh
  
  #--------------------------------------------------------------------------
  # draw_horz_line
  #--------------------------------------------------------------------------
  def draw_horz_line(y)
    line_y = y + line_height / 2 - 1
    contents.fill_rect(0, line_y, contents_width, 2, line_color)
  end #draw_horz_line
  
  #--------------------------------------------------------------------------
  # line_color                              # Get Color of Horizontal Line
  #--------------------------------------------------------------------------
  def line_color
    color = normal_color
    color.alpha = 48
    color
  end #line_color
  
  #--------------------------------------------------------------------------
  # info_header_text
  #--------------------------------------------------------------------------
  def info_header_text(key)
    LucasMS::Feature_Status::INFO_PAGE_HEADER_TEXT[key]
  end #info_header_text
  
  #--------------------------------------------------------------------------
  # standard_rect
  #--------------------------------------------------------------------------
  def standard_rect(x, y)
    Rect.new(x, y, contents.width - 4 - x, line_height)
  end #standard_rect
  
  #--------------------------------------------------------------------------
  # draw_param_info
  #--------------------------------------------------------------------------
  def draw_param_info(item, x, y)
    8.times do |i|
      y_plus = line_height * i
      x_plus = 0 #i % col_max * item_width
      draw_param_name(x + x_plus, y + y_plus, i)
      draw_param_value(item, x + x_plus, y + y_plus, i)
    end #do
  end #draw_param_info
  
  #--------------------------------------------------------------------------
  # draw_xparam_info
  #--------------------------------------------------------------------------
  def draw_xparam_info(item, x, y)
    j = 0
    10.times do |i|
      j = i   if item.xparam(i) == 0
      next    if   item.xparam(i) == 0
      return  if item.xparam(i) == 0
      y_plus = line_height * (i-j)
      x_plus = 0 #i % col_max * item_width
      draw_xparam_name(x + x_plus, y + y_plus, i)
      draw_xparam_value(item, x + x_plus, y + y_plus, i)
    end #do
  end #draw_xparam_info

  #--------------------------------------------------------------------------
  # draw_sparam_info
  #--------------------------------------------------------------------------
  def draw_sparam_info(item, x, y)
    j = 0
    10.times do |i|
      j = i   if item.sparam(i) == 1.0
      next    if item.sparam(i) == 1.0
      return  if item.sparam(i) == 1.0
      y_plus = line_height * (i-j)
      x_plus = 0 #i % col_max * item_width
      draw_sparam_name(x + x_plus, y + y_plus, i)
      draw_sparam_value(item, x + x_plus, y + y_plus, i)
    end #do
  end #draw_sparam_info

  #--------------------------------------------------------------------------
  # xparam_changes? checks if the xparam values are not the default (0) ones
  #--------------------------------------------------------------------------
  def xparam_changes?(item)
    changes = false
    10.times {|i| changes = true if item.xparam(i) != 0 }
    return changes
  end #def
  
  #--------------------------------------------------------------------------
  # sparam_changes? checks if the sparam values are not the default (1.0) ones
  #--------------------------------------------------------------------------
  def sparam_changes?(item)
    changes = false
    10.times {|i| changes = true if item.sparam(i) != 1.0 }
    return changes
  end #def

  #--------------------------------------------------------------------------
  # draw_attack_info
  #--------------------------------------------------------------------------
  def draw_attack_info(item, x, y)
    draw_attack_elements(item, x, y + line_height * 0)
    draw_attack_speed(item, x, y + line_height * 1)
    draw_number_of_attacks(item, x, y + line_height * 2)
    draw_attack_states_text(item, x, y + line_height * 4)
    draw_attack_states(item, x, y + line_height * 5)
  end #draw_attack_info
  
  #--------------------------------------------------------------------------
  # draw_attack_elements
  #--------------------------------------------------------------------------
  def draw_attack_elements(item, x, y)
    draw_attack_elements_text(item, x, y)
    draw_attack_elements_icons(item, x, y)
  end #draw_attack_elements
  
  #--------------------------------------------------------------------------
  # draw_attack_elements_text
  #--------------------------------------------------------------------------
  def draw_attack_elements_text(item, x, y)
    change_color(system_color)
    rect = standard_rect(x, y)
    text = info_header_text(:atk_elements) # "Attack Element"
    draw_text(rect, text)
  end #draw_attack_elements_text
  
  #--------------------------------------------------------------------------
  # draw_attack_elements_icons
  #--------------------------------------------------------------------------
  def draw_attack_elements_icons(item, x, y)
    icons = item.atk_elements
    icons.reverse.each_with_index do |id, i|
      n = element_icon_id(id) ? element_icon_id(id) : 0
      draw_icon(n, contents.width - 4 - x - (24 * (i + 1)), y)
    end #do
  end #draw_attack_elements_icons
  
  #--------------------------------------------------------------------------
  # draw_attack_speed
  #--------------------------------------------------------------------------
  def draw_attack_speed(item, x, y)
    change_color(system_color)
    rect = standard_rect(x, y)
    text = info_header_text(:atk_speed) # "Attack Speed"
    draw_text(rect, text)
    value = item.atk_speed
    change_color(param_change_color(value))
    draw_text(rect, sprintf("%+d", value), 2)
  end #draw_attack_speed
  
  #--------------------------------------------------------------------------
  # draw_number_of_attacks
  #--------------------------------------------------------------------------
  def draw_number_of_attacks(item, x, y)
    change_color(system_color)
    rect = standard_rect(x, y)
    text = info_header_text(:atk_times_add) # "Number of Attacks"
    draw_text(rect, text)
    value = item.atk_times_add
    change_color(param_change_color(value))
    draw_text(rect, sprintf("%+d", value), 2)
  end #draw_number_of_attacks
  
  #--------------------------------------------------------------------------
  # draw_attack_states
  #--------------------------------------------------------------------------
  def draw_attack_states(item, x, y)
    change_color(normal_color)
    item.atk_states.each_with_index do |state_id, index|
      y_plus = line_height * (index / col_max)
      x_plus = index % col_max * item_width
      icon_index = $data_states[state_id].icon_index
      draw_icon(icon_index, x + x_plus, y + y_plus)
      rect = Rect.new(x, y, contents.width / col_max - 4 - x, line_height)
      rect.x += x_plus
      rect.y += y_plus
      rate = item.atk_states_rate(state_id) * 100
      text = sprintf("%d%%", rate)
      draw_text(rect, text, 2)    
    end #do
  end #draw_attack_states
  
  #--------------------------------------------------------------------------
  # draw_attack_states_text
  #--------------------------------------------------------------------------
  def draw_attack_states_text(item, x, y)
    change_color(system_color)
    rect = standard_rect(x, y) 
    text = info_header_text(:atk_states) # "Attack States"
    draw_text(rect, text)
  end #draw_attack_states_text

  #--------------------------------------------------------------------------
  # element_icon_id
  #--------------------------------------------------------------------------
  def element_icon_id(element_id)
    LucasMS::Feature_Status::ELEMENT_ICONS[element_id]
  end #element_icon_id
  
  #--------------------------------------------------------------------------
  # draw_element_resists_info
  #--------------------------------------------------------------------------
  def draw_element_resists_info(item, x, y)
    draw_element_resists_text(item, x, y + line_height * 0)
    draw_element_resists(item, x, y + line_height * 1)
  end #draw_element_resists_info
  
  #--------------------------------------------------------------------------
  # draw_state_resists_info
  #--------------------------------------------------------------------------
  def draw_state_resists_info(item, x, y)
    draw_state_resists_text(item, x, y + line_height * 0)
    draw_state_resists(item, x, y + line_height * 1)
    draw_state_immunity_text(item, x, y + line_height * 8)
    draw_state_immunity(item, x, y + + line_height * 9)
  end #draw_state_resists_info
  
  #--------------------------------------------------------------------------
  # draw_state_resists_text
  #--------------------------------------------------------------------------
  def draw_state_resists_text(item, x, y)
    change_color(system_color)
    rect = standard_rect(x, y)
    text = info_header_text(:state_rate) # "State Resistance"
    draw_text(rect, text)
  end #draw_state_resists_text
  
  #--------------------------------------------------------------------------
  # draw_state_resists
  #--------------------------------------------------------------------------
  def draw_state_resists(item, x, y)
    listed_states.each_with_index do |state_id, index|
      y_plus = line_height * (index / col_max)
      x_plus = index % col_max * item_width
      icon_index = $data_states[state_id].icon_index
      draw_icon(icon_index, x + x_plus, y + y_plus)
      rect = Rect.new(x, y, contents.width / col_max - 4 - x, line_height)
      rect.x += x_plus
      rect.y += y_plus
      rate = item.state_rate(state_id) * 100 - 100
      change_color(param_change_color(-rate))
      text = sprintf("%+d%%", -rate)
      draw_text(rect, text, 2)    
    end #do
  end #draw_state_resists
  
  #--------------------------------------------------------------------------
  # draw_state_immunity_text
  #--------------------------------------------------------------------------
  def draw_state_immunity_text(item, x, y)
    change_color(system_color)
    rect = standard_rect(x, y)
    text = info_header_text(:state_resist_set) # "State Immunity"
    draw_text(rect, text)
  end #draw_state_immunity_text
  
  #--------------------------------------------------------------------------
  # draw_state_immunity
  #--------------------------------------------------------------------------
  def draw_state_immunity(item, x, y)
    item.state_resist_set.each_with_index do |state_id, index|
      icon_row_max = (contents.width - 4 - x) / 24
      y_plus = (index / icon_row_max) * line_height
      x_plus = (index % icon_row_max) * 24
      icon_index = $data_states[state_id].icon_index
      draw_icon(icon_index, x + x_plus, y + y_plus)
    end #do
  end #draw_state_immunity
  
  #--------------------------------------------------------------------------
  # draw_element_resists
  #--------------------------------------------------------------------------
  def draw_element_resists(item, x, y)
    change_color(normal_color)
    listed_elements.each_with_index do |element_id, index|
      y_plus = line_height * (index / col_max)
      x_plus = index % col_max * item_width
      icon_index = element_icon_id(element_id) ? element_icon_id(element_id) : 0
      draw_icon(icon_index, x + x_plus, y + y_plus)
      rect = Rect.new(x + x_plus, y + y_plus, contents.width / col_max - 4 - x, line_height)
      rate = item.element_rate(element_id) * 100 - 100
      change_color(param_change_color(-rate))
      text = sprintf("%+d%%", -rate)
      draw_text(rect, text, 2)  
    end #do
  end #draw_element_resists
  
  #--------------------------------------------------------------------------
  # draw_element_resists_text
  #--------------------------------------------------------------------------
  def draw_element_resists_text(item, x, y)
    change_color(system_color)
    rect = standard_rect(x, y)
    text = info_header_text(:element_rate) # "Element Resists"
    draw_text(rect, text)
  end #draw_element_resists_text

  #--------------------------------------------------------------------------
  # listed_elements
  #--------------------------------------------------------------------------
  def listed_elements
    LucasMS::Feature_Status::DISPLAYED_ELEMENT_RESISTS
  end
  
  #--------------------------------------------------------------------------
  # listed_states
  #--------------------------------------------------------------------------
  def listed_states
    LucasMS::Feature_Status::DISPLAYED_STATE_RESISTS
  end
  
  #--------------------------------------------------------------------------
  # draw_usableitem_info
  #--------------------------------------------------------------------------
  def draw_usableitem_info(item, x, y)
    draw_hp_recovery(item, x, y + line_height * 0)
    draw_mp_recovery(item, x, y + line_height * 1)
    draw_tp_recovery(item, x, y  + line_height * 2)
    draw_add_state_text(item, x, y + line_height * 4)
    draw_add_state_icons(item, x, y + line_height * 5)
    draw_remove_state_text(item, x, y + line_height * 7)
    draw_remove_state_icons(item, x, y + line_height * 8)
  end #draw_usableitem_info
  
  #--------------------------------------------------------------------------
  # draw_add_state_icons
  #--------------------------------------------------------------------------
  def draw_add_state_icons(item, x, y)
    icons = get_add_state_icons(item)
    icons.each_with_index do |n, i|
      icon_row_max = (contents.width - 4 - x) / 24
      y_plus = (i / icon_row_max) * line_height
      x_plus = (i % icon_row_max) * 24
      draw_icon(n, x + x_plus, y + y_plus)
    end #do
  end #draw_add_state_icons
  
  #--------------------------------------------------------------------------
  # get_add_state_icons
  #--------------------------------------------------------------------------
  def get_add_state_icons(item)
    icons = item.add_states.collect   { |id| $data_states[id].icon_index }
    icons += item.add_buffs.collect   { |param| buff_icon_index( 1, param) }
    icons += item.add_debuffs.collect { |param| buff_icon_index(-1, param) }
    icons.delete(0)
    icons
  end #get_add_state_icons
  
  #--------------------------------------------------------------------------
  # draw_remove_state_icons
  #--------------------------------------------------------------------------
  def draw_remove_state_icons(item, x, y)
    icons = get_remove_state_icons(item)
    icons.each_with_index do |n, i|
      icon_row_max = (contents.width - 4 - x) / 24
      y_plus = (i / icon_row_max) * line_height
      x_plus = (i % icon_row_max) * 24
      draw_icon(n, x + x_plus, y + y_plus)
    end #do
  end #draw_remove_state_icons
  
  #--------------------------------------------------------------------------
  # get_remove_state_icons
  #--------------------------------------------------------------------------
  def get_remove_state_icons(item)
    icons =  item.remove_states.collect  { |id| $data_states[id].icon_index }
    icons += item.remove_buffs.collect   { |param| buff_icon_index( 1, param) }
    icons += item.remove_debuffs.collect { |param| buff_icon_index(-1, param) }
    icons.delete(0)
    icons
  end #get_remove_state_icons
  
  #--------------------------------------------------------------------------
  # buff_icon_index           # Get Icon Number Corresponding to Buff/Debuff
  #--------------------------------------------------------------------------
  def buff_icon_index(buff_level, param_id)
    if buff_level > 0
      return ICON_BUFF_START + (buff_level - 1) * 8 + param_id
    elsif buff_level < 0
      return ICON_DEBUFF_START + (-buff_level - 1) * 8 + param_id 
    else
      return 0
    end #if
  end #buff_icon_index
  
  #--------------------------------------------------------------------------
  # draw_add_state_text
  #--------------------------------------------------------------------------
  def draw_add_state_text(item, x, y)
    change_color(system_color)
    rect = standard_rect(x, y)
    text = info_header_text(:add_states) # "Add States"
    draw_text(rect, text)
  end #draw_add_state_text
  
  #--------------------------------------------------------------------------
  # draw_remove_state_text
  #--------------------------------------------------------------------------
  def draw_remove_state_text(item, x, y)
    change_color(system_color)
    rect = standard_rect(x, y)
    text = info_header_text(:remove_states) # "Remove States"
    draw_text(rect, text)
  end #draw_remove_state_text
  
  #--------------------------------------------------------------------------
  # draw_hp_recovery
  #--------------------------------------------------------------------------
  def draw_hp_recovery(item, x, y)
    change_color(system_color)
    rect = standard_rect(x, y) 
    text = info_header_text(:hp_recovery) # "HP Recovery"
    draw_text(rect, text)
    value = item.hp_recovery
    rate = item.hp_recovery_rate
    text = get_recovery_text(value, rate)
    draw_text(rect, text, 2)
  end #draw_hp_recovery
  
  #--------------------------------------------------------------------------
  # draw_mp_recovery
  #--------------------------------------------------------------------------
  def draw_mp_recovery(item, x, y)
    change_color(system_color)
    rect = standard_rect(x, y)
    text = info_header_text(:mp_recovery) # "MP Recovery"
    draw_text(rect, text)
    value = item.mp_recovery
    rate = item.mp_recovery_rate
    text = get_recovery_text(value, rate)
    draw_text(rect, text, 2)
  end #draw_mp_recovery
  
  #--------------------------------------------------------------------------
  # draw_tp_recovery
  #--------------------------------------------------------------------------
  def draw_tp_recovery(item, x, y)
    change_color(system_color)
    rect = standard_rect(x, y)
    text = info_header_text(:tp_recovery) # "TP Recovery"
    draw_text(rect, text)
    # If you get an error on this line, it means you are using an old
    # version of "Reader Functions for Features/Effects". Get v1.2 or above.
    value = item.tp_recovery
    text = get_recovery_text(value)
    draw_text(rect, text, 2)
  end #draw_tp_recovery
  
  #--------------------------------------------------------------------------
  # get_recovery_text
  #--------------------------------------------------------------------------
  def get_recovery_text(value, rate = 0)
    rate = rate * 100
    if value != 0 && rate != 0
      change_color(param_change_color(value))
      text = sprintf("%+d%%%+d", rate, value)
    elsif rate != 0
      change_color(param_change_color(rate))
      text = sprintf("%+d%%", rate)
    else
      change_color(param_change_color(value))
      text = sprintf("%+d", value)
    end #if
    return text
  end #get_recovery_text

  #--------------------------------------------------------------------------
  # draw_param_name
  #--------------------------------------------------------------------------
  def draw_param_name(x, y, param_id)
    change_color(system_color)
    text = Vocab::param(param_id)
    draw_text(x, y, contents.width - 4 - x, line_height, text)
  end #draw_param_name
  
  #--------------------------------------------------------------------------
  # draw_param_value
  #--------------------------------------------------------------------------
  def draw_param_value(item, x, y, param_id)
    rect = standard_rect(x, y)
    value = item.param(param_id)
    rate = item.param_rate(param_id)
    text = get_param_text(value, rate)
    draw_text(rect, text, 2)
  end #draw_param_value
  
  #--------------------------------------------------------------------------
  # get_param_text
  #--------------------------------------------------------------------------
  def get_param_text(value, rate = 0)
    rate = (rate * 100).to_i - 100
    if value != 0 && rate != 0
      change_color(param_change_color(value))
      text = sprintf("%+d%%%+d", rate, value)
    elsif rate != 0
      change_color(param_change_color(rate))
      text = sprintf("%+d%%", rate)
    else
      change_color(param_change_color(value))
      text = sprintf("%+d", value)
    end #if
    return text
  end #get_param_text
  
  #--------------------------------------------------------------------------
  # draw_xparam_name
  #--------------------------------------------------------------------------
  def draw_xparam_name(x, y, param_id)
    change_color(system_color)
    text = vocab_xparam(param_id)
    draw_text(x, y, contents.width - 4 - x, line_height, text)
  end
  
  #--------------------------------------------------------------------------
  # draw_sparam_name
  #--------------------------------------------------------------------------
  def draw_sparam_name(x, y, param_id)
    change_color(system_color)
    text = vocab_sparam(param_id)
    draw_text(x, y, contents.width - 4 - x, line_height, text)
  end
  
  #--------------------------------------------------------------------------
  # vocab_xparam
  #--------------------------------------------------------------------------
  def vocab_xparam(param_id)
    return Vocab::xparam_f(param_id) #if use_full_param_names?
    return Vocab::xparam(param_id)
  end
  
  #--------------------------------------------------------------------------
  # vocab_sparam
  #--------------------------------------------------------------------------
  def vocab_sparam(param_id)
    return Vocab::sparam_f(param_id) #if use_full_param_names?
    return Vocab::sparam(param_id)
  end


  #--------------------------------------------------------------------------
  # draw_xparam_value
  #--------------------------------------------------------------------------
  def draw_xparam_value(item, x, y, param_id)
    value = item.xparam(param_id)
    text = get_xparam_text(value)
    draw_parameter_value(text, x, y)
  end
  
  #--------------------------------------------------------------------------
  # draw_sparam_value
  #--------------------------------------------------------------------------
  def draw_sparam_value(item, x, y, param_id)
    value = item.sparam(param_id)
    text = get_sparam_text(value)
    draw_parameter_value(text, x, y)
  end
  
  #--------------------------------------------------------------------------
  # draw_parameter_value
  #--------------------------------------------------------------------------
  def draw_parameter_value(text, x, y)
    rect = standard_rect(x, y)
    draw_text(rect, text, 2)
  end


  #--------------------------------------------------------------------------
  # get_xparam_text
  #--------------------------------------------------------------------------
  def get_xparam_text(value)
    value = (value * 100)
    change_color(param_change_color(value))
    text = sprintf("%+d%%", value)
    return text
  end

  #--------------------------------------------------------------------------
  # get_sparam_text
  #--------------------------------------------------------------------------
  def get_sparam_text(value)
    value = (value * 100).to_i - 100
    change_color(param_change_color(value))
    text = sprintf("%+d%%", value)
    return text
  end

  #--------------------------------------------------------------------------
  # col_max
  #--------------------------------------------------------------------------
  def col_max
    return 2
  end #col_max
  
  #--------------------------------------------------------------------------
  # item_width
  #--------------------------------------------------------------------------
  def item_width
    (width - standard_padding * 2 + 4) / col_max - 4
  end #item_width
  
  #--------------------------------------------------------------------------
  # draw_item
  #--------------------------------------------------------------------------
  def draw_item(index)
    item = @data[index]
    if item
      rect = item_rect(index)
      rect.width -= 4
      draw_item_name(item, rect.x, rect.y, enable?(item))
      draw_item_number(rect, item)
    end #if
  end #draw_item
  
  #--------------------------------------------------------------------------
  # draw_item_number
  #--------------------------------------------------------------------------
  def draw_item_number(rect, item)
    draw_text(rect, sprintf(":%2d", $game_party.item_number(item)), 2)
  end #draw_item_number
  
  #--------------------------------------------------------------------------
  # draw_item_stats_text
  #--------------------------------------------------------------------------
  def draw_info_header_text(x, y)
    rect = standard_rect(x, y)
    change_color(system_color)
    draw_text(rect, info_header_text(:main_header))
    if @item.is_a?(Game_Actor) #@category == :actor_features
      draw_character_as_icon(@item.character_name, @item.character_index, rect.width - 24, y) if @item
    else
      draw_icon(@item.icon_index, rect.width - 24, y) if @item
    end # if
  end #draw_info_header_text

  #--------------------------------------------------------------------------
  # item=                                        # Set Item
  #--------------------------------------------------------------------------
  def item=(item)
    @item = item
    @page_index = 0
    refresh
  end #item
  
  #--------------------------------------------------------------------------
  # page_max                            # Get Maximum Number of Pages
  #--------------------------------------------------------------------------
  def page_max
    (@ingredients.size + page_size - 1) / page_size
  end #page_max
  
  #--------------------------------------------------------------------------
  # opening_proc
  #--------------------------------------------------------------------------
  def opening_proc
    @closing_proc = false
    @opening_proc = true
  end #opening_proc

  #--------------------------------------------------------------------------
  # closing_proc
  #--------------------------------------------------------------------------
  def closing_proc
    @opening_proc = false
    @closing_proc = true
  end #closing_proc

  #--------------------------------------------------------------------------
  # feature_category
  #--------------------------------------------------------------------------
  def feature_category(feature_category)
    @category = feature_category
    @data = $game_party.members if @category == :actor_features
  end #feature_category
  
end # class Window_Info_Page  

###////////////////////////////////////////////////////////////////////////////

#==============================================================================
# ** Window_MenuCommand
#------------------------------------------------------------------------------
#  This command window appears on the menu screen.
#==============================================================================
class Window_MenuCommand < Window_Command
  #--------------------------------------------------------------------------
  # * For Adding Original Commands
  #--------------------------------------------------------------------------
  alias :lms_featurescene_windowmenucommand_addoriginalcommands_0704151424 add_original_commands
  #--------------------------------------------------------------------------
  def add_original_commands
      lms_featurescene_windowmenucommand_addoriginalcommands_0704151424()
      add_command("Features", :features_scene, true)
  end #add_original_commands (method)
end #Window_MenuCommand (class)

#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs the menu screen processing.
#==============================================================================
class Scene_Menu < Scene_MenuBase
  #--------------------------------------------------------------------------
  # * Create Command Window
  #--------------------------------------------------------------------------
  alias :lms_featurescene_scene_menu_createcommandwindow_0704151424 create_command_window
  #--------------------------------------------------------------------------
  def create_command_window
    lms_featurescene_scene_menu_createcommandwindow_0704151424()
    @command_window.set_handler(:features_scene,    method(:command_features_scene))
  end #create_command_window
  #--------------------------------------------------------------------------
  # * Calls the Features Scene
  #--------------------------------------------------------------------------
  def command_features_scene
    SceneManager.call(Scene_Features)
  end #command_features_scene (method)
end #Scene_Menu (class)

###////////////////////////////////////////////////////////////////////////////

#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
#  This is a super class of all windows within the game.
#==============================================================================
class Window_Base < Window
  
  #--------------------------------------------------------------------------
  # * Draw Item Name (default method overwrite)
  # ** Adds a specific drawing procedure for actors as items on a list.
  #--------------------------------------------------------------------------
  alias :lms_featurescene_windowbase_drawitemname_0704151424 draw_item_name
  #--------------------------------------------------------------------------
  def draw_item_name(item, x, y, enabled = true, width = 172)
    return unless item
    if item.is_a?(Game_Actor)
      draw_character_as_icon(item.character_name, item.character_index, x, y)
      change_color(normal_color, enabled)
      draw_text(x + 24, y, width, line_height, item.name)
    else
      lms_featurescene_windowbase_drawitemname_0704151424(item, x, y, enabled, width)
    end #if
  end #draw_item_name
  
  #--------------------------------------------------------------------------
  # * Draw Character as Icon (new method)
  # ** Draw the character sprite as an icon
  #--------------------------------------------------------------------------
  def draw_character_as_icon(character_name, character_index, x, y, enabled = true)
    return unless character_name
    bitmap = Cache.character(character_name)
    sign = character_name[/^[\!\$]./]
    if sign && sign.include?('$')
      cw = bitmap.width / 3
      ch = bitmap.height / 4
    else
      cw = bitmap.width / 12
      ch = bitmap.height / 8
    end #if
    n = character_index
    src_rect = (Rect.new((n%4*3+1)*cw, (n/4*4)*ch, cw, ch))
    dest_rect = (Rect.new(x, y, 24, 24))
    contents.stretch_blt(dest_rect, bitmap, src_rect)
  end #draw_character_as_icon
end #Window_Base

 

 

 

Share this post


Link to post
Share on other sites

I'm very surprised this hasn't received any recognition. This looks like a great script. I'm going to test it out right now. 

Thanks and pls let me know what you think of it.

It is rather unpolished tho.

Having no clue about regexp forced me to work upon an existing script instead of writing one from scratch - and that could explain the lack of "recognition".

Also I couldn't manage to use bang and query method's at all (wich I plan to fix after some more ruby lessons :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×