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.

Swirls

Members
  • Joined

  • Last visited

  1. I'm just asking for some tips what should I do, and for making topics i will stick to one from nowon
  2. Hello, I need help with creating a button subclass, and overriding the relevant method(s). I want to change color of a button, also onHover. I've been told I cant do this with the default Button. Any help would be appreciated, thanks in forward.
  3. Oh, that makes sense now, thank you
  4. Hello, I was wondering if it is possible to change a color of a button added with addWidget method? Also if its possible to change color onHover? event.addWidget(new Button(154, 33, 31, 14, "", new CustomAction())); Thanks!
  5. Its working after changing from .Pre to .Post, thank you very much for your time!
  6. So basically instead of .Pre i would use .Post
  7. Sorry, but i dont understand
  8. Isnt the event called with event handler?
  9. Once again, I've been told on discord that event is called with event handler.
  10. Sure, This is the code after I removed Bus.MOD and changed x,y,height,width of button @Mod.EventBusSubscriber(modid = StudyingMod.MOD_ID, bus = Bus.FORGE, value = Dist.CLIENT) public class SurvivalInventory { @SubscribeEvent public static void addCustomButtonToInventory(GuiScreenEvent.InitGuiEvent.Pre event) { if (event.getGui() instanceof InventoryScreen) { event.addWidget(new Button(154, 33, 31, 14, "test", new CustomAction())); } } public static class CustomAction implements IPressable { public void onPress(Button button) { } } }
  11. Again, it's not working for some reason. I tried changing x, y of the button but didn't help. At this point i really don't know what to do
  12. Should i remove it completely?
  13. Hello there, I added a addWidget method to instance of InventoryScreen but it seems not to work. I don't know what might be causing the issue. Perhaps its my event handler. @Mod.EventBusSubscriber(modid = StudyingMod.MOD_ID, bus = Bus.MOD, value = Dist.CLIENT) public class SurvivalInventory { @SubscribeEvent public static void addCustomButtonToInventory(GuiScreenEvent.InitGuiEvent.Pre event) { if (event.getGui() instanceof InventoryScreen) { event.addWidget(new Button(8, 12, 6, 3, "test", new CustomAction())); } } public static class CustomAction implements IPressable { public void onPress(Button button) { } } } If anyone knows what the issue might be, help would be really appreciated. Thanks in forward!
  14. I have my event handler, but anyways doesn't seem to be working. Well I will work something out. thank you for your time!

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.