Added spotless back and reformatted
This commit is contained in:
@@ -53,7 +53,7 @@ public class AETextField extends TextFieldWidget {
|
||||
* @param height absolute height
|
||||
*/
|
||||
public AETextField(final TextRenderer fontRenderer, final int xPos, final int yPos, final int width,
|
||||
final int height) {
|
||||
final int height) {
|
||||
super(fontRenderer, xPos + PADDING, yPos + PADDING, width - 2 * PADDING - (int) fontRenderer.getWidth("_"),
|
||||
height - 2 * PADDING, LiteralText.EMPTY);
|
||||
|
||||
@@ -87,11 +87,13 @@ public class AETextField extends TextFieldWidget {
|
||||
public void renderButton(MatrixStack matrices, int mouseX, int mouseY, float partial) {
|
||||
if (this.isVisible()) {
|
||||
if (this.isFocused()) {
|
||||
fill(matrices, this.x - PADDING + 1, this.y - PADDING + 1, this.x + this.width + this._fontPad + PADDING - 1,
|
||||
this.y + this.height + PADDING - 1, 0xFF606060);
|
||||
fill(matrices, this.x - PADDING + 1, this.y - PADDING + 1,
|
||||
this.x + this.width + this._fontPad + PADDING - 1, this.y + this.height + PADDING - 1,
|
||||
0xFF606060);
|
||||
} else {
|
||||
fill(matrices, this.x - PADDING + 1, this.y - PADDING + 1, this.x + this.width + this._fontPad + PADDING - 1,
|
||||
this.y + this.height + PADDING - 1, 0xFFA8A8A8);
|
||||
fill(matrices, this.x - PADDING + 1, this.y - PADDING + 1,
|
||||
this.x + this.width + this._fontPad + PADDING - 1, this.y + this.height + PADDING - 1,
|
||||
0xFFA8A8A8);
|
||||
}
|
||||
super.renderButton(matrices, mouseX, mouseY, partial);
|
||||
}
|
||||
|
||||
@@ -21,11 +21,12 @@ package appeng.client.gui.widgets;
|
||||
import java.util.function.Consumer;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
|
||||
public class ActionButton extends IconButton implements ITooltip {
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
|
||||
private final int iconIndex;
|
||||
|
||||
@@ -30,7 +30,8 @@ public abstract class CustomSlotWidget extends DrawableHelper implements IToolti
|
||||
public void slotClicked(final ItemStack clickStack, final int mouseButton) {
|
||||
}
|
||||
|
||||
public abstract void drawContent(final MinecraftClient mc, final int mouseX, final int mouseY, final float partialTicks);
|
||||
public abstract void drawContent(final MinecraftClient mc, final int mouseX, final int mouseY,
|
||||
final float partialTicks);
|
||||
|
||||
public void drawBackground(MatrixStack matrices, int guileft, int guitop, int currentZIndex) {
|
||||
}
|
||||
|
||||
@@ -28,8 +28,7 @@ import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public abstract class IconButton extends ButtonWidget implements ITooltip {
|
||||
public static final Identifier TEXTURE_STATES = new Identifier("appliedenergistics2",
|
||||
"textures/guis/states.png");
|
||||
public static final Identifier TEXTURE_STATES = new Identifier("appliedenergistics2", "textures/guis/states.png");
|
||||
|
||||
private boolean halfSize = false;
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class NumberBox extends TextFieldWidget {
|
||||
private long maxValue;
|
||||
|
||||
public NumberBox(final TextRenderer fontRenderer, final int x, final int y, final int width, final int height,
|
||||
final Class<?> type, LongConsumer changeListener) {
|
||||
final Class<?> type, LongConsumer changeListener) {
|
||||
super(fontRenderer, x, y, width, height, new LiteralText("0"));
|
||||
this.setText("0");
|
||||
setChangedListener(this::handleTextChanged);
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
package appeng.client.gui.widgets;
|
||||
|
||||
import appeng.container.interfaces.IProgressProvider;
|
||||
import appeng.core.localization.GuiText;
|
||||
import net.minecraft.client.MinecraftClient;
|
||||
import net.minecraft.client.gui.widget.AbstractButtonWidget;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
@@ -27,6 +25,9 @@ import net.minecraft.text.LiteralText;
|
||||
import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import appeng.container.interfaces.IProgressProvider;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class ProgressBar extends AbstractButtonWidget implements ITooltip {
|
||||
|
||||
private final IProgressProvider source;
|
||||
@@ -66,8 +67,7 @@ public class ProgressBar extends AbstractButtonWidget implements ITooltip {
|
||||
this.height - diff);
|
||||
} else {
|
||||
final int diff = this.width - (max > 0 ? (this.width * current) / max : 0);
|
||||
drawTexture(matrices, this.x, this.y, this.fill_u + diff, this.fill_v, this.width - diff,
|
||||
this.height);
|
||||
drawTexture(matrices, this.x, this.y, this.fill_u + diff, this.fill_v, this.width - diff, this.height);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,8 +83,7 @@ public class ProgressBar extends AbstractButtonWidget implements ITooltip {
|
||||
}
|
||||
|
||||
Text text = this.titleName != null ? this.titleName : LiteralText.EMPTY;
|
||||
return text.copy().append("\n" + this.source.getCurrentProgress() + " ")
|
||||
.append(GuiText.Of.text())
|
||||
return text.copy().append("\n" + this.source.getCurrentProgress() + " ").append(GuiText.Of.text())
|
||||
.append(" " + this.source.getMaxProgress());
|
||||
}
|
||||
|
||||
|
||||
@@ -20,10 +20,11 @@ package appeng.client.gui.widgets;
|
||||
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
import net.minecraft.client.gui.DrawableHelper;
|
||||
import net.minecraft.client.util.math.MatrixStack;
|
||||
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
|
||||
public class Scrollbar implements IScrollSource {
|
||||
|
||||
private int displayX = 0;
|
||||
@@ -36,7 +37,8 @@ public class Scrollbar implements IScrollSource {
|
||||
private int minScroll = 0;
|
||||
private int currentScroll = 0;
|
||||
|
||||
private final DrawableHelper drawable = new DrawableHelper(){};
|
||||
private final DrawableHelper drawable = new DrawableHelper() {
|
||||
};
|
||||
|
||||
public void draw(MatrixStack matrices, final AEBaseScreen<?> g) {
|
||||
g.bindTexture("minecraft", "gui/container/creative_inventory/tabs.png");
|
||||
|
||||
@@ -29,15 +29,14 @@ import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class TabButton extends ButtonWidget implements ITooltip {
|
||||
public static final Identifier TEXTURE_STATES = new Identifier("appliedenergistics2",
|
||||
"textures/guis/states.png");
|
||||
public static final Identifier TEXTURE_STATES = new Identifier("appliedenergistics2", "textures/guis/states.png");
|
||||
private final ItemRenderer itemRenderer;
|
||||
private int hideEdge = 0;
|
||||
private int myIcon = -1;
|
||||
private ItemStack myItem;
|
||||
|
||||
public TabButton(final int x, final int y, final int ico, final Text message, final ItemRenderer ir,
|
||||
PressAction onPress) {
|
||||
PressAction onPress) {
|
||||
super(x, y, 22, 22, message, onPress);
|
||||
|
||||
this.myIcon = ico;
|
||||
|
||||
@@ -30,8 +30,7 @@ import net.minecraft.text.Text;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
public class ToggleButton extends ButtonWidget implements ITooltip {
|
||||
public static final Identifier TEXTURE_STATES = new Identifier("appliedenergistics2",
|
||||
"textures/guis/states.png");
|
||||
public static final Identifier TEXTURE_STATES = new Identifier("appliedenergistics2", "textures/guis/states.png");
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
|
||||
private final int iconIdxOn;
|
||||
private final int iconIdxOff;
|
||||
|
||||
Reference in New Issue
Block a user