#============================================================================
# *Window_Base ADDITION
# Icon States ::)
#============================================================================
class Scene_Menu
#--------------------------------------------------------------------------
# ◠オブジェクトåˆæœŸåŒ–
# menu_index : コマンドã®ã‚«ãƒ¼ã‚½ãƒ«åˆæœŸä½ç½®
#--------------------------------------------------------------------------
def initialize(menu_index = 0)
@menu_index = menu_index
@changer = 0
@where = 0
@checker = 0
end
#--------------------------------------------------------------------------
# ◠メイン処ç†
#--------------------------------------------------------------------------
def main
@spriteset = Spriteset_Map.new
@Menu = Sprite.new
@Menu.bitmap = RPG::Cache.picture("Menu/" + "Main Menu")
@Help = Sprite.new
@Help.bitmap = RPG::Cache.picture("Menu/" + "Help2")
@sprite2 = Sprite.new
@sprite2.bitmap = RPG::Cache.picture("shadow")
@sprite2.z = 2
@sprite2.opacity = 80
# コマンドウィンドウを作æˆ
s1 = $data_system.words.item
s2 = $data_system.words.skill
s3 = $data_system.words.equip
s4 = " Status"
s9 = " Æsir"
s11 = " Limit"
s7 = " Mognet"
s10 = " Info"
s5 = " Save"
# ステータスウィンドウを作æˆ
@status_window = Window_MenuStatus.new
@status_window.x = -10
@status_window.y = 37
@status_window.opacity = 0
#-------------------
@mapname_window = Window_Mapname.new
@mapname_window.x = 15
@mapname_window.y = 430
@mapname_window.opacity = 0
#--------------------------
@location_window = Window_Location.new
@location_window.x = 0
@location_window.y = 410
@help_window = Window_Help.new
#--------------------
@command_window = Window_Command.new(160, [s1, s2, s3, s4,s9,s11, s7, s10, s5])
@command_window.index = @menu_index
@command_window.x = 530
@command_window.y = 15
@command_window.opacity = 0
# パーティ人数㌠0 人ã®å ´åˆ
if $game_party.actors.size == 0
# アイテムã€ã‚¹ã‚ルã€è£…å‚™ã€ã‚¹ãƒ†ãƒ¼ã‚¿ã‚¹ã‚’無効化
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
@command_window.disable_item(3)
end
# セーブç¦æ¢ã®å ´åˆ
if $game_system.save_disabled
# セーブを無効ã«ã™ã‚‹
@command_window.disable_item(8)
end
@faux_window = Window_Faux.new
@faux_window.x = 480
@faux_window.y = 308
@faux_window.opacity = 0
@sprite_window = Window_Character.new
@sprite_window.x = 490
@sprite_window.y = 320
@playtime_window = Window_PlayTime.new
@playtime_window.x = 470
@playtime_window.y = 410
@playtime_window.opacity = 0
# æ©æ•°ã‚¦ã‚£ãƒ³ãƒ‰ã‚¦ã‚’作æˆ
# ゴールドウィンドウを作æˆ
@gold_window = Window_Gold.new
@gold_window.x = 490
@gold_window.y = 390
@gold_window.opacity = 0
# プレイ時間ウィンドウを作æˆ
#
# トランジション実行
Graphics.transition
# メインループ
loop do
# ゲーム画é¢ã‚’æ›´æ–°
Graphics.update
# å…¥åŠ›æƒ…å ±ã‚’æ›´æ–°
Input.update
# フレーム更新
update
# ç”»é¢ãŒåˆ‡ã‚Šæ›¿ã‚ã£ãŸã‚‰ãƒ«ãƒ¼ãƒ—ã‚’ä¸æ–
if $scene != self
break
end
end
# トランジション準備
Graphics.freeze
# ウィンドウを解放
@spriteset.dispose
@sprite2.dispose
@command_window.dispose
@playtime_window.dispose
@gold_window.dispose
@status_window.dispose
@location_window.dispose
@mapname_window.dispose
@sprite_window.dispose
@Menu.dispose
@help_window.dispose
end
#--------------------------------------------------------------------------
# ◠フレーム更新
#--------------------------------------------------------------------------
def update
# ウィンドウを更新
@help_window.update
@command_window.update
@playtime_window.update
@gold_window.update
@status_window.update
@location_window.update
@mapname_window.update
@sprite_window.update
# コマンドウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_command を呼ã¶
if @command_window.active
update_command
return
end
# ステータスウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ: update_status を呼ã¶
if @status_window.active
update_status
return
end
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (コマンドウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_command
case @command_window.index
when 0
@help_window.set_text("Item")
when 1
@help_window.set_text("Ability")
when 2
when 3
when 4
when 5
when 6
when 7
when 8
@help_window.set_text("Save Progress")
end
if Input.trigger?(Input::A)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# マップ画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Map.new
return
end
# C ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::C)
# パーティ人数㌠0 人ã§ã€ã‚»ãƒ¼ãƒ–ã€ã‚²ãƒ¼ãƒ 終了以外ã®ã‚³ãƒžãƒ³ãƒ‰ã®å ´åˆ
if $game_party.actors.size == 0 and @command_window.index < 4
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# コマンドウィンドウã®ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ã§åˆ†å²
case @command_window.index
when 0 # アイテãƒ
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# アイテム画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Item.new
when 1 # スã‚ル
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# ステータスウィンドウをアクティブã«ã™ã‚‹
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2 # 装備
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# ステータスウィンドウをアクティブã«ã™ã‚‹
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 3 # ステータス
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# ステータスウィンドウをアクティブã«ã™ã‚‹
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 6
$game_system.se_play($data_system.decision_se)
@checker = 0
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 8 # セーブ
# セーブç¦æ¢ã®å ´åˆ
if $game_system.save_disabled
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# セーブ画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Save.new
#=====================================================
end
return
end
end
#--------------------------------------------------------------------------
# ◠フレーム更新 (ステータスウィンドウãŒã‚¢ã‚¯ãƒ†ã‚£ãƒ–ã®å ´åˆ)
#--------------------------------------------------------------------------
def update_status
# B ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::A)
# ã‚ャンセル SE ã‚’æ¼”å¥
$game_system.se_play($data_system.cancel_se)
# コマンドウィンドウをアクティブã«ã™ã‚‹
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# C ボタンãŒæŠ¼ã•ã‚ŒãŸå ´åˆ
if Input.trigger?(Input::C)
# コマンドウィンドウã®ã‚«ãƒ¼ã‚½ãƒ«ä½ç½®ã§åˆ†å²
case @command_window.index
when 1 # スã‚ル
# ã“ã®ã‚¢ã‚¯ã‚¿ãƒ¼ã®è¡Œå‹•åˆ¶é™ãŒ 2 以上ã®å ´åˆ
if $game_party.actors[@status_window.index].restriction >= 2
# ブザー SE ã‚’æ¼”å¥
$game_system.se_play($data_system.buzzer_se)
return
end
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# スã‚ル画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Skill.new(@status_window.index)
when 2 # 装備
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# 装備画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Equip.new(@status_window.index)
when 3 # ステータス
# 決定 SE ã‚’æ¼”å¥
$game_system.se_play($data_system.decision_se)
# ステータス画é¢ã«åˆ‡ã‚Šæ›¿ãˆ
$scene = Scene_Status.new(@status_window.index)
when 6
$game_system.se_play($data_system.decision_se)
if @checker == 0
@changer = $game_party.actors[@status_window.index]
@where = @status_window.index
@checker = 1
else
$game_party.actors[@where] = $game_party.actors[@status_window.index]
$game_party.actors[@status_window.index] = @changer
@checker = 0
@status_window.refresh
end
end
return
end
end