Ejemplo n.º 1
0
 public String getFullGameInfo() {
   return ResourceManager.getInstance().getText("TXT_GAME_NAME")
       + " v. "
       + ResourceManager.getInstance().getText("TXT_GAME_VER")
       + " "
       + ResourceManager.getInstance().getText("TXT_GAME_PHASE");
 }
Ejemplo n.º 2
0
 public BuyPreview(BasicUnitBuilder builder, ArmyUnit unit, int credits, GameContainer gc) {
   super(0, 0, gc);
   this.builder = builder;
   this.unit = unit;
   this.credits = credits;
   clrNotAvailable = new Color(100, 100, 100, 255);
   background = ResourceManager.getInstance().getImage("GUI_BOTTOM_SHORTCUT");
   backgroundHover = ResourceManager.getInstance().getImage("GUI_BOTTOM_SHORTCUT_HOVER");
 }
Ejemplo n.º 3
0
  @Override
  public void draw(Graphics g) {
    Color colorOriginal = ResourceManager.getInstance().getColor("COLOR_MAIN");
    Color color = new Color(colorOriginal.r, colorOriginal.g, colorOriginal.b, (float) 0.2);
    if (isMouseOver()) {

      if (isBuyable()) {
        if (equals(builder.getSelected())) {
          backgroundHover.draw(getX(), getY(), getWidth(), getHeight(), colorOriginal);
        } else {
          backgroundHover.draw(getX(), getY(), getWidth(), getHeight());
        }
        unit.getImgAvatar()
            .draw(
                getX() + UnitShortcut.BORDER,
                getY() + UnitShortcut.BORDER,
                getWidth() - UnitShortcut.BORDER * 2,
                getHeight() - UnitShortcut.BORDER * 2,
                unit.getPlayer().getColor());
      } else {
        background.draw(getX(), getY(), getWidth(), getHeight());
        unit.getImgAvatar()
            .draw(
                getX() + UnitShortcut.BORDER,
                getY() + UnitShortcut.BORDER,
                getWidth() - UnitShortcut.BORDER * 2,
                getHeight() - UnitShortcut.BORDER * 2,
                clrNotAvailable);
      }
      if (equals(builder.getSelected())) {
        g.setColor(color);
        g.drawRoundRect(getX(), getY(), getWidth(), getHeight(), 3);
      }
    } else {
      if (equals(builder.getSelected())) {
        backgroundHover.draw(getX(), getY(), getWidth(), getHeight(), colorOriginal);
      } else {
        background.draw(getX(), getY(), getWidth(), getHeight());
      }
      if (isBuyable()) {
        unit.getImgAvatar()
            .draw(
                getX() + UnitShortcut.BORDER,
                getY() + UnitShortcut.BORDER,
                getWidth() - UnitShortcut.BORDER * 2,
                getHeight() - UnitShortcut.BORDER * 2,
                unit.getPlayer().getColor());
      } else {
        unit.getImgAvatar()
            .draw(
                getX() + UnitShortcut.BORDER,
                getY() + UnitShortcut.BORDER,
                getWidth() - UnitShortcut.BORDER * 2,
                getHeight() - UnitShortcut.BORDER * 2,
                clrNotAvailable);
      }
      if (equals(builder.getSelected())) {
        g.setColor(color);
        g.drawRoundRect(getX(), getY(), getWidth(), getHeight(), 3);
      }
    }
  }