Advertisement
Guest User

Untitled

a guest
Sep 30th, 2011
473
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 8.42 KB | None | 0 0
  1. #==============================================================
  2. #
  3. # HungrySnake's Total Menu Control V 1.1
  4. #
  5. # This is a script which enables the user to fully customize
  6. # the menu.
  7. #
  8. #
  9. # How to use:
  10. #
  11. # 1) Set-up the config
  12. # 2) Switch the Switch-ID In-Game ON
  13. # 3) Finished
  14. #
  15. # Credit:
  16. #
  17. # HungrySnake
  18. #
  19. #==============================================================
  20.  
  21. module TMC
  22.   module Config
  23.    
  24. #==============================================================
  25. #
  26. #                        Start Config
  27. #
  28. #==============================================================
  29.  
  30.   # WLH --------------------------------------------------------------------
  31.     WLH = 24 # If you ever decide to change the Window Line Height in the
  32.              # Window_Base, then change this one to that value too.
  33.   # ------------------------------------------------------------------------
  34.  
  35.   # Switch -----------------------------------------------------------------
  36.     SWITCH_ID = 20 # << The Switch_ID to turn your custom menu ON.
  37.   # ------------------------------------------------------------------------
  38.                            
  39.   # Visual -----------------------------------------------------------------
  40.     # Command Screen Window ------------------------------------------------
  41.       CSW_X = Graphics.width / 4 * 3 - 25
  42.       CSW_Y = 0
  43.       CSW_WIDTH = 160
  44.     # ----------------------------------------------------------------------
  45.    
  46.     # Gold Window ----------------------------------------------------------
  47.       GOLD_WINDOW = true # << Show Gold Window?
  48.       GOLD_WINDOW_X = Graphics.width / 4 * 3 - 25
  49.       GOLD_WINDOW_Y = 360
  50.     # ----------------------------------------------------------------------
  51.    
  52.     # Window Menu Status Screen --------------------------------------------
  53.       WMS_X = 0
  54.       WMS_Y = 0
  55.       WMS_WIDTH = Graphics.width / 4 - 10 + 180
  56.       WMS_HEIGHT = 416
  57.       WMS_VISIBLE_S = true # << Window Menu Status Screen visible on start?
  58.       DRAW_STUFF = [ # << Don't delete
  59.      
  60.       true, # << Draw Actor Face?
  61.       true, # << Draw Actor Name?
  62.       true, # << Draw Actor Graphic?
  63.       true, # << Draw Actor Level?
  64.       true, # << Draw Actor HP?
  65.       true, # << Draw Actor MP?
  66.       true, # << Draw Actor Class?
  67.       true, # << Draw Actor State?
  68.      
  69.       ] # << Don't delete
  70.      
  71.       # Actor Stuff Advanced ----------------------------------------------
  72.      
  73.         ACTOR_FACE_X = 2 # Actor Face X coordinate
  74.         ACTOR_FACE_Y = 0 # Actor Face Y coordinate
  75.      
  76.         ACTOR_NAME_X = 104 # Actor Name X coordinate
  77.         ACTOR_NAME_Y = -15 # Actor Name Y coordinate
  78.      
  79.         ACTOR_GRAPHIC_X = 50 # Actor Graphic X coordinate
  80.         ACTOR_GRAPHIC_Y = 80 # Actor Graphic Y coordinate
  81.      
  82.         ACTOR_LEVEL_X = 104 # Actor Level X coordinate
  83.         ACTOR_LEVEL_Y = 5 # Actor Level Y coordinate  
  84.      
  85.         ACTOR_HP_X = 104 # Actor HP X coordinate
  86.         ACTOR_HP_Y = WLH * 1 # Actor HP Y coordinate
  87.      
  88.         ACTOR_MP_X = 104 # Actor MP X coordinate
  89.         ACTOR_MP_Y = WLH * 2 # Actor MP Y coordinate
  90.      
  91.         ACTOR_CLASS_X = 184 # Actor Class X coordinate
  92.         ACTOR_CLASS_Y = -15 # Actor Class Y coordinate
  93.      
  94.         ACTOR_STATE_X = 104 # Actor State X coordinate
  95.         ACTOR_STATE_Y = 45 # Actor State Y coordinate
  96.      
  97.       # ----------------------------------------------------------------------
  98.     # -----------------------------------------------------------------------
  99.   # ------------------------------------------------------------------------
  100.   end
  101. end
  102.  
  103. #==============================================================
  104. #
  105. #                        End Config
  106. #
  107. #==============================================================
  108.  
  109. class Scene_Menu < Scene_Base
  110.   include TMC::Config
  111.  
  112.   #--------------------------------------------------------------------------
  113.   # * Start processing
  114.   #--------------------------------------------------------------------------
  115.   def start
  116.     super
  117.     create_menu_background
  118.     create_command_window
  119.       if $game_switches[SWITCH_ID]
  120.         @gold_window = Window_Gold.new(GOLD_WINDOW_X, GOLD_WINDOW_Y)
  121.         @gold_window.visible = GOLD_WINDOW
  122.         @status_window = Window_MenuStatus.new(WMS_X,WMS_Y)
  123.         @status_window.visible = WMS_VISIBLE_S
  124.       else
  125.         @gold_window = Window_Gold.new(0, 360)
  126.         @status_window = Window_MenuStatus.new(160, 0)  
  127.         @status_window.visible = true
  128.       end
  129.   end
  130.  
  131.   #--------------------------------------------------------------------------
  132.   # * Create Command Window
  133.   #--------------------------------------------------------------------------
  134.   def create_command_window
  135.     s1 = Vocab::item
  136.     s2 = Vocab::skill
  137.     s3 = Vocab::equip
  138.     s4 = Vocab::status
  139.     s5 = Vocab::save
  140.     s6 = Vocab::game_end
  141.     @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6])
  142.     @command_window.index = @menu_index
  143.     if $game_switches[SWITCH_ID]
  144.       @command_window.x = CSW_X
  145.       @command_window.y = CSW_Y
  146.       @command_window.width = CSW_WIDTH
  147.     end
  148.     if $game_party.members.size == 0          # If number of party members is 0
  149.       @command_window.draw_item(0, false)     # Disable item
  150.       @command_window.draw_item(1, false)     # Disable skill
  151.       @command_window.draw_item(2, false)     # Disable equipment
  152.       @command_window.draw_item(3, false)     # Disable status
  153.     end
  154.     if $game_system.save_disabled             # If save is forbidden
  155.       @command_window.draw_item(4, false)     # Disable save
  156.     end
  157.   end
  158.  
  159.   #--------------------------------------------------------------------------
  160.   # * Start Actor Selection
  161.   #--------------------------------------------------------------------------
  162.   alias hsnake_ma_sas start_actor_selection unless $@
  163.   def start_actor_selection(*args, &block)
  164.     if $game_switches[SWITCH_ID]
  165.       @status_window.visible = true
  166.     end
  167.     hsnake_ma_sas(*args, &block)
  168.   end
  169.  
  170.   #--------------------------------------------------------------------------
  171.   # * End Actor Selection
  172.   #--------------------------------------------------------------------------
  173.   alias hsnake_ma_eas end_actor_selection unless $@
  174.   def end_actor_selection (*args, &block)
  175.     if $game_switches[SWITCH_ID]
  176.       @status_window.visible = false
  177.     end
  178.     hsnake_ma_eas(*args, &block)
  179.   end
  180.  
  181. end
  182.  
  183. class Window_MenuStatus < Window_Selectable
  184.   include TMC::Config
  185.  
  186.   #--------------------------------------------------------------------------
  187.   # * Object Initialization
  188.   #--------------------------------------------------------------------------
  189.   def initialize(x, y)
  190.     if $game_switches[SWITCH_ID]
  191.       super(x, y, WMS_WIDTH, WMS_HEIGHT)
  192.     else
  193.       super(x, y, 384, 416)
  194.     end
  195.     refresh
  196.     self.active = false
  197.     self.index = -1
  198.   end
  199.   #--------------------------------------------------------------------------
  200.   # * Refresh
  201.   #--------------------------------------------------------------------------
  202.   def refresh
  203.     self.contents.clear
  204.     @item_max = $game_party.members.size
  205.     for actor in $game_party.members
  206.       x = 104
  207.       y = actor.index * 96 + WLH / 2
  208.      if $game_switches[SWITCH_ID]
  209.       if DRAW_STUFF[0]
  210.         draw_actor_face(actor, ACTOR_FACE_X, actor.index * 96 + 2 + ACTOR_FACE_Y, 92)
  211.       end
  212.       if DRAW_STUFF[1]
  213.         draw_actor_name(actor, ACTOR_NAME_X, y + ACTOR_NAME_Y)          
  214.       end
  215.       if DRAW_STUFF[2]
  216.         draw_actor_graphic(actor,ACTOR_GRAPHIC_X, y + ACTOR_GRAPHIC_Y)
  217.       end
  218.       if DRAW_STUFF[3]
  219.         draw_actor_level(actor,ACTOR_LEVEL_X, y + ACTOR_LEVEL_Y)
  220.       end
  221.       if DRAW_STUFF[4]
  222.         draw_actor_hp(actor,ACTOR_HP_X, y + ACTOR_HP_Y)
  223.       end
  224.       if DRAW_STUFF[5]
  225.         draw_actor_mp(actor,ACTOR_MP_X, y + ACTOR_MP_Y)
  226.       end
  227.       if DRAW_STUFF[6]
  228.         draw_actor_class(actor,ACTOR_CLASS_X, y + ACTOR_CLASS_Y)
  229.       end
  230.       if DRAW_STUFF[7]
  231.         draw_actor_state(actor,ACTOR_STATE_X, y + ACTOR_STATE_Y)
  232.       end      
  233.     else
  234.       draw_actor_face(actor, 2, actor.index * 96 + 2, 92)
  235.       draw_actor_name(actor, x, y)
  236.       draw_actor_class(actor, x + 120, y)
  237.       draw_actor_level(actor, x, y + WLH * 1)
  238.       draw_actor_state(actor, x, y + WLH * 2)
  239.       draw_actor_hp(actor, x + 120, y + WLH * 1)
  240.       draw_actor_mp(actor, x + 120, y + WLH * 2)
  241.       end  
  242.     end
  243.   end
  244. end
  245.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement