# ╔═════════════════════════════════════╦════════════════════╗
# ║ Title: Alternate Window Status 1 ║ Version: 1.00 ║
# ║ Author: Roninator2 ║ ║
# ╠═════════════════════════════════════╬════════════════════╣
# ║ Function: ║ Date Created ║
# ║ ╠════════════════════╣
# ║ Display Actor Status ║ 28 Nov 2023 ║
# ╚═════════════════════════════════════╩════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Requires: nil ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Brief Description ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Instructions: ║
# ║ ║
# ║ Configure the colour setting below and gauge position ║
# ║ and image filename extension ║
# ║ ║
# ║ example is "Status" ║
# ║ filename will be Actor4 (Eric) + "-" ║
# ║ index position (for the face) + "_" ║
# ║ name in quotes below in config ║
# ║ Example ║
# ║ Actor4-1_Status.png ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Updates: ║
# ║ 1.00 - 28 Nov 2023 - Script finished ║
# ╚══════════════════════════════════════════════════════════╝
# ╔══════════════════════════════════════════════════════════╗
# ║ Terms of use: ║
# ║ Free for all uses in RPG Maker except nudity ║
# ╚══════════════════════════════════════════════════════════╝
module R2_Alt_Status_One
FULL_LINE_COLOUR = Color.new(250, 20, 20, 200)
SECTION_LINE_COLOUR = Color.new(120, 20, 180, 200)
SECTION_TEXT_COLOUR = Color.new(190, 140, 220, 200)
STAT_TEXT_COLOUR = Color.new(90, 240, 120, 200)
DATA_TEXT_COLOUR = Color.new(220, 20, 180, 200)
HP_X = 120
MP_X = 100
IMAGE_FILENAME_EXT = "Status"
IMAGE_FILE_SIZE = 270 # pixels of image in width and height
# can be higher but image will be cut off if larger than this number
# find a value that works for you. 270 is good for default resolution
end
#==============================================================================
# ** Window_Status
#==============================================================================
class Window_Status < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize(actor)
super(0, 0, Graphics.width, Graphics.height)
@actor = actor
refresh
activate
end
#--------------------------------------------------------------------------
# * Set Actor
#--------------------------------------------------------------------------
def actor=(actor)
return if @actor == actor
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
# Draw Description of actor
draw_desc
draw_horz_line(line_height * 2)
# draw actor image, face or bust
draw_image
# draw actor stats and equipment
draw_stat_eq
# draw actor data (hp, mp)
draw_horz_line(contents_height - 80)
draw_act_data(contents_height - 72)
end
#--------------------------------------------------------------------------
# * Draw Description
#--------------------------------------------------------------------------
def draw_desc
draw_description(8, 0)
end
#--------------------------------------------------------------------------
# * Draw Description
#--------------------------------------------------------------------------
def draw_description(x, y)
draw_text_ex(x, y, @actor.description)
end
#--------------------------------------------------------------------------
# * Draw Actor Image
#--------------------------------------------------------------------------
def draw_image
draw_section_title(20, 72 - 16)
draw_section_line(10, 72)
# 240 pixels
draw_actor_image(@actor, 8, 72 - 32)
end
#--------------------------------------------------------------------------
# * Draw Image Title
#--------------------------------------------------------------------------
def draw_section_title(x,y)
change_color(R2_Alt_Status_One::SECTION_TEXT_COLOUR)
draw_text(x, y, 180, line_height, "Portrait", 0)
end
#--------------------------------------------------------------------------
# * Draw Actor Image
#--------------------------------------------------------------------------
def draw_actor_image(actor, x, y)
rct_size = R2_Alt_Status_One::IMAGE_FILE_SIZE
bitmap = Cache.picture(actor.face_name.to_s + "-" + actor.face_index.to_s + "_" + "#{R2_Alt_Status_One::IMAGE_FILENAME_EXT}")
self.contents.blt(x, y, bitmap, Rect.new(0, 0, rct_size, rct_size), 255)
bitmap.dispose
end
#--------------------------------------------------------------------------
# * Draw Stats & Equip
#--------------------------------------------------------------------------
def draw_stat_eq
x = Graphics.width / 2
draw_stat_title(x + 10, 72 - 16)
draw_section_line(x, 72)
draw_parameters(x + 10, line_height * 3 - 16)
draw_equip_title(x + 10, 56 + line_height * 4)
draw_section_line(x, 72 + line_height * 4)
draw_equipments(x, y + line_height * 8 - 8)
end
#--------------------------------------------------------------------------
# * Draw Image Title
#--------------------------------------------------------------------------
def draw_stat_title(x,y)
change_color(R2_Alt_Status_One::SECTION_TEXT_COLOUR)
draw_text(x, y, 180, line_height, "Attributes", 0)
end
#--------------------------------------------------------------------------
# * Draw Image Title
#--------------------------------------------------------------------------
def draw_equip_title(x,y)
change_color(R2_Alt_Status_One::SECTION_TEXT_COLOUR)
draw_text(x, y, 180, line_height, "Equipment", 0)
end
#--------------------------------------------------------------------------
# * Draw Parameters
#--------------------------------------------------------------------------
def draw_parameters(x, y)
6.times {|i|
j = i + 2
if j.even?
draw_actor_param(@actor, x, y + line_height * (j / 2), j)
else
draw_actor_param(@actor, x + x / 2, y + line_height * (j / 2).to_i, j)
end
}
end
#--------------------------------------------------------------------------
# * Draw Parameters
#--------------------------------------------------------------------------
def draw_actor_param(actor, x, y, param_id)
change_color(R2_Alt_Status_One::STAT_TEXT_COLOUR)
draw_text(x, y, 120, line_height, Vocab::param(param_id))
change_color(normal_color)
draw_text(x + 60, y, 36, line_height, actor.param(param_id), 2)
end
#--------------------------------------------------------------------------
# * Draw Equipment
#--------------------------------------------------------------------------
def draw_equipments(x, y)
@actor.equips.each_with_index do |item, i|
draw_item_name(item, x, y + line_height * i)
end
end
#--------------------------------------------------------------------------
# * Draw Actor Data
#--------------------------------------------------------------------------
def draw_act_data(y)
draw_actor_name(@actor, 4, y)
draw_actor_class(@actor, R2_Alt_Status_One::MP_X, y)
draw_basic_info(10, y)
draw_exp_info(304, y)
end
#--------------------------------------------------------------------------
# * Draw Basic Information
#--------------------------------------------------------------------------
def draw_basic_info(x, y)
draw_actor_level(@actor, x, y + line_height * 2)
draw_actor_icons(@actor, x, y + line_height * 1)
draw_actor_hp(@actor, R2_Alt_Status_One::HP_X, y + line_height * 1)
draw_actor_mp(@actor, R2_Alt_Status_One::MP_X, y + line_height * 2)
end
#--------------------------------------------------------------------------
# * Draw Level
#--------------------------------------------------------------------------
def draw_actor_level(actor, x, y)
change_color(R2_Alt_Status_One::DATA_TEXT_COLOUR)
draw_text(x, y, 24, line_height, Vocab::level_a)
change_color(normal_color)
draw_text(x + 32, y, 36, line_height, actor.level, 2)
end
#--------------------------------------------------------------------------
# * Draw Experience Information
#--------------------------------------------------------------------------
def draw_exp_info(x, y)
s1 = @actor.max_level? ? "-------" : @actor.exp
s2 = @actor.max_level? ? "-------" : @actor.next_level_exp - @actor.exp
s_next = sprintf(Vocab::ExpNext, Vocab::level)
change_color(R2_Alt_Status_One::DATA_TEXT_COLOUR)
draw_text(x, y - 2, 180, line_height, Vocab::ExpTotal)
draw_text(x, y + 30, 180, line_height, s_next)
change_color(normal_color)
draw_text(x, y + 16, 180, line_height * 1, s1, 2)
draw_text(x, y + 48, 180, line_height, s2, 2)
end
#--------------------------------------------------------------------------
# * Draw Horizontal Line
#--------------------------------------------------------------------------
def draw_horz_line(y)
contents.fill_rect(0, y + 8, contents_width, 2, line_color)
end
#--------------------------------------------------------------------------
# * Draw Horizontal Line
#--------------------------------------------------------------------------
def draw_section_line(x,y)
contents.fill_rect(x, y + 8, contents_width / 2 - 20, 2, section_color)
end
#--------------------------------------------------------------------------
# * Get Color of Horizontal Line
#--------------------------------------------------------------------------
def line_color
color = R2_Alt_Status_One::FULL_LINE_COLOUR
color
end
#--------------------------------------------------------------------------
# * Get Color of Horizontal Line
#--------------------------------------------------------------------------
def section_color
color = R2_Alt_Status_One::SECTION_LINE_COLOUR
color
end
end