Skip to content

Instantly share code, notes, and snippets.

@TakkunMaker
Created February 6, 2018 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TakkunMaker/9ef12c58d826471ca35b8852dfcbfc48 to your computer and use it in GitHub Desktop.
Save TakkunMaker/9ef12c58d826471ca35b8852dfcbfc48 to your computer and use it in GitHub Desktop.
#==============================================================================
# ** TK - Class Icon
#------------------------------------------------------------------------------
# Autor: Takkun (a.k.a Faalco)
# Create: 06/02/2018
# Version: 1.0a
#==============================================================================
# * Instructions & Info:
# -----------------------------------------------------------------------------
# Paste the script above the main of your project, and make the necessary
# settings.
#
# This script (Only the TK - Class Icon) can be used for commercial and
# non-commercial purposes, credits are welcome but not required.
#
# Any problems before the script can be taken on the topics of the same or by
# personal message us forums in which I participate.
#
#==============================================================================
($imported ||= {})["TK - Class Icon"] = true
#==============================================================================
# ** RPG::Class
#------------------------------------------------------------------------------
# The data class for class.
#==============================================================================
module RPG
class Class < BaseItem
#--------------------------------------------------------------------------
# * Class Icon
#--------------------------------------------------------------------------
def class_icon
return @class_icon unless @class_icon.nil?
load_notetag_class_icon
return @class_icon
end
#--------------------------------------------------------------------------
# * Load Note
#--------------------------------------------------------------------------
def load_notetag_class_icon
regex =/<icon:(\d+)>/i
@class_icon = self.note =~ regex ? $1.downcase : 143
end
end
end
#==============================================================================
# ** Window_Base
#------------------------------------------------------------------------------
# This is a super class of all windows within the game.
#==============================================================================
class Window_Base < Window
#--------------------------------------------------------------------------
# * Draw Class
#--------------------------------------------------------------------------
def draw_actor_class(actor, x, y, width = 112)
change_color(normal_color)
draw_icon($data_classes[actor.class.id].class_icon.to_i, x, y)
draw_text(x + 25, y, width, line_height, actor.class.name)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment