Search in sources :

Example 21 with TranslatableText

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);
}
Also used : TranslatableText(net.minecraft.text.TranslatableText)

Example 22 with TranslatableText

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);
}
Also used : TranslatableText(net.minecraft.text.TranslatableText)

Example 23 with TranslatableText

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;
}
Also used : Dim2i(me.jellysquid.mods.sodium.client.util.Dim2i) TranslatableText(net.minecraft.text.TranslatableText) VideoOptionsScreen(net.minecraft.client.gui.screen.option.VideoOptionsScreen) Screen(net.minecraft.client.gui.screen.Screen) FlatButtonWidget(me.jellysquid.mods.sodium.client.gui.widgets.FlatButtonWidget) BasicFrame(me.flashyreese.mods.reeses_sodium_options.client.gui.frame.BasicFrame) LiteralText(net.minecraft.text.LiteralText)

Example 24 with TranslatableText

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);
}
Also used : TranslatableText(net.minecraft.text.TranslatableText) LiteralText(net.minecraft.text.LiteralText)

Example 25 with TranslatableText

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);
}
Also used : TranslatableText(net.minecraft.text.TranslatableText) OptionButtonFactory(com.redlimerl.speedrunigt.api.OptionButtonFactory) AbstractButtonWidget(net.minecraft.client.gui.widget.AbstractButtonWidget) AbstractButtonWidget(net.minecraft.client.gui.widget.AbstractButtonWidget) ButtonWidget(net.minecraft.client.gui.widget.ButtonWidget)

Aggregations

TranslatableText (net.minecraft.text.TranslatableText)161 LiteralText (net.minecraft.text.LiteralText)30 Text (net.minecraft.text.Text)19 ItemStack (net.minecraft.item.ItemStack)16 ArrayList (java.util.ArrayList)15 ButtonWidget (net.minecraft.client.gui.widget.ButtonWidget)14 List (java.util.List)12 MinecraftClient (net.minecraft.client.MinecraftClient)12 ServerPlayerEntity (net.minecraft.server.network.ServerPlayerEntity)12 SPEInterface (eu.pb4.armorstandeditor.helpers.SPEInterface)9 LivingEntity (net.minecraft.entity.LivingEntity)9 PlayerEntity (net.minecraft.entity.player.PlayerEntity)8 ListTag (net.minecraft.nbt.ListTag)8 Formatting (net.minecraft.util.Formatting)8 BlockPos (net.minecraft.util.math.BlockPos)8 Environment (net.fabricmc.api.Environment)7 AbstractButtonWidget (net.minecraft.client.gui.widget.AbstractButtonWidget)7 Entity (net.minecraft.entity.Entity)7 Collection (java.util.Collection)6 ArmorStandPreset (eu.pb4.armorstandeditor.config.ArmorStandPreset)5