Skip to content

Commit 7ecc11b

Browse files
Merge pull request #32 from falkreon/1.21
Remove default tablet keybind
2 parents fecdd84 + 1dd745d commit 7ecc11b

File tree

4 files changed

+20
-6
lines changed

4 files changed

+20
-6
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +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-
The *Shard Collection* shows obtained and missing shards. It can be accessed from the pause menu, or via hotkey (J).
15-
16-
Hold shift while viewing your shard collection to see overall completion, as well as shard rarity.
14+
Type `/shards` or use a *Shard Tablet* any time to view shows obtained and missing shards. 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!
1716

1817
**Features:**
1918
- 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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
public class ScatteredShardsClient implements ClientModInitializer {
2727
public static final KeyBinding VIEW_COLLECTION = KeyBindingHelper.registerKeyBinding(new KeyBinding(
2828
"key.scattered_shards.collection",
29-
InputUtil.GLFW_KEY_J,
29+
InputUtil.UNKNOWN_KEY.getCode(),
3030
"key.categories.scattered_shards"
3131
));
3232

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

Lines changed: 16 additions & 2 deletions
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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
"toast.scattered_shards.collected": "Shard Collected!",
3636
"toast.scattered_shards.collected.prompt": "Press [%s] to view",
37+
"toast.scattered_shards.collected.prompt_without_key": "Use %s to view",
3738
"toast.scattered_shards.shard_mod.title": "Shard Modification",
3839
"toast.scattered_shards.shard_mod.success": "Successfully modified '%s'",
3940
"toast.scattered_shards.shard_mod.fail": "Failed to modify '%s'",

0 commit comments

Comments
 (0)