vindaca510

V's Custom Animated Title Scene v2.7

Oct 12th, 2013
6,025
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 62.41 KB | None | 0 0
  1. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  2. #                                                                              #
  3. #                        V's Custom Animated Title Scene                       #
  4. #                                 Version  2.7                                 #
  5. #                                                                              #
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  7. #                                Written By:  V                                #
  8. #                         Last Edited: January 5, 2013                         #
  9. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  10. #                              Special Thanks to:                              #
  11. #                                                                              #
  12. #                                   Mithran                                    #
  13. #                                                                              #
  14. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  15.  
  16.  
  17. #==============================================================================#
  18. #------------------------------------------------------------------------------#
  19. # ** Disclaimer                                                                #
  20. #------------------------------------------------------------------------------#
  21. #                                                                              #
  22. # This script was intended for Non-commercial use only, if you wish to use     #
  23. # this script in a commercial game please PM me at which ever site you found   #
  24. # this script. Either way please give me credit in your game script as the     #
  25. # writer of this script, and send me a PM abuot the release of the game/demo.  #
  26. #                                                                              #
  27. #------------------------------------------------------------------------------#
  28. # ** How To Use                                                                #
  29. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  30. #                                                                              #
  31. # * This script has a customizable area below.                                 #
  32. #                                                                              #
  33. # * All images must be saved in the "Titles1" folder of your project.          #
  34. #                                                                              #
  35. # * If you are unsure how to use this script please see the help file included #
  36. #   in the demo, or visit http://pastebin.com/raw.php?i=tqLTXBar.              #
  37. #                                                                              #
  38. # * If using variable animations remember to name your frames with "_(number)" #
  39. #   (check the slime images in the titles1 folder of the demo for details.     #
  40. #                                                                              #
  41. # * Remember you can overload on animations and slow down the scene            #
  42. #   dramatically if moderation is not used.                                    #
  43. #                                                                              #                                                                              #
  44. # * Most but, not all animations will work properly with eachother.            #
  45. #                                                                              #
  46. #------------------------------------------------------------------------------#
  47. # ** Description                                                               #
  48. #------------------------------------------------------------------------------#
  49. #                                                                              #
  50. #  v0.1                                                                        #
  51. # ~=~=~=~                                                                      #
  52. #  * This script allows you to fully manipulate the Title Screen.              #
  53. #                                                                              #
  54. #  v0.2                                                                        #
  55. # ~=~=~=~                                                                      #
  56. #  * I fixed a the loading screen bug and a few others.                        #
  57. #                                                                              #
  58. #  v0.3                                                                        #
  59. # ~=~=~=~                                                                      #
  60. #  * I added in a multiple animation types function for each layer, as well as #
  61. #    variable, blending and wave animations.                                   #
  62. #                                                                              #
  63. #  v0.4                                                                        #
  64. # ~=~=~=~                                                                      #
  65. #  * I fixed a problem with the variable animations not working right          #
  66. #                                                                              #
  67. #  v0.5                                                                        #
  68. # ~=~=~=~                                                                      #
  69. #  * I added a cursor animation type.                                          #
  70. #                                                                              #
  71. #  v1.0                                                                        #
  72. # ~=~=~=~                                                                      #
  73. #  * I fixed a bug with the cursor animation type.                             #
  74. #                                                                              #
  75. #  v1.1                                                                        #
  76. # ~=~=~=~                                                                      #
  77. #  * I added more audio options and updated the animations for more control.   #
  78. #                                                                              #
  79. #  v1.2                                                                        #
  80. # ~=~=~=~                                                                      #
  81. #  * I fixed the scrolling animation issue.                                    #
  82. #                                                                              #
  83. #  v1.3                                                                        #
  84. # ~=~=~=~                                                                      #
  85. #  * I added a Cursor Movement SE.                                             #
  86. #                                                                              #
  87. #  v1.4                                                                        #
  88. # ~=~=~=~                                                                      #
  89. #  * I added a "No Save Files" image set-up for the continue option when there #
  90. #    are no save files.                                                        #
  91. #                                                                              #
  92. #  v2.0                                                                        #
  93. # ~=~=~=~                                                                      #
  94. #  * I added a initialize option for each layer with its own set of animations.#
  95. #                                                                              #
  96. #  v2.1                                                                        #
  97. # ~=~=~=~                                                                      #
  98. #  * I fixed the bug with multiple initializing animations and added some      #
  99. #    starting options for each image.                                          #
  100. #                                                                              #
  101. #  v2.2                                                                        #
  102. # ~=~=~=~                                                                      #
  103. #  * I added a splash movie feature to be played before the title appears.     #
  104. #                                                                              #
  105. #  v2.3                                                                        #
  106. # ~=~=~=~                                                                      #
  107. #  * I added a few more options for each layer. They can all be found inside   #
  108. #    of the help guide included in the demo. I've also added another option    #
  109. #    for the splash movie to start after you select a new game.                #
  110. #                                                                              #
  111. #  v2.4                                                                        #
  112. # ~=~=~=~                                                                      #
  113. #  * I added a fade out animation type.                                        #
  114. #                                                                              #
  115. #  v2.5                                                                        #
  116. # ~=~=~=~                                                                      #
  117. #  * I added a min fade opacity for the fade in and out animation type.        #
  118. #                                                                              #
  119. #  v2.6                                                                        #
  120. # ~=~=~=~                                                                      #
  121. #  * I added a timer for the input triggers to stop the player from making a   #
  122. #    selection before you want them to.                                        #
  123. #                                                                              #
  124. #  v2.7                                                                        #
  125. # ~=~=~=~                                                                      #
  126. #  * I fixed the problem with the layers not reintializing properly.           #
  127. #                                                                              #
  128. #------------------------------------------------------------------------------#
  129. #==============================================================================#
  130. #==============================================================================
  131. # ** V's Custom Animated Title Scene
  132. #------------------------------------------------------------------------------
  133. #  This module manages customizable features and methods.
  134. #==============================================================================
  135. module V_Custom_Animated_Title_Scene
  136.   module Specs
  137.     Layers = {
  138. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  139. #                                                                              #
  140. #                           Start Customizable Area.                           #
  141. #                                                                              #
  142. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
  143. #                                                                              #
  144. #                      ONLY EDIT AFTER THE EQUALS SYMBOL.                      #
  145. #                                                                              #
  146. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  147.  
  148.  
  149.  
  150.   #=============================================================================
  151.   # * Layers
  152.   #=============================================================================
  153.  
  154.     "totvp_intro" => { :x => 0,
  155.                       :y => 0,
  156.                       :ox => 0,
  157.                       :oy => 0,
  158.                       :z => 25,
  159.                       :opacity => 255,
  160.                       :animation_types => [0, 14],
  161.                       :fade_out_frame_rate => 1,
  162.                       :fade_out_speed => 2,
  163.                       :start_fade_out => 100,
  164.                       },#<---- Do Not Remove
  165.  
  166.     "Background" => { :x => 0,
  167.                       :y => 0,
  168.                       :ox => 0,
  169.                       :oy => 0,
  170.                       :z => 1,
  171.                       :opacity => 255,
  172.                       :animation_types => [0],
  173.                       },#<---- Do Not Remove
  174.  
  175.     "Title" => {      :x => 272.5,
  176.                       :y => 167,
  177.                       :ox => 237.5,
  178.                       :oy => 92,
  179.                       :z => 8,
  180.                       :angle => 1080,
  181.                       :opacity => 0,
  182.                       :fade_max_opacity => 175,
  183.                       :animation_types => [0],
  184.                       :initialize_time => 200,
  185.                       :initialize_animations => [1, 7],
  186.                       :initialize_rotation_frame_rate => 1,
  187.                       :initialize_rotation_speed => 12,
  188.                       :initialize_rotation_final_angle => -1080,
  189.                       :initialize_fade_in_frame_rate => 8,
  190.                       :initialize_fade_in_speed => 8,
  191.                       },#<---- Do Not Remove
  192.  
  193.     "Clock" => {      :x => 460,
  194.                       :y => -91,
  195.                       :ox => 75,
  196.                       :oy => 75,
  197.                       :z => 5,
  198.                       :opacity => 255,
  199.                       :animation_types => [0],
  200.                       :initialize_time => 400,
  201.                       :initialize_animations => [5],
  202.                       :initialize_move_frame_rate => 1,
  203.                       :initialize_move_speed => 1,
  204.                       :initialize_move_final_y => 91,
  205.                       },#<---- Do Not Remove
  206.  
  207.     "Hour" => {       :x => 460,
  208.                       :y => -91,
  209.                       :ox => 75,
  210.                       :oy => 75,
  211.                       :z => 6,
  212.                       :opacity => 255,
  213.                       :animation_types => [8],
  214.                       :initialize_time => 400,
  215.                       :initialize_animations => [5],
  216.                       :initialize_move_frame_rate => 1,
  217.                       :initialize_move_speed => 1,
  218.                       :initialize_move_final_y => 91,
  219.                       },#<---- Do Not Remove
  220.  
  221.     "Minute" => {     :x => 460,
  222.                       :y => -91,
  223.                       :ox => 75,
  224.                       :oy => 75,
  225.                       :z => 7,
  226.                       :opacity => 255,
  227.                       :animation_types => [9],
  228.                       :initialize_time => 400,
  229.                       :initialize_animations => [5],
  230.                       :initialize_move_frame_rate => 1,
  231.                       :initialize_move_speed => 1,
  232.                       :initialize_move_final_y => 91,
  233.                       },#<---- Do Not Remove
  234.  
  235.     "Slime" => {      :scroll_frame_rate => 4,
  236.                       :variable_frame_rate => 12,
  237.                       :max_variable_frames => 3,
  238.                       :scroll_speed => 2,
  239.                       :x => 0,
  240.                       :y => 0,
  241.                       :ox => 0,
  242.                       :oy => 0,
  243.                       :z => 2,
  244.                       :opacity => 255,
  245.                       :animation_types => [4, 12],
  246.                       },#<---- Do Not Remove
  247.  
  248.     "Slimes" => {     :scroll_frame_rate => 4,
  249.                       :blend_frame_rate => 8,
  250.                       :scroll_speed => 2,
  251.                       :x => 544,
  252.                       :y => 0,
  253.                       :ox => 0,
  254.                       :oy => 0,
  255.                       :z => 2,
  256.                       :opacity => 255,
  257.                       :animation_types => [4, 11],
  258.                       },#<---- Do Not Remove
  259.  
  260.     "Prize Wheel" => {:rotation_frame_rate => 1,
  261.                       :fade_frame_rate => 8,
  262.                       :rotation_speed => 2,
  263.                       :fade_speed => 1,
  264.                       :x => 40,
  265.                       :y => 40,
  266.                       :ox => 157.5,
  267.                       :oy => 157.5,
  268.                       :z => 3,
  269.                       :opacity => 255,
  270.                       :animation_types => [1,7],
  271.                       },#<---- Do Not Remove
  272.  
  273.     "Cursor" => {     :variable_frame_rate => 12,
  274.                       :max_variable_frames => 17,
  275.                       :ox => -10,
  276.                       :oy => -15,
  277.                       :z => 15,
  278.                       :opacity => 255,
  279.                       :animation_types => [12, 13],
  280.                       },#<---- Do Not Remove
  281.  
  282.     }#<---- End of Layers Hash. Do Not Remove
  283.  
  284.    
  285.   #=============================================================================
  286.   # * Splash Movie Options
  287.   #=============================================================================
  288.     Play_Splash_Movie = false
  289.     Play_On_New_Game = false
  290.     Movie_Name = "Flow_Animation"
  291.  
  292.    
  293.   #=============================================================================
  294.   # * Audio
  295.   #=============================================================================
  296.     BGM =         ["Town4", 80, 80]
  297.     BGS =         ["Clock", 40, 80]
  298.     New_Game_SE = ["Devil2", 80, 80]
  299.     Continue_SE = ["Explosion7", 80, 80]
  300.     Shutdown_SE = ["Cow", 80, 80]
  301.     Cancel_SE =   ["Horse", 80, 80]
  302.     Buzzer_SE =   ["Cat", 80, 80]
  303.     Cursor_SE =   ["Shot1", 80, 80]
  304.  
  305.    
  306.   #=============================================================================
  307.   # * Fade Out Of Menu Time In Frames (60 frames = 1 second)
  308.   #=============================================================================
  309.     Fade_Speed = 25
  310.  
  311.    
  312.   #=============================================================================
  313.   # * Title Command Window
  314.   #=============================================================================
  315.     #------------------------------------------------------------------------
  316.     # * Command Window Activate Time
  317.     #------------------------------------------------------------------------
  318.     Command_Window_Activate_Time = 500
  319.  
  320.     #------------------------------------------------------------------------
  321.     # * Command Alignment
  322.     #------------------------------------------------------------------------
  323.     Use_Horizontal_Command_Window = true
  324.  
  325.     #------------------------------------------------------------------------
  326.     # * Command Window Position & Size
  327.     #------------------------------------------------------------------------
  328.     Command_Window_X = 2
  329.     Command_Window_Y = 330
  330.     Command_Window_Z = 8
  331.     Command_Window_Height = 200
  332.     Command_Window_Width = 544
  333.  
  334.     #------------------------------------------------------------------------
  335.     # * Command Window Opacity & Back Opacity
  336.     #------------------------------------------------------------------------
  337.     Command_Window_Opacity = 0
  338.     Command_Window_Back_Opacity = 0
  339.  
  340.     #------------------------------------------------------------------------
  341.     # * Command Text
  342.     #------------------------------------------------------------------------
  343.     Use_Text_Commands = false
  344.     Command_Alignment = 1                     # Left = 0 Center = 1 Right = 2
  345.     Command_Window_Font = "Dobkin Plain"
  346.     Command_Window_Text_Size = 35
  347.     Command_Window_Text_Color = "mp_gauge_color1"
  348.  
  349.     #------------------------------------------------------------------------
  350.     # * Command Rect for Background
  351.     #------------------------------------------------------------------------
  352.     Command_Window_Rect_Width = 170
  353.     Command_Window_Rect_Height = 40
  354.     Command_Window_Rect_Spacing = 2
  355.  
  356.     #------------------------------------------------------------------------
  357.     # * Command Rect for Images Cursors
  358.     #------------------------------------------------------------------------
  359.     Command_Window_Cursor_Width = 170
  360.     Command_Window_Cursor_Height = 40
  361.     Command_Window_Cursor_Spacing = 2
  362.  
  363.     #------------------------------------------------------------------------
  364.     # * Command Images
  365.     #------------------------------------------------------------------------
  366.     NO_SAVE_FILE_IMAGE = ["No Save Files", -27, -15]
  367.    
  368.     Command_Window_Images = { #<---- Do Not Remove
  369.    
  370.       "New Game" =>  { :ox => -5,  :oy => -5              },#<---- Do Not Remove
  371.                      
  372.       "Continue" =>  { :ox => -15,  :oy => -5             },#<---- Do Not Remove
  373.                      
  374.       "Exit Demo" => { :ox => -7,  :oy => -5              },#<---- Do Not Remove
  375.  
  376.      
  377.      
  378. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  379. #                                                                              #
  380. #         DO NOT EDIT PAST THIS POINT UNLESS YOU KNOW WHAT YOUR DOING.         #
  381. #                                                                              #
  382. #<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>#
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395. }
  396. end
  397. end #<--- End Module===========================================================
  398.  
  399.  
  400. #==============================================================================
  401. # ** Sound
  402. #------------------------------------------------------------------------------
  403. #  This module plays sound effects. It obtains sound effects specified in the
  404. # database from the global variable $data_system, and plays them.
  405. #==============================================================================
  406.  
  407. module Sound
  408.  
  409.   #--------------------------------------------------------------------------
  410.   # * Include Module
  411.   #--------------------------------------------------------------------------
  412.   include V_Custom_Animated_Title_Scene::Specs
  413.  
  414.   #--------------------------------------------------------------------------
  415.   # * Method for cursor sound
  416.   #--------------------------------------------------------------------------
  417.   def self.play_cursor
  418.     $title == false ? play_system_sound(0) :  RPG::SE.new(Cursor_SE[0], Cursor_SE[1], Cursor_SE[2]).play if $title != false
  419.   end
  420.  
  421. end #<--- End Module===========================================================
  422.  
  423.  
  424. #==============================================================================
  425. # ** Window_TitleCommand
  426. #------------------------------------------------------------------------------
  427. #  This window is for selecting New Game/Continue on the title screen.
  428. #==============================================================================
  429.  
  430. class Window_TitleCommand < Window_Command
  431.  
  432.   #----------------------------------------------------------------------------
  433.   # * Checks If Your Using The Title Scene
  434.   #----------------------------------------------------------------------------
  435.   if $title != false
  436.    
  437.     #--------------------------------------------------------------------------
  438.     # * Include Module
  439.     #--------------------------------------------------------------------------
  440.     include V_Custom_Animated_Title_Scene::Specs
  441.  
  442.     #--------------------------------------------------------------------------
  443.     # * Update Window Position
  444.     #--------------------------------------------------------------------------
  445.     def update_placement
  446.       self.x = Command_Window_X
  447.       self.y = Command_Window_Y
  448.       self.z = Command_Window_Z
  449.       self.opacity = Command_Window_Opacity
  450.       self.back_opacity = Command_Window_Back_Opacity
  451.     end
  452.    
  453.     #--------------------------------------------------------------------------
  454.     # * Variable Initialization
  455.     #--------------------------------------------------------------------------
  456.     def init_vars
  457.       @command = {}
  458.     end
  459.      
  460.     #--------------------------------------------------------------------------
  461.     # * Processing When OK Button Is Pressed
  462.     #--------------------------------------------------------------------------
  463.     def process_ok
  464.       if current_item_enabled?
  465.         case @index
  466.         when 0
  467.           RPG::SE.new(New_Game_SE[0], New_Game_SE[1], New_Game_SE[2]).play
  468.         when 1
  469.           RPG::SE.new(Continue_SE[0], Continue_SE[1], Continue_SE[2]).play
  470.         when 2
  471.           RPG::SE.new(Shutdown_SE[0], Shutdown_SE[1], Shutdown_SE[2]).play
  472.         end
  473.         Input.update
  474.         deactivate
  475.         call_ok_handler
  476.       else
  477.         RPG::SE.new(Buzzer_SE[0], Buzzer_SE[1], Buzzer_SE[2]).play
  478.       end
  479.     end
  480.    
  481.     #--------------------------------------------------------------------------
  482.     # * Processing When Cancel Button Is Pressed
  483.     #--------------------------------------------------------------------------
  484.     def process_cancel
  485.       RPG::SE.new(Cancel_SE[0], Cancel_SE[1], Cancel_SE[2]).play
  486.       Input.update
  487.       deactivate
  488.       call_cancel_handler
  489.     end
  490.    
  491.     #----------------------------------------------------------------------------
  492.     # * Use Horizontal Command Window
  493.     #----------------------------------------------------------------------------
  494.     if Use_Horizontal_Command_Window
  495.      
  496.       #--------------------------------------------------------------------------
  497.       # * Maximum number of colums
  498.       #--------------------------------------------------------------------------
  499.       def col_max
  500.         return item_max
  501.       end
  502.      
  503.       #--------------------------------------------------------------------------
  504.       # * Visible line number
  505.       #--------------------------------------------------------------------------
  506.       def visible_line_number
  507.         1
  508.       end
  509.      
  510.     end #<---End Horizontal Check
  511.      
  512.    
  513.     #--------------------------------------------------------------------------
  514.     # * Window Height
  515.     #--------------------------------------------------------------------------
  516.     def window_height
  517.       return Command_Window_Height
  518.     end
  519.      
  520.     #--------------------------------------------------------------------------
  521.     # * Window Height
  522.     #--------------------------------------------------------------------------
  523.     def window_width
  524.       return Command_Window_Width
  525.     end
  526.      
  527.     #--------------------------------------------------------------------------
  528.     # * Draw Item
  529.     #--------------------------------------------------------------------------
  530.     def set_text_color
  531.       case Command_Window_Text_Color
  532.       when "normal_color"
  533.         normal_color
  534.       when "system_color"
  535.         system_color
  536.       when "crisis_color"
  537.         crisis_color
  538.       when "knockout_color"
  539.         knockout_color
  540.       when "gauge_back_color"
  541.         gauge_back_color
  542.       when "power_up_color"
  543.         power_up_color
  544.       when "power_down_color"
  545.         power_down_color
  546.       when "hp_gauge_color1"
  547.         hp_gauge_color1
  548.       when "mp_gauge_color2"
  549.         hp_gauge_color2
  550.       when "mp_gauge_color1"
  551.         mp_gauge_color1
  552.       when "mp_gauge_color2"
  553.         mp_gauge_color2
  554.       when "mp_cost_color"
  555.         mp_cost_color
  556.       when "tp_gauge_color1"
  557.         tp_gauge_color1
  558.       when "tp_gauge_color2"
  559.         tp_gauge_color2
  560.       when "tp_cost_color"
  561.         tp_cost_color
  562.       end
  563.     end
  564.  
  565.     #--------------------------------------------------------------------------
  566.     # * Get Item Width
  567.     #--------------------------------------------------------------------------
  568.     def item_width
  569.       Command_Window_Rect_Width
  570.     end
  571.  
  572.     #--------------------------------------------------------------------------
  573.     # * Get Item Height
  574.     #--------------------------------------------------------------------------
  575.     def item_height
  576.       Command_Window_Rect_Height
  577.     end
  578.    
  579.     #--------------------------------------------------------------------------
  580.     # * Get Spacing for Items Arranged Side by Side
  581.     #--------------------------------------------------------------------------
  582.     def spacing
  583.       return Command_Window_Rect_Spacing
  584.     end
  585.    
  586.     #--------------------------------------------------------------------------
  587.     # * Draw Command Text
  588.     #--------------------------------------------------------------------------
  589.     def draw_command_text(index, text)
  590.       reset_font_settings
  591.       contents.font.name = Command_Window_Font
  592.       contents.font.size = Command_Window_Text_Size
  593.       change_color(set_text_color, command_enabled?(index))
  594.       contents.draw_text(item_rect(index), text, Command_Alignment)
  595.       reset_font_settings
  596.     end
  597.  
  598.     #--------------------------------------------------------------------------
  599.     # * Draw Command Image
  600.     #--------------------------------------------------------------------------
  601.     def draw_command_images
  602.       init_vars
  603.       index = 0
  604.       width = Command_Window_Rect_Width + spacing
  605.       height = Command_Window_Rect_Height + spacing
  606.       Command_Window_Images.each_key { |i|
  607.         @command[i] = Sprite.new
  608.         if index != 1
  609.           @command[i].bitmap = Cache.title1(i)
  610.           @command[i].ox = Command_Window_Images[i][:ox]
  611.           @command[i].oy = Command_Window_Images[i][:oy]
  612.         else
  613.           if continue_enabled
  614.             @command[i].bitmap = Cache.title1(i)
  615.             @command[i].ox = Command_Window_Images[i][:ox]
  616.             @command[i].oy = Command_Window_Images[i][:oy]
  617.           else
  618.             @command[i].bitmap = Cache.title1(NO_SAVE_FILE_IMAGE[0])
  619.             @command[i].ox = NO_SAVE_FILE_IMAGE[1]
  620.             @command[i].oy = NO_SAVE_FILE_IMAGE[2]
  621.           end
  622.         end
  623.         case Use_Horizontal_Command_Window
  624.         when true
  625.           @command[i].x = (Command_Window_X + (width * index))
  626.           @command[i].y = Command_Window_Y
  627.         when false
  628.           @command[i].x = Command_Window_X
  629.           @command[i].y = (Command_Window_Y + (height * index))
  630.         end
  631.         @command[i].z = Command_Window_Z
  632.         index += 1
  633.       }  
  634.     end
  635.  
  636.     #--------------------------------------------------------------------------
  637.     # * Draw Item
  638.     #--------------------------------------------------------------------------
  639.     def draw_item(index)
  640.       draw_command_text(index, command_name(index)) if Use_Text_Commands
  641.       draw_command_images if Use_Text_Commands == false
  642.     end
  643.  
  644.     #--------------------------------------------------------------------------
  645.     # *
  646.     #--------------------------------------------------------------------------
  647.     def dispose_item_images
  648.       @command.each_key { |i|
  649.       @command[i].bitmap.dispose
  650.       @command[i].dispose
  651.       }
  652.     end
  653.  
  654.     #--------------------------------------------------------------------------
  655.     # * Dispose
  656.     #--------------------------------------------------------------------------
  657.     def dispose
  658.       super
  659.       dispose_item_images if @command != nil
  660.     end
  661.    
  662.   end #<---End Title Usage Check
  663.  
  664. end #<--- End Class============================================================
  665.  
  666.  
  667.  
  668. #==============================================================================
  669. # ** Scene_Title
  670. #------------------------------------------------------------------------------
  671. #  This class performs the title screen processing.
  672. #==============================================================================
  673.  
  674. class Scene_Title < Scene_Base
  675.  
  676.   #--------------------------------------------------------------------------
  677.   # * Include Module
  678.   #--------------------------------------------------------------------------
  679.   include V_Custom_Animated_Title_Scene::Specs
  680.  
  681.   #--------------------------------------------------------------------------
  682.   # * Start Processing
  683.   #--------------------------------------------------------------------------
  684.   def start
  685.     play_intro_movie(Movie_Name) if Play_Splash_Movie && Play_On_New_Game != true
  686.     create_command_window
  687.     init_cat_vars
  688.     play_title_music
  689.   end
  690.  
  691.   #--------------------------------------------------------------------------
  692.   # * Aliasing Method: Close Command Window
  693.   #--------------------------------------------------------------------------
  694.   alias :ccw546345313131 :create_command_window
  695.  
  696.   #--------------------------------------------------------------------------
  697.   # * Create Command Window
  698.   #--------------------------------------------------------------------------
  699.   def create_command_window
  700.     ccw546345313131()
  701.     @active = true
  702.     Command_Window_Activate_Time > 0 ? @command_window.deactivate && @active = false : @active = true
  703.   end
  704.  
  705.   #--------------------------------------------------------------------------
  706.   # * Initialization CAT Variables
  707.   #--------------------------------------------------------------------------
  708.   def init_cat_vars
  709.     init_basic_vars
  710.     init_layer_vars
  711.     init_layer_info_vars
  712.   end
  713.                            
  714.   #--------------------------------------------------------------------------
  715.   # * Variable Initialization
  716.   #--------------------------------------------------------------------------
  717.   def init_basic_vars
  718.     @command_timer = 0
  719.     $title = true
  720.     @hour = nil
  721.     @minute = nil
  722.     @layers = {}
  723.     @layers_info = {}
  724.   end
  725.                            
  726.   #--------------------------------------------------------------------------
  727.   # * Variable Initialization
  728.   #--------------------------------------------------------------------------
  729.   def init_layer_vars
  730.     Layers.each_key { |i|
  731.       @layers[i] = Sprite.new
  732.       @layers[i].bitmap = Cache.title1(i) unless Layers[i].has_key?(:max_variable_frames)
  733.       @layers[i].bitmap = Cache.title1(i + "_0") if Layers[i].has_key?(:max_variable_frames)
  734.       @layers[i].x = Command_Window_X if Layers[i][:x] == nil
  735.       @layers[i].y = Command_Window_Y if Layers[i][:y] == nil
  736.       @layers[i].x = Layers[i][:x] unless Layers[i][:x] == nil
  737.       @layers[i].y = Layers[i][:y] unless Layers[i][:y] == nil
  738.       @layers[i].z = Layers[i][:z]
  739.       @layers[i].ox = Layers[i][:ox]
  740.       @layers[i].oy = Layers[i][:oy]
  741.       @layers[i].opacity = Layers[i][:opacity]
  742.       @layers[i].angle = Layers[i][:angle] if Layers[i].has_key?(:angle)
  743.       @layers[i].blend = Layers[i][:blend] if Layers[i].has_key?(:blend)
  744.     }
  745.   end
  746.                            
  747.   #--------------------------------------------------------------------------
  748.   # * Variable Initialization
  749.   #--------------------------------------------------------------------------
  750.   def init_layer_info_vars
  751.     Layers.each_key { |i|
  752.       @layers_info[i] = {  
  753.         :animation_types => Layers[i][:animation_types],
  754.         :rotation_frame => 0,
  755.         :scroll_frame => 0,
  756.         :fade_frame => 0,
  757.         :fade_out_frame => 0,
  758.         :fade_out_time => 0,
  759.         :wave_frame => 0,
  760.         :blend_frame => 0,
  761.         :variable_frame => 0,
  762.         :variable_id => 0,
  763.         :initialize_rotation_frame => 0,
  764.         :initialize_move_frame => 0,
  765.         :initialize_fade_in_frame => 0,
  766.         :fade_switch => true,
  767.         :wave_switch => true,
  768.         :blend_switch => true,
  769.         :blend_switch => true,
  770.         :initialize_frame => 0,
  771.         :initialize_switch => true,
  772.       }
  773.       @layers_info[i][:rotation_speed] = Layers[i][:rotation_speed] if Layers[i].has_key?(:rotation_speed)
  774.       @layers_info[i][:scroll_speed] = Layers[i][:scroll_speed] if Layers[i].has_key?(:scroll_speed)
  775.       @layers_info[i][:fade_speed] = Layers[i][:fade_speed] if Layers[i].has_key?(:fade_speed)
  776.       @layers_info[i][:rotation_frame_rate] = Layers[i][:rotation_frame_rate] if Layers[i].has_key?(:rotation_frame_rate)
  777.       @layers_info[i][:scroll_frame_rate] = Layers[i][:scroll_frame_rate] if Layers[i].has_key?(:scroll_frame_rate)
  778.       @layers_info[i][:fade_frame_rate] = Layers[i][:fade_frame_rate] if Layers[i].has_key?(:fade_frame_rate)
  779.       @layers_info[i][:start_fade_out] = Layers[i][:start_fade_out] if Layers[i].has_key?(:start_fade_out)
  780.       @layers_info[i][:fade_out_frame_rate] = Layers[i][:fade_out_frame_rate] if Layers[i].has_key?(:fade_out_frame_rate)
  781.       @layers_info[i][:fade_out_speed] = Layers[i][:fade_out_speed] if Layers[i].has_key?(:fade_out_speed)
  782.       @layers_info[i][:fade_max_opacity] = Layers[i][:fade_max_opacity] if Layers[i].has_key?(:fade_max_opacity)
  783.       @layers_info[i][:fade_min_opacity] = Layers[i][:fade_min_opacity] if Layers[i].has_key?(:fade_min_opacity)
  784.       @layers_info[i][:wave_frame_rate] = Layers[i][:wave_frame_rate] if Layers[i].has_key?(:wave_frame_rate)
  785.       @layers_info[i][:wave_strength] = Layers[i][:wave_strength] if Layers[i].has_key?(:wave_frame_rate)
  786.       @layers_info[i][:blend_frame_rate] = Layers[i][:blend_frame_rate] if Layers[i].has_key?(:blend_frame_rate)
  787.       @layers_info[i][:variable_frame_rate] = Layers[i][:variable_frame_rate] if Layers[i].has_key?(:variable_frame_rate)
  788.       @layers_info[i][:max_variable_frames] = Layers[i][:max_variable_frames] if Layers[i].has_key?(:max_variable_frames)
  789.       @layers_info[i][:variable_frame_name] = (i + "_" + @layers_info[i][:variable_id].to_s) if Layers[i].has_key?(:max_variable_frames)
  790.       @layers_info[i][:initialize_time] = Layers[i][:initialize_time] if Layers[i].has_key?(:initialize_time)
  791.       @layers_info[i][:initialize_time] = 0 if Layers[i].has_key?(:initialize_time) == false
  792.       @layers_info[i][:initialize_animations] = Layers[i][:initialize_animations].dup if Layers[i].has_key?(:initialize_animations)
  793.       @layers_info[i][:initialize_animations] = [0] if Layers[i].has_key?(:initialize_animations) == false
  794.       @layers_info[i][:initialize_rotation_frame_rate] = Layers[i][:initialize_rotation_frame_rate] if Layers[i].has_key?(:initialize_rotation_frame_rate)
  795.       @layers_info[i][:initialize_rotation_speed] = Layers[i][:initialize_rotation_speed] if Layers[i].has_key?(:initialize_rotation_speed)
  796.       @layers_info[i][:initialize_rotation_final_angle] = Layers[i][:initialize_rotation_final_angle] if Layers[i].has_key?(:initialize_rotation_final_angle)
  797.       @layers_info[i][:initialize_move_frame_rate] = Layers[i][:initialize_move_frame_rate] if Layers[i].has_key?(:initialize_move_frame_rate)
  798.       @layers_info[i][:initialize_move_speed] = Layers[i][:initialize_move_speed] if Layers[i].has_key?(:initialize_move_speed)
  799.       @layers_info[i][:initialize_move_final_x] = Layers[i][:initialize_move_final_x] if Layers[i].has_key?(:initialize_move_final_x)
  800.       @layers_info[i][:initialize_move_final_y] = Layers[i][:initialize_move_final_y] if Layers[i].has_key?(:initialize_move_final_y)
  801.       @layers_info[i][:initialize_fade_in_frame_rate] = Layers[i][:initialize_fade_in_frame_rate] if Layers[i].has_key?(:initialize_fade_in_frame_rate)
  802.       @layers_info[i][:initialize_fade_in_speed] = Layers[i][:initialize_fade_in_speed] if Layers[i].has_key?(:initialize_fade_in_speed)
  803.     }
  804.   end
  805.                            
  806.   #--------------------------------------------------------------------------
  807.   # * Get Transition Speed
  808.   #--------------------------------------------------------------------------
  809.   def transition_speed
  810.     return Fade_Speed
  811.   end
  812.  
  813.   #--------------------------------------------------------------------------
  814.   # * Termination Processing
  815.   #--------------------------------------------------------------------------
  816.   def terminate
  817.     Graphics.freeze
  818.     dispose_all_windows
  819.     SceneManager.snapshot_for_background
  820.     dispose_cat_layers
  821.     dispose_cat_layers_info
  822.   end
  823.  
  824.   #--------------------------------------------------------------------------
  825.   # * Free Foreground
  826.   #--------------------------------------------------------------------------
  827.   def dispose_cat_layers_info
  828.     @layers_info.clear
  829.   end
  830.  
  831.   #--------------------------------------------------------------------------
  832.   # * Dipose Layers
  833.   #--------------------------------------------------------------------------
  834.   def dispose_cat_layers
  835.     @layers.each_key { |i|
  836.       @layers[i].bitmap.dispose
  837.       @layers[i].dispose
  838.     }
  839.     @layers.clear
  840.   end
  841.  
  842.   #--------------------------------------------------------------------------
  843.   # * Method for Animating Layers
  844.   #--------------------------------------------------------------------------
  845.   def update_layer_frames
  846.     @command_timer += 1
  847.     @layers_info.each_key { |i|
  848.                             @layers_info[i][:rotation_frame] += 1 if @layers_info[i].has_key?(:rotation_frame)
  849.                             @layers_info[i][:scroll_frame] += 1 if @layers_info[i].has_key?(:scroll_frame)
  850.                             @layers_info[i][:fade_frame] += 1 if @layers_info[i].has_key?(:fade_frame)
  851.                             @layers_info[i][:fade_out_frame] += 1 if @layers_info[i].has_key?(:fade_out_frame)
  852.                             @layers_info[i][:fade_out_time] += 1 if @layers_info[i].has_key?(:fade_out_time)
  853.                             @layers_info[i][:wave_frame] += 1 if @layers_info[i].has_key?(:wave_frame)
  854.                             @layers_info[i][:blend_frame] += 1 if @layers_info[i].has_key?(:blend_frame)
  855.                             @layers_info[i][:variable_frame] += 1 if @layers_info[i].has_key?(:variable_frame)
  856.                             @layers_info[i][:initialize_frame] += 1 if @layers_info[i].has_key?(:initialize_frame)
  857.                             @layers_info[i][:initialize_fade_in_frame] += 1 if @layers_info[i].has_key?(:initialize_fade_in_frame)
  858.                             @layers_info[i][:initialize_move_frame] += 1 if @layers_info[i].has_key?(:initialize_move_frame)
  859.                             @layers_info[i][:initialize_rotation_frame] += 1 if @layers_info[i].has_key?(:initialize_rotation_frame)
  860.                           }
  861.   end
  862.  
  863.   #--------------------------------------------------------------------------
  864.   # * Process Layers
  865.   #--------------------------------------------------------------------------
  866.   def process_layer_animations
  867.     @layers_info.each_key { |i|
  868.       if @layers_info[i][:initialize_frame] >= @layers_info[i][:initialize_time]
  869.         case @layers_info[i][:initialize_switch]
  870.         when true
  871.           update_initialize_layer_animations
  872.         when false
  873.           update_layer_animations
  874.         end
  875.       end
  876.     }
  877.   end
  878.  
  879.   #--------------------------------------------------------------------------
  880.   # * Update Layers
  881.   #--------------------------------------------------------------------------
  882.   def update_initialize_layer_animations
  883.     @layers_info.each_key { |i|
  884.       @layers_info[i][:initialize_animations].size.times { |animation_index|
  885.         case @layers_info[i][:initialize_animations][animation_index]
  886.         when 0
  887.           initialize_complete(i, animation_index)
  888.         when 1
  889.           move_clockwise_animation(i, animation_index)
  890.         when 2
  891.           move_counter_clockwise_animation(i, animation_index)
  892.         when 3
  893.           move_right(i, animation_index)
  894.         when 4
  895.           move_left(i, animation_index)
  896.         when 5
  897.           move_down(i, animation_index)
  898.         when 6
  899.           move_up(i, animation_index)
  900.         when 7
  901.           fade_in(i, animation_index)
  902.         end
  903.       }
  904.     }
  905.   end
  906.  
  907.   #--------------------------------------------------------------------------
  908.   # * Update Layers
  909.   #--------------------------------------------------------------------------
  910.   def update_layer_animations
  911.     @layers_info.each_key { |i|
  912.       @layers_info[i][:animation_types].size.times { |types|
  913.         case @layers_info[i][:animation_types][types]
  914.         when 0
  915.         when 1
  916.           clockwise_animation(i)
  917.         when 2
  918.           counter_clockwise_animation(i)
  919.         when 3
  920.           loop_right(i)
  921.         when 4
  922.           loop_left(i)
  923.         when 5
  924.           loop_down(i)
  925.         when 6
  926.           loop_up(i)
  927.         when 7
  928.           fade_in_out(i)
  929.         when 8
  930.           hour(i)
  931.         when 9
  932.           minute(i)
  933.         when 10
  934.           wave(i)
  935.         when 11
  936.           blend(i)
  937.         when 12
  938.           variable(i)
  939.         when 13
  940.           cursor(i)
  941.         when 14
  942.           fade_out(i)
  943.         end
  944.       }
  945.     }
  946.   end
  947.  
  948.   #--------------------------------------------------------------------------
  949.   # * Cursor Animation
  950.   #--------------------------------------------------------------------------
  951.   def cursor(index)
  952.     cursor_index = @command_window.index
  953.     width = (Command_Window_Cursor_Width + Command_Window_Cursor_Spacing)
  954.     height = (Command_Window_Cursor_Height + Command_Window_Cursor_Spacing)
  955.     if Use_Horizontal_Command_Window
  956.       case cursor_index
  957.       when 0
  958.         @layers[index].x = Command_Window_X
  959.       when 1
  960.         @layers[index].x = Command_Window_X + width
  961.       when 2
  962.         @layers[index].x = Command_Window_X + (width * 2)
  963.       end
  964.     else
  965.       case cursor_index
  966.       when 0
  967.         @layers[index].y = Command_Window_Y
  968.       when 1
  969.         @layers[index].x = Command_Window_Y + height
  970.       when 2
  971.         @layers[index].x = Command_Window_Y + (height * 2)
  972.       end
  973.     end
  974.   end
  975.  
  976.   #--------------------------------------------------------------------------
  977.   # * Variable Animation
  978.   #--------------------------------------------------------------------------
  979.   def variable(index)
  980.     if @layers_info[index][:variable_frame] >= @layers_info[index][:variable_frame_rate]
  981.       case
  982.       when @layers_info[index][:variable_id] >= @layers_info[index][:max_variable_frames]
  983.         @layers[index].bitmap.dispose
  984.         @layers_info[index][:variable_id] = 0
  985.         @layers_info[index][:variable_frame_name] = (index + "_" + @layers_info[index][:variable_id].to_s)
  986.         @layers[index].bitmap = Cache.title1(@layers_info[index][:variable_frame_name])
  987.       when @layers_info[index][:variable_id] < @layers_info[index][:max_variable_frames]
  988.         @layers[index].bitmap.dispose
  989.         @layers_info[index][:variable_id] += 1
  990.         @layers_info[index][:variable_frame_name] = (index + "_" + @layers_info[index][:variable_id].to_s)
  991.         @layers[index].bitmap = Cache.title1(@layers_info[index][:variable_frame_name])
  992.       end
  993.       @layers_info[index][:variable_frame] = 0
  994.     end
  995.   end
  996.  
  997.   #--------------------------------------------------------------------------
  998.   # * Blend Animation
  999.   #--------------------------------------------------------------------------
  1000.   def blend(index)
  1001.     if @layers_info[index][:blend_frame] >= @layers_info[index][:blend_frame_rate]
  1002.       case
  1003.       when @layers_info[index][:blend_switch] == true
  1004.         @layers[index].blend_type += 1
  1005.         @layers_info[index][:blend_switch]= false if @layers[index].blend_type >= 2
  1006.       when @layers_info[index][:blend_switch] == false
  1007.         @layers[index].blend_type -= 1
  1008.         @layers_info[index][:blend_switch] = true if @layers[index].blend_type <= 0
  1009.       end
  1010.       @layers_info[index][:blend_frame] = 0
  1011.     end
  1012.   end
  1013.  
  1014.   #--------------------------------------------------------------------------
  1015.   # * Wave Animation
  1016.   #--------------------------------------------------------------------------
  1017.   def wave(index)
  1018.     if @layers_info[index][:wave_frame] >= @layers_info[index][:wave_frame_rate]
  1019.       case
  1020.       when @layers_info[index][:wave_switch] == true
  1021.         @layers[index].wave_amp += 1
  1022.         @layers_info[index][:wave_switch]= false if @layers[index].wave_amp >= @layers_info[index][:wave_strength]
  1023.       when @layers_info[index][:wave_switch] == false
  1024.         @layers[index].wave_amp -= 1
  1025.         @layers_info[index][:wave_switch] = true if @layers[index].wave_amp <= 0
  1026.       end
  1027.       @layers_info[index][:wave_frame] = 0
  1028.     end
  1029.   end
  1030.  
  1031.   #--------------------------------------------------------------------------
  1032.   # * Hour Animation
  1033.   #--------------------------------------------------------------------------
  1034.   def hour(index)
  1035.     time = Time.now
  1036.     hour = time.hour
  1037.     if hour > 12
  1038.       hour -= 12
  1039.     end
  1040.     if @hour != hour
  1041.       @layers[index].angle = (30 * hour) * -1
  1042.       @hour = hour
  1043.     end
  1044.   end
  1045.  
  1046.   #--------------------------------------------------------------------------
  1047.   # * Minute Animation
  1048.   #--------------------------------------------------------------------------
  1049.   def minute(index)
  1050.     time = Time.now
  1051.     minute = time.min
  1052.     if @minute != minute
  1053.       @layers[index].angle = (6 * minute) * -1
  1054.       @minute = minute
  1055.     end
  1056.   end
  1057.  
  1058.   #--------------------------------------------------------------------------
  1059.   # * Clockwise Animation
  1060.   #--------------------------------------------------------------------------
  1061.   def clockwise_animation(index)
  1062.     if @layers_info[index][:rotation_frame] >= @layers_info[index][:rotation_frame_rate]
  1063.       @layers[index].angle -= @layers_info[index][:rotation_speed]
  1064.       @layers_info[index][:rotation_frame] = 0
  1065.     end
  1066.   end
  1067.  
  1068.   #--------------------------------------------------------------------------
  1069.   # * Counter Clockwise Animation
  1070.   #--------------------------------------------------------------------------
  1071.   def counter_clockwise_animation(index)
  1072.     if @layers_info[index][:rotation_frame] <= @layers_info[index][:rotation_frame_rate]
  1073.       @layers[index].angle += @layers_info[index][:rotation_speed]
  1074.       @layers_info[index][:rotation_frame] = 0
  1075.     end
  1076.   end
  1077.  
  1078.   #--------------------------------------------------------------------------
  1079.   # * Loop Moving Down
  1080.   #--------------------------------------------------------------------------
  1081.   def loop_down(index)
  1082.     if @layers_info[index][:scroll_frame] >= @layers_info[index][:scroll_frame_rate]
  1083.       @layers[index].y += @layers_info[index][:scroll_speed]
  1084.       if @layers[index].y >= Graphics.height
  1085.         @layers[index].y = Graphics.height - ((@layers[index].height * 2 ) + 5)
  1086.       end
  1087.       @layers_info[index][:scroll_frame] = 0
  1088.     end
  1089.   end
  1090.  
  1091.   #--------------------------------------------------------------------------
  1092.   # * Loop Moving Up
  1093.   #--------------------------------------------------------------------------
  1094.   def loop_up(index)
  1095.     if @layers_info[index][:scroll_frame] >= @layers_info[index][:scroll_frame_rate]
  1096.       @layers[index].y -= @layers_info[index][:scroll_speed]
  1097.       if @layers[index].y <= Graphics.height * -1
  1098.         @layers[index].y = Graphics.height
  1099.       end
  1100.       @layers_info[index][:scroll_frame] = 0
  1101.     end
  1102.   end
  1103.  
  1104.   #--------------------------------------------------------------------------
  1105.   # * Loop Moving Right
  1106.   #--------------------------------------------------------------------------
  1107.   def loop_right(index)
  1108.     if @layers_info[index][:scroll_frame] >= @layers_info[index][:scroll_frame_rate]
  1109.       @layers[index].x += @layers_info[index][:scroll_speed]
  1110.       if @layers[index].x >= Graphics.width
  1111.         @layers[index].x = Graphics.width - (@layers[index].width * 2)
  1112.       end
  1113.       @layers_info[index][:scroll_frame] = 0
  1114.     end
  1115.   end
  1116.  
  1117.   #--------------------------------------------------------------------------
  1118.   # * Loop Moving Left
  1119.   #--------------------------------------------------------------------------
  1120.   def loop_left(index)
  1121.     if @layers_info[index][:scroll_frame] >= @layers_info[index][:scroll_frame_rate]
  1122.       @layers[index].x -= @layers_info[index][:scroll_speed]
  1123.       if @layers[index].x <= @layers[index].width * -1
  1124.         @layers[index].x = Graphics.width
  1125.       end
  1126.       @layers_info[index][:scroll_frame] = 0
  1127.     end
  1128.   end
  1129.  
  1130.   #--------------------------------------------------------------------------
  1131.   # * Fade In And Out
  1132.   #--------------------------------------------------------------------------
  1133.   def fade_in_out(index)
  1134.     if @layers_info[index][:fade_frame] >= @layers_info[index][:fade_frame_rate]
  1135.       case
  1136.       when @layers_info[index][:fade_switch] == true
  1137.         @layers[index].opacity -= @layers_info[index][:fade_speed]
  1138.         if @layers_info[index].has_key?(:fade_min_opacity)
  1139.           @layers_info[index][:fade_switch]= false if @layers[index].opacity <= @layers_info[index][:fade_min_opacity]
  1140.         else
  1141.           @layers_info[index][:fade_switch]= false if @layers[index].opacity <= 25
  1142.         end
  1143.       when @layers_info[index][:fade_switch] == false
  1144.         @layers[index].opacity += @layers_info[index][:fade_speed]
  1145.         case @layers_info[index].has_key?(:fade_max_opacity)
  1146.         when true
  1147.           @layers_info[index][:fade_switch] = true if @layers[index].opacity >= @layers[index][:fade_max_opacity]
  1148.         when false
  1149.           @layers_info[index][:fade_switch] = true if @layers[index].opacity >= 255
  1150.         end
  1151.       end
  1152.       @layers_info[index][:fade_frame] = 0
  1153.     end
  1154.   end
  1155.  
  1156.   #--------------------------------------------------------------------------
  1157.   # * Initialize Animation Method: Initialize Complete
  1158.   #--------------------------------------------------------------------------
  1159.   def initialize_complete(index, animation_index)
  1160.     @layers_info[index][:initialize_animations][animation_index] = 0
  1161.     initialize_completed(index)
  1162.   end
  1163.  
  1164.   #--------------------------------------------------------------------------
  1165.   # * Initialize Animation Method: Initialize Completed
  1166.   #--------------------------------------------------------------------------
  1167.   def initialize_completed(index)
  1168.     completed = true
  1169.     @layers_info[index][:initialize_animations].size.times { |i|
  1170.       completed = false if @layers_info[index][:initialize_animations][i] != 0
  1171.     }
  1172.     @layers_info[index][:initialize_switch] = false if completed == true
  1173.   end
  1174.  
  1175.   #--------------------------------------------------------------------------
  1176.   # * Fade Out
  1177.   #--------------------------------------------------------------------------
  1178.   def fade_out(index)
  1179.     case
  1180.     when @layers_info[index][:fade_out_time] >= @layers_info[index][:start_fade_out]
  1181.       if @layers_info[index][:fade_out_frame] >= @layers_info[index][:fade_out_frame_rate]
  1182.         case
  1183.         when @layers[index].opacity > 0
  1184.           @layers[index].opacity -= @layers_info[index][:fade_out_speed]
  1185.         end
  1186.       @layers_info[index][:fade_out_frame] = 0
  1187.       end
  1188.     end
  1189.   end
  1190.  
  1191.   #--------------------------------------------------------------------------
  1192.   # * Initialize Animation Method: Fade In
  1193.   #--------------------------------------------------------------------------
  1194.   def fade_in(index, animation_index)
  1195.     if @layers_info[index][:initialize_fade_in_frame] >= @layers_info[index][:initialize_fade_in_frame_rate]
  1196.       case @layers_info[index].has_key?(:fade_max_opacity)
  1197.       when true
  1198.         if @layers[index].opacity < @layers_info[index][:fade_max_opacity]
  1199.           @layers[index].opacity += @layers_info[index][:initialize_fade_in_speed]
  1200.         end
  1201.         if @layers[index].opacity >= @layers_info[index][:fade_max_opacity]
  1202.           initialize_complete(index, animation_index)
  1203.         end
  1204.       when false
  1205.         if @layers[index].opacity < 255
  1206.           @layers[index].opacity += @layers_info[index][:initialize_fade_in_speed]
  1207.         end
  1208.         if @layers[index].opacity >= 255
  1209.           initialize_complete(index, animation_index)
  1210.         end
  1211.       end
  1212.       @layers_info[index][:initialize_fade_in_frame] = 0
  1213.     end
  1214.   end
  1215.  
  1216.   #--------------------------------------------------------------------------
  1217.   # * Initialize Animation Method: Move Right
  1218.   #--------------------------------------------------------------------------
  1219.   def move_right(index, animation_index)
  1220.     if @layers_info[index][:initialize_move_frame] >= @layers_info[index][:initialize_move_frame_rate]
  1221.       case
  1222.       when @layers[index].x < @layers_info[index][:initialize_move_final_x]
  1223.         @layers[index].x += @layers_info[index][:initialize_move_speed]
  1224.       when @layers[index].x >= @layers_info[index][:initialize_move_final_x]
  1225.         initialize_complete(index, animation_index)
  1226.       end
  1227.       @layers_info[index][:initialize_move_frame] = 0
  1228.     end
  1229.   end
  1230.  
  1231.   #--------------------------------------------------------------------------
  1232.   # * Initialize Animation Method: Move Left
  1233.   #--------------------------------------------------------------------------
  1234.   def move_left(index, animation_index)
  1235.     if @layers_info[index][:initialize_move_frame] >= @layers_info[index][:initialize_move_frame_rate]
  1236.       case
  1237.       when @layers[index].x > @layers_info[index][:initialize_move_final_x]
  1238.         @layers[index].x -= @layers_info[index][:initialize_move_speed]
  1239.       when @layers[index].x <= @layers_info[index][:initialize_move_final_x]
  1240.         initialize_complete(index, animation_index)
  1241.       end
  1242.       @layers_info[index][:initialize_move_frame] = 0
  1243.     end
  1244.   end
  1245.  
  1246.   #--------------------------------------------------------------------------
  1247.   # * Initialize Animation Method: Move Up
  1248.   #--------------------------------------------------------------------------
  1249.   def move_up(index, animation_index)
  1250.     if @layers_info[index][:initialize_move_frame] >= @layers_info[index][:initialize_move_frame_rate]
  1251.       case
  1252.       when @layers[index].y > @layers_info[index][:initialize_move_final_y]
  1253.         @layers[index].y -= @layers_info[index][:initialize_move_speed]
  1254.       when @layers[index].y <= @layers_info[index][:initialize_move_final_y]
  1255.         initialize_complete(index, animation_index)
  1256.       end
  1257.       @layers_info[index][:initialize_move_frame] = 0
  1258.     end
  1259.   end
  1260.  
  1261.   #--------------------------------------------------------------------------
  1262.   # * Initialize Animation Method: Move Down
  1263.   #--------------------------------------------------------------------------
  1264.   def move_down(index, animation_index)
  1265.     if @layers_info[index][:initialize_move_frame] >= @layers_info[index][:initialize_move_frame_rate]
  1266.       case
  1267.       when @layers[index].y < @layers_info[index][:initialize_move_final_y]
  1268.         @layers[index].y += @layers_info[index][:initialize_move_speed]
  1269.       when @layers[index].y >= @layers_info[index][:initialize_move_final_y]
  1270.         initialize_complete(index, animation_index)
  1271.       end
  1272.       @layers_info[index][:initialize_move_frame] = 0
  1273.     end
  1274.   end
  1275.  
  1276.   #--------------------------------------------------------------------------
  1277.   # * Initialize Animation Method: Move Clockwise Rotation
  1278.   #--------------------------------------------------------------------------
  1279.   def move_clockwise_animation(index, animation_index)
  1280.     if @layers_info[index][:initialize_rotation_frame] >= @layers_info[index][:initialize_rotation_frame_rate]
  1281.       case
  1282.       when @layers[index].angle > @layers_info[index][:initialize_rotation_final_angle]
  1283.         @layers[index].angle -= @layers_info[index][:initialize_rotation_speed]
  1284.       when @layers[index].angle == @layers_info[index][:initialize_rotation_final_angle]
  1285.         initialize_complete(index, animation_index)
  1286.       end
  1287.       @layers_info[index][:initialize_rotation_frame] = 0
  1288.     end
  1289.   end
  1290.  
  1291.   #--------------------------------------------------------------------------
  1292.   # * Initialize Animation Method: Move Counter-clockwise Rotation
  1293.   #--------------------------------------------------------------------------
  1294.   def move_counter_clockwise_animation(index, animation_index)
  1295.     if @layers_info[index][:initialize_rotation_frame] >= @layers_info[index][:initialize_rotation_frame_rate]
  1296.       case
  1297.       when @layers[index].angle < @layers_info[index][:initialize_rotation_final_angle]
  1298.         @layers[index].angle += @layers_info[index][:initialize_rotation_speed]
  1299.       when @layers[index].angle >= @layers_info[index][:initialize_rotation_final_angle]
  1300.         initialize_complete(index, animation_index)
  1301.       end
  1302.       @layers_info[index][:initialize_rotation_frame] = 0
  1303.     end
  1304.   end
  1305.  
  1306.   #--------------------------------------------------------------------------
  1307.   # * Method for Animating Layers
  1308.   #--------------------------------------------------------------------------
  1309.   def animate_layers
  1310.     update_layer_frames
  1311.     process_layer_animations
  1312.   end
  1313.  
  1314.   #--------------------------------------------------------------------------
  1315.   # * Play Intro Movie
  1316.   #--------------------------------------------------------------------------
  1317.   def play_intro_movie(movie_name)
  1318.     Graphics.play_movie('Movies/' + movie_name) unless movie_name.empty?
  1319.   end
  1320.  
  1321.   #--------------------------------------------------------------------------
  1322.   # * Play Title Screen Music
  1323.   #--------------------------------------------------------------------------
  1324.   def play_title_music
  1325.     play_title_background_music(BGM[0], BGM[1], BGM[2])
  1326.     play_title_background_se(BGS[0], BGS[1], BGS[2])
  1327.   end
  1328.  
  1329.   #--------------------------------------------------------------------------
  1330.   # * Play Title Screen Music
  1331.   #--------------------------------------------------------------------------
  1332.   def play_title_background_music(bgm, volume, pitch)
  1333.     RPG::BGM.new(bgm, volume, pitch).play
  1334.   end
  1335.  
  1336.   #--------------------------------------------------------------------------
  1337.   # * Play Title Screen Music
  1338.   #--------------------------------------------------------------------------
  1339.   def play_title_background_se(se, volume, pitch)
  1340.     RPG::BGS.new(se, volume, pitch).play
  1341.   end
  1342.  
  1343.   #--------------------------------------------------------------------------
  1344.   # * [New Game] Command
  1345.   #--------------------------------------------------------------------------
  1346.   def command_new_game
  1347.     DataManager.setup_new_game
  1348.     close_command_window
  1349.     fadeout_all
  1350.     play_intro_movie(Movie_Name) if Play_Splash_Movie && Play_On_New_Game
  1351.     $game_map.autoplay
  1352.     SceneManager.goto(Scene_Map)
  1353.   end
  1354.  
  1355.   #--------------------------------------------------------------------------
  1356.   # * Command Update
  1357.   #--------------------------------------------------------------------------
  1358.   def command_update
  1359.     if @command_timer >= Command_Window_Activate_Time
  1360.       @command_window.activate
  1361.       @active = true
  1362.     end
  1363.   end
  1364.  
  1365.   #--------------------------------------------------------------------------
  1366.   # * Aliasing Method: Update Processing
  1367.   #--------------------------------------------------------------------------
  1368.   alias :u546131651321 :update
  1369.  
  1370.   #--------------------------------------------------------------------------
  1371.   # * Update Processing
  1372.   #--------------------------------------------------------------------------
  1373.   def update
  1374.     command_update if Command_Window_Activate_Time > 0 && @active == false
  1375.     animate_layers if @layers
  1376.     u546131651321()
  1377.   end
  1378.  
  1379.   #--------------------------------------------------------------------------
  1380.   # * Aliasing Method: Close Command Window
  1381.   #--------------------------------------------------------------------------
  1382.   alias :clcw546345313131 :close_command_window
  1383.  
  1384.   #--------------------------------------------------------------------------
  1385.   # * Close Command Window
  1386.   #--------------------------------------------------------------------------
  1387.   def close_command_window
  1388.     clcw546345313131()
  1389.     $title = false
  1390.   end
  1391.  
  1392. end #<--- End Class============================================================
Advertisement
Add Comment
Please, Sign In to add comment