Jump to content

Swirls

Members
  • Posts

    23
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Swirls's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  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!
×
×
  • Create New...

Important Information

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