Advertisement
richter_h

as-updated

Jan 18th, 2013
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. #==============================================================================
  2. # ■ Scene_Map
  3. #------------------------------------------------------------------------------
  4. #  マップ画面の処理を行うクラスです。
  5. #==============================================================================
  6. class Scene_Map < Scene_Base
  7. #--------------------------------------------------------------------------
  8. # ● Aボタンによるオリジナルメニュー呼び出し判定
  9. #--------------------------------------------------------------------------
  10. def update_call_menu2
  11. if Input.trigger?(Input::A)
  12.   return if $game_map.interpreter.running? # イベント実行中?
  13.   return if $game_system.menu_disabled # メニュー禁止中?
  14.   $game_temp.menu_beep = true # SE 演奏フラグ設定
  15.   $game_temp.next_scene = "original_menu"
  16. end
  17. end
  18. #--------------------------------------------------------------------------
  19. # ● 画面切り替えの実行
  20. #--------------------------------------------------------------------------
  21. def update_scene_change
  22. return if $game_player.moving? # Is player moving?
  23. case $game_temp.next_scene
  24. when "battle"
  25. call_battle
  26. when "shop"
  27. call_shop
  28. when "name"
  29. call_name
  30. when "menu"
  31. call_menu
  32. when "save"
  33. call_save
  34. when "debug"
  35. call_debug
  36. when "gameover"
  37. call_gameover
  38. when "title"
  39. call_title
  40. when "original_menu"
  41.   call_original_menu
  42. else
  43. $game_temp.next_scene = nil
  44. end
  45. end
  46. end
  47.  
  48. #==============================================================================
  49. # ■ Scene_Original_Menu
  50. #------------------------------------------------------------------------------
  51. #  メニュー画面の処理を行うクラスです。
  52. #==============================================================================
  53.  
  54. class Scene_Original_Menu < Scene_Base
  55. #--------------------------------------------------------------------------
  56. # ● オブジェクト初期化
  57. # menu_index : コマンドのカーソル初期位置
  58. #--------------------------------------------------------------------------
  59. def initialize(menu_index = 0)
  60.   @menu_index = menu_index
  61. end
  62. #--------------------------------------------------------------------------
  63. # ● 開始処理
  64. #--------------------------------------------------------------------------
  65. def start
  66.   super
  67.   create_menu_background
  68.   create_command_window
  69. end
  70. #--------------------------------------------------------------------------
  71. # ● 終了処理
  72. #--------------------------------------------------------------------------
  73. def terminate
  74.   super
  75.   dispose_menu_background
  76.   @command_window.dispose
  77. end
  78. #--------------------------------------------------------------------------
  79. # ● フレーム更新
  80. #--------------------------------------------------------------------------
  81. def update
  82.   super
  83.   update_menu_background
  84.   @command_window.update
  85.   update_command_selection
  86. end
  87. #--------------------------------------------------------------------------
  88. # ● コマンドウィンドウの作成
  89. #--------------------------------------------------------------------------
  90. def create_command_window
  91.   s1 = "コモンイベント1"
  92.   s2 = "コモンイベント2"
  93.   s3 = "コモンイベント3"
  94.   s4 = "コモンイベント4"
  95.   @command_window = Window_Command.new(160, [s1, s2, s3, s4],1,4,32)
  96.   @command_window.index = @menu_index
  97. end
  98. #--------------------------------------------------------------------------
  99. # ● コマンド選択の更新
  100. #--------------------------------------------------------------------------
  101. def update_command_selection
  102.   #Bボタンで終了
  103. if Input.trigger?(Input::B)
  104.     Sound.play_cancel
  105.     $scene = Scene_Map.new
  106. elsif Input.trigger?(Input::C)
  107.     Sound.play_decision
  108.     #コモンイベントの呼び出し
  109.     $game_temp.common_event_id = @command_window.index+1
  110.     $scene = Scene_Map.new
  111. end
  112. end
  113. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement