Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2020
408
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.39 KB | None | 0 0
  1. #===============================================================================
  2. # Neo PauseMenu (for v17.x)
  3. # by Luka S.J. edited by #Not Important to support derFishae's quest thingy
  4. # ----------------
  5. # Provides only features present in the default version of the Pokedex in
  6. # Essentials. Mean as a new cosmetic overhaul, adhering to the UI design
  7. # language of the Elite Battle System: The Next Generation
  8. #
  9. # Enjoy the script, and make sure to give credit!
  10. # (DO NOT ALTER THE NAMES OF THE INDIVIDUAL SCRIPT SECTIONS OR YOU WILL BREAK
  11. # YOUR SYSTEM!)
  12. #-------------------------------------------------------------------------------
  13. # Main module for handling each menu item/entry
  14. #===============================================================================
  15. class PokemonPauseMenu
  16. def initialize(scene)
  17. @scene = scene
  18. end
  19.  
  20. def pbShowMenu
  21. @scene.pbRefresh
  22. @scene.pbShowMenu
  23. end
  24.  
  25. def pbStartPokemonMenu
  26. pbSetViableDexes
  27. @scene.pbStartScene
  28. endscene = true
  29. commands = []
  30. cmdPokedex = -1
  31. cmdPokemon = -1
  32. cmdBag = -1
  33. cmdTrainer = -1
  34. cmdSave = -1
  35. cmdOption = -1
  36. cmdPokegear = -1
  37. cmdDebug = -1
  38. cmdQuit = -1
  39. cmdEndGame = -1
  40. if !$Trainer
  41. if $DEBUG
  42. Kernel.pbMessage(_INTL("The player trainer was not defined, so the menu can't be displayed."))
  43. Kernel.pbMessage(_INTL("Please see the documentation to learn how to set up the trainer player."))
  44. end
  45. return
  46. end
  47. commands[cmdPokedex = commands.length] = _INTL("Pokédex") if $Trainer.pokedex && $PokemonGlobal.pokedexViable.length>0
  48. commands[cmdPokemon = commands.length] = _INTL("Pokémon") if $Trainer.party.length>0
  49. commands[cmdQuests = commands.length] = _INTL("Quests")
  50. commands[cmdBag = commands.length] = _INTL("Bag") if !pbInBugContest?
  51. commands[cmdPokegear = commands.length] = _INTL("Pokégear") if $Trainer.pokegear
  52. commands[cmdTrainer = commands.length] = $Trainer.name
  53. if pbInSafari?
  54. if SAFARISTEPS<=0
  55. @scene.pbShowInfo(_INTL("Balls: {1}",pbSafariState.ballcount))
  56. else
  57. @scene.pbShowInfo(_INTL("Steps: {1}/{2}\nBalls: {3}",
  58. pbSafariState.steps,SAFARISTEPS,pbSafariState.ballcount))
  59. end
  60. commands[cmdQuit = commands.length] = _INTL("Quit")
  61. elsif pbInBugContest?
  62. if pbBugContestState.lastPokemon
  63. @scene.pbShowInfo(_INTL("Caught: {1}\nLevel: {2}\nBalls: {3}",
  64. PBSpecies.getName(pbBugContestState.lastPokemon.species),
  65. pbBugContestState.lastPokemon.level,
  66. pbBugContestState.ballcount))
  67. else
  68. @scene.pbShowInfo(_INTL("Caught: None\nBalls: {1}",pbBugContestState.ballcount))
  69. end
  70. commands[cmdQuit = commands.length] = _INTL("Quit Contest")
  71. else
  72. commands[cmdSave = commands.length] = _INTL("Save") if $game_system && !$game_system.save_disabled
  73. end
  74. commands[cmdOption = commands.length] = _INTL("Options")
  75. commands[cmdDebug = commands.length] = _INTL("Debug") if $DEBUG
  76. commands[cmdEndGame = commands.length] = _INTL("Quit Game")
  77. loop do
  78. command = @scene.pbShowCommands(commands)
  79. if cmdPokedex>=0 && command==cmdPokedex
  80. if DEXDEPENDSONLOCATION
  81. pbFadeOutIn(99999){
  82. scene = PokemonPokedex_Scene.new
  83. screen = PokemonPokedexScreen.new(scene)
  84. screen.pbStartScreen
  85. @scene.pbRefresh
  86. }
  87. else
  88. if $PokemonGlobal.pokedexViable.length==1
  89. $PokemonGlobal.pokedexDex = $PokemonGlobal.pokedexViable[0]
  90. $PokemonGlobal.pokedexDex = -1 if $PokemonGlobal.pokedexDex==$PokemonGlobal.pokedexUnlocked.length-1
  91. pbFadeOutIn(99999){
  92. scene = PokemonPokedex_Scene.new
  93. screen = PokemonPokedexScreen.new(scene)
  94. screen.pbStartScreen
  95. @scene.pbRefresh
  96. }
  97. else
  98. pbFadeOutIn(99999){
  99. scene = PokemonPokedexMenu_Scene.new
  100. screen = PokemonPokedexMenuScreen.new(scene)
  101. screen.pbStartScreen
  102. @scene.pbRefresh
  103. }
  104. end
  105. end
  106. elsif cmdPokemon>=0 && command==cmdPokemon
  107. hiddenmove = nil
  108. pbFadeOutIn(99999){
  109. sscene = PokemonParty_Scene.new
  110. sscreen = PokemonPartyScreen.new(sscene,$Trainer.party)
  111. hiddenmove = sscreen.pbPokemonScreen
  112. (hiddenmove) ? @scene.pbEndScene : @scene.pbRefresh
  113. }
  114. if hiddenmove
  115. $game_temp.in_menu = false
  116. Kernel.pbUseHiddenMove(hiddenmove[0],hiddenmove[1])
  117. return
  118. end
  119. elsif cmdBag>=0 && command==cmdBag
  120. item = 0
  121. pbFadeOutIn(99999){
  122. scene = PokemonBag_Scene.new
  123. screen = PokemonBagScreen.new(scene,$PokemonBag)
  124. item = screen.pbStartScreen
  125. (item>0) ? @scene.pbEndScene : @scene.pbRefresh
  126. }
  127. if item>0
  128. Kernel.pbUseKeyItemInField(item)
  129. return
  130. end
  131. elsif cmdPokegear>=0 && command==cmdPokegear
  132. pbFadeOutIn(99999){
  133. scene = PokemonPokegear_Scene.new
  134. screen = PokemonPokegearScreen.new(scene)
  135. screen.pbStartScreen
  136. @scene.pbRefresh
  137. }
  138. elsif cmdTrainer>=0 && command==cmdTrainer
  139. pbFadeOutIn(99999){
  140. scene = PokemonTrainerCard_Scene.new
  141. screen = PokemonTrainerCardScreen.new(scene)
  142. screen.pbStartScreen
  143. @scene.pbRefresh
  144. }
  145. elsif cmdQuit>=0 && command==cmdQuit
  146. @scene.pbHideMenu
  147. if pbInSafari?
  148. if Kernel.pbConfirmMessage(_INTL("Would you like to leave the Safari Game right now?"))
  149. @scene.pbEndScene
  150. pbSafariState.decision = 1
  151. pbSafariState.pbGoToStart
  152. return
  153. else
  154. pbShowMenu
  155. end
  156. else
  157. if Kernel.pbConfirmMessage(_INTL("Would you like to end the Contest now?"))
  158. @scene.pbEndScene
  159. pbBugContestState.pbStartJudging
  160. return
  161. else
  162. pbShowMenu
  163. end
  164. end
  165. elsif cmdSave>=0 && command==cmdSave
  166. @scene.pbHideMenu
  167. scene = PokemonSave_Scene.new
  168. screen = PokemonSaveScreen.new(scene)
  169. if screen.pbSaveScreen
  170. @scene.pbEndScene
  171. endscene = false
  172. break
  173. else
  174. pbShowMenu
  175. end
  176. elsif cmdOption>=0 && command==cmdOption
  177. pbFadeOutIn(99999){
  178. scene = PokemonOption_Scene.new
  179. screen = PokemonOptionScreen.new(scene)
  180. screen.pbStartScreen
  181. pbUpdateSceneMap
  182. @scene.pbRefresh
  183. }
  184. elsif cmdDebug>=0 && command==cmdDebug
  185. pbFadeOutIn(99999){
  186. pbDebugMenu
  187. @scene.pbRefresh
  188. }
  189. elsif cmdEndGame>=0 && command==cmdEndGame
  190. @scene.pbHideMenu
  191. if Kernel.pbConfirmMessage(_INTL("Are you sure you want to quit the game?"))
  192. scene = PokemonSave_Scene.new
  193. screen = PokemonSaveScreen.new(scene)
  194. if screen.pbSaveScreen
  195. @scene.pbEndScene
  196. end
  197. @scene.pbEndScene
  198. $scene = nil
  199. return
  200. else
  201. pbShowMenu
  202. end
  203. else
  204. break
  205. end
  206. end
  207. @scene.pbEndScene if endscene
  208. end
  209. end
  210. #here be neo
  211. module MenuHandlers
  212. # hash used to store the elements inside of the menu
  213. @@menuEntry = {}
  214. # hash used to store whether or not an element is unlocked
  215. @@available = {}
  216. # hash used to store the index of each element; for sorting
  217. @@indexes = {}
  218. @@index = 0
  219. # function to add a new element/entry to the menu.
  220. def self.addEntry(ref,name,icon,proc,conditional)
  221. @@menuEntry[ref] = [name,icon,proc]
  222. @@available[ref] = conditional
  223. @@indexes[ref] = @@index
  224. @@index += 1
  225. end
  226. # function to get the name of an element/entry
  227. def self.getName(ref)
  228. return @@menuEntry[ref][0]
  229. end
  230. # function to get the icon of an element/entry
  231. def self.getIcon(ref)
  232. return "Graphics/Icons/#{@@menuEntry[ref][1]}"
  233. end
  234. # function to get all the possible keys from the main hash
  235. def self.getKeys
  236. entries = Array.new(@@menuEntry.keys.length)
  237. for key in @@menuEntry.keys
  238. entries[@@indexes[key]] = key
  239. end
  240. return entries
  241. end
  242. # function used to invoke the stored code for each element/entry
  243. def self.runAction(ref,scene)
  244. @@menuEntry[ref][2].call(scene)
  245. end
  246. # function to check if the player has access to an element/entry
  247. def self.available?(ref)
  248. return @@available[ref].call
  249. end
  250. # function that lists all accessible menu elements/entries
  251. def self.elements?
  252. ent = self.getKeys
  253. items = 0
  254. for val in ent
  255. items += 1 if self.available?(val)
  256. end
  257. return items
  258. end
  259. end
  260. #-------------------------------------------------------------------------------
  261. # Main class used to handle the visuals
  262. #-------------------------------------------------------------------------------
  263. class PokemonPauseMenu_Scene
  264. attr_accessor :index
  265. attr_accessor :entries
  266. attr_accessor :endscene
  267. attr_accessor :close
  268. attr_accessor :hidden
  269.  
  270. # retained for compatibility
  271. def pbShowInfo(text)
  272. @sprites["helpwindow"].resizeToFit(text,Graphics.height)
  273. @sprites["helpwindow"].text = text
  274. @sprites["helpwindow"].visible = true
  275. @helpstate = true
  276. pbBottomLeft(@sprites["helpwindow"])
  277. end
  278. # retained for compatibility
  279. def pbShowHelp(text)
  280. @sprites["helpwindow"].resizeToFit(text,Graphics.height)
  281. @sprites["helpwindow"].text = text
  282. @sprites["helpwindow"].visible = true
  283. @helpstate = true
  284. pbBottomLeft(@sprites["helpwindow"])
  285. end
  286. # main scene generation
  287. def pbStartScene
  288. pbSetViableDexes
  289. # sets the default index
  290. @index = $PokemonTemp.menuLastChoice.nil? ? 0 : $PokemonTemp.menuLastChoice
  291. @index = 0 if @index >= MenuHandlers.elements?
  292. @oldindex = 0
  293. @endscene = true
  294. @close = false
  295. @hidden = false
  296. # loads the visual parts of the
  297. @viewport = Viewport.new(0,0,Graphics.width,Graphics.height)
  298. @viewport.z = 99999
  299. @sprites = {}
  300. # initializes the background graphic
  301. @bitmap = Graphics.snap_to_bitmap if !@bitmap
  302. @sprites["background"] = Sprite.new(@viewport)
  303. @sprites["background"].bitmap = @bitmap
  304. @sprites["background"].blur_sprite(3)
  305. @sprites["background"].bitmap.blt(0,0,pbBitmap("Graphics/Pictures/PauseMenu/bg"),Rect.new(0,0,Graphics.width,Graphics.height))
  306. bmp = pbBitmap("Graphics/Pictures/Common/scrollbar_bg")
  307. @sprites["background"].bitmap.blt(Graphics.width - 28,(Graphics.height - bmp.height)/2,bmp,Rect.new(0,0,bmp.width,bmp.height))
  308. # initializes the scrolling panorama
  309. @sprites["panorama"] = ScrollingSprite.new(@viewport)
  310. @sprites["panorama"].setBitmap("Graphics/Pictures/Common/panorama")
  311. @sprites["panorama"].speed = 1
  312. # retained for compatibility
  313. @sprites["infowindow"] = Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
  314. @sprites["infowindow"].visible = false
  315. @sprites["helpwindow"] = Window_UnformattedTextPokemon.newWithSize("",0,0,32,32,@viewport)
  316. @sprites["helpwindow"].visible = false
  317. # draw the contest crap
  318. @sprites["textOverlay"] = Sprite.new(@viewport)
  319. @sprites["textOverlay"].bitmap = Bitmap.new(@viewport.rect.width,@viewport.rect.height)
  320. @sprites["textOverlay"].end_x = 0
  321. @sprites["textOverlay"].x = [email protected]
  322. pbSetSystemFont(@sprites["textOverlay"].bitmap)
  323. bmp = pbBitmap("Graphics/Pictures/Common/partyBar")
  324. content = []
  325. text = []
  326. if pbInSafari?
  327. content.push(_INTL("Steps: {1}/{2}",pbSafariState.steps,SAFARISTEPS)) if SAFARISTEPS > 0
  328. content.push(_INTL("Balls: {1}",pbSafariState.ballcount))
  329. elsif pbInBugContest?
  330. if pbBugContestState.lastPokemon
  331. content.push(_INTL("Caught: {1}",PBSpecies.getName(pbBugContestState.lastPokemon.species)))
  332. content.push(_INTL("Level: {1}",pbBugContestState.lastPokemon.level))
  333. content.push(_INTL("Balls: {1}",pbBugContestState.ballcount))
  334. else
  335. content.push("Caught: none")
  336. end
  337. content.push(_INTL("Balls: {1}",pbBugContestState.ballcount))
  338. end
  339. for i in 0...content.length
  340. text.push([content[i],16, 60 + i*50, 0, Color.new(255,255,255),Color.new(0,0,0,65)])
  341. @sprites["textOverlay"].bitmap.blt(-2,92 + i*50,bmp,Rect.new(0,0,bmp.width,bmp.height))
  342. end
  343. pbDrawTextPositions(@sprites["textOverlay"].bitmap,text)
  344. # initializes the scroll bar
  345. @sprites["scroll"] = Sprite.new(@viewport)
  346. # rendering elements on screen
  347. self.refresh
  348. self.update
  349. # memorizes the target opacities and sets them to 0
  350. @opacities = {}
  351. for key in @sprites.keys
  352. @opacities[key] = @sprites[key].opacity
  353. @sprites[key].opacity = 0
  354. end
  355. end
  356.  
  357. def pbHideMenu
  358. # animations for closing the menu
  359. @sprites["textOverlay"].end_x = [email protected]
  360. 8.times do
  361. for key in @sprites.keys
  362. next if !@sprites[key] || @sprites[key].disposed?
  363. @sprites[key].opacity -= 32
  364. end
  365. @sprites["textOverlay"].x += (@sprites["textOverlay"].end_x - @sprites["textOverlay"].x)*0.2
  366. Graphics.update
  367. end
  368. end
  369.  
  370. def pbShowMenu
  371. # animations for opening the menu
  372. @sprites["textOverlay"].end_x = 0
  373. 8.times do
  374. for key in @sprites.keys
  375. next if !@sprites[key] || @sprites[key].disposed?
  376. @sprites[key].opacity += 32 if @sprites[key].opacity < @opacities[key]
  377. end
  378. @sprites["textOverlay"].x += (@sprites["textOverlay"].end_x - @sprites["textOverlay"].x)*0.4
  379. Graphics.update
  380. end
  381. end
  382.  
  383. def refresh
  384. # index safety
  385. @index = MenuHandlers.elements? - 1 if @index >= MenuHandlers.elements?
  386. @oldindex = @index
  387. # disposes old items in the menu
  388. if @entries
  389. @sprites["#{i}"].dispose if @sprites["#{i}"]
  390. end
  391. end
  392. # creates a new list of available items
  393. ent = MenuHandlers.getKeys
  394. @entries = []
  395. for val in ent
  396. @entries.push(val) if MenuHandlers.available?(val)
  397. end
  398. # draws individual item entries
  399. bmp = pbBitmap("Graphics/Pictures/PauseMenu/sel")
  400. key = @entries[i]
  401. @sprites["#{i}"] = Sprite.new(@viewport)
  402. @sprites["#{i}"].bitmap = Bitmap.new(bmp.width,bmp.height)
  403. pbSetSystemFont(@sprites["#{i}"].bitmap)
  404. @sprites["#{i}"].src_rect.set(0,0,bmp.width/2,bmp.height)
  405. @sprites["#{i}"].bitmap.blt(0,0,bmp,Rect.new(0,0,bmp.width,bmp.height))
  406. for j in 0...2
  407. opac = j == 0 ? 155 : 255
  408. icon = pbBitmap(MenuHandlers.getIcon(key))
  409. text = MenuHandlers.getName(key)
  410. text.gsub!("\\pn"){"#{$Trainer.name}"}
  411. text.gsub!("\\contest"){pbInSafari? ? "Quit" : "Quit Contest"}
  412. @sprites["#{i}"].bitmap.blt(18 + j*bmp.width/2,6,icon,Rect.new(0,0,48,48),opac)
  413. pbDrawOutlineText(@sprites["#{i}"].bitmap,66 + j*bmp.width/2,6,136,48,text,Color.new(255,255,255),Color.new(64,64,64),1)
  414. end
  415. @sprites["#{i}"].x = Graphics.width - bmp.width/2 - 52
  416. @sprites["#{i}"].y = 49 + (bmp.height + 12)*i
  417. @sprites["#{i}"].opacity = 128
  418. end
  419. # configures the scroll bar
  420. n = (@entries.length < 4 ? 1 : @entries.length - 3)
  421. height = 204/n
  422. height += 204 - (height*n)
  423. height += 16
  424. @sprites["scroll"].bitmap = Bitmap.new(16,height)
  425. bmp = pbBitmap("Graphics/Pictures/Common/scrollbar_kn")
  426. @sprites["scroll"].bitmap.blt(0,0,bmp,Rect.new(0,0,16,6))
  427. @sprites["scroll"].bitmap.stretch_blt(Rect.new(0,6,16,height-14),bmp,Rect.new(0,6,16,1))
  428. @sprites["scroll"].bitmap.blt(0,height-8,bmp,Rect.new(0,8,16,8))
  429. @sprites["scroll"].x = Graphics.width - 32
  430. @sprites["scroll"].y = (Graphics.height - 204)/2
  431. @sprites["scroll"].end_y = (Graphics.height - 204)/2
  432. end
  433.  
  434. def update
  435. # scrolling background image
  436. @sprites["panorama"].update
  437. # calculations for updating the scrollbar position
  438. k = (@entries.length < 4 ? 0 : @index - 3)
  439. k = 0 if k < 0
  440. n = (@entries.length < 4 ? 1 : @entries.length - 3)
  441. height = 204/n
  442. @sprites["scroll"].end_y = (Graphics.height-204)/2 + height*k
  443. @sprites["scroll"].y += (@sprites["scroll"].end_y - @sprites["scroll"].y)*0.2
  444. # updates for each element/entry in the menu
  445. j = @entries.length < 4 ? 0 : (@index - 3)
  446. j = 0 if j < 0
  447. y = (-j)*(@sprites["#{i}"].src_rect.height + 12) + 49 + i*(@sprites["#{i}"].src_rect.height + 12)
  448. @sprites["#{i}"].y -= (@sprites["#{i}"].y - y)*0.1
  449. @sprites["#{i}"].src_rect.x = @sprites["#{i}"].src_rect.width*(@index == i ? 1 : 0)
  450. @sprites["#{i}"].x += 2 if @sprites["#{i}"].x < Graphics.width - @sprites["#{i}"].src_rect.width - 52
  451. if i.between?(j,j+3)
  452. @sprites["#{i}"].opacity += 15 if @sprites["#{i}"].opacity < 255
  453. else
  454. @sprites["#{i}"].opacity -= 15 if @sprites["#{i}"].opacity > 128
  455. end
  456. if @index == i
  457. @sprites["#{i}"].tone.gray -= 51 if @sprites["#{i}"].tone.gray > 0
  458. else
  459. @sprites["#{i}"].tone.gray += 51 if @sprites["#{i}"].tone.gray < 255
  460. end
  461. end
  462. # sets the index
  463. if @oldindex != @index
  464. @sprites["#{@index}"].x -= 6
  465. @oldindex = @index
  466. end
  467. end
  468.  
  469. def pbEndScene
  470. # disposes the sprite hash
  471. pbHideMenu
  472. pbDisposeSpriteHash(@sprites)
  473. @viewport.dispose
  474. end
  475.  
  476. def pbRefresh
  477. end
  478. end
  479. #-------------------------------------------------------------------------------
  480. # Main class used to handle the logic of the pause menu
  481. #-------------------------------------------------------------------------------
  482. class PokemonPauseMenu
  483. def initialize(scene)
  484. @scene = scene
  485. end
  486.  
  487. def pbShowMenu
  488. #@scene.pbRefresh
  489. @scene.pbShowMenu
  490. end
  491.  
  492. def pbStartPokemonMenu
  493. # loads up the scene
  494. @scene.pbStartScene
  495. @scene.pbShowMenu
  496. loop do
  497. # main loop
  498. Graphics.update
  499. Input.update
  500. @scene.update
  501. if Input.repeat?(Input::DOWN)
  502. @scene.index += 1
  503. @scene.index = 0 if @scene.index > @scene.entries.length - 1
  504. $PokemonTemp.menuLastChoice = @scene.index
  505. pbSEPlay("SE_Select1")
  506. elsif Input.repeat?(Input::UP)
  507. @scene.index -= 1
  508. @scene.index = @scene.entries.length - 1 if @scene.index < 0
  509. $PokemonTemp.menuLastChoice = @scene.index
  510. pbSEPlay("SE_Select1")
  511. elsif Input.trigger?(Input::C)
  512. MenuHandlers.runAction(@scene.entries[@scene.index],@scene)
  513. end
  514. break if @scene.close || Input.trigger?(Input::B)
  515. end
  516. # used to dispose of the scene
  517. @scene.pbEndScene if @scene.endscene
  518. end
  519. end
  520. #-------------------------------------------------------------------------------
  521. # Your own entries for the pause menu
  522. #
  523. # How to use
  524. #
  525. # MenuHandlers.addEntry(:name,"button text","icon name",proc{|menu|
  526. # # code you want to run
  527. # # when the entry in the menu is selected
  528. # },proc{ # code to check if menu entry is available })
  529. #-------------------------------------------------------------------------------
  530. # PokeDex
  531. MenuHandlers.addEntry(:POKEDEX,_INTL("Pokédex"),"menuPokedex",proc{|menu|
  532. if DEXDEPENDSONLOCATION
  533. pbFadeOutIn(99999){
  534. scene = PokemonPokedex_Scene.new
  535. screen = PokemonPokedexScreen.new(scene)
  536. screen.pbStartScreen
  537. menu.refresh
  538. }
  539. else
  540. if $PokemonGlobal.pokedexViable.length==1
  541. $PokemonGlobal.pokedexDex = $PokemonGlobal.pokedexViable[0]
  542. $PokemonGlobal.pokedexDex = -1 if $PokemonGlobal.pokedexDex==$PokemonGlobal.pokedexUnlocked.length-1
  543. pbFadeOutIn(99999){
  544. scene = PokemonPokedex_Scene.new
  545. screen = PokemonPokedexScreen.new(scene)
  546. screen.pbStartScreen
  547. menu.refresh
  548. }
  549. else
  550. pbFadeOutIn(99999){
  551. scene = PokemonPokedexMenu_Scene.new
  552. screen = PokemonPokedexMenuScreen.new(scene)
  553. screen.pbStartScreen
  554. menu.refresh
  555. }
  556. end
  557. end
  558. },proc{ return $Trainer.pokedex && $PokemonGlobal.pokedexViable.length > 0 })
  559. # Party Screen
  560. MenuHandlers.addEntry(:POKEMON,_INTL("Pokémon"),"menuPokemon",proc{|menu|
  561. sscene = PokemonParty_Scene.new
  562. sscreen = PokemonPartyScreen.new(sscene,$Trainer.party)
  563. hiddenmove = nil
  564. pbFadeOutIn(99999) {
  565. hiddenmove = sscreen.pbPokemonScreen
  566. if hiddenmove
  567. menu.pbEndScene
  568. menu.endscene = false
  569. end
  570. }
  571. if hiddenmove
  572. Kernel.pbUseHiddenMove(hiddenmove[0],hiddenmove[1])
  573. menu.close = true
  574. end
  575. },proc{ return $Trainer.party.length > 0 })
  576. # Bag Screen
  577. MenuHandlers.addEntry(:BAG,_INTL("Bag"),"menuBag",proc{|menu|
  578. item = 0
  579. scene = PokemonBag_Scene.new
  580. screen = PokemonBagScreen.new(scene,$PokemonBag)
  581. pbFadeOutIn(99999) {
  582. item = screen.pbStartScreen
  583. if item > 0
  584. menu.pbEndScene
  585. menu.endscene = false
  586. end
  587. }
  588. if item > 0
  589. Kernel.pbUseKeyItemInField(item)
  590. menu.close = true
  591. end
  592. },proc{ return true })
  593. # Quest Menü
  594. MenuHandlers.addEntry(:QUESTS,_INTL("Quests"),"menuQuests",proc{|menu|
  595. scene = QuestScene.new
  596. screen = QuestScreen.new(scene)
  597. pbFadeOutIn(99999) {
  598. screen.pbStartScreen
  599. }
  600. },proc{ return true })
  601. # PokeGear
  602. MenuHandlers.addEntry(:POKEGEAR,_INTL("Pokégear"),"menuPokegear",proc{|menu|
  603. scene = PokemonPokegear_Scene.new
  604. screen = PokemonPokegearScreen.new(scene)
  605. pbFadeOutIn(99999) {
  606. screen.pbStartScreen
  607. }
  608. },proc{ return $Trainer.pokegear })
  609. # Trainer Card
  610. MenuHandlers.addEntry(:TRAINER,_INTL("\\pn"),"menuTrainer",proc{|menu|
  611. scene = PokemonTrainerCard_Scene.new
  612. screen = PokemonTrainerCardScreen.new(scene)
  613. pbFadeOutIn(99999) {
  614. screen.pbStartScreen
  615. }
  616. },proc{ return true })
  617. # Save Screen
  618. MenuHandlers.addEntry(:SAVE,_INTL("Save"),"menuSave",proc{|menu|
  619. scene = PokemonSave_Scene.new
  620. screen = PokemonSaveScreen.new(scene)
  621. menu.pbEndScene
  622. menu.endscene = false
  623. if screen.pbSaveScreen
  624. menu.close = true
  625. else
  626. menu.pbStartScene
  627. menu.pbShowMenu
  628. menu.close = false
  629. end
  630. },proc{ return !$game_system || !$game_system.save_disabled && !(pbInSafari? || pbInBugContest?)})
  631. # Quit Safari-Zone
  632. MenuHandlers.addEntry(:QUIT,_INTL("\\contest"),"menuQuit",proc{|menu|
  633. if pbInSafari?
  634. if Kernel.pbConfirmMessage(_INTL("Would you like to leave the Safari Game right now?"))
  635. menu.pbEndScene
  636. menu.endscene = false
  637. menu.close = true
  638. pbSafariState.decision=1
  639. pbSafariState.pbGoToStart
  640. end
  641. else
  642. if Kernel.pbConfirmMessage(_INTL("Would you like to end the Contest now?"))
  643. menu.pbEndScene
  644. menu.endscene = false
  645. menu.close = true
  646. pbBugContestState.pbStartJudging
  647. return
  648. end
  649. end
  650. },proc{ return pbInSafari? || pbInBugContest? })
  651. # Options Screen
  652. MenuHandlers.addEntry(:OPTIONS,_INTL("Options"),"menuOptions",proc{|menu|
  653. scene = PokemonOption_Scene.new
  654. screen = PokemonOptionScreen.new(scene)
  655. pbFadeOutIn(99999) {
  656. screen.pbStartScreen
  657. pbUpdateSceneMap
  658. }
  659. },proc{ return true })
  660. # Debug Menu
  661. MenuHandlers.addEntry(:DEBUG,_INTL("Debug"),"menuDebug",proc{|menu|
  662. pbFadeOutIn(99999) {
  663. pbDebugMenu
  664. menu.refresh
  665. }
  666. },proc{ return $DEBUG })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement