use of com.simibubi.create.foundation.tileEntity.behaviour.ValueBox.IconValueBox in project Create by Creators-of-Create.
the class ScrollValueRenderer method addBox.
protected static void addBox(ClientLevel world, BlockPos pos, Direction face, ScrollValueBehaviour behaviour, boolean highlight) {
AABB bb = new AABB(Vec3.ZERO, Vec3.ZERO).inflate(.5f).contract(0, 0, -.5f).move(0, 0, -.125f);
Component label = behaviour.label;
ValueBox box;
if (behaviour instanceof ScrollOptionBehaviour) {
box = new IconValueBox(label, ((ScrollOptionBehaviour<?>) behaviour).getIconForSelected(), bb, pos);
} else {
box = new TextValueBox(label, bb, pos, new TextComponent(behaviour.formatValue()));
if (behaviour.unit != null)
box.subLabel(new TextComponent("(").append(behaviour.unit.apply(behaviour.scrollableValue)).append(")"));
}
box.scrollTooltip(new TextComponent("[").append(Lang.translate("action.scroll")).append("]"));
box.offsetLabel(behaviour.textShift.add(20, -10, 0)).withColors(0x5A5D5A, 0xB5B7B6).passive(!highlight);
CreateClient.OUTLINER.showValueBox(pos, box.transform(behaviour.slotPositioning)).lineWidth(1 / 64f).highlightFace(face);
}
Aggregations