From 3628eaf7e2f46052cc5b2b3ed7d5557345fc0ee8 Mon Sep 17 00:00:00 2001 From: Technus Date: Mon, 18 Dec 2017 22:54:01 +0100 Subject: Scan Reader gui ok --- .../com/github/technus/tectech/CommonValues.java | 2 +- .../definitions/dComplexAspectDefinition.java | 4 +- .../core/stacks/cElementalInstanceStack.java | 5 +- .../core/templates/cElementalPrimitive.java | 2 +- .../definitions/complex/atom/dAtomDefinition.java | 6 +- .../complex/hadron/dHadronDefinition.java | 2 +- .../item/ElementalDefinitionScanStorage_EM.java | 4 +- .../tectech/thing/item/gui/ScanDisplayScreen.java | 67 +++++++++++++++------ .../tectech/textures/gui/scanDisplayScreen.png | Bin 262972 -> 0 bytes .../tectech/textures/gui/scanDisplayScreen1.png | Bin 0 -> 97514 bytes .../tectech/textures/gui/scanDisplayScreen2.png | Bin 0 -> 98360 bytes .../tectech/textures/gui/scanDisplayScreen3.png | Bin 0 -> 97606 bytes .../tectech/textures/gui/scanDisplayScreen4.png | Bin 0 -> 98319 bytes .../tectech/textures/gui/scanDisplayScreen5.png | Bin 0 -> 96650 bytes .../tectech/textures/gui/scanDisplayScreen6.png | Bin 0 -> 97865 bytes .../tectech/textures/gui/scanDisplayScreen7.png | Bin 0 -> 97446 bytes .../tectech/textures/gui/scanDisplayScreen8.png | Bin 0 -> 97833 bytes 17 files changed, 61 insertions(+), 31 deletions(-) delete mode 100644 src/main/resources/assets/tectech/textures/gui/scanDisplayScreen.png create mode 100644 src/main/resources/assets/tectech/textures/gui/scanDisplayScreen1.png create mode 100644 src/main/resources/assets/tectech/textures/gui/scanDisplayScreen2.png create mode 100644 src/main/resources/assets/tectech/textures/gui/scanDisplayScreen3.png create mode 100644 src/main/resources/assets/tectech/textures/gui/scanDisplayScreen4.png create mode 100644 src/main/resources/assets/tectech/textures/gui/scanDisplayScreen5.png create mode 100644 src/main/resources/assets/tectech/textures/gui/scanDisplayScreen6.png create mode 100644 src/main/resources/assets/tectech/textures/gui/scanDisplayScreen7.png create mode 100644 src/main/resources/assets/tectech/textures/gui/scanDisplayScreen8.png (limited to 'src') diff --git a/src/main/java/com/github/technus/tectech/CommonValues.java b/src/main/java/com/github/technus/tectech/CommonValues.java index cc6957cf56..fb5b04f63d 100644 --- a/src/main/java/com/github/technus/tectech/CommonValues.java +++ b/src/main/java/com/github/technus/tectech/CommonValues.java @@ -15,7 +15,7 @@ public final class CommonValues { EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.BLUE + ": Elemental Matter"; public final static String BASS_MARK = - EnumChatFormatting.BLUE + "Bass" + + EnumChatFormatting.BLUE + "Tec" + EnumChatFormatting.DARK_BLUE + "Tech" + EnumChatFormatting.BLUE + ": Theta Movement"; diff --git a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java index 7eed0b309e..31158572a8 100644 --- a/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java +++ b/src/main/java/com/github/technus/tectech/compatibility/thaumcraft/definitions/dComplexAspectDefinition.java @@ -233,8 +233,6 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme return hash; } - - @Override public void addScanResults(ArrayList lines, int capabilities, long energyLevel) { if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) @@ -246,7 +244,7 @@ public final class dComplexAspectDefinition extends cElementalDefinition impleme if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) lines.add("CHARGE = "+getCharge()/3f+" eV"); if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) - lines.add(getColor()<0?"NOT COLORED":"CARRIES COLOR"); + lines.add(getColor()<0?"COLORLESS":"CARRIES COLOR"); if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) lines.add("MASS = "+getMass()+" eV/c\u00b2"); if(Util.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)){ diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java b/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java index 3c5e94121b..25782b234d 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/core/stacks/cElementalInstanceStack.java @@ -320,10 +320,9 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) lines.add("COLOR = "+color+" RGB or CMY"); if(Util.areBitsSet(SCAN_GET_ENERGY_LEVEL,capabilities)) - lines.add("ENERGY LEVEL = "+energy); + lines.add("E. LEVEL = "+energy); if(Util.areBitsSet(SCAN_GET_AMOUNT,capabilities)) lines.add("AMOUNT = "+amount); - lines.add("");//def separator scanContents(lines,definition.getSubParticles(),1,detailsOnDepthLevels); } @@ -331,12 +330,12 @@ public final class cElementalInstanceStack implements iHasElementalDefinition { if(definitions!=null && depth lines, int capabilities, long energyLevel) { if(Util.areBitsSet(SCAN_GET_CLASS_TYPE, capabilities)) @@ -1428,7 +1426,7 @@ public final class dAtomDefinition extends cElementalDefinition { if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) lines.add("CHARGE = "+getCharge()/3f+" eV"); if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) - lines.add(getColor()<0?"NOT COLORED":"CARRIES COLOR"); + lines.add(getColor()<0?"COLORLESS":"CARRIES COLOR"); if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) lines.add("MASS = "+getMass()+" eV/c\u00b2"); if(iaeaDefinitionExistsAndHasEnergyLevels && Util.areBitsSet(SCAN_GET_ENERGY_STATES,capabilities)){ diff --git a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java index 902f79b3f4..55c2e7ccf9 100644 --- a/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java +++ b/src/main/java/com/github/technus/tectech/elementalMatter/definitions/complex/hadron/dHadronDefinition.java @@ -405,7 +405,7 @@ public final class dHadronDefinition extends cElementalDefinition {//TODO Optimi if(Util.areBitsSet(SCAN_GET_CHARGE,capabilities)) lines.add("CHARGE = "+getCharge()/3f+" eV"); if(Util.areBitsSet(SCAN_GET_COLOR,capabilities)) - lines.add(getColor()<0?"NOT COLORED":"CARRIES COLOR"); + lines.add(getColor()<0?"COLORLESS":"CARRIES COLOR"); if(Util.areBitsSet(SCAN_GET_MASS,capabilities)) lines.add("MASS = "+getMass()+" eV/c\u00b2"); if(Util.areBitsSet(SCAN_GET_TIMESPAN_INFO, capabilities)){ diff --git a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java index cd36cb44bf..ef7685a938 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java +++ b/src/main/java/com/github/technus/tectech/thing/item/ElementalDefinitionScanStorage_EM.java @@ -15,6 +15,7 @@ import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IIcon; import net.minecraft.world.World; @@ -64,7 +65,8 @@ public class ElementalDefinitionScanStorage_EM extends Item { aList.add(CommonValues.TEC_MARK_EM); try { if (aStack.stackTagCompound != null && aStack.stackTagCompound.hasKey("elementalInfo")) { - aList.add("Contains scan result"); + aList.add(EnumChatFormatting.BLUE+"Contains scan result"); + aList.add("Use to read"); //if(DEBUG_MODE) { // aList.add("DEBUG MODE INFO - U CHEATER"); // Collections.addAll(aList, Util.infoFromNBT(aStack.stackTagCompound.getCompoundTag("elementalInfo"))); diff --git a/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java b/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java index 69a3c395d4..9b6c336cf6 100644 --- a/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java +++ b/src/main/java/com/github/technus/tectech/thing/item/gui/ScanDisplayScreen.java @@ -15,18 +15,26 @@ import static org.lwjgl.opengl.GL11.*; * Created by danie_000 on 17.12.2017. */ public class ScanDisplayScreen extends GuiScreen { - private static final int sizeX=240,sizeY=220; + private static final int sizeX=240,sizeY=220, renderedLines =10; private int baseX,baseY; private Button up,down,pgUp,pgDown; - private String[] lines; + private final String[] lines; private int firstLine =0; - private static final ResourceLocation BACKGROUND =new ResourceLocation("tectech:textures/gui/scanDisplayScreen.png"); + private static final ResourceLocation[] BACKGROUND1 =new ResourceLocation[]{new ResourceLocation("tectech:textures/gui/scanDisplayScreen1.png"), + new ResourceLocation("tectech:textures/gui/scanDisplayScreen2.png"), + new ResourceLocation("tectech:textures/gui/scanDisplayScreen3.png"), + new ResourceLocation("tectech:textures/gui/scanDisplayScreen4.png"), + new ResourceLocation("tectech:textures/gui/scanDisplayScreen5.png"), + new ResourceLocation("tectech:textures/gui/scanDisplayScreen6.png"), + new ResourceLocation("tectech:textures/gui/scanDisplayScreen7.png"), + new ResourceLocation("tectech:textures/gui/scanDisplayScreen8.png")}; + private static final ResourceLocation BACKGROUND = BACKGROUND1[0]; private static final ResourceLocation ITEM =new ResourceLocation("tectech:textures/gui/scanDisplayItem.png"); public ScanDisplayScreen(EntityPlayer player){ super(); - lines= ElementalDefinitionScanStorage_EM.getLines(player.getHeldItem()); + lines=ElementalDefinitionScanStorage_EM.getLines(player.getHeldItem()); } @Override @@ -37,16 +45,42 @@ public class ScanDisplayScreen extends GuiScreen { long tick=System.currentTimeMillis()/150; int itick=(int)(tick%12); drawTexturedModalRect(baseX+99,baseY+189,32*(itick/6),32*(itick%6), 32, 32); - this.mc.getTextureManager().bindTexture(BACKGROUND); + this.mc.getTextureManager().bindTexture(BACKGROUND1[(int)(tick%8)]); drawTexturedModalRect(baseX,baseY,0,0, sizeX, sizeY); glDisable(GL_BLEND); super.drawScreen(x,y,partialTicks); + itick=(TecTech.Rnd.nextInt(0x66)<<16)+0x77EEFF; int textBaseX=baseX+20; - int textBaseY=baseY+20; - - for(int i=firstLine;i=0 && j!=0;i--,j/=2){ + int equalPos=lines[i].indexOf('='); + if(equalPos>=0){ + TecTech.proxy.renderUnicodeString(lines[i].substring(0,equalPos), textBaseX, textBaseY - 8 + j, 200, itick); + TecTech.proxy.renderUnicodeString(lines[i].substring(equalPos), textBaseXX, textBaseY - 8 + j, 200, itick); + }else { + TecTech.proxy.renderUnicodeString(lines[i], textBaseX, textBaseY - 8 + j, 200, itick); + } + } + for(int i=firstLine, j=0;i=0){ + TecTech.proxy.renderUnicodeString(lines[i].substring(0,equalPos), textBaseX, textBaseY, 200, itick); + TecTech.proxy.renderUnicodeString(lines[i].substring(equalPos), textBaseXX, textBaseY, 200, itick); + }else { + TecTech.proxy.renderUnicodeString(lines[i], textBaseX, textBaseY, 200, itick); + } + } + for(int i=firstLine+renderedLines, j=8;i=0){ + TecTech.proxy.renderUnicodeString(lines[i].substring(0,equalPos), textBaseX, textBaseY + 17 - j, 200, itick); + TecTech.proxy.renderUnicodeString(lines[i].substring(equalPos), textBaseXX, textBaseY + 17 - j, 200, itick); + }else { + TecTech.proxy.renderUnicodeString(lines[i], textBaseX, textBaseY + 17 - j, 200, itick); + } } } @@ -60,25 +94,25 @@ public class ScanDisplayScreen extends GuiScreen { baseX=(width-sizeX)/2; baseY=(height-sizeY)/2-12; int buttonBaseY=baseY+145; - this.buttonList.add(up=new Button(0,baseX+77,buttonBaseY,0,220)); - this.buttonList.add(down=new Button(1,baseX+99,buttonBaseY,20,220)); - this.buttonList.add(pgUp=new Button(2,baseX+121,buttonBaseY,40,220)); + this.buttonList.add(pgUp=new Button(0,baseX+77,buttonBaseY,0,220)); + this.buttonList.add(up=new Button(1,baseX+99,buttonBaseY,20,220)); + this.buttonList.add(down=new Button(2,baseX+121,buttonBaseY,40,220)); this.buttonList.add(pgDown=new Button(3,baseX+143,buttonBaseY,60,220)); } @Override protected void actionPerformed(GuiButton button) { - if (lines.length <= 8) return; + if (lines.length <= renderedLines) return; if (button == pgUp) { - firstLine -= 8; + firstLine -= renderedLines; } else if (button == up) { firstLine--; } else if (button == down) { firstLine++; } else if (button == pgDown) { - firstLine += 8; + firstLine += renderedLines; } - if (firstLine > lines.length - 8) firstLine = lines.length - 8; + if (firstLine > lines.length - renderedLines) firstLine = lines.length - renderedLines; if (firstLine < 0) firstLine = 0; } @@ -96,7 +130,6 @@ public class ScanDisplayScreen extends GuiScreen { if (this.visible) { this.field_146123_n = xPos >= this.xPosition && yPos >= this.yPosition && xPos < this.xPosition + this.width && yPos < this.yPosition + this.height; - mc.getTextureManager().bindTexture(BACKGROUND); glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); mc.getTextureManager().bindTexture(BACKGROUND); diff --git a/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen.png b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen.png deleted file mode 100644 index cf73f8098a..0000000000 Binary files a/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen.png and /dev/null differ diff --git a/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen1.png b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen1.png new file mode 100644 index 0000000000..e1e659718c Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen1.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen2.png b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen2.png new file mode 100644 index 0000000000..fd29923b87 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen2.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen3.png b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen3.png new file mode 100644 index 0000000000..0dbe68fba6 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen3.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen4.png b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen4.png new file mode 100644 index 0000000000..a9488280c1 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen4.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen5.png b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen5.png new file mode 100644 index 0000000000..6cefaa0186 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen5.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen6.png b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen6.png new file mode 100644 index 0000000000..385bc9ba0f Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen6.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen7.png b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen7.png new file mode 100644 index 0000000000..6a11d2df4a Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen7.png differ diff --git a/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen8.png b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen8.png new file mode 100644 index 0000000000..bbe69099c2 Binary files /dev/null and b/src/main/resources/assets/tectech/textures/gui/scanDisplayScreen8.png differ -- cgit