Fixed the "Confirm" button of the Key Changer screen not disabling again
...and also included a method call when backspace is pressed
@@ -111,6 +111,7 @@ public class KeyChangerScreen extends ContainerScreen<GenericTEContainer> {
{
Minecraft.getInstance().player.playSound(ForgeRegistries.SOUND_EVENTS.getValue(new ResourceLocation("random.click")), 0.15F, 1.0F);
focusedTextField.setText(Utils.removeLastChar(focusedTextField.getText()));
+ checkToEnableSaveButton();
return true;
}
}
@@ -148,10 +149,7 @@ public class KeyChangerScreen extends ContainerScreen<GenericTEContainer> {
String newPasscode = !textboxNewPasscode.getText().isEmpty() ? textboxNewPasscode.getText() : null;
String confirmedPasscode = !textboxConfirmPasscode.getText().isEmpty() ? textboxConfirmPasscode.getText() : null;
- if(newPasscode == null || confirmedPasscode == null) return;
- if(!newPasscode.equals(confirmedPasscode)) return;
-
- confirmButton.active = true;
+ confirmButton.active = !(newPasscode == null || confirmedPasscode == null) && newPasscode.equals(confirmedPasscode);
}
@Override
