Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

add an element to the vanilla world list!

 

What?

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

Oh. You're trying to add another line of text to the screen that lets you pick a world to play (the "load a save" screen).

 

The not-coremod way of doing this would be to create your own GUI screen and replace it when the vanilla one is invoked (there's events for that).

 

This probably isn't the best way (COG does stuff in a way that's a holdover from when another person was maintaining it, all I did was make sure that it continued to work on 1.10--also that code only adds a button to the "create new world" screen rather than replacing the entire GUI).

Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable.  If you think this is the case, JUST REPORT ME.  Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice.

 

Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked.

 

DO NOT PM ME WITH PROBLEMS. No help will be given.

  • Author

Oh. You're trying to add another line of text to the screen that lets you pick a world to play (the "load a save" screen).

 

The not-coremod way of doing this would be to create your own GUI screen and replace it when the vanilla one is invoked (there's events for that).

 

This probably isn't the best way (COG does stuff in a way that's a holdover from when another person was maintaining it, all I did was make sure that it continued to work on 1.10--also that code only adds a button to the "create new world" screen rather than replacing the entire GUI).

Whoahh, thank you so much!

Actually, that would be so easy if I wouldn't think so complicated!

First I tried to do it with java reflection! How stupid can I be? ;D:o

 

You probably do not need to replace the whole GuiScreen.

Is there another way to achieve this?

  • Author

Yeahhhhh, got my computer to work!

 

Now this is my result:

Unbenannt-2.png

 

Everything works perfectly! Thanks ^^

 

EDIT: If someone else has problems with this:

1. Copy the classes GuiWorldSelection, GuiListWorldSelection and GuiListWorldSelectionEntry to your mod and edit the drawEntry method in the GuiListWorldSelectionEntry class

2. Create an class that does this:

You can easily draw additional stuff onto an existing

GuiScreen

using

GuiScreenEvent.DrawScreenEvent

(you could also use the InitGuiEvent like I, depends on what you want to do! When the events are called is really self-explanatory)

And register the event in your client proxy or client side in your main mod or common proxy init method!

3. Here's the source for the event class:

http://pastebin.com/w1E98q97

 

Don't know if there's an easier way but I hope it helps ^^

Guest
This topic is now closed to further replies.

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.