Skip to content

Commit 9c1647b

Browse files
committed
Remove default tablet key, fixup toast text and readme
1 parent 644c0da commit 9c1647b

File tree

4 files changed

+20
-4
lines changed

4 files changed

+20
-4
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ Requires <a href="https://modrinth.com/mod/connector">Connector</a> and <a href=
1111

1212
**Scattered Shards** adds a system of collectible "shards" that can be created via a UI and placed in-world.
1313

14-
Type `/shards` or use a *Shard Tablet* any time to view which shards you've collected, and which ones are left!
14+
Type `/shards` or use a *Shard Tablet* any time to view which shards you've collected, and which ones are left! There is also a keybind to open the tablet;
15+
it is not bound by default, so you may want to create a default setting for your modpack!
1516

1617
**Features:**
1718
- Shards can have titles, descriptions, and face art in the form of item stacks or arbitrary textures

src/main/java/net/modfest/scatteredshards/client/ScatteredShardsClient.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
public class ScatteredShardsClient implements ClientModInitializer {
2525
public static final KeyBinding VIEW_COLLECTION = KeyBindingHelper.registerKeyBinding(new KeyBinding(
2626
"key.scattered_shards.collection",
27-
InputUtil.GLFW_KEY_J,
27+
InputUtil.UNKNOWN_KEY.getCode(),
2828
"key.categories.scattered_shards"
2929
));
3030

src/main/java/net/modfest/scatteredshards/client/ShardCollectedToast.java

+16-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@
2323
public class ShardCollectedToast implements Toast {
2424
public static final int TITLE_COLOR = 0xFF_FFFF00;
2525
public static final Text TITLE = Text.translatable("toast.scattered_shards.collected");
26-
public static final Text HINT = Text.translatable("toast.scattered_shards.collected.prompt", Text.keybind(ScatteredShardsClient.VIEW_COLLECTION.getTranslationKey()).formatted(Formatting.GOLD).formatted(Formatting.BOLD));
2726
private static final Identifier TEXTURE = Identifier.ofVanilla("toast/advancement");
2827
public static final int DURATION = 5000;
2928

@@ -33,9 +32,24 @@ public class ShardCollectedToast implements Toast {
3332
private final int height;
3433

3534
public ShardCollectedToast(Shard shard) {
35+
36+
Text hint;
37+
38+
if (ScatteredShardsClient.VIEW_COLLECTION.isUnbound()) {
39+
hint = Text.translatable(
40+
"toast.scattered_shards.collected.prompt_without_key",
41+
Text.literal("/shards").formatted(Formatting.AQUA).formatted(Formatting.BOLD)
42+
);
43+
} else {
44+
hint = Text.translatable(
45+
"toast.scattered_shards.collected.prompt",
46+
Text.keybind(ScatteredShardsClient.VIEW_COLLECTION.getTranslationKey()).formatted(Formatting.GOLD).formatted(Formatting.BOLD)
47+
);
48+
}
49+
3650
this.icon = shard.icon();
3751
this.descLines = wrap(List.of(shard.name().copy().withColor(ScatteredShardsAPI.getClientLibrary().shardTypes().get(shard.shardTypeId()).orElse(ShardType.MISSING).textColor())));
38-
this.hintLines = wrap(List.of(HINT));
52+
this.hintLines = wrap(List.of(hint));
3953
this.height = 32 + Math.max(0, Math.max(this.descLines.size(), this.hintLines.size()) - 1) * 11;
4054
icon.ifRight(ModMetaUtil::touchIconTexture);
4155
}

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

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929

3030
"toast.scattered_shards.collected": "Shard Collected!",
3131
"toast.scattered_shards.collected.prompt": "Press [%s] to view",
32+
"toast.scattered_shards.collected.prompt_without_key": "Use %s to view",
3233
"toast.scattered_shards.shard_mod.title": "Shard Modification",
3334
"toast.scattered_shards.shard_mod.success": "Successfully modified '%s'",
3435
"toast.scattered_shards.shard_mod.fail": "Failed to modify '%s'",

0 commit comments

Comments
 (0)