Search in sources :

Example 1 with Vector4f

use of org.lwjgl.util.vector.Vector4f in project Galacticraft by micdoodle8.

the class GuiCelestialSelection method drawScreen.

@Override
public void drawScreen(int mousePosX, int mousePosY, float partialTicks) {
    if (Mouse.hasWheel()) {
        float wheel = Mouse.getDWheel() / (this.selectedBody == null ? 500.0F : 250.0F);
        if (wheel != 0) {
            if (this.selectedBody == null || (this.viewState == EnumView.PREVIEW && !this.isZoomed())) {
                // Minimum zoom increased from 0.55F to 1F to allow zoom out to see other solar systems
                this.zoom = Math.min(Math.max(this.zoom + wheel * ((this.zoom + 2.0F)) / 10.0F, -1.0F), 3);
            } else {
                this.planetZoom = Math.min(Math.max(this.planetZoom + wheel, -4.9F), 5);
            }
        }
    }
    GL11.glPushMatrix();
    GL11.glEnable(GL11.GL_BLEND);
    Matrix4f camMatrix = new Matrix4f();
    // See EntityRenderer.java:setupOverlayRendering
    Matrix4f.translate(new Vector3f(0.0F, 0.0F, -9000.0F), camMatrix, camMatrix);
    Matrix4f viewMatrix = new Matrix4f();
    viewMatrix.m00 = 2.0F / width;
    viewMatrix.m11 = 2.0F / -height;
    viewMatrix.m22 = -2.0F / 9000.0F;
    viewMatrix.m30 = -1.0F;
    viewMatrix.m31 = 1.0F;
    viewMatrix.m32 = -2.0F;
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadIdentity();
    FloatBuffer fb = BufferUtils.createFloatBuffer(16 * Float.SIZE);
    fb.rewind();
    viewMatrix.store(fb);
    fb.flip();
    GL11.glMultMatrix(fb);
    fb.clear();
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity();
    fb.rewind();
    camMatrix.store(fb);
    fb.flip();
    fb.clear();
    GL11.glMultMatrix(fb);
    this.setBlackBackground();
    GL11.glPushMatrix();
    Matrix4f worldMatrix = this.setIsometric(partialTicks);
    mainWorldMatrix = worldMatrix;
    // 194.4F;
    float gridSize = 7000F;
    // TODO: Add dynamic map sizing, to allow the map to be small by default and expand when more distant solar systems are added.
    this.drawGrid(gridSize, height / 3 / 3.5F);
    this.drawCircles();
    GL11.glPopMatrix();
    HashMap<CelestialBody, Matrix4f> matrixMap = this.drawCelestialBodies(worldMatrix);
    this.planetPosMap.clear();
    for (Map.Entry<CelestialBody, Matrix4f> e : matrixMap.entrySet()) {
        Matrix4f planetMatrix = e.getValue();
        Matrix4f matrix0 = Matrix4f.mul(viewMatrix, planetMatrix, planetMatrix);
        int x = (int) Math.floor((matrix0.m30 * 0.5 + 0.5) * Minecraft.getMinecraft().displayWidth);
        int y = (int) Math.floor(Minecraft.getMinecraft().displayHeight - (matrix0.m31 * 0.5 + 0.5) * Minecraft.getMinecraft().displayHeight);
        Vector2f vec = new Vector2f(x, y);
        Matrix4f scaleVec = new Matrix4f();
        scaleVec.m00 = matrix0.m00;
        scaleVec.m11 = matrix0.m11;
        scaleVec.m22 = matrix0.m22;
        Vector4f newVec = Matrix4f.transform(scaleVec, new Vector4f(2, -2, 0, 0), null);
        float iconSize = (newVec.y * (Minecraft.getMinecraft().displayHeight / 2.0F)) * (e.getKey() instanceof Star ? 2 : 1) * (e.getKey() == this.selectedBody ? 1.5F : 1.0F);
        // Store size on-screen in Z-value for ease
        this.planetPosMap.put(e.getKey(), new Vector3f(vec.x, vec.y, iconSize));
    }
    this.drawSelectionCursor(fb, worldMatrix);
    try {
        this.drawButtons(mousePosX, mousePosY);
    } catch (Exception e) {
        if (!this.errorLogged) {
            this.errorLogged = true;
            GCLog.severe("Problem identifying planet or dimension in an add on for Galacticraft!");
            GCLog.severe("(The problem is likely caused by a dimension ID conflict.  Check configs for dimension clashes.  You can also try disabling Mars space station in configs.)");
            e.printStackTrace();
        }
    }
    this.drawBorder();
    GL11.glPopMatrix();
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadIdentity();
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity();
}
Also used : FloatBuffer(java.nio.FloatBuffer) ArabicShapingException(com.ibm.icu.text.ArabicShapingException) IOException(java.io.IOException) Matrix4f(org.lwjgl.util.vector.Matrix4f) Vector4f(org.lwjgl.util.vector.Vector4f) Vector2f(org.lwjgl.util.vector.Vector2f) Vector3f(org.lwjgl.util.vector.Vector3f)

Example 2 with Vector4f

use of org.lwjgl.util.vector.Vector4f in project j6dof-flight-sim by chris-ali.

the class ParticleSystem method generateRandomUnitVectorWithinCone.

private static Vector3f generateRandomUnitVectorWithinCone(Vector3f coneDirection, float angle) {
    float cosAngle = (float) Math.cos(angle);
    Random random = new Random();
    float theta = (float) (random.nextFloat() * 2f * Math.PI);
    float z = cosAngle + (random.nextFloat() * (1 - cosAngle));
    float rootOneMinusZSquared = (float) Math.sqrt(1 - z * z);
    float x = (float) (rootOneMinusZSquared * Math.cos(theta));
    float y = (float) (rootOneMinusZSquared * Math.sin(theta));
    Vector4f direction = new Vector4f(x, y, z, 1);
    if (coneDirection.x != 0 || coneDirection.y != 0 || (coneDirection.z != 1 && coneDirection.z != -1)) {
        Vector3f rotateAxis = Vector3f.cross(coneDirection, new Vector3f(0, 0, 1), null);
        rotateAxis.normalise();
        float rotateAngle = (float) Math.acos(Vector3f.dot(coneDirection, new Vector3f(0, 0, 1)));
        Matrix4f rotationMatrix = new Matrix4f();
        rotationMatrix.rotate(-rotateAngle, rotateAxis);
        Matrix4f.transform(rotationMatrix, direction, direction);
    } else if (coneDirection.z == -1) {
        direction.z *= -1;
    }
    return new Vector3f(direction);
}
Also used : Matrix4f(org.lwjgl.util.vector.Matrix4f) Random(java.util.Random) Vector4f(org.lwjgl.util.vector.Vector4f) Vector3f(org.lwjgl.util.vector.Vector3f)

Example 3 with Vector4f

use of org.lwjgl.util.vector.Vector4f in project BetterQuesting by Funwayguy.

the class GuiHome method initPanel.

@Override
public void initPanel() {
    super.initPanel();
    PEventBroadcaster.INSTANCE.register(this, PEventButton.class);
    ResourceLocation homeGui = new ResourceLocation(QuestSettings.INSTANCE.getProperty(NativeProps.HOME_IMAGE));
    IGuiTexture homeSplashBG = new SimpleTexture(homeGui, new GuiRectangle(0, 0, 256, 128));
    IGuiTexture homeSplashTitle = new SimpleTexture(homeGui, new GuiRectangle(0, 128, 256, 128)).maintainAspect(true);
    float ancX = QuestSettings.INSTANCE.getProperty(NativeProps.HOME_ANC_X);
    float ancY = QuestSettings.INSTANCE.getProperty(NativeProps.HOME_ANC_Y);
    int offX = QuestSettings.INSTANCE.getProperty(NativeProps.HOME_OFF_X);
    int offY = QuestSettings.INSTANCE.getProperty(NativeProps.HOME_OFF_Y);
    // Background panel
    CanvasTextured bgCan = new CanvasTextured(new GuiTransform(GuiAlign.FULL_BOX, new GuiPadding(0, 0, 0, 0), 0), PresetTexture.PANEL_MAIN.getTexture());
    this.addPanel(bgCan);
    // Inner canvas bounds
    CanvasEmpty inCan = new CanvasEmpty(new GuiTransform(GuiAlign.FULL_BOX, new GuiPadding(16, 16, 16, 16), 0));
    bgCan.addPanel(inCan);
    CanvasTextured splashCan = new CanvasTextured(new GuiTransform(GuiAlign.FULL_BOX, new GuiPadding(0, 0, 0, 32), 0), homeSplashBG);
    inCan.addPanel(splashCan);
    CanvasTextured splashTitle = new CanvasTextured(new GuiTransform(new Vector4f(ancX, ancY, ancX, ancY), new GuiPadding(offX, offY, -256 - offX, -128 - offY), 0), homeSplashTitle);
    splashCan.addPanel(splashTitle);
    PanelButton btnExit = new PanelButton(new GuiTransform(new Vector4f(0F, 1F, 0.25F, 1F), new GuiPadding(0, -32, 0, 0), 0), 0, I18n.format("betterquesting.home.exit"));
    inCan.addPanel(btnExit);
    PanelButton btnQuests = new PanelButton(new GuiTransform(new Vector4f(0.25F, 1F, 0.5F, 1F), new GuiPadding(0, -32, 0, 0), 0), 1, I18n.format("betterquesting.home.quests"));
    inCan.addPanel(btnQuests);
    PanelButton btnParty = new PanelButton(new GuiTransform(new Vector4f(0.5F, 1F, 0.75F, 1F), new GuiPadding(0, -32, 0, 0), 0), 2, I18n.format("betterquesting.home.party"));
    inCan.addPanel(btnParty);
    PanelButton btnTheme = new PanelButton(new GuiTransform(new Vector4f(0.75F, 1F, 1F, 1F), new GuiPadding(0, -32, 0, 0), 0), 3, I18n.format("betterquesting.home.theme"));
    inCan.addPanel(btnTheme);
    if (QuestingAPI.getAPI(ApiReference.SETTINGS).canUserEdit(mc.player)) {
        PanelButton btnEdit = new PanelButton(new GuiTransform(GuiAlign.TOP_LEFT, new GuiPadding(0, 0, -16, -16), 0), 4, "").setIcon(PresetIcon.ICON_GEAR.getTexture());
        inCan.addPanel(btnEdit);
    }
}
Also used : IGuiTexture(betterquesting.api2.client.gui.resources.textures.IGuiTexture) Vector4f(org.lwjgl.util.vector.Vector4f) PanelButton(betterquesting.api2.client.gui.controls.PanelButton) IPanelButton(betterquesting.api2.client.gui.controls.IPanelButton) GuiRectangle(betterquesting.api2.client.gui.misc.GuiRectangle) ResourceLocation(net.minecraft.util.ResourceLocation) CanvasTextured(betterquesting.api2.client.gui.panels.CanvasTextured) GuiTransform(betterquesting.api2.client.gui.misc.GuiTransform) SimpleTexture(betterquesting.api2.client.gui.resources.textures.SimpleTexture) GuiPadding(betterquesting.api2.client.gui.misc.GuiPadding) CanvasEmpty(betterquesting.api2.client.gui.panels.CanvasEmpty)

Example 4 with Vector4f

use of org.lwjgl.util.vector.Vector4f in project BetterQuesting by Funwayguy.

the class GuiQuest method initPanel.

@Override
public void initPanel() {
    super.initPanel();
    this.quest = QuestDatabase.INSTANCE.getValue(questID);
    if (quest == null) {
        mc.displayGuiScreen(this.parent);
        return;
    }
    PEventBroadcaster.INSTANCE.register(this, PEventButton.class);
    // TODO: Register quest updated event
    // Background panel
    CanvasTextured cvBackground = new CanvasTextured(new GuiTransform(GuiAlign.FULL_BOX, new GuiPadding(0, 0, 0, 0), 0), PresetTexture.PANEL_MAIN.getTexture());
    this.addPanel(cvBackground);
    PanelTextBox panTxt = new PanelTextBox(new GuiTransform(GuiAlign.TOP_EDGE, new GuiPadding(0, 16, 0, -32), 0), I18n.format(quest.getUnlocalisedName())).setAlignment(1);
    panTxt.setColor(PresetColor.TEXT_HEADER.getColor());
    cvBackground.addPanel(panTxt);
    if (QuestingAPI.getAPI(ApiReference.SETTINGS).canUserEdit(mc.player)) {
        cvBackground.addPanel(new PanelButton(new GuiTransform(GuiAlign.BOTTOM_CENTER, -100, -16, 100, 16, 0), 0, I18n.format("gui.back")));
        cvBackground.addPanel(new PanelButton(new GuiTransform(GuiAlign.BOTTOM_CENTER, 0, -16, 100, 16, 0), 1, I18n.format("betterquesting.btn.edit")));
    } else {
        cvBackground.addPanel(new PanelButton(new GuiTransform(GuiAlign.BOTTOM_CENTER, -100, -16, 200, 16, 0), 0, I18n.format("gui.back")));
    }
    cvInner = new CanvasEmpty(new GuiTransform(GuiAlign.FULL_BOX, new GuiPadding(16, 32, 16, 24), 0));
    cvBackground.addPanel(cvInner);
    if (quest.getRewards().size() > 0) {
        CanvasScrolling cvDesc = new CanvasScrolling(new GuiTransform(new Vector4f(0F, 0F, 0.5F, 0.5F), new GuiPadding(0, 0, 16, 16), 0));
        cvInner.addPanel(cvDesc);
        PanelTextBox paDesc = new PanelTextBox(new GuiRectangle(0, 0, cvDesc.getTransform().getWidth(), 0), I18n.format(quest.getUnlocalisedDescription()), true);
        paDesc.setColor(PresetColor.TEXT_MAIN.getColor());
        cvDesc.addPanel(paDesc);
        PanelVScrollBar paDescScroll = new PanelVScrollBar(new GuiTransform(GuiAlign.quickAnchor(GuiAlign.TOP_CENTER, GuiAlign.MID_CENTER), new GuiPadding(-16, 0, 8, 16), 0));
        cvInner.addPanel(paDescScroll);
        cvDesc.setScrollDriverY(paDescScroll);
        paDescScroll.setEnabled(cvDesc.getScrollBounds().getHeight() > 0);
        btnClaim = new PanelButton(new GuiTransform(new Vector4f(0F, 1F, 0.5F, 1F), new GuiPadding(16, -16, 24, 0), 0), 6, I18n.format("betterquesting.btn.claim"));
        btnClaim.setBtnState(false);
        cvInner.addPanel(btnClaim);
        btnRewardLeft = new PanelButton(new GuiTransform(GuiAlign.BOTTOM_LEFT, new GuiPadding(0, -16, -16, 0), 0), 2, "<");
        btnRewardLeft.setBtnState(rewardIndex > 0);
        cvInner.addPanel(btnRewardLeft);
        btnRewardRight = new PanelButton(new GuiTransform(new Vector4f(0.5F, 1F, 0.5F, 1F), new GuiPadding(-24, -16, 8, 0), 0), 3, ">");
        btnRewardRight.setBtnState(rewardIndex < quest.getRewards().size() - 1);
        cvInner.addPanel(btnRewardRight);
        rectReward = new GuiTransform(new Vector4f(0F, 0.5F, 0.5F, 1F), new GuiPadding(0, 0, 8, 16), 0);
        rectReward.setParent(cvInner.getTransform());
        titleReward = new PanelTextBox(new GuiTransform(new Vector4f(0F, 0.5F, 0.5F, 0.5F), new GuiPadding(0, -16, 8, 0), 0), "?");
        titleReward.setColor(PresetColor.TEXT_HEADER.getColor()).setAlignment(1);
        cvInner.addPanel(titleReward);
        refreshRewardPanel();
    } else {
        CanvasScrolling cvDesc = new CanvasScrolling(new GuiTransform(GuiAlign.HALF_LEFT, new GuiPadding(0, 0, 16, 0), 0));
        cvInner.addPanel(cvDesc);
        PanelTextBox paDesc = new PanelTextBox(new GuiRectangle(0, 0, cvDesc.getTransform().getWidth(), 0), I18n.format(quest.getUnlocalisedDescription()), true);
        paDesc.setColor(PresetColor.TEXT_MAIN.getColor());
        cvDesc.addPanel(paDesc);
        PanelVScrollBar paDescScroll = new PanelVScrollBar(new GuiTransform(GuiAlign.quickAnchor(GuiAlign.TOP_CENTER, GuiAlign.BOTTOM_CENTER), new GuiPadding(-16, 0, 8, 0), 0));
        cvInner.addPanel(paDescScroll);
        cvDesc.setScrollDriverY(paDescScroll);
        paDescScroll.setEnabled(cvDesc.getScrollBounds().getHeight() > 0);
    }
    if (quest.getTasks().size() > 0) {
        btnDetect = new PanelButton(new GuiTransform(new Vector4f(0.5F, 1F, 1F, 1F), new GuiPadding(24, -16, 16, 0), 0), 7, I18n.format("betterquesting.btn.detect_submit"));
        btnDetect.setBtnState(false);
        cvInner.addPanel(btnDetect);
        btnTaskLeft = new PanelButton(new GuiTransform(new Vector4f(0.5F, 1F, 0.5F, 1F), new GuiPadding(8, -16, -24, 0), 0), 4, "<");
        btnTaskLeft.setBtnState(taskIndex > 0);
        cvInner.addPanel(btnTaskLeft);
        btnTaskRight = new PanelButton(new GuiTransform(GuiAlign.BOTTOM_RIGHT, new GuiPadding(-16, -16, 0, 0), 0), 5, ">");
        btnTaskRight.setBtnState(taskIndex < quest.getTasks().size() - 1);
        cvInner.addPanel(btnTaskRight);
        rectTask = new GuiTransform(GuiAlign.HALF_RIGHT, new GuiPadding(8, 16, 0, 16), 0);
        rectTask.setParent(cvInner.getTransform());
        titleTask = new PanelTextBox(new GuiTransform(new Vector4f(0.5F, 0F, 1F, 0F), new GuiPadding(8, 0, 0, -16), 0), "?");
        titleTask.setColor(PresetColor.TEXT_HEADER.getColor()).setAlignment(1);
        cvInner.addPanel(titleTask);
        refreshTaskPanel();
    }
    IGuiRect ls0 = new GuiTransform(GuiAlign.TOP_CENTER, 0, 0, 0, 0, 0);
    ls0.setParent(cvInner.getTransform());
    IGuiRect le0 = new GuiTransform(GuiAlign.BOTTOM_CENTER, 0, 0, 0, 0, 0);
    le0.setParent(cvInner.getTransform());
    PanelLine paLine0 = new PanelLine(ls0, le0, PresetLine.GUI_DIVIDER.getLine(), 1, PresetColor.GUI_DIVIDER.getColor(), 1);
    cvInner.addPanel(paLine0);
}
Also used : PanelTextBox(betterquesting.api2.client.gui.panels.content.PanelTextBox) PanelButton(betterquesting.api2.client.gui.controls.PanelButton) IPanelButton(betterquesting.api2.client.gui.controls.IPanelButton) Vector4f(org.lwjgl.util.vector.Vector4f) CanvasTextured(betterquesting.api2.client.gui.panels.CanvasTextured) CanvasScrolling(betterquesting.api2.client.gui.panels.lists.CanvasScrolling) PanelVScrollBar(betterquesting.api2.client.gui.panels.bars.PanelVScrollBar) PanelLine(betterquesting.api2.client.gui.panels.content.PanelLine) CanvasEmpty(betterquesting.api2.client.gui.panels.CanvasEmpty)

Example 5 with Vector4f

use of org.lwjgl.util.vector.Vector4f in project BetterQuesting by Funwayguy.

the class GuiThemes method initPanel.

@Override
public void initPanel() {
    super.initPanel();
    PEventBroadcaster.INSTANCE.register(this, PEventButton.class);
    // Background panel
    CanvasTextured bgCan = new CanvasTextured(new GuiTransform(GuiAlign.FULL_BOX, new GuiPadding(0, 0, 0, 0), 0), PresetTexture.PANEL_MAIN.getTexture());
    this.addPanel(bgCan);
    // Inner canvas bounds
    CanvasEmpty inCan = new CanvasEmpty(new GuiTransform(GuiAlign.FULL_BOX, new GuiPadding(16, 16, 16, 16), 0));
    bgCan.addPanel(inCan);
    PanelTextBox panTxt = new PanelTextBox(new GuiTransform(GuiAlign.TOP_EDGE, new GuiPadding(0, 0, 0, -16), 0), I18n.format("betterquesting.title.select_theme")).setAlignment(1);
    panTxt.setColor(PresetColor.TEXT_HEADER.getColor());
    inCan.addPanel(panTxt);
    PanelButton btnExit = new PanelButton(new GuiTransform(GuiAlign.BOTTOM_CENTER, new GuiPadding(-100, -16, -100, 0), 0), 0, I18n.format("gui.done"));
    bgCan.addPanel(btnExit);
    CanvasScrolling canScroll = new CanvasScrolling(new GuiTransform(GuiAlign.HALF_LEFT, new GuiPadding(0, 16, 16, 16), 0));
    inCan.addPanel(canScroll);
    List<ITheme> themes = betterquesting.client.themes.ThemeRegistry.INSTANCE.getAllThemes();
    // List<IGuiTheme> themes = ThemeRegistry.INSTANCE.getAllThemes();
    int width = canScroll.getTransform().getWidth();
    for (int i = 0; i < themes.size(); i++) {
        GuiRectangle trans = new GuiRectangle(0, i * 24, width, 24, 0);
        ITheme theme = themes.get(i);
        PanelButtonStorage<ResourceLocation> pbs = new PanelButtonStorage<>(trans, 1, theme.getDisplayName(), theme.getThemeID());
        canScroll.addPanel(pbs);
        if (betterquesting.client.themes.ThemeRegistry.INSTANCE.getCurrentTheme() == theme) {
            pbs.setEnabled(false);
        }
    }
    PanelVScrollBar vsb = new PanelVScrollBar(new GuiTransform(GuiAlign.RIGHT_EDGE, new GuiPadding(0, 0, -8, 0), 0));
    inCan.addPanel(vsb);
    vsb.getTransform().setParent(canScroll.getTransform());
    canScroll.setScrollDriverY(vsb);
    scrollPanel = vsb;
    // === PREVIEW PANELS ===
    CanvasEmpty preCan = new CanvasEmpty(new GuiTransform(GuiAlign.HALF_RIGHT, new GuiPadding(8, 16, 0, 16), 0));
    inCan.addPanel(preCan);
    CanvasTextured preCanIn0 = new CanvasTextured(new GuiTransform(new Vector4f(0F, 0F, 0.5F, 0.5F), new GuiPadding(0, 0, 0, 0), 0), PresetTexture.PANEL_MAIN.getTexture());
    preCan.addPanel(preCanIn0);
    preCanIn0.addPanel(new PanelTextBox(new GuiTransform(GuiAlign.MID_CENTER, -32, -8, 64, 16, 0), "EXAMPLE").setAlignment(1).setColor(PresetColor.TEXT_MAIN.getColor()));
    CanvasTextured preCanIn1 = new CanvasTextured(new GuiTransform(new Vector4f(0.5F, 0F, 1F, 0.5F), new GuiPadding(0, 0, 0, 0), 0), PresetTexture.PANEL_INNER.getTexture());
    preCanIn1.addPanel(new PanelTextBox(new GuiTransform(GuiAlign.MID_CENTER, -32, -8, 64, 16, 0), "EXAMPLE").setAlignment(1).setColor(PresetColor.TEXT_AUX_0.getColor()));
    preCan.addPanel(preCanIn1);
    CanvasTextured preCanIn2 = new CanvasTextured(new GuiTransform(GuiAlign.HALF_BOTTOM, new GuiPadding(0, 0, 0, 0), 0), PresetTexture.AUX_FRAME_0.getTexture());
    preCan.addPanel(preCanIn2);
    IGuiTexture icoSlides = new SlideShowTexture(1F, new GuiTextureColored(PresetTexture.QUEST_NORM_0.getTexture(), PresetColor.QUEST_ICON_LOCKED.getColor()), new GuiTextureColored(PresetTexture.QUEST_NORM_1.getTexture(), PresetColor.QUEST_ICON_UNLOCKED.getColor()), new GuiTextureColored(PresetTexture.QUEST_NORM_2.getTexture(), PresetColor.QUEST_ICON_PENDING.getColor()), new GuiTextureColored(PresetTexture.QUEST_NORM_3.getTexture(), PresetColor.QUEST_ICON_COMPLETE.getColor()), new GuiTextureColored(PresetTexture.QUEST_MAIN_0.getTexture(), PresetColor.QUEST_ICON_LOCKED.getColor()), new GuiTextureColored(PresetTexture.QUEST_MAIN_1.getTexture(), PresetColor.QUEST_ICON_UNLOCKED.getColor()), new GuiTextureColored(PresetTexture.QUEST_MAIN_2.getTexture(), PresetColor.QUEST_ICON_PENDING.getColor()), new GuiTextureColored(PresetTexture.QUEST_MAIN_3.getTexture(), PresetColor.QUEST_ICON_COMPLETE.getColor()), new GuiTextureColored(PresetTexture.QUEST_AUX_0.getTexture(), PresetColor.QUEST_ICON_LOCKED.getColor()), new GuiTextureColored(PresetTexture.QUEST_AUX_1.getTexture(), PresetColor.QUEST_ICON_UNLOCKED.getColor()), new GuiTextureColored(PresetTexture.QUEST_AUX_2.getTexture(), PresetColor.QUEST_ICON_PENDING.getColor()), new GuiTextureColored(PresetTexture.QUEST_AUX_3.getTexture(), PresetColor.QUEST_ICON_COMPLETE.getColor()));
    PanelGeneric pqp = new PanelGeneric(new GuiTransform(new Vector4f(0.25F, 0.5F, 0.25F, 0.5F), -12, -12, 24, 24, 0), icoSlides);
    preCanIn2.addPanel(pqp);
    CanvasTextured itemFrame = new CanvasTextured(new GuiTransform(new Vector4f(0.75F, 0.5F, 0.75F, 0.5F), -12, -12, 24, 24, 0), PresetTexture.ITEM_FRAME.getTexture());
    itemFrame.addPanel(new PanelGeneric(new GuiTransform(GuiAlign.FULL_BOX, new GuiPadding(1, 1, 1, 1), 0), new ItemTexture(new BigItemStack(BetterQuesting.guideBook))));
    preCanIn2.addPanel(itemFrame);
    IGuiLine linSeq = new GuiLineSequence(1F, PresetLine.QUEST_LOCKED.getLine(), PresetLine.QUEST_UNLOCKED.getLine(), PresetLine.QUEST_PENDING.getLine(), PresetLine.QUEST_COMPLETE.getLine());
    IGuiColor colSeq = new GuiColorSequence(1F, PresetColor.QUEST_LINE_LOCKED.getColor(), PresetColor.QUEST_LINE_UNLOCKED.getColor(), PresetColor.QUEST_LINE_PENDING.getColor(), PresetColor.QUEST_LINE_COMPLETE.getColor());
    preCanIn2.addPanel(new PanelLine(pqp.getTransform(), itemFrame.getTransform(), linSeq, 4, colSeq, 1));
    preCanIn2.addPanel(new PanelTextBox(new GuiTransform(GuiAlign.FULL_BOX, new GuiPadding(8, 8, 8, 8), 0), "EXAMPLE").setAlignment(1).setColor(PresetColor.TEXT_AUX_1.getColor()));
    IGuiRect ls0 = new GuiTransform(GuiAlign.TOP_CENTER, 0, 16, 0, 0, 0);
    ls0.setParent(inCan.getTransform());
    IGuiRect le0 = new GuiTransform(GuiAlign.BOTTOM_CENTER, 0, -16, 0, 0, 0);
    le0.setParent(inCan.getTransform());
    PanelLine paLine0 = new PanelLine(ls0, le0, PresetLine.GUI_DIVIDER.getLine(), 1, PresetColor.GUI_DIVIDER.getColor(), 1);
    inCan.addPanel(paLine0);
}
Also used : PanelButton(betterquesting.api2.client.gui.controls.PanelButton) IPanelButton(betterquesting.api2.client.gui.controls.IPanelButton) GuiLineSequence(betterquesting.api2.client.gui.resources.lines.GuiLineSequence) PanelVScrollBar(betterquesting.api2.client.gui.panels.bars.PanelVScrollBar) IGuiColor(betterquesting.api2.client.gui.resources.colors.IGuiColor) Vector4f(org.lwjgl.util.vector.Vector4f) ResourceLocation(net.minecraft.util.ResourceLocation) CanvasTextured(betterquesting.api2.client.gui.panels.CanvasTextured) PanelButtonStorage(betterquesting.api2.client.gui.controls.PanelButtonStorage) ITheme(betterquesting.api.client.themes.ITheme) IGuiTexture(betterquesting.api2.client.gui.resources.textures.IGuiTexture) IGuiLine(betterquesting.api2.client.gui.resources.lines.IGuiLine) PanelLine(betterquesting.api2.client.gui.panels.content.PanelLine) CanvasEmpty(betterquesting.api2.client.gui.panels.CanvasEmpty) SlideShowTexture(betterquesting.api2.client.gui.resources.textures.SlideShowTexture) PanelTextBox(betterquesting.api2.client.gui.panels.content.PanelTextBox) GuiTextureColored(betterquesting.api2.client.gui.resources.textures.GuiTextureColored) GuiColorSequence(betterquesting.api2.client.gui.resources.colors.GuiColorSequence) CanvasScrolling(betterquesting.api2.client.gui.panels.lists.CanvasScrolling) PanelGeneric(betterquesting.api2.client.gui.panels.content.PanelGeneric) BigItemStack(betterquesting.api.utils.BigItemStack) ItemTexture(betterquesting.api2.client.gui.resources.textures.ItemTexture)

Aggregations

Vector4f (org.lwjgl.util.vector.Vector4f)7 PanelButton (betterquesting.api2.client.gui.controls.PanelButton)4 CanvasTextured (betterquesting.api2.client.gui.panels.CanvasTextured)4 IPanelButton (betterquesting.api2.client.gui.controls.IPanelButton)3 CanvasEmpty (betterquesting.api2.client.gui.panels.CanvasEmpty)3 PanelVScrollBar (betterquesting.api2.client.gui.panels.bars.PanelVScrollBar)3 CanvasScrolling (betterquesting.api2.client.gui.panels.lists.CanvasScrolling)3 GuiPadding (betterquesting.api2.client.gui.misc.GuiPadding)2 GuiRectangle (betterquesting.api2.client.gui.misc.GuiRectangle)2 GuiTransform (betterquesting.api2.client.gui.misc.GuiTransform)2 PanelLine (betterquesting.api2.client.gui.panels.content.PanelLine)2 PanelTextBox (betterquesting.api2.client.gui.panels.content.PanelTextBox)2 IGuiTexture (betterquesting.api2.client.gui.resources.textures.IGuiTexture)2 ResourceLocation (net.minecraft.util.ResourceLocation)2 Matrix4f (org.lwjgl.util.vector.Matrix4f)2 Vector3f (org.lwjgl.util.vector.Vector3f)2 ITheme (betterquesting.api.client.themes.ITheme)1 BigItemStack (betterquesting.api.utils.BigItemStack)1 PanelButtonStorage (betterquesting.api2.client.gui.controls.PanelButtonStorage)1 IGuiRect (betterquesting.api2.client.gui.misc.IGuiRect)1