The Great Renamening of 2020
This commit is contained in:
+3
-3
@@ -34,7 +34,7 @@ import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
*
|
||||
* The rendering does pay attention to the size of the '_' caret.
|
||||
*/
|
||||
public class MEGuiTextField extends TextFieldWidget {
|
||||
public class AETextField extends TextFieldWidget {
|
||||
private static final int PADDING = 2;
|
||||
|
||||
private final int _fontPad;
|
||||
@@ -50,8 +50,8 @@ public class MEGuiTextField extends TextFieldWidget {
|
||||
* @param width absolute width
|
||||
* @param height absolute height
|
||||
*/
|
||||
public MEGuiTextField(final FontRenderer fontRenderer, final int xPos, final int yPos, final int width,
|
||||
final int height) {
|
||||
public AETextField(final FontRenderer fontRenderer, final int xPos, final int yPos, final int width,
|
||||
final int height) {
|
||||
super(fontRenderer, xPos + PADDING, yPos + PADDING, width - 2 * PADDING - (int) fontRenderer.getCharWidth('_'),
|
||||
height - 2 * PADDING, "");
|
||||
|
||||
+2
-2
@@ -24,11 +24,11 @@ import java.util.regex.Pattern;
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
|
||||
public class GuiActionButton extends GuiIconButton implements ITooltip {
|
||||
public class ActionButton extends IconButton implements ITooltip {
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
|
||||
private final int iconIndex;
|
||||
|
||||
public GuiActionButton(final int x, final int y, final ActionItems action, Consumer<ActionItems> onPress) {
|
||||
public ActionButton(final int x, final int y, final ActionItems action, Consumer<ActionItems> onPress) {
|
||||
super(x, y, btn -> onPress.accept(action));
|
||||
|
||||
ButtonToolTips displayName;
|
||||
@@ -9,12 +9,12 @@ public final class CommonButtons {
|
||||
private CommonButtons() {
|
||||
}
|
||||
|
||||
public static GuiSettingToggleButton<PowerUnits> togglePowerUnit(int x, int y) {
|
||||
return new GuiSettingToggleButton<>(x, y, Settings.POWER_UNITS, AEConfig.instance().getSelectedPowerUnit(),
|
||||
public static SettingToggleButton<PowerUnits> togglePowerUnit(int x, int y) {
|
||||
return new SettingToggleButton<>(x, y, Settings.POWER_UNITS, AEConfig.instance().getSelectedPowerUnit(),
|
||||
CommonButtons::togglePowerUnit);
|
||||
}
|
||||
|
||||
private static void togglePowerUnit(GuiSettingToggleButton<PowerUnits> button, boolean backwards) {
|
||||
private static void togglePowerUnit(SettingToggleButton<PowerUnits> button, boolean backwards) {
|
||||
AEConfig.instance().nextPowerUnit(backwards);
|
||||
button.set(AEConfig.instance().getSelectedPowerUnit());
|
||||
}
|
||||
|
||||
+2
-2
@@ -6,12 +6,12 @@ import net.minecraft.client.gui.AbstractGui;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public abstract class GuiCustomSlot extends AbstractGui implements ITooltip {
|
||||
public abstract class CustomSlotWidget extends AbstractGui implements ITooltip {
|
||||
private final int x;
|
||||
private final int y;
|
||||
private final int id;
|
||||
|
||||
public GuiCustomSlot(final int id, final int x, final int y) {
|
||||
public CustomSlotWidget(final int id, final int x, final int y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.id = id;
|
||||
+2
-2
@@ -26,13 +26,13 @@ import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
public abstract class GuiIconButton extends Button implements ITooltip {
|
||||
public abstract class IconButton extends Button implements ITooltip {
|
||||
public static final ResourceLocation TEXTURE_STATES = new ResourceLocation("appliedenergistics2",
|
||||
"textures/guis/states.png");
|
||||
|
||||
private boolean halfSize = false;
|
||||
|
||||
public GuiIconButton(final int x, final int y, IPressable onPress) {
|
||||
public IconButton(final int x, final int y, IPressable onPress) {
|
||||
super(x, y, 16, 16, "", onPress);
|
||||
}
|
||||
|
||||
+3
-3
@@ -22,12 +22,12 @@ import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
|
||||
// FIXME: Fix this piece of crap (i.e. onChange listener)
|
||||
public class GuiNumberBox extends TextFieldWidget {
|
||||
public class NumberBox extends TextFieldWidget {
|
||||
|
||||
private final Class type;
|
||||
|
||||
public GuiNumberBox(final FontRenderer fontRenderer, final int x, final int y, final int width, final int height,
|
||||
final Class type) {
|
||||
public NumberBox(final FontRenderer fontRenderer, final int x, final int y, final int width, final int height,
|
||||
final Class type) {
|
||||
super(fontRenderer, x, y, width, height, "0");
|
||||
this.type = type;
|
||||
}
|
||||
+5
-5
@@ -26,7 +26,7 @@ import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import appeng.container.interfaces.IProgressProvider;
|
||||
import appeng.core.localization.GuiText;
|
||||
|
||||
public class GuiProgressBar extends Widget implements ITooltip {
|
||||
public class ProgressBar extends Widget implements ITooltip {
|
||||
|
||||
private final IProgressProvider source;
|
||||
private final ResourceLocation texture;
|
||||
@@ -36,13 +36,13 @@ public class GuiProgressBar extends Widget implements ITooltip {
|
||||
private final String titleName;
|
||||
private String fullMsg;
|
||||
|
||||
public GuiProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
|
||||
final int u, final int y, final int width, final int height, final Direction dir) {
|
||||
public ProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
|
||||
final int u, final int y, final int width, final int height, final Direction dir) {
|
||||
this(source, texture, posX, posY, u, y, width, height, dir, null);
|
||||
}
|
||||
|
||||
public GuiProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
|
||||
final int u, final int y, final int width, final int height, final Direction dir, final String title) {
|
||||
public ProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
|
||||
final int u, final int y, final int width, final int height, final Direction dir, final String title) {
|
||||
super(posX, posY, width, height, "");
|
||||
this.source = source;
|
||||
this.texture = new ResourceLocation("appliedenergistics2", "textures/" + texture);
|
||||
+7
-7
@@ -22,9 +22,9 @@ import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import appeng.client.gui.AEBaseGui;
|
||||
import appeng.client.gui.AEBaseScreen;
|
||||
|
||||
public class GuiScrollbar implements IScrollSource {
|
||||
public class Scrollbar implements IScrollSource {
|
||||
|
||||
private int displayX = 0;
|
||||
private int displayY = 0;
|
||||
@@ -36,7 +36,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
private int minScroll = 0;
|
||||
private int currentScroll = 0;
|
||||
|
||||
public void draw(final AEBaseGui<?> g) {
|
||||
public void draw(final AEBaseScreen<?> g) {
|
||||
g.bindTexture("minecraft", "gui/container/creative_inventory/tabs.png");
|
||||
RenderSystem.color4f(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
|
||||
@@ -58,7 +58,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
return this.displayX;
|
||||
}
|
||||
|
||||
public GuiScrollbar setLeft(final int v) {
|
||||
public Scrollbar setLeft(final int v) {
|
||||
this.displayX = v;
|
||||
return this;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
return this.displayY;
|
||||
}
|
||||
|
||||
public GuiScrollbar setTop(final int v) {
|
||||
public Scrollbar setTop(final int v) {
|
||||
this.displayY = v;
|
||||
return this;
|
||||
}
|
||||
@@ -76,7 +76,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
return this.width;
|
||||
}
|
||||
|
||||
public GuiScrollbar setWidth(final int v) {
|
||||
public Scrollbar setWidth(final int v) {
|
||||
this.width = v;
|
||||
return this;
|
||||
}
|
||||
@@ -85,7 +85,7 @@ public class GuiScrollbar implements IScrollSource {
|
||||
return this.height;
|
||||
}
|
||||
|
||||
public GuiScrollbar setHeight(final int v) {
|
||||
public Scrollbar setHeight(final int v) {
|
||||
this.height = v;
|
||||
return this;
|
||||
}
|
||||
+6
-6
@@ -20,19 +20,19 @@ package appeng.client.gui.widgets;
|
||||
|
||||
import appeng.api.config.Settings;
|
||||
import appeng.core.sync.network.NetworkHandler;
|
||||
import appeng.core.sync.packets.PacketConfigButton;
|
||||
import appeng.core.sync.packets.ConfigButtonPacket;
|
||||
|
||||
/**
|
||||
* Convenience button that automatically sends settings changes to the server.
|
||||
*/
|
||||
public class GuiServerSettingToggleButton<T extends Enum<T>> extends GuiSettingToggleButton<T> {
|
||||
public class ServerSettingToggleButton<T extends Enum<T>> extends SettingToggleButton<T> {
|
||||
|
||||
public GuiServerSettingToggleButton(final int x, final int y, final Settings setting, final T val) {
|
||||
super(x, y, setting, val, GuiServerSettingToggleButton::sendToServer);
|
||||
public ServerSettingToggleButton(final int x, final int y, final Settings setting, final T val) {
|
||||
super(x, y, setting, val, ServerSettingToggleButton::sendToServer);
|
||||
}
|
||||
|
||||
private static <T extends Enum<T>> void sendToServer(GuiSettingToggleButton<T> button, boolean backwards) {
|
||||
NetworkHandler.instance().sendToServer(new PacketConfigButton(button.getSetting(), backwards));
|
||||
private static <T extends Enum<T>> void sendToServer(SettingToggleButton<T> button, boolean backwards) {
|
||||
NetworkHandler.instance().sendToServer(new ConfigButtonPacket(button.getSetting(), backwards));
|
||||
}
|
||||
|
||||
}
|
||||
+10
-10
@@ -49,29 +49,29 @@ import appeng.api.config.YesNo;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
import appeng.util.EnumCycler;
|
||||
|
||||
public class GuiSettingToggleButton<T extends Enum<T>> extends GuiIconButton {
|
||||
public class SettingToggleButton<T extends Enum<T>> extends IconButton {
|
||||
private static final Pattern COMPILE = Pattern.compile("%s");
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
|
||||
private static Map<EnumPair, ButtonAppearance> appearances;
|
||||
private final Settings buttonSetting;
|
||||
private final IHandler<GuiSettingToggleButton<T>> onPress;
|
||||
private final IHandler<SettingToggleButton<T>> onPress;
|
||||
private final EnumSet<T> validValues;
|
||||
private String fillVar;
|
||||
private T currentValue;
|
||||
|
||||
@FunctionalInterface
|
||||
public interface IHandler<T extends GuiSettingToggleButton<?>> {
|
||||
public interface IHandler<T extends SettingToggleButton<?>> {
|
||||
void handle(T button, boolean backwards);
|
||||
}
|
||||
|
||||
public GuiSettingToggleButton(final int x, final int y, final Settings setting, final T val,
|
||||
IHandler<GuiSettingToggleButton<T>> onPress) {
|
||||
public SettingToggleButton(final int x, final int y, final Settings setting, final T val,
|
||||
IHandler<SettingToggleButton<T>> onPress) {
|
||||
this(x, y, setting, val, t -> true, onPress);
|
||||
}
|
||||
|
||||
public GuiSettingToggleButton(final int x, final int y, final Settings setting, final T val,
|
||||
Predicate<T> isValidValue, IHandler<GuiSettingToggleButton<T>> onPress) {
|
||||
super(x, y, GuiSettingToggleButton::onPress);
|
||||
public SettingToggleButton(final int x, final int y, final Settings setting, final T val,
|
||||
Predicate<T> isValidValue, IHandler<SettingToggleButton<T>> onPress) {
|
||||
super(x, y, SettingToggleButton::onPress);
|
||||
this.onPress = onPress;
|
||||
|
||||
// Build a list of values (in order) that are valid w.r.t. the given predicate
|
||||
@@ -223,8 +223,8 @@ public class GuiSettingToggleButton<T extends Enum<T>> extends GuiIconButton {
|
||||
}
|
||||
|
||||
private static void onPress(Button btn) {
|
||||
if (btn instanceof GuiSettingToggleButton) {
|
||||
((GuiSettingToggleButton<?>) btn).triggerPress();
|
||||
if (btn instanceof SettingToggleButton) {
|
||||
((SettingToggleButton<?>) btn).triggerPress();
|
||||
}
|
||||
}
|
||||
|
||||
+5
-5
@@ -27,7 +27,7 @@ import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GuiTabButton extends Button implements ITooltip {
|
||||
public class TabButton extends Button implements ITooltip {
|
||||
public static final ResourceLocation TEXTURE_STATES = new ResourceLocation("appliedenergistics2",
|
||||
"textures/guis/states.png");
|
||||
private final ItemRenderer itemRenderer;
|
||||
@@ -35,8 +35,8 @@ public class GuiTabButton extends Button implements ITooltip {
|
||||
private int myIcon = -1;
|
||||
private ItemStack myItem;
|
||||
|
||||
public GuiTabButton(final int x, final int y, final int ico, final String message, final ItemRenderer ir,
|
||||
IPressable onPress) {
|
||||
public TabButton(final int x, final int y, final int ico, final String message, final ItemRenderer ir,
|
||||
IPressable onPress) {
|
||||
super(x, y, 22, 22, message, onPress);
|
||||
|
||||
this.myIcon = ico;
|
||||
@@ -52,8 +52,8 @@ public class GuiTabButton extends Button implements ITooltip {
|
||||
* @param message mouse over message
|
||||
* @param ir renderer
|
||||
*/
|
||||
public GuiTabButton(final int x, final int y, final ItemStack ico, final String message, final ItemRenderer ir,
|
||||
IPressable onPress) {
|
||||
public TabButton(final int x, final int y, final ItemStack ico, final String message, final ItemRenderer ir,
|
||||
IPressable onPress) {
|
||||
super(x, y, 22, 22, message, onPress);
|
||||
this.myItem = ico;
|
||||
this.itemRenderer = ir;
|
||||
+3
-3
@@ -28,7 +28,7 @@ import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
public class GuiToggleButton extends Button implements ITooltip {
|
||||
public class ToggleButton extends Button implements ITooltip {
|
||||
public static final ResourceLocation TEXTURE_STATES = new ResourceLocation("appliedenergistics2",
|
||||
"textures/guis/states.png");
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
|
||||
@@ -40,8 +40,8 @@ public class GuiToggleButton extends Button implements ITooltip {
|
||||
|
||||
private boolean isActive;
|
||||
|
||||
public GuiToggleButton(final int x, final int y, final int on, final int off, final String displayName,
|
||||
final String displayHint, IPressable onPress) {
|
||||
public ToggleButton(final int x, final int y, final int on, final int off, final String displayName,
|
||||
final String displayHint, IPressable onPress) {
|
||||
super(x, y, 16, 16, "", onPress);
|
||||
this.iconIdxOn = on;
|
||||
this.iconIdxOff = off;
|
||||
Reference in New Issue
Block a user