Advertisement
diamondandplatinum3

Sound Test Scene ~ Tutorial Version ~ RGSS3

Jun 18th, 2013
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 55.44 KB | None | 0 0
  1. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  2. #             Sound Test Scene ~ Customisable Version
  3. #             Version: 1.0
  4. #             Author: DiamondandPlatinum3
  5. #             Date: June 18, 2013
  6. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  7. #  Description:
  8. #
  9. #    This script creates a new scene in your menu which allows you to listen to
  10. #    music that is played in your game. It also allows for some customisation to
  11. #    be made when playing a sound, such as modifying Volume, Pitch and/or Position.
  12. #    Music can also be locked until a certain Event Switch is turned on.
  13. #
  14. #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. #------------------------------------------------------------------------------
  16. #  Instructions:
  17. #
  18. #  ~  Go into the Script and Modify the Editable Region as Needed
  19. #
  20. #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  21. module DiamondandPlatinum3
  22.   module SoundTestScene
  23.     #=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  24.     #                                                        -=
  25.     #                 Editable Region        ////            ==
  26.     #                                                        =-
  27.     #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  28.    
  29.     # The Text that is displayed for the Option in the Menu
  30.     MenuCommandText = "Sound Test"
  31.    
  32.     # Text to be displayed on the help window when Selecting a Sound
  33.     SoundSelectHelpWindowTextLine1      = "Select a Sound"
  34.     SoundSelectHelpWindowTextLine2      = "Press 'Esc or X' to Exit"
  35.    
  36.     # Text to be displayed on the help window when Hovering over the 'Play Sound' Option
  37.     PlaySoundOptionHelpWindowTextLine1  = "Select To Play Sound"
  38.     PlaySoundOptionHelpWindowTextLine2  = "(Default Settings)"
  39.    
  40.     # Text to be displayed on the help window when Hovering over the 'Volume' Option
  41.     VolumeOptionHelpWindowTextLine1     = "Select To Play Sound"
  42.     VolumeOptionHelpWindowTextLine2     = "(At Specific Volume)"
  43.    
  44.     # Text to be displayed on the help window when Hovering over the 'Pitch' Option
  45.     PitchOptionHelpWindowTextLine1      = "Select To Play Sound"
  46.     PitchOptionHelpWindowTextLine2      = "(At Specific Pitch)"
  47.    
  48.     # Text to be displayed on the help window when Hovering over the 'Position' Option
  49.     PositionOptionHelpWindowTextLine1   = "Select To Play Sound At Specific Position"
  50.     PositionOptionHelpWindowTextLine2   = "(Only works for WAV & OGG Files)"
  51.    
  52.     # Text to be displayed on the help window when inputting a value in the NuberInput Window
  53.     NumberInputHelpWindowTextLine1      = "Input A Value"
  54.     NumberInputHelpWindowTextLine2      = ""
  55.    
  56.    
  57.     # Filename of background Image to be displayed when using the scene (Located in Pictures Folder)
  58.     BackgroundSpriteFilename            = "SoundTest_BackgroundImage"
  59.    
  60.    
  61.    
  62.     #--------------------------------------
  63.     Sounds = { # <=   Do Not Touch
  64.     #--------------------------------------
  65.    
  66.    
  67.     # Exact Filename of BGM you want to Have in the Scene
  68.       "Airship" =>
  69.       {
  70.         :display_name       => "Airship Theme",               # Display Name of Sound
  71.         :default_volume     =>  100,                          # Deault Volume
  72.         :default_pitch      =>  100,                          # Default Pitch
  73.         :conditional_switch =>  0,                            # Conditional Switch (Must be on before sound will be available, unless event switch is Zero)
  74.         :info_line1         =>  "Author: Enterbrain",         # Info Line1, can be anything you want to say about the Individual Sound
  75.         :info_line2         =>  "Used As: Airship Theme",     # Info Line2, can be anything you want to say about the Individual Sound
  76.         :info_line3         =>  "",                           # Info Line3, can be anything you want to say about the Individual Sound
  77.         :info_line4         =>  "From: RPG Maker VX Ace RTP", # Info Line4, can be anything you want to say about the Individual Sound
  78.       },
  79.      
  80.      
  81.       # Rinse, Repeat. Keep Doing this until all your desired SoundFiles are Available to be played
  82.       "Battle1" =>
  83.       {
  84.         :display_name       => "Battle Theme 1",    
  85.         :default_volume     =>  100,                
  86.         :default_pitch      =>  100,                
  87.         :conditional_switch =>  0,                  
  88.         :info_line1         =>  "Author: Enterbrain",                
  89.         :info_line2         =>  "Used As: Normal Battle Theme",                
  90.         :info_line3         =>  "",                
  91.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  92.       },
  93.      
  94.      
  95.       "Battle2" =>
  96.       {
  97.         :display_name       => "Battle Theme 2",    
  98.         :default_volume     =>  100,                
  99.         :default_pitch      =>  100,                
  100.         :conditional_switch =>  0,                  
  101.         :info_line1         =>  "Author: Enterbrain",                
  102.         :info_line2         =>  "Used As: Normal Battle Theme",                
  103.         :info_line3         =>  "",                
  104.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  105.       },
  106.      
  107.      
  108.       "Battle3" =>
  109.       {
  110.         :display_name       => "Battle Theme 3",    
  111.         :default_volume     =>  100,                
  112.         :default_pitch      =>  100,                
  113.         :conditional_switch =>  0,                  
  114.         :info_line1         =>  "Author: Enterbrain",                
  115.         :info_line2         =>  "Used As: Mini-Boss Battle Theme",                
  116.         :info_line3         =>  "",                
  117.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  118.       },
  119.      
  120.      
  121.       "Battle4" =>
  122.       {
  123.         :display_name       => "Battle Theme 4",    
  124.         :default_volume     =>  100,                
  125.         :default_pitch      =>  100,                
  126.         :conditional_switch =>  0,                  
  127.         :info_line1         =>  "Author: Enterbrain",                
  128.         :info_line2         =>  "Used As: Normal Battle Theme",                
  129.         :info_line3         =>  "",                
  130.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  131.       },
  132.      
  133.      
  134.       "Battle5" =>
  135.       {
  136.         :display_name       => "Battle Theme 5",    
  137.         :default_volume     =>  100,                
  138.         :default_pitch      =>  100,                
  139.         :conditional_switch =>  0,                  
  140.         :info_line1         =>  "Author: Enterbrain",                
  141.         :info_line2         =>  "Used As: Normal Battle Theme",                
  142.         :info_line3         =>  "",                
  143.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  144.       },
  145.      
  146.      
  147.       "Battle6" =>
  148.       {
  149.         :display_name       => "Battle Theme 6",    
  150.         :default_volume     =>  100,                
  151.         :default_pitch      =>  100,                
  152.         :conditional_switch =>  0,                  
  153.         :info_line1         =>  "Author: Enterbrain",                
  154.         :info_line2         =>  "Used As: Normal Battle Theme",                
  155.         :info_line3         =>  "",                
  156.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  157.       },
  158.      
  159.      
  160.       "Battle7" =>
  161.       {
  162.         :display_name       => "Battle Theme 7",    
  163.         :default_volume     =>  100,                
  164.         :default_pitch      =>  100,                
  165.         :conditional_switch =>  0,                  
  166.         :info_line1         =>  "Author: Enterbrain",                
  167.         :info_line2         =>  "Used As: Normal Battle Theme",                
  168.         :info_line3         =>  "",                
  169.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  170.       },
  171.      
  172.      
  173.       "Battle8" =>
  174.       {
  175.         :display_name       => "Battle Theme 8",    
  176.         :default_volume     =>  100,                
  177.         :default_pitch      =>  100,                
  178.         :conditional_switch =>  0,                  
  179.         :info_line1         =>  "Author: Enterbrain",                
  180.         :info_line2         =>  "Used As: Boss Battle Theme",                
  181.         :info_line3         =>  "",                
  182.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  183.       },
  184.      
  185.      
  186.       "Battle9" =>
  187.       {
  188.         :display_name       => "Battle Theme 9",    
  189.         :default_volume     =>  100,                
  190.         :default_pitch      =>  100,                
  191.         :conditional_switch =>  0,                  
  192.         :info_line1         =>  "Author: Enterbrain",                
  193.         :info_line2         =>  "Used As: Final Boss Battle Theme",                
  194.         :info_line3         =>  "",                
  195.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  196.       },
  197.      
  198.      
  199.       "Dungeon1" =>
  200.       {
  201.         :display_name       => "Dungeon Theme 1",    
  202.         :default_volume     =>  100,                
  203.         :default_pitch      =>  100,                
  204.         :conditional_switch =>  0,                  
  205.         :info_line1         =>  "Author: Enterbrain",                
  206.         :info_line2         =>  "Used As: BootCamp Cave Theme",                
  207.         :info_line3         =>  "",                
  208.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  209.       },
  210.      
  211.      
  212.       "Dungeon2" =>
  213.       {
  214.         :display_name       => "Dungeon Theme 2",    
  215.         :default_volume     =>  100,                
  216.         :default_pitch      =>  100,                
  217.         :conditional_switch =>  0,                  
  218.         :info_line1         =>  "Author: Enterbrain",                
  219.         :info_line2         =>  "Used As: Heavy Rain Theme",                
  220.         :info_line3         =>  "",                
  221.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  222.       },
  223.      
  224.      
  225.       "Dungeon3" =>
  226.       {
  227.         :display_name       => "Dungeon Theme 3",    
  228.         :default_volume     =>  100,                
  229.         :default_pitch      =>  100,                
  230.         :conditional_switch =>  0,                  
  231.         :info_line1         =>  "Author: Enterbrain",                
  232.         :info_line2         =>  "Used As: Underground Base Theme",                
  233.         :info_line3         =>  "",                
  234.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  235.       },
  236.      
  237.      
  238.       "Dungeon4" =>
  239.       {
  240.         :display_name       => "Dungeon Theme 4",    
  241.         :default_volume     =>  100,                
  242.         :default_pitch      =>  100,                
  243.         :conditional_switch =>  0,                  
  244.         :info_line1         =>  "Author: Enterbrain",                
  245.         :info_line2         =>  "Used As: Thought Before War Theme",                
  246.         :info_line3         =>  "",                
  247.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  248.       },
  249.      
  250.      
  251.       "Dungeon5" =>
  252.       {
  253.         :display_name       => "Dungeon Theme 5",    
  254.         :default_volume     =>  100,                
  255.         :default_pitch      =>  100,                
  256.         :conditional_switch =>  0,                  
  257.         :info_line1         =>  "Author: Enterbrain",                
  258.         :info_line2         =>  "Used As: Magical Cavern Theme",                
  259.         :info_line3         =>  "",                
  260.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  261.       },
  262.      
  263.      
  264.       "Dungeon6" =>
  265.       {
  266.         :display_name       => "Dungeon Theme 6",    
  267.         :default_volume     =>  100,                
  268.         :default_pitch      =>  100,                
  269.         :conditional_switch =>  0,                  
  270.         :info_line1         =>  "Author: Enterbrain",                
  271.         :info_line2         =>  "Used As: Following a Trail Theme",                
  272.         :info_line3         =>  "",                
  273.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  274.       },
  275.      
  276.      
  277.       "Dungeon7" =>
  278.       {
  279.         :display_name       => "Dungeon Theme 7",    
  280.         :default_volume     =>  100,                
  281.         :default_pitch      =>  100,                
  282.         :conditional_switch =>  0,                  
  283.         :info_line1         =>  "Author: Enterbrain",                
  284.         :info_line2         =>  "Used As: Climbing the Heavens Theme",                
  285.         :info_line3         =>  "",                
  286.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  287.       },
  288.      
  289.      
  290.       "Dungeon8" =>
  291.       {
  292.         :display_name       => "Dungeon Theme 8",    
  293.         :default_volume     =>  100,                
  294.         :default_pitch      =>  100,                
  295.         :conditional_switch =>  0,                  
  296.         :info_line1         =>  "Author: Enterbrain",                
  297.         :info_line2         =>  "Used As: Descending to the Ground Theme",                
  298.         :info_line3         =>  "",                
  299.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  300.       },
  301.      
  302.      
  303.       "Dungeon9" =>
  304.       {
  305.         :display_name       => "Dungeon Theme 9",    
  306.         :default_volume     =>  100,                
  307.         :default_pitch      =>  100,                
  308.         :conditional_switch =>  0,                  
  309.         :info_line1         =>  "Author: Enterbrain",                
  310.         :info_line2         =>  "Used As: Last Dungeon Theme",                
  311.         :info_line3         =>  "",                
  312.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  313.       },
  314.      
  315.      
  316.       "Field1" =>
  317.       {
  318.         :display_name       => "Field Map Theme 1",    
  319.         :default_volume     =>  100,                
  320.         :default_pitch      =>  100,                
  321.         :conditional_switch =>  0,                  
  322.         :info_line1         =>  "Author: Enterbrain",                
  323.         :info_line2         =>  "Used As: Starting Your Journey Theme",                
  324.         :info_line3         =>  "",                
  325.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  326.       },
  327.      
  328.      
  329.       "Field2" =>
  330.       {
  331.         :display_name       => "Field Map Theme 2",    
  332.         :default_volume     =>  100,                
  333.         :default_pitch      =>  100,                
  334.         :conditional_switch =>  0,                  
  335.         :info_line1         =>  "Author: Enterbrain",                
  336.         :info_line2         =>  "Used As: World Map Theme",                
  337.         :info_line3         =>  "",                
  338.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  339.       },
  340.      
  341.      
  342.       "Field3" =>
  343.       {
  344.         :display_name       => "Field Map Theme 3",    
  345.         :default_volume     =>  100,                
  346.         :default_pitch      =>  100,                
  347.         :conditional_switch =>  0,                  
  348.         :info_line1         =>  "Author: Enterbrain",                
  349.         :info_line2         =>  "Used As: The Heroes of this Tale Theme",                
  350.         :info_line3         =>  "",                
  351.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  352.       },
  353.      
  354.      
  355.       "Field4" =>
  356.       {
  357.         :display_name       => "Field Map Theme 4",    
  358.         :default_volume     =>  100,                
  359.         :default_pitch      =>  100,                
  360.         :conditional_switch =>  0,                  
  361.         :info_line1         =>  "Author: Enterbrain",                
  362.         :info_line2         =>  "Used As: A World in Chaos Theme",                
  363.         :info_line3         =>  "",                
  364.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  365.       },
  366.      
  367.      
  368.       "Scene1" =>
  369.       {
  370.         :display_name       => "Custom Scene Theme 1",    
  371.         :default_volume     =>  100,                
  372.         :default_pitch      =>  100,                
  373.         :conditional_switch =>  0,                  
  374.         :info_line1         =>  "Author: Enterbrain",                
  375.         :info_line2         =>  "Used As: In Danger Theme",                
  376.         :info_line3         =>  "",                
  377.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  378.       },
  379.      
  380.      
  381.       "Scene2" =>
  382.       {
  383.         :display_name       => "Custom Scene Theme 2",    
  384.         :default_volume     =>  100,                
  385.         :default_pitch      =>  100,                
  386.         :conditional_switch =>  0,                  
  387.         :info_line1         =>  "Author: Enterbrain",                
  388.         :info_line2         =>  "Used As: Villain Appears Theme",                
  389.         :info_line3         =>  "",                
  390.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  391.       },
  392.      
  393.      
  394.       "Scene3" =>
  395.       {
  396.         :display_name       => "Custom Scene Theme 3",    
  397.         :default_volume     =>  100,                
  398.         :default_pitch      =>  100,                
  399.         :conditional_switch =>  0,                  
  400.         :info_line1         =>  "Author: Enterbrain",                
  401.         :info_line2         =>  "Used As: Villain Two Appears Theme",                
  402.         :info_line3         =>  "",                
  403.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  404.       },
  405.      
  406.      
  407.       "Scene4" =>
  408.       {
  409.         :display_name       => "Custom Scene Theme 4",    
  410.         :default_volume     =>  100,                
  411.         :default_pitch      =>  100,                
  412.         :conditional_switch =>  0,                  
  413.         :info_line1         =>  "Author: Enterbrain",                
  414.         :info_line2         =>  "Used As: Found a New Friend Theme",                
  415.         :info_line3         =>  "",                
  416.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  417.       },
  418.      
  419.      
  420.       "Scene5" =>
  421.       {
  422.         :display_name       => "Custom Scene Theme 5",    
  423.         :default_volume     =>  100,                
  424.         :default_pitch      =>  100,                
  425.         :conditional_switch =>  0,                  
  426.         :info_line1         =>  "Author: Enterbrain",                
  427.         :info_line2         =>  "Used As: HeartWarming Discussion Theme",                
  428.         :info_line3         =>  "",                
  429.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  430.       },
  431.      
  432.      
  433.       "Scene6" =>
  434.       {
  435.         :display_name       => "Custom Scene Theme 6",    
  436.         :default_volume     =>  100,                
  437.         :default_pitch      =>  100,                
  438.         :conditional_switch =>  0,                  
  439.         :info_line1         =>  "Author: Enterbrain",                
  440.         :info_line2         =>  "Used As: Happiness Theme",                
  441.         :info_line3         =>  "",                
  442.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  443.       },
  444.      
  445.      
  446.       "Ship" =>
  447.       {
  448.         :display_name       => "Ship Theme",    
  449.         :default_volume     =>  100,                
  450.         :default_pitch      =>  100,                
  451.         :conditional_switch =>  0,                  
  452.         :info_line1         =>  "Author: Enterbrain",                
  453.         :info_line2         =>  "Used As: Riding in a Ship Theme",                
  454.         :info_line3         =>  "",                
  455.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  456.       },
  457.      
  458.      
  459.       "Theme1" =>
  460.       {
  461.         :display_name       => "Custom Theme 1",    
  462.         :default_volume     =>  100,                
  463.         :default_pitch      =>  100,                
  464.         :conditional_switch =>  0,                  
  465.         :info_line1         =>  "Author: Enterbrain",                
  466.         :info_line2         =>  "Used As: We are a Team Theme",                
  467.         :info_line3         =>  "",                
  468.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  469.       },
  470.      
  471.      
  472.       "Theme2" =>
  473.       {
  474.         :display_name       => "Custom Theme 2",    
  475.         :default_volume     =>  100,                
  476.         :default_pitch      =>  100,                
  477.         :conditional_switch =>  0,                  
  478.         :info_line1         =>  "Author: Enterbrain",                
  479.         :info_line2         =>  "Used As: Fallen Heroes Theme",                
  480.         :info_line3         =>  "",                
  481.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  482.       },
  483.      
  484.      
  485.       "Theme3" =>
  486.       {
  487.         :display_name       => "Custom Theme 3",    
  488.         :default_volume     =>  100,                
  489.         :default_pitch      =>  100,                
  490.         :conditional_switch =>  0,                  
  491.         :info_line1         =>  "Author: Enterbrain",                
  492.         :info_line2         =>  "Used As: Art Museum Theme",                
  493.         :info_line3         =>  "",                
  494.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  495.       },
  496.      
  497.      
  498.       "Theme4" =>
  499.       {
  500.         :display_name       => "Custom Theme 4",    
  501.         :default_volume     =>  100,                
  502.         :default_pitch      =>  100,                
  503.         :conditional_switch =>  0,                  
  504.         :info_line1         =>  "Author: Enterbrain",                
  505.         :info_line2         =>  "Used As: Ending Credits Theme",                
  506.         :info_line3         =>  "",                
  507.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  508.       },
  509.      
  510.      
  511.       "Theme5" =>
  512.       {
  513.         :display_name       => "Custom Theme 1",    
  514.         :default_volume     =>  100,                
  515.         :default_pitch      =>  100,                
  516.         :conditional_switch =>  0,                  
  517.         :info_line1         =>  "Author: Enterbrain",                
  518.         :info_line2         =>  "Used As: Supporters Theme",                
  519.         :info_line3         =>  "",                
  520.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  521.       },
  522.      
  523.      
  524.       "Town1" =>
  525.       {
  526.         :display_name       => "Town Theme 1",    
  527.         :default_volume     =>  100,                
  528.         :default_pitch      =>  100,                
  529.         :conditional_switch =>  0,                  
  530.         :info_line1         =>  "Author: Enterbrain",                
  531.         :info_line2         =>  "Used As: Hero's Home Town Theme",                
  532.         :info_line3         =>  "",                
  533.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  534.       },
  535.      
  536.      
  537.       "Town2" =>
  538.       {
  539.         :display_name       => "Town Theme 2",    
  540.         :default_volume     =>  100,                
  541.         :default_pitch      =>  100,                
  542.         :conditional_switch =>  0,                  
  543.         :info_line1         =>  "Author: Enterbrain",                
  544.         :info_line2         =>  "Used As: Capital City Theme",                
  545.         :info_line3         =>  "",                
  546.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  547.       },
  548.      
  549.      
  550.       "Town3" =>
  551.       {
  552.         :display_name       => "Town Theme 3",    
  553.         :default_volume     =>  100,                
  554.         :default_pitch      =>  100,                
  555.         :conditional_switch =>  0,                  
  556.         :info_line1         =>  "Author: Enterbrain",                
  557.         :info_line2         =>  "Used As: Scummy Area of Town Theme",                
  558.         :info_line3         =>  "",                
  559.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  560.       },
  561.      
  562.      
  563.       "Town4" =>
  564.       {
  565.         :display_name       => "Town Theme 4",    
  566.         :default_volume     =>  100,                
  567.         :default_pitch      =>  100,                
  568.         :conditional_switch =>  0,                  
  569.         :info_line1         =>  "Author: Enterbrain",                
  570.         :info_line2         =>  "Used As: Elderly Village Theme",                
  571.         :info_line3         =>  "",                
  572.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  573.       },
  574.      
  575.      
  576.       "Town5" =>
  577.       {
  578.         :display_name       => "Town Theme 5",    
  579.         :default_volume     =>  100,                
  580.         :default_pitch      =>  100,                
  581.         :conditional_switch =>  0,                  
  582.         :info_line1         =>  "Author: Enterbrain",                
  583.         :info_line2         =>  "Used As: Peaceful Village Theme",                
  584.         :info_line3         =>  "",                
  585.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  586.       },
  587.      
  588.      
  589.       "Town6" =>
  590.       {
  591.         :display_name       => "Town Theme 6",    
  592.         :default_volume     =>  100,                
  593.         :default_pitch      =>  100,                
  594.         :conditional_switch =>  0,                  
  595.         :info_line1         =>  "Author: Enterbrain",                
  596.         :info_line2         =>  "Used As: A Town for Adventurer's Theme",                
  597.         :info_line3         =>  "",                
  598.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  599.       },
  600.      
  601.      
  602.       "Town7" =>
  603.       {
  604.         :display_name       => "Town Theme 7",    
  605.         :default_volume     =>  100,                
  606.         :default_pitch      =>  100,                
  607.         :conditional_switch =>  0,                  
  608.         :info_line1         =>  "Author: Enterbrain",                
  609.         :info_line2         =>  "Used As: Mermaid Village Theme",                
  610.         :info_line3         =>  "",                
  611.         :info_line4         =>  "From: RPG Maker VX Ace RTP",
  612.       },
  613.      
  614.      
  615.      
  616.     # If you want to add more Sounds, you may do so above this Line, just
  617.     # copy-paste the above format and change things as needed.
  618.     #///////////////////////
  619.    
  620.    
  621.     #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  622.     #                                           \/
  623.     #               End of Editable Region      /\
  624.     #                                           \/
  625.     #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
  626.     #---------------------------------------------------------
  627.     # No touchie past here unless you know what you are
  628.     # doing. Failure to heed this warning could cause your
  629.     # computer to yell and scream at you.
  630.     #
  631.     # Edit at your own risk.
  632.     #--------------------------------------------------------
  633.     }
  634.   end
  635. end
  636.  
  637.  
  638.  
  639.  
  640. #==============================================================================
  641. # ** SoundTestSound
  642. #------------------------------------------------------------------------------
  643. #  This is a class which hold Individual Sound Information for Play
  644. #==============================================================================
  645.  
  646. class SoundTestSound
  647.   include DiamondandPlatinum3::SoundTestScene
  648.   #--------------------------------------------------------------------------
  649.   # * Public Instance Variables
  650.   #--------------------------------------------------------------------------
  651.   attr_accessor :name
  652.   attr_accessor :volume
  653.   attr_accessor :pitch
  654.   #--------------------------------------------------------------------------
  655.   # * Intialize
  656.   #--------------------------------------------------------------------------
  657.   def initialize( name, volume, pitch )
  658.     @name   = name
  659.     @volume = volume
  660.     @pitch  = pitch    
  661.   end
  662.   #--------------------------------------------------------------------------
  663.   # * Play Sound
  664.   #--------------------------------------------------------------------------
  665.   def play()
  666.     RPG::BGM.stop()
  667.     RPG::BGM.new( name, volume, pitch ).play
  668.   end
  669.   #--------------------------------------------------------------------------
  670.   # * Play Sound at Position
  671.   #--------------------------------------------------------------------------
  672.   def play_at_position( position )
  673.     RPG::BGM.stop()
  674.     RPG::BGM.new( name, volume, pitch ).play( position )
  675.   end
  676.   #--------------------------------------------------------------------------
  677.   # * Play Sound ( Default )
  678.   #--------------------------------------------------------------------------
  679.   def default_play()
  680.     RPG::BGM.stop()
  681.     RPG::BGM.new( name, Sounds[name][:default_volume], Sounds[name][:default_pitch] ).play
  682.   end
  683. end
  684.  
  685.  
  686.  
  687.  
  688.  
  689. #==============================================================================
  690. # ** Scene_SoundTest
  691. #------------------------------------------------------------------------------
  692. #  This Clas Holds the Scene Information for the SoundTest
  693. #==============================================================================
  694.  
  695. class Scene_SoundTest < Scene_Base
  696.   include DiamondandPlatinum3::SoundTestScene
  697.   #--------------------------------------------------------------------------
  698.   # * Start Processing
  699.   #--------------------------------------------------------------------------
  700.   def start
  701.     super()
  702.    
  703.     save_current_bgm()
  704.     create_background_image()
  705.     create_soundtestfiles_array()
  706.     create_command_windows()
  707.     create_help_window()
  708.     create_soundinfo_window()
  709.     create_numberinput_window()
  710.     set_input_variables()
  711.     setup_scene_intro_animation()
  712.     # Current Selected Sound
  713.     @current_sound_symbol = nil
  714.   end
  715.   #--------------------------------------------------------------------------
  716.   # * Post-Start Processing
  717.   #--------------------------------------------------------------------------
  718.   def post_start
  719.     super()
  720.     animate_intro_scene()
  721.   end  
  722.   #--------------------------------------------------------------------------
  723.   # * Frame Update
  724.   #--------------------------------------------------------------------------
  725.   def update
  726.     super()
  727.    
  728.     update_window_info_text()
  729.     update_help_text()
  730.     update_scene_changes()
  731.     update_user_input()
  732.   end
  733.   #--------------------------------------------------------------------------
  734.   # * Pre-Termination Processing
  735.   #--------------------------------------------------------------------------
  736.   def pre_terminate
  737.     super()
  738.    
  739.     @current_map_bgm.replay()
  740.   end
  741.   #--------------------------------------------------------------------------
  742.   # * Termination Processing
  743.   #--------------------------------------------------------------------------
  744.   def terminate
  745.     @sound_select_cmmdwindow.dispose()  unless @sound_select_cmmdwindow.disposed?
  746.     @sound_play_cmmdwindow.dispose()    unless @sound_play_cmmdwindow.disposed?
  747.     @help_window.dispose()              unless @help_window.disposed?
  748.     @sound_info_window.dispose()        unless @sound_info_window.disposed?
  749.     @numberinput_window.dispose()       unless @numberinput_window.disposed?
  750.    
  751.     unless @background_image.disposed?
  752.       @background_image.bitmap.dispose()
  753.       @background_image.dispose()
  754.     end
  755.    
  756.     super()
  757.   end  
  758.   #--------------------------------------------------------------------------
  759.   # * Save Current BGM
  760.   #--------------------------------------------------------------------------
  761.   def save_current_bgm()
  762.     # Get Current BGM
  763.     @current_map_bgm = RPG::BGM.last
  764.     RPG::BGM.stop()
  765.   end
  766.   #--------------------------------------------------------------------------
  767.   # * Create Background Image
  768.   #--------------------------------------------------------------------------
  769.   def create_background_image()
  770.     @background_image = Sprite.new()
  771.     @background_image.bitmap = Cache.picture(BackgroundSpriteFilename)
  772.     @background_image.x = 0
  773.     @background_image.y = 0
  774.     @background_image.z = 1
  775.     @background_image.zoom_x = (Graphics.width.to_f / @background_image.bitmap.width)
  776.     @background_image.zoom_y = (Graphics.height.to_f / @background_image.bitmap.height)
  777.   end
  778.   #--------------------------------------------------------------------------
  779.   # * Create SoundTest Files Array
  780.   #--------------------------------------------------------------------------
  781.   def create_soundtestfiles_array()
  782.     @soundfiles_hash = {}
  783.     Sounds.each_key do |key_name|
  784.       @soundfiles_hash[ key_name ] = SoundTestSound.new( key_name, Sounds[key_name][:default_volume], Sounds[key_name][:default_pitch] )
  785.     end
  786.   end
  787.   #--------------------------------------------------------------------------
  788.   # * Create Command Windows
  789.   #--------------------------------------------------------------------------
  790.   def create_command_windows()
  791.     # Setting Up Command Window for Sounds
  792.     command_window_ypos = 72
  793.     @sound_select_cmmdwindow = Window_SoundTest_SoundCommand.new(0, command_window_ypos)
  794.     @sound_select_cmmdwindow.height = Graphics.height - command_window_ypos
  795.     set_soundcommand_window_handlers()
  796.    
  797.     # Setting Up Command Window for Play Sound
  798.     @sound_play_cmmdwindow = Window_SoundTest_PlayCommand.new(Graphics.width * 0.5, command_window_ypos)
  799.     @sound_play_cmmdwindow.deactivate()
  800.     set_soundplay_window_handlers()
  801.   end
  802.   #--------------------------------------------------------------------------
  803.   # * Set Command Handlers
  804.   #--------------------------------------------------------------------------
  805.   def set_soundcommand_window_handlers
  806.     Sounds.each_key do |key_name|
  807.       @sound_select_cmmdwindow.set_handler(key_name.to_sym, method(:deactivate_soundcommand_window))
  808.     end
  809.   end
  810.   #--------------------------------------------------------------------------
  811.   # * Set SoundPlay Handlers
  812.   #--------------------------------------------------------------------------
  813.   def set_soundplay_window_handlers
  814.     @sound_play_cmmdwindow.set_handler(:play_sound, method(:playsound_command))
  815.     @sound_play_cmmdwindow.set_handler(:volume,     method(:playsound_at_volume))
  816.     @sound_play_cmmdwindow.set_handler(:pitch,      method(:playsound_at_pitch))
  817.     @sound_play_cmmdwindow.set_handler(:position,   method(:playsound_at_position))
  818.   end
  819.   #--------------------------------------------------------------------------
  820.   # * Create Help Window
  821.   #--------------------------------------------------------------------------
  822.   def create_help_window()
  823.     # Setting up Help Window
  824.     @help_window = Window_Help.new()
  825.     @help_window.set_text(SoundSelectHelpWindowTextLine1 + "\n" + SoundSelectHelpWindowTextLine2)
  826.   end
  827.   #--------------------------------------------------------------------------
  828.   # * Create SoundInfo Window
  829.   #--------------------------------------------------------------------------
  830.   def create_soundinfo_window()
  831.     # Setting up Sound Info Window
  832.     @sound_info_window = Window_SoundInfo.new()
  833.     @sound_info_window.x = Graphics.width * 0.5
  834.     @sound_info_window.y = 192
  835.     @sound_info_window.openness = 255
  836.   end
  837.   #--------------------------------------------------------------------------
  838.   # * Create NumberInput Window
  839.   #--------------------------------------------------------------------------
  840.   def create_numberinput_window()
  841.     # Setting Up Number Input
  842.     @numberinput_window = Window_SoundTest_NumberInput.new()
  843.     @numberinput_window.z = 200
  844.   end
  845.   #--------------------------------------------------------------------------
  846.   # * Set Input Variables
  847.   #--------------------------------------------------------------------------
  848.   def set_input_variables()
  849.     @user_currently_inputting_value     = false
  850.     @currently_entering_volume_value    = false
  851.     @currently_entering_pitch_value     = false
  852.     @currently_entering_position_value  = false
  853.   end
  854.   #--------------------------------------------------------------------------
  855.   # * Setup Scene Intro Animation
  856.   #--------------------------------------------------------------------------
  857.   def setup_scene_intro_animation()
  858.     @background_image.opacity    = 0
  859.     @sound_select_cmmdwindow.x  -= 500
  860.     @sound_play_cmmdwindow.x    += 500
  861.     @help_window.y              -= 400
  862.     @sound_info_window.y        += 300
  863.   end
  864.   #--------------------------------------------------------------------------
  865.   # * Animate Intro Sequence
  866.   #--------------------------------------------------------------------------
  867.   def animate_intro_scene()
  868.     while( true )
  869.       bool1 = animate_sceneintro_background_image()
  870.       bool2 = animate_sceneintro_soundselectcmmdwindow()
  871.       bool3 = animate_sceneintro_soundplaycmmdwindow()
  872.       bool4 = animate_sceneintro_helpwindow()
  873.       bool5 = animate_sceneintro_soundinfowindow()
  874.       Graphics.update()
  875.       break if bool1 && bool2 && bool3 && bool4 && bool5
  876.     end
  877.   end
  878.   #--------------------------------------------------------------------------
  879.   # * Animate BackgroundImage Opacity for Intro Sequence
  880.   #--------------------------------------------------------------------------
  881.   def animate_sceneintro_background_image()
  882.     return true if @background_image.opacity == 255
  883.     @background_image.opacity += 5
  884.     return @background_image.opacity == 255
  885.   end
  886.   #--------------------------------------------------------------------------
  887.   # * Animate SoundSelectCommand Window for Intro Sequence
  888.   #--------------------------------------------------------------------------
  889.   def animate_sceneintro_soundselectcmmdwindow()
  890.     return true if @sound_select_cmmdwindow.x == 0
  891.     @sound_select_cmmdwindow.x += 20
  892.     return @sound_select_cmmdwindow.x == 0
  893.   end
  894.   #--------------------------------------------------------------------------
  895.   # * Animate SoundPlayCommand Window for Intro Sequence
  896.   #--------------------------------------------------------------------------
  897.   def animate_sceneintro_soundplaycmmdwindow()
  898.     return true if @sound_play_cmmdwindow.x == (Graphics.width * 0.5)
  899.     @sound_play_cmmdwindow.x -= 20
  900.     return @sound_play_cmmdwindow.x == (Graphics.width * 0.5)
  901.   end
  902.   #--------------------------------------------------------------------------
  903.   # * Animate Help Window for Intro Sequence
  904.   #--------------------------------------------------------------------------
  905.   def animate_sceneintro_helpwindow()
  906.     return true if @help_window.y == 0
  907.     @help_window.y += 10
  908.     return @help_window.y == 0
  909.   end
  910.   #--------------------------------------------------------------------------
  911.   # * Animate Sound Info Window
  912.   #--------------------------------------------------------------------------
  913.   def animate_sceneintro_soundinfowindow()
  914.     return true if @sound_info_window.y == 192
  915.     @sound_info_window.y -= 6
  916.     return @sound_info_window.y == 192
  917.   end
  918.   #--------------------------------------------------------------------------
  919.   # * Deactivate Sound Command Windows
  920.   #--------------------------------------------------------------------------
  921.   def deactivate_soundcommand_windows()
  922.     @sound_select_cmmdwindow.deactivate()
  923.     @sound_play_cmmdwindow.deactivate()
  924.   end
  925.   #--------------------------------------------------------------------------
  926.   # * Deactivate Sound Command Window
  927.   #--------------------------------------------------------------------------
  928.   def deactivate_soundcommand_window()
  929.     @sound_select_cmmdwindow.deactivate()
  930.     @sound_play_cmmdwindow.activate()
  931.   end
  932.   #--------------------------------------------------------------------------
  933.   # * Deactivate SoundPlay Command Window
  934.   #--------------------------------------------------------------------------
  935.   def deactivate_soundplaycommand_window()
  936.     @sound_select_cmmdwindow.activate()
  937.     @sound_play_cmmdwindow.deactivate()
  938.   end
  939.   #--------------------------------------------------------------------------
  940.   # * Update Info Window Text
  941.   #--------------------------------------------------------------------------
  942.   def update_window_info_text()
  943.     if @current_sound_symbol != @sound_select_cmmdwindow.current_symbol
  944.       @current_sound_symbol = @sound_select_cmmdwindow.current_symbol
  945.       text  = Sounds[@current_sound_symbol.to_s][:info_line1].gsub("\n", "") + "\n"
  946.       text += Sounds[@current_sound_symbol.to_s][:info_line2].gsub("\n", "") + "\n"
  947.       text += Sounds[@current_sound_symbol.to_s][:info_line3].gsub("\n", "") + "\n"
  948.       text += Sounds[@current_sound_symbol.to_s][:info_line4].gsub("\n", "")
  949.       @sound_info_window.draw_text_soundinfo(text)
  950.     end
  951.   end
  952.   #--------------------------------------------------------------------------
  953.   # * Update Help Text
  954.   #--------------------------------------------------------------------------
  955.   def update_help_text()
  956.     # If SoundSelect Command Window is Active
  957.     if @sound_select_cmmdwindow.active
  958.       @help_window.set_text(SoundSelectHelpWindowTextLine1 + "\n" + SoundSelectHelpWindowTextLine2)
  959.     # If NumberInput Window is Active
  960.     elsif @numberinput_window.active
  961.       @help_window.set_text(NumberInputHelpWindowTextLine1 + "\n" + NumberInputHelpWindowTextLine2)
  962.      # If Hovering Over PlaySound
  963.     elsif @sound_play_cmmdwindow.current_symbol == :play_sound
  964.       @help_window.set_text(PlaySoundOptionHelpWindowTextLine1 + "\n" + PlaySoundOptionHelpWindowTextLine2)
  965.      # If Hovering Over Volume Input
  966.     elsif @sound_play_cmmdwindow.current_symbol == :volume
  967.       @help_window.set_text(VolumeOptionHelpWindowTextLine1 + "\n" + VolumeOptionHelpWindowTextLine2)
  968.      # If Hovering Over Pitch Input
  969.     elsif @sound_play_cmmdwindow.current_symbol == :pitch
  970.       @help_window.set_text(PitchOptionHelpWindowTextLine1 + "\n" + PitchOptionHelpWindowTextLine2)
  971.      # If Hovering Over Position Input
  972.     else
  973.       @help_window.set_text(PositionOptionHelpWindowTextLine1 + "\n" + PositionOptionHelpWindowTextLine2)
  974.     end
  975.   end
  976.   #--------------------------------------------------------------------------
  977.   # * Update Scene Changes
  978.   #--------------------------------------------------------------------------
  979.   def update_scene_changes()
  980.     return_scene()                        if Input.trigger?(:B) && @sound_select_cmmdwindow.active
  981.     deactivate_soundplaycommand_window()  if Input.trigger?(:B) && @sound_play_cmmdwindow.active
  982.   end
  983.   #--------------------------------------------------------------------------
  984.   # * Update User Input
  985.   #--------------------------------------------------------------------------
  986.   def update_user_input()
  987.     if @user_currently_inputting_value && @numberinput_window.completed
  988.       receive_volume_value()    if @currently_entering_volume_value
  989.       receive_pitch_value()     if @currently_entering_pitch_value
  990.       receive_position_value()  if @currently_entering_position_value  
  991.     end
  992.   end
  993.   #--------------------------------------------------------------------------
  994.   # * Play Sound Command
  995.   #--------------------------------------------------------------------------
  996.   def playsound_command()
  997.     @soundfiles_hash[@current_sound_symbol.to_s].default_play()    
  998.     @sound_play_cmmdwindow.activate()
  999.   end
  1000.   #--------------------------------------------------------------------------
  1001.   # * Play Sound 'At Volume' Command
  1002.   #--------------------------------------------------------------------------
  1003.   def playsound_at_volume()
  1004.     deactivate_soundcommand_windows()
  1005.     @user_currently_inputting_value = true
  1006.     @currently_entering_volume_value = true
  1007.     number = @soundfiles_hash[@current_sound_symbol.to_s].volume
  1008.     @numberinput_window.start( number, 3 )
  1009.   end
  1010.   #--------------------------------------------------------------------------
  1011.   # * Play Sound 'At Pitch' Command
  1012.   #--------------------------------------------------------------------------
  1013.   def playsound_at_pitch()
  1014.     deactivate_soundcommand_windows()
  1015.     @user_currently_inputting_value = true
  1016.     @currently_entering_pitch_value = true
  1017.     number = @soundfiles_hash[@current_sound_symbol.to_s].pitch
  1018.     @numberinput_window.start( number, 3 )
  1019.   end
  1020.   #--------------------------------------------------------------------------
  1021.   # * Play Sound 'At Position' Command
  1022.   #--------------------------------------------------------------------------
  1023.   def playsound_at_position()
  1024.     @currently_entering_position_value = true
  1025.     @user_currently_inputting_value = true
  1026.     deactivate_soundcommand_windows()
  1027.     @numberinput_window.start( 0, 9 )
  1028.   end
  1029.   #--------------------------------------------------------------------------
  1030.   # * Receive Volume Value
  1031.   #--------------------------------------------------------------------------
  1032.   def receive_volume_value()
  1033.     if @numberinput_window.processed_ok
  1034.       @soundfiles_hash[@current_sound_symbol.to_s].volume = @numberinput_window.result
  1035.       @soundfiles_hash[@current_sound_symbol.to_s].play()
  1036.     end
  1037.     @sound_play_cmmdwindow.activate()
  1038.     set_input_variables()
  1039.   end
  1040.   #--------------------------------------------------------------------------
  1041.   # * Receive Pitch Value
  1042.   #--------------------------------------------------------------------------
  1043.   def receive_pitch_value()
  1044.     if @numberinput_window.processed_ok
  1045.       @soundfiles_hash[@current_sound_symbol.to_s].pitch = @numberinput_window.result
  1046.       @soundfiles_hash[@current_sound_symbol.to_s].play()
  1047.     end
  1048.     @sound_play_cmmdwindow.activate()
  1049.     set_input_variables()
  1050.   end
  1051.   #--------------------------------------------------------------------------
  1052.   # * Receive Position Value
  1053.   #--------------------------------------------------------------------------
  1054.   def receive_position_value()
  1055.     if @numberinput_window.processed_ok
  1056.       @soundfiles_hash[@current_sound_symbol.to_s].play_at_position( @numberinput_window.result )
  1057.     end
  1058.     @sound_play_cmmdwindow.activate()
  1059.     set_input_variables()
  1060.   end
  1061. end
  1062.  
  1063.  
  1064. #==============================================================================
  1065. # ** Window_MenuCommand
  1066. #------------------------------------------------------------------------------
  1067. #  This command window appears on the menu screen.
  1068. #==============================================================================
  1069.  
  1070. class Window_MenuCommand < Window_Command
  1071.   #--------------------------------------------------------------------------
  1072.   # * Add Exit Game to Command List
  1073.   #--------------------------------------------------------------------------
  1074.   alias dp3_soundtestscene_windowmenucommd_addgameendcmmd_ofa     add_game_end_command
  1075.   #--------------------------------------------------------------------------
  1076.   def add_game_end_command
  1077.     add_command(DiamondandPlatinum3::SoundTestScene::MenuCommandText, :sound_test)
  1078.     dp3_soundtestscene_windowmenucommd_addgameendcmmd_ofa()
  1079.   end
  1080. end
  1081.  
  1082.  
  1083.  
  1084. #==============================================================================
  1085. # ** Scene_Menu
  1086. #------------------------------------------------------------------------------
  1087. #  This class performs the menu screen processing.
  1088. #==============================================================================
  1089.  
  1090. class Scene_Menu < Scene_MenuBase
  1091.   #--------------------------------------------------------------------------
  1092.   # * Create Command Window
  1093.   #--------------------------------------------------------------------------
  1094.   alias dp3_soundtestscene_scenemenu_creatcmmdwind_ofa      create_command_window
  1095.   #--------------------------------------------------------------------------
  1096.   def create_command_window
  1097.     dp3_soundtestscene_scenemenu_creatcmmdwind_ofa() # Call original Method    
  1098.     @command_window.set_handler(:sound_test,    method(:command_soundtest))
  1099.   end
  1100.   #--------------------------------------------------------------------------
  1101.   # * Command Sound Test
  1102.   #--------------------------------------------------------------------------
  1103.   def command_soundtest
  1104.     SceneManager.call(Scene_SoundTest)
  1105.   end
  1106. end
  1107.  
  1108.  
  1109.  
  1110. #==============================================================================
  1111. # ** SoundTest_Command
  1112. #------------------------------------------------------------------------------
  1113. # The Command Window that is used when selecting a sound
  1114. #==============================================================================
  1115.  
  1116. class Window_SoundTest_SoundCommand < Window_Command
  1117.   include DiamondandPlatinum3::SoundTestScene
  1118.   #--------------------------------------------------------------------------
  1119.   # * Get Window Width
  1120.   #--------------------------------------------------------------------------
  1121.   def window_width
  1122.     return Graphics.width * 0.5
  1123.   end
  1124.   #--------------------------------------------------------------------------
  1125.   # * Make Command List
  1126.   #--------------------------------------------------------------------------
  1127.   def make_command_list
  1128.     Sounds.each_key do |key_name|
  1129.       switch_id = Sounds[key_name][:conditional_switch]
  1130.       next unless $game_switches[switch_id] || switch_id == 0
  1131.      
  1132.       add_command(Sounds[key_name][:display_name], key_name.to_sym)
  1133.     end
  1134.   end  
  1135. end
  1136.  
  1137.  
  1138. #==============================================================================
  1139. # ** PlaySound_Command
  1140. #------------------------------------------------------------------------------
  1141. # The Command Window that is used for playing a sound
  1142. #==============================================================================
  1143.  
  1144. class Window_SoundTest_PlayCommand < Window_Command
  1145.   include DiamondandPlatinum3::SoundTestScene
  1146.   #--------------------------------------------------------------------------
  1147.   # * Get Window Width
  1148.   #--------------------------------------------------------------------------
  1149.   def window_width
  1150.     return Graphics.width * 0.5
  1151.   end
  1152.   #--------------------------------------------------------------------------
  1153.   # * Make Command List
  1154.   #--------------------------------------------------------------------------
  1155.   def make_command_list
  1156.     add_command("Play Sound", :play_sound)
  1157.     add_command("Volume",     :volume)
  1158.     add_command("Pitch",      :pitch)
  1159.     add_command("Position",   :position)
  1160.   end  
  1161. end
  1162.  
  1163.  
  1164.  
  1165.  
  1166. #==============================================================================
  1167. # ** Window_SoundInfo
  1168. #------------------------------------------------------------------------------
  1169. #  This message window is used to display Sound Information
  1170. #==============================================================================
  1171.  
  1172. class Window_SoundInfo < Window_Message
  1173.   #--------------------------------------------------------------------------
  1174.   # * Set Font
  1175.   #--------------------------------------------------------------------------
  1176.   def set_font
  1177.     contents.font.size = 18
  1178.   end
  1179.   #--------------------------------------------------------------------------
  1180.   # * Get Window Width
  1181.   #--------------------------------------------------------------------------
  1182.   def window_width
  1183.     return Graphics.width * 0.5
  1184.   end
  1185.   #--------------------------------------------------------------------------
  1186.   # * Get Window Height
  1187.   #--------------------------------------------------------------------------
  1188.   def window_height
  1189.     return Graphics.height - 192
  1190.   end  
  1191.   #--------------------------------------------------------------------------
  1192.   # * Draw Text
  1193.   #--------------------------------------------------------------------------
  1194.   def draw_text_soundinfo(text)
  1195.     contents.clear
  1196.     set_font()
  1197.     draw_text_ex(0, 0, word_wrapping(text))
  1198.   end  
  1199.   #--------------------------------------------------------------------------
  1200.   # * Draw Text with Control Characters
  1201.   #--------------------------------------------------------------------------
  1202.   def draw_text_ex(x, y, text)
  1203.     text = convert_escape_characters(text)
  1204.     pos = {:x => x, :y => y, :new_x => x, :height => calc_line_height(text)}
  1205.     process_character(text.slice!(0, 1), text, pos) until text.empty?
  1206.   end
  1207.   #--------------------------------------------------------------------------
  1208.   # * Wait After Output of One Character
  1209.   #--------------------------------------------------------------------------
  1210.   def wait_for_one_character
  1211.   end
  1212.   #--------------------------------------------------------------------------
  1213.   # * Word Wrapping
  1214.   #--------------------------------------------------------------------------
  1215.   def word_wrapping(text, pos = 0)
  1216.    
  1217.     # Current Text Position
  1218.     current_text_position = 0    
  1219.    
  1220.     for i in 0..(text.length - 1)
  1221.       if text[i] == "\n"
  1222.         current_text_position = 0
  1223.         next
  1224.       end
  1225.      
  1226.       # Current Position += character width
  1227.       current_text_position += contents.text_size(text[i]).width
  1228.      
  1229.       # If Current Position > Window Width
  1230.       if (pos + current_text_position) >= (contents.width)
  1231.         # Then Format the Sentence to fit Line
  1232.         current_element = i
  1233.         while(text[current_element] != " ")
  1234.           break if current_element == 0
  1235.           current_element -= 1
  1236.         end
  1237.        
  1238.         temp_text = ""
  1239.         for j in 0..(text.length - 1)
  1240.           temp_text += text[j]
  1241.           temp_text += "\n" if j == current_element
  1242.         end
  1243.         text = temp_text
  1244.         i = current_element
  1245.         current_text_position = 0
  1246.       end
  1247.     end
  1248.     return text
  1249.   end
  1250. end
  1251.  
  1252.  
  1253.  
  1254. #==============================================================================
  1255. # ** Window_NumberInput
  1256. #------------------------------------------------------------------------------
  1257. #  This window is used for the event command [Input Number].
  1258. #==============================================================================
  1259.  
  1260. class Window_SoundTest_NumberInput < Window_NumberInput
  1261.   #--------------------------------------------------------------------------
  1262.   # * Public Instance Variables
  1263.   #--------------------------------------------------------------------------
  1264.   attr_reader :result       # The Result of User Input
  1265.   attr_reader :completed    # User Finished Input Processing?
  1266.   attr_reader :processed_ok # User Did not Cancel User Input?
  1267.   #--------------------------------------------------------------------------
  1268.   # * Initialize
  1269.   #--------------------------------------------------------------------------
  1270.   def initialize()
  1271.     super( self )
  1272.     @result       = 0
  1273.     @completed    = true
  1274.     @processed_ok = false
  1275.   end
  1276.   #--------------------------------------------------------------------------
  1277.   # * Start Input Processing
  1278.   #--------------------------------------------------------------------------
  1279.   def start( number, digits )
  1280.     @digits_max = digits
  1281.     @number = number
  1282.     @index = 0
  1283.     @completed = false
  1284.     update_placement
  1285.     create_contents
  1286.     refresh
  1287.     open
  1288.     activate
  1289.   end
  1290.   #--------------------------------------------------------------------------
  1291.   # * Update Window Position
  1292.   #--------------------------------------------------------------------------
  1293.   def update_placement
  1294.     self.width = @digits_max * 20 + padding * 2
  1295.     self.height = fitting_height(1)
  1296.     self.x = (Graphics.width - width) / 2
  1297.     self.y = 192
  1298.   end
  1299.   #--------------------------------------------------------------------------
  1300.   # * Processing When OK Button Is Pressed
  1301.   #--------------------------------------------------------------------------
  1302.   def process_ok
  1303.     Sound.play_ok
  1304.     @result = @number
  1305.     @completed = true
  1306.     @processed_ok = true
  1307.     deactivate
  1308.     close
  1309.   end
  1310.   #--------------------------------------------------------------------------
  1311.   # * Processing When Cancel Button Is Pressed
  1312.   #--------------------------------------------------------------------------
  1313.   def process_cancel
  1314.     Sound.play_cancel
  1315.     @completed    = true
  1316.     @processed_ok = false
  1317.     deactivate
  1318.     close
  1319.   end
  1320. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement