#在角色备注写上<hide param>和<hide level>
module NCF
module REGEXP
module ACTOR
HIDE_LEVEL_PARAM_TEXT = /<(?:HIDE|hide)[ ]\s*(.*)>/i
end
end
end
module DataManager
class << self; alias :load_database_hlpt :load_database; end
def self.load_database
load_database_hlpt
load_notetags_hlpt
end
def self.load_notetags_hlpt
groups = [$data_actors]
for group in groups
for obj in group
next if obj.nil?
obj.load_notetags_hlpt
end
end
end
end
class RPG::Actor
attr_accessor :hide_level_param_text
def load_notetags_hlpt
@hide_level_param_text = [false, false]
self.note.split(/[\r\n]+/).each { |line|
case line
when NCF::REGEXP::ACTOR::HIDE_LEVEL_PARAM_TEXT
case $1.upcase
when "LEVEL"
@hide_level_param_text[0] = true
when "PARAM"
@hide_level_param_text[1] = true
end
end
}
end
end
class Game_Temp
#--------------------------------------------------------------------------
# ● 定义实例变量
#--------------------------------------------------------------------------
attr_accessor :hide_level_param_text
#--------------------------------------------------------------------------
# ● 初始化對象
#--------------------------------------------------------------------------
alias :initialize_hide :initialize
def initialize
initialize_hide
@hide_level_param_text = false
end
end
class Window_Base < Window
#--------------------------------------------------------------------------
# ● 绘制內容
# args : 与 Bitmap#draw_text 相同
#--------------------------------------------------------------------------
alias :draw_text_hide :draw_text
def draw_text(*args)
args[4] = "???" if $game_temp.hide_level_param_text && args[4].is_a?(Numeric)
draw_text_hide(*args)
end
#--------------------------------------------------------------------------
# ● 绘制等级
#--------------------------------------------------------------------------
alias :draw_actor_level_hide :draw_actor_level
def draw_actor_level(actor, x, y)
$game_temp.hide_level_param_text = true if actor.actor.hide_level_param_text[0]
draw_actor_level_hide(actor, x, y)
$game_temp.hide_level_param_text = false
end
#--------------------------------------------------------------------------
# ● 绘制 HP
#--------------------------------------------------------------------------
alias :draw_actor_hp_hide :draw_actor_hp
def draw_actor_hp(actor, x, y, width = 124)
$game_temp.hide_level_param_text = true if actor.actor.hide_level_param_text[1]
draw_actor_hp_hide(actor, x, y, width)
$game_temp.hide_level_param_text = false
end
#--------------------------------------------------------------------------
# ● 绘制 HP
#--------------------------------------------------------------------------
alias :draw_actor_mp_hide :draw_actor_mp
def draw_actor_mp(actor, x, y, width = 124)
$game_temp.hide_level_param_text = true if actor.actor.hide_level_param_text[1]
draw_actor_mp_hide(actor, x, y, width)
$game_temp.hide_level_param_text = false
end
#--------------------------------------------------------------------------
# ● 绘制 HP
#--------------------------------------------------------------------------
alias :draw_actor_tp_hide :draw_actor_tp
def draw_actor_tp(actor, x, y, width = 124)
$game_temp.hide_level_param_text = true if actor.actor.hide_level_param_text[1]
draw_actor_tp_hide(actor, x, y, width)
$game_temp.hide_level_param_text = false
end
#--------------------------------------------------------------------------
# ● 绘制能力值
#--------------------------------------------------------------------------
alias :draw_actor_param_hide :draw_actor_param
def draw_actor_param(actor, x, y, param_id)
$game_temp.hide_level_param_text = true if actor.actor.hide_level_param_text[1]
draw_actor_param_hide(actor, x, y, param_id)
$game_temp.hide_level_param_text = false
end
end
class Window_EquipStatus < Window_Base
#--------------------------------------------------------------------------
# ● 绘制当前能力值
#--------------------------------------------------------------------------
alias :draw_current_param_hide :draw_current_param
def draw_current_param(x, y, param_id)
$game_temp.hide_level_param_text = true if @actor.actor.hide_level_param_text[1]
draw_current_param_hide(x, y, param_id)
$game_temp.hide_level_param_text = false
end
end