Fix priority screen.
This commit is contained in:
@@ -32,13 +32,16 @@ public class ClientSetup {
|
|||||||
new ResourceLocation(RS.ID, "block/controller/cutouts/on")
|
new ResourceLocation(RS.ID, "block/controller/cutouts/on")
|
||||||
));
|
));
|
||||||
|
|
||||||
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "disk_drive"), (base, registry) -> new DiskDriveBakedModel(
|
bakedModelOverrideRegistry.add(new ResourceLocation(RS.ID, "disk_drive"), (base, registry) -> new FullbrightBakedModel(
|
||||||
|
new DiskDriveBakedModel(
|
||||||
base,
|
base,
|
||||||
registry.get(new ResourceLocation(RS.ID + ":block/disks/disk")),
|
registry.get(new ResourceLocation(RS.ID + ":block/disks/disk")),
|
||||||
registry.get(new ResourceLocation(RS.ID + ":block/disks/disk_near_capacity")),
|
registry.get(new ResourceLocation(RS.ID + ":block/disks/disk_near_capacity")),
|
||||||
registry.get(new ResourceLocation(RS.ID + ":block/disks/disk_full")),
|
registry.get(new ResourceLocation(RS.ID + ":block/disks/disk_full")),
|
||||||
registry.get(new ResourceLocation(RS.ID + ":block/disks/disk_disconnected"))
|
registry.get(new ResourceLocation(RS.ID + ":block/disks/disk_disconnected"))
|
||||||
));
|
),
|
||||||
|
new ResourceLocation(RS.ID, "block/disks/leds")
|
||||||
|
).disableCache());
|
||||||
|
|
||||||
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/disks/disk"));
|
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/disks/disk"));
|
||||||
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/disks/disk_near_capacity"));
|
ModelLoader.addSpecialModel(new ResourceLocation(RS.ID + ":block/disks/disk_near_capacity"));
|
||||||
|
@@ -6,28 +6,28 @@ import net.minecraft.client.gui.widget.button.Button;
|
|||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.inventory.container.Container;
|
import net.minecraft.inventory.container.Container;
|
||||||
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
import org.lwjgl.glfw.GLFW;
|
||||||
|
|
||||||
public abstract class GuiAmountSpecifying<T extends Container> extends BaseScreen<T> {
|
public abstract class AmountSpecifyingScreen<T extends Container> extends BaseScreen<T> {
|
||||||
protected TextFieldWidget amountField;
|
|
||||||
|
|
||||||
private BaseScreen parent;
|
private BaseScreen parent;
|
||||||
|
|
||||||
|
protected TextFieldWidget amountField;
|
||||||
|
|
||||||
protected Button okButton;
|
protected Button okButton;
|
||||||
private Button cancelButton;
|
private Button cancelButton;
|
||||||
|
|
||||||
private Button[] incrementButtons = new Button[6];
|
private Button[] incrementButtons = new Button[6];
|
||||||
|
|
||||||
public GuiAmountSpecifying(BaseScreen parent, T container, int width, int height, PlayerInventory playerInventory) {
|
public AmountSpecifyingScreen(BaseScreen parent, T container, int width, int height, PlayerInventory playerInventory, ITextComponent title) {
|
||||||
super(container, width, height, playerInventory, null);
|
super(container, width, height, playerInventory, title);
|
||||||
|
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract String getOkButtonText();
|
protected abstract String getOkButtonText();
|
||||||
|
|
||||||
protected abstract String getGuiTitle();
|
|
||||||
|
|
||||||
protected abstract String getTexture();
|
protected abstract String getTexture();
|
||||||
|
|
||||||
protected abstract int[] getIncrements();
|
protected abstract int[] getIncrements();
|
||||||
@@ -50,10 +50,8 @@ public abstract class GuiAmountSpecifying<T extends Container> extends BaseScree
|
|||||||
public void init(int x, int y) {
|
public void init(int x, int y) {
|
||||||
Pair<Integer, Integer> pos = getOkCancelPos();
|
Pair<Integer, Integer> pos = getOkCancelPos();
|
||||||
|
|
||||||
okButton = addButton(x + pos.getLeft(), y + pos.getRight(), 50, 20, getOkButtonText(), true, true, btn -> {
|
okButton = addButton(x + pos.getLeft(), y + pos.getRight(), 50, 20, getOkButtonText(), true, true, btn -> onOkButtonPressed(hasShiftDown()));
|
||||||
});
|
cancelButton = addButton(x + pos.getLeft(), y + pos.getRight() + 24, 50, 20, I18n.format("gui.cancel"), true, true, btn -> close());
|
||||||
cancelButton = addButton(x + pos.getLeft(), y + pos.getRight() + 24, 50, 20, I18n.format("gui.cancel"), true, true, btn -> {
|
|
||||||
});
|
|
||||||
|
|
||||||
amountField = new TextFieldWidget(font, x + getAmountPos().getLeft(), y + getAmountPos().getRight(), 69 - 6, font.FONT_HEIGHT, "");
|
amountField = new TextFieldWidget(font, x + getAmountPos().getLeft(), y + getAmountPos().getRight(), 69 - 6, font.FONT_HEIGHT, "");
|
||||||
amountField.setEnableBackgroundDrawing(false);
|
amountField.setEnableBackgroundDrawing(false);
|
||||||
@@ -61,7 +59,11 @@ public abstract class GuiAmountSpecifying<T extends Container> extends BaseScree
|
|||||||
amountField.setText(String.valueOf(getDefaultAmount()));
|
amountField.setText(String.valueOf(getDefaultAmount()));
|
||||||
amountField.setTextColor(16777215);
|
amountField.setTextColor(16777215);
|
||||||
amountField.setCanLoseFocus(false);
|
amountField.setCanLoseFocus(false);
|
||||||
amountField.setFocused2(true);
|
amountField.changeFocus(true);
|
||||||
|
|
||||||
|
addButton(amountField);
|
||||||
|
|
||||||
|
setFocused(amountField);
|
||||||
|
|
||||||
int[] increments = getIncrements();
|
int[] increments = getIncrements();
|
||||||
|
|
||||||
@@ -69,14 +71,15 @@ public abstract class GuiAmountSpecifying<T extends Container> extends BaseScree
|
|||||||
int width = 30;
|
int width = 30;
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
String text = "+" + increments[i];
|
int increment = increments[i];
|
||||||
|
|
||||||
|
String text = "+" + increment;
|
||||||
|
|
||||||
if (text.equals("+1000")) {
|
if (text.equals("+1000")) {
|
||||||
text = "+1B";
|
text = "+1B";
|
||||||
}
|
}
|
||||||
|
|
||||||
incrementButtons[i] = addButton(x + xx, y + 20, width, 20, text, true, true, btn -> {
|
incrementButtons[i] = addButton(x + xx, y + 20, width, 20, text, true, true, btn -> onIncrementButtonClicked(increment));
|
||||||
});
|
|
||||||
|
|
||||||
xx += width + 3;
|
xx += width + 3;
|
||||||
}
|
}
|
||||||
@@ -84,19 +87,65 @@ public abstract class GuiAmountSpecifying<T extends Container> extends BaseScree
|
|||||||
xx = 7;
|
xx = 7;
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 3; ++i) {
|
||||||
String text = "-" + increments[i];
|
int increment = increments[i];
|
||||||
|
|
||||||
|
String text = "-" + increment;
|
||||||
|
|
||||||
if (text.equals("-1000")) {
|
if (text.equals("-1000")) {
|
||||||
text = "-1B";
|
text = "-1B";
|
||||||
}
|
}
|
||||||
|
|
||||||
incrementButtons[3 + i] = addButton(x + xx, y + ySize - 20 - 7, width, 20, text, true, true, btn -> {
|
incrementButtons[3 + i] = addButton(x + xx, y + ySize - 20 - 7, width, 20, text, true, true, btn -> onIncrementButtonClicked(-increment));
|
||||||
});
|
|
||||||
|
|
||||||
xx += width + 3;
|
xx += width + 3;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean keyPressed(int key, int scanCode, int modifiers) {
|
||||||
|
if (key == GLFW.GLFW_KEY_ESCAPE) {
|
||||||
|
close();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key == GLFW.GLFW_KEY_ENTER || key == GLFW.GLFW_KEY_KP_ENTER) {
|
||||||
|
onOkButtonPressed(hasShiftDown());
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (amountField.keyPressed(key, scanCode, modifiers)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return super.keyPressed(key, scanCode, modifiers);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onIncrementButtonClicked(int increment) {
|
||||||
|
int oldAmount = 0;
|
||||||
|
|
||||||
|
try {
|
||||||
|
oldAmount = Integer.parseInt(amountField.getText());
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
// NO OP
|
||||||
|
}
|
||||||
|
|
||||||
|
int newAmount = increment;
|
||||||
|
|
||||||
|
if (!canAmountGoNegative()) {
|
||||||
|
newAmount = Math.max(1, ((oldAmount == 1 && newAmount != 1) ? 0 : oldAmount) + newAmount);
|
||||||
|
} else {
|
||||||
|
newAmount = oldAmount + newAmount;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newAmount > getMaxAmount()) {
|
||||||
|
newAmount = getMaxAmount();
|
||||||
|
}
|
||||||
|
|
||||||
|
amountField.setText(String.valueOf(newAmount));
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void tick(int x, int y) {
|
public void tick(int x, int y) {
|
||||||
// NO OP
|
// NO OP
|
||||||
@@ -113,76 +162,15 @@ public abstract class GuiAmountSpecifying<T extends Container> extends BaseScree
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderForeground(int mouseX, int mouseY) {
|
public void renderForeground(int mouseX, int mouseY) {
|
||||||
renderString(7, 7, getGuiTitle());
|
renderString(7, 7, title.getFormattedText());
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO
|
|
||||||
@Override
|
|
||||||
protected void keyTyped(char character, int keyCode) throws IOException {
|
|
||||||
if (!checkHotbarKeys(keyCode) && amountField.textboxKeyTyped(character, keyCode)) {
|
|
||||||
// NO OP
|
|
||||||
} else {
|
|
||||||
if (keyCode == Keyboard.KEY_RETURN) {
|
|
||||||
onOkButtonPressed(isShiftKeyDown());
|
|
||||||
} else if (keyCode == Keyboard.KEY_ESCAPE) {
|
|
||||||
close();
|
|
||||||
} else {
|
|
||||||
super.keyTyped(character, keyCode);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void actionPerformed(GuiButton button) throws IOException {
|
|
||||||
super.actionPerformed(button);
|
|
||||||
|
|
||||||
if (button.id == okButton.id) {
|
|
||||||
onOkButtonPressed(isShiftKeyDown());
|
|
||||||
} else if (button.id == cancelButton.id) {
|
|
||||||
close();
|
|
||||||
} else {
|
|
||||||
for (GuiButton incrementButton : incrementButtons) {
|
|
||||||
if (incrementButton.id == button.id) {
|
|
||||||
Integer oldAmount = Ints.tryParse(amountField.getText());
|
|
||||||
|
|
||||||
if (oldAmount == null) {
|
|
||||||
oldAmount = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
String incrementButtonText = incrementButton.displayString;
|
|
||||||
|
|
||||||
if (incrementButtonText.equals("+1B")) {
|
|
||||||
incrementButtonText = "1000";
|
|
||||||
} else if (incrementButtonText.equals("-1B")) {
|
|
||||||
incrementButtonText = "-1000";
|
|
||||||
}
|
|
||||||
|
|
||||||
int newAmount = Integer.parseInt(incrementButtonText);
|
|
||||||
|
|
||||||
if (!canAmountGoNegative()) {
|
|
||||||
newAmount = Math.max(1, ((oldAmount == 1 && newAmount != 1) ? 0 : oldAmount) + newAmount);
|
|
||||||
} else {
|
|
||||||
newAmount = oldAmount + newAmount;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (newAmount > getMaxAmount()) {
|
|
||||||
newAmount = getMaxAmount();
|
|
||||||
}
|
|
||||||
|
|
||||||
amountField.setText(String.valueOf(newAmount));
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
protected void onOkButtonPressed(boolean shiftDown) {
|
protected void onOkButtonPressed(boolean shiftDown) {
|
||||||
// NO OP
|
// NO OP
|
||||||
}
|
}
|
||||||
|
|
||||||
public void close() {
|
public void close() {
|
||||||
// TODO FMLClientHandler.instance().showGuiScreen(parent);
|
minecraft.displayGuiScreen(parent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public BaseScreen getParent() {
|
public BaseScreen getParent() {
|
@@ -5,14 +5,15 @@ import com.raoulvdberge.refinedstorage.container.AmountContainer;
|
|||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.text.TranslationTextComponent;
|
||||||
|
|
||||||
public class GuiAmount extends GuiAmountSpecifying<AmountContainer> {
|
public class GuiAmount extends AmountSpecifyingScreen<AmountContainer> {
|
||||||
private int containerSlot;
|
private int containerSlot;
|
||||||
private ItemStack stack;
|
private ItemStack stack;
|
||||||
private int maxAmount;
|
private int maxAmount;
|
||||||
|
|
||||||
public GuiAmount(BaseScreen parent, PlayerEntity player, int containerSlot, ItemStack stack, int maxAmount) {
|
public GuiAmount(BaseScreen parent, PlayerEntity player, int containerSlot, ItemStack stack, int maxAmount) {
|
||||||
super(parent, new AmountContainer(player, stack), 172, 99, player.inventory);
|
super(parent, new AmountContainer(player, stack), 172, 99, player.inventory, new TranslationTextComponent("gui.refinedstorage:item_amount"));
|
||||||
|
|
||||||
this.containerSlot = containerSlot;
|
this.containerSlot = containerSlot;
|
||||||
this.stack = stack;
|
this.stack = stack;
|
||||||
@@ -39,11 +40,6 @@ public class GuiAmount extends GuiAmountSpecifying<AmountContainer> {
|
|||||||
return I18n.format("misc.refinedstorage:set");
|
return I18n.format("misc.refinedstorage:set");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getGuiTitle() {
|
|
||||||
return I18n.format("gui.refinedstorage:item_amount");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTexture() {
|
protected String getTexture() {
|
||||||
return "gui/crafting_settings.png";
|
return "gui/crafting_settings.png";
|
||||||
|
@@ -4,15 +4,16 @@ import com.google.common.primitives.Ints;
|
|||||||
import com.raoulvdberge.refinedstorage.container.FluidAmountContainer;
|
import com.raoulvdberge.refinedstorage.container.FluidAmountContainer;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.util.text.TranslationTextComponent;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
public class GuiFluidAmount extends GuiAmountSpecifying<FluidAmountContainer> {
|
public class GuiFluidAmount extends AmountSpecifyingScreen<FluidAmountContainer> {
|
||||||
private int containerSlot;
|
private int containerSlot;
|
||||||
private FluidStack stack;
|
private FluidStack stack;
|
||||||
private int maxAmount;
|
private int maxAmount;
|
||||||
|
|
||||||
public GuiFluidAmount(BaseScreen parent, PlayerEntity player, int containerSlot, FluidStack stack, int maxAmount) {
|
public GuiFluidAmount(BaseScreen parent, PlayerEntity player, int containerSlot, FluidStack stack, int maxAmount) {
|
||||||
super(parent, new FluidAmountContainer(player, stack), 172, 99, player.inventory);
|
super(parent, new FluidAmountContainer(player, stack), 172, 99, player.inventory, new TranslationTextComponent("gui.refinedstorage:fluid_amount"));
|
||||||
|
|
||||||
this.containerSlot = containerSlot;
|
this.containerSlot = containerSlot;
|
||||||
this.stack = stack;
|
this.stack = stack;
|
||||||
@@ -39,11 +40,6 @@ public class GuiFluidAmount extends GuiAmountSpecifying<FluidAmountContainer> {
|
|||||||
return I18n.format("misc.refinedstorage:set");
|
return I18n.format("misc.refinedstorage:set");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getGuiTitle() {
|
|
||||||
return I18n.format("gui.refinedstorage:fluid_amount");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTexture() {
|
protected String getTexture() {
|
||||||
return "gui/crafting_settings.png";
|
return "gui/crafting_settings.png";
|
||||||
|
@@ -1,24 +1,24 @@
|
|||||||
package com.raoulvdberge.refinedstorage.screen;
|
package com.raoulvdberge.refinedstorage.screen;
|
||||||
|
|
||||||
import com.google.common.primitives.Ints;
|
|
||||||
import com.raoulvdberge.refinedstorage.tile.data.TileDataManager;
|
import com.raoulvdberge.refinedstorage.tile.data.TileDataManager;
|
||||||
import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter;
|
import com.raoulvdberge.refinedstorage.tile.data.TileDataParameter;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.inventory.container.Container;
|
import net.minecraft.inventory.container.Container;
|
||||||
|
import net.minecraft.util.text.TranslationTextComponent;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
public class GuiPriority extends GuiAmountSpecifying<Container> {
|
public class PriorityScreen extends AmountSpecifyingScreen<Container> {
|
||||||
private TileDataParameter<Integer, ?> priority;
|
private TileDataParameter<Integer, ?> priority;
|
||||||
|
|
||||||
public GuiPriority(BaseScreen parent, TileDataParameter<Integer, ?> priority, PlayerInventory inventory) {
|
public PriorityScreen(BaseScreen parent, TileDataParameter<Integer, ?> priority, PlayerInventory inventory) {
|
||||||
super(parent, new Container(null, 0) { // TODO ctor
|
super(parent, new Container(null, 0) {
|
||||||
@Override
|
@Override
|
||||||
public boolean canInteractWith(PlayerEntity player) {
|
public boolean canInteractWith(PlayerEntity player) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}, 164, 92, inventory);
|
}, 164, 92, inventory, new TranslationTextComponent("misc.refinedstorage:priority"));
|
||||||
|
|
||||||
this.priority = priority;
|
this.priority = priority;
|
||||||
}
|
}
|
||||||
@@ -33,11 +33,6 @@ public class GuiPriority extends GuiAmountSpecifying<Container> {
|
|||||||
return I18n.format("misc.refinedstorage:set");
|
return I18n.format("misc.refinedstorage:set");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getGuiTitle() {
|
|
||||||
return I18n.format("misc.refinedstorage:priority");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTexture() {
|
protected String getTexture() {
|
||||||
return "gui/priority.png";
|
return "gui/priority.png";
|
||||||
@@ -73,12 +68,14 @@ public class GuiPriority extends GuiAmountSpecifying<Container> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onOkButtonPressed(boolean noPreview) {
|
protected void onOkButtonPressed(boolean noPreview) {
|
||||||
Integer amount = Ints.tryParse(amountField.getText());
|
try {
|
||||||
|
int amount = Integer.parseInt(amountField.getText());
|
||||||
|
|
||||||
if (amount != null) {
|
|
||||||
TileDataManager.setParameter(priority, amount);
|
TileDataManager.setParameter(priority, amount);
|
||||||
|
|
||||||
close();
|
close();
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
// NO OP
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -84,6 +84,7 @@ public class StorageScreen<T extends Container> extends BaseScreen<T> {
|
|||||||
int buttonWidth = 10 + font.getStringWidth(I18n.format("misc.refinedstorage:priority"));
|
int buttonWidth = 10 + font.getStringWidth(I18n.format("misc.refinedstorage:priority"));
|
||||||
|
|
||||||
priorityButton = addButton(x + 169 - buttonWidth, y + 41, buttonWidth, 20, I18n.format("misc.refinedstorage:priority"), true, true, btn -> {
|
priorityButton = addButton(x + 169 - buttonWidth, y + 41, buttonWidth, 20, I18n.format("misc.refinedstorage:priority"), true, true, btn -> {
|
||||||
|
minecraft.displayGuiScreen(new PriorityScreen(this, priorityParameter, playerInventory));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -125,14 +126,4 @@ public class StorageScreen<T extends Container> extends BaseScreen<T> {
|
|||||||
) + "\n" + TextFormatting.GRAY + I18n.format("misc.refinedstorage.storage.full", full));
|
) + "\n" + TextFormatting.GRAY + I18n.format("misc.refinedstorage.storage.full", full));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* TODO
|
|
||||||
@Override
|
|
||||||
protected void actionPerformed(GuiButton button) throws IOException {
|
|
||||||
super.actionPerformed(button);
|
|
||||||
|
|
||||||
if (button == priorityButton) {
|
|
||||||
FMLCommonHandler.instance().showGuiScreen(new GuiPriority(this, gui.getPriorityParameter()));
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
@@ -2,19 +2,20 @@ package com.raoulvdberge.refinedstorage.screen.grid;
|
|||||||
|
|
||||||
import com.google.common.primitives.Ints;
|
import com.google.common.primitives.Ints;
|
||||||
import com.raoulvdberge.refinedstorage.container.CraftingSettingsContainer;
|
import com.raoulvdberge.refinedstorage.container.CraftingSettingsContainer;
|
||||||
|
import com.raoulvdberge.refinedstorage.screen.AmountSpecifyingScreen;
|
||||||
import com.raoulvdberge.refinedstorage.screen.BaseScreen;
|
import com.raoulvdberge.refinedstorage.screen.BaseScreen;
|
||||||
import com.raoulvdberge.refinedstorage.screen.GuiAmountSpecifying;
|
|
||||||
import com.raoulvdberge.refinedstorage.screen.grid.stack.GridStackFluid;
|
import com.raoulvdberge.refinedstorage.screen.grid.stack.GridStackFluid;
|
||||||
import com.raoulvdberge.refinedstorage.screen.grid.stack.IGridStack;
|
import com.raoulvdberge.refinedstorage.screen.grid.stack.IGridStack;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
import net.minecraft.util.text.TranslationTextComponent;
|
||||||
import net.minecraftforge.fluids.FluidAttributes;
|
import net.minecraftforge.fluids.FluidAttributes;
|
||||||
|
|
||||||
public class GuiGridCraftingSettings extends GuiAmountSpecifying<CraftingSettingsContainer> {
|
public class GuiGridCraftingSettings extends AmountSpecifyingScreen<CraftingSettingsContainer> {
|
||||||
private IGridStack stack;
|
private IGridStack stack;
|
||||||
|
|
||||||
public GuiGridCraftingSettings(BaseScreen parent, PlayerEntity player, IGridStack stack) {
|
public GuiGridCraftingSettings(BaseScreen parent, PlayerEntity player, IGridStack stack) {
|
||||||
super(parent, new CraftingSettingsContainer(player, stack), 172, 99, player.inventory);
|
super(parent, new CraftingSettingsContainer(player, stack), 172, 99, player.inventory, new TranslationTextComponent("container.crafting"));
|
||||||
|
|
||||||
this.stack = stack;
|
this.stack = stack;
|
||||||
}
|
}
|
||||||
@@ -24,11 +25,6 @@ public class GuiGridCraftingSettings extends GuiAmountSpecifying<CraftingSetting
|
|||||||
return I18n.format("misc.refinedstorage:start");
|
return I18n.format("misc.refinedstorage:start");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected String getGuiTitle() {
|
|
||||||
return I18n.format("container.crafting");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected String getTexture() {
|
protected String getTexture() {
|
||||||
return "gui/crafting_settings.png";
|
return "gui/crafting_settings.png";
|
||||||
|
Reference in New Issue
Block a user