use of mcjty.theoneprobe.api.IProbeInfo in project GregTech by GregTechCE.
the class WorkableInfoProvider method addProbeInfo.
@Override
protected void addProbeInfo(IWorkable capability, IProbeInfo probeInfo, TileEntity tileEntity, EnumFacing sideHit) {
int currentProgress = capability.getProgress();
int maxProgress = capability.getMaxProgress();
if (maxProgress > 0) {
int progressScaled = maxProgress == 0 ? 0 : (int) Math.floor(currentProgress / (maxProgress * 1.0) * 100);
IProbeInfo horizontalPane = probeInfo.horizontal(probeInfo.defaultLayoutStyle().alignment(ElementAlignment.ALIGN_CENTER));
horizontalPane.text(TextStyleClass.INFO + "{*gregtech.top.progress*} ");
horizontalPane.progress(progressScaled, 100, probeInfo.defaultProgressStyle().suffix("%").borderColor(0x00000000).backgroundColor(0x00000000).filledColor(0xFF000099).alternateFilledColor(0xFF000077));
}
}
use of mcjty.theoneprobe.api.IProbeInfo in project RFToolsControl by McJty.
the class ProcessorBlock method addProbeInfo.
@Override
@Optional.Method(modid = "theoneprobe")
public void addProbeInfo(ProbeMode mode, IProbeInfo probeInfo, EntityPlayer player, World world, IBlockState blockState, IProbeHitData data) {
super.addProbeInfo(mode, probeInfo, player, world, blockState, data);
TileEntity te = world.getTileEntity(data.getPos());
if (te instanceof ProcessorTileEntity) {
ProcessorTileEntity processor = (ProcessorTileEntity) te;
if (processor.hasNetworkCard()) {
probeInfo.text(TextFormatting.GREEN + "Channel: " + processor.getChannelName());
probeInfo.text(TextFormatting.GREEN + "Nodes: " + processor.getNodeCount());
}
if (mode == ProbeMode.EXTENDED) {
List<String> lastMessages = processor.getLastMessages(6);
if (!lastMessages.isEmpty()) {
IProbeInfo v = probeInfo.vertical(probeInfo.defaultLayoutStyle().borderColor(0xffff0000));
for (String s : lastMessages) {
v.text(" " + s);
}
}
}
}
}
Aggregations