Thread: [Essentials Script] Diamond And Pearl Battle System-CNG
View Single Post
  #23    
Old August 18th, 2010 (11:41 AM).
lark125 lark125 is offline
     
    Join Date: Apr 2008
    Posts: 33
    heey can anyone please help me with somthing i crasyninjaguy's dualscreen and mous input script and now i want to make a touchable menu but its not working for me if i use his tutorial for a touchable menu and this is how it the scripts looks like
    Spoiler:
    class PokemonMenu_Scene
    def pbShowCommands(commands)
    ret=-1
    [email protected]["cmdwindow"]
    [email protected]
    cmdwindow.index=$PokemonTemp.menuLastChoice
    cmdwindow.resizeToFit(commands)
    cmdwindow.commands=commands
    cmdwindow.x=Graphics.width-cmdwindow.width
    cmdwindow.y=0
    cmdwindow.visible=true
    loop do
    cmdwindow.update
    Graphics.update
    Input.update
    pbUpdateSceneMap
    Mouse.update
    $mouse.x = Mouse.pos_x
    $mouse.y = Mouse.pos_y
    if Input.trigger?(Input::B)
    ret=-1
    break
    end
    if Input.trigger?(Input::C)
    ret=cmdwindow.index
    $PokemonTemp.menuLastChoice=ret
    break
    end
    end
    return ret
    end
    def pbShowInfo(text)
    @sprites["infowindow"].resizeToFit(text,Graphics.height)
    @sprites["infowindow"].text=text
    @sprites["infowindow"].visible=true
    @infostate=true
    end
    def pbShowHelp(text)
    @sprites["helpwindow"].resizeToFit(text,Graphics.height)
    @sprites["helpwindow"].text=text
    @sprites["helpwindow"].visible=true
    @helpstate=true
    pbBottomLeft(@sprites["helpwindow"])
    end
    def pbStartScene
    @viewport=Viewport.new(0,0,Graphics.width,Graphics.height)
    @viewport.z=99999
    @sprites={}
    @sprites["cmdwindow"]=Window_CommandPokemon.new([])
    @sprites["menu-bag"]=IconSprite.new(0, 360)
    @sprites["menu-bag"].setBitmap("Graphics/Pictures/menu-bag.png")
    @sprites["infowindow"]=Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
    @sprites["infowindow"].visible=false
    @sprites["helpwindow"]=Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
    @sprites["helpwindow"].visible=false
    @sprites["cmdwindow"].visible=false
    @infostate=false
    @helpstate=false
    pbSEPlay("menu")
    end
    def pbHideMenu
    @sprites["cmdwindow"].visible=false
    @sprites["infowindow"].visible=false
    @sprites["helpwindow"].visible=false
    end
    def pbShowMenu
    @sprites["cmdwindow"].visible=true
    @sprites["infowindow"][email protected]
    @sprites["helpwindow"][email protected]
    end
    def pbEndScene
    pbDisposeSpriteHash(@sprites)
    @viewport.dispose
    end
    def pbRefresh
    end
    end

    class PokemonMenu
    def initialize(scene)
    @scene=scene
    end
    def pbShowMenu
    @scene.pbRefresh
    @scene.pbShowMenu
    end
    def pbStartPokemonMenu
    @scene.pbStartScene
    endscene=true
    commands=[]
    cmdPokedex=-1
    cmdPokemon=-1
    cmdBag=-1
    cmdTrainer=-1
    cmdSave=-1
    cmdOption=-1
    cmdPokegear=-1
    cmdDebug=-1
    cmdQuit=-1
    if !$Trainer
    if $DEBUG
    Kernel.pbMessage(_INTL("The player trainer was not defined, so the menu can't be displayed."))
    Kernel.pbMessage(_INTL("Please see the documentation to learn how to set up the trainer player."))
    end
    return
    end
    commands[cmdPokedex=commands.length]=_INTL("POKéDEX") if $Trainer.pokedex
    commands[cmdPokemon=commands.length]=_INTL("POKéMON") if $Trainer.party.length>0
    commands[cmdBag=commands.length]=_INTL("BAG") if !pbInBugContest?
    commands[cmdPokegear=commands.length]=_INTL("POKéGEAR") if $Trainer.pokegear
    commands[cmdTrainer=commands.length]=$Trainer.name
    if pbInSafari?
    @scene.pbShowInfo(_INTL("STEPS: {1}/600\nBALLS: {2}",pbSafariState.steps,pbSafariState.ballcount))
    commands[cmdQuit=commands.length]=_INTL("QUIT")
    elsif pbInBugContest?
    if pbBugContestState.lastPokemon
    @scene.pbShowInfo(_INTL("CAUGHT: {1}\nLEVEL: {2}\nBALLS: {3}",
    PBSpecies.getName(pbBugContestState.lastPokemon.species),
    pbBugContestState.lastPokemon.level,
    pbBugContestState.ballcount))
    else
    @scene.pbShowInfo(_INTL("CAUGHT: None\nBALLS: {1}",pbBugContestState.ballcount))
    end
    commands[cmdQuit=commands.length]=_INTL("QUIT")
    else
    commands[cmdSave=commands.length]=_INTL("SAVE") if !$game_system || !$game_system.save_disabled
    end
    commands[cmdOption=commands.length]=_INTL("OPTION")
    commands[cmdDebug=commands.length]=_INTL("DEBUG") if $DEBUG
    commands[commands.length]=_INTL("EXIT")
    loop do
    if Mouse.mouse_in_area?(0, 360, 60, 39)
    if Mouse.click?(1)
    pbFadeOutIn(99999) {
    scene=PokemonPokedexScene.new
    screen=PokemonPokedex.new(scene)
    screen.pbStartScreen
    @scene.pbRefresh
    }
    end
    end
    [email protected](commands)
    if cmdPokedex>=0 && command==cmdPokedex
    pbFadeOutIn(99999) {
    scene=PokemonPokedexScene.new
    screen=PokemonPokedex.new(scene)
    screen.pbStartScreen
    @scene.pbRefresh
    }
    elsif cmdPokegear>=0 && command==cmdPokegear
    pbLoadRpgxpScene(Scene_Pokegear.new)
    elsif cmdPokemon>=0 && command==cmdPokemon
    sscene=PokemonScreen_Scene.new
    sscreen=PokemonScreen.new(sscene,$Trainer.party)
    hiddenmove=nil
    pbFadeOutIn(99999) {
    hiddenmove=sscreen.pbPokemonScreen
    if hiddenmove
    @scene.pbEndScene
    else
    @scene.pbRefresh
    end
    }
    if hiddenmove
    Kernel.pbUseHiddenMove(hiddenmove[0],hiddenmove[1])
    return
    end
    elsif cmdBag>=0 && command==cmdBag
    item=0
    scene=PokemonBag_Scene.new
    screen=PokemonBagScreen.new(scene,$PokemonBag)
    pbFadeOutIn(99999) {
    item=screen.pbStartScreen
    if item>0
    @scene.pbEndScene
    else
    @scene.pbRefresh
    end
    }
    if item>0
    Kernel.pbUseKeyItemInField(item)
    return
    end
    elsif cmdTrainer>=0 && command==cmdTrainer
    PBDebug.logonerr {
    scene=PokemonTrainerCardScene.new
    screen=PokemonTrainerCard.new(scene)
    pbFadeOutIn(99999) {
    screen.pbStartScreen
    @scene.pbRefresh
    }
    }
    elsif cmdQuit>=0 && command==cmdQuit
    @scene.pbHideMenu
    if pbInSafari?
    if Kernel.pbConfirmMessage(_INTL("Would you like to leave the Safari Game right now?"))
    @scene.pbEndScene
    pbSafariState.decision=1
    pbSafariState.pbGoToStart
    return
    else
    pbShowMenu
    end
    else
    if Kernel.pbConfirmMessage(_INTL("Would you like to end the Contest now?"))
    @scene.pbEndScene
    pbBugContestState.pbStartJudging
    return
    else
    pbShowMenu
    end
    end
    elsif cmdSave>=0 && command==cmdSave
    @scene.pbHideMenu
    scene=PokemonSaveScene.new
    screen=PokemonSave.new(scene)
    if screen.pbSaveScreen
    @scene.pbEndScene
    endscene=false
    break
    else
    pbShowMenu
    end
    elsif cmdDebug>=0 && command==cmdDebug
    pbFadeOutIn(99999) {
    pbDebugMenu
    @scene.pbRefresh
    }
    elsif cmdOption>=0 && command==cmdOption
    scene=PokemonOptionScene.new
    screen=PokemonOption.new(scene)
    pbFadeOutIn(99999) {
    screen.pbStartScreen
    pbUpdateSceneMap
    @scene.pbRefresh
    }
    else
    break
    end
    end
    @scene.pbEndScene if endscene
    end
    end
    it doesn't work when i click on it does nothing so can anyone help me please

    thanks
    Reply With Quote