HorseNuggets / TerminatorPlus

the epic plugin
Eclipse Public License 2.0
145 stars 53 forks source link

TerminatorPlus Bot GUI #38

Open joeybalardeta opened 3 years ago

joeybalardeta commented 3 years ago

The main change that this pull request makes is the bot viewing GUI that is implemented. The GUI offers features like removing individual bots and viewing their stats, the GUI offers a page system to scale with any number of bots as well.

Now for the technical jargon of this pull request, in the bot class I have added one public method (botLore()), for grabbing some stats from the bot in a list of strings, this is mainly for the lore of the heads displayed on the GUI. I have also added one private variable (skinName), this is so the bot's head appears as the correct skin, not the skin the bot's display name is linked to. I've added a ui package to the project, this is to keep everything organized and tidy (along with fitting the style of the rest of the project). This ui package is where most of the new code lies. I won't talk too much about it here since it would take a lot of time, but the GUI for a single bot and the GUI for all the bots are separate classes. There is also an event handler to make sure interactions in these inventories (GUIs) go smoothly, we don't want people pulling items out of that. The UIManager also holds some relevant information, like HashMaps linking players to the inventories they are currently in (useful for seeing what they are clicking on). Lastly, I added a public method to PlayerUtils (getPlayerHead()) that returns an itemstack that is a model of the player's head, with the name it was given as it's one parameter.

Finally, below are some screenshots of the new GUI system at work. If you would like to see more, just dm me on discord (I'm aclownsquad).

Using /bot info: 2021-09-02_22 48 49

2021-09-02_22 49 07

Clicking on a bot in /bot info: 2021-09-02_22 49 22

2021-09-02_22 49 35

Using /bot info : 2021-09-02_22 31 53

joeybalardeta commented 3 years ago

The last picture is supposed to be the command /bot info (name). I labeled it incorrectly.

Badbird5907 commented 2 years ago

rewrote the gui to use a menu framework, I ported the framework from 1.8 so there may be a bug or two, but it works