use of net.minecraft.text.TranslatableText in project MCDoom by AzureDoom.
the class ArgentShovel method appendTooltip.
@Override
public void appendTooltip(ItemStack stack, World world, List<Text> tooltip, TooltipContext context) {
tooltip.add(new TranslatableText("doom.argent_powered.text").formatted(Formatting.RED).formatted(Formatting.ITALIC));
super.appendTooltip(stack, world, tooltip, context);
}
use of net.minecraft.text.TranslatableText in project MCDoom by AzureDoom.
the class AxeMarauderItem method appendTooltip.
@Override
public void appendTooltip(ItemStack stack, World world, List<Text> tooltip, TooltipContext context) {
tooltip.add(new TranslatableText("doom.marauder_axe1.text").formatted(Formatting.RED).formatted(Formatting.ITALIC));
tooltip.add(new TranslatableText("doom.marauder_axe2.text").formatted(Formatting.RED).formatted(Formatting.ITALIC));
tooltip.add(new TranslatableText("doom.marauder_axe3.text").formatted(Formatting.RED).formatted(Formatting.ITALIC));
super.appendTooltip(stack, world, tooltip, context);
}
use of net.minecraft.text.TranslatableText in project reeses-sodium-options by FlashyReese.
the class SodiumVideoOptionsScreen method parentFrameBuilder.
protected BasicFrame.Builder parentFrameBuilder() {
BasicFrame.Builder basicFrameBuilder;
Dim2i basicFrameDim = new Dim2i(0, 0, this.width, this.height);
Dim2i tabFrameDim = new Dim2i(basicFrameDim.width() / 20 / 2, basicFrameDim.height() / 4 / 2, basicFrameDim.width() - (basicFrameDim.width() / 20), basicFrameDim.height() / 4 * 3);
Dim2i undoButtonDim = new Dim2i(tabFrameDim.getLimitX() - 203, tabFrameDim.getLimitY() + 5, 65, 20);
Dim2i applyButtonDim = new Dim2i(tabFrameDim.getLimitX() - 134, tabFrameDim.getLimitY() + 5, 65, 20);
Dim2i closeButtonDim = new Dim2i(tabFrameDim.getLimitX() - 65, tabFrameDim.getLimitY() + 5, 65, 20);
Dim2i donateButtonDim = new Dim2i(tabFrameDim.getLimitX() - 122, tabFrameDim.y() - 26, 100, 20);
Dim2i hideDonateButtonDim = new Dim2i(tabFrameDim.getLimitX() - 20, tabFrameDim.y() - 26, 20, 20);
this.undoButton = new FlatButtonWidget(undoButtonDim, new TranslatableText("sodium.options.buttons.undo"), this::undoChanges);
this.applyButton = new FlatButtonWidget(applyButtonDim, new TranslatableText("sodium.options.buttons.apply"), this::applyChanges);
this.closeButton = new FlatButtonWidget(closeButtonDim, new TranslatableText("gui.done"), this::close);
this.donateButton = new FlatButtonWidget(donateButtonDim, new TranslatableText("sodium.options.buttons.donate"), this::openDonationPage);
this.hideDonateButton = new FlatButtonWidget(hideDonateButtonDim, new LiteralText("x"), this::hideDonationButton);
if (SodiumClientMod.options().notifications.hideDonationButton) {
this.setDonationButtonVisibility(false);
}
basicFrameBuilder = this.parentBasicFrameBuilder(basicFrameDim, tabFrameDim);
if (FabricLoader.getInstance().isModLoaded("iris")) {
int size = this.client.textRenderer.getWidth(new TranslatableText(IrisApi.getInstance().getMainScreenLanguageKey()));
Dim2i shaderPackButtonDim;
if (!SodiumClientMod.options().notifications.hideDonationButton) {
shaderPackButtonDim = new Dim2i(tabFrameDim.getLimitX() - 134 - size, tabFrameDim.y() - 26, 10 + size, 20);
} else {
shaderPackButtonDim = new Dim2i(tabFrameDim.getLimitX() - size - 10, tabFrameDim.y() - 26, 10 + size, 20);
}
FlatButtonWidget shaderPackButton = new FlatButtonWidget(shaderPackButtonDim, new TranslatableText(IrisApi.getInstance().getMainScreenLanguageKey()), () -> this.client.setScreen((Screen) IrisApi.getInstance().openMainIrisScreenObj(this)));
basicFrameBuilder.addChild(dim -> shaderPackButton);
}
return basicFrameBuilder;
}
use of net.minecraft.text.TranslatableText in project SpeedRunIGT by RedLime.
the class SpeedRunIGTInfoScreen method render.
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float delta) {
this.renderBackground(matrices);
matrices.push();
matrices.scale(1.5F, 1.5F, 1.5F);
this.drawCenteredText(matrices, this.textRenderer, this.title, this.width / 3, 15, 16777215);
matrices.pop();
this.drawCenteredText(matrices, this.textRenderer, new LiteralText("Made by RedLime"), this.width / 2, 50, 16777215);
this.drawCenteredText(matrices, this.textRenderer, new LiteralText("Discord : RedLime#0817"), this.width / 2, 62, 16777215);
this.drawCenteredText(matrices, this.textRenderer, new LiteralText("Version : " + SpeedRunIGT.MOD_VERSION.split("\\+")[0]), this.width / 2, 78, 16777215);
if (UPDATE_STATUS != UpdateStatus.NONE) {
if (UPDATE_STATUS == UpdateStatus.OUTDATED) {
update.active = true;
this.drawCenteredText(matrices, this.textRenderer, new LiteralText("Updated Version : " + UPDATE_VERSION).formatted(Formatting.YELLOW), this.width / 2, 88, 16777215);
}
this.drawCenteredText(matrices, this.textRenderer, new TranslatableText("speedrunigt.message.update." + UPDATE_STATUS.name().toLowerCase(Locale.ROOT)), this.width / 2, 116, 16777215);
}
super.render(matrices, mouseX, mouseY, delta);
}
use of net.minecraft.text.TranslatableText in project SpeedRunIGT by RedLime.
the class SpeedRunOptionScreen method init.
@Override
protected void init() {
super.init();
categorySubButtons.clear();
categorySelectButtons.clear();
tooltips.clear();
List<OptionButtonFactory> optionButtonFactoryList = SpeedRunOption.getOptionButtonFactories();
int categoryCount = 0;
for (OptionButtonFactory factory : optionButtonFactoryList) {
OptionButtonFactory.Storage builder = factory.create(this).build();
AbstractButtonWidget button = builder.getButtonWidget();
if (builder.getTooltip() != null)
tooltips.put(button, builder.getTooltip());
String category = builder.getCategory();
ArrayList<AbstractButtonWidget> categoryList = categorySubButtons.getOrDefault(category, new ArrayList<>());
categoryList.add(button);
categorySubButtons.put(category, categoryList);
if (!categorySelectButtons.containsKey(category)) {
ButtonWidget buttonWidget = new ButtonWidget(width - 110, 30 + (categoryCount++ * 22), 80, 20, new TranslatableText(category), (ButtonWidget buttonWidget1) -> selectCategory(category));
categorySelectButtons.put(category, buttonWidget);
addButton(buttonWidget);
}
}
addButton(new ButtonWidget(width - 85, height - 35, 70, 20, ScreenTexts.CANCEL, (ButtonWidget button) -> onClose()));
addButton(new ButtonWidget(15, height - 35, 70, 20, new TranslatableText("speedrunigt.menu.donate"), (ButtonWidget button) -> Util.getOperatingSystem().open("https://ko-fi.com/redlimerl")));
buttonListWidget = addChild(new ButtonScrollListWidget());
categorySelectButtons.keySet().stream().findFirst().ifPresent(this::selectCategory);
}
Aggregations