Skip to content

Commit

Permalink
fix e notation formatting on power milestone
Browse files Browse the repository at this point in the history
  • Loading branch information
serenibyss committed Sep 30, 2024
1 parent 88d8155 commit 36296a0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1392,7 +1392,7 @@ protected ModularWindow createIndividualMilestoneWindow(final EntityPlayer playe
.setPos(5, 50)
.setSize(140, 30))
.widget(
TextWidget.dynamicText(() -> milestoneProgressText(currentMilestoneID, true))
TextWidget.dynamicText(() -> milestoneProgressText(currentMilestoneID))
.setScale(0.7f)
.setDefaultColor(EnumChatFormatting.WHITE)
.setSize(140, 30)
Expand Down Expand Up @@ -2692,7 +2692,7 @@ protected ModularWindow createSpecialThanksWindow(final EntityPlayer player) {
.setSize(60, 10))
.widget(
new TextWidget(
translateToLocal("gt.blockmachines.multimachine.FOG.serenybiss") + " "
translateToLocal("gt.blockmachines.multimachine.FOG.serenibyss") + " "
+ EnumChatFormatting.DARK_AQUA
+ translateToLocal("gt.blockmachines.multimachine.FOG.teg")).setScale(0.8f)
.setTextAlignment(Alignment.CenterLeft)
Expand Down Expand Up @@ -3502,14 +3502,13 @@ private Text currentMilestone(int milestoneID) {
+ milestoneProgress[milestoneID]);
}

private Text milestoneProgressText(int milestoneID, boolean formatting) {
private Text milestoneProgressText(int milestoneID) {
long max;
BigInteger bigMax;
String suffix;
String progressText = translateToLocal("gt.blockmachines.multimachine.FOG.progress");
Text done = new Text(translateToLocal("gt.blockmachines.multimachine.FOG.milestonecomplete"));
if (noFormatting) {
formatting = false;
done = new Text(
translateToLocal("gt.blockmachines.multimachine.FOG.milestonecomplete") + EnumChatFormatting.DARK_RED
+ "?");
Expand All @@ -3524,7 +3523,7 @@ private Text milestoneProgressText(int milestoneID, boolean formatting) {
bigMax = BigInteger.valueOf(LongMath.pow(9, milestoneProgress[0]))
.multiply(BigInteger.valueOf(LongMath.pow(10, 15)));
}
if (formatting && (totalPowerConsumed.compareTo(BigInteger.valueOf(1_000L)) > 0)) {
if (!noFormatting && (bigMax.compareTo(BigInteger.valueOf(1_000L)) > 0)) {
return new Text(
progressText + ": " + EnumChatFormatting.GRAY + toExponentForm(bigMax) + " " + suffix);
} else {
Expand Down Expand Up @@ -3568,7 +3567,7 @@ private Text milestoneProgressText(int milestoneID, boolean formatting) {
default:
return new Text("Error");
}
if (formatting) {
if (!noFormatting) {
return new Text(progressText + ": " + EnumChatFormatting.GRAY + formatNumbers(max) + " " + suffix);
} else {
return new Text(progressText + ": " + EnumChatFormatting.GRAY + max + " " + suffix);
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/tectech/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,7 @@ gt.blockmachines.multimachine.FOG.lead=Project Lead
gt.blockmachines.multimachine.FOG.cloud=GDCloud
gt.blockmachines.multimachine.FOG.programming=Programming
gt.blockmachines.multimachine.FOG.teg=TheEpicGamer
gt.blockmachines.multimachine.FOG.serenybiss=§dSereni§5byss
gt.blockmachines.multimachine.FOG.serenibyss=§dSereni§5byss
gt.blockmachines.multimachine.FOG.textures=Textures & Structure
gt.blockmachines.multimachine.FOG.ant=Ant
gt.blockmachines.multimachine.FOG.lore=Loremaster
Expand Down

0 comments on commit 36296a0

Please sign in to comment.