Display Username
Alright so this is a quick short tutorial for you lot.
So, this is just a simple code to show your username on the Main Menu, a bit like this.
Ok, to get started, open up your custom MainMenu. If you're lazy and cant be bothered to create hooks for guis, go ahead and open up GuiMainMenu. Its pretty much the same thing.
Next scroll down to where the "Copyright blah blah stuff. Do not distribute!" is. Then underneath the drawstring of the var10 (which is the Copyright thing), initialize a String called whatever. This string will get the username from Session class.
After, we just have to draw the string.
So overall, your code should look a little bit like this...
Of-course you can just do this.fontRenderer, "Username: " + user,... but its just more convenient for me like this.
So, this is just a simple code to show your username on the Main Menu, a bit like this.
Display
Ok, to get started, open up your custom MainMenu. If you're lazy and cant be bothered to create hooks for guis, go ahead and open up GuiMainMenu. Its pretty much the same thing.
Next scroll down to where the "Copyright blah blah stuff. Do not distribute!" is. Then underneath the drawstring of the var10 (which is the Copyright thing), initialize a String called whatever. This string will get the username from Session class.
After, we just have to draw the string.
So overall, your code should look a little bit like this...
Code:
String user = Session.username;
String var89 = "Username: " + user;
this.drawString(this.fontRenderer, var89, this.width / 2 + 10, this.height / 2 - 5, 0xffffff);
Of-course you can just do this.fontRenderer, "Username: " + user,... but its just more convenient for me like this.
And yeah I like Xenons main menu, but i wont just copy the looks of it
Id like to make something more unique-ish.. Maybe ill redo the whole client and create maybe a new main menu or stuff, but for now Im sticking with what ive got and what I made.