Advertisement
Guest User

Untitled

a guest
Feb 9th, 2012
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 9.19 KB | None | 0 0
  1. #==============================================================================
  2. # ++ Customize the Title Screen [VX] ver. 1.00 ++
  3. #  Script by Para Dog
  4. #  Translated by RTAgent5
  5. #  http://2d6.parasite.jp/
  6. #------------------------------------------------------------------------------
  7. # Use a picture on the menu to change the appearance on the window.
  8. #==============================================================================
  9.  
  10. module PARA_TITLE_CUSTOM
  11.  
  12.   # Use images for the menu command ( true / false )
  13.   IMG_MENU = true
  14.  
  15. #↓---Commands used to set the menu---
  16.  
  17.   # Menu image filename ( Graphics/System )
  18.   #( Pictures required - When the command is not selected, and a pic of when the command is selected ] )
  19.  
  20.   # New Game:
  21.   IMG_NEWGAME = ["New Adventure","New AdventureA"]
  22.   IMG_NEWGAME_X = 160   # Horizontal position
  23.   IMG_NEWGAME_Y = 200   # Vertical position
  24.   # Continue:
  25.   IMG_CONTINUE = ["Continue Adventure","Continue AdventureA"]
  26.   IMG_CONTINUE_X = 200   # Horizontal position
  27.   IMG_CONTINUE_Y = 230   # Vertical position
  28.   # Shutdown:
  29.   IMG_SHUTDOWN = ["Quit","QuitA"]
  30.   IMG_SHUTDOWN_X = 240   # Horizontal position
  31.   IMG_SHUTDOWN_Y = 260   # Vertical position
  32.  
  33.   # Continue Disabled ( 0:Semi-transparent / 1:Specify image )
  34.   LOAD_DISABLED_TYPE = 1
  35.  
  36.   # Images of the disabled continue:
  37.   IMG_CONTINUE_DISABLED = ["Continue Adventure","Continue AdventureB"]
  38.  
  39.   # How to synthetic image: ( 0:Usually / 1:Plus  / 2:Subtraction )
  40.   BLEND_TYPE = 0
  41.  
  42. #↓---Images not used for the command menu---
  43.  
  44.   # Hide panel ( true / false )
  45.   WINDOW_TRANS = false
  46.   # Window Transparency
  47.   WINDOW_OPACITY = 160
  48.  
  49.   # Window size:
  50.   WINDOW_WIDTH = 172
  51.   # Location of the window ( 0:Specify coordinate / 1:Left / 2:Middle / 3:Right )
  52.   WINDOW_ALIGN = 2
  53.   # "Coordinates designated" position next to the window:
  54.   WINDOW_POS_X = 0
  55.   # The vertical position of the window ( 0:Specify coordinate / 1:Left  / 2:Middle / 3:Right )
  56.   WINDOW_VALIGN = 0
  57.   # "Coordinates specified" window of time ordinate
  58.   WINDOW_POS_Y = 288
  59.  
  60. end
  61.  
  62. # ↑ 設定項目ここまで
  63. #------------------------------------------------------------------------------
  64.  
  65. #==============================================================================
  66. # ■ Scene_Title
  67. #==============================================================================
  68.  
  69. class Scene_Title < Scene_Base
  70.   #--------------------------------------------------------------------------
  71.   # ● Create a command window
  72.   #--------------------------------------------------------------------------
  73.   def create_command_window
  74.     s1 = Vocab::new_game
  75.     s2 = Vocab::continue
  76.     s3 = Vocab::shutdown
  77.     w = PARA_TITLE_CUSTOM::WINDOW_WIDTH
  78.     @command_window = Window_Command.new(w, [s1, s2, s3])
  79.     @command_window.x = (544 - @command_window.width) / 2
  80.     @command_window.y = 288
  81.     if @continue_enabled                    # If a valid continue
  82.       @command_window.index = 1             # Set the cursor
  83.     else                                    # If you disable
  84.       @command_window.draw_item(1, false)   # Command to display the menu semi-transparent
  85.     end
  86.     @command_window.openness = 0
  87.     # Use image for command window
  88.     if PARA_TITLE_CUSTOM::IMG_MENU
  89.       # Hide command window
  90.       @command_window.opacity = 0
  91.       @command_window.contents_opacity = 0
  92.       create_img_command_window
  93.     else
  94.       change_window_visual
  95.     end
  96.     @command_window.open
  97.   end
  98.   #--------------------------------------------------------------------------
  99.   # ● Set the command window appearance
  100.   #--------------------------------------------------------------------------
  101.   def change_window_visual
  102.     # ウィンドウの透明度
  103.     if PARA_TITLE_CUSTOM::WINDOW_TRANS
  104.       @command_window.opacity = 0
  105.     else
  106.       @command_window.back_opacity = PARA_TITLE_CUSTOM::WINDOW_OPACITY
  107.     end
  108.     # ウィンドウの位置を指定
  109.     case PARA_TITLE_CUSTOM::WINDOW_ALIGN
  110.       when 0
  111.         @command_window.x = PARA_TITLE_CUSTOM::WINDOW_POS_X
  112.       when 1
  113.         @command_window.x = 0
  114.       when 2
  115.         @command_window.x = ( 544 - @command_window.width ) / 2
  116.       when 3
  117.         @command_window.x = 544 - @command_window.width
  118.     end
  119.     case PARA_TITLE_CUSTOM::WINDOW_VALIGN
  120.       when 0
  121.         @command_window.y = PARA_TITLE_CUSTOM::WINDOW_POS_Y
  122.       when 1
  123.         @command_window.y = 0
  124.       when 2
  125.         @command_window.y = ( 416 - @command_window.height ) / 2
  126.       when 3
  127.         @command_window.y = 416 - @command_window.height
  128.     end
  129.   end
  130.   #--------------------------------------------------------------------------
  131.   # ○ Creating images of the command window
  132.   #--------------------------------------------------------------------------
  133.   def create_img_command_window
  134.     # Sprite Generation
  135.     sprite1 = Sprite.new
  136.     sprite1.x = PARA_TITLE_CUSTOM::IMG_NEWGAME_X
  137.     sprite1.y = PARA_TITLE_CUSTOM::IMG_NEWGAME_Y
  138.     sprite1.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
  139.     sprite2 = Sprite.new
  140.     sprite2.x = PARA_TITLE_CUSTOM::IMG_CONTINUE_X
  141.     sprite2.y = PARA_TITLE_CUSTOM::IMG_CONTINUE_Y
  142.     sprite2.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
  143.     sprite3 = Sprite.new
  144.     sprite3.x = PARA_TITLE_CUSTOM::IMG_SHUTDOWN_X
  145.     sprite3.y = PARA_TITLE_CUSTOM::IMG_SHUTDOWN_Y
  146.     sprite3.blend_type = PARA_TITLE_CUSTOM::BLEND_TYPE
  147.     # In the management SUPURAITOSETTO
  148.     @command_sprites = [sprite1, sprite2, sprite3]
  149.     # BITTOMAPPUFAIRU managed by an array of names
  150.     @command_bitmaps = [PARA_TITLE_CUSTOM::IMG_NEWGAME, PARA_TITLE_CUSTOM::IMG_CONTINUE, PARA_TITLE_CUSTOM::IMG_SHUTDOWN]
  151.     if @continue_enabled                    # If a valid continue
  152.       select_img_item(1)                    # Set the cursor
  153.     else                                    # If you disable
  154.       case PARA_TITLE_CUSTOM::LOAD_DISABLED_TYPE
  155.         when 0  # Translucent continue Disabled
  156.           @command_sprites[1].opacity = 160
  157.         when 1  # When continue is disabled
  158.           @command_bitmaps[1] = PARA_TITLE_CUSTOM::IMG_CONTINUE_DISABLED
  159.       end
  160.       select_img_item(0)                    # Set the cursor
  161.     end
  162.   end
  163.   #--------------------------------------------------------------------------
  164.   # ● Frame Update
  165.   #--------------------------------------------------------------------------
  166.   def update
  167.     super
  168.     @command_window.update
  169.     if PARA_TITLE_CUSTOM::IMG_MENU
  170.       if Input.repeat?(Input::UP) or Input.repeat?(Input::DOWN)
  171.         # Image change
  172.         select_img_item(@command_window.index)
  173.       end
  174.     end
  175.     if Input.trigger?(Input::C)
  176.       case @command_window.index
  177.       when 0    # New Game
  178.         command_new_game
  179.       when 1    # Continue
  180.         command_continue
  181.       when 2    # Shut down
  182.         command_shutdown
  183.       end
  184.     end
  185.   end
  186.   #--------------------------------------------------------------------------
  187.   # ○ When switching the image menu selections
  188.   #--------------------------------------------------------------------------
  189.   def select_img_item(index)
  190.     case index
  191.       when 0
  192.         @command_sprites[0].bitmap = Cache.system(@command_bitmaps[0][1])
  193.         @command_sprites[1].bitmap = Cache.system(@command_bitmaps[1][0])
  194.         @command_sprites[2].bitmap = Cache.system(@command_bitmaps[2][0])
  195.       when 1
  196.         @command_sprites[0].bitmap = Cache.system(@command_bitmaps[0][0])
  197.         @command_sprites[1].bitmap = Cache.system(@command_bitmaps[1][1])
  198.         @command_sprites[2].bitmap = Cache.system(@command_bitmaps[2][0])
  199.       when 2
  200.         @command_sprites[0].bitmap = Cache.system(@command_bitmaps[0][0])
  201.         @command_sprites[1].bitmap = Cache.system(@command_bitmaps[1][0])
  202.         @command_sprites[2].bitmap = Cache.system(@command_bitmaps[2][1])
  203.     end
  204.   end
  205.   #--------------------------------------------------------------------------
  206.   # ● The release of the command window
  207.   #--------------------------------------------------------------------------
  208.   def dispose_command_window
  209.     @command_window.dispose
  210.     if @command_sprites != nil
  211.       @command_sprites[0].dispose
  212.       @command_sprites[1].dispose
  213.       @command_sprites[2].dispose
  214.     end
  215.   end
  216.   #--------------------------------------------------------------------------
  217.   # ● Open a command window
  218.   #--------------------------------------------------------------------------
  219.   def open_command_window
  220.     # Hidden behind the window when you see the moment
  221.     if PARA_TITLE_CUSTOM::WINDOW_TRANS
  222.       @command_window.openness = 255
  223.     end
  224.     @command_window.open
  225.     begin
  226.       @command_window.update
  227.       Graphics.update
  228.     end until @command_window.openness == 255
  229.   end
  230.   #--------------------------------------------------------------------------
  231.   # ● Close the command window
  232.   #--------------------------------------------------------------------------
  233.   def close_command_window
  234.     # Hidden behind the window closed when not to
  235.     if not(PARA_TITLE_CUSTOM::WINDOW_TRANS)
  236.       @command_window.close
  237.       begin
  238.         @command_window.update
  239.         Graphics.update
  240.       end until @command_window.openness == 0
  241.     end
  242.   end
  243. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement