# ╔═══════════════════════════════════════════════╦════════════════════╗
# ║ Title: Skill Equip Display mod ║ Version: 1.00 ║
# ║ Author: Roninator2 ║ ║
# ╠═══════════════════════════════════════════════╬════════════════════╣
# ║ Function: ║ Date Created ║
# ║ ╠════════════════════╣
# ║ Script Function ║ 05 Sep 2024 ║
# ╚═══════════════════════════════════════════════╩════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Requires: Yami Engine Symphony - Skill Equip ║
# ║ ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Brief Description: ║
# ║ Allow note tag control of text ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Instructions: ║
# ║ Use note tag <mp_pp: X> to control which value is displayed for ║
# ║ the skill. MP or PP. 0 = MP, 1 = PP, 2 = both with switching ║
# ║ ║
# ║ Use note tag for controlling the text to display ║
# ║ <display text: text, other text> ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Updates: ║
# ║ 1.00 - 05 Sep 2024 - Script finished ║
# ║ ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Credits and Thanks: ║
# ║ Roninator2 ║
# ║ ║
# ╚════════════════════════════════════════════════════════════════════╝
# ╔════════════════════════════════════════════════════════════════════╗
# ║ Terms of use: ║
# ║ Follow the original Authors terms of use where applicable ║
# ║ - When not made by me (Roninator2) ║
# ║ Free for all uses in RPG Maker except nudity ║
# ║ Anyone using this script in their project before these terms ║
# ║ were changed are allowed to use this script even if it conflicts ║
# ║ with these new terms. New terms effective 03 Apr 2024 ║
# ║ No part of this code can be used with AI programs or tools ║
# ║ Credit must be given ║
# ╚════════════════════════════════════════════════════════════════════╝
module YES
module SKILL_EQUIP
ITEM_REGEX = /<display[-_ ]*text:[ ](\w*),(...*)>/i
INPUT_SWITCH = :X # A button
MP_PP_REGEX = /<mp[-_ ]*pp:[ ](\d+)>/i
end
end
# ╔════════════════════════════════════════════════════════════════════╗
# ║ End of editable region ║
# ╚════════════════════════════════════════════════════════════════════╝
#==============================================================================
# ¡ Window_Properties_Slot
#==============================================================================
class Window_Properties_Slot < Window_Base
#--------------------------------------------------------------------------
# refresh
#--------------------------------------------------------------------------
def refresh
contents.clear
return unless @actor
if @item.nil? || @item == 0
reset_font_settings
change_color(normal_color, false)
draw_icon(YES::SKILL_EQUIP::EMPTY_SKILL_ICON, 0, 0, false)
draw_text(24, 0, contents.width, line_height, YES::SKILL_EQUIP::EMPTY_SKILL_TEXT)
end
return if @item.nil? || @item == 0
reset_font_settings
#---
draw_item_name(@item, 0, 0)
#---
return if @item.nil?
@text_data = []
@text_data = @item.note.scan(YES::SKILL_EQUIP::ITEM_REGEX)
draw_skill_data
end
#--------------------------------------------------------------------------
# draw_skill_data
#--------------------------------------------------------------------------
def draw_skill_data
if @item.note.scan(YES::SKILL_EQUIP::MP_PP_REGEX)[0]
sw_data = @item.note.scan(YES::SKILL_EQUIP::MP_PP_REGEX)[0][0].to_i
end
i = 1
@text_data.each { |line|
group = line[0]; value = line[1]
w = contents.width
case sw_data
when 0
if group == "PP"
draw_skill_cost(i*line_height)
else
change_color(system_color)
draw_text(0, i * line_height, w, line_height, group)
change_color(normal_color)
draw_text(0, i * line_height, w, line_height, value, 2)
end
when 1
change_color(system_color)
draw_text(0, i * line_height, w, line_height, group)
change_color(normal_color)
draw_text(0, i * line_height, w, line_height, value, 2)
when 2
if @mp_pp == true && group == "PP"
draw_skill_cost(i*line_height)
else
change_color(system_color)
draw_text(0, i * line_height, w, line_height, group)
change_color(normal_color)
draw_text(0, i * line_height, w, line_height, value, 2)
end
else
change_color(system_color)
draw_text(0, i * line_height, w, line_height, group)
change_color(normal_color)
draw_text(0, i * line_height, w, line_height, value, 2)
end
i += 1
}
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
alias r2_update_mp_pp update
def update
r2_update_mp_pp
if Input.trigger?(YES::SKILL_EQUIP::INPUT_SWITCH)
@mp_pp = !@mp_pp
refresh
end
end
end