From 5045736c2df49b6214c63dc78edff258ed39de0e Mon Sep 17 00:00:00 2001 From: Mary <33456283+FourIsTheNumber@users.noreply.github.com> Date: Wed, 24 Jul 2024 21:14:45 -0400 Subject: Update multi-machines to display running mode in GUI (#2755) * Framework for mode text in gui * Add getMachineModeName to all multimachines * Changed lang file for MFE because "Electromagnetic Polarizer" and "Electromagnetic Separator" are too long and make the GUI look bad * Removed leftover code * Removed more leftover code... oops * Moved logic to base class and made mode switch chat message localizable * Merge caused spotless to fail, I guess * Reverted logic from parent class * ahhhh spotless --- .../interfaces/modularui/ControllerWithOptionalFeatures.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/main/java/gregtech/api/interfaces') diff --git a/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java b/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java index a877492907..67e6a72776 100644 --- a/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java +++ b/src/main/java/gregtech/api/interfaces/modularui/ControllerWithOptionalFeatures.java @@ -132,6 +132,13 @@ public interface ControllerWithOptionalFeatures extends IVoidable, IRecipeLockab return 0; } + /** + * @return name for the current machine mode on this machine. Defaults "Unknown Mode" + */ + default String getMachineModeName() { + return "Unknown Mode"; + } + /** * @param index Index of machineModeIcons to pull from * @return UITexture associated with that machineMode @@ -161,6 +168,9 @@ public interface ControllerWithOptionalFeatures extends IVoidable, IRecipeLockab Pos2d getMachineModeSwitchButtonPos(); + /** + * Called when the mode switch button is clicked + */ default void onMachineModeSwitchClick() {} default ButtonWidget createModeSwitchButton(IWidgetBuilder builder) { -- cgit