Exemplo n.º 1
0
  @Override
  public boolean isEnabled() {

    if (stat.canBeUnlocked(player, level)) {
      if (player.getUnlockedLevel(stat) < stat.maxLevel()) {
        return true;
      }
    }
    return false;
  }
Exemplo n.º 2
0
 @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);
 }
Exemplo n.º 3
0
 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);
   }
 }
Exemplo n.º 4
0
 @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);
 }
Exemplo n.º 5
0
 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);
   }
 }
Exemplo n.º 6
0
 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();
 }
Exemplo n.º 7
0
 @Override
 public void addTooltip(List<String> list) {
   stat.onTooltip(player, level, list, gui.getMouseX(), gui.getMouseY());
 }