/** * Draws the stack directly to the screen. * * @param x * The x coordinate of the building * @param y * The y coordinate of the building * @param material * The material the stack should have. * @param count * The number of elements on the stack */ private void drawStackAtScreen(int x, int y, EMaterialType material, int count, float color) { int stackIndex = material.getStackIndex(); Sequence<? extends Image> seq = this.imageProvider.getSettlerSequence(OBJECTS_FILE, stackIndex); draw(seq.getImageSafe(count - 1, () -> Labels.getName(material, count != 1) + "@" + count), x, y, 0, color); }
int count = ship.getCargoCount(j); if (material != null && count > 0) { Sequence<? extends Image> seq = this.imageProvider.getSettlerSequence(OBJECTS_FILE, material.getStackIndex()); Image image = seq.getImageSafe(count - 1, () -> Labels.getName(material, false)); image.drawAt(glDrawContext, viewX + xShift, viewY + yShift + CARGO_DECK_HEIGHT, 0, color, shade); int count = ship.getCargoCount(j); if (material != null && count > 0) { Sequence<? extends Image> seq = this.imageProvider.getSettlerSequence(OBJECTS_FILE, material.getStackIndex()); Image image = seq.getImageSafe(count - 1, () -> Labels.getName(material, false)); image.drawAt(glDrawContext, viewX + xShift, viewY + yShift + CARGO_DECK_HEIGHT, 0, color, shade);