use of net.minecraft.util.text.ITextProperties in project AstralSorcery by HellFirePvP.
the class ScreenJournalConstellationDetail method drawPageConstellation.
private void drawPageConstellation(MatrixStack renderStack, float partial) {
ITextProperties cstName = this.constellation.getConstellationName();
int width = font.getStringPropertyWidth(cstName);
renderStack.push();
renderStack.translate(guiLeft + (305 - (width * 1.8F / 2F)), guiTop + 26, this.getGuiZLevel());
renderStack.scale(1.8F, 1.8F, 1);
RenderingDrawUtils.renderStringAt(cstName, renderStack, font, 0xFFC3C3C3, true);
renderStack.pop();
ITextProperties dstInfo = constellation.getConstellationTypeDescription();
if (!detailed) {
dstInfo = new TranslationTextComponent("astralsorcery.journal.constellation.unknown");
}
width = font.getStringPropertyWidth(dstInfo);
renderStack.push();
renderStack.translate(guiLeft + (305 - (width / 2F)), guiTop + 219, this.getGuiZLevel());
RenderingDrawUtils.renderStringAt(dstInfo, renderStack, font, 0xFFDDDDDD, true);
renderStack.pop();
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
Random rand = new Random(0x4196A15C91A5E199L);
boolean known = ResearchHelper.getClientProgress().hasConstellationDiscovered(constellation);
RenderingConstellationUtils.renderConstellationIntoGUI(known ? constellation.getConstellationColor() : constellation.getTierRenderColor(), constellation, renderStack, guiLeft + 40, guiTop + 60, this.getGuiZLevel(), 150, 150, 2F, () -> 0.6F + 0.4F * RenderingConstellationUtils.conCFlicker(ClientScheduler.getClientTick(), partial, 12 + rand.nextInt(10)), true, false);
RenderSystem.disableBlend();
}
use of net.minecraft.util.text.ITextProperties in project AstralSorcery by HellFirePvP.
the class ScreenJournalConstellationDetail method buildCapeText.
private void buildCapeText() {
if (this.constellation instanceof IWeakConstellation) {
if (ResearchHelper.getClientProgress().getTierReached().isThisLaterOrEqual(ProgressionTier.TRAIT_CRAFT)) {
ITextComponent txtMantle = ((IWeakConstellation) this.constellation).getInfoMantleEffect();
ITextProperties headTxt = new TranslationTextComponent("astralsorcery.journal.constellation.mantle");
locTextMantle.add(localize(headTxt));
locTextMantle.add(IReorderingProcessor.field_242232_a);
List<IReorderingProcessor> lines = new LinkedList<>();
for (String segment : txtMantle.getString().split("<NL>")) {
lines.addAll(font.trimStringToWidth(new StringTextComponent(segment), JournalPage.DEFAULT_WIDTH));
lines.add(IReorderingProcessor.field_242232_a);
}
locTextMantle.addAll(lines);
locTextMantle.add(IReorderingProcessor.field_242232_a);
}
}
}
use of net.minecraft.util.text.ITextProperties in project AstralSorcery by HellFirePvP.
the class ScreenJournalConstellationOverview method drawConstellation.
private Rectangle drawConstellation(MatrixStack renderStack, IConstellation display, double offsetX, double offsetY, float zLevel, float partial, int mouseX, int mouseY) {
Rectangle rect = new Rectangle(MathHelper.floor(offsetX), MathHelper.floor(offsetY), width, height);
renderStack.push();
renderStack.translate(offsetX + (width / 2F), offsetY + (width / 2F), zLevel);
if (rect.contains(mouseX, mouseY)) {
renderStack.scale(1.1F, 1.1F, 1F);
}
renderStack.translate(-(width / 2F), -(width / 2F), zLevel);
RenderSystem.enableBlend();
RenderSystem.defaultBlendFunc();
Random rand = new Random(0x4196A15C91A5E199L);
RenderingConstellationUtils.renderConstellationIntoGUI(display.getConstellationColor(), display, renderStack, 0, 0, 0, 95, 95, 1.6F, () -> 0.5F + 0.5F * RenderingConstellationUtils.conCFlicker(ClientScheduler.getClientTick(), partial, 12 + rand.nextInt(10)), true, false);
RenderSystem.disableBlend();
ITextProperties cstName = display.getConstellationName();
float fullLength = (width / 2F) - (font.getStringPropertyWidth(cstName) / 2F);
renderStack.translate(fullLength, 90, 10);
RenderingDrawUtils.renderStringAt(cstName, renderStack, font, 0xBBDDDDDD, false);
renderStack.pop();
return rect;
}
use of net.minecraft.util.text.ITextProperties in project AstralSorcery by HellFirePvP.
the class ScreenJournalClusterRenderer method drawMouseHighlight.
public void drawMouseHighlight(MatrixStack renderStack, float zLevel, int mouseX, int mouseY) {
Rectangle frame = new Rectangle(renderOffsetX, renderOffsetY, renderGuiWidth, renderGuiHeight);
if (frame.contains(mouseX, mouseY)) {
for (Rectangle r : clickableNodes.keySet()) {
if (r.contains(mouseX, mouseY)) {
ITextProperties name = clickableNodes.get(r).getName();
renderStack.push();
renderStack.translate(r.getX(), r.getY(), zLevel + 200);
renderStack.scale(progressionSizeHandler.getScalingFactor(), progressionSizeHandler.getScalingFactor(), 1F);
RenderingDrawUtils.renderBlueTooltipComponents(renderStack, 0, 0, 0, Lists.newArrayList(name), Minecraft.getInstance().fontRenderer, false);
renderStack.pop();
}
}
}
}
use of net.minecraft.util.text.ITextProperties in project AstralSorcery by HellFirePvP.
the class ScreenJournalProgressionRenderer method drawProgressionPart.
public void drawProgressionPart(MatrixStack renderStack, float zLevel, int mouseX, int mouseY) {
drawBackground(renderStack, zLevel);
drawClusters(renderStack, zLevel);
focusedClusterMouse = tryFocusCluster(mouseX, mouseY);
float scaleX = this.mousePointScaled.getPosX();
float scaleY = this.mousePointScaled.getPosY();
if (sizeHandler.getScalingFactor() >= 6.1D && focusedClusterZoom != null && clusterRenderer != null) {
JournalCluster cluster = JournalProgressionClusterMapping.getClusterMapping(focusedClusterZoom);
drawClusterBackground(renderStack, cluster.clusterBackgroundTexture, zLevel);
clusterRenderer.drawClusterScreen(renderStack, this.parentGui, zLevel);
scaleX = clusterRenderer.getMouseX();
scaleY = clusterRenderer.getMouseY();
}
if (focusedClusterMouse != null) {
JournalCluster cluster = JournalProgressionClusterMapping.getClusterMapping(focusedClusterMouse);
float width = this.sizeHandler.scaledDistanceX(cluster.x, cluster.maxX);
float height = this.sizeHandler.scaledDistanceY(cluster.y, cluster.maxY);
Point.Float offset = this.sizeHandler.scalePointToGui(this.parentGui, this.mousePointScaled, new Point.Float(cluster.x, cluster.y));
float scale = sizeHandler.getScalingFactor();
float br = 1F;
if (scale > 8.01F) {
br = 0F;
} else if (scale >= 6F) {
br = 1F - ((scale - 6F) / 2F);
}
ITextProperties name = focusedClusterMouse.getName();
float length = Minecraft.getInstance().fontRenderer.getStringPropertyWidth(name) * 1.4F;
int alpha = 0xCC;
alpha *= br;
alpha = Math.max(alpha, 5);
int color = 0x5A28FF | (alpha << 24);
renderStack.push();
renderStack.translate(offset.x + (width / 2F) - length / 2D, offset.y + (height / 3F), 0);
renderStack.scale(1.4F, 1.4F, 1F);
RenderingDrawUtils.renderStringAt(name, renderStack, null, color, true);
renderStack.pop();
}
drawStarParallaxLayers(renderStack, scaleX, scaleY, zLevel);
}
Aggregations