Pages - Neat and tidy display which doesn't flood the chat.

Discussion in 'Resources' started by Adamki11s, Feb 4, 2013.

Thread Status:
Not open for further replies.
  1. I've seen a few posts around on plugin development over the past few weeks with regard to creating a set of 'pages' which the user can toggle between. The purpose of this class is the organise and return a set of strings from an array provided so that this can be neatly displayed to a Player, this is especially useful if you have a lot of information which cannot be squeezed into the chat.

    To use this class all you need to do is copy all of the code provided below into a class, preferably named Pages.

    The usage is very simple, just pass in the String[] and items per page you want to be displayed to the user, and then run getStringsToSend(int page) to retrieve the Strings from a certain page, if you specify a page out of bounds it will return an empty array, so the getPages() function should be used to check a page is within the range.

    The latest version of the class can be found on my GitHub.

    https://github.com/Adamki11s/QuestX/blob/master/src/com/adamki11s/display/Pages.java
     
Thread Status:
Not open for further replies.

Share This Page