Skip to content

Commit 4b1f781

Browse files
committed
always show stats
1 parent 19c8f7a commit 4b1f781

File tree

4 files changed

+8
-17
lines changed

4 files changed

+8
-17
lines changed

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ authors=Falkreon, acikek
1616
contributors=Trudle, Tomate0613, afamiliarquiet, FoundationGames, TheEpicBlock, hama
1717
license=MIT
1818
# Mod Version
19-
baseVersion=1.9.2
19+
baseVersion=1.9.3
2020
# Branch Metadata
2121
branch=1.21.7
2222
tagBranch=1.21.7

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import net.modfest.scatteredshards.api.ShardLibrary;
1717
import net.modfest.scatteredshards.api.shard.Shard;
1818
import net.modfest.scatteredshards.api.shard.ShardType;
19-
import net.modfest.scatteredshards.client.ScatteredShardsClient;
2019
import net.modfest.scatteredshards.client.screen.widget.WLeftRightPanel;
2120
import net.modfest.scatteredshards.client.screen.widget.WShardPanel;
2221
import net.modfest.scatteredshards.client.screen.widget.WShardSetPanel;
@@ -58,7 +57,6 @@ public ShardTabletGuiDescription(ShardCollection collection, ShardLibrary librar
5857
int panelHeight = selectorPanel.getHeight();
5958

6059
WScaledLabel progressVisited = new WScaledLabel(() -> {
61-
if (!ScatteredShardsClient.hasShiftDown()) return Text.empty();
6260
int visitedSets = 0;
6361
for (Collection<Identifier> set : library.shardSets().asMap().values()) {
6462
for (Identifier identifier : set) {
@@ -74,10 +72,7 @@ public ShardTabletGuiDescription(ShardCollection collection, ShardLibrary librar
7472
progressVisited.setSize(80, 10);
7573
progressVisited.setLocation(13, panelHeight - 20);
7674

77-
WScaledLabel progressTotal = new WScaledLabel(() -> {
78-
if (!ScatteredShardsClient.hasShiftDown()) return Text.empty();
79-
return Text.translatable("gui.scattered_shards.tablet.label.progress.total", "%.0f%%".formatted(100 * collection.size() / (float) library.shards().size()));
80-
}, 1.0f).setColor(Colors.LIGHT_GRAY);
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);
8176
selectorPanel.add(progressTotal, 0, 0);
8277
progressTotal.setSize(80, 10);
8378
progressTotal.setLocation(selectorPanel.getWidth() - 72, panelHeight - 20);
@@ -123,7 +118,7 @@ public void addPainters() {
123118

124119
public static class Screen extends CottonClientScreen {
125120
public Screen(ShardCollection collection, ShardLibrary library) {
126-
super(new ShardTabletGuiDescription(collection, library));
121+
super(Text.translatable("menu.scattered_shards.collection"), new ShardTabletGuiDescription(collection, library));
127122
}
128123

129124
@Override

src/main/java/net/modfest/scatteredshards/client/screen/widget/WMiniShard.java

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package net.modfest.scatteredshards.client.screen.widget;
22

3-
import com.mojang.blaze3d.systems.RenderSystem;
43
import io.github.cottonmc.cotton.gui.client.ScreenDrawing;
54
import io.github.cottonmc.cotton.gui.widget.TooltipBuilder;
65
import io.github.cottonmc.cotton.gui.widget.WWidget;
@@ -21,7 +20,6 @@
2120
import net.modfest.scatteredshards.api.shard.ShardIconOffsets;
2221
import net.modfest.scatteredshards.api.shard.ShardTextureSettings;
2322
import net.modfest.scatteredshards.api.shard.ShardType;
24-
import net.modfest.scatteredshards.client.ScatteredShardsClient;
2523
import net.modfest.scatteredshards.client.screen.ShardTabletGuiDescription;
2624
import net.modfest.scatteredshards.util.ModMetaUtil;
2725

@@ -101,15 +99,13 @@ public void paint(DrawContext context, int x, int y, int mouseX, int mouseY) {
10199
@Override
102100
public void addTooltip(TooltipBuilder tooltip) {
103101

104-
if (ScatteredShardsClient.hasShiftDown() && !shard.name().getString().isBlank()) {
102+
if (!shard.name().getString().isBlank()) {
105103
tooltip.add(shard.name());
106104
}
107105
tooltip.add(ShardType.getDescription(shard.shardTypeId()).copy().withColor(0xFF_000000 | shardType.textColor()));
108-
if (ScatteredShardsClient.hasShiftDown()) {
109-
GlobalCollection globalCollection = ScatteredShardsAPI.getClientGlobalCollection();
110-
if (globalCollection != null) {
111-
tooltip.add(Text.translatable("gui.scattered_shards.tablet.tooltip.global_collection", "%.1f%%".formatted(100 * globalCollection.getCount(shardId) / (float) globalCollection.totalPlayers())).formatted(Formatting.GRAY));
112-
}
106+
GlobalCollection globalCollection = ScatteredShardsAPI.getClientGlobalCollection();
107+
if (globalCollection != null) {
108+
tooltip.add(Text.translatable("gui.scattered_shards.tablet.tooltip.global_collection", "%.1f%%".formatted(100 * globalCollection.getCount(shardId) / (float) globalCollection.totalPlayers())).formatted(Formatting.GRAY));
113109
}
114110

115111
super.addTooltip(tooltip);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
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",
5454
"gui.scattered_shards.tablet.label.progress.started": "%s Started",
55-
"gui.scattered_shards.tablet.label.progress.total": "%s Total",
55+
"gui.scattered_shards.tablet.label.progress.total": "%s Overall",
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)