Skip to content

Commit

Permalink
btw, level key translations
Browse files Browse the repository at this point in the history
  • Loading branch information
afamiliarquiet committed Oct 31, 2024
1 parent f2289eb commit 82feb2f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package io.github.afamiliarquiet.familiar_magic.client.gooey;

import io.github.afamiliarquiet.familiar_magic.FamiliarMagicClient;
import io.github.afamiliarquiet.familiar_magic.data.FamiliarAttachments;
import io.github.afamiliarquiet.familiar_magic.data.SummoningRequestData;
import net.minecraft.client.DeltaTracker;
import net.minecraft.client.Minecraft;
Expand Down Expand Up @@ -57,7 +56,8 @@ public void render(GuiGraphics guiGraphics, DeltaTracker deltaTracker) {
);

// i have a hunch this may not exist but we shall see! maybe neoforge is nice to me today
Component levelComponent = Component.translatable(requestData.tableLevelKey().location().toLanguageKey());
// ya didnt exist. so i make it my own and it's fine enough, compat with other mod dimensions should be easy enough
Component levelComponent = Component.translatable("familiar_magic.level_key." + requestData.tableLevelKey().location().toLanguageKey());
BlockPos destinationPos = requestData.tablePos();
Component positionComponent = Component.translatable(
"gui.familiar_magic.summoning_request.position",
Expand All @@ -68,8 +68,8 @@ public void render(GuiGraphics guiGraphics, DeltaTracker deltaTracker) {
List<ItemStack> offerings = requestData.offerings().orElse(List.of()); // *should* always be present but w/e

this.drawCenteredStringAtHeight(guiGraphics, minecraft.font, top, left, titleComponent, 0);
guiGraphics.drawWordWrap(minecraft.font, blurb, left + this.spacing, top + 26, this.imageWidth - 2 * this.spacing, 0x492f5b);
this.drawCenteredStringAtHeight(guiGraphics, minecraft.font, top, left, levelComponent, 60);
guiGraphics.drawWordWrap(minecraft.font, blurb, left + this.spacing, top + 26, this.imageWidth - 2 * this.spacing, 0x382414);
this.drawCenteredStringAtHeight(guiGraphics, minecraft.font, top, left, levelComponent, 62);
this.drawCenteredStringAtHeight(guiGraphics, minecraft.font, top, left, positionComponent, 72);

this.drawItems(guiGraphics, minecraft.font, top, left, offerings);
Expand Down
6 changes: 5 additions & 1 deletion src/main/resources/assets/familiar_magic/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,9 @@
"commands.familiar_magic.success": "Placed candles for %s at %s %s %s",
"category.familiar_magic.familiar_magic": "Familiar Magic",
"key.familiar_magic.focus": "Focus",
"key.familiar_magic.focus_toggle": "Toggle Focus"
"key.familiar_magic.focus_toggle": "Toggle Focus",

"familiar_magic.level_key.minecraft.overworld": "The Overworld",
"familiar_magic.level_key.minecraft.the_nether": "The Nether",
"familiar_magic.level_key.minecraft.the_end": "The End"
}

0 comments on commit 82feb2f

Please sign in to comment.