・一覧に表示させないステートを指定できるように変更
・ヘルプウィンドウにスキル等の情報が残るバグを修正
コード: 全て選択
module TOMO
module StateHelp
# 説明文の設定
# ステートID => 説明文
#
# 説明文に制御文字が使えます
Text = {
1 => "HPが0になり、死亡した状態。", # 戦闘不能
2 => "\\C[2]テスト\\C[0]", # 毒
}
# 一覧に表示させないステートID
HideState = [9]
end
end
class Window_StateList < Window_Command
def make_command_list
states = []
($game_party.members + $game_troop.members).each do |battler|
states |= battler.states.collect{|s| s.id }
end
states.sort!
states.each do |state_id|
next if TOMO::StateHelp::HideState.include?(state_id)
state = $data_states[state_id]
add_command(state.name, :state_list, true, state)
end
end
def window_width
Graphics.width
end
def window_height
Graphics.height - fitting_height(2)
end
def process_ok
end
def draw_item(index)
change_color(normal_color, command_enabled?(index))
rect = item_rect_for_text(index)
draw_item_name(@list[index][:ext], rect.x, rect.y)
end
def update_help
if @help_window && current_ext
text = TOMO::StateHelp::Text[current_ext.id]
text = "" if TOMO::StateHelp::Text[current_ext.id].nil?
text += "\r\n\\}"
($game_party.members + $game_troop.members).each do |battler|
text += battler.name + " " if battler.state?(current_ext.id)
end
@help_window.set_text(text)
end
end
def show
refresh
select(0)
@help_window.show if @help_window
super
end
def hide
@help_window.hide if @help_window
super
end
end
class Window_PartyCommand < Window_Command
alias tomo_state_help_make_command_list make_command_list
def make_command_list
tomo_state_help_make_command_list
add_command("ステート確認", :state)
end
end
class Scene_Battle < Scene_Base
alias tomo_state_help_create_party_command_window create_party_command_window
def create_party_command_window
tomo_state_help_create_party_command_window
@party_command_window.set_handler(:state, method(:command_state))
@party_command_window.unselect
end
alias tomo_state_help_create_all_windows create_all_windows
def create_all_windows
tomo_state_help_create_all_windows
@state_window = Window_StateList.new(0, @help_window.height)
@state_window.set_handler(:cancel, method(:on_state_cancel))
@state_window.help_window = @help_window
@state_window.hide
end
def command_state
@party_command_window.deactivate
@help_window.set_text("")
@state_window.show.activate
end
def on_state_cancel
@state_window.hide.deactivate
@party_command_window.activate
end
end