Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/main/java/fr/iglee42/createqualityoflife/CreateQOL.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private void playerJoin(PlayerEvent.PlayerLoggedInEvent event){
ServerPlayer player = (ServerPlayer) p;
if (!p.hasPermissions(1)) return;
if (isActivate(Features.STOCK_MANAGER) && CreateQOLConfigs.server().experimentalWarning.get())
player.displayClientMessage(Component.literal("Warning: Stock Manager is a beta feature, some bugs and crash might appear.\nPlease report them on https://issues-qol.iglee.fr").withStyle(ChatFormatting.YELLOW),false);
player.displayClientMessage(CreateQOLLang.translateDirect("client_message.header").withStyle(ChatFormatting.YELLOW).append(CreateQOLLang.translateDirect("client_message.warning").withStyle(ChatFormatting.WHITE)),false);
}


Expand All @@ -213,7 +213,7 @@ public void onWorldTick(LevelTickEvent.Post event) {
public void itemTooltips(ItemTooltipEvent event){
if (!event.getItemStack().is(Items.FIREWORK_ROCKET)) return;
if (isActivate(Features.SHADOW_RADIANCE) && CreateQOLConfigs.server().equipments.armors.elytraBoostAllowed.get() && CreateQOLConfigs.server().equipments.armors.useFireworksForBoost.get()){
event.getToolTip().add(2,CreateQOLLang.translateDirect("chestplate.use_fireworks").withStyle(ChatFormatting.YELLOW));
event.getToolTip().add(2,CreateQOLLang.translateDirect("armor.ability.use_fireworks").withStyle(ChatFormatting.YELLOW));
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.simibubi.create.content.equipment.armor.BacktankBlock;
import com.simibubi.create.content.equipment.armor.BacktankBlockEntity;
import com.simibubi.create.content.equipment.armor.BacktankItem;
import fr.iglee42.createqualityoflife.CreateQOLLang;
import fr.iglee42.createqualityoflife.blockentitites.RefinedRadianceBacktankBE;
import fr.iglee42.createqualityoflife.blockentitites.ShadowRadianceBacktankBE;
import fr.iglee42.createqualityoflife.config.CreateQOLConfigs;
Expand Down Expand Up @@ -65,7 +66,7 @@ protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Lev
if (level.getBlockEntity(pos) instanceof RefinedRadianceBacktankBE be){
if (!be.hasElytra() && player.getMainHandItem().is(Items.ELYTRA)) {
if (!CreateQOLConfigs.server().equipments.armors.elytraAllowed.get()) {
player.displayClientMessage(Component.literal("Elytra are disabled by the config").withStyle(ChatFormatting.RED), true);
player.displayClientMessage(CreateQOLLang.translateDirect("backtank.elytra_disabled").withStyle(ChatFormatting.RED), true);
level.playSound(null, pos, AllSoundEvents.DENY.getMainEvent(), SoundSource.PLAYERS, 1, 1.45f);
return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.simibubi.create.content.equipment.armor.BacktankBlock;
import com.simibubi.create.content.equipment.armor.BacktankBlockEntity;
import com.simibubi.create.content.equipment.armor.BacktankItem;
import fr.iglee42.createqualityoflife.CreateQOLLang;
import fr.iglee42.createqualityoflife.blockentitites.ShadowRadianceBacktankBE;
import fr.iglee42.createqualityoflife.config.CreateQOLConfigs;
import fr.iglee42.createqualityoflife.items.armors.ShadowRadianceChestplate;
Expand Down Expand Up @@ -75,7 +76,7 @@ protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Lev
if (level.getBlockEntity(pos) instanceof ShadowRadianceBacktankBE be){
if (!be.hasPropeller() && AllItems.PROPELLER.is(player.getMainHandItem().getItem())) {
if (!CreateQOLConfigs.server().equipments.armors.propellerAllowed.get()) {
player.displayClientMessage(Component.literal("Propellers are disabled by the config").withStyle(ChatFormatting.RED), true);
player.displayClientMessage(CreateQOLLang.translateDirect("backtank.propeller_disabled").withStyle(ChatFormatting.RED), true);
level.playSound(null, pos, AllSoundEvents.DENY.getMainEvent(), SoundSource.PLAYERS, 1, 1.45f);
return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
}
Expand All @@ -86,7 +87,7 @@ protected ItemInteractionResult useItemOn(ItemStack stack, BlockState state, Lev
}
if (!be.hasElytra() && player.getMainHandItem().is(Items.ELYTRA)) {
if (!CreateQOLConfigs.server().equipments.armors.elytraAllowed.get()) {
player.displayClientMessage(Component.literal("Elytra are disabled by the config").withStyle(ChatFormatting.RED), true);
player.displayClientMessage(CreateQOLLang.translateDirect("backtank.elytra_disabled").withStyle(ChatFormatting.RED), true);
level.playSound(null, pos, AllSoundEvents.DENY.getMainEvent(), SoundSource.PLAYERS, 1, 1.45f);
return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ protected void renderForeground(GuiGraphics graphics, int mouseX, int mouseY, fl
getExampleStatue().setItemSlot(EquipmentSlot.values()[slot],getMenu().ghostInventory.getStackInSlot(slot));
}
if (!hideBackground){
graphics.drawString(Minecraft.getInstance().font,"Customize your Statue",getGuiLeft() + 5, getGuiTop() + 3,0xffffff);
graphics.drawString(Minecraft.getInstance().font,CreateQOLLang.translateDirect("statue.title"),getGuiLeft() + 5, getGuiTop() + 3,0xffffff);
}

int offsetX = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.simibubi.create.foundation.gui.widget.Indicator;
import com.simibubi.create.foundation.gui.widget.Label;
import com.simibubi.create.foundation.gui.widget.SelectionScrollInput;
import fr.iglee42.createqualityoflife.CreateQOLLang;
import fr.iglee42.createqualityoflife.packets.ConfigureDisplayBoardPacket;
import fr.iglee42.createqualityoflife.registries.QOLGuiTextures;
import net.createmod.catnip.gui.AbstractSimiScreen;
Expand Down Expand Up @@ -67,7 +68,7 @@ protected void init() {
glowingButton.setIcon(glowingIndicator.state == Indicator.State.OFF ? AllIcons.I_FX_SURFACE_ON : AllIcons.I_FX_SURFACE_OFF);
glowingIndicator.state = glowingIndicator.state == Indicator.State.OFF ? Indicator.State.GREEN : Indicator.State.OFF;
});
glowingButton.setToolTip(Component.literal("Glowing"));
glowingButton.setToolTip(CreateQOLLang.translateDirect("gui.display_board.glowing"));

glowingIndicator = new Indicator(guiLeft + 53,guiTop + 64,Component.empty());
glowingIndicator.state = be.glowingLines[lineIndex] ? Indicator.State.GREEN : Indicator.State.OFF;
Expand All @@ -77,10 +78,9 @@ protected void init() {

colorScrollInput = new SelectionScrollInput(guiLeft + 144, guiTop + 49, 55, 16);
colorScrollInputLabel = new Label(guiLeft + 144, guiTop + 52, Component.empty()).withShadow();
colorScrollInput.forOptions(Arrays.stream(DyeColor.values()).map(DyeColor::getSerializedName).map(s->{
String firstLetter = String.valueOf(s.charAt(0)).toUpperCase();
return firstLetter + s.substring(1).replace("_"," ");
}).map(s->Component.literal(s).withStyle(Style.EMPTY.withColor(DyeColor.byName(!s.equals("Black") ?s.replace(" ","_").toLowerCase() : "gray",DyeColor.WHITE).getTextColor()))).toList()).calling(i->{
colorScrollInput.forOptions(Arrays.stream(DyeColor.values()).map(DyeColor::getSerializedName)
.map(s -> Component.translatable("color.minecraft." + s.toLowerCase())
.withStyle(Style.EMPTY.withColor(DyeColor.byName(!s.equals("black") ?s.toLowerCase() : "gray",DyeColor.WHITE).getTextColor()))).toList()).calling(i->{
DyeColor color = DyeColor.byId(i);
colorScrollInputLabel.colored(color != DyeColor.BLACK ? color.getTextColor() : DyeColor.GRAY.getTextColor());
}).writingTo(colorScrollInputLabel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ protected void init() {
ItemConfigButton btn = new ItemConfigButton(guiLeft + 112-28,guiTop + 84, b->Minecraft.getInstance().setScreen(new ItemConfigScreen(40)),40);
btn = btn.showing(player.getInventory().getItem(40));
addRenderableWidget(btn);
int boxWidth = font.width("Choose an item to configure") + 10;
int boxWidth = font.width(Component.translatable("createqol.gui.inventory_config_screen.title")) + 10;
int boxHeight = 19;
int boxPadding = 4;
BoxWidget title = new BoxWidget(width / 2 - boxWidth / 2, height / 2 - 130, boxWidth, boxHeight)
Expand Down Expand Up @@ -101,7 +101,7 @@ protected void renderWindow(GuiGraphics graphics, int mouseX, int mouseY, float
//graphics.fill(guiLeft + 24, guiTop - 2 , guiLeft + 106-24, guiTop + 106,0xff00ff00);
InventoryScreen.renderEntityInInventoryFollowsMouse(graphics, guiLeft + 24, guiTop - 2 , guiLeft + 106-24,guiTop + 106, 48, 0.05F, mouseX, mouseY, this.minecraft.player);

graphics.drawCenteredString(font, "Choose an item to configure", width / 2, height / 2 - 125, UIRenderHelper.COLOR_TEXT_STRONG_ACCENT.getFirst().getRGB());
graphics.drawCenteredString(font, Component.translatable("createqol.gui.inventory_config_screen.title"), width / 2, height / 2 - 125, UIRenderHelper.COLOR_TEXT_STRONG_ACCENT.getFirst().getRGB());
AtomicReference<ItemConfigButton> button = new AtomicReference<>();
children().stream().filter(c->c instanceof ItemConfigButton).map(ItemConfigButton.class::cast).forEach(btn->{
if (btn.isHovered() && btn.active) button.set(btn);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected void init() {
goBack.showingElement(PonderGuiTextures.ICON_CONFIG_BACK.asStencil()
.withElementRenderer(BoxWidget.gradientFactory.apply(goBack)));
goBack.getToolTip()
.add(Component.literal("Go Back"));
.add(Component.translatable("createqol.gui.config_screen.go_back"));
addRenderableWidget(goBack);

if (item.has(QOLDataComponents.ITEM_TOOLTIPS)) list.children().add(new TooltipButtonEntry("Tooltips","Open the config menu to choose which tooltips are displayed"));
Expand Down Expand Up @@ -151,7 +151,7 @@ protected void endFrame() {
protected void renderWindow(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
int x = width / 2;

graphics.drawCenteredString(minecraft.font, Component.literal("Configure " ).append(item.getHoverName()) , x, 15, UIRenderHelper.COLOR_TEXT.getFirst().getRGB());
graphics.drawCenteredString(minecraft.font, Component.translatable("createqol.gui.item_config_screen.title", item.getHoverName()), x, 15, UIRenderHelper.COLOR_TEXT.getFirst().getRGB());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected void init() {
goBack.showingElement(PonderGuiTextures.ICON_CONFIG_BACK.asStencil()
.withElementRenderer(BoxWidget.gradientFactory.apply(goBack)));
goBack.getToolTip()
.add(Component.literal("Go Back"));
.add(Component.translatable("createqol.gui.config_screen.go_back"));
addRenderableWidget(goBack);

ItemTooltips tooltips = item.getOrDefault(QOLDataComponents.ITEM_TOOLTIPS,ItemTooltips.DEFAULT);
Expand All @@ -101,7 +101,7 @@ protected void init() {
enableAll.showingElement(AllIcons.I_CONFIRM.asStencil()
.withElementRenderer(BoxWidget.gradientFactory.apply(enableAll)));
enableAll.getToolTip()
.add(Component.literal("Enable All"));
.add(Component.translatable("createqol.gui.tooltips_config_screen.enable_all"));
addRenderableWidget(enableAll);


Expand All @@ -112,7 +112,7 @@ protected void init() {
disableAll.showingElement(AllIcons.I_DISABLE.asStencil()
.withElementRenderer(BoxWidget.gradientFactory.apply(disableAll)));
disableAll.getToolTip()
.add(Component.literal("Disable All"));
.add(Component.translatable("createqol.gui.tooltips_config_screen.disable_all"));
addRenderableWidget(disableAll);


Expand Down Expand Up @@ -155,7 +155,7 @@ protected void endFrame() {
protected void renderWindow(GuiGraphics graphics, int mouseX, int mouseY, float partialTicks) {
int x = width / 2;

graphics.drawCenteredString(minecraft.font, Component.literal("Configure " ).append(item.getHoverName()).append(" Tooltips") , x, 15, UIRenderHelper.COLOR_TEXT.getFirst().getRGB());
graphics.drawCenteredString(minecraft.font, Component.translatable("createqol.gui.tooltips_config_screen.title", item.getHoverName()), x, 15, UIRenderHelper.COLOR_TEXT.getFirst().getRGB());

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public void initWidgets(int x, int y) {
nameEdit = new EditBox(Minecraft.getInstance().font, x + BASE_OFFSET + LOOP_X + 21, y + 173 - 19 + TEXT_Y_OFFSET,TEXT_BOX_WIDTH - 20,18,CommonComponents.EMPTY);
nameEdit.setBordered(false);
nameEdit.setFocused(false);
nameEdit.setHint(Component.literal("Animation Name"));
nameEdit.setHint(CreateQOLLang.translateDirect("statue.animation.publishName"));
nameEdit.setTooltip(Tooltip.create(CreateQOLLang.translateDirect("statue.name_utility")));

if (animation != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public void initWidgets(int x, int y) {
nameTextBox.setBordered(false);
nameTextBox.setTextColor(0xffffff);
nameTextBox.setFocused(false);
nameTextBox.setHint(Component.literal("Name"));
nameTextBox.setHint(CreateQOLLang.translateDirect("statue.name"));

List<Component> tip = new ArrayList<>();
tip.add(CreateQOLLang.translateDirect("statue.showName"));
Expand All @@ -87,8 +87,8 @@ public void initWidgets(int x, int y) {
showNameButton.green = getExampleStatue().isCustomNameVisible();
showNameButton.getToolTip().clear();
showNameButton.getToolTip().addAll(getExampleStatue().isCustomNameVisible() ? tipEnabled : tip);
showNameLabel = new Label(x + LABEL_X_OFFSET,y + SHOW_NAME_Y + LABEL_Y_OFFSET,Component.literal("Show Name"));
showNameLabel.text = Component.literal("Show Name");
showNameLabel = new Label(x + LABEL_X_OFFSET,y + SHOW_NAME_Y + LABEL_Y_OFFSET,CreateQOLLang.translateDirect("statue.showName"));
showNameLabel.text = CreateQOLLang.translateDirect("statue.showName");

tip.clear();
tip.add(CreateQOLLang.translateDirect("statue.small"));
Expand All @@ -110,8 +110,8 @@ public void initWidgets(int x, int y) {
smallButton.green = getExampleStatue().isSmall();
smallButton.getToolTip().clear();
smallButton.getToolTip().addAll( getExampleStatue().isSmall() ? tipEnabled : tip);
smallLabel = new Label(x + LABEL_X_OFFSET,y + SMALL_Y + LABEL_Y_OFFSET,Component.literal("Small"));
smallLabel.text = Component.literal("Small");
smallLabel = new Label(x + LABEL_X_OFFSET,y + SMALL_Y + LABEL_Y_OFFSET,CreateQOLLang.translateDirect("statue.small"));
smallLabel.text = CreateQOLLang.translateDirect("statue.small");

tip.clear();
tip.add(CreateQOLLang.translateDirect("statue.slimArms"));
Expand All @@ -132,8 +132,8 @@ public void initWidgets(int x, int y) {
slimArmsButton.green = getExampleStatue().isSlimArms();
slimArmsButton.getToolTip().clear();
slimArmsButton.getToolTip().addAll( getExampleStatue().isSlimArms() ? tipEnabled : tip);
slimArmsLabel = new Label(x + LABEL_X_OFFSET,y + SLIM_ARMS_Y + LABEL_Y_OFFSET,Component.literal("Slim Arms"));
slimArmsLabel.text = Component.literal("Slim Arms");
slimArmsLabel = new Label(x + LABEL_X_OFFSET,y + SLIM_ARMS_Y + LABEL_Y_OFFSET,CreateQOLLang.translateDirect("statue.slimArms"));
slimArmsLabel.text = CreateQOLLang.translateDirect("statue.slimArms");

tip.clear();
tip.add(CreateQOLLang.translateDirect("statue.noGravity"));
Expand All @@ -155,8 +155,8 @@ public void initWidgets(int x, int y) {
ngButton.green = getExampleStatue().isNoGravity();
ngButton.getToolTip().clear();
ngButton.getToolTip().addAll( getExampleStatue().isNoGravity() ? tipEnabled : tip);
ngLabel = new Label(x + LABEL_X_OFFSET,y + NO_GRAVITY_Y + LABEL_Y_OFFSET,Component.literal("No Gravity"));
ngLabel.text = Component.literal("No Gravity");
ngLabel = new Label(x + LABEL_X_OFFSET,y + NO_GRAVITY_Y + LABEL_Y_OFFSET,CreateQOLLang.translateDirect("statue.noGravity"));
ngLabel.text = CreateQOLLang.translateDirect("statue.noGravity");

tip.clear();
tip.add(CreateQOLLang.translateDirect("statue.invulnerable"));
Expand All @@ -181,8 +181,8 @@ public void initWidgets(int x, int y) {
invulnerableButton.green = getExampleStatue().isInvulnerable();
invulnerableButton.getToolTip().clear();
invulnerableButton.getToolTip().addAll( getExampleStatue().isInvulnerable() ? tipEnabled : tip);
invulnerableLabel = new Label(x + LABEL_X_OFFSET,y + INVUlNERABLE_Y + LABEL_Y_OFFSET,Component.literal("Invulnerable"));
invulnerableLabel.text = Component.literal("Invulnerable");
invulnerableLabel = new Label(x + LABEL_X_OFFSET,y + INVUlNERABLE_Y + LABEL_Y_OFFSET,CreateQOLLang.translateDirect("statue.invulnerable"));
invulnerableLabel.text = CreateQOLLang.translateDirect("statue.invulnerable");

if (getExampleStatue().hasOwner() && !Minecraft.getInstance().player.getUUID().equals(getExampleStatue().getOwner().get())){
invulnerableButton.active = false;
Expand Down Expand Up @@ -212,8 +212,8 @@ public void initWidgets(int x, int y) {
invisibleButton.green = getExampleStatue().isInvisible();
invisibleButton.getToolTip().clear();
invisibleButton.getToolTip().addAll( getExampleStatue().isInvisible() ? tipEnabled : tip);
invisibleLabel = new Label(x + LABEL_X_OFFSET,y + INVISIBLE_Y + LABEL_Y_OFFSET,Component.literal("Invisible"));
invisibleLabel.text = Component.literal("Invisible");
invisibleLabel = new Label(x + LABEL_X_OFFSET,y + INVISIBLE_Y + LABEL_Y_OFFSET,CreateQOLLang.translateDirect("statue.invisible"));
invisibleLabel.text = CreateQOLLang.translateDirect("statue.invisible");
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public void initWidgets(int x, int y) {
playerSkinTextBox.setBordered(false);
playerSkinTextBox.setTextColor(0xffffff);
playerSkinTextBox.setFocused(false);
playerSkinTextBox.setHint(Component.literal("Player Name"));
playerSkinTextBox.setHint(CreateQOLLang.translateDirect("statue.playerName"));
playerSkinTextBox.setFilter(StringUtil::isValidPlayerName);

partsButtons = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ public void initWidgets(int x, int y) {
scale.withStepFunction(ctx->ctx.control ? 1 : ctx.shift ? 0.5f : 0.1f);
scale.calling(i->{
getExampleStatue().setEntityScale(i);
scale.titled(Component.literal("Scale: " + String.format("%.2f",scale.getState()) ));
scale.titled(CreateQOLLang.translateDirect("statue.scaleScroll", String.format("%.2f", scale.getState())));
getParent().sendUpdatePacket();
});
scale.setState(getExampleStatue().getEntityScale());
scale.titled(Component.literal("Scale: " + String.format("%.2f",scale.getState())));
scale.titled(CreateQOLLang.translateDirect("statue.scaleScroll", String.format("%.2f", scale.getState())));

rotationLabel = new Label(x + 2* BASE_OFFSET, y+88 - LABEL_Y_OFFSET*3,CreateQOLLang.translateDirect("statue.rotation.cape"));
rotationLabel.text = CreateQOLLang.translateDirect("statue.rotation.cape");
Expand Down
Loading
Loading