translations for sidebuttons + basic sidebuttons for grid sorting
This commit is contained in:
@@ -19,8 +19,8 @@ public class GuiExporter extends GuiBase {
|
|||||||
public void init(int x, int y) {
|
public void init(int x, int y) {
|
||||||
addSideButton(new SideButtonRedstoneMode(exporter));
|
addSideButton(new SideButtonRedstoneMode(exporter));
|
||||||
|
|
||||||
addSideButton(new SideButtonCompare(exporter, "NBT", InventoryUtils.COMPARE_NBT));
|
addSideButton(new SideButtonCompare(exporter, InventoryUtils.COMPARE_DAMAGE));
|
||||||
addSideButton(new SideButtonCompare(exporter, "Damage", InventoryUtils.COMPARE_DAMAGE));
|
addSideButton(new SideButtonCompare(exporter, InventoryUtils.COMPARE_NBT));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -9,6 +9,8 @@ import org.lwjgl.input.Keyboard;
|
|||||||
import org.lwjgl.input.Mouse;
|
import org.lwjgl.input.Mouse;
|
||||||
import storagecraft.StorageCraft;
|
import storagecraft.StorageCraft;
|
||||||
import storagecraft.container.ContainerGrid;
|
import storagecraft.container.ContainerGrid;
|
||||||
|
import storagecraft.gui.sidebutton.SideButtonGridSortingDirection;
|
||||||
|
import storagecraft.gui.sidebutton.SideButtonGridSortingType;
|
||||||
import storagecraft.gui.sidebutton.SideButtonRedstoneMode;
|
import storagecraft.gui.sidebutton.SideButtonRedstoneMode;
|
||||||
import storagecraft.network.MessageStoragePull;
|
import storagecraft.network.MessageStoragePull;
|
||||||
import storagecraft.network.MessageStoragePush;
|
import storagecraft.network.MessageStoragePush;
|
||||||
@@ -17,6 +19,15 @@ import storagecraft.tile.TileController;
|
|||||||
import storagecraft.tile.TileGrid;
|
import storagecraft.tile.TileGrid;
|
||||||
|
|
||||||
public class GuiGrid extends GuiBase {
|
public class GuiGrid extends GuiBase {
|
||||||
|
public static final int SORTING_DIRECTION_ASCENDING = 0;
|
||||||
|
public static final int SORTING_DIRECTION_DESCENDING = 1;
|
||||||
|
|
||||||
|
public static final int SORTING_TYPE_COUNT = 0;
|
||||||
|
public static final int SORTING_TYPE_NAME = 1;
|
||||||
|
|
||||||
|
public static int SORTING_DIRECTION = SORTING_DIRECTION_ASCENDING;
|
||||||
|
public static int SORTING_TYPE = SORTING_TYPE_COUNT;
|
||||||
|
|
||||||
private ContainerGrid container;
|
private ContainerGrid container;
|
||||||
private TileGrid grid;
|
private TileGrid grid;
|
||||||
|
|
||||||
@@ -38,6 +49,9 @@ public class GuiGrid extends GuiBase {
|
|||||||
public void init(int x, int y) {
|
public void init(int x, int y) {
|
||||||
addSideButton(new SideButtonRedstoneMode(grid));
|
addSideButton(new SideButtonRedstoneMode(grid));
|
||||||
|
|
||||||
|
addSideButton(new SideButtonGridSortingDirection());
|
||||||
|
addSideButton(new SideButtonGridSortingType());
|
||||||
|
|
||||||
searchField = new GuiTextField(fontRendererObj, x + 80 + 1, y + 6 + 1, 88 - 6, fontRendererObj.FONT_HEIGHT);
|
searchField = new GuiTextField(fontRendererObj, x + 80 + 1, y + 6 + 1, 88 - 6, fontRendererObj.FONT_HEIGHT);
|
||||||
searchField.setEnableBackgroundDrawing(false);
|
searchField.setEnableBackgroundDrawing(false);
|
||||||
searchField.setVisible(true);
|
searchField.setVisible(true);
|
||||||
|
@@ -20,8 +20,8 @@ public class GuiImporter extends GuiBase {
|
|||||||
public void init(int x, int y) {
|
public void init(int x, int y) {
|
||||||
addSideButton(new SideButtonRedstoneMode(importer));
|
addSideButton(new SideButtonRedstoneMode(importer));
|
||||||
|
|
||||||
addSideButton(new SideButtonCompare(importer, "NBT", InventoryUtils.COMPARE_NBT));
|
addSideButton(new SideButtonCompare(importer, InventoryUtils.COMPARE_DAMAGE));
|
||||||
addSideButton(new SideButtonCompare(importer, "Damage", InventoryUtils.COMPARE_DAMAGE));
|
addSideButton(new SideButtonCompare(importer, InventoryUtils.COMPARE_NBT));
|
||||||
|
|
||||||
addSideButton(new SideButtonImporterMode(importer));
|
addSideButton(new SideButtonImporterMode(importer));
|
||||||
}
|
}
|
||||||
|
@@ -8,12 +8,10 @@ import storagecraft.tile.ICompareSetting;
|
|||||||
|
|
||||||
public class SideButtonCompare extends SideButton {
|
public class SideButtonCompare extends SideButton {
|
||||||
private ICompareSetting setting;
|
private ICompareSetting setting;
|
||||||
private String name;
|
|
||||||
private int mask;
|
private int mask;
|
||||||
|
|
||||||
public SideButtonCompare(ICompareSetting setting, String name, int mask) {
|
public SideButtonCompare(ICompareSetting setting, int mask) {
|
||||||
this.setting = setting;
|
this.setting = setting;
|
||||||
this.name = name;
|
|
||||||
this.mask = mask;
|
this.mask = mask;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,12 +19,12 @@ public class SideButtonCompare extends SideButton {
|
|||||||
public String getTooltip(GuiBase gui) {
|
public String getTooltip(GuiBase gui) {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
|
|
||||||
builder.append(EnumChatFormatting.YELLOW).append(gui.t("misc.storagecraft:compare" + name)).append(EnumChatFormatting.RESET).append("\n");
|
builder.append(EnumChatFormatting.YELLOW).append(gui.t("sidebutton.storagecraft:compare." + mask)).append(EnumChatFormatting.RESET).append("\n");
|
||||||
|
|
||||||
if ((setting.getCompare() & mask) == mask) {
|
if ((setting.getCompare() & mask) == mask) {
|
||||||
builder.append(gui.t("misc.storagecraft:on"));
|
builder.append(gui.t("misc.storagecraft:yes"));
|
||||||
} else {
|
} else {
|
||||||
builder.append(gui.t("misc.storagecraft:off"));
|
builder.append(gui.t("misc.storagecraft:no"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
|
@@ -0,0 +1,27 @@
|
|||||||
|
package storagecraft.gui.sidebutton;
|
||||||
|
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import storagecraft.gui.GuiBase;
|
||||||
|
import storagecraft.gui.GuiGrid;
|
||||||
|
|
||||||
|
public class SideButtonGridSortingDirection extends SideButton {
|
||||||
|
@Override
|
||||||
|
public String getTooltip(GuiBase gui) {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
|
||||||
|
builder.append(EnumChatFormatting.YELLOW).append(gui.t("sidebutton.storagecraft:sorting.direction")).append(EnumChatFormatting.RESET).append("\n");
|
||||||
|
|
||||||
|
builder.append(gui.t("sidebutton.storagecraft:sorting.direction." + GuiGrid.SORTING_DIRECTION));
|
||||||
|
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(GuiBase gui, int x, int y) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed() {
|
||||||
|
GuiGrid.SORTING_DIRECTION = GuiGrid.SORTING_DIRECTION == GuiGrid.SORTING_DIRECTION_ASCENDING ? GuiGrid.SORTING_DIRECTION_DESCENDING : GuiGrid.SORTING_DIRECTION_ASCENDING;
|
||||||
|
}
|
||||||
|
}
|
@@ -0,0 +1,27 @@
|
|||||||
|
package storagecraft.gui.sidebutton;
|
||||||
|
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import storagecraft.gui.GuiBase;
|
||||||
|
import storagecraft.gui.GuiGrid;
|
||||||
|
|
||||||
|
public class SideButtonGridSortingType extends SideButton {
|
||||||
|
@Override
|
||||||
|
public String getTooltip(GuiBase gui) {
|
||||||
|
StringBuilder builder = new StringBuilder();
|
||||||
|
|
||||||
|
builder.append(EnumChatFormatting.YELLOW).append(gui.t("sidebutton.storagecraft:sorting.type")).append(EnumChatFormatting.RESET).append("\n");
|
||||||
|
|
||||||
|
builder.append(gui.t("sidebutton.storagecraft:sorting.type." + GuiGrid.SORTING_TYPE));
|
||||||
|
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void draw(GuiBase gui, int x, int y) {
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void actionPerformed() {
|
||||||
|
GuiGrid.SORTING_TYPE = GuiGrid.SORTING_TYPE == GuiGrid.SORTING_TYPE_COUNT ? GuiGrid.SORTING_TYPE_NAME : GuiGrid.SORTING_TYPE_COUNT;
|
||||||
|
}
|
||||||
|
}
|
@@ -17,9 +17,9 @@ public class SideButtonImporterMode extends SideButton {
|
|||||||
public String getTooltip(GuiBase gui) {
|
public String getTooltip(GuiBase gui) {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
|
|
||||||
builder.append(EnumChatFormatting.GREEN).append("Mode").append(EnumChatFormatting.RESET).append("\n");
|
builder.append(EnumChatFormatting.GREEN).append(gui.t("sidebutton.storagecraft:importer.mode")).append(EnumChatFormatting.RESET).append("\n");
|
||||||
|
|
||||||
builder.append(gui.t("misc.storagecraft:importer.mode." + importer.getMode()));
|
builder.append(gui.t("sidebutton.storagecraft:importer.mode." + importer.getMode()));
|
||||||
|
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
@@ -19,9 +19,9 @@ public class SideButtonRedstoneMode extends SideButton {
|
|||||||
public String getTooltip(GuiBase gui) {
|
public String getTooltip(GuiBase gui) {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
|
|
||||||
builder.append(EnumChatFormatting.RED).append("Redstone Mode").append(EnumChatFormatting.RESET).append("\n");
|
builder.append(EnumChatFormatting.RED).append(gui.t("sidebutton.storagecraft:redstoneMode")).append(EnumChatFormatting.RESET).append("\n");
|
||||||
|
|
||||||
builder.append(gui.t("misc.storagecraft:redstoneMode." + setting.getRedstoneMode().id));
|
builder.append(gui.t("sidebutton.storagecraft:redstoneMode." + setting.getRedstoneMode().id));
|
||||||
|
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
@@ -104,14 +104,14 @@ public class StorageItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean compare(StorageItem other, int flags) {
|
public boolean compare(StorageItem other, int flags) {
|
||||||
if ((flags & InventoryUtils.COMPARE_NBT) == InventoryUtils.COMPARE_NBT) {
|
if ((flags & InventoryUtils.COMPARE_DAMAGE) == InventoryUtils.COMPARE_DAMAGE) {
|
||||||
if (tag != null && !tag.equals(other.getTag())) {
|
if (damage != other.getDamage()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & InventoryUtils.COMPARE_DAMAGE) == InventoryUtils.COMPARE_DAMAGE) {
|
if ((flags & InventoryUtils.COMPARE_NBT) == InventoryUtils.COMPARE_NBT) {
|
||||||
if (damage != other.getDamage()) {
|
if (tag != null && !tag.equals(other.getTag())) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -126,14 +126,14 @@ public class StorageItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean compare(ItemStack stack, int flags) {
|
public boolean compare(ItemStack stack, int flags) {
|
||||||
if ((flags & InventoryUtils.COMPARE_NBT) == InventoryUtils.COMPARE_NBT) {
|
if ((flags & InventoryUtils.COMPARE_DAMAGE) == InventoryUtils.COMPARE_DAMAGE) {
|
||||||
if (tag != null && !tag.equals(stack.stackTagCompound)) {
|
if (damage != stack.getItemDamage()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & InventoryUtils.COMPARE_DAMAGE) == InventoryUtils.COMPARE_DAMAGE) {
|
if ((flags & InventoryUtils.COMPARE_NBT) == InventoryUtils.COMPARE_NBT) {
|
||||||
if (damage != stack.getItemDamage()) {
|
if (tag != null && !tag.equals(stack.stackTagCompound)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -171,14 +171,14 @@ public class InventoryUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean compareStack(ItemStack first, ItemStack second, int flags) {
|
public static boolean compareStack(ItemStack first, ItemStack second, int flags) {
|
||||||
if ((flags & COMPARE_NBT) == COMPARE_NBT) {
|
if ((flags & COMPARE_DAMAGE) == COMPARE_DAMAGE) {
|
||||||
if (first.stackTagCompound != null && !first.stackTagCompound.equals(second.stackTagCompound)) {
|
if (first.getItemDamage() != second.getItemDamage()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flags & COMPARE_DAMAGE) == COMPARE_DAMAGE) {
|
if ((flags & COMPARE_NBT) == COMPARE_NBT) {
|
||||||
if (first.getItemDamage() != second.getItemDamage()) {
|
if (first.stackTagCompound != null && !first.stackTagCompound.equals(second.stackTagCompound)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -13,18 +13,28 @@ misc.storagecraft:energyUsage=Usage: %d RF/t
|
|||||||
misc.storagecraft:storageCellStored=Stored: %d
|
misc.storagecraft:storageCellStored=Stored: %d
|
||||||
misc.storagecraft:storageCellStoredWithCapacity=Stored: %d / %d
|
misc.storagecraft:storageCellStoredWithCapacity=Stored: %d / %d
|
||||||
|
|
||||||
misc.storagecraft:compareNBT=Compare NBT
|
sidebutton.storagecraft:compare.1=Compare Damage
|
||||||
misc.storagecraft:compareDamage=Compare Damage
|
sidebutton.storagecraft:compare.2=Compare NBT
|
||||||
|
|
||||||
misc.storagecraft:on=On
|
sidebutton.storagecraft:redstoneMode=Redstone Mode
|
||||||
misc.storagecraft:off=Off
|
sidebutton.storagecraft:redstoneMode.0=Ignore
|
||||||
|
sidebutton.storagecraft:redstoneMode.1=High
|
||||||
|
sidebutton.storagecraft:redstoneMode.2=Low
|
||||||
|
|
||||||
misc.storagecraft:redstoneMode.0=Ignore
|
sidebutton.storagecraft:sorting.direction=Sorting Direction
|
||||||
misc.storagecraft:redstoneMode.1=High
|
sidebutton.storagecraft:sorting.direction.0=Ascending
|
||||||
misc.storagecraft:redstoneMode.2=Low
|
sidebutton.storagecraft:sorting.direction.1=Descending
|
||||||
|
|
||||||
misc.storagecraft:importer.mode.0=Whitelist
|
sidebutton.storagecraft:sorting.type=Sorting Type
|
||||||
misc.storagecraft:importer.mode.1=Blacklist
|
sidebutton.storagecraft:sorting.type.0=Item Count
|
||||||
|
sidebutton.storagecraft:sorting.type.1=Item Name
|
||||||
|
|
||||||
|
sidebutton.storagecraft:importer.mode=Mode
|
||||||
|
sidebutton.storagecraft:importer.mode.0=Whitelist
|
||||||
|
sidebutton.storagecraft:importer.mode.1=Blacklist
|
||||||
|
|
||||||
|
misc.storagecraft:yes=Yes
|
||||||
|
misc.storagecraft:no=No
|
||||||
|
|
||||||
block.storagecraft:controller.name=Controller
|
block.storagecraft:controller.name=Controller
|
||||||
block.storagecraft:cable.0.name=Cable
|
block.storagecraft:cable.0.name=Cable
|
||||||
|
@@ -1,42 +0,0 @@
|
|||||||
itemGroup.storagecraft=StorageCraft
|
|
||||||
|
|
||||||
gui.storagecraft:controller=Controleur
|
|
||||||
gui.storagecraft:grid=Rooster
|
|
||||||
gui.storagecraft:drive=Schijf
|
|
||||||
gui.storagecraft:storageProxy=Opslag Proxy
|
|
||||||
gui.storagecraft:importer=Importeur
|
|
||||||
gui.storagecraft:exporter=Exporteur
|
|
||||||
|
|
||||||
misc.storagecraft:energyStored=%d / %d RF
|
|
||||||
misc.storagecraft:energyUsage=Verbruik: %d RF/t
|
|
||||||
|
|
||||||
misc.storagecraft:storageCellStored=Opgeslagen: %d
|
|
||||||
misc.storagecraft:storageCellStoredWithCapacity=Opgeslagen: %d / %d
|
|
||||||
|
|
||||||
misc.storagecraft:compareNBT=NBT vergelijken
|
|
||||||
misc.storagecraft:compareDamage=Damage vergelijken
|
|
||||||
|
|
||||||
misc.storagecraft:on=Aan
|
|
||||||
misc.storagecraft:off=Uit
|
|
||||||
|
|
||||||
misc.storagecraft:redstoneMode.0=Negeren
|
|
||||||
misc.storagecraft:redstoneMode.1=Hoog
|
|
||||||
misc.storagecraft:redstoneMode.2=Laag
|
|
||||||
|
|
||||||
misc.storagecraft:importer.mode.0=Whitelist
|
|
||||||
misc.storagecraft:importer.mode.1=Blacklist
|
|
||||||
|
|
||||||
block.storagecraft:controller.name=Controleur
|
|
||||||
block.storagecraft:cable.0.name=Kabel
|
|
||||||
block.storagecraft:cable.1.name=Gevoelige Kabel
|
|
||||||
block.storagecraft:grid.name=Rooster
|
|
||||||
block.storagecraft:drive.name=Schijf
|
|
||||||
block.storagecraft:storageProxy.name=Opslag Proxy
|
|
||||||
block.storagecraft:importer.name=Importeur
|
|
||||||
block.storagecraft:exporter.name=Exporteur
|
|
||||||
|
|
||||||
item.storagecraft:storageCell.0.name=1k Opslagcel
|
|
||||||
item.storagecraft:storageCell.1.name=4k Opslagcel
|
|
||||||
item.storagecraft:storageCell.2.name=16k Opslagcel
|
|
||||||
item.storagecraft:storageCell.3.name=64k Opslagcel
|
|
||||||
item.storagecraft:storageCell.4.name=Creative Opslagcel
|
|
Reference in New Issue
Block a user