Skip to content

Commit 38104ab

Browse files
authored
Add NEITHER SteamMode to hide energy cost of recipes (#990)
1 parent f985db2 commit 38104ab

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

src/client/java/aztech/modern_industrialization/compat/viewer/usage/MachineCategory.java

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
import aztech.modern_industrialization.MIText;
3131
import aztech.modern_industrialization.MITooltips;
3232
import aztech.modern_industrialization.compat.rei.machines.MachineCategoryParams;
33+
import aztech.modern_industrialization.compat.rei.machines.SteamMode;
3334
import aztech.modern_industrialization.compat.viewer.abstraction.ViewerCategory;
3435
import aztech.modern_industrialization.inventory.SlotPositions;
3536
import aztech.modern_industrialization.machines.gui.MachineScreen;
@@ -206,9 +207,11 @@ public void buildWidgets(RecipeHolder<MachineRecipe> recipeHolder, WidgetList wi
206207

207208
guiGraphics.pose().popPose();
208209
});
209-
widgets.text(
210-
TextHelper.getEuTextTick(recipe.eu),
211-
15 + (params.steamMode.steam ? 2 : 0), 5, TextAlign.LEFT, false, true, null);
210+
if (params.steamMode != SteamMode.NEITHER) {
211+
widgets.text(
212+
TextHelper.getEuTextTick(recipe.eu),
213+
15 + (params.steamMode.steam ? 2 : 0), 5, TextAlign.LEFT, false, true, null);
214+
}
212215
widgets.text(
213216
MIText.BaseDurationSeconds.text(getSeconds(recipe)),
214217
width - 5, 5, TextAlign.RIGHT, false, true, null);
@@ -235,7 +238,9 @@ public void buildWidgets(RecipeHolder<MachineRecipe> recipeHolder, WidgetList wi
235238
}
236239
// Tooltips
237240
List<Component> tooltips = new ArrayList<>();
238-
tooltips.add(MIText.BaseEuTotal.text(TextHelper.getEuText((long) recipe.duration * recipe.eu)));
241+
if (params.steamMode != SteamMode.NEITHER) {
242+
tooltips.add(MIText.BaseEuTotal.text(TextHelper.getEuText((long) recipe.duration * recipe.eu)));
243+
}
239244
if (params.steamMode.steam) {
240245
tooltips.add((params.steamMode.electric ? MIText.AcceptsSteamToo : MIText.AcceptsSteam).text().withStyle(ChatFormatting.GRAY));
241246
if (steelHatchRequired) {
@@ -251,7 +256,9 @@ public void buildWidgets(RecipeHolder<MachineRecipe> recipeHolder, WidgetList wi
251256
condition.appendDescription(tooltips);
252257
}
253258
}
254-
widgets.tooltip(2, 5, width - 10, 11, tooltips);
259+
if (!tooltips.isEmpty()) {
260+
widgets.tooltip(2, 5, width - 10, 11, tooltips);
261+
}
255262
}
256263

257264
private double getSeconds(MachineRecipe recipe) {

src/main/java/aztech/modern_industrialization/compat/rei/machines/SteamMode.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
public enum SteamMode {
2727
STEAM_ONLY(true, false),
2828
ELECTRIC_ONLY(false, true),
29-
BOTH(true, true);
29+
BOTH(true, true),
30+
NEITHER(false, false);
3031

3132
public final boolean steam;
3233
public final boolean electric;

0 commit comments

Comments
 (0)