コード: 全て選択
#立ち絵表示
#
#
# 内容:立ち絵の表示 / 独自ステータスの表示 / 項目削除[並べ替え][ステータス]
# by nleo
# Pictureフォルダの画像を以下のファイル名で参照します
# "立ち絵_" SIMGA[着替えID] + "_" + SIMGB[表情ID]
#
module MENUSTAND
SIMGAID = 3
SIMGBID = 4
KIND = ["未設定", "未設定", "未設定", "未設定", "未設定"]
STATS = [25, 26, 27, 28, 29]
end
class Window_Base < Window
#--------------------------------------------------------------------------
# ○ 立ち絵の描画
#--------------------------------------------------------------------------
def draw_standimage(x, y, enabled = true)
$game_variables[MENUSTAND::SIMGBID] = 1 if $game_variables[MENUSTAND::SIMGBID] <= 0
$game_variables[MENUSTAND::SIMGAID] = 1 if $game_variables[MENUSTAND::SIMGAID] <= 0
filename = "Actor" + $game_variables[MENUSTAND::SIMGAID].to_s + "_" + $game_variables[MENUSTAND::SIMGBID].to_s
bitmap = Cache.picture(filename)
rect = Rect.new(0, 0, 500, 500)
contents.blt(x, y, bitmap, rect, enabled ? 255 : translucent_alpha)
bitmap.dispose
end
end
class Window_MenuStatus < Window_Selectable
#--------------------------------------------------------------------------
# ■ 項目の高さを取得
#--------------------------------------------------------------------------
def item_height
(height - standard_padding * 2)
end
#--------------------------------------------------------------------------
# ○ メニュー立ち絵のステータス描画
#--------------------------------------------------------------------------
def draw_actor_stand_status(actor, x, y)
#~ bw = 260 #block width
bw = 0 #block width
# 能力地の描画
draw_parameters(actor, x, y)
# 経験地の描画
draw_exp_info(actor, x, y + 150)
y += 205
change_color(system_color)
# 独自ステータスの名前を描画
(MENUSTAND::KIND.length).times {|i|
draw_text(x, y+line_height*i, 20 * MENUSTAND::KIND[i].length, line_height, MENUSTAND::KIND[i])
}
# 独自ステータスの値を描画
change_color(normal_color)
draw_text(x+150, y+line_height*0, 20 * $game_variables[MENUSTAND::STATS[0]].to_s.length.to_i + 30, line_height, $game_variables[MENUSTAND::STATS[0]].to_s)
draw_text(x+150, y+line_height*1, 20 * $game_variables[MENUSTAND::STATS[1]].to_s.length.to_i + 30, line_height, $game_variables[MENUSTAND::STATS[1]].to_s)
draw_text(x+150, y+line_height*2, 20 * $game_variables[MENUSTAND::STATS[2]].to_s.length.to_i + 30, line_height, $game_variables[MENUSTAND::STATS[2]].to_s+"人")
draw_text(x+150, y+line_height*3, 20 * $game_variables[MENUSTAND::STATS[3]].to_s.length.to_i + 30, line_height, $game_variables[MENUSTAND::STATS[3]].to_s+"mℓ")
draw_text(x+150, y+line_height*4, 20 * $game_variables[MENUSTAND::STATS[4]].to_s.length.to_i + 30, line_height, $game_variables[MENUSTAND::STATS[4]].to_s+"mℓ")
#~ draw_text(x+150, y+line_height*0, bw, line_height, $game_variables[MENUSTAND::STATS[0]].to_s)
#~ draw_text(x+150, y+line_height*1, bw, line_height, $game_variables[MENUSTAND::STATS[1]].to_s+"人")
#~ draw_text(x+150, y+line_height*2, bw, line_height, $game_variables[MENUSTAND::STATS[2]].to_s+"回")
#~ draw_text(x+150, y+line_height*3, bw, line_height, $game_variables[MENUSTAND::STATS[3]].to_s+"回")
#~ draw_text(x+150, y+line_height*4, bw, line_height, $game_variables[MENUSTAND::STATS[4]].to_s+"回")
#~ draw_text(x+150, y+line_height*5, bw, line_height, $game_variables[MENUSTAND::STATS[5]].to_s+"回")
y += 135 # 微妙に下にずらす
draw_actor_name(actor, x + bw, y)
draw_actor_level(actor, x + bw + 100, y)
draw_actor_icons(actor, x + bw, y + line_height * 1)
draw_actor_hp(actor, x + bw, y + line_height * 2)
draw_actor_mp(actor, x + bw, y + line_height * 3)
end
#--------------------------------------------------------------------------
# ● 職業の描画
#--------------------------------------------------------------------------
def draw_actor_class(actor, x, y, width = 112)
change_color(normal_color)
draw_text(x, y, width, line_height, actor.class.name)
end
#--------------------------------------------------------------------------
# ● 能力値の描画
#--------------------------------------------------------------------------
def draw_parameters(actor, x, y)
6.times {|i| draw_actor_param(actor, x, y + line_height * i, i + 2) }
end
#--------------------------------------------------------------------------
# o 経験値情報の描画
#--------------------------------------------------------------------------
def draw_exp_info(actor, 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(system_color)
draw_text(x, y + line_height * 0, 180, line_height, Vocab::ExpTotal)
draw_text(x, y + line_height * 1, 180, line_height, s_next)
change_color(normal_color)
draw_text(x, y + line_height * 0, 180, line_height, s1, 2)
draw_text(x, y + line_height * 1, 180, line_height, s2, 2)
end
#--------------------------------------------------------------------------
# ■ 項目の描画
#--------------------------------------------------------------------------
def draw_item(index)
actor = $game_party.members[index]
enabled = $game_party.battle_members.include?(actor)
rect = item_rect(index)
draw_item_background(index)
draw_standimage(rect.x, rect.y, enabled)
draw_actor_stand_status(actor, rect.x+10, rect.y + line_height / 2)
end
end
#==============================================================================
# ■ Window_MenuCommand
#------------------------------------------------------------------------------
class Window_MenuCommand < Window_Command
#--------------------------------------------------------------------------
# ■ 主要コマンドをリストに追加
#--------------------------------------------------------------------------
def add_main_commands
add_command(Vocab::item, :item, main_commands_enabled)
add_command(Vocab::skill, :skill, main_commands_enabled)
add_command(Vocab::equip, :equip, main_commands_enabled)
#~ add_command(Vocab::status, :status, main_commands_enabled)
end
#--------------------------------------------------------------------------
# ■ 並び替えをコマンドリストに追加
#--------------------------------------------------------------------------
def add_formation_command
end
end
#memo
# $data_system.switches[4] # スイッチ
# $game_variables[id] # 変数