|
6 | 6 | import io.github.cottonmc.cotton.gui.widget.WListPanel;
|
7 | 7 | import io.github.cottonmc.cotton.gui.widget.WPanelWithInsets;
|
8 | 8 | import io.github.cottonmc.cotton.gui.widget.WPlainPanel;
|
| 9 | +import io.github.cottonmc.cotton.gui.widget.data.HorizontalAlignment; |
9 | 10 | import io.github.cottonmc.cotton.gui.widget.data.Insets;
|
| 11 | +import io.github.cottonmc.cotton.gui.widget.data.Vec2i; |
10 | 12 | import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
11 | 13 | import net.minecraft.text.Text;
|
12 | 14 | import net.minecraft.util.Colors;
|
@@ -66,16 +68,22 @@ public ShardTabletGuiDescription(ShardCollection collection, ShardLibrary librar
|
66 | 68 | }
|
67 | 69 | }
|
68 | 70 | }
|
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())); |
70 | 72 | }, 1.0f).setColor(Colors.LIGHT_GRAY);
|
71 | 73 | 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); |
74 | 77 |
|
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); |
76 | 79 | 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); |
79 | 87 |
|
80 | 88 | ClientPlayNetworking.send(C2SRequestGlobalCollection.INSTANCE);
|
81 | 89 |
|
|
0 commit comments