thebluelegend Membre
Inscrit le: 11 Juil 2013
Messages: 44 Localisation: Monde Distorsion
|
Posté le: Jeu 5 Sep - 19:08 (2013) Sujet du message: Musique alternative dans le menu |
|
|
J'ai édité le script Pokemon_Menu pour qu'il joue une musique alternative dans les menus. il suffit de remplacer Pokemon_Menu par ce qui suit Une petite précision,ce script n'est pas à installer si vous avez déjà fait d'autres modifications à Pokemon_menu. Pour PSP 0.8
Code: | module POKEMON_S class Pokemon_Menu def initialize(menu_index = 0) @menu_index = menu_index Audio.bgm_play("Audio/BGM/Menu.mp3", 100, 100) end def main Graphics.freeze @z_level = 10000 # Image de fond du menu @spriteset = Spriteset_Map.new @background = Sprite.new @background.bitmap = RPG::Cache.picture("Menu_Back.PNG") @background.x = 0 @background.y = 0 @background.z = @z_level @command = POKEMON_S::Window_Menu.new @command.x = 0 @command.y = 0 @command.z = @z_level + 2 @command.opacity = 0 @cde0 = Sprite.new @cde0.bitmap = RPG::Cache.picture("Menu0.PNG") @cde0.y = 44+ 84 *(0 % 3) @cde0.x = 48 + 160*(0 / 3) @cde0.z = @z_level + 2 if not($data_pokedex[0]) @cde0.opacity = 0 end @cde1 = Sprite.new @cde1.bitmap = RPG::Cache.picture("Menu1.PNG") @cde1.y = 44+ 84 *(1 % 3) @cde1.x = 48 + 160*(1 / 3) @cde1.z = @z_level + 2 if $pokemon_party.size == 0 @cde1.opacity = 0 end @cde2 = Sprite.new @cde2.bitmap = RPG::Cache.picture("Menu2.PNG") @cde2.y = 44+ 84 *(2 % 3) @cde2.x = 48 + 160*(2 / 3) @cde2.z = @z_level + 2 @cde3 = Sprite.new @cde3.bitmap = RPG::Cache.picture("Menu3.PNG") @cde3.y = 44+ 84 *(3 % 3) @cde3.x = 48 + 160*(3 / 3) @cde3.z = @z_level + 2 @cde4 = Sprite.new @cde4.bitmap = RPG::Cache.picture("Menu4.PNG") @cde4.y = 44+ 84 *(4 % 3) @cde4.x = 48 + 160*(4 / 3) @cde4.z = @z_level + 2 @cde5 = Sprite.new @cde5.bitmap = RPG::Cache.picture("Menu5.PNG") @cde5.y = 44+ 84 *(5 % 3) @cde5.x = 48 + 160*(5 / 3) @cde5.z = @z_level + 2 if not($data_pokedex[0]) and @menu_index == 0 @menu_index = 1 end if $pokemon_party.size == 0 and @menu_index == 1 @menu_index = 2 end @curseur = Sprite.new @curseur.bitmap = RPG::Cache.picture("Menu_curseur.PNG") @curseur.y = 44+ 84 *(@menu_index % 3) @curseur.x = 48 + 160*(@menu_index / 3) @curseur.z = @z_level + 4 Graphics.transition loop do Graphics.update Input.update update @curseur.dispose @curseur = Sprite.new @curseur.bitmap = RPG::Cache.picture("Menu_curseur.PNG") @curseur.y = 44+ 84 *(@menu_index % 3) @curseur.x = 48 + 160*(@menu_index / 3) @curseur.z = @z_level + 4 @command.refresh if $scene != self break end end Graphics.freeze @curseur.dispose @command.dispose @background.dispose @spriteset.dispose @command.dispose @cde0.dispose @cde1.dispose @cde2.dispose @cde3.dispose @cde4.dispose @cde5.dispose end def update @spriteset.update a = 0 if Input.trigger?(Input::UP) and @menu_index>0 @menu_index -= 1 if @menu_index == 2 @menu_index = 3 a = 1 end if not($data_pokedex[0]) and @menu_index == 0 @menu_index = 1 a = 1 end if $pokemon_party.size == 0 and @menu_index == 1 @menu_index = 2 a = 1 end if a == 0 $game_system.se_play($data_system.decision_se) end end if Input.trigger?(Input::DOWN) and @menu_index<5 @menu_index += 1 if @menu_index == 3 @menu_index = 2 a = 1 end if a == 0 $game_system.se_play($data_system.decision_se) end end if Input.trigger?(Input::LEFT) and @menu_index>2 $game_system.se_play($data_system.decision_se) @menu_index -= 3 if not($data_pokedex[0]) and @menu_index == 0 @menu_index = 1 end if $pokemon_party.size == 0 and @menu_index == 1 @menu_index = 2 end end if Input.trigger?(Input::RIGHT) and @menu_index<3 $game_system.se_play($data_system.decision_se) @menu_index += 3 end if Input.trigger?(Input::B) $game_system.se_play($data_system.cancel_se) $scene = Scene_Map.new $game_system.bgm_stop $game_map.autoplay return end if Input.trigger?(Input::C) if @menu_index == 0 # Pokédex if not($data_pokedex[0]) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = POKEMON_S::Pokemon_Pokedex.new end if @menu_index == 1 # Menu if $pokemon_party.size == 0 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = POKEMON_S::Pokemon_Party_Menu.new end if @menu_index == 2 # Sac $game_system.se_play($data_system.decision_se) $scene = Pokemon_Item_Bag.new end if @menu_index == 3 # Carte dresseur $game_system.se_play($data_system.decision_se) $game_temp.common_event_id = 19 $scene = Scene_Map.new end if @menu_index == 4 # Sauvegarde if $game_system.save_disabled $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = POKEMON_S::Pokemon_Save.new end if @menu_index == 5 # Quitter le menu $game_system.se_play($data_system.decision_se) $scene = Scene_Map.new end return end end end class Window_Location < Window_Base #-------------------------------------------------------------------------- def initialize super(0, 0, 300, 96) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize refresh end #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = Color.new(40,40,40,255) self.contents.draw_text(6, 0, 300, 32,$data_mapzone[$game_map.map_id][1]) self.contents.draw_text(4, 2, 300, 32,$data_mapzone[$game_map.map_id][1]) self.contents.draw_text(6, 2, 300, 32,$data_mapzone[$game_map.map_id][1]) self.contents.font.color = Color.new(251,251,251,255) self.contents.draw_text(4, 0, 300, 32,$data_mapzone[$game_map.map_id][1]) end end class Window_Argent < Window_Base #-------------------------------------------------------------------------- def initialize super(0, 0, 900, 96) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize refresh end #-------------------------------------------------------------------------- def refresh self.contents.clear self.contents.font.color = Color.new(40,40,40,255) self.contents.draw_text(6, 0, 300, 32, $pokemon_party.money.to_s + "$", 2) self.contents.draw_text(4, 2, 300, 32, $pokemon_party.money.to_s + "$", 2) self.contents.draw_text(6, 2, 300, 32, $pokemon_party.money.to_s + "$", 2) self.contents.font.color = Color.new(251,251,251,255) self.contents.draw_text(4, 0, 300, 32,$pokemon_party.money.to_s + "$", 2) end end class Window_Menu < Window_Base #-------------------------------------------------------------------------- def initialize super(0, 0, 640, 480) self.contents = Bitmap.new(width - 32, height - 32) self.contents.font.name = $fontface self.contents.font.size = $fontsize self.contents.clear refresh end #-------------------------------------------------------------------------- def refresh s1 = "POKéDEX" s2 = "POKéMON" s3 = "SAC" s4 = Player.name s5 = "SAUVER" s6 = "QUITTER" menu = [s1,s2,s3,s4,s5,s6] for i in 0..5 if not($data_pokedex[0]) and i == 0 i = 1 end if $pokemon_party.size == 0 and i == 1 i = 2 end y = 46+ 84 *(i % 3) + 34 x = 72 + 160*(i / 3) text = menu[i].to_s a = self.contents.text_size(text).width / 2 self.contents.font.color = Color.new(107,107,107,255) self.contents.draw_text((x-a)+2, y, 300, 32, text) self.contents.draw_text((x-a), y+2, 300, 32, text) self.contents.draw_text((x-a)+2, y+2, 300, 32, text) self.contents.font.color = Color.new(251,251,251,255) self.contents.draw_text((x-a), y, 300, 32,text) end end def dispose self.contents.clear end end end
|
Pour PSP DS:
Code: | #============================================================================== # ■ Pokemon_Menu # Pokemon Script Project - Krosk # 18/07/07 # 22/02/10 - Palbolsky #----------------------------------------------------------------------------- # Scène modifiable #----------------------------------------------------------------------------- # Menu principal accessible par échap #-----------------------------------------------------------------------------
module POKEMON_S class Pokemon_Menu < Window_Base #-------------------------------------------------------------------------- # #-------------------------------------------------------------------------- def initialize(menu_index = 0) @menu_index = menu_index super(0,0,640,480) self.contents = Bitmap.new(width - 32, height - 32) self.opacity = 0 self.z = 11 Audio.bgm_play("Audio/BGM/Menu.mp3", 100, 100) end #-------------------------------------------------------------------------- # #-------------------------------------------------------------------------- def main @spriteset = Spriteset_Map.new @interface = Interface_Echap.new if POKEMON_S::VIEWER_TEAM @pkmn_team = Pokemon_Equipe.new end s1 = "Pokédex" s3 = "équipe" s5 = "Objets" s7 = "" s2 = Player.name s4 = "Sauver" s6 = "Options" s8 = "Retour" @command_window = Window_Command.new(80, [s1, s2, s3, s4, s5, s6, s7], $fontsizebig, 2, 14) @command_window.index = @menu_index @command_window.x = 480 - 169 - 123 + 200 @command_window.y = 28 - 20 @command_window.z = 10000 @command_window.visible = false @selecteur = Sprite.new @selecteur.z = 200 if $color_menu == 1 or $color_menu == nil # Vert @string = "_rouge" elsif $color_menu == 0 # Bleu @string = "_vert" elsif $color_menu == 2 # Rouge @string = "_bleu" end @selecteur.bitmap = RPG::Cache.picture("Menu Echap/selector_menu" + @string) if @command_window.index == 0 @selecteur.x = 37 @selecteur.y = 249 elsif @command_window.index == 2 @selecteur.x = 37 @selecteur.y = 289 elsif @command_window.index == 4 @selecteur.x = 37 @selecteur.y = 329 elsif @command_window.index == 6 @selecteur.x = 37 @selecteur.y = 369 end if @command_window.index == 1 @selecteur.x = 117 @selecteur.y = 249 elsif @command_window.index == 3 @selecteur.x = 117 @selecteur.y = 289 elsif @command_window.index == 5 @selecteur.x = 117 @selecteur.y = 329 end if $pokemon_party.size == 0 # Enlève accès Equipe @command_window.disable_item(2) end if not($data_pokedex[0]) # Enlève accès Pokédex si non possédé @command_window.disable_item(0) end if $game_system.save_disabled @command_window.disable_item(5) end @command_window.disable_item(5) Graphics.transition loop do Graphics.update Input.update update if $scene != self break end end Graphics.freeze @command_window.dispose @spriteset.dispose @selecteur.dispose @interface.dispose @pkmn_team.dispose if not @pkmn_team.nil? Graphics.freeze end #-------------------------------------------------------------------------- # #-------------------------------------------------------------------------- def update if @command_window.index == 0 @selecteur.x = 37 @selecteur.y = 249 elsif @command_window.index == 2 @selecteur.x = 37 @selecteur.y = 289 elsif @command_window.index == 4 @selecteur.x = 37 @selecteur.y = 329 elsif @command_window.index == 6 @selecteur.x = 37 @selecteur.y = 369 elsif @command_window.index == 1 @selecteur.x = 117 @selecteur.y = 249 elsif @command_window.index == 3 @selecteur.x = 117 @selecteur.y = 289 elsif @command_window.index == 5 @selecteur.x = 117 @selecteur.y = 329 end # ウィンドウを更新 @command_window.update @spriteset.update @selecteur.update @interface.update # コマンドウィンドウがアクティブの場合: update_command を呼ぶ if @command_window.active update_command return end end def dispose super end #-------------------------------------------------------------------------- # ● フレーム更新 (コマンドウィンドウがアクティブの場合) #-------------------------------------------------------------------------- def update_command # B ボタンが押された場合 if Input.trigger?(Input::B) # キャンセル SE を演奏 $game_system.se_play($data_system.cancel_se) # マップ画面に切り替え $scene = Scene_Map.new $game_system.bgm_stop $game_map.autoplay self.contents.clear return end # C ボタンが押された場合 if Input.trigger?(Input::C) # パーティ人数が 0 人で、セーブ、ゲーム終了以外のコマンドの場合 if $game_party.actors.size == 0 and @command_window.index < 4 # ブザー SE を演奏 $game_system.se_play($data_system.buzzer_se) return end # コマンドウィンドウのカーソル位置で分岐 case @command_window.index when 0 # Pokédex if not($data_pokedex[0]) $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Pokemon_Pokedex.new self.contents.clear when 2 # Menu if $pokemon_party.size == 0 $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Pokemon_Party_Menu.new when 4 # Sac $game_system.se_play($data_system.decision_se) $scene = Pokemon_Item_Bag.new when 6 # Pokématos if $game_switches[9] == false $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Pokematos.new when 1 # Carte dresseur $game_system.se_play($data_system.decision_se) $game_temp.common_event_id = 19 $scene = Scene_Map.new when 3 # Sauvegarde if $game_system.save_disabled $game_system.se_play($data_system.buzzer_se) return end $game_system.se_play($data_system.decision_se) $scene = Pokemon_Save.new self.contents.clear when 5 # OPTIONS $game_system.se_play($data_system.decision_se) $scene = OPTIONS.new end return end end end end |
il suffit ensuite de mettre un Menu.mp3 dans le dossier audio/bgm N'oubliez pas de m'ajouter dans vos crédits!
Dernière édition par thebluelegend le Jeu 5 Sep - 21:43 (2013); édité 3 fois |
|