@Override public boolean isEnabled() { if (stat.canBeUnlocked(player, level)) { if (player.getUnlockedLevel(stat) < stat.maxLevel()) { return true; } } return false; }
@Override public void onAction(int mouseX, int mouseY, int mouseButton) { if (super.intersectsWith(mouseX, mouseY)) { if (stat.canBeUnlocked(player, level + 1) && level < stat.maxLevel()) { GuiBase.playSound(Reference.MOD_ID + ":" + "gui.biotic_stat_unlock", 1, 1); MatterOverdrive.packetPipeline.sendToServer( new PacketUnlockBioticStat(stat.getUnlocalizedName(), ++level)); } } super.onAction(mouseX, mouseY, mouseButton); }
public void drawForeground(int x, int y) { if (stat.maxLevel() > 1 && level > 0) { String levelInfo = Integer.toString(level); ClientProxy.holoIcons.renderIcon("black_circle", posX + 14, posY + 14, 10, 10); getFontRenderer().drawString(levelInfo, posX + 16, posY + 16, 0xFFFFFF); } }
@Override public void drawBackground(int mouseX, int mouseY, float gameTicks) { glEnable(GL_BLEND); ApplyColor(); super.drawBackground(mouseX, mouseY, gameTicks); drawIcon(stat.getIcon(level), posX + 3, posY + 3); if (direction != ForgeDirection.UNKNOWN) { glPushMatrix(); glTranslated(posX, posY, 0); glTranslated(sizeX / 2, sizeY / 2, 0); glTranslated(direction.offsetX * (sizeX * 0.75), -direction.offsetY * (sizeY * 0.75), 0); if (direction == ForgeDirection.EAST) { glRotated(90, 0, 0, 1); } else if (direction == ForgeDirection.WEST) { glRotated(-90, 0, 0, 1); } else if (direction == ForgeDirection.DOWN) { glRotated(180, 0, 0, 1); } glTranslated(-3.5, -3.5, 0); ClientProxy.holoIcons.renderIcon("up_arrow", 0, 0); glPopMatrix(); } ResetColor(); glDisable(GL_BLEND); }
protected void ApplyColor() { if (stat.canBeUnlocked(player, level) || player.isUnlocked(stat, level)) { if (level <= 0) { RenderUtils.applyColorWithMultipy(Reference.COLOR_HOLO, 0.5f); } else { RenderUtils.applyColor(Reference.COLOR_HOLO); } } else { RenderUtils.applyColorWithMultipy(Reference.COLOR_HOLO_RED, 0.5f); } }
public ElementBioStat( MOGuiBase gui, int posX, int posY, IBionicStat stat, int level, AndroidPlayer player, ForgeDirection direction) { super(gui, gui, posX, posY, stat.getUnlocalizedName(), 0, 0, 0, 0, 22, 22, ""); texture = ElementSlot.getTexture("holo"); texW = 22; texH = 22; this.stat = stat; this.player = player; this.level = level; this.direction = direction; cylinder = new Cylinder(); }
@Override public void addTooltip(List<String> list) { stat.onTooltip(player, level, list, gui.getMouseX(), gui.getMouseY()); }