Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # =============================================================================
- # TheoAllen - Menu Sounds
- # Version : 1.0
- # Contact : www.rpgmakerid.com (or) http://theolized.blogspot.com
- # (This script documentation is written in informal indonesian language)
- # =============================================================================
- ($imported ||= {})[:Theo_MenuSound] = true
- # =============================================================================
- # CHANGE LOGS:
- # -----------------------------------------------------------------------------
- # 2013.05.11 - Started and Finished script
- # =============================================================================
- =begin
- Perkenalan :
- Script ini ngebikin kamu setiap kali akses menu bisa puter lagu (BGM) atau
- puter suara background (BGS)
- Cara pakai :
- Pasang diatas main tapi dibawah material
- Edit konfigurasi di bawah
- TERMS OF USE :
- Credit gw, TheoAllen. Kalo semisal u bisa ngedit2 script gw trus jadi lebih
- keren, terserah. Ane bebasin. Asal ngga ngeklaim aja. Kalo semisal mau
- dipake buat komersil, jangan lupa, gw dibagi gratisannya.
- =end
- # =============================================================================
- # Konfigurasi :
- # =============================================================================
- module THEO
- module SOUND
- # ------------------------------------------------------------------------
- # Settingan BGM :
- # ------------------------------------------------------------------------
- BGM_FILENAME = "Field1"
- # Nama file untuk BGM. File harus ada di Audio/BGM
- # ------------------------------------------------------------------------
- BGM_VOLUME = 100
- # Volume BGM.
- # ------------------------------------------------------------------------
- BGM_PITCH = 100
- # Pitch BGM
- # ------------------------------------------------------------------------
- BGM_SWITCH = 99
- # Switch id untuk play BGM. Jika true, maka tidak akan play BGM
- # ------------------------------------------------------------------------
- # ------------------------------------------------------------------------
- # Settingan BGS :
- # ------------------------------------------------------------------------
- BGS_FILENAME = "Clock"
- # Nama file untuk BGS. File harus ada di Audio/BGS
- # ------------------------------------------------------------------------
- BGS_VOLUME = 100
- # Volume untuk BGS
- # ------------------------------------------------------------------------
- BGS_PITCH = 100
- # Pitch untuk BGS
- # ------------------------------------------------------------------------
- BGS_SWITCH = 98
- # Switch id untuk play BGS. Jika true, maka tidak akan play BGS
- # ------------------------------------------------------------------------
- end
- end
- # =============================================================================
- # Akhir dari konfigurasi. Setelah line ini jangan diedit kecuali ente ngerti
- # =============================================================================
- class Game_System
- alias pre_menusound_init initialize
- def initialize
- pre_menusound_init
- @saved_bgs = nil
- end
- def save_bgs
- @saved_bgs = RPG::BGS.last
- end
- def replay_bgs
- @saved_bgs.replay if @saved_bgs
- end
- end
- class Scene_MenuBase < Scene_Base
- include THEO::SOUND
- alias pre_menusound_start start
- def start
- pre_menusound_start
- $game_system.save_bgm
- $game_system.save_bgs
- play_menu_bgm
- play_menu_bgs
- end
- def play_menu_bgm
- return unless BGM_FILENAME.is_a?(String)
- return if $game_switches[BGM_SWITCH]
- path = sprintf("Audio/BGM/%s",BGM_FILENAME)
- Audio.bgm_play(path, BGM_VOLUME, BGM_PITCH) rescue return
- end
- def play_menu_bgs
- return unless BGS_FILENAME.is_a?(String)
- return if $game_switches[BGS_SWITCH]
- path = sprintf("Audio/BGS/%s",BGS_FILENAME)
- Audio.bgs_play(path, BGS_VOLUME, BGS_PITCH) rescue return
- end
- end
- class Scene_Map < Scene_Base
- alias pre_menusound_start start
- def start
- $game_system.replay_bgm
- $game_system.replay_bgs
- pre_menusound_start
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment