v17 Mega Evolution Button in FRLG Battle Screen

This thread pertains to v17 of Pokémon Essentials.

BiggusWeeabus

"What's so funny about Biggus Dickus?"
Member
Joined
Sep 1, 2020
Posts
68
Age
20
So, i'm using the Battle Interface of this resource HERE.

A big problem about it is that the Mega Evolution button doesn't appear on the screen.
I've been looking on the original Battle interfaces script for the place the Mega Evolution button is defined, but i'm having no success...
 
Solution
Oh, I see, the issue was that the script turns off the other buttons as part of setting it up. So for an awkward workaround, find this:
Ruby:
    if PokeBattle_SceneConstants::USEFIGHTBOX
      @window.opacity=0
      @window.x=Graphics.width
      @info.opacity=0
      @info.x=Graphics.width+Graphics.width-96
      @buttons=FightMenuButtons.new(self.index,nil,viewport)
end

change the end to:
Ruby:
    else
      @buttons=MegaButtons.new(self.index,nil,viewport)
    end

And at the bottom of the script section, put this:
Ruby:
#For just mega button
class MegaButtons < BitmapSprite
  UPPERGAP=46

  def initialize(index=0,moves=nil,viewport=nil)
    super(Graphics.width,96+UPPERGAP,viewport)...

TechSkylander1518

Wiki Dweeb
Member
Joined
Mar 24, 2017
Posts
685
I ran the scripts through text compare, and everything that refers to the Mega button is exactly the same as in the default kit. Does your game still have a file named mega_cursor? And is everything set up to Mega Evolve when you're playtesting? (Both a Mega Ring and a Mega Stone)
 

BiggusWeeabus

"What's so funny about Biggus Dickus?"
Member
Joined
Sep 1, 2020
Posts
68
Age
20
I ran the scripts through text compare, and everything that refers to the Mega button is exactly the same as in the default kit. Does your game still have a file named mega_cursor? And is everything set up to Mega Evolve when you're playtesting? (Both a Mega Ring and a Mega Stone)
Everything is set up, Mega Evolution still works as It should, the only difference is the fact the button doesn't show up
 

TechSkylander1518

Wiki Dweeb
Member
Joined
Mar 24, 2017
Posts
685
Oh, I see, the issue was that the script turns off the other buttons as part of setting it up. So for an awkward workaround, find this:
Ruby:
    if PokeBattle_SceneConstants::USEFIGHTBOX
      @window.opacity=0
      @window.x=Graphics.width
      @info.opacity=0
      @info.x=Graphics.width+Graphics.width-96
      @buttons=FightMenuButtons.new(self.index,nil,viewport)
end

change the end to:
Ruby:
    else
      @buttons=MegaButtons.new(self.index,nil,viewport)
    end

And at the bottom of the script section, put this:
Ruby:
#For just mega button
class MegaButtons < BitmapSprite
  UPPERGAP=46

  def initialize(index=0,moves=nil,viewport=nil)
    super(Graphics.width,96+UPPERGAP,viewport)
    self.x=0
    self.y=Graphics.height-96-UPPERGAP
    pbSetNarrowFont(self.bitmap)
    @megaevobitmap=AnimatedBitmap.new(_INTL("Graphics/Pictures/Battle/cursor_mega"))
    refresh(index,moves,0)
  end

  def dispose
    @megaevobitmap.dispose
    super
  end

  def update(index=0,moves=nil,megaButton=0)
    refresh(index,moves,megaButton)
  end

  def refresh(index,moves,megaButton)
    return if !moves
    self.bitmap.clear
    textpos=[]
    if megaButton>0
      self.bitmap.blt(146,0,@megaevobitmap.bitmap,Rect.new(0,(megaButton-1)*46,96,46))
    end
  end
end

Ends up looking like this:
1616913825792.png
 
Solution
Top