Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Have the skills listed in the menu in ascending order instead of descending

Hi,

I am looking for a way to edit the skill menu so skills at the END of the database list will appear first. I know the simplest way to do this would be to rearrange the database, but let's assume I don't want to do that.
 

khmp

Sponsor

Scratch that. That's a stupid idea. This way you leave the data_skills alone and just reverse what's drawn.

Code:
#==============================================================================
# ** Window_Skill
#------------------------------------------------------------------------------
#  This window displays usable skills on the skill and battle screens.
#==============================================================================

class Window_Skill < Window_Selectable
  #--------------------------------------------------------------------------
  # * Refresh                                                      !OVERRIDE!
  #--------------------------------------------------------------------------
  def refresh
    if self.contents != nil
      self.contents.dispose
      self.contents = nil
    end
    @data = []
    for i in 0...@actor.skills.size
      skill = $data_skills[@actor.skills[i]]
      if skill != nil
        @data.push(skill)
      end
    end
    @data.reverse!
    # If item count is not 0, make a bit map and draw all items
    @item_max = @data.size
    if @item_max > 0
      self.contents = Bitmap.new(width - 32, row_max * 32)
      for i in 0...@item_max
        draw_item(i)
      end
    end
  end
end
 
EDIT: Because he edited his post too.
Second EDIT: That worked! Thank you very much. I just wish I could return the favor now... meh, if you ever put out a game, I'll review it and say it's totally amazing even if it's donkey crap.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top