Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add active machine mode to the GUI of MultiMapControllers #2671

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
import gregtech.api.gui.widgets.ImageCycleButtonWidget;
import gregtech.api.pattern.TraceabilityPredicate;
import gregtech.api.recipes.RecipeMap;
import gregtech.api.util.GTUtility;
import gregtech.api.util.LocalizationUtils;
import gregtech.api.util.TextComponentUtil;

import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.EntityPlayer;
Expand All @@ -18,7 +20,9 @@
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.util.text.TextFormatting;
import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.Capability;
import net.minecraftforge.fml.relauncher.Side;
Expand Down Expand Up @@ -68,6 +72,19 @@ public boolean onScrewdriverClick(EntityPlayer playerIn, EnumHand hand, EnumFaci
return true; // return true here on the client to keep the GUI closed
}

@Override
protected void addDisplayText(List<ITextComponent> textList) {
MultiblockDisplayText.builder(textList, isStructureFormed())
.setWorkingStatus(recipeMapWorkable.isWorkingEnabled(), recipeMapWorkable.isActive())
.addEnergyUsageLine(recipeMapWorkable.getEnergyContainer())
.addEnergyTierLine(GTUtility.getTierByVoltage(recipeMapWorkable.getMaxVoltage()))
.addParallelsLine(recipeMapWorkable.getParallelLimit())
.addWorkingStatusLine()
.addProgressLine(recipeMapWorkable.getProgressPercent())
.addCustom(tl -> tl.add(TextComponentUtil.translationWithColor(TextFormatting.GRAY,
"gregtech.multiblock.active_machine_mode", getCurrentRecipeMap().getLocalizedName())));
}

@Override
public RecipeMap<?>[] getAvailableRecipeMaps() {
return recipeMaps;
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/gregtech/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -5821,6 +5821,8 @@ gregtech.multiblock.hpca.info_coolant_name=PCB Coolant
gregtech.multiblock.hpca.info_bridging_enabled=Bridging Enabled
gregtech.multiblock.hpca.info_bridging_disabled=Bridging Disabled

gregtech.multiblock.active_machine_mode=Active Machine Mode: %s

gregtech.command.usage=Usage: /gregtech <worldgen/hand/recipecheck/datafix>
gregtech.command.worldgen.usage=Usage: /gregtech worldgen <reload>
gregtech.command.worldgen.reload.usage=Usage: /gregtech worldgen reload
Expand Down
Loading