Skip to content
This repository has been archived by the owner on Apr 22, 2019. It is now read-only.

Commit

Permalink
Starting some work on modular components for GUIs
Browse files Browse the repository at this point in the history
  • Loading branch information
pahimar committed Apr 5, 2017
1 parent 94e2cec commit d76061f
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/com/pahimar/ee/client/gui/GuiAlchenomicon.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
*/
public class GuiAlchenomicon extends GuiScreen {

final int guiWidth = 256;
final int guiHeight = 256;
private static final int GUI_WIDTH = 256;
private static final int GUI_HEIGHT = 201;

private static final ResourceLocation TEXTURE = Textures.Gui.ALCHENOMICON;

Expand All @@ -37,7 +37,7 @@ public final void drawScreen(int mouseX, int mouseY, float partialTicks) {
this.drawDefaultBackground();
GlStateManager.color(1f, 1f, 1f, 1f);
mc.renderEngine.bindTexture(TEXTURE);
drawTexturedModalRect(width / 2 - guiWidth / 2, height / 2 - guiHeight / 2, 0, 0, guiWidth, guiHeight);
drawTexturedModalRect(width / 2 - GUI_WIDTH / 2, height / 2 - GUI_HEIGHT / 2, 0, 0, GUI_WIDTH, GUI_HEIGHT);
}

@Override
Expand Down
61 changes: 61 additions & 0 deletions src/main/java/com/pahimar/ee/client/gui/component/Component.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
package com.pahimar.ee.client.gui.component;

import net.minecraft.util.ResourceLocation;

/**
* TODO Finish Javadoc
*
* @author Pahimar (pahimar@gmail.com)
* @version 3.0.0
* @since 3.0.0
*/
//FIXME Pick up here
public class Component {

protected String componentId;
protected int width;
protected int height;
protected int xPosition;
protected int yPosition;
protected int uPosition;
protected int vPosition;
protected ResourceLocation resourceLocation;
protected boolean isEnabled;
protected boolean isVisible;

/**
* TODO Finish Javadoc
*
* @param componentId
* @since 3.0.0
*/
public Component(final String componentId) {
this.componentId = componentId;
}

/**
* TODO Finish Javadoc
*
* @return
* @since 3.0.0
*/
public int getWidth() {
return width;
}

/**
* TODO Finish Javadoc
*
* @return
* @since 3.0.0
*/
public int getHeight() {
return height;
}

public enum HoverState {
DISABLED,
NOT_HOVERED,
HOVERED
}
}

0 comments on commit d76061f

Please sign in to comment.