Skip to content

Commit e694005

Browse files
committed
Do 'working dynamic color substitutions into IKey.lang' TODO
1 parent d8f9845 commit e694005

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

src/main/java/gregtech/common/metatileentities/multi/electric/MetaTileEntityHPCA.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ protected void configureDisplayText(MultiblockUIBuilder builder) {
415415
"gregtech.multiblock.hpca.energy",
416416
KeyUtil.number(syncer.syncLong(hpcaHandler.cachedEUt)),
417417
KeyUtil.number(syncer.syncLong(hpcaHandler.getMaxEUt())),
418-
voltageName));
418+
voltageName + TextFormatting.GRAY));
419419

420420
// Provided Computation
421421
manager.add(KeyUtil.lang("gregtech.multiblock.hpca.computation",
@@ -568,14 +568,17 @@ public void registerBars(List<UnaryOperator<TemplateBarBuilder>> bars, PanelSync
568568
double temp = temperatureValue.getDoubleValue();
569569
int degrees = (int) Math.round(temp / 10.0);
570570

571-
// TODO working dynamic color substitutions into IKey.lang
571+
TextFormatting color;
572572
if (temp < 500) {
573-
t.addLine(IKey.lang("gregtech.multiblock.hpca.temperature.low", degrees));
573+
color = TextFormatting.GREEN;
574574
} else if (temp < 750) {
575-
t.addLine(IKey.lang("gregtech.multiblock.hpca.temperature.medium", degrees));
575+
color = TextFormatting.YELLOW;
576576
} else {
577-
t.addLine(IKey.lang("gregtech.multiblock.hpca.temperature.high", degrees));
577+
color = TextFormatting.RED;
578578
}
579+
580+
t.addLine(IKey.lang("gregtech.multiblock.hpca.temperature",
581+
() -> new Object[] { color, degrees }));
579582
} else {
580583
t.addLine(IKey.lang("gregtech.multiblock.invalid_structure"));
581584
}

src/main/resources/assets/gregtech/lang/en_us.lang

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5958,9 +5958,7 @@ gregtech.multiblock.data_bank.providing=Providing data.
59585958

59595959
gregtech.multiblock.hpca.computation=§7Providing: §b%,d / %,d CWU/t
59605960
gregtech.multiblock.hpca.energy=Using: %s / %s EU/t (%s)
5961-
gregtech.multiblock.hpca.temperature.high=§7Temperature: §c%,d°C
5962-
gregtech.multiblock.hpca.temperature.medium=§7Temperature: §e%,d°C
5963-
gregtech.multiblock.hpca.temperature.low=§7Temperature: §a%,d°C
5961+
gregtech.multiblock.hpca.temperature=§7Temperature: %s%,d°C
59645962
gregtech.multiblock.hpca.hover_for_info=Hover for details
59655963
gregtech.multiblock.hpca.error_damaged=Damaged component in structure!
59665964
gregtech.multiblock.hpca.error_temperature=Temperature above 100C, components may be damaged!

0 commit comments

Comments
 (0)