Advertisement
neutale

Witch's House Menu (Imitation) [VX]

Sep 15th, 2018
1,017
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 6.66 KB | None | 0 0
  1. #*******************************************************************************************
  2. #
  3. #   * Imitation Menu - Witch's House *
  4. #
  5. #                       for RGSS2
  6. #
  7. #        Ver 1.1.0   2016.08.12
  8. #
  9. #   Author:魂(Lctseng),Bahamut Forum ID:play123
  10. #
  11. #   Please keep this label reprinted
  12. #
  13. #   Home link:http://home.gamer.com.tw/homeindex.php?owner=play123
  14. #
  15. #   Description:
  16. #            A menu similar to Witch's House
  17. #
  18. #
  19. #   Update Log:
  20. #    Ver 1.0.0 :
  21. #    Date:2014.02.13
  22. #    Summary:First release
  23. #         A menu similar to Witch's House
  24. #
  25. #    Ver 1.1.0 :
  26. #    Date:2016.08.12
  27. #    Summary:Fixed size problem
  28. #
  29. #
  30. #    Summary:
  31. #             The following categories can be modiefied or redefined:
  32. #                1.Scene_Menu
  33. #                2.Scene_File
  34. #                3.Scene_End
  35. #                4.Window_MenuStatus
  36. #
  37. #*******************************************************************************************
  38.  
  39.  
  40. #*******************************************************************************************
  41. #
  42. #   DO NOT MODIFY UNLESS YOU KNOW WHAT TO DO !
  43. #
  44. #*******************************************************************************************
  45.  
  46.  
  47. #==============================================================================
  48. # ■ Scene_Menu
  49. #------------------------------------------------------------------------------
  50. #  Class that handles menu screen
  51. #==============================================================================
  52.  
  53. class Scene_Menu < Scene_Base
  54.   #--------------------------------------------------------------------------
  55.   # ● Start processing
  56.   #--------------------------------------------------------------------------
  57.   def start
  58.     super
  59.     create_menu_background
  60.     create_command_window
  61.     @gold_window = Window_Gold.new(0, 360)
  62.     @gold_window.visible = false
  63.     @status_window = Window_MenuStatus.new(160, 0)
  64.     @status_window.y = Graphics.height - @status_window.height
  65.     @command_window.y = Graphics.height - @status_window.height + (@status_window.height - @command_window.height ) / 2
  66.   end
  67.   #--------------------------------------------------------------------------
  68.   # ● Create command window
  69.   #--------------------------------------------------------------------------
  70.   def create_command_window
  71.     s1 = Vocab::item
  72.     s5 = Vocab::save
  73.         s6 = Vocab::game_end
  74.     @command_window = Window_Command.new(160, [s1, s5 , s6])
  75.     @command_window.index = @menu_index
  76.     if $game_party.members.size == 0          # If no party members
  77.       @command_window.draw_item(0, false)     # Invalid item option
  78.     end
  79.     if $game_system.save_disabled             # If save is not allowed
  80.       @command_window.draw_item(1, false)     # Invalid save option
  81.     end
  82.  
  83.  
  84.  
  85.   end
  86.   #--------------------------------------------------------------------------
  87.   # ● Update command selection
  88.   #--------------------------------------------------------------------------
  89.   def update_command_selection
  90.     if Input.trigger?(Input::B)
  91.       Sound.play_cancel
  92.       $scene = Scene_Map.new
  93.     elsif Input.trigger?(Input::C)
  94.       if $game_party.members.size == 0 and @command_window.index < 1
  95.         Sound.play_buzzer
  96.         return
  97.       elsif $game_system.save_disabled and @command_window.index == 1
  98.         Sound.play_buzzer
  99.         return
  100.       end
  101.       Sound.play_decision
  102.       case @command_window.index
  103.       when 0      # Item
  104.         $scene = Scene_Item.new
  105.       when 1      # File
  106.         $scene = Scene_File.new(true, false, false)
  107.       when 2      # End game
  108.         $scene = Scene_End.new
  109.       end
  110.     end
  111.   end
  112.   #--------------------------------------------------------------------------
  113.   # ● Actor update selection
  114.   #--------------------------------------------------------------------------
  115.   def update_actor_selection
  116.     if Input.trigger?(Input::B)
  117.       Sound.play_cancel
  118.       end_actor_selection
  119.     elsif Input.trigger?(Input::C)
  120.     end
  121.   end
  122. end
  123.  
  124. #==============================================================================
  125. # ■ Scene_File
  126. #------------------------------------------------------------------------------
  127. #  Class of file and end scene screen
  128. #==============================================================================
  129.  
  130. class Scene_File < Scene_Base
  131.   #--------------------------------------------------------------------------
  132.   # ● Return to original scene
  133.   #--------------------------------------------------------------------------
  134.   def return_scene
  135.     if @from_title
  136.       $scene = Scene_Title.new
  137.     elsif @from_event
  138.       $scene = Scene_Map.new
  139.     else
  140.       $scene = Scene_Menu.new(1)
  141.     end
  142.   end
  143. end
  144.  
  145. #==============================================================================
  146. # ■ Scene_End
  147. #------------------------------------------------------------------------------
  148. #  Class that handles end scene
  149. #==============================================================================
  150.  
  151. class Scene_End < Scene_Base
  152.  
  153.   #--------------------------------------------------------------------------
  154.   # ● Return to original scene
  155.   #--------------------------------------------------------------------------
  156.   def return_scene
  157.     $scene = Scene_Menu.new(2)
  158.   end
  159. end
  160.  
  161. #==============================================================================
  162. # ■ Window_MenuStatus
  163. #------------------------------------------------------------------------------
  164. #  Windows displays menu screen and status counterpart
  165. #==============================================================================
  166.  
  167. class Window_MenuStatus < Window_Selectable
  168.   #--------------------------------------------------------------------------
  169.   # ● Initialize object
  170.   #     x      : X window coordinate
  171.   #     y      : Y window coordinate
  172.   #--------------------------------------------------------------------------
  173.   def initialize(x, y)
  174.     super(x, y, 384, 120)
  175.     refresh
  176.     self.active = false
  177.     self.index = -1
  178.   end
  179.   #--------------------------------------------------------------------------
  180.   # ● Refresh
  181.   #--------------------------------------------------------------------------
  182.   def refresh
  183.     self.contents.clear
  184.     @item_max = $game_party.members.size
  185.     for actor in $game_party.members
  186.       draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
  187.       x = 104
  188.       y = actor.index * 96 + WLH / 2
  189.       draw_actor_name(actor, x, y)
  190.       draw_actor_class(actor, x + 120, y)
  191.       draw_actor_level(actor, x, y + WLH * 1)
  192.       draw_actor_state(actor, x, y + WLH * 2)
  193.       draw_actor_hp(actor, x + 120, y + WLH * 1)
  194.     end
  195.   end
  196. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement