Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Menu2
- def update;end
- def pbStartScene
- @sprites={}
- @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
- @viewport.z=99999
- @sprites["bg"]=Sprite.new(@viewport)
- @sprites["bg"].bitmap=RPG::Cache.picture("MenuSM")
- @sprites["title"]=Sprite.new(@viewport)
- @sprites["title"].z=99999
- pbSEPlay("abrirM")
- end
- def pbEndScene
- pbDisposeSpriteHash(@sprites)
- @viewport.dispose if @viewport
- end
- def pbUpdate
- @xcount=0
- @posible1=0
- @posible2=0
- @posible3=0
- loop do
- Graphics.update
- Input.update
- if Input.trigger?(Input::RIGHT)
- if @xcount==1 || @xcount==3 || @xcount==5
- @xcount-=1
- pbSEPlay("MoverM")
- else
- @xcount+=1
- pbSEPlay("MoverM")
- end
- end
- if Input.trigger?(Input::LEFT)
- if @xcount==0 || @xcount==2 || @xcount==4
- @xcount+=1
- pbSEPlay("MoverM")
- else
- @xcount-=1
- pbSEPlay("MoverM")
- end
- end
- if Input.trigger?(Input::UP)
- if @xcount==0 || @xcount==1
- @xcount+=4
- pbSEPlay("MoverM")
- else
- @xcount-=2
- pbSEPlay("MoverM")
- end
- end
- if Input.trigger?(Input::DOWN)
- if @xcount==4 || @xcount==5
- @xcount-=4
- pbSEPlay("MoverM")
- else
- @xcount+=2
- pbSEPlay("MoverM")
- end
- end
- if (@xcount == -1)
- @xcount= @totalElements-1
- end
- if (@xcount == @totalElements)
- @xcount=0
- end
- if (@xcount==1)
- @sprites["title"].bitmap=RPG::Cache.picture("Flechita2")
- @sprites["title"].x = (Graphics.width-@sprites["title"].bitmap.width)/2
- @sprites["title"].y = (Graphics.height-@sprites["title"].bitmap.height)/2
- loop do
- if Input.trigger?(Input::C) and !$Trainer.pokedex
- pbSEPlay("EscogerMenu")
- Kernel.pbMessage(_INTL("No tienes la Pokedex."))
- end
- Input.update
- Graphics.update
- end
- loop do
- if Input.trigger?(Input::C)
- pbSEPlay("EscogerMenu")
- end
- Input.update
- Graphics.update
- if DEXDEPENDSONLOCATION
- pbFadeOutIn(99999) {
- scene=PokemonPokedexScene.new
- screen=PokemonPokedex.new(scene)
- screen.pbStartScreen
- #@scene.pbRefresh
- }
- else
- if $PokemonGlobal.pokedexViable.length==1
- $PokemonGlobal.pokedexDex=$PokemonGlobal.pokedexViable[0]
- $PokemonGlobal.pokedexDex=-1
- if $PokemonGlobal.pokedexDex==$PokemonGlobal.pokedexUnlocked.length-1
- pbFadeOutIn(99999) {
- scene=PokemonPokedexScene.new
- screen=PokemonPokedex.new(scene)
- screen.pbStartScreen
- #@scene.pbRefresh
- }
- else
- pbLoadRpgxpScene(Scene_PokedexMenu.new)
- end
- end
- end
- end
- end
- if (@xcount==0)
- @sprites["title"].bitmap=RPG::Cache.picture("Flechita1")
- @sprites["title"].x = (Graphics.width-@sprites["title"].bitmap.width)/2
- @sprites["title"].y = (Graphics.height-@sprites["title"].bitmap.height)/2
- if $Trainer.party.length<1
- if Input.trigger?(Input::C)
- Kernel.pbMessage(_INTL("No tienes ningun pokémon."))
- end
- end
- if Input.trigger?(Input::C)
- sscene=PokemonScreen_Scene.new
- sscreen=PokemonScreen.new(sscene,$Trainer.party)
- hiddenmove=nil
- pbFadeOutIn(99999) {
- hiddenmove=sscreen.pbPokemonScreen
- if hiddenmove
- pbEndScene
- else
- #@scene.pbRefresh
- end
- }
- if hiddenmove
- Kernel.pbUseHiddenMove(hiddenmove[0],hiddenmove[1])
- return
- end
- end
- end
- if (@xcount==2)
- @sprites["title"].bitmap=RPG::Cache.picture("Flechita3")
- @sprites["title"].x = (Graphics.width-@sprites["title"].bitmap.width)/2
- @sprites["title"].y = (Graphics.height-@sprites["title"].bitmap.height)/2
- if Input.trigger?(Input::C)
- item=0
- scene=PokemonBag_Scene.new
- screen=PokemonBagScreen.new(scene,$PokemonBag)
- pbFadeOutIn(99999) {
- item=screen.pbStartScreen
- if item>0
- pbEndScene
- else
- #@scene.pbRefresh
- end
- }
- if item>0
- Kernel.pbUseKeyItemInField(item)
- return
- end
- end
- end
- if (@xcount==3)
- @sprites["title"].bitmap=RPG::Cache.picture("Flechita4")
- @sprites["title"].x = (Graphics.width-@sprites["title"].bitmap.width)/2
- @sprites["title"].y = (Graphics.height-@sprites["title"].bitmap.height)/2
- if Input.trigger?(Input::C)
- PBDebug.logonerr {
- scene=PokemonTrainerCardScene.new
- screen=PokemonTrainerCard.new(scene)
- pbFadeOutIn(99999) {
- screen.pbStartScreen
- #@scene.pbRefresh
- }
- }
- end
- end
- if (@xcount==5)
- @sprites["title"].bitmap=RPG::Cache.picture("Flechita6")
- @sprites["title"].x = (Graphics.width-@sprites["title"].bitmap.width)/2
- @sprites["title"].y = (Graphics.height-@sprites["title"].bitmap.height)/2
- if Input.trigger?(Input::C)
- scene=PokemonOptionScene.new
- screen=PokemonOption.new(scene)
- pbFadeOutIn(99999) {
- screen.pbStartScreen
- pbUpdateSceneMap
- #@scene.pbRefresh
- }
- end
- end
- if (@xcount==4)
- @sprites["title"].bitmap=RPG::Cache.picture("Flechita5")
- @sprites["title"].x = (Graphics.width-@sprites["title"].bitmap.width)/2
- @sprites["title"].y = (Graphics.height-@sprites["title"].bitmap.height)/2
- if Input.trigger?(Input::C)
- scene=PokemonSaveScene.new
- screen=PokemonSave.new(scene)
- if screen.pbSaveScreen
- endscene=false
- break
- else
- pbUpdateSceneMap
- end
- end
- end
- break if Input.trigger?(Input::B)
- end
- end
- end
- def pbCallMenu2
- scene=Menu2.new
- scene.pbStartScene
- scene.pbUpdate
- scene.pbEndScene
- end
- def getXPolygon(element, total, x_centre, radius)
- return radius * Math.cos(2*Math::PI*element/total + (Math::PI*1.5)) + x_centre
- end
- def getYPolygon(element, total, y_centre, radius)
- return radius * Math.sin(2*Math::PI*element/total + (Math::PI*1.5)) + y_centre
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement