Skip to content

Commit 7e4f2e8

Browse files
committed
use whole numbers
1 parent 4b1f781 commit 7e4f2e8

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

src/main/java/net/modfest/scatteredshards/client/screen/ShardTabletGuiDescription.java

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
import io.github.cottonmc.cotton.gui.widget.WListPanel;
77
import io.github.cottonmc.cotton.gui.widget.WPanelWithInsets;
88
import io.github.cottonmc.cotton.gui.widget.WPlainPanel;
9+
import io.github.cottonmc.cotton.gui.widget.data.HorizontalAlignment;
910
import io.github.cottonmc.cotton.gui.widget.data.Insets;
11+
import io.github.cottonmc.cotton.gui.widget.data.Vec2i;
1012
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
1113
import net.minecraft.text.Text;
1214
import net.minecraft.util.Colors;
@@ -66,16 +68,22 @@ public ShardTabletGuiDescription(ShardCollection collection, ShardLibrary librar
6668
}
6769
}
6870
}
69-
return Text.translatable("gui.scattered_shards.tablet.label.progress.started", "%.0f%%".formatted(100 * visitedSets / (float) library.shardSets().asMap().keySet().size()));
71+
return Text.translatable("gui.scattered_shards.tablet.label.progress.started", "%d/%d".formatted(visitedSets, library.shardSets().asMap().size()));
7072
}, 1.0f).setColor(Colors.LIGHT_GRAY);
7173
selectorPanel.add(progressVisited, 0, 0);
72-
progressVisited.setSize(80, 10);
73-
progressVisited.setLocation(13, panelHeight - 20);
74+
progressVisited.setSize(100, 10);
75+
progressVisited.setLocation(selectorPanel.getInsets().left(), panelHeight - selectorPanel.getInsets().bottom() - 10);
76+
progressVisited.setHorizontalAlignment(HorizontalAlignment.LEFT);
7477

75-
WScaledLabel progressTotal = new WScaledLabel(() -> Text.translatable("gui.scattered_shards.tablet.label.progress.total", "%.0f%%".formatted(100 * collection.size() / (float) library.shards().size())), 1.0f).setColor(Colors.LIGHT_GRAY);
78+
WScaledLabel progressTotal = new WScaledLabel(() -> Text.translatable("gui.scattered_shards.tablet.label.progress.total", "%d/%d".formatted(collection.size(), library.shards().size())), 1.0f).setColor(Colors.LIGHT_GRAY);
7679
selectorPanel.add(progressTotal, 0, 0);
77-
progressTotal.setSize(80, 10);
78-
progressTotal.setLocation(selectorPanel.getWidth() - 72, panelHeight - 20);
80+
progressTotal.setHorizontalAlignment(HorizontalAlignment.RIGHT);
81+
progressTotal.setSize(100, 10);
82+
progressTotal.setLocation(selectorPanel.getWidth() - selectorPanel.getInsets().right() - 100 - 10 /* scrollbar */, panelHeight - selectorPanel.getInsets().bottom() - 10);
83+
84+
setTitleColor(0xFF_FFFFFF);
85+
setTitlePos(new Vec2i(root.getX() + root.getWidth() / 2, root.getAbsoluteY() - 10));
86+
setTitleAlignment(HorizontalAlignment.CENTER);
7987

8088
ClientPlayNetworking.send(C2SRequestGlobalCollection.INSTANCE);
8189

src/main/resources/assets/scattered_shards/lang/en_us.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
"gui.scattered_shards.creator.button.save": "Save",
5252
"gui.scattered_shards.tablet.click_on_a_shard": "Click on a Shard to the left",
5353
"gui.scattered_shards.tablet.tooltip.global_collection": "%s of players have this shard",
54-
"gui.scattered_shards.tablet.label.progress.started": "%s Started",
55-
"gui.scattered_shards.tablet.label.progress.total": "%s Overall",
54+
"gui.scattered_shards.tablet.label.progress.started": "%s Started Sets",
55+
"gui.scattered_shards.tablet.label.progress.total": "%s Shards",
5656

5757
"argument.scattered_shards.entity.options.has_shard.description": "Shard Identifier",
5858
"argument.scattered_shards.entity.options.has_shard.invalid": "Unknown shard identifier '%s'"

0 commit comments

Comments
 (0)